Initialize efl-assist
[platform/core/uifw/efl-assist.git] / src / include / efl_assist_private.h
1 /*
2  * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *  Licensed under the Apache License, Version 2.0 (the "License");
5  *  you may not use this file except in compliance with the License.
6  *  You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *  Unless required by applicable law or agreed to in writing, software
11  *  distributed under the License is distributed on an "AS IS" BASIS,
12  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *  See the License for the specific language governing permissions and
14  *  limitations under the License.
15  *
16  */
17
18 #ifndef __EFL_ASSIST_PRIVATE_H__
19 #define __EFL_ASSIST_PRIVATE_H__
20
21 #include <syslog.h>
22 #include <stdio.h>
23 #include <stdlib.h>
24 #include <string.h>
25 #include <strings.h>
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 #ifdef LOG_TAG
32 #undef LOG_TAG
33 #endif
34
35 #define LOG_TAG "efl-assist"
36 #define __CONSTRUCTOR__ __attribute__ ((constructor))
37 #define __DESTRUCTOR__ __attribute__ ((destructor))
38
39 /* eina magic types */
40 #define EA_MAGIC_NONE 0x87657890
41 #define EA_MAGIC_CUTLINK 0x78908765
42
43 typedef unsigned int ea_magic;
44 #define EA_MAGIC                ea_magic __magic
45
46 #define EA_MAGIC_SET(d, m)      (d)->__magic = (m)
47 #define EA_MAGIC_CHECK(d, m)    ((d) && ((d)->__magic == (m)))
48 #define EA_MAGIC_FAIL(d, m, fn) \
49                 _ea_magic_fail((d), (d) ? (d)->__magic : 0, (m), (fn));
50
51 void _ea_magic_fail(const void *d, ea_magic m,
52                     ea_magic req_m, const char *fname);
53
54 #define CRITICAL(...) EINA_LOG_DOM_CRIT(_ea.ea_log_dom, __VA_ARGS__)
55 #define ERR(...)      EINA_LOG_DOM_ERR(_ea.ea_log_dom, __VA_ARGS__)
56 #define WRN(...)      EINA_LOG_DOM_WARN(_ea.ea_log_dom, __VA_ARGS__)
57 #define INF(...)      EINA_LOG_DOM_INFO(_ea.ea_log_dom, __VA_ARGS__)
58 #define DBG(...)      EINA_LOG_DOM_DBG(_ea.ea_log_dom, __VA_ARGS__)
59
60 typedef struct _Ea Ea;
61 typedef struct _Ea_Event_Mgr Ea_Event_Mgr;
62
63 struct _Ea
64 {
65    Eina_List *event_mgrs;
66    int ea_log_dom;
67 };
68
69 extern Ea _ea;
70
71 void ea_event_mgr_clear(Ea_Event_Mgr *event_mgr);
72
73 #ifdef __cplusplus
74 }
75 #endif
76
77 #endif /* __EFL_ASSIST_PRIVATE_H__ */