22#define streql(a, b) (strcmp((a), (b)) == 0)
63#define O2_MAX_PROCNAME_LEN 32
66#define O2_MAX_NAME_LEN 63
68extern void *((*o2_malloc_ptr)(
size_t size));
69extern void ((*o2_free_ptr)(
void *));
88#define O2_MALLOC(x) (*o2_malloc_ptr)(x)
89#define O2_MALLOCNT(n, typ) ((typ *) ((*o2_malloc_ptr)((n) * sizeof(typ))))
92#define O2_MALLOC(x) o2_dbg_malloc(x, __FILE__, __LINE__)
97#define O2_MALLOCNT(n, typ) ((typ *) O2_MALLOC((n) * sizeof(typ)))
101#define O2_MALLOCT(typ) O2_MALLOCNT(1, typ)
107#define O2_FREE(x) (*o2_free_ptr)(x)
109void o2_dbg_free(
void *obj,
const char *file,
int line);
110#define O2_FREE(x) o2_dbg_free(x, __FILE__, __LINE__)
118void *o2_calloc(
size_t n,
size_t s);
119#define O2_CALLOC(n, s) o2_calloc(n, s)
120#define O2_CALLOCNT(n, typ) ((typ *) o2_calloc(n, sizeof(typ)))
122void *
o2_dbg_calloc(
size_t n,
size_t s,
const char *file,
int line);
123#define O2_CALLOC(n, s) o2_dbg_calloc(n, s, __FILE__, __LINE__)
128#define O2_CALLOCNT(n, typ) ((typ *) O2_CALLOC(n, sizeof(typ)))
132#define O2_CALLOCT(typ) O2_CALLOCNT(1, typ)
150void o2_mem_check(
void *ptr);
152#define o2_mem_check(ptr) 0
void o2_sleep(int n)
Suspend for n milliseconds.
Definition: o2sleep.c:46
void * o2_dbg_malloc(size_t size, const char *file, int line)
allocate memory
Definition: o2dbmem.cpp:15
void o2_hex_to_dot(const char *hex, char *dot)
Convert from hex format to dot format IP address.
Definition: hostipimpl.h:156
void * o2_dbg_calloc(size_t n, size_t s, const char *file, int line)
allocate and zero memory (see #O2_MALLOC)
Definition: o2dbmem.cpp:52
unsigned int o2_hex_to_int(const char *hex)
Convert hex string to integer.
Definition: hostipimpl.h:142
void o2_dbg_free(void *obj, const char *file, int line)
free memory allocated by #O2_MALLOC
Definition: o2mem.cpp:157