Re: [Vala] passing string length in VAPI file
- From: Andre Masella <andre masella name>
- To: rastersoft <raster rastersoft com>
- Cc: Vala List <vala-list gnome org>
- Subject: Re: [Vala] passing string length in VAPI file
- Date: Fri, 6 Dec 2013 09:02:50 -0800
An intermediate function is the typical way to do it. You can also bind it
as `uint8[]` array and pass `string.data`. If the inner function is marked
`private` it won't appear in the generated ValaDoc. There's lots of this in
`glib-2.0.vapi`.
On 6 December 2013 07:38, rastersoft <raster rastersoft com> wrote:
Hi all:
I'm completing the XCB api for Vala, but I have a problem: there are
several functions that receive a string and its length, like:
xcb_intern_atom (xcb_connection_t *_conn_, uint8_t _only_if_exists_,
uint16_t _name_len_, const char *_name_);
Currently I'm doing it this way, by defining an intermediate function:
[CCode (cname = "xcb_intern_atom")]
public InternAtomCookie *l_intern_atom(bool only_if_exists,uint16
len, string name);
[CCode (cname = "vala_xcb_intern_atom")]
public InternAtomCookie *intern_atom(bool only_if_exists,string
name) {
this.l_intern_atom(only_if_exists,(uint16)name.length, name);
}
But it's not very elegant. Is there a way of doing this directly in a VAPI
file?
I tried with array_length_pos, but seems to not work in this case.
Thanks.
--
Nos leemos
RASTER (Linux user #228804)
raster rastersoft com http://www.rastersoft.com
_______________________________________________
vala-list mailing list
vala-list gnome org
https://mail.gnome.org/mailman/listinfo/vala-list
--
--Andre Masella<andre masella name>
http://www.masella.name/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]