/usr/share/swig/3.0.12
NameSizeModeActions
allegrocl/-0755rm
cffi/-0755rm
chicken/-0755rm
clisp/-0755rm
csharp/-0755rm
d/-0755rm
gcj/-0755rm
go/-0755rm
guile/-0755rm
java/-0755rm
javascript/-0755rm
lua/-0755rm
modula3/-0755rm
mzscheme/-0755rm
ocaml/-0755rm
octave/-0755rm
perl5/-0755rm
php/-0755rm
php5/-0755rm
pike/-0755rm
python/-0755rm
r/-0755rm
ruby/-0755rm
scilab/-0755rm
std/-0755rm
tcl/-0755rm
typemaps/-0755rm
uffi/-0755rm
allkw.swg8030644editdlrm
attribute.i4960644editdlrm
carrays.i26460644editdlrm
cdata.i31810644editdlrm
cmalloc.i23540644editdlrm
constraints.i70470644editdlrm
cpointer.i35510644editdlrm
cstring.i3240644editdlrm
cwstring.i2650644editdlrm
director_common.swg5120644editdlrm
exception.i82540644editdlrm
intrusive_ptr.i28140644editdlrm
inttypes.i23800644editdlrm
math.i20860644editdlrm
pointer.i2940644editdlrm
runtime.swg12360644editdlrm
shared_ptr.i26860644editdlrm
stdint.i23680644editdlrm
std_except.i20770644editdlrm
stl.i2490644editdlrm
swig.swg248400644editdlrm
swigarch.i15800644editdlrm
swigerrors.swg4990644editdlrm
swiginit.swg79730644editdlrm
swiglabels.swg38000644editdlrm
swigrun.i2560644editdlrm
swigrun.swg166620644editdlrm
swigwarn.swg142910644editdlrm
swigwarnings.swg70940644editdlrm
wchar.i3090644editdlrm
windows.i41430644editdlrm
Edit: /usr/share/swig/3.0.12/cpointer.i (3551B)
/* ----------------------------------------------------------------------------- * cpointer.i * * SWIG library file containing macros that can be used to manipulate simple * pointer objects. * ----------------------------------------------------------------------------- */ /* ----------------------------------------------------------------------------- * %pointer_class(type,name) * * Places a simple proxy around a simple type like 'int', 'float', or whatever. * The proxy provides this interface: * * class type { * public: * type(); * ~type(); * type value(); * void assign(type value); * }; * * Example: * * %pointer_class(int, intp); * * int add(int *x, int *y) { return *x + *y; } * * In python (with proxies) * * >>> a = intp() * >>> a.assign(10) * >>> a.value() * 10 * >>> b = intp() * >>> b.assign(20) * >>> print add(a,b) * 30 * * As a general rule, this macro should not be used on class/structures that * are already defined in the interface. * ----------------------------------------------------------------------------- */ %define %pointer_class(TYPE, NAME) %{ typedef TYPE NAME; %} typedef struct { } NAME; %extend NAME { #ifdef __cplusplus NAME() { return new TYPE(); } ~NAME() { if ($self) delete $self; } #else NAME() { return (TYPE *) calloc(1,sizeof(TYPE)); } ~NAME() { if ($self) free($self); } #endif } %extend NAME { void assign(TYPE value) { *$self = value; } TYPE value() { return *$self; } TYPE * cast() { return $self; } static NAME * frompointer(TYPE *t) { return (NAME *) t; } } %types(NAME = TYPE); %enddef /* ----------------------------------------------------------------------------- * %pointer_functions(type,name) * * Create functions for allocating/deallocating pointers. This can be used * if you don't want to create a proxy class or if the pointer is complex. * * %pointer_functions(int, intp) * * int add(int *x, int *y) { return *x + *y; } * * In python (with proxies) * * >>> a = copy_intp(10) * >>> intp_value(a) * 10 * >>> b = new_intp() * >>> intp_assign(b,20) * >>> print add(a,b) * 30 * >>> delete_intp(a) * >>> delete_intp(b) * * ----------------------------------------------------------------------------- */ %define %pointer_functions(TYPE,NAME) %{ static TYPE *new_##NAME() { %} #ifdef __cplusplus %{ return new TYPE(); %} #else %{ return (TYPE *) calloc(1,sizeof(TYPE)); %} #endif %{} static TYPE *copy_##NAME(TYPE value) { %} #ifdef __cplusplus %{ return new TYPE(value); %} #else %{ TYPE *obj = (TYPE *) calloc(1,sizeof(TYPE)); *obj = value; return obj; %} #endif %{} static void delete_##NAME(TYPE *obj) { %} #ifdef __cplusplus %{ if (obj) delete obj; %} #else %{ if (obj) free(obj); %} #endif %{} static void NAME ##_assign(TYPE *obj, TYPE value) { *obj = value; } static TYPE NAME ##_value(TYPE *obj) { return *obj; } %} TYPE *new_##NAME(); TYPE *copy_##NAME(TYPE value); void delete_##NAME(TYPE *obj); void NAME##_assign(TYPE *obj, TYPE value); TYPE NAME##_value(TYPE *obj); %enddef /* ----------------------------------------------------------------------------- * %pointer_cast(type1,type2,name) * * Generates a pointer casting function. * ----------------------------------------------------------------------------- */ %define %pointer_cast(TYPE1,TYPE2,NAME) %inline %{ TYPE2 NAME(TYPE1 x) { return (TYPE2) x; } %} %enddef