6 EAPI Eobj_Op SIMPLE_BASE_ID = 0;
8 static const Eobj_Class *_my_class = NULL;
11 _a_set(Eobj *obj __UNUSED__, void *class_data, va_list *list)
13 Simple_Public_Data *pd = class_data;
15 a = va_arg(*list, int);
16 printf("%s %d\n", eobj_class_name_get(_my_class), a);
21 _a_print(Eobj *obj __UNUSED__, void *class_data, va_list *list)
23 Simple_Public_Data *pd = class_data;
25 printf("Print %s %d\n", eobj_class_name_get(_my_class), pd->a);
29 _class_constructor(Eobj_Class *klass)
31 const Eobj_Op_Func_Description func_desc[] = {
32 EOBJ_OP_FUNC(SIMPLE_ID(SIMPLE_SUB_ID_A_SET), _a_set),
33 EOBJ_OP_FUNC(SIMPLE_ID(SIMPLE_SUB_ID_A_PRINT), _a_print),
37 eobj_class_funcs_set(klass, func_desc);
41 simple_class_get(void)
43 if (_my_class) return _my_class;
45 static const Eobj_Op_Description op_desc[] = {
46 EOBJ_OP_DESCRIPTION(SIMPLE_SUB_ID_A_SET, "i", "Set property A"),
47 EOBJ_OP_DESCRIPTION(SIMPLE_SUB_ID_A_PRINT, "", "Print property A"),
48 EOBJ_OP_DESCRIPTION_SENTINEL
51 static const Eobj_Class_Description class_desc = {
53 EOBJ_CLASS_TYPE_REGULAR,
54 EOBJ_CLASS_DESCRIPTION_OPS(&SIMPLE_BASE_ID, op_desc, SIMPLE_SUB_ID_LAST),
56 sizeof(Simple_Public_Data),
63 return _my_class = eobj_class_new(&class_desc, EOBJ_CLASS_BASE, NULL);