diff options
author | William Wilgus <wilgus.william@gmail.com> | 2021-10-13 23:45:00 -0400 |
---|---|---|
committer | William Wilgus <wilgus.william@gmail.com> | 2021-10-16 10:18:44 -0400 |
commit | 15ee7400609b0b8837982a2dd388531bc19c06f6 (patch) | |
tree | a6a91ef67057533e61ed718e06863a55a88543c7 /apps/open_plugin.h | |
parent | 6fb942d8ff843444cbade57278de6e6687337fd6 (diff) | |
download | rockbox-15ee7400609b0b8837982a2dd388531bc19c06f6.tar.gz rockbox-15ee7400609b0b8837982a2dd388531bc19c06f6.zip |
Open Plugins search by langids
On language change Stored plugins may fail to run due
to hashing on lang dependent string
allows searching by langid when the supplied key is LANG_PTR
Fixes error on hash flush where previous entry was not restored
Adds routine to update file in-place (for ATA targets)
Other targets make a temp file to copy entries
breaking changes:
ROCKBOXDIR is no longer hashed since
/.rockbox directory may soon be able to be changed
packed attribute added to op data structure -- oops
Change-Id: Ieead26609559b9c5bdadc6a95227cb2bfbb9f71c
Diffstat (limited to 'apps/open_plugin.h')
-rw-r--r-- | apps/open_plugin.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/apps/open_plugin.h b/apps/open_plugin.h index 8c09c4ac58..e1d49bf329 100644 --- a/apps/open_plugin.h +++ b/apps/open_plugin.h | |||
@@ -32,17 +32,28 @@ | |||
32 | #ifndef __PCTOOL__ | 32 | #ifndef __PCTOOL__ |
33 | /* open_plugin path lookup */ | 33 | /* open_plugin path lookup */ |
34 | #define OPEN_PLUGIN_DAT PLUGIN_DIR "/plugin.dat" | 34 | #define OPEN_PLUGIN_DAT PLUGIN_DIR "/plugin.dat" |
35 | #define OPEN_RBPLUGIN_DAT PLUGIN_DIR "/rb_plugins.dat" | ||
35 | #define OPEN_PLUGIN_BUFSZ MAX_PATH | 36 | #define OPEN_PLUGIN_BUFSZ MAX_PATH |
36 | #define OPEN_PLUGIN_NAMESZ 32 | 37 | #define OPEN_PLUGIN_NAMESZ 32 |
38 | |||
39 | enum { | ||
40 | OPEN_PLUGIN_LANG_INVALID = (-1), | ||
41 | OPEN_PLUGIN_LANG_IGNORE = (-2), | ||
42 | OPEN_PLUGIN_LANG_IGNOREALL = (-3), | ||
43 | OPEN_PLUGIN_NOT_FOUND = (-1), | ||
44 | OPEN_PLUGIN_NEEDS_FLUSHED = (-2) | ||
45 | }; | ||
46 | |||
37 | struct open_plugin_entry_t | 47 | struct open_plugin_entry_t |
38 | { | 48 | { |
49 | /* hash and lang_id need to be the first items */ | ||
39 | uint32_t hash; | 50 | uint32_t hash; |
40 | int32_t lang_id; | 51 | int32_t lang_id; |
41 | char name[OPEN_PLUGIN_NAMESZ+1]; | 52 | char name[OPEN_PLUGIN_NAMESZ+1]; |
42 | /*char key[OPEN_PLUGIN_BUFSZ+1];*/ | 53 | /*char key[OPEN_PLUGIN_BUFSZ+1];*/ |
43 | char path[OPEN_PLUGIN_BUFSZ+1]; | 54 | char path[OPEN_PLUGIN_BUFSZ+1]; |
44 | char param[OPEN_PLUGIN_BUFSZ+1]; | 55 | char param[OPEN_PLUGIN_BUFSZ+1]; |
45 | }; | 56 | }__attribute__((packed)); |
46 | 57 | ||
47 | inline static void open_plugin_get_hash(const char *key, uint32_t *hash) | 58 | inline static void open_plugin_get_hash(const char *key, uint32_t *hash) |
48 | { | 59 | { |