Justtechjobs.com Find a programming school near you






Online Campus Both


php4-beta | 199912

[PHP4BETA] cvs: /php4/ext/standard string.c From: Thies C. Arntzen (thies <email protected>)
Date: 12/23/99

thies Thu Dec 23 09:59:31 1999 EDT

  Modified files:
    /php4/ext/standard string.c
  Log:
  pval->zval
  
  
Index: php4/ext/standard/string.c
diff -u php4/ext/standard/string.c:1.80 php4/ext/standard/string.c:1.81
--- php4/ext/standard/string.c:1.80 Thu Dec 23 09:55:50 1999
+++ php4/ext/standard/string.c Thu Dec 23 09:59:01 1999
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: string.c,v 1.80 1999/12/23 14:55:50 thies Exp $ */
+/* $Id: string.c,v 1.81 1999/12/23 14:59:01 thies Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -62,7 +62,7 @@
    converts the binary representation of data to hex */
 PHP_FUNCTION(bin2hex)
 {
- pval **data;
+ zval **data;
         char *new;
         size_t newlen;
 
@@ -116,7 +116,7 @@
 }
 /* }}} */
 
-PHPAPI void php_trim(pval *str, pval * return_value, int mode)
+PHPAPI void php_trim(zval *str, zval * return_value, int mode)
 /* mode 1 : trim left
    mode 2 : trim right
    mode 3 : trim left and right
@@ -160,7 +160,7 @@
    Remove trailing whitespace */
 PHP_FUNCTION(chop)
 {
- pval **str;
+ zval **str;
         
         if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &str) == FAILURE) {
                 WRONG_PARAM_COUNT;
@@ -179,7 +179,7 @@
    Strip whitespace from the beginning and end of a string */
 PHP_FUNCTION(trim)
 {
- pval **str;
+ zval **str;
         
         if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &str) == FAILURE) {
                 WRONG_PARAM_COUNT;
@@ -198,7 +198,7 @@
    Strip whitespace from the beginning of a string */
 PHP_FUNCTION(ltrim)
 {
- pval **str;
+ zval **str;
         
         if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &str) == FAILURE) {
                 WRONG_PARAM_COUNT;
@@ -212,7 +212,7 @@
 }
 /* }}} */
 
