cvs: php4 /ext/ccvs ccvs.c ccvs.h
| From: | Brendan W. McAdams | Date: | Wed, 09 Aug 2000 17:43:04 +0000 |
| Subject: | cvs: php4 /ext/ccvs ccvs.c ccvs.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-1116@lists.php.net to get a copy of this message | ||
bmcadams Wed Aug 9 10:43:04 2000 EDT
Modified files:
/php4/ext/ccvs ccvs.c ccvs.h
Log:
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.
Index: php4/ext/ccvs/ccvs.c
diff -u php4/ext/ccvs/ccvs.c:1.3 php4/ext/ccvs/ccvs.c:1.4
--- php4/ext/ccvs/ccvs.c:1.3 Tue Aug 8 18:18:28 2000
+++ php4/ext/ccvs/ccvs.c Wed Aug 9 10:43:04 2000
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
/*
-* cvvs.c $Revision: 1.3 $ - PHP4 Interface to the RedHat CCVS API
+* cvvs.c $Revision: 1.4 $ - PHP4 Interface to the RedHat CCVS API
* -------
* Interfaces RedHat's CCVS [Credit Card Verification System] <http://www.redhat.com/products/ccvs/>
* This code is ported from an original php3 interface written by RedHat's Doug DeJulio
<ddj@redhat.com>
@@ -27,16 +27,84 @@
/*
* Code started on 2000.07.24@09.04.EST by Brendan W. McAdams <brendan@plexmedia.com>
-* $Revision: 1.3 $
+* $Revision: 1.4 $
*/
-static char const cvsid[] = "$Id: ccvs.c,v 1.3 2000/08/09 01:18:28 bmcadams Exp $";
+static char const cvsid[] = "$Id: ccvs.c,v 1.4 2000/08/09 17:43:04 bmcadams Exp $";
#include <php.h>
#include <stdlib.h>
#include <string.h>
#include <ccvs.h>
+
+ /*
+ * Create the Zend Internal hash construct to track this modules functions
+ *
+ * In case anyone is wondering why we use ccvs_<action> instead of cv_<action>,
+ * it's because we are directly importing functions of the actual CCVS, which uses functions
that are
+ * cv_<action>, 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_<action> is much more readable and clear to anyone reading the code
than
+ * cv_<action>, 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() */
Index: php4/ext/ccvs/ccvs.h
diff -u php4/ext/ccvs/ccvs.h:1.3 php4/ext/ccvs/ccvs.h:1.4
--- php4/ext/ccvs/ccvs.h:1.3 Tue Aug 8 18:18:28 2000
+++ php4/ext/ccvs/ccvs.h Wed Aug 9 10:43:04 2000
@@ -19,6 +19,7 @@
#include <cv_api.h>
+ 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_<action> instead of cv_<action>,
- * it's because we are directly importing functions of the actual CCVS, which uses functions
that are
- * cv_<action>, 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_<action> is much more readable and clear to anyone reading the
code than
- * cv_<action>, 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