Karsten Ohme wrote:
> I have a C functions which can return the the necessary size of a string
> buffer if the given string buffer is null:
> something like foo(unsigned char **names, int *nameLen)
Use the int *OUTPUT typemaps in typemaps.i.
> In Java A want to give a List an the list should be automatically been
> filled by the wrapper. The wrapper should make the two necessary calls
> and add the
I appreciate you are probably not a native English speaker, but I'm
afraid I can't work out what you are asking here.
> Can I change the return type to void of these functions, because the
> return value is now replaced by exception?
Yes. This was discussed just recently, see mail postings titled "Turning
returns codes into exceptions". This was for C#, but you can do the same
for Java, by modifying the typemaps to the equivalent java typemaps, eg
csout -> javaout.
> What can be the boolean expression after the require and ensure tag? Is
> it any usual C expression. I have to test the input parameters for nun null.
> What exception is throw for it if the contract fails? Can I specify
> another exception?
Not sure I follow again, but %exception or the throws typemap might be
what you are looking for.
> Can I entered somehow debugging statements to the wrapper functions?
> Something like: functions starts here, ends here, the values are ... and
> are set to ...
You can try using %exception, eg