1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-02-21 17:25:46 +01:00

Remove dependency to CPP: add support for conditional directives

It is now possible to use #ifdef/#ifndef to exclude some part of the
file. The implementation uses a stack to track conditionals so it is
possible to use nested constructs.
This commit is contained in:
Christophe CURIS
2012-06-23 18:18:31 +02:00
committed by Carlos R. Mafra
parent 9b792369cb
commit 4658f4f9a1
3 changed files with 119 additions and 0 deletions

View File

@@ -44,6 +44,16 @@ struct w_menu_parser {
FILE *file_handle;
int line_number;
WParserMacro *macros;
struct {
/* Conditional text parsing is implemented using a stack of the
skip states for each nested #if */
int depth;
struct {
Bool skip;
char name[8];
int line;
} stack[32];
} cond;
char *rd;
char line_buffer[MAXLINE];
};