libmach.h (979B)
1 2 struct objops { 3 int (*type)(char *); 4 int (*probe)(unsigned char *, char **); 5 6 int (*new)(Obj *, int); 7 void (*del)(Obj *); 8 9 int (*read)(Obj *, FILE *); 10 int (*write)(Obj *, Map *, FILE *); 11 12 int (*strip)(Obj *); 13 int (*pc2line)(Obj *, unsigned long long , char *, int *); 14 15 Map *(*loadmap)(Obj *, FILE *); 16 17 Symbol *(*getsym)(Obj *, int *, Symbol *); 18 Symbol *(*setsym)(Obj *, int *, Symbol *); 19 Section *(*getsec)(Obj *, int *, Section *); 20 Section *(*setsec)(Obj *, int *, Section *); 21 22 int (*setidx)(long, char *[], long[], FILE *); 23 int (*getidx)(long *, char ***, long **, FILE *); 24 }; 25 26 struct map { 27 int n; 28 struct mapsec { 29 char *name; 30 FILE *fp; 31 unsigned long long begin; 32 unsigned long long end; 33 long offset; 34 } sec[]; 35 }; 36 37 /* common functions */ 38 extern int pack(int order, unsigned char *dst, char *fmt, ...); 39 extern int unpack(int order, unsigned char *src, char *fmt, ...); 40 41 /* globals */ 42 extern Objops *objops[]; 43 extern Objops coff32; 44 extern Objops elf64;