xref: /php-src/ext/zlib/zlib_arginfo.h (revision 6d1881b4)
1 /* This is a generated file, edit the .stub.php file instead.
2  * Stub hash: 65271ce06d23b397180a8dbbcecdb0cde5c6942b */
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_BOOL, 0, "false")
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_BOOL, 0, "false")
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_BOOL, 0, "false")
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 ZEND_FUNCTION(ob_gzhandler);
136 ZEND_FUNCTION(zlib_get_coding_type);
137 ZEND_FUNCTION(gzfile);
138 ZEND_FUNCTION(gzopen);
139 ZEND_FUNCTION(readgzfile);
140 ZEND_FUNCTION(zlib_encode);
141 ZEND_FUNCTION(zlib_decode);
142 ZEND_FUNCTION(gzdeflate);
143 ZEND_FUNCTION(gzencode);
144 ZEND_FUNCTION(gzcompress);
145 ZEND_FUNCTION(gzinflate);
146 ZEND_FUNCTION(gzdecode);
147 ZEND_FUNCTION(gzuncompress);
148 ZEND_FUNCTION(fwrite);
149 ZEND_FUNCTION(rewind);
150 ZEND_FUNCTION(fclose);
151 ZEND_FUNCTION(feof);
152 ZEND_FUNCTION(fgetc);
153 ZEND_FUNCTION(fpassthru);
154 ZEND_FUNCTION(fseek);
155 ZEND_FUNCTION(ftell);
156 ZEND_FUNCTION(fread);
157 ZEND_FUNCTION(fgets);
158 ZEND_FUNCTION(deflate_init);
159 ZEND_FUNCTION(deflate_add);
160 ZEND_FUNCTION(inflate_init);
161 ZEND_FUNCTION(inflate_add);
162 ZEND_FUNCTION(inflate_get_status);
163 ZEND_FUNCTION(inflate_get_read_len);
164 
165 static const zend_function_entry ext_functions[] = {
166 	ZEND_FE(ob_gzhandler, arginfo_ob_gzhandler)
167 	ZEND_FE(zlib_get_coding_type, arginfo_zlib_get_coding_type)
168 	ZEND_FE(gzfile, arginfo_gzfile)
169 	ZEND_FE(gzopen, arginfo_gzopen)
170 	ZEND_FE(readgzfile, arginfo_readgzfile)
171 	ZEND_FE(zlib_encode, arginfo_zlib_encode)
172 	ZEND_FE(zlib_decode, arginfo_zlib_decode)
173 	ZEND_FE(gzdeflate, arginfo_gzdeflate)
174 	ZEND_FE(gzencode, arginfo_gzencode)
175 	ZEND_FE(gzcompress, arginfo_gzcompress)
176 	ZEND_FE(gzinflate, arginfo_gzinflate)
177 	ZEND_FE(gzdecode, arginfo_gzdecode)
178 	ZEND_FE(gzuncompress, arginfo_gzuncompress)
179 	ZEND_RAW_FENTRY("gzwrite", zif_fwrite, arginfo_gzwrite, 0, NULL, NULL)
180 	ZEND_RAW_FENTRY("gzputs", zif_fwrite, arginfo_gzputs, 0, NULL, NULL)
181 	ZEND_RAW_FENTRY("gzrewind", zif_rewind, arginfo_gzrewind, 0, NULL, NULL)
182 	ZEND_RAW_FENTRY("gzclose", zif_fclose, arginfo_gzclose, 0, NULL, NULL)
183 	ZEND_RAW_FENTRY("gzeof", zif_feof, arginfo_gzeof, 0, NULL, NULL)
184 	ZEND_RAW_FENTRY("gzgetc", zif_fgetc, arginfo_gzgetc, 0, NULL, NULL)
185 	ZEND_RAW_FENTRY("gzpassthru", zif_fpassthru, arginfo_gzpassthru, 0, NULL, NULL)
186 	ZEND_RAW_FENTRY("gzseek", zif_fseek, arginfo_gzseek, 0, NULL, NULL)
187 	ZEND_RAW_FENTRY("gztell", zif_ftell, arginfo_gztell, 0, NULL, NULL)
188 	ZEND_RAW_FENTRY("gzread", zif_fread, arginfo_gzread, 0, NULL, NULL)
189 	ZEND_RAW_FENTRY("gzgets", zif_fgets, arginfo_gzgets, 0, NULL, NULL)
190 	ZEND_FE(deflate_init, arginfo_deflate_init)
191 	ZEND_FE(deflate_add, arginfo_deflate_add)
192 	ZEND_FE(inflate_init, arginfo_inflate_init)
193 	ZEND_FE(inflate_add, arginfo_inflate_add)
194 	ZEND_FE(inflate_get_status, arginfo_inflate_get_status)
195 	ZEND_FE(inflate_get_read_len, arginfo_inflate_get_read_len)
196 	ZEND_FE_END
197 };
198 
register_zlib_symbols(int module_number)199 static void register_zlib_symbols(int module_number)
200 {
201 	REGISTER_LONG_CONSTANT("FORCE_GZIP", PHP_ZLIB_ENCODING_GZIP, CONST_PERSISTENT);
202 	REGISTER_LONG_CONSTANT("FORCE_DEFLATE", PHP_ZLIB_ENCODING_DEFLATE, CONST_PERSISTENT);
203 	REGISTER_LONG_CONSTANT("ZLIB_ENCODING_RAW", PHP_ZLIB_ENCODING_RAW, CONST_PERSISTENT);
204 	REGISTER_LONG_CONSTANT("ZLIB_ENCODING_GZIP", PHP_ZLIB_ENCODING_GZIP, CONST_PERSISTENT);
205 	REGISTER_LONG_CONSTANT("ZLIB_ENCODING_DEFLATE", PHP_ZLIB_ENCODING_DEFLATE, CONST_PERSISTENT);
206 	REGISTER_LONG_CONSTANT("ZLIB_NO_FLUSH", Z_NO_FLUSH, CONST_PERSISTENT);
207 	REGISTER_LONG_CONSTANT("ZLIB_PARTIAL_FLUSH", Z_PARTIAL_FLUSH, CONST_PERSISTENT);
208 	REGISTER_LONG_CONSTANT("ZLIB_SYNC_FLUSH", Z_SYNC_FLUSH, CONST_PERSISTENT);
209 	REGISTER_LONG_CONSTANT("ZLIB_FULL_FLUSH", Z_FULL_FLUSH, CONST_PERSISTENT);
210 	REGISTER_LONG_CONSTANT("ZLIB_BLOCK", Z_BLOCK, CONST_PERSISTENT);
211 	REGISTER_LONG_CONSTANT("ZLIB_FINISH", Z_FINISH, CONST_PERSISTENT);
212 	REGISTER_LONG_CONSTANT("ZLIB_FILTERED", Z_FILTERED, CONST_PERSISTENT);
213 	REGISTER_LONG_CONSTANT("ZLIB_HUFFMAN_ONLY", Z_HUFFMAN_ONLY, CONST_PERSISTENT);
214 	REGISTER_LONG_CONSTANT("ZLIB_RLE", Z_RLE, CONST_PERSISTENT);
215 	REGISTER_LONG_CONSTANT("ZLIB_FIXED", Z_FIXED, CONST_PERSISTENT);
216 	REGISTER_LONG_CONSTANT("ZLIB_DEFAULT_STRATEGY", Z_DEFAULT_STRATEGY, CONST_PERSISTENT);
217 	REGISTER_STRING_CONSTANT("ZLIB_VERSION", ZLIB_VERSION, CONST_PERSISTENT);
218 	REGISTER_LONG_CONSTANT("ZLIB_VERNUM", ZLIB_VERNUM, CONST_PERSISTENT);
219 	REGISTER_LONG_CONSTANT("ZLIB_OK", Z_OK, CONST_PERSISTENT);
220 	REGISTER_LONG_CONSTANT("ZLIB_STREAM_END", Z_STREAM_END, CONST_PERSISTENT);
221 	REGISTER_LONG_CONSTANT("ZLIB_NEED_DICT", Z_NEED_DICT, CONST_PERSISTENT);
222 	REGISTER_LONG_CONSTANT("ZLIB_ERRNO", Z_ERRNO, CONST_PERSISTENT);
223 	REGISTER_LONG_CONSTANT("ZLIB_STREAM_ERROR", Z_STREAM_ERROR, CONST_PERSISTENT);
224 	REGISTER_LONG_CONSTANT("ZLIB_DATA_ERROR", Z_DATA_ERROR, CONST_PERSISTENT);
225 	REGISTER_LONG_CONSTANT("ZLIB_MEM_ERROR", Z_MEM_ERROR, CONST_PERSISTENT);
226 	REGISTER_LONG_CONSTANT("ZLIB_BUF_ERROR", Z_BUF_ERROR, CONST_PERSISTENT);
227 	REGISTER_LONG_CONSTANT("ZLIB_VERSION_ERROR", Z_VERSION_ERROR, CONST_PERSISTENT);
228 }
229 
register_class_InflateContext(void)230 static zend_class_entry *register_class_InflateContext(void)
231 {
232 	zend_class_entry ce, *class_entry;
233 
234 	INIT_CLASS_ENTRY(ce, "InflateContext", NULL);
235 	class_entry = zend_register_internal_class_with_flags(&ce, NULL, ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE);
236 
237 	return class_entry;
238 }
239 
register_class_DeflateContext(void)240 static zend_class_entry *register_class_DeflateContext(void)
241 {
242 	zend_class_entry ce, *class_entry;
243 
244 	INIT_CLASS_ENTRY(ce, "DeflateContext", NULL);
245 	class_entry = zend_register_internal_class_with_flags(&ce, NULL, ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE);
246 
247 	return class_entry;
248 }
249