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.

119 lines
4.3 KiB

23 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. | Author: Moriyoshi Koizumi <moriyoshi@php.net> |
  16. +----------------------------------------------------------------------+
  17. */
  18. /* $Id$ */
  19. #ifndef _PHP_MBREGEX_H
  20. #define _PHP_MBREGEX_H
  21. #if HAVE_MBREGEX
  22. #include "php.h"
  23. #include "zend.h"
  24. #include "oniguruma/oniguruma.h"
  25. /* {{{ PHP_MBREGEX_GLOBALS */
  26. #define PHP_MBREGEX_GLOBALS \
  27. OnigEncoding default_mbctype; \
  28. OnigEncoding current_mbctype; \
  29. HashTable ht_rc; \
  30. zval *search_str; \
  31. zval *search_str_val; \
  32. unsigned int search_pos; \
  33. php_mb_regex_t *search_re; \
  34. OnigRegion *search_regs; \
  35. OnigOptionType regex_default_options; \
  36. OnigSyntaxType *regex_default_syntax;
  37. /* }}} */
  38. /* {{{ PHP_MBREGEX_FUNCTION_ENTRIES */
  39. #define PHP_MBREGEX_FUNCTION_ENTRIES \
  40. PHP_FE(mb_regex_encoding, NULL) \
  41. PHP_FE(mb_regex_set_options, NULL) \
  42. PHP_FE(mb_ereg, third_arg_force_ref) \
  43. PHP_FE(mb_eregi, third_arg_force_ref) \
  44. PHP_FE(mb_ereg_replace, NULL) \
  45. PHP_FE(mb_eregi_replace, NULL) \
  46. PHP_FE(mb_split, NULL) \
  47. PHP_FE(mb_ereg_match, NULL) \
  48. PHP_FE(mb_ereg_search, NULL) \
  49. PHP_FE(mb_ereg_search_pos, NULL) \
  50. PHP_FE(mb_ereg_search_regs, NULL) \
  51. PHP_FE(mb_ereg_search_init, NULL) \
  52. PHP_FE(mb_ereg_search_getregs, NULL) \
  53. PHP_FE(mb_ereg_search_getpos, NULL) \
  54. PHP_FE(mb_ereg_search_setpos, NULL) \
  55. PHP_FALIAS(mbregex_encoding, mb_regex_encoding, NULL) \
  56. PHP_FALIAS(mbereg, mb_ereg, NULL) \
  57. PHP_FALIAS(mberegi, mb_eregi, NULL) \
  58. PHP_FALIAS(mbereg_replace, mb_ereg_replace, NULL) \
  59. PHP_FALIAS(mberegi_replace, mb_eregi_replace, NULL) \
  60. PHP_FALIAS(mbsplit, mb_split, NULL) \
  61. PHP_FALIAS(mbereg_match, mb_ereg_match, NULL) \
  62. PHP_FALIAS(mbereg_search, mb_ereg_search, NULL) \
  63. PHP_FALIAS(mbereg_search_pos, mb_ereg_search_pos, NULL) \
  64. PHP_FALIAS(mbereg_search_regs, mb_ereg_search_regs, NULL) \
  65. PHP_FALIAS(mbereg_search_init, mb_ereg_search_init, NULL) \
  66. PHP_FALIAS(mbereg_search_getregs, mb_ereg_search_getregs, NULL) \
  67. PHP_FALIAS(mbereg_search_getpos, mb_ereg_search_getpos, NULL) \
  68. PHP_FALIAS(mbereg_search_setpos, mb_ereg_search_setpos, NULL)
  69. /* }}} */
  70. typedef struct _zend_mbstring_globals * zend_mbstring_globals_ptr;
  71. #define PHP_MBREGEX_MAXCACHE 50
  72. PHP_MINIT_FUNCTION(mb_regex);
  73. PHP_MSHUTDOWN_FUNCTION(mb_regex);
  74. PHP_RINIT_FUNCTION(mb_regex);
  75. PHP_RSHUTDOWN_FUNCTION(mb_regex);
  76. void _php_mb_regex_globals_ctor(zend_mbstring_globals_ptr pglobals TSRMLS_DC);
  77. void php_mb_regex_set_options(OnigOptionType options, OnigSyntaxType *syntax, OnigOptionType *prev_options, OnigSyntaxType **prev_syntax TSRMLS_DC);
  78. void _php_mb_regex_globals_dtor(zend_mbstring_globals_ptr pglobals TSRMLS_DC);
  79. OnigEncoding php_mb_regex_name2mbctype(const char *pname);
  80. const char *php_mb_regex_mbctype2name(OnigEncoding mbctype);
  81. PHP_FUNCTION(mb_regex_encoding);
  82. PHP_FUNCTION(mb_ereg);
  83. PHP_FUNCTION(mb_eregi);
  84. PHP_FUNCTION(mb_ereg_replace);
  85. PHP_FUNCTION(mb_eregi_replace);
  86. PHP_FUNCTION(mb_split);
  87. PHP_FUNCTION(mb_ereg_match);
  88. PHP_FUNCTION(mb_ereg_search);
  89. PHP_FUNCTION(mb_ereg_search_pos);
  90. PHP_FUNCTION(mb_ereg_search_regs);
  91. PHP_FUNCTION(mb_ereg_search_init);
  92. PHP_FUNCTION(mb_ereg_search_getregs);
  93. PHP_FUNCTION(mb_ereg_search_getpos);
  94. PHP_FUNCTION(mb_ereg_search_setpos);
  95. PHP_FUNCTION(mb_regex_set_options);
  96. #endif /* HAVE_MBREGEX */
  97. #endif /* _PHP_MBREGEX_H */
  98. /*
  99. * Local variables:
  100. * tab-width: 4
  101. * c-basic-offset: 4
  102. * End:
  103. * vim600: noet sw=4 ts=4 fdm=marker
  104. * vim<600: noet sw=4 ts=4
  105. */