Skip to content

Commit 5322de1

Browse files
committed
Generate functions entries from stubs for another set of extensions
Closes GH-5351
1 parent d5bbb28 commit 5322de1

34 files changed

+868
-811
lines changed

ext/filter/filter.c

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -78,26 +78,12 @@ static const filter_list_entry filter_list[] = {
7878
static unsigned int php_sapi_filter(int arg, char *var, char **val, size_t val_len, size_t *new_val_len);
7979
static unsigned int php_sapi_filter_init(void);
8080

81-
/* {{{ filter_functions[]
82-
*/
83-
static const zend_function_entry filter_functions[] = {
84-
PHP_FE(filter_input, arginfo_filter_input)
85-
PHP_FE(filter_var, arginfo_filter_var)
86-
PHP_FE(filter_input_array, arginfo_filter_input_array)
87-
PHP_FE(filter_var_array, arginfo_filter_var_array)
88-
PHP_FE(filter_list, arginfo_filter_list)
89-
PHP_FE(filter_has_var, arginfo_filter_has_var)
90-
PHP_FE(filter_id, arginfo_filter_id)
91-
PHP_FE_END
92-
};
93-
/* }}} */
94-
9581
/* {{{ filter_module_entry
9682
*/
9783
zend_module_entry filter_module_entry = {
9884
STANDARD_MODULE_HEADER,
9985
"filter",
100-
filter_functions,
86+
ext_functions,
10187
PHP_MINIT(filter),
10288
PHP_MSHUTDOWN(filter),
10389
NULL,

ext/filter/filter.stub.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
/** @generate-function-entries */
4+
35
function filter_has_var(int $type, string $variable_name): bool {}
46

57
/**

ext/filter/filter_arginfo.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,24 @@ ZEND_END_ARG_INFO()
3636
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_filter_id, 0, 1, MAY_BE_LONG|MAY_BE_FALSE)
3737
ZEND_ARG_TYPE_INFO(0, filtername, IS_STRING, 0)
3838
ZEND_END_ARG_INFO()
39+
40+
41+
ZEND_FUNCTION(filter_has_var);
42+
ZEND_FUNCTION(filter_input);
43+
ZEND_FUNCTION(filter_var);
44+
ZEND_FUNCTION(filter_input_array);
45+
ZEND_FUNCTION(filter_var_array);
46+
ZEND_FUNCTION(filter_list);
47+
ZEND_FUNCTION(filter_id);
48+
49+
50+
static const zend_function_entry ext_functions[] = {
51+
ZEND_FE(filter_has_var, arginfo_filter_has_var)
52+
ZEND_FE(filter_input, arginfo_filter_input)
53+
ZEND_FE(filter_var, arginfo_filter_var)
54+
ZEND_FE(filter_input_array, arginfo_filter_input_array)
55+
ZEND_FE(filter_var_array, arginfo_filter_var_array)
56+
ZEND_FE(filter_list, arginfo_filter_list)
57+
ZEND_FE(filter_id, arginfo_filter_id)
58+
ZEND_FE_END
59+
};

ext/filter/php_filter.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,6 @@ PHP_RINIT_FUNCTION(filter);
4242
PHP_RSHUTDOWN_FUNCTION(filter);
4343
PHP_MINFO_FUNCTION(filter);
4444

45-
PHP_FUNCTION(filter_input);
46-
PHP_FUNCTION(filter_var);
47-
PHP_FUNCTION(filter_input_array);
48-
PHP_FUNCTION(filter_var_array);
49-
PHP_FUNCTION(filter_list);
50-
PHP_FUNCTION(filter_has_var);
51-
PHP_FUNCTION(filter_id);
52-
5345
ZEND_BEGIN_MODULE_GLOBALS(filter)
5446
zval post_array;
5547
zval get_array;

ext/ftp/ftp.stub.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
/** @generate-function-entries */
4+
35
/** @return resource|false */
46
function ftp_connect(string $host, int $port = 21, int $timeout = 90) {}
57

ext/ftp/ftp_arginfo.h

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,3 +194,85 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ftp_get_option, 0, 2, MAY_BE_LON
194194
ZEND_ARG_INFO(0, ftp)
195195
ZEND_ARG_TYPE_INFO(0, option, IS_LONG, 0)
196196
ZEND_END_ARG_INFO()
197+
198+
199+
ZEND_FUNCTION(ftp_connect);
200+
#if defined(HAVE_FTP_SSL)
201+
ZEND_FUNCTION(ftp_ssl_connect);
202+
#endif
203+
ZEND_FUNCTION(ftp_login);
204+
ZEND_FUNCTION(ftp_pwd);
205+
ZEND_FUNCTION(ftp_cdup);
206+
ZEND_FUNCTION(ftp_chdir);
207+
ZEND_FUNCTION(ftp_exec);
208+
ZEND_FUNCTION(ftp_raw);
209+
ZEND_FUNCTION(ftp_mkdir);
210+
ZEND_FUNCTION(ftp_rmdir);
211+
ZEND_FUNCTION(ftp_chmod);
212+
ZEND_FUNCTION(ftp_alloc);
213+
ZEND_FUNCTION(ftp_nlist);
214+
ZEND_FUNCTION(ftp_rawlist);
215+
ZEND_FUNCTION(ftp_mlsd);
216+
ZEND_FUNCTION(ftp_systype);
217+
ZEND_FUNCTION(ftp_fget);
218+
ZEND_FUNCTION(ftp_nb_fget);
219+
ZEND_FUNCTION(ftp_pasv);
220+
ZEND_FUNCTION(ftp_get);
221+
ZEND_FUNCTION(ftp_nb_get);
222+
ZEND_FUNCTION(ftp_nb_continue);
223+
ZEND_FUNCTION(ftp_fput);
224+
ZEND_FUNCTION(ftp_nb_fput);
225+
ZEND_FUNCTION(ftp_put);
226+
ZEND_FUNCTION(ftp_append);
227+
ZEND_FUNCTION(ftp_nb_put);
228+
ZEND_FUNCTION(ftp_size);
229+
ZEND_FUNCTION(ftp_mdtm);
230+
ZEND_FUNCTION(ftp_rename);
231+
ZEND_FUNCTION(ftp_delete);
232+
ZEND_FUNCTION(ftp_site);
233+
ZEND_FUNCTION(ftp_close);
234+
ZEND_FUNCTION(ftp_set_option);
235+
ZEND_FUNCTION(ftp_get_option);
236+
237+
238+
static const zend_function_entry ext_functions[] = {
239+
ZEND_FE(ftp_connect, arginfo_ftp_connect)
240+
#if defined(HAVE_FTP_SSL)
241+
ZEND_FE(ftp_ssl_connect, arginfo_ftp_ssl_connect)
242+
#endif
243+
ZEND_FE(ftp_login, arginfo_ftp_login)
244+
ZEND_FE(ftp_pwd, arginfo_ftp_pwd)
245+
ZEND_FE(ftp_cdup, arginfo_ftp_cdup)
246+
ZEND_FE(ftp_chdir, arginfo_ftp_chdir)
247+
ZEND_FE(ftp_exec, arginfo_ftp_exec)
248+
ZEND_FE(ftp_raw, arginfo_ftp_raw)
249+
ZEND_FE(ftp_mkdir, arginfo_ftp_mkdir)
250+
ZEND_FE(ftp_rmdir, arginfo_ftp_rmdir)
251+
ZEND_FE(ftp_chmod, arginfo_ftp_chmod)
252+
ZEND_FE(ftp_alloc, arginfo_ftp_alloc)
253+
ZEND_FE(ftp_nlist, arginfo_ftp_nlist)
254+
ZEND_FE(ftp_rawlist, arginfo_ftp_rawlist)
255+
ZEND_FE(ftp_mlsd, arginfo_ftp_mlsd)
256+
ZEND_FE(ftp_systype, arginfo_ftp_systype)
257+
ZEND_FE(ftp_fget, arginfo_ftp_fget)
258+
ZEND_FE(ftp_nb_fget, arginfo_ftp_nb_fget)
259+
ZEND_FE(ftp_pasv, arginfo_ftp_pasv)
260+
ZEND_FE(ftp_get, arginfo_ftp_get)
261+
ZEND_FE(ftp_nb_get, arginfo_ftp_nb_get)
262+
ZEND_FE(ftp_nb_continue, arginfo_ftp_nb_continue)
263+
ZEND_FE(ftp_fput, arginfo_ftp_fput)
264+
ZEND_FE(ftp_nb_fput, arginfo_ftp_nb_fput)
265+
ZEND_FE(ftp_put, arginfo_ftp_put)
266+
ZEND_FE(ftp_append, arginfo_ftp_append)
267+
ZEND_FE(ftp_nb_put, arginfo_ftp_nb_put)
268+
ZEND_FE(ftp_size, arginfo_ftp_size)
269+
ZEND_FE(ftp_mdtm, arginfo_ftp_mdtm)
270+
ZEND_FE(ftp_rename, arginfo_ftp_rename)
271+
ZEND_FE(ftp_delete, arginfo_ftp_delete)
272+
ZEND_FE(ftp_site, arginfo_ftp_site)
273+
ZEND_FE(ftp_close, arginfo_ftp_close)
274+
ZEND_FALIAS(ftp_quit, ftp_close, arginfo_ftp_quit)
275+
ZEND_FE(ftp_set_option, arginfo_ftp_set_option)
276+
ZEND_FE(ftp_get_option, arginfo_ftp_get_option)
277+
ZEND_FE_END
278+
};

ext/ftp/php_ftp.c

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -37,54 +37,12 @@
3737
static int le_ftpbuf;
3838
#define le_ftpbuf_name "FTP Buffer"
3939

40-
static const zend_function_entry php_ftp_functions[] = {
41-
PHP_FE(ftp_connect, arginfo_ftp_connect)
42-
#ifdef HAVE_FTP_SSL
43-
PHP_FE(ftp_ssl_connect, arginfo_ftp_ssl_connect)
44-
#endif
45-
PHP_FE(ftp_login, arginfo_ftp_login)
46-
PHP_FE(ftp_pwd, arginfo_ftp_pwd)
47-
PHP_FE(ftp_cdup, arginfo_ftp_cdup)
48-
PHP_FE(ftp_chdir, arginfo_ftp_chdir)
49-
PHP_FE(ftp_exec, arginfo_ftp_exec)
50-
PHP_FE(ftp_raw, arginfo_ftp_raw)
51-
PHP_FE(ftp_mkdir, arginfo_ftp_mkdir)
52-
PHP_FE(ftp_rmdir, arginfo_ftp_rmdir)
53-
PHP_FE(ftp_chmod, arginfo_ftp_chmod)
54-
PHP_FE(ftp_alloc, arginfo_ftp_alloc)
55-
PHP_FE(ftp_nlist, arginfo_ftp_nlist)
56-
PHP_FE(ftp_rawlist, arginfo_ftp_rawlist)
57-
PHP_FE(ftp_mlsd, arginfo_ftp_mlsd)
58-
PHP_FE(ftp_systype, arginfo_ftp_systype)
59-
PHP_FE(ftp_pasv, arginfo_ftp_pasv)
60-
PHP_FE(ftp_get, arginfo_ftp_get)
61-
PHP_FE(ftp_fget, arginfo_ftp_fget)
62-
PHP_FE(ftp_put, arginfo_ftp_put)
63-
PHP_FE(ftp_append, arginfo_ftp_append)
64-
PHP_FE(ftp_fput, arginfo_ftp_fput)
65-
PHP_FE(ftp_size, arginfo_ftp_size)
66-
PHP_FE(ftp_mdtm, arginfo_ftp_mdtm)
67-
PHP_FE(ftp_rename, arginfo_ftp_rename)
68-
PHP_FE(ftp_delete, arginfo_ftp_delete)
69-
PHP_FE(ftp_site, arginfo_ftp_site)
70-
PHP_FE(ftp_close, arginfo_ftp_close)
71-
PHP_FE(ftp_set_option, arginfo_ftp_set_option)
72-
PHP_FE(ftp_get_option, arginfo_ftp_get_option)
73-
PHP_FE(ftp_nb_fget, arginfo_ftp_nb_fget)
74-
PHP_FE(ftp_nb_get, arginfo_ftp_nb_get)
75-
PHP_FE(ftp_nb_continue, arginfo_ftp_nb_continue)
76-
PHP_FE(ftp_nb_put, arginfo_ftp_nb_put)
77-
PHP_FE(ftp_nb_fput, arginfo_ftp_nb_fput)
78-
PHP_FALIAS(ftp_quit, ftp_close, arginfo_ftp_quit)
79-
PHP_FE_END
80-
};
81-
8240
zend_module_entry php_ftp_module_entry = {
8341
STANDARD_MODULE_HEADER_EX,
8442
NULL,
8543
NULL,
8644
"ftp",
87-
php_ftp_functions,
45+
ext_functions,
8846
PHP_MINIT(ftp),
8947
NULL,
9048
NULL,

ext/ftp/php_ftp.h

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -34,44 +34,6 @@ extern zend_module_entry php_ftp_module_entry;
3434
PHP_MINIT_FUNCTION(ftp);
3535
PHP_MINFO_FUNCTION(ftp);
3636

37-
PHP_FUNCTION(ftp_connect);
38-
#ifdef HAVE_FTP_SSL
39-
PHP_FUNCTION(ftp_ssl_connect);
40-
#endif
41-
PHP_FUNCTION(ftp_login);
42-
PHP_FUNCTION(ftp_pwd);
43-
PHP_FUNCTION(ftp_cdup);
44-
PHP_FUNCTION(ftp_chdir);
45-
PHP_FUNCTION(ftp_exec);
46-
PHP_FUNCTION(ftp_raw);
47-
PHP_FUNCTION(ftp_mkdir);
48-
PHP_FUNCTION(ftp_rmdir);
49-
PHP_FUNCTION(ftp_chmod);
50-
PHP_FUNCTION(ftp_alloc);
51-
PHP_FUNCTION(ftp_nlist);
52-
PHP_FUNCTION(ftp_rawlist);
53-
PHP_FUNCTION(ftp_mlsd);
54-
PHP_FUNCTION(ftp_systype);
55-
PHP_FUNCTION(ftp_pasv);
56-
PHP_FUNCTION(ftp_get);
57-
PHP_FUNCTION(ftp_fget);
58-
PHP_FUNCTION(ftp_put);
59-
PHP_FUNCTION(ftp_append);
60-
PHP_FUNCTION(ftp_fput);
61-
PHP_FUNCTION(ftp_size);
62-
PHP_FUNCTION(ftp_mdtm);
63-
PHP_FUNCTION(ftp_rename);
64-
PHP_FUNCTION(ftp_delete);
65-
PHP_FUNCTION(ftp_site);
66-
PHP_FUNCTION(ftp_close);
67-
PHP_FUNCTION(ftp_set_option);
68-
PHP_FUNCTION(ftp_get_option);
69-
PHP_FUNCTION(ftp_nb_get);
70-
PHP_FUNCTION(ftp_nb_fget);
71-
PHP_FUNCTION(ftp_nb_put);
72-
PHP_FUNCTION(ftp_nb_fput);
73-
PHP_FUNCTION(ftp_nb_continue);
74-
7537
#define phpext_ftp_ptr php_ftp_module_ptr
7638

7739
#else

0 commit comments

Comments
 (0)