diff options
Diffstat (limited to 'shared/external.h')
-rw-r--r-- | shared/external.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/shared/external.h b/shared/external.h new file mode 100644 index 0000000..1d7f3b7 --- /dev/null +++ b/shared/external.h @@ -0,0 +1,21 @@ +#ifndef fooexternalhfoo +#define fooexternalhfoo + +/* These need to be defined in the linking binary */ +#define zmalloc(s) __zmalloc(__func__, __LINE__, s) +void *__zmalloc(const char *fn, int line, size_t s); + +#define xstrdup(s) __xstrdup(__func__, __LINE__, s) +char *__xstrdup(const char *fn, int line, const char *s); + +#define xstrndup(s, n) __xstrndup(__func__, __LINE__, s, n) +char *__xstrndup(const char *fn, int line, const char *s, size_t n); + +#define xfree(s) __xfree(__func__, __LINE__, s) +void __xfree(const char *fn, int line, void *ptr); + +void __debug(enum debug_lvl lvl, const char *fmt, ...) _printf_(2, 3); + +void __die(const char *fmt, ...) _printf_(1, 2); + +#endif |