[Vala] How to include C headers into Vala code?


I have the simple question. Imagine That we have a vala CLI
application... for example like this:

//----- Main.vala -------
using GLib;
class cli_hello : Glib.Object {
  void print_default_hello () {
    stdout.printf("Hello world!\n");

  static int main (string[] args)
    var hello = new cli_hello();
    return 0;

And I wand to add new method to my cli_hello class. And this method
needs the C header file... for example <sys/socket.h>, and use C
function in my Vala application.
Is it possible, how could i do that? How the code will be changed?

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