RetroArch
Classes | Macros | Typedefs | Enumerations | Functions | Variables
chd.h File Reference
#include "coretypes.h"
#include <streams/file_stream.h>
Include dependency graph for chd.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _chd_header
 
struct  _chd_verify_result
 

Macros

#define __CHD_H__
 
#define CHD_HEADER_VERSION   5
 
#define CHD_V1_HEADER_SIZE   76
 
#define CHD_V2_HEADER_SIZE   80
 
#define CHD_V3_HEADER_SIZE   120
 
#define CHD_V4_HEADER_SIZE   108
 
#define CHD_V5_HEADER_SIZE   124
 
#define CHD_MAX_HEADER_SIZE   CHD_V5_HEADER_SIZE
 
#define CHD_MD5_BYTES   16
 
#define CHD_SHA1_BYTES   20
 
#define CHDFLAGS_HAS_PARENT   0x00000001
 
#define CHDFLAGS_IS_WRITEABLE   0x00000002
 
#define CHDFLAGS_UNDEFINED   0xfffffffc
 
#define CHDCOMPRESSION_NONE   0
 
#define CHDCOMPRESSION_ZLIB   1
 
#define CHDCOMPRESSION_ZLIB_PLUS   2
 
#define CHDCOMPRESSION_AV   3
 
#define AV_CODEC_COMPRESS_CONFIG   1
 
#define AV_CODEC_DECOMPRESS_CONFIG   2
 
#define CHDMETATAG_WILDCARD   0
 
#define CHD_METAINDEX_APPEND   ((UINT32)-1)
 
#define CHD_MDFLAGS_CHECKSUM   0x01 /* indicates data is checksummed */
 
#define HARD_DISK_METADATA_TAG   0x47444444 /* 'GDDD' */
 
#define HARD_DISK_METADATA_FORMAT   "CYLS:%d,HEADS:%d,SECS:%d,BPS:%d"
 
#define HARD_DISK_IDENT_METADATA_TAG   0x49444e54 /* 'IDNT' */
 
#define HARD_DISK_KEY_METADATA_TAG   0x4b455920 /* 'KEY ' */
 
#define PCMCIA_CIS_METADATA_TAG   0x43495320 /* 'CIS ' */
 
#define CDROM_OLD_METADATA_TAG   0x43484344 /* 'CHCD' */
 
#define CDROM_TRACK_METADATA_TAG   0x43485452 /* 'CHTR' */
 
#define CDROM_TRACK_METADATA_FORMAT   "TRACK:%d TYPE:%s SUBTYPE:%s FRAMES:%d"
 
#define CDROM_TRACK_METADATA2_TAG   0x43485432 /* 'CHT2' */
 
#define CDROM_TRACK_METADATA2_FORMAT   "TRACK:%d TYPE:%s SUBTYPE:%s FRAMES:%d PREGAP:%d PGTYPE:%s PGSUB:%s POSTGAP:%d"
 
#define GDROM_TRACK_METADATA_TAG   0x43484744 /* 'CHTD' */
 
#define GDROM_TRACK_METADATA_FORMAT   "TRACK:%d TYPE:%s SUBTYPE:%s FRAMES:%d PAD:%d PREGAP:%d PGTYPE:%s PGSUB:%s POSTGAP:%d"
 
#define AV_METADATA_TAG   0x41564156 /* 'AVAV' */
 
#define AV_METADATA_FORMAT   "FPS:%d.%06d WIDTH:%d HEIGHT:%d INTERLACED:%d CHANNELS:%d SAMPLERATE:%d"
 
#define AV_LD_METADATA_TAG   0x41564C44 /* 'AVLD' */
 
#define CHD_OPEN_READ   1
 
#define CHD_OPEN_READWRITE   2
 

Typedefs

typedef enum _chd_error chd_error
 
typedef struct _chd_file chd_file
 
typedef struct _chd_header chd_header
 
typedef struct _chd_verify_result chd_verify_result
 

Enumerations

enum  _chd_error {
  CHDERR_NONE, CHDERR_NO_INTERFACE, CHDERR_OUT_OF_MEMORY, CHDERR_INVALID_FILE,
  CHDERR_INVALID_PARAMETER, CHDERR_INVALID_DATA, CHDERR_FILE_NOT_FOUND, CHDERR_REQUIRES_PARENT,
  CHDERR_FILE_NOT_WRITEABLE, CHDERR_READ_ERROR, CHDERR_WRITE_ERROR, CHDERR_CODEC_ERROR,
  CHDERR_INVALID_PARENT, CHDERR_HUNK_OUT_OF_RANGE, CHDERR_DECOMPRESSION_ERROR, CHDERR_COMPRESSION_ERROR,
  CHDERR_CANT_CREATE_FILE, CHDERR_CANT_VERIFY, CHDERR_NOT_SUPPORTED, CHDERR_METADATA_NOT_FOUND,
  CHDERR_INVALID_METADATA_SIZE, CHDERR_UNSUPPORTED_VERSION, CHDERR_VERIFY_INCOMPLETE, CHDERR_INVALID_METADATA,
  CHDERR_INVALID_STATE, CHDERR_OPERATION_PENDING, CHDERR_NO_ASYNC_OPERATION, CHDERR_UNSUPPORTED_FORMAT
}
 

