Realign for some comments.
This commit is contained in:
parent
8985c34809
commit
9a6f82ab31
12 changed files with 35 additions and 35 deletions
|
|
@ -2160,7 +2160,7 @@ The typemaps to achieve this are shown below.
|
||||||
%typemap(cstype) CDate & "out System.DateTime"
|
%typemap(cstype) CDate & "out System.DateTime"
|
||||||
%typemap(csin,
|
%typemap(csin,
|
||||||
pre=" CDate temp$csinput = new CDate();",
|
pre=" CDate temp$csinput = new CDate();",
|
||||||
post=" $csinput = new System.DateTime(temp$csinput.getYear(), "
|
post=" $csinput = new System.DateTime(temp$csinput.getYear(),"
|
||||||
" temp$csinput.getMonth(), temp$csinput.getDay(), 0, 0, 0);",
|
" temp$csinput.getMonth(), temp$csinput.getDay(), 0, 0, 0);",
|
||||||
cshin="out $csinput"
|
cshin="out $csinput"
|
||||||
) CDate &
|
) CDate &
|
||||||
|
|
@ -2266,7 +2266,7 @@ will be possible with the following <tt>CDate *</tt> typemaps
|
||||||
|
|
||||||
%typemap(csin,
|
%typemap(csin,
|
||||||
pre=" CDate temp$csinput = new CDate($csinput.Year, $csinput.Month, $csinput.Day);",
|
pre=" CDate temp$csinput = new CDate($csinput.Year, $csinput.Month, $csinput.Day);",
|
||||||
post=" $csinput = new System.DateTime(temp$csinput.getYear(), "
|
post=" $csinput = new System.DateTime(temp$csinput.getYear(),"
|
||||||
" temp$csinput.getMonth(), temp$csinput.getDay(), 0, 0, 0);",
|
" temp$csinput.getMonth(), temp$csinput.getDay(), 0, 0, 0);",
|
||||||
cshin="ref $csinput"
|
cshin="ref $csinput"
|
||||||
) CDate *
|
) CDate *
|
||||||
|
|
@ -2305,7 +2305,7 @@ The <tt>subtractYears</tt> method is nearly identical to the above <tt>addYears<
|
||||||
<pre>
|
<pre>
|
||||||
%typemap(csin,
|
%typemap(csin,
|
||||||
pre=" using (CDate temp$csinput = new CDate($csinput.Year, $csinput.Month, $csinput.Day)) {",
|
pre=" using (CDate temp$csinput = new CDate($csinput.Year, $csinput.Month, $csinput.Day)) {",
|
||||||
post=" $csinput = new System.DateTime(temp$csinput.getYear(), "
|
post=" $csinput = new System.DateTime(temp$csinput.getYear(),"
|
||||||
" temp$csinput.getMonth(), temp$csinput.getDay(), 0, 0, 0);",
|
" temp$csinput.getMonth(), temp$csinput.getDay(), 0, 0, 0);",
|
||||||
terminator=" } // terminate temp$csinput using block",
|
terminator=" } // terminate temp$csinput using block",
|
||||||
cshin="ref $csinput"
|
cshin="ref $csinput"
|
||||||
|
|
@ -2377,7 +2377,7 @@ The typemap type required is thus <tt>CDate *</tt>. Given that the previous sect
|
||||||
|
|
||||||
%typemap(csin,
|
%typemap(csin,
|
||||||
pre=" CDate temp$csinput = new CDate($csinput.Year, $csinput.Month, $csinput.Day);",
|
pre=" CDate temp$csinput = new CDate($csinput.Year, $csinput.Month, $csinput.Day);",
|
||||||
post=" $csinput = new System.DateTime(temp$csinput.getYear(), "
|
post=" $csinput = new System.DateTime(temp$csinput.getYear(),"
|
||||||
" temp$csinput.getMonth(), temp$csinput.getDay(), 0, 0, 0);",
|
" temp$csinput.getMonth(), temp$csinput.getDay(), 0, 0, 0);",
|
||||||
cshin="ref $csinput"
|
cshin="ref $csinput"
|
||||||
) CDate *
|
) CDate *
|
||||||
|
|
|
||||||
|
|
@ -295,9 +295,9 @@
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
The author of TinyCLOS, Gregor Kiczales, describes TinyCLOS as:
|
The author of TinyCLOS, Gregor Kiczales, describes TinyCLOS as:
|
||||||
"Tiny CLOS is a Scheme implementation of a `kernelized' CLOS, with a
|
"Tiny CLOS is a Scheme implementation of a 'kernelized' CLOS, with a
|
||||||
metaobject protocol. The implementation is even simpler than
|
metaobject protocol. The implementation is even simpler than
|
||||||
the simple CLOS found in `The Art of the Metaobject Protocol, '
|
the simple CLOS found in 'The Art of the Metaobject Protocol',
|
||||||
weighing in at around 850 lines of code, including (some)
|
weighing in at around 850 lines of code, including (some)
|
||||||
comments and documentation."
|
comments and documentation."
|
||||||
</p>
|
</p>
|
||||||
|
|
@ -420,7 +420,7 @@ See the
|
||||||
Loading-extension-libraries in the eval unit inside the CHICKEN manual for more information.</p>
|
Loading-extension-libraries in the eval unit inside the CHICKEN manual for more information.</p>
|
||||||
|
|
||||||
<p>Another alternative is to run SWIG normally and create a scheme file that contains <code>(declare (uses <i>modname</i>))</code>
|
<p>Another alternative is to run SWIG normally and create a scheme file that contains <code>(declare (uses <i>modname</i>))</code>
|
||||||
and then compile that file into the shared library as well. For example, inside the <tt>mod_load.scm</tt> file, </p>
|
and then compile that file into the shared library as well. For example, inside the <tt>mod_load.scm</tt> file,</p>
|
||||||
|
|
||||||
<div class="targetlang">
|
<div class="targetlang">
|
||||||
<pre>
|
<pre>
|
||||||
|
|
|
||||||
|
|
@ -1337,7 +1337,7 @@ func Modf(x float64) (fracPart float64, intPart float64) {
|
||||||
|
|
||||||
<p>For classes, since swig generates an interface, you can add additional
|
<p>For classes, since swig generates an interface, you can add additional
|
||||||
methods by defining another interface that includes the swig-generated
|
methods by defining another interface that includes the swig-generated
|
||||||
interface. For example, </p>
|
interface. For example,</p>
|
||||||
<div class="code">
|
<div class="code">
|
||||||
<pre>
|
<pre>
|
||||||
%rename(Wrapped_MyClass) MyClass;
|
%rename(Wrapped_MyClass) MyClass;
|
||||||
|
|
@ -1372,7 +1372,7 @@ few, then you might as well define your own struct that includes the
|
||||||
swig-wrapped object, instead of adding methods to the swig-generated object.</p>
|
swig-wrapped object, instead of adding methods to the swig-generated object.</p>
|
||||||
|
|
||||||
<p>If you need to import other go packages, you can do this with
|
<p>If you need to import other go packages, you can do this with
|
||||||
<code>%go_import</code>. For example, </p>
|
<code>%go_import</code>. For example,</p>
|
||||||
<div class="code">
|
<div class="code">
|
||||||
<pre>
|
<pre>
|
||||||
%go_import("fmt", _ "unusedPackage", rp "renamed/package")
|
%go_import("fmt", _ "unusedPackage", rp "renamed/package")
|
||||||
|
|
|
||||||
|
|
@ -727,7 +727,7 @@ In the previous example, the GOOPS definitions will be in a file named Test.scm.
|
||||||
|
|
||||||
<p>Because of the naming conflicts, you can't in general use both the <code>-primitive</code> and the GOOPS
|
<p>Because of the naming conflicts, you can't in general use both the <code>-primitive</code> and the GOOPS
|
||||||
guile-modules at the same time. To do this, you need to rename the exported symbols from one or both
|
guile-modules at the same time. To do this, you need to rename the exported symbols from one or both
|
||||||
guile-modules. For example, </p>
|
guile-modules. For example,</p>
|
||||||
<div class="targetlang"><pre>
|
<div class="targetlang"><pre>
|
||||||
(use-modules ((Test-primitive) #:renamer (symbol-prefix-proc 'primitive:)))
|
(use-modules ((Test-primitive) #:renamer (symbol-prefix-proc 'primitive:)))
|
||||||
(use-modules ((Test) #:renamer (symbol-prefix-proc 'goops:)))
|
(use-modules ((Test) #:renamer (symbol-prefix-proc 'goops:)))
|
||||||
|
|
|
||||||
|
|
@ -563,7 +563,7 @@ Don't worry if the wrapper file doesn't exist yet--Visual Studio will keep a ref
|
||||||
<li>Enter "SWIG" in the description field.
|
<li>Enter "SWIG" in the description field.
|
||||||
<li>Enter "<tt>swig -java -o $(ProjDir)\$(InputName)_wrap.c $(InputPath)</tt>" in the "Build command(s) field"
|
<li>Enter "<tt>swig -java -o $(ProjDir)\$(InputName)_wrap.c $(InputPath)</tt>" in the "Build command(s) field"
|
||||||
<li>Enter "<tt>$(ProjDir)\$(InputName)_wrap.c</tt>" in the "Output files(s) field".
|
<li>Enter "<tt>$(ProjDir)\$(InputName)_wrap.c</tt>" in the "Output files(s) field".
|
||||||
<li>Next, select the settings for the entire project and go to C/C++ tab and select the Preprocessor category . Add the include directories to the JNI header files under "Additional include directories", eg "C:\jdk1.3\include, C:\jdk1.3\include\win32".
|
<li>Next, select the settings for the entire project and go to C/C++ tab and select the Preprocessor category. Add the include directories to the JNI header files under "Additional include directories", eg "C:\jdk1.3\include, C:\jdk1.3\include\win32".
|
||||||
<li>Next, select the settings for the entire project and go to Link tab and select the General category. Set the name of the output file to match the name of your Java module (ie. example.dll).
|
<li>Next, select the settings for the entire project and go to Link tab and select the General category. Set the name of the output file to match the name of your Java module (ie. example.dll).
|
||||||
<li>Next, select the example.c and example_wrap.c files and go to the C/C++ tab and select the Precompiled Headers tab in the project settings. Disabling precompiled headers for these files will overcome any precompiled header errors while building.
|
<li>Next, select the example.c and example_wrap.c files and go to the C/C++ tab and select the Precompiled Headers tab in the project settings. Disabling precompiled headers for these files will overcome any precompiled header errors while building.
|
||||||
<li>Finally, add the java compilation as a post build rule in the Post-build step tab in project settings, eg, "c:\jdk1.3\bin\javac *.java"
|
<li>Finally, add the java compilation as a post build rule in the Post-build step tab in project settings, eg, "c:\jdk1.3\bin\javac *.java"
|
||||||
|
|
|
||||||
|
|
@ -1121,7 +1121,7 @@ Extend works with both C and C++ code, on classes and structs. It does not modif
|
||||||
<H3><a name="Lua_nn20">28.3.13 Using %newobject to release memory</a></H3>
|
<H3><a name="Lua_nn20">28.3.13 Using %newobject to release memory</a></H3>
|
||||||
|
|
||||||
|
|
||||||
<p> If you have a function that allocates memory like this, </p>
|
<p> If you have a function that allocates memory like this,</p>
|
||||||
<div class="code">
|
<div class="code">
|
||||||
<pre>char *foo() {
|
<pre>char *foo() {
|
||||||
char *result = (char *) malloc(...);
|
char *result = (char *) malloc(...);
|
||||||
|
|
|
||||||
|
|
@ -4941,7 +4941,7 @@ in SWIG-1.3.26. and later.</p>
|
||||||
SWIG automatically keeps track of mappings between C++ objects and Ruby
|
SWIG automatically keeps track of mappings between C++ objects and Ruby
|
||||||
objects. Note that enabling object tracking causes a slight performance
|
objects. Note that enabling object tracking causes a slight performance
|
||||||
degradation. Test results show this degradation to be about 3% to 5%
|
degradation. Test results show this degradation to be about 3% to 5%
|
||||||
when creating and destroying 100, 000 animals in a row.</p>
|
when creating and destroying 100,000 animals in a row.</p>
|
||||||
|
|
||||||
<p>Since <tt>%trackobjects</tt> is implemented as a <tt>%feature</tt>,
|
<p>Since <tt>%trackobjects</tt> is implemented as a <tt>%feature</tt>,
|
||||||
it uses the same name matching rules as other kinds of features (see
|
it uses the same name matching rules as other kinds of features (see
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue