75 #define _SAFEMEM_H_DEPRECATED
92 #define INIT(x,y) do { x=(y *)blSafemalloc(sizeof(y)); \
93 if(x != NULL) x->next = NULL; } while(0)
94 #define INITPREV(x,y) do { x=(y *)blSafemalloc(sizeof(y)); \
95 if(x != NULL) {x->next = NULL; x->prev = NULL;} } \
97 #define ALLOCNEXT(x,y) do { (x)->next=(y *)blSafemalloc(sizeof(y)); \
98 if((x)->next != NULL) { (x)->next->next=NULL; } \
100 #define ALLOCNEXTPREV(x,y) do { (x)->next=(y *)blSafemalloc(sizeof(y)); \
101 if((x)->next != NULL) \
102 { (x)->next->prev = (x); \
103 (x)->next->next=NULL; } \
109 #define FREELIST(y,z) while((y)!=NULL) \
110 { z *_freelist_macro_q; \
111 _freelist_macro_q = (y)->next; \
112 blSafefree((char *)(y)); \
113 (y) = _freelist_macro_q; \
115 #define ORDFREELIST(y,z) while((y)!=NULL) \
116 { z *_freelist_macro_q; \
117 _freelist_macro_q = (y)->next; \
119 (y) = _freelist_macro_q; \
132 #define DELETE(x, y, z) \
134 z *_delete_macro_p, \
135 *_delete_macro_prev = NULL, \
136 *_delete_macro_temp, \
137 *_delete_macro_temp2; \
138 if((x)!=NULL && (y)!=NULL) \
140 for(_delete_macro_p=(x); \
141 _delete_macro_p!=NULL; \
142 NEXT(_delete_macro_p)) \
144 if(_delete_macro_p == (y)) \
146 _delete_macro_temp2 = (y)->next; \
147 if(_delete_macro_prev == NULL) \
149 _delete_macro_temp = (x)->next; \
151 (x) = _delete_macro_temp; \
156 _delete_macro_prev->next = _delete_macro_p->next; \
157 blSafefree(_delete_macro_p); \
160 _delete_macro_prev = _delete_macro_p; \
162 (y) = _delete_macro_temp2; \
166 #define SAFEINIT(x,y) INIT(x,y)
167 #define SAFEINITPREV(x,y) INITPREV(x,y)
168 #define SAFEALLOCNEXT(x,y) ALLOCNEXT(x,y)
169 #define SAFEALLOCNEXTPREV(x,y) ALLOCNEXTPREV(x,y)
170 #define SAFEFREELIST(y,z) FREELIST(y,z)
171 #define SAFEDELETE(x, y, z) DELETE(x, y, z)
Redirect calls to deprecated functions.
void * blSafemalloc(int nbytes)
System-type variable type definitions.
BOOL blSafefree(void *ptr)