1
0
Fork 0
forked from len0rd/rockbox

unify pointers to value for configfile, and add TYPE_BOOL type, used by

pictureflow

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19786 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Andrew Mahone 2009-01-17 22:53:12 +00:00
parent 2fecb713ea
commit 0b41f0599f
16 changed files with 120 additions and 91 deletions

View file

@ -24,6 +24,7 @@
#define TYPE_INT 1
#define TYPE_ENUM 2
#define TYPE_STRING 3
#define TYPE_BOOL 4
struct configdata
{
@ -31,12 +32,14 @@ struct configdata
int min; /* Min value for integers, should be 0 for enums */
int max; /* Max value for enums and integers,
buffer size for strings */
int *val; /* Pointer to integer/enum value,
NULL if the item is a string */
union
{
int *int_p;
bool *bool_p;
char *string;
}; /* Pointer to value, a union of the possible types */
char *name; /* Pointer to the name of the item */
char **values; /* List of strings for enums, NULL if not enum */
char *string; /* Pointer to a string buffer if the item is a string,
NULL otherwise */
};
/* configfile_save - Given configdata entries this function will