Fix typos in docs and comments
This commit is contained in:
parent
b5544a1812
commit
b127e11f1e
27 changed files with 46 additions and 46 deletions
|
|
@ -75,7 +75,7 @@ Functionality
|
||||||
https://www.doxygen.nl/manual/commands.html. If a tag is
|
https://www.doxygen.nl/manual/commands.html. If a tag is
|
||||||
marked as 'ignored', then the tag is ignored, but the text is copied
|
marked as 'ignored', then the tag is ignored, but the text is copied
|
||||||
to the destination documentation. 'Not implemented' means that the
|
to the destination documentation. 'Not implemented' means that the
|
||||||
tag with it's contents is stripped out of the output.
|
tag with its contents is stripped out of the output.
|
||||||
|
|
||||||
Doxygen tags:
|
Doxygen tags:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -181,7 +181,7 @@ or enum element comments:
|
||||||
<div class="code"><pre>
|
<div class="code"><pre>
|
||||||
enum E_NUMBERS
|
enum E_NUMBERS
|
||||||
{
|
{
|
||||||
EN_ZERO, ///< The first enum item, gets zero as it's value
|
EN_ZERO, ///< The first enum item, gets zero as its value
|
||||||
EN_ONE, ///< The second, EN_ONE=1
|
EN_ONE, ///< The second, EN_ONE=1
|
||||||
EN_THREE
|
EN_THREE
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -644,7 +644,7 @@ java::
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
To build the DLL and compile the java code, run NMAKE (you may need to run <tt>vcvars32</tt> first).
|
To build the DLL and compile the java code, run NMAKE (you may need to run <tt>vcvars32</tt> first).
|
||||||
This is a pretty simplistic Makefile, but hopefully its enough to get you started.
|
This is a pretty simplistic Makefile, but hopefully it's enough to get you started.
|
||||||
Of course you may want to make changes for it to work for C++ by adding in the -c++ command line option for swig and replacing .c with .cxx.
|
Of course you may want to make changes for it to work for C++ by adding in the -c++ command line option for swig and replacing .c with .cxx.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1520,7 +1520,7 @@ function
|
||||||
nil
|
nil
|
||||||
>
|
>
|
||||||
</pre></div>
|
</pre></div>
|
||||||
<p> This behaviour was changed. Now unless -squash-bases option is provided, Derived store a list of it's bases and if some symbol is not found in it's own service tables
|
<p> This behaviour was changed. Now unless -squash-bases option is provided, Derived stores a list of its bases and if some symbol is not found in its own service tables
|
||||||
then its bases are searched for it. Option -squash-bases will effectively return old behaviour.
|
then its bases are searched for it. Option -squash-bases will effectively return old behaviour.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
@ -1638,7 +1638,7 @@ More details can be found in the <a href="Library.html#Library_carrays">carrays.
|
||||||
|
|
||||||
<div class="code"><pre>// using the C-array
|
<div class="code"><pre>// using the C-array
|
||||||
%include <carrays.i>
|
%include <carrays.i>
|
||||||
// this declares a batch of function for manipulating C integer arrays
|
// this declares a batch of functions for manipulating C integer arrays
|
||||||
%array_functions(int, int)
|
%array_functions(int, int)
|
||||||
|
|
||||||
extern void sort_int(int* arr, int len); // the function to wrap
|
extern void sort_int(int* arr, int len); // the function to wrap
|
||||||
|
|
@ -1997,10 +1997,10 @@ So when 'p:Print()' is called, the __index looks on the object metatable for a '
|
||||||
In theory, you can play with this usertable & add new features, but remember that it is a shared table between all instances of one class, and you could very easily corrupt the functions in all the instances.
|
In theory, you can play with this usertable & add new features, but remember that it is a shared table between all instances of one class, and you could very easily corrupt the functions in all the instances.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Note: Both the opaque structures (like the FILE*) and normal wrapped classes/structs use the same 'swig_lua_userdata' structure. Though the opaque structures has do not have a metatable attached, or any information on how to dispose of them when the interpreter has finished with them.
|
Note: Both the opaque structures (like the FILE*) and normal wrapped classes/structs use the same 'swig_lua_userdata' structure. Though the opaque structures do not have a metatable attached, or any information on how to dispose of them when the interpreter has finished with them.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Note: Operator overloads are basically done in the same way, by adding functions such as '__add' & '__call' to the class' metatable. The current implementation is a bit rough as it will add any member function beginning with '__' into the metatable too, assuming its an operator overload.
|
Note: Operator overloads are basically done in the same way, by adding functions such as '__add' & '__call' to the class' metatable. The current implementation is a bit rough as it will add any member function beginning with '__' into the metatable too, assuming it's an operator overload.
|
||||||
</p>
|
</p>
|
||||||
<H3><a name="Lua_nn38">29.7.3 Memory management</a></H3>
|
<H3><a name="Lua_nn38">29.7.3 Memory management</a></H3>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2319,7 +2319,7 @@ typedef struct {
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
By default, SWIG doesn't know how to the handle the values structure
|
By default, SWIG doesn't know how to the handle the values structure
|
||||||
member it's an array, not a pointer. In this case, SWIG makes the array member
|
member because it's an array, not a pointer. In this case, SWIG makes the array member
|
||||||
read-only. Reading will simply return a pointer to the first item in the array.
|
read-only. Reading will simply return a pointer to the first item in the array.
|
||||||
To make the member writable, a "memberin" typemap can be used.
|
To make the member writable, a "memberin" typemap can be used.
|
||||||
</p>
|
</p>
|
||||||
|
|
@ -2747,7 +2747,7 @@ from the internal <tt>%OWNER</tt> hash).
|
||||||
The <tt>%OWNER</tt> hash is an implementation detail, discussed here
|
The <tt>%OWNER</tt> hash is an implementation detail, discussed here
|
||||||
only to help clarify the operation of <tt>ACQUIRE</tt> and <tt>DISOWN</tt>.
|
only to help clarify the operation of <tt>ACQUIRE</tt> and <tt>DISOWN</tt>.
|
||||||
You should not access <tt>%OWNER</tt> directly - the details of how it
|
You should not access <tt>%OWNER</tt> directly - the details of how it
|
||||||
works (and possibly even its existence) may chance in future SWIG versions.
|
works (and possibly even its existence) may change in future SWIG versions.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="targetlang"><pre>
|
<div class="targetlang"><pre>
|
||||||
|
|
|
||||||
|
|
@ -636,7 +636,7 @@ tcl:
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
To build the extension, run NMAKE (you may need to run vcvars32
|
To build the extension, run NMAKE (you may need to run vcvars32
|
||||||
first). This is a pretty minimal Makefile, but hopefully its enough
|
first). This is a pretty minimal Makefile, but hopefully it's enough
|
||||||
to get you started. With a little practice, you'll be making lots of
|
to get you started. With a little practice, you'll be making lots of
|
||||||
Tcl extensions.
|
Tcl extensions.
|
||||||
</p>
|
</p>
|
||||||
|
|
|
||||||
|
|
@ -9,12 +9,12 @@ See the lua code for how they are called
|
||||||
|
|
||||||
%include <carrays.i> // array helpers
|
%include <carrays.i> // array helpers
|
||||||
|
|
||||||
// this declares a batch of function for manipulating C integer arrays
|
// this declares a batch of functions for manipulating C integer arrays
|
||||||
%array_functions(int,int)
|
%array_functions(int,int)
|
||||||
|
|
||||||
// this adds some lua code directly into the module
|
// this adds some lua code directly into the module
|
||||||
// warning: you need the example. prefix if you want it added into the module
|
// warning: you need the example. prefix if you want it added into the module
|
||||||
// admittedly this code is a bit tedious, but its a one off effort
|
// admittedly this code is a bit tedious, but it's a one off effort
|
||||||
%luacode {
|
%luacode {
|
||||||
function example.sort_int2(t)
|
function example.sort_int2(t)
|
||||||
-- local len=table.maxn(t) -- the len - maxn deprecated in 5.3
|
-- local len=table.maxn(t) -- the len - maxn deprecated in 5.3
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ extern int luaopen_example(lua_State*L);
|
||||||
|
|
||||||
/* This is an example of how to call the Lua function
|
/* This is an example of how to call the Lua function
|
||||||
int add(int,int)
|
int add(int,int)
|
||||||
its very tedious, but gives you an idea of the issues involved.
|
it's very tedious, but gives you an idea of the issues involved.
|
||||||
(look below for a better idea)
|
(look below for a better idea)
|
||||||
*/
|
*/
|
||||||
int call_add(lua_State *L,int a,int b,int* res) {
|
int call_add(lua_State *L,int a,int b,int* res) {
|
||||||
|
|
@ -75,7 +75,7 @@ int call_add(lua_State *L,int a,int b,int* res) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This is a variargs call function for calling from C into Lua.
|
/* This is a varargs call function for calling from C into Lua.
|
||||||
Original Code from Programming in Lua (PIL) by Roberto Ierusalimschy
|
Original Code from Programming in Lua (PIL) by Roberto Ierusalimschy
|
||||||
ISBN 85-903798-1-7
|
ISBN 85-903798-1-7
|
||||||
http://www.lua.org/pil/25.3.html
|
http://www.lua.org/pil/25.3.html
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ bool push_pointer(lua_State*L, void* ptr, const char* type_name, int owned = 0)
|
||||||
|
|
||||||
/* This is an example of how to call the Lua function
|
/* This is an example of how to call the Lua function
|
||||||
void onEvent(Event e)
|
void onEvent(Event e)
|
||||||
its very tedious, but gives you an idea of the issues involed.
|
it's very tedious, but gives you an idea of the issues involved.
|
||||||
*/
|
*/
|
||||||
int call_onEvent(lua_State *L, Event e) {
|
int call_onEvent(lua_State *L, Event e) {
|
||||||
int top;
|
int top;
|
||||||
|
|
@ -105,7 +105,7 @@ int main(int argc, char* argv[]) {
|
||||||
/* this code will pass a pointer into lua, but C++ still owns the object
|
/* this code will pass a pointer into lua, but C++ still owns the object
|
||||||
this is a little tedious, to do, but let's do it
|
this is a little tedious, to do, but let's do it
|
||||||
we need to pass the pointer (obviously), the type name
|
we need to pass the pointer (obviously), the type name
|
||||||
and a flag which states if Lua should delete the pointer once its finished with it
|
and a flag which states if Lua should delete the pointer once it's finished with it
|
||||||
The type name is a class name string which is registered with SWIG
|
The type name is a class name string which is registered with SWIG
|
||||||
(normally, just look in the wrapper file to get this)
|
(normally, just look in the wrapper file to get this)
|
||||||
in this case we don't want Lua to delete the pointer so the ownership flag is 0
|
in this case we don't want Lua to delete the pointer so the ownership flag is 0
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ run_testcase = \
|
||||||
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(CFFI) -batch -s $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
|
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(CFFI) -batch -s $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Clean: (does nothing, we dont generate extra cffi code)
|
# Clean: (does nothing, we don't generate extra cffi code)
|
||||||
%.clean:
|
%.clean:
|
||||||
@exit 0
|
@exit 0
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ Hash {
|
||||||
and by checking the typemaps.
|
and by checking the typemaps.
|
||||||
The typemap code also calls SwigType_remember(), if your typemaps
|
The typemap code also calls SwigType_remember(), if your typemaps
|
||||||
defined an object type, it will be added into the SwigType table.
|
defined an object type, it will be added into the SwigType table.
|
||||||
its normally a
|
it's normally a
|
||||||
SWIG_ConvertPtr(....$descriptor...)
|
SWIG_ConvertPtr(....$descriptor...)
|
||||||
when it should have been a $&descriptor or $*descriptor
|
when it should have been a $&descriptor or $*descriptor
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ namespace Swig {
|
||||||
%feature("director:except") {
|
%feature("director:except") {
|
||||||
jthrowable $error = jenv->ExceptionOccurred();
|
jthrowable $error = jenv->ExceptionOccurred();
|
||||||
if ($error) {
|
if ($error) {
|
||||||
// Dont clear exception, still be active when return to java execution
|
// Don't clear exception, still be active when return to java execution
|
||||||
// Essentially ignore exception occurred -- old behavior.
|
// Essentially ignore exception occurred -- old behavior.
|
||||||
return $null;
|
return $null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ run_testcase = \
|
||||||
env LUA_PATH="$(srcdir)/?.lua;" $(RUNTOOL) $(LUA) $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
|
env LUA_PATH="$(srcdir)/?.lua;" $(RUNTOOL) $(LUA) $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Clean: (does nothing, we dont generate extra lua code)
|
# Clean: (does nothing, we don't generate extra lua code)
|
||||||
%.clean:
|
%.clean:
|
||||||
@exit 0
|
@exit 0
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ multiple output values, they are returned in the form of a Python tuple.
|
||||||
|
|
||||||
For example, suppose you were trying to wrap the modf() function in the
|
For example, suppose you were trying to wrap the modf() function in the
|
||||||
C math library which splits x into integral and fractional parts (and
|
C math library which splits x into integral and fractional parts (and
|
||||||
returns the integer part in one of its parameters).K:
|
returns the integer part in one of its parameters) :
|
||||||
|
|
||||||
double modf(double x, double *ip);
|
double modf(double x, double *ip);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ multiple output values, they are returned in the form of a Python tuple.
|
||||||
|
|
||||||
For example, suppose you were trying to wrap the modf() function in the
|
For example, suppose you were trying to wrap the modf() function in the
|
||||||
C math library which splits x into integral and fractional parts (and
|
C math library which splits x into integral and fractional parts (and
|
||||||
returns the integer part in one of its parameters).K:
|
returns the integer part in one of its parameters) :
|
||||||
|
|
||||||
double modf(double x, double *ip);
|
double modf(double x, double *ip);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -151,7 +151,7 @@ The python/lua ones are great, but C++ ones I don't like
|
||||||
(mainly because I cannot get the stack trace out of it)
|
(mainly because I cannot get the stack trace out of it)
|
||||||
Therefore I have not bothered to try doing much in this
|
Therefore I have not bothered to try doing much in this
|
||||||
|
|
||||||
Therefore currently its just enough to get a few test cases running ok
|
Therefore currently it's just enough to get a few test cases running ok
|
||||||
|
|
||||||
note: if you wish to throw anything related to std::exception
|
note: if you wish to throw anything related to std::exception
|
||||||
use %include <std_except.i> instead
|
use %include <std_except.i> instead
|
||||||
|
|
@ -191,7 +191,7 @@ use %include <std_except.i> instead
|
||||||
Throwing object is a serious problem:
|
Throwing object is a serious problem:
|
||||||
Assuming some code throws a 'FooBar'
|
Assuming some code throws a 'FooBar'
|
||||||
There are a few options:
|
There are a few options:
|
||||||
- return a pointer to it: but its unclear how long this will last for.
|
- return a pointer to it: but it's unclear how long this will last for.
|
||||||
- return a copy of it: but not all objects are copyable
|
- return a copy of it: but not all objects are copyable
|
||||||
(see exception_partial_info in the test suite for a case where you cannot do this)
|
(see exception_partial_info in the test suite for a case where you cannot do this)
|
||||||
- convert to a string & throw that
|
- convert to a string & throw that
|
||||||
|
|
@ -224,7 +224,7 @@ SWIG_fail;%}
|
||||||
|
|
||||||
|
|
||||||
// note: no support for object pointers
|
// note: no support for object pointers
|
||||||
// its not clear how long the pointer is valid for, therefore not supporting it
|
// it's not clear how long the pointer is valid for, therefore not supporting it
|
||||||
|
|
||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
* extras
|
* extras
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ note: it should be passed by value, not byref or as a pointer.
|
||||||
|
|
||||||
The SWIGLUA_FN holds a pointer to the lua_State, and the stack index where the function is held.
|
The SWIGLUA_FN holds a pointer to the lua_State, and the stack index where the function is held.
|
||||||
The macro SWIGLUA_FN_GET() will put a copy of the lua function at the top of the stack.
|
The macro SWIGLUA_FN_GET() will put a copy of the lua function at the top of the stack.
|
||||||
After that its fairly simple to write the rest of the code (assuming know how to use lua),
|
After that it's fairly simple to write the rest of the code (assuming know how to use lua),
|
||||||
just push the parameters, call the function and return the result.
|
just push the parameters, call the function and return the result.
|
||||||
|
|
||||||
int my_func(int a, int b, SWIGLUA_FN fn)
|
int my_func(int a, int b, SWIGLUA_FN fn)
|
||||||
|
|
|
||||||
|
|
@ -826,7 +826,7 @@ SWIGINTERN int SWIG_Lua_class_do_get_item(lua_State *L, swig_type_info *type, i
|
||||||
/* NEW: looks for the __getitem() fn
|
/* NEW: looks for the __getitem() fn
|
||||||
this is a user provided get fn */
|
this is a user provided get fn */
|
||||||
SWIG_Lua_get_table(L,"__getitem"); /* find the __getitem fn */
|
SWIG_Lua_get_table(L,"__getitem"); /* find the __getitem fn */
|
||||||
if (lua_iscfunction(L,-1)) /* if its there */
|
if (lua_iscfunction(L,-1)) /* if it's there */
|
||||||
{ /* found it so call the fn & return its value */
|
{ /* found it so call the fn & return its value */
|
||||||
lua_pushvalue(L,substack_start+1); /* the userdata */
|
lua_pushvalue(L,substack_start+1); /* the userdata */
|
||||||
lua_pushvalue(L,substack_start+2); /* the parameter */
|
lua_pushvalue(L,substack_start+2); /* the parameter */
|
||||||
|
|
@ -883,7 +883,7 @@ SWIGINTERN int SWIG_Lua_class_do_get(lua_State *L, swig_type_info *type, int SW
|
||||||
lua_pushvalue(L,substack_start+2); /* key */
|
lua_pushvalue(L,substack_start+2); /* key */
|
||||||
lua_rawget(L,-2); /* look for the fn */
|
lua_rawget(L,-2); /* look for the fn */
|
||||||
lua_remove(L,-2); /* stack tidy, remove .fn table */
|
lua_remove(L,-2); /* stack tidy, remove .fn table */
|
||||||
if (lua_isfunction(L,-1)) /* note: if its a C function or lua function */
|
if (lua_isfunction(L,-1)) /* note: if it's a C function or lua function */
|
||||||
{ /* found it so return the fn & let lua call it */
|
{ /* found it so return the fn & let lua call it */
|
||||||
lua_remove(L,-2); /* stack tidy, remove metatable */
|
lua_remove(L,-2); /* stack tidy, remove metatable */
|
||||||
if(ret)
|
if(ret)
|
||||||
|
|
@ -966,7 +966,7 @@ SWIGINTERN int SWIG_Lua_class_do_set(lua_State *L, swig_type_info *type, int fi
|
||||||
/* NEW: looks for the __setitem() fn
|
/* NEW: looks for the __setitem() fn
|
||||||
this is a user provided set fn */
|
this is a user provided set fn */
|
||||||
SWIG_Lua_get_table(L,"__setitem"); /* find the fn */
|
SWIG_Lua_get_table(L,"__setitem"); /* find the fn */
|
||||||
if (lua_iscfunction(L,-1)) /* if its there */
|
if (lua_iscfunction(L,-1)) /* if it's there */
|
||||||
{ /* found it so call the fn & return its value */
|
{ /* found it so call the fn & return its value */
|
||||||
lua_pushvalue(L,substack_start+1); /* the userdata */
|
lua_pushvalue(L,substack_start+1); /* the userdata */
|
||||||
lua_pushvalue(L,substack_start+2); /* the parameter */
|
lua_pushvalue(L,substack_start+2); /* the parameter */
|
||||||
|
|
@ -1343,7 +1343,7 @@ SWIGINTERN void SWIG_Lua_add_class_instance_details(lua_State *L, swig_lua_clas
|
||||||
SWIGRUNTIME int SWIG_Lua_resolve_metamethod(lua_State *L); /*forward declaration*/
|
SWIGRUNTIME int SWIG_Lua_resolve_metamethod(lua_State *L); /*forward declaration*/
|
||||||
|
|
||||||
/* The real function that resolves a metamethod.
|
/* The real function that resolves a metamethod.
|
||||||
* Function searches given class and all it's bases(recursively) for first instance of something that is
|
* Function searches given class and all its bases (recursively) for first instance of something that is
|
||||||
* not equal to SWIG_Lua_resolve_metamethod. (Almost always this 'something' is actual metamethod implementation
|
* not equal to SWIG_Lua_resolve_metamethod. (Almost always this 'something' is actual metamethod implementation
|
||||||
* and it is a SWIG-generated C function.). It returns value on the top of the L and there is no garbage below the
|
* and it is a SWIG-generated C function.). It returns value on the top of the L and there is no garbage below the
|
||||||
* answer.
|
* answer.
|
||||||
|
|
|
||||||
|
|
@ -252,7 +252,7 @@ $1=($1_ltype)&temp;%}
|
||||||
|
|
||||||
/* void* is a special case
|
/* void* is a special case
|
||||||
A function void fn(void*) should take any kind of pointer as a parameter (just like C/C++ does)
|
A function void fn(void*) should take any kind of pointer as a parameter (just like C/C++ does)
|
||||||
but if its an output, then it should be wrapped like any other SWIG object (using default typemap)
|
but if it's an output, then it should be wrapped like any other SWIG object (using default typemap)
|
||||||
*/
|
*/
|
||||||
%typemap(in,checkfn="SWIG_isptrtype") void*
|
%typemap(in,checkfn="SWIG_isptrtype") void*
|
||||||
%{$1=($1_ltype)SWIG_MustGetPtr(L,$input,0,0,$argnum,"$symname");%}
|
%{$1=($1_ltype)SWIG_MustGetPtr(L,$input,0,0,$argnum,"$symname");%}
|
||||||
|
|
@ -285,7 +285,7 @@ parameters match which function
|
||||||
|
|
||||||
// unfortunately lua only considers one type of number
|
// unfortunately lua only considers one type of number
|
||||||
// so all numbers (int,float,double) match
|
// so all numbers (int,float,double) match
|
||||||
// you could add an advanced fn to get type & check if its integral
|
// you could add an advanced fn to get type & check if it's integral
|
||||||
%typecheck(SWIG_TYPECHECK_INTEGER)
|
%typecheck(SWIG_TYPECHECK_INTEGER)
|
||||||
int, short, long,
|
int, short, long,
|
||||||
unsigned int, unsigned short, unsigned long,
|
unsigned int, unsigned short, unsigned long,
|
||||||
|
|
@ -396,7 +396,7 @@ parameters match which function
|
||||||
* Specials
|
* Specials
|
||||||
* ----------------------------------------------------------------------------- */
|
* ----------------------------------------------------------------------------- */
|
||||||
// swig::LANGUAGE_OBJ was added to allow containers of native objects
|
// swig::LANGUAGE_OBJ was added to allow containers of native objects
|
||||||
// however its rather difficult to do this in lua, as you cannot hold pointers
|
// however it's rather difficult to do this in lua, as you cannot hold pointers
|
||||||
// to native objects (they are held in the interpreter)
|
// to native objects (they are held in the interpreter)
|
||||||
// therefore for now: just ignoring this feature
|
// therefore for now: just ignoring this feature
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ The basic code looks like this:
|
||||||
|
|
||||||
However the code below is a mixture of #defines & such, so nowhere as easy to read
|
However the code below is a mixture of #defines & such, so nowhere as easy to read
|
||||||
|
|
||||||
To make you code work correctly its not just a matter of %including this file
|
To make you code work correctly it's not just a matter of %including this file
|
||||||
You also have to give SWIG the hints on which to use where
|
You also have to give SWIG the hints on which to use where
|
||||||
|
|
||||||
eg
|
eg
|
||||||
|
|
@ -77,7 +77,7 @@ SWIG_NUMBER_TYPEMAP(enum SWIGTYPE);
|
||||||
// also for long longs's
|
// also for long longs's
|
||||||
SWIG_NUMBER_TYPEMAP(long long); SWIG_NUMBER_TYPEMAP(unsigned long long); SWIG_NUMBER_TYPEMAP(signed long long);
|
SWIG_NUMBER_TYPEMAP(long long); SWIG_NUMBER_TYPEMAP(unsigned long long); SWIG_NUMBER_TYPEMAP(signed long long);
|
||||||
|
|
||||||
// note we dont do char, as a char* is probably a string not a ptr to a single char
|
// note we don't do char, as a char* is probably a string not a ptr to a single char
|
||||||
|
|
||||||
// similar for booleans
|
// similar for booleans
|
||||||
%typemap(in,checkfn="lua_isboolean") bool *INPUT(bool temp), bool &INPUT(bool temp)
|
%typemap(in,checkfn="lua_isboolean") bool *INPUT(bool temp), bool &INPUT(bool temp)
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ multiple output values, they are returned in the form of a Python tuple.
|
||||||
|
|
||||||
For example, suppose you were trying to wrap the modf() function in the
|
For example, suppose you were trying to wrap the modf() function in the
|
||||||
C math library which splits x into integral and fractional parts (and
|
C math library which splits x into integral and fractional parts (and
|
||||||
returns the integer part in one of its parameters).K:
|
returns the integer part in one of its parameters) :
|
||||||
|
|
||||||
double modf(double x, double *ip);
|
double modf(double x, double *ip);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -119,7 +119,7 @@ multiple output values, they are returned in the form of a Ruby Array.
|
||||||
|
|
||||||
For example, suppose you were trying to wrap the modf() function in the
|
For example, suppose you were trying to wrap the modf() function in the
|
||||||
C math library which splits x into integral and fractional parts (and
|
C math library which splits x into integral and fractional parts (and
|
||||||
returns the integer part in one of its parameters).K:
|
returns the integer part in one of its parameters) :
|
||||||
|
|
||||||
double modf(double x, double *ip);
|
double modf(double x, double *ip);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -152,7 +152,7 @@ void JavaDocConverter::fillStaticTables() {
|
||||||
tagHandlers["f{"] = make_pair(&JavaDocConverter::handleTagVerbatim, "");
|
tagHandlers["f{"] = make_pair(&JavaDocConverter::handleTagVerbatim, "");
|
||||||
|
|
||||||
tagHandlers["warning"] = make_pair(&JavaDocConverter::handleTagMessage, "Warning: ");
|
tagHandlers["warning"] = make_pair(&JavaDocConverter::handleTagMessage, "Warning: ");
|
||||||
// this command just prints it's contents
|
// this command just prints its contents
|
||||||
// (it is internal command of swig's parser, contains plain text)
|
// (it is internal command of swig's parser, contains plain text)
|
||||||
tagHandlers["plainstd::string"] = make_pair(&JavaDocConverter::handlePlainString, "");
|
tagHandlers["plainstd::string"] = make_pair(&JavaDocConverter::handlePlainString, "");
|
||||||
tagHandlers["plainstd::endl"] = make_pair(&JavaDocConverter::handleNewLine, "");
|
tagHandlers["plainstd::endl"] = make_pair(&JavaDocConverter::handleNewLine, "");
|
||||||
|
|
|
||||||
|
|
@ -302,7 +302,7 @@ void PyDocConverter::fillStaticTables() {
|
||||||
tagHandlers["ref"] = make_handler(&PyDocConverter::handleTagRef);
|
tagHandlers["ref"] = make_handler(&PyDocConverter::handleTagRef);
|
||||||
tagHandlers["result"] = tagHandlers["return"] = tagHandlers["returns"] = make_handler(&PyDocConverter::handleTagReturn);
|
tagHandlers["result"] = tagHandlers["return"] = tagHandlers["returns"] = make_handler(&PyDocConverter::handleTagReturn);
|
||||||
|
|
||||||
// this command just prints it's contents
|
// this command just prints its contents
|
||||||
// (it is internal command of swig's parser, contains plain text)
|
// (it is internal command of swig's parser, contains plain text)
|
||||||
tagHandlers["plainstd::string"] = make_handler(&PyDocConverter::handlePlainString);
|
tagHandlers["plainstd::string"] = make_handler(&PyDocConverter::handlePlainString);
|
||||||
tagHandlers["plainstd::endl"] = make_handler(&PyDocConverter::handleNewLine);
|
tagHandlers["plainstd::endl"] = make_handler(&PyDocConverter::handleNewLine);
|
||||||
|
|
|
||||||
|
|
@ -148,7 +148,7 @@
|
||||||
#define WARN_IGNORE_OPERATOR_DELARR 395 /* delete [] */
|
#define WARN_IGNORE_OPERATOR_DELARR 395 /* delete [] */
|
||||||
#define WARN_IGNORE_OPERATOR_REF 396 /* operator *() */
|
#define WARN_IGNORE_OPERATOR_REF 396 /* operator *() */
|
||||||
|
|
||||||
/* 394-399 are reserved */
|
/* please leave 350-399 free for WARN_IGNORE_OPERATOR_* */
|
||||||
|
|
||||||
/* -- Type system and typemaps -- */
|
/* -- Type system and typemaps -- */
|
||||||
|
|
||||||
|
|
@ -225,7 +225,7 @@
|
||||||
#define WARN_DOXYGEN_UNKNOWN_CHARACTER 565
|
#define WARN_DOXYGEN_UNKNOWN_CHARACTER 565
|
||||||
#define WARN_DOXYGEN_UNEXPECTED_ITERATOR_VALUE 566
|
#define WARN_DOXYGEN_UNEXPECTED_ITERATOR_VALUE 566
|
||||||
|
|
||||||
/* -- Reserved (600-799) -- */
|
/* -- Reserved (600-699) -- */
|
||||||
|
|
||||||
/* -- Language module specific warnings (700 - 899) -- */
|
/* -- Language module specific warnings (700 - 899) -- */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@
|
||||||
/**** Diagnostics:
|
/**** Diagnostics:
|
||||||
With the #define REPORT(), you can change the amount of diagnostics given
|
With the #define REPORT(), you can change the amount of diagnostics given
|
||||||
This helps me search the parse tree & figure out what is going on inside SWIG
|
This helps me search the parse tree & figure out what is going on inside SWIG
|
||||||
(because its not clear or documented)
|
(because it's not clear or documented)
|
||||||
*/
|
*/
|
||||||
#define REPORT(T,D) // no info:
|
#define REPORT(T,D) // no info:
|
||||||
//#define REPORT(T,D) {Printf(stdout,T"\n");} // only title
|
//#define REPORT(T,D) {Printf(stdout,T"\n");} // only title
|
||||||
|
|
@ -435,7 +435,7 @@ public:
|
||||||
/* NEW LANGUAGE NOTE:***********************************************
|
/* NEW LANGUAGE NOTE:***********************************************
|
||||||
This is it!
|
This is it!
|
||||||
you get this one right, and most of your work is done
|
you get this one right, and most of your work is done
|
||||||
but its going to take some file to get it working right
|
but it's going to take some file to get it working right
|
||||||
quite a bit of this is generally boilerplate code
|
quite a bit of this is generally boilerplate code
|
||||||
(or stuff I don't understand)
|
(or stuff I don't understand)
|
||||||
that which matters will have extra added comments
|
that which matters will have extra added comments
|
||||||
|
|
@ -2053,8 +2053,8 @@ public:
|
||||||
if (GetFlag(carrays_hash, "lua:class_instance")) {
|
if (GetFlag(carrays_hash, "lua:class_instance")) {
|
||||||
String *static_cls = Getattr(carrays_hash, "lua:class_instance:static_hash");
|
String *static_cls = Getattr(carrays_hash, "lua:class_instance:static_hash");
|
||||||
assert(static_cls);
|
assert(static_cls);
|
||||||
// static_cls is swig_lua_namespace. This structure can't be use with eLua(LTR)
|
// static_cls is swig_lua_namespace. This structure can't be used with eLua(LTR)
|
||||||
// Instead structure describing its methods isused
|
// Instead a structure describing its methods is used
|
||||||
String *static_cls_cname = Getattr(static_cls, "methods:name");
|
String *static_cls_cname = Getattr(static_cls, "methods:name");
|
||||||
assert(static_cls_cname);
|
assert(static_cls_cname);
|
||||||
Printv(metatable_tab, tab4, "{LSTRKEY(\".static\"), LROVAL(", static_cls_cname, ")},\n", NIL);
|
Printv(metatable_tab, tab4, "{LSTRKEY(\".static\"), LROVAL(", static_cls_cname, ")},\n", NIL);
|
||||||
|
|
|
||||||
|
|
@ -396,7 +396,7 @@ void Swig_nested_name_unnamed_c_structs(Node *n) {
|
||||||
Delete(ins);
|
Delete(ins);
|
||||||
Delattr(c, "nested:outer");
|
Delattr(c, "nested:outer");
|
||||||
} else {
|
} else {
|
||||||
// global unnamed struct - ignore it and it's instances
|
// global unnamed struct - ignore it and its instances
|
||||||
SetFlag(c, "feature:ignore");
|
SetFlag(c, "feature:ignore");
|
||||||
while (next && Getattr(next, "nested:unnamedtype") == c) {
|
while (next && Getattr(next, "nested:unnamedtype") == c) {
|
||||||
SetFlag(next, "feature:ignore");
|
SetFlag(next, "feature:ignore");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue