mirror of
https://github.com/pcsc-for-php/pcsc.git
synced 2026-08-08 21:09:26 +02:00
generate arginfo from stub file
This commit is contained in:
parent
71ee080987
commit
7849799fe7
5 changed files with 201 additions and 54 deletions
|
|
@ -40,6 +40,9 @@ http://pear.php.net/dtd/package-2.0.xsd">
|
||||||
<file name="config.w32" role="src" />
|
<file name="config.w32" role="src" />
|
||||||
<file name="pcsc.c" role="src" />
|
<file name="pcsc.c" role="src" />
|
||||||
<file name="php_pcsc.h" role="src" />
|
<file name="php_pcsc.h" role="src" />
|
||||||
|
<file name="pcsc.stub.php" role="src" />
|
||||||
|
<file name="pcsc_arginfo.h" role="src" />
|
||||||
|
<file name="pcsc_legacy_arginfo.h" role="src" />
|
||||||
<file name="TODO" role="doc" />
|
<file name="TODO" role="doc" />
|
||||||
</dir> <!-- / -->
|
</dir> <!-- / -->
|
||||||
</contents>
|
</contents>
|
||||||
|
|
|
||||||
60
pcsc.c
60
pcsc.c
|
|
@ -36,59 +36,11 @@ ZEND_DECLARE_MODULE_GLOBALS(pcsc);
|
||||||
#define TRUE 1
|
#define TRUE 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* arg info for scard_connect (accepts an optional compile-time reference parameter) */
|
#if PHP_VERSION_ID < 80000
|
||||||
ZEND_BEGIN_ARG_INFO_EX(php_pcsc_scard_connect_arginfo, 0, 0, 2)
|
#include "pcsc_legacy_arginfo.h"
|
||||||
ZEND_ARG_INFO(0, context)
|
#else
|
||||||
ZEND_ARG_INFO(0, reader_name)
|
#include "pcsc_arginfo.h"
|
||||||
ZEND_ARG_INFO(0, preferred_protocol)
|
#endif
|
||||||
ZEND_ARG_INFO(1, active_protocol)
|
|
||||||
ZEND_END_ARG_INFO()
|
|
||||||
|
|
||||||
ZEND_BEGIN_ARG_INFO_EX(php_pcsc_scard_void, 0, 0, 0)
|
|
||||||
ZEND_END_ARG_INFO()
|
|
||||||
|
|
||||||
ZEND_BEGIN_ARG_INFO_EX(php_pcsc_scard_context, 0, 0, 1)
|
|
||||||
ZEND_ARG_INFO(0, context)
|
|
||||||
ZEND_END_ARG_INFO()
|
|
||||||
|
|
||||||
ZEND_BEGIN_ARG_INFO_EX(php_pcsc_scard_disconnect, 0, 0, 1)
|
|
||||||
ZEND_ARG_INFO(0, card)
|
|
||||||
ZEND_ARG_INFO(0, disposition)
|
|
||||||
ZEND_END_ARG_INFO()
|
|
||||||
|
|
||||||
ZEND_BEGIN_ARG_INFO_EX(php_pcsc_scard_transmit, 0, 0, 2)
|
|
||||||
ZEND_ARG_INFO(0, card)
|
|
||||||
ZEND_ARG_INFO(0, command)
|
|
||||||
ZEND_END_ARG_INFO()
|
|
||||||
|
|
||||||
ZEND_BEGIN_ARG_INFO_EX(php_pcsc_scard_card, 0, 0, 1)
|
|
||||||
ZEND_ARG_INFO(0, card)
|
|
||||||
ZEND_END_ARG_INFO()
|
|
||||||
|
|
||||||
ZEND_BEGIN_ARG_INFO_EX(php_pcsc_scard_errstr, 0, 0, 1)
|
|
||||||
ZEND_ARG_INFO(0, errno)
|
|
||||||
ZEND_END_ARG_INFO()
|
|
||||||
|
|
||||||
/* {{{ pcsc_functions[]
|
|
||||||
*
|
|
||||||
* Every user visible function must have an entry in pcsc_functions[].
|
|
||||||
*/
|
|
||||||
zend_function_entry pcsc_functions[] = {
|
|
||||||
PHP_FE(scard_establish_context, php_pcsc_scard_void)
|
|
||||||
PHP_FE(scard_release_context, php_pcsc_scard_context)
|
|
||||||
PHP_FE(scard_is_valid_context, php_pcsc_scard_context)
|
|
||||||
PHP_FE(scard_list_readers, php_pcsc_scard_context)
|
|
||||||
PHP_FE(scard_connect, php_pcsc_scard_connect_arginfo)
|
|
||||||
//PHP_FE(scard_reconnect, NULL)
|
|
||||||
PHP_FE(scard_disconnect, php_pcsc_scard_disconnect)
|
|
||||||
PHP_FE(scard_transmit, php_pcsc_scard_transmit)
|
|
||||||
PHP_FE(scard_status, php_pcsc_scard_card)
|
|
||||||
//PHP_FE(scard_get_status_change, NULL)
|
|
||||||
PHP_FE(scard_last_errno, php_pcsc_scard_void)
|
|
||||||
PHP_FE(scard_errstr, php_pcsc_scard_errstr)
|
|
||||||
PHP_FE_END
|
|
||||||
};
|
|
||||||
/* }}} */
|
|
||||||
|
|
||||||
/* {{{ pcsc_module_entry
|
/* {{{ pcsc_module_entry
|
||||||
*/
|
*/
|
||||||
|
|
@ -97,7 +49,7 @@ zend_module_entry pcsc_module_entry = {
|
||||||
STANDARD_MODULE_HEADER,
|
STANDARD_MODULE_HEADER,
|
||||||
#endif
|
#endif
|
||||||
"PC/SC",
|
"PC/SC",
|
||||||
pcsc_functions,
|
ext_functions,
|
||||||
PHP_MINIT(pcsc),
|
PHP_MINIT(pcsc),
|
||||||
PHP_MSHUTDOWN(pcsc),
|
PHP_MSHUTDOWN(pcsc),
|
||||||
NULL,
|
NULL,
|
||||||
|
|
|
||||||
55
pcsc.stub.php
Normal file
55
pcsc.stub.php
Normal file
|
|
@ -0,0 +1,55 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @generate-function-entries
|
||||||
|
* @generate-legacy-arginfo
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return resource|false
|
||||||
|
*/
|
||||||
|
function scard_establish_context() {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param resource $context
|
||||||
|
*/
|
||||||
|
function scard_release_context($context): bool {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param resource $context
|
||||||
|
*/
|
||||||
|
function scard_is_valid_context($context): bool {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param resource $context
|
||||||
|
*/
|
||||||
|
function scard_list_readers($context): array|false {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param resource $context
|
||||||
|
* @return resource|false
|
||||||
|
*/
|
||||||
|
function scard_connect($context, string $reader_name, int $preferred_protocol=SCARD_PROTOCOL_T0|SCARD_PROTOCOL_T0, int &$current_protocol=NULL): array|false {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param resource $card
|
||||||
|
* @return resource|false
|
||||||
|
*/
|
||||||
|
function scard_disconnect($card, int $disposition=SCARD_EJECT_CARD): bool {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param resource $card
|
||||||
|
* @return resource|false
|
||||||
|
*/
|
||||||
|
function scard_transmit($card, string $command): string|false {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param resource $card
|
||||||
|
* @return resource|false
|
||||||
|
*/
|
||||||
|
function scard_status($card): array|false {}
|
||||||
|
|
||||||
|
function scard_last_errno(): int {}
|
||||||
|
|
||||||
|
function scard_errstr(int $errno): string {}
|
||||||
|
|
||||||
70
pcsc_arginfo.h
Normal file
70
pcsc_arginfo.h
Normal file
|
|
@ -0,0 +1,70 @@
|
||||||
|
/* This is a generated file, edit the .stub.php file instead.
|
||||||
|
* Stub hash: c92a84c03add0a3e132eb4ce3b787e285148e03e */
|
||||||
|
|
||||||
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_scard_establish_context, 0, 0, 0)
|
||||||
|
ZEND_END_ARG_INFO()
|
||||||
|
|
||||||
|
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_scard_release_context, 0, 1, _IS_BOOL, 0)
|
||||||
|
ZEND_ARG_INFO(0, context)
|
||||||
|
ZEND_END_ARG_INFO()
|
||||||
|
|
||||||
|
#define arginfo_scard_is_valid_context arginfo_scard_release_context
|
||||||
|
|
||||||
|
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_scard_list_readers, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE)
|
||||||
|
ZEND_ARG_INFO(0, context)
|
||||||
|
ZEND_END_ARG_INFO()
|
||||||
|
|
||||||
|
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_scard_connect, 0, 2, MAY_BE_ARRAY|MAY_BE_FALSE)
|
||||||
|
ZEND_ARG_INFO(0, context)
|
||||||
|
ZEND_ARG_TYPE_INFO(0, reader_name, IS_STRING, 0)
|
||||||
|
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, preferred_protocol, IS_LONG, 0, "SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T0")
|
||||||
|
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(1, current_protocol, IS_LONG, 0, "NULL")
|
||||||
|
ZEND_END_ARG_INFO()
|
||||||
|
|
||||||
|
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_scard_disconnect, 0, 1, _IS_BOOL, 0)
|
||||||
|
ZEND_ARG_INFO(0, card)
|
||||||
|
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, disposition, IS_LONG, 0, "SCARD_EJECT_CARD")
|
||||||
|
ZEND_END_ARG_INFO()
|
||||||
|
|
||||||
|
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_scard_transmit, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
|
||||||
|
ZEND_ARG_INFO(0, card)
|
||||||
|
ZEND_ARG_TYPE_INFO(0, command, IS_STRING, 0)
|
||||||
|
ZEND_END_ARG_INFO()
|
||||||
|
|
||||||
|
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_scard_status, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE)
|
||||||
|
ZEND_ARG_INFO(0, card)
|
||||||
|
ZEND_END_ARG_INFO()
|
||||||
|
|
||||||
|
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_scard_last_errno, 0, 0, IS_LONG, 0)
|
||||||
|
ZEND_END_ARG_INFO()
|
||||||
|
|
||||||
|
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_scard_errstr, 0, 1, IS_STRING, 0)
|
||||||
|
ZEND_ARG_TYPE_INFO(0, errno, IS_LONG, 0)
|
||||||
|
ZEND_END_ARG_INFO()
|
||||||
|
|
||||||
|
|
||||||
|
ZEND_FUNCTION(scard_establish_context);
|
||||||
|
ZEND_FUNCTION(scard_release_context);
|
||||||
|
ZEND_FUNCTION(scard_is_valid_context);
|
||||||
|
ZEND_FUNCTION(scard_list_readers);
|
||||||
|
ZEND_FUNCTION(scard_connect);
|
||||||
|
ZEND_FUNCTION(scard_disconnect);
|
||||||
|
ZEND_FUNCTION(scard_transmit);
|
||||||
|
ZEND_FUNCTION(scard_status);
|
||||||
|
ZEND_FUNCTION(scard_last_errno);
|
||||||
|
ZEND_FUNCTION(scard_errstr);
|
||||||
|
|
||||||
|
|
||||||
|
static const zend_function_entry ext_functions[] = {
|
||||||
|
ZEND_FE(scard_establish_context, arginfo_scard_establish_context)
|
||||||
|
ZEND_FE(scard_release_context, arginfo_scard_release_context)
|
||||||
|
ZEND_FE(scard_is_valid_context, arginfo_scard_is_valid_context)
|
||||||
|
ZEND_FE(scard_list_readers, arginfo_scard_list_readers)
|
||||||
|
ZEND_FE(scard_connect, arginfo_scard_connect)
|
||||||
|
ZEND_FE(scard_disconnect, arginfo_scard_disconnect)
|
||||||
|
ZEND_FE(scard_transmit, arginfo_scard_transmit)
|
||||||
|
ZEND_FE(scard_status, arginfo_scard_status)
|
||||||
|
ZEND_FE(scard_last_errno, arginfo_scard_last_errno)
|
||||||
|
ZEND_FE(scard_errstr, arginfo_scard_errstr)
|
||||||
|
ZEND_FE_END
|
||||||
|
};
|
||||||
67
pcsc_legacy_arginfo.h
Normal file
67
pcsc_legacy_arginfo.h
Normal file
|
|
@ -0,0 +1,67 @@
|
||||||
|
/* This is a generated file, edit the .stub.php file instead.
|
||||||
|
* Stub hash: c92a84c03add0a3e132eb4ce3b787e285148e03e */
|
||||||
|
|
||||||
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_scard_establish_context, 0, 0, 0)
|
||||||
|
ZEND_END_ARG_INFO()
|
||||||
|
|
||||||
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_scard_release_context, 0, 0, 1)
|
||||||
|
ZEND_ARG_INFO(0, context)
|
||||||
|
ZEND_END_ARG_INFO()
|
||||||
|
|
||||||
|
#define arginfo_scard_is_valid_context arginfo_scard_release_context
|
||||||
|
|
||||||
|
#define arginfo_scard_list_readers arginfo_scard_release_context
|
||||||
|
|
||||||
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_scard_connect, 0, 0, 2)
|
||||||
|
ZEND_ARG_INFO(0, context)
|
||||||
|
ZEND_ARG_INFO(0, reader_name)
|
||||||
|
ZEND_ARG_INFO(0, preferred_protocol)
|
||||||
|
ZEND_ARG_INFO(1, current_protocol)
|
||||||
|
ZEND_END_ARG_INFO()
|
||||||
|
|
||||||
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_scard_disconnect, 0, 0, 1)
|
||||||
|
ZEND_ARG_INFO(0, card)
|
||||||
|
ZEND_ARG_INFO(0, disposition)
|
||||||
|
ZEND_END_ARG_INFO()
|
||||||
|
|
||||||
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_scard_transmit, 0, 0, 2)
|
||||||
|
ZEND_ARG_INFO(0, card)
|
||||||
|
ZEND_ARG_INFO(0, command)
|
||||||
|
ZEND_END_ARG_INFO()
|
||||||
|
|
||||||
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_scard_status, 0, 0, 1)
|
||||||
|
ZEND_ARG_INFO(0, card)
|
||||||
|
ZEND_END_ARG_INFO()
|
||||||
|
|
||||||
|
#define arginfo_scard_last_errno arginfo_scard_establish_context
|
||||||
|
|
||||||
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_scard_errstr, 0, 0, 1)
|
||||||
|
ZEND_ARG_INFO(0, errno)
|
||||||
|
ZEND_END_ARG_INFO()
|
||||||
|
|
||||||
|
|
||||||
|
ZEND_FUNCTION(scard_establish_context);
|
||||||
|
ZEND_FUNCTION(scard_release_context);
|
||||||
|
ZEND_FUNCTION(scard_is_valid_context);
|
||||||
|
ZEND_FUNCTION(scard_list_readers);
|
||||||
|
ZEND_FUNCTION(scard_connect);
|
||||||
|
ZEND_FUNCTION(scard_disconnect);
|
||||||
|
ZEND_FUNCTION(scard_transmit);
|
||||||
|
ZEND_FUNCTION(scard_status);
|
||||||
|
ZEND_FUNCTION(scard_last_errno);
|
||||||
|
ZEND_FUNCTION(scard_errstr);
|
||||||
|
|
||||||
|
|
||||||
|
static const zend_function_entry ext_functions[] = {
|
||||||
|
ZEND_FE(scard_establish_context, arginfo_scard_establish_context)
|
||||||
|
ZEND_FE(scard_release_context, arginfo_scard_release_context)
|
||||||
|
ZEND_FE(scard_is_valid_context, arginfo_scard_is_valid_context)
|
||||||
|
ZEND_FE(scard_list_readers, arginfo_scard_list_readers)
|
||||||
|
ZEND_FE(scard_connect, arginfo_scard_connect)
|
||||||
|
ZEND_FE(scard_disconnect, arginfo_scard_disconnect)
|
||||||
|
ZEND_FE(scard_transmit, arginfo_scard_transmit)
|
||||||
|
ZEND_FE(scard_status, arginfo_scard_status)
|
||||||
|
ZEND_FE(scard_last_errno, arginfo_scard_last_errno)
|
||||||
|
ZEND_FE(scard_errstr, arginfo_scard_errstr)
|
||||||
|
ZEND_FE_END
|
||||||
|
};
|
||||||
Loading…
Add table
Add a link
Reference in a new issue