summaryrefslogtreecommitdiff
path: root/legacy/eet/src/lib/Eet_private.h
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2011-12-02 22:50:00 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2011-12-02 22:50:00 +0000
commitccf4af02aa2a341c0a7b121d1fa1417143fc1d65 (patch)
tree51b83b53adc2e1fc35eb63210e5ab2af5e554cc7 /legacy/eet/src/lib/Eet_private.h
parente5cbe139928e2f8cdbadf038cb77c480136cda0f (diff)
unrevert 65828 and unspank myself.
SVN revision: 65832
Diffstat (limited to 'legacy/eet/src/lib/Eet_private.h')
-rw-r--r--legacy/eet/src/lib/Eet_private.h135
1 files changed, 135 insertions, 0 deletions
diff --git a/legacy/eet/src/lib/Eet_private.h b/legacy/eet/src/lib/Eet_private.h
index 83f4c18a63..c04daf0239 100644
--- a/legacy/eet/src/lib/Eet_private.h
+++ b/legacy/eet/src/lib/Eet_private.h
@@ -66,6 +66,126 @@ struct _Eet_Node
66 Eet_Node_Data data; 66 Eet_Node_Data data;
67}; 67};
68 68
69typedef struct _Eet_File_Header Eet_File_Header;
70typedef struct _Eet_File_Node Eet_File_Node;
71typedef struct _Eet_File_Directory Eet_File_Directory;
72
73struct _Eet_File
74{
75 const char *path;
76 Eina_File *readfp;
77 Eet_File_Header *header;
78 Eet_Dictionary *ed;
79 Eet_Key *key;
80 const unsigned char *data;
81 const void *x509_der;
82 const void *signature;
83 void *sha1;
84
85 Eet_File_Mode mode;
86
87 int magic;
88 int references;
89
90 unsigned long int data_size;
91 int x509_length;
92 unsigned int signature_length;
93 int sha1_length;
94
95 Eina_Lock file_lock;
96
97 unsigned char writes_pending : 1;
98 unsigned char delete_me_now : 1;
99};
100
101struct _Eet_File_Header
102{
103 int magic;
104 Eet_File_Directory *directory;
105};
106
107struct _Eet_File_Directory
108{
109 int size;
110 Eet_File_Node **nodes;
111};
112
113struct _Eet_File_Node
114{
115 char *name;
116 void *data;
117 Eet_File_Node *next; /* FIXME: make buckets linked lists */
118
119 unsigned long int offset;
120 unsigned long int dictionary_offset;
121 unsigned long int name_offset;
122
123 unsigned int name_size;
124 unsigned int size;
125 unsigned int data_size;
126
127 unsigned char free_name : 1;
128 unsigned char compression : 1;
129 unsigned char ciphered : 1;
130 unsigned char alias : 1;
131};
132
133#if 0
134/* Version 2 */
135/* NB: all int's are stored in network byte order on disk */
136/* file format: */
137int magic; /* magic number ie 0x1ee7ff00 */
138int num_directory_entries; /* number of directory entries to follow */
139int bytes_directory_entries; /* bytes of directory entries to follow */
140struct
141{
142 int offset; /* bytes offset into file for data chunk */
143 int flags; /* flags - for now 0 = uncompressed and clear, 1 = compressed and clear, 2 = uncompressed and ciphered, 3 = compressed and ciphered */
144 int size; /* size of the data chunk */
145 int data_size; /* size of the (uncompressed) data chunk */
146 int name_size; /* length in bytes of the name field */
147 char name[name_size]; /* name string (variable length) and \0 terminated */
148} directory[num_directory_entries];
149/* and now startes the data stream... */
150#endif /* if 0 */
151
152#if 0
153/* Version 3 */
154/* NB: all int's are stored in network byte order on disk */
155/* file format: */
156int magic; /* magic number ie 0x1ee70f42 */
157int num_directory_entries; /* number of directory entries to follow */
158int num_dictionary_entries; /* number of dictionary entries to follow */
159struct
160{
161 int data_offset; /* bytes offset into file for data chunk */
162 int size; /* size of the data chunk */
163 int data_size; /* size of the (uncompressed) data chunk */
164 int name_offset; /* bytes offset into file for name string */
165 int name_size; /* length in bytes of the name field */
166 int flags; /* bit flags - for now:
167 bit 0 => compresion on/off
168 bit 1 => ciphered on/off
169 bit 2 => alias
170 */
171} directory[num_directory_entries];
172struct
173{
174 int hash;
175 int offset;
176 int size;
177 int prev;
178 int next;
179} dictionary[num_dictionary_entries];
180/* now start the string stream. */
181/* and right after them the data stream. */
182int magic_sign; /* Optional, only if the eet file is signed. */
183int signature_length; /* Signature length. */
184int x509_length; /* Public certificate that signed the file. */
185char signature[signature_length]; /* The signature. */
186char x509[x509_length]; /* The public certificate. */
187#endif /* if 0 */
188
69/* 189/*
70 * variable and macros used for the eina_log module 190 * variable and macros used for the eina_log module
71 */ 191 */
@@ -178,6 +298,21 @@ Eet_Node *
178void 298void
179 eet_node_free(Eet_Node *node); 299 eet_node_free(Eet_Node *node);
180 300
301
302#define GENERIC_ALLOC_FREE_HEADER(TYPE, Type) \
303 TYPE *Type##_malloc(unsigned int); \
304 TYPE *Type##_calloc(unsigned int); \
305 void Type##_mp_free(TYPE *e);
306
307GENERIC_ALLOC_FREE_HEADER(Eet_File_Directory, eet_file_directory);
308GENERIC_ALLOC_FREE_HEADER(Eet_File_Node, eet_file_node);
309GENERIC_ALLOC_FREE_HEADER(Eet_File_Header, eet_file_header);
310GENERIC_ALLOC_FREE_HEADER(Eet_Dictionary, eet_dictionary);
311GENERIC_ALLOC_FREE_HEADER(Eet_File, eet_file);
312
313Eina_Bool eet_mempool_init(void);
314void eet_mempool_shutdown(void);
315
181#ifndef PATH_MAX 316#ifndef PATH_MAX
182# define PATH_MAX 4096 317# define PATH_MAX 4096
183#endif /* ifndef PATH_MAX */ 318#endif /* ifndef PATH_MAX */