ADC Home > Reference Library > Reference > Darwin > Miscellaneous User Space API Reference
|
tools.h |
@defgroup util Memory Utility Routines @ingroup library @{
SNMP_FREE |
#define SNMP_FREE( s) do { if ( s) { free(( void *)s); s=NULL; } } while( 0)
@def SNMP_FREE(s) Frees a pointer only if it is !NULL and sets its value to NULL
SNMP_MALLOC_STRUCT |
#define SNMP_MALLOC_STRUCT( s)
@def SNMP_MALLOC_STRUCT(s) Mallocs memory of sizeof(struct s), zeros it and returns a pointer to it.
SNMP_MALLOC_TYPEDEF |
#define SNMP_MALLOC_TYPEDEF( td)
@def SNMP_MALLOC_TYPEDEF(t) Mallocs memory of sizeof(t), zeros it and returns a pointer to it.
SNMP_MAX |
#define SNMP_MAX( a,b)
@def SNMP_MAX(a, b) Computers the maximum of a and b.
SNMP_MIN |
#define SNMP_MIN( a,b)
@def SNMP_MIN(a, b) Computers the minimum of a and b.
SNMP_SWIPE_MEM |
#define SNMP_SWIPE_MEM( n,s) do { if ( n) free(( void *)n); n = s; s=NULL; } while( 0)
@def SNMP_SWIPE_MEM(n, s) Frees pointer n only if it is !NULL, sets n to s and sets s to NULL
SNMP_ZERO |
#define SNMP_ZERO( s,l) do { if ( s) memset( s, 0, l); } while( 0)
@def SNMP_ZERO(s,l) Zeros l bytes of memory starting at s.