CVS update: php3/functions

From: Date: Sat, 17 Apr 1999 01:56:26 +0000
Subject: CVS update: php3/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-5105@lists.php.net to get a copy of this message
Date: Friday April 16, 1999 @ 21:56 Author: andrey Update of /repository/php3/functions In directory asf:/u/temp/cvs-serv12430/functions Modified Files: basic_functions.c Log Message: Modified extract() to optionally take only one parameter. Index: php3/functions/basic_functions.c diff -c php3/functions/basic_functions.c:1.259 php3/functions/basic_functions.c:1.260 *** php3/functions/basic_functions.c:1.259 Tue Mar 30 07:43:29 1999 --- php3/functions/basic_functions.c Fri Apr 16 21:56:25 1999 *************** *** 28,34 **** +----------------------------------------------------------------------+ */ ! /* $Id: basic_functions.c,v 1.259 1999/03/30 12:43:29 rasmus Exp $ */ #ifdef THREAD_SAFE #include "tls.h" #endif --- 28,34 ---- +----------------------------------------------------------------------+ */ ! /* $Id: basic_functions.c,v 1.260 1999/04/17 01:56:25 andrey Exp $ */ #ifdef THREAD_SAFE #include "tls.h" #endif *************** *** 2027,2041 **** pval data; char *varname, *finalname; ulong lkey; ! int res; switch(ARG_COUNT(ht)) { case 2: if (getParameters(ht, 2, &var_array, &etype) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long(etype); ! if (etype->value.lval > EXTR_SKIP && etype->value.lval <= EXTR_PREFIX_ALL) { WRONG_PARAM_COUNT; } break; --- 2027,2049 ---- pval data; char *varname, *finalname; ulong lkey; ! int res, extype; switch(ARG_COUNT(ht)) { + case 1: + if (getParameters(ht, 1, &var_array) == FAILURE) { + WRONG_PARAM_COUNT; + } + extype = EXTR_OVERWRITE; + break; + case 2: if (getParameters(ht, 2, &var_array, &etype) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long(etype); ! extype = etype->value.lval; ! if (extype > EXTR_SKIP && extype <= EXTR_PREFIX_ALL) { WRONG_PARAM_COUNT; } break; *************** *** 2044,2049 **** --- 2052,2058 ---- if (getParameters(ht, 3, &var_array, &etype, &prefix) == FAILURE) { WRONG_PARAM_COUNT; } + extype = etype->value.lval; break; default: *************** *** 2051,2057 **** break; } ! if (etype->value.lval < EXTR_OVERWRITE || etype->value.lval > EXTR_PREFIX_ALL) { php3_error(E_WARNING, "Wrong argument in call to extract()"); return; } --- 2060,2066 ---- break; } ! if (extype < EXTR_OVERWRITE || extype > EXTR_PREFIX_ALL) { php3_error(E_WARNING, "Wrong argument in call to extract()"); return; } *************** *** 2077,2083 **** res = _php3_hash_find(GLOBAL(active_symbol_table), varname, strlen(varname)+1, (void**)&exist); ! switch (etype->value.lval) { case EXTR_OVERWRITE: finalname = estrdup(varname); break; --- 2086,2092 ---- res = _php3_hash_find(GLOBAL(active_symbol_table), varname, strlen(varname)+1, (void**)&exist); ! switch (extype) { case EXTR_OVERWRITE: finalname = estrdup(varname); break; -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#5105) next »