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
|
|
@ -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 */
|
||||||
|
|
@ -223,7 +225,6 @@ unix > <b>tclsh</b>
|
||||||
%
|
%
|
||||||
</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
|
||||||
|
|
|
||||||
|
|
@ -2613,6 +2613,7 @@ sub DESTROY {
|
||||||
examplec::delete_Vector($self));
|
examplec::delete_Vector($self));
|
||||||
delete $OWNER{$self};
|
delete $OWNER{$self};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sub FETCH {
|
sub FETCH {
|
||||||
my ($self,$field) = @_;
|
my ($self,$field) = @_;
|
||||||
|
|
|
||||||
|
|
@ -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 %{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue