Eobj: s/__UNUSED__/EINA_UNUSED/ I had no idea that exists.
[profile/ivi/eobj.git] / examples / function_overrides / inherit3.c
1 #include "Eobj.h"
2 #include "simple.h"
3
4 #include "inherit2.h"
5 #include "inherit3.h"
6
7 #include "config.h"
8
9 static const Eobj_Class *_my_class = NULL;
10
11 static void
12 _a_set(Eobj *obj, void *class_data EINA_UNUSED, va_list *list)
13 {
14    int a;
15    a = va_arg(*list, int);
16    printf("%s %d\n", eobj_class_name_get(_my_class), a);
17    eobj_do_super(obj, SIMPLE_A_SET(a + 1));
18 }
19
20 static void
21 _class_constructor(Eobj_Class *klass)
22 {
23    const Eobj_Op_Func_Description func_desc[] = {
24         EOBJ_OP_FUNC(SIMPLE_ID(SIMPLE_SUB_ID_A_SET), _a_set),
25         EOBJ_OP_FUNC_SENTINEL
26    };
27
28    eobj_class_funcs_set(klass, func_desc);
29 }
30
31 const Eobj_Class *
32 inherit3_class_get(void)
33 {
34    if (_my_class) return _my_class;
35
36    static const Eobj_Class_Description class_desc = {
37         "Inherit3",
38         EOBJ_CLASS_TYPE_REGULAR,
39         EOBJ_CLASS_DESCRIPTION_OPS(NULL, NULL, 0),
40         NULL,
41         0,
42         NULL,
43         NULL,
44         _class_constructor,
45         NULL
46    };
47
48    return _my_class = eobj_class_new(&class_desc, INHERIT2_CLASS, NULL);
49 }