comparison include/mb_tools.h @ 235:65cabbdd5284

termporary revision
author Thinker K.F. Li <thinker@branda.to>
date Thu, 25 Dec 2008 18:40:27 +0800
parents 530bb7728546
children bd8ea44b421e
comparison
equal deleted inserted replaced
234:889cdc5f23c5 235:65cabbdd5284
119 } \ 119 } \
120 da->ds[da->num++] = v; \ 120 da->ds[da->num++] = v; \
121 return 0; \ 121 return 0; \
122 } 122 }
123 #define DARRAY_CLEAN(da) do { (da)->num = 0; } while(0) 123 #define DARRAY_CLEAN(da) do { (da)->num = 0; } while(0)
124 #define DARRAY_INIT(da) do { (da)->num = (da)->max = 0; (da)->ds = NULL; } 124 #define DARRAY_INIT(da) \
125 do { (da)->num = (da)->max = 0; (da)->ds = NULL; } while(0)
125 #define DARRAY_DESTROY(da) do { if((da)->ds) free((da)->ds); } while(0) 126 #define DARRAY_DESTROY(da) do { if((da)->ds) free((da)->ds); } while(0)
126 /* @} */ 127 /* @} */
127 128
128 #include <stdlib.h> 129 #include <stdlib.h>
129 130