Replace warnings with RETURN_FALSE and a global last_errno to allow userland response to errors

git-svn-id: https://svn.php.net/repository/pecl/pcsc/trunk@332847 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Marco Schuster 2014-02-13 11:05:09 +00:00
commit d47c882716
2 changed files with 60 additions and 25 deletions

View file

@ -29,11 +29,22 @@ PHP_FUNCTION(scard_connect);
PHP_FUNCTION(scard_disconnect);
PHP_FUNCTION(scard_status);
PHP_FUNCTION(scard_transmit);
//PHP_FUNCTION(scard_cancel);
PHP_FUNCTION(scard_last_errno);
PHP_FUNCTION(scard_errstr);
#define PHP_PCSC_CTX_RES_NAME "PC/SC Context"
#define PHP_PCSC_CONN_RES_NAME "PC/SC Connection"
static char* php_pcsc_error_to_string(LONG dwRC);
static char* php_pcsc_error_to_string(DWORD dwRC);
ZEND_BEGIN_MODULE_GLOBALS(pcsc)
DWORD last_errno;
ZEND_END_MODULE_GLOBALS(pcsc)
#ifdef ZTS
#define PCSC_G(v) TSRMG(pcsc_globals_id,zend_pcsc_globals*,v)
#else
#define PCSC_G(v) (pcsc_globals.v)
#endif
#endif /* PHP_PCSC_H */