Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

endian.h File Reference

Go to the source code of this file.

Defines

#define guint64_to_BE(x)   x
#define guint64_to_LE(x)   GUINT64_SWAP_LE_BE(x)
#define READ_GUINT16_LE(a, v)
#define WRITE_GUINT16_LE(v, a)
#define READ_GUINT16_BE(a, v)
#define WRITE_GUINT16_BE(v, a)
#define READ_GUINT32_LE(a, v)
#define READ_GUINT32_BE(a, v)
#define WRITE_GUINT32_LE(v, a)
#define WRITE_GUINT32_BE(v, a)
#define READ_GUINT64_BE(a, v)
#define READ_GUINT64_LE(a, v)
#define WRITE_GUINT64_BE(v, a)
#define WRITE_GUINT64_LE(v, a)

Functions

guint16 peek_be16 (gconstpointer p)
guint32 peek_be32 (gconstpointer p)
guint16 peek_le16 (gconstpointer p)
guint32 peek_le32 (gconstpointer p)
gpointer poke_be16 (gpointer p, guint16 v)
gpointer poke_be32 (gpointer p, guint32 v)
gpointer poke_le16 (gpointer p, guint16 v)
gpointer poke_le32 (gpointer p, guint32 v)


Define Documentation

#define guint64_to_BE  )     x
 

#define guint64_to_LE  )     GUINT64_SWAP_LE_BE(x)
 

#define READ_GUINT16_BE a,
v   ) 
 

Value:

G_STMT_START { \
    STATIC_ASSERT(2 == sizeof (v));     \
    memcpy(&v, a, 2); v = ntohs(v); \
} G_STMT_END

#define READ_GUINT16_LE a,
v   ) 
 

Value:

G_STMT_START { \
    STATIC_ASSERT(2 == sizeof (v));     \
    memcpy(&v, a, 2); v = GUINT16_FROM_LE(v); \
} G_STMT_END

#define READ_GUINT32_BE a,
v   ) 
 

Value:

G_STMT_START { \
    STATIC_ASSERT(4 == sizeof (v));     \
    memcpy(&v, a, 4); v = ntohl(v); \
} G_STMT_END

#define READ_GUINT32_LE a,
v   ) 
 

Value:

G_STMT_START { \
    STATIC_ASSERT(4 == sizeof (v));     \
    memcpy(&v, a, 4); v = GUINT32_FROM_LE(v); \
} G_STMT_END

#define READ_GUINT64_BE a,
v   ) 
 

Value:

G_STMT_START { \
    STATIC_ASSERT(8 == sizeof (v));     \
    memcpy(&v, a, 8); v = guint64_to_BE(v); \
} G_STMT_END

#define READ_GUINT64_LE a,
v   ) 
 

Value:

G_STMT_START { \
    STATIC_ASSERT(8 == sizeof (v));     \
    memcpy(&v, a, 8); v = guint64_to_LE(v); \
} G_STMT_END

#define WRITE_GUINT16_BE v,
 ) 
 

Value:

G_STMT_START { \
    guint16 _v = htons(v); memcpy(a, &_v, 2); \
} G_STMT_END

#define WRITE_GUINT16_LE v,
 ) 
 

Value:

G_STMT_START { \
    guint16 _v = GUINT16_TO_LE(v); memcpy(a, &_v, 2); \
} G_STMT_END

#define WRITE_GUINT32_BE v,
 ) 
 

Value:

G_STMT_START { \
    guint32 _v = htonl(v); memcpy(a, &_v, 4); \
} G_STMT_END

#define WRITE_GUINT32_LE v,
 ) 
 

Value:

G_STMT_START { \
    guint32 _v = GUINT32_TO_LE(v); memcpy(a, &_v, 4); \
} G_STMT_END

#define WRITE_GUINT64_BE v,
 ) 
 

Value:

G_STMT_START { \
    guint64 _v = guint64_to_BE(v); memcpy(a, &_v, sizeof _v); \
} G_STMT_END

#define WRITE_GUINT64_LE v,
 ) 
 

Value:

G_STMT_START { \
    guint64 _v = guint64_to_LE(v); memcpy(a, &_v, sizeof _v); \
} G_STMT_END


Function Documentation

guint16 peek_be16 gconstpointer  p  )  [inline, static]
 

guint32 peek_be32 gconstpointer  p  )  [inline, static]
 

guint16 peek_le16 gconstpointer  p  )  [inline, static]
 

guint32 peek_le32 gconstpointer  p  )  [inline, static]
 

gpointer poke_be16 gpointer  p,
guint16  v
[inline, static]
 

gpointer poke_be32 gpointer  p,
guint32  v
[inline, static]
 

gpointer poke_le16 gpointer  p,
guint16  v
[inline, static]
 

gpointer poke_le32 gpointer  p,
guint32  v
[inline, static]
 


Generated on Sun Feb 12 10:50:00 2006 for Gtk-Gnutella by doxygen 1.3.6