typemap m3wrapargconst allow definition of local constants

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6617 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
amigalemming 2004-11-02 15:35:07 +00:00
commit 15dedcc7d4
2 changed files with 41 additions and 8 deletions

View file

@ -146,7 +146,7 @@ On the one hand Modula-3 can be safe
while providing much static and dynamic safety.
On the other hand you can write efficient
but less safe code in the style of C
within UNSAFE modules.
within <tt>UNSAFE</tt> modules.
<p>
Unfortunately Modula's safety and strength
@ -187,7 +187,7 @@ and the low level of the C libraries.
SWIG converts C headers to Modula-3 interfaces for you.
You could call the C functions without loss
of efficiency but it won't be joy
because you could not pass TEXTs
because you could not pass <tt>TEXT</tt>s
or open arrays and
you would have to process error return codes
rather then exceptions.
@ -650,11 +650,18 @@ consist of the following parts:
</tr>
<tr>
<td>m3wrapargvar</td>
<td><tt>$1: Ptr := $1_name;</tt></td>
<td><tt>$1: INTEGER := $1_name;</tt></td>
<td>
Declaration of some variables needed for temporary results.
</td>
</tr>
<tr>
<td>m3wrapargconst</td>
<td><tt>$1 = "$1_name";</tt></td>
<td>
Declaration of some constant, maybe for debug purposes.
</td>
</tr>
<tr>
<td>m3wrapargraw</td>
<td><tt>ORD($1_name)</tt></td>
@ -909,6 +916,8 @@ where almost everything is generated by a typemap:
PROCEDURE Name (READONLY str : TEXT := "" )
<I> (* m3wrapoutcheck:throws *)</I>
: NameResult RAISES {E} =
CONST
arg1name = "str"; <I>(* m3wrapargconst *)</I>
VAR
arg0 : C.char_star; <I>(* m3wrapretvar *)</I>
arg1 : C.char_star; <I>(* m3wrapargvar *)</I>