From: Michele J. <er...@jl...> - 2011-01-14 21:49:44
|
I'm using swig2.0 with perl wrapping C++ on linux. I'm attempting to wrap a library that is not owned by me. After wrapping the C++ header file, I have no problem using the enumerated _values_ (i.e. NorthLinac) in my perl script, but one of the methods requires a BldID as one of the arguments C++: int RFdef::RfName(const char *name, BldID <http://devweb/controls_web/certified/rflib/html/namespaceRFdef.html#a27> &id, unsigned &i, unsigned &j) I'm trying to recreate this test C++ code: const char *name = "1L17-2"; RFdef::BldID id; unsigned i, j; const int got = RFdef::RfName(name, id, i, j); Here's my very simple interface file: %module rfdef %{ #include "../../inc/rfdef.h" typedef enum { Injector=0, NorthLinac, SouthLinac, BldCount } BldID; %} %include "../../inc/rfdef.h" How do I instantiate (in perl) the RFdef::BldID type that the wrapped function expects? Any help would be greatly appreciated. Michele Joyce |