13 char *getline_wrapped(FILE *file
, unsigned int *linenum
);
15 void filename2modname(char *modname
, const char *filename
);
16 char *underscores(char *string
);
17 char *my_basename(const char *path
);
19 struct string_table
*strtbl_add(const char *str
, struct string_table
*tbl
);
20 void strtbl_free(struct string_table
*tbl
);
22 const char *next_string(const char *string
, unsigned long *secsize
);
25 * Change endianness of x if conv is true.
27 #define END(x, conv) \
30 if (conv) __swap_bytes(&(x), &(__x), sizeof(__x)); \
35 static inline void __swap_bytes(const void *src
, void *dest
, unsigned int size
)
38 for (i
= 0; i
< size
; i
++)
39 ((unsigned char*)dest
)[i
] = ((unsigned char*)src
)[size
- i
-1];
42 int native_endianness(void);
44 #define streq(a,b) (strcmp((a),(b)) == 0)
45 #define strstarts(a,start) (strncmp((a),(start), strlen(start)) == 0)
47 int regex_match(const char *string
, const char *pattern
);