Skip to content

Generate functions entries from stubs for another set of extensions #5351

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions ext/filter/filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,26 +78,12 @@ static const filter_list_entry filter_list[] = {
static unsigned int php_sapi_filter(int arg, char *var, char **val, size_t val_len, size_t *new_val_len);
static unsigned int php_sapi_filter_init(void);

/* {{{ filter_functions[]
*/
static const zend_function_entry filter_functions[] = {
PHP_FE(filter_input, arginfo_filter_input)
PHP_FE(filter_var, arginfo_filter_var)
PHP_FE(filter_input_array, arginfo_filter_input_array)
PHP_FE(filter_var_array, arginfo_filter_var_array)
PHP_FE(filter_list, arginfo_filter_list)
PHP_FE(filter_has_var, arginfo_filter_has_var)
PHP_FE(filter_id, arginfo_filter_id)
PHP_FE_END
};
/* }}} */

/* {{{ filter_module_entry
*/
zend_module_entry filter_module_entry = {
STANDARD_MODULE_HEADER,
"filter",
filter_functions,
ext_functions,
PHP_MINIT(filter),
PHP_MSHUTDOWN(filter),
NULL,
Expand Down
2 changes: 2 additions & 0 deletions ext/filter/filter.stub.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

/** @generate-function-entries */

function filter_has_var(int $type, string $variable_name): bool {}

/**
Expand Down
21 changes: 21 additions & 0 deletions ext/filter/filter_arginfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,24 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_filter_id, 0, 1, MAY_BE_LONG|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, filtername, IS_STRING, 0)
ZEND_END_ARG_INFO()


ZEND_FUNCTION(filter_has_var);
ZEND_FUNCTION(filter_input);
ZEND_FUNCTION(filter_var);
ZEND_FUNCTION(filter_input_array);
ZEND_FUNCTION(filter_var_array);
ZEND_FUNCTION(filter_list);
ZEND_FUNCTION(filter_id);


static const zend_function_entry ext_functions[] = {
ZEND_FE(filter_has_var, arginfo_filter_has_var)
ZEND_FE(filter_input, arginfo_filter_input)
ZEND_FE(filter_var, arginfo_filter_var)
ZEND_FE(filter_input_array, arginfo_filter_input_array)
ZEND_FE(filter_var_array, arginfo_filter_var_array)
ZEND_FE(filter_list, arginfo_filter_list)
ZEND_FE(filter_id, arginfo_filter_id)
ZEND_FE_END
};
8 changes: 0 additions & 8 deletions ext/filter/php_filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,6 @@ PHP_RINIT_FUNCTION(filter);
PHP_RSHUTDOWN_FUNCTION(filter);
PHP_MINFO_FUNCTION(filter);

PHP_FUNCTION(filter_input);
PHP_FUNCTION(filter_var);
PHP_FUNCTION(filter_input_array);
PHP_FUNCTION(filter_var_array);
PHP_FUNCTION(filter_list);
PHP_FUNCTION(filter_has_var);
PHP_FUNCTION(filter_id);

ZEND_BEGIN_MODULE_GLOBALS(filter)
zval post_array;
zval get_array;
Expand Down
2 changes: 2 additions & 0 deletions ext/ftp/ftp.stub.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

/** @generate-function-entries */

/** @return resource|false */
function ftp_connect(string $host, int $port = 21, int $timeout = 90) {}

Expand Down
82 changes: 82 additions & 0 deletions ext/ftp/ftp_arginfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,3 +194,85 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ftp_get_option, 0, 2, MAY_BE_LON
ZEND_ARG_INFO(0, ftp)
ZEND_ARG_TYPE_INFO(0, option, IS_LONG, 0)
ZEND_END_ARG_INFO()


ZEND_FUNCTION(ftp_connect);
#if defined(HAVE_FTP_SSL)
ZEND_FUNCTION(ftp_ssl_connect);
#endif
ZEND_FUNCTION(ftp_login);
ZEND_FUNCTION(ftp_pwd);
ZEND_FUNCTION(ftp_cdup);
ZEND_FUNCTION(ftp_chdir);
ZEND_FUNCTION(ftp_exec);
ZEND_FUNCTION(ftp_raw);
ZEND_FUNCTION(ftp_mkdir);
ZEND_FUNCTION(ftp_rmdir);
ZEND_FUNCTION(ftp_chmod);
ZEND_FUNCTION(ftp_alloc);
ZEND_FUNCTION(ftp_nlist);
ZEND_FUNCTION(ftp_rawlist);
ZEND_FUNCTION(ftp_mlsd);
ZEND_FUNCTION(ftp_systype);
ZEND_FUNCTION(ftp_fget);
ZEND_FUNCTION(ftp_nb_fget);
ZEND_FUNCTION(ftp_pasv);
ZEND_FUNCTION(ftp_get);
ZEND_FUNCTION(ftp_nb_get);
ZEND_FUNCTION(ftp_nb_continue);
ZEND_FUNCTION(ftp_fput);
ZEND_FUNCTION(ftp_nb_fput);
ZEND_FUNCTION(ftp_put);
ZEND_FUNCTION(ftp_append);
ZEND_FUNCTION(ftp_nb_put);
ZEND_FUNCTION(ftp_size);
ZEND_FUNCTION(ftp_mdtm);
ZEND_FUNCTION(ftp_rename);
ZEND_FUNCTION(ftp_delete);
ZEND_FUNCTION(ftp_site);
ZEND_FUNCTION(ftp_close);
ZEND_FUNCTION(ftp_set_option);
ZEND_FUNCTION(ftp_get_option);


static const zend_function_entry ext_functions[] = {
ZEND_FE(ftp_connect, arginfo_ftp_connect)
#if defined(HAVE_FTP_SSL)
ZEND_FE(ftp_ssl_connect, arginfo_ftp_ssl_connect)
#endif
ZEND_FE(ftp_login, arginfo_ftp_login)
ZEND_FE(ftp_pwd, arginfo_ftp_pwd)
ZEND_FE(ftp_cdup, arginfo_ftp_cdup)
ZEND_FE(ftp_chdir, arginfo_ftp_chdir)
ZEND_FE(ftp_exec, arginfo_ftp_exec)
ZEND_FE(ftp_raw, arginfo_ftp_raw)
ZEND_FE(ftp_mkdir, arginfo_ftp_mkdir)
ZEND_FE(ftp_rmdir, arginfo_ftp_rmdir)
ZEND_FE(ftp_chmod, arginfo_ftp_chmod)
ZEND_FE(ftp_alloc, arginfo_ftp_alloc)
ZEND_FE(ftp_nlist, arginfo_ftp_nlist)
ZEND_FE(ftp_rawlist, arginfo_ftp_rawlist)
ZEND_FE(ftp_mlsd, arginfo_ftp_mlsd)
ZEND_FE(ftp_systype, arginfo_ftp_systype)
ZEND_FE(ftp_fget, arginfo_ftp_fget)
ZEND_FE(ftp_nb_fget, arginfo_ftp_nb_fget)
ZEND_FE(ftp_pasv, arginfo_ftp_pasv)
ZEND_FE(ftp_get, arginfo_ftp_get)
ZEND_FE(ftp_nb_get, arginfo_ftp_nb_get)
ZEND_FE(ftp_nb_continue, arginfo_ftp_nb_continue)
ZEND_FE(ftp_fput, arginfo_ftp_fput)
ZEND_FE(ftp_nb_fput, arginfo_ftp_nb_fput)
ZEND_FE(ftp_put, arginfo_ftp_put)
ZEND_FE(ftp_append, arginfo_ftp_append)
ZEND_FE(ftp_nb_put, arginfo_ftp_nb_put)
ZEND_FE(ftp_size, arginfo_ftp_size)
ZEND_FE(ftp_mdtm, arginfo_ftp_mdtm)
ZEND_FE(ftp_rename, arginfo_ftp_rename)
ZEND_FE(ftp_delete, arginfo_ftp_delete)
ZEND_FE(ftp_site, arginfo_ftp_site)
ZEND_FE(ftp_close, arginfo_ftp_close)
ZEND_FALIAS(ftp_quit, ftp_close, arginfo_ftp_quit)
ZEND_FE(ftp_set_option, arginfo_ftp_set_option)
ZEND_FE(ftp_get_option, arginfo_ftp_get_option)
ZEND_FE_END
};
44 changes: 1 addition & 43 deletions ext/ftp/php_ftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,54 +37,12 @@
static int le_ftpbuf;
#define le_ftpbuf_name "FTP Buffer"

static const zend_function_entry php_ftp_functions[] = {
PHP_FE(ftp_connect, arginfo_ftp_connect)
#ifdef HAVE_FTP_SSL
PHP_FE(ftp_ssl_connect, arginfo_ftp_ssl_connect)
#endif
PHP_FE(ftp_login, arginfo_ftp_login)
PHP_FE(ftp_pwd, arginfo_ftp_pwd)
PHP_FE(ftp_cdup, arginfo_ftp_cdup)
PHP_FE(ftp_chdir, arginfo_ftp_chdir)
PHP_FE(ftp_exec, arginfo_ftp_exec)
PHP_FE(ftp_raw, arginfo_ftp_raw)
PHP_FE(ftp_mkdir, arginfo_ftp_mkdir)
PHP_FE(ftp_rmdir, arginfo_ftp_rmdir)
PHP_FE(ftp_chmod, arginfo_ftp_chmod)
PHP_FE(ftp_alloc, arginfo_ftp_alloc)
PHP_FE(ftp_nlist, arginfo_ftp_nlist)
PHP_FE(ftp_rawlist, arginfo_ftp_rawlist)
PHP_FE(ftp_mlsd, arginfo_ftp_mlsd)
PHP_FE(ftp_systype, arginfo_ftp_systype)
PHP_FE(ftp_pasv, arginfo_ftp_pasv)
PHP_FE(ftp_get, arginfo_ftp_get)
PHP_FE(ftp_fget, arginfo_ftp_fget)
PHP_FE(ftp_put, arginfo_ftp_put)
PHP_FE(ftp_append, arginfo_ftp_append)
PHP_FE(ftp_fput, arginfo_ftp_fput)
PHP_FE(ftp_size, arginfo_ftp_size)
PHP_FE(ftp_mdtm, arginfo_ftp_mdtm)
PHP_FE(ftp_rename, arginfo_ftp_rename)
PHP_FE(ftp_delete, arginfo_ftp_delete)
PHP_FE(ftp_site, arginfo_ftp_site)
PHP_FE(ftp_close, arginfo_ftp_close)
PHP_FE(ftp_set_option, arginfo_ftp_set_option)
PHP_FE(ftp_get_option, arginfo_ftp_get_option)
PHP_FE(ftp_nb_fget, arginfo_ftp_nb_fget)
PHP_FE(ftp_nb_get, arginfo_ftp_nb_get)
PHP_FE(ftp_nb_continue, arginfo_ftp_nb_continue)
PHP_FE(ftp_nb_put, arginfo_ftp_nb_put)
PHP_FE(ftp_nb_fput, arginfo_ftp_nb_fput)
PHP_FALIAS(ftp_quit, ftp_close, arginfo_ftp_quit)
PHP_FE_END
};

zend_module_entry php_ftp_module_entry = {
STANDARD_MODULE_HEADER_EX,
NULL,
NULL,
"ftp",
php_ftp_functions,
ext_functions,
PHP_MINIT(ftp),
NULL,
NULL,
Expand Down
38 changes: 0 additions & 38 deletions ext/ftp/php_ftp.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,44 +34,6 @@ extern zend_module_entry php_ftp_module_entry;
PHP_MINIT_FUNCTION(ftp);
PHP_MINFO_FUNCTION(ftp);

PHP_FUNCTION(ftp_connect);
#ifdef HAVE_FTP_SSL
PHP_FUNCTION(ftp_ssl_connect);
#endif
PHP_FUNCTION(ftp_login);
PHP_FUNCTION(ftp_pwd);
PHP_FUNCTION(ftp_cdup);
PHP_FUNCTION(ftp_chdir);
PHP_FUNCTION(ftp_exec);
PHP_FUNCTION(ftp_raw);
PHP_FUNCTION(ftp_mkdir);
PHP_FUNCTION(ftp_rmdir);
PHP_FUNCTION(ftp_chmod);
PHP_FUNCTION(ftp_alloc);
PHP_FUNCTION(ftp_nlist);
PHP_FUNCTION(ftp_rawlist);
PHP_FUNCTION(ftp_mlsd);
PHP_FUNCTION(ftp_systype);
PHP_FUNCTION(ftp_pasv);
PHP_FUNCTION(ftp_get);
PHP_FUNCTION(ftp_fget);
PHP_FUNCTION(ftp_put);
PHP_FUNCTION(ftp_append);
PHP_FUNCTION(ftp_fput);
PHP_FUNCTION(ftp_size);
PHP_FUNCTION(ftp_mdtm);
PHP_FUNCTION(ftp_rename);
PHP_FUNCTION(ftp_delete);
PHP_FUNCTION(ftp_site);
PHP_FUNCTION(ftp_close);
PHP_FUNCTION(ftp_set_option);
PHP_FUNCTION(ftp_get_option);
PHP_FUNCTION(ftp_nb_get);
PHP_FUNCTION(ftp_nb_fget);
PHP_FUNCTION(ftp_nb_put);
PHP_FUNCTION(ftp_nb_fput);
PHP_FUNCTION(ftp_nb_continue);

#define phpext_ftp_ptr php_ftp_module_ptr

#else
Expand Down
Loading