Hi Lyle, On Fri, Feb 14, 2003 at 12:04:04PM -0600, Hayhurst, Lyle wrote: > Hello all. I have a question about automatic function wrappers with > respect to bulk importing a C library. > > I am working with a C library (call it 'LibX') that I want to use in > Perl. The C-Cookbook describes this use case, but only gives an example > for importing one single function from the library. > > What I want to do is programatically bulk import not just every function > but every constant and enumerated type using Inline::C. This is in the > interests of Laziness; there are a lot of functions, and I'm too lazy to > type them all in. Also, since this library is a 3rd party product, the > C code compiles out to multiple architectures, and thus the function > prototypes change according to the architecture. (I'm only interested > in one architecture, but if I ever switch to a different one, it would > be a real hassle to go through and hand change out all of the > prototypes.)
Though I have no experience with it, I'd suggest taking a look at XSBuilder, which is used to generate the Perl interface to Apache2 (mod_perl2). It was explicitly designed for what you are trying to accomplish. http://search.cpan.org/author/GRICHTER/ExtUtils-XSBuilder-0.22/ http://search.cpan.org/author/GRICHTER/ExtUtils-XSBuilder-0.22/XSBuilder.pod Have fun, -Colin.