html fixes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6632 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
0dc3099ead
commit
3ef946d2d1
13 changed files with 51 additions and 51 deletions
|
|
@ -26,7 +26,7 @@ you might have an operator like this:
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<pre>
|
<pre>
|
||||||
Vector operator+(const Vector &a, const Vector &b) {
|
Vector operator+(const Vector &a, const Vector &b) {
|
||||||
Vector result;
|
Vector result;
|
||||||
result.x = a.x + b.x;
|
result.x = a.x + b.x;
|
||||||
result.y = a.y + b.y;
|
result.y = a.y + b.y;
|
||||||
|
|
@ -40,7 +40,7 @@ or a function:
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<pre>
|
<pre>
|
||||||
Vector addv(const Vector &a, const Vector &b) {
|
Vector addv(const Vector &a, const Vector &b) {
|
||||||
Vector result;
|
Vector result;
|
||||||
result.x = a.x + b.x;
|
result.x = a.x + b.x;
|
||||||
result.y = a.y + b.y;
|
result.y = a.y + b.y;
|
||||||
|
|
@ -67,7 +67,7 @@ The prototypical example is an operator like this:
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<pre>
|
<pre>
|
||||||
Vector &operator[](int index);
|
Vector &operator[](int index);
|
||||||
</pre>
|
</pre>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
||||||
|
|
@ -75,7 +75,7 @@ or a method:
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<pre>
|
<pre>
|
||||||
Vector &get(int index);
|
Vector &get(int index);
|
||||||
</pre>
|
</pre>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
||||||
|
|
@ -84,8 +84,8 @@ For functions returning references, a wrapper like this is created:
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<pre>
|
<pre>
|
||||||
Vector *wrap_Object_get(Object *self, int index) {
|
Vector *wrap_Object_get(Object *self, int index) {
|
||||||
Vector &result = self->get(index);
|
Vector &result = self->get(index);
|
||||||
return &result;
|
return &result;
|
||||||
}
|
}
|
||||||
</pre>
|
</pre>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
@ -107,10 +107,10 @@ class VectorArray {
|
||||||
public:
|
public:
|
||||||
...
|
...
|
||||||
%addmethods {
|
%addmethods {
|
||||||
Vector &get(int index) {
|
Vector &get(int index) {
|
||||||
return (*self)[index];
|
return (*self)[index];
|
||||||
}
|
}
|
||||||
void set(int index, Vector &a) {
|
void set(int index, Vector &a) {
|
||||||
(*self)[index] = a;
|
(*self)[index] = a;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ double Foo = 3.0;
|
||||||
int gcd(int x, int y) {
|
int gcd(int x, int y) {
|
||||||
int g;
|
int g;
|
||||||
g = y;
|
g = y;
|
||||||
while (x > 0) {
|
while (x > 0) {
|
||||||
g = x;
|
g = x;
|
||||||
x = y % x;
|
x = y % x;
|
||||||
y = g;
|
y = g;
|
||||||
|
|
|
||||||
|
|
@ -36,10 +36,10 @@ template<class T> class vector {
|
||||||
v = new T[_sz];
|
v = new T[_sz];
|
||||||
sz = _sz;
|
sz = _sz;
|
||||||
}
|
}
|
||||||
T &get(int index) {
|
T &get(int index) {
|
||||||
return v[index];
|
return v[index];
|
||||||
}
|
}
|
||||||
void set(int index, T &val) {
|
void set(int index, T &val) {
|
||||||
v[index] = val;
|
v[index] = val;
|
||||||
}
|
}
|
||||||
#ifdef SWIG
|
#ifdef SWIG
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ double Foo = 3.0;
|
||||||
int gcd(int x, int y) {
|
int gcd(int x, int y) {
|
||||||
int g;
|
int g;
|
||||||
g = y;
|
g = y;
|
||||||
while (x > 0) {
|
while (x > 0) {
|
||||||
g = x;
|
g = x;
|
||||||
x = y % x;
|
x = y % x;
|
||||||
y = g;
|
y = g;
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ you might have an operator like this:
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<pre>
|
<pre>
|
||||||
Vector operator+(const Vector &a, const Vector &b) {
|
Vector operator+(const Vector &a, const Vector &b) {
|
||||||
Vector result;
|
Vector result;
|
||||||
result.x = a.x + b.x;
|
result.x = a.x + b.x;
|
||||||
result.y = a.y + b.y;
|
result.y = a.y + b.y;
|
||||||
|
|
@ -40,7 +40,7 @@ or a function:
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<pre>
|
<pre>
|
||||||
Vector addv(const Vector &a, const Vector &b) {
|
Vector addv(const Vector &a, const Vector &b) {
|
||||||
Vector result;
|
Vector result;
|
||||||
result.x = a.x + b.x;
|
result.x = a.x + b.x;
|
||||||
result.y = a.y + b.y;
|
result.y = a.y + b.y;
|
||||||
|
|
@ -67,7 +67,7 @@ The prototypical example is an operator like this:
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<pre>
|
<pre>
|
||||||
Vector &operator[](int index);
|
Vector &operator[](int index);
|
||||||
</pre>
|
</pre>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
||||||
|
|
@ -75,7 +75,7 @@ or a method:
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<pre>
|
<pre>
|
||||||
Vector &get(int index);
|
Vector &get(int index);
|
||||||
</pre>
|
</pre>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
||||||
|
|
@ -84,8 +84,8 @@ For functions returning references, a wrapper like this is created:
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<pre>
|
<pre>
|
||||||
Vector *wrap_Object_get(Object *self, int index) {
|
Vector *wrap_Object_get(Object *self, int index) {
|
||||||
Vector &result = self->get(index);
|
Vector &result = self->get(index);
|
||||||
return &result;
|
return &result;
|
||||||
}
|
}
|
||||||
</pre>
|
</pre>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
@ -107,10 +107,10 @@ class VectorArray {
|
||||||
public:
|
public:
|
||||||
...
|
...
|
||||||
%addmethods {
|
%addmethods {
|
||||||
Vector &get(int index) {
|
Vector &get(int index) {
|
||||||
return (*self)[index];
|
return (*self)[index];
|
||||||
}
|
}
|
||||||
void set(int index, Vector &a) {
|
void set(int index, Vector &a) {
|
||||||
(*self)[index] = a;
|
(*self)[index] = a;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ double Foo = 3.0;
|
||||||
int gcd(int x, int y) {
|
int gcd(int x, int y) {
|
||||||
int g;
|
int g;
|
||||||
g = y;
|
g = y;
|
||||||
while (x > 0) {
|
while (x > 0) {
|
||||||
g = x;
|
g = x;
|
||||||
x = y % x;
|
x = y % x;
|
||||||
y = g;
|
y = g;
|
||||||
|
|
|
||||||
|
|
@ -51,8 +51,8 @@ the steps look like this (Linux):
|
||||||
% python
|
% python
|
||||||
Python 1.5.2 (#3, Oct 9 1999, 22:09:34) [GCC 2.95.1 19990816 (release)] on linux2
|
Python 1.5.2 (#3, Oct 9 1999, 22:09:34) [GCC 2.95.1 19990816 (release)] on linux2
|
||||||
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
|
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
|
||||||
>>> import interface
|
>>> import interface
|
||||||
>>> interface.blah(...)
|
>>> interface.blah(...)
|
||||||
...
|
...
|
||||||
</pre>
|
</pre>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ you might have an operator like this:
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<pre>
|
<pre>
|
||||||
Vector operator+(const Vector &a, const Vector &b) {
|
Vector operator+(const Vector &a, const Vector &b) {
|
||||||
Vector result;
|
Vector result;
|
||||||
result.x = a.x + b.x;
|
result.x = a.x + b.x;
|
||||||
result.y = a.y + b.y;
|
result.y = a.y + b.y;
|
||||||
|
|
@ -40,7 +40,7 @@ or a function:
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<pre>
|
<pre>
|
||||||
Vector addv(const Vector &a, const Vector &b) {
|
Vector addv(const Vector &a, const Vector &b) {
|
||||||
Vector result;
|
Vector result;
|
||||||
result.x = a.x + b.x;
|
result.x = a.x + b.x;
|
||||||
result.y = a.y + b.y;
|
result.y = a.y + b.y;
|
||||||
|
|
@ -67,7 +67,7 @@ The prototypical example is an operator like this:
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<pre>
|
<pre>
|
||||||
Vector &operator[](int index);
|
Vector &operator[](int index);
|
||||||
</pre>
|
</pre>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
||||||
|
|
@ -75,7 +75,7 @@ or a method:
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<pre>
|
<pre>
|
||||||
Vector &get(int index);
|
Vector &get(int index);
|
||||||
</pre>
|
</pre>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
||||||
|
|
@ -84,8 +84,8 @@ For functions returning references, a wrapper like this is created:
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<pre>
|
<pre>
|
||||||
Vector *wrap_Object_get(Object *self, int index) {
|
Vector *wrap_Object_get(Object *self, int index) {
|
||||||
Vector &result = self->get(index);
|
Vector &result = self->get(index);
|
||||||
return &result;
|
return &result;
|
||||||
}
|
}
|
||||||
</pre>
|
</pre>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
@ -107,10 +107,10 @@ class VectorArray {
|
||||||
public:
|
public:
|
||||||
...
|
...
|
||||||
%addmethods {
|
%addmethods {
|
||||||
Vector &get(int index) {
|
Vector &get(int index) {
|
||||||
return (*self)[index];
|
return (*self)[index];
|
||||||
}
|
}
|
||||||
void set(int index, Vector &a) {
|
void set(int index, Vector &a) {
|
||||||
(*self)[index] = a;
|
(*self)[index] = a;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ double Foo = 3.0;
|
||||||
int gcd(int x, int y) {
|
int gcd(int x, int y) {
|
||||||
int g;
|
int g;
|
||||||
g = y;
|
g = y;
|
||||||
while (x > 0) {
|
while (x > 0) {
|
||||||
g = x;
|
g = x;
|
||||||
x = y % x;
|
x = y % x;
|
||||||
y = g;
|
y = g;
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ you might have an operator like this:
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<pre>
|
<pre>
|
||||||
Vector operator+(const Vector &a, const Vector &b) {
|
Vector operator+(const Vector &a, const Vector &b) {
|
||||||
Vector result;
|
Vector result;
|
||||||
result.x = a.x + b.x;
|
result.x = a.x + b.x;
|
||||||
result.y = a.y + b.y;
|
result.y = a.y + b.y;
|
||||||
|
|
@ -40,7 +40,7 @@ or a function:
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<pre>
|
<pre>
|
||||||
Vector addv(const Vector &a, const Vector &b) {
|
Vector addv(const Vector &a, const Vector &b) {
|
||||||
Vector result;
|
Vector result;
|
||||||
result.x = a.x + b.x;
|
result.x = a.x + b.x;
|
||||||
result.y = a.y + b.y;
|
result.y = a.y + b.y;
|
||||||
|
|
@ -67,7 +67,7 @@ The prototypical example is an operator like this:
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<pre>
|
<pre>
|
||||||
Vector &operator[](int index);
|
Vector &operator[](int index);
|
||||||
</pre>
|
</pre>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
||||||
|
|
@ -75,7 +75,7 @@ or a method:
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<pre>
|
<pre>
|
||||||
Vector &get(int index);
|
Vector &get(int index);
|
||||||
</pre>
|
</pre>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
||||||
|
|
@ -84,8 +84,8 @@ For functions returning references, a wrapper like this is created:
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<pre>
|
<pre>
|
||||||
Vector *wrap_Object_get(Object *self, int index) {
|
Vector *wrap_Object_get(Object *self, int index) {
|
||||||
Vector &result = self->get(index);
|
Vector &result = self->get(index);
|
||||||
return &result;
|
return &result;
|
||||||
}
|
}
|
||||||
</pre>
|
</pre>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
@ -107,10 +107,10 @@ class VectorArray {
|
||||||
public:
|
public:
|
||||||
...
|
...
|
||||||
%addmethods {
|
%addmethods {
|
||||||
Vector &get(int index) {
|
Vector &get(int index) {
|
||||||
return (*self)[index];
|
return (*self)[index];
|
||||||
}
|
}
|
||||||
void set(int index, Vector &a) {
|
void set(int index, Vector &a) {
|
||||||
(*self)[index] = a;
|
(*self)[index] = a;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ double Foo = 3.0;
|
||||||
int gcd(int x, int y) {
|
int gcd(int x, int y) {
|
||||||
int g;
|
int g;
|
||||||
g = y;
|
g = y;
|
||||||
while (x > 0) {
|
while (x > 0) {
|
||||||
g = x;
|
g = x;
|
||||||
x = y % x;
|
x = y % x;
|
||||||
y = g;
|
y = g;
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ you might have an operator like this:
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<pre>
|
<pre>
|
||||||
Vector operator+(const Vector &a, const Vector &b) {
|
Vector operator+(const Vector &a, const Vector &b) {
|
||||||
Vector result;
|
Vector result;
|
||||||
result.x = a.x + b.x;
|
result.x = a.x + b.x;
|
||||||
result.y = a.y + b.y;
|
result.y = a.y + b.y;
|
||||||
|
|
@ -40,7 +40,7 @@ or a function:
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<pre>
|
<pre>
|
||||||
Vector addv(const Vector &a, const Vector &b) {
|
Vector addv(const Vector &a, const Vector &b) {
|
||||||
Vector result;
|
Vector result;
|
||||||
result.x = a.x + b.x;
|
result.x = a.x + b.x;
|
||||||
result.y = a.y + b.y;
|
result.y = a.y + b.y;
|
||||||
|
|
@ -67,7 +67,7 @@ The prototypical example is an operator like this:
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<pre>
|
<pre>
|
||||||
Vector &operator[](int index);
|
Vector &operator[](int index);
|
||||||
</pre>
|
</pre>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
||||||
|
|
@ -75,7 +75,7 @@ or a method:
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<pre>
|
<pre>
|
||||||
Vector &get(int index);
|
Vector &get(int index);
|
||||||
</pre>
|
</pre>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
||||||
|
|
@ -84,8 +84,8 @@ For functions returning references, a wrapper like this is created:
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<pre>
|
<pre>
|
||||||
Vector *wrap_Object_get(Object *self, int index) {
|
Vector *wrap_Object_get(Object *self, int index) {
|
||||||
Vector &result = self->get(index);
|
Vector &result = self->get(index);
|
||||||
return &result;
|
return &result;
|
||||||
}
|
}
|
||||||
</pre>
|
</pre>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
@ -107,10 +107,10 @@ class VectorArray {
|
||||||
public:
|
public:
|
||||||
...
|
...
|
||||||
%addmethods {
|
%addmethods {
|
||||||
Vector &get(int index) {
|
Vector &get(int index) {
|
||||||
return (*self)[index];
|
return (*self)[index];
|
||||||
}
|
}
|
||||||
void set(int index, Vector &a) {
|
void set(int index, Vector &a) {
|
||||||
(*self)[index] = a;
|
(*self)[index] = a;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -129,7 +129,7 @@ Click <a href="runme.tcl">here</a> to see a script that manipulates some C++ ref
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>C++ references primarily provide notational convenience for C++
|
<li>C++ references primarily provide notational convenience for C++
|
||||||
source code. However, Tcl has neither the 'x.a' or 'x->a'
|
source code. However, Tcl has neither the 'x.a' or 'x->a'
|
||||||
notation so it doesn't much matter.
|
notation so it doesn't much matter.
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ double Foo = 3.0;
|
||||||
int gcd(int x, int y) {
|
int gcd(int x, int y) {
|
||||||
int g;
|
int g;
|
||||||
g = y;
|
g = y;
|
||||||
while (x > 0) {
|
while (x > 0) {
|
||||||
g = x;
|
g = x;
|
||||||
x = y % x;
|
x = y % x;
|
||||||
y = g;
|
y = g;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue