1 #pragma ident "%Z%%M% %I% %E% SMI"
11 #define CLEANUP_INIT(x) \
12 struct cleanup cleanup_data[x]; \
13 int cleanup_count = 0;
15 #define CLEANUP_PUSH(x, y) \
16 cleanup_data[cleanup_count].arg = x; \
17 cleanup_data[cleanup_count].func = y; \
20 #define CLEANUP_POP(x) \
21 if ((--cleanup_count) && x && (cleanup_data[cleanup_count].func)) \
22 cleanup_data[cleanup_count].func(cleanup_data[cleanup_count].arg);
24 #define CLEANUP_DONE() \
25 while(cleanup_count--) \
26 if (cleanup_data[cleanup_count].func) \
27 cleanup_data[cleanup_count].func(cleanup_data[cleanup_count].arg);