PageRenderTime 46ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

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

#
Swig | 20 lines | 13 code | 7 blank | 0 comment | 0 complexity | 9ae2e7629584c296037cbfbe471097c1 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. %module function_typedef
  2. %inline %{
  3. typedef int binop_t(int, int);
  4. int do_binop1(binop_t f, int x, int y) {
  5. return f(x,y);
  6. }
  7. int do_binop2(binop_t *f, int x, int y) {
  8. return (*f)(x,y);
  9. }
  10. int do_binop3(int f(int,int), int x, int y) {
  11. return f(x,y);
  12. }
  13. %}