diff options
Diffstat (limited to 'apps/plugins/lib/configfile.h')
-rw-r--r-- | apps/plugins/lib/configfile.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/apps/plugins/lib/configfile.h b/apps/plugins/lib/configfile.h index fcce7de275..7aa69f3ecf 100644 --- a/apps/plugins/lib/configfile.h +++ b/apps/plugins/lib/configfile.h | |||
@@ -38,9 +38,41 @@ struct configdata | |||
38 | }; | 38 | }; |
39 | 39 | ||
40 | void configfile_init(struct plugin_api* newrb); | 40 | void configfile_init(struct plugin_api* newrb); |
41 | |||
42 | /* configfile_save - Given configdata entries this function will | ||
43 | create a config file with these entries, destroying any | ||
44 | previous config file of the same name */ | ||
41 | int configfile_save(const char *filename, struct configdata *cfg, | 45 | int configfile_save(const char *filename, struct configdata *cfg, |
42 | int num_items, int version); | 46 | int num_items, int version); |
47 | |||
43 | int configfile_load(const char *filename, struct configdata *cfg, | 48 | int configfile_load(const char *filename, struct configdata *cfg, |
44 | int num_items, int min_version); | 49 | int num_items, int min_version); |
45 | 50 | ||
51 | /* configfile_get_value - Given a key name, this function will | ||
52 | return the integer value for that key. | ||
53 | |||
54 | Input: | ||
55 | filename = config file filename | ||
56 | name = (name/value) pair name entry | ||
57 | Return: | ||
58 | value if (name/value) pair is found | ||
59 | -1 if entry is not found | ||
60 | */ | ||
61 | int configfile_get_value(const char* filename, const char* name); | ||
62 | |||
63 | /* configure_update_entry - Given a key name and integer value | ||
64 | this function will update the entry if found, or add it if | ||
65 | not found. | ||
66 | |||
67 | Input: | ||
68 | filename = config file filename | ||
69 | name = (name/value) pair name entry | ||
70 | val = new value for (name/value) pair | ||
71 | Return: | ||
72 | 1 if the (name/value) pair was found and updated with the new value | ||
73 | 0 if the (name/value) pair was added as a new entry | ||
74 | -1 if error | ||
75 | */ | ||
76 | int configfile_update_entry(const char* filename, const char* name, int val); | ||
77 | |||
46 | #endif | 78 | #endif |