6 char *getline_wrapped(FILE *file
, unsigned int *linenum
);
8 void filename2modname(char *modname
, const char *filename
);
9 char *underscores(char *string
);
10 char *my_basename(const char *path
);
12 const char *next_string(const char *string
, unsigned long *secsize
);
15 * Change endianness of x if conv is true.
17 #define END(x, conv) \
20 if (conv) __swap_bytes(&(x), &(__x), sizeof(__x)); \
25 static inline void __swap_bytes(const void *src
, void *dest
, unsigned int size
)
28 for (i
= 0; i
< size
; i
++)
29 ((unsigned char*)dest
)[i
] = ((unsigned char*)src
)[size
- i
-1];
32 int native_endianness(void);
34 int elf_ident(void *file
, unsigned long fsize
, int *conv
);
35 void *get_section(void *file
, unsigned long filesize
,
36 const char *secname
, unsigned long *secsize
);
37 void *get_section32(void *file
, unsigned long filesize
,
38 const char *secname
, unsigned long *secsize
, int conv
);
39 void *get_section64(void *file
, unsigned long filesize
,
40 const char *secname
, unsigned long *secsize
, int conv
);
42 #define streq(a,b) (strcmp((a),(b)) == 0)
43 #define strstarts(a,start) (strncmp((a),(start), strlen(start)) == 0)