1/*
2 +----------------------------------------------------------------------+
3 | PHP Version 5 |
4 +----------------------------------------------------------------------+
5 | Copyright (c) 1997-2015 The PHP Group |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.txt |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
15 | Authors: Rasmus Lerdorf <rasmus@php.net> |
16 | Stig Sæther Bakken <ssb@php.net> |
17 +----------------------------------------------------------------------+
18*/
19
20/* $Id$ */
21
22/* Synced with php 3.0 revision 1.43 1999-06-16 [ssb] */
23
24#ifndef PHP_STRING_H
25#define PHP_STRING_H
26
27PHP_FUNCTION(strspn);
28PHP_FUNCTION(strcspn);
29PHP_FUNCTION(str_replace);
30PHP_FUNCTION(str_ireplace);
31PHP_FUNCTION(rtrim);
32PHP_FUNCTION(trim);
33PHP_FUNCTION(ltrim);
34PHP_FUNCTION(soundex);
35PHP_FUNCTION(levenshtein);
36
37PHP_FUNCTION(count_chars);
38PHP_FUNCTION(wordwrap);
39PHP_FUNCTION(explode);
40PHP_FUNCTION(implode);
41PHP_FUNCTION(strtok);
42PHP_FUNCTION(strtoupper);
43PHP_FUNCTION(strtolower);
44PHP_FUNCTION(basename);
45PHP_FUNCTION(dirname);
46PHP_FUNCTION(pathinfo);
47PHP_FUNCTION(strstr);
48PHP_FUNCTION(strpos);
49PHP_FUNCTION(stripos);
50PHP_FUNCTION(strrpos);
51PHP_FUNCTION(strripos);
52PHP_FUNCTION(strrchr);
53PHP_FUNCTION(substr);
54PHP_FUNCTION(quotemeta);
55PHP_FUNCTION(ucfirst);
56PHP_FUNCTION(lcfirst);
57PHP_FUNCTION(ucwords);
58PHP_FUNCTION(strtr);
59PHP_FUNCTION(strrev);
60PHP_FUNCTION(hebrev);
61PHP_FUNCTION(hebrevc);
62PHP_FUNCTION(user_sprintf);
63PHP_FUNCTION(user_printf);
64PHP_FUNCTION(vprintf);
65PHP_FUNCTION(vsprintf);
66PHP_FUNCTION(addcslashes);
67PHP_FUNCTION(addslashes);
68PHP_FUNCTION(stripcslashes);
69PHP_FUNCTION(stripslashes);
70PHP_FUNCTION(chr);
71PHP_FUNCTION(ord);
72PHP_FUNCTION(nl2br);
73PHP_FUNCTION(setlocale);
74PHP_FUNCTION(localeconv);
75PHP_FUNCTION(nl_langinfo);
76PHP_FUNCTION(stristr);
77PHP_FUNCTION(chunk_split);
78PHP_FUNCTION(parse_str);
79PHP_FUNCTION(str_getcsv);
80PHP_FUNCTION(bin2hex);
81PHP_FUNCTION(hex2bin);
82PHP_FUNCTION(similar_text);
83PHP_FUNCTION(strip_tags);
84PHP_FUNCTION(str_repeat);
85PHP_FUNCTION(substr_replace);
86PHP_FUNCTION(strnatcmp);
87PHP_FUNCTION(strnatcasecmp);
88PHP_FUNCTION(substr_count);
89PHP_FUNCTION(str_pad);
90PHP_FUNCTION(sscanf);
91PHP_FUNCTION(str_shuffle);
92PHP_FUNCTION(str_word_count);
93PHP_FUNCTION(str_split);
94PHP_FUNCTION(strpbrk);
95PHP_FUNCTION(substr_compare);
96#ifdef HAVE_STRCOLL
97PHP_FUNCTION(strcoll);
98#endif
99#if HAVE_STRFMON
100PHP_FUNCTION(money_format);
101#endif
102
103#if defined(HAVE_LOCALECONV) && defined(ZTS)
104PHP_MINIT_FUNCTION(localeconv);
105PHP_MSHUTDOWN_FUNCTION(localeconv);
106#endif
107#if HAVE_NL_LANGINFO
108PHP_MINIT_FUNCTION(nl_langinfo);
109#endif
110
111#define strnatcmp(a, b) \
112 strnatcmp_ex(a, strlen(a), b, strlen(b), 0)
113#define strnatcasecmp(a, b) \
114 strnatcmp_ex(a, strlen(a), b, strlen(b), 1)
115PHPAPI int strnatcmp_ex(char const *a, size_t a_len, char const *b, size_t b_len, int fold_case);
116
117#ifdef HAVE_LOCALECONV
118PHPAPI struct lconv *localeconv_r(struct lconv *out);
119#endif
120
121PHPAPI char *php_strtoupper(char *s, size_t len);
122PHPAPI char *php_strtolower(char *s, size_t len);
123PHPAPI char *php_strtr(char *str, int len, char *str_from, char *str_to, int trlen);
124PHPAPI char *php_addslashes(char *str, int length, int *new_length, int freeit TSRMLS_DC);
125PHPAPI char *php_addcslashes(const char *str, int length, int *new_length, int freeit, char *what, int wlength TSRMLS_DC);
126PHPAPI void php_stripslashes(char *str, int *len TSRMLS_DC);
127PHPAPI void php_stripcslashes(char *str, int *len);
128PHPAPI void php_basename(const char *s, size_t len, char *suffix, size_t sufflen, char **p_ret, size_t *p_len TSRMLS_DC);
129PHPAPI size_t php_dirname(char *str, size_t len);
130PHPAPI char *php_stristr(char *s, char *t, size_t s_len, size_t t_len);
131PHPAPI char *php_str_to_str_ex(char *haystack, int length, char *needle,
132 int needle_len, char *str, int str_len, int *_new_length, int case_sensitivity, int *replace_count);
133PHPAPI char *php_str_to_str(char *haystack, int length, char *needle,
134 int needle_len, char *str, int str_len, int *_new_length);
135PHPAPI char *php_trim(char *c, int len, char *what, int what_len, zval *return_value, int mode TSRMLS_DC);
136PHPAPI size_t php_strip_tags(char *rbuf, int len, int *state, char *allow, int allow_len);
137PHPAPI size_t php_strip_tags_ex(char *rbuf, int len, int *stateptr, char *allow, int allow_len, zend_bool allow_tag_spaces);
138PHPAPI int php_char_to_str_ex(char *str, uint len, char from, char *to, int to_len, zval *result, int case_sensitivity, int *replace_count);
139PHPAPI int php_char_to_str(char *str, uint len, char from, char *to, int to_len, zval *result);
140PHPAPI void php_implode(zval *delim, zval *arr, zval *return_value TSRMLS_DC);
141PHPAPI void php_explode(zval *delim, zval *str, zval *return_value, long limit);
142
143PHPAPI size_t php_strspn(char *s1, char *s2, char *s1_end, char *s2_end);
144PHPAPI size_t php_strcspn(char *s1, char *s2, char *s1_end, char *s2_end);
145
146PHPAPI int string_natural_compare_function_ex(zval *result, zval *op1, zval *op2, zend_bool case_insensitive TSRMLS_DC);
147PHPAPI int string_natural_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
148PHPAPI int string_natural_case_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
149
150#ifndef HAVE_STRERROR
151PHPAPI char *php_strerror(int errnum);
152#define strerror php_strerror
153#endif
154
155#ifndef HAVE_MBLEN
156# define php_mblen(ptr, len) 1
157#else
158# if defined(_REENTRANT) && defined(HAVE_MBRLEN) && defined(HAVE_MBSTATE_T)
159# define php_mblen(ptr, len) ((ptr) == NULL ? memset(&BG(mblen_state), 0, sizeof(BG(mblen_state))): (int)mbrlen(ptr, len, &BG(mblen_state)))
160# else
161# define php_mblen(ptr, len) mblen(ptr, len)
162# endif
163#endif
164
165void register_string_constants(INIT_FUNC_ARGS);
166
167#endif /* PHP_STRING_H */
168