DGen/SDL
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ckvp.h
Go to the documentation of this file.
1 
21 #ifndef CKVP_H_
22 #define CKVP_H_
23 
24 #include <stddef.h>
25 
26 #ifdef __cplusplus
27 #define CKVP_DECL_BEGIN__ extern "C" {
28 #define CKVP_DECL_END__ }
29 #else
30 #define CKVP_DECL_BEGIN__
31 #define CKVP_DECL_END__
32 #endif
33 
35 
36 #define CKVP_OUT_SIZE 511
37 #define CKVP_OUT_SIZE_STR "511"
38 #define CKVP_INIT { CKVP_NONE, 1, 1, 0x0002, 0, "" }
39 
48 typedef struct {
49  unsigned int state;
50  unsigned int line;
51  unsigned int column;
52  unsigned int internal;
53  size_t out_size;
57  char out[(CKVP_OUT_SIZE + 1)]; /* hack: this +1 saves room for \0 */
58 } ckvp_t;
59 
63 #define CKVP_NONE 0
64 #define CKVP_OUT_FULL 1
65 #define CKVP_OUT_KEY 2
66 #define CKVP_OUT_VALUE 3
67 #define CKVP_ERROR 4
86 extern size_t ckvp_parse(ckvp_t *ckvp, size_t size, const char in[]);
87 
89 
90 #endif /* CKVP_H_ */