Kernel - Slight reworks to timer code
[tpg/acess2.git] / Kernel / include / lib / keyvalue.h
1 /*
2  * Acess2 Kernel
3  * - By John Hodge
4  *
5  * include/keyvalue.h
6  * - Key/Value pair parsing
7  */
8 #ifndef _ACESS_KEYVALUE_H_
9 #define _ACESS_KEYVALUE_H_
10
11 typedef struct sKeyVal_ParseRules       tKeyVal_ParseRules;
12 typedef struct sKeyVal_int_Rule tKeyVal_int_Rule;
13 typedef void (*tKeyVal_UnkCb)(char *String);
14 typedef void (*tKeyVal_KeyCb)(const char *Key, char *Value);
15
16 /**
17  * \brief Handling rule for a key
18  */
19 struct sKeyVal_int_Rule
20 {
21         const char      *Key;
22         const char      *Type;  // Acess printf format, with 'F' being a tKeyVal_KeyCb
23         void    *Data;
24 };
25
26 struct sKeyVal_ParseRules
27 {
28         /**
29          * \brief Function to call when no match is found
30          */
31         tKeyVal_UnkCb   Unknown;
32         tKeyVal_int_Rule        Rules[];
33 };
34
35 /**
36  * \brief Parse a NULL terminated list of strings as Key/Value pairs
37  * \param Rules Parsing rules
38  * \param Strings       Input string list
39  */
40 extern int      KeyVal_ParseNull(tKeyVal_ParseRules *Rules, char **Strings);
41
42 #endif
43

UCC git Repository :: git.ucc.asn.au