1 #define MAX(a,b) ((a) > (b) ? (a) : (b))
2 #define MIN(a,b) ((a) < (b) ? (a) : (b))
4 #define new0(type) (calloc(1, sizeof(type)))
6 #define countof(x) (sizeof(x)/sizeof((x)[0]))
8 #define map_get(map, key) ({ \
10 for (i = 0; i < countof(map) && \
11 *((typeof(key)*)&map[i]) != key; i++); \
12 i < countof(map) ? &map[i] : NULL ; \