Re: [Vala] Are htons() and atoi() somewhere ?



On Wed, 2007-10-24 at 16:07 +0200, Jürg Billeter wrote:
On Wed, 2007-10-24 at 14:09 +0200, Xavier Bestel wrote:
Now, I'd like to use atoi() and htons[] and friends. Could someone
indicate me how to do that ?

atoi() is bound to string.to_int(), so you can just do something like
that: "some string".to_int() or some_string.to_int()

Nice.

htons and the other byte order conversion functions are not in the
bindings yet, I'm not sure yet where the appropriate place would be. In
the meantime you can add it yourself to glib-2.0.vapi or a custom vapi
file:
[CCode (cname = "g_htons")]
public uint16 htons (uint16 hostshort);

I see. I'll do that kind of thing now.

Thanks,
        Xav





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