From: Andrei Zmievski Date: Tue, 8 Apr 2003 17:15:43 +0000 (+0000) Subject: Remove php_memnstr (it's in ZE now). X-Git-Tag: RELEASE_0_5~91 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b18542ba68e7bc17907654d9a962225efa3e6011;p=php Remove php_memnstr (it's in ZE now). --- diff --git a/ext/standard/php_string.h b/ext/standard/php_string.h index 39ce9ce993..7daa3ced91 100644 --- a/ext/standard/php_string.h +++ b/ext/standard/php_string.h @@ -134,31 +134,6 @@ PHPAPI int php_char_to_str(char *str, uint len, char from, char *to, int to_len, PHPAPI void php_implode(zval *delim, zval *arr, zval *return_value); PHPAPI void php_explode(zval *delim, zval *str, zval *return_value, int limit); -static inline char * -php_memnstr(char *haystack, char *needle, int needle_len, char *end) -{ - char *p = haystack; - char ne = needle[needle_len-1]; - - end -= needle_len; - - while (p <= end) { - if ((p = memchr(p, *needle, (end-p+1))) && ne == p[needle_len-1]) { - if (!memcmp(needle, p, needle_len-1)) { - return p; - } - } - - if (p == NULL) { - return NULL; - } - - p++; - } - - return NULL; -} - PHPAPI size_t php_strspn(char *s1, char *s2, char *s1_end, char *s2_end); PHPAPI size_t php_strcspn(char *s1, char *s2, char *s1_end, char *s2_end);