175 #define EX_IMPL(a) impl->cb_##a
178 static int int_new_class(
void);
179 static void int_cleanup(
void);
180 static int int_get_new_index(
int class_index,
long argl,
void *argp,
183 static int int_new_ex_data(
int class_index,
void *
obj,
187 static void int_free_ex_data(
int class_index,
void *
obj,
201 static void impl_check(
void)
205 impl = &impl_default;
210 #define IMPL_CHECK if(!impl) impl_check();
260 return a->class_index - b->class_index;
267 static
int ex_data_check(
void)
279 #define EX_DATA_CHECK(iffail) if(!ex_data && !ex_data_check()) {iffail}
290 static void def_cleanup_cb(
void *a_void)
333 static int def_add_index(
EX_CLASS_ITEM *item,
long argl,
void *argp,
360 toret = item->meth_num++;
370 static int int_new_class(
void)
379 static void int_cleanup(
void)
388 static int int_get_new_index(
int class_index,
long argl,
void *argp,
395 return def_add_index(item, argl, argp, new_func, dup_func, free_func);
402 static int int_new_ex_data(
int class_index,
void *
obj,
420 for(i = 0; i < mx; i++)
425 if((mx > 0) && !storage)
430 for(i = 0; i < mx; i++)
432 if(storage[i] && storage[i]->new_func)
436 storage[i]->argl,storage[i]->argp);
455 if((item = def_get_class(class_index)) == NULL)
467 for(i = 0; i < mx; i++)
472 if((mx > 0) && !storage)
477 for(i = 0; i < mx; i++)
480 if(storage[i] && storage[i]->dup_func)
481 storage[i]->
dup_func(to,from,&ptr,i,
482 storage[i]->argl,storage[i]->argp);
491 static void int_free_ex_data(
int class_index,
void *obj,
498 if((item = def_get_class(class_index)) == NULL)
507 for(i = 0; i < mx; i++)
512 if((mx > 0) && !storage)
517 for(i = 0; i < mx; i++)
519 if(storage[i] && storage[i]->free_func)
523 storage[i]->argl,storage[i]->argp);
565 ret =
EX_IMPL(get_new_index)(class_index,
566 argl, argp, new_func, dup_func,
free_func);
575 return EX_IMPL(new_ex_data)(class_index,
obj, ad);
584 return EX_IMPL(dup_ex_data)(class_index, to, from);