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:
William S Fulton 2015-12-29 19:10:57 +00:00
commit 3763beb489
25 changed files with 758 additions and 749 deletions

View file

@ -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>

View file

@ -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 &lt;= 1) return 1; if (n &lt;= 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 &gt; <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

View file

@ -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) = @_;

View file

@ -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>

View file

@ -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 */

View file

@ -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-&gt;name) free(obj-&gt;name); if (obj-&gt;name)
free(obj-&gt;name);
obj-&gt;name = (char *) malloc(strlen(c)+1); obj-&gt;name = (char *) malloc(strlen(c)+1);
strcpy(obj-&gt;name,c); strcpy(obj-&gt;name,c);
return obj-&gt;name; return obj-&gt;name;

View file

@ -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 &lt;= 1) return 1; if (n &lt;= 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) {

View file

@ -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,&amp;$1) == TCL_ERROR) return TCL_ERROR; if (Tcl_GetIntFromObj(interp,$input,&amp;$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,&amp;$1) == TCL_ERROR) return TCL_ERROR; if (Tcl_GetIntFromObj(interp,$input,&amp;$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,&amp;$1) == TCL_ERROR) return TCL_ERROR; if (Tcl_GetIntFromObj(interp,$input,&amp;$1) == TCL_ERROR)
return TCL_ERROR;
printf("n = %d\n",$1); printf("n = %d\n",$1);
} }
%inline %{ %inline %{