summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/hashfile.h
blob: 23467d17b5d09eb9902d64cbbdeba0bf91fa4405 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*********************************************************************

    hashfile.h

    Code for parsing hash info (*.hsi) files

*********************************************************************/

#ifndef __HASHFILE_H__
#define __HASHFILE_H__

#include "emu.h"
#include "hash.h"


/***************************************************************************
    TYPE DEFINITIONS
***************************************************************************/

typedef struct _hash_info hash_info;
struct _hash_info
{
	char hash[HASH_BUF_SIZE];
	const char *longname;
	const char *manufacturer;
	const char *year;
	const char *playable;
	const char *pcb;
	const char *extrainfo;
};

typedef struct _hash_file hash_file;

typedef void (*hashfile_error_func)(const char *message);



/***************************************************************************
    FUNCTION PROTOTYPES
***************************************************************************/

/* opens a hash file; if is_preload is non-zero, the entire file is preloaded */
hash_file *hashfile_open(const char *sysname, int is_preload, hashfile_error_func error_proc);

/* opens a hash file; if is_preload is non-zero, the entire file is preloaded */
hash_file *hashfile_open_options(core_options *opts, const char *sysname, int is_preload,
	hashfile_error_func error_proc);

/* closes a hash file and associated resources */
void hashfile_close(hash_file *hashfile);

/* looks up information in a hash file */
const hash_info *hashfile_lookup(hash_file *hashfile, const char *hash);

/* performs a syntax check on a hash file */
int hashfile_verify(const char *sysname, void (*error_proc)(const char *message));

/* returns the functions used in this hash file */
unsigned int hashfile_functions_used(hash_file *hashfile, iodevice_t devtype);


#endif /* __HASHFILE_H__ */