Replace tabs with spaces in html docs
wkhtmltopdf is not expanding tabs within <pre> elements to 8 spaces as it should. Workaround the problem by converting all tabs to an appropriate number of spaces.
This commit is contained in:
parent
4e67d5c7a8
commit
3763beb489
25 changed files with 758 additions and 749 deletions
|
|
@ -1177,25 +1177,25 @@ namespace BAR {
|
||||||
<H4><a name="Allegrocl_nn26">18.3.7.1 Generating wrapper code for templates</a></H4>
|
<H4><a name="Allegrocl_nn26">18.3.7.1 Generating wrapper code for templates</a></H4>
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
SWIG provides support for dealing with templates, but by
|
SWIG provides support for dealing with templates, but by
|
||||||
default, it will not generate any member variable or function
|
default, it will not generate any member variable or function
|
||||||
wrappers for templated classes. In order to create these
|
wrappers for templated classes. In order to create these
|
||||||
wrappers, you need to explicitly tell SWIG to instantiate
|
wrappers, you need to explicitly tell SWIG to instantiate
|
||||||
them. This is done via the
|
them. This is done via the
|
||||||
<a href="SWIGPlus.html#SWIGPlus_nn30"><tt>%template</tt></a>
|
<a href="SWIGPlus.html#SWIGPlus_nn30"><tt>%template</tt></a>
|
||||||
directive.
|
directive.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<H4><a name="Allegrocl_nn27">18.3.7.2 Implicit Template instantiation</a></H4>
|
<H4><a name="Allegrocl_nn27">18.3.7.2 Implicit Template instantiation</a></H4>
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
While no wrapper code is generated for accessing member
|
While no wrapper code is generated for accessing member
|
||||||
variables, or calling member functions, type code is generated
|
variables, or calling member functions, type code is generated
|
||||||
to include these templated classes in the foreign-type and CLOS
|
to include these templated classes in the foreign-type and CLOS
|
||||||
class schema.
|
class schema.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<H3><a name="Allegrocl_nn28">18.3.8 Typedef, Templates, and Synonym Types</a></H3>
|
<H3><a name="Allegrocl_nn28">18.3.8 Typedef, Templates, and Synonym Types</a></H3>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -124,8 +124,10 @@ void clear_exception() {
|
||||||
error_status = 0;
|
error_status = 0;
|
||||||
}
|
}
|
||||||
char *check_exception() {
|
char *check_exception() {
|
||||||
if (error_status) return error_message;
|
if (error_status)
|
||||||
else return NULL;
|
return error_message;
|
||||||
|
else
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
@ -137,13 +139,13 @@ To use these functions, functions simply call
|
||||||
|
|
||||||
<div class="code"><pre>
|
<div class="code"><pre>
|
||||||
double inv(double x) {
|
double inv(double x) {
|
||||||
if (x != 0) return 1.0/x;
|
if (x != 0)
|
||||||
|
return 1.0/x;
|
||||||
else {
|
else {
|
||||||
throw_exception("Division by zero");
|
throw_exception("Division by zero");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
@ -207,8 +209,10 @@ Now, within a C program, you can do the following :</p>
|
||||||
|
|
||||||
<div class="code"><pre>
|
<div class="code"><pre>
|
||||||
double inv(double x) {
|
double inv(double x) {
|
||||||
if (x) return 1.0/x;
|
if (x)
|
||||||
else throw(DivisionByZero);
|
return 1.0/x;
|
||||||
|
else
|
||||||
|
throw(DivisionByZero);
|
||||||
}
|
}
|
||||||
|
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
|
||||||
|
|
@ -159,8 +159,10 @@ double My_variable = 3.0;
|
||||||
|
|
||||||
/* Compute factorial of n */
|
/* Compute factorial of n */
|
||||||
int fact(int n) {
|
int fact(int n) {
|
||||||
if (n <= 1) return 1;
|
if (n <= 1)
|
||||||
else return n*fact(n-1);
|
return 1;
|
||||||
|
else
|
||||||
|
return n*fact(n-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Compute n mod m */
|
/* Compute n mod m */
|
||||||
|
|
@ -222,8 +224,7 @@ unix > <b>tclsh</b>
|
||||||
7.5
|
7.5
|
||||||
%
|
%
|
||||||
</pre></div>
|
</pre></div>
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
The <tt>swig</tt> command produced a new file called
|
The <tt>swig</tt> command produced a new file called
|
||||||
<tt>example_wrap.c</tt> that should be compiled along with the
|
<tt>example_wrap.c</tt> that should be compiled along with the
|
||||||
<tt>example.c</tt> file. Most operating systems and scripting
|
<tt>example.c</tt> file. Most operating systems and scripting
|
||||||
|
|
|
||||||
|
|
@ -349,7 +349,7 @@ It has some extras to configure <code>node-webkit</code>. See the <a href="https
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<code>package.json</code>:
|
<code>package.json</code>:
|
||||||
</p>
|
</p>
|
||||||
<div class="code">
|
<div class="code">
|
||||||
<pre>
|
<pre>
|
||||||
|
|
@ -369,7 +369,7 @@ The <code>'main'</code> property of <code>package.json</code> specifies a web-pa
|
||||||
the main window.</p>
|
the main window.</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<code>app.html</code>:
|
<code>app.html</code>:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="code">
|
<div class="code">
|
||||||
|
|
@ -396,7 +396,7 @@ open new windows, and many more things.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<code>app.js</code>:
|
<code>app.js</code>:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="code">
|
<div class="code">
|
||||||
|
|
|
||||||
|
|
@ -662,14 +662,14 @@ swig -clisp -help
|
||||||
<td>-extern-all</td>
|
<td>-extern-all</td>
|
||||||
<td>If this option is given then clisp definitions for all the functions<br/>
|
<td>If this option is given then clisp definitions for all the functions<br/>
|
||||||
and global variables will be created otherwise only definitions for<br/>
|
and global variables will be created otherwise only definitions for<br/>
|
||||||
externed functions and variables are created.
|
externed functions and variables are created.
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>-generate-typedef</td>
|
<td>-generate-typedef</td>
|
||||||
<td>If this option is given then def-c-type will be used to generate<br/>
|
<td>If this option is given then def-c-type will be used to generate<br/>
|
||||||
shortcuts according to the typedefs in the input.
|
shortcuts according to the typedefs in the input.
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|
@ -680,15 +680,15 @@ and global variables will be created otherwise only definitions for<br/>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
As mentioned earlier the CLISP bindings generated by SWIG may need
|
As mentioned earlier the CLISP bindings generated by SWIG may need
|
||||||
some modifications. The clisp module creates a lisp file with
|
some modifications. The clisp module creates a lisp file with
|
||||||
the same name as the module name. This
|
the same name as the module name. This
|
||||||
lisp file contains a 'defpackage' declaration, with the
|
lisp file contains a 'defpackage' declaration, with the
|
||||||
package name same as the module name. This package uses the
|
package name same as the module name. This package uses the
|
||||||
'common-lisp' and 'ffi' packages. Also, package exports all
|
'common-lisp' and 'ffi' packages. Also, package exports all
|
||||||
the functions, structures and variables for which an ffi
|
the functions, structures and variables for which an ffi
|
||||||
binding was generated.<br/>
|
binding was generated.<br/>
|
||||||
After generating the defpackage statement, the clisp module also
|
After generating the defpackage statement, the clisp module also
|
||||||
sets the default language.
|
sets the default language.
|
||||||
|
|
||||||
<div class="targetlang"><pre>
|
<div class="targetlang"><pre>
|
||||||
(defpackage :test
|
(defpackage :test
|
||||||
|
|
|
||||||
|
|
@ -1259,17 +1259,17 @@ The following C++ operators are currently supported by the Perl module:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>operator++ </li>
|
<li>operator++</li>
|
||||||
<li>operator-- </li>
|
<li>operator--</li>
|
||||||
<li>operator+ </li>
|
<li>operator+</li>
|
||||||
<li>operator- </li>
|
<li>operator-</li>
|
||||||
<li>operator* </li>
|
<li>operator*</li>
|
||||||
<li>operator/ </li>
|
<li>operator/</li>
|
||||||
<li>operator== </li>
|
<li>operator==</li>
|
||||||
<li>operator!= </li>
|
<li>operator!=</li>
|
||||||
<li>operator% </li>
|
<li>operator%</li>
|
||||||
<li>operator> </li>
|
<li>operator></li>
|
||||||
<li>operator< </li>
|
<li>operator<</li>
|
||||||
<li>operator and </li>
|
<li>operator and </li>
|
||||||
<li>operator or </li>
|
<li>operator or </li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
@ -2612,6 +2612,7 @@ sub DESTROY {
|
||||||
if (exists $OWNER{$self}) {
|
if (exists $OWNER{$self}) {
|
||||||
examplec::delete_Vector($self));
|
examplec::delete_Vector($self));
|
||||||
delete $OWNER{$self};
|
delete $OWNER{$self};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub FETCH {
|
sub FETCH {
|
||||||
|
|
|
||||||
|
|
@ -262,9 +262,9 @@ accessed incorrectly in PHP,
|
||||||
include("example.php");
|
include("example.php");
|
||||||
|
|
||||||
if(EASY_TO_MISPEL) {
|
if(EASY_TO_MISPEL) {
|
||||||
....
|
...
|
||||||
} else {
|
} else {
|
||||||
....
|
...
|
||||||
}
|
}
|
||||||
|
|
||||||
</pre>
|
</pre>
|
||||||
|
|
|
||||||
|
|
@ -5251,8 +5251,7 @@ existing Ruby object to the destroyed C++ object and raise an exception.
|
||||||
#include "example.h"
|
#include "example.h"
|
||||||
%}
|
%}
|
||||||
|
|
||||||
/* Specify that ownership is transferred to the zoo
|
/* Specify that ownership is transferred to the zoo when calling add_animal */
|
||||||
when calling add_animal */
|
|
||||||
%apply SWIGTYPE *DISOWN { Animal* animal };
|
%apply SWIGTYPE *DISOWN { Animal* animal };
|
||||||
|
|
||||||
/* Track objects */
|
/* Track objects */
|
||||||
|
|
|
||||||
|
|
@ -1045,7 +1045,6 @@ def filecopy(source,target):
|
||||||
fwrite(buffer,8192,1,f2)
|
fwrite(buffer,8192,1,f2)
|
||||||
nbytes = fread(buffer,8192,1,f1)
|
nbytes = fread(buffer,8192,1,f1)
|
||||||
free(buffer)
|
free(buffer)
|
||||||
|
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
@ -1607,9 +1606,9 @@ directive as shown :</p>
|
||||||
|
|
||||||
int a; // Can read/write
|
int a; // Can read/write
|
||||||
%immutable;
|
%immutable;
|
||||||
int b,c,d // Read only variables
|
int b,c,d; // Read only variables
|
||||||
%mutable;
|
%mutable;
|
||||||
double x,y // read/write
|
double x,y; // read/write
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
@ -2459,7 +2458,8 @@ char *Foo_name_get(Foo *obj) {
|
||||||
}
|
}
|
||||||
|
|
||||||
char *Foo_name_set(Foo *obj, char *c) {
|
char *Foo_name_set(Foo *obj, char *c) {
|
||||||
if (obj->name) free(obj->name);
|
if (obj->name)
|
||||||
|
free(obj->name);
|
||||||
obj->name = (char *) malloc(strlen(c)+1);
|
obj->name = (char *) malloc(strlen(c)+1);
|
||||||
strcpy(obj->name,c);
|
strcpy(obj->name,c);
|
||||||
return obj->name;
|
return obj->name;
|
||||||
|
|
|
||||||
|
|
@ -102,8 +102,10 @@ Suppose you have an ordinary C function like this :</p>
|
||||||
|
|
||||||
<div class="code"><pre>
|
<div class="code"><pre>
|
||||||
int fact(int n) {
|
int fact(int n) {
|
||||||
if (n <= 1) return 1;
|
if (n <= 1)
|
||||||
else return n*fact(n-1);
|
return 1;
|
||||||
|
else
|
||||||
|
return n*fact(n-1);
|
||||||
}
|
}
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
||||||
|
|
@ -124,8 +126,7 @@ As an example, the Tcl wrapper function for the <tt>fact()</tt>
|
||||||
function above example might look like the following : </p>
|
function above example might look like the following : </p>
|
||||||
|
|
||||||
<div class="code"><pre>
|
<div class="code"><pre>
|
||||||
int wrap_fact(ClientData clientData, Tcl_Interp *interp,
|
int wrap_fact(ClientData clientData, Tcl_Interp *interp, int argc, char *argv[]) {
|
||||||
int argc, char *argv[]) {
|
|
||||||
int result;
|
int result;
|
||||||
int arg0;
|
int arg0;
|
||||||
if (argc != 2) {
|
if (argc != 2) {
|
||||||
|
|
|
||||||
|
|
@ -626,7 +626,7 @@ CFLAGS = /Z7 /Od /c /nologo
|
||||||
TCL_INCLUDES = -Id:\tcl8.0a2\generic -Id:\tcl8.0a2\win
|
TCL_INCLUDES = -Id:\tcl8.0a2\generic -Id:\tcl8.0a2\win
|
||||||
TCLLIB = d:\tcl8.0a2\win\tcl80.lib
|
TCLLIB = d:\tcl8.0a2\win\tcl80.lib
|
||||||
|
|
||||||
tcl::
|
tcl:
|
||||||
..\..\swig -tcl -o $(WRAPFILE) $(INTERFACE)
|
..\..\swig -tcl -o $(WRAPFILE) $(INTERFACE)
|
||||||
$(CC) $(CFLAGS) $(TCL_INCLUDES) $(SRCS) $(WRAPFILE)
|
$(CC) $(CFLAGS) $(TCL_INCLUDES) $(SRCS) $(WRAPFILE)
|
||||||
set LIB=$(TOOLS)\lib
|
set LIB=$(TOOLS)\lib
|
||||||
|
|
@ -2466,7 +2466,8 @@ you might define a typemap like this:
|
||||||
%module example
|
%module example
|
||||||
|
|
||||||
%typemap(in) int {
|
%typemap(in) int {
|
||||||
if (Tcl_GetIntFromObj(interp,$input,&$1) == TCL_ERROR) return TCL_ERROR;
|
if (Tcl_GetIntFromObj(interp,$input,&$1) == TCL_ERROR)
|
||||||
|
return TCL_ERROR;
|
||||||
printf("Received an integer : %d\n",$1);
|
printf("Received an integer : %d\n",$1);
|
||||||
}
|
}
|
||||||
%inline %{
|
%inline %{
|
||||||
|
|
@ -2504,7 +2505,8 @@ You can refine this by supplying an optional parameter name. For example:
|
||||||
%module example
|
%module example
|
||||||
|
|
||||||
%typemap(in) int n {
|
%typemap(in) int n {
|
||||||
if (Tcl_GetIntFromObj(interp,$input,&$1) == TCL_ERROR) return TCL_ERROR;
|
if (Tcl_GetIntFromObj(interp,$input,&$1) == TCL_ERROR)
|
||||||
|
return TCL_ERROR;
|
||||||
printf("n = %d\n",$1);
|
printf("n = %d\n",$1);
|
||||||
}
|
}
|
||||||
%inline %{
|
%inline %{
|
||||||
|
|
@ -2527,7 +2529,8 @@ the typemap system follows <tt>typedef</tt> declarations. For example:
|
||||||
<div class="code">
|
<div class="code">
|
||||||
<pre>
|
<pre>
|
||||||
%typemap(in) int n {
|
%typemap(in) int n {
|
||||||
if (Tcl_GetIntFromObj(interp,$input,&$1) == TCL_ERROR) return TCL_ERROR;
|
if (Tcl_GetIntFromObj(interp,$input,&$1) == TCL_ERROR)
|
||||||
|
return TCL_ERROR;
|
||||||
printf("n = %d\n",$1);
|
printf("n = %d\n",$1);
|
||||||
}
|
}
|
||||||
%inline %{
|
%inline %{
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,7 @@ PYTHON_LIB: D:\python21\libs\python21.lib<br>
|
||||||
<p>
|
<p>
|
||||||
<b><tt>TCL_INCLUDE</tt></b> : Set this to the directory containing tcl.h<br>
|
<b><tt>TCL_INCLUDE</tt></b> : Set this to the directory containing tcl.h<br>
|
||||||
<b><tt>TCL_LIB</tt></b> : Set this to the TCL library including path for linking<p>
|
<b><tt>TCL_LIB</tt></b> : Set this to the TCL library including path for linking<p>
|
||||||
Example using ActiveTcl 8.3.3.3 <br>
|
Example using ActiveTcl 8.3.3.3<br>
|
||||||
<tt>
|
<tt>
|
||||||
TCL_INCLUDE: D:\tcl\include<br>
|
TCL_INCLUDE: D:\tcl\include<br>
|
||||||
TCL_LIB: D:\tcl\lib\tcl83.lib<br>
|
TCL_LIB: D:\tcl\lib\tcl83.lib<br>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue