diff --git a/Doc/Manual/Allegrocl.html b/Doc/Manual/Allegrocl.html index 9f37d4fc5..4b6bad421 100644 --- a/Doc/Manual/Allegrocl.html +++ b/Doc/Manual/Allegrocl.html @@ -373,21 +373,21 @@ swig -allegrocl [ options ] filename -identifier-converter [name] - Binds the variable swig:*swig-identifier-convert* in the generated .cl file to name. - This function is used to generate symbols - for the lisp side of the interface. + This function is used to generate symbols + for the lisp side of the interface. -cwrap - [default] Generate a .cxx file containing C wrapper function when wrapping C code. The interface generated is similar to what is - done for C++ code. + done for C++ code. -nocwrap - Explicitly turn off generation of .cxx wrappers for C code. Reasonable for modules with simple interfaces. Can not handle all legal enum - and constant constructs, or take advantage of SWIG customization features. + and constant constructs, or take advantage of SWIG customization features. -isolate - With this command-line argument, all lisp helper functions are defined in a unique package named swig.<module-name> rather than - swig. This prevents conflicts when the module is - intended to be used with other swig generated interfaces that may, - for instance, make use of different identifier converters. + swig. This prevents conflicts when the module is + intended to be used with other swig generated interfaces that may, + for instance, make use of different identifier converters. @@ -472,7 +472,7 @@ interested in generating an interface to C++. | Foreign Code | What we're generating an interface to. |______________| | - | + | _______v______ | | (foreign side) | Wrapper code | extern "C" wrappers calling C++ @@ -484,18 +484,18 @@ interested in generating an interface to C++. | FFI Layer | Low level lisp interface. ff:def-foreign-call, |______________| ff:def-foreign-variable | - +---------------------------- + +---------------------------- _______v______ _______v______ | | | | (lisp side) | Defuns | | Defmethods | wrapper for overloaded |______________| |______________| functions or those with (lisp side) | defaulted arguments - Wrapper for non-overloaded | - functions and methods _______v______ - | | (lisp side) - | Defuns | dispatch function - |______________| to overloads based - on arity + Wrapper for non-overloaded | + functions and methods _______v______ + | | (lisp side) + | Defuns | dispatch function + |______________| to overloads based + on arity @@ -799,8 +799,8 @@ namespace car {

- Users are cautioned to get to know their constants before use, or - not use the -nocwrap command-line option. + Users are cautioned to get to know their constants before use, or + not use the -nocwrap command-line option.

18.3.3 Variables

@@ -907,7 +907,7 @@ globalvar> (globalvar.nnn::glob_float)

For example, the following header file

enum.h:
-enum COL { RED, GREEN, BLUE };	
+enum COL { RED, GREEN, BLUE };
 enum FOO { FOO1 = 10, FOO2, FOO3 };
       
@@ -1177,25 +1177,25 @@ namespace BAR {

18.3.7.1 Generating wrapper code for templates

-

- SWIG provides support for dealing with templates, but by - default, it will not generate any member variable or function - wrappers for templated classes. In order to create these - wrappers, you need to explicitly tell SWIG to instantiate - them. This is done via the - %template - directive. -

+

+SWIG provides support for dealing with templates, but by +default, it will not generate any member variable or function +wrappers for templated classes. In order to create these +wrappers, you need to explicitly tell SWIG to instantiate +them. This is done via the +%template +directive. +

18.3.7.2 Implicit Template instantiation

-

- While no wrapper code is generated for accessing member - variables, or calling member functions, type code is generated - to include these templated classes in the foreign-type and CLOS - class schema. -

+

+While no wrapper code is generated for accessing member +variables, or calling member functions, type code is generated +to include these templated classes in the foreign-type and CLOS +class schema. +

18.3.8 Typedef, Templates, and Synonym Types

@@ -1243,7 +1243,7 @@ int zzz(A *inst = 0); /* return inst->x + inst->y */ definition, we generate a form that expands to:

- (setf (find-class <synonym>) <primary>) + (setf (find-class <synonym>) <primary>)

The result is that all references to synonym types in foreign @@ -1285,17 +1285,17 @@ synonym> criteria from a set of synonym types.

18.3.9 Function overloading/Parameter defaulting

@@ -1472,68 +1472,68 @@ overload>
 /* name conversion for overloaded operators. */
 #ifdef __cplusplus
-%rename(__add__)	     *::operator+;
-%rename(__pos__)	     *::operator+();
-%rename(__pos__)	     *::operator+() const;
+%rename(__add__)             *::operator+;
+%rename(__pos__)             *::operator+();
+%rename(__pos__)             *::operator+() const;
 
-%rename(__sub__)	     *::operator-;
-%rename(__neg__)	     *::operator-() const;
-%rename(__neg__)	     *::operator-();
+%rename(__sub__)             *::operator-;
+%rename(__neg__)             *::operator-() const;
+%rename(__neg__)             *::operator-();
 
-%rename(__mul__)	     *::operator*;
-%rename(__deref__)	     *::operator*();
-%rename(__deref__)	     *::operator*() const;
+%rename(__mul__)             *::operator*;
+%rename(__deref__)           *::operator*();
+%rename(__deref__)           *::operator*() const;
 
-%rename(__div__)	     *::operator/;
-%rename(__mod__)	     *::operator%;
-%rename(__logxor__)	     *::operator^;
-%rename(__logand__)	     *::operator&;
-%rename(__logior__)	     *::operator|;
-%rename(__lognot__)	     *::operator~();
-%rename(__lognot__)	     *::operator~() const;
+%rename(__div__)             *::operator/;
+%rename(__mod__)             *::operator%;
+%rename(__logxor__)          *::operator^;
+%rename(__logand__)          *::operator&;
+%rename(__logior__)          *::operator|;
+%rename(__lognot__)          *::operator~();
+%rename(__lognot__)          *::operator~() const;
 
-%rename(__not__)	     *::operator!();
-%rename(__not__)	     *::operator!() const;
+%rename(__not__)             *::operator!();
+%rename(__not__)             *::operator!() const;
 
-%rename(__assign__)	     *::operator=;
+%rename(__assign__)          *::operator=;
 
 %rename(__add_assign__)      *::operator+=;
-%rename(__sub_assign__)	     *::operator-=;
-%rename(__mul_assign__)	     *::operator*=;
-%rename(__div_assign__)	     *::operator/=;
-%rename(__mod_assign__)	     *::operator%=;
+%rename(__sub_assign__)      *::operator-=;
+%rename(__mul_assign__)      *::operator*=;
+%rename(__div_assign__)      *::operator/=;
+%rename(__mod_assign__)      *::operator%=;
 %rename(__logxor_assign__)   *::operator^=;
 %rename(__logand_assign__)   *::operator&=;
 %rename(__logior_assign__)   *::operator|=;
 
-%rename(__lshift__)	     *::operator<<;
+%rename(__lshift__)          *::operator<<;
 %rename(__lshift_assign__)   *::operator<<=;
-%rename(__rshift__)	     *::operator>>;
+%rename(__rshift__)          *::operator>>;
 %rename(__rshift_assign__)   *::operator>>=;
 
-%rename(__eq__)		     *::operator==;
-%rename(__ne__)		     *::operator!=;
-%rename(__lt__)		     *::operator<;
-%rename(__gt__)		     *::operator>;
-%rename(__lte__)	     *::operator<=;
-%rename(__gte__)	     *::operator>=;
+%rename(__eq__)              *::operator==;
+%rename(__ne__)              *::operator!=;
+%rename(__lt__)              *::operator<;
+%rename(__gt__)              *::operator>;
+%rename(__lte__)             *::operator<=;
+%rename(__gte__)             *::operator>=;
 
-%rename(__and__)	     *::operator&&;
-%rename(__or__)		     *::operator||;
+%rename(__and__)             *::operator&&;
+%rename(__or__)              *::operator||;
 
-%rename(__preincr__)	     *::operator++();
-%rename(__postincr__)	     *::operator++(int);
-%rename(__predecr__)	     *::operator--();
-%rename(__postdecr__)	     *::operator--(int);
+%rename(__preincr__)         *::operator++();
+%rename(__postincr__)        *::operator++(int);
+%rename(__predecr__)         *::operator--();
+%rename(__postdecr__)        *::operator--(int);
 
-%rename(__comma__)	     *::operator,();
-%rename(__comma__)	     *::operator,() const;
+%rename(__comma__)           *::operator,();
+%rename(__comma__)           *::operator,() const;
 
 %rename(__member_ref__)      *::operator->;
 %rename(__member_func_ref__) *::operator->*;
 
-%rename(__funcall__)	     *::operator();
-%rename(__aref__)	     *::operator[];
+%rename(__funcall__)         *::operator();
+%rename(__aref__)            *::operator[];
     
@@ -1821,28 +1821,28 @@ return-val wrapper-name(parm0, parm1, ..., parmN)

The LIN typemap accepts the following $variable references.

-%typemap(lin)	SWIGTYPE 	"(cl:let (($out $in))\n  $body)";
+%typemap(lin) SWIGTYPE "(cl:let (($out $in))\n  $body)";
     
@@ -1858,17 +1858,17 @@ return-val wrapper-name(parm0, parm1, ..., parmN)

The LOUT typemap uses the following $variable

diff --git a/Doc/Manual/Android.html b/Doc/Manual/Android.html index 2d3658009..8838e67a9 100644 --- a/Doc/Manual/Android.html +++ b/Doc/Manual/Android.html @@ -210,7 +210,7 @@ When complete your device should be listed in those attached, something like:
 $ adb devices
 List of devices attached 
-A32-6DBE0001-9FF80000-015D62C3-02018028	device
+A32-6DBE0001-9FF80000-015D62C3-02018028 device
 
@@ -222,7 +222,7 @@ This means you are now ready to install the application...
 $ adb install bin/SwigSimple-debug.apk 
 95 KB/s (4834 bytes in 0.049s)
-	pkg: /data/local/tmp/SwigSimple-debug.apk
+        pkg: /data/local/tmp/SwigSimple-debug.apk
 Success
 
diff --git a/Doc/Manual/Arguments.html b/Doc/Manual/Arguments.html index db46359d5..48ec5c629 100644 --- a/Doc/Manual/Arguments.html +++ b/Doc/Manual/Arguments.html @@ -60,7 +60,7 @@ Suppose you had a C function like this:
 void add(double a, double b, double *result) {
-	*result = a + b;
+  *result = a + b;
 }
 
@@ -204,7 +204,7 @@ input value:

-int *INPUT		
+int *INPUT
 short *INPUT
 long *INPUT
 unsigned int *INPUT
@@ -221,7 +221,7 @@ function:
 
 
 double add(double *a, double *b) {
-	return *a+*b;
+  return *a+*b;
 }
 
@@ -273,7 +273,7 @@ These methods can be used as shown in an earlier example. For example, if you ha
 void add(double a, double b, double *c) {
-	*c = a+b;
+  *c = a+b;
 }
 
@@ -339,7 +339,7 @@ A C function that uses this might be something like this:

 void negate(double *x) {
-	*x = -(*x);
+  *x = -(*x);
 }
 
 
diff --git a/Doc/Manual/Chicken.html b/Doc/Manual/Chicken.html index 2d800ad6a..820d01fde 100644 --- a/Doc/Manual/Chicken.html +++ b/Doc/Manual/Chicken.html @@ -55,10 +55,10 @@

    -
  1. generates portable C code
  2. -
  3. includes a customizable interpreter
  4. -
  5. links to C libraries with a simple Foreign Function Interface
  6. -
  7. supports full tail-recursion and first-class continuations
  8. +
  9. generates portable C code
  10. +
  11. includes a customizable interpreter
  12. +
  13. links to C libraries with a simple Foreign Function Interface
  14. +
  15. supports full tail-recursion and first-class continuations

@@ -98,7 +98,7 @@

-
% swig -chicken example.i
+
% swig -chicken example.i

@@ -131,7 +131,7 @@

-
% swig -chicken -c++ example.i
+
% swig -chicken -c++ example.i

@@ -142,7 +142,7 @@

-
% chicken example.scm -output-file oexample.c
+
% chicken example.scm -output-file oexample.c

@@ -176,10 +176,10 @@

The name of the module must be declared one of two ways:

@@ -189,7 +189,7 @@

CHICKEN will be able to access the module using the (declare - (uses modulename)) CHICKEN Scheme form. + (uses modulename)) CHICKEN Scheme form.

