/* RetroArch - A frontend for libretro.
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see .
*/
#ifndef TASK_DATABASE_CUE
#define TASK_DATABASE_CUE
#include
#include
#include
#include
RETRO_BEGIN_DECLS
struct magic_entry
{
const char *system_name;
const char *magic;
int32_t offset;
};
int detect_ps1_game(intfstream_t *fd, char *s, size_t len,
const char *filename);
int detect_ps2_game(intfstream_t *fd, char *s, size_t len,
const char *filename);
int detect_psp_game(intfstream_t *fd, char *s, size_t len,
const char *filename);
int detect_pbp_game(intfstream_t *fd, char *s, size_t len,
const char *filename);
int detect_3ds_game(intfstream_t *fd, char *s, size_t len);
size_t detect_gc_game(intfstream_t *fd, char *s, size_t len,
const char *filename);
int detect_scd_game(intfstream_t *fd, char *s, size_t len,
const char *filename);
int detect_sat_game(intfstream_t *fd,
char *s, size_t len, const char *filename);
int detect_dc_game(intfstream_t *fd, char *s, size_t len,
const char *filename);
size_t detect_wii_game(intfstream_t *fd, char *s, size_t len,
const char *filename);
int detect_system(intfstream_t *fd, const char **system_name,
const char * filename);
int cue_find_track(const char *cue_path, bool first, uint64_t *offset,
size_t *size, char *s, size_t len);
bool cue_next_file(intfstream_t *fd, const char *cue_path,
char *s, uint64_t len);
int gdi_find_track(const char *gdi_path, bool first, char *s,
size_t len);
size_t gdi_next_file(intfstream_t *fd, const char *gdi_path, char *s,
size_t len);
int intfstream_get_serial(intfstream_t *fd, char *s, size_t len,
const char *filename);
bool intfstream_file_get_serial(const char *name,
uint64_t offset, int64_t size, char *s, size_t len, uint64_t *fsize);
int task_database_cue_get_serial(const char *name, char *s, size_t len,
uint64_t *filesize);
int task_database_gdi_get_serial(const char *name, char *s, size_t len,
uint64_t *filesize);
int task_database_pbp_get_serial(const char *name, char *s, size_t len,
uint64_t *filesize);
int task_database_3ds_get_serial(const char *name, char *s, size_t len,
uint64_t *filesize);
int task_database_ciso_get_serial(const char *name, char *s, size_t len,
uint64_t *filesize);
/* An Xbox or Xbox 360 serial for @name: with @disc that of the disc
* image's game, otherwise that of the executable or package it is.
* @regions gets the XDVDFS_REGION_* the title says it is for, or 0. */
int task_database_xbox_get_serial(const char *name, bool disc, char *s,
size_t len, uint64_t *filesize, uint8_t *regions);
/* The Xbox 360 serial of the game a ZArchive holds, @regions as above */
int task_database_zar_get_serial(const char *name, char *s, size_t len,
uint64_t *filesize, uint8_t *regions);
/* The product code of a Wii U disc, a WUD or a WUX (or a disc image
* by another name), four characters: a release's serial may add the
* maker's two */
int task_database_wiiu_get_serial(const char *name, char *s, size_t len,
uint64_t *filesize);
/* The same for the game a Wii U archive (.wua) holds, @maker getting
* the maker's two characters from its company code, or "" */
int task_database_wua_get_serial(const char *name, char *s, size_t len,
uint64_t *filesize, char *maker);
bool is_chd_file_cdi(const char *path);
/* @regions as for task_database_xbox_get_serial(), for an Xbox disc */
int task_database_chd_get_serial(const char *name, char *serial, size_t len,
uint64_t *filesize, uint8_t *regions);
enum task_database_crc_kind
{
TASK_DATABASE_CRC_FILE = 0,
TASK_DATABASE_CRC_CUE,
TASK_DATABASE_CRC_GDI,
TASK_DATABASE_CRC_CHD
};
intfstream_t *task_database_crc_open(const char *name,
enum task_database_crc_kind kind, int64_t *span, uint64_t *size);
RETRO_END_DECLS
#endif