ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Urlader/urlib.h
Revision: 1.5
Committed: Fri Jan 6 07:56:36 2012 UTC (12 years, 4 months ago) by root
Content type: text/plain
Branch: MAIN
CVS Tags: rel-0_2
Changes since 1.4: +0 -3 lines
Log Message:
*** empty log message ***

File Contents

# Content
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 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 };
17
18 enum
19 {
20 F_LZF = 0x01,
21 F_EXEC = 0x10,
22 F_NULL = 0
23 };
24
25 #define TAIL_MAGIC "ScHmOrp_PaCk_000"
26
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 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 char md5_head[16]; /* md5(urlader) or 0, if there is no checksum */
44 char md5_pack[16]; /* md5(pack) or 0, if there is no checksum */
45 };
46
47 #endif
48