xref: /PHP-8.2/ext/zlib/zlib_arginfo.h (revision ce058273)
1 /* This is a generated file, edit the .stub.php file instead.
2  * Stub hash: 3660ad3239f93c84b6909c36ddfcc92dd0773c70 */
3 
4 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ob_gzhandler, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
5 	ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
6 	ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 0)
7 ZEND_END_ARG_INFO()
8 
9 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_zlib_get_coding_type, 0, 0, MAY_BE_STRING|MAY_BE_FALSE)
10 ZEND_END_ARG_INFO()
11 
12 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_gzfile, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE)
13 	ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
14 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, use_include_path, IS_LONG, 0, "0")
15 ZEND_END_ARG_INFO()
16 
17 ZEND_BEGIN_ARG_INFO_EX(arginfo_gzopen, 0, 0, 2)
18 	ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
19 	ZEND_ARG_TYPE_INFO(0, mode, IS_STRING, 0)
20 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, use_include_path, IS_LONG, 0, "0")
21 ZEND_END_ARG_INFO()
22 
23 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_readgzfile, 0, 1, MAY_BE_LONG|MAY_BE_FALSE)
24 	ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
25 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, use_include_path, IS_LONG, 0, "0")
26 ZEND_END_ARG_INFO()
27 
28 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_zlib_encode, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
29 	ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
30 	ZEND_ARG_TYPE_INFO(0, encoding, IS_LONG, 0)
31 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, level, IS_LONG, 0, "-1")
32 ZEND_END_ARG_INFO()
33 
34 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_zlib_decode, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
35 	ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
36 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, max_length, IS_LONG, 0, "0")
37 ZEND_END_ARG_INFO()
38 
39 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_gzdeflate, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
40 	ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
41 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, level, IS_LONG, 0, "-1")
42 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_LONG, 0, "ZLIB_ENCODING_RAW")
43 ZEND_END_ARG_INFO()
44 
45 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_gzencode, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
46 	ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
47 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, level, IS_LONG, 0, "-1")
48 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_LONG, 0, "ZLIB_ENCODING_GZIP")
49 ZEND_END_ARG_INFO()
50 
51 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_gzcompress, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
52 	ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
53 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, level, IS_LONG, 0, "-1")
54 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_LONG, 0, "ZLIB_ENCODING_DEFLATE")
55 ZEND_END_ARG_INFO()
56 
57 #define arginfo_gzinflate arginfo_zlib_decode
58 
59 #define arginfo_gzdecode arginfo_zlib_decode
60 
61 #define arginfo_gzuncompress arginfo_zlib_decode
62 
63 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_gzwrite, 0, 2, MAY_BE_LONG|MAY_BE_FALSE)
64 	ZEND_ARG_INFO(0, stream)
65 	ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
66 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null")
67 ZEND_END_ARG_INFO()
68 
69 #define arginfo_gzputs arginfo_gzwrite
70 
71 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gzrewind, 0, 1, _IS_BOOL, 0)
72 	ZEND_ARG_INFO(0, stream)
73 ZEND_END_ARG_INFO()
74 
75 #define arginfo_gzclose arginfo_gzrewind
76 
77 #define arginfo_gzeof arginfo_gzrewind
78 
79 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_gzgetc, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
80 	ZEND_ARG_INFO(0, stream)
81 ZEND_END_ARG_INFO()
82 
83 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gzpassthru, 0, 1, IS_LONG, 0)
84 	ZEND_ARG_INFO(0, stream)
85 ZEND_END_ARG_INFO()
86 
87 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gzseek, 0, 2, IS_LONG, 0)
88 	ZEND_ARG_INFO(0, stream)
89 	ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0)
90 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, whence, IS_LONG, 0, "SEEK_SET")
91 ZEND_END_ARG_INFO()
92 
93 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_gztell, 0, 1, MAY_BE_LONG|MAY_BE_FALSE)
94 	ZEND_ARG_INFO(0, stream)
95 ZEND_END_ARG_INFO()
96 
97 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_gzread, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
98 	ZEND_ARG_INFO(0, stream)
99 	ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0)
100 ZEND_END_ARG_INFO()
101 
102 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_gzgets, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
103 	ZEND_ARG_INFO(0, stream)
104 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null")
105 ZEND_END_ARG_INFO()
106 
107 ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_deflate_init, 0, 1, DeflateContext, MAY_BE_FALSE)
108 	ZEND_ARG_TYPE_INFO(0, encoding, IS_LONG, 0)
109 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]")
110 ZEND_END_ARG_INFO()
111 
112 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_deflate_add, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
113 	ZEND_ARG_OBJ_INFO(0, context, DeflateContext, 0)
114 	ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
115 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flush_mode, IS_LONG, 0, "ZLIB_SYNC_FLUSH")
116 ZEND_END_ARG_INFO()
117 
118 ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_inflate_init, 0, 1, InflateContext, MAY_BE_FALSE)
119 	ZEND_ARG_TYPE_INFO(0, encoding, IS_LONG, 0)
120 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]")
121 ZEND_END_ARG_INFO()
122 
123 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_inflate_add, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
124 	ZEND_ARG_OBJ_INFO(0, context, InflateContext, 0)
125 	ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
126 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flush_mode, IS_LONG, 0, "ZLIB_SYNC_FLUSH")
127 ZEND_END_ARG_INFO()
128 
129 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_inflate_get_status, 0, 1, IS_LONG, 0)
130 	ZEND_ARG_OBJ_INFO(0, context, InflateContext, 0)
131 ZEND_END_ARG_INFO()
132 
133 #define arginfo_inflate_get_read_len arginfo_inflate_get_status
134 
135 
136 ZEND_FUNCTION(ob_gzhandler);
137 ZEND_FUNCTION(zlib_get_coding_type);
138 ZEND_FUNCTION(gzfile);
139 ZEND_FUNCTION(gzopen);
140 ZEND_FUNCTION(readgzfile);
141 ZEND_FUNCTION(zlib_encode);
142 ZEND_FUNCTION(zlib_decode);
143 ZEND_FUNCTION(gzdeflate);
144 ZEND_FUNCTION(gzencode);
145 ZEND_FUNCTION(gzcompress);
146 ZEND_FUNCTION(gzinflate);
147 ZEND_FUNCTION(gzdecode);
148 ZEND_FUNCTION(gzuncompress);
149 ZEND_FUNCTION(fwrite);
150 ZEND_FUNCTION(rewind);
151 ZEND_FUNCTION(fclose);
152 ZEND_FUNCTION(feof);
153 ZEND_FUNCTION(fgetc);
154 ZEND_FUNCTION(fpassthru);
155 ZEND_FUNCTION(fseek);
156 ZEND_FUNCTION(ftell);
157 ZEND_FUNCTION(fread);
158 ZEND_FUNCTION(fgets);
159 ZEND_FUNCTION(deflate_init);
160 ZEND_FUNCTION(deflate_add);
161 ZEND_FUNCTION(inflate_init);
162 ZEND_FUNCTION(inflate_add);
163 ZEND_FUNCTION(inflate_get_status);
164 ZEND_FUNCTION(inflate_get_read_len);
165 
166 
167 static const zend_function_entry ext_functions[] = {
168 	ZEND_FE(ob_gzhandler, arginfo_ob_gzhandler)
169 	ZEND_FE(zlib_get_coding_type, arginfo_zlib_get_coding_type)
170 	ZEND_FE(gzfile, arginfo_gzfile)
171 	ZEND_FE(gzopen, arginfo_gzopen)
172 	ZEND_FE(readgzfile, arginfo_readgzfile)
173 	ZEND_FE(zlib_encode, arginfo_zlib_encode)
174 	ZEND_FE(zlib_decode, arginfo_zlib_decode)
175 	ZEND_FE(gzdeflate, arginfo_gzdeflate)
176 	ZEND_FE(gzencode, arginfo_gzencode)
177 	ZEND_FE(gzcompress, arginfo_gzcompress)
178 	ZEND_FE(gzinflate, arginfo_gzinflate)
179 	ZEND_FE(gzdecode, arginfo_gzdecode)
180 	ZEND_FE(gzuncompress, arginfo_gzuncompress)
181 	ZEND_FALIAS(gzwrite, fwrite, arginfo_gzwrite)
182 	ZEND_FALIAS(gzputs, fwrite, arginfo_gzputs)
183 	ZEND_FALIAS(gzrewind, rewind, arginfo_gzrewind)
184 	ZEND_FALIAS(gzclose, fclose, arginfo_gzclose)
185 	ZEND_FALIAS(gzeof, feof, arginfo_gzeof)
186 	ZEND_FALIAS(gzgetc, fgetc, arginfo_gzgetc)
187 	ZEND_FALIAS(gzpassthru, fpassthru, arginfo_gzpassthru)
188 	ZEND_FALIAS(gzseek, fseek, arginfo_gzseek)
189 	ZEND_FALIAS(gztell, ftell, arginfo_gztell)
190 	ZEND_FALIAS(gzread, fread, arginfo_gzread)
191 	ZEND_FALIAS(gzgets, fgets, arginfo_gzgets)
192 	ZEND_FE(deflate_init, arginfo_deflate_init)
193 	ZEND_FE(deflate_add, arginfo_deflate_add)
194 	ZEND_FE(inflate_init, arginfo_inflate_init)
195 	ZEND_FE(inflate_add, arginfo_inflate_add)
196 	ZEND_FE(inflate_get_status, arginfo_inflate_get_status)
197 	ZEND_FE(inflate_get_read_len, arginfo_inflate_get_read_len)
198 	ZEND_FE_END
199 };
200 
201 
202 static const zend_function_entry class_InflateContext_methods[] = {
203 	ZEND_FE_END
204 };
205 
206 
207 static const zend_function_entry class_DeflateContext_methods[] = {
208 	ZEND_FE_END
209 };
210 
register_zlib_symbols(int module_number)211 static void register_zlib_symbols(int module_number)
212 {
213 	REGISTER_LONG_CONSTANT("FORCE_GZIP", PHP_ZLIB_ENCODING_GZIP, CONST_PERSISTENT);
214 	REGISTER_LONG_CONSTANT("FORCE_DEFLATE", PHP_ZLIB_ENCODING_DEFLATE, CONST_PERSISTENT);
215 	REGISTER_LONG_CONSTANT("ZLIB_ENCODING_RAW", PHP_ZLIB_ENCODING_RAW, CONST_PERSISTENT);
216 	REGISTER_LONG_CONSTANT("ZLIB_ENCODING_GZIP", PHP_ZLIB_ENCODING_GZIP, CONST_PERSISTENT);
217 	REGISTER_LONG_CONSTANT("ZLIB_ENCODING_DEFLATE", PHP_ZLIB_ENCODING_DEFLATE, CONST_PERSISTENT);
218 	REGISTER_LONG_CONSTANT("ZLIB_NO_FLUSH", Z_NO_FLUSH, CONST_PERSISTENT);
219 	REGISTER_LONG_CONSTANT("ZLIB_PARTIAL_FLUSH", Z_PARTIAL_FLUSH, CONST_PERSISTENT);
220 	REGISTER_LONG_CONSTANT("ZLIB_SYNC_FLUSH", Z_SYNC_FLUSH, CONST_PERSISTENT);
221 	REGISTER_LONG_CONSTANT("ZLIB_FULL_FLUSH", Z_FULL_FLUSH, CONST_PERSISTENT);
222 	REGISTER_LONG_CONSTANT("ZLIB_BLOCK", Z_BLOCK, CONST_PERSISTENT);
223 	REGISTER_LONG_CONSTANT("ZLIB_FINISH", Z_FINISH, CONST_PERSISTENT);
224 	REGISTER_LONG_CONSTANT("ZLIB_FILTERED", Z_FILTERED, CONST_PERSISTENT);
225 	REGISTER_LONG_CONSTANT("ZLIB_HUFFMAN_ONLY", Z_HUFFMAN_ONLY, CONST_PERSISTENT);
226 	REGISTER_LONG_CONSTANT("ZLIB_RLE", Z_RLE, CONST_PERSISTENT);
227 	REGISTER_LONG_CONSTANT("ZLIB_FIXED", Z_FIXED, CONST_PERSISTENT);
228 	REGISTER_LONG_CONSTANT("ZLIB_DEFAULT_STRATEGY", Z_DEFAULT_STRATEGY, CONST_PERSISTENT);
229 	REGISTER_STRING_CONSTANT("ZLIB_VERSION", ZLIB_VERSION, CONST_PERSISTENT);
230 	REGISTER_LONG_CONSTANT("ZLIB_VERNUM", ZLIB_VERNUM, CONST_PERSISTENT);
231 	REGISTER_LONG_CONSTANT("ZLIB_OK", Z_OK, CONST_PERSISTENT);
232 	REGISTER_LONG_CONSTANT("ZLIB_STREAM_END", Z_STREAM_END, CONST_PERSISTENT);
233 	REGISTER_LONG_CONSTANT("ZLIB_NEED_DICT", Z_NEED_DICT, CONST_PERSISTENT);
234 	REGISTER_LONG_CONSTANT("ZLIB_ERRNO", Z_ERRNO, CONST_PERSISTENT);
235 	REGISTER_LONG_CONSTANT("ZLIB_STREAM_ERROR", Z_STREAM_ERROR, CONST_PERSISTENT);
236 	REGISTER_LONG_CONSTANT("ZLIB_DATA_ERROR", Z_DATA_ERROR, CONST_PERSISTENT);
237 	REGISTER_LONG_CONSTANT("ZLIB_MEM_ERROR", Z_MEM_ERROR, CONST_PERSISTENT);
238 	REGISTER_LONG_CONSTANT("ZLIB_BUF_ERROR", Z_BUF_ERROR, CONST_PERSISTENT);
239 	REGISTER_LONG_CONSTANT("ZLIB_VERSION_ERROR", Z_VERSION_ERROR, CONST_PERSISTENT);
240 }
241 
register_class_InflateContext(void)242 static zend_class_entry *register_class_InflateContext(void)
243 {
244 	zend_class_entry ce, *class_entry;
245 
246 	INIT_CLASS_ENTRY(ce, "InflateContext", class_InflateContext_methods);
247 	class_entry = zend_register_internal_class_ex(&ce, NULL);
248 	class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE;
249 
250 	return class_entry;
251 }
252 
register_class_DeflateContext(void)253 static zend_class_entry *register_class_DeflateContext(void)
254 {
255 	zend_class_entry ce, *class_entry;
256 
257 	INIT_CLASS_ENTRY(ce, "DeflateContext", class_DeflateContext_methods);
258 	class_entry = zend_register_internal_class_ex(&ce, NULL);
259 	class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE;
260 
261 	return class_entry;
262 }
263