openbox/parse.h (raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
#ifndef __parse_h #define __parse_h #include <glib.h> #include "parse.tab.h" typedef enum { TOKEN_REAL = REAL, TOKEN_INTEGER = INTEGER, TOKEN_STRING = STRING, TOKEN_IDENTIFIER = IDENTIFIER, TOKEN_BOOL = BOOL, TOKEN_LIST, TOKEN_LBRACE = '{', TOKEN_RBRACE = '}', TOKEN_EQUALS = '=', TOKEN_COMMA = ',', TOKEN_NEWLINE = '\n' } ParseTokenType; typedef struct { ParseTokenType type; union ParseTokenData data; } ParseToken; typedef void (*ParseFunc)(ParseToken *token); void parse_startup(); void parse_shutdown(); /* Parse the RC file found in parse.yacc */ void parse_rc(); void parse_reg_section(char *section, ParseFunc func); /* Free a parsed token's allocated memory */ void parse_free_token(ParseToken *token); /* Display an error message while parsing. found in parse.yacc */ void yyerror(char *err); #endif |