1 #ifndef _PARSE_STRING_H_
2 #define _PARSE_STRING_H_
6 /* size of a parsed string */
7 #define STR_TOKEN_SIZE 32
9 typedef char fixed_string_t[STR_TOKEN_SIZE];
11 struct token_string_data {
12 const prog_char * str;
17 struct token_string_data string_data;
19 typedef struct token_string parse_token_string_t;
20 struct token_string_pgm {
22 struct token_string_data string_data;
24 typedef struct token_string_pgm parse_pgm_token_string_t;
26 extern struct token_ops token_string_ops;
28 int8_t parse_string(parse_pgm_token_hdr_t * tk, const char * srcbuf, void * res);
29 int8_t complete_get_nb_string(parse_pgm_token_hdr_t * tk);
30 int8_t complete_get_elt_string(parse_pgm_token_hdr_t * tk, int8_t idx,
31 char * dstbuf, uint8_t size);
32 int8_t get_help_string(parse_pgm_token_hdr_t * tk, char * dstbuf, uint8_t size);
34 #define TOKEN_STRING_INITIALIZER(structure, field, string) \
37 .ops = &token_string_ops, \
38 .offset = offsetof(structure, field), \
45 #endif /* _PARSE_STRING_H_ */