Re: [Vala] Help about write vapi file with c libray



On 26/09/2014 16:09, Matrix wrote:
Hi:

I'm try using Vala to write a GUI serialport tool with libserialport.

I have already have a demo with pure c implenmention.

I'm still working with write vapi file to this lib follow the tutorial
at https://wiki.gnome.org/Projects/Vala/LegacyBindings

but the c struct is init by this form:

enum sp_return sp_get_port_by_name(const char *portname, struct
sp_port **port_ptr);

how do i to write for such form ?
class Port {
  [CCode (cname = "sp_get_port_by_name")]
  static Return get_port_by_name (string portname, out Port);
}

Then:

Port port;
Port.get_port_by_name ("foo", out port);


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