masugata                Mon Jul 17 04:44:06 2006 UTC

  Modified files:              
    /php-src/ext/mbstring       mbstring.c 
  Log:
  added option parameter mb_strrpos( ).
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/mbstring.c?r1=1.258&r2=1.259&diff_format=u
Index: php-src/ext/mbstring/mbstring.c
diff -u php-src/ext/mbstring/mbstring.c:1.258 
php-src/ext/mbstring/mbstring.c:1.259
--- php-src/ext/mbstring/mbstring.c:1.258       Thu Jun 15 15:44:05 2006
+++ php-src/ext/mbstring/mbstring.c     Mon Jul 17 04:44:06 2006
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: mbstring.c,v 1.258 2006/06/15 15:44:05 masugata Exp $ */
+/* $Id: mbstring.c,v 1.259 2006/07/17 04:44:06 masugata Exp $ */
 
 /*
  * PHP 4 Multibyte String module "mbstring"
@@ -1632,11 +1632,12 @@
 }
 /* }}} */
 
-/* {{{ proto int mb_strrpos(string haystack, string needle [, string encoding])
+/* {{{ proto int mb_strrpos(string haystack, string needle [, int offset [, 
string encoding]])
    Find position of last occurrence of a string within another */
 PHP_FUNCTION(mb_strrpos)
 {
        int n;
+       long offset = 0;
        mbfl_string haystack, needle;
        char *enc_name = NULL;
        int enc_name_len;
@@ -1648,7 +1649,7 @@
        needle.no_language = MBSTRG(current_language);
        needle.no_encoding = MBSTRG(current_internal_encoding);
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|s", (char 
**)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &enc_name, 
&enc_name_len) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|ls", (char 
**)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &offset, 
&enc_name, &enc_name_len) == FAILURE) {
                RETURN_FALSE;
        }
 
@@ -1668,7 +1669,7 @@
                php_error_docref(NULL TSRMLS_CC, E_WARNING,"Empty needle");
                RETURN_FALSE;
        }
-       n = mbfl_strpos(&haystack, &needle, 0, 1);
+       n = mbfl_strpos(&haystack, &needle, offset, 1);
        if (n >= 0) {
                RETVAL_LONG(n);
        } else {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to