config: update test config files to current aversive config.in
[aversive.git] / modules / ihm / parse / parse_string.h
1 #ifndef _PARSE_STRING_H_
2 #define _PARSE_STRING_H_
3
4 #include "parse.h"
5
6 /* size of a parsed string */
7 #define STR_TOKEN_SIZE 32
8
9 typedef char fixed_string_t[STR_TOKEN_SIZE];
10
11 struct token_string_data {
12         PGM_P str;
13 };
14
15 struct token_string {
16         struct token_hdr hdr;
17         struct token_string_data string_data;
18 };
19 typedef struct token_string parse_token_string_t;
20
21 extern struct token_ops token_string_ops;
22
23 int8_t parse_string(PGM_P tk, const char * srcbuf, void * res);
24 int8_t complete_get_nb_string(PGM_P tk);
25 int8_t complete_get_elt_string(PGM_P tk, int8_t idx, 
26                                char * dstbuf, uint8_t size);
27 int8_t get_help_string(PGM_P tk, char * dstbuf, uint8_t size);
28
29 #define TOKEN_STRING_INITIALIZER(structure, field, string)  \
30 {                                                           \
31         .hdr = {                                            \
32                 .ops = &token_string_ops,                   \
33                 .offset = offsetof(structure, field),       \
34         },                                                  \
35         .string_data = {                                    \
36                 .str = string,                              \
37         },                                                  \
38 }
39
40 #endif /* _PARSE_STRING_H_ */