1 |
#ifndef __LIBISO_H__ |
2 |
#define __LIBISO_H__ |
3 |
|
4 |
#ifdef _MSC_VER |
5 |
#pragma warning(disable:4018) |
6 |
#endif |
7 |
|
8 |
#define ISOTYPE_ILLEGAL 0 |
9 |
#define ISOTYPE_CD 1 |
10 |
#define ISOTYPE_DVD 2 |
11 |
#define ISOTYPE_AUDIO 3 |
12 |
|
13 |
#define ISOFLAGS_Z 0x0001 |
14 |
#define ISOFLAGS_Z2 0x0002 |
15 |
#define ISOFLAGS_BLOCKDUMP 0x0004 |
16 |
#define ISOFLAGS_MULTI 0x0008 |
17 |
#define ISOFLAGS_BZ2 0x0010 |
18 |
|
19 |
#define CD_FRAMESIZE_RAW 2352 |
20 |
#define DATA_SIZE (CD_FRAMESIZE_RAW-12) |
21 |
|
22 |
#define itob(i) ((i)/10*16 + (i)%10) /* u_char to BCD */ |
23 |
#define btoi(b) ((b)/16*10 + (b)%16) /* BCD to u_char */ |
24 |
|
25 |
typedef struct |
26 |
{ |
27 |
u32 slsn; |
28 |
u32 elsn; |
29 |
void *handle; |
30 |
} _multih; |
31 |
|
32 |
typedef struct |
33 |
{ |
34 |
char filename[256]; |
35 |
u32 type; |
36 |
u32 flags; |
37 |
u32 offset; |
38 |
u32 blockofs; |
39 |
u32 blocksize; |
40 |
u32 blocks; |
41 |
void *handle; |
42 |
void *htable; |
43 |
char *Ztable; |
44 |
u32 *dtable; |
45 |
int dtablesize; |
46 |
_multih multih[8]; |
47 |
int buflsn; |
48 |
u8 *buffer; |
49 |
} isoFile; |
50 |
|
51 |
|
52 |
isoFile *isoOpen(const char *filename); |
53 |
isoFile *isoCreate(const char *filename, int mode); |
54 |
int isoSetFormat(isoFile *iso, int blockofs, int blocksize, int blocks); |
55 |
int isoDetect(isoFile *iso); |
56 |
int isoReadBlock(isoFile *iso, u8 *dst, int lsn); |
57 |
int isoWriteBlock(isoFile *iso, u8 *src, int lsn); |
58 |
void isoClose(isoFile *iso); |
59 |
|
60 |
void *_openfile(const char *filename, int flags); |
61 |
u32 _tellfile(void *handle); |
62 |
int _seekfile(void *handle, u64 offset, int whence); |
63 |
int _readfile(void *handle, void *dst, int size); |
64 |
int _writefile(void *handle, void *src, int size); |
65 |
void _closefile(void *handle); |
66 |
|
67 |
#endif /* __LIBISO_H__ */ |