doc
Macros
cynapses libc macro definitions
cynapses libc API (internal)

Macros

#define ARRAY_SIZE(a)   (sizeof(a)/sizeof(a[0]))
 
#define basename(x)   DO_NOT_CALL_MALLOC__USE_C_BASENAME_INSTEAD
 
#define calloc(x, y)   DO_NOT_CALL_CALLOC__USE_C_CALLOC_INSTEAD
 
#define dirname(x)   DO_NOT_CALL_MALLOC__USE_C_DIRNAME_INSTEAD
 
#define INT_TO_POINTER(i)   (void *) i
 
#define malloc(x)   DO_NOT_CALL_MALLOC__USE_C_MALLOC_INSTEAD
 
#define MAX(a, b)   ((a) < (b) ? (b) : (a))
 
#define MIN(a, b)   ((a) < (b) ? (a) : (b))
 
#define POINTER_TO_INT(p)   *((int *) (p))
 
#define realloc(x, y)   DO_NOT_CALL_REALLOC__USE_C_REALLOC_INSTEAD
 
#define SAFE_FREE(x)   do { if ((x) != NULL) {free(x); x=NULL;} } while(0)
 
#define strdup(x)   DO_NOT_CALL_STRDUP__USE_C_STRDUP_INSTEAD
 
#define ZERO_STRUCT(x)   memset((char *)&(x), 0, sizeof(x))
 
#define ZERO_STRUCTP(x)   do { if ((x) != NULL) memset((char *)(x), 0, sizeof(*(x))); } while(0)
 

Detailed Description

Macro Definition Documentation

#define ARRAY_SIZE (   a)    (sizeof(a)/sizeof(a[0]))

Get the size of an array.

Definition at line 88 of file c_macro.h.

#define basename (   x)    DO_NOT_CALL_MALLOC__USE_C_BASENAME_INSTEAD

Definition at line 62 of file c_macro.h.

#define calloc (   x,
 
)    DO_NOT_CALL_CALLOC__USE_C_CALLOC_INSTEAD

Definition at line 47 of file c_macro.h.

#define dirname (   x)    DO_NOT_CALL_MALLOC__USE_C_DIRNAME_INSTEAD

Definition at line 57 of file c_macro.h.

#define INT_TO_POINTER (   i)    (void *) i

Definition at line 69 of file c_macro.h.

#define malloc (   x)    DO_NOT_CALL_MALLOC__USE_C_MALLOC_INSTEAD

Definition at line 42 of file c_macro.h.

#define MAX (   a,
 
)    ((a) < (b) ? (b) : (a))

Get the bigger value.

Definition at line 85 of file c_macro.h.

#define MIN (   a,
 
)    ((a) < (b) ? (a) : (b))

Get the smaller value.

Definition at line 82 of file c_macro.h.

#define POINTER_TO_INT (   p)    *((int *) (p))

Definition at line 70 of file c_macro.h.

#define realloc (   x,
 
)    DO_NOT_CALL_REALLOC__USE_C_REALLOC_INSTEAD

Definition at line 52 of file c_macro.h.

#define SAFE_FREE (   x)    do { if ((x) != NULL) {free(x); x=NULL;} } while(0)

Free memory and zero the pointer.

Definition at line 79 of file c_macro.h.

#define strdup (   x)    DO_NOT_CALL_STRDUP__USE_C_STRDUP_INSTEAD

Definition at line 67 of file c_macro.h.

#define ZERO_STRUCT (   x)    memset((char *)&(x), 0, sizeof(x))

Zero a structure.

Definition at line 73 of file c_macro.h.

#define ZERO_STRUCTP (   x)    do { if ((x) != NULL) memset((char *)(x), 0, sizeof(*(x))); } while(0)

Zero a structure given a pointer to the structure.

Definition at line 76 of file c_macro.h.