-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcdfh.h
30 lines (24 loc) · 854 Bytes
/
cdfh.h
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
#ifndef _CDFH_H
#define _CDFH_H
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct CDFileHandle {
int32_t (*Seek)(struct CDFileHandle *handle, int32_t offset, int32_t whence);
int32_t (*Tell)(struct CDFileHandle *handle);
int32_t (*Read)(struct CDFileHandle *handle, void *ptr, int32_t size);
uint8_t (*Get)(struct CDFileHandle *handle);
uint8_t (*Eof)(struct CDFileHandle *handle);
int32_t offset; // start block of file
int32_t length; // length of file
int32_t block; // current block in buffer
int32_t pos; // current position in file
} CDFileHandle_t;
extern CDFileHandle_t *cd_handle_from_name(char *name);
extern CDFileHandle_t *cd_handle_from_offset(int32_t offset, int32_t length);
extern void delete_cd_handle(CDFileHandle_t *handle);
#ifdef __cplusplus
}
#endif
#endif