Kamel:
You can write vapi files with the structures, functions and constants of
every header file.
Here is a little example:
io.vapi:
[[CCode (lower_case_cprefix ="", cheader_filename="sys/io.h")
namespace Io
{
public static int ioperm (ulong from, ulong num, bool turn_on);
public static uchar inb (ushort port);
}
Then use the vapi file with this source:
using GLib;
using Io;
public class Sample : GLib.Object
{
public static void main (string[] args)
{
ioperm (0x0378, 0x0380, true);
uchar a = inb (0x0379);
print ("%d", a);
}
}
Compile the code with:
valac sample.vala --pkg io --vapidir .
I hope that this will be helpful
Matias
_______________________________________________
Vala-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/vala-list