3 // GROUPS passed old-abort
4 typedef unsigned char uchar;
5 typedef unsigned short ushort;
6 typedef unsigned long ulong;
7 extern int swap_endian;
9 swapshort(ushort value)
12 return ((value << 8) | (value >> 8));
17 operator ushort() { return swap_endian ? swapshort(data) : data;}
18 eshort(ushort t) { data = swap_endian ? swapshort(t) : t;}
24 ulong v = (value << 16) | (value >> 16);
25 return ((v >> 8) & 0x00ff00ff) | ((v << 8) & 0xff00ff00);
30 operator ulong() { return swap_endian ? swaplong(data) : data;}
31 elong(ulong t) { data = swap_endian ? swaplong(t) : t; }
44 elong startup_code[2];
47 extern void uncompress(uchar* buf, ulong len);
48 extern ulong compress(char* filename, uchar* buffer, ulong);
87 int file_little_endian;
88 int host_little_endian;
93 ulong compression_quality;
96 extern "C" int getopt (int, char**, const char*);
98 main(int argc, char** argv)
115 compression_quality = 10000;
117 while ((c = getopt(argc, argv, "Ccdf:k:q:x:")) != -1)
125 if ((expand && (docheck || compressfile || quality)) ||
126 (quality && !compressfile))
133 dh->image_offset = len;
135 len += compress(compressfile, code + len, maxlen - len);