match arguments in "later" part of a C function argument list

Andy Tai <[email protected]> Sun, 19 May 2024 23:42:05 -0700
Newsgroups gmane.comp.programming.swig
Message-ID <CAJsg1E_D4r6W-sihM7-YN6PA3DC3S+bvdrYpjTOO3wjr5=Tm+Q@mail.gmail.com>
Hi, can typemaps be used to match "later" parts of the arguments of a
C function?
For example, if I have a C function

void func(int a1, const char *str, size_t size) ;

where the second and the third arguments are meant to pass in a C string.

I find that if I try to apply the typical typemap

%typemap(in) (const char *, size_t) {
  size_t temp;
  $1 = SWIG_Guile_scm2newstr($input,&temp);
  $2 = temp;
}

the output code from SWIG does not seem to recognize the 2nd and 3rd
arguments as meant to be converted from a string in the target script
language for which the binding of the function is being generated.

Any way to do that (or I missed something)?

Thanks for info