Functions

chd_error chd_open_file (RFILE *file, int mode, chd_file *parent, chd_file **chd)
 
chd_error chd_open (const char *filename, int mode, chd_file *parent, chd_file **chd)
 
chd_error chd_precache (chd_file *chd)
 
void chd_close (chd_file *chd)
 
RFILEchd_core_file (chd_file *chd)
 
const char * chd_error_string (chd_error err)
 
const chd_headerchd_get_header (chd_file *chd)
 
chd_error chd_read (chd_file *chd, UINT32 hunknum, void *buffer)
 
chd_error chd_get_metadata (chd_file *chd, UINT32 searchtag, UINT32 searchindex, void *output, UINT32 outputlen, UINT32 *resultlen, UINT32 *resulttag, UINT8 *resultflags)
 
chd_error chd_codec_config (chd_file *chd, int param, void *config)
 
const char * chd_get_codec_name (UINT32 codec)
 

Variables

const uint8_t s_cd_sync_header [12]
 

Macro Definition Documentation

◆ __CHD_H__

#define __CHD_H__

◆ AV_CODEC_COMPRESS_CONFIG

#define AV_CODEC_COMPRESS_CONFIG   1

◆ AV_CODEC_DECOMPRESS_CONFIG

#define AV_CODEC_DECOMPRESS_CONFIG   2

◆ AV_LD_METADATA_TAG

#define AV_LD_METADATA_TAG   0x41564C44 /* 'AVLD' */

◆ AV_METADATA_FORMAT

#define AV_METADATA_FORMAT   "FPS:%d.%06d WIDTH:%d HEIGHT:%d INTERLACED:%d CHANNELS:%d SAMPLERATE:%d"

◆ AV_METADATA_TAG

#define AV_METADATA_TAG   0x41564156 /* 'AVAV' */

◆ CDROM_OLD_METADATA_TAG

#define CDROM_OLD_METADATA_TAG   0x43484344 /* 'CHCD' */

◆ CDROM_TRACK_METADATA2_FORMAT

#define CDROM_TRACK_METADATA2_FORMAT   "TRACK:%d TYPE:%s SUBTYPE:%s FRAMES:%d PREGAP:%d PGTYPE:%s PGSUB:%s POSTGAP:%d"

◆ CDROM_TRACK_METADATA2_TAG

#define CDROM_TRACK_METADATA2_TAG   0x43485432 /* 'CHT2' */

◆ CDROM_TRACK_METADATA_FORMAT

#define CDROM_TRACK_METADATA_FORMAT   "TRACK:%d TYPE:%s SUBTYPE:%s FRAMES:%d"

◆ CDROM_TRACK_METADATA_TAG

#define CDROM_TRACK_METADATA_TAG   0x43485452 /* 'CHTR' */

◆ CHD_HEADER_VERSION

#define CHD_HEADER_VERSION   5

◆ CHD_MAX_HEADER_SIZE

#define CHD_MAX_HEADER_SIZE   CHD_V5_HEADER_SIZE

◆ CHD_MD5_BYTES

#define CHD_MD5_BYTES   16

◆ CHD_MDFLAGS_CHECKSUM

#define CHD_MDFLAGS_CHECKSUM   0x01 /* indicates data is checksummed */

◆ CHD_METAINDEX_APPEND

#define CHD_METAINDEX_APPEND   ((UINT32)-1)

◆ CHD_OPEN_READ

#define CHD_OPEN_READ   1

◆ CHD_OPEN_READWRITE

#define CHD_OPEN_READWRITE   2

◆ CHD_SHA1_BYTES

#define CHD_SHA1_BYTES   20

◆ CHD_V1_HEADER_SIZE

#define CHD_V1_HEADER_SIZE   76

◆ CHD_V2_HEADER_SIZE

#define CHD_V2_HEADER_SIZE   80

◆ CHD_V3_HEADER_SIZE

#define CHD_V3_HEADER_SIZE   120

◆ CHD_V4_HEADER_SIZE

#define CHD_V4_HEADER_SIZE   108

◆ CHD_V5_HEADER_SIZE

#define CHD_V5_HEADER_SIZE   124

◆ CHDCOMPRESSION_AV

#define CHDCOMPRESSION_AV   3

◆ CHDCOMPRESSION_NONE

#define CHDCOMPRESSION_NONE   0

◆ CHDCOMPRESSION_ZLIB

#define CHDCOMPRESSION_ZLIB   1

