From 9a2d9b993dc9345dcbfe181882ce7de580c3410f Mon Sep 17 00:00:00 2001 From: "Brendan W. McAdams" Date: Wed, 9 Aug 2000 17:43:04 +0000 Subject: [PATCH] Looks like I found my problem. I was predeclaring my functions in ccvs.h (stupid of me), so PHP was seeing the predec from internal_functions.h, the predec again, and then the actual functions and barfing. Compiles into apache now. Will test further. --- ext/ccvs/ccvs.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++++ ext/ccvs/ccvs.h | 69 ++----------------------------------------------- 2 files changed, 70 insertions(+), 67 deletions(-) diff --git a/ext/ccvs/ccvs.c b/ext/ccvs/ccvs.c index 339508a026..c66ef248e0 100644 --- a/ext/ccvs/ccvs.c +++ b/ext/ccvs/ccvs.c @@ -37,6 +37,74 @@ static char const cvsid[] = "$Id$"; #include #include + + /* + * Create the Zend Internal hash construct to track this modules functions + * + * In case anyone is wondering why we use ccvs_ instead of cv_, + * it's because we are directly importing functions of the actual CCVS, which uses functions that are + * cv_, and we had problems implementing ZEND_NAMED_FE calls (bug in NAMED_FE? investigate + * later). We don't want our PHP calls to conflict with the C calls in the CCVS API. + * + * BWM - 2000.07.27@16.41.EST - Added FALIAS Calls. While I'm of the opinion that naming the + * functions in PHP ccvs_ is much more readable and clear to anyone reading the code than + * cv_, It strikes me that many people coming from php3 -> php4 will need backwards + * compatibility. It was kind of careless to simply change the function calls (There were reasons other + * than readability behind this; the ZEND_NAMED_FE macro was misbehaving) and not provide for + * backwards compatibility - this *IS* an API and should scale with compatibility. + * + */ + + zend_function_entry ccvs_functions[] = { + ZEND_FE(ccvs_init,NULL) + ZEND_FALIAS(cv_init,ccvs_init,NULL) + ZEND_FE(ccvs_done,NULL) + ZEND_FALIAS(cv_done,ccvs_done,NULL) + ZEND_FE(ccvs_new,NULL) + ZEND_FALIAS(cv_new,ccvs_new,NULL) + ZEND_FE(ccvs_add,NULL) + ZEND_FALIAS(cv_add,ccvs_add,NULL) + ZEND_FE(ccvs_delete,NULL) + ZEND_FALIAS(cv_delete,ccvs_delete,NULL) + ZEND_FE(ccvs_auth,NULL) + ZEND_FALIAS(cv_auth,ccvs_auth,NULL) + ZEND_FE(ccvs_return,NULL) + ZEND_FALIAS(cv_return,ccvs_return,NULL) + ZEND_FE(ccvs_reverse,NULL) + ZEND_FALIAS(cv_reverse,ccvs_reverse,NULL) + ZEND_FE(ccvs_sale,NULL) + ZEND_FALIAS(cv_sale,ccvs_sale,NULL) + ZEND_FE(ccvs_void,NULL) + ZEND_FALIAS(cv_void,ccvs_void,NULL) + ZEND_FE(ccvs_status,NULL) + ZEND_FALIAS(cv_status,ccvs_status,NULL) + ZEND_FE(ccvs_count,NULL) + ZEND_FALIAS(cv_count,ccvs_count,NULL) + ZEND_FE(ccvs_lookup,NULL) + ZEND_FALIAS(cv_lookup,ccvs_lookup,NULL) + ZEND_FE(ccvs_report,NULL) + ZEND_FALIAS(cv_report,ccvs_report,NULL) + ZEND_FE(ccvs_command,NULL) + ZEND_FALIAS(cv_command,ccvs_command,NULL) + ZEND_FE(ccvs_textvalue,NULL) + ZEND_FALIAS(cv_textvalue,ccvs_textvalue,NULL) + {NULL,NULL} + }; + +/* End function declarations */ + +/* Zend Engine Exports - module information */ + + /* Declare our module to the Zend engine */ + zend_module_entry ccvs_module_entry = { + "CCVS", + ccvs_functions, + NULL,NULL,NULL,NULL, + PHP_MINFO(ccvs), + STANDARD_MODULE_PROPERTIES + }; + + /* Full Functions (The actual CCVS functions and any internal php hooked functions such as MINFO) */ ZEND_FUNCTION(ccvs_init) /* cv_init() */ diff --git a/ext/ccvs/ccvs.h b/ext/ccvs/ccvs.h index 66406c3e3d..151520b4d7 100644 --- a/ext/ccvs/ccvs.h +++ b/ext/ccvs/ccvs.h @@ -19,6 +19,7 @@ #include + extern zend_module_entry ccvs_module_entry; #define ccvs_module_ptr &ccvs_module_entry #define phpext_ccvs_ptr ccvs_module_ptr @@ -47,73 +48,7 @@ ZEND_FUNCTION(ccvs_report); ZEND_FUNCTION(ccvs_command); ZEND_FUNCTION(ccvs_textvalue); - PHP_MINFO_FUNCTION(ccvs); - - /* - * Create the Zend Internal hash construct to track this modules functions - * - * In case anyone is wondering why we use ccvs_ instead of cv_, - * it's because we are directly importing functions of the actual CCVS, which uses functions that are - * cv_, and we had problems implementing ZEND_NAMED_FE calls (bug in NAMED_FE? investigate - * later). We don't want our PHP calls to conflict with the C calls in the CCVS API. - * - * BWM - 2000.07.27@16.41.EST - Added FALIAS Calls. While I'm of the opinion that naming the - * functions in PHP ccvs_ is much more readable and clear to anyone reading the code than - * cv_, It strikes me that many people coming from php3 -> php4 will need backwards - * compatibility. It was kind of careless to simply change the function calls (There were reasons other - * than readability behind this; the ZEND_NAMED_FE macro was misbehaving) and not provide for - * backwards compatibility - this *IS* an API and should scale with compatibility. - * - */ - - zend_function_entry ccvs_functions[] = { - ZEND_FE(ccvs_init,NULL) - ZEND_FALIAS(cv_init,ccvs_init,NULL) - ZEND_FE(ccvs_done,NULL) - ZEND_FALIAS(cv_done,ccvs_done,NULL) - ZEND_FE(ccvs_new,NULL) - ZEND_FALIAS(cv_new,ccvs_new,NULL) - ZEND_FE(ccvs_add,NULL) - ZEND_FALIAS(cv_add,ccvs_add,NULL) - ZEND_FE(ccvs_delete,NULL) - ZEND_FALIAS(cv_delete,ccvs_delete,NULL) - ZEND_FE(ccvs_auth,NULL) - ZEND_FALIAS(cv_auth,ccvs_auth,NULL) - ZEND_FE(ccvs_return,NULL) - ZEND_FALIAS(cv_return,ccvs_return,NULL) - ZEND_FE(ccvs_reverse,NULL) - ZEND_FALIAS(cv_reverse,ccvs_reverse,NULL) - ZEND_FE(ccvs_sale,NULL) - ZEND_FALIAS(cv_sale,ccvs_sale,NULL) - ZEND_FE(ccvs_void,NULL) - ZEND_FALIAS(cv_void,ccvs_void,NULL) - ZEND_FE(ccvs_status,NULL) - ZEND_FALIAS(cv_status,ccvs_status,NULL) - ZEND_FE(ccvs_count,NULL) - ZEND_FALIAS(cv_count,ccvs_count,NULL) - ZEND_FE(ccvs_lookup,NULL) - ZEND_FALIAS(cv_lookup,ccvs_lookup,NULL) - ZEND_FE(ccvs_report,NULL) - ZEND_FALIAS(cv_report,ccvs_report,NULL) - ZEND_FE(ccvs_command,NULL) - ZEND_FALIAS(cv_command,ccvs_command,NULL) - ZEND_FE(ccvs_textvalue,NULL) - ZEND_FALIAS(cv_textvalue,ccvs_textvalue,NULL) - {NULL,NULL} - }; - - /* End function declarations */ - - /* Zend Engine Exports - module information */ - - /* Declare our module to the Zend engine */ - zend_module_entry ccvs_module_entry = { - "CCVS", - ccvs_functions, - NULL,NULL,NULL,NULL, - PHP_MINFO(ccvs), - STANDARD_MODULE_PROPERTIES - }; + PHP_MINFO_FUNCTION(ccvs); /* Declare the information we need to dynamically link this module later */ #if COMPILE_DL -- 2.40.0