Re: [Vala] how vala types are mapped to C ones?



I loocked into a code generated and found that I do not need all the
'new=' stuff in this case.

On Fri, Jan 30, 2009 at 8:57 PM,  <vasaka gmail com> wrote:
---------- Forwarded message ----------
From:  <vasaka gmail com>
Date: Fri, Jan 30, 2009 at 8:53 PM
Subject: Re: [Vala] how vala types are mapped to C ones?
To: Jürg Billeter <j bitron ch>


On Fri, Jan 30, 2009 at 9:52 AM, Jürg Billeter <j bitron ch> wrote:
On Fri, 2009-01-30 at 07:43 +0200, vasaka gmail com wrote:
when writing .vapi file how to handle correctly types like int64_t and char[32]

You can use the Vala type int64 for int64_t. If the name is a UTF-8
compatible NUL-terminated string (ASCII is fine as well), you can just
use `string'. Otherwise, char[] is what you have to use for now.

[...]

and not shure that simple changing char name[32] to char* name and
__u32 to int will produce correct code in most cases.
and what to do with nested structures?

__u32 maps to uint32. Nested structures should work fine in general, let
me know if you have issues.

Jürg



how to handle structs with arrays of fixed length inside? I only see
the way to handle it by  writing something like
this.struct_object.name = new char[32] every time you using this
struct, but this is error prone practice, one can always forget to
init struct field properly

--
Vasily Levin



--
Vasily Levin




-- 
Vasily Levin



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