X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fparse.h;h=3ce5ebbdc3420b1c6cac2a394ba2611530d54418;hb=92d3f2342db3d3bfd5d41a6c3dc165efa7766ffa;hp=3c649db10c5f40aa3f3029342c0b5ef4629357ec;hpb=089a7320ff201080a8aa1b591eacd9be1f88b5c3;p=chaz%2Fopenbox diff --git a/openbox/parse.h b/openbox/parse.h index 3c649db1..3ce5ebbd 100644 --- a/openbox/parse.h +++ b/openbox/parse.h @@ -2,7 +2,9 @@ #define __parse_h #include -#include "y.tab.h" +#ifndef NO_TAB_H +#include "parse.tab.h" +#endif typedef enum { TOKEN_REAL = REAL, @@ -10,16 +12,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(); @@ -29,11 +35,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 */