From: Brendan W. McAdams Date: Thu, 5 Oct 2000 18:20:06 +0000 (+0000) Subject: Updated email address to reflect my php.net address. X-Git-Tag: php-4.0.3~56 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5ab813e1b621d249b13dd5445e024037c1bf6087;p=php Updated email address to reflect my php.net address. I am no longer associated with Plexus InterActive (my plexmedia.com address) so the old address is no longer any good. --- diff --git a/ext/ccvs/ccvs.c b/ext/ccvs/ccvs.c index 65eaf8c2ac..93c84bd31f 100644 --- a/ext/ccvs/ccvs.c +++ b/ext/ccvs/ccvs.c @@ -12,21 +12,21 @@ | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ - | Authors: Brendan W. McAdams | + | Authors: Brendan W. McAdams | | Doug DeJulio | +----------------------------------------------------------------------+ - */ -/* + */ +/* * cvvs.c $Revision$ - PHP4 Interface to the RedHat CCVS API * ------- * Interfaces RedHat's CCVS [Credit Card Verification System] * This code is ported from an original php3 interface written by RedHat's Doug DeJulio -* The code was subsequently ported to the Zend API by Brendan W. McAdams +* The code was subsequently ported to the Zend API by Brendan W. McAdams * ------- */ -/* -* Code started on 2000.07.24@09.04.EST by Brendan W. McAdams +/* +* Code started on 2000.07.24@09.04.EST by Brendan W. McAdams * $Revision$ */ @@ -38,21 +38,21 @@ static char const cvsid[] = "$Id$"; #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 + * 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 + * + * 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. - * + * 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. + * */ function_entry ccvs_functions[] = { @@ -101,10 +101,10 @@ static char const cvsid[] = "$Id$"; ccvs_functions, NULL,NULL,NULL,NULL, PHP_MINFO(ccvs), - STANDARD_MODULE_PROPERTIES - }; - - + STANDARD_MODULE_PROPERTIES + }; + + /* Full Functions (The actual CCVS functions and any internal php hooked functions such as MINFO) */ PHP_FUNCTION(ccvs_init) /* cv_init() */ @@ -112,8 +112,8 @@ PHP_FUNCTION(ccvs_init) /* cv_init() */ zval **name; void *vsess; char *p; - - if ((ZEND_NUM_ARGS() != 1) || (zend_get_parameters_ex(1, &name) != SUCCESS)) + + if ((ZEND_NUM_ARGS() != 1) || (zend_get_parameters_ex(1, &name) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */ { WRONG_PARAM_COUNT; @@ -121,33 +121,33 @@ PHP_FUNCTION(ccvs_init) /* cv_init() */ convert_to_string_ex(name); - vsess = cv_init((*name)->value.str.val); - - /* - * -- In the case that we don't run error checking on the return value... -- - * On 32 bit systems a failure of the cv_init call returns 0,0,0,0 ; on 64 bit systems its 0,0,0,0,0,0,0,0 + vsess = cv_init((*name)->value.str.val); + + /* + * -- In the case that we don't run error checking on the return value... -- + * On 32 bit systems a failure of the cv_init call returns 0,0,0,0 ; on 64 bit systems its 0,0,0,0,0,0,0,0 * This unconsistent error (not to mention a string of comma seperated zeros in and of itself) is hard to - * Trap for in PHP (or any language). However, we can also grab cv_init to return CV_SESS_BAD on - * failure at the C API level, and return a set, fixed error code to the user which the user then knows to + * Trap for in PHP (or any language). However, we can also grab cv_init to return CV_SESS_BAD on + * failure at the C API level, and return a set, fixed error code to the user which the user then knows to * trap for... e.g. a NULL Value which PHP can then trap by: * if (!($string = cv_init($config)) { or some such... */ - + if (vsess == CV_SESS_BAD) /* if the cv_init() call failed... */ - { - + { + p = ""; /* set p, the value we will return, to NULL */ - - } + + } else /* we got a valid session returned, which means it worked */ { - + p = hks_ptr_ptrtostring(vsess); /* Convert the (void*) into a string representation. */ - + } - + RETVAL_STRING(p, 1); - + free(p); return; } @@ -228,10 +228,10 @@ PHP_FUNCTION(ccvs_add) /* cv_add() */ } /* -* cv_create can't be implemented because of vararg limits in PHP3's C API. +* cv_create can't be implemented because of vararg limits in PHP3's C API. * (COMMENT BY DDJ [from original code]) * -* BWM: I looked into this, checking in on what cv_create was; it is a deprecated function left in for +* BWM: I looked into this, checking in on what cv_create was; it is a deprecated function left in for * backwards compatibility according * to the CCVS C API ref. I didn't try to implement it for that reason. If anyone needs it, they can add it in * themselves I'm sure. @@ -515,24 +515,24 @@ PHP_FUNCTION(ccvs_textvalue) /* cv_textvalue() */ } /* -* Our Info Function which reports info on this module out to PHP's phpinfo() function -* Brendan W. McAdams on 2000.07.26@16:22.EST +* Our Info Function which reports info on this module out to PHP's phpinfo() function +* Brendan W. McAdams on 2000.07.26@16:22.EST */ PHP_MINFO_FUNCTION(ccvs) { php_info_print_table_start(); php_info_print_table_header(2, "RedHat CCVS support", "enabled"); - php_info_print_table_row(2,"CCVS Support by","Brendan W. McAdams <brendan@plexmedia.com>
& Doug DeJulio <ddj@redhat.com>"); + php_info_print_table_row(2,"CCVS Support by","Brendan W. McAdams <bmcadams@php.net>
& Doug DeJulio <ddj@redhat.com>"); php_info_print_table_row(2,"Release ID",cvsid); php_info_print_table_row(2,"This Release Certified For CCVS Versions","3.0 and greater"); - php_info_print_table_end(); - + php_info_print_table_end(); + /* DISPLAY_INI_ENTRIES(); */ - + /* * In the future, we will probably have entries in php.ini for runtime config, in which case we will * Uncomment the DISPLAY_INI_ENTRIES call... */ - + } diff --git a/ext/ccvs/ccvs.h b/ext/ccvs/ccvs.h index 358d1c2461..5e84cb045c 100644 --- a/ext/ccvs/ccvs.h +++ b/ext/ccvs/ccvs.h @@ -12,25 +12,25 @@ | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ - | Authors: Brendan W. McAdams | + | Authors: Brendan W. McAdams | | Doug DeJulio | +----------------------------------------------------------------------+ -*/ +*/ #include - + extern zend_module_entry ccvs_module_entry; - + #define ccvs_module_ptr &ccvs_module_entry #define phpext_ccvs_ptr ccvs_module_ptr - + /* Declare functions not in cv_api.h but in libccvs.a. */ char *hks_ptr_ptrtostring(void *vptr); void *hks_ptr_stringtoptr(char *str); - + /* Declare the Functions this Module Makes Available to Zend */ - - + + /* Pre-declarations of functions */ PHP_FUNCTION(ccvs_init); PHP_FUNCTION(ccvs_done); @@ -47,13 +47,13 @@ PHP_FUNCTION(ccvs_lookup); PHP_FUNCTION(ccvs_report); PHP_FUNCTION(ccvs_command); - PHP_FUNCTION(ccvs_textvalue); + PHP_FUNCTION(ccvs_textvalue); PHP_MINFO_FUNCTION(ccvs); - + /* Declare the information we need to dynamically link this module later */ #if COMPILE_DL DLEXPORT zend_module_entry *get_module(void) { return &ccvs_module_entry; } #endif - + /* End exports */ - +