◆ CHDCOMPRESSION_ZLIB_PLUS

#define CHDCOMPRESSION_ZLIB_PLUS   2

◆ CHDFLAGS_HAS_PARENT

#define CHDFLAGS_HAS_PARENT   0x00000001

◆ CHDFLAGS_IS_WRITEABLE

#define CHDFLAGS_IS_WRITEABLE   0x00000002

◆ CHDFLAGS_UNDEFINED

#define CHDFLAGS_UNDEFINED   0xfffffffc

◆ CHDMETATAG_WILDCARD

#define CHDMETATAG_WILDCARD   0

◆ GDROM_TRACK_METADATA_FORMAT

#define GDROM_TRACK_METADATA_FORMAT   "TRACK:%d TYPE:%s SUBTYPE:%s FRAMES:%d PAD:%d PREGAP:%d PGTYPE:%s PGSUB:%s POSTGAP:%d"

◆ GDROM_TRACK_METADATA_TAG

#define GDROM_TRACK_METADATA_TAG   0x43484744 /* 'CHTD' */

◆ HARD_DISK_IDENT_METADATA_TAG

#define HARD_DISK_IDENT_METADATA_TAG   0x49444e54 /* 'IDNT' */

◆ HARD_DISK_KEY_METADATA_TAG

#define HARD_DISK_KEY_METADATA_TAG   0x4b455920 /* 'KEY ' */

◆ HARD_DISK_METADATA_FORMAT

#define HARD_DISK_METADATA_FORMAT   "CYLS:%d,HEADS:%d,SECS:%d,BPS:%d"

◆ HARD_DISK_METADATA_TAG

#define HARD_DISK_METADATA_TAG   0x47444444 /* 'GDDD' */

◆ PCMCIA_CIS_METADATA_TAG

#define PCMCIA_CIS_METADATA_TAG   0x43495320 /* 'CIS ' */

Typedef Documentation

◆ chd_error

typedef enum _chd_error chd_error

◆ chd_file

typedef struct _chd_file chd_file

◆ chd_header

typedef struct _chd_header chd_header

◆ chd_verify_result

Enumeration Type Documentation

◆ _chd_error

enum _chd_error
Enumerator
CHDERR_NONE 
CHDERR_NO_INTERFACE 
CHDERR_OUT_OF_MEMORY 
CHDERR_INVALID_FILE 
CHDERR_INVALID_PARAMETER 
CHDERR_INVALID_DATA 
CHDERR_FILE_NOT_FOUND 
CHDERR_REQUIRES_PARENT 
CHDERR_FILE_NOT_WRITEABLE 
CHDERR_READ_ERROR 
CHDERR_WRITE_ERROR 
CHDERR_CODEC_ERROR 
CHDERR_INVALID_PARENT 
CHDERR_HUNK_OUT_OF_RANGE 
CHDERR_DECOMPRESSION_ERROR 
CHDERR_COMPRESSION_ERROR 
CHDERR_CANT_CREATE_FILE 
CHDERR_CANT_VERIFY 
CHDERR_NOT_SUPPORTED 
CHDERR_METADATA_NOT_FOUND 
CHDERR_INVALID_METADATA_SIZE 
CHDERR_UNSUPPORTED_VERSION 
CHDERR_VERIFY_INCOMPLETE 
CHDERR_INVALID_METADATA 
CHDERR_INVALID_STATE 
CHDERR_OPERATION_PENDING 
CHDERR_NO_ASYNC_OPERATION 
CHDERR_UNSUPPORTED_FORMAT 

Function Documentation

◆ chd_close()

void chd_close ( chd_file chd)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ chd_codec_config()

chd_error chd_codec_config ( chd_file chd,
int  param,
void config 
)

◆ chd_core_file()

RFILE* chd_core_file ( chd_file chd)

◆ chd_error_string()

const char* chd_error_string ( chd_error  err)

◆ chd_get_codec_name()

const char* chd_get_codec_name ( UINT32  codec)

◆ chd_get_header()

const chd_header* chd_get_header ( chd_file chd)
Here is the caller graph for this function:

◆ chd_get_metadata()

chd_error chd_get_metadata ( chd_file chd,
UINT32  searchtag,
UINT32  searchindex,
void output,
UINT32  outputlen,
UINT32 resultlen,
UINT32 resulttag,
UINT8 resultflags 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ chd_open()

chd_error chd_open ( const char *  filename,
int  mode,
chd_file parent,
chd_file **  chd 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ chd_open_file()

chd_error chd_open_file ( RFILE file,
int  mode,
chd_file parent,
chd_file **  chd 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ chd_precache()

chd_error chd_precache ( chd_file chd)
Here is the call graph for this function:

◆ chd_read()

chd_error chd_read ( chd_file chd,
UINT32  hunknum,
void buffer 
)
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ s_cd_sync_header

const uint8_t s_cd_sync_header[12]