21.2.3 Constants and Variables

@@ -200,10 +200,10 @@ the interface file:

    -
  1. #define MYCONSTANT1 ...
  2. -
  3. %constant int MYCONSTANT2 = ...
  4. -
  5. const int MYCONSTANT3 = ...
  6. -
  7. enum { MYCONSTANT4 = ... };
  8. +
  9. #define MYCONSTANT1 ...
  10. +
  11. %constant int MYCONSTANT2 = ...
  12. +
  13. const int MYCONSTANT3 = ...
  14. +
  15. enum { MYCONSTANT4 = ... };

@@ -295,11 +295,11 @@

The author of TinyCLOS, Gregor Kiczales, describes TinyCLOS as: - "Tiny CLOS is a Scheme implementation of a `kernelized' CLOS, with a - metaobject protocol. The implementation is even simpler than - the simple CLOS found in `The Art of the Metaobject Protocol,' - weighing in at around 850 lines of code, including (some) - comments and documentation." + "Tiny CLOS is a Scheme implementation of a `kernelized' CLOS, with a + metaobject protocol. The implementation is even simpler than + the simple CLOS found in `The Art of the Metaobject Protocol,' + weighing in at around 850 lines of code, including (some) + comments and documentation."

diff --git a/Doc/Manual/Customization.html b/Doc/Manual/Customization.html index d3ddecbb1..8705534f9 100644 --- a/Doc/Manual/Customization.html +++ b/Doc/Manual/Customization.html @@ -116,16 +116,18 @@ static char error_message[256]; static int error_status = 0; void throw_exception(char *msg) { - strncpy(error_message,msg,256); - error_status = 1; + strncpy(error_message,msg,256); + error_status = 1; } void clear_exception() { - error_status = 0; + error_status = 0; } char *check_exception() { - if (error_status) return error_message; - else return NULL; + if (error_status) + return error_message; + else + return NULL; }

@@ -137,13 +139,13 @@ To use these functions, functions simply call
 double inv(double x) {
-	if (x != 0) return 1.0/x;
-	else {
-		throw_exception("Division by zero");
-		return 0;
-	}
+  if (x != 0)
+    return 1.0/x;
+  else {
+    throw_exception("Division by zero");
+    return 0;
+  }
 }
-
 

@@ -152,12 +154,12 @@ as the following (shown for Perl5) :

 %exception {
-    char *err;
-    clear_exception();
-    $action
-    if ((err = check_exception())) {
-       croak(err);
-    }
+  char *err;
+  clear_exception();
+  $action
+  if ((err = check_exception())) {
+    croak(err);
+  }
 }
 
@@ -207,8 +209,10 @@ Now, within a C program, you can do the following :

 double inv(double x) {
-	if (x) return 1.0/x;
-	else throw(DivisionByZero);
+  if (x)
+    return 1.0/x;
+  else
+    throw(DivisionByZero);
 }
 
 
@@ -222,17 +226,17 @@ Finally, to create a SWIG exception handler, write the following :

%} %exception { - try { - $action - } catch(RangeError) { - croak("Range Error"); - } catch(DivisionByZero) { - croak("Division by zero"); - } catch(OutOfMemory) { - croak("Out of memory"); - } finally { - croak("Unknown exception"); - } + try { + $action + } catch(RangeError) { + croak("Range Error"); + } catch(DivisionByZero) { + croak("Division by zero"); + } catch(OutOfMemory) { + croak("Out of memory"); + } finally { + croak("Unknown exception"); + } } @@ -250,17 +254,17 @@ Handling C++ exceptions is also straightforward. For example:
 %exception {
-	try {
-		$action
-	} catch(RangeError) {
-		croak("Range Error");
-	} catch(DivisionByZero) {
-		croak("Division by zero");
-	} catch(OutOfMemory) {
-		croak("Out of memory");
-	} catch(...) {
-		croak("Unknown exception");
-	}
+  try {
+    $action
+  } catch(RangeError) {
+    croak("Range Error");
+  } catch(DivisionByZero) {
+    croak("Division by zero");
+  } catch(OutOfMemory) {
+    croak("Out of memory");
+  } catch(...) {
+    croak("Unknown exception");
+  }
 }
 
 
@@ -320,7 +324,7 @@ critical pieces of code. For example:
 %exception {
-	... your exception handler ...
+  ... your exception handler ...
 }
 /* Define critical operations that can throw exceptions here */
 
diff --git a/Doc/Manual/Go.html b/Doc/Manual/Go.html
index 52f023f92..ced046c66 100644
--- a/Doc/Manual/Go.html
+++ b/Doc/Manual/Go.html
@@ -477,10 +477,10 @@ objects and fits nicely C++'s RAII idiom.  Example:
 
 func UseClassName(...) ... {
-	o := NewClassName(...)
-	defer DeleteClassName(o)
-	// Use the ClassName object
-	return ...
+  o := NewClassName(...)
+  defer DeleteClassName(o)
+  // Use the ClassName object
+  return ...
 }
 
@@ -495,17 +495,17 @@ that creates a C++ object and functions called by this function. Example:
 func WithClassName(constructor args, f func(ClassName, ...interface{}) error, data ...interface{}) error {
-	o := NewClassName(constructor args)
-	defer DeleteClassName(o)
-	return f(o, data...)
+  o := NewClassName(constructor args)
+  defer DeleteClassName(o)
+  return f(o, data...)
 }
 
 func UseClassName(o ClassName, data ...interface{}) (err error) {
-	// Use the ClassName object and additional data and return error.
+  // Use the ClassName object and additional data and return error.
 }
 
 func main() {
-	WithClassName(constructor args, UseClassName, additional data)
+  WithClassName(constructor args, UseClassName, additional data)
 }
 
@@ -547,33 +547,33 @@ problematic with C++ code that uses thread-local storage.
 import (
-	"runtime"
-	"wrap" // SWIG generated wrapper code
+  "runtime"
+  "wrap" // SWIG generated wrapper code
 )
 
 type GoClassName struct {
-	wcn wrap.ClassName
+  wcn wrap.ClassName
 }
 
 func NewGoClassName() *GoClassName {
-	o := &GoClassName{wcn: wrap.NewClassName()}
-	runtime.SetFinalizer(o, deleteGoClassName)
-	return o
+  o := &GoClassName{wcn: wrap.NewClassName()}
+  runtime.SetFinalizer(o, deleteGoClassName)
+  return o
 }
 
 func deleteGoClassName(o *GoClassName) {
-	// Runs typically in a different OS thread!
-	wrap.DeleteClassName(o.wcn)
-	o.wcn = nil
+  // Runs typically in a different OS thread!
+  wrap.DeleteClassName(o.wcn)
+  o.wcn = nil
 }
 
 func (o *GoClassName) Close() {
-	// If the C++ object has a Close method.
-	o.wcn.Close()
+  // If the C++ object has a Close method.
+  o.wcn.Close()
 
-	// If the GoClassName object is no longer in an usable state.
-	runtime.SetFinalizer(o, nil) // Remove finalizer.
-	deleteGoClassName() // Free the C++ object.
+  // If the GoClassName object is no longer in an usable state.
+  runtime.SetFinalizer(o, nil) // Remove finalizer.
+  deleteGoClassName() // Free the C++ object.
 }
 
@@ -635,19 +635,19 @@ explains how to implement a FooBarGo class similar to the FooBarCpp class. class FooBarAbstract { public: - FooBarAbstract() {}; - virtual ~FooBarAbstract() {}; + FooBarAbstract() {}; + virtual ~FooBarAbstract() {}; - std::string FooBar() { - return this->Foo() + ", " + this->Bar(); - }; + std::string FooBar() { + return this->Foo() + ", " + this->Bar(); + }; protected: - virtual std::string Foo() { - return "Foo"; - }; + virtual std::string Foo() { + return "Foo"; + }; - virtual std::string Bar() = 0; + virtual std::string Bar() = 0; };
@@ -661,13 +661,13 @@ protected: class FooBarCpp : public FooBarAbstract { protected: - virtual std::string Foo() { - return "C++ " + FooBarAbstract::Foo(); - } + virtual std::string Foo() { + return "C++ " + FooBarAbstract::Foo(); + } - virtual std::string Bar() { - return "C++ Bar"; - } + virtual std::string Bar() { + return "C++ Bar"; + } }; @@ -758,9 +758,9 @@ determine if an object instance was created via NewDirectorClassName:
 if o.DirectorInterface() != nil {
-	DeleteDirectorClassName(o)
+  DeleteDirectorClassName(o)
 } else {
-	DeleteClassName(o)
+  DeleteClassName(o)
 }
 
@@ -798,22 +798,22 @@ As an example see part of the FooBarGo class:
 type overwrittenMethodsOnFooBarAbstract struct {
-	fb FooBarAbstract
+  fb FooBarAbstract
 }
 
 func (om *overwrittenMethodsOnFooBarAbstract) Foo() string {
-	...
+  ...
 }
 
 func (om *overwrittenMethodsOnFooBarAbstract) Bar() string {
-	...
+  ...
 }
 
 func NewFooBarGo() FooBarGo {
-	om := &overwrittenMethodsOnFooBarAbstract{}
-	fb := NewDirectorFooBarAbstract(om)
-	om.fb = fb
-	...
+  om := &overwrittenMethodsOnFooBarAbstract{}
+  fb := NewDirectorFooBarAbstract(om)
+  om.fb = fb
+  ...
 }
 
