cvs: php4 /ext/ctype ctype.c
| From: | Hartmut Holzgraefe | Date: | Mon, 22 Oct 2001 19:36:46 +0000 |
| Subject: | cvs: php4 /ext/ctype ctype.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-7937@lists.php.net to get a copy of this message | ||
hholzgra Mon Oct 22 15:36:46 2001 EDT
Modified files:
/php4/ext/ctype ctype.c
Log:
new-style parameter parsing
Index: php4/ext/ctype/ctype.c
diff -u php4/ext/ctype/ctype.c:1.16 php4/ext/ctype/ctype.c:1.17
--- php4/ext/ctype/ctype.c:1.16 Thu Oct 11 19:32:37 2001
+++ php4/ext/ctype/ctype.c Mon Oct 22 15:36:46 2001
@@ -79,10 +79,6 @@
ZEND_GET_MODULE(ctype)
#endif
-#ifndef PHP_EXPERIMENTAL
-#define PHP_EXPERIMENTAL(x, y)
-#endif
-
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(ctype)
@@ -123,13 +119,12 @@
Checks for alphanumeric character(s) */
PHP_FUNCTION(ctype_alnum)
{
- PHP_EXPERIMENTAL("4.0.4dev", NULL)
- zval **c;
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &c) == FAILURE){
- WRONG_PARAM_COUNT;
- }
+ zval *c;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &c) == FAILURE)
+ return;
- if(ctype(isalnum, c)) {
+ if(ctype(isalnum, &c)) {
RETURN_TRUE;
}
@@ -141,13 +136,12 @@
Checks for alphabetic character(s) */
PHP_FUNCTION(ctype_alpha)
{
- PHP_EXPERIMENTAL("4.0.4dev", NULL)
- zval **c;
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &c) == FAILURE){
- WRONG_PARAM_COUNT;
- }
+ zval *c;
- if(ctype(isalpha, c)) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &c) == FAILURE)
+ return;
+
+ if(ctype(isalpha, &c)) {
RETURN_TRUE;
}
@@ -159,13 +153,12 @@
Checks for control character(s) */
PHP_FUNCTION(ctype_cntrl)
{
- PHP_EXPERIMENTAL("4.0.4dev", NULL)
- zval **c;
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &c) == FAILURE){
- WRONG_PARAM_COUNT;
- }
+ zval *c;
- if(ctype(iscntrl, c)) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &c) == FAILURE)
+ return;
+
+ if(ctype(iscntrl, &c)) {
RETURN_TRUE;
}
@@ -177,13 +170,12 @@
Checks for numeric character(s) */
PHP_FUNCTION(ctype_digit)
{
- PHP_EXPERIMENTAL("4.0.4dev", NULL)
- zval **c;
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &c) == FAILURE){
- WRONG_PARAM_COUNT;
- }
+ zval *c;
- if(ctype(isdigit, c)) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &c) == FAILURE)
+ return;
+
+ if(ctype(isdigit, &c)) {
RETURN_TRUE;
}
@@ -195,13 +187,12 @@
Checks for lowercase character(s) */
PHP_FUNCTION(ctype_lower)
{
- PHP_EXPERIMENTAL("4.0.4dev", NULL)
- zval **c;
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &c) == FAILURE){
- WRONG_PARAM_COUNT;
- }
+ zval *c;
- if(ctype(islower, c)) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &c) == FAILURE)
+ return;
+
+ if(ctype(islower, &c)) {
RETURN_TRUE;
}
@@ -213,13 +204,12 @@
Checks for any printable character(s) except space */
PHP_FUNCTION(ctype_graph)
{
- PHP_EXPERIMENTAL("4.0.4dev", NULL)
- zval **c;
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &c) == FAILURE){
- WRONG_PARAM_COUNT;
- }
+ zval *c;
- if(ctype(isgraph, c)) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &c) == FAILURE)
+ return;
+
+ if(ctype(isgraph, &c)) {
RETURN_TRUE;
}
@@ -231,13 +221,12 @@
Checks for printable character(s) */
PHP_FUNCTION(ctype_print)
{
- PHP_EXPERIMENTAL("4.0.4dev", NULL)
- zval **c;
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &c) == FAILURE){
- WRONG_PARAM_COUNT;
- }
+ zval *c;
- if(ctype(isprint, c)) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &c) == FAILURE)
+ return;
+
+ if(ctype(isprint, &c)) {
RETURN_TRUE;
}
@@ -249,13 +238,12 @@
Checks for any printable character which is not whitespace or an alphanumeric character */
PHP_FUNCTION(ctype_punct)
{
- PHP_EXPERIMENTAL("4.0.4dev", NULL)
- zval **c;
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &c) == FAILURE){
- WRONG_PARAM_COUNT;
- }
+ zval *c;
- if(ctype(ispunct, c)) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &c) == FAILURE)
+ return;
+
+ if(ctype(ispunct, &c)) {
RETURN_TRUE;
}
@@ -267,13 +255,12 @@
Checks for whitespace character(s)*/
PHP_FUNCTION(ctype_space)
{
- PHP_EXPERIMENTAL("4.0.4dev", NULL)
- zval **c;
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &c) == FAILURE){
- WRONG_PARAM_COUNT;
- }
+ zval *c;
- if(ctype(isspace, c)) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &c) == FAILURE)
+ return;
+
+ if(ctype(isspace, &c)) {
RETURN_TRUE;
}
@@ -285,13 +272,12 @@
Checks for uppercase character(s) */
PHP_FUNCTION(ctype_upper)
{
- PHP_EXPERIMENTAL("4.0.4dev", NULL)
- zval **c;
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &c) == FAILURE){
- WRONG_PARAM_COUNT;
- }
+ zval *c;
- if(ctype(isupper, c)) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &c) == FAILURE)
+ return;
+
+ if(ctype(isupper, &c)) {
RETURN_TRUE;
}
@@ -303,13 +289,12 @@
Checks for character(s) representing a hexadecimal digit */
PHP_FUNCTION(ctype_xdigit)
{
- PHP_EXPERIMENTAL("4.0.4dev", NULL)
- zval **c;
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &c) == FAILURE){
- WRONG_PARAM_COUNT;
- }
+ zval *c;
- if(ctype(isxdigit, c)) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &c) == FAILURE)
+ return;
+
+ if(ctype(isxdigit, &c)) {
RETURN_TRUE;
}