types.h File Reference

Common type definitions used pervasively in libcdio. More...

#include <cdio/cdio_config.h>

Go to the source code of this file.

Data Structures

struct  msf_s
 MSF (minute/second/frame) structure. More...
union  cdio_cdrom_addr

Defines

#define UINT16_C(c)   c ## U
#define UINT32_C(c)   c ## U
#define UINT64_C(c)   c ## ULL
#define INT64_C(c)   c ## LL
#define false   0
#define true   1
#define bool   uint8_t
#define GNUC_PRINTF(format_idx, arg_idx)
#define GNUC_SCANF(format_idx, arg_idx)
#define GNUC_FORMAT(arg_idx)
#define GNUC_NORETURN
#define GNUC_CONST
#define GNUC_UNUSED
#define GNUC_PACKED
 ISO-9660 longer-format time structure.
#define PRAGMA_BEGIN_PACKED
#define PRAGMA_END_PACKED
#define GNUC_LIKELY(x)   (x)
#define GNUC_UNLIKELY(x)   (x)
#define NULL   ((void*) 0)
#define __cd_offsetof(TYPE, MEMBER)   ((size_t) &((TYPE *)0)->MEMBER)
#define msf_t_SIZEOF   3
#define CDIO_INVALID_SESSION   0xFF
#define CDIO_INVALID_LBA   -45301
#define CDIO_INVALID_LSN   CDIO_INVALID_LBA
#define CDIO_MCN_SIZE   13
#define CDIO_ISRC_SIZE   12

Typedefs

typedef uint8_t ubyte
typedef
typedefPRAGMA_END_PACKED
struct msf_s 
msf_t
typedef char cdio_utf8_t
 UTF-8 char definition.
typedef uint8_t bitfield_t
typedef int32_t lba_t
typedef int32_t lsn_t
typedef uint8_t track_t
typedef uint8_t session_t
typedef char cdio_mcn_t [CDIO_MCN_SIZE+1]
typedef char cdio_isrc_t [CDIO_ISRC_SIZE+1]
typedef int cdio_fs_anal_t

Enumerations

enum  bool_3way_t { nope = 0, yep = 1, dunno = 2 }
enum  cdio_track_flag {
  CDIO_TRACK_FLAG_NONE = 0x00, CDIO_TRACK_FLAG_PRE_EMPHASIS = 0x01, CDIO_TRACK_FLAG_COPY_PERMITTED = 0x02, CDIO_TRACK_FLAG_DATA = 0x04,
  CDIO_TRACK_FLAG_FOUR_CHANNEL_AUDIO = 0x08, CDIO_TRACK_FLAG_SCMS = 0x10
}

Variables

PRAGMA_BEGIN_PACKED struct msf_s GNUC_PACKED
 MSF (minute/second/frame) structure.


Detailed Description

Common type definitions used pervasively in libcdio.


Define Documentation

#define __cd_offsetof ( TYPE,
MEMBER   )     ((size_t) &((TYPE *)0)->MEMBER)

#define bool   uint8_t

#define CDIO_INVALID_LBA   -45301

Constant for invalid LBA. It is 151 less than the most negative LBA -45150. This provide slack for the 150-frame offset in LBA to LSN 150 conversions

#define CDIO_INVALID_LSN   CDIO_INVALID_LBA

Constant for invalid LSN

#define CDIO_INVALID_SESSION   0xFF

Constant for invalid session number

#define CDIO_ISRC_SIZE   12

Number of ASCII bytes in International Standard Recording Codes (ISRC)

#define CDIO_MCN_SIZE   13

Number of ASCII bytes in a media catalog number (MCN).

#define false   0

#define GNUC_CONST

#define GNUC_FORMAT ( arg_idx   ) 

#define GNUC_LIKELY (  )     (x)

#define GNUC_NORETURN

ISO-9660 longer-format time structure.

ISO-9660 Supplementary Volume Descriptor.

ISO-9660 Primary Volume Descriptor.

Format of an ISO-9660 directory record.

Timestamp (ECMA 167r3 1/7.3)

Entity identifier (ECMA 167r3 1/7.4)

Volume Structure Descriptor (ECMA 167r3 2/9.1)

Beginning Extended Area Descriptor (ECMA 167r3 2/9.2)

Terminating Extended Area Descriptor (ECMA 167r3 2/9.3)

Boot Descriptor (ECMA 167r3 2/9.4)

Extent Descriptor (ECMA 167r3 3/7.1)

Descriptor Tag (ECMA 167r3 3/7.2)

NSR Descriptor (ECMA 167r3 3/9.1)

Primary Volume Descriptor (ECMA 167r3 3/10.1)

Anchor Volume Descriptor Pointer (ECMA 167r3 3/10.2)

Volume Descriptor Pointer (ECMA 167r3 3/10.3)

Implementation Use Volume Descriptor (ECMA 167r3 3/10.4)

Partition Descriptor (ECMA 167r3 3/10.5)

Recorded Address (ECMA 167r3 4/7.1)

Short Allocation Descriptor (ECMA 167r3 4/14.14.1)

Long Allocation Descriptor (ECMA 167r3 4/14.14.2)

Logical Volume Descriptor (ECMA 167r3 3/10.6)

Generic Partition Map (ECMA 167r3 3/10.7.1)

Type 1 Partition Map (ECMA 167r3 3/10.7.2)

Type 2 Partition Map (ECMA 167r3 3/10.7.3)

Unallocated Space Descriptor (ECMA 167r3 3/10.8)

Terminating Descriptor (ECMA 167r3 3/10.9)

Logical Volume Integrity Descriptor (ECMA 167r3 3/10.10)

