The CODING_STANDARDS document recommends the use of the ZEND_* macros instead of the PHP_* ones (point 7). "Use ZEND_* macros instead of PHP_* macros". This patch makes the CODING_STANDARDS, README.EXT_SKEL, and skeleton directory use the ZEND_FE and ZEND_FUNCTION in place of the PHP_ counterparts. This should encourage developers of new extension modules to use the ZEND_ macros in place of the PHP_ ones.
dave == PATCH inlined here == diff -ruNbB ../php-4.2.2.ORIG/CODING_STANDARDS ./CODING_STANDARDS --- ../php-4.2.2.ORIG/CODING_STANDARDS Wed Feb 27 22:31:09 2002 +++ ./CODING_STANDARDS Fri Aug 2 09:56:42 2002 @@ -68,7 +68,7 @@ ------------------ [1] Function names for user-level functions should be enclosed with in - the PHP_FUNCTION() macro. They should be in lowercase, with words + the ZEND_FUNCTION() macro. They should be in lowercase, with words underscore delimited, with care taken to minimize the letter count. Abbreviations should not be used when they greatly decrease the readability of the function name itself. @@ -169,7 +169,7 @@ /* {{{ proto int abs(int number) Returns the absolute value of the number */ -PHP_FUNCTION(abs) +ZEND_FUNCTION(abs) { ... } diff -ruNbB ../php-4.2.2.ORIG/README.EXT_SKEL ./README.EXT_SKEL --- ../php-4.2.2.ORIG/README.EXT_SKEL Wed Aug 1 22:49:23 2001 +++ ./README.EXT_SKEL Fri Aug 2 09:57:37 2002 @@ -148,7 +148,7 @@ /* {{{ proto bool my_drawtext(resource image, string text, resource font, int x, int y[, int color]) */ -PHP_FUNCTION(my_drawtext) +ZEND_FUNCTION(my_drawtext) { zval **image, **text, **font, **x, **y, **color; int argc; diff -ruNbB ../php-4.2.2.ORIG/ext/skeleton/create_stubs ./ext/skeleton/create_stubs --- ../php-4.2.2.ORIG/ext/skeleton/create_stubs Tue Dec 18 03:16:53 2001 +++ ./ext/skeleton/create_stubs Fri Aug 2 09:50:58 2002 @@ -226,7 +226,7 @@ convert(i, j, 1) } - proto = proto closeopts ")\n " fcomments[i] " */\nPHP_FUNCTION(" funcs[i] ")\n{" + proto = proto closeopts ")\n " fcomments[i] " */\nZEND_FUNCTION(" funcs[i] ")\n{" if (maxargs[i]>0) { fetchargs = fetchargs ") == FAILURE)" closefetch " \n\t\treturn;\n" } @@ -254,11 +254,11 @@ print "}\n/* }}} */\n" > stubfile if (stubs) { - h_stubs = h_stubs "PHP_FUNCTION(" funcs[i] ");\n" - c_stubs = c_stubs "\tPHP_FE(" funcs[i] ",\tNULL)\n" + h_stubs = h_stubs "ZEND_FUNCTION(" funcs[i] ");\n" + c_stubs = c_stubs "\tZEND_FE(" funcs[i] ",\tNULL)\n" } else { - print "PHP_FUNCTION(" funcs[i] ");" > extname "/function_declarations" - print "\tPHP_FE(" funcs[i] ",\tNULL)" > extname "/function_entries" + print "ZEND_FUNCTION(" funcs[i] ");" > extname +"/function_declarations" + print "\tZEND_FE(" funcs[i] ",\tNULL)" > extname +"/function_entries" } if (xml) print xmlstr > xmldoc diff -ruNbB ../php-4.2.2.ORIG/ext/skeleton/php_skeleton.h ./ext/skeleton/php_skeleton.h --- ../php-4.2.2.ORIG/ext/skeleton/php_skeleton.h Wed Aug 8 21:47:47 2001 +++ ./ext/skeleton/php_skeleton.h Fri Aug 2 09:51:44 2002 @@ -22,7 +22,7 @@ PHP_RSHUTDOWN_FUNCTION(extname); PHP_MINFO_FUNCTION(extname); -PHP_FUNCTION(confirm_extname_compiled); /* For testing, remove later. */ +ZEND_FUNCTION(confirm_extname_compiled); /* For testing, remove later. */ /* __function_declarations_here__ */ /* diff -ruNbB ../php-4.2.2.ORIG/ext/skeleton/skeleton.c ./ext/skeleton/skeleton.c --- ../php-4.2.2.ORIG/ext/skeleton/skeleton.c Sat Dec 1 16:59:44 2001 +++ ./ext/skeleton/skeleton.c Fri Aug 2 09:54:28 2002 @@ -21,7 +21,7 @@ * Every user visible function must have an entry in extname_functions[]. */ function_entry extname_functions[] = { - PHP_FE(confirm_extname_compiled, NULL) /* For testing, remove later. */ + ZEND_FE(confirm_extname_compiled, NULL) /* For testing, remove +later. */ /* __function_entries_here__ */ {NULL, NULL, NULL} /* Must be the last line in extname_functions[] */ }; @@ -135,7 +135,7 @@ /* Every user-visible function in PHP should document itself in the source */ /* {{{ proto string confirm_extname_compiled(string arg) Return a string to confirm that the module is compiled in */ -PHP_FUNCTION(confirm_extname_compiled) +ZEND_FUNCTION(confirm_extname_compiled) { char *arg = NULL; int arg_len, len; -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php