32 lines
591 B
C
32 lines
591 B
C
#ifndef PARSE_H
|
|
#define PARSE_H
|
|
|
|
#define TOKEN_SZ 64
|
|
|
|
typedef enum {
|
|
T_GROUP,
|
|
T_NAME,
|
|
T_CHAR,
|
|
T_STRING,
|
|
T_INT
|
|
} Token;
|
|
|
|
typedef struct {
|
|
Token token;
|
|
char content[TOKEN_SZ];
|
|
} Tokendata;
|
|
|
|
typedef enum {
|
|
FALSE,
|
|
TRUE
|
|
} bool;
|
|
|
|
int parse(char *content, Tokendata **data);
|
|
int search_token(Token token, char *content, Tokendata *tokens, int token_d_sz);
|
|
int get_value_from_name(Token value_type, char *value, Tokendata *tokens,
|
|
int token_d_sz);
|
|
int get_value_from_name_noerror(Token value_type, char *value,
|
|
Tokendata *tokens, int token_d_sz);
|
|
|
|
#endif
|