summaryrefslogtreecommitdiff
path: root/apps/open_plugin.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/open_plugin.h')
-rw-r--r--apps/open_plugin.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/apps/open_plugin.h b/apps/open_plugin.h
index e1d49bf329..adfb9a75bc 100644
--- a/apps/open_plugin.h
+++ b/apps/open_plugin.h
@@ -41,19 +41,31 @@ enum {
41 OPEN_PLUGIN_LANG_IGNORE = (-2), 41 OPEN_PLUGIN_LANG_IGNORE = (-2),
42 OPEN_PLUGIN_LANG_IGNOREALL = (-3), 42 OPEN_PLUGIN_LANG_IGNOREALL = (-3),
43 OPEN_PLUGIN_NOT_FOUND = (-1), 43 OPEN_PLUGIN_NOT_FOUND = (-1),
44 OPEN_PLUGIN_NEEDS_FLUSHED = (-2) 44 OPEN_PLUGIN_NEEDS_FLUSHED = (-2),
45}; 45};
46 46
47struct open_plugin_entry_t 47struct open_plugin_entry_t
48{ 48{
49/* hash and lang_id need to be the first items */ 49/* hash lang_id checksum need to be the first items */
50 uint32_t hash; 50 uint32_t hash;
51 int32_t lang_id; 51 int32_t lang_id;
52 uint32_t checksum;
52 char name[OPEN_PLUGIN_NAMESZ+1]; 53 char name[OPEN_PLUGIN_NAMESZ+1];
53 /*char key[OPEN_PLUGIN_BUFSZ+1];*/ 54 /*char key[OPEN_PLUGIN_BUFSZ+1];*/
54 char path[OPEN_PLUGIN_BUFSZ+1]; 55 char path[OPEN_PLUGIN_BUFSZ+1];
55 char param[OPEN_PLUGIN_BUFSZ+1]; 56 char param[OPEN_PLUGIN_BUFSZ+1];
56}__attribute__((packed)); 57};
58
59#define OPEN_PLUGIN_CHECKSUM (uint32_t) \
60( \
61 (sizeof(struct open_plugin_entry_t) << 16) + \
62 offsetof(struct open_plugin_entry_t, hash) + \
63 offsetof(struct open_plugin_entry_t, lang_id) + \
64 offsetof(struct open_plugin_entry_t, checksum) + \
65 offsetof(struct open_plugin_entry_t, name) + \
66 /*offsetof(struct open_plugin_entry_t, key)+*/ \
67 offsetof(struct open_plugin_entry_t, path) + \
68 offsetof(struct open_plugin_entry_t, param))
57 69
58inline static void open_plugin_get_hash(const char *key, uint32_t *hash) 70inline static void open_plugin_get_hash(const char *key, uint32_t *hash)
59{ 71{