Re: [Vala] Adding macros to a vapi for a non-gobject type library



Okay, thanks a lot. That should help me to keep going. I will place this
question directly to the IRC channel as well but is there any chance that
there's a vapi documentation project that's been started that I could offer
to contribute to?

Geoff

On Sat, Dec 10, 2011 at 3:48 PM, Evan Nemerson <evan coeus-group com> wrote:

On Sat, 2011-12-10 at 15:30 -0800, Geoff Johnson wrote:
First off, I've never written a vapi file before so excuse my lack of
understanding. I've started to write a vapi file for the comedi library
which contains several macros for channel setup, for example:

#define CR_PACK(chan,rng,aref) ( (((aref)&0x3)<<24) | (((rng)&0xff)<<16)
|
(chan) )

My question is how are macros represented in a vapi file? Or, is there
some

As methods. I'm not familiar with the comedi library, but from your
description I would guess that this should be a static method in a
Channel class/struct. Something like

[CCode (cname = "CR_PACK")]
public static int pack (int chan, int rng, int aref);

documentation on writing vapi files for non-gobject type libraries? I've
done a fair amount of searching and found some good examples but there's
nothing comprehensive.

There isn't one, though there probably should be (you're not the first
to ask). The IRC channel is generally a good place to get help with this
kind of stuff, though.


-Evan




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]