Re: [pure-lang-users] C macros
Status: Beta
Brought to you by:
agraef
From: Albert G. <Dr....@t-...> - 2008-08-25 21:18:25
|
Eddie Rucker wrote: > Since aren't too many of these macros, I might could code some of these > by hand while Albert gets SWIG operational. You don't need SWIG for that. Write a little wrapper module which can be loaded in Pure and which in turn links against GSL, then you can add any needed wrappers for symbolic constants and other macros to that module. You already know how to do that. Have a look at the pure_sys_vars function in runtime.cc and how it's called in system.pure, that shows how you can set up a few predefined constant and variable values from corresponding C values. If there's not too many macro definitions then this is the most straightforward way to do it, and you'd probably need that wrapper module for other stuff anyway, like marshalling functions for the datatypes. SWIG is really only needed for wrapping up C++ (or huge C) libraries, since it generates all the necessary declarations and tiny C wrapper functions for you. Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |