Merge branch 'master' into gsoc2017-php7-classes-via-c-api
This commit is contained in:
commit
8ded9d8dae
1906 changed files with 50934 additions and 30001 deletions
|
|
@ -136,7 +136,7 @@
|
|||
|
||||
%typemap(varin) SWIGTYPE []
|
||||
{
|
||||
if($1) {
|
||||
if ($1) {
|
||||
zval *z_var = zend_hash_str_find(&EG(symbol_table), "$1", sizeof("$1") - 1);
|
||||
SWIG_SetPointerZval(z_var, (void*)$1, $1_descriptor, $owner);
|
||||
}
|
||||
|
|
@ -144,15 +144,15 @@
|
|||
|
||||
%typemap(varin) char [ANY]
|
||||
{
|
||||
zval **z_var;
|
||||
char *s1;
|
||||
zval **z_var;
|
||||
char *s1;
|
||||
|
||||
zend_hash_str_find(&EG(symbol_table), "$1", sizeof("$1") - 1, (void**)&z_var);
|
||||
s1 = Z_STRVAL_P(z_var);
|
||||
if ((s1 == NULL) || ($1 == NULL) || strcmp(s1, $1)) {
|
||||
if (s1)
|
||||
strncpy($1, s1, $1_dim0);
|
||||
}
|
||||
zend_hash_str_find(&EG(symbol_table), "$1", sizeof("$1") - 1, (void**)&z_var);
|
||||
s1 = Z_STRVAL_P(z_var);
|
||||
if ((s1 == NULL) || ($1 == NULL) || strcmp(s1, $1)) {
|
||||
if (s1)
|
||||
strncpy($1, s1, $1_dim0);
|
||||
}
|
||||
}
|
||||
|
||||
%typemap(varin) SWIGTYPE
|
||||
|
|
@ -166,7 +166,6 @@
|
|||
}
|
||||
|
||||
$1 = *($&1_ltype)_temp;
|
||||
|
||||
}
|
||||
|
||||
%typemap(varin) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&
|
||||
|
|
@ -245,7 +244,7 @@
|
|||
(z_var)->value.str.val = 0;
|
||||
(z_var)->value.str.len = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
%typemap(varout) SWIGTYPE
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
%runtime "swigrun.swg" // Common C API type-checking code
|
||||
%runtime "swigerrors.swg" // SWIG errors
|
||||
%runtime "phprun.swg" // PHP runtime functions
|
||||
|
||||
%include <phpinit.swg> // PHP initialization routine.
|
||||
|
|
@ -177,7 +178,7 @@
|
|||
/* Allow NULL from php for void* */
|
||||
if (Z_ISNULL($input)) $1=0;
|
||||
else
|
||||
SWIG_PHP_Error(E_ERROR, "Type error in argument $argnum of $symname. Expected $&1_descriptor");
|
||||
SWIG_PHP_Error(E_ERROR, "Type error in argument $argnum of $symname. Expected $1_descriptor");
|
||||
}
|
||||
%}
|
||||
|
||||
|
|
@ -492,36 +493,45 @@
|
|||
%php_typecheck(double,SWIG_TYPECHECK_DOUBLE,IS_DOUBLE)
|
||||
%php_typecheck(char,SWIG_TYPECHECK_CHAR,IS_STRING)
|
||||
|
||||
%typemap(typecheck,precedence=SWIG_TYPECHECK_STRING) char *, char *&, char []
|
||||
%typemap(typecheck,precedence=SWIG_TYPECHECK_STRING) char *, char *&
|
||||
" $1 = (Z_TYPE($input) == IS_STRING || Z_TYPE($input) == IS_NULL); "
|
||||
|
||||
%typemap(typecheck,precedence=SWIG_TYPECHECK_STRING) char []
|
||||
" $1 = (Z_TYPE($input) == IS_STRING); "
|
||||
|
||||
%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE
|
||||
{
|
||||
void *tmp;
|
||||
_v = (SWIG_ConvertPtr(&$input, (void **)&tmp, $&1_descriptor, 0) >= 0);
|
||||
$1 = (SWIG_ConvertPtr(&$input, (void **)&tmp, $&1_descriptor, SWIG_POINTER_NO_NULL) >= 0);
|
||||
}
|
||||
|
||||
%typecheck(SWIG_TYPECHECK_POINTER)
|
||||
SWIGTYPE *,
|
||||
SWIGTYPE [],
|
||||
SWIGTYPE &,
|
||||
SWIGTYPE &&,
|
||||
SWIGTYPE *const&
|
||||
{
|
||||
void *tmp;
|
||||
_v = (SWIG_ConvertPtr(&$input, (void **)&tmp, $1_descriptor, 0) >= 0);
|
||||
$1 = (SWIG_ConvertPtr(&$input, (void**)&tmp, $1_descriptor, 0) >= 0);
|
||||
}
|
||||
|
||||
%typecheck(SWIG_TYPECHECK_POINTER)
|
||||
SWIGTYPE &,
|
||||
SWIGTYPE &&
|
||||
{
|
||||
void *tmp;
|
||||
$1 = (SWIG_ConvertPtr(&$input, (void**)&tmp, $1_descriptor, SWIG_POINTER_NO_NULL) >= 0);
|
||||
}
|
||||
|
||||
%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *const&
|
||||
{
|
||||
void *tmp;
|
||||
_v = (SWIG_ConvertPtr(&$input, (void **)&tmp, $*1_descriptor, 0) >= 0);
|
||||
$1 = (SWIG_ConvertPtr(&$input, (void**)&tmp, $*1_descriptor, 0) >= 0);
|
||||
}
|
||||
|
||||
%typecheck(SWIG_TYPECHECK_VOIDPTR) void *
|
||||
{
|
||||
void *tmp;
|
||||
_v = (SWIG_ConvertPtr(&$input, (void **)&tmp, 0, 0) >= 0);
|
||||
$1 = (SWIG_ConvertPtr(&$input, (void**)&tmp, 0, 0) >= 0);
|
||||
}
|
||||
|
||||
/* Exception handling */
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
|
||||
/* ------------------------------------------------------------
|
||||
* The start of the PHP initialization function
|
||||
* The start of the PHP initialization function
|
||||
* ------------------------------------------------------------ */
|
||||
|
||||
%insert(init) "swiginit.swg"
|
||||
|
||||
%init %{
|
||||
SWIG_php_minit {
|
||||
SWIG_InitializeModule(0);
|
||||
SWIG_InitializeModule((void*)&module_number);
|
||||
%}
|
||||
|
||||
%fragment("swig_php_init_member_ptr2", "header") %{
|
||||
|
|
@ -21,5 +21,5 @@ static int swig_member_ptr = 0;
|
|||
%}
|
||||
|
||||
%fragment("swig_php_init_member_ptr", "init", fragment="swig_php_init_member_ptr2") %{
|
||||
swig_member_ptr = zend_register_list_destructors_ex(swig_member_ptr_dtor, NULL, SWIG_MEMBER_PTR, module_number);
|
||||
swig_member_ptr = zend_register_list_destructors_ex(swig_member_ptr_dtor, NULL, SWIG_MEMBER_PTR, module_number);
|
||||
%}
|
||||
|
|
|
|||
|
|
@ -30,13 +30,11 @@
|
|||
* could lead to confusion."
|
||||
*/
|
||||
/* Check is case insensitive - these *MUST* be listed in lower case here */
|
||||
PHPKW(__halt_compiler);
|
||||
PHPKW(abstract);
|
||||
PHPKW(and);
|
||||
PHPKW(array);
|
||||
PHPKW(as);
|
||||
PHPKW(break);
|
||||
PHPKW(callable); // As of PHP 5.4
|
||||
PHPKW(callable);
|
||||
PHPKW(case);
|
||||
PHPKW(catch);
|
||||
PHPKW(class);
|
||||
|
|
@ -45,71 +43,57 @@ PHPKW(const);
|
|||
PHPKW(continue);
|
||||
PHPKW(declare);
|
||||
PHPKW(default);
|
||||
PHPKW(die); // "Language construct"
|
||||
PHPKW(do);
|
||||
PHPKW(echo); // "Language construct"
|
||||
PHPKW(else);
|
||||
PHPKW(elseif);
|
||||
PHPKW(empty); // "Language construct"
|
||||
PHPKW(enddeclare);
|
||||
PHPKW(endfor);
|
||||
PHPKW(endforeach);
|
||||
PHPKW(endif);
|
||||
PHPKW(endswitch);
|
||||
PHPKW(endwhile);
|
||||
PHPKW(eval); // "Language construct"
|
||||
PHPKW(exit); // "Language construct"
|
||||
PHPKW(extends);
|
||||
PHPKW(final);
|
||||
PHPKW(finally); // As of PHP 5.5
|
||||
PHPKW(finally);
|
||||
PHPKW(for);
|
||||
PHPKW(foreach);
|
||||
PHPKW(function);
|
||||
PHPKW(global);
|
||||
PHPKW(goto); // As of PHP 5.3
|
||||
PHPKW(goto);
|
||||
PHPKW(if);
|
||||
PHPKW(implements);
|
||||
PHPKW(include); // "Language construct"
|
||||
PHPKW(include_once); // "Language construct"
|
||||
PHPKW(instanceof);
|
||||
PHPKW(insteadof); // As of PHP 5.4
|
||||
PHPKW(insteadof);
|
||||
PHPKW(interface);
|
||||
PHPKW(isset); // "Language construct"
|
||||
PHPKW(list); // "Language construct"
|
||||
PHPKW(namespace); // As of PHP 5.3
|
||||
PHPKW(namespace);
|
||||
PHPKW(new);
|
||||
PHPKW(or);
|
||||
PHPKW(print); // "Language construct"
|
||||
PHPKW(private);
|
||||
PHPKW(protected);
|
||||
PHPKW(public);
|
||||
PHPKW(require); // "Language construct"
|
||||
PHPKW(require_once); // "Language construct"
|
||||
PHPKW(return); // "Language construct"
|
||||
PHPKW(static);
|
||||
PHPKW(switch);
|
||||
PHPKW(throw);
|
||||
PHPKW(trait); // As of PHP 5.4
|
||||
PHPKW(trait);
|
||||
PHPKW(try);
|
||||
PHPKW(unset); // "Language construct"
|
||||
PHPKW(use);
|
||||
PHPKW(var);
|
||||
PHPKW(while);
|
||||
PHPKW(xor);
|
||||
PHPKW(yield); // As of PHP 5.5
|
||||
PHPKW(yield);
|
||||
|
||||
// Compile-time "magic" constants
|
||||
// From: http://php.net/manual/en/reserved.keywords.php
|
||||
// also at: http://php.net/manual/en/language.constants.predefined.php
|
||||
/* These *MUST* be listed in lower case here */
|
||||
PHPKW(__class__);
|
||||
PHPKW(__dir__); // As of PHP 5.3
|
||||
PHPKW(__dir__);
|
||||
PHPKW(__file__);
|
||||
PHPKW(__function__);
|
||||
PHPKW(__line__);
|
||||
PHPKW(__method__);
|
||||
PHPKW(__namespace__); // As of PHP 5.3
|
||||
PHPKW(__trait__); // As of PHP 5.4
|
||||
PHPKW(__namespace__);
|
||||
PHPKW(__trait__);
|
||||
|
||||
/* We classify these as built-in names since they conflict, but PHP still runs */
|
||||
|
||||
|
|
@ -122,27 +106,27 @@ PHPBN1(false);
|
|||
/* "Core Predefined Constants" from http://php.net/manual/en/reserved.constants.php */
|
||||
/* These are case sensitive */
|
||||
PHPBN2(PHP_VERSION);
|
||||
PHPBN2(PHP_MAJOR_VERSION); // As of PHP 5.2.7
|
||||
PHPBN2(PHP_MINOR_VERSION); // As of PHP 5.2.7
|
||||
PHPBN2(PHP_RELEASE_VERSION); // As of PHP 5.2.7
|
||||
PHPBN2(PHP_VERSION_ID); // As of PHP 5.2.7
|
||||
PHPBN2(PHP_EXTRA_VERSION); // As of PHP 5.2.7
|
||||
PHPBN2(PHP_ZTS); // As of PHP 5.2.7
|
||||
PHPBN2(PHP_DEBUG); // As of PHP 5.2.7
|
||||
PHPBN2(PHP_MAXPATHLEN); // As of PHP 5.3.0
|
||||
PHPBN2(PHP_MAJOR_VERSION);
|
||||
PHPBN2(PHP_MINOR_VERSION);
|
||||
PHPBN2(PHP_RELEASE_VERSION);
|
||||
PHPBN2(PHP_VERSION_ID);
|
||||
PHPBN2(PHP_EXTRA_VERSION);
|
||||
PHPBN2(PHP_ZTS);
|
||||
PHPBN2(PHP_DEBUG);
|
||||
PHPBN2(PHP_MAXPATHLEN);
|
||||
PHPBN2(PHP_OS);
|
||||
PHPBN2(PHP_SAPI);
|
||||
PHPBN2(PHP_EOL); // As of PHP 5.0.2
|
||||
PHPBN2(PHP_INT_MAX); // As of PHP 5.0.5
|
||||
PHPBN2(PHP_INT_SIZE); // As of PHP 5.0.5
|
||||
PHPBN2(PHP_EOL);
|
||||
PHPBN2(PHP_INT_MAX);
|
||||
PHPBN2(PHP_INT_SIZE);
|
||||
PHPBN2(DEFAULT_INCLUDE_PATH);
|
||||
PHPBN2(PEAR_INSTALL_DIR);
|
||||
PHPBN2(PEAR_EXTENSION_DIR);
|
||||
PHPBN2(PHP_EXTENSION_DIR);
|
||||
PHPBN2(PHP_PREFIX);
|
||||
PHPBN2(PHP_BINDIR);
|
||||
PHPBN2(PHP_BINARY); // As of PHP 5.4
|
||||
PHPBN2(PHP_MANDIR); // As of PHP 5.3.7
|
||||
PHPBN2(PHP_BINARY);
|
||||
PHPBN2(PHP_MANDIR);
|
||||
PHPBN2(PHP_LIBDIR);
|
||||
PHPBN2(PHP_DATADIR);
|
||||
PHPBN2(PHP_SYSCONFDIR);
|
||||
|
|
@ -161,11 +145,11 @@ PHPBN2(E_COMPILE_WARNING);
|
|||
PHPBN2(E_USER_ERROR);
|
||||
PHPBN2(E_USER_WARNING);
|
||||
PHPBN2(E_USER_NOTICE);
|
||||
PHPBN2(E_DEPRECATED); // As of PHP 5.3.0
|
||||
PHPBN2(E_USER_DEPRECATED); // As of PHP 5.3.0
|
||||
PHPBN2(E_DEPRECATED);
|
||||
PHPBN2(E_USER_DEPRECATED);
|
||||
PHPBN2(E_ALL);
|
||||
PHPBN2(E_STRICT);
|
||||
PHPBN2(__COMPILER_HALT_OFFSET__); // As of PHP 5.1.0
|
||||
PHPBN2(__COMPILER_HALT_OFFSET__);
|
||||
// TRUE, FALSE, NULL are listed on the same page, but are actually
|
||||
// case-insensitive, whereas all the other constants listed there seem to be
|
||||
// case-sensitive, so we handle TRUE, FALSE, NULL in PHPBN1.
|
||||
|
|
@ -174,17 +158,17 @@ PHPBN2(PHP_OUTPUT_HANDLER_CONT);
|
|||
PHPBN2(PHP_OUTPUT_HANDLER_END);
|
||||
/* These don't actually seem to be set (tested on Linux, I guess they're
|
||||
* Windows only?) */
|
||||
PHPBN2(PHP_WINDOWS_NT_DOMAIN_CONTROLLER); // As of PHP 5.3
|
||||
PHPBN2(PHP_WINDOWS_NT_SERVER); // As of PHP 5.3
|
||||
PHPBN2(PHP_WINDOWS_NT_WORKSTATION); // As of PHP 5.3
|
||||
PHPBN2(PHP_WINDOWS_VERSION_BUILD); // As of PHP 5.3
|
||||
PHPBN2(PHP_WINDOWS_VERSION_MAJOR); // As of PHP 5.3
|
||||
PHPBN2(PHP_WINDOWS_VERSION_MINOR); // As of PHP 5.3
|
||||
PHPBN2(PHP_WINDOWS_VERSION_PLATFORM); // As of PHP 5.3
|
||||
PHPBN2(PHP_WINDOWS_VERSION_PRODUCTTYPE); // As of PHP 5.3
|
||||
PHPBN2(PHP_WINDOWS_VERSION_SP_MAJOR); // As of PHP 5.3
|
||||
PHPBN2(PHP_WINDOWS_VERSION_SP_MINOR); // As of PHP 5.3
|
||||
PHPBN2(PHP_WINDOWS_VERSION_SUITEMASK); // As of PHP 5.3
|
||||
PHPBN2(PHP_WINDOWS_NT_DOMAIN_CONTROLLER);
|
||||
PHPBN2(PHP_WINDOWS_NT_SERVER);
|
||||
PHPBN2(PHP_WINDOWS_NT_WORKSTATION);
|
||||
PHPBN2(PHP_WINDOWS_VERSION_BUILD);
|
||||
PHPBN2(PHP_WINDOWS_VERSION_MAJOR);
|
||||
PHPBN2(PHP_WINDOWS_VERSION_MINOR);
|
||||
PHPBN2(PHP_WINDOWS_VERSION_PLATFORM);
|
||||
PHPBN2(PHP_WINDOWS_VERSION_PRODUCTTYPE);
|
||||
PHPBN2(PHP_WINDOWS_VERSION_SP_MAJOR);
|
||||
PHPBN2(PHP_WINDOWS_VERSION_SP_MINOR);
|
||||
PHPBN2(PHP_WINDOWS_VERSION_SUITEMASK);
|
||||
/* "Standard Predefined Constants" from http://php.net/manual/en/reserved.constants.php */
|
||||
PHPBN2(EXTR_OVERWRITE);
|
||||
PHPBN2(EXTR_SKIP);
|
||||
|
|
@ -214,8 +198,8 @@ PHPBN2(INI_USER);
|
|||
PHPBN2(INI_PERDIR);
|
||||
PHPBN2(INI_SYSTEM);
|
||||
PHPBN2(INI_ALL);
|
||||
PHPBN2(INI_SCANNER_NORMAL); // As of PHP 5.3
|
||||
PHPBN2(INI_SCANNER_RAW); // As of PHP 5.3
|
||||
PHPBN2(INI_SCANNER_NORMAL);
|
||||
PHPBN2(INI_SCANNER_RAW);
|
||||
PHPBN2(M_E);
|
||||
PHPBN2(M_LOG2E);
|
||||
PHPBN2(M_LOG10E);
|
||||
|
|
@ -229,10 +213,10 @@ PHPBN2(M_2_PI);
|
|||
PHPBN2(M_2_SQRTPI);
|
||||
PHPBN2(M_SQRT2);
|
||||
PHPBN2(M_SQRT1_2);
|
||||
PHPBN2(M_EULER); // As of PHP 5.2
|
||||
PHPBN2(M_LNPI); // As of PHP 5.2
|
||||
PHPBN2(M_SQRT3); // As of PHP 5.2
|
||||
PHPBN2(M_SQRTPI); // As of PHP 5.2
|
||||
PHPBN2(M_EULER);
|
||||
PHPBN2(M_LNPI);
|
||||
PHPBN2(M_SQRT3);
|
||||
PHPBN2(M_SQRTPI);
|
||||
PHPBN2(CRYPT_SALT_LENGTH);
|
||||
PHPBN2(CRYPT_STD_DES);
|
||||
PHPBN2(CRYPT_EXT_DES);
|
||||
|
|
@ -273,7 +257,7 @@ PHPBN2(STR_PAD_BOTH);
|
|||
PHPBN2(PATHINFO_DIRNAME);
|
||||
PHPBN2(PATHINFO_BASENAME);
|
||||
PHPBN2(PATHINFO_EXTENSION);
|
||||
PHPBN2(PATHINFO_FILENAME); // As of PHP 5.2
|
||||
PHPBN2(PATHINFO_FILENAME);
|
||||
PHPBN2(PATH_SEPARATOR);
|
||||
PHPBN2(CHAR_MAX);
|
||||
PHPBN2(LC_CTYPE);
|
||||
|
|
@ -393,7 +377,6 @@ PHPBN2(LOG_NDELAY);
|
|||
PHPBN2(LOG_NOWAIT);
|
||||
PHPBN2(LOG_PERROR);
|
||||
|
||||
/* Added in PHP 5.2 */
|
||||
PHPBN2(PREG_BACKTRACK_LIMIT_ERROR);
|
||||
PHPBN2(PREG_BAD_UTF8_ERROR);
|
||||
PHPBN2(PREG_INTERNAL_ERROR);
|
||||
|
|
@ -415,10 +398,10 @@ PHPBN2(CURLFTPSSL_NONE);
|
|||
PHPBN2(CURLFTPSSL_TRY);
|
||||
PHPBN2(CURLOPT_FTP_SSL);
|
||||
PHPBN2(CURLOPT_FTPSSLAUTH);
|
||||
PHPBN2(CURLOPT_TCP_NODELAY); // Added in PHP 5.2.1
|
||||
PHPBN2(CURLOPT_TIMEOUT_MS); // Added in PHP 5.2.3
|
||||
PHPBN2(CURLOPT_CONNECTTIMEOUT_MS); // Added in PHP 5.2.3
|
||||
PHPBN2(GMP_VERSION); // Added in PHP 5.2.2
|
||||
PHPBN2(CURLOPT_TCP_NODELAY);
|
||||
PHPBN2(CURLOPT_TIMEOUT_MS);
|
||||
PHPBN2(CURLOPT_CONNECTTIMEOUT_MS);
|
||||
PHPBN2(GMP_VERSION);
|
||||
PHPBN2(SWFTEXTFIELD_USEFONT);
|
||||
PHPBN2(SWFTEXTFIELD_AUTOSIZE);
|
||||
PHPBN2(SWF_SOUND_NOT_COMPRESSED);
|
||||
|
|
@ -440,7 +423,6 @@ PHPBN2(SNMP_OID_OUTPUT_NUMERIC);
|
|||
PHPBN2(MSG_EAGAIN);
|
||||
PHPBN2(MSG_ENOMSG);
|
||||
|
||||
/* Added in PHP 5.3 */
|
||||
PHPBN2(CURLOPT_PROGRESSFUNCTION);
|
||||
PHPBN2(IMG_FILTER_PIXELATE);
|
||||
PHPBN2(JSON_ERROR_CTRL_CHAR);
|
||||
|
|
@ -504,7 +486,6 @@ PHPBN2(SIG_UNBLOCK);
|
|||
PHPBN2(TRAP_BRKPT);
|
||||
PHPBN2(TRAP_TRACE);
|
||||
|
||||
/* Added in PHP 5.4 */
|
||||
PHPBN2(ENT_DISALLOWED);
|
||||
PHPBN2(ENT_HTML401);
|
||||
PHPBN2(ENT_HTML5);
|
||||
|
|
@ -583,7 +564,6 @@ PHPBN2(JSON_NUMERIC_CHECK);
|
|||
PHPBN2(JSON_UNESCAPED_UNICODE);
|
||||
PHPBN2(JSON_BIGINT_AS_STRING);
|
||||
|
||||
/* Added in PHP 5.5 */
|
||||
PHPBN2(IMG_AFFINE_TRANSLATE);
|
||||
PHPBN2(IMG_AFFINE_SCALE);
|
||||
PHPBN2(IMG_AFFINE_ROTATE);
|
||||
|
|
@ -622,7 +602,6 @@ PHPBN2(JSON_ERROR_INF_OR_NAN);
|
|||
PHPBN2(JSON_ERROR_UNSUPPORTED_TYPE);
|
||||
PHPBN2(MYSQLI_SERVER_PUBLIC_KEY);
|
||||
|
||||
/* Added in PHP 5.6 */
|
||||
PHPBN2(LDAP_ESCAPE_DN);
|
||||
PHPBN2(LDAP_ESCAPE_FILTER);
|
||||
PHPBN2(OPENSSL_DEFAULT_STREAM_CIPHERS);
|
||||
|
|
@ -654,10 +633,10 @@ PHPCN(stdclass);
|
|||
PHPCN(__php_incomplete_class);
|
||||
/* Added in PHP5. */
|
||||
PHPCN(exception);
|
||||
PHPCN(errorexception); // As of PHP 5.1
|
||||
PHPCN(errorexception);
|
||||
PHPCN(php_user_filter);
|
||||
PHPCN(closure); // As of PHP 5.3
|
||||
PHPCN(generator); // As of PHP 5.5
|
||||
PHPCN(closure);
|
||||
PHPCN(generator);
|
||||
PHPCN(self);
|
||||
PHPCN(static);
|
||||
PHPCN(parent);
|
||||
|
|
@ -772,7 +751,9 @@ PHPCN(datetime);
|
|||
/* Built-in PHP functions (incomplete). */
|
||||
/* Includes Array Functions - http://php.net/manual/en/ref.array.php */
|
||||
/* Check is case insensitive - these *MUST* be listed in lower case here */
|
||||
PHPFN(__halt_compiler);
|
||||
PHPFN(acos);
|
||||
PHPFN(array);
|
||||
PHPFN(array_change_key_case);
|
||||
PHPFN(array_chunk);
|
||||
PHPFN(array_column);
|
||||
|
|
@ -834,17 +815,26 @@ PHPFN(cos);
|
|||
PHPFN(cosh);
|
||||
PHPFN(count);
|
||||
PHPFN(current);
|
||||
PHPFN(die); // "Language construct"
|
||||
PHPFN(each);
|
||||
PHPFN(echo); // "Language construct"
|
||||
PHPFN(empty);
|
||||
PHPFN(end);
|
||||
PHPFN(eval); // "Language construct"
|
||||
PHPFN(exit); // "Language construct"
|
||||
PHPFN(exp);
|
||||
PHPFN(extract);
|
||||
PHPFN(floor);
|
||||
PHPFN(fmod);
|
||||
PHPFN(in_array);
|
||||
PHPFN(include); // "Language construct"
|
||||
PHPFN(include_once); // "Language construct"
|
||||
PHPFN(isset); // "Language construct"
|
||||
PHPFN(key);
|
||||
PHPFN(key_exists);
|
||||
PHPFN(krsort);
|
||||
PHPFN(ksort);
|
||||
PHPFN(list); // "Language construct"
|
||||
PHPFN(log);
|
||||
PHPFN(log10);
|
||||
PHPFN(max);
|
||||
|
|
@ -855,9 +845,13 @@ PHPFN(next);
|
|||
PHPFN(pos);
|
||||
PHPFN(pow);
|
||||
PHPFN(prev);
|
||||
PHPFN(print); // "Language construct"
|
||||
PHPFN(range);
|
||||
PHPFN(reset);
|
||||
PHPFN(rsort);
|
||||
PHPFN(require); // "Language construct"
|
||||
PHPFN(require_once); // "Language construct"
|
||||
PHPFN(return); // "Language construct"
|
||||
PHPFN(shuffle);
|
||||
PHPFN(sin);
|
||||
PHPFN(sinh);
|
||||
|
|
@ -868,6 +862,7 @@ PHPFN(tan);
|
|||
PHPFN(tanh);
|
||||
PHPFN(uasort);
|
||||
PHPFN(uksort);
|
||||
PHPFN(unset); // "Language construct"
|
||||
PHPFN(usort);
|
||||
|
||||
#undef PHPKW
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ extern "C" {
|
|||
#include "zend_exceptions.h"
|
||||
#include "php.h"
|
||||
|
||||
#if PHP_MAJOR_VERSION != 7
|
||||
# error These bindings need PHP7 - to generate PHP5 bindings use: swig -php5
|
||||
#if PHP_MAJOR_VERSION < 7
|
||||
# error These bindings need PHP 7 or later - to generate PHP5 bindings use: SWIG < 4.0.0 and swig -php5
|
||||
#endif
|
||||
|
||||
#include "ext/standard/php_string.h"
|
||||
|
|
@ -57,7 +57,7 @@ static int default_error_code = E_ERROR;
|
|||
|
||||
/* Standard SWIG API */
|
||||
#define SWIG_GetModule(clientdata) SWIG_Php_GetModule()
|
||||
#define SWIG_SetModule(clientdata, pointer) SWIG_Php_SetModule(pointer)
|
||||
#define SWIG_SetModule(clientdata, pointer) SWIG_Php_SetModule(pointer, *(int*)clientdata)
|
||||
|
||||
/* used to wrap returned objects in so we know whether they are newobject
|
||||
and need freeing, or not */
|
||||
|
|
@ -92,15 +92,13 @@ SWIG_SetPointerZval(zval *z, void *ptr, swig_type_info *type, int newobject) {
|
|||
} else {
|
||||
/*
|
||||
* Wrap the resource in an object, the resource will be accessible
|
||||
* via the "_cPtr" member. This is currently only used by
|
||||
* via the "_cPtr" property. This code path is currently only used by
|
||||
* directorin typemaps.
|
||||
*/
|
||||
zval resource;
|
||||
zend_class_entry *ce = NULL;
|
||||
const char *type_name = type->name+3; /* +3 so: _p_Foo -> Foo */
|
||||
size_t type_name_len;
|
||||
const char * p;
|
||||
HashTable * ht;
|
||||
|
||||
/* Namespace__Foo -> Foo */
|
||||
/* FIXME: ugly and goes wrong for classes with __ in their names. */
|
||||
|
|
@ -109,7 +107,6 @@ SWIG_SetPointerZval(zval *z, void *ptr, swig_type_info *type, int newobject) {
|
|||
}
|
||||
type_name_len = strlen(type_name);
|
||||
|
||||
ZVAL_RES(&resource, zend_register_resource(value, *(int *)(type->clientdata)));
|
||||
if (SWIG_PREFIX_LEN > 0) {
|
||||
zend_string * classname = zend_string_alloc(SWIG_PREFIX_LEN + type_name_len, 0);
|
||||
memcpy(classname->val, SWIG_PREFIX, SWIG_PREFIX_LEN);
|
||||
|
|
@ -123,13 +120,12 @@ SWIG_SetPointerZval(zval *z, void *ptr, swig_type_info *type, int newobject) {
|
|||
}
|
||||
if (ce == NULL) {
|
||||
/* class does not exist */
|
||||
ce = zend_standard_class_def;
|
||||
object_init(z);
|
||||
} else {
|
||||
object_init_ex(z, ce);
|
||||
}
|
||||
|
||||
ALLOC_HASHTABLE(ht);
|
||||
zend_hash_init(ht, 1, NULL, NULL, 0);
|
||||
zend_hash_str_update(ht, "_cPtr", sizeof("_cPtr") - 1, &resource);
|
||||
object_and_properties_init(z, ce, ht);
|
||||
add_property_resource_ex(z, "_cPtr", sizeof("_cPtr") - 1, zend_register_resource(value, *(int *)(type->clientdata)));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
@ -221,7 +217,11 @@ SWIG_ConvertPtr(zval *z, void **ptr, swig_type_info *ty, int flags) {
|
|||
|
||||
switch (Z_TYPE_P(z)) {
|
||||
case IS_OBJECT: {
|
||||
#if PHP_MAJOR_VERSION < 8
|
||||
HashTable * ht = Z_OBJ_HT_P(z)->get_properties(z);
|
||||
#else
|
||||
HashTable * ht = Z_OBJ_HT_P(z)->get_properties(Z_OBJ_P(z));
|
||||
#endif
|
||||
if (ht) {
|
||||
zval * _cPtr = zend_hash_str_find(ht, "_cPtr", sizeof("_cPtr") - 1);
|
||||
if (_cPtr) {
|
||||
|
|
@ -245,7 +245,7 @@ SWIG_ConvertPtr(zval *z, void **ptr, swig_type_info *ty, int flags) {
|
|||
return (*ptr == NULL ? -1 : 0);
|
||||
case IS_NULL:
|
||||
*ptr = 0;
|
||||
return 0;
|
||||
return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK;
|
||||
}
|
||||
|
||||
return -1;
|
||||
|
|
@ -293,7 +293,7 @@ SWIG_SetZval( zval *zv, int newFlow, int userNewObj, void *ptr, swig_type_info *
|
|||
}
|
||||
}
|
||||
|
||||
static char const_name[] = "swig_runtime_data_type_pointer";
|
||||
static const char const_name[] = "swig_runtime_data_type_pointer";
|
||||
static swig_module_info *SWIG_Php_GetModule() {
|
||||
zval *pointer = zend_get_constant_str(const_name, sizeof(const_name) - 1);
|
||||
if (pointer) {
|
||||
|
|
@ -304,6 +304,6 @@ static swig_module_info *SWIG_Php_GetModule() {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static void SWIG_Php_SetModule(swig_module_info *pointer) {
|
||||
REGISTER_MAIN_LONG_CONSTANT(const_name, (long) pointer, CONST_PERSISTENT | CONST_CS);
|
||||
static void SWIG_Php_SetModule(swig_module_info *pointer, int module_number) {
|
||||
REGISTER_LONG_CONSTANT(const_name, (long) pointer, CONST_CS | CONST_PERSISTENT);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,21 +20,27 @@
|
|||
|
||||
namespace std {
|
||||
|
||||
template<class K, class T> class map {
|
||||
template<class K, class T, class C = std::less<K> > class map {
|
||||
// add typemaps here
|
||||
public:
|
||||
typedef size_t size_type;
|
||||
typedef ptrdiff_t difference_type;
|
||||
typedef K key_type;
|
||||
typedef T mapped_type;
|
||||
typedef std::pair< const K, T > value_type;
|
||||
typedef value_type* pointer;
|
||||
typedef const value_type* const_pointer;
|
||||
typedef value_type& reference;
|
||||
typedef const value_type& const_reference;
|
||||
|
||||
map();
|
||||
map(const map<K,T> &);
|
||||
map(const map& other);
|
||||
|
||||
unsigned int size() const;
|
||||
void clear();
|
||||
%extend {
|
||||
const T& get(const K& key) throw (std::out_of_range) {
|
||||
std::map<K,T >::iterator i = self->find(key);
|
||||
std::map< K, T, C >::iterator i = self->find(key);
|
||||
if (i != self->end())
|
||||
return i->second;
|
||||
else
|
||||
|
|
@ -44,14 +50,14 @@ namespace std {
|
|||
(*self)[key] = x;
|
||||
}
|
||||
void del(const K& key) throw (std::out_of_range) {
|
||||
std::map<K,T >::iterator i = self->find(key);
|
||||
std::map< K, T, C >::iterator i = self->find(key);
|
||||
if (i != self->end())
|
||||
self->erase(i);
|
||||
else
|
||||
throw std::out_of_range("key not found");
|
||||
}
|
||||
bool has_key(const K& key) {
|
||||
std::map<K,T >::iterator i = self->find(key);
|
||||
std::map< K, T, C >::iterator i = self->find(key);
|
||||
return i != self->end();
|
||||
}
|
||||
bool is_empty() const {
|
||||
|
|
|
|||
|
|
@ -18,12 +18,14 @@
|
|||
namespace std {
|
||||
|
||||
template<class T, class U> struct pair {
|
||||
typedef T first_type;
|
||||
typedef U second_type;
|
||||
|
||||
pair();
|
||||
pair(T first, U second);
|
||||
pair(const pair& p);
|
||||
pair(const pair& other);
|
||||
|
||||
template <class U1, class U2> pair(const pair<U1, U2> &p);
|
||||
template <class U1, class U2> pair(const pair<U1, U2> &other);
|
||||
|
||||
T first;
|
||||
U second;
|
||||
|
|
|
|||
|
|
@ -14,10 +14,17 @@ namespace std {
|
|||
template<class T> class vector {
|
||||
public:
|
||||
typedef size_t size_type;
|
||||
typedef ptrdiff_t difference_type;
|
||||
typedef T value_type;
|
||||
typedef value_type* pointer;
|
||||
typedef const value_type* const_pointer;
|
||||
typedef value_type& reference;
|
||||
typedef const value_type& const_reference;
|
||||
|
||||
vector();
|
||||
vector(size_type n);
|
||||
vector(const vector& other);
|
||||
|
||||
size_type size() const;
|
||||
size_type capacity() const;
|
||||
void reserve(size_type n);
|
||||
|
|
@ -56,10 +63,17 @@ namespace std {
|
|||
template<> class vector<bool> {
|
||||
public:
|
||||
typedef size_t size_type;
|
||||
typedef ptrdiff_t difference_type;
|
||||
typedef bool value_type;
|
||||
typedef value_type* pointer;
|
||||
typedef const value_type* const_pointer;
|
||||
typedef value_type& reference;
|
||||
typedef bool const_reference;
|
||||
|
||||
vector();
|
||||
vector(size_type n);
|
||||
vector(const vector& other);
|
||||
|
||||
size_type size() const;
|
||||
size_type capacity() const;
|
||||
void reserve(size_type n);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
/* -----------------------------------------------------------------------------
|
||||
* stl.i
|
||||
*
|
||||
* Initial STL definition. extended as needed in each language
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
%include <std_common.i>
|
||||
|
|
|
|||
|
|
@ -77,18 +77,12 @@
|
|||
%{
|
||||
if (!EG(exception)) {
|
||||
CONVERT_IN($result, $1_ltype, *$input);
|
||||
} else {
|
||||
typedef $1_ltype swig_result_typedef;
|
||||
$result = swig_result_typedef();
|
||||
}
|
||||
%}
|
||||
%typemap(directorout) const TYPE & ($*1_ltype temp)
|
||||
%{
|
||||
if (!EG(exception)) {
|
||||
CONVERT_IN(temp, $*1_ltype, *$input);
|
||||
} else {
|
||||
typedef $*1_ltype swig_result_typedef;
|
||||
temp = swig_result_typedef();
|
||||
}
|
||||
$result = &temp;
|
||||
%}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue