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 |
|
|
#define MAX_ARGC 32 /* maximum number of arguments */ |
8 |
|
|
#define MAX_ARGS 256 /* maximum TOTAL length of arguments */ |
9 |
|
|
|
10 |
|
|
enum |
11 |
|
|
{ |
12 |
|
|
U_T_NULL, // 5 |
13 |
|
|
U_T_META, // 1 : exe_id, exe_ver |
14 |
|
|
U_T_ENV, // 2 : name, value |
15 |
|
|
U_T_ARG, // 3 : arg |
16 |
|
|
U_T_DIR, // 4+: path |
17 |
|
|
U_T_FILE, // 4+: path, data |
18 |
|
|
U_T_NUM |
19 |
|
|
}; |
20 |
|
|
|
21 |
|
|
enum |
22 |
|
|
{ |
23 |
|
|
U_F_LZF = 0x01, |
24 |
|
|
U_F_EXEC = 0x10, |
25 |
|
|
U_F_NULL = 0 |
26 |
|
|
}; |
27 |
|
|
|
28 |
|
|
#define TAIL_MAGIC "sChMoRPAcK_0" |
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_filesize[4]; |
43 |
|
|
unsigned char size[4]; |
44 |
|
|
char magic[12]; |
45 |
|
|
}; |
46 |
|
|
|
47 |
|
|
#endif |
48 |
|
|
|