summaryrefslogtreecommitdiff
path: root/src/benchmarks/eo/class_simple.c
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2012-09-26 06:56:52 +0000
committerVincent Torri <vincent.torri@gmail.com>2012-09-26 06:56:52 +0000
commit3b5a3448b7dfc53c2f129bdb04bea9f7a02741a6 (patch)
tree18ad8a6b1841e9832c85a46f887b2cd6d6dacc4b /src/benchmarks/eo/class_simple.c
parent195d31c73fef88cfaa803b07b2ae3cba983a4093 (diff)
merge: add eo
SVN revision: 77072
Diffstat (limited to 'src/benchmarks/eo/class_simple.c')
-rw-r--r--src/benchmarks/eo/class_simple.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/benchmarks/eo/class_simple.c b/src/benchmarks/eo/class_simple.c
new file mode 100644
index 0000000000..2e8dc3f621
--- /dev/null
+++ b/src/benchmarks/eo/class_simple.c
@@ -0,0 +1,50 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include "Eo.h"
6#include "class_simple.h"
7
8#define MY_CLASS SIMPLE_CLASS
9
10EAPI Eo_Op SIMPLE_BASE_ID = 0;
11
12static void
13_a_set(Eo *obj EINA_UNUSED, void *class_data, va_list *list)
14{
15 Simple_Public_Data *pd = class_data;
16 int a;
17 a = va_arg(*list, int);
18
19 pd->a = a;
20}
21
22static void
23_class_constructor(Eo_Class *klass)
24{
25 const Eo_Op_Func_Description func_desc[] = {
26 EO_OP_FUNC(SIMPLE_ID(SIMPLE_SUB_ID_A_SET), _a_set),
27 EO_OP_FUNC_SENTINEL
28 };
29
30 eo_class_funcs_set(klass, func_desc);
31}
32
33static const Eo_Op_Description op_desc[] = {
34 EO_OP_DESCRIPTION(SIMPLE_SUB_ID_A_SET, "Set property A"),
35 EO_OP_DESCRIPTION_SENTINEL
36};
37
38static const Eo_Class_Description class_desc = {
39 EO_VERSION,
40 "Simple",
41 EO_CLASS_TYPE_REGULAR,
42 EO_CLASS_DESCRIPTION_OPS(&SIMPLE_BASE_ID, op_desc, SIMPLE_SUB_ID_LAST),
43 NULL,
44 sizeof(Simple_Public_Data),
45 _class_constructor,
46 NULL
47};
48
49EO_DEFINE_CLASS(simple_class_get, &class_desc, EO_BASE_CLASS, NULL)
50