Merge branch 'master' of git+ssh://github.com/swig/swig
* 'master' of git+ssh://github.com/swig/swig: [Python] Fix some errors in the documentation for -threads Fixed typo in Perl5 docs. Update PHP testsuite for vadz's new cars [php] Whitespace improvements in generated C/C++ code Fix hardcoded _v in PHP typecheck typemaps
This commit is contained in:
commit
8c207dd3a9
9 changed files with 39 additions and 40 deletions
|
|
@ -1813,7 +1813,7 @@
|
||||||
<li><a href="Ocaml.html#Ocaml_nn25">Director Usage Example</a>
|
<li><a href="Ocaml.html#Ocaml_nn25">Director Usage Example</a>
|
||||||
<li><a href="Ocaml.html#Ocaml_nn26">Creating director objects</a>
|
<li><a href="Ocaml.html#Ocaml_nn26">Creating director objects</a>
|
||||||
<li><a href="Ocaml.html#Ocaml_nn27">Typemaps for directors, directorin, directorout, directorargout</a>
|
<li><a href="Ocaml.html#Ocaml_nn27">Typemaps for directors, directorin, directorout, directorargout</a>
|
||||||
<li><a href="Ocaml.html#Ocaml_nn28">typemap</a>
|
<li><a href="Ocaml.html#Ocaml_nn28">directorin typemap</a>
|
||||||
<li><a href="Ocaml.html#Ocaml_nn29">directorout typemap</a>
|
<li><a href="Ocaml.html#Ocaml_nn29">directorout typemap</a>
|
||||||
<li><a href="Ocaml.html#Ocaml_nn30">directorargout typemap</a>
|
<li><a href="Ocaml.html#Ocaml_nn30">directorargout typemap</a>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@
|
||||||
<li><a href="#Ocaml_nn25">Director Usage Example</a>
|
<li><a href="#Ocaml_nn25">Director Usage Example</a>
|
||||||
<li><a href="#Ocaml_nn26">Creating director objects</a>
|
<li><a href="#Ocaml_nn26">Creating director objects</a>
|
||||||
<li><a href="#Ocaml_nn27">Typemaps for directors, directorin, directorout, directorargout</a>
|
<li><a href="#Ocaml_nn27">Typemaps for directors, directorin, directorout, directorargout</a>
|
||||||
<li><a href="#Ocaml_nn28">typemap</a>
|
<li><a href="#Ocaml_nn28">directorin typemap</a>
|
||||||
<li><a href="#Ocaml_nn29">directorout typemap</a>
|
<li><a href="#Ocaml_nn29">directorout typemap</a>
|
||||||
<li><a href="#Ocaml_nn30">directorargout typemap</a>
|
<li><a href="#Ocaml_nn30">directorargout typemap</a>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
@ -948,7 +948,7 @@ well as a function return value in the same way you provide function arguments,
|
||||||
and to receive arguments the same way you normally receive function returns.
|
and to receive arguments the same way you normally receive function returns.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<H4><a name="Ocaml_nn28">38.2.5.6 typemap</a></H4>
|
<H4><a name="Ocaml_nn28">38.2.5.6 directorin typemap</a></H4>
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
|
||||||
|
|
@ -1888,7 +1888,7 @@ like this:
|
||||||
<pre>
|
<pre>
|
||||||
%typemap(out) int {
|
%typemap(out) int {
|
||||||
$result = sv_newmortal();
|
$result = sv_newmortal();
|
||||||
set_setiv($result, (IV) $1);
|
sv_setiv($result, (IV) $1);
|
||||||
argvi++;
|
argvi++;
|
||||||
}
|
}
|
||||||
</pre>
|
</pre>
|
||||||
|
|
|
||||||
|
|
@ -7259,12 +7259,12 @@ will not be able to run any other threads, even if the wrapped C/C++ code is wai
|
||||||
<p>
|
<p>
|
||||||
The <tt>threads</tt> module option in the *.i template file:
|
The <tt>threads</tt> module option in the *.i template file:
|
||||||
</p>
|
</p>
|
||||||
<div class="code"><pre>%feature("nothread") method;</pre></div>
|
<div class="code"><pre>%module("threads"=1)</pre></div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><p>You can disable thread support for a given method:</p>
|
<li><p>You can disable thread support for a given method:</p>
|
||||||
<div class="code"><pre>%module("threads"=1)</pre></div>
|
<div class="code"><pre>%feature("nothread") method;</pre></div>
|
||||||
or
|
or
|
||||||
<div class="code"><pre>%nothread method;</pre></div>
|
<div class="code"><pre>%nothread method;</pre></div>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ require "tests.php";
|
||||||
require "ignore_parameter.php";
|
require "ignore_parameter.php";
|
||||||
|
|
||||||
// New functions
|
// New functions
|
||||||
check::functions(array('jaguar','lotus','tvr','ferrari','sportscars_daimler','sportscars_astonmartin','sportscars_bugatti','sportscars_lamborghini'));
|
check::functions(array('jaguar','lotus','tvr','ferrari','fiat','sportscars_daimler','sportscars_astonmartin','sportscars_bugatti','sportscars_lamborghini','sportscars_maseratti'));
|
||||||
// New classes
|
// New classes
|
||||||
check::classes(array('ignore_parameter','SportsCars','MiniCooper','MorrisMinor','FordAnglia','AustinAllegro'));
|
check::classes(array('ignore_parameter','SportsCars','MiniCooper','MorrisMinor','FordAnglia','AustinAllegro'));
|
||||||
// No new vars
|
// No new vars
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,7 @@
|
||||||
|
|
||||||
%typemap(varin) SWIGTYPE []
|
%typemap(varin) SWIGTYPE []
|
||||||
{
|
{
|
||||||
if($1) {
|
if ($1) {
|
||||||
zval *z_var = zend_hash_str_find(&EG(symbol_table), "$1", sizeof("$1") - 1);
|
zval *z_var = zend_hash_str_find(&EG(symbol_table), "$1", sizeof("$1") - 1);
|
||||||
SWIG_SetPointerZval(z_var, (void*)$1, $1_descriptor, $owner);
|
SWIG_SetPointerZval(z_var, (void*)$1, $1_descriptor, $owner);
|
||||||
}
|
}
|
||||||
|
|
@ -144,15 +144,15 @@
|
||||||
|
|
||||||
%typemap(varin) char [ANY]
|
%typemap(varin) char [ANY]
|
||||||
{
|
{
|
||||||
zval **z_var;
|
zval **z_var;
|
||||||
char *s1;
|
char *s1;
|
||||||
|
|
||||||
zend_hash_str_find(&EG(symbol_table), "$1", sizeof("$1") - 1, (void**)&z_var);
|
zend_hash_str_find(&EG(symbol_table), "$1", sizeof("$1") - 1, (void**)&z_var);
|
||||||
s1 = Z_STRVAL_P(z_var);
|
s1 = Z_STRVAL_P(z_var);
|
||||||
if ((s1 == NULL) || ($1 == NULL) || strcmp(s1, $1)) {
|
if ((s1 == NULL) || ($1 == NULL) || strcmp(s1, $1)) {
|
||||||
if (s1)
|
if (s1)
|
||||||
strncpy($1, s1, $1_dim0);
|
strncpy($1, s1, $1_dim0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
%typemap(varin) SWIGTYPE
|
%typemap(varin) SWIGTYPE
|
||||||
|
|
@ -166,7 +166,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
$1 = *($&1_ltype)_temp;
|
$1 = *($&1_ltype)_temp;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
%typemap(varin) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&
|
%typemap(varin) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&
|
||||||
|
|
@ -245,7 +244,7 @@
|
||||||
(z_var)->value.str.val = 0;
|
(z_var)->value.str.val = 0;
|
||||||
(z_var)->value.str.len = 0;
|
(z_var)->value.str.len = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
%typemap(varout) SWIGTYPE
|
%typemap(varout) SWIGTYPE
|
||||||
|
|
|
||||||
|
|
@ -471,7 +471,7 @@
|
||||||
%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE
|
%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE
|
||||||
{
|
{
|
||||||
void *tmp;
|
void *tmp;
|
||||||
_v = (SWIG_ConvertPtr(&$input, (void **)&tmp, $&1_descriptor, SWIG_POINTER_NO_NULL) >= 0);
|
$1 = (SWIG_ConvertPtr(&$input, (void **)&tmp, $&1_descriptor, SWIG_POINTER_NO_NULL) >= 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
%typecheck(SWIG_TYPECHECK_POINTER)
|
%typecheck(SWIG_TYPECHECK_POINTER)
|
||||||
|
|
@ -480,7 +480,7 @@
|
||||||
SWIGTYPE *const&
|
SWIGTYPE *const&
|
||||||
{
|
{
|
||||||
void *tmp;
|
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)
|
%typecheck(SWIG_TYPECHECK_POINTER)
|
||||||
|
|
@ -488,19 +488,19 @@
|
||||||
SWIGTYPE &&
|
SWIGTYPE &&
|
||||||
{
|
{
|
||||||
void *tmp;
|
void *tmp;
|
||||||
_v = (SWIG_ConvertPtr(&$input, (void**)&tmp, $1_descriptor, SWIG_POINTER_NO_NULL) >= 0);
|
$1 = (SWIG_ConvertPtr(&$input, (void**)&tmp, $1_descriptor, SWIG_POINTER_NO_NULL) >= 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *const&
|
%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *const&
|
||||||
{
|
{
|
||||||
void *tmp;
|
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 *
|
%typecheck(SWIG_TYPECHECK_VOIDPTR) void *
|
||||||
{
|
{
|
||||||
void *tmp;
|
void *tmp;
|
||||||
_v = (SWIG_ConvertPtr(&$input, (void**)&tmp, 0, 0) >= 0);
|
$1 = (SWIG_ConvertPtr(&$input, (void**)&tmp, 0, 0) >= 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Exception handling */
|
/* Exception handling */
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
|
|
||||||
/* ------------------------------------------------------------
|
/* ------------------------------------------------------------
|
||||||
* The start of the PHP initialization function
|
* The start of the PHP initialization function
|
||||||
* ------------------------------------------------------------ */
|
* ------------------------------------------------------------ */
|
||||||
|
|
||||||
%insert(init) "swiginit.swg"
|
%insert(init) "swiginit.swg"
|
||||||
|
|
||||||
%init %{
|
%init %{
|
||||||
SWIG_php_minit {
|
SWIG_php_minit {
|
||||||
SWIG_InitializeModule((void*)&module_number);
|
SWIG_InitializeModule((void*)&module_number);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%fragment("swig_php_init_member_ptr2", "header") %{
|
%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") %{
|
%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);
|
||||||
%}
|
%}
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,7 @@ static void SwigPHP_emit_resource_registrations() {
|
||||||
|
|
||||||
ki = First(zend_types);
|
ki = First(zend_types);
|
||||||
if (ki.key)
|
if (ki.key)
|
||||||
Printf(s_oinit, "\n/* Register resource destructors for pointer types */\n");
|
Printf(s_oinit, "\n /* Register resource destructors for pointer types */\n");
|
||||||
while (ki.key) {
|
while (ki.key) {
|
||||||
DOH *key = ki.key;
|
DOH *key = ki.key;
|
||||||
Node *class_node = ki.item;
|
Node *class_node = ki.item;
|
||||||
|
|
@ -180,11 +180,11 @@ static void SwigPHP_emit_resource_registrations() {
|
||||||
Printf(s_vdecl, "static int le_swig_%s=0; /* handle for %s */\n", key, human_name);
|
Printf(s_vdecl, "static int le_swig_%s=0; /* handle for %s */\n", key, human_name);
|
||||||
|
|
||||||
// register with php
|
// register with php
|
||||||
Printf(s_oinit, "le_swig_%s=zend_register_list_destructors_ex"
|
Printf(s_oinit, " le_swig_%s=zend_register_list_destructors_ex"
|
||||||
"(%s, NULL, SWIGTYPE%s->name, module_number);\n", key, rsrc_dtor_name, key);
|
"(%s, NULL, SWIGTYPE%s->name, module_number);\n", key, rsrc_dtor_name, key);
|
||||||
|
|
||||||
// store php type in class struct
|
// store php type in class struct
|
||||||
Printf(s_oinit, "SWIG_TypeClientData(SWIGTYPE%s,&le_swig_%s);\n", key, key);
|
Printf(s_oinit, " SWIG_TypeClientData(SWIGTYPE%s,&le_swig_%s);\n", key, key);
|
||||||
|
|
||||||
Delete(rsrc_dtor_name);
|
Delete(rsrc_dtor_name);
|
||||||
|
|
||||||
|
|
@ -272,8 +272,8 @@ public:
|
||||||
/* subsections of the init section */
|
/* subsections of the init section */
|
||||||
s_vinit = NewStringEmpty();
|
s_vinit = NewStringEmpty();
|
||||||
s_vdecl = NewString("/* vdecl subsection */\n");
|
s_vdecl = NewString("/* vdecl subsection */\n");
|
||||||
s_cinit = NewString("/* cinit subsection */\n");
|
s_cinit = NewString(" /* cinit subsection */\n");
|
||||||
s_oinit = NewString("/* oinit subsection */\n");
|
s_oinit = NewString(" /* oinit subsection */\n");
|
||||||
pragma_phpinfo = NewStringEmpty();
|
pragma_phpinfo = NewStringEmpty();
|
||||||
s_phpclasses = NewString("/* PHP Proxy Classes */\n");
|
s_phpclasses = NewString("/* PHP Proxy Classes */\n");
|
||||||
f_directors_h = NewStringEmpty();
|
f_directors_h = NewStringEmpty();
|
||||||
|
|
@ -364,7 +364,7 @@ public:
|
||||||
|
|
||||||
/* Initialize the rest of the module */
|
/* Initialize the rest of the module */
|
||||||
|
|
||||||
Printf(s_oinit, "ZEND_INIT_MODULE_GLOBALS(%s, %s_init_globals, NULL);\n", module, module);
|
Printf(s_oinit, " ZEND_INIT_MODULE_GLOBALS(%s, %s_init_globals, NULL);\n", module, module);
|
||||||
|
|
||||||
/* start the header section */
|
/* start the header section */
|
||||||
Printf(s_header, "ZEND_BEGIN_MODULE_GLOBALS(%s)\n", module);
|
Printf(s_header, "ZEND_BEGIN_MODULE_GLOBALS(%s)\n", module);
|
||||||
|
|
@ -549,17 +549,17 @@ public:
|
||||||
|
|
||||||
// Printv(s_init,s_resourcetypes,NIL);
|
// Printv(s_init,s_resourcetypes,NIL);
|
||||||
/* We need this after all classes written out by ::top */
|
/* We need this after all classes written out by ::top */
|
||||||
Printf(s_oinit, "CG(active_class_entry) = NULL;\n");
|
Printf(s_oinit, " CG(active_class_entry) = NULL;\n");
|
||||||
Printf(s_oinit, "/* end oinit subsection */\n");
|
Printf(s_oinit, " /* end oinit subsection */\n");
|
||||||
Printf(s_init, "%s\n", s_oinit);
|
Printf(s_init, "%s\n", s_oinit);
|
||||||
|
|
||||||
/* Constants generated during top call */
|
/* Constants generated during top call */
|
||||||
Printf(s_cinit, "/* end cinit subsection */\n");
|
Printf(s_cinit, " /* end cinit subsection */\n");
|
||||||
Printf(s_init, "%s\n", s_cinit);
|
Printf(s_init, "%s\n", s_cinit);
|
||||||
Clear(s_cinit);
|
Clear(s_cinit);
|
||||||
Delete(s_cinit);
|
Delete(s_cinit);
|
||||||
|
|
||||||
Printf(s_init, " return SUCCESS;\n");
|
Printf(s_init, " return SUCCESS;\n");
|
||||||
Printf(s_init, "}\n\n");
|
Printf(s_init, "}\n\n");
|
||||||
|
|
||||||
// Now do REQUEST init which holds any user specified %rinit, and also vinit
|
// Now do REQUEST init which holds any user specified %rinit, and also vinit
|
||||||
|
|
@ -577,15 +577,15 @@ public:
|
||||||
if (Len(s_vinit) > 0) {
|
if (Len(s_vinit) > 0) {
|
||||||
/* finish our init section which will have been used by class wrappers */
|
/* finish our init section which will have been used by class wrappers */
|
||||||
Printv(s_init,
|
Printv(s_init,
|
||||||
"/* vinit subsection */\n",
|
" /* vinit subsection */\n",
|
||||||
s_vinit, "\n"
|
s_vinit, "\n"
|
||||||
"/* end vinit subsection */\n",
|
" /* end vinit subsection */\n",
|
||||||
NIL);
|
NIL);
|
||||||
Clear(s_vinit);
|
Clear(s_vinit);
|
||||||
}
|
}
|
||||||
Delete(s_vinit);
|
Delete(s_vinit);
|
||||||
|
|
||||||
Printf(s_init, " return SUCCESS;\n");
|
Printf(s_init, " return SUCCESS;\n");
|
||||||
Printf(s_init, "}\n\n");
|
Printf(s_init, "}\n\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -598,7 +598,7 @@ public:
|
||||||
"/* shutdown section */\n"
|
"/* shutdown section */\n"
|
||||||
"{\n",
|
"{\n",
|
||||||
s_shutdown,
|
s_shutdown,
|
||||||
" return SUCCESS;\n"
|
" return SUCCESS;\n"
|
||||||
"}\n\n", NIL);
|
"}\n\n", NIL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue