/tags/rel-1.3.35/Examples/test-suite/typemap_numinputs.i

# · Swig · 37 lines · 30 code · 7 blank · 0 comment · 0 complexity · 560bc05f246a18d322327535119c44d9 MD5 · raw file

  1. %module typemap_numinputs
  2. %typemap(in, numinputs=1) (char *STR, int LEN)(int temp = 0)
  3. {
  4. temp = 1;
  5. $2 = 0;
  6. $1 = 0;
  7. }
  8. %typemap(in) (int *OUTPUT) (int temp = 0)
  9. {
  10. temp = 2;
  11. $1 = &temp;
  12. }
  13. %typemap(argout) (int *OUTPUT)
  14. {
  15. ++temp$argnum;
  16. }
  17. %typemap(argout, numinputs=1) (char *STR, int LEN)
  18. {
  19. ++temp$argnum;
  20. }
  21. %typemap(in) int hello
  22. {
  23. $1 = 0;
  24. }
  25. %inline %{
  26. int this_breaks(int hello, char *STR, int LEN, int *OUTPUT)
  27. {
  28. return LEN;
  29. }
  30. %}