-
Notifications
You must be signed in to change notification settings - Fork 2
/
pbo.h
54 lines (47 loc) · 1.47 KB
/
pbo.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef __PBO_H__
#define __PBO_H__
#include <cstdio>
using namespace std;
#include <boost/filesystem.hpp>
using namespace boost::filesystem;
#include <boost/algorithm/string.hpp>
using namespace boost::algorithm;
#ifndef _NIX
#include <windows.h>
#else
typedef unsigned char BYTE; // 8-bit unsigned entity.
typedef BYTE * PBYTE; // Pointer to BYTE.
#endif
// PBO Extract status
#define STATUS_HEADER 0
#define STATUS_FILECOUNT 1
#define STATUS_FILETABLE 2
#define STATUS_DONE 3
#define FNAMELEN 512 // Max length of filenames
#define PREFIXFILE "$PBOPREFIX$" // File name to store pbo prefix in
#define EXCLUDEFILE "$EXCLUDE$" // File name with exluded extensions
#define VERSIONSTRING "cpbo v2.13 by Kegetys"
#define EX_NUM 256 // Max number of excludes
#define EX_LEN 256 // Max exclude length
// Function prototypes
bool pboEx(char *sf, char *dd, bool overwrite, bool gui);
bool pboPack(char *sd, char *df, bool overwrite);
bool pboDecompress(BYTE *buf, BYTE *out, int size, int outSize);
// PBO entry without null terminated string
typedef struct {
// null terminated string here
unsigned int PackingMethod;
unsigned int OriginalSize;
unsigned int Reserved;
unsigned int TimeStamp;
unsigned int DataSize;
} PBOENTRY;
// Table used to store pbo filename table
typedef struct {
char fname[FNAMELEN];
unsigned int len;
unsigned int timestamp;
unsigned int origsize; // 0 = not compressed
bool extract;
} FTENTRY;
#endif