[PHP] The SWIG cdata.i library module is now supported.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10647 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
3d6dcc3ce6
commit
1e6d6b2708
3 changed files with 15 additions and 4 deletions
|
|
@ -1,6 +1,9 @@
|
|||
Version 1.3.37 (in progress)
|
||||
=============================
|
||||
|
||||
2008-07-04: olly
|
||||
[PHP] The SWIG cdata.i library module is now supported.
|
||||
|
||||
2008-07-03: olly
|
||||
[PHP] The deprecated command line option "-phpfull" has been
|
||||
removed. We recommend building your extension as a dynamically
|
||||
|
|
|
|||
|
|
@ -29,6 +29,11 @@ typedef struct SWIGCDATA {
|
|||
$result = C_string(&string_space, $1.len, $1.data);
|
||||
}
|
||||
%typemap(in) (const void *indata, int inlen) = (char *STRING, int LENGTH);
|
||||
#elif SWIGPHP
|
||||
%typemap(out) SWIGCDATA {
|
||||
ZVAL_STRINGL($result, $1.data, $1.len, 1);
|
||||
}
|
||||
%typemap(in) (const void *indata, int inlen) = (char *STRING, int LENGTH);
|
||||
#else
|
||||
%echo "cdata.i module not supported."
|
||||
#endif
|
||||
|
|
@ -76,7 +81,3 @@ SWIGCDATA cdata_##NAME(TYPE *ptr, int nelements);
|
|||
|
||||
/* Memory move function */
|
||||
void memmove(void *data, const void *indata, int inlen);
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -73,6 +73,13 @@
|
|||
$1 = ($1_ltype) Z_STRVAL_PP($input);
|
||||
}
|
||||
|
||||
%typemap(in) (char *STRING, int LENGTH)
|
||||
{
|
||||
convert_to_string_ex($input);
|
||||
$1 = ($1_ltype) Z_STRVAL_PP($input);
|
||||
$2 = ($2_ltype) Z_STRLEN_PP($input);
|
||||
}
|
||||
|
||||
/* Object passed by value. Convert to a pointer */
|
||||
%typemap(in) SWIGTYPE ($&1_ltype tmp)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue