summaryrefslogtreecommitdiff
path: root/src/lib/eolian/database_event.c
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2014-07-10 15:31:01 +0100
committerDaniel Kolesa <d.kolesa@samsung.com>2014-07-10 15:31:01 +0100
commit144fd1e2aebf69ed1523d223e9841302c7f47fd2 (patch)
tree0d0552e8274782bf8e29a6749d8bf1a17a146b47 /src/lib/eolian/database_event.c
parent239e7524dc30093466ee7a6c276ac9fe9c1e4d40 (diff)
eolian: refactoring: get rid of Eo_Event_Def
Diffstat (limited to 'src/lib/eolian/database_event.c')
-rw-r--r--src/lib/eolian/database_event.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/lib/eolian/database_event.c b/src/lib/eolian/database_event.c
index 8608880..f51a408 100644
--- a/src/lib/eolian/database_event.c
+++ b/src/lib/eolian/database_event.c
@@ -1,22 +1,12 @@
1#include <Eina.h> 1#include <Eina.h>
2#include "eolian_database.h" 2#include "eolian_database.h"
3 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 4void
17database_event_del(Eolian_Event *event) 5database_event_del(Eolian_Event *event)
18{ 6{
19 eina_stringshare_del(event->name); 7 if (!event) return;
20 eina_stringshare_del(event->comment); 8 if (event->name) eina_stringshare_del(event->name);
9 if (event->type) eina_stringshare_del(event->type);
10 if (event->comment) eina_stringshare_del(event->comment);
21 free(event); 11 free(event);
22} 12}