struct ElementType { int size; void (*handler )(void* ptr); void (*destructor)(void* ptr); }; struct Element { struct ElementType* type_ptr void* ptr; }; struct NestedLoopList { int length; Element* ptr; int free_ptr; /* 1 when ptr needs to be freed. */ int free_elems; /* 1 when each element of ptr[] needs to be freed and destroyed. */ }; struct NestedLoopArrayArg { struct ElementType* type_ptr; int length; void* ptr; }; struct NestedLoopMixedArg { int length; struct Element* ptr; }; struct NestedLoopFuncArg { void (*ptr)(struct NestedLoopList* list_ptr, void* pad); void* pad; }; struct NestedLoopArg { int ptr_type; /* 0 = array, 1 = mixed array, 2 = func */ union { struct NestedLoopArrayArg array; struct NestedLoopMixedArg mixed; struct NestedLoopFuncArg func; } ptr; };