summaryrefslogtreecommitdiff
path: root/shared/external.h
blob: beba93a4a3dce1af779dbb6835c62041efe6f184 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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) _malloc_ _alloc_(3);

#define xstrdup(s) __xstrdup(__func__, __LINE__, s)
char *__xstrdup(const char *fn, int line, const char *s) _malloc_;

#define xstrndup(s, n) __xstrndup(__func__, __LINE__, s, n)
char *__xstrndup(const char *fn, int line, const char *s, size_t n) _malloc_ _alloc_(4);

#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