-
Notifications
You must be signed in to change notification settings - Fork 1
/
wud.h
32 lines (28 loc) · 852 Bytes
/
wud.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
31
32
typedef struct
{
unsigned int magic0;
unsigned int magic1;
unsigned int sectorSize;
unsigned long long uncompressedSize;
unsigned int flags;
}wuxHeader_t;
typedef struct
{
FILE* fileWud;
long long uncompressedSize;
bool isCompressed;
// data only used when compressed
unsigned int sectorSize;
unsigned int indexTableEntryCount;
unsigned int* indexTable;
long long offsetIndexTable;
long long offsetSectorArray;
}wud_t;
#define WUX_MAGIC_0 '0XUW' // "WUX0"
#define WUX_MAGIC_1 0x1099d02e
// wud and wux functions
wud_t* wud_open(char* path); // handles both, compressed and uncompressed files
void wud_close(wud_t* wud);
unsigned int wud_readData(wud_t* wud, void* buffer, unsigned int length, long long offset);
bool wud_isWUXCompressed(wud_t* wud);
long long wud_getWUDSize(wud_t* wud);