-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfpack.h
More file actions
29 lines (23 loc) · 758 Bytes
/
Copy pathfpack.h
File metadata and controls
29 lines (23 loc) · 758 Bytes
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
#ifndef fpack_h
#define fpack_h
#include <stdint.h>
#ifndef _MSC_VER
#define PACKED __attribute__((packed))
#else
#pragma pack(push, 1)
#define PACKED
#endif
typedef struct {
char signature[4]; // 'FPAK'
uint32_t files_count; // Number of files in the archive
} PACKED fpack_header_t;
typedef struct {
char filename[16]; // Filename (null-terminated, max 15 chars + null terminator)
uint32_t offset; // Offset in the archive where the file data starts
uint32_t size; // Size of the file data, if compressed, this is the compressed size
// decompressed size can be derived from the first 4 bytes of the file data
} PACKED fpack_file_entry_t;
#ifdef _MSC_VER
#pragma pack(pop)
#endif
#endif // fpack.h