X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=src%2Fcpp.h;h=57e9eb5666ab74e6626ed83ae72dd001ff12bd09;hp=ed766e3843b2347547f1a49a54add91dce681c91;hb=e918b10a9b5a8de154d12385665728f7408e5cc7;hpb=a7ac1c0a3c855321f21682c127a4b707de33a303 diff --git a/src/cpp.h b/src/cpp.h index ed766e3..57e9eb5 100644 --- a/src/cpp.h +++ b/src/cpp.h @@ -29,7 +29,7 @@ #include "data.h" #ifndef PSI_CPP_DEBUG -# define PSI_CPP_DEBUG 1 +# define PSI_CPP_DEBUG 0 #endif struct psi_cpp { @@ -39,7 +39,9 @@ struct psi_cpp { struct { struct psi_plist *iter; struct psi_plist *next; + struct psi_plist *exec; } tokens; + HashTable expanding; const char *search; size_t index; unsigned level; @@ -47,10 +49,13 @@ struct psi_cpp { unsigned seen; unsigned expanded; unsigned counter; + unsigned include_level; + bool do_cpp; }; struct psi_cpp *psi_cpp_init(struct psi_parser *parser); -bool psi_cpp_process(struct psi_cpp *cpp, struct psi_plist **tokens); +bool psi_cpp_process(struct psi_cpp *cpp, struct psi_plist **tokens, + struct psi_token *expanding); void psi_cpp_free(struct psi_cpp **cpp_ptr); bool psi_cpp_if(struct psi_cpp *cpp, struct psi_cpp_exp *exp); @@ -68,7 +73,7 @@ bool psi_cpp_include(struct psi_cpp *cpp, const struct psi_token *file, unsigned void psi_cpp_tokiter_reset(struct psi_cpp *cpp); bool psi_cpp_tokiter_seek(struct psi_cpp *cpp, size_t index); #if PSI_CPP_DEBUG > 1 -void psi_cpp_tokiter_dump(int fd, struct psi_cpp *cpp); +void psi_cpp_tokiter_dump(struct psi_dump *dump, struct psi_cpp *cpp); #endif struct psi_token *psi_cpp_tokiter_current(struct psi_cpp *cpp); size_t psi_cpp_tokiter_index(struct psi_cpp *cpp);