Added shmop arginfo stubs

This commit is contained in:
Stephen Reay 2019-08-12 00:24:29 +07:00 committed by Christoph M. Becker
parent 47b95bd83c
commit 93efcaa9c3
3 changed files with 64 additions and 33 deletions

View File

@ -0,0 +1,32 @@
<?php
/** @return resource|false */
function shmop_open(int $key, string $flags, int $mode, int $size) {}
/**
* @param resource $shmid
* @return string|false
*/
function shmop_read($shmid, int $start, int $count) {}
/**
* @param resource $shmid
*/
function shmop_close($shmid): bool {}
/**
* @param resource $shmid
* @return int|false
*/
function shmop_size($shmid) {}
/**
* @param resource $shmid
* @return int|false
*/
function shmop_write($shmid, string $data, int $offset) {}
/**
* @param resource $shmid
*/
function shmop_delete($shmid): bool {}

View File

@ -0,0 +1,30 @@
/* This is a generated file, edit the .stub.php file instead. */
ZEND_BEGIN_ARG_INFO_EX(arginfo_shmop_open, 0, 0, 4)
ZEND_ARG_TYPE_INFO(0, key, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, flags, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, mode, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, size, IS_LONG, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_shmop_read, 0, 0, 3)
ZEND_ARG_INFO(0, shmid)
ZEND_ARG_TYPE_INFO(0, start, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, count, IS_LONG, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_shmop_close, 0, 1, _IS_BOOL, 0)
ZEND_ARG_INFO(0, shmid)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_shmop_size, 0, 0, 1)
ZEND_ARG_INFO(0, shmid)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_shmop_write, 0, 0, 3)
ZEND_ARG_INFO(0, shmid)
ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0)
ZEND_END_ARG_INFO()
#define arginfo_shmop_delete arginfo_shmop_close

View File

@ -24,6 +24,8 @@
#include "php.h"
#include "php_ini.h"
#include "php_shmop.h"
#include "php_shmop_arginfo.h"
# ifndef PHP_WIN32
# include <sys/ipc.h>
# include <sys/shm.h>
@ -44,39 +46,6 @@ php_shmop_globals shmop_globals;
int shm_type;
/* {{{ arginfo */
ZEND_BEGIN_ARG_INFO_EX(arginfo_shmop_open, 0, 0, 4)
ZEND_ARG_INFO(0, key)
ZEND_ARG_INFO(0, flags)
ZEND_ARG_INFO(0, mode)
ZEND_ARG_INFO(0, size)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_shmop_read, 0, 0, 3)
ZEND_ARG_INFO(0, shmid)
ZEND_ARG_INFO(0, start)
ZEND_ARG_INFO(0, count)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_shmop_close, 0, 0, 1)
ZEND_ARG_INFO(0, shmid)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_shmop_size, 0, 0, 1)
ZEND_ARG_INFO(0, shmid)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_shmop_write, 0, 0, 3)
ZEND_ARG_INFO(0, shmid)
ZEND_ARG_INFO(0, data)
ZEND_ARG_INFO(0, offset)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_shmop_delete, 0, 0, 1)
ZEND_ARG_INFO(0, shmid)
ZEND_END_ARG_INFO()
/* }}} */
/* {{{ shmop_functions[]
*/
static const zend_function_entry shmop_functions[] = {