Back to index

lightdm  1.3.2
x-common.h
Go to the documentation of this file.
00001 #ifndef _X_COMMON_H_
00002 #define _X_COMMON_H_
00003 
00004 #include <glib-object.h>
00005 
00006 G_BEGIN_DECLS
00007 
00008 enum
00009 {
00010     X_BYTE_ORDER_MSB,
00011     X_BYTE_ORDER_LSB
00012 };
00013 
00014 gsize pad (gsize length);
00015 
00016 void read_padding (gsize length, gsize *offset);
00017 
00018 guint8 read_card8 (const guint8 *buffer, gsize buffer_length, gsize *offset);
00019 
00020 guint16 read_card16 (const guint8 *buffer, gsize buffer_length, guint8 byte_order, gsize *offset);
00021 
00022 guint32 read_card32 (const guint8 *buffer, gsize buffer_length, guint8 byte_order, gsize *offset);
00023 
00024 guint8 *read_string8 (const guint8 *buffer, gsize buffer_length, gsize string_length, gsize *offset);
00025 
00026 gchar *read_string (const guint8 *buffer, gsize buffer_length, gsize string_length, gsize *offset);
00027 
00028 gchar *read_padded_string (const guint8 *buffer, gsize buffer_length, gsize string_length, gsize *offset);
00029 
00030 void write_card8 (guint8 *buffer, gsize buffer_length, guint8 value, gsize *offset);
00031 
00032 void write_padding (guint8 *buffer, gsize buffer_length, gsize length, gsize *offset);
00033 
00034 void write_card16 (guint8 *buffer, gsize buffer_length, guint8 byte_order, guint16 value, gsize *offset);
00035 
00036 void write_card32 (guint8 *buffer, gsize buffer_length, guint8 byte_order, guint32 value, gsize *offset);
00037 
00038 void write_string8 (guint8 *buffer, gsize buffer_length, const guint8 *value, gsize value_length, gsize *offset);
00039 
00040 gsize padded_string_length (const gchar *value);
00041 
00042 void write_string (guint8 *buffer, gsize buffer_length, const gchar *value, gsize *offset);
00043 
00044 void write_padded_string (guint8 *buffer, gsize buffer_length, const gchar *value, gsize *offset);
00045 
00046 G_END_DECLS
00047 
00048 #endif /* _X_COMMON_H_ */