xref: /PHP-7.4/ext/mbstring/php_mbregex.h (revision 92ac598a)
1 /*
2    +----------------------------------------------------------------------+
3    | PHP Version 7                                                        |
4    +----------------------------------------------------------------------+
5    | Copyright (c) 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 
19 #ifndef _PHP_MBREGEX_H
20 #define _PHP_MBREGEX_H
21 
22 #if HAVE_MBREGEX
23 
24 #include "php.h"
25 #include "zend.h"
26 
27 /* {{{ PHP_MBREGEX_FUNCTION_ENTRIES */
28 #define PHP_MBREGEX_FUNCTION_ENTRIES \
29 	PHP_FE(mb_regex_encoding,	arginfo_mb_regex_encoding) \
30 	PHP_FE(mb_regex_set_options,	arginfo_mb_regex_set_options) \
31 	PHP_FE(mb_ereg,			arginfo_mb_ereg) \
32 	PHP_FE(mb_eregi,			arginfo_mb_eregi) \
33 	PHP_FE(mb_ereg_replace,			arginfo_mb_ereg_replace) \
34 	PHP_FE(mb_eregi_replace,			arginfo_mb_eregi_replace) \
35 	PHP_FE(mb_ereg_replace_callback,			arginfo_mb_ereg_replace_callback) \
36 	PHP_FE(mb_split,					arginfo_mb_split) \
37 	PHP_FE(mb_ereg_match,			arginfo_mb_ereg_match) \
38 	PHP_FE(mb_ereg_search,			arginfo_mb_ereg_search) \
39 	PHP_FE(mb_ereg_search_pos,		arginfo_mb_ereg_search_pos) \
40 	PHP_FE(mb_ereg_search_regs,		arginfo_mb_ereg_search_regs) \
41 	PHP_FE(mb_ereg_search_init,		arginfo_mb_ereg_search_init) \
42 	PHP_FE(mb_ereg_search_getregs,	arginfo_mb_ereg_search_getregs) \
43 	PHP_FE(mb_ereg_search_getpos,	arginfo_mb_ereg_search_getpos) \
44 	PHP_FE(mb_ereg_search_setpos,	arginfo_mb_ereg_search_setpos) \
45 	PHP_DEP_FALIAS(mbregex_encoding,	mb_regex_encoding,	arginfo_mb_regex_encoding) \
46 	PHP_DEP_FALIAS(mbereg,	mb_ereg,	arginfo_mb_ereg) \
47 	PHP_DEP_FALIAS(mberegi,	mb_eregi,	arginfo_mb_eregi) \
48 	PHP_DEP_FALIAS(mbereg_replace,	mb_ereg_replace,	arginfo_mb_ereg_replace) \
49 	PHP_DEP_FALIAS(mberegi_replace,	mb_eregi_replace,	arginfo_mb_eregi_replace) \
50 	PHP_DEP_FALIAS(mbsplit,	mb_split,	arginfo_mb_split) \
51 	PHP_DEP_FALIAS(mbereg_match,	mb_ereg_match,	arginfo_mb_ereg_match) \
52 	PHP_DEP_FALIAS(mbereg_search,	mb_ereg_search,	arginfo_mb_ereg_search) \
53 	PHP_DEP_FALIAS(mbereg_search_pos,	mb_ereg_search_pos,	arginfo_mb_ereg_search_pos) \
54 	PHP_DEP_FALIAS(mbereg_search_regs,	mb_ereg_search_regs,	arginfo_mb_ereg_search_regs) \
55 	PHP_DEP_FALIAS(mbereg_search_init,	mb_ereg_search_init,	arginfo_mb_ereg_search_init) \
56 	PHP_DEP_FALIAS(mbereg_search_getregs,	mb_ereg_search_getregs,	arginfo_mb_ereg_search_getregs) \
57 	PHP_DEP_FALIAS(mbereg_search_getpos,	mb_ereg_search_getpos,	arginfo_mb_ereg_search_getpos) \
58 	PHP_DEP_FALIAS(mbereg_search_setpos,	mb_ereg_search_setpos,	arginfo_mb_ereg_search_setpos)
59 /* }}} */
60 
61 #define PHP_MBREGEX_MAXCACHE 50
62 
63 PHP_MINIT_FUNCTION(mb_regex);
64 PHP_MSHUTDOWN_FUNCTION(mb_regex);
65 PHP_RINIT_FUNCTION(mb_regex);
66 PHP_RSHUTDOWN_FUNCTION(mb_regex);
67 PHP_MINFO_FUNCTION(mb_regex);
68 
69 typedef struct _zend_mb_regex_globals zend_mb_regex_globals;
70 
71 zend_mb_regex_globals *php_mb_regex_globals_alloc(void);
72 void php_mb_regex_globals_free(zend_mb_regex_globals *pglobals);
73 int php_mb_regex_set_mbctype(const char *enc);
74 int php_mb_regex_set_default_mbctype(const char *encname);
75 const char *php_mb_regex_get_mbctype(void);
76 const char *php_mb_regex_get_default_mbctype(void);
77 
78 PHP_FUNCTION(mb_regex_encoding);
79 PHP_FUNCTION(mb_ereg);
80 PHP_FUNCTION(mb_eregi);
81 PHP_FUNCTION(mb_ereg_replace);
82 PHP_FUNCTION(mb_eregi_replace);
83 PHP_FUNCTION(mb_ereg_replace_callback);
84 PHP_FUNCTION(mb_split);
85 PHP_FUNCTION(mb_ereg_match);
86 PHP_FUNCTION(mb_ereg_search);
87 PHP_FUNCTION(mb_ereg_search_pos);
88 PHP_FUNCTION(mb_ereg_search_regs);
89 PHP_FUNCTION(mb_ereg_search_init);
90 PHP_FUNCTION(mb_ereg_search_getregs);
91 PHP_FUNCTION(mb_ereg_search_getpos);
92 PHP_FUNCTION(mb_ereg_search_setpos);
93 PHP_FUNCTION(mb_regex_set_options);
94 
95 #endif /* HAVE_MBREGEX */
96 
97 #endif /* _PHP_MBREGEX_H */
98