svn update: 48539 (latest:48959)
[framework/uifw/eet.git] / src / lib / Eet_private.h
1 /*
2  * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
3  */
4
5 #ifndef _EET_PRIVATE_H
6 #define _EET_PRIVATE_H
7
8 #include <Eina.h>
9
10 typedef enum _Eet_Convert_Type Eet_Convert_Type;
11
12 enum _Eet_Convert_Type
13 {
14   EET_D_NOT_CONVERTED = 0,
15   EET_D_FLOAT = 1 << 1,
16   EET_D_DOUBLE = 1 << 2,
17   EET_D_FIXED_POINT = 1 << 4
18 };
19
20 typedef struct _Eet_String              Eet_String;
21
22 struct _Eet_String
23 {
24   const char            *mmap;
25   char                  *str;
26
27   int                    hash;
28   int                    len;
29
30   int                    next;
31   int                    prev;
32
33   float                f;
34   double               d;
35   Eina_F32p32            fp;
36
37   Eet_Convert_Type       type;
38 };
39 struct _Eet_Dictionary
40 {
41   Eet_String   *all;
42
43   int           size;
44   int           offset;
45
46   int           hash[256];
47
48   int           count;
49   int           total;
50
51   const char   *start;
52   const char   *end;
53 };
54
55 struct _Eet_Node
56 {
57    int         type;
58    int         count;
59    const char *name;
60    const char *key;
61    Eet_Node   *values;
62    Eet_Node   *next;
63    Eet_Node   *parent;
64    Eet_Node_Data data;
65 };
66
67 /*
68  * variable and macros used for the eina_log module
69  */
70 extern int _eet_log_dom_global;
71
72 /*
73  * Macros that are used everywhere
74  *
75  * the first four macros are the general macros for the lib
76  */
77 #ifdef EET_DEFAULT_LOG_COLOR
78 # undef EET_DEFAULT_LOG_COLOR
79 #endif
80 #define EET_DEFAULT_LOG_COLOR EINA_COLOR_CYAN
81 #ifdef ERR
82 # undef ERR
83 #endif
84 #define ERR(...) EINA_LOG_DOM_ERR(_eet_log_dom_global, __VA_ARGS__)
85 #ifdef DBG
86 # undef DBG
87 #endif
88 #define DBG(...) EINA_LOG_DOM_DBG(_eet_log_dom_global, __VA_ARGS__)
89 #ifdef INF
90 # undef INF
91 #endif
92 #define INF(...) EINA_LOG_DOM_INFO(_eet_log_dom_global, __VA_ARGS__)
93 #ifdef WRN
94 # undef WRN
95 #endif
96 #define WRN(...) EINA_LOG_DOM_WARN(_eet_log_dom_global, __VA_ARGS__)
97 #ifdef CRIT
98 # undef CRIT
99 #endif
100 #define CRIT(...) EINA_LOG_DOM_CRIT(_eet_log_dom_global, __VA_ARGS__)
101
102 Eet_Dictionary  *eet_dictionary_add(void);
103 void             eet_dictionary_free(Eet_Dictionary *ed);
104 int              eet_dictionary_string_add(Eet_Dictionary *ed, const char *string);
105 int              eet_dictionary_string_get_size(const Eet_Dictionary *ed, int index);
106 const char      *eet_dictionary_string_get_char(const Eet_Dictionary *ed, int index);
107 Eina_Bool        eet_dictionary_string_get_float(const Eet_Dictionary *ed, int index, float *result);
108 Eina_Bool        eet_dictionary_string_get_double(const Eet_Dictionary *ed, int index, double *result);
109 Eina_Bool        eet_dictionary_string_get_fp(const Eet_Dictionary *ed, int index, Eina_F32p32 *result);
110 int              eet_dictionary_string_get_hash(const Eet_Dictionary *ed, int index);
111
112 int   _eet_hash_gen(const char *key, int hash_size);
113
114 const void* eet_identity_check(const void *data_base, unsigned int data_length,
115                                void **sha1, int *sha1_length,
116                                const void *signature_base, unsigned int signature_length,
117                                const void **raw_signature_base, unsigned int *raw_signature_length,
118                                int *x509_length);
119 void *eet_identity_compute_sha1(const void *data_base, unsigned int data_length,
120                                 int *sha1_length);
121 Eet_Error eet_cipher(const void *data, unsigned int size, const char *key, unsigned int length, void **result, unsigned int *result_length);
122 Eet_Error eet_decipher(const void *data, unsigned int size, const char *key, unsigned int length, void **result, unsigned int *result_length);
123 Eet_Error eet_identity_sign(FILE *fp, Eet_Key *key);
124 void eet_identity_unref(Eet_Key *key);
125 void eet_identity_ref(Eet_Key *key);
126
127 void eet_node_shutdown(void);
128 int eet_node_init(void);
129 Eet_Node *eet_node_new(void);
130 void eet_node_free(Eet_Node *node);
131
132 #ifndef PATH_MAX
133 # define PATH_MAX 4096
134 #endif
135
136 #ifdef DNDEBUG
137 # define EET_ASSERT(Test, Do) if (Test == 0) Do;
138 #else
139 # define EET_ASSERT(Test, Do) if (Test == 0) abort();
140 #endif
141
142 #endif