ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Urlader/urlib.h
Revision: 1.2
Committed: Mon Jan 2 09:23:04 2012 UTC (12 years, 4 months ago) by root
Content type: text/plain
Branch: MAIN
Changes since 1.1: +10 -10 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
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 root 1.2 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 root 1.1 };
20    
21     enum
22     {
23 root 1.2 F_LZF = 0x01,
24     F_EXEC = 0x10,
25     F_NULL = 0
26 root 1.1 };
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