summaryrefslogtreecommitdiff
path: root/src/lib/eolian/database_event.c
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2014-07-10 12:15:29 +0100
committerDaniel Kolesa <d.kolesa@samsung.com>2014-07-10 12:15:29 +0100
commit37bc20298c10ddfc33e76865309998b8df209506 (patch)
treeffb1c3abb9f6fe7e1762c4664d4a4f11b60c7d4e /src/lib/eolian/database_event.c
parent2ababe8a8985c85f4ce7e5b5ef69cba2abe55400 (diff)
eolian: refactoring: split up eolian_database into individual files
Diffstat (limited to 'src/lib/eolian/database_event.c')
-rw-r--r--src/lib/eolian/database_event.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/lib/eolian/database_event.c b/src/lib/eolian/database_event.c
new file mode 100644
index 0000000..13d0bad
--- /dev/null
+++ b/src/lib/eolian/database_event.c
@@ -0,0 +1,32 @@
1#include <Eina.h>
2#include "eolian_database.h"
3
4Eolian_Event *
5database_event_new(const char *event_name, const char *event_type, const char *event_comment)
6{
7 if (!event_name) return NULL;
8 Eolian_Event *event_desc = calloc(1, sizeof(Eolian_Event));
9 if (!event_desc) return NULL;
10 event_desc->name = eina_stringshare_add(event_name);
11 if (event_type) event_desc->type = eina_stringshare_add(event_type);
12 event_desc->comment = eina_stringshare_add(event_comment);
13 return event_desc;
14}
15
16void
17database_event_free(Eolian_Event *event)
18{
19 eina_stringshare_del(event->name);
20 eina_stringshare_del(event->comment);
21 free(event);
22}
23
24EAPI Eina_Bool
25eolian_class_event_information_get(const Eolian_Event *event, const char **event_name, const char **event_type, const char **event_comment)
26{
27 EINA_SAFETY_ON_NULL_RETURN_VAL(event, EINA_FALSE);
28 if (event_name) *event_name = event->name;
29 if (event_type) *event_type = event->type;
30 if (event_comment) *event_comment = event->comment;
31 return EINA_TRUE;
32}