1 |
#ifndef URLIB_H_ |
2 |
#define URLIB_H_ |
3 |
|
4 |
#define URLADER "urlader" |
5 |
#define URLADER_VERSION "1.0" /* a decimal number, not a version string */ |
6 |
|
7 |
#define MAX_ARGC 32 /* maximum number of arguments */ |
8 |
#define MAX_ARGS 256 /* maximum TOTAL length of arguments */ |
9 |
|
10 |
enum |
11 |
{ |
12 |
T_NULL, // 5 |
13 |
T_META, // 1 : exe_id, exe_ver |
14 |
T_ENV, // 2 : name, value |
15 |
T_ARG, // 3 : arg |
16 |
T_DIR, // 4+: path |
17 |
T_FILE, // 4+: path, data |
18 |
T_NUM |
19 |
}; |
20 |
|
21 |
enum |
22 |
{ |
23 |
F_LZF = 0x01, |
24 |
F_EXEC = 0x10, |
25 |
F_NULL = 0 |
26 |
}; |
27 |
|
28 |
#define TAIL_MAGIC "ScHmOrp_PaCk_000" |
29 |
|
30 |
struct u_pack_hdr |
31 |
{ |
32 |
unsigned char type; |
33 |
unsigned char flags; |
34 |
unsigned char namelen[2]; |
35 |
unsigned char datalen[4]; |
36 |
}; |
37 |
|
38 |
#define u_16(ptr) (((ptr)[0] << 8) | (ptr)[1]) |
39 |
#define u_32(ptr) (((ptr)[0] << 24) | ((ptr)[1] << 16) | ((ptr)[2] << 8) | (ptr)[3]) |
40 |
|
41 |
struct u_pack_tail { |
42 |
unsigned char max_uncompressed[4]; /* maximum uncompressed file size */ |
43 |
unsigned char size[4]; /* how many bytes to seke backwards from end(!) of tail */ |
44 |
unsigned char reserved[8]; /* must be 0 */ |
45 |
char magic[16]; |
46 |
char md5_head[16]; /* md5(urlader) or 0, if there is no checksum */ |
47 |
char md5_pack[16]; /* md5(pack) or 0, if there is no checksum */ |
48 |
}; |
49 |
|
50 |
#endif |
51 |
|