Doc update
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5411 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
01926d2f67
commit
eca80d3999
20 changed files with 760 additions and 488 deletions
|
|
@ -5,7 +5,7 @@
|
|||
</head>
|
||||
|
||||
<body bgcolor="#ffffff">
|
||||
<a name="n1"></a><H1>12 SWIG library</H1>
|
||||
<a name="n1"></a><H1>13 SWIG library</H1>
|
||||
<!-- INDEX -->
|
||||
<ul>
|
||||
<li><a href="#n2">The %include directive and library search path</a>
|
||||
|
|
@ -50,7 +50,7 @@ these files are now deprecated and have been removed from the distribution.
|
|||
Alternative libraries provide similar functionality. Please read this chapter
|
||||
carefully if you used the old libraries.
|
||||
|
||||
<a name="n2"></a><H2>12.1 The %include directive and library search path</H2>
|
||||
<a name="n2"></a><H2>13.1 The %include directive and library search path</H2>
|
||||
|
||||
|
||||
Library files are included using the <tt>%include</tt> directive.
|
||||
|
|
@ -73,7 +73,7 @@ for language-specific implementations of library files.
|
|||
You can override the location of the SWIG library by setting the
|
||||
<tt>SWIG_LIB</tt> environment variable.<p>
|
||||
|
||||
<a name="n3"></a><H2>12.2 C Arrays and Pointers</H2>
|
||||
<a name="n3"></a><H2>13.2 C Arrays and Pointers</H2>
|
||||
|
||||
|
||||
This section describes library modules for manipulating low-level C arrays and pointers.
|
||||
|
|
@ -83,7 +83,7 @@ used to allocate memory, manufacture pointers, dereference memory, and wrap
|
|||
pointers as class-like objects. Since these functions provide direct access to
|
||||
memory, their use is potentially unsafe and you should exercise caution.
|
||||
|
||||
<a name="n4"></a><H3>12.2.1 cpointer.i</H3>
|
||||
<a name="n4"></a><H3>13.2.1 cpointer.i</H3>
|
||||
|
||||
|
||||
The <tt>cpointer.i</tt> module defines macros that can be used to used
|
||||
|
|
@ -250,7 +250,7 @@ In this example, the function <tt>int_to_uint()</tt> would be used to cast type
|
|||
<P>
|
||||
<b>Note:</b> When working with simple pointers, typemaps can often be used to provide more seamless operation.
|
||||
|
||||
<a name="n5"></a><H3>12.2.2 carrays.i</H3>
|
||||
<a name="n5"></a><H3>13.2.2 carrays.i</H3>
|
||||
|
||||
|
||||
This module defines macros that assist in wrapping ordinary C pointers as arrays.
|
||||
|
|
@ -395,7 +395,7 @@ you should consider using a special array object rather than a bare pointer.
|
|||
<b>Note:</b> <tt>%array_functions()</tt> and <tt>%array_class()</tt> should not be
|
||||
used with types of <tt>char</tt> or <tt>char *</tt>.
|
||||
|
||||
<a name="n6"></a><H3>12.2.3 cmalloc.i</H3>
|
||||
<a name="n6"></a><H3>13.2.3 cmalloc.i</H3>
|
||||
|
||||
|
||||
This module defines macros for wrapping the low-level C memory allocation functions
|
||||
|
|
@ -507,7 +507,7 @@ Now, in a script:
|
|||
</pre>
|
||||
</blockquote>
|
||||
|
||||
<a name="n7"></a><H3>12.2.4 cdata.i</H3>
|
||||
<a name="n7"></a><H3>13.2.4 cdata.i</H3>
|
||||
|
||||
|
||||
The <tt>cdata.i</tt> module defines functions for converting raw C data to and from strings
|
||||
|
|
@ -580,7 +580,7 @@ char *cdata_<em>name</em>(int nitems)
|
|||
<b>Note:</b> These functions provide direct access to memory and can be used to overwrite data.
|
||||
Clearly they are unsafe.
|
||||
|
||||
<a name="n8"></a><H2>12.3 C String Handling</H2>
|
||||
<a name="n8"></a><H2>13.3 C String Handling</H2>
|
||||
|
||||
|
||||
A common problem when working with C programs is dealing with
|
||||
|
|
@ -597,7 +597,7 @@ well-known. However, SWIG is not in the business of enforcing
|
|||
morality. The modules in this section provide basic functionality
|
||||
for manipulating raw C strings.
|
||||
|
||||
<a name="n9"></a><H3>12.3.1 Default string handling</H3>
|
||||
<a name="n9"></a><H3>13.3.1 Default string handling</H3>
|
||||
|
||||
|
||||
Suppose you have a C function with this prototype:
|
||||
|
|
@ -631,7 +631,7 @@ a <tt>char *</tt> argument points to data inside the target language, it is
|
|||
interpreter and lead to a crash). Furthermore, the default behavior does
|
||||
not work well with binary data. Instead, strings are assumed to be NULL-terminated.
|
||||
|
||||
<a name="n10"></a><H3>12.3.2 Passing binary data</H3>
|
||||
<a name="n10"></a><H3>13.3.2 Passing binary data</H3>
|
||||
|
||||
|
||||
If you have a function that expects binary data,
|
||||
|
|
@ -664,7 +664,7 @@ Now, in the target language, you can use binary string data like this:
|
|||
|
||||
In the wrapper function, the passed string will be expanded to a pointer and length parameter.
|
||||
|
||||
<a name="n11"></a><H3>12.3.3 Using %newobject to release memory</H3>
|
||||
<a name="n11"></a><H3>13.3.3 Using %newobject to release memory</H3>
|
||||
|
||||
|
||||
If you have a function that allocates memory like this,
|
||||
|
|
@ -695,7 +695,7 @@ char *foo();
|
|||
|
||||
This will release the result.
|
||||
|
||||
<a name="n12"></a><H3>12.3.4 cstring.i</H3>
|
||||
<a name="n12"></a><H3>13.3.4 cstring.i</H3>
|
||||
|
||||
|
||||
The <tt>cstring.i</tt> library file provides a collection of macros
|
||||
|
|
@ -1066,14 +1066,14 @@ allocation. If using ANSI C, the library uses <tt>malloc()</tt> and <tt>free()<
|
|||
structure or class instead.
|
||||
</ul>
|
||||
|
||||
<a name="n13"></a><H2>12.4 C++ Library</H2>
|
||||
<a name="n13"></a><H2>13.4 C++ Library</H2>
|
||||
|
||||
|
||||
The library modules in this section provide access to parts of the standard C++ library.
|
||||
All of these modules are new in SWIG-1.3.12 and are only the beginning phase of more complete
|
||||
C++ library support including support for the STL.
|
||||
|
||||
<a name="n14"></a><H3>12.4.1 std_string.i</H3>
|
||||
<a name="n14"></a><H3>13.4.1 std_string.i</H3>
|
||||
|
||||
|
||||
The <tt>std_string.i</tt> library provides typemaps for converting C++ <tt>std::string</tt>
|
||||
|
|
@ -1121,7 +1121,7 @@ void foo(string s, const String &t); // std_string typemaps still applied
|
|||
<b>Note:</b> The <tt>std_string</tt> library is incompatible with Perl on some platforms.
|
||||
We're looking into it.
|
||||
|
||||
<a name="n15"></a><H3>12.4.2 std_vector.i</H3>
|
||||
<a name="n15"></a><H3>13.4.2 std_vector.i</H3>
|
||||
|
||||
|
||||
The <tt>std_vector.i</tt> library provides support for the C++ <tt>vector</tt> class in the STL.
|
||||
|
|
@ -1290,10 +1290,10 @@ details and the public API exposed to the interpreter vary.
|
|||
<b>Note:</b> <tt>std_vector.i</tt> was written by Luigi "The Amazing" Ballabio.
|
||||
|
||||
|
||||
<a name="n16"></a><H2>12.5 Utility Libraries</H2>
|
||||
<a name="n16"></a><H2>13.5 Utility Libraries</H2>
|
||||
|
||||
|
||||
<a name="n17"></a><H3>12.5.1 exception.i</H3>
|
||||
<a name="n17"></a><H3>13.5.1 exception.i</H3>
|
||||
|
||||
|
||||
The <tt>exception.i</tt> library provides a language-independent function for raising a run-time
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue