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