@@ -855,7 +855,7 @@ the method in the base class. This is also the case for the
 virtual std::string Foo() {
-	return "C++ " + FooBarAbstract::Foo();
+  return "C++ " + FooBarAbstract::Foo();
 }
 
@@ -869,7 +869,7 @@ The FooBarGo.Foo implementation in the example looks like this:
 func (om *overwrittenMethodsOnFooBarAbstract) Foo() string {
-	return "Go " + DirectorFooBarAbstractFoo(om.fb)
+  return "Go " + DirectorFooBarAbstractFoo(om.fb)
 }
 
@@ -902,31 +902,31 @@ this:
 type FooBarGo interface {
-	FooBarAbstract
-	deleteFooBarAbstract()
-	IsFooBarGo()
+  FooBarAbstract
+  deleteFooBarAbstract()
+  IsFooBarGo()
 }
 
 type fooBarGo struct {
-	FooBarAbstract
+  FooBarAbstract
 }
 
 func (fbgs *fooBarGo) deleteFooBarAbstract() {
-	DeleteDirectorFooBarAbstract(fbgs.FooBarAbstract)
+  DeleteDirectorFooBarAbstract(fbgs.FooBarAbstract)
 }
 
 func (fbgs *fooBarGo) IsFooBarGo() {}
 
 func NewFooBarGo() FooBarGo {
-	om := &overwrittenMethodsOnFooBarAbstract{}
-	fb := NewDirectorFooBarAbstract(om)
-	om.fb = fb
+  om := &overwrittenMethodsOnFooBarAbstract{}
+  fb := NewDirectorFooBarAbstract(om)
+  om.fb = fb
 
-	return &fooBarGo{FooBarAbstract: fb}
+  return &fooBarGo{FooBarAbstract: fb}
 }
 
 func DeleteFooBarGo(fbg FooBarGo) {
-	fbg.deleteFooBarAbstract()
+  fbg.deleteFooBarAbstract()
 }
 
@@ -962,14 +962,14 @@ in the FooBarGo class is here:
 type overwrittenMethodsOnFooBarAbstract struct {
-	fb FooBarAbstract
+  fb FooBarAbstract
 }
 
 func NewFooBarGo() FooBarGo {
-	om := &overwrittenMethodsOnFooBarAbstract{}
-	fb := NewDirectorFooBarAbstract(om) // fb.v = om
-	om.fb = fb // Backlink causes cycle as fb.v = om!
-	...
+  om := &overwrittenMethodsOnFooBarAbstract{}
+  fb := NewDirectorFooBarAbstract(om) // fb.v = om
+  om.fb = fb // Backlink causes cycle as fb.v = om!
+  ...
 }
 
@@ -985,21 +985,21 @@ the finalizer on fooBarGo:
 type fooBarGo struct {
-	FooBarAbstract
+  FooBarAbstract
 }
 
 type overwrittenMethodsOnFooBarAbstract struct {
-	fb FooBarAbstract
+  fb FooBarAbstract
 }
 
 func NewFooBarGo() FooBarGo {
-	om := &overwrittenMethodsOnFooBarAbstract{}
-	fb := NewDirectorFooBarAbstract(om)
-	om.fb = fb // Backlink causes cycle as fb.v = om!
+  om := &overwrittenMethodsOnFooBarAbstract{}
+  fb := NewDirectorFooBarAbstract(om)
+  om.fb = fb // Backlink causes cycle as fb.v = om!
 
-	fbgs := &fooBarGo{FooBarAbstract: fb}
-	runtime.SetFinalizer(fbgs, FooBarGo.deleteFooBarAbstract)
-	return fbgs
+  fbgs := &fooBarGo{FooBarAbstract: fb}
+  runtime.SetFinalizer(fbgs, FooBarGo.deleteFooBarAbstract)
+  return fbgs
 }
 
@@ -1026,18 +1026,18 @@ The complete and annotated FooBarGo class looks like this: // drop in replacement for FooBarAbstract but the reverse causes a compile time // error. type FooBarGo interface { - FooBarAbstract - deleteFooBarAbstract() - IsFooBarGo() + FooBarAbstract + deleteFooBarAbstract() + IsFooBarGo() } // Via embedding fooBarGo "inherits" all methods of FooBarAbstract. type fooBarGo struct { - FooBarAbstract + FooBarAbstract } func (fbgs *fooBarGo) deleteFooBarAbstract() { - DeleteDirectorFooBarAbstract(fbgs.FooBarAbstract) + DeleteDirectorFooBarAbstract(fbgs.FooBarAbstract) } // The IsFooBarGo method ensures that FooBarGo is a superset of FooBarAbstract. @@ -1049,48 +1049,48 @@ func (fbgs *fooBarGo) IsFooBarGo() {} // Go type that defines the DirectorInterface. It contains the Foo and Bar // methods that overwrite the respective virtual C++ methods on FooBarAbstract. type overwrittenMethodsOnFooBarAbstract struct { - // Backlink to FooBarAbstract so that the rest of the class can be used by - // the overridden methods. - fb FooBarAbstract + // Backlink to FooBarAbstract so that the rest of the class can be used by + // the overridden methods. + fb FooBarAbstract - // If additional constructor arguments have been given they are typically - // stored here so that the overriden methods can use them. + // If additional constructor arguments have been given they are typically + // stored here so that the overriden methods can use them. } func (om *overwrittenMethodsOnFooBarAbstract) Foo() string { - // DirectorFooBarAbstractFoo calls the base method FooBarAbstract::Foo. - return "Go " + DirectorFooBarAbstractFoo(om.fb) + // DirectorFooBarAbstractFoo calls the base method FooBarAbstract::Foo. + return "Go " + DirectorFooBarAbstractFoo(om.fb) } func (om *overwrittenMethodsOnFooBarAbstract) Bar() string { - return "Go Bar" + return "Go Bar" } func NewFooBarGo() FooBarGo { - // Instantiate FooBarAbstract with selected methods overridden. The methods - // that will be overwritten are defined on - // overwrittenMethodsOnFooBarAbstract and have a compatible signature to the - // respective virtual C++ methods. Furthermore additional constructor - // arguments will be typically stored in the - // overwrittenMethodsOnFooBarAbstract struct. - om := &overwrittenMethodsOnFooBarAbstract{} - fb := NewDirectorFooBarAbstract(om) - om.fb = fb // Backlink causes cycle as fb.v = om! + // Instantiate FooBarAbstract with selected methods overridden. The methods + // that will be overwritten are defined on + // overwrittenMethodsOnFooBarAbstract and have a compatible signature to the + // respective virtual C++ methods. Furthermore additional constructor + // arguments will be typically stored in the + // overwrittenMethodsOnFooBarAbstract struct. + om := &overwrittenMethodsOnFooBarAbstract{} + fb := NewDirectorFooBarAbstract(om) + om.fb = fb // Backlink causes cycle as fb.v = om! - fbgs := &fooBarGo{FooBarAbstract: fb} - // The memory of the FooBarAbstract director object instance can be - // automatically freed once the FooBarGo instance is garbage collected by - // uncommenting the following line. Please make sure to understand the - // runtime.SetFinalizer specific gotchas before doing this. Furthemore - // DeleteFooBarGo should be deleted if a finalizer is in use or the fooBarGo - // struct needs additional data to prevent double deletion. - // runtime.SetFinalizer(fbgs, FooBarGo.deleteFooBarAbstract) - return fbgs + fbgs := &fooBarGo{FooBarAbstract: fb} + // The memory of the FooBarAbstract director object instance can be + // automatically freed once the FooBarGo instance is garbage collected by + // uncommenting the following line. Please make sure to understand the + // runtime.SetFinalizer specific gotchas before doing this. Furthemore + // DeleteFooBarGo should be deleted if a finalizer is in use or the fooBarGo + // struct needs additional data to prevent double deletion. + // runtime.SetFinalizer(fbgs, FooBarGo.deleteFooBarAbstract) + return fbgs } // Recommended to be removed if runtime.SetFinalizer is in use. func DeleteFooBarGo(fbg FooBarGo) { - fbg.deleteFooBarAbstract() + fbg.deleteFooBarAbstract() } @@ -1114,13 +1114,13 @@ For comparison the FooBarCpp class looks like this: class FooBarCpp : public FooBarAbstract { protected: - virtual std::string Foo() { - return "C++ " + FooBarAbstract::Foo(); - } + virtual std::string Foo() { + return "C++ " + FooBarAbstract::Foo(); + } - virtual std::string Bar() { - return "C++ Bar"; - } + virtual std::string Bar() { + return "C++ Bar"; + } }; diff --git a/Doc/Manual/Guile.html b/Doc/Manual/Guile.html index 5c8792150..f30e139e5 100644 --- a/Doc/Manual/Guile.html +++ b/Doc/Manual/Guile.html @@ -158,8 +158,8 @@ following module-system hack:
 (module-map (lambda (sym var)
-	      (module-export! (current-module) (list sym)))
-	    (current-module))
+              (module-export! (current-module) (list sym)))
+            (current-module))
 
@@ -462,16 +462,16 @@ mapping:
-      MAP(SWIG_MemoryError,	"swig-memory-error");
-      MAP(SWIG_IOError,		"swig-io-error");
-      MAP(SWIG_RuntimeError,	"swig-runtime-error");
-      MAP(SWIG_IndexError,	"swig-index-error");
-      MAP(SWIG_TypeError,	"swig-type-error");
-      MAP(SWIG_DivisionByZero,	"swig-division-by-zero");
-      MAP(SWIG_OverflowError,	"swig-overflow-error");
-      MAP(SWIG_SyntaxError,	"swig-syntax-error");
-      MAP(SWIG_ValueError,	"swig-value-error");
-      MAP(SWIG_SystemError,	"swig-system-error");
+      MAP(SWIG_MemoryError,     "swig-memory-error");
+      MAP(SWIG_IOError,         "swig-io-error");
+      MAP(SWIG_RuntimeError,    "swig-runtime-error");
+      MAP(SWIG_IndexError,      "swig-index-error");
+      MAP(SWIG_TypeError,       "swig-type-error");
+      MAP(SWIG_DivisionByZero,  "swig-division-by-zero");
+      MAP(SWIG_OverflowError,   "swig-overflow-error");
+      MAP(SWIG_SyntaxError,     "swig-syntax-error");
+      MAP(SWIG_ValueError,      "swig-value-error");
+      MAP(SWIG_SystemError,     "swig-system-error");
 
