mirror of https://github.com/swig/swig
Fix typos in docs and comments
This commit is contained in:
parent
b5544a1812
commit
b127e11f1e
|
@ -75,7 +75,7 @@ Functionality
|
|||
https://www.doxygen.nl/manual/commands.html. If a tag is
|
||||
marked as 'ignored', then the tag is ignored, but the text is copied
|
||||
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:
|
||||
|
||||
|
|
|
@ -181,7 +181,7 @@ or enum element comments:
|
|||
<div class="code"><pre>
|
||||
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_THREE
|
||||
};
|
||||
|
|
|
@ -644,7 +644,7 @@ java::
|
|||
|
||||
<p>
|
||||
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.
|
||||
</p>
|
||||
|
||||
|
|
|
@ -1520,7 +1520,7 @@ function
|
|||
nil
|
||||
>
|
||||
</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.
|
||||
</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
|
||||
%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)
|
||||
|
||||
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.
|
||||
</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>
|
||||
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>
|
||||
<H3><a name="Lua_nn38">29.7.3 Memory management</a></H3>
|
||||
|
||||
|
|
|
@ -2319,7 +2319,7 @@ typedef struct {
|
|||
|
||||
<p>
|
||||
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.
|
||||
To make the member writable, a "memberin" typemap can be used.
|
||||
</p>
|
||||
|
@ -2747,7 +2747,7 @@ from the internal <tt>%OWNER</tt> hash).
|
|||
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>.
|
||||
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>
|
||||
|
||||
<div class="targetlang"><pre>
|
||||
|
|
|
@ -636,7 +636,7 @@ tcl:
|
|||
|
||||
<p>
|
||||
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
|
||||
Tcl extensions.
|
||||
</p>
|
||||
|
|
|
@ -9,12 +9,12 @@ See the lua code for how they are called
|
|||
|
||||
%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)
|
||||
|
||||
// this adds some lua code directly 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 {
|
||||
function example.sort_int2(t)
|
||||
-- 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
|
||||
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)
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
/* 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
|
||||
ISBN 85-903798-1-7
|
||||
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
|
||||
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 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 is a little tedious, to do, but let's do it
|
||||
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
|
||||
(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
|
||||
|
|
|
@ -43,7 +43,7 @@ run_testcase = \
|
|||
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(CFFI) -batch -s $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
|
||||
fi
|
||||
|
||||
# Clean: (does nothing, we dont generate extra cffi code)
|
||||
# Clean: (does nothing, we don't generate extra cffi code)
|
||||
%.clean:
|
||||
@exit 0
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ Hash {
|
|||
and by checking the typemaps.
|
||||
The typemap code also calls SwigType_remember(), if your typemaps
|
||||
defined an object type, it will be added into the SwigType table.
|
||||
its normally a
|
||||
it's normally a
|
||||
SWIG_ConvertPtr(....$descriptor...)
|
||||
when it should have been a $&descriptor or $*descriptor
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ namespace Swig {
|
|||
%feature("director:except") {
|
||||
jthrowable $error = jenv->ExceptionOccurred();
|
||||
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.
|
||||
return $null;
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ run_testcase = \
|
|||
env LUA_PATH="$(srcdir)/?.lua;" $(RUNTOOL) $(LUA) $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
|
||||
fi
|
||||
|
||||
# Clean: (does nothing, we dont generate extra lua code)
|
||||
# Clean: (does nothing, we don't generate extra lua code)
|
||||
%.clean:
|
||||
@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
|
||||
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);
|
||||
|
||||
|
|
|
@ -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
|
||||
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);
|
||||
|
||||
|
|
|
@ -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)
|
||||
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
|
||||
use %include <std_except.i> instead
|
||||
|
@ -191,7 +191,7 @@ use %include <std_except.i> instead
|
|||
Throwing object is a serious problem:
|
||||
Assuming some code throws a 'FooBar'
|
||||
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
|
||||
(see exception_partial_info in the test suite for a case where you cannot do this)
|
||||
- convert to a string & throw that
|
||||
|
@ -224,7 +224,7 @@ SWIG_fail;%}
|
|||
|
||||
|
||||
// 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
|
||||
|
|
|
@ -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 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.
|
||||
|
||||
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
|
||||
this is a user provided get 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 */
|
||||
lua_pushvalue(L,substack_start+1); /* the userdata */
|
||||
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_rawget(L,-2); /* look for the fn */
|
||||
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 */
|
||||
lua_remove(L,-2); /* stack tidy, remove metatable */
|
||||
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
|
||||
this is a user provided set 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 */
|
||||
lua_pushvalue(L,substack_start+1); /* the userdata */
|
||||
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*/
|
||||
|
||||
/* 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
|
||||
* 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.
|
||||
|
|
|
@ -252,7 +252,7 @@ $1=($1_ltype)&temp;%}
|
|||
|
||||
/* void* is a special case
|
||||
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*
|
||||
%{$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
|
||||
// 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)
|
||||
int, short, long,
|
||||
unsigned int, unsigned short, unsigned long,
|
||||
|
@ -396,7 +396,7 @@ parameters match which function
|
|||
* Specials
|
||||
* ----------------------------------------------------------------------------- */
|
||||
// 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)
|
||||
// therefore for now: just ignoring this feature
|
||||
#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
|
||||
|
||||
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
|
||||
|
||||
eg
|
||||
|
@ -77,7 +77,7 @@ SWIG_NUMBER_TYPEMAP(enum SWIGTYPE);
|
|||
// also for long longs's
|
||||
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
|
||||
%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
|
||||
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);
|
||||
|
||||
|
|
|
@ -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
|
||||
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);
|
||||
|
||||
|
|
|
@ -152,7 +152,7 @@ void JavaDocConverter::fillStaticTables() {
|
|||
tagHandlers["f{"] = make_pair(&JavaDocConverter::handleTagVerbatim, "");
|
||||
|
||||
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)
|
||||
tagHandlers["plainstd::string"] = make_pair(&JavaDocConverter::handlePlainString, "");
|
||||
tagHandlers["plainstd::endl"] = make_pair(&JavaDocConverter::handleNewLine, "");
|
||||
|
|
|
@ -302,7 +302,7 @@ void PyDocConverter::fillStaticTables() {
|
|||
tagHandlers["ref"] = make_handler(&PyDocConverter::handleTagRef);
|
||||
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)
|
||||
tagHandlers["plainstd::string"] = make_handler(&PyDocConverter::handlePlainString);
|
||||
tagHandlers["plainstd::endl"] = make_handler(&PyDocConverter::handleNewLine);
|
||||
|
|
|
@ -148,7 +148,7 @@
|
|||
#define WARN_IGNORE_OPERATOR_DELARR 395 /* delete [] */
|
||||
#define WARN_IGNORE_OPERATOR_REF 396 /* operator *() */
|
||||
|
||||
/* 394-399 are reserved */
|
||||
/* please leave 350-399 free for WARN_IGNORE_OPERATOR_* */
|
||||
|
||||
/* -- Type system and typemaps -- */
|
||||
|
||||
|
@ -225,7 +225,7 @@
|
|||
#define WARN_DOXYGEN_UNKNOWN_CHARACTER 565
|
||||
#define WARN_DOXYGEN_UNEXPECTED_ITERATOR_VALUE 566
|
||||
|
||||
/* -- Reserved (600-799) -- */
|
||||
/* -- Reserved (600-699) -- */
|
||||
|
||||
/* -- Language module specific warnings (700 - 899) -- */
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
/**** Diagnostics:
|
||||
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
|
||||
(because its not clear or documented)
|
||||
(because it's not clear or documented)
|
||||
*/
|
||||
#define REPORT(T,D) // no info:
|
||||
//#define REPORT(T,D) {Printf(stdout,T"\n");} // only title
|
||||
|
@ -435,7 +435,7 @@ public:
|
|||
/* NEW LANGUAGE NOTE:***********************************************
|
||||
This is it!
|
||||
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
|
||||
(or stuff I don't understand)
|
||||
that which matters will have extra added comments
|
||||
|
@ -2053,8 +2053,8 @@ public:
|
|||
if (GetFlag(carrays_hash, "lua:class_instance")) {
|
||||
String *static_cls = Getattr(carrays_hash, "lua:class_instance:static_hash");
|
||||
assert(static_cls);
|
||||
// static_cls is swig_lua_namespace. This structure can't be use with eLua(LTR)
|
||||
// Instead structure describing its methods isused
|
||||
// static_cls is swig_lua_namespace. This structure can't be used with eLua(LTR)
|
||||
// Instead a structure describing its methods is used
|
||||
String *static_cls_cname = Getattr(static_cls, "methods:name");
|
||||
assert(static_cls_cname);
|
||||
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);
|
||||
Delattr(c, "nested:outer");
|
||||
} else {
|
||||
// global unnamed struct - ignore it and it's instances
|
||||
// global unnamed struct - ignore it and its instances
|
||||
SetFlag(c, "feature:ignore");
|
||||
while (next && Getattr(next, "nested:unnamedtype") == c) {
|
||||
SetFlag(next, "feature:ignore");
|
||||
|
|
Loading…
Reference in New Issue