You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

160 lines
5.8 KiB

24 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
25 years ago
25 years ago
23 years ago
25 years ago
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 5 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2006 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 Sther Bakken <ssb@php.net> |
  17. +----------------------------------------------------------------------+
  18. */
  19. /* $Id$ */
  20. /* Synced with php 3.0 revision 1.43 1999-06-16 [ssb] */
  21. #ifndef PHP_STRING_H
  22. #define PHP_STRING_H
  23. PHP_FUNCTION(strspn);
  24. PHP_FUNCTION(strcspn);
  25. PHP_FUNCTION(str_replace);
  26. PHP_FUNCTION(str_ireplace);
  27. PHP_FUNCTION(rtrim);
  28. PHP_FUNCTION(trim);
  29. PHP_FUNCTION(ltrim);
  30. PHP_FUNCTION(soundex);
  31. PHP_FUNCTION(levenshtein);
  32. PHP_FUNCTION(count_chars);
  33. PHP_FUNCTION(wordwrap);
  34. PHP_FUNCTION(explode);
  35. PHP_FUNCTION(implode);
  36. PHP_FUNCTION(strtok);
  37. PHP_FUNCTION(strtoupper);
  38. PHP_FUNCTION(strtolower);
  39. PHP_FUNCTION(basename);
  40. PHP_FUNCTION(dirname);
  41. PHP_FUNCTION(pathinfo);
  42. PHP_FUNCTION(strstr);
  43. PHP_FUNCTION(strpos);
  44. PHP_FUNCTION(stripos);
  45. PHP_FUNCTION(strrpos);
  46. PHP_FUNCTION(strripos);
  47. PHP_FUNCTION(strrchr);
  48. PHP_FUNCTION(substr);
  49. PHP_FUNCTION(quotemeta);
  50. PHP_FUNCTION(ucfirst);
  51. PHP_FUNCTION(ucwords);
  52. PHP_FUNCTION(strtr);
  53. PHP_FUNCTION(strrev);
  54. PHP_FUNCTION(hebrev);
  55. PHP_FUNCTION(hebrevc);
  56. PHP_FUNCTION(user_sprintf);
  57. PHP_FUNCTION(user_printf);
  58. PHP_FUNCTION(vprintf);
  59. PHP_FUNCTION(vsprintf);
  60. PHP_FUNCTION(addcslashes);
  61. PHP_FUNCTION(addslashes);
  62. PHP_FUNCTION(stripcslashes);
  63. PHP_FUNCTION(stripslashes);
  64. PHP_FUNCTION(chr);
  65. PHP_FUNCTION(ord);
  66. PHP_FUNCTION(nl2br);
  67. PHP_FUNCTION(setlocale);
  68. PHP_FUNCTION(localeconv);
  69. PHP_FUNCTION(nl_langinfo);
  70. PHP_FUNCTION(stristr);
  71. PHP_FUNCTION(chunk_split);
  72. PHP_FUNCTION(parse_str);
  73. PHP_FUNCTION(bin2hex);
  74. PHP_FUNCTION(similar_text);
  75. PHP_FUNCTION(strip_tags);
  76. PHP_FUNCTION(str_repeat);
  77. PHP_FUNCTION(substr_replace);
  78. PHP_FUNCTION(strnatcmp);
  79. PHP_FUNCTION(strnatcasecmp);
  80. PHP_FUNCTION(substr_count);
  81. PHP_FUNCTION(str_pad);
  82. PHP_FUNCTION(sscanf);
  83. PHP_FUNCTION(str_shuffle);
  84. PHP_FUNCTION(str_word_count);
  85. PHP_FUNCTION(str_split);
  86. PHP_FUNCTION(strpbrk);
  87. PHP_FUNCTION(substr_compare);
  88. #ifdef HAVE_STRCOLL
  89. PHP_FUNCTION(strcoll);
  90. #endif
  91. #if HAVE_STRFMON
  92. PHP_FUNCTION(money_format);
  93. #endif
  94. #if defined(HAVE_LOCALECONV) && defined(ZTS)
  95. PHP_MINIT_FUNCTION(localeconv);
  96. PHP_MSHUTDOWN_FUNCTION(localeconv);
  97. #endif
  98. #if HAVE_NL_LANGINFO
  99. PHP_MINIT_FUNCTION(nl_langinfo);
  100. #endif
  101. #define strnatcmp(a, b) \
  102. strnatcmp_ex(a, strlen(a), b, strlen(b), 0)
  103. #define strnatcasecmp(a, b) \
  104. strnatcmp_ex(a, strlen(a), b, strlen(b), 1)
  105. PHPAPI int strnatcmp_ex(char const *a, size_t a_len, char const *b, size_t b_len, int fold_case);
  106. #ifdef HAVE_LOCALECONV
  107. PHPAPI struct lconv *localeconv_r(struct lconv *out);
  108. #endif
  109. PHPAPI char *php_strtoupper(char *s, size_t len);
  110. PHPAPI char *php_strtolower(char *s, size_t len);
  111. PHPAPI char *php_strtr(char *str, int len, char *str_from, char *str_to, int trlen);
  112. PHPAPI char *php_addslashes(char *str, int length, int *new_length, int freeit TSRMLS_DC);
  113. PHPAPI char *php_addslashes_ex(char *str, int length, int *new_length, int freeit, int ignore_sybase TSRMLS_DC);
  114. PHPAPI char *php_addcslashes(char *str, int length, int *new_length, int freeit, char *what, int wlength TSRMLS_DC);
  115. PHPAPI void php_stripslashes(char *str, int *len TSRMLS_DC);
  116. PHPAPI void php_stripcslashes(char *str, int *len);
  117. PHPAPI void php_basename(char *s, size_t len, char *suffix, size_t sufflen, char **p_ret, size_t *p_len TSRMLS_DC);
  118. PHPAPI size_t php_dirname(char *str, size_t len);
  119. PHPAPI char *php_stristr(unsigned char *s, unsigned char *t, size_t s_len, size_t t_len);
  120. PHPAPI char *php_str_to_str_ex(char *haystack, int length, char *needle,
  121. int needle_len, char *str, int str_len, int *_new_length, int case_sensitivity, int *replace_count);
  122. PHPAPI char *php_str_to_str(char *haystack, int length, char *needle,
  123. int needle_len, char *str, int str_len, int *_new_length);
  124. PHPAPI char *php_trim(char *c, int len, char *what, int what_len, zval *return_value, int mode TSRMLS_DC);
  125. PHPAPI size_t php_strip_tags(char *rbuf, int len, int *state, char *allow, int allow_len);
  126. PHPAPI 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);
  127. PHPAPI int php_char_to_str(char *str, uint len, char from, char *to, int to_len, zval *result);
  128. PHPAPI void php_implode(zval *delim, zval *arr, zval *return_value);
  129. PHPAPI void php_explode(zval *delim, zval *str, zval *return_value, int limit);
  130. PHPAPI size_t php_strspn(char *s1, char *s2, char *s1_end, char *s2_end);
  131. PHPAPI size_t php_strcspn(char *s1, char *s2, char *s1_end, char *s2_end);
  132. #ifndef HAVE_STRERROR
  133. PHPAPI char *php_strerror(int errnum);
  134. #define strerror php_strerror
  135. #endif
  136. #ifndef HAVE_MBLEN
  137. # define php_mblen(ptr, len) 1
  138. #else
  139. # if defined(_REENTRANT) && defined(HAVE_MBRLEN) && defined(HAVE_MBSTATE_T)
  140. # define php_mblen(ptr, len) ((ptr) == NULL ? mbsinit(&BG(mblen_state)): (int)mbrlen(ptr, len, &BG(mblen_state)))
  141. # else
  142. # define php_mblen(ptr, len) mblen(ptr, len)
  143. # endif
  144. #endif
  145. void register_string_constants(INIT_FUNC_ARGS);
  146. #endif /* PHP_STRING_H */