diff --git a/Doc/Manual/Introduction.html b/Doc/Manual/Introduction.html index 677784d9a..1c29f4760 100644 --- a/Doc/Manual/Introduction.html +++ b/Doc/Manual/Introduction.html @@ -158,14 +158,16 @@ following C code: double My_variable = 3.0; /* Compute factorial of n */ -int fact(int n) { - if (n <= 1) return 1; - else return n*fact(n-1); +int fact(int n) { + if (n <= 1) + return 1; + else + return n*fact(n-1); } /* Compute n mod m */ int my_mod(int n, int m) { - return(n % m); + return(n % m); } @@ -222,8 +224,7 @@ unix > tclsh 7.5 % -

- +

The swig command produced a new file called example_wrap.c that should be compiled along with the example.c file. Most operating systems and scripting @@ -245,8 +246,8 @@ any changes type the following (shown for Solaris):

 unix > swig -perl5 example.i
 unix > gcc -c example.c example_wrap.c \
-	-I/usr/local/lib/perl5/sun4-solaris/5.003/CORE
-unix > ld -G example.o example_wrap.o -o example.so		# This is for Solaris
+        -I/usr/local/lib/perl5/sun4-solaris/5.003/CORE
+unix > ld -G example.o example_wrap.o -o example.so # This is for Solaris
 unix > perl5.003
 use example;
 print example::fact(4), "\n";
@@ -297,7 +298,7 @@ SWIG on the C header file and specifying a module name as follows
 
 unix > swig -perl5 -module example example.h
 unix > gcc -c example.c example_wrap.c \
-	-I/usr/local/lib/perl5/sun4-solaris/5.003/CORE
+        -I/usr/local/lib/perl5/sun4-solaris/5.003/CORE
 unix > ld -G example.o example_wrap.o -o example.so
 unix > perl5.003
 use example;
diff --git a/Doc/Manual/Java.html b/Doc/Manual/Java.html
index eeedc5d68..83d14ed64 100644
--- a/Doc/Manual/Java.html
+++ b/Doc/Manual/Java.html
@@ -464,9 +464,9 @@ If you forget to compile and link in the SWIG wrapper file into your native libr
 
 $ java runme
 Exception in thread "main" java.lang.UnsatisfiedLinkError: exampleJNI.gcd(II)I
-	at exampleJNI.gcd(Native Method)
-	at example.gcd(example.java:12)
-	at runme.main(runme.java:18)
+        at exampleJNI.gcd(Native Method)
+        at example.gcd(example.java:12)
+        at runme.main(runme.java:18)
 

@@ -630,11 +630,11 @@ CFLAGS = /Z7 /Od /c /nologo JAVA_INCLUDE = -ID:\jdk1.3\include -ID:\jdk1.3\include\win32 java:: - swig -java -o $(WRAPFILE) $(INTERFACE) - $(CC) $(CFLAGS) $(JAVA_INCLUDE) $(SRCS) $(WRAPFILE) - set LIB=$(TOOLS)\lib - $(LINK) $(LOPT) -out:example.dll $(LIBS) example.obj example_wrap.obj - javac *.java + swig -java -o $(WRAPFILE) $(INTERFACE) + $(CC) $(CFLAGS) $(JAVA_INCLUDE) $(SRCS) $(WRAPFILE) + set LIB=$(TOOLS)\lib + $(LINK) $(LOPT) -out:example.dll $(LIBS) example.obj example_wrap.obj + javac *.java

@@ -1340,7 +1340,7 @@ member variables. For example,

 struct Vector {
-	double x,y,z;
+  double x,y,z;
 };
 
 
diff --git a/Doc/Manual/Javascript.html b/Doc/Manual/Javascript.html index 3a4b6d69b..56f83b763 100644 --- a/Doc/Manual/Javascript.html +++ b/Doc/Manual/Javascript.html @@ -349,7 +349,7 @@ It has some extras to configure node-webkit. See the
@@ -369,7 +369,7 @@ The 'main' property of package.json specifies a web-pa
 the main window.

- app.html: +app.html:

@@ -396,7 +396,7 @@ open new windows, and many more things.

- app.js: +app.js:

diff --git a/Doc/Manual/Lisp.html b/Doc/Manual/Lisp.html index baee4ddf1..0867ba926 100644 --- a/Doc/Manual/Lisp.html +++ b/Doc/Manual/Lisp.html @@ -220,19 +220,19 @@ The generated SWIG Code will be: (cl:defconstant x (cl:ash 5 -1)) (cffi:defcstruct bar - (p :short) - (q :short) - (a :char) - (b :char) - (z :pointer) - (n :pointer)) + (p :short) + (q :short) + (a :char) + (b :char) + (z :pointer) + (n :pointer)) (cffi:defcvar ("my_struct" my_struct) :pointer) (cffi:defcstruct foo - (a :int) - (b :pointer)) + (a :int) + (b :pointer)) (cffi:defcfun ("pointer_func" pointer_func) :int (ClosureFun :pointer) @@ -248,9 +248,9 @@ The generated SWIG Code will be: (array :pointer)) (cffi:defcenum color - :RED - :BLUE - :GREEN) + :RED + :BLUE + :GREEN)

@@ -336,12 +336,12 @@ The feature intern_function ensures that all C names are (cl:export '#.(swig-lispify "x" 'constant)) (cffi:defcstruct #.(swig-lispify "bar" 'classname) - (#.(swig-lispify "p" 'slotname) :short) - (#.(swig-lispify "q" 'slotname) :short) - (#.(swig-lispify "a" 'slotname) :char) - (#.(swig-lispify "b" 'slotname) :char) - (#.(swig-lispify "z" 'slotname) :pointer) - (#.(swig-lispify "n" 'slotname) :pointer)) + (#.(swig-lispify "p" 'slotname) :short) + (#.(swig-lispify "q" 'slotname) :short) + (#.(swig-lispify "a" 'slotname) :char) + (#.(swig-lispify "b" 'slotname) :char) + (#.(swig-lispify "z" 'slotname) :pointer) + (#.(swig-lispify "n" 'slotname) :pointer)) (cl:export '#.(swig-lispify "bar" 'classname)) @@ -363,8 +363,8 @@ The feature intern_function ensures that all C names are (cl:export '#.(swig-lispify "my_struct" 'variable)) (cffi:defcstruct #.(swig-lispify "foo" 'classname) - (#.(swig-lispify "a" 'slotname) :int) - (#.(swig-lispify "b" 'slotname) :pointer)) + (#.(swig-lispify "a" 'slotname) :int) + (#.(swig-lispify "b" 'slotname) :pointer)) (cl:export '#.(swig-lispify "foo" 'classname)) @@ -388,9 +388,9 @@ The feature intern_function ensures that all C names are (cl:export '#.(my-lispify "lispsort_double" 'function) 'some-other-package) (cffi:defcenum #.(swig-lispify "color" 'enumname) - #.(swig-lispify "RED" 'enumvalue :keyword) - #.(swig-lispify "BLUE" 'enumvalue :keyword) - #.(swig-lispify "GREEN" 'enumvalue :keyword)) + #.(swig-lispify "RED" 'enumvalue :keyword) + #.(swig-lispify "BLUE" 'enumvalue :keyword) + #.(swig-lispify "GREEN" 'enumvalue :keyword)) (cl:export '#.(swig-lispify "color" 'enumname)) @@ -662,14 +662,14 @@ swig -clisp -help -extern-all If this option is given then clisp definitions for all the functions
and global variables will be created otherwise only definitions for
- externed functions and variables are created. +externed functions and variables are created. -generate-typedef If this option is given then def-c-type will be used to generate
- shortcuts according to the typedefs in the input. +shortcuts according to the typedefs in the input. @@ -680,15 +680,15 @@ and global variables will be created otherwise only definitions for

As mentioned earlier the CLISP bindings generated by SWIG may need - some modifications. The clisp module creates a lisp file with - the same name as the module name. This - lisp file contains a 'defpackage' declaration, with the - package name same as the module name. This package uses the - 'common-lisp' and 'ffi' packages. Also, package exports all - the functions, structures and variables for which an ffi - binding was generated.
- After generating the defpackage statement, the clisp module also - sets the default language. +some modifications. The clisp module creates a lisp file with +the same name as the module name. This +lisp file contains a 'defpackage' declaration, with the +package name same as the module name. This package uses the +'common-lisp' and 'ffi' packages. Also, package exports all +the functions, structures and variables for which an ffi +binding was generated.
+After generating the defpackage statement, the clisp module also +sets the default language.

 (defpackage :test
@@ -738,18 +738,18 @@ void test123(float x , double y);
 (ffi:def-call-out pointer_func
     (:name "pointer_func")
   (:arguments (ClosureFun (ffi:c-function (:arguments (arg0 (ffi:c-pointer NIL))
-						      (arg1 (ffi:c-pointer NIL))
-						      (arg2 (ffi:c-pointer NIL)))
-					  (:return-type NIL)))
-	      (y ffi:int))
+                                                      (arg1 (ffi:c-pointer NIL))
+                                                      (arg2 (ffi:c-pointer NIL)))
+                                          (:return-type NIL)))
+              (y ffi:int))
   (:return-type ffi:int)
   (:library +library-name+))
 
 (ffi:def-call-out func123
     (:name "func123")
   (:arguments (x (ffi:c-pointer div_t))
-	      (z (ffi:c-ptr (ffi:c-array (ffi:c-ptr (ffi:c-ptr ffi:int)) 100)))
-	      (y (ffi:c-ptr (ffi:c-ptr (ffi:c-array ffi:int (1000 10))))))
+              (z (ffi:c-ptr (ffi:c-array (ffi:c-ptr (ffi:c-ptr ffi:int)) 100)))
+              (y (ffi:c-ptr (ffi:c-ptr (ffi:c-array ffi:int (1000 10))))))
   (:return-type ffi:int)
   (:library +library-name+))
 
@@ -757,14 +757,14 @@ void test123(float x , double y);
 (ffi:def-call-out lispsort_double
     (:name "lispsort_double")
   (:arguments (n ffi:int)
-	      (array (ffi:c-ptr DOUBLE-FLOAT)))
+              (array (ffi:c-ptr DOUBLE-FLOAT)))
   (:return-type NIL)
   (:library +library-name+))
 
 (ffi:def-call-out test123
     (:name "test")
   (:arguments (x SINGLE-FLOAT)
-	      (y DOUBLE-FLOAT))
+              (y DOUBLE-FLOAT))
   (:return-type NIL)
   (:library +library-name+))
 
diff --git a/Doc/Manual/Lua.html b/Doc/Manual/Lua.html
index 8639e5f9e..004ca6f2b 100644
--- a/Doc/Manual/Lua.html
+++ b/Doc/Manual/Lua.html
@@ -202,8 +202,8 @@ int main(int argc,char* argv[])
   return 0;
  }
  L=lua_open();
- luaopen_base(L);	// load basic libs (eg. print)
- luaopen_example(L);	// load the wrapped module
+ luaopen_base(L);       // load basic libs (eg. print)
+ luaopen_example(L);    // load the wrapped module
  if (luaL_loadfile(L,argv[1])==0) // load and run the file
   lua_pcall(L,0,0,0);
  else
@@ -1536,8 +1536,8 @@ function
 
