Add "freearg" template
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10037 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
7037fecf7e
commit
54f0b11ddf
2 changed files with 47 additions and 10 deletions
28
Lib/r/r.swg
28
Lib/r/r.swg
|
|
@ -96,24 +96,38 @@ SWIG_InitializeModule(0);
|
|||
}
|
||||
|
||||
%typemap(in,noblock=1) char* {
|
||||
$1 = %reinterpret_cast(%const_cast(CHAR(STRING_ELT($input, 0)),
|
||||
char *), $1_ltype);
|
||||
$1 = %reinterpret_cast(strdup(CHAR(STRING_ELT($input, 0))), $1_ltype);
|
||||
}
|
||||
|
||||
%typemap(freearg,noblock=1) char* {
|
||||
free($1);
|
||||
}
|
||||
|
||||
%typemap(in,noblock=1) char *[ANY] {
|
||||
$1 = %reinterpret_cast(%const_cast(CHAR(STRING_ELT($input, 0)),
|
||||
char *),
|
||||
$1_ltype);
|
||||
$1 = %reinterpret_cast(strdup(CHAR(STRING_ELT($input, 0))), $1_ltype);
|
||||
}
|
||||
|
||||
%typemap(freearg,noblock=1) char *[ANY] {
|
||||
free($1);
|
||||
}
|
||||
|
||||
%typemap(in,noblock=1) char[ANY] {
|
||||
$1 = %const_cast(CHAR(STRING_ELT($input, 0)), char *);
|
||||
$1 = strdup(CHAR(STRING_ELT($input, 0)));
|
||||
}
|
||||
|
||||
%typemap(freearg,noblock=1) char[ANY] {
|
||||
free($1);
|
||||
}
|
||||
|
||||
%typemap(in,noblock=1) char[] {
|
||||
$1 = %const_cast(CHAR(STRING_ELT($input, 0)), char *);
|
||||
$1 = strdup(CHAR(STRING_ELT($input, 0)));
|
||||
}
|
||||
|
||||
%typemap(freearg,noblock=1) char[] {
|
||||
free($1);
|
||||
}
|
||||
|
||||
|
||||
%typemap(memberin) char[] %{
|
||||
if ($input) strcpy($1, $input);
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue