Re: g_io_channel
- From: Vivien Malerba <vmalerba gmail com>
- To: "uzytkownik22 gazeta pl" <uzytkownik22 gazeta pl>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: g_io_channel
- Date: Fri, 8 Jul 2005 14:33:59 +0200
On 7/8/05, uzytkownik22 gazeta pl <uzytkownik22 gazeta pl> wrote:
I need to send a data structure over an io_channel. In the
reference
manual, I found that the only available instruction to write data
in a
channel is:
GIOStatus g_io_channel_write_chars (GIOChannel *channel,
const gchar *buf,
gssize count,
gsize *bytes_written,
GError **error);
which needs a gchar* as the input data.. How can I send my data
structure with this command?
g_io_channel_write_chars(channel, (const gchar *)your_struct, sizeof
(your_struct), &written, errors);
Beware however that depending on the contents of your structure, you
may have some problems if you exchange data this way between machines
which do not have the same endian-ness (if it's on the same machine,
then no problem!).
Vivien
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]