PageRenderTime 31ms CodeModel.GetById 8ms RepoModel.GetById 0ms app.codeStats 0ms

/ext/standard/php_string.h

http://github.com/infusion/PHP
C Header | 170 lines | 136 code | 14 blank | 20 comment | 5 complexity | d0e97727fe97b75bd316ab524f06a82c MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, LGPL-2.1, BSD-3-Clause
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 5 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2011 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. /* $Id: php_string.h 306939 2011-01-01 02:19:59Z felipe $ */
  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(lcfirst);
  52. PHP_FUNCTION(ucwords);
  53. PHP_FUNCTION(strtr);
  54. PHP_FUNCTION(strrev);
  55. PHP_FUNCTION(hebrev);
  56. PHP_FUNCTION(hebrevc);
  57. PHP_FUNCTION(user_sprintf);
  58. PHP_FUNCTION(user_printf);
  59. PHP_FUNCTION(vprintf);
  60. PHP_FUNCTION(vsprintf);
  61. PHP_FUNCTION(addcslashes);
  62. PHP_FUNCTION(addslashes);
  63. PHP_FUNCTION(stripcslashes);
  64. PHP_FUNCTION(stripslashes);
  65. PHP_FUNCTION(chr);
  66. PHP_FUNCTION(ord);
  67. PHP_FUNCTION(nl2br);
  68. PHP_FUNCTION(setlocale);
  69. PHP_FUNCTION(localeconv);
  70. PHP_FUNCTION(nl_langinfo);
  71. PHP_FUNCTION(stristr);
  72. PHP_FUNCTION(chunk_split);
  73. PHP_FUNCTION(parse_str);
  74. PHP_FUNCTION(str_getcsv);
  75. PHP_FUNCTION(bin2hex);
  76. PHP_FUNCTION(similar_text);
  77. PHP_FUNCTION(strip_tags);
  78. PHP_FUNCTION(str_repeat);
  79. PHP_FUNCTION(substr_replace);
  80. PHP_FUNCTION(strnatcmp);
  81. PHP_FUNCTION(strnatcasecmp);
  82. PHP_FUNCTION(substr_count);
  83. PHP_FUNCTION(str_pad);
  84. PHP_FUNCTION(sscanf);
  85. PHP_FUNCTION(str_shuffle);
  86. PHP_FUNCTION(str_word_count);
  87. PHP_FUNCTION(str_split);
  88. PHP_FUNCTION(strpbrk);
  89. PHP_FUNCTION(substr_compare);
  90. PHP_FUNCTION(strcut);
  91. PHP_FUNCTION(xsprintf);
  92. PHP_FUNCTION(strcal);
  93. PHP_FUNCTION(strical);
  94. PHP_FUNCTION(strmap);
  95. PHP_FUNCTION(str_random);
  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. #define strnatcmp(a, b) \
  110. strnatcmp_ex(a, strlen(a), b, strlen(b), 0)
  111. #define strnatcasecmp(a, b) \
  112. strnatcmp_ex(a, strlen(a), b, strlen(b), 1)
  113. PHPAPI int strnatcmp_ex(char const *a, size_t a_len, char const *b, size_t b_len, int fold_case);
  114. #ifdef HAVE_LOCALECONV
  115. PHPAPI struct lconv *localeconv_r(struct lconv *out);
  116. #endif
  117. PHPAPI char *php_strtoupper(char *s, size_t len);
  118. PHPAPI char *php_strtolower(char *s, size_t len);
  119. PHPAPI char *php_strtr(char *str, int len, char *str_from, char *str_to, int trlen);
  120. PHPAPI char *php_strtr_del(char *str, int *len, char *from, int from_len);
  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, zend_bool keys 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. #ifndef HAVE_MBLEN
  147. # define php_mblen(ptr, len) 1
  148. #else
  149. # if defined(_REENTRANT) && defined(HAVE_MBRLEN) && defined(HAVE_MBSTATE_T)
  150. # define php_mblen(ptr, len) ((ptr) == NULL ? mbsinit(&BG(mblen_state)): (int)mbrlen(ptr, len, &BG(mblen_state)))
  151. # else
  152. # define php_mblen(ptr, len) mblen(ptr, len)
  153. # endif
  154. #endif
  155. void register_string_constants(INIT_FUNC_ARGS);
  156. #endif /* PHP_STRING_H */