PageRenderTime 41ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/2.0/Source/ExtSupport/PHP5/API/ext/standard/php_string.h

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