Doc update
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5411 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
60c74da9c6
commit
47f612c99a
20 changed files with 760 additions and 488 deletions
|
|
@ -5,7 +5,7 @@
|
|||
</head>
|
||||
|
||||
<body bgcolor="#ffffff">
|
||||
<a name="n1"></a><H1>10 Variable Length Arguments</H1>
|
||||
<a name="n1"></a><H1>11 Variable Length Arguments</H1>
|
||||
<!-- INDEX -->
|
||||
<ul>
|
||||
<li><a href="#n2">Introduction</a>
|
||||
|
|
@ -36,7 +36,7 @@ fact, support for varargs is an often requested feature that was first
|
|||
added in SWIG-1.3.12. Most other wrapper generation tools have
|
||||
wisely chosen to avoid this issue.
|
||||
|
||||
<a name="n2"></a><H2>10.1 Introduction</H2>
|
||||
<a name="n2"></a><H2>11.1 Introduction</H2>
|
||||
|
||||
|
||||
Some C and C++ programs may include functions that accept a variable
|
||||
|
|
@ -122,7 +122,7 @@ List make_list(const char *s, ...) {
|
|||
</pre>
|
||||
</blockquote>
|
||||
|
||||
<a name="n3"></a><H2>10.2 The Problem</H2>
|
||||
<a name="n3"></a><H2>11.2 The Problem</H2>
|
||||
|
||||
|
||||
Generating wrappers for a variable length argument function presents a
|
||||
|
|
@ -203,7 +203,7 @@ varargs support without having to resort to assembly language. However, SWIG
|
|||
can also support real varargs wrapping (with stack-frame manipulation) if you
|
||||
are willing to get hands dirty. Keep reading.
|
||||
|
||||
<a name="n4"></a><H2>10.3 Default varargs support</H2>
|
||||
<a name="n4"></a><H2>11.3 Default varargs support</H2>
|
||||
|
||||
|
||||
When variable length arguments appear in an interface, the default
|
||||
|
|
@ -246,7 +246,7 @@ instance, you could make function calls like this (in Python):
|
|||
|
||||
Notice how string formatting is being done in Python instead of C.
|
||||
|
||||
<a name="n5"></a><H2>10.4 Argument replacement using %varargs</H2>
|
||||
<a name="n5"></a><H2>11.4 Argument replacement using %varargs</H2>
|
||||
|
||||
|
||||
Instead of dropping the variable length arguments, an alternative approach is to replace
|
||||
|
|
@ -298,7 +298,7 @@ Argument replacement is not as useful when working with functions that accept
|
|||
mixed argument types such as <tt>printf()</tt>. Providing general purpose
|
||||
wrappers to such functions presents special problems (covered shortly).
|
||||
|
||||
<a name="n6"></a><H2>10.5 Varargs and typemaps</H2>
|
||||
<a name="n6"></a><H2>11.5 Varargs and typemaps</H2>
|
||||
|
||||
|
||||
Variable length arguments may be used in typemap specifications. For example:
|
||||
|
|
@ -435,7 +435,7 @@ you know for certain that they've had several cups of coffee. If you
|
|||
really want to elevate your guru status and increase your job
|
||||
security, continue to the next section.
|
||||
|
||||
<a name="n7"></a><H2>10.6 Varargs wrapping with libffi</H2>
|
||||
<a name="n7"></a><H2>11.6 Varargs wrapping with libffi</H2>
|
||||
|
||||
|
||||
All of the previous examples have relied on features of SWIG that are
|
||||
|
|
@ -674,7 +674,7 @@ module, we used the special <tt>varargs</tt> variable to get these arguments. M
|
|||
provide an argument number for the first extra argument. This can be used to index into an array of passed arguments to get
|
||||
values. Please consult the chapter on each language module for more details.
|
||||
|
||||
<a name="n8"></a><H2>10.7 Wrapping of va_list</H2>
|
||||
<a name="n8"></a><H2>11.7 Wrapping of va_list</H2>
|
||||
|
||||
|
||||
Closely related to variable length argument wrapping, you may encounter functions that accept a parameter
|
||||
|
|
@ -694,7 +694,7 @@ of a <tt>va_list</tt> structure are closely tied to the underlying
|
|||
call-stack. It's not clear that exporting a <tt>va_list</tt> would
|
||||
have any use or that it would work at all.
|
||||
|
||||
<a name="n9"></a><H2>10.8 C++ Issues</H2>
|
||||
<a name="n9"></a><H2>11.8 C++ Issues</H2>
|
||||
|
||||
|
||||
Wrapping of C++ member functions that accept a variable number of
|
||||
|
|
@ -755,7 +755,7 @@ Given the potential to shoot yourself in the foot, it is probably easier to reco
|
|||
design or to provide an alternative interface using a helper function than it is to create a
|
||||
fully general wrapper to a varargs C++ member function.
|
||||
|
||||
<a name="n10"></a><H2>10.9 Discussion</H2>
|
||||
<a name="n10"></a><H2>11.9 Discussion</H2>
|
||||
|
||||
|
||||
This chapter has provided a number of techniques that can be used to address the problem of variable length
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue