Arun,

On Fri, Mar 21, 2008 at 10:45 PM, Arun Sharma <[EMAIL PROTECTED]> wrote:
> On Fri, Mar 21, 2008 at 2:19 PM, stephane eranian <[EMAIL PROTECTED]>
> wrote:
>
> > Arun,
> >
> > Not all functions are syscalls here. only the first 12. The others are
> > just library
> > calls.
>
> SWIG doesn't know if they're system calls are not. It just needs to be able
> to tell whether the function succeeded or not.
>
>
> >
> > Is the pfm_err_t  trick, what  they use for the other syscalls?
>
> I think most of the wrappers in python base libraries are hand written C
> (not SWIG generated C).
>
> http://docs.python.org/ext/intro.html
>
This one led me to believe we should define a libpfm exception as shown
in the example: if ret != PFMLIB_SUCCES then raise libpfmError.

> Using typemaps and typedefs is also fairly common. The other method is
> %exception:
>
> http://www.swig.org/Doc1.3/Python.html#Python_nn44
>
This one looks easy to do for the syscall calls, only 12 of them.

> But we'd have to write one exception block per function.
>
Yes, no big deal and it would keep the perfmon.h untouched so it would
not confused C/C++ users.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
perfmon2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel

Reply via email to