diff options
| author | Zeev Suraski <zeev@php.net> | 2001-08-06 13:48:51 +0000 |
|---|---|---|
| committer | Zeev Suraski <zeev@php.net> | 2001-08-06 13:48:51 +0000 |
| commit | 609d58a4d6aa63dd7abaf2651cf40f4907b77c1e (patch) | |
| tree | 25fe6f56401a13587ef407ebb1eb96898d348c96 /Zend/zend_ini_parser.y | |
| parent | a35df189b8e6a580261e4cce0339b0f0d2a0d4c3 (diff) | |
| download | php-git-609d58a4d6aa63dd7abaf2651cf40f4907b77c1e.tar.gz | |
Merge from branch - move to standard C scanners in thread safe mode
Diffstat (limited to 'Zend/zend_ini_parser.y')
| -rw-r--r-- | Zend/zend_ini_parser.y | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/Zend/zend_ini_parser.y b/Zend/zend_ini_parser.y index d673316fe8..ea7f6dc0c3 100644 --- a/Zend/zend_ini_parser.y +++ b/Zend/zend_ini_parser.y @@ -35,25 +35,27 @@ #include <winbase.h> #endif - -typedef struct _zend_ini_parser_param { - zend_ini_parser_cb_t ini_parser_cb; - void *arg; -} zend_ini_parser_param; - #define YYSTYPE zval -#define YYPARSE_PARAM ini_parser_param -#define ZEND_INI_PARSER_CB ((zend_ini_parser_param *) ini_parser_param)->ini_parser_cb -#define ZEND_INI_PARSER_ARG ((zend_ini_parser_param *) ini_parser_param)->arg +#ifdef ZTS +#define YYPARSE_PARAM tsrm_ls +#define YYLEX_PARAM tsrm_ls +#endif + +#define ZEND_INI_PARSER_CB (CG(ini_parser_param))->ini_parser_cb +#define ZEND_INI_PARSER_ARG (CG(ini_parser_param))->arg -int ini_lex(zval *ini_lval); -int ini_parse(void *ini_parser_param); +int ini_lex(zval *ini_lval TSRMLS_DC); +#ifdef ZTS +int ini_parse(void *arg); +#else +int ini_parse(void); +#endif zval yylval; #ifndef ZTS -extern int ini_lex(zval *ini_lval); +extern int ini_lex(zval *ini_lval TSRMLS_DC); extern FILE *ini_in; extern int ini_lineno; extern void init_cfg_scanner(void); @@ -147,19 +149,20 @@ static void ini_error(char *str) int zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_errors, zend_ini_parser_cb_t ini_parser_cb, void *arg) { - zend_ini_parser_param ini_parser_param; int retval; + zend_ini_parser_param ini_parser_param; TSRMLS_FETCH(); ini_parser_param.ini_parser_cb = ini_parser_cb; ini_parser_param.arg = arg; + CG(ini_parser_param) = &ini_parser_param; if (zend_ini_open_file_for_scanning(fh TSRMLS_CC)==FAILURE) { return FAILURE; } CG(ini_parser_unbuffered_errors) = unbuffered_errors; - retval = ini_parse(&ini_parser_param); + retval = ini_parse(TSRMLS_C); zend_ini_close_file(fh TSRMLS_CC); |
