#ifndef URLIB_H_ #define URLIB_H_ #define URLADER "urlader" #define URLADER_VERSION "1.0" /* a decimal number, not a version string */ #define MAX_ARGC 32 /* maximum number of arguments */ #define MAX_ARGS 256 /* maximum TOTAL length of arguments */ enum { U_T_NULL, // 5 U_T_META, // 1 : exe_id, exe_ver U_T_ENV, // 2 : name, value U_T_ARG, // 3 : arg U_T_DIR, // 4+: path U_T_FILE, // 4+: path, data U_T_NUM }; enum { U_F_LZF = 0x01, U_F_EXEC = 0x10, U_F_NULL = 0 }; #define TAIL_MAGIC "sChMoRPAcK_0" struct u_pack_hdr { unsigned char type; unsigned char flags; unsigned char namelen[2]; unsigned char datalen[4]; }; #define u_16(ptr) (((ptr)[0] << 8) | (ptr)[1]) #define u_32(ptr) (((ptr)[0] << 24) | ((ptr)[1] << 16) | ((ptr)[2] << 8) | (ptr)[3]) struct u_pack_tail { unsigned char max_filesize[4]; unsigned char size[4]; char magic[12]; }; #endif