![]() |
![]() |
![]() |
libMirage Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
#include <mirage.h> enum MIRAGE_Sector_MCSB; enum MIRAGE_Sector_SubchannelFormat; enum MIRAGE_Sector_ValidData; MIRAGE_Sector; gboolean mirage_sector_feed_data (MIRAGE_Sector *self
,gint address
,GObject *track
,GError **error
); gboolean mirage_sector_get_sector_type (MIRAGE_Sector *self
,gint *type
,GError **error
); gboolean mirage_sector_get_sync (MIRAGE_Sector *self
,guint8 **ret_buf
,gint *ret_len
,GError **error
); gboolean mirage_sector_get_header (MIRAGE_Sector *self
,guint8 **ret_buf
,gint *ret_len
,GError **error
); gboolean mirage_sector_get_subheader (MIRAGE_Sector *self
,guint8 **ret_buf
,gint *ret_len
,GError **error
); gboolean mirage_sector_get_data (MIRAGE_Sector *self
,guint8 **ret_buf
,gint *ret_len
,GError **error
); gboolean mirage_sector_get_edc_ecc (MIRAGE_Sector *self
,guint8 **ret_buf
,gint *ret_len
,GError **error
); gboolean mirage_sector_get_subchannel (MIRAGE_Sector *self
,gint format
,guint8 **ret_buf
,gint *ret_len
,GError **error
);
MIRAGE_Sector object represents a sector. It provides access to the sector data, generating it if needed.
typedef enum { MIRAGE_MCSB_SYNC = 0x80, MIRAGE_MCSB_SUBHEADER = 0x40, MIRAGE_MCSB_HEADER = 0x20, MIRAGE_MCSB_DATA = 0x10, MIRAGE_MCSB_EDC_ECC = 0x08, MIRAGE_MCSB_C2_2 = 0x04, MIRAGE_MCSB_C2_1 = 0x02, } MIRAGE_Sector_MCSB;
Main channel selection flags.
typedef enum { MIRAGE_SUBCHANNEL_PW = 0x01, MIRAGE_SUBCHANNEL_PQ = 0x02, MIRAGE_SUBCHANNEL_RW = 0x03 } MIRAGE_Sector_SubchannelFormat;
Subchannel selection flags.
typedef enum { MIRAGE_VALID_SYNC = 0x01, MIRAGE_VALID_HEADER = 0x02, MIRAGE_VALID_SUBHEADER = 0x04, MIRAGE_VALID_DATA = 0x08, MIRAGE_VALID_EDC_ECC = 0x10, MIRAGE_VALID_SUBCHAN = 0x20, } MIRAGE_Sector_ValidData;
Sector data validity flags.
typedef struct _MIRAGE_Sector MIRAGE_Sector;
Contains private data only, and should be accessed using the functions below.
gboolean mirage_sector_feed_data (MIRAGE_Sector *self
,gint address
,GObject *track
,GError **error
);
Feeds data to sector. It finds appropriate fragment to feed from, reads data into sector object and sets data validity flags.
|
a MIRAGE_Sector |
|
address the sector represents |
|
track the sector belongs to |
|
location to store error, or NULL
|
Returns : |
TRUE on success, FALSE on failure |
gboolean mirage_sector_get_sector_type (MIRAGE_Sector *self
,gint *type
,GError **error
);
Retrieves sector type (track mode); one of MIRAGE_TrackModes.
|
a MIRAGE_Sector |
|
location to store sector type |
|
location to store error, or NULL
|
Returns : |
TRUE on success, FALSE on failure |
gboolean mirage_sector_get_sync (MIRAGE_Sector *self
,guint8 **ret_buf
,gint *ret_len
,GError **error
);
Retrieves sector's sync pattern. The pointer to appropriate location in
sector's data buffer is stored into ret_buf
; as such, it should not be freed.
If sync pattern is not provided by image file(s), it is generated.
gboolean mirage_sector_get_header (MIRAGE_Sector *self
,guint8 **ret_buf
,gint *ret_len
,GError **error
);
Retrieves sector's header. The pointer to appropriate location in
sector's data buffer is stored into ret_buf
; as such, it should not be freed.
If header is not provided by image file(s), it is generated.
gboolean mirage_sector_get_subheader (MIRAGE_Sector *self
,guint8 **ret_buf
,gint *ret_len
,GError **error
);
Retrieves sector's subheader. The pointer to appropriate location in
sector's data buffer is stored into ret_buf
; as such, it should not be freed.
If subheader is not provided by image file(s), it is generated.
gboolean mirage_sector_get_data (MIRAGE_Sector *self
,guint8 **ret_buf
,gint *ret_len
,GError **error
);
Retrieves sector's user data. The pointer to appropriate location in
sector's data buffer is stored into ret_buf
; as such, it should not be freed.
gboolean mirage_sector_get_edc_ecc (MIRAGE_Sector *self
,guint8 **ret_buf
,gint *ret_len
,GError **error
);
Retrieves sector's EDC/ECC data. The pointer to appropriate location in
sector's data buffer is stored into ret_buf
; as such, it should not be freed.
If EDC/ECC data is not provided by image file(s), it is generated.
gboolean mirage_sector_get_subchannel (MIRAGE_Sector *self
,gint format
,guint8 **ret_buf
,gint *ret_len
,GError **error
);
Retrieves sector's subchannel. type
must be one of MIRAGE_Sector_SubchannelFormat.
The pointer to appropriate location in sector's data buffer is stored into
ret_buf
; as such, it should not be freed.
If subchannel is not provided by image file(s), it is generated.