%module example
 
 %typemap(in) int {
-	$1 = (int) lua_tonumber(L,$input);
-	printf("Received an integer : %d\n",$1);
+  $1 = (int) lua_tonumber(L,$input);
+  printf("Received an integer : %d\n",$1);
 }
 %inline %{
 extern int fact(int n);
diff --git a/Doc/Manual/Mzscheme.html b/Doc/Manual/Mzscheme.html
index 5b589cef1..c5c199262 100644
--- a/Doc/Manual/Mzscheme.html
+++ b/Doc/Manual/Mzscheme.html
@@ -56,12 +56,12 @@ Then in scheme, you can use regular struct access procedures like
 
 
-	; suppose a function created a struct foo as 
-	; (define foo (make-diag-cntrs (#x1 #x2 #x3) (make-inspector))
-	; Then you can do
-	(format "0x~x" (diag-cntrs-field1 foo))
-	(format "0x~x" (diag-cntrs-field2 foo))
-	;etc...
+        ; suppose a function created a struct foo as
+        ; (define foo (make-diag-cntrs (#x1 #x2 #x3) (make-inspector))
+        ; Then you can do
+        (format "0x~x" (diag-cntrs-field1 foo))
+        (format "0x~x" (diag-cntrs-field2 foo))
+        ;etc...
 
diff --git a/Doc/Manual/Ocaml.html b/Doc/Manual/Ocaml.html index 07b3ffc1f..e489c4147 100644 --- a/Doc/Manual/Ocaml.html +++ b/Doc/Manual/Ocaml.html @@ -308,19 +308,19 @@ A few functions exist which generate and return these:
  • caml_ptr_val receives a c_obj and returns a void *. This - should be used for all pointer purposes.
  • + should be used for all pointer purposes.
  • caml_long_val receives a c_obj and returns a long. This - should be used for most integral purposes.
  • + should be used for most integral purposes.
  • caml_val_ptr receives a void * and returns a c_obj.
  • caml_val_bool receives a C int and returns a c_obj representing - its bool value.
  • + its bool value.
  • caml_val_(u)?(char|short|int|long|float|double) receives an - appropriate C value and returns a c_obj representing it.
  • + appropriate C value and returns a c_obj representing it.
  • caml_val_string receives a char * and returns a string value.
  • caml_val_string_len receives a char * and a length and returns - a string value.
  • + a string value.
  • caml_val_obj receives a void * and an object type and returns - a C_obj, which contains a closure giving method access.
  • + a C_obj, which contains a closure giving method access.

@@ -544,24 +544,24 @@ into this type of function convenient. #include <stdio.h> void printfloats( float *tab, int len ) { - int i; + int i; - for( i = 0; i < len; i++ ) { - printf( "%f ", tab[i] ); - } + for( i = 0; i < len; i++ ) { + printf( "%f ", tab[i] ); + } - printf( "\n" ); + printf( "\n" ); } %} %typemap(in) (float *tab, int len) { - int i; - /* $*1_type */ - $2 = caml_array_len($input); - $1 = ($*1_type *)malloc( $2 * sizeof( float ) ); - for( i = 0; i < $2; i++ ) { - $1[i] = caml_double_val(caml_array_nth($input,i)); - } + int i; + /* $*1_type */ + $2 = caml_array_len($input); + $1 = ($*1_type *)malloc( $2 * sizeof( float ) ); + for( i = 0; i < $2; i++ ) { + $1[i] = caml_double_val(caml_array_nth($input,i)); + } } void printfloats( float *tab, int len ); @@ -640,7 +640,7 @@ length. Instead, use multiple returns, as in the argout_ref example. %include <stl.i> namespace std { - %template(StringVector) std::vector < string >; + %template(StringVector) std::vector < string >; }; %include "example.h" @@ -715,16 +715,16 @@ Here's a simple example using Trolltech's Qt Library: %} class QApplication { public: - QApplication( int argc, char **argv ); - void setMainWidget( QWidget *widget ); - void exec(); + QApplication( int argc, char **argv ); + void setMainWidget( QWidget *widget ); + void exec(); }; class QPushButton { public: - QPushButton( char *str, QWidget *w ); - void resize( int x, int y ); - void show(); + QPushButton( char *str, QWidget *w ); + void resize( int x, int y ); + void show(); };

@@ -848,9 +848,9 @@ let triangle_class pts ob meth args = "cover" -> (match args with C_list [ x_arg ; y_arg ] -> - let xa = x_arg as float - and ya = y_arg as float in - (point_in_triangle pts xa ya) to bool + let xa = x_arg as float + and ya = y_arg as float in + (point_in_triangle pts xa ya) to bool | _ -> raise (Failure "cover needs two double arguments.")) | _ -> (invoke ob) meth args ;; diff --git a/Doc/Manual/Perl5.html b/Doc/Manual/Perl5.html index 4bb2b84c7..8d7b866d6 100644 --- a/Doc/Manual/Perl5.html +++ b/Doc/Manual/Perl5.html @@ -220,9 +220,9 @@ script such as the following:

# File : Makefile.PL use ExtUtils::MakeMaker; WriteMakefile( - `NAME' => `example', # Name of package - `LIBS' => [`-lm'], # Name of custom libraries - `OBJECT' => `example.o example_wrap.o' # Object files + `NAME' => `example', # Name of package + `LIBS' => [`-lm'], # Name of custom libraries + `OBJECT' => `example.o example_wrap.o' # Object files );
@@ -301,7 +301,7 @@ for a dynamic module, but change the link line to something like this:
 $ gcc example.o example_wrap.o -L/usr/lib/perl/5.14/CORE \
-	-lperl -lsocket -lnsl -lm -o myperl
+        -lperl -lsocket -lnsl -lm -o myperl
 

@@ -892,9 +892,9 @@ To check to see if a value is the NULL pointer, use the

 if (defined($ptr)) {
-	print "Not a NULL pointer.";
+  print "Not a NULL pointer.";
 } else {
-	print "Is a NULL pointer.";
+  print "Is a NULL pointer.";
 }
 
 
@@ -917,9 +917,9 @@ dereference them as follows:
 if ($$a == $$b) {
-	print "a and b point to the same thing in C";
+  print "a and b point to the same thing in C";
 } else {
-	print "a and b point to different objects.";
+  print "a and b point to different objects.";
 }
 
 
@@ -978,7 +978,7 @@ accessor functions as described in the "SWIG Basics" chapter. For example,
 struct Vector {
-	double x,y,z;
+  double x,y,z;
 };
 
@@ -1259,17 +1259,17 @@ The following C++ operators are currently supported by the Perl module:

@@ -1783,8 +1783,8 @@ you might define a typemap like this: %module example %typemap(in) int { - $1 = (int) SvIV($input); - printf("Received an integer : %d\n", $1); + $1 = (int) SvIV($input); + printf("Received an integer : %d\n", $1); } ... %inline %{ @@ -1829,8 +1829,8 @@ the typemap system follows typedef declarations. For example:
 %typemap(in) int n {
-	$1 = (int) SvIV($input);
-	printf("n = %d\n",$1);
+  $1 = (int) SvIV($input);
+  printf("n = %d\n",$1);
 }
 %inline %{
 typedef int Integer;
@@ -2143,47 +2143,47 @@ reference to be used as a char ** datatype.
 
 // This tells SWIG to treat char ** as a special case
 %typemap(in) char ** {
-	AV *tempav;
-	I32 len;
-	int i;
-	SV  **tv;
-	if (!SvROK($input))
-	    croak("Argument $argnum is not a reference.");
-        if (SvTYPE(SvRV($input)) != SVt_PVAV)
-	    croak("Argument $argnum is not an array.");
-        tempav = (AV*)SvRV($input);
-	len = av_len(tempav);
-	$1 = (char **) malloc((len+2)*sizeof(char *));
-	for (i = 0; i <= len; i++) {
-	    tv = av_fetch(tempav, i, 0);	
-	    $1[i] = (char *) SvPV(*tv,PL_na);
-        }
-	$1[i] = NULL;
+  AV *tempav;
+  I32 len;
+  int i;
+  SV  **tv;
+  if (!SvROK($input))
+    croak("Argument $argnum is not a reference.");
+  if (SvTYPE(SvRV($input)) != SVt_PVAV)
+    croak("Argument $argnum is not an array.");
+  tempav = (AV*)SvRV($input);
+  len = av_len(tempav);
+  $1 = (char **) malloc((len+2)*sizeof(char *));
+  for (i = 0; i <= len; i++) {
+    tv = av_fetch(tempav, i, 0);
+    $1[i] = (char *) SvPV(*tv,PL_na);
+  }
+  $1[i] = NULL;
 };
 
 // This cleans up the char ** array after the function call
 %typemap(freearg) char ** {
-	free($1);
+  free($1);
 }
 
 // Creates a new Perl array and places a NULL-terminated char ** into it
 %typemap(out) char ** {
-	AV *myav;
-	SV **svs;
-	int i = 0,len = 0;
-	/* Figure out how many elements we have */
-	while ($1[len])
-	   len++;
-	svs = (SV **) malloc(len*sizeof(SV *));
-	for (i = 0; i < len ; i++) {
-	    svs[i] = sv_newmortal();
-	    sv_setpv((SV*)svs[i],$1[i]);
-	};
-	myav =	av_make(len,svs);
-	free(svs);
-        $result = newRV_noinc((SV*)myav);
-        sv_2mortal($result);
-        argvi++;
+  AV *myav;
+  SV **svs;
+  int i = 0,len = 0;
+  /* Figure out how many elements we have */
+  while ($1[len])
+     len++;
+  svs = (SV **) malloc(len*sizeof(SV *));
+  for (i = 0; i < len ; i++) {
+      svs[i] = sv_newmortal();
+      sv_setpv((SV*)svs[i],$1[i]);
+  };
+  myav = av_make(len,svs);
+  free(svs);
+  $result = newRV_noinc((SV*)myav);
+  sv_2mortal($result);
+  argvi++;
 }
 
 // Now a few test functions
@@ -2240,12 +2240,12 @@ can be done using the EXTEND() macro as in:
 
 
 %typemap(argout) int *OUTPUT {
-	if (argvi >= items) {            
-		EXTEND(sp,1);              /* Extend the stack by 1 object */
-	}
-	$result = sv_newmortal();
-	sv_setiv($target,(IV) *($1));
-	argvi++;
+  if (argvi >= items) {
+    EXTEND(sp,1);              /* Extend the stack by 1 object */
+  }
+  $result = sv_newmortal();
+  sv_setiv($target,(IV) *($1));
+  argvi++;
 }
 
@@ -2264,24 +2264,24 @@ its arguments. This example describes the implementation of the OUTPUT // an output value. %typemap(argout) double *OUTPUT { - $result = sv_newmortal(); - sv_setnv($result, *$input); - argvi++; /* Increment return count -- important! */ + $result = sv_newmortal(); + sv_setnv($result, *$input); + argvi++; /* Increment return count -- important! */ } // We don't care what the input value is. Ignore, but set to a temporary variable %typemap(in,numinputs=0) double *OUTPUT(double junk) { - $1 = &junk; + $1 = &junk; } // Now a function to test it %{ /* Returns the first two input arguments */ int multout(double a, double b, double *out1, double *out2) { - *out1 = a; - *out2 = b; - return 0; + *out1 = a; + *out2 = b; + return 0; }; %} @@ -2377,7 +2377,7 @@ have a C function that modifies its arguments like this:
 void add(double a, double b, double *c) {
-	*c = a + b;
+  *c = a + b;
 }
 
@@ -2558,9 +2558,9 @@ Suppose you have the following SWIG interface file:
 %module example
 struct Vector {
-	Vector(double x, double y, double z);
-	~Vector();
-	double x,y,z;
+  Vector(double x, double y, double z);
+  ~Vector();
+  double x,y,z;
 };
 
 
@@ -2610,8 +2610,9 @@ sub DESTROY { my $self = tied(%{$_[0]}); delete $ITERATORS{$self}; if (exists $OWNER{$self}) { - examplec::delete_Vector($self)); - delete $OWNER{$self}; + examplec::delete_Vector($self)); + delete $OWNER{$self}; + } } sub FETCH { @@ -2663,8 +2664,8 @@ $v->{x} = 7.5; # Assignment of all members %$v = ( x=>3, - y=>9, - z=>-2); + y=>9, + z=>-2); # Reading members $x = $v->{x}; @@ -2685,7 +2686,7 @@ problem---suppose you had a function like this:
 Vector *Vector_get(Vector *v, int index) {
-	return &v[i];
+  return &v[i];
 }
 
@@ -2698,9 +2699,9 @@ Vector object:
 Vector *new_Vector(double x, double y, double z) {
-	Vector *v;
-	v = new Vector(x,y,z);        // Call C++ constructor
-	return v;
+  Vector *v;
+  v = new Vector(x,y,z);        // Call C++ constructor
+  return v;
 }
 
@@ -2770,10 +2771,10 @@ Suppose that we have a new object that looks like this:
 struct Particle {
-	Vector r;
-	Vector v;
-	Vector f;
-	int	type;
+  Vector r;
+  Vector v;
+  Vector f;
+  int type;
 }
 
 
@@ -2789,9 +2790,9 @@ look like this (along with some supporting code): package Particle; ... %BLESSEDMEMBERS = ( - r => `Vector', - v => `Vector', - f => `Vector', + r => `Vector', + v => `Vector', + f => `Vector', );
@@ -2867,23 +2868,23 @@ interface file: class Shape { public: - virtual double area() = 0; - virtual double perimeter() = 0; - void set_location(double x, double y); + virtual double area() = 0; + virtual double perimeter() = 0; + void set_location(double x, double y); }; class Circle : public Shape { public: - Circle(double radius); - ~Circle(); - double area(); - double perimeter(); + Circle(double radius); + ~Circle(); + double area(); + double perimeter(); }; class Square : public Shape { public: - Square(double size); - ~Square(); - double area(); - double perimeter(); + Square(double size); + ~Square(); + double area(); + double perimeter(); } diff --git a/Doc/Manual/Php.html b/Doc/Manual/Php.html index 36f8ca981..8c483b7a0 100644 --- a/Doc/Manual/Php.html +++ b/Doc/Manual/Php.html @@ -136,8 +136,8 @@ least work for Linux though):

-	gcc `php-config --includes` -fpic -c example_wrap.c example.c
-	gcc -shared example_wrap.o example.o -o example.so
+        gcc `php-config --includes` -fpic -c example_wrap.c example.c
+        gcc -shared example_wrap.o example.o -o example.so
 

34.1.2 Using PHP Extensions

@@ -150,7 +150,7 @@ load it. To do this, add a line like this to the [PHP] section of

-	extension=/path/to/modulename.so
+        extension=/path/to/modulename.so
 

@@ -165,7 +165,7 @@ PHP script which uses your extension:

-	dl("/path/to/modulename.so");	// Load the module
+        dl("/path/to/modulename.so"); // Load the module
 

@@ -180,7 +180,7 @@ call for you if the extension isn't already loaded:

-	include("example.php");
+        include("example.php");
 

@@ -249,7 +249,7 @@ For example,

 %module example
 
-#define EASY_TO_MISPELL	0
+#define EASY_TO_MISPELL 0
 
@@ -262,9 +262,9 @@ accessed incorrectly in PHP, include("example.php"); if(EASY_TO_MISPEL) { - .... + ... } else { - .... + ... } @@ -303,7 +303,7 @@ is accessed as follows:
 include("example.php");
 print seki_get();
-seki_set( seki_get() * 2);	# The C variable is now 4.
+seki_set( seki_get() * 2); # The C variable is now 4.
 print seki_get();
 
@@ -348,7 +348,7 @@ Will be accessed in PHP like this : include("example.php"); $a = foo(2); $b = bar(3.5, -1.5); -$c = bar(3.5); # Use default argument for 2nd parameter +$c = bar(3.5); # Use default argument for 2nd parameter @@ -599,10 +599,10 @@ This interface file class Vector { public: - double x,y,z; - Vector(); - ~Vector(); - double magnitude(); + double x,y,z; + Vector(); + ~Vector(); + double magnitude(); }; struct Complex { @@ -722,7 +722,7 @@ returns the current value of the class variable. For example %module example class Ko { - static int threats; + static int threats; }; diff --git a/Doc/Manual/Python.html b/Doc/Manual/Python.html index c8148fbdc..abb3c5f18 100644 --- a/Doc/Manual/Python.html +++ b/Doc/Manual/Python.html @@ -466,9 +466,9 @@ $ swig -python example.i $ gcc example.c example_wrap.c \ -Xlinker -export-dynamic \ -DHAVE_CONFIG_H -I/usr/local/include/python2.1 \ - -I/usr/local/lib/python2.1/config \ - -L/usr/local/lib/python2.1/config -lpython2.1 -lm -ldl \ - -o mypython + -I/usr/local/lib/python2.1/config \ + -L/usr/local/lib/python2.1/config -lpython2.1 -lm -ldl \ + -o mypython

@@ -1286,7 +1286,7 @@ a very natural interface. For example,

 struct Vector {
-	double x,y,z;
+  double x,y,z;
 };
 
 
@@ -4310,8 +4310,8 @@ you might define a typemap like this: %module example %typemap(in) int { - $1 = (int) PyLong_AsLong($input); - printf("Received an integer : %d\n",$1); + $1 = (int) PyLong_AsLong($input); + printf("Received an integer : %d\n",$1); } %inline %{ extern int fact(int n); @@ -4348,11 +4348,11 @@ You can refine this by supplying an optional parameter name. For example: %module example %typemap(in) int nonnegative { - $1 = (int) PyLong_AsLong($input); - if ($1 < 0) { - PyErr_SetString(PyExc_ValueError,"Expected a nonnegative value."); - return NULL; - } + $1 = (int) PyLong_AsLong($input); + if ($1 < 0) { + PyErr_SetString(PyExc_ValueError,"Expected a nonnegative value."); + return NULL; + } } %inline %{ extern int fact(int nonnegative); @@ -4374,8 +4374,8 @@ the typemap system follows typedef declarations. For example:
 %typemap(in) int n {
-	$1 = (int) PyLong_AsLong($input);
-	printf("n = %d\n",$1);
+  $1 = (int) PyLong_AsLong($input);
+  printf("n = %d\n",$1);
 }
 %inline %{
 typedef int Integer;
@@ -4685,11 +4685,11 @@ object to be used as a char ** object.
     for (i = 0; i < size; i++) {
       PyObject *o = PyList_GetItem($input,i);
       if (PyString_Check(o))
-	$1[i] = PyString_AsString(PyList_GetItem($input,i));
+        $1[i] = PyString_AsString(PyList_GetItem($input,i));
       else {
-	PyErr_SetString(PyExc_TypeError,"list must contain strings");
-	free($1);
-	return NULL;
+        PyErr_SetString(PyExc_TypeError,"list must contain strings");
+        free($1);
+        return NULL;
       }
     }
     $1[i] = 0;
@@ -4784,11 +4784,11 @@ previous example:
     for (i = 0; i < $1; i++) {
       PyObject *o = PyList_GetItem($input,i);
       if (PyString_Check(o))
-	$2[i] = PyString_AsString(PyList_GetItem($input,i));
+        $2[i] = PyString_AsString(PyList_GetItem($input,i));
       else {
-	PyErr_SetString(PyExc_TypeError,"list must contain strings");
-	free($2);
-	return NULL;
+        PyErr_SetString(PyExc_TypeError,"list must contain strings");
+        free($2);
+        return NULL;
       }
     }
     $2[i] = 0;
@@ -4832,10 +4832,10 @@ arguments rather than in the return value of a function.  For example:
 
 /* Returns a status value and two values in out1 and out2 */
 int spam(double a, double b, double *out1, double *out2) {
-	... Do a bunch of stuff ...
-	*out1 = result1;
-	*out2 = result2;
-	return status;
+  ... Do a bunch of stuff ...
+  *out1 = result1;
+  *out2 = result2;
+  return status;
 }
 
diff --git a/Doc/Manual/Ruby.html b/Doc/Manual/Ruby.html index 4d7f92a0f..27580387b 100644 --- a/Doc/Manual/Ruby.html +++ b/Doc/Manual/Ruby.html @@ -4190,10 +4190,10 @@ this:
function_name(int x, int y, Foo foo=nil, Bar bar=nil) -> bool
 
 Parameters:
-	x - int
-	y - int
-	foo - Foo
-	bar - Bar
+ x - int + y - int + foo - Foo + bar - Bar

38.8.2.5 %feature("autodoc", "docstring")

@@ -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 */ diff --git a/Doc/Manual/SWIG.html b/Doc/Manual/SWIG.html index 16cdd0e8f..be26c94b4 100644 --- a/Doc/Manual/SWIG.html +++ b/Doc/Manual/SWIG.html @@ -1037,15 +1037,14 @@ expect :

 # Copy a file 
 def filecopy(source,target):
-	f1 = fopen(source,"r")
-	f2 = fopen(target,"w")
-	buffer = malloc(8192)
-	nbytes = fread(buffer,8192,1,f1)
-	while (nbytes > 0):
-		fwrite(buffer,8192,1,f2)
-		nbytes = fread(buffer,8192,1,f1)
-	free(buffer)
-
+  f1 = fopen(source,"r")
+  f2 = fopen(target,"w")
+  buffer = malloc(8192)
+  nbytes = fread(buffer,8192,1,f1)
+  while (nbytes > 0):
+    fwrite(buffer,8192,1,f2)
+          nbytes = fread(buffer,8192,1,f1)
+  free(buffer)
 

@@ -1315,10 +1314,10 @@ gets mapped to an underlying pair of set/get functions like this :

 Vector *unit_i_get() {
-	return &unit_i;
+  return &unit_i;
 }
 void unit_i_set(Vector *value) {
-	unit_i = *value;
+  unit_i = *value;
 }
 
@@ -1605,11 +1604,11 @@ directive as shown :

 // File : interface.i
 
-int 	a; 			// Can read/write
+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
 

@@ -2129,8 +2128,8 @@ default arguments are optional in the target language. For example, this functio used in Tcl as follows :

-% plot -3.4 7.5 				# Use default value
-% plot -3.4 7.5 10				# set color to 10 instead
+% plot -3.4 7.5    # Use default value
+% plot -3.4 7.5 10 # set color to 10 instead
 
 
@@ -2320,7 +2319,7 @@ to an individual member. For example, the declaration :

 struct Vector {
-	double x,y,z;
+  double x,y,z;
 }
 
 
@@ -2330,22 +2329,22 @@ gets transformed into the following set of accessor functions :

 double Vector_x_get(struct Vector *obj) {
-	return obj->x;
+  return obj->x;
 }
 double Vector_y_get(struct Vector *obj) { 
-	return obj->y;
+  return obj->y;
 }
 double Vector_z_get(struct Vector *obj) { 
-	return obj->z;
+  return obj->z;
 }
 void Vector_x_set(struct Vector *obj, double value) {
-	obj->x = value;
+  obj->x = value;
 }
 void Vector_y_set(struct Vector *obj, double value) {
-	obj->y = value;
+  obj->y = value;
 }
 void Vector_z_set(struct Vector *obj, double value) {
-	obj->z = value;
+  obj->z = value;
 }
 
@@ -2393,7 +2392,7 @@ programs :

 typedef struct {
-	double x,y,z;
+  double x,y,z;
 } Vector;
 
 
@@ -2408,7 +2407,7 @@ that the use of typedef allows SWIG to drop the
 double Vector_x_get(Vector *obj) {
-	return obj->x;
+  return obj->x;
 }
 
@@ -2418,7 +2417,7 @@ If two different names are used like this :

 typedef struct vector_struct {
-	double x,y,z;
+  double x,y,z;
 } Vector;
 
 
@@ -2444,8 +2443,8 @@ will be released, and the new contents allocated. For example :

%module mymodule ... struct Foo { - char *name; - ... + char *name; + ... } @@ -2455,14 +2454,15 @@ This results in the following accessor functions :

 char *Foo_name_get(Foo *obj) {
-	return Foo->name;
+  return Foo->name;
 }
 
 char *Foo_name_set(Foo *obj, char *c) {
-	if (obj->name) free(obj->name);
-	obj->name = (char *) malloc(strlen(c)+1);
-	strcpy(obj->name,c);
-	return obj->name;
+  if (obj->name)
+    free(obj->name);
+  obj->name = (char *) malloc(strlen(c)+1);
+  strcpy(obj->name,c);
+  return obj->name;
 }
 
@@ -2714,7 +2714,7 @@ the following declaration :

/* file : vector.h */ ... typedef struct Vector { - double x,y,z; + double x,y,z; } Vector; @@ -2732,23 +2732,23 @@ You can make a Vector look a lot like a class by writing a SWIG interfa %include "vector.h" // Just grab original C header file %extend Vector { // Attach these functions to struct Vector - Vector(double x, double y, double z) { - Vector *v; - v = (Vector *) malloc(sizeof(Vector)); - v->x = x; - v->y = y; - v->z = z; - return v; - } - ~Vector() { - free($self); - } - double magnitude() { - return sqrt($self->x*$self->x+$self->y*$self->y+$self->z*$self->z); - } - void print() { - printf("Vector [%g, %g, %g]\n", $self->x,$self->y,$self->z); - } + Vector(double x, double y, double z) { + Vector *v; + v = (Vector *) malloc(sizeof(Vector)); + v->x = x; + v->y = y; + v->z = z; + return v; + } + ~Vector() { + free($self); + } + double magnitude() { + return sqrt($self->x*$self->x+$self->y*$self->y+$self->z*$self->z); + } + void print() { + printf("Vector [%g, %g, %g]\n", $self->x,$self->y,$self->z); + } }; @@ -2787,12 +2787,12 @@ of the Vector structure. For example:

%} typedef struct Vector { - double x,y,z; - %extend { - Vector(double x, double y, double z) { ... } - ~Vector() { ... } - ... - } + double x,y,z; + %extend { + Vector(double x, double y, double z) { ... } + ~Vector() { ... } + ... + } } Vector; @@ -2806,19 +2806,19 @@ example :

/* Vector methods */ #include "vector.h" Vector *new_Vector(double x, double y, double z) { - Vector *v; - v = (Vector *) malloc(sizeof(Vector)); - v->x = x; - v->y = y; - v->z = z; - return v; + Vector *v; + v = (Vector *) malloc(sizeof(Vector)); + v->x = x; + v->y = y; + v->z = z; + return v; } void delete_Vector(Vector *v) { - free(v); + free(v); } double Vector_magnitude(Vector *v) { - return sqrt(v->x*v->x+v->y*v->y+v->z*v->z); + return sqrt(v->x*v->x+v->y*v->y+v->z*v->z); } // File : vector.i @@ -2829,13 +2829,13 @@ double Vector_magnitude(Vector *v) { %} typedef struct Vector { - double x,y,z; - %extend { - Vector(int,int,int); // This calls new_Vector() - ~Vector(); // This calls delete_Vector() - double magnitude(); // This will call Vector_magnitude() - ... - } + double x,y,z; + %extend { + Vector(int,int,int); // This calls new_Vector() + ~Vector(); // This calls delete_Vector() + double magnitude(); // This will call Vector_magnitude() + ... + } } Vector; @@ -2847,13 +2847,13 @@ For example:
 typedef struct Integer {
-	int value;
+  int value;
 } Int;
 %extend Integer { ...  } /* Correct name */
 %extend Int { ...  } /* Incorrect name */
 
 struct Float {
-	float value;
+  float value;
 };
 typedef struct Float FloatValue;
 %extend Float { ...  } /* Correct name */
@@ -2866,7 +2866,7 @@ There is one exception to this rule and that is when the struct is anonymously n
 
 
 typedef struct {
-	double value;
+  double value;
 } Double;
 %extend Double { ...  } /* Okay */
 
@@ -2975,13 +2975,13 @@ Occasionally, a C program will involve structures like this :

 typedef struct Object {
-	int objtype;
-	union {
-		int 	ivalue;
-		double	dvalue;
-		char	*strvalue;
-		void	*ptrvalue;
-	} intRep;
+  int objtype;
+  union {
+    int ivalue;
+    double dvalue;
+    char *strvalue;
+    void *ptrvalue;
+  } intRep;
 } Object;
 
 
@@ -2993,15 +2993,15 @@ following:

 typedef union {
-	int 		ivalue;
-	double		dvalue;
-	char		*strvalue;
-	void		*ptrvalue;
+  int ivalue;
+  double dvalue;
+  char *strvalue;
+  void *ptrvalue;
 } Object_intRep;
 
 typedef struct Object {
-	int objType;
-	Object_intRep intRep;
+  int objType;
+  Object_intRep intRep;
 } Object;
 
 
@@ -3013,16 +3013,16 @@ structures. In this case, functions like this would be created :

 Object_intRep *Object_intRep_get(Object *o) {
-	return (Object_intRep *) &o->intRep;
+  return (Object_intRep *) &o->intRep;
 }
 int Object_intRep_ivalue_get(Object_intRep *o) {
-	return o->ivalue;
+  return o->ivalue;
 }
 int Object_intRep_ivalue_set(Object_intRep *o, int value) {
-	return (o->ivalue = value);
+  return (o->ivalue = value);
 }
 double Object_intRep_dvalue_get(Object_intRep *o) {
-	return o->dvalue;
+  return o->dvalue;
 }
 ... etc ...
 
@@ -3229,7 +3229,7 @@ program. For example :

%{ /* Create a new vector */ static Vector *new_Vector() { - return (Vector *) malloc(sizeof(Vector)); + return (Vector *) malloc(sizeof(Vector)); } %} @@ -3249,7 +3249,7 @@ there is a special inlined form of code block that is used as follows %inline %{ /* Create a new vector */ Vector *new_Vector() { - return (Vector *) malloc(sizeof(Vector)); + return (Vector *) malloc(sizeof(Vector)); } %} @@ -3275,7 +3275,7 @@ initialization on module loading, you could write this:
 %init %{
-	init_variables();
+  init_variables();
 %}
 
diff --git a/Doc/Manual/SWIGPlus.html b/Doc/Manual/SWIGPlus.html index 82f720b21..73b242fa3 100644 --- a/Doc/Manual/SWIGPlus.html +++ b/Doc/Manual/SWIGPlus.html @@ -530,10 +530,10 @@ functions such as the following :

 List * new_List(void) {
-	return new List;
+  return new List;
 }
 void delete_List(List *l) {
-	delete l;
+  delete l;
 }
 
 
@@ -874,7 +874,7 @@ All member functions are roughly translated into accessor functions like this :<
 int List_search(List *obj, char *value) {
-	return obj->search(value);
+  return obj->search(value);
 }
 
 
@@ -912,11 +912,11 @@ structures. A pair of accessor functions are effectively created. For example
 int List_length_get(List *obj) {
-	return obj->length;
+  return obj->length;
 }
 int List_length_set(List *obj, int value) {
-	obj->length = value;
-	return value;
+  obj->length = value;
+  return value;
 }
 
 
@@ -933,7 +933,7 @@ class List { public: ... %immutable; - int length; + int length; %mutable; ... }; @@ -1231,7 +1231,7 @@ into constants with the classname as a prefix. For example :

 class Swig {
 public:
-	enum {ALE, LAGER, PORTER, STOUT};
+  enum {ALE, LAGER, PORTER, STOUT};
 };
 
 
@@ -1321,7 +1321,7 @@ a declaration like this :

 class Foo {
 public:
-	double bar(double &a);
+  double bar(double &a);
 }
 
@@ -1331,7 +1331,7 @@ has a low-level accessor
 double Foo_bar(Foo *obj, double *a) {
-	obj->bar(*a);
+  obj->bar(*a);
 }
 
@@ -1550,24 +1550,24 @@ the full C++ code has been omitted.

class Shape { public: - double x,y; - virtual double area() = 0; - virtual double perimeter() = 0; - void set_location(double x, double y); + double x,y; + virtual double area() = 0; + virtual double perimeter() = 0; + void set_location(double x, double y); }; class Circle : public Shape { public: - Circle(double radius); - ~Circle(); - double area(); - double perimeter(); + Circle(double radius); + ~Circle(); + double area(); + double perimeter(); }; class Square : public Shape { public: - Square(double size); - ~Square(); - double area(); - double perimeter(); + Square(double size); + ~Square(); + double area(); + double perimeter(); }
@@ -2615,7 +2615,7 @@ public: } Complex operator*(const Complex &c) const { return Complex(rpart*c.rpart - ipart*c.ipart, - rpart*c.ipart + c.rpart*ipart); + rpart*c.ipart + c.rpart*ipart); } Complex operator-() const { return Complex(-rpart, -ipart); @@ -2788,17 +2788,17 @@ example : class Vector { public: - double x,y,z; - Vector(); - ~Vector(); - ... bunch of C++ methods ... - %extend { - char *__str__() { - static char temp[256]; - sprintf(temp,"[ %g, %g, %g ]", $self->x,$self->y,$self->z); - return &temp[0]; - } - } + double x,y,z; + Vector(); + ~Vector(); + ... bunch of C++ methods ... + %extend { + char *__str__() { + static char temp[256]; + sprintf(temp,"[ %g, %g, %g ]", $self->x,$self->y,$self->z); + return &temp[0]; + } + } };
@@ -4696,11 +4696,11 @@ public: return add_ref(); } - int unref() const { + int unref() const { if (ref_count() == 0 || del_ref() == 0 ) { - delete this; - return 0; - } + delete this; + return 0; + } return ref_count(); } }; diff --git a/Doc/Manual/Scripting.html b/Doc/Manual/Scripting.html index f178033e4..18af78a68 100644 --- a/Doc/Manual/Scripting.html +++ b/Doc/Manual/Scripting.html @@ -102,8 +102,10 @@ Suppose you have an ordinary C function like this :

 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);
 }
 
@@ -124,18 +126,17 @@ As an example, the Tcl wrapper function for the fact() function above example might look like the following :

-int wrap_fact(ClientData clientData, Tcl_Interp *interp,
-		int argc, char *argv[]) {
-	int result;
-	int arg0;
-	if (argc != 2) {
-		interp->result = "wrong # args";
-		return TCL_ERROR;
-	}
-	arg0 = atoi(argv[1]);
-	result = fact(arg0);
-	sprintf(interp->result,"%d", result);
-	return TCL_OK;
+int wrap_fact(ClientData clientData, Tcl_Interp *interp, int argc, char *argv[]) {
+  int result;
+  int arg0;
+  if (argc != 2) {
+    interp->result = "wrong # args";
+    return TCL_ERROR;
+  }
+  arg0 = atoi(argv[1]);
+  result = fact(arg0);
+  sprintf(interp->result,"%d", result);
+  return TCL_OK;
 }
 
 
@@ -149,9 +150,9 @@ requires code like the following :

 int Wrap_Init(Tcl_Interp *interp) {
-	Tcl_CreateCommand(interp, "fact", wrap_fact, (ClientData) NULL,
-				(Tcl_CmdDeleteProc *) NULL);
-	return TCL_OK;
+  Tcl_CreateCommand(interp, "fact", wrap_fact, (ClientData) NULL,
+                    (Tcl_CmdDeleteProc *) NULL);
+  return TCL_OK;
 }
 
@@ -244,9 +245,9 @@ representation of a structure. For example,
 struct Vector {
-	Vector();
-	~Vector();
-	double x,y,z;
+  Vector();
+  ~Vector();
+  double x,y,z;
 };
 
 
@@ -299,9 +300,9 @@ have the following C++ definition :

 class Vector {
 public:
-	Vector();
-	~Vector();
-	double x,y,z;
+  Vector();
+  ~Vector();
+  double x,y,z;
 };
 
diff --git a/Doc/Manual/Tcl.html b/Doc/Manual/Tcl.html index 77ea5f3b6..31fae0321 100644 --- a/Doc/Manual/Tcl.html +++ b/Doc/Manual/Tcl.html @@ -208,8 +208,8 @@ $ swig -tcl example.i $ gcc example.c example_wrap.c \ -Xlinker -export-dynamic \ -DHAVE_CONFIG_H -I/usr/local/include/ \ - -L/usr/local/lib -ltcl -lm -ldl \ - -o mytclsh + -L/usr/local/lib -ltcl -lm -ldl \ + -o mytclsh @@ -626,11 +626,11 @@ CFLAGS = /Z7 /Od /c /nologo TCL_INCLUDES = -Id:\tcl8.0a2\generic -Id:\tcl8.0a2\win TCLLIB = d:\tcl8.0a2\win\tcl80.lib -tcl:: - ..\..\swig -tcl -o $(WRAPFILE) $(INTERFACE) - $(CC) $(CFLAGS) $(TCL_INCLUDES) $(SRCS) $(WRAPFILE) - set LIB=$(TOOLS)\lib - $(LINK) $(LOPT) -out:example.dll $(LIBS) $(TCLLIB) example.obj example_wrap.obj +tcl: + ..\..\swig -tcl -o $(WRAPFILE) $(INTERFACE) + $(CC) $(CFLAGS) $(TCL_INCLUDES) $(SRCS) $(WRAPFILE) + set LIB=$(TOOLS)\lib + $(LINK) $(LOPT) -out:example.dll $(LIBS) $(TCLLIB) example.obj example_wrap.obj @@ -981,7 +981,7 @@ This provides a very natural interface. For example,
 struct Vector {
-	double x,y,z;
+  double x,y,z;
 };
 
 
@@ -2466,8 +2466,9 @@ you might define a typemap like this: %module example %typemap(in) int { - if (Tcl_GetIntFromObj(interp,$input,&$1) == TCL_ERROR) return TCL_ERROR; - printf("Received an integer : %d\n",$1); + if (Tcl_GetIntFromObj(interp,$input,&$1) == TCL_ERROR) + return TCL_ERROR; + printf("Received an integer : %d\n",$1); } %inline %{ extern int fact(int n); @@ -2504,8 +2505,9 @@ 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; - printf("n = %d\n",$1); + if (Tcl_GetIntFromObj(interp,$input,&$1) == TCL_ERROR) + return TCL_ERROR; + printf("n = %d\n",$1); } %inline %{ extern int fact(int n); @@ -2527,8 +2529,9 @@ the typemap system follows typedef declarations. For example:
 %typemap(in) int n {
-        if (Tcl_GetIntFromObj(interp,$input,&$1) == TCL_ERROR) return TCL_ERROR;
-	printf("n = %d\n",$1);
+  if (Tcl_GetIntFromObj(interp,$input,&$1) == TCL_ERROR)
+    return TCL_ERROR;
+  printf("n = %d\n",$1);
 }
 %inline %{
 typedef int Integer;
@@ -2976,10 +2979,10 @@ work)
 
 %typemap(in) int, short, long {
-   int temp;
-   if (Tcl_GetIntFromObj(interp, $input, &temp) == TCL_ERROR)
-      return TCL_ERROR;
-   $1 = ($1_ltype) temp;
+  int temp;
+  if (Tcl_GetIntFromObj(interp, $input, &temp) == TCL_ERROR)
+    return TCL_ERROR;
+  $1 = ($1_ltype) temp;
 }
 
@@ -3154,8 +3157,8 @@ subdirectory which has the same name as the package. For example :
 ./example/
-	   pkgIndex.tcl           # The file created by pkg_mkIndex
-	   example.so             # The SWIG generated module
+           pkgIndex.tcl           # The file created by pkg_mkIndex
+           example.so             # The SWIG generated module
 

@@ -3265,14 +3268,14 @@ Our script allows easy array access as follows :

 set a [Array double 100]                   ;# Create a double [100]
 for {set i 0} {$i < 100} {incr i 1} {      ;# Clear the array
-	$a set $i 0.0
+        $a set $i 0.0
 }
 $a set 3 3.1455                            ;# Set an individual element
 set b [$a get 10]                          ;# Retrieve an element
 
 set ia [Array int 50]                      ;# Create an int[50]
 for {set i 0} {$i < 50} {incr i 1} {       ;# Clear it
-	$ia set $i 0
+        $ia set $i 0
 }
 $ia set 3 7                                ;# Set an individual element
 set ib [$ia get 10]                        ;# Get an individual element
diff --git a/Doc/Manual/Typemaps.html b/Doc/Manual/Typemaps.html
index 6dfc5d05d..0dc725a9f 100644
--- a/Doc/Manual/Typemaps.html
+++ b/Doc/Manual/Typemaps.html
@@ -3051,8 +3051,8 @@ For example, suppose you had a structure like this:
 
 
 struct SomeObject {
-	float  value[4];
-        ...
+  float  value[4];
+  ...
 };
 
@@ -3166,9 +3166,9 @@ checking the values of function arguments. For example:

%module math %typemap(check) double posdouble { - if ($1 < 0) { - croak("Expecting a positive number"); - } + if ($1 < 0) { + croak("Expecting a positive number"); + } } ... @@ -4511,22 +4511,22 @@ The following excerpt from the Python module illustrates this: /* Note: %typecheck(X) is a macro for %typemap(typecheck,precedence=X) */ %typecheck(SWIG_TYPECHECK_INTEGER) - int, short, long, - unsigned int, unsigned short, unsigned long, - signed char, unsigned char, - long long, unsigned long long, - const int &, const short &, const long &, - const unsigned int &, const unsigned short &, const unsigned long &, - const long long &, const unsigned long long &, - enum SWIGTYPE, - bool, const bool & + int, short, long, + unsigned int, unsigned short, unsigned long, + signed char, unsigned char, + long long, unsigned long long, + const int &, const short &, const long &, + const unsigned int &, const unsigned short &, const unsigned long &, + const long long &, const unsigned long long &, + enum SWIGTYPE, + bool, const bool & { $1 = (PyInt_Check($input) || PyLong_Check($input)) ? 1 : 0; } %typecheck(SWIG_TYPECHECK_DOUBLE) - float, double, - const float &, const double & + float, double, + const float &, const double & { $1 = (PyFloat_Check($input) || PyInt_Check($input) || PyLong_Check($input)) ? 1 : 0; } diff --git a/Doc/Manual/Varargs.html b/Doc/Manual/Varargs.html index 78689c2fb..1c99804f1 100644 --- a/Doc/Manual/Varargs.html +++ b/Doc/Manual/Varargs.html @@ -636,7 +636,7 @@ example. For example: PyObject *o = PyTuple_GetItem(varargs,i); if (!PyString_Check(o)) { PyErr_SetString(PyExc_ValueError,"Expected a string"); - free(argv); + free(argv); return NULL; } argv[i] = PyString_AsString(o); diff --git a/Doc/Manual/Windows.html b/Doc/Manual/Windows.html index d7c1932b7..b95105bdd 100644 --- a/Doc/Manual/Windows.html +++ b/Doc/Manual/Windows.html @@ -164,7 +164,7 @@ PYTHON_LIB: D:\python21\libs\python21.lib

TCL_INCLUDE : Set this to the directory containing tcl.h
TCL_LIB : Set this to the TCL library including path for linking

-Example using ActiveTcl 8.3.3.3
+Example using ActiveTcl 8.3.3.3
TCL_INCLUDE: D:\tcl\include
TCL_LIB: D:\tcl\lib\tcl83.lib