| Top |
| enum | MirageSubChannel |
| extern guint16 * | crc16_1021_lut |
| extern guint32 * | crc32_d8018001_lut |
| extern guint8 * | ecma_130_scrambler_lut |
These functions cover various functionality. They are exported because, while primarily designed to be used within libMirage, they could also prove useful to other applications.
#define MIRAGE_CAST_DATA(buf,off,type) (*((type *)(buf+off)))
A macro for easy retrieval of data from (unsigned integer) buffer. Mostly to be used in binary image parsers, for example, to retrieve guint32 or guint16 value from buffer.
#define MIRAGE_CAST_PTR(buf,off,type) ((type)(buf+off))
A macro for easy placing of pointers within (unsigned integer) buffer. Mostly to be used in binary image parsers, for example, to retrieve a string or a structure from buffer.
guint8
mirage_helper_ascii2isrc (gchar c);
Converts ASCII character c
into ISRC character.
gint
mirage_helper_bcd2hex (gint bcd);
Converts bcd-encoded integer into hex-encoded integer.
guint16 mirage_helper_calculate_crc16 (const guint8 *data,guint length,const guint16 *crctab,gboolean reflected,gboolean invert);
Calculates the CRC-16 checksum of the data stored in data
.
guint32 mirage_helper_calculate_crc32_fast (const guint8 *data,guint length,const guint32 *crctab,gboolean reflected,gboolean invert);
Calculates the CRC-32 checksum of the data stored in data
. This is
fast slice-by-8 implementation that processes 8 bytes at a time, and
requires crctab
to be allocating using mirage_helper_init_crc32_lut()
with slice parameter set to 8.
guint32 mirage_helper_calculate_crc32_standard (const guint8 *data,guint length,const guint32 *crctab,gboolean reflected,gboolean invert);
Calculates the CRC-32 checksum of the data stored in data
. This is
standard inplementation that processes 1 byte at a time, and requires
crctab
to be allocated using mirage_helper_init_crc32_lut() with slice
parameter set to 1.