Coverage Report

Created: 2022-10-14 11:21

/src/php-src/ext/mbstring/mbstring.h
Line
Count
Source
1
/*
2
   +----------------------------------------------------------------------+
3
   | Copyright (c) The PHP Group                                          |
4
   +----------------------------------------------------------------------+
5
   | This source file is subject to version 3.01 of the PHP license,      |
6
   | that is bundled with this package in the file LICENSE, and is        |
7
   | available through the world-wide-web at the following url:           |
8
   | http://www.php.net/license/3_01.txt                                  |
9
   | If you did not receive a copy of the PHP license and are unable to   |
10
   | obtain it through the world-wide-web, please send a note to          |
11
   | license@php.net so we can mail you a copy immediately.               |
12
   +----------------------------------------------------------------------+
13
   | Author: Tsukada Takuya <tsukada@fminn.nagano.nagano.jp>              |
14
   |         Hironori Sato <satoh@jpnnet.com>                             |
15
   |         Shigeru Kanemoto <sgk@happysize.co.jp>                       |
16
   +----------------------------------------------------------------------+
17
 */
18
19
#ifndef _MBSTRING_H
20
#define _MBSTRING_H
21
22
#ifdef COMPILE_DL_MBSTRING
23
#undef HAVE_MBSTRING
24
#define HAVE_MBSTRING 1
25
#endif
26
27
#include "php_version.h"
28
#define PHP_MBSTRING_VERSION PHP_VERSION
29
30
#ifdef PHP_WIN32
31
# undef MBSTRING_API
32
# ifdef MBSTRING_EXPORTS
33
#   define MBSTRING_API __declspec(dllexport)
34
# elif defined(COMPILE_DL_MBSTRING)
35
#   define MBSTRING_API __declspec(dllimport)
36
# else
37
#   define MBSTRING_API /* nothing special */
38
# endif
39
#elif defined(__GNUC__) && __GNUC__ >= 4
40
# undef MBSTRING_API
41
# define MBSTRING_API __attribute__ ((visibility("default")))
42
#else
43
# undef MBSTRING_API
44
# define MBSTRING_API /* nothing special */
45
#endif
46
47
48
#ifdef HAVE_MBSTRING
49
50
#include "libmbfl/mbfl/mbfilter.h"
51
#include "SAPI.h"
52
53
#define PHP_MBSTRING_API 20021024
54
55
extern zend_module_entry mbstring_module_entry;
56
#define mbstring_module_ptr &mbstring_module_entry
57
58
PHP_MINIT_FUNCTION(mbstring);
59
PHP_MSHUTDOWN_FUNCTION(mbstring);
60
PHP_RINIT_FUNCTION(mbstring);
61
PHP_RSHUTDOWN_FUNCTION(mbstring);
62
PHP_MINFO_FUNCTION(mbstring);
63
64
MBSTRING_API char *php_mb_safe_strrchr_ex(const char *s, unsigned int c,
65
                                    size_t nbytes, const mbfl_encoding *enc);
66
MBSTRING_API char *php_mb_safe_strrchr(const char *s, unsigned int c,
67
                                 size_t nbytes);
68
69
MBSTRING_API char *php_mb_convert_encoding_ex(
70
    const char *input, size_t length,
71
    const mbfl_encoding *to_encoding, const mbfl_encoding *from_encoding, size_t *output_len);
72
MBSTRING_API char * php_mb_convert_encoding(
73
    const char *input, size_t length, const mbfl_encoding *to_encoding,
74
    const mbfl_encoding **from_encodings, size_t num_from_encodings, size_t *output_len);
75
76
MBSTRING_API size_t php_mb_mbchar_bytes_ex(const char *s, const mbfl_encoding *enc);
77
MBSTRING_API size_t php_mb_mbchar_bytes(const char *s);
78
79
MBSTRING_API size_t php_mb_stripos(int mode, const char *old_haystack, size_t old_haystack_len, const char *old_needle, size_t old_needle_len, zend_long offset, const mbfl_encoding *encoding);
80
MBSTRING_API int php_mb_check_encoding(const char *input, size_t length, const mbfl_encoding *encoding);
81
82
ZEND_BEGIN_MODULE_GLOBALS(mbstring)
83
  char *internal_encoding_name;
84
  const mbfl_encoding *internal_encoding;
85
  const mbfl_encoding *current_internal_encoding;
86
  const mbfl_encoding *http_output_encoding;
87
  const mbfl_encoding *current_http_output_encoding;
88
  const mbfl_encoding *http_input_identify;
89
  const mbfl_encoding *http_input_identify_get;
90
  const mbfl_encoding *http_input_identify_post;
91
  const mbfl_encoding *http_input_identify_cookie;
92
  const mbfl_encoding *http_input_identify_string;
93
  const mbfl_encoding **http_input_list;
94
  size_t http_input_list_size;
95
  const mbfl_encoding **detect_order_list;
96
  size_t detect_order_list_size;
97
  const mbfl_encoding **current_detect_order_list;
98
  size_t current_detect_order_list_size;
99
  enum mbfl_no_encoding *default_detect_order_list;
100
  size_t default_detect_order_list_size;
101
  int filter_illegal_mode;
102
  int filter_illegal_substchar;
103
  int current_filter_illegal_mode;
104
  int current_filter_illegal_substchar;
105
  enum mbfl_no_language language;
106
  zend_bool encoding_translation;
107
  zend_bool strict_detection;
108
  size_t illegalchars;
109
  mbfl_buffer_converter *outconv;
110
    void *http_output_conv_mimetypes;
111
#ifdef HAVE_MBREGEX
112
    struct _zend_mb_regex_globals *mb_regex_globals;
113
    zend_long regex_stack_limit;
114
#endif
115
  zend_string *last_used_encoding_name;
116
  const mbfl_encoding *last_used_encoding;
117
  /* Whether an explicit internal_encoding / http_output / http_input encoding was set. */
118
  zend_bool internal_encoding_set;
119
  zend_bool http_output_set;
120
  zend_bool http_input_set;
121
#ifdef HAVE_MBREGEX
122
    zend_long regex_retry_limit;
123
#endif
124
ZEND_END_MODULE_GLOBALS(mbstring)
125
126
11.1M
#define MBSTRG(v) ZEND_MODULE_GLOBALS_ACCESSOR(mbstring, v)
127
128
#if defined(ZTS) && defined(COMPILE_DL_MBSTRING)
129
ZEND_TSRMLS_CACHE_EXTERN()
130
#endif
131
132
#else /* HAVE_MBSTRING */
133
134
#define mbstring_module_ptr NULL
135
136
#endif  /* HAVE_MBSTRING */
137
138
#define phpext_mbstring_ptr mbstring_module_ptr
139
140
#endif    /* _MBSTRING_H */