X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fparse.h;h=d77b6924a3c8539dd9958e6347c2b65166bf3217;hb=95b1cd01669f9867511f9a65ce01e4404e5800b3;hp=9f9eda6d8855edeeba531c7ca8cdaba0a3fa39cc;hpb=8dd9a7c7fb811f633c9e2959fa27c16c7a366f9c;p=chaz%2Fopenbox diff --git a/openbox/parse.h b/openbox/parse.h index 9f9eda6d..d77b6924 100644 --- a/openbox/parse.h +++ b/openbox/parse.h @@ -2,9 +2,7 @@ #define __parse_h #include -#ifndef NO_Y_H -# include "y.tab.h" -#endif +#include "parse.tab.h" typedef enum { TOKEN_REAL = REAL, @@ -12,16 +10,20 @@ typedef enum { TOKEN_STRING = STRING, TOKEN_IDENTIFIER = IDENTIFIER, TOKEN_BOOL = BOOL, - TOKEN_LBRACKET = '(', - TOKEN_RBRACKET = ')', + TOKEN_LIST, TOKEN_LBRACE = '{', TOKEN_RBRACE = '}', - TOKEN_EQUALS = '=', TOKEN_COMMA = ',', TOKEN_NEWLINE = '\n' } ParseTokenType; -typedef void (*ParseFunc)(ParseTokenType type, union ParseToken token); +typedef struct { + ParseTokenType type; + union ParseTokenData data; +} ParseToken; + +typedef void (*ParseFunc)(ParseToken *token); +typedef void (*AssignParseFunc)(char *name, ParseToken *value); void parse_startup(); void parse_shutdown(); @@ -31,11 +33,11 @@ void parse_shutdown(); */ void parse_rc(); -void parse_reg_section(char *section, ParseFunc func); +void parse_reg_section(char *section, ParseFunc func, AssignParseFunc afunc); /* Free a parsed token's allocated memory */ -void parse_free_token(ParseTokenType type, union ParseToken token); +void parse_free_token(ParseToken *token); /* Display an error message while parsing. found in parse.yacc */