typedef enum bool
{
true = 1,
false = 0
} bool;
enum { INVALID_FD = -1 };
#define assert_valid(p) assert((p) != nil)
#define fd_isopen(fd) ((fd) >= 0)
#define static_array_length(array) (sizeof(array) / sizeof(array[0]))
/** same as emalloc9p except the content is zeroed */
void *emallocz9p(ulong size);
void *emalloc_fs(ulong size);
void *erealloc_fs(void *p, ulong size);
void *emallocz_fs(ulong size);
char *estrdup_fs(char *str);
#ifdef CPP_DEBUG
#ifdef assert
#undef assert
#endif
#define assert(x) \
if(!(x)) \
{ fprint(2, "%s:%d assertion failed\n", __FILE__, __LINE__); abort(); }
#endif
|