X7ROOT File Manager
Current Path:
/usr/share/swig/2.0.10
usr
/
share
/
swig
/
2.0.10
/
📁
..
📁
allegrocl
📄
allkw.swg
(705 B)
📄
attribute.i
(496 B)
📄
carrays.i
(2.58 KB)
📄
cdata.i
(2.17 KB)
📁
cffi
📁
chicken
📁
clisp
📄
cmalloc.i
(2.3 KB)
📄
constraints.i
(6.88 KB)
📄
cpointer.i
(3.47 KB)
📁
csharp
📄
cstring.i
(324 B)
📄
cwstring.i
(265 B)
📁
d
📄
exception.i
(7.77 KB)
📁
gcj
📁
go
📁
guile
📄
intrusive_ptr.i
(2.75 KB)
📄
inttypes.i
(2.57 KB)
📁
java
📁
lua
📄
math.i
(2.04 KB)
📁
modula3
📁
mzscheme
📁
ocaml
📁
octave
📁
perl5
📁
php
📁
pike
📄
pointer.i
(294 B)
📁
python
📁
r
📁
ruby
📄
runtime.swg
(1.21 KB)
📄
shared_ptr.i
(2.1 KB)
📁
std
📄
std_except.i
(1.95 KB)
📄
stdint.i
(2.31 KB)
📄
stl.i
(249 B)
📄
swig.swg
(23.57 KB)
📄
swigarch.i
(1.54 KB)
📄
swigerrors.swg
(509 B)
📄
swiginit.swg
(7.88 KB)
📄
swiglabels.swg
(3.11 KB)
📄
swigrun.i
(256 B)
📄
swigrun.swg
(16.49 KB)
📄
swigwarn.swg
(13.2 KB)
📄
swigwarnings.swg
(6.83 KB)
📁
tcl
📁
typemaps
📁
uffi
📄
wchar.i
(309 B)
📄
windows.i
(4.05 KB)
Editing: cmalloc.i
/* ----------------------------------------------------------------------------- * cmalloc.i * * SWIG library file containing macros that can be used to create objects using * the C malloc function. * ----------------------------------------------------------------------------- */ %{ #include <stdlib.h> %} /* %malloc(TYPE [, NAME = TYPE]) %calloc(TYPE [, NAME = TYPE]) %realloc(TYPE [, NAME = TYPE]) %free(TYPE [, NAME = TYPE]) %allocators(TYPE [,NAME = TYPE]) Creates functions for allocating/reallocating memory. TYPE *malloc_NAME(int nbytes = sizeof(TYPE); TYPE *calloc_NAME(int nobj=1, int size=sizeof(TYPE)); TYPE *realloc_NAME(TYPE *ptr, int nbytes); void free_NAME(TYPE *ptr); */ %define %malloc(TYPE,NAME...) #if #NAME != "" %rename(malloc_##NAME) ::malloc(int nbytes); #else %rename(malloc_##TYPE) ::malloc(int nbytes); #endif #if #TYPE != "void" %typemap(default) int nbytes "$1 = (int) sizeof(TYPE);" #endif TYPE *malloc(int nbytes); %typemap(default) int nbytes; %enddef %define %calloc(TYPE,NAME...) #if #NAME != "" %rename(calloc_##NAME) ::calloc(int nobj, int sz); #else %rename(calloc_##TYPE) ::calloc(int nobj, int sz); #endif #if #TYPE != "void" %typemap(default) int sz "$1 = (int) sizeof(TYPE);" #else %typemap(default) int sz "$1 = 1;" #endif %typemap(default) int nobj "$1 = 1;" TYPE *calloc(int nobj, int sz); %typemap(default) int sz; %typemap(default) int nobj; %enddef %define %realloc(TYPE,NAME...) %insert("header") { #if #NAME != "" TYPE *realloc_##NAME(TYPE *ptr, int nitems) #else TYPE *realloc_##TYPE(TYPE *ptr, int nitems) #endif { #if #TYPE != "void" return (TYPE *) realloc(ptr, nitems*sizeof(TYPE)); #else return (TYPE *) realloc(ptr, nitems); #endif } } #if #NAME != "" TYPE *realloc_##NAME(TYPE *ptr, int nitems); #else TYPE *realloc_##TYPE(TYPE *ptr, int nitems); #endif %enddef %define %free(TYPE,NAME...) #if #NAME != "" %rename(free_##NAME) ::free(TYPE *ptr); #else %rename(free_##TYPE) ::free(TYPE *ptr); #endif void free(TYPE *ptr); %enddef %define %sizeof(TYPE,NAME...) #if #NAME != "" %constant int sizeof_##NAME = sizeof(TYPE); #else %constant int sizeof_##TYPE = sizeof(TYPE); #endif %enddef %define %allocators(TYPE,NAME...) %malloc(TYPE,NAME) %calloc(TYPE,NAME) %realloc(TYPE,NAME) %free(TYPE,NAME) #if #TYPE != "void" %sizeof(TYPE,NAME) #endif %enddef
Upload File
Create Folder