Extended Allocation Descriptor (ECMA 167r3 4/14.14.3)

Descriptor Tag (ECMA 167r3 4/7.2 - See 3/7.2) Tag Identifier (ECMA 167r3 4/7.2.1) File Set Descriptor (ECMA 167r3 4/14.1)

Partition Header Descriptor (ECMA 167r3 4/14.3)

File Identifier Descriptor (ECMA 167r3 4/14.4)

Allocation Ext Descriptor (ECMA 167r3 4/14.5)

ICB Tag (ECMA 167r3 4/14.6)

Indirect Entry (ECMA 167r3 4/14.7)

Terminal Entry (ECMA 167r3 4/14.8)

File Entry (ECMA 167r3 4/14.9)

Extended Attribute Header Descriptor (ECMA 167r3 4/14.10.1)

Generic Format (ECMA 167r3 4/14.10.2)

Character Set Information (ECMA 167r3 4/14.10.3)

File Times Extended Attribute (ECMA 167r3 4/14.10.5)

Information Times Extended Attribute (ECMA 167r3 4/14.10.6)

Device Specification (ECMA 167r3 4/14.10.7)

Implementation Use Extended Attr (ECMA 167r3 4/14.10.8)

Application Use Extended Attribute (ECMA 167r3 4/14.10.9)

Unallocated Space Entry (ECMA 167r3 4/14.11)

Space Bitmap Descriptor (ECMA 167r3 4/14.12)

Partition Integrity Entry (ECMA 167r3 4/14.13)

Long Allocation Descriptor (ECMA 167r3 4/14.14.2) Extended Allocation Descriptor (ECMA 167r3 4/14.14.3) Logical Volume Header Descriptor (ECMA 167r3 4/14.15)

Path Component (ECMA 167r3 4/14.16.1)

File Entry (ECMA 167r3 4/14.17)

Section 8.4.26.1 of ECMA 119. All values are encoded as character arrays, eg. '1', '9', '5', '5' for the year 1955 (no null terminated byte).

See also:
iso9660_ltime
Section 9.1 of ECMA 119.

This structure may have an odd length depending on how many characters there are in the filename! Some compilers (e.g. on Sun3/mc68020) pad the structures to an even length. For this reason, we cannot use sizeof (struct iso_path_table) or sizeof (struct iso_directory_record) to compute on disk sizes. Instead, we use offsetof(..., name) and add the name size. See mkisofs.h of the cdrtools package.

See also:
iso9660_stat
This is used for Joliet Extentions and is almost the same as the the primary descriptor but two unused fields, "unused1" and "unused3 become "flags and "escape_sequences" respectively.

This struct is used by cdio_audio_get_volume and cdio_audio_set_volume

#define GNUC_PRINTF ( format_idx,
arg_idx   ) 

#define GNUC_SCANF ( format_idx,
arg_idx   ) 

#define GNUC_UNLIKELY (  )     (x)

#define GNUC_UNUSED

#define INT64_C (  )     c ## LL

#define msf_t_SIZEOF   3

#define NULL   ((void*) 0)

#define PRAGMA_BEGIN_PACKED

#define PRAGMA_END_PACKED

#define true   1

#define UINT16_C (  )     c ## U

#define UINT32_C (  )     c ## U

#define UINT64_C (  )     c ## ULL


Typedef Documentation

typedef uint8_t bitfield_t

typedef int cdio_fs_anal_t

typedef char cdio_isrc_t[CDIO_ISRC_SIZE+1]

Type to hold ASCII bytes in a media catalog number (MCN). We include an extra 0 byte so these can be used as C strings.

typedef char cdio_mcn_t[CDIO_MCN_SIZE+1]

Type to hold ASCII bytes in a media catalog number (MCN). We include an extra 0 byte so these can be used as C strings.

typedef char cdio_utf8_t

UTF-8 char definition.

Type to denote UTF-8 strings.

typedef int32_t lba_t

The type of a Logical Block Address. We allow for an lba to be negative to be consistent with an lba, although I'm not sure this this is possible.

typedef int32_t lsn_t

The type of a Logical Sector Number. Note that an lba can be negative and the MMC3 specs allow for a conversion of a negative lba.

See also:
msf_t

typedef typedefPRAGMA_END_PACKED struct msf_s msf_t

typedef uint8_t session_t

The type of a session number 0..99.

typedef uint8_t track_t

The type of a track number 0..99.

typedef uint8_t ubyte


Enumeration Type Documentation

Enumerator:
nope 
yep 
dunno 

track flags Q Sub-channel Control Field (4.2.3.3)

Enumerator:
CDIO_TRACK_FLAG_NONE  no flags set
CDIO_TRACK_FLAG_PRE_EMPHASIS  audio track recorded with pre-emphasis
CDIO_TRACK_FLAG_COPY_PERMITTED  digital copy permitted
CDIO_TRACK_FLAG_DATA  data track
CDIO_TRACK_FLAG_FOUR_CHANNEL_AUDIO  4 audio channels
CDIO_TRACK_FLAG_SCMS  SCMS (5.29.2.7)


Variable Documentation

PRAGMA_BEGIN_PACKED struct msf_s GNUC_PACKED

MSF (minute/second/frame) structure.

One CD-ROMs addressing scheme especially used in audio formats (Red Book) is an address by minute, sector and frame which BCD-encoded in three bytes. An alternative format is an lba_t.

Note: the fields in this structure are BCD encoded. Use cdio_to_bcd8() or cdio_from_bcd8() to convert an integer into or out of this format. The format specifier x (not d) can be used if you need to format or print values in this structure.

See also:
lba_t


Generated for libcdio by doxygen 1.5.7.1