X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=src%2Fparser_proc.inc;h=5e2128c13c68b9aee7406acc153cced50ffa9c35;hp=81489d5ff6b88c3f0e22d549de4aa0e9883bad54;hb=ff0048963fcbcddc9de14a3e1c370fcc81d12af7;hpb=5359ad5c181e5772f350fe1cba060cbed3a05b91 diff --git a/src/parser_proc.inc b/src/parser_proc.inc index 81489d5..5e2128c 100644 --- a/src/parser_proc.inc +++ b/src/parser_proc.inc @@ -1,15 +1,34 @@ %include { -#ifdef HAVE_CONFIG_H -# include "config.h" -#else -# include "php_config.h" -#endif +#include "php_psi_stdinc.h" -#include #include -#include -#include #include +#include "plist.h" #include "parser.h" + +/* rename lemon symbols, works better than DEF(%name) */ +#define ParseAlloc psi_parser_proc_init_ex +#define Parse psi_parser_proc_parse +#define ParseTrace psi_parser_proc_trace +#define ParseFree psi_parser_proc_free_ex + +/* fwd decls */ +void *ParseAlloc(void *(*mallocProc)(size_t)); +void ParseFree(void *p, void (*freeProc)(void*)); + +/* wrappers */ +void *psi_parser_proc_init(void) +{ + return ParseAlloc(malloc); +} + +void psi_parser_proc_free(void **parser_proc) +{ + if (*parser_proc) { + ParseFree(*parser_proc, free); + *parser_proc = NULL; + } +} + }