4 #define ISOTYPE_ILLEGAL 0
7 #define ISOTYPE_AUDIO 3
8 #define ISOTYPE_DVDDL 4
10 #define ISOFLAGS_Z 0x0001
11 #define ISOFLAGS_Z2 0x0002
12 #define ISOFLAGS_BLOCKDUMP 0x0004
13 #define ISOFLAGS_MULTI 0x0008
14 #define ISOFLAGS_BZ2 0x0010
16 #define CD_FRAMESIZE_RAW 2352
17 #define DATA_SIZE (CD_FRAMESIZE_RAW-12)
19 #define itob(i) ((i)/10*16 + (i)%10) /* u_char to BCD */
20 #define btoi(b) ((b)/16*10 + (b)%16) /* BCD to u_char */
51 struct rootDirTocHeader
55 u32 tocLBA_bigend
; //+06
57 u32 tocSize_bigend
; //+0E
58 u8 dateStamp
[8]; //+12
62 } __attribute__((packed
));
75 } __attribute__((packed
));
80 u8 filesystemType
; // 0x01 = ISO9660, 0x02 = Joliet, 0xFF = NULL
81 u8 volID
[5]; // "CD001"
85 u8 volName
[32]; // The ISO9660 Volume Name
87 u32 volSize
; // Volume Size
88 u32 volSizeBig
; // Volume Size Big-Endian
92 u16 volDescSize
; //+80
93 u16 volDescSize_bigend
; //+82
95 u32 unknown3_bigend
; //+88
96 u32 priDirTableLBA
; // LBA of Primary Dir Table //+8C
98 u32 secDirTableLBA
; // LBA of Secondary Dir Table //+94
100 struct rootDirTocHeader rootToc
;
102 s8 publisherName
[128];
103 s8 preparerName
[128];
104 s8 applicationName
[128];
105 s8 copyrightFileName
[37];
106 s8 abstractFileName
[37];
107 s8 bibliographyFileName
[37];
108 struct asciiDate creationDate
;
109 struct asciiDate modificationDate
;
110 struct asciiDate effectiveDate
;
111 struct asciiDate expirationDate
;
114 } __attribute__((packed
));
118 struct isoFile
*isoOpen(const char *filename
);
119 struct isoFile
*isoCreate(const char *filename
, int mode
);
120 int isoSetFormat(struct isoFile
*iso
, int blockofs
, int blocksize
, int blocks
);
121 int isoDetect(struct isoFile
*iso
);
122 int isoReadBlock(struct isoFile
*iso
, u8
*dst
, u32 lsn
);
123 int isoWriteBlock(struct isoFile
*iso
, u8
*src
, u32 lsn
);
124 void isoClose(struct isoFile
*iso
);
125 void print_ps2image_info(const char *image_name
);
126 void prepare_iso(char image_name
[]);
128 void *_openfile(const char *filename
, int flags
);
129 u64
_tellfile(void *handle
);
130 int _seekfile(void *handle
, u64 offset
, int whence
);
131 int _readfile(void *handle
, void *dst
, int size
);
132 int _writefile(void *handle
, void *src
, int size
);
133 void _closefile(void *handle
);
135 #endif /* __LIBISO_H__ */