| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
#ifndef _COMPAT_H |
| 7 |
#define _COMPAT_H |
| 8 |
|
| 9 |
|
| 10 |
#define TRUE true |
| 11 |
#define FALSE false |
| 12 |
#define FMT64 PRId64 |
| 13 |
#define FMT64U PRIu64 |
| 14 |
|
| 15 |
|
| 16 |
#ifndef MIN |
| 17 |
#define MIN(x, y) ((x) < (y) ? (x) : (y)) |
| 18 |
#endif |
| 19 |
#ifndef MAX |
| 20 |
#define MAX(x, y) ((x) > (y) ? (x) : (y)) |
| 21 |
#endif |
| 22 |
|
| 23 |
#define safe_strncpy strlcpy |
| 24 |
#define strcasestr_local strcasestr |
| 25 |
#define strdup_local strdup |
| 26 |
|
| 27 |
#define CALLOC(x, y) calloc(x, y) |
| 28 |
#define object_decrease_nrof_by_one(xyz) object_decrease_nrof(xyz, 1) |
| 29 |
|
| 30 |
void safe_strcat(char *dest, const char *orig, size_t *curlen, size_t maxlen); |
| 31 |
|
| 32 |
#ifndef HAVE_STRCASESTR |
| 33 |
char *strcasestr(const char *s, const char *find); |
| 34 |
#endif |
| 35 |
|
| 36 |
#ifndef HAVE_STRDUP |
| 37 |
char *strdup(const char *str); |
| 38 |
#endif |
| 39 |
|
| 40 |
#ifndef HAVE_STRLCPY |
| 41 |
size_t strlcpy(char *dst, const char *src, size_t size); |
| 42 |
#endif |
| 43 |
|
| 44 |
#ifndef HAVE_TEMPNAM |
| 45 |
char *tempnam(const char *tmpdir, const char *prefix); |
| 46 |
#endif |
| 47 |
|
| 48 |
#endif |