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;
|
||||
}
|
||||
char *check_exception() {
|
||||
if (error_status) return error_message;
|
||||
else return NULL;
|
||||
if (error_status)
|
||||
return error_message;
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
</pre></div>
|
||||
|
|
@ -137,13 +139,13 @@ To use these functions, functions simply call
|
|||
|
||||
<div class="code"><pre>
|
||||
double inv(double x) {
|
||||
if (x != 0) return 1.0/x;
|
||||
if (x != 0)
|
||||
return 1.0/x;
|
||||
else {
|
||||
throw_exception("Division by zero");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
</pre></div>
|
||||
|
||||
<p>
|
||||
|
|
@ -207,8 +209,10 @@ Now, within a C program, you can do the following :</p>
|
|||
|
||||
<div class="code"><pre>
|
||||
double inv(double x) {
|
||||
if (x) return 1.0/x;
|
||||
else throw(DivisionByZero);
|
||||
if (x)
|
||||
return 1.0/x;
|
||||
else
|
||||
throw(DivisionByZero);
|
||||
}
|
||||
|
||||
</pre></div>
|
||||
|
|
|
|||
|
|
@ -159,8 +159,10 @@ double My_variable = 3.0;
|
|||
|
||||
/* Compute factorial of n */
|
||||
int fact(int n) {
|
||||
if (n <= 1) return 1;
|
||||
else return n*fact(n-1);
|
||||
if (n <= 1)
|
||||
return 1;
|
||||
else
|
||||
return n*fact(n-1);
|
||||
}
|
||||
|
||||
/* Compute n mod m */
|
||||
|
|
@ -223,7 +225,6 @@ unix > <b>tclsh</b>
|
|||
%
|
||||
</pre></div>
|
||||
<p>
|
||||
|
||||
The <tt>swig</tt> command produced a new file called
|
||||
<tt>example_wrap.c</tt> that should be compiled along with the
|
||||
<tt>example.c</tt> file. Most operating systems and scripting
|
||||
|
|
|
|||
|
|
@ -2613,6 +2613,7 @@ sub DESTROY {
|
|||
examplec::delete_Vector($self));
|
||||
delete $OWNER{$self};
|
||||
}
|
||||
}
|
||||
|
||||
sub FETCH {
|
||||
my ($self,$field) = @_;
|
||||
|
|
|
|||
|
|
@ -262,9 +262,9 @@ accessed incorrectly in PHP,
|
|||
include("example.php");
|
||||
|
||||
if(EASY_TO_MISPEL) {
|
||||
....
|
||||
...
|
||||
} else {
|
||||
....
|
||||
...
|
||||
}
|
||||
|
||||
</pre>
|
||||
|
|
|
|||
|
|
@ -5251,8 +5251,7 @@ existing Ruby object to the destroyed C++ object and raise an exception.
|
|||
#include "example.h"
|
||||
%}
|
||||
|
||||
/* Specify that ownership is transferred to the zoo
|
||||
when calling add_animal */
|
||||
/* Specify that ownership is transferred to the zoo when calling add_animal */
|
||||
%apply SWIGTYPE *DISOWN { Animal* animal };
|
||||
|
||||
/* Track objects */
|
||||
|
|
|
|||
|
|
@ -1045,7 +1045,6 @@ def filecopy(source,target):
|
|||
fwrite(buffer,8192,1,f2)
|
||||
nbytes = fread(buffer,8192,1,f1)
|
||||
free(buffer)
|
||||
|
||||
</pre></div>
|
||||
|
||||
<p>
|
||||
|
|
@ -1607,9 +1606,9 @@ directive as shown :</p>
|
|||
|
||||
int a; // Can read/write
|
||||
%immutable;
|
||||
int b,c,d // Read only variables
|
||||
int b,c,d; // Read only variables
|
||||
%mutable;
|
||||
double x,y // read/write
|
||||
double x,y; // read/write
|
||||
</pre></div>
|
||||
|
||||
<p>
|
||||
|
|
@ -2459,7 +2458,8 @@ char *Foo_name_get(Foo *obj) {
|
|||
}
|
||||
|
||||
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);
|
||||
strcpy(obj->name,c);
|
||||
return obj->name;
|
||||
|
|
|
|||
|
|
@ -102,8 +102,10 @@ Suppose you have an ordinary C function like this :</p>
|
|||
|
||||
<div class="code"><pre>
|
||||
int fact(int n) {
|
||||
if (n <= 1) return 1;
|
||||
else return n*fact(n-1);
|
||||
if (n <= 1)
|
||||
return 1;
|
||||
else
|
||||
return n*fact(n-1);
|
||||
}
|
||||
</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>
|
||||
|
||||
<div class="code"><pre>
|
||||
int wrap_fact(ClientData clientData, Tcl_Interp *interp,
|
||||
int argc, char *argv[]) {
|
||||
int wrap_fact(ClientData clientData, Tcl_Interp *interp, int argc, char *argv[]) {
|
||||
int result;
|
||||
int arg0;
|
||||
if (argc != 2) {
|
||||
|
|
|
|||
|
|
@ -626,7 +626,7 @@ CFLAGS = /Z7 /Od /c /nologo
|
|||
TCL_INCLUDES = -Id:\tcl8.0a2\generic -Id:\tcl8.0a2\win
|
||||
TCLLIB = d:\tcl8.0a2\win\tcl80.lib
|
||||
|
||||
tcl::
|
||||
tcl:
|
||||
..\..\swig -tcl -o $(WRAPFILE) $(INTERFACE)
|
||||
$(CC) $(CFLAGS) $(TCL_INCLUDES) $(SRCS) $(WRAPFILE)
|
||||
set LIB=$(TOOLS)\lib
|
||||
|
|
@ -2466,7 +2466,8 @@ you might define a typemap like this:
|
|||
%module example
|
||||
|
||||
%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);
|
||||
}
|
||||
%inline %{
|
||||
|
|
@ -2504,7 +2505,8 @@ You can refine this by supplying an optional parameter name. For example:
|
|||
%module example
|
||||
|
||||
%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);
|
||||
}
|
||||
%inline %{
|
||||
|
|
@ -2527,7 +2529,8 @@ the typemap system follows <tt>typedef</tt> declarations. For example:
|
|||
<div class="code">
|
||||
<pre>
|
||||
%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);
|
||||
}
|
||||
%inline %{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue