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