Re: [Vala] Binding questions



Michael B. Trausch wrote:
I actually have an example of this that I ran into today... for
libuuid.  It seems to inject too many parameters.  When I declare:

  [CCode(lower_case_cprefix="uuid_")]
  public static void generate(out char[16] new_uuid);

I call this in Vala like so:

  char[16] uuid;
  LibUUID.generate(out uuid);

When called, Vala writes:

  gint uuid_length1;
  gchar *uuid;
  uuid_generate(&uuid, &uuid_length1);

This should do what you want:

  public static void generate([CCode (array_length = false)] char[]
new_uuid);

and

  char[] uuid = new char[16];
  generate(uuid);



Regards,

Frederik



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