-PHPAPI void php_explode(pval *delim, pval *str, pval *return_value)
+PHPAPI void php_explode(zval *delim, zval *str, zval *return_value)
 {
         char *p1, *p2, *endp;
         int i = 0;
@@ -240,7 +240,7 @@
    Split a string on string separator and return array of components */
 PHP_FUNCTION(explode)
 {
- pval **str, **delim;
+ zval **str, **delim;
 
         if (ARG_COUNT(ht) != 2 || zend_get_parameters_ex(2, &delim, &str) == FAILURE) {
                 WRONG_PARAM_COUNT;
@@ -266,9 +266,9 @@
 /* {{{ proto string join(array src, string glue)
    An alias for implode */
 /* }}} */
-PHPAPI void php_implode(pval *delim, pval *arr, pval *return_value)
+PHPAPI void php_implode(zval *delim, zval *arr, zval *return_value)
 {
- pval **tmp;
+ zval **tmp;
         int len = 0, count = 0, target = 0;
 
         /* convert everything to strings, and calculate length */
@@ -309,7 +309,7 @@
    Join array elements placing glue string between items and return one string */
 PHP_FUNCTION(implode)
 {
- pval **arg1, **arg2, *delim, *arr;
+ zval **arg1, **arg2, *delim, *arr;
         
         if (ARG_COUNT(ht) != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) {
                 WRONG_PARAM_COUNT;
@@ -338,7 +338,7 @@
    Tokenize a string */
 PHP_FUNCTION(strtok)
 {
- pval **str, **tok;
+ zval **str, **tok;
         char *token = NULL, *tokp=NULL;
         char *first = NULL;
         int argc;
@@ -410,7 +410,7 @@
    Make a string uppercase */
 PHP_FUNCTION(strtoupper)
 {
- pval **arg;
+ zval **arg;
         
         if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &arg)) {
                 WRONG_PARAM_COUNT;
@@ -442,7 +442,7 @@
    Make a string lowercase */
 PHP_FUNCTION(strtolower)
 {
- pval **str;
+ zval **str;
         char *ret;
         
         if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &str)) {
@@ -460,7 +460,7 @@
    Return the filename component of the path */
 PHP_FUNCTION(basename)
 {
- pval **str;
+ zval **str;
         char *ret, *c;
         
         if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &str)) {
@@ -512,7 +512,7 @@
    Return the directory name component of the path */
 PHP_FUNCTION(dirname)
 {
- pval **str;
+ zval **str;
         char *ret;
         
         if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &str)) {
@@ -650,7 +650,7 @@
    Find position of first occurrence of a string within another */
 PHP_FUNCTION(strpos)
 {
- pval **haystack, **needle, **OFFSET;
+ zval **haystack, **needle, **OFFSET;
         int offset = 0;
         char *found = NULL;
         char *endp;
@@ -717,7 +717,7 @@
    Find the last occurrence of a character in a string within another */
 PHP_FUNCTION(strrpos)
 {
- pval **haystack, **needle;
+ zval **haystack, **needle;
         char *found = NULL;
         
         if (ARG_COUNT(ht) != 2 || zend_get_parameters_ex(2, &haystack, &needle) == FAILURE) {
@@ -744,7 +744,7 @@
    Find the last occurrence of a character in a string within another */
 PHP_FUNCTION(strrchr)
 {
- pval **haystack, **needle;
+ zval **haystack, **needle;
         char *found = NULL;
         
         if (ARG_COUNT(ht) != 2 || zend_get_parameters_ex(2, &haystack, &needle) ==
@@ -810,7 +810,7 @@
    Return split line */
 PHP_FUNCTION(chunk_split)
 {
- pval **p_str, **p_chunklen, **p_ending;
+ zval **p_str, **p_chunklen, **p_ending;
         int argc;
         char *result;
         char *end = "\r\n";
@@ -857,7 +857,7 @@
    Return part of a string */
 PHP_FUNCTION(substr)
 {
- pval **string, **from, **len;
+ zval **string, **from, **len;
         int argc, l;
         int f;
         
@@ -1040,7 +1040,7 @@
    Return ASCII value of character */
 PHP_FUNCTION(ord)
 {
- pval **str;
+ zval **str;
         
         if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &str) == FAILURE) {
                 WRONG_PARAM_COUNT;
@@ -1054,7 +1054,7 @@
    Convert ASCII code to a character */
 PHP_FUNCTION(chr)
 {
- pval **num;
+ zval **num;
         char temp[2];
         
         if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &num) == FAILURE) {
@@ -1071,7 +1071,7 @@
    Make a string's first character uppercase */
 PHP_FUNCTION(ucfirst)
 {
- pval **arg;
+ zval **arg;
         
         if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) {
                 WRONG_PARAM_COUNT;
@@ -1248,7 +1248,7 @@
    Translate characters in str using given translation tables */
 PHP_FUNCTION(strtr)
 { /* strtr(STRING,FROM,TO) */
- pval **str, **from, **to;
+ zval **str, **from, **to;
         int ac = ARG_COUNT(ht);
 
         if (ac < 2 || ac > 3 || zend_get_parameters_ex(ac, &str, &from, &to) == FAILURE) {
@@ -1285,7 +1285,7 @@
    Reverse a string */
 PHP_FUNCTION(strrev)
 {
- pval **str;
+ zval **str;
         int i,len;
         char c;
         
@@ -1296,7 +1296,7 @@
         convert_to_string_ex(str);
         
         *return_value = **str;
- pval_copy_constructor(return_value);
+ zval_copy_ctor(return_value);
 
         len = return_value->value.str.len;
         
@@ -1351,7 +1351,7 @@
    Calculates the similarity between two strings */
 PHP_FUNCTION(similar_text)
 {
- pval **t1, **t2, **percent;
+ zval **t1, **t2, **percent;
         int ac = ARG_COUNT(ht);
         int sim;
         
@@ -1440,7 +1440,7 @@
    or with ASCII<32 (except '\n', '\r', '\t' etc...) */
 PHP_FUNCTION(addcslashes)
 {
- pval **str, **what;
+ zval **str, **what;
 
         if (ARG_COUNT(ht) != 2 || zend_get_parameters_ex(2, &str, &what) == FAILURE) {
                 WRONG_PARAM_COUNT;
@@ -1456,7 +1456,7 @@
    Escape single quote, double quotes and backslash characters in a string with backslashes */
 PHP_FUNCTION(addslashes)
 {
- pval **str;
+ zval **str;
 
         if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &str) == FAILURE) {
                 WRONG_PARAM_COUNT;
@@ -1471,7 +1471,7 @@
    Strip backslashes from a string. Uses C-style conventions*/
 PHP_FUNCTION(stripcslashes)
 {
- pval **str;
+ zval **str;
         
         if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &str) == FAILURE) {
                 WRONG_PARAM_COUNT;
@@ -1488,7 +1488,7 @@
    Strip backslashes from a string */
 PHP_FUNCTION(stripslashes)
 {
- pval **str;
+ zval **str;
         
         if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &str) == FAILURE) {
                 WRONG_PARAM_COUNT;
@@ -1682,7 +1682,7 @@
 #define _isblank(c) (((((unsigned char) c)==' ' || ((unsigned char) c)=='\t')) ? 1 : 0)
 #define _isnewline(c) (((((unsigned char) c)=='\n' || ((unsigned char) c)=='\r')) ? 1 : 0)
 
-PHPAPI void php_char_to_str(char *str,uint len,char from,char *to,int to_len,pval *result)
+PHPAPI void php_char_to_str(char *str,uint len,char from,char *to,int to_len,zval *result)
 {
         int char_count=0;
         char *source,*target,*tmp,*source_end=str+len, *tmp_end=NULL;
@@ -1788,7 +1788,7 @@
    Replace all occurrences of needle in haystack with str */
 PHP_FUNCTION(str_replace)
 {
- pval **haystack, **needle, **str;
+ zval **haystack, **needle, **str;
         char *new;
         int len = 0;
 
@@ -1832,7 +1832,7 @@
  */
 static void php_hebrev(INTERNAL_FUNCTION_PARAMETERS,int convert_newlines)
 {
- pval **str,**max_chars_per_line;
+ zval **str,**max_chars_per_line;
         char *heb_str,*tmp,*target,*opposite_target,*broken_str;
         int block_start, block_end, block_type, block_length, i;
         int block_ended;
@@ -2014,7 +2014,7 @@
    Converts newlines to HTML line breaks */
 PHP_FUNCTION(nl2br)
 {
- pval **str;
+ zval **str;
         
         if (ARG_COUNT(ht)!=1 || zend_get_parameters_ex(1, &str)==FAILURE) {
                 WRONG_PARAM_COUNT;
@@ -2031,7 +2031,7 @@
 PHP_FUNCTION(strip_tags)
 {
         char *buf;
- pval **str, **allow=NULL;
+ zval **str, **allow=NULL;
 
         switch(ARG_COUNT(ht)) {
                 case 1:
@@ -2060,8 +2060,8 @@
    Set locale information */
 PHP_FUNCTION(setlocale)
 {
- pval **pcategory, **plocale;
- pval *category, *locale;
+ zval **pcategory, **plocale;
+ zval *category, *locale;
         int cat;
         char *loc, *retval;
         BLS_FETCH();
@@ -2113,7 +2113,7 @@
    Parses GET/POST/COOKIE data and sets global variables. */
 PHP_FUNCTION(parse_str)
 {
- pval **arg;
+ zval **arg;
         char *res = NULL;
         ELS_FETCH();
         PLS_FETCH();

-- 
PHP 4.0 Beta Mailing List <http://www.php.net/version4/>
To unsubscribe, e-mail: php4beta-unsubscribe <email protected>
For additional commands, e-mail: php4beta-help <email protected>
To contact the list administrators, e-mail: php4beta-admin <email protected>