diff options
Diffstat (limited to 'apps/plugins/lib/configfile.h')
-rw-r--r-- | apps/plugins/lib/configfile.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/apps/plugins/lib/configfile.h b/apps/plugins/lib/configfile.h new file mode 100644 index 0000000000..78cc8b1b6c --- /dev/null +++ b/apps/plugins/lib/configfile.h | |||
@@ -0,0 +1,44 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 Linus Nielsen Feltzing | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | #ifndef CONFIGFILE_H | ||
20 | #define CONFIGFILE_H | ||
21 | |||
22 | #define TYPE_INT 1 | ||
23 | #define TYPE_ENUM 2 | ||
24 | #define TYPE_STRING 3 | ||
25 | |||
26 | struct configdata | ||
27 | { | ||
28 | int type; /* See TYPE_ macros above */ | ||
29 | int min; /* Min value for integers, should be 0 for enums */ | ||
30 | int max; /* Max value for enums and integers, | ||
31 | buffer size for strings */ | ||
32 | int *val; /* Pointer to integer/enum value, | ||
33 | NULL if the item is a string */ | ||
34 | char *name; /* Pointer to the name of the item */ | ||
35 | char **values; /* List of strings for enums, NULL if not enum */ | ||
36 | char *string; /* Pointer to a string buffer if the item is a string, | ||
37 | NULL otherwise */ | ||
38 | }; | ||
39 | |||
40 | void configfile_init(struct plugin_api* newrb); | ||
41 | int configfile_save(char *filename, struct configdata *cfg, int num_items); | ||
42 | int configfile_load(char *filename, struct configdata *cfg, int num_items); | ||
43 | |||
44 | #endif | ||