diff options
author | Máté Kocsis <kocsismate@woohoolabs.com> | 2020-04-19 20:05:16 +0200 |
---|---|---|
committer | Máté Kocsis <kocsismate@woohoolabs.com> | 2020-04-20 10:38:41 +0200 |
commit | 4815be44db6b7a73cabfa872dc17d7e1574e1930 (patch) | |
tree | 1acf5fda7957d12814f73654ef1e3b149ba39bc2 /ext/pcntl | |
parent | 8e9bc90004f09a0d67fdac393a8f3fca904be397 (diff) | |
download | php-git-4815be44db6b7a73cabfa872dc17d7e1574e1930.tar.gz |
Generate function entries from stubs
Converts ext/pcntl, ext/simplexml, ext/snmp, ext/soap, ext/sqlite3.
Closes GH-5421
Diffstat (limited to 'ext/pcntl')
-rw-r--r-- | ext/pcntl/pcntl.c | 45 | ||||
-rw-r--r-- | ext/pcntl/pcntl.stub.php | 4 | ||||
-rw-r--r-- | ext/pcntl/pcntl_arginfo.h | 90 |
3 files changed, 91 insertions, 48 deletions
diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c index a4554a61cd..a52429e549 100644 --- a/ext/pcntl/pcntl.c +++ b/ext/pcntl/pcntl.c @@ -57,53 +57,10 @@ ZEND_DECLARE_MODULE_GLOBALS(pcntl) static PHP_GINIT_FUNCTION(pcntl); -static const zend_function_entry pcntl_functions[] = { - PHP_FE(pcntl_fork, arginfo_pcntl_fork) - PHP_FE(pcntl_waitpid, arginfo_pcntl_waitpid) - PHP_FE(pcntl_wait, arginfo_pcntl_wait) - PHP_FE(pcntl_signal, arginfo_pcntl_signal) - PHP_FE(pcntl_signal_get_handler, arginfo_pcntl_signal_get_handler) - PHP_FE(pcntl_signal_dispatch, arginfo_pcntl_signal_dispatch) - PHP_FE(pcntl_wifexited, arginfo_pcntl_wifexited) - PHP_FE(pcntl_wifstopped, arginfo_pcntl_wifstopped) - PHP_FE(pcntl_wifsignaled, arginfo_pcntl_wifsignaled) - PHP_FE(pcntl_wexitstatus, arginfo_pcntl_wifexitstatus) - PHP_FE(pcntl_wtermsig, arginfo_pcntl_wtermsig) - PHP_FE(pcntl_wstopsig, arginfo_pcntl_wstopsig) - PHP_FE(pcntl_exec, arginfo_pcntl_exec) - PHP_FE(pcntl_alarm, arginfo_pcntl_alarm) - PHP_FE(pcntl_get_last_error, arginfo_pcntl_get_last_error) - PHP_FALIAS(pcntl_errno, pcntl_get_last_error, arginfo_pcntl_errno) - PHP_FE(pcntl_strerror, arginfo_pcntl_strerror) -#ifdef HAVE_GETPRIORITY - PHP_FE(pcntl_getpriority, arginfo_pcntl_getpriority) -#endif -#ifdef HAVE_SETPRIORITY - PHP_FE(pcntl_setpriority, arginfo_pcntl_setpriority) -#endif -#ifdef HAVE_SIGPROCMASK - PHP_FE(pcntl_sigprocmask, arginfo_pcntl_sigprocmask) -#endif -#ifdef HAVE_STRUCT_SIGINFO_T -# if HAVE_SIGWAITINFO && HAVE_SIGTIMEDWAIT - PHP_FE(pcntl_sigwaitinfo, arginfo_pcntl_sigwaitinfo) - PHP_FE(pcntl_sigtimedwait, arginfo_pcntl_sigtimedwait) -# endif -#endif -#ifdef HAVE_WCONTINUED - PHP_FE(pcntl_wifcontinued, arginfo_pcntl_wifcontinued) -#endif - PHP_FE(pcntl_async_signals, arginfo_pcntl_async_signals) -#ifdef HAVE_UNSHARE - PHP_FE(pcntl_unshare, arginfo_pcntl_unshare) -#endif - PHP_FE_END -}; - zend_module_entry pcntl_module_entry = { STANDARD_MODULE_HEADER, "pcntl", - pcntl_functions, + ext_functions, PHP_MINIT(pcntl), PHP_MSHUTDOWN(pcntl), PHP_RINIT(pcntl), diff --git a/ext/pcntl/pcntl.stub.php b/ext/pcntl/pcntl.stub.php index 82bac57316..60e9c98a7f 100644 --- a/ext/pcntl/pcntl.stub.php +++ b/ext/pcntl/pcntl.stub.php @@ -1,5 +1,7 @@ <?php +/** @generate-function-entries */ + function pcntl_fork(): int {} function pcntl_waitpid(int $pid, &$status, int $options = 0, &$rusage = []): int {} @@ -38,7 +40,7 @@ function pcntl_wifcontinued(int $status): bool {} function pcntl_wifsignaled(int $status): bool {} -function pcntl_wifexitstatus(int $status): int|false {} +function pcntl_wexitstatus(int $status): int|false {} function pcntl_wtermsig(int $status): int|false {} diff --git a/ext/pcntl/pcntl_arginfo.h b/ext/pcntl/pcntl_arginfo.h index 19c46e4725..e7dff8e379 100644 --- a/ext/pcntl/pcntl_arginfo.h +++ b/ext/pcntl/pcntl_arginfo.h @@ -67,13 +67,13 @@ ZEND_END_ARG_INFO() #define arginfo_pcntl_wifsignaled arginfo_pcntl_wifexited -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pcntl_wifexitstatus, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pcntl_wexitstatus, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, status, IS_LONG, 0) ZEND_END_ARG_INFO() -#define arginfo_pcntl_wtermsig arginfo_pcntl_wifexitstatus +#define arginfo_pcntl_wtermsig arginfo_pcntl_wexitstatus -#define arginfo_pcntl_wstopsig arginfo_pcntl_wifexitstatus +#define arginfo_pcntl_wstopsig arginfo_pcntl_wexitstatus ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pcntl_exec, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) @@ -117,3 +117,87 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pcntl_unshare, 0, 1, _IS_BOOL, 0 ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 0) ZEND_END_ARG_INFO() #endif + + +ZEND_FUNCTION(pcntl_fork); +ZEND_FUNCTION(pcntl_waitpid); +ZEND_FUNCTION(pcntl_wait); +ZEND_FUNCTION(pcntl_signal); +ZEND_FUNCTION(pcntl_signal_get_handler); +ZEND_FUNCTION(pcntl_signal_dispatch); +#if defined(HAVE_SIGPROCMASK) +ZEND_FUNCTION(pcntl_sigprocmask); +#endif +#if defined(HAVE_STRUCT_SIGINFO_T) && HAVE_SIGWAITINFO && HAVE_SIGTIMEDWAIT +ZEND_FUNCTION(pcntl_sigwaitinfo); +#endif +#if defined(HAVE_STRUCT_SIGINFO_T) && HAVE_SIGWAITINFO && HAVE_SIGTIMEDWAIT +ZEND_FUNCTION(pcntl_sigtimedwait); +#endif +ZEND_FUNCTION(pcntl_wifexited); +ZEND_FUNCTION(pcntl_wifstopped); +#if defined(HAVE_WCONTINUED) +ZEND_FUNCTION(pcntl_wifcontinued); +#endif +ZEND_FUNCTION(pcntl_wifsignaled); +ZEND_FUNCTION(pcntl_wexitstatus); +ZEND_FUNCTION(pcntl_wtermsig); +ZEND_FUNCTION(pcntl_wstopsig); +ZEND_FUNCTION(pcntl_exec); +ZEND_FUNCTION(pcntl_alarm); +ZEND_FUNCTION(pcntl_get_last_error); +#if defined(HAVE_GETPRIORITY) +ZEND_FUNCTION(pcntl_getpriority); +#endif +#if defined(HAVE_SETPRIORITY) +ZEND_FUNCTION(pcntl_setpriority); +#endif +ZEND_FUNCTION(pcntl_strerror); +ZEND_FUNCTION(pcntl_async_signals); +#if defined(HAVE_UNSHARE) +ZEND_FUNCTION(pcntl_unshare); +#endif + + +static const zend_function_entry ext_functions[] = { + ZEND_FE(pcntl_fork, arginfo_pcntl_fork) + ZEND_FE(pcntl_waitpid, arginfo_pcntl_waitpid) + ZEND_FE(pcntl_wait, arginfo_pcntl_wait) + ZEND_FE(pcntl_signal, arginfo_pcntl_signal) + ZEND_FE(pcntl_signal_get_handler, arginfo_pcntl_signal_get_handler) + ZEND_FE(pcntl_signal_dispatch, arginfo_pcntl_signal_dispatch) +#if defined(HAVE_SIGPROCMASK) + ZEND_FE(pcntl_sigprocmask, arginfo_pcntl_sigprocmask) +#endif +#if defined(HAVE_STRUCT_SIGINFO_T) && HAVE_SIGWAITINFO && HAVE_SIGTIMEDWAIT + ZEND_FE(pcntl_sigwaitinfo, arginfo_pcntl_sigwaitinfo) +#endif +#if defined(HAVE_STRUCT_SIGINFO_T) && HAVE_SIGWAITINFO && HAVE_SIGTIMEDWAIT + ZEND_FE(pcntl_sigtimedwait, arginfo_pcntl_sigtimedwait) +#endif + ZEND_FE(pcntl_wifexited, arginfo_pcntl_wifexited) + ZEND_FE(pcntl_wifstopped, arginfo_pcntl_wifstopped) +#if defined(HAVE_WCONTINUED) + ZEND_FE(pcntl_wifcontinued, arginfo_pcntl_wifcontinued) +#endif + ZEND_FE(pcntl_wifsignaled, arginfo_pcntl_wifsignaled) + ZEND_FE(pcntl_wexitstatus, arginfo_pcntl_wexitstatus) + ZEND_FE(pcntl_wtermsig, arginfo_pcntl_wtermsig) + ZEND_FE(pcntl_wstopsig, arginfo_pcntl_wstopsig) + ZEND_FE(pcntl_exec, arginfo_pcntl_exec) + ZEND_FE(pcntl_alarm, arginfo_pcntl_alarm) + ZEND_FE(pcntl_get_last_error, arginfo_pcntl_get_last_error) + ZEND_FALIAS(pcntl_errno, pcntl_get_last_error, arginfo_pcntl_errno) +#if defined(HAVE_GETPRIORITY) + ZEND_FE(pcntl_getpriority, arginfo_pcntl_getpriority) +#endif +#if defined(HAVE_SETPRIORITY) + ZEND_FE(pcntl_setpriority, arginfo_pcntl_setpriority) +#endif + ZEND_FE(pcntl_strerror, arginfo_pcntl_strerror) + ZEND_FE(pcntl_async_signals, arginfo_pcntl_async_signals) +#if defined(HAVE_UNSHARE) + ZEND_FE(pcntl_unshare, arginfo_pcntl_unshare) +#endif + ZEND_FE_END +}; |