make %callback more uniform and usable

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6435 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2004-10-18 07:35:18 +00:00
commit c7982bbdc8
6 changed files with 35 additions and 16 deletions

View file

@ -8,11 +8,11 @@
extern int do_op(int a, int b, int (*op)(int, int));
/* Now install a bunch of "ops" as constants */
%callback("%(upper)s")
%callback("%(upper)s");
int add(int, int);
int sub(int, int);
int mul(int, int);
%nocallback
%nocallback;
extern int (*funcvar)(int,int);

View file

@ -8,11 +8,11 @@
extern int do_op(int a, int b, int (*op)(int, int));
/* Now install a bunch of "ops" as constants */
%callback("%(upper)s")
%callback("%(upper)s");
int add(int, int);
int sub(int, int);
int mul(int, int);
%nocallback
%nocallback;
extern int (*funcvar)(int,int);

View file

@ -1,14 +1,13 @@
%module callback
%pythoncallback(1);
%pythoncallback(1) foo;
%pythoncallback(1) A::bar;
%pythoncallback(1) A::foom;
%pythoncallback(1) foo_T;
%callback(1) foo;
%callback(1) foof;
%callback(1) A::bar;
%callback(1) A::foom;
%callback("%s_Cb_Ptr") foo_T; // old style, still works.
%inline %{
int foo(int a) {
return a;
}