summaryrefslogtreecommitdiff
path: root/src/lib/evas/cserve2/evas_cs2_private.h
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2013-07-29 15:41:23 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2013-10-28 15:47:13 +0900
commit88ef4131a0df0735ebef19306285b4bea608cbab (patch)
treed59961ffc1c7a6253c3e5ac2a2be300d18c94b25 /src/lib/evas/cserve2/evas_cs2_private.h
parent47be3a2b819ed6319a65018195b31b622b547aab (diff)
evas/cserve2: Share paths of index tables with clients
- Send paths to all connected clients - Send paths upon connection from a new client - Client side: - Fast find opened images - Fast find loaded images - Optimize load by skipping socket wait Also, remap indexes when needed (file size changed) When index file grows, the clients are not notified, so they must constantly check that their mapping matches the current array size.
Diffstat (limited to 'src/lib/evas/cserve2/evas_cs2_private.h')
-rw-r--r--src/lib/evas/cserve2/evas_cs2_private.h55
1 files changed, 34 insertions, 21 deletions
diff --git a/src/lib/evas/cserve2/evas_cs2_private.h b/src/lib/evas/cserve2/evas_cs2_private.h
index 6acf6f66d4..a2b897b0de 100644
--- a/src/lib/evas/cserve2/evas_cs2_private.h
+++ b/src/lib/evas/cserve2/evas_cs2_private.h
@@ -4,6 +4,11 @@
4#include "evas_common_private.h" 4#include "evas_common_private.h"
5#include "evas_cs2.h" 5#include "evas_cs2.h"
6 6
7typedef struct _Data_Entry Data_Entry;
8typedef struct _Font_Entry Font_Entry;
9typedef struct _Index_Table Index_Table;
10typedef struct _Shared_Index Shared_Index;
11
7struct _Data_Entry { 12struct _Data_Entry {
8 unsigned int image_id; 13 unsigned int image_id;
9 void (*preloaded_cb)(void *, Eina_Bool); 14 void (*preloaded_cb)(void *, Eina_Bool);
@@ -18,31 +23,39 @@ struct _Data_Entry {
18 } shm; 23 } shm;
19}; 24};
20 25
26struct _Shared_Index {
27 char path[64];
28 Eina_File *f;
29 const Shared_Array_Header *header;
30 union
31 {
32 const Index_Entry *index; // TODO for strings
33 const Image_Data *idata;
34 const File_Data *fdata;
35 // TODO Fonts
36 } entries;
37 int count;
38 Eina_Hash *entries_by_hkey;
39 int last_entry_in_hash;
40};
41
21struct _Index_Table { 42struct _Index_Table {
43 // TODO: use Shared_Index
22 struct { 44 struct {
23 char path[64]; 45 char index_path[64];
24 Eina_File *f; 46 char entries_path[64];
25 const Shared_Array_Header *header; 47 Eina_File *index_file;
26 const File_Data *entries; 48 Eina_File *entries_file;
27 } files; 49 const Shared_Array_Header *index_header;
28 struct { 50 const Index_Entry *indexes;
29 char path[64]; 51 const char *data;
30 Eina_File *f; 52 size_t entries_size;
31 const Shared_Array_Header *header; 53 } strings;
32 const Image_Data *entries; 54 Shared_Index files;
33 } images; 55 Shared_Index images;
34 struct { 56 Shared_Index fonts; // TODO
35 char path[64];
36 Eina_File *f;
37 const Shared_Array_Header *header;
38 const void *entries; // FIXME
39 } fonts;
40}; 57};
41 58
42typedef struct _Data_Entry Data_Entry;
43typedef struct _Font_Entry Font_Entry;
44typedef struct _Index_Table Index_Table;
45
46int evas_cserve2_init(void); 59int evas_cserve2_init(void);
47int evas_cserve2_shutdown(void); 60int evas_cserve2_shutdown(void);
48EAPI int evas_cserve2_use_get(void); 61EAPI int evas_cserve2_use_get(void);