| 49 |
fprintf(stderr, (fmt), ##__VA_ARGS__); \ |
fprintf(stderr, (fmt), ##__VA_ARGS__); \ |
| 50 |
} while (0) |
} while (0) |
| 51 |
|
|
| 52 |
|
__BEGIN_DECLS |
| 53 |
EXTERN int debug I__(0); |
EXTERN int debug I__(0); |
| 54 |
EXTERN sqlite3 *db I__(NULL); |
EXTERN sqlite3 *db I__(NULL); |
| 55 |
|
|
| 79 |
size_t strlcpy(char *, const char *, size_t); |
size_t strlcpy(char *, const char *, size_t); |
| 80 |
#endif |
#endif |
| 81 |
#endif |
#endif |
| 82 |
|
__END_DECLS |
| 83 |
|
|
| 84 |
|
/* useful stuff */ |
| 85 |
|
#define xmalloc(size) ({ \ |
| 86 |
|
void *xmalloc_ptr; \ |
| 87 |
|
size_t xmalloc_sz = (size); \ |
| 88 |
|
\ |
| 89 |
|
if ((xmalloc_ptr = malloc(xmalloc_sz)) == NULL) \ |
| 90 |
|
err(255, "cannot allocate %zu bytes", \ |
| 91 |
|
xmalloc_sz); \ |
| 92 |
|
(xmalloc_ptr); \ |
| 93 |
|
}) |
| 94 |
|
|
| 95 |
#endif |
#endif |