CVS update: php3/functions

From: Date: Thu, 04 Feb 1999 03:34:53 +0000
Subject: CVS update: php3/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-3873@lists.php.net to get a copy of this message
Date: Wednesday February 3, 1999 @ 22:34 Author: andrey Update of /repository/php3/functions In directory asf:/u/temp/cvs-serv21204/functions Modified Files: basic_functions.c basic_functions.h Log Message: Added function_exists() and docs for it. Index: php3/functions/basic_functions.c diff -c php3/functions/basic_functions.c:1.256 php3/functions/basic_functions.c:1.257 *** php3/functions/basic_functions.c:1.256 Thu Jan 28 21:39:52 1999 --- php3/functions/basic_functions.c Wed Feb 3 22:34:52 1999 *************** *** 28,34 **** +----------------------------------------------------------------------+ */ ! /* $Id: basic_functions.c,v 1.256 1999/01/29 02:39:52 rasmus Exp $ */ #ifdef THREAD_SAFE #include "tls.h" #endif --- 28,34 ---- +----------------------------------------------------------------------+ */ ! /* $Id: basic_functions.c,v 1.257 1999/02/04 03:34:52 andrey Exp $ */ #ifdef THREAD_SAFE #include "tls.h" #endif *************** *** 319,324 **** --- 319,326 ---- PHP_FE(connection_timeout, NULL) PHP_FE(connection_status, NULL) PHP_FE(ignore_user_abort, NULL) + + PHP_FE(function_exists, NULL) {NULL, NULL, NULL} }; *************** *** 1952,1957 **** --- 1954,1980 ---- pval_copy_constructor(&shutdown_function_name); _php3_hash_next_index_insert(user_shutdown_function_names, &shutdown_function_name, sizeof(pval), NULL); + } + /* }}} */ + + + /* {{{ proto int function_exists(string function_name) + Checks if a given function has been defined */ + PHP_FUNCTION(function_exists) + { + pval *fname; + pval *tmp; + + if (ARG_COUNT(ht)!=1 || getParameters(ht, 1, &fname)==FAILURE) { + WRONG_PARAM_COUNT; + } + + if (_php3_hash_find(&GLOBAL(function_table), fname->value.str.val, + fname->value.str.len+1, (void**)&tmp) == FAILURE) { + RETURN_FALSE; + } else { + RETURN_TRUE; + } } /* }}} */ Index: php3/functions/basic_functions.h diff -c php3/functions/basic_functions.h:1.39 php3/functions/basic_functions.h:1.40 *** php3/functions/basic_functions.h:1.39 Thu Jan 28 21:39:52 1999 --- php3/functions/basic_functions.h Wed Feb 3 22:34:52 1999 *************** *** 29,35 **** */ ! /* $Id: basic_functions.h,v 1.39 1999/01/29 02:39:52 rasmus Exp $ */ #ifndef _BASIC_FUNCTIONS_H #define _BASIC_FUNCTIONS_H --- 29,35 ---- */ ! /* $Id: basic_functions.h,v 1.40 1999/02/04 03:34:52 andrey Exp $ */ #ifndef _BASIC_FUNCTIONS_H #define _BASIC_FUNCTIONS_H *************** *** 101,106 **** --- 101,107 ---- extern void php3_ignore_user_abort(INTERNAL_FUNCTION_PARAMETERS); PHP_FUNCTION(register_shutdown_function); + PHP_FUNCTION(function_exists); #if HAVE_PUTENV typedef struct { -- 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 (#3873) next »