move around - flatter.
[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 #ifdef __GNUC__
9 # if __GNUC__ >= 4
10 // BROKEN in gcc 4 on amd64
11 //#  pragma GCC visibility push(hidden)
12 # endif
13 #endif
14
15 typedef struct _Eet_String              Eet_String;
16
17 struct _Eet_String
18 {
19   const char            *mmap;
20   char                  *str;
21
22   int                    hash;
23   int                    len;
24
25   int                    next;
26   int                    prev;
27
28   union
29   {
30     float                f;
31     double               d;
32   } convert;
33
34   struct
35   {
36     unsigned int         converted : 1;
37     unsigned int         is_float : 1;
38   } flags;
39 };
40 struct _Eet_Dictionary
41 {
42   Eet_String   *all;
43
44   int           size;
45   int           offset;
46
47   int           hash[256];
48
49   int           count;
50   int           total;
51
52   const char   *start;
53   const char   *end;
54 };
55
56 Eet_Dictionary  *eet_dictionary_add(void);
57 void             eet_dictionary_free(Eet_Dictionary *ed);
58 int              eet_dictionary_string_add(Eet_Dictionary *ed, const char *string);
59 int              eet_dictionary_string_get_size(const Eet_Dictionary *ed, int index);
60 const char      *eet_dictionary_string_get_char(const Eet_Dictionary *ed, int index);
61 int              eet_dictionary_string_get_float(const Eet_Dictionary *ed, int index, float *result);
62 int              eet_dictionary_string_get_double(const Eet_Dictionary *ed, int index, double *result);
63 int              eet_dictionary_string_get_hash(const Eet_Dictionary *ed, int index);
64
65 FILE *_eet_memfile_read_open(const void *data, size_t size);
66 void  _eet_memfile_read_close(FILE *f);
67 FILE *_eet_memfile_write_open(void **data, size_t *size);
68 void  _eet_memfile_write_close(FILE *f);
69 void  _eet_memfile_shutdown(void);
70 int   _eet_hash_gen(const char *key, int hash_size);
71 int   _eet_string_to_double_convert(const char *src, long long *m, long *e);
72 void  _eet_double_to_string_convert(char des[128], double d);
73
74 #ifndef PATH_MAX
75 #define PATH_MAX 4096
76 #endif
77
78 #ifdef DNDEBUG
79 #define EET_ASSERT(Test, Do) if (Test == 0) Do;
80 #else
81 #define EET_ASSERT(Test, Do) if (Test == 0) abort();
82 #endif
83
84 #endif