Added .cvsignore.
|
|
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
|
Makefile.dep
contrib
work
Makefile
config.h
dact.conf
config.log
config.cache
config.status
dact
|
Added .dact.c.swp.
cannot compute difference between binary files
Added AUTHORS.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
Roy Keene <dact@rkeene.org>
Idea, primary maintainer.
dact.[ch], comp_plain.[ch], comp_delta.[ch], buffer.[ch],
comp_luck.[ch], comp_zlib.[ch].
Jay Freeman <saurik@saurik.com>
CVS help, build scripts, man page.
Various patches (strsep(), patch-magic-file).
Toby Collier <tcollier@indifferent.com>
README, ChangeLog
Daniel Vignes <dvignes@mac.com>
int_sort:sort.[ch]
|
Added CVS/Entries.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
/LICENSE/1.2/Sat Sep 23 03:32:32 2000//
D/Docs////
D/comp_range////
/comp_bzlib.lnk/1.1/Mon Sep 25 09:26:20 2000//
/comp_mzlib.lnk/1.1/Mon Sep 25 09:26:20 2000//
/comp_mzlib2.lnk/1.1/Mon Sep 25 09:26:20 2000//
/comp_zlib.lnk/1.1/Mon Sep 25 09:26:20 2000//
/install-sh/1.1/Mon Sep 25 08:20:28 2000//
/.cvsignore/1.6/Tue Oct 10 15:39:51 2000//
/INSTALL/1.1/Sat Mar 24 15:33:16 2001//
/makesnapshot.sh/1.1/Sun Apr 22 00:56:57 2001//
/buffer.h/1.7/Mon Sep 10 02:52:37 2001//
/comp_bitsums.h/1.4/Mon Sep 10 02:52:37 2001//
/comp_bzlib.h/1.5/Mon Sep 10 02:52:37 2001//
/comp_delta.h/1.6/Mon Sep 10 02:52:37 2001//
/comp_factor.h/1.5/Mon Sep 10 02:52:37 2001//
/comp_fail.h/1.4/Mon Sep 10 02:52:37 2001//
/comp_mzlib.h/1.6/Mon Sep 10 02:52:37 2001//
/comp_mzlib2.h/1.6/Mon Sep 10 02:52:37 2001//
/comp_plain.h/1.4/Mon Sep 10 02:52:37 2001//
/comp_rle.h/1.6/Mon Sep 10 02:52:37 2001//
/comp_snibble.h/1.5/Mon Sep 10 02:52:37 2001//
/comp_text.h/1.6/Mon Sep 10 02:52:37 2001//
/crc.c/1.2/Mon Sep 10 02:52:37 2001//
/crc.h/1.3/Mon Sep 10 02:52:37 2001//
/math.h/1.3/Mon Sep 10 02:52:37 2001//
/sort.h/1.7/Mon Sep 10 02:52:37 2001//
/stdint.h/1.8/Mon Sep 10 02:52:37 2001//
/strsep.c/1.2/Mon Sep 10 02:52:37 2001//
/strsep.h/1.3/Mon Sep 10 02:52:37 2001//
/AUTHORS/1.9/Mon Sep 10 02:52:37 2001//
/ChangeLog/1.15/Mon Sep 10 02:52:37 2001//
/header.h/1.3/Sun Dec 2 23:52:28 2001//
/dendian.h/1.4/Sun Mar 3 21:23:18 2002//
/getopt.c/1.1/Wed Mar 6 19:51:59 2002//
/getopt.h/1.1/Wed Mar 6 19:51:59 2002//
/patch-magic-file/1.8/Mon Mar 4 16:13:06 2002//
/comp_textrle.h/1.1/Thu Apr 18 00:06:27 2002//
/cipher_serpent.h/1.2/Sat Jul 6 02:39:37 2002//
/ciphers.h/1.6/Sat Jul 6 02:54:30 2002//
/TODO/1.13/Sat Jul 6 03:12:39 2002//
/cipher_chaos.h/1.5/Sat Jul 6 05:51:10 2002//
/cipher_sub.h/1.5/Sat Jul 6 05:51:54 2002//
/comp_zlib.h/1.8/Fri Aug 30 05:19:50 2002//
/README/1.18/Thu Aug 29 17:54:16 2002//
/buffer.c/1.14/Thu Aug 29 16:37:48 2002//
/cipher_serpent.c/1.3/Thu Aug 29 16:05:09 2002//
/cipher_sub.c/1.12/Mon Sep 30 19:32:57 2002//
/comp_bitsums.c/1.7/Thu Aug 29 16:06:23 2002//
/comp_delta.c/1.11/Thu Aug 29 16:07:10 2002//
/comp_factor.c/1.9/Thu Aug 29 16:07:32 2002//
/comp_fail.c/1.6/Thu Aug 29 16:07:51 2002//
/comp_mzlib.c/1.12/Thu Aug 29 16:08:50 2002//
/comp_plain.c/1.8/Thu Aug 29 16:10:23 2002//
/comp_rle.c/1.13/Thu Aug 29 16:10:50 2002//
/comp_snibble.c/1.10/Thu Aug 29 16:11:23 2002//
/comp_text.c/1.10/Thu Aug 29 16:12:30 2002//
/comp_textrle.c/1.3/Thu Aug 29 16:12:56 2002//
/dendian.c/1.5/Thu Aug 29 16:55:32 2002//
/header.c/1.5/Thu Aug 29 16:16:04 2002//
/net.h/1.8/Thu Aug 29 16:57:14 2002//
/parse.h/1.13/Thu Aug 29 16:58:11 2002//
/sort.c/1.12/Thu Aug 29 16:19:25 2002//
/cipher_chaos.c/1.6/Fri Sep 27 04:29:51 2002//
/cipher_psub.c/1.3/Thu Aug 29 17:04:58 2002//
/cipher_psub.h/1.3/Thu Aug 29 16:52:50 2002//
/comp_mzlib2.c/1.15/Mon Sep 30 19:43:15 2002//
/comp_zlib.c/1.15/Mon Sep 30 19:00:50 2002//
/makearch.sh/1.5/Thu Aug 29 17:53:24 2002//
/net.c/1.13/Fri Sep 27 05:57:22 2002//
/ui.c/1.5/Mon Sep 30 19:38:30 2002//
/ui.h/1.4/Mon Sep 30 19:29:44 2002//
/win32.h/1.1/Fri Aug 30 02:56:52 2002//
/parse.c/1.22/Mon Sep 30 20:29:50 2002//
/comp_lzooy.lnk/1.1/Tue Oct 1 06:15:16 2002//
/comp_lzoox.lnk/1.1/Tue Oct 1 04:51:01 2002//
/comp_lzooy.h/1.1/Tue Oct 1 06:26:56 2002//
/comp_lzooy.c/1.1/Tue Oct 1 06:33:25 2002//
/comp_lzota.c/1.1/Tue Oct 1 06:30:45 2002//
/comp_lzota.h/1.1/Tue Oct 1 06:31:21 2002//
/comp_lzota.lnk/1.1/Tue Oct 1 06:29:37 2002//
/aclocal.m4/1.17/Tue Oct 1 05:53:03 2002//
/acconfig.h/1.13/Tue Oct 1 02:42:22 2002//
/algorithms.h/1.21/Tue Oct 1 06:31:49 2002//
/module.h/1.7/Tue Oct 1 06:57:25 2002//
/module.c/1.13/Tue Oct 1 07:31:09 2002//
/configure.in/1.17/Tue Oct 1 07:14:16 2002//
/config.h.in/1.19/Tue Oct 1 07:14:50 2002//
/configure/1.27/Tue Oct 1 07:38:16 2002//
/Makefile.in/1.44/Tue Oct 1 07:36:34 2002//
/dact.c/1.54/Tue Oct 1 07:37:59 2002//
/comp_bzlib.c/1.10/Tue Oct 1 08:09:50 2002//
/dact.h/1.46/Tue Oct 1 08:14:45 2002//
/comp_lzoox.h/1.1/Tue Oct 1 06:27:09 2002//
/comp_lzoox.c/1.1/Tue Oct 1 06:15:26 2002//
|
Added CVS/Repository.
Added CVS/Root.
|
|
>
|
1
|
:pserver:rkeene@cvs.saurik.com:/cvs/dact
|
Added ChangeLog.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
20040220
* Moved LZO-* out of DEBUG.
20031211
* Started maintaining DACT again, version 0.8.31 released.
20010821
* Added `-E' option to use with encryption
* Added cipher subsystem
* Added cipher_chaos.c (Chaos cipher)
20010614
* Added message to be displayed when upgrading DACT (with -N)
* Added config option `block_size'
20010601
* Added URL parsing support.
* Added `-p' option to display the result of parsed URL.
* Added `-N' option to upgrade DACT.
20010422
* Added URL support.
* Added `-H' option to write only the header of a DACT file.
* Added extended header support.
* Added `-n' option to ignore CRCs.
* Added `-I' option to use only a specific algorithm and 0.
* Added `-U' option to specify a file that contains a list of URLs.
* Added `-u' option to specify an URL to download copy of real data.
* Added `-D' option to specify a file description.
* Added `-O' option to toggle the writing of original file name.
* Added hooks for native `bunzip2' and `gunzip' handling.
* Lots of bug fixes.
* Version is 0.7.0.
20010325
* Fixed bug with newer libbz2's (from Glenn McGrath <bug1@optushome.com.au>)
* Changed comp_bzlib to 900k block (from Glenn McGrath <bug1@optushome.com.au>)
* Added support for -C option, and decompression checking.
* Version is 0.6.6
20010324
* Fixed bugs in configure script
* Fixed bugs in dact_blk_compress() (possibly causing heap corruption)
* Changed magic number to be less likely to occur in a text file
* Version is 0.6.5
20010322
* Rewrote dact.c.
* Made lots of changes to sort.[ch].
* Decided to keep current algorithms system.
* Changed magic number location in file to offset=0.
* Completely dropped support for old DACT files.
* New dact.c main(...) functions really similarily to `gzip.'
* Using GNU configure stuffs.
* comp_range and comp_mzlib2 are not enabled, they broke.
* Block size limit is (theoretically) 4GB.
* Changed structure of DACT file and block header.
* The -C option doesn't work.
* DACT doesn't check for a new binary (making a user dact-upgrade.sh
pointless at the moment, but this will be fixed. )
* Version is 0.6.1.
* Began using CVS to break things more quickly.
* Several misc bug fixes.
20000922
* Added modules !
* Converted all stable algorithms to modularizbale form.
* Now uses a config file (/etc/dact.conf)
* CHECK_VERSION is defined by default now (but disabled in dact.conf)
* comp_mzlib2 works now.
* Added a '-m' option to specify a config file.
* update-version.sh renamed to dact-upgrade.sh and installed by `make install'
20000907
* Added precompiled binaries, and a script to automatically upgrade.
* Added Docs/helpfile.txt which needs to be turned into a manpage.
20000905
* Added "Bugs" and "Horror Stories" to README.
* Fixed 2 bugs in comp_text.c.
* Added Docs/ directory.
* Changed CHECKSUM to MD5SUM
* A VERSION now exists and is consulted to check for latest, use
--with-check-version option on configure script to enable.
20000828
* Added backward compatability to <= 0.4.2.
* Fixed patch to magic file.
* Modified configuration scripts to work under more conditions.
* Preliminary testing of endian-neutrality.
* comp_mzlib2 modified, and almost works.
* int_sort_fast() modified to be even faster.
* Added path options to configure options.
* Created an installation guide, INSTALL.
* Added MD5 Checksum file, CHECKSUM.
20000827
* Added preliminary support for endian-neutrality (UNTESTED!)
* Added magic number, offset, and size.
* Added patch to magic file.
20000720
* Added getopt(3) support.
* Added '-l' option.
* Added '-s' option.
* Changed archive name to dact-VER.
* int_sort_really_fast added to sort.c.
* Added '-e' option.
* Fixed configure script to work with Solaris 8 (SunOS 5.8) (but not 7).
* Some bugs were possibly fixed and created.
* Added variable block size support.
* Default block size is now 4088 bytes (Max is 16384).
* Default output is to INFILE.dct instead of stdout.
20000526
* Fixed several memory leaks.
* Added bzlib.h check in configure for later use.
* Added int_sort_really_fast to buffer.[ch]
20000515
* comp_snibble.[ch] added as algo #6
* comp_range.[ch] added as algo #7
20000514
* comp_range_compress working (hopefully).
* comp_range_decompress partially working.
* int_sort_fast added to sort.c.
* byte_buffer_* added to buffer.c.
* configure script was modified.
* comp_mzlib2 was removed from algorithms.h, to be readded as algo #8.
* Added `-c' option and compression verification.
20000430
* comp_range was modified to begin to get it to work
* Modifications to configure script
* comp_mzlib2 was started
* Added sort.[ch] by Daniel Vignes (dvignes@n-f-d.com)
20000425
* Configure no longer relies on sed
* Binary filename changed from 'compress' to 'dact.'
* Toby Collier (tcollier@n-f-d.com) begins
handling documentation and Changelog.
20000421
* Name changed from DCL to DACT.
* New algorithms added.
* Bugs fixed.
20000414
* Initial release as DCL by Roy Keene (dact@rkeene.org)
|
Added Docs/CVS/Entries.
|
|
>
>
>
>
>
>
|
1
2
3
4
5
6
|
/INSTALL/1.1/Sat Sep 23 03:42:46 2000//
/config_help.txt/1.1/Sat Sep 23 03:47:24 2000//
/dact.txt/1.2/Thu Mar 22 02:34:17 2001//
/dact.1/1.4/Wed Mar 6 19:46:50 2002//
/helpfile.txt/1.5/Wed Mar 6 19:46:37 2002//
D
|
Added Docs/CVS/Repository.
Added Docs/CVS/Root.
|
|
>
|
1
|
:pserver:rkeene@cvs.saurik.com:/cvs/dact
|
Added Docs/INSTALL.
|
|
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
|
DACT Installation Guide
$ ./configure
$ make
$ su
$ make install
(note, the default installation location is /usr/local,
make sure you have proper privileges to write there.)
|
Added Docs/config_help.txt.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
`configure' configures this package to adapt to many kinds of systems.
Usage: ./configure [OPTION]... [VAR=VALUE]...
To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE. See below for descriptions of some of the useful variables.
Defaults for the options are specified in brackets.
Configuration:
-h, --help display this help and exit
--help=short display options specific to this package
--help=recursive display the short help of all the included packages
-V, --version display version information and exit
-q, --quiet, --silent do not print `checking...' messages
--cache-file=FILE cache test results in FILE [disabled]
-C, --config-cache alias for `--cache-file=config.cache'
-n, --no-create do not create output files
--srcdir=DIR find the sources in DIR [configure dir or `..']
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
[/usr/local]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[PREFIX]
By default, `make install' will install all the files in
`/usr/local/bin', `/usr/local/lib' etc. You can specify
an installation prefix other than `/usr/local' using `--prefix',
for instance `--prefix=$HOME'.
For better control, use the options below.
Fine tuning of the installation directories:
--bindir=DIR user executables [EPREFIX/bin]
--sbindir=DIR system admin executables [EPREFIX/sbin]
--libexecdir=DIR program executables [EPREFIX/libexec]
--datadir=DIR read-only architecture-independent data [PREFIX/share]
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
--infodir=DIR info documentation [PREFIX/info]
--mandir=DIR man documentation [PREFIX/man]
Optional Features:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--disable-chkvers Completely disable the ability to check for new versions
--disable-network Disable DACT's network activity completely
--enable-debug Enable developmental code
--disable-modules Disable use of modules
--enable-debianupgrade Use the Debian upgrade procedure instead of the DACT one
Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
headers in a nonstandard directory <include dir>
CPP C preprocessor
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
|
Added Docs/dact.1.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
|
.PU
.TH DACT 1
.SH NAME
dact \- compress or expand a file, or stream
.SH SYNOPSIS
.ll +10
.B dact
.RB [ " \-dsfcvlniCHOShVNa " ]
.RB [ \-b\ size ]
.RB [ \-e\ algo ]
.RB [ \-m\ file ]
.RB [ \-o\ file ]
.RB [ \-u\ url ]
.RB [ \-p\ url ]
.RB [ \-M\ command ]
.RB [ \-D\ desc ]
.RB [ \-I\ algo ]
.RB [ \-U\ file ]
.RB [ \-E\ cipher ]
.RB [ "file ..." ]
.ll -10
.SH DESCRIPTION
.I DACT
reduces input files by attempting to compress each block
of the file with several different algorithms and selects the
best one for each block.
.SH OPTIONS
.TP
.B \-d
Decompress the file (or stdin, if no file is given), removing
the extention if it has a valid one.
.TP
.B \-s
Display statistics about the file, such as:
Magic number of file, DACT version file was compressed with, Block size used to compress file, Compressed file size, Original file's size, Compression ratio (uncompressed to compressed), File's original name, CRCs (if available).
.TP
.B \-f
Force bad and unsafe things to happen. Can be combined to
make even worse things happen. One `-f' allows overwriting of
existing files, two `-f' allows you to ignore bad magic and
CRC check fails.
.TP
.B \-c
Send output to stdout, this will allow you to force DACT to
send compressed output to a terminal or result of compressing
a file to a pipe.
.TP
.B \-v
Increase verbosity, can be combined to increase verbosity a
lot. Currently, only up to 3 makes sense. One `-v' displays
a bar graph. Two `-v' displays a bar graph and block
information. Three `-v' displays a bar graph and detailed
compression statistics per block.
.TP
.B \-l
List compression algorithms available.
.TP
.B \-n
Toggle use of CRCs. This option is especially useful when
combined with the network capabilities of DACT. It allows
you to create a compressed file with only the header pointing
to an web page that contains the real DACT file (which
normally has it's CRCs checked against the compressed header
to ensure they're the same file), with this option the files
do not have to be from the same source (i.e., you can have
an updated copy automatically extend itself.)
.TP
.B \-i
Read input from standard input instead of /dev/tty. This is used to read user supplied information like encryption keys and passwords from standard input instead of the more appropriate method of opening "/dev/tty."
.TP
.B \-C
Complain when compression errors occur. When a block is
selected, it is tested to ensure that it decompresses back
to the original source. If it fails, the algorithm is not
used, with this option you are informed of the failure.
.TP
.B \-H
Write only header (no data). This option is useful for
distributing archives that need only reside on the internet
someplace.
.TP
.B \-O
Toggle writing original file name in the DACT header. This
has no real use that I know of.
.TP
.B \-S
Use speed-size as a metric rather than size. This is not
implemented yet. This will make DACT create an optimized
compressed file, balancing speed of decompression with size.
.TP
.B \-h
Give usage synopsis.
.TP
.B \-V
Display DACT version.
.TP
.B \-N
Upgrade DACT. This option will fetch the latest binary from
the internet and place it in $HOME/.dact/ as dact.bin. If
you have `binary_check on' in your dact.conf file, DACT will
check for this file and use it. If you have Debian and run
`dact -N' as root the Debian upgrade procedure will upgrade
your entire system.
.TP
.B \-a
DACT modules. This option will fetch the latest modules from the internet and place them in $HOME/.dact/ in a subdirectory cooresponding to your Operating System and CPU Architecture.
.TP
.B \-b\ size
Use the specified block size to compress the file. This
option's parameters is in bytes.
.TP
.B \-e\ num
Exclude an algorithm from being used. This option is useful
if you know your target will not be able to decompress a
certain algorithm (you can get their numbers from the `-l'
option.)
.TP
.B \-m\ file
Load another config file. This option will attempt to load
the specified file in addition to the normal files, the
options in this file will supercede other options.
.TP
.B \-o\ file
Alternate output. This option sends output to a file instead
of INFILE.dct. The file can also be a URL or '-' for standard
out.
.TP
.B \-u\ url
This option will encode an URL in the compressed file's header,
this URL will be tried (and CRCs checked) before attempting to
decompress the data in the actual file.
.TP
.B \-p\ url
URLs in DACT can have variables in them that will be expanded when network access is required, this allows you to test the results of that extrapolation easily. Variables and their values are:
@@OSNM@@ OS Name (linux, freebsd, sunos, etc)
@@OSVR@@ OS version (2.2.x, 4.2, 5.8, etc)
@@OSVS@@ OS version (short) (2.2, 4.2, 5.8, etc)
@@ARCH@@ Arch (i386, sparc64, sun4u, sun4m, etc)
@@DIST@@ If OSNM=Linux, distribution of Linux.
@@FILE@@ Name of compressed file.
@@DTVR@@ Version of DACT (maj.min.rev)
@@DTVS@@ Version of DACT (short) (maj.min)
@@PASS@@ Prompt for Password
@@USER@@ Prompt for Username
@@ATSN@@ Put an `@'
example:
dact -p http://www.rkeene.org/devel/dact/precompiled/dact-@@OSNM@@-@@OSVS@@-@@ARCH@@.bin
dact: http://www.rkeene.org/devel/dact/precompiled/dact-linux-2.4-i586.bin
.TP
.B \-M\ command
This option executes a command from the command line as if it appeared in "dact.conf".
.TP
.B \-D\ desc
Encode the description specified into the header of the
compressed file.
.TP
.B \-I\ num
Use only 1 algorithm (and uncompressed as a fall-back), useful
if you want to limit yourself to a certain type of compression.
.TP
.B \-U\ file
Encode the specified file into the header of the compressed
file. This file will be searched (line-by-line) for a working
URL to download compressed content from. See also `-u.'
.TP
.B \-E\ cipher
Enable encryption using the specified algorithm, different
algorithms use different authentication methods.
.SH FILES
$HOME/.dact/
$HOME/.dact/dact.conf
/usr/etc/dact.conf
.SH "SEE ALSO"
gzip(1), bzip2(1), mcrypt(3)
.SH AUTHOR
.Sp
Roy Keene
.I <dact@rkeene.org>
|
Added Docs/dact.1.txt.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
|
DACT(1) DACT(1)
NAME
dact - compress or expand a file, or stream
SYNOPSIS
dact [ -dsfcvlniCHOShVNa ] [-b size] [-e algo] [-m file] [-o file] [-u url]
[-p url] [-M command] [-D desc] [-I algo] [-U file] [-E cipher] [file ...]
DESCRIPTION
DACT reduces input files by attempting to compress each block of the
file with several different algorithms and selects the best one for
each block.
OPTIONS
-d Decompress the file (or stdin, if no file is given), removing
the extention if it has a valid one.
-s Display statistics about the file, such as: Magic number of
file, DACT version file was compressed with, Block size used to
compress file, Compressed file size, Original file's size, Com-
pression ratio (uncompressed to compressed), File's original
name, CRCs (if available).
-f Force bad and unsafe things to happen. Can be combined to make
even worse things happen. One `-f' allows overwriting of exist-
ing files, two `-f' allows you to ignore bad magic and CRC check
fails.
-c Send output to stdout, this will allow you to force DACT to send
compressed output to a terminal or result of compressing a file
to a pipe.
-v Increase verbosity, can be combined to increase verbosity a lot.
Currently, only up to 3 makes sense. One `-v' displays a bar
graph. Two `-v' displays a bar graph and block information.
Three `-v' displays a bar graph and detailed compression statis-
tics per block.
-l List compression algorithms available.
-n Toggle use of CRCs. This option is especially useful when com-
bined with the network capabilities of DACT. It allows you to
create a compressed file with only the header pointing to an web
page that contains the real DACT file (which normally has it's
CRCs checked against the compressed header to ensure they're the
same file), with this option the files do not have to be from
the same source (i.e., you can have an updated copy automati-
cally extend itself.)
-i Read input from standard input instead of /dev/tty. This is
used to read user supplied information like encryption keys and
passwords from standard input instead of the more appropriate
method of opening "/dev/tty."
-C Complain when compression errors occur. When a block is
selected, it is tested to ensure that it decompresses back to
the original source. If it fails, the algorithm is not used,
with this option you are informed of the failure.
-H Write only header (no data). This option is useful for dis-
tributing archives that need only reside on the internet some-
place.
-O Toggle writing original file name in the DACT header. This has
no real use that I know of.
-S Use speed-size as a metric rather than size. This is not imple-
mented yet. This will make DACT create an optimized compressed
file, balancing speed of decompression with size.
-h Give usage synopsis.
-V Display DACT version.
-N Upgrade DACT. This option will fetch the latest binary from the
internet and place it in $HOME/.dact/ as dact.bin. If you have
`binary_check on' in your dact.conf file, DACT will check for
this file and use it. If you have Debian and run `dact -N' as
root the Debian upgrade procedure will upgrade your entire sys-
tem.
-a DACT modules. This option will fetch the latest modules from
the internet and place them in $HOME/.dact/ in a subdirectory
cooresponding to your Operating System and CPU Architecture.
-b size
Use the specified block size to compress the file. This
option's parameters is in bytes.
-e num Exclude an algorithm from being used. This option is useful if
you know your target will not be able to decompress a certain
algorithm (you can get their numbers from the `-l' option.)
-m file
Load another config file. This option will attempt to load the
specified file in addition to the normal files, the options in
this file will supercede other options.
-o file
Alternate output. This option sends output to a file instead of
INFILE.dct. The file can also be a URL or '-' for standard out.
-u url This option will encode an URL in the compressed file's header,
this URL will be tried (and CRCs checked) before attempting to
decompress the data in the actual file.
-p url URLs in DACT can have variables in them that will be expanded
when network access is required, this allows you to test the
results of that extrapolation easily. Variables and their val-
ues are:
@@OSNM@@ OS Name (linux, freebsd, sunos, etc)
@@OSVR@@ OS version (2.2.x, 4.2, 5.8, etc)
@@OSVS@@ OS version (short) (2.2, 4.2, 5.8, etc)
@@ARCH@@ Arch (i386, sparc64, sun4u, sun4m, etc)
@@DIST@@ If OSNM=Linux, distribution of Linux.
@@FILE@@ Name of compressed file.
@@DTVR@@ Version of DACT (maj.min.rev)
@@DTVS@@ Version of DACT (short) (maj.min)
@@PASS@@ Prompt for Password
@@USER@@ Prompt for Username
@@ATSN@@ Put an `@'
example:
dact -p http://www.rkeene.org/devel/dact/precom-
piled/dact-@@OSNM@@-@@OSVS@@-@@ARCH@@.bin
dact: http://www.rkeene.org/devel/dact/precompiled/dact-
linux-2.4-i586.bin
-M command
This option executes a command from the command line as if it
appeared in "dact.conf".
-D desc
Encode the description specified into the header of the com-
pressed file.
-I num Use only 1 algorithm (and uncompressed as a fall-back), useful
if you want to limit yourself to a certain type of compression.
-U file
Encode the specified file into the header of the compressed
file. This file will be searched (line-by-line) for a working
URL to download compressed content from. See also `-u.'
-E cipher
Enable encryption using the specified algorithm, different algo-
rithms use different authentication methods.
FILES
$HOME/.dact/
$HOME/.dact/dact.conf
/usr/etc/dact.conf
SEE ALSO
gzip(1), bzip2(1), mcrypt(3)
AUTHOR
Roy Keene <dact@rkeene.org>
DACT(1)
|
Added Docs/dact.txt.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
A Brief Discussion of the History and Operation of
the DACT Compression engine.
History:
DACT started out as a science fair project on "Lossless
Compression of Arbitrary Data." A feat which (to me) seemed like it
should be possible, but I later realized why it could not be[1]. From
there, I decided that a compression program that knew different file
types and had a dictionary of compression algorithms to use for each file
type. So I began writing a program to do this, but I was too lazy to do
some magic identification, or base it on the file's extension. So, this
program instead compressed each block with all known algorithms, finding
the smallest overall file size. The next logical step was to make it test
each algorithm on each block.
Operation:
DACT takes a block (of arbitrary size, specified by the user) from
a file, compresses it with all of the compression algorithms in it's
dictionary, finding the one that yields the lowest size. It provides a
simple interface for creating new algorithms.
Questions? Comments? Code/Document Contribution? Feel free to contact
me at rkeene@rkeene.org.
|
Added Docs/helpfile.txt.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
|
DACT(1) DACT(1)
NNAAMMEE
dact - compress or expand a file, or stream
SSYYNNOOPPSSIISS
ddaacctt [ --ddssffccvvllnniiCCHHOOSShhVVNNaa ] [--bb ssiizzee] [--ee aallggoo] [--mm ffiillee] [--oo ffiillee] [--uu uurrll]
[--pp uurrll] [--MM ccoommmmaanndd] [--DD ddeesscc] [--II aallggoo] [--UU ffiillee] [--EE cciipphheerr] [ffiillee ......]
DDEESSCCRRIIPPTTIIOONN
_D_A_C_T reduces input files by attempting to compress each block of the
file with several different algorithms and selects the best one for
each block.
OOPPTTIIOONNSS
--dd Decompress the file (or stdin, if no file is given), removing
the extention if it has a valid one.
--ss Display statistics about the file, such as: Magic number of
file, DACT version file was compressed with, Block size used to
compress file, Compressed file size, Original file's size, Com-
pression ratio (uncompressed to compressed), File's original
name, CRCs (if available).
--ff Force bad and unsafe things to happen. Can be combined to make
even worse things happen. One `-f' allows overwriting of exist-
ing files, two `-f' allows you to ignore bad magic and CRC check
fails.
--cc Send output to stdout, this will allow you to force DACT to send
compressed output to a terminal or result of compressing a file
to a pipe.
--vv Increase verbosity, can be combined to increase verbosity a lot.
Currently, only up to 3 makes sense. One `-v' displays a bar
graph. Two `-v' displays a bar graph and block information.
Three `-v' displays a bar graph and detailed compression statis-
tics per block.
--ll List compression algorithms available.
--nn Toggle use of CRCs. This option is especially useful when com-
bined with the network capabilities of DACT. It allows you to
create a compressed file with only the header pointing to an web
page that contains the real DACT file (which normally has it's
CRCs checked against the compressed header to ensure they're the
same file), with this option the files do not have to be from
the same source (i.e., you can have an updated copy automati-
cally extend itself.)
--ii Read input from standard input instead of /dev/tty. This is
used to read user supplied information like encryption keys and
passwords from standard input instead of the more appropriate
method of opening "/dev/tty."
--CC Complain when compression errors occur. When a block is
selected, it is tested to ensure that it decompresses back to
the original source. If it fails, the algorithm is not used,
with this option you are informed of the failure.
--HH Write only header (no data). This option is useful for dis-
tributing archives that need only reside on the internet some-
place.
--OO Toggle writing original file name in the DACT header. This has
no real use that I know of.
--SS Use speed-size as a metric rather than size. This is not imple-
mented yet. This will make DACT create an optimized compressed
file, balancing speed of decompression with size.
--hh Give usage synopsis.
--VV Display DACT version.
--NN Upgrade DACT. This option will fetch the latest binary from the
internet and place it in $HOME/.dact/ as dact.bin. If you have
`binary_check on' in your dact.conf file, DACT will check for
this file and use it. If you have Debian and run `dact -N' as
root the Debian upgrade procedure will upgrade your entire sys-
tem.
--aa DACT modules. This option will fetch the latest modules from
the internet and place them in $HOME/.dact/ in a subdirectory
cooresponding to your Operating System and CPU Architecture.
--bb ssiizzee
Use the specified block size to compress the file. This
option's parameters is in bytes.
--ee nnuumm Exclude an algorithm from being used. This option is useful if
you know your target will not be able to decompress a certain
algorithm (you can get their numbers from the `-l' option.)
--mm ffiillee
Load another config file. This option will attempt to load the
specified file in addition to the normal files, the options in
this file will supercede other options.
--oo ffiillee
Alternate output. This option sends output to a file instead of
INFILE.dct. The file can also be a URL or '-' for standard out.
--uu uurrll This option will encode an URL in the compressed file's header,
this URL will be tried (and CRCs checked) before attempting to
decompress the data in the actual file.
--pp uurrll URLs in DACT can have variables in them that will be expanded
when network access is required, this allows you to test the
results of that extrapolation easily. Variables and their val-
ues are:
@@OSNM@@ OS Name (linux, freebsd, sunos, etc)
@@OSVR@@ OS version (2.2.x, 4.2, 5.8, etc)
@@OSVS@@ OS version (short) (2.2, 4.2, 5.8, etc)
@@ARCH@@ Arch (i386, sparc64, sun4u, sun4m, etc)
@@DIST@@ If OSNM=Linux, distribution of Linux.
@@FILE@@ Name of compressed file.
@@DTVR@@ Version of DACT (maj.min.rev)
@@DTVS@@ Version of DACT (short) (maj.min)
@@PASS@@ Prompt for Password
@@USER@@ Prompt for Username
@@ATSN@@ Put an `@'
example:
dact -p http://www.rkeene.org/devel/dact/precom-
piled/dact-@@OSNM@@-@@OSVS@@-@@ARCH@@.bin
dact: http://www.rkeene.org/devel/dact/precompiled/dact-
linux-2.4-i586.bin
--MM ccoommmmaanndd
This option executes a command from the command line as if it
appeared in "dact.conf".
--DD ddeesscc
Encode the description specified into the header of the com-
pressed file.
--II nnuumm Use only 1 algorithm (and uncompressed as a fall-back), useful
if you want to limit yourself to a certain type of compression.
--UU ffiillee
Encode the specified file into the header of the compressed
file. This file will be searched (line-by-line) for a working
URL to download compressed content from. See also `-u.'
--EE cciipphheerr
Enable encryption using the specified algorithm, different algo-
rithms use different authentication methods.
FFIILLEESS
$HOME/.dact/
$HOME/.dact/dact.conf
/usr/etc/dact.conf
SSEEEE AALLSSOO
gzip(1), bzip2(1), mcrypt(3)
AAUUTTHHOORR
Roy Keene _<_d_a_c_t_@_r_k_e_e_n_e_._o_r_g_>
DACT(1)
|
Added Docs/man2txt.
|
|
>
>
>
|
1
2
3
|
#! /bin/bash
MANWIDTH=80 man -l -Tascii $1 | sed s/'.[]'/''/g > $1.txt
|
Added HEADER.
|
|
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
|
DYNAMIC ADAPTIVE COMPRESSION TOOL
DACT @@VERS@@
Release information:
pkg: DACT version @@VERS@@
url: http://www.rkeene.org/files/oss/@@UTIL@@/@@UTIL@@-@@VERS@@.tar.gz
web: http://www.rkeene.org/oss/@@UTIL@@/
date: @@DATE@@
--------------------------------------------------------------------------
|
Added INSTALL.
|
|
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
|
DACT Installation Guide
$ ./configure
$ make
$ su
$ make install
(note, the default installation location is /usr/local,
make sure you have proper privileges to write there.)
|
Added LICENSE.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
|
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your freedom
to share and change it. By contrast, the GNU General Public License is
intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if
you distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on,
we want its recipients to know that what they have is not the
original, so that any problems introduced by others will not reflect
on the original authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at
all.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains a
notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the Program
(independent of having been made by running the Program). Whether that
is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's source
code as you receive it, in any medium, provided that you conspicuously
and appropriately publish on each copy an appropriate copyright notice
and disclaimer of warranty; keep intact all the notices that refer to
this License and to the absence of any warranty; and give any other
recipients of the Program a copy of this License along with the
Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Program or any portion of
it, thus forming a work based on the Program, and copy and distribute
such modifications or work under the terms of Section 1 above,
provided that you also meet all of these conditions:
* a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
* b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
* c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but does
not normally print such an announcement, your work based on the
Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
* a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software
interchange; or,
* b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
* c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt otherwise
to copy, modify, sublicense or distribute the Program is void, and
will automatically terminate your rights under this License. However,
parties who have received copies, or rights, from you under this
License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new
versions of the General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Program does not specify a
version number of this License, you may choose any version ever
published by the Free Software Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the
author to ask for permission. For software which is copyrighted by the
Free Software Foundation, write to the Free Software Foundation; we
sometimes make exceptions for this. Our decision will be guided by the
two goals of preserving the free status of all derivatives of our free
software and of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
|
Added Makefile.dep.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
|
comp_snibble.o: comp_snibble.c dact.h config.h comp_fail.h comp_snibble.h \
buffer.h sort.h
comp_delta.o: comp_delta.c dact.h config.h comp_fail.h comp_delta.h \
buffer.h
comp_text.o: comp_text.c dact.h config.h comp_fail.h comp_text.h buffer.h
comp_rle.o: comp_rle.c dact.h config.h comp_fail.h comp_rle.h
cipher_chaos.o: cipher_chaos.c dact.h config.h comp_fail.h ui.h \
cipher_chaos.h
cipher_sub.o: cipher_sub.c cipher_sub.h dact.h config.h comp_fail.h \
parse.h ui.h
cipher_psub.o: cipher_psub.c dact.h config.h comp_fail.h cipher_psub.h \
parse.h ui.h
comp_lzoox.o: comp_lzoox.c dact.h config.h comp_fail.h comp_lzoox.h
comp_lzooy.o: comp_lzooy.c dact.h config.h comp_fail.h comp_lzooy.h
comp_lzota.o: comp_lzota.c dact.h config.h comp_fail.h comp_lzota.h
comp_bzlib.o: comp_bzlib.c dact.h config.h comp_fail.h comp_bzlib.h
comp_zlib.o: comp_zlib.c dact.h config.h comp_fail.h comp_zlib.h
comp_mzlib.o: comp_mzlib.c dact.h config.h comp_fail.h comp_mzlib.h
comp_mzlib2.o: comp_mzlib2.c dact.h config.h comp_fail.h comp_mzlib2.h
dact_common.o: dact_common.c dact.h config.h comp_fail.h parse.h \
dendian.h crc.h math.h dact_common.h algorithms.h comp_plain.h \
comp_rle.h comp_delta.h comp_zlib.h comp_mzlib.h comp_mzlib2.h \
comp_bzlib.h comp_snibble.h comp_text.h comp_lzoox.h comp_lzooy.h \
comp_lzota.h ciphers.h cipher_chaos.h cipher_sub.h cipher_serpent.h \
cipher_psub.h module.h header.h net.h ui.h
comp_fail.o: comp_fail.c dact.h config.h comp_fail.h
comp_plain.o: comp_plain.c dact.h config.h comp_fail.h comp_plain.h
buffer.o: buffer.c dact.h config.h comp_fail.h buffer.h
header.o: header.c dact.h config.h comp_fail.h header.h
sort.o: sort.c dact.h config.h comp_fail.h sort.h
dact.o: dact.c dact.h config.h comp_fail.h parse.h dendian.h crc.h math.h \
dact_common.h algorithms.h comp_plain.h comp_rle.h comp_delta.h \
comp_zlib.h comp_mzlib.h comp_mzlib2.h comp_bzlib.h comp_snibble.h \
comp_text.h comp_lzoox.h comp_lzooy.h comp_lzota.h ciphers.h \
cipher_chaos.h cipher_sub.h cipher_serpent.h cipher_psub.h module.h \
header.h net.h ui.h
module.o: module.c dact.h config.h comp_fail.h module.h algorithms.h \
comp_plain.h comp_rle.h comp_delta.h comp_zlib.h comp_mzlib.h \
comp_mzlib2.h comp_bzlib.h comp_snibble.h comp_text.h comp_lzoox.h \
comp_lzooy.h comp_lzota.h ciphers.h cipher_chaos.h cipher_sub.h \
cipher_serpent.h cipher_psub.h parse.h net.h ui.h
parse.o: parse.c dact.h config.h comp_fail.h buffer.h parse.h crc.h ui.h
dendian.o: dendian.c dact.h config.h comp_fail.h dendian.h
crc.o: crc.c dact.h config.h comp_fail.h crc.h
net.o: net.c dact.h config.h comp_fail.h net.h parse.h crc.h
ui.o: ui.c dact.h config.h comp_fail.h ui.h
dact.o: dact.c dact.h config.h comp_fail.h parse.h dendian.h crc.h math.h \
dact_common.h algorithms.h comp_plain.h comp_rle.h comp_delta.h \
comp_zlib.h comp_mzlib.h comp_mzlib2.h comp_bzlib.h comp_snibble.h \
comp_text.h comp_lzoox.h comp_lzooy.h comp_lzota.h ciphers.h \
cipher_chaos.h cipher_sub.h cipher_serpent.h cipher_psub.h module.h \
header.h net.h ui.h
comp_snibble.so: comp_snibble.c dact.h config.h comp_fail.h comp_snibble.h \
buffer.h sort.h
comp_delta.so: comp_delta.c dact.h config.h comp_fail.h comp_delta.h \
buffer.h
comp_text.so: comp_text.c dact.h config.h comp_fail.h comp_text.h buffer.h
comp_rle.so: comp_rle.c dact.h config.h comp_fail.h comp_rle.h
cipher_chaos.so: cipher_chaos.c dact.h config.h comp_fail.h ui.h \
cipher_chaos.h
cipher_sub.so: cipher_sub.c cipher_sub.h dact.h config.h comp_fail.h \
parse.h ui.h
cipher_psub.so: cipher_psub.c dact.h config.h comp_fail.h cipher_psub.h \
parse.h ui.h
comp_lzoox.so: comp_lzoox.c dact.h config.h comp_fail.h comp_lzoox.h
comp_lzooy.so: comp_lzooy.c dact.h config.h comp_fail.h comp_lzooy.h
comp_lzota.so: comp_lzota.c dact.h config.h comp_fail.h comp_lzota.h
comp_bzlib.so: comp_bzlib.c dact.h config.h comp_fail.h comp_bzlib.h
comp_zlib.so: comp_zlib.c dact.h config.h comp_fail.h comp_zlib.h
comp_mzlib.so: comp_mzlib.c dact.h config.h comp_fail.h comp_mzlib.h
comp_mzlib2.so: comp_mzlib2.c dact.h config.h comp_fail.h comp_mzlib2.h
dact_common.so: dact_common.c dact.h config.h comp_fail.h parse.h \
dendian.h crc.h math.h dact_common.h algorithms.h comp_plain.h \
comp_rle.h comp_delta.h comp_zlib.h comp_mzlib.h comp_mzlib2.h \
comp_bzlib.h comp_snibble.h comp_text.h comp_lzoox.h comp_lzooy.h \
comp_lzota.h ciphers.h cipher_chaos.h cipher_sub.h cipher_serpent.h \
cipher_psub.h module.h header.h net.h ui.h
comp_fail.so: comp_fail.c dact.h config.h comp_fail.h
comp_plain.so: comp_plain.c dact.h config.h comp_fail.h comp_plain.h
buffer.so: buffer.c dact.h config.h comp_fail.h buffer.h
header.so: header.c dact.h config.h comp_fail.h header.h
sort.so: sort.c dact.h config.h comp_fail.h sort.h
dact.so: dact.c dact.h config.h comp_fail.h parse.h dendian.h crc.h math.h \
dact_common.h algorithms.h comp_plain.h comp_rle.h comp_delta.h \
comp_zlib.h comp_mzlib.h comp_mzlib2.h comp_bzlib.h comp_snibble.h \
comp_text.h comp_lzoox.h comp_lzooy.h comp_lzota.h ciphers.h \
cipher_chaos.h cipher_sub.h cipher_serpent.h cipher_psub.h module.h \
header.h net.h ui.h
module.so: module.c dact.h config.h comp_fail.h module.h algorithms.h \
comp_plain.h comp_rle.h comp_delta.h comp_zlib.h comp_mzlib.h \
comp_mzlib2.h comp_bzlib.h comp_snibble.h comp_text.h comp_lzoox.h \
comp_lzooy.h comp_lzota.h ciphers.h cipher_chaos.h cipher_sub.h \
cipher_serpent.h cipher_psub.h parse.h net.h ui.h
parse.so: parse.c dact.h config.h comp_fail.h buffer.h parse.h crc.h ui.h
dendian.so: dendian.c dact.h config.h comp_fail.h dendian.h
crc.so: crc.c dact.h config.h comp_fail.h crc.h
net.so: net.c dact.h config.h comp_fail.h net.h parse.h crc.h
ui.so: ui.c dact.h config.h comp_fail.h ui.h
dact.so: dact.c dact.h config.h comp_fail.h parse.h dendian.h crc.h math.h \
dact_common.h algorithms.h comp_plain.h comp_rle.h comp_delta.h \
comp_zlib.h comp_mzlib.h comp_mzlib2.h comp_bzlib.h comp_snibble.h \
comp_text.h comp_lzoox.h comp_lzooy.h comp_lzota.h ciphers.h \
cipher_chaos.h cipher_sub.h cipher_serpent.h cipher_psub.h module.h \
header.h net.h ui.h
|
Added Makefile.in.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
CC = @CC@
CFLAGS = @CFLAGS@ @DEFS@
CPPFLAGS = @CPPFLAGS@
EXEEXT = @EXEEXT@
OBJEXT = @OBJEXT@
PATH_SEPARATOR = @PATH_SEPARATOR@
LD = @CC@
LOADLIBES =
LDLIBS += @LIBS@ @MODLIBS@ -lm @NOMODS@ @MODLIBSCOND@
LDFLAGS += @LDFLAGS@
MODLIBS = @MODLIBS@
INSTALL = @INSTALL@
@SET_MAKE@
prefix = @prefix@
mandir = @mandir@
sysconfdir = @sysconfdir@
datadir = @datadir@
exec_prefix = @exec_prefix@
bindir = @bindir@
CONF = $(sysconfdir)/dact.conf
CFLAGS += -DDACT_CONFIG_FILE=\"$(CONF)\" -DEXEEXT=\"$(EXEEXT)\"
#CFLAGS += -O3
#LDFLAGS += -static
DEBUGALGO = comp_bitsums.c comp_factor.c comp_textrle.c
OBJS += dact_common.o comp_fail.o comp_plain.o buffer.o header.o sort.o dact.o module.o parse.o dendian.o crc.o net.o ui.o @LIBOBJS@
ALGO = comp_snibble.c comp_delta.c comp_text.c comp_rle.c cipher_chaos.c cipher_sub.c cipher_psub.c @ALGO@
all: @DEFAULT@
module: @DEPEND@
@MODS="$(ALGO:.c=.so)" LDLIBS="@ALLMODLIBS@" \
$(MAKE) dact libdact.so dact.conf
static: @DEPEND@
@OBJS="$(ALGO:.c=.o) $(CR_OBJ)" LDLIBS="$(MODLIBS)" $(MAKE) dact libdact.so dact.conf
dact.conf: Makefile
@echo "version_check off" > dact.conf
@echo "#block_size 0" >> dact.conf
@echo "#exclude_algo 0" >> dact.conf
@echo "use_urls on" >> dact.conf
@echo "color_ui off" >> dact.conf
@echo "network_access on" >> dact.conf
@echo "binary_check off" >> dact.conf
@echo "module_dir $(datadir)/dact" >> dact.conf
@echo "module_load_all off" >> dact.conf
@MODS@ @for so in $(MODS:.so=); do echo "load_module $$so" >> dact.conf; done
dact: $(OBJS) $(MODS)
$(CC) $(OBJS) $(LDFLAGS) $(LIBS) $(LDLIBS) -o dact$(EXEEXT)
libdact.so: $(OBJS) libdact.o
@MODS@ @echo $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ @SHARED@ $(filter-out dact.c, $(^:.o=.c)); \
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ @SHARED@ $(filter-out dact.c, $(^:.o=.c))
@true
%.so: %.c %.lnk
@echo $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -DAS_MODULE @SHARED@ $< $(filter %.o, $^) `cat $(<:.c=.lnk)`; \
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -DAS_MODULE @SHARED@ $< $(filter %.o, $^) `cat $(<:.c=.lnk)`
clean:
rm -f dact dact$(EXEEXT) $(OBJS) libdact.so libdact.o core *~ $(ALGO:.c=.o) $(ALGO:.c=.so)
distclean: clean
rm -f Makefile config.h config.status config.log config.cache
mrproper: distclean
rm -rf Makefile.dep configure autom4te.cache/ config.h.in
install-bin: dact
$(INSTALL) -m 755 dact$(EXEEXT) $(bindir)/dact$(EXEEXT)
install: all install-bin
$(INSTALL) -m 644 dact.conf $(CONF)
$(INSTALL) -m 644 Docs/dact.1 $(mandir)/man1/dact.1
@MODS@ mkdir -p -m 755 $(datadir)/dact
@MODS@ for so in *.so; do $(INSTALL) -m 755 $$so $(datadir)/dact/$$so; done
./patch-magic-file $(datadir)/magic
install-bin-local: dact
mkdir -p $(HOME)/.dact/`uname -s | tr A-Z a-z`-`uname -m`
$(INSTALL) -m 755 dact$(EXEEXT) $(HOME)/.dact/`uname -s | tr A-Z a-z`-`uname -m`/dact$(EXEEXT)
install-local: all install-bin-local
$(INSTALL) -m 644 dact.conf $(HOME)/.dact/dact.conf
@MODS@ for so in *.so; do $(INSTALL) -m 755 $$so $(HOME)/.dact/`uname -s | tr A-Z a-z`-`uname -m`/$$so; done
uninstall:
rm -f $(bindir)/dact$(EXEEXT)
rm -f $(mandir)/man1/dact.1 $(CONF)
@MODS@ rm -rf $(datadir)/dact
depend: Makefile.dep
Makefile.dep: *.c *.h Makefile
@echo "building Makefile.dep"
@$(CC) $(CFLAGS) $(CPPFLAGS) -MM $(ALGO) $(OBJS:.o=.c) $(MODS:.so=.c) dact.c | tee Makefile.dep | sed -e "s/^\([^ ]*\)\.o: /\1.so: /g" >> Makefile.dep
include Makefile.dep
|
Added README.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
1. EXPLANATION:
Take file, compress each block with 1 of 256 algorithms (including
no compression) and use algorithm on a per block basis.
2. WARNING! You should never use an algorithm listed in algorithms.h under DEBUG for real data, they are subject to reordering, recoding, and removal.
3. FEEDBACK would be appreciated. Email me, dact@rkeene.org,
if you find a flaw in the code, or if you have a suggestion.
4. WRITING A COMPRESSION ALGORITHM FOR DACT:
a. You can use comp_plain.[ch] as an example for the interface.
b. Your function must take 5 parameters:
mode - DACT_MODE_COMPR or DACT_MODE_DECMP
Determine whether to compress or decompress.
prev_block - Previous (uncompressed) block.
curr_block - The data to be compressed.
out_block - Where to put data after compression.
blk_size - Size of prev_block and curr_block.
c. Add your function's header file to algorithms.h:
#include "comp_youralgorithm.h"
d. Add your function's call to algorithms[] in algorithms.h, before
the NULL:
comp_yourfunction_algo,
e. Add your function's code to the Makefile.in (if it has no depencies):
ALGO+=comp_yourfunction.o
5. Horror Stories:
a. Comp_range didn't compile under Solaris 8 using C WorkShop 6.0.
b. Compiled Successfully, but shared binary didn't work.
c. Failed to make a Static binary under Slackware 7.0.
6. Bugs:
a. Please submit all bugs to dact@rkeene.org
|
Added TODO.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
Finish writing dact.conf options handlers
a. Archive
b. Pre/Post Install script
# x. Darwin: Does not set file permissions (fixed)
y. Does not handle large files
z. Does not store original file permissions.
i. auto-upgrade for modules
ii. fix modules everywhere
iii. sign modules
iv. default to modules
v. module version stuff
vi. commercial modules
1. Get more compression algorithms
2. factor
3. --> lha (not GPL)
4. --> arj (not GPL)
5. --> rar (not GPL, shareware)
6. lzw
7. Document code.
...
n. Write better documentation.
|
Added TODO.ideas.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
From bugoptushome.com.au Thu May 10 21:40:21 2001
Date: Sun, 06 May 2001 17:46:35 +1000
From: Glenn McGrath <bugoptushome.com.au>
To: Roy Keene <dactrkeene.org>
Subject: dact: replacing tar
Hello again, some more thoughts for you to consider.
.tar.gz really sucks, im writting some code that works on files inside a
.tar.gz in busybox and its a real hassle, i have to fork and uncompress
in a child process and feed the uncompressed data back the main function
that can untar it.
The problem stems from the fact that the tar file is compressed rather
than the individual files, if people did .gz.tar that it would be easy
to work on individual files within the archive, but it wouldnt get as
good compression due to the probably reduced block size (if the files
are small).
The loss in compression from appending files compressed with dact
probably wouldnt be as bad as .tar.gz as dact can take advantage of
different compresion methods for small files.
The real reason i would like to see this could also tie in well with
your url idea that you have been working on.
If dact something like an index file that had a list of filenames, their
offset and compressed size, then it would be possible to download and
unpack only one file within an archive.
e.g. linux-2.4.4.tar.gz is about 20MB, say i want to look at the
./README file, to do so i have to download the entire 20MB, uncompress
it, untar it, then access README.
In would be good to start the download of linux-2.4.4.dct and read
untill the end of the index section of the file and close the connection
(or have the index file seperate), then with the index file i would know
where abouts in the linux-2.4.4.dct the ./README file starts, so we
could open a connection and start resuming the download from the offset
of the ./README, rather than from the start of the file.
You have mentioned you had ideas for combining multiple compressed
files, so hopefully something like this could be worked into your plans.
Glenn
|
Added aclocal.m4.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
|
AC_DEFUN(DC_PROG_GCC, [
AC_SUBST(DEPEND)
if test -n "$GCC"; then
CFLAGS="$CFLAGS -Wall"
DEPEND="Makefile.dep"
fi
])
AC_DEFUN(DC_CHK_URANDOM, [
if test "$cross_compiling" = "no"; then
AC_MSG_CHECKING(to see if you have /dev/urandom)
if test -r "/dev/urandom"; then
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_DEV_URANDOM], [], [Have random device?])
else
AC_MSG_RESULT(no)
fi
fi
])
AC_DEFUN(DC_CHK_MODULE, [
AC_SUBST(ALGO)
AC_SUBST(MODLIBS)
AC_CHECK_LIB($1, main, [
ALGO="$2 $ALGO"
MODLIBS="-l$1 $MODLIBS"
AC_DEFINE($3, [], [Something])
])
])
AC_DEFUN(DC_CHK_MODULE_VAR, [
AC_SUBST(ALGO)
AC_SUBST($4)
AC_CHECK_LIB($1, main, [
ALGO="$2 $ALGO"
$4="-l$1 $(eval echo $(echo \$$4))"
AC_DEFINE($3, [], [Also something])
])
])
AC_DEFUN(DC_DO_NETSET, [
AC_SEARCH_LIBS(socket, socket nsl)
AC_SEARCH_LIBS(gethostbyname, nsl)
AC_SEARCH_LIBS(inet_aton, xnet, AC_DEFINE(HAVE_INET_ATON, [], [Have inet_aton() ?]), AC_SEARCH_LIBS(inet_addr, nsl))
])
AC_DEFUN(DC_ASK_CHKVERS, [
AC_ARG_ENABLE(chkvers, [ --disable-chkvers Completely disable the ability to check for new versions], [
case "$enableval" in
no)
;;
*)
AC_DEFINE(CHECK_VERSION, [], [Check for new versions over the network?])
;;
esac
], AC_DEFINE(CHECK_VERSION, [], [Check for new versions over the network?]))
])
AC_DEFUN(DC_ASK_DEBIAN, [
AC_ARG_ENABLE(debianupgrade, [ --enable-debianupgrade Use the Debian upgrade procedure instead of the DACT one], [
case "$enableval" in
no)
;;
*)
AC_DEFINE(DACT_DEBIAN_UPGRADE_PROC, [], [Use the Debian upgrade procedure instead of DACTs internal one])
;;
esac
])
])
AC_DEFUN(DC_ASK_NETWORK, [
AC_ARG_ENABLE(network, [ --disable-network Disable DACT's network activity completely], [
case "$enableval" in
no)
AC_DEFINE(NO_NETWORK, [], [Disable all network support])
;;
*)
DC_DO_NETSET
;;
esac
], DC_DO_NETSET )
])
AC_DEFUN(DC_DO_DEBUG, [
ALGO="$ALGO \$(DEBUGALGO)"
AC_DEFINE(DEBUG, [1], [Debug])
])
AC_DEFUN(DC_ASK_DEBUG, [
AC_ARG_ENABLE(debug, [ --enable-debug Enable developmental code], [
if test "$enable_version" != "no"; then
DC_DO_DEBUG
fi
], [
case "`uname -n`" in
rkeene | unleaded | *.saurik.com )
DC_DO_DEBUG
;;
esac
])
])
AC_DEFUN(DC_NO_MODULE, [
DEFAULT="static"
MODS="# "
])
AC_DEFUN(DC_GET_SHARED, [
AC_SUBST(SHARED)
OLD_LDFLAGS="$LDFLAGS"
SHARED=""
if test -z "$SHARED"; then
LDFLAGS="$OLD_LDFLAGS -shared -Wl,-G,-z,textoff -rdynamic -fPIC"
AC_TRY_LINK([#include <stdio.h>], [ printf("okay\n"); return(0); ], [ SHARED="-shared -Wl,-G,-z,textoff -fPIC"; ADD_LDFLAGS="-rdynamic" ], SHARED="", SHARED="");
fi
if test -z "$SHARED"; then
LDFLAGS="$OLD_LDFLAGS -shared -Wl,-G,-z,textoff -rdynamic"
AC_TRY_LINK([#include <stdio.h>], [ printf("okay\n"); return(0); ], [ SHARED="-shared -Wl,-G,-z,textoff"; ADD_LDFLAGS="-rdynamic" ], SHARED="", SHARED="");
fi
if test -z "$SHARED"; then
LDFLAGS="$OLD_LDFLAGS -shared -Wl,-G,-z,textoff -fPIC"
AC_TRY_LINK([#include <stdio.h>], [ printf("okay\n"); return(0); ], [ SHARED="-shared -Wl,-G,-z,textoff -fPIC"; ADD_LDFLAGS="" ], SHARED="", SHARED="");
fi
if test -z "$SHARED"; then
LDFLAGS="$OLD_LDFLAGS -shared -Wl,-G,-z,textoff"
AC_TRY_LINK([#include <stdio.h>], [ printf("okay\n"); return(0); ], [ SHARED="-shared -Wl,-G,-z,textoff"; ADD_LDFLAGS="" ], SHARED="", SHARED="");
fi
if test -z "$SHARED"; then
LDFLAGS="$OLD_LDFLAGS -Wl,-G,-z,textoff -rdynamic -fPIC"
AC_TRY_LINK([#include <stdio.h>], [ printf("okay\n"); return(0); ], [ SHARED="-Wl,-G,-z,textoff -fPIC"; ADD_LDFLAGS="-rdynamic" ], SHARED="", SHARED="");
fi
if test -z "$SHARED"; then
LDFLAGS="$OLD_LDFLAGS -Wl,-G,-z,textoff -rdynamic"
AC_TRY_LINK([#include <stdio.h>], [ printf("okay\n"); return(0); ], [ SHARED="-Wl,-G,-z,textoff"; ADD_LDFLAGS="-rdynamic" ], SHARED="", SHARED="");
fi
if test -z "$SHARED"; then
LDFLAGS="$OLD_LDFLAGS -Wl,-G,-z,textoff -fPIC"
AC_TRY_LINK([#include <stdio.h>], [ printf("okay\n"); return(0); ], [ SHARED="-Wl,-G,-z,textoff -fPIC"; ADD_LDFLAGS="" ], SHARED="", SHARED="");
fi
if test -z "$SHARED"; then
LDFLAGS="$OLD_LDFLAGS -Wl,-G,-z,textoff"
AC_TRY_LINK([#include <stdio.h>], [ printf("okay\n"); return(0); ], [ SHARED="-Wl,-G,-z,textoff"; ADD_LDFLAGS="" ], SHARED="", SHARED="");
fi
if test -z "$SHARED"; then
LDFLAGS="$LDFLAGS -shared -rdynamic -fPIC"
AC_TRY_LINK([#include <stdio.h>], [ printf("okay\n"); return(0); ], [ SHARED="-shared -fPIC"; ADD_LDFLAGS="-rdynamic" ], SHARED="", SHARED="");
fi
if test -z "$SHARED"; then
LDFLAGS="$OLD_LDFLAGS -shared -fPIC"
AC_TRY_LINK([#include <stdio.h>], [ printf("okay\n"); return(0); ], [ SHARED="-shared -fPIC"; ADD_LDFLAGS="" ], SHARED="", SHARED="");
fi
if test -z "$SHARED"; then
LDFLAGS="$OLD_LDFLAGS -shared"
AC_TRY_LINK([#include <stdio.h>], [ printf("okay\n"); return(0); ], [ SHARED="-shared"; ADD_LDFLAGS="" ], SHARED="", SHARED="");
fi
LDFLAGS="$ADD_LDFLAGS $OLD_LDFLAGS"
])
AC_DEFUN(DC_ASK_MODULE, [
AC_SUBST(DEFAULT)
AC_SUBST(MODS)
AC_SUBST(NOMODS)
DC_CHK_DLOPEN
AC_MSG_CHECKING(to use modules)
AC_ARG_ENABLE(modules, [ --disable-modules Disable use of modules], [
case "$enableval" in
no)
AC_MSG_RESULT(no)
DC_NO_MODULE
;;
*)
DC_GET_SHARED
if test "$HAVEDLOPEN" = yes -a -n "$SHARED"; then
AC_MSG_RESULT(yes)
AC_DEFINE(USE_MODULES, [], [Enable use of dynamically loadable modules?])
NOMODS="#"
DEFAULT="module"
else
AC_MSG_RESULT(can't)
DC_NO_MODULE
fi
;;
esac
], [
DC_GET_SHARED
if test "$HAVEDLOPEN" = yes -a -n "$SHARED"; then
AC_MSG_RESULT(yes)
AC_DEFINE(USE_MODULES, [Enable use of dynamically loadable modules?])
NOMODS="#"
DEFAULT="module"
else
AC_MSG_RESULT(can't)
DC_NO_MODULE
fi
])
])
AC_DEFUN(DC_DO_TYPE, [
if test -z "$ac_cv_sizeof_long"; then
AC_C_INLINE
AC_CHECK_SIZEOF(long, 4)
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(short, 2)
fi
FOUND=0
for dc_cv_loop in \$ac_cv_sizeof_int \$ac_cv_sizeof_long \$ac_cv_sizeof_short; do
dc_cv_size=`eval echo $dc_cv_loop`
dc_cv_name=`echo $dc_cv_loop | sed s/\\\$ac_cv_sizeof_//`
if test "$dc_cv_size" = "$3"; then
if test "$dc_cv_name" = "int"; then
AC_CHECK_TYPE($1, $2 int)
fi
if test "$dc_cv_name" = "long"; then
AC_CHECK_TYPE($1, $2 long)
fi
if test "$dc_cv_name" = "short"; then
AC_CHECK_TYPE($1, $2 short)
fi
FOUND=1
break
fi
done
])
AC_DEFUN(DC_CHK_DLOPEN, [
AC_CHECK_FUNC(dlopen, [
AC_DEFINE(HAVE_DLOPEN, [1], [Have dlopen()?])
HAVEDLOPEN=yes
])
if test "$ac_cv_func_dlopen" = "no"; then
AC_CHECK_LIB(dl, dlopen, [
AC_DEFINE(HAVE_DLOPEN, [1], [Have dlopen()?])
ALLMODLIBS=-ldl
AC_SUBST(ALLMODLIBS)
HAVEDLOPEN=yes
])
fi
])
|
Added algorithms.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#ifndef _ALGORITHMS_H
#define _ALOGIRTHMS_H
/*
Algorithms!
*/
#include "dact.h"
#include "comp_plain.h"
#include "comp_rle.h"
#include "comp_delta.h"
#ifdef HAVE_LIBZ
#include "comp_zlib.h"
#include "comp_mzlib.h"
#include "comp_mzlib2.h"
#endif
#ifdef HAVE_LIBBZ2
#include "comp_bzlib.h"
#endif
#ifdef DEBUG
#include "comp_factor.h"
#include "comp_bitsums.h"
#include "comp_textrle.h"
#endif
#include "comp_snibble.h"
#include "comp_text.h"
#include "comp_fail.h"
#include "comp_lzoox.h"
#include "comp_lzooy.h"
#include "comp_lzota.h"
#ifdef __DACT_C
int (*(algorithms[256]))()={ comp_plain_algo,
comp_rle_algo,
comp_delta_algo,
comp_text_algo,
#ifdef HAVE_LIBZ
comp_zlib_algo,
comp_mzlib_algo,
#else
DACT_FAILED_ALGO,
DACT_FAILED_ALGO,
#endif
comp_snibble_algo,
DACT_FAILED_ALGO,
#ifdef HAVE_LIBZ
comp_mzlib2_algo,
#else
DACT_FAILED_ALGO,
#endif
#ifdef HAVE_LIBBZ2
comp_bzlib_algo,
#else
DACT_FAILED_ALGO,
#endif
#ifdef DEBUG
comp_factor_algo,
comp_bitsums_algo,
comp_textrle_algo,
#else
DACT_FAILED_ALGO,
DACT_FAILED_ALGO,
DACT_FAILED_ALGO,
#endif
comp_lzoox_algo,
comp_lzooy_algo,
comp_lzota_algo,
NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL,
NULL};
char *algorithm_names[256]={ "Uncompressed",
"RLE Compression",
"Delta Compression",
"Text Compression",
#ifdef HAVE_LIBZ
"Zlib Compression",
"Modified Zlib Compression",
#else
"Unsupported Algorithm (zlib)",
"Unsupported Algorithm (mzlib)",
#endif
"Seminibble Encoding",
"Range Encoding",
#ifdef HAVE_LIBZ
"Second Modified Zlib Compression",
#else
"Unsupported Algorithm (mzlib2)",
#endif
#ifdef HAVE_LIBBZ2
"Bzip2 Compression",
#else
"Unsupported Algorithm (bzlib)",
#endif
#ifdef DEBUG
"Factor Compression",
"Bitsums Compression",
"Text RLE Compression",
#else
"Unsupported Algorithm (factor)",
"Unsupported Algorithm (bitsums)",
"Unsupported Algorithm (textrle)",
#endif
#ifdef HAVE_LIBLZO
"LZO-1x Compression",
"LZO-1y Compression",
"LZO-2a Compression",
#else
"Unsupported Algorithm (comp_lzoox)",
"Unsupported Algorithm (comp_lzooy)",
"Unsupported Algorithm (comp_lzota)",
#endif
NULL
};
#else
extern int (*(algorithms[256]))();
extern char *algorithm_names[256];
#endif
#endif
|
Added autom4te.cache/output.0.
more than 10,000 changes
Added autom4te.cache/requests.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
# This file was generated by Autom4te Mon Jan 19 17:15:15 PST 2004.
# It contains the lists of macros which have been traced.
# It can be safely removed.
@request = (
bless( [
'0',
1,
[
'/usr/share/autoconf'
],
[
'/usr/share/autoconf/autoconf/autoconf.m4f',
'aclocal.m4',
'configure.in'
],
{
'm4_pattern_forbid' => 1,
'AC_CONFIG_LIBOBJ_DIR' => 1,
'AC_C_VOLATILE' => 1,
'AC_TYPE_OFF_T' => 1,
'AC_FUNC_CLOSEDIR_VOID' => 1,
'AC_REPLACE_FNMATCH' => 1,
'AC_PROG_LIBTOOL' => 1,
'AC_FUNC_STAT' => 1,
'AC_FUNC_WAIT3' => 1,
'AC_HEADER_TIME' => 1,
'AC_FUNC_LSTAT' => 1,
'AC_STRUCT_TM' => 1,
'AM_AUTOMAKE_VERSION' => 1,
'AC_FUNC_GETMNTENT' => 1,
'AC_TYPE_MODE_T' => 1,
'AC_FUNC_STRTOD' => 1,
'AC_CHECK_HEADERS' => 1,
'AC_FUNC_STRNLEN' => 1,
'm4_sinclude' => 1,
'AC_PROG_CXX' => 1,
'AC_PATH_X' => 1,
'AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK' => 1,
'AC_PROG_AWK' => 1,
'_m4_warn' => 1,
'AC_HEADER_STDC' => 1,
'AC_HEADER_MAJOR' => 1,
'AC_FUNC_ERROR_AT_LINE' => 1,
'AC_PROG_GCC_TRADITIONAL' => 1,
'AC_LIBSOURCE' => 1,
'AC_FUNC_MBRTOWC' => 1,
'AC_STRUCT_ST_BLOCKS' => 1,
'AC_TYPE_SIGNAL' => 1,
'AC_TYPE_UID_T' => 1,
'AC_PROG_MAKE_SET' => 1,
'AC_CONFIG_AUX_DIR' => 1,
'm4_pattern_allow' => 1,
'sinclude' => 1,
'AC_DEFINE_TRACE_LITERAL' => 1,
'AC_FUNC_STRERROR_R' => 1,
'AC_PROG_CC' => 1,
'AC_DECL_SYS_SIGLIST' => 1,
'AC_FUNC_FORK' => 1,
'AC_FUNC_STRCOLL' => 1,
'AC_FUNC_VPRINTF' => 1,
'AC_PROG_YACC' => 1,
'AC_INIT' => 1,
'AC_STRUCT_TIMEZONE' => 1,
'AC_FUNC_CHOWN' => 1,
'AC_SUBST' => 1,
'AC_FUNC_ALLOCA' => 1,
'AC_CANONICAL_HOST' => 1,
'AC_FUNC_GETPGRP' => 1,
'AC_PROG_RANLIB' => 1,
'AM_INIT_AUTOMAKE' => 1,
'AC_FUNC_SETPGRP' => 1,
'AC_CONFIG_SUBDIRS' => 1,
'AC_FUNC_MMAP' => 1,
'AC_FUNC_REALLOC' => 1,
'AC_TYPE_SIZE_T' => 1,
'AC_CONFIG_LINKS' => 1,
'AC_CHECK_TYPES' => 1,
'AC_CHECK_MEMBERS' => 1,
'AM_MAINTAINER_MODE' => 1,
'AC_FUNC_UTIME_NULL' => 1,
'AC_FUNC_SELECT_ARGTYPES' => 1,
'AC_HEADER_STAT' => 1,
'AC_FUNC_STRFTIME' => 1,
'AC_PROG_CPP' => 1,
'AC_C_INLINE' => 1,
'AC_PROG_LEX' => 1,
'AC_C_CONST' => 1,
'AC_TYPE_PID_T' => 1,
'AC_CONFIG_FILES' => 1,
'include' => 1,
'AC_FUNC_SETVBUF_REVERSED' => 1,
'AC_PROG_INSTALL' => 1,
'AM_GNU_GETTEXT' => 1,
'AC_CHECK_LIB' => 1,
'AC_FUNC_OBSTACK' => 1,
'AC_FUNC_MALLOC' => 1,
'AC_FUNC_GETGROUPS' => 1,
'AC_FUNC_GETLOADAVG' => 1,
'AH_OUTPUT' => 1,
'AC_FUNC_FSEEKO' => 1,
'AM_PROG_CC_C_O' => 1,
'AC_FUNC_MKTIME' => 1,
'AC_CANONICAL_SYSTEM' => 1,
'AM_CONDITIONAL' => 1,
'AC_CONFIG_HEADERS' => 1,
'AC_HEADER_SYS_WAIT' => 1,
'AC_PROG_LN_S' => 1,
'AC_FUNC_MEMCMP' => 1,
'm4_include' => 1,
'AC_HEADER_DIRENT' => 1,
'AC_CHECK_FUNCS' => 1
}
], 'Autom4te::Request' )
);
|
Added autom4te.cache/traces.0.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
|
m4trace:configure.in:3: -1- AC_INIT
m4trace:configure.in:3: -1- m4_pattern_forbid([^_?A[CHUM]_])
m4trace:configure.in:3: -1- m4_pattern_forbid([_AC_])
m4trace:configure.in:3: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
m4trace:configure.in:3: -1- m4_pattern_allow([^AS_FLAGS$])
m4trace:configure.in:3: -1- m4_pattern_forbid([^_?m4_])
m4trace:configure.in:3: -1- m4_pattern_forbid([^dnl$])
m4trace:configure.in:3: -1- m4_pattern_forbid([^_?AS_])
m4trace:configure.in:3: -1- AC_SUBST([SHELL], [${CONFIG_SHELL-/bin/sh}])
m4trace:configure.in:3: -1- AC_SUBST([PATH_SEPARATOR])
m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])])
m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])])
m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])])
m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])])
m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])])
m4trace:configure.in:3: -1- AC_SUBST([exec_prefix], [NONE])
m4trace:configure.in:3: -1- AC_SUBST([prefix], [NONE])
m4trace:configure.in:3: -1- AC_SUBST([program_transform_name], [s,x,x,])
m4trace:configure.in:3: -1- AC_SUBST([bindir], ['${exec_prefix}/bin'])
m4trace:configure.in:3: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin'])
m4trace:configure.in:3: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec'])
m4trace:configure.in:3: -1- AC_SUBST([datadir], ['${prefix}/share'])
m4trace:configure.in:3: -1- AC_SUBST([sysconfdir], ['${prefix}/etc'])
m4trace:configure.in:3: -1- AC_SUBST([sharedstatedir], ['${prefix}/com'])
m4trace:configure.in:3: -1- AC_SUBST([localstatedir], ['${prefix}/var'])
m4trace:configure.in:3: -1- AC_SUBST([libdir], ['${exec_prefix}/lib'])
m4trace:configure.in:3: -1- AC_SUBST([includedir], ['${prefix}/include'])
m4trace:configure.in:3: -1- AC_SUBST([oldincludedir], ['/usr/include'])
m4trace:configure.in:3: -1- AC_SUBST([infodir], ['${prefix}/info'])
m4trace:configure.in:3: -1- AC_SUBST([mandir], ['${prefix}/man'])
m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME])
m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */
#undef PACKAGE_NAME])
m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME])
m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME])
m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION])
m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */
#undef PACKAGE_VERSION])
m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING])
m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */
#undef PACKAGE_STRING])
m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT])
m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT])
m4trace:configure.in:3: -1- AC_SUBST([build_alias])
m4trace:configure.in:3: -1- AC_SUBST([host_alias])
m4trace:configure.in:3: -1- AC_SUBST([target_alias])
m4trace:configure.in:3: -1- AC_SUBST([DEFS])
m4trace:configure.in:3: -1- AC_SUBST([ECHO_C])
m4trace:configure.in:3: -1- AC_SUBST([ECHO_N])
m4trace:configure.in:3: -1- AC_SUBST([ECHO_T])
m4trace:configure.in:3: -1- AC_SUBST([LIBS])
m4trace:configure.in:4: -1- AC_CONFIG_HEADERS([config.h])
m4trace:configure.in:7: -1- AC_PROG_CC
m4trace:configure.in:7: -1- AC_SUBST([CC])
m4trace:configure.in:7: -1- AC_SUBST([CFLAGS])
m4trace:configure.in:7: -1- AC_SUBST([LDFLAGS])
m4trace:configure.in:7: -1- AC_SUBST([CPPFLAGS])
m4trace:configure.in:7: -1- AC_SUBST([CC])
m4trace:configure.in:7: -1- AC_SUBST([ac_ct_CC])
m4trace:configure.in:7: -1- AC_SUBST([CC])
m4trace:configure.in:7: -1- AC_SUBST([ac_ct_CC])
m4trace:configure.in:7: -1- AC_SUBST([CC])
m4trace:configure.in:7: -1- AC_SUBST([CC])
m4trace:configure.in:7: -1- AC_SUBST([ac_ct_CC])
m4trace:configure.in:7: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext])
m4trace:configure.in:7: -1- AC_SUBST([OBJEXT], [$ac_cv_objext])
m4trace:configure.in:8: -1- AC_PROG_MAKE_SET
m4trace:configure.in:8: -1- AC_SUBST([SET_MAKE])
m4trace:configure.in:9: -1- AC_PROG_INSTALL
m4trace:configure.in:9: -1- AC_SUBST([INSTALL_PROGRAM])
m4trace:configure.in:9: -1- AC_SUBST([INSTALL_SCRIPT])
m4trace:configure.in:9: -1- AC_SUBST([INSTALL_DATA])
m4trace:configure.in:11: -1- AC_SUBST([DEPEND])
m4trace:configure.in:15: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DLOPEN])
m4trace:configure.in:15: -1- AH_OUTPUT([HAVE_DLOPEN], [/* Have dlopen()? */
#undef HAVE_DLOPEN])
m4trace:configure.in:15: -1- AC_CHECK_LIB([dl], [dlopen], [
AC_DEFINE(HAVE_DLOPEN, [1], [Have dlopen()?])
ALLMODLIBS=-ldl
AC_SUBST(ALLMODLIBS)
HAVEDLOPEN=yes
])
m4trace:configure.in:15: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DLOPEN])
m4trace:configure.in:15: -1- AH_OUTPUT([HAVE_DLOPEN], [/* Have dlopen()? */
#undef HAVE_DLOPEN])
m4trace:configure.in:15: -1- AC_SUBST([ALLMODLIBS])
m4trace:configure.in:16: -1- AC_SUBST([ALGO])
m4trace:configure.in:16: -1- AC_SUBST([MODLIBS])
m4trace:configure.in:16: -1- AC_CHECK_LIB([z], [main], [
ALGO="comp_zlib.c comp_mzlib.c comp_mzlib2.c $ALGO"
MODLIBS="-lz $MODLIBS"
AC_DEFINE(HAVE_LIBZ, [], [Something])
])
m4trace:configure.in:16: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBZ])
m4trace:configure.in:16: -1- AH_OUTPUT([HAVE_LIBZ], [/* Something */
#undef HAVE_LIBZ])
m4trace:configure.in:17: -1- AC_SUBST([ALGO])
m4trace:configure.in:17: -1- AC_SUBST([MODLIBS])
m4trace:configure.in:17: -1- AC_CHECK_LIB([bz2], [main], [
ALGO="comp_bzlib.c $ALGO"
MODLIBS="-lbz2 $MODLIBS"
AC_DEFINE(HAVE_LIBBZ2, [], [Something])
])
m4trace:configure.in:17: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBBZ2])
m4trace:configure.in:17: -1- AH_OUTPUT([HAVE_LIBBZ2], [/* Something */
#undef HAVE_LIBBZ2])
m4trace:configure.in:18: -1- AC_SUBST([ALGO])
m4trace:configure.in:18: -1- AC_SUBST([MODLIBS])
m4trace:configure.in:18: -1- AC_CHECK_LIB([mcrypt], [main], [
ALGO="cipher_serpent.c $ALGO"
MODLIBS="-lmcrypt $MODLIBS"
AC_DEFINE(HAVE_LIBMCRYPT, [], [Something])
])
m4trace:configure.in:18: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBMCRYPT])
m4trace:configure.in:18: -1- AH_OUTPUT([HAVE_LIBMCRYPT], [/* Something */
#undef HAVE_LIBMCRYPT])
m4trace:configure.in:19: -1- AC_SUBST([ALGO])
m4trace:configure.in:19: -1- AC_SUBST([MODLIBSCOND])
m4trace:configure.in:19: -1- AC_CHECK_LIB([lzo], [main], [
ALGO="comp_lzoox.c comp_lzooy.c comp_lzota.c $ALGO"
MODLIBSCOND="-llzo $(eval echo $(echo \$MODLIBSCOND))"
AC_DEFINE(HAVE_LIBLZO, [], [Also something])
])
m4trace:configure.in:19: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBLZO])
m4trace:configure.in:19: -1- AH_OUTPUT([HAVE_LIBLZO], [/* Also something */
#undef HAVE_LIBLZO])
m4trace:configure.in:21: -2- AC_DEFINE_TRACE_LITERAL([CHECK_VERSION])
m4trace:configure.in:21: -2- AH_OUTPUT([CHECK_VERSION], [/* Check for new versions over the network? */
#undef CHECK_VERSION])
m4trace:configure.in:21: -1- AC_DEFINE_TRACE_LITERAL([CHECK_VERSION])
m4trace:configure.in:21: -1- AH_OUTPUT([CHECK_VERSION], [/* Check for new versions over the network? */
#undef CHECK_VERSION])
m4trace:configure.in:22: -3- AC_DEFINE_TRACE_LITERAL([HAVE_INET_ATON])
m4trace:configure.in:22: -3- AH_OUTPUT([HAVE_INET_ATON], [/* Have inet_aton() ? */
#undef HAVE_INET_ATON])
m4trace:configure.in:22: -1- AC_DEFINE_TRACE_LITERAL([NO_NETWORK])
m4trace:configure.in:22: -1- AH_OUTPUT([NO_NETWORK], [/* Disable all network support */
#undef NO_NETWORK])
m4trace:configure.in:22: -2- AC_DEFINE_TRACE_LITERAL([HAVE_INET_ATON])
m4trace:configure.in:22: -2- AH_OUTPUT([HAVE_INET_ATON], [/* Have inet_aton() ? */
#undef HAVE_INET_ATON])
m4trace:configure.in:23: -1- AC_DEFINE_TRACE_LITERAL([DEBUG])
m4trace:configure.in:23: -1- AH_OUTPUT([DEBUG], [/* Debug */
#undef DEBUG])
m4trace:configure.in:23: -1- AC_DEFINE_TRACE_LITERAL([DEBUG])
m4trace:configure.in:23: -1- AH_OUTPUT([DEBUG], [/* Debug */
#undef DEBUG])
m4trace:configure.in:24: -1- AC_SUBST([DEFAULT])
m4trace:configure.in:24: -1- AC_SUBST([MODS])
m4trace:configure.in:24: -1- AC_SUBST([NOMODS])
m4trace:configure.in:24: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DLOPEN])
m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_DLOPEN], [/* Have dlopen()? */
#undef HAVE_DLOPEN])
m4trace:configure.in:24: -1- AC_CHECK_LIB([dl], [dlopen], [
AC_DEFINE(HAVE_DLOPEN, [1], [Have dlopen()?])
ALLMODLIBS=-ldl
AC_SUBST(ALLMODLIBS)
HAVEDLOPEN=yes
])
m4trace:configure.in:24: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DLOPEN])
m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_DLOPEN], [/* Have dlopen()? */
#undef HAVE_DLOPEN])
m4trace:configure.in:24: -1- AC_SUBST([ALLMODLIBS])
m4trace:configure.in:24: -1- AC_SUBST([SHARED])
m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete.
You should run autoupdate.], [autoconf/general.m4:2223: AC_TRY_LINK is expanded from...
aclocal.m4:162: DC_GET_SHARED is expanded from...
autoconf/general.m4:1303: AC_ARG_ENABLE is expanded from...
aclocal.m4:203: DC_ASK_MODULE is expanded from...
configure.in:24: the top level])
m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete.
You should run autoupdate.], [autoconf/general.m4:2223: AC_TRY_LINK is expanded from...
aclocal.m4:162: DC_GET_SHARED is expanded from...
autoconf/general.m4:1303: AC_ARG_ENABLE is expanded from...
aclocal.m4:203: DC_ASK_MODULE is expanded from...
configure.in:24: the top level])
m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete.
You should run autoupdate.], [autoconf/general.m4:2223: AC_TRY_LINK is expanded from...
aclocal.m4:162: DC_GET_SHARED is expanded from...
autoconf/general.m4:1303: AC_ARG_ENABLE is expanded from...
aclocal.m4:203: DC_ASK_MODULE is expanded from...
configure.in:24: the top level])
m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete.
You should run autoupdate.], [autoconf/general.m4:2223: AC_TRY_LINK is expanded from...
aclocal.m4:162: DC_GET_SHARED is expanded from...
autoconf/general.m4:1303: AC_ARG_ENABLE is expanded from...
aclocal.m4:203: DC_ASK_MODULE is expanded from...
configure.in:24: the top level])
m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete.
You should run autoupdate.], [autoconf/general.m4:2223: AC_TRY_LINK is expanded from...
aclocal.m4:162: DC_GET_SHARED is expanded from...
autoconf/general.m4:1303: AC_ARG_ENABLE is expanded from...
aclocal.m4:203: DC_ASK_MODULE is expanded from...
configure.in:24: the top level])
m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete.
You should run autoupdate.], [autoconf/general.m4:2223: AC_TRY_LINK is expanded from...
aclocal.m4:162: DC_GET_SHARED is expanded from...
autoconf/general.m4:1303: AC_ARG_ENABLE is expanded from...
aclocal.m4:203: DC_ASK_MODULE is expanded from...
configure.in:24: the top level])
m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete.
You should run autoupdate.], [autoconf/general.m4:2223: AC_TRY_LINK is expanded from...
aclocal.m4:162: DC_GET_SHARED is expanded from...
autoconf/general.m4:1303: AC_ARG_ENABLE is expanded from...
aclocal.m4:203: DC_ASK_MODULE is expanded from...
configure.in:24: the top level])
m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete.
You should run autoupdate.], [autoconf/general.m4:2223: AC_TRY_LINK is expanded from...
aclocal.m4:162: DC_GET_SHARED is expanded from...
autoconf/general.m4:1303: AC_ARG_ENABLE is expanded from...
aclocal.m4:203: DC_ASK_MODULE is expanded from...
configure.in:24: the top level])
m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete.
You should run autoupdate.], [autoconf/general.m4:2223: AC_TRY_LINK is expanded from...
aclocal.m4:162: DC_GET_SHARED is expanded from...
autoconf/general.m4:1303: AC_ARG_ENABLE is expanded from...
aclocal.m4:203: DC_ASK_MODULE is expanded from...
configure.in:24: the top level])
m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete.
You should run autoupdate.], [autoconf/general.m4:2223: AC_TRY_LINK is expanded from...
aclocal.m4:162: DC_GET_SHARED is expanded from...
autoconf/general.m4:1303: AC_ARG_ENABLE is expanded from...
aclocal.m4:203: DC_ASK_MODULE is expanded from...
configure.in:24: the top level])
m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete.
You should run autoupdate.], [autoconf/general.m4:2223: AC_TRY_LINK is expanded from...
aclocal.m4:162: DC_GET_SHARED is expanded from...
autoconf/general.m4:1303: AC_ARG_ENABLE is expanded from...
aclocal.m4:203: DC_ASK_MODULE is expanded from...
configure.in:24: the top level])
m4trace:configure.in:24: -1- AC_DEFINE_TRACE_LITERAL([USE_MODULES])
m4trace:configure.in:24: -1- AH_OUTPUT([USE_MODULES], [/* Enable use of dynamically loadable modules? */
#undef USE_MODULES])
m4trace:configure.in:24: -1- AC_SUBST([SHARED])
m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete.
You should run autoupdate.], [autoconf/general.m4:2223: AC_TRY_LINK is expanded from...
aclocal.m4:162: DC_GET_SHARED is expanded from...
autoconf/general.m4:1303: AC_ARG_ENABLE is expanded from...
aclocal.m4:203: DC_ASK_MODULE is expanded from...
configure.in:24: the top level])
m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete.
You should run autoupdate.], [autoconf/general.m4:2223: AC_TRY_LINK is expanded from...
aclocal.m4:162: DC_GET_SHARED is expanded from...
autoconf/general.m4:1303: AC_ARG_ENABLE is expanded from...
aclocal.m4:203: DC_ASK_MODULE is expanded from...
configure.in:24: the top level])
m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete.
You should run autoupdate.], [autoconf/general.m4:2223: AC_TRY_LINK is expanded from...
aclocal.m4:162: DC_GET_SHARED is expanded from...
autoconf/general.m4:1303: AC_ARG_ENABLE is expanded from...
aclocal.m4:203: DC_ASK_MODULE is expanded from...
configure.in:24: the top level])
m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete.
You should run autoupdate.], [autoconf/general.m4:2223: AC_TRY_LINK is expanded from...
aclocal.m4:162: DC_GET_SHARED is expanded from...
autoconf/general.m4:1303: AC_ARG_ENABLE is expanded from...
aclocal.m4:203: DC_ASK_MODULE is expanded from...
configure.in:24: the top level])
m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete.
You should run autoupdate.], [autoconf/general.m4:2223: AC_TRY_LINK is expanded from...
aclocal.m4:162: DC_GET_SHARED is expanded from...
autoconf/general.m4:1303: AC_ARG_ENABLE is expanded from...
aclocal.m4:203: DC_ASK_MODULE is expanded from...
configure.in:24: the top level])
m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete.
You should run autoupdate.], [autoconf/general.m4:2223: AC_TRY_LINK is expanded from...
aclocal.m4:162: DC_GET_SHARED is expanded from...
autoconf/general.m4:1303: AC_ARG_ENABLE is expanded from...
aclocal.m4:203: DC_ASK_MODULE is expanded from...
configure.in:24: the top level])
m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete.
You should run autoupdate.], [autoconf/general.m4:2223: AC_TRY_LINK is expanded from...
aclocal.m4:162: DC_GET_SHARED is expanded from...
autoconf/general.m4:1303: AC_ARG_ENABLE is expanded from...
aclocal.m4:203: DC_ASK_MODULE is expanded from...
configure.in:24: the top level])
m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete.
You should run autoupdate.], [autoconf/general.m4:2223: AC_TRY_LINK is expanded from...
aclocal.m4:162: DC_GET_SHARED is expanded from...
autoconf/general.m4:1303: AC_ARG_ENABLE is expanded from...
aclocal.m4:203: DC_ASK_MODULE is expanded from...
configure.in:24: the top level])
m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete.
You should run autoupdate.], [autoconf/general.m4:2223: AC_TRY_LINK is expanded from...
aclocal.m4:162: DC_GET_SHARED is expanded from...
autoconf/general.m4:1303: AC_ARG_ENABLE is expanded from...
aclocal.m4:203: DC_ASK_MODULE is expanded from...
configure.in:24: the top level])
m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete.
You should run autoupdate.], [autoconf/general.m4:2223: AC_TRY_LINK is expanded from...
aclocal.m4:162: DC_GET_SHARED is expanded from...
autoconf/general.m4:1303: AC_ARG_ENABLE is expanded from...
aclocal.m4:203: DC_ASK_MODULE is expanded from...
configure.in:24: the top level])
m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete.
You should run autoupdate.], [autoconf/general.m4:2223: AC_TRY_LINK is expanded from...
aclocal.m4:162: DC_GET_SHARED is expanded from...
autoconf/general.m4:1303: AC_ARG_ENABLE is expanded from...
aclocal.m4:203: DC_ASK_MODULE is expanded from...
configure.in:24: the top level])
m4trace:configure.in:24: -1- AC_DEFINE_TRACE_LITERAL([USE_MODULES])
m4trace:configure.in:25: -1- AC_DEFINE_TRACE_LITERAL([DACT_DEBIAN_UPGRADE_PROC])
m4trace:configure.in:25: -1- AH_OUTPUT([DACT_DEBIAN_UPGRADE_PROC], [/* Use the Debian upgrade procedure instead of DACTs internal one */
#undef DACT_DEBIAN_UPGRADE_PROC])
m4trace:configure.in:26: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DEV_URANDOM])
m4trace:configure.in:26: -1- AH_OUTPUT([HAVE_DEV_URANDOM], [/* Have random device? */
#undef HAVE_DEV_URANDOM])
m4trace:configure.in:29: -1- AC_CHECK_HEADERS([zlib.h getopt.h stdio.h strings.h string.h unistd.h stdint.h inttypes.h bzlib.h sys/utsname.h sys/socket.h sys/wait.h lzoconf.h lzo1x.h lzo1y.h lzo2a.h dirent.h mcrypt.h dlfcn.h])
m4trace:configure.in:29: -1- AH_OUTPUT([HAVE_ZLIB_H], [/* Define to 1 if you have the <zlib.h> header file. */
#undef HAVE_ZLIB_H])
m4trace:configure.in:29: -1- AH_OUTPUT([HAVE_GETOPT_H], [/* Define to 1 if you have the <getopt.h> header file. */
#undef HAVE_GETOPT_H])
m4trace:configure.in:29: -1- AH_OUTPUT([HAVE_STDIO_H], [/* Define to 1 if you have the <stdio.h> header file. */
#undef HAVE_STDIO_H])
m4trace:configure.in:29: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H])
m4trace:configure.in:29: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H])
m4trace:configure.in:29: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H])
m4trace:configure.in:29: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H])
m4trace:configure.in:29: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H])
m4trace:configure.in:29: -1- AH_OUTPUT([HAVE_BZLIB_H], [/* Define to 1 if you have the <bzlib.h> header file. */
#undef HAVE_BZLIB_H])
m4trace:configure.in:29: -1- AH_OUTPUT([HAVE_SYS_UTSNAME_H], [/* Define to 1 if you have the <sys/utsname.h> header file. */
#undef HAVE_SYS_UTSNAME_H])
m4trace:configure.in:29: -1- AH_OUTPUT([HAVE_SYS_SOCKET_H], [/* Define to 1 if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H])
m4trace:configure.in:29: -1- AH_OUTPUT([HAVE_SYS_WAIT_H], [/* Define to 1 if you have the <sys/wait.h> header file. */
#undef HAVE_SYS_WAIT_H])
m4trace:configure.in:29: -1- AH_OUTPUT([HAVE_LZOCONF_H], [/* Define to 1 if you have the <lzoconf.h> header file. */
#undef HAVE_LZOCONF_H])
m4trace:configure.in:29: -1- AH_OUTPUT([HAVE_LZO1X_H], [/* Define to 1 if you have the <lzo1x.h> header file. */
#undef HAVE_LZO1X_H])
m4trace:configure.in:29: -1- AH_OUTPUT([HAVE_LZO1Y_H], [/* Define to 1 if you have the <lzo1y.h> header file. */
#undef HAVE_LZO1Y_H])
m4trace:configure.in:29: -1- AH_OUTPUT([HAVE_LZO2A_H], [/* Define to 1 if you have the <lzo2a.h> header file. */
#undef HAVE_LZO2A_H])
m4trace:configure.in:29: -1- AH_OUTPUT([HAVE_DIRENT_H], [/* Define to 1 if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H])
m4trace:configure.in:29: -1- AH_OUTPUT([HAVE_MCRYPT_H], [/* Define to 1 if you have the <mcrypt.h> header file. */
#undef HAVE_MCRYPT_H])
m4trace:configure.in:29: -1- AH_OUTPUT([HAVE_DLFCN_H], [/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H])
m4trace:configure.in:29: -1- AC_HEADER_STDC
m4trace:configure.in:29: -1- AC_PROG_CPP
m4trace:configure.in:29: -1- AC_SUBST([CPP])
m4trace:configure.in:29: -1- AC_SUBST([CPPFLAGS])
m4trace:configure.in:29: -1- AC_SUBST([CPP])
m4trace:configure.in:29: -1- AC_SUBST([EGREP])
m4trace:configure.in:29: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS])
m4trace:configure.in:29: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS])
m4trace:configure.in:29: -1- AC_CHECK_HEADERS([sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
inttypes.h stdint.h unistd.h], [], [], [$ac_includes_default])
m4trace:configure.in:29: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H])
m4trace:configure.in:29: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H])
m4trace:configure.in:29: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H])
m4trace:configure.in:29: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H])
m4trace:configure.in:29: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H])
m4trace:configure.in:29: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H])
m4trace:configure.in:29: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H])
m4trace:configure.in:29: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H])
m4trace:configure.in:29: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H])
m4trace:configure.in:32: -1- AC_DEFINE_TRACE_LITERAL([uint])
m4trace:configure.in:32: -1- AH_OUTPUT([uint], [/* Define to `unsigned int\' if <sys/types.h> does not define. */
#undef uint])
m4trace:configure.in:37: -1- AC_C_INLINE
m4trace:configure.in:37: -1- AH_OUTPUT([inline], [/* Define to `__inline__\' or `__inline\' if that\'s what the C compiler
calls it, or to nothing if \'inline\' is not supported under any name. */
#ifndef __cplusplus
#undef inline
#endif])
m4trace:configure.in:38: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_LONG])
m4trace:configure.in:38: -1- AH_OUTPUT([SIZEOF_LONG], [/* The size of a `long\', as computed by sizeof. */
#undef SIZEOF_LONG])
m4trace:configure.in:39: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_INT])
m4trace:configure.in:39: -1- AH_OUTPUT([SIZEOF_INT], [/* The size of a `int\', as computed by sizeof. */
#undef SIZEOF_INT])
m4trace:configure.in:40: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_SHORT])
m4trace:configure.in:40: -1- AH_OUTPUT([SIZEOF_SHORT], [/* The size of a `short\', as computed by sizeof. */
#undef SIZEOF_SHORT])
m4trace:configure.in:42: -1- AC_C_INLINE
m4trace:configure.in:42: -1- AH_OUTPUT([inline], [/* Define to `__inline__\' or `__inline\' if that\'s what the C compiler
calls it, or to nothing if \'inline\' is not supported under any name. */
#ifndef __cplusplus
#undef inline
#endif])
m4trace:configure.in:42: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_LONG])
m4trace:configure.in:42: -1- AH_OUTPUT([SIZEOF_LONG], [/* The size of a `long\', as computed by sizeof. */
#undef SIZEOF_LONG])
m4trace:configure.in:42: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_INT])
m4trace:configure.in:42: -1- AH_OUTPUT([SIZEOF_INT], [/* The size of a `int\', as computed by sizeof. */
#undef SIZEOF_INT])
m4trace:configure.in:42: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_SHORT])
m4trace:configure.in:42: -1- AH_OUTPUT([SIZEOF_SHORT], [/* The size of a `short\', as computed by sizeof. */
#undef SIZEOF_SHORT])
m4trace:configure.in:42: -1- AC_DEFINE_TRACE_LITERAL([uint32_t])
m4trace:configure.in:42: -1- AH_OUTPUT([uint32_t], [/* Define to `unsigned int\' if <sys/types.h> does not define. */
#undef uint32_t])
m4trace:configure.in:42: -1- AC_DEFINE_TRACE_LITERAL([uint32_t])
m4trace:configure.in:42: -1- AH_OUTPUT([uint32_t], [/* Define to `unsigned long\' if <sys/types.h> does not define. */
#undef uint32_t])
m4trace:configure.in:42: -1- AC_DEFINE_TRACE_LITERAL([uint32_t])
m4trace:configure.in:42: -1- AH_OUTPUT([uint32_t], [/* Define to `unsigned short\' if <sys/types.h> does not define. */
#undef uint32_t])
m4trace:configure.in:43: -1- AC_C_INLINE
m4trace:configure.in:43: -1- AH_OUTPUT([inline], [/* Define to `__inline__\' or `__inline\' if that\'s what the C compiler
calls it, or to nothing if \'inline\' is not supported under any name. */
#ifndef __cplusplus
#undef inline
#endif])
m4trace:configure.in:43: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_LONG])
m4trace:configure.in:43: -1- AH_OUTPUT([SIZEOF_LONG], [/* The size of a `long\', as computed by sizeof. */
#undef SIZEOF_LONG])
m4trace:configure.in:43: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_INT])
m4trace:configure.in:43: -1- AH_OUTPUT([SIZEOF_INT], [/* The size of a `int\', as computed by sizeof. */
#undef SIZEOF_INT])
m4trace:configure.in:43: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_SHORT])
m4trace:configure.in:43: -1- AH_OUTPUT([SIZEOF_SHORT], [/* The size of a `short\', as computed by sizeof. */
#undef SIZEOF_SHORT])
m4trace:configure.in:43: -1- AC_DEFINE_TRACE_LITERAL([int32_t])
m4trace:configure.in:43: -1- AH_OUTPUT([int32_t], [/* Define to `signed int\' if <sys/types.h> does not define. */
#undef int32_t])
m4trace:configure.in:43: -1- AC_DEFINE_TRACE_LITERAL([int32_t])
m4trace:configure.in:43: -1- AH_OUTPUT([int32_t], [/* Define to `signed long\' if <sys/types.h> does not define. */
#undef int32_t])
m4trace:configure.in:43: -1- AC_DEFINE_TRACE_LITERAL([int32_t])
m4trace:configure.in:43: -1- AH_OUTPUT([int32_t], [/* Define to `signed short\' if <sys/types.h> does not define. */
#undef int32_t])
m4trace:configure.in:44: -1- AC_C_INLINE
m4trace:configure.in:44: -1- AH_OUTPUT([inline], [/* Define to `__inline__\' or `__inline\' if that\'s what the C compiler
calls it, or to nothing if \'inline\' is not supported under any name. */
#ifndef __cplusplus
#undef inline
#endif])
m4trace:configure.in:44: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_LONG])
m4trace:configure.in:44: -1- AH_OUTPUT([SIZEOF_LONG], [/* The size of a `long\', as computed by sizeof. */
#undef SIZEOF_LONG])
m4trace:configure.in:44: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_INT])
m4trace:configure.in:44: -1- AH_OUTPUT([SIZEOF_INT], [/* The size of a `int\', as computed by sizeof. */
#undef SIZEOF_INT])
m4trace:configure.in:44: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_SHORT])
m4trace:configure.in:44: -1- AH_OUTPUT([SIZEOF_SHORT], [/* The size of a `short\', as computed by sizeof. */
#undef SIZEOF_SHORT])
m4trace:configure.in:44: -1- AC_DEFINE_TRACE_LITERAL([uint16_t])
m4trace:configure.in:44: -1- AH_OUTPUT([uint16_t], [/* Define to `unsigned int\' if <sys/types.h> does not define. */
#undef uint16_t])
m4trace:configure.in:44: -1- AC_DEFINE_TRACE_LITERAL([uint16_t])
m4trace:configure.in:44: -1- AH_OUTPUT([uint16_t], [/* Define to `unsigned long\' if <sys/types.h> does not define. */
#undef uint16_t])
m4trace:configure.in:44: -1- AC_DEFINE_TRACE_LITERAL([uint16_t])
m4trace:configure.in:44: -1- AH_OUTPUT([uint16_t], [/* Define to `unsigned short\' if <sys/types.h> does not define. */
#undef uint16_t])
m4trace:configure.in:45: -1- AC_C_INLINE
m4trace:configure.in:45: -1- AH_OUTPUT([inline], [/* Define to `__inline__\' or `__inline\' if that\'s what the C compiler
calls it, or to nothing if \'inline\' is not supported under any name. */
#ifndef __cplusplus
#undef inline
#endif])
m4trace:configure.in:45: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_LONG])
m4trace:configure.in:45: -1- AH_OUTPUT([SIZEOF_LONG], [/* The size of a `long\', as computed by sizeof. */
#undef SIZEOF_LONG])
m4trace:configure.in:45: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_INT])
m4trace:configure.in:45: -1- AH_OUTPUT([SIZEOF_INT], [/* The size of a `int\', as computed by sizeof. */
#undef SIZEOF_INT])
m4trace:configure.in:45: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_SHORT])
m4trace:configure.in:45: -1- AH_OUTPUT([SIZEOF_SHORT], [/* The size of a `short\', as computed by sizeof. */
#undef SIZEOF_SHORT])
m4trace:configure.in:45: -1- AC_DEFINE_TRACE_LITERAL([int16_t])
m4trace:configure.in:45: -1- AH_OUTPUT([int16_t], [/* Define to `signed int\' if <sys/types.h> does not define. */
#undef int16_t])
m4trace:configure.in:45: -1- AC_DEFINE_TRACE_LITERAL([int16_t])
m4trace:configure.in:45: -1- AH_OUTPUT([int16_t], [/* Define to `signed long\' if <sys/types.h> does not define. */
#undef int16_t])
m4trace:configure.in:45: -1- AC_DEFINE_TRACE_LITERAL([int16_t])
m4trace:configure.in:45: -1- AH_OUTPUT([int16_t], [/* Define to `signed short\' if <sys/types.h> does not define. */
#undef int16_t])
m4trace:configure.in:48: -2- AC_DEFINE_TRACE_LITERAL([HAVE_COMPRESS2])
m4trace:configure.in:48: -2- AH_OUTPUT([HAVE_COMPRESS2], [/* Have more versatile compress2() ? */
#undef HAVE_COMPRESS2])
m4trace:configure.in:48: -1- AC_CHECK_LIB([z], [compress2], [
cat >>confdefs.h <<\_ACEOF
@%:@define HAVE_COMPRESS2
_ACEOF
])
m4trace:configure.in:49: -2- AC_DEFINE_TRACE_LITERAL([HAVE_GZDOPEN])
m4trace:configure.in:49: -2- AH_OUTPUT([HAVE_GZDOPEN], [/* Have gzdopen() ? */
#undef HAVE_GZDOPEN])
m4trace:configure.in:49: -1- AC_CHECK_LIB([z], [gzdopen], [
cat >>confdefs.h <<\_ACEOF
@%:@define HAVE_GZDOPEN
_ACEOF
])
m4trace:configure.in:50: -2- AC_DEFINE_TRACE_LITERAL([HAVE_OLD_BZ2])
m4trace:configure.in:50: -2- AH_OUTPUT([HAVE_OLD_BZ2], [/* Do not have BZ2_ prefixed to all bzip2 symbols? */
#undef HAVE_OLD_BZ2])
m4trace:configure.in:50: -1- AC_CHECK_LIB([bz2], [bzBuffToBuffCompress], [
cat >>confdefs.h <<\_ACEOF
@%:@define HAVE_OLD_BZ2
_ACEOF
])
m4trace:configure.in:51: -2- AC_DEFINE_TRACE_LITERAL([HAVE_NEW_BZ2])
m4trace:configure.in:51: -2- AH_OUTPUT([HAVE_NEW_BZ2], [/* Have BZ2_ prefixed to all bzip2 symbols? */
#undef HAVE_NEW_BZ2])
m4trace:configure.in:51: -1- AC_CHECK_LIB([bz2], [BZ2_bzBuffToBuffCompress], [
cat >>confdefs.h <<\_ACEOF
@%:@define HAVE_NEW_BZ2
_ACEOF
])
m4trace:configure.in:52: -2- AC_DEFINE_TRACE_LITERAL([HAVE_NEW_BZ2])
m4trace:configure.in:52: -2- AH_OUTPUT([HAVE_NEW_BZ2], [/* Have BZ2_ prefixed to all bzip2 symbols? */
#undef HAVE_NEW_BZ2])
m4trace:configure.in:52: -1- AC_CHECK_LIB([bz2], [_BZ2_bzBuffToBuffCompress], [
cat >>confdefs.h <<\_ACEOF
@%:@define HAVE_NEW_BZ2
_ACEOF
])
m4trace:configure.in:53: -2- AC_DEFINE_TRACE_LITERAL([HAVE_BZDOPEN])
m4trace:configure.in:53: -2- AH_OUTPUT([HAVE_BZDOPEN], [/* Have bzdopen() ? */
#undef HAVE_BZDOPEN])
m4trace:configure.in:53: -1- AC_CHECK_LIB([bz2], [bzdopen], [
cat >>confdefs.h <<\_ACEOF
@%:@define HAVE_BZDOPEN
_ACEOF
])
m4trace:configure.in:54: -2- AC_DEFINE_TRACE_LITERAL([HAVE_NEW_BZDOPEN])
m4trace:configure.in:54: -2- AH_OUTPUT([HAVE_NEW_BZDOPEN], [/* Have BZ2_bzdopen() ? */
#undef HAVE_NEW_BZDOPEN])
m4trace:configure.in:54: -1- AC_CHECK_LIB([bz2], [BZ2_bzdopen], [
cat >>confdefs.h <<\_ACEOF
@%:@define HAVE_NEW_BZDOPEN
_ACEOF
])
m4trace:configure.in:55: -1- AC_LIBSOURCE([getopt.c])
m4trace:configure.in:55: -1- AC_LIBSOURCE([strsep.c])
m4trace:configure.in:55: -1- AC_LIBSOURCE([getpass.c])
m4trace:configure.in:55: -1- AC_LIBSOURCE([mkstemp.c])
m4trace:configure.in:55: -1- AC_CHECK_FUNCS([getopt strsep getpass mkstemp], [], [_AC_LIBOBJ($ac_func)])
m4trace:configure.in:55: -1- AH_OUTPUT([HAVE_GETOPT], [/* Define to 1 if you have the `getopt\' function. */
#undef HAVE_GETOPT])
m4trace:configure.in:55: -1- AH_OUTPUT([HAVE_STRSEP], [/* Define to 1 if you have the `strsep\' function. */
#undef HAVE_STRSEP])
m4trace:configure.in:55: -1- AH_OUTPUT([HAVE_GETPASS], [/* Define to 1 if you have the `getpass\' function. */
#undef HAVE_GETPASS])
m4trace:configure.in:55: -1- AH_OUTPUT([HAVE_MKSTEMP], [/* Define to 1 if you have the `mkstemp\' function. */
#undef HAVE_MKSTEMP])
m4trace:configure.in:55: -1- AC_SUBST([LIB@&t@OBJS])
m4trace:configure.in:59: -1- AC_CONFIG_FILES([Makefile])
m4trace:configure.in:59: -1- _m4_warn([obsolete], [AC_OUTPUT should be used without arguments.
You should run autoupdate.], [])
m4trace:configure.in:59: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])
m4trace:configure.in:59: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
|
Added buffer.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#include "dact.h"
#include "buffer.h"
#include <stdio.h>
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
uint32_t bit_buffer_data=0;
int bit_buffer_location=0;
char *byte_buffer_data=NULL;
int byte_buffer_location=-1;
/*
Func: bit_buffer_read
Args:
bits - (int) Number of bits to read from the buffer.
Rets: Int, value from buffer.
Meth: Bread high BITS bits from BUFFER_DATA and shift to the left.
Stat: Complete
*/
int bit_buffer_read(int bits) {
int retval;
if (bits>bit_buffer_location) {
DPRINTF("Request for %i bits, buffer contains %i bits",bits,bit_buffer_location);
bits=bit_buffer_location;
}
retval=(bit_buffer_data>>((sizeof(bit_buffer_data)*8)-bits));
bit_buffer_data=(bit_buffer_data<<bits);
bit_buffer_location-=bits;
#ifdef BUFFER_VERBOSE
DPRINTF("bit_buffer_read(%i)=%i",bits,retval);
#endif
return(retval);
}
/*
Func: bit_buffer_write
Args:
val - (uint) Value to write
bits - (uint) Number of bits to allocate
Rets: Nothing
Meth: Add to right of current BUFFER_DATA[BUFFER_LOCATION], incremint
BUFFER_LOCATION
Stat: Complete
*/
void bit_buffer_write(unsigned int val, unsigned int bits) {
while ((val>>bits)!=0) {
DPRINTF("Value (%i) is bigger than %i bits.",val,bits);
bits++;
}
if ((bits+bit_buffer_location)>(sizeof(bit_buffer_data)*8)) {
DPRINTF("Buffer overflow");
return;
}
bit_buffer_location+=bits;
bit_buffer_data+=(val<<((sizeof(bit_buffer_data)*8)-bit_buffer_location));
#ifdef BUFFER_VERBOSE
DPRINTF("bit_buffer_write(%i, %i)",val,bits);
#endif
return;
}
/*
Func: bit_buffer_size
Args: None
Rets: Int, number of bits in buffer
Meth: buffer_location
Stat: Complete
*/
int bit_buffer_size(void) {
#ifdef BUFFER_VERBOSE
DPRINTF("bit_buffer_size()=%i",bit_buffer_location);
#endif
return(bit_buffer_location);
}
/*
Func: bit_buffer_purge
Args: None
Rets: Nothing
Meth: Clear BUFFER_DATA and set BUFFER_LOCATION to 0
*/
void bit_buffer_purge(void) {
bit_buffer_location=0;
bit_buffer_data=0;
#ifdef BUFFER_VERBOSE
DPRINTF("bit_buffer_purge()");
#endif
return;
}
char *byte_buffer_read(int bytes) {
char *retval;
if (byte_buffer_location==-1) return(NULL);
if (bytes>byte_buffer_location) {
DPRINTF("Request for %i bytes, buffer contains %i bytes.",bytes,byte_buffer_location);
bytes=byte_buffer_location;
}
if (!(retval=malloc(bytes))) {
memcpy(retval,byte_buffer_data,bytes);
memmove(byte_buffer_data,byte_buffer_data+bytes,(byte_buffer_location-=bytes));
return(retval);
} else {
return(NULL);
}
}
void byte_buffer_write(char *val, unsigned int size) {
if (byte_buffer_location==-1) {
byte_buffer_purge();
}
if ((byte_buffer_location+size)>(BYTE_BUFF_SIZE)) {
DPRINTF("Buffer overflow.");
return;
}
memcpy(byte_buffer_data+byte_buffer_location,val,size);
byte_buffer_location+=size;
}
char byte_buffer_read_1(void) {
char *buffread;
char retval;
buffread=byte_buffer_read(1);
retval=buffread[0];
free(buffread);
return(retval);
}
int byte_buffer_size(void) {
return(byte_buffer_location);
}
void byte_buffer_purge(void) {
int i;
#if 0
if (byte_buffer_data!=NULL) free(byte_buffer_data);
byte_buffer_data=calloc(BYTE_BUFF_SIZE, 1);
#endif
if (byte_buffer_data==NULL) {
if (!(byte_buffer_data=malloc(BYTE_BUFF_SIZE))) return;
}
if (byte_buffer_location==-1) {
for (i=0;i<(BYTE_BUFF_SIZE);i++) byte_buffer_data[i]=0;
} else {
for (i=0;i<(byte_buffer_location+1);i++) byte_buffer_data[i]=0;
}
byte_buffer_location=0;
return;
}
|
Added buffer.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#ifndef _BUFFER_H
#define _BUFFER_H
#include "dact.h"
int bit_buffer_read(int bits);
void bit_buffer_write(unsigned int val, unsigned int bits);
int bit_buffer_size(void);
void bit_buffer_purge(void);
char *byte_buffer_read(int bytes);
char byte_buffer_read_1(void);
void byte_buffer_write(char *val, unsigned int size);
int byte_buffer_size(void);
void byte_buffer_purge(void);
#ifndef BYTE_BUFF_SIZE
#define BYTE_BUFF_SIZE DACT_BLK_SIZE*2
#endif
#endif
|
Added build/build_win32.sh.
|
|
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
|
#! /bin/sh
if [ ! -x configure ]; then cd ../; fi
CFLAGS='-Iwork/include'
CPPFLAGS="${CFLAGS}"
LDFLAGS='-Lwork/lib'
export CFLAGS LDFLAGS CPPFLAGS
./configure --host=i586-mingw32msvc
|
Added build/cleanup.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
#!/bin/bash
if [ ! "${SNAPSHOT}" = "1" ]; then
VER_MAJ=`echo $VERS | cut -f 1 -d .`
VER_MIN=`echo $VERS | cut -f 2 -d .`
VER_REV=`echo $VERS | cut -f 3 -d .`
printf "%03i%03i%03i\n" $VER_MAJ $VER_MIN $VER_REV > VERSION
else
echo "SNAPSHOT" > VERSION
fi
rm -f makearch.sh .* *.dct *.bak *.swp *.exe makesnapshot.sh *.o joe* bob* f 2>/dev/null >/dev/null
for i in *.[ch]; do
grep -v -e '^//' -e DPRINTF -e SHOWVAL $i > f
mv f $i
done
|
Added build/makearch.info.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# This is the name of the utility, it will be prefixed to the tarball name
UTIL="dact"
# This is the name of output files that should exist after configure
# procedures.
BINS="dact"
# This lists the name of files that are required to exist
REQS=""
# Version of utility, if empty it will be guessed.
# VERS=""
# Space sperated list of documents, if they exist, they will be
# prefixed with the contents of the DOC_HDR file and substitution
# will occur:
# @@UTIL@@ becomes the utility name ${UTIL}
# @@VERS@@ becomes the utility version
# @@DATE@@ becomes the current date
DOCS="AUTHORS README TODO INSTALL ChangeLog TODO.ideas Docs/config_help.txt Docs/dact.txt Docs/INSTALL"
DOC_HDR="HEADER"
# This script is executed immediately prior to creation of the
# tarball
AFTER=""
BEFORE="build/cleanup"
# Files matching these (space-seperated) patterns are deleted
TMPS="*.out bob joe sally f *.exe build work *.dct autom4te.cache HEADER"
|
Added build/makearch.sh.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
#!/bin/sh
cd /home/rkeene/devel/compression/
VER=`/usr/bin/grep "DACT_VER_" dact.h | /bin/cut -f 3 -d " " | /usr/bin/tr "\n" . | /bin/cut -f 1-3 -d "."`
DIRECT=`pwd`
cd ../
echo "Making archive `pwd`/dact-$VER.tar.gz"
cd $DIRECT
VER_MAJ=`echo $VER | cut -f 1 -d .`
VER_MIN=`echo $VER | cut -f 2 -d .`
VER_REV=`echo $VER | cut -f 3 -d .`
mkdir -p ../dact-$VER/Docs
cp * ../dact-$VER 2>/dev/null >/dev/null
cp Docs/* ../dact-$VER/Docs/ 2>/dev/null >/dev/null
cd ../dact-$VER
rm -f makearch.sh .* *.dct *.bak *.swp *.exe makesnapshot.sh *.o joe* bob* f 2>/dev/null >/dev/null
for i in *.[ch]; do
grep -v ^// $i > f
mv f $i
done
./configure 2>&1 >/dev/null
/usr/bin/make distclean >/dev/null 2>/dev/null
/usr/bin/make Makefile.dep 2>/dev/null >/dev/null
/usr/bin/sed s/"DACT_VERSION"/$VER/g README > f
/bin/mv f README
/usr/bin/md5sum * 2>/dev/null > MD5SUM
/usr/bin/file * 2>/dev/null > FILETYPE
printf "%03i%03i%03i\n" $VER_MAJ $VER_MIN $VER_REV > VERSION
cd ..
/bin/tar -zhcf dact-$VER.tar.gz dact-$VER/*
/bin/rm -rf dact-$VER
|
Added build/makesnapshot.sh.
|
|
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
|
#!/bin/bash
cd /home/rkeene/devel/compression
VER=`/usr/bin/grep "DACT_VER_" dact.h | /bin/cut -f 3 -d " " | /usr/bin/tr "\n" . | /bin/cut -f 1-3 -d "."`
./makearch.sh 2>/dev/null >/dev/null
cp ../dact-$VER.tar.gz /web/rkeene/devel/dact-snapshot.tar.gz
|
Added cipher_chaos.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#include "dact.h"
#include <math.h>
#include <stdio.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#include <fcntl.h>
#include "ui.h"
#include "cipher_chaos.h"
#if defined(USE_MODULES) && defined(AS_MODULE)
#include "module.h"
uint32_t DC_NUM=0;
uint32_t DC_TYPE=DACT_MOD_TYPE_ENC;
void *DC_ALGO=cipher_chaos;
char *DC_NAME="chaos (MOD)";
#endif
int cipher_chaos(const char *inblock, char *outblock, const int blksize, char *key, const int mode) {
switch (mode) {
case (DACT_MODE_CINIT+DACT_MODE_CDEC):
case (DACT_MODE_CINIT+DACT_MODE_CENC):
case DACT_MODE_CINIT:
return(cipher_chaos_init(mode,key));
break;
case DACT_MODE_CDEC:
return(cipher_chaos_encdec(inblock, outblock, blksize, key));
break;
case DACT_MODE_CENC:
#ifdef DACT_CIPHER_CHAOS
return(cipher_chaos_encdec(inblock, outblock, blksize, key));
#else
dact_ui_status(DACT_UI_LVL_GEN, "The chaos cipher is no longer supported.");
return(-1);
#endif
break;
}
return(0);
}
int cipher_chaos_init(const int mode, char *key) {
return(cipher_chaos_init_getkey(mode-DACT_MODE_CINIT,key));
}
int cipher_chaos_init_getkey(const int mode, char *key) {
strcpy(key,dact_ui_getuserinput("File Identification Number: ", 128, 1));
return(1);
}
int cipher_chaos_encdec(const char *blk, char *outblk, const int blksize, char *key) {
double fkey;
int y=0,i;
fkey=(double) atoi(key);
for (i=0;i<blksize;i++) {
outblk[i]=blk[i]^cipher_chaos_getbyte(&fkey,y);
}
return(blksize);
}
unsigned char cipher_chaos_getbyte(double *x, int y) {
static int i=0;
NORM(*x);
FIX(*x);
BEST(*x,y);
*x=(double) (R(*x)*(1-*x));
i++;
SPOTVAR_NUM(y);
return((unsigned char) y);
}
|
Added cipher_chaos.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#ifndef _CIPHER_CHAOS_H
#define _CIPHER_CHAOS_H
#include "dact.h"
#include "comp_fail.h"
#if defined(USE_MODULES) && !defined(AS_MODULE)
#define cipher_chaos DACT_FAILED_ALGO
#else
#define R(x) 4*(x)
#define NORM(x) { x+=0.000001; while(x<1) x*=10; while(x>=1) x/=10; }
#define BEST(x,y) { y=((int) ((x)*10000))&0xff; }
#define FIX(x) { x=(((double) ((int) ((x)*100000)))/100000); }
int cipher_chaos(const char *inblock, char *outblock, const int blksize, char *key, const int mode);
int cipher_chaos_init(const int mode, char *key);
int cipher_chaos_init_getkey(const int mode, char *key);
int cipher_chaos_encdec(const char *blk, char *outblk, const int blksize, char *key);
unsigned char cipher_chaos_getbyte(double *x, int y);
#endif
#endif
|
Added cipher_chaos.lnk.
Added cipher_psub.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
/*
Encrypt data.
*/
#include "dact.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#include <fcntl.h>
#include <stdio.h>
#include <math.h>
#include "cipher_psub.h"
#include "parse.h"
#include "ui.h"
#if defined(USE_MODULES) && defined(AS_MODULE)
#include "module.h"
uint32_t DC_NUM=3;
uint32_t DC_TYPE=DACT_MOD_TYPE_ENC;
void *DC_ALGO=cipher_psub;
char *DC_NAME="psubst (MOD)";
#endif
int cipher_psub(const unsigned char *inblock, unsigned char *outblock, const int blksize, unsigned char *key, const int mode) {
switch (mode) {
case (DACT_MODE_CINIT+DACT_MODE_CDEC):
case (DACT_MODE_CINIT+DACT_MODE_CENC):
case DACT_MODE_CINIT:
return(cipher_psub_init(mode,key));
break;
case DACT_MODE_CDEC:
return(cipher_psub_decrypt(inblock, outblock, blksize, key));
break;
case DACT_MODE_CENC:
return(cipher_psub_encrypt(inblock, outblock, blksize, key));
break;
}
return(0);
}
int cipher_psub_init(const int mode, unsigned char *key) {
return(cipher_psub_init_getkey(mode-DACT_MODE_CINIT,key));
}
int cipher_psub_init_getkey(const int mode, unsigned char *key) {
unsigned char *phrase;
char *keyreg;
phrase=dact_ui_getuserinput("Passphrase: ",128,1);
memcpy(key,keyreg=cipher_psub_generatekey(phrase),257);
free(keyreg);
return(257);
}
char *cipher_psub_generatekey(const char *passphrase) {
char *keybuf, used[256], hbuf[4];
int i,m,x,loc=0,num;
double d;
keybuf=malloc(1024);
for (i=0;i<256;i++) used[i]=0;
if (strlen(passphrase)<3) { num=257; } else { num=((259/((int) (strlen(passphrase)/3)))+1); }
for (m=0;m<strlen(passphrase);m+=3) {
memcpy(hbuf,passphrase+m,3);
hbuf[3]='\0';
d=hash_fourbyte(hbuf, '\0');
for (i=0;i<num;i++) {
d=(sin(tan(d))*(255*5));
x=((abs((int) d)&0x3ff)-255);
if (x<0 || x>255 || used[x]) { i--; continue; }
used[x]=1;
if (loc==0) used[x]=0;
keybuf[loc++]=x;
if (loc==257) break;
}
if (loc==257) break;
}
return(keybuf);
}
int cipher_psub_encrypt(const unsigned char *inblk, unsigned char *outblk, int blksize, unsigned char *key) {
int i,mod;
static int keyoffset=0;
mod=(int) key[0];
for (i=0;i<blksize;i++) {
if (!(i%mod)) {
keyoffset=((keyoffset+1)&0xff);
}
outblk[i]=key[((((int) inblk[i])+keyoffset)&0xff)+1];
}
return(blksize);
}
int cipher_psub_decrypt(const unsigned char *inblk, unsigned char *outblk, int blksize, unsigned char *key) {
int i,mod,x;
char reversekey[256];
static int keyoffset=0;
mod=(int) key[0];
for (i=1;i<257;i++) reversekey[(int) key[i]]=(i-1);
for (i=0;i<blksize;i++) {
if (!(i%mod)) {
keyoffset=((keyoffset+1)&0xff);
for (x=0;x<256;x++) reversekey[(int) key[((x+keyoffset)&0xff)+1]]=x;
}
outblk[i]=reversekey[(int) inblk[i]];
}
return(blksize);
}
|
Added cipher_psub.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#ifndef _CIPHER_PSUB_H
#define _CIPHER_PSUB_H
#include "dact.h"
#if defined(USE_MODULES) && !defined(AS_MODULE)
#define cipher_psub DACT_FAILED_ALGO
#else
int cipher_psub(const unsigned char *inblock, unsigned char *outblock, const int blksize, unsigned char *key, const int mode);
int cipher_psub_init(const int mode, unsigned char *key);
int cipher_psub_init_getkey(const int mode, unsigned char *key);
char *cipher_psub_generatekey(const char *passphrase);
int cipher_psub_encrypt(const unsigned char *inblk, unsigned char *outblk, int blksize, unsigned char *key);
int cipher_psub_decrypt(const unsigned char *inblk, unsigned char *outblk, int blksize, unsigned char *key);
#endif
#endif
|
Added cipher_psub.lnk.
Added cipher_serpent.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
|
/*
Serpent Cipher from libmcrypt
*/
#include "dact.h"
#include "cipher_serpent.h"
#ifdef HAVE_MCRYPT
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#include <fcntl.h>
#include <stdio.h>
#include <time.h>
#include "parse.h"
#include "ui.h"
#if defined(USE_MODULES) && defined(AS_MODULE)
#include "module.h"
uint32_t DC_NUM=2;
uint32_t DC_TYPE=DACT_MOD_TYPE_ENC;
void *DC_ALGO=cipher_serpent;
char *DC_NAME="serpent (MOD)";
#endif
MCRYPT mcrypt_tdid;
int cipher_serpent(const char *inblock, char *outblock, const int blksize, char *key, const int mode) {
static unsigned char *IV;
switch (mode) {
case (DACT_MODE_CINIT+DACT_MODE_CDEC):
case (DACT_MODE_CINIT+DACT_MODE_CENC):
case DACT_MODE_CINIT:
return(cipher_serpent_init(mode, key, IV));
break;
case DACT_MODE_CDEC:
return(cipher_serpent_decrypt(inblock, outblock, blksize, key, IV));
break;
case DACT_MODE_CENC:
return(cipher_serpent_encrypt(inblock, outblock, blksize, key, IV));
break;
}
return(0);
}
int cipher_serpent_init(const int mode, char *key, unsigned char *IV) {
char *password;
int plen, i;
unsigned char buff;
char *mime_buf;
#ifdef RANDOM_DEV
int fd;
fd=open(RANDOM_DEV, O_RDONLY);
if (fd<0) {
#endif
srand(time(NULL)+rand());
#ifdef RANDOM_DEV
}
#endif
mcrypt_tdid=mcrypt_module_open("serpent", NULL, "cfb", NULL);
if (mcrypt_tdid==MCRYPT_FAILED) {
#ifdef RANDOM_DEV
if (fd>=0) close(fd);
#endif
return(-1);
}
password=dact_ui_getuserinput("Enter your passphrase: ", 128, 1);
memset(key, 1, 16);
plen=strlen(password);
if (plen<16) plen=16;
memcpy(key, password, plen);
if ((mode-DACT_MODE_CINIT)==DACT_MODE_CENC) {
/* mhash_keygen(KEYGEN_MCRYPT, MHASH_MD5, key, 16, NULL, 0, password, strlen(password)); */
plen=mcrypt_enc_get_iv_size(mcrypt_tdid);
IV=malloc(plen);
for (i=0; i<plen; i++) {
#ifdef RANDOM_DEV
if (fd>=0) {
read(fd, &buff, 1);
} else {
#endif
srand(time(NULL)+rand());
buff=(int) ((256.0*rand())/(RAND_MAX+1.0));
#ifdef RANDOM_DEV
}
#endif
IV[i]=buff;
}
mime_buf=mimes64(IV, &plen);
fprintf(stderr, "Magic [needed for decryption]: %s\n", mime_buf);
free(mime_buf);
} else {
plen=mcrypt_enc_get_iv_size(mcrypt_tdid);
IV=dact_ui_getuserinput("Enter your magic key: ", plen*3, 0);
mime_buf=demime64(IV);
memcpy(IV, mime_buf, plen);
free(mime_buf);
}
#ifdef RANDOM_DEV
if (fd>=0) close(fd);
#endif
i=mcrypt_generic_init(mcrypt_tdid, key, 16, IV);
if (i<0) {
mcrypt_perror(i);
return(-1);
}
return(16);
}
int cipher_serpent_encrypt(const char *inblk, char *outblk, int blksize, char *key, unsigned char *IV) {
int i;
memcpy(outblk, inblk, blksize);
for (i=0; i<blksize; i++) {
mcrypt_generic(mcrypt_tdid, &outblk[i], 1);
}
return(blksize);
}
int cipher_serpent_decrypt(const char *inblk, char *outblk, int blksize, char *key, unsigned char *IV) {
int i;
memcpy(outblk, inblk, blksize);
for (i=0; i<blksize; i++) {
mdecrypt_generic(mcrypt_tdid, outblk+i, 1);
}
return(blksize);
}
#else
int cipher_serpent(const char *inblock, char *outblock, const int blksize, char *key, const int mode) {
return(0);
}
#endif
|
Added cipher_serpent.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#ifndef _CIPHER_SERPENT_H
#define _CIPHER_SERPENT_H
#include "dact.h"
#include "comp_fail.h"
#if defined(USE_MODULES) && !defined(AS_MODULE)
#define cipher_serpent DACT_FAILED_ALGO
#else
#if defined(HAVE_LIBMCRYPT) && defined(HAVE_MCRYPT_H)
#define HAVE_MCRYPT 1
#include <mcrypt.h>
int cipher_serpent_init(const int mode, char *key, unsigned char *IV);
int cipher_serpent_encrypt(const char *inblk, char *outblk, int blksize, char *key, unsigned char *IV);
int cipher_serpent_decrypt(const char *inblk, char *outblk, int blksize, char *key, unsigned char *IV);
#endif
int cipher_serpent(const char *inblock, char *outblock, const int blksize, char *key, const int mode);
#endif
#endif
|
Added cipher_serpent.lnk.
Added cipher_sub.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
/*
Encrypt data.
*/
#include "cipher_sub.h"
#include "parse.h"
#include "dact.h"
#include "ui.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#include <fcntl.h>
#include <stdio.h>
#ifndef RANDOM_DEV
#include <time.h>
#endif
#if defined(USE_MODULES) && defined(AS_MODULE)
#include "module.h"
uint32_t DC_NUM=1;
uint32_t DC_TYPE=DACT_MOD_TYPE_ENC;
void *DC_ALGO=cipher_sub;
char *DC_NAME="subst (MOD)";
#endif
int cipher_sub(const char *inblock, char *outblock, const int blksize, char *key, const int mode) {
switch (mode) {
case (DACT_MODE_CINIT+DACT_MODE_CDEC):
case (DACT_MODE_CINIT+DACT_MODE_CENC):
case DACT_MODE_CINIT:
return(cipher_sub_init(mode,key));
break;
case DACT_MODE_CDEC:
return(cipher_sub_decrypt(inblock, outblock, blksize, key));
break;
case DACT_MODE_CENC:
return(cipher_sub_encrypt(inblock, outblock, blksize, key));
break;
}
return(0);
}
int cipher_sub_init(const int mode, char *key) {
return(cipher_sub_init_getkey(mode-DACT_MODE_CINIT,key));
}
int cipher_sub_init_getkey(const int mode, char *key) {
char *fname;
char keybuf[1024], *ptrbuf;
int fd,x=257;
fname=dact_ui_getuserinput("Key file: ",128,0);
fd=open(fname, O_RDONLY);
if (fd>=0) {
x=read(fd, &keybuf, sizeof(keybuf));
if (x==257) {
memcpy(key,keybuf,257); /* For backward compatability with DACT 0.8.1*/
} else {
memcpy(key,ptrbuf=demime64(keybuf),257);
free(ptrbuf);
}
close(fd);
return(257);
}
if (fd<0 && mode==DACT_MODE_CENC) {
fd=open(fname, O_WRONLY|O_CREAT|O_TRUNC, 0600);
if (fd<0) { PERROR("open"); return(0); }
memcpy(key,generatekey(),257);
memcpy(keybuf, ptrbuf=mimes64(key,&x), 400);
write(fd, keybuf, x);
write(fd, "\n", 1);
close(fd);
free(ptrbuf);
return(257);
}
return(-1);
}
int cipher_sub_encrypt(const unsigned char *inblk, unsigned char *outblk, int blksize, unsigned char *key) {
int i,mod;
static int keyoffset=0;
mod=(int) key[0];
for (i=0;i<blksize;i++) {
if (!(i%mod)) {
keyoffset=((keyoffset+1)&0xff);
}
outblk[i]=key[((((int) inblk[i])+keyoffset)&0xff)+1];
}
return(blksize);
}
int cipher_sub_decrypt(const unsigned char *inblk, unsigned char *outblk, int blksize, unsigned char *key) {
int i,mod,x;
char reversekey[256];
static int keyoffset=0;
mod=(int) key[0];
for (i=1;i<257;i++) reversekey[(int) key[i]]=(i-1);
for (i=0;i<blksize;i++) {
if (!(i%mod)) {
keyoffset=((keyoffset+1)&0xff);
for (x=0;x<256;x++) reversekey[(int) key[((x+keyoffset)&0xff)+1]]=x;
}
outblk[i]=reversekey[(int) inblk[i]];
}
return(blksize);
}
char *generatekey(void) {
static char key[257];
char used[256];
int i,x;
#ifdef RANDOM_DEV
unsigned char buff[1];
int fd;
fd=open(RANDOM_DEV, O_RDONLY);
read(fd, buff, 1);
if (buff[0]==0) buff[0]=3;
key[0]=buff[0];
#else
srand(time(NULL)+rand());
key[0]=1+(int) (255.0*rand()/(RAND_MAX+1.0));
#endif
for (i=0;i<256;i++) used[i]=0;
for (i=1;i<257;i++) {
#ifdef RANDOM_DEV
read(fd, buff, 1);
x=buff[0];
#else
srand(time(NULL)+rand());
x=(int) (256.0*rand()/(RAND_MAX+1.0));
#endif
if (used[x]==0) { key[i]=x; used[x]=1; } else { i--; }
}
#ifdef RANDOM_DEV
close(fd);
#endif
return(key);
}
|
Added cipher_sub.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#ifndef _CIPHER_SUB_H
#define _CIPHER_SUB_H
#include "dact.h"
#include "comp_fail.h"
#if defined(USE_MODULES) && !defined(AS_MODULE)
#define cipher_sub DACT_FAILED_ALGO
#else
int cipher_sub(const char *inblock, char *outblock, const int blksize, char *key, const int mode);
int cipher_sub_init(const int mode, char *key);
int cipher_sub_init_getkey(const int mode, char *key);
int cipher_sub_encrypt(const unsigned char *inblk, unsigned char *outblk, int blksize, unsigned char *key);
int cipher_sub_decrypt(const unsigned char *inblk, unsigned char *outblk, int blksize, unsigned char *key);
char *generatekey(void);
#endif
#endif
|
Added cipher_sub.lnk.
Added ciphers.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#ifndef _CIPHERS_H
#define _CIPHERS_H
#include "cipher_chaos.h"
#include "cipher_sub.h"
#include "cipher_serpent.h"
#include "cipher_psub.h"
#ifndef CIPHER_COUNT
#define CIPHER_COUNT 5
#endif
#ifdef __DACT_C
int (*(ciphers[CIPHER_COUNT]))()={
cipher_chaos,
cipher_sub,
#ifdef HAVE_LIBMCRYPT
cipher_serpent,
#else
NULL,
#endif
cipher_psub,
NULL
};
char *ciphers_name[CIPHER_COUNT]={ /* These must be lower-cased */
"chaos",
"subst",
#ifdef HAVE_LIBMCRYPT
"serpent",
#else
NULL,
#endif
"psubst",
NULL
};
#else
extern int (*(ciphers[CIPHER_COUNT]))();
extern char *ciphers_name[CIPHER_COUNT];
#endif
#endif
|
Added comp_bitsums.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#include "dact.h"
#include "comp_bitsums.h"
#include <stdio.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
/*
mode - DACT_MODE_COMPR or DACT_MODE_DECMP
Determine whether to compress or decompress.
prev_block - Previous (uncompressed) block.
curr_block - The data to be compressed.
out_block - Where to put data after compression.
blk_size - Size of prev_block and curr_block.
*/
#if defined(AS_MODULE) && defined(USE_MODULES)
#include "module.h"
uint32_t DC_NUM=11;
uint32_t DC_TYPE=DACT_MOD_TYPE_COMP;
void *DC_ALGO=comp_bitsums_algo;
char *DC_NAME="Bitsums Compression (MOD)";
#endif
int comp_bitsums_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
switch(mode) {
case DACT_MODE_COMPR:
return(comp_bitsums_compress(prev_block,curr_block,out_block,blk_size));
break; /* Heh */
case DACT_MODE_DECMP:
return(comp_bitsums_decompress(prev_block,curr_block,out_block,blk_size));
break;
default:
fprintf(stderr, "Unsupported mode: %i\n", mode);
return(-1);
}
}
int comp_bitsums_compress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
return(-1);
}
int comp_bitsums_decompress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
fprintf(stderr, "Not yet supported.\n");
return(0);
}
|
Added comp_bitsums.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#ifndef _COMP_BITSUMS_H
#define _COMP_BITSUMS_H
#include "dact.h"
#include "config.h"
#if defined(USE_MODULES) && !defined(AS_MODULE)
#define comp_bitsums_algo DACT_FAILED_ALGO
#else
int comp_bitsums_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
int comp_bitsums_compress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
int comp_bitsums_decompress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
#endif
#endif
|
Added comp_bitsums.lnk.
Added comp_bzlib.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#include "dact.h"
#include "comp_bzlib.h"
#ifdef HAVE_LIBBZ2
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include <stdio.h>
#ifdef HAVE_BZLIB_H
#include <bzlib.h>
#endif
/*
mode - DACT_MODE_COMPR or DACT_MODE_DECMP
Determine whether to compress or decompress.
prev_block - Previous (uncompressed) block.
curr_block - The data to be compressed.
out_block - Where to put data after compression.
blk_size - Size of prev_block and curr_block.
*/
#if defined(USE_MODULES) && defined(AS_MODULE)
#include "module.h"
uint32_t DC_NUM=9;
uint32_t DC_TYPE=DACT_MOD_TYPE_COMP;
void *DC_ALGO=comp_bzlib_algo;
char *DC_NAME="Bzip2 Compression (MOD)";
#endif
int comp_bzlib_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
switch(mode) {
case DACT_MODE_COMPR:
return(comp_bzlib_compress(prev_block,curr_block,out_block,blk_size));
break; /* Heh */
case DACT_MODE_DECMP:
return(comp_bzlib_decompress(prev_block,curr_block,out_block,blk_size));
break;
default:
fprintf(stderr, "Unsupported mode: %i\n", mode);
return(-1);
}
}
int comp_bzlib_compress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
unsigned int dest_size=(DACT_BLK_SIZE*2);
int retval;
#ifdef HAVE_OLD_BZ2
retval=bzBuffToBuffCompress(out_block, &dest_size, curr_block, blk_size, 9, 0, 9);
#else
retval=BZ2_bzBuffToBuffCompress(out_block, &dest_size, curr_block, blk_size, 9, 0, 9);
#endif
/* Remove the "BZh9" header. */
dest_size-=4;
memmove(out_block, out_block+4, dest_size);
if (retval!=BZ_OK) return(-1);
return(dest_size);
}
int comp_bzlib_decompress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
unsigned int dest_size=(DACT_BLK_SIZE*2);
char *tmpbuf;
int retval;
/* Replant the header. */
tmpbuf=malloc(blk_size+4);
memcpy(tmpbuf, "BZh9", 4);
memcpy(tmpbuf+4, curr_block, blk_size);
#ifdef HAVE_OLD_BZ2
retval=bzBuffToBuffDecompress(out_block, &dest_size, tmpbuf, blk_size+4, 0, 0);
#else
retval=BZ2_bzBuffToBuffDecompress(out_block, &dest_size, tmpbuf, blk_size+4, 0, 0);
#endif
free(tmpbuf);
if (retval!=BZ_OK) return(0);
return(dest_size);
}
#endif
|
Added comp_bzlib.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#ifndef _COMP_BZLIB_H
#define _COMP_BZLIB_H
#include "dact.h"
#include "config.h"
#if defined(USE_MODULES) && !defined(AS_MODULE)
#define comp_bzlib_algo DACT_FAILED_ALGO
#else
int comp_bzlib_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
int comp_bzlib_compress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
int comp_bzlib_decompress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
#endif
#endif
|
Added comp_bzlib.lnk.
Added comp_delta.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#include "dact.h"
#include "comp_delta.h"
#include "buffer.h"
#include <stdio.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
/*
mode - DACT_MODE_COMPR or DACT_MODE_DECMP
Determine whether to compress or decompress.
prev_block - Previous (uncompressed) block.
curr_block - The data to be compressed.
out_block - Where to put data after compression.
blk_size - Size of prev_block and curr_block.
*/
#if defined(USE_MODULES) && defined(AS_MODULE)
#include "module.h"
uint32_t DC_NUM=2;
uint32_t DC_TYPE=DACT_MOD_TYPE_COMP;
void *DC_ALGO=comp_delta_algo;
char *DC_NAME="Delta Compression (MOD)";
#endif
int comp_delta_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
switch(mode) {
case DACT_MODE_COMPR:
return(comp_delta_compress(prev_block,curr_block,out_block,blk_size));
break; /* Heh */
case DACT_MODE_DECMP:
return(comp_delta_decompress(prev_block,curr_block,out_block,blk_size));
break;
default:
printf("Unsupported mode: %i\n", mode);
return(-1);
}
}
int comp_delta_compress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
int i,x=0,y=0;
char Val;
unsigned char CurrByte, PrevByte;
signed char DeltaByte;
bit_buffer_purge();
CurrByte=curr_block[0];
out_block[x]=CurrByte;
for (i=1;i<blk_size;i++) {
PrevByte=CurrByte;
CurrByte=curr_block[i];
DeltaByte=(CurrByte-PrevByte);
if (abs(DeltaByte)<32) {
Val=(((1<<6) | (( ( DeltaByte<0 ))<<5) | (abs(DeltaByte)&33)));
bit_buffer_write(Val,7);
} else {
bit_buffer_write(CurrByte,9);
}
y=bit_buffer_size();
while (y>=8 && y!=16) {
out_block[++x]=bit_buffer_read(8);
if (x>=DACT_BLK_SIZE*2) return(-1);
y=bit_buffer_size();
}
}
y=bit_buffer_size();
if (y!=0) {
out_block[++x]=(bit_buffer_read(y)<<(8-y));
}
return(x+1);
}
int comp_delta_decompress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
int i=0,x=0;
unsigned char CurrByte;
unsigned char DeltaByte;
char CompBit;
char Neg;
char Val;
CurrByte=curr_block[0];
bit_buffer_purge();
while (1) {
if ((bit_buffer_size()<=8) && i==blk_size) break;
if ((bit_buffer_size()<=8) && i!=blk_size)
bit_buffer_write((unsigned char) curr_block[++i],8);
CompBit=bit_buffer_read(1);
if ((bit_buffer_size()<=8) && i!=blk_size)
bit_buffer_write((unsigned char) curr_block[++i],8);
if (CompBit==1) {
Neg=bit_buffer_read(1);
DeltaByte=bit_buffer_read(5);
Val=CurrByte+(((-2*Neg)+1)*DeltaByte);
} else {
Val=bit_buffer_read(8);
}
out_block[x++]=CurrByte;
CurrByte=Val;
}
return(x);
}
|
Added comp_delta.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#ifndef _COMP_DELTA_H
#define _COMP_DELTA_H
#include "dact.h"
#include "config.h"
#if defined(USE_MODULES) && !defined(AS_MODULE)
#define comp_delta_algo DACT_FAILED_ALGO
#else
int comp_delta_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
int comp_delta_compress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
int comp_delta_decompress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
#endif
#endif
|
Added comp_delta.lnk.
Added comp_factor.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#include "dact.h"
#include "comp_factor.h"
#include <stdio.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
/*
mode - DACT_MODE_COMPR or DACT_MODE_DECMP
Determine whether to compress or decompress.
prev_block - Previous (uncompressed) block.
curr_block - The data to be compressed.
out_block - Where to put data after compression.
blk_size - Size of prev_block and curr_block.
*/
#if defined(AS_MODULE) && defined(USE_MODULES)
#include "module.h"
uint32_t DC_NUM=10;
uint32_t DC_TYPE=DACT_MOD_TYPE_COMP;
void *DC_ALGO=comp_factor_algo;
char *DC_NAME="Factor Compression (MOD)";
#endif
int comp_factor_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
switch(mode) {
case DACT_MODE_COMPR:
return(comp_factor_compress(prev_block,curr_block,out_block,blk_size));
break; /* Heh */
case DACT_MODE_DECMP:
return(comp_factor_decompress(prev_block,curr_block,out_block,blk_size));
break;
default:
fprintf(stderr, "Unsupported mode: %i\n", mode);
return(-1);
}
}
int comp_factor_compress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
return(-1);
}
int comp_factor_decompress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
fprintf(stderr, "Not yet supported.\n");
return(0);
}
|
Added comp_factor.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#ifndef _COMP_FACTOR_H
#define _COMP_FACTOR_H
#if defined(USE_MODULES) && !defined(AS_MODULE)
#define comp_factor_algo DACT_FAILED_ALGO
#else
int comp_factor_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
int comp_factor_compress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
int comp_factor_decompress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
#endif
#endif
|
Added comp_factor.lnk.
Added comp_fail.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
/*
Ignore requests for compression and return errors for decompression.
Stub algorithm.
*/
#include "dact.h"
#include "comp_fail.h"
#include <stdio.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
/*
mode - DACT_MODE_COMPR or DACT_MODE_DECMP
Determine whether to compress or decompress.
prev_block - Previous (uncompressed) block.
curr_block - The data to be compressed.
out_block - Where to put data after compression.
blk_size - Size of prev_block and curr_block.
*/
int comp_fail_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
switch(mode) {
case DACT_MODE_COMPR:
return(comp_fail_compress(prev_block,curr_block,out_block,blk_size));
break; /* Heh */
case DACT_MODE_DECMP:
return(comp_fail_decompress(prev_block,curr_block,out_block,blk_size));
break;
default:
printf("Unsupported mode: %i\n", mode);
return(-1);
}
}
int comp_fail_compress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
return(-1);
}
int comp_fail_decompress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
printf("You tried to decompress a file with an algorithm that is not compiled into your version. Output will be unusable.\n");
return(0);
}
|
Added comp_fail.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#ifndef _COMP_FAIL_H
#define _COMP_FAIL_H
int comp_fail_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
int comp_fail_compress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
int comp_fail_decompress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
#endif
|
Added comp_lzoox.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#include "dact.h"
#include "comp_lzoox.h"
#ifndef comp_lzoox_algo
#include <lzoconf.h>
#include <lzo1x.h>
#include <stdio.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
/*
mode - DACT_MODE_COMPR or DACT_MODE_DECMP
Determine whether to compress or decompress.
prev_block - Previous (uncompressed) block.
curr_block - The data to be compressed.
out_block - Where to put data after compression.
blk_size - Size of prev_block and curr_block.
*/
#if defined(AS_MODULE) && defined(USE_MODULES)
#include "module.h"
uint32_t DC_NUM=13;
uint32_t DC_TYPE=DACT_MOD_TYPE_COMP;
void *DC_ALGO=comp_lzoox_algo;
char *DC_NAME="LZO-1x Compression (MOD)";
/*
char *DC_SIGN="RGlnaXRhbFNpZ25hdHVyZQ==";
char *DC_URL_GET="http://www.rkeene.org/projects/compression/dact/@@OSNM@@-@@ARCH@@/comp_rle.dll";
char *DC_URL_VER="http://www.rkeene.org/projects/compression/dact/@@OSNM@@-@@ARCH@@/comp_rle.ver";
uint32_t DC_VER=0x00080d;
uint32_t DC_REQUIRE=DACT_MOD_REQ_ATLEAST|(0x00080d);
*/
#endif
int comp_lzoox_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
switch(mode) {
case DACT_MODE_COMPR:
return(comp_lzoox_compress(prev_block,curr_block,out_block,blk_size));
break; /* Heh */
case DACT_MODE_DECMP:
return(comp_lzoox_decompress(prev_block,curr_block,out_block,blk_size));
break;
default:
printf("Unsupported mode: %i\n", mode);
return(-1);
}
}
int comp_lzoox_compress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
int retsize=0;
char *wrkmem;
if ((wrkmem=malloc(LZO1X_999_MEM_COMPRESS))==NULL) return(-1);
if (lzo_init()!=LZO_E_OK) return(-1);
lzo1x_999_compress(curr_block, blk_size, out_block, &retsize, wrkmem);
free(wrkmem);
return(retsize);
}
int comp_lzoox_decompress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
int retsize=0, retval;
if (lzo_init()!=LZO_E_OK) return(-1);
retval=lzo1x_decompress(curr_block, blk_size, out_block, &retsize, NULL);
if (retval!=LZO_E_OK) return(-1);
return(retsize);
}
#endif
|
Added comp_lzoox.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#ifndef _COMP_LZOOX_H
#define _COMP_LZOOX_H
#include "dact.h"
#include "config.h"
#if (defined(USE_MODULES) && !defined(AS_MODULE)) || !defined(HAVE_LIBLZO) || !defined(HAVE_LZOCONF_H) || !defined(HAVE_LZO1X_H)
#define comp_lzoox_algo DACT_FAILED_ALGO
#else
int comp_lzoox_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
int comp_lzoox_compress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
int comp_lzoox_decompress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
#endif
#endif
|
Added comp_lzoox.lnk.
Added comp_lzooy.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#include "dact.h"
#include "comp_lzooy.h"
#ifndef comp_lzooy_algo
#include <lzoconf.h>
#include <lzo1y.h>
#include <stdio.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
/*
mode - DACT_MODE_COMPR or DACT_MODE_DECMP
Determine whether to compress or decompress.
prev_block - Previous (uncompressed) block.
curr_block - The data to be compressed.
out_block - Where to put data after compression.
blk_size - Size of prev_block and curr_block.
*/
#if defined(AS_MODULE) && defined(USE_MODULES)
#include "module.h"
uint32_t DC_NUM=14;
uint32_t DC_TYPE=DACT_MOD_TYPE_COMP;
void *DC_ALGO=comp_lzooy_algo;
char *DC_NAME="LZO-1y Compression (MOD)";
/*
char *DC_SIGN="RGlnaXRhbFNpZ25hdHVyZQ==";
char *DC_URL_GET="http://www.rkeene.org/projects/compression/dact/@@OSNM@@-@@ARCH@@/comp_rle.dll";
char *DC_URL_VER="http://www.rkeene.org/projects/compression/dact/@@OSNM@@-@@ARCH@@/comp_rle.ver";
uint32_t DC_VER=0x00080d;
uint32_t DC_REQUIRE=DACT_MOD_REQ_ATLEAST|(0x00080d);
*/
#endif
int comp_lzooy_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
switch(mode) {
case DACT_MODE_COMPR:
return(comp_lzooy_compress(prev_block,curr_block,out_block,blk_size));
break; /* Heh */
case DACT_MODE_DECMP:
return(comp_lzooy_decompress(prev_block,curr_block,out_block,blk_size));
break;
default:
printf("Unsupported mode: %i\n", mode);
return(-1);
}
}
int comp_lzooy_compress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
int retsize=0;
char *wrkmem;
if ((wrkmem=malloc(LZO1Y_999_MEM_COMPRESS))==NULL) return(-1);
if (lzo_init()!=LZO_E_OK) return(-1);
lzo1y_999_compress(curr_block, blk_size, out_block, &retsize, wrkmem);
free(wrkmem);
return(retsize);
}
int comp_lzooy_decompress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
int retsize=0, retval;
if (lzo_init()!=LZO_E_OK) return(-1);
retval=lzo1y_decompress(curr_block, blk_size, out_block, &retsize, NULL);
if (retval!=LZO_E_OK) return(-1);
return(retsize);
}
#endif
|
Added comp_lzooy.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#ifndef _COMP_LZOOY_H
#define _COMP_LZOOY_H
#include "dact.h"
#include "config.h"
#if (defined(USE_MODULES) && !defined(AS_MODULE)) || !defined(HAVE_LIBLZO) || !defined(HAVE_LIBLZO) || !defined(HAVE_LZO1Y_H)
#define comp_lzooy_algo DACT_FAILED_ALGO
#else
int comp_lzooy_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
int comp_lzooy_compress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
int comp_lzooy_decompress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
#endif
#endif
|
Added comp_lzooy.lnk.
Added comp_lzota.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#include "dact.h"
#include "comp_lzota.h"
#ifndef comp_lzota_algo
#include <lzoconf.h>
#include <lzo2a.h>
#include <stdio.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
/*
mode - DACT_MODE_COMPR or DACT_MODE_DECMP
Determine whether to compress or decompress.
prev_block - Previous (uncompressed) block.
curr_block - The data to be compressed.
out_block - Where to put data after compression.
blk_size - Size of prev_block and curr_block.
*/
#if defined(AS_MODULE) && defined(USE_MODULES)
#include "module.h"
uint32_t DC_NUM=15;
uint32_t DC_TYPE=DACT_MOD_TYPE_COMP;
void *DC_ALGO=comp_lzota_algo;
char *DC_NAME="LZO-2a Compression (MOD)";
/*
char *DC_SIGN="RGlnaXRhbFNpZ25hdHVyZQ==";
char *DC_URL_GET="http://www.rkeene.org/projects/compression/dact/@@OSNM@@-@@ARCH@@/comp_rle.dll";
char *DC_URL_VER="http://www.rkeene.org/projects/compression/dact/@@OSNM@@-@@ARCH@@/comp_rle.ver";
uint32_t DC_VER=0x00080d;
uint32_t DC_REQUIRE=DACT_MOD_REQ_ATLEAST|(0x00080d);
*/
#endif
int comp_lzota_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
switch(mode) {
case DACT_MODE_COMPR:
return(comp_lzota_compress(prev_block,curr_block,out_block,blk_size));
break; /* Heh */
case DACT_MODE_DECMP:
return(comp_lzota_decompress(prev_block,curr_block,out_block,blk_size));
break;
default:
printf("Unsupported mode: %i\n", mode);
return(-1);
}
}
int comp_lzota_compress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
int retsize=0;
char *wrkmem;
if ((wrkmem=malloc(LZO2A_999_MEM_COMPRESS))==NULL) return(-1);
if (lzo_init()!=LZO_E_OK) return(-1);
lzo2a_999_compress(curr_block, blk_size, out_block, &retsize, wrkmem);
free(wrkmem);
return(retsize);
}
int comp_lzota_decompress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
int retsize=0, retval;
if (lzo_init()!=LZO_E_OK) return(-1);
retval=lzo2a_decompress(curr_block, blk_size, out_block, &retsize, NULL);
if (retval!=LZO_E_OK) return(-1);
return(retsize);
}
#endif
|
Added comp_lzota.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#ifndef _COMP_LZOTA_H
#define _COMP_LZOTA_H
#include "dact.h"
#include "config.h"
#if (defined(USE_MODULES) && !defined(AS_MODULE)) || !defined(HAVE_LIBLZO) || !defined(HAVE_LIBLZO) || !defined(HAVE_LZO2A_H)
#define comp_lzota_algo DACT_FAILED_ALGO
#else
int comp_lzota_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
int comp_lzota_compress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
int comp_lzota_decompress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
#endif
#endif
|
Added comp_lzota.lnk.
Added comp_mzlib.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#include "dact.h"
#include "comp_mzlib.h"
#ifdef HAVE_LIBZ
#include <stdio.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_ZLIB_H
#include <zlib.h>
#endif
/*
mode - DACT_MODE_COMPR or DACT_MODE_DECMP
Determine whether to compress or decompress.
prev_block - Previous (uncompressed) block.
curr_block - The data to be compressed.
out_block - Where to put data after compression.
blk_size - Size of prev_block and curr_block.
*/
#if defined(USE_MODULES) && defined(AS_MODULE)
#include "module.h"
uint32_t DC_NUM=5;
uint32_t DC_TYPE=DACT_MOD_TYPE_COMP;
void *DC_ALGO=comp_mzlib_algo;
char *DC_NAME="Modifed Zlib Compression (MOD)";
#endif
int comp_mzlib_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
switch(mode) {
case DACT_MODE_COMPR:
return(comp_mzlib_compress(prev_block,curr_block,out_block,blk_size));
break; /* Heh */
case DACT_MODE_DECMP:
return(comp_mzlib_decompress(prev_block,curr_block,out_block,blk_size));
break;
default:
printf("Unsupported mode: %i\n", mode);
return(-1);
}
}
int comp_mzlib_compress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
unsigned long dest_size;
char *tmp_block;
int retval;
int i;
dest_size=(int) ((float) (blk_size*1.02)+15);
if ((tmp_block=malloc(dest_size))==NULL) {
return(-1);
}
memcpy(tmp_block,curr_block,blk_size);
for (i=0;i<blk_size;i++) {
/*
tmp_block[i]=( \
( (tmp_block[i]&0x80) >> 7 ) + \
( (tmp_block[i]&0x20) >> 4 ) + \
( (tmp_block[i]&0x08) >> 1 ) + \
( (tmp_block[i]&0x02) << 2 ) + \
( (tmp_block[i]&0x40) >> 2 ) + \
( (tmp_block[i]&0x10) << 1 ) + \
( (tmp_block[i]&0x04) << 4 ) + \
( (tmp_block[i]&0x01) << 7 ) \
);
*/
tmp_block[i]=( ((tmp_block[i]&0xf0)>>4) + ( (tmp_block[i]&0x0f) <<4) );
}
#ifdef HAVE_COMPRESS2
retval=compress2(out_block, &dest_size, tmp_block, blk_size, Z_BEST_COMPRESSION);
#else
retval=compress(out_block, &dest_size, tmp_block, blk_size);
#endif
if (retval!=Z_OK) {
return(-1);
}
free(tmp_block);
return(dest_size);
}
int comp_mzlib_decompress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
unsigned long dest_size=(DACT_BLK_SIZE*2);
int retval;
int i;
retval=uncompress(out_block,&dest_size,curr_block,blk_size);
if (retval!=Z_OK) {
return(0);
}
for (i=0;i<dest_size;i++) {
out_block[i]=( ( (out_block[i]&0xf0)>>4) + ((out_block[i]&0x0f)<<4) );
}
return(dest_size);
}
#endif
|
Added comp_mzlib.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#ifndef _COMP_MZLIB_H
#define _COMP_MZLIB_H
#include "dact.h"
#include "config.h"
#if defined(USE_MODULES) && !defined(AS_MODULE)
#define comp_mzlib_algo DACT_FAILED_ALGO
#else
int comp_mzlib_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
int comp_mzlib_compress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
int comp_mzlib_decompress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
#endif
#endif
|
Added comp_mzlib.lnk.
Added comp_mzlib2.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
/*
Compress by gathering bytes that are most often placed near each other
and rearranging the ASCII Charectar Set to make those bytes have
similar values.
*/
#include "dact.h"
#include "comp_mzlib2.h"
#ifndef comp_mzlib2_algo
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB_H
#include <zlib.h>
#endif
#include <stdio.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include "sort.h"
#define SQRD_256 65536
/*
mode - DACT_MODE_COMPR or DACT_MODE_DECMP
Determine whether to compress or decompress.
prev_block - Previous (uncompressed) block.
curr_block - The data to be compressed.
out_block - Where to put data after compression.
blk_size - Size of prev_block and curr_block.
*/
#if defined(USE_MODULES) && defined(AS_MODULE)
#include "module.h"
uint32_t DC_NUM=8;
uint32_t DC_TYPE=DACT_MOD_TYPE_COMP;
void *DC_ALGO=comp_mzlib2_algo;
char *DC_NAME="Second Modified Zlib Compression (MOD)";
#endif
#ifdef DEBUG
#if DEBUG>=2
#define MAKE_MZLIB2 1
#endif
#endif
#ifdef MAKE_MZLIB2
int comp_mzlib2_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
switch(mode) {
case DACT_MODE_COMPR:
return(comp_mzlib2_compress(prev_block,curr_block,out_block,blk_size));
break; /* Heh */
case DACT_MODE_DECMP:
return(comp_mzlib2_decompress(prev_block,curr_block,out_block,blk_size));
break;
default:
printf("Unsupported mode: %i\n", mode);
return(-1);
}
}
#else
int comp_mzlib2_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
return(-1);
}
#endif
int comp_mzlib2_compress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
unsigned long dest_size;
unsigned char *tmp_block;
uint32_t freq[SQRD_256];
uint16_t lookup_table[SQRD_256], curr_val, repl_val;
int i, cnt, m=2, retval, low_byte=0, x;
memset(freq,0,sizeof(freq));
for (i=0;i<blk_size;i+=2) {
x=(curr_block[i]<<8)|(curr_block[i+1]);
freq[x]++;
//SPOTVAR_NUM(freq[x]);
if (freq[x]==0xffff) return(-1);
}
// for (i=0;i<SQRD_256;i++) {
// if (freq[i]!=0) {
// PRINT_LINE; fprintf(stderr, "%04x: 0x%02x and 0x%02x are near each other %i times\n",i,i>>8,i&0xff,freq[i]);
// }
// }
int_sort_fast(freq, SQRD_256, 0);
for (i=0;i<(SQRD_256);i++) {
if ((freq[i]&0xffff)!=0) {
out_block[m++]=freq[i]>>24;
out_block[m++]=(freq[i]>>16)&0xff;
if (m>=(DACT_BLK_SIZE*2)) {
//SPOTVAR_NUM(m);
return(-1);
}
lookup_table[freq[i]>>16]=i;
PRINT_LINE; fprintf(stderr, "%04x: 0x%02x and 0x%02x are near each other %i times\n",i,(freq[i]>>24),(freq[i]>>16)&0xff,freq[i]&0xffff);
} else {
break;
}
}
cnt=(m-2);
out_block[0]=((m-2)>>8);
out_block[1]=((m-2)&0xff);
if ((m-2)<0x200) low_byte=1;
for (i=0;i<blk_size;i+=2) {
curr_val=((curr_block[i]<<8)| curr_block[i+1]);
repl_val=lookup_table[curr_val];
if (!low_byte)
out_block[m++]=repl_val>>8;
out_block[m++]=repl_val&0xff;
SPOTVAR_NUM(m);
if (m>=(DACT_BLK_SIZE*2)) return(-1);
}
dest_size=(int) ((float) ((m*1.02)+15));
SPOTVAR_NUM(dest_size);
if ((tmp_block=malloc(dest_size))==NULL) {
return(-1);
}
memcpy(tmp_block,out_block,m);
/*
for (i=0;i<m;i++) {
printf("%02x ", tmp_block[i]);
if (i==(cnt+2)) printf("-- ");
if (((i+1)%25)==0) printf("\n");
}
printf("\n\n");
*/
/*
for (i=0;i<blk_size;i++) printf("%02x ", curr_block[i]);
printf("\n");
*/
retval=compress(out_block, &dest_size, tmp_block, m);
if (retval!=Z_OK) {
return(blk_size*2);
}
free(tmp_block);
return(dest_size);
}
int comp_mzlib2_decompress(unsigned char *prev_block, unsigned char *curr_block, unsigned char *out_block, int blk_size) {
uint16_t lookup_table[SQRD_256], curr_val, repl_val;
unsigned long dest_size=(DACT_BLK_SIZE*2);
unsigned char *tmp_block;
unsigned int m=0, hdrsize;
int retval, i, low_byte=0;
tmp_block=malloc(dest_size);
retval=uncompress(tmp_block,&dest_size,curr_block,blk_size);
if (retval!=Z_OK) return(0);
hdrsize=((unsigned int) (((tmp_block[0]<<8)|tmp_block[1])))+2;
if ((hdrsize-2)<0x200) low_byte=1;
for (i=2;i<hdrsize;i+=2) {
lookup_table[(i-2)/2]=((tmp_block[i]<<8)|tmp_block[i+1]);
}
for (i=hdrsize;i<(dest_size);i+=(2-low_byte)) {
if (low_byte) {
curr_val=tmp_block[i];
} else {
curr_val=((tmp_block[i]<<8)|tmp_block[i+1]);
}
repl_val=lookup_table[curr_val];
out_block[m++]=repl_val>>8;
out_block[m++]=repl_val&0xff;
}
/*
for (i=0;i<m;i++) printf("%02x ", out_block[i]);
printf("\n");
*/
free(tmp_block);
return(m);
}
#endif
#endif
|
Added comp_mzlib2.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#ifndef _COMP_MZLIB2_H
#define _COMP_MZLIB2_H
#include "dact.h"
#include "config.h"
#if (defined(USE_MODULES) && !defined(AS_MODULE)) || !defined(DEBUG)
#define comp_mzlib2_algo DACT_FAILED_ALGO
#else
int comp_mzlib2_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
int comp_mzlib2_compress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
int comp_mzlib2_decompress(unsigned char *prev_block, unsigned char *curr_block,unsigned char *out_block, int blk_size);
#endif
#endif
|
Added comp_mzlib2.lnk.
Added comp_plain.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
/*
Example block compression routine for interfacing with DACT.
This does no compression.
(This is used as the minimum case, so block can be atmost blk_size
+3 bytes in size)
*/
#include "dact.h"
#include "comp_plain.h"
#include <stdio.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
/*
mode - DACT_MODE_COMPR or DACT_MODE_DECMP
Determine whether to compress or decompress.
prev_block - Previous (uncompressed) block.
curr_block - The data to be compressed.
out_block - Where to put data after compression.
blk_size - Size of prev_block and curr_block.
*/
int comp_plain_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
switch(mode) {
case DACT_MODE_COMPR:
return(comp_plain_compress(prev_block,curr_block,out_block,blk_size));
break; /* Heh */
case DACT_MODE_DECMP:
return(comp_plain_decompress(prev_block,curr_block,out_block,blk_size));
break;
default:
printf("Unsupported mode: %i\n", mode);
return(-1);
}
}
int comp_plain_compress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
memcpy(out_block,curr_block,blk_size);
return(blk_size);
}
int comp_plain_decompress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
memcpy(out_block,curr_block,blk_size);
return(blk_size);
}
|
Added comp_plain.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#ifndef _COMP_PLAIN_H
#define _COMP_PLAIN_H
int comp_plain_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
int comp_plain_compress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
int comp_plain_decompress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
#endif
|
Added comp_rle.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#include "dact.h"
#include "comp_rle.h"
#include <stdio.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
/*
mode - DACT_MODE_COMPR or DACT_MODE_DECMP
Determine whether to compress or decompress.
prev_block - Previous (uncompressed) block.
curr_block - The data to be compressed.
out_block - Where to put data after compression.
blk_size - Size of prev_block and curr_block.
*/
#if defined(AS_MODULE) && defined(USE_MODULES)
#include "module.h"
uint32_t DC_NUM=1;
uint32_t DC_TYPE=DACT_MOD_TYPE_COMP;
void *DC_ALGO=comp_rle_algo;
char *DC_NAME="RLE Compression (MOD)";
char *DC_SIGN="RGlnaXRhbFNpZ25hdHVyZQ==";
char *DC_URL_GET="http://www.rkeene.org/projects/compression/dact/@@OSNM@@-@@ARCH@@/comp_rle.dll";
char *DC_URL_VER="http://www.rkeene.org/projects/compression/dact/@@OSNM@@-@@ARCH@@/comp_rle.ver";
uint32_t DC_VER=0x00080d;
uint32_t DC_REQUIRE=DACT_MOD_REQ_ATLEAST|(0x00080d);
#endif
int comp_rle_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
switch(mode) {
case DACT_MODE_COMPR:
return(comp_rle_compress(prev_block,curr_block,out_block,blk_size));
break; /* Heh */
case DACT_MODE_DECMP:
return(comp_rle_decompress(prev_block,curr_block,out_block,blk_size));
break;
default:
printf("Unsupported mode: %i\n", mode);
return(-1);
}
}
int comp_rle_compress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
int i,x=0,m;
unsigned char sentinel=0xff;
unsigned char currchar=0, prevchar;
unsigned char charcnt=0;
unsigned int lowestcnt=0xffff;
unsigned int count[256];
for (i=0;i<256;i++) count[i]=0;
for (i=0;i<blk_size;i++) count[curr_block[i]]++;
for (i=0;i<256;i++) {
if (count[i]<lowestcnt) {
sentinel=i;
lowestcnt=count[i];
}
}
out_block[x++]=sentinel;
prevchar=curr_block[0];
for (i=0;i<(blk_size+1);i++) {
if (i!=blk_size) { currchar=curr_block[i]; } else { currchar++; }
if (prevchar!=currchar || charcnt==255 || i>=(blk_size)) {
if (charcnt<=2 && prevchar!=sentinel) {
for (m=0;m<charcnt;m++) out_block[x++]=prevchar;
} else {
out_block[x++]=sentinel;
out_block[x++]=prevchar;
out_block[x++]=charcnt;
}
charcnt=0;
}
charcnt++;
prevchar=currchar;
}
return(x);
}
int comp_rle_decompress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
int i,x=0,m;
unsigned char sentinel=curr_block[0];
unsigned char currchar;
unsigned char charcnt;
for (i=1;i<blk_size;i++) {
currchar=curr_block[i];
if (currchar==sentinel) {
currchar=curr_block[++i];
charcnt=curr_block[++i];
if ((x+charcnt)>DACT_BLK_SIZE) {
printf("Error in RLE compression!\n");
return(0);
}
for (m=0;m<charcnt;m++) out_block[x++]=currchar;
} else {
out_block[x++]=currchar;
}
}
return(x);
}
|
Added comp_rle.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#ifndef _COMP_RLE_H
#define _COMP_RLE_H
#include "dact.h"
#include "config.h"
#if defined(USE_MODULES) && !defined(AS_MODULE)
#define comp_rle_algo DACT_FAILED_ALGO
#else
int comp_rle_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
int comp_rle_compress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
int comp_rle_decompress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
#endif
#endif
|
Added comp_rle.lnk.
Added comp_snibble.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
/*
Example block compression routine for interfacing with DACT.
Seminibble Compression (Actually, a 2bit Huffman Implementation)
*/
#include "dact.h"
#include "comp_snibble.h"
#include "buffer.h"
#include "sort.h"
#include <stdio.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
/*
mode - DACT_MODE_COMPR or DACT_MODE_DECMP
Determine whether to compress or decompress.
prev_block - Previous (uncompressed) block.
curr_block - The data to be compressed.
out_block - Where to put data after compression.
blk_size - Size of prev_block and curr_block.
*/
#if defined(USE_MODULES) && defined(AS_MODULE)
#include "module.h"
uint32_t DC_NUM=6;
uint32_t DC_TYPE=DACT_MOD_TYPE_COMP;
void *DC_ALGO=comp_snibble_algo;
char *DC_NAME="Seminibble Encoding (MOD)";
#endif
int comp_snibble_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
switch(mode) {
case DACT_MODE_COMPR:
return(comp_snibble_compress(prev_block,curr_block,out_block,blk_size));
break; /* Heh */
case DACT_MODE_DECMP:
return(comp_snibble_decompress(prev_block,curr_block,out_block,blk_size));
break;
default:
printf("Unsupported mode: %i\n", mode);
return(-1);
}
}
int comp_snibble_compress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
char *curr_cpy;
const static unsigned char hash_table[4]={0, 2, 6, 7};
const static unsigned char hash_len[8]= {1, 0, 2, 0, 0, 0, 3, 3};
uint32_t freq[4]={0, 0, 0, 0};
unsigned char lookup_table[4]={0, 0, 0, 0};
int i,x,m,g=0;
if ((curr_cpy=malloc(blk_size))==NULL) {
return(-1);
}
memcpy(curr_cpy,curr_block,blk_size);
bit_buffer_purge();
for (i=0;i<blk_size;i++) {
freq[(int) ((curr_cpy[i]&0xc0)>>6)]++;
freq[(int) ((curr_cpy[i]&0x30)>>4)]++;
freq[(int) ((curr_cpy[i]&0x0c)>>2)]++;
freq[(int) ((curr_cpy[i]&0x03))]++;
}
int_sort(freq,4,1);
for (i=0;i<4;i++) lookup_table[freq[i]]=hash_table[i];
bit_buffer_write(freq[0],2);
bit_buffer_write(freq[1],2);
bit_buffer_write(freq[2],2);
/*
outsize=((int) ((((((float) (freq[0]&0xffff))/2)+(freq[1]&0xffff)+(((float) (freq[2]&0xffff)+(freq[3]&0xffff))*1.5))/4.0)+0.99));
*/
for (i=0;i<blk_size;i++) {
for (x=0;x<4;x++) {
m=((curr_cpy[i]&(3<<(x*2)))>>( x*2 )) ;
bit_buffer_write(lookup_table[m],hash_len[lookup_table[m]]);
while (bit_buffer_size()>=8) out_block[g++]=((unsigned char) (bit_buffer_read(8)));
}
}
i=bit_buffer_size();
if (i!=0) out_block[g++]=bit_buffer_read(i)<<(8-i);
free(curr_cpy);
return(g);
}
int comp_snibble_decompress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
const static unsigned char lookup_table[8]={0, 0, 1, 0, 0, 0, 2, 3};
unsigned int freq[4];
unsigned int x,m=0;
unsigned int i,g=0,cnt=0,f=0,j=0;
freq[0]=(curr_block[0]&0xc0)>>6; /* 0 */
freq[1]=(curr_block[0]&0x30)>>4; /* 2 */
freq[2]=(curr_block[0]&0x0c)>>2; /* 6 */
for (i=0;i<4;i++) {
if (freq[0]!=i && freq[1]!=i && freq[2]!=i) freq[3]=i;
}
out_block[0]=0;
bit_buffer_purge();
bit_buffer_write(curr_block[g++]&0x03,2);
while (1) {
while (((bit_buffer_size()+8)<=16) && g<=blk_size) bit_buffer_write(curr_block[g++],8);
x=bit_buffer_read(1);
m=(m<<1)+x;
cnt++;
if (x==0 || cnt==3) {
out_block[f]|=(freq[lookup_table[m]]<<( j )) ;
j+=2;
/* Obsficated comes to mind ... */
if (j==8) out_block[++f]=(j=0);
m=0;
cnt=0;
}
if (bit_buffer_size()==0 || f==DACT_BLK_SIZE) break;
}
return(f);
}
|
Added comp_snibble.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#ifndef _COMP_SNIBBLE_H
#define _COMP_SNIBBLE_H
#include "dact.h"
#include "config.h"
#if defined(USE_MODULES) && !defined(AS_MODULE)
#define comp_snibble_algo DACT_FAILED_ALGO
#else
int comp_snibble_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
int comp_snibble_compress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
int comp_snibble_decompress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
#endif
#endif
|
Added comp_snibble.lnk.
Added comp_text.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#include "dact.h"
#include "comp_text.h"
#include "buffer.h"
#include <stdio.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
/*
mode - DACT_MODE_COMPR or DACT_MODE_DECMP
Determine whether to compress or decompress.
prev_block - Previous (uncompressed) block.
curr_block - The data to be compressed.
out_block - Where to put data after compression.
blk_size - Size of prev_block and curr_block.
*/
#if defined(USE_MODULES) && defined(AS_MODULE)
#include "module.h"
uint32_t DC_NUM=3;
uint32_t DC_TYPE=DACT_MOD_TYPE_COMP;
void *DC_ALGO=comp_text_algo;
char *DC_NAME="Text Compression (MOD)";
#endif
int comp_text_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
switch(mode) {
case DACT_MODE_COMPR:
return(comp_text_compress(prev_block,curr_block,out_block,blk_size));
break; /* Heh */
case DACT_MODE_DECMP:
return(comp_text_decompress(prev_block,curr_block,out_block,blk_size));
break;
default:
printf("Unsupported mode: %i\n", mode);
return(-1);
}
}
int comp_text_compress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
unsigned char low_byte=255, high_byte=0;
unsigned char byte_buf;
unsigned int range;
int i,x=0,y;
bit_buffer_purge();
for (i=0;i<blk_size;i++) {
if (((unsigned char) curr_block[i])<low_byte) low_byte=curr_block[i];
if (((unsigned char) curr_block[i])>high_byte) high_byte=curr_block[i];
}
range=(unsigned int) (high_byte-low_byte);
out_block[x++]=low_byte;
out_block[x++]=high_byte;
if (range==0)
return(2);
for (y=1;y<=8;y++)
if ((range>>y)==0) break;
if (y==8) return(-1);
for (i=0;i<blk_size;i++) {
byte_buf=(unsigned char) (curr_block[i]-low_byte);
/*
if ((byte_buf>>y)==1) {
return(-1);
}
*/
bit_buffer_write(byte_buf,y);
while (bit_buffer_size()>=8) {
out_block[x++]=bit_buffer_read(8);
}
}
/* Remove any less-than-one-byte data */
if ((i=bit_buffer_size())!=0) {
out_block[x++]=(bit_buffer_read(i)<<(8-i));
}
return(x);
}
int comp_text_decompress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
unsigned char high_byte, low_byte;
unsigned int range;
int i=0,x=0,y;
low_byte=curr_block[x++];
high_byte=curr_block[x++];
range=(unsigned int) (high_byte-low_byte);
if (range==0) {
memset(out_block,low_byte,DACT_BLK_SIZE);
return(DACT_BLK_SIZE);
}
for (y=1;y<=8;y++)
if ((range>>y)==0) break;
bit_buffer_purge();
while (1) {
if (bit_buffer_size()<y) bit_buffer_write((unsigned char) curr_block[x++],8);
out_block[i++]=(bit_buffer_read(y)+low_byte);
if ((x==blk_size) && (bit_buffer_size()<y)) break;
if (i>=(DACT_BLK_SIZE)) break;
}
return(i);
}
|
Added comp_text.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#ifndef _COMP_TEXT_H
#define _COMP_TEXT_H
#include "dact.h"
#include "config.h"
#if defined(USE_MODULES) && !defined(AS_MODULE)
#define comp_text_algo DACT_FAILED_ALGO
#else
int comp_text_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
int comp_text_compress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
int comp_text_decompress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
#endif
#endif
|
Added comp_text.lnk.
Added comp_textrle.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#include "dact.h"
#include "comp_textrle.h"
#include <stdio.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
/*
mode - DACT_MODE_COMPR or DACT_MODE_DECMP
Determine whether to compress or decompress.
prev_block - Previous (uncompressed) block.
curr_block - The data to be compressed.
out_block - Where to put data after compression.
blk_size - Size of prev_block and curr_block.
*/
#if defined(AS_MODULE) && defined(USE_MODULES)
#include "module.h"
uint32_t DC_NUM=12;
uint32_t DC_TYPE=DACT_MOD_TYPE_COMP;
void *DC_ALGO=comp_textrle_algo;
char *DC_NAME="Text RLE Compression (MOD)";
#endif
int comp_textrle_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
switch(mode) {
case DACT_MODE_COMPR:
return(comp_textrle_compress(prev_block,curr_block,out_block,blk_size));
break; /* Heh */
case DACT_MODE_DECMP:
return(comp_textrle_decompress(prev_block,curr_block,out_block,blk_size));
break;
default:
printf("Unsupported mode: %i\n", mode);
return(-1);
}
}
int comp_textrle_compress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
int i,x=0,m;
unsigned char sentinel=0xff;
unsigned char currchar=0, prevchar;
unsigned char charcnt=0;
unsigned int lowestcnt=0xffff;
unsigned int count[256];
for (i=0;i<256;i++) count[i]=0;
for (i=0;i<blk_size;i++) count[curr_block[i]]++;
for (i=0;i<256;i++) {
if (count[i]<lowestcnt) {
sentinel=i;
lowestcnt=count[i];
}
}
out_block[x++]=sentinel;
return(x);
}
int comp_textrle_decompress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
int i,x=0,m;
unsigned char sentinel=curr_block[0];
unsigned char currchar;
unsigned char charcnt;
for (i=1;i<blk_size;i++) {
currchar=curr_block[i];
if (currchar==sentinel) {
currchar=curr_block[++i];
charcnt=curr_block[++i];
if ((x+charcnt)>DACT_BLK_SIZE) {
printf("Error in RLE compression!\n");
return(0);
}
for (m=0;m<charcnt;m++) out_block[x++]=currchar;
} else {
out_block[x++]=currchar;
}
}
return(x);
}
|
Added comp_textrle.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#ifndef _COMP_TEXTRLE_H
#define _COMP_TEXTRLE_H
#include "dact.h"
#include "config.h"
#if defined(USE_MODULES) && !defined(AS_MODULE)
#define comp_textrle_algo DACT_FAILED_ALGO
#else
int comp_textrle_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
int comp_textrle_compress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
int comp_textrle_decompress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
#endif
#endif
|
Added comp_textrle.lnk.
Added comp_zlib.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
/*
Example block compression routine for interfacing with DACT.
Uses zlib.
*/
#include "dact.h"
#include "comp_zlib.h"
#ifdef HAVE_LIBZ
#include <stdio.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_ZLIB_H
#include <zlib.h>
#endif
/*
mode - DACT_MODE_COMPR or DACT_MODE_DECMP
Determine whether to compress or decompress.
prev_block - Previous (uncompressed) block.
curr_block - The data to be compressed.
out_block - Where to put data after compression.
blk_size - Size of prev_block and curr_block.
*/
#if defined(USE_MODULES) && defined(AS_MODULE)
#include "module.h"
uint32_t DC_NUM=4;
uint32_t DC_TYPE=DACT_MOD_TYPE_COMP;
void *DC_ALGO=comp_zlib_algo;
char *DC_NAME="Zlib Compression (MOD)";
#endif
int comp_zlib_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
switch(mode) {
case DACT_MODE_COMPR:
return(comp_zlib_compress(prev_block,curr_block,out_block,blk_size));
break; /* Heh */
case DACT_MODE_DECMP:
return(comp_zlib_decompress(prev_block,curr_block,out_block,blk_size));
break;
default:
printf("Unsupported mode: %i\n", mode);
return(-1);
}
}
int comp_zlib_compress(unsigned char *prev_block, unsigned char *curr_block, unsigned char *out_block, int blk_size) {
unsigned long dest_size;
int retval;
dest_size=(int) ((float) (blk_size*1.01)+13);
#ifdef HAVE_COMPRESS2
retval=compress2(out_block, &dest_size, curr_block, blk_size, Z_BEST_COMPRESSION);
#else
retval=compress(out_block, &dest_size, curr_block, blk_size);
#endif
if (retval!=Z_OK) return(-1);
/* Remove the 120,218 header */
dest_size-=2;
memmove(out_block, out_block+2, dest_size);
return(dest_size);
}
int comp_zlib_decompress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
unsigned long dest_size;
unsigned char *tmpbuf;
int retval;
/* Replant the header. */
tmpbuf=malloc(blk_size+2);
tmpbuf[0]=120;
tmpbuf[1]=218;
memcpy(tmpbuf+2, curr_block, blk_size);
dest_size=(DACT_BLK_SIZE*2);
retval=uncompress(out_block,&dest_size,tmpbuf,blk_size+2);
free(tmpbuf);
if (retval!=Z_OK) return(0);
return(dest_size);
}
#endif
|
Added comp_zlib.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#ifndef _COMP_ZLIB_H
#define _COMP_ZLIB_H
#include "dact.h"
#include "config.h"
#if defined(USE_MODULES) && !defined(AS_MODULE)
#define comp_zlib_algo DACT_FAILED_ALGO
#else
int comp_zlib_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
int comp_zlib_compress(unsigned char *prev_block, unsigned char *curr_block, unsigned char *out_block, int blk_size);
int comp_zlib_decompress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
#endif
#endif
|
Added comp_zlib.lnk.
Added config.h.in.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
|
/* config.h.in. Generated from configure.in by autoheader. */
/* Check for new versions over the network? */
#undef CHECK_VERSION
/* Use the Debian upgrade procedure instead of DACTs internal one */
#undef DACT_DEBIAN_UPGRADE_PROC
/* Debug */
#undef DEBUG
/* Have bzdopen() ? */
#undef HAVE_BZDOPEN
/* Define to 1 if you have the <bzlib.h> header file. */
#undef HAVE_BZLIB_H
/* Have more versatile compress2() ? */
#undef HAVE_COMPRESS2
/* Have random device? */
#undef HAVE_DEV_URANDOM
/* Define to 1 if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Have dlopen()? */
#undef HAVE_DLOPEN
/* Define to 1 if you have the `getopt' function. */
#undef HAVE_GETOPT
/* Define to 1 if you have the <getopt.h> header file. */
#undef HAVE_GETOPT_H
/* Define to 1 if you have the `getpass' function. */
#undef HAVE_GETPASS
/* Have gzdopen() ? */
#undef HAVE_GZDOPEN
/* Have inet_aton() ? */
#undef HAVE_INET_ATON
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Something */
#undef HAVE_LIBBZ2
/* Also something */
#undef HAVE_LIBLZO
/* Something */
#undef HAVE_LIBMCRYPT
/* Something */
#undef HAVE_LIBZ
/* Define to 1 if you have the <lzo1x.h> header file. */
#undef HAVE_LZO1X_H
/* Define to 1 if you have the <lzo1y.h> header file. */
#undef HAVE_LZO1Y_H
/* Define to 1 if you have the <lzo2a.h> header file. */
#undef HAVE_LZO2A_H
/* Define to 1 if you have the <lzoconf.h> header file. */
#undef HAVE_LZOCONF_H
/* Define to 1 if you have the <mcrypt.h> header file. */
#undef HAVE_MCRYPT_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `mkstemp' function. */
#undef HAVE_MKSTEMP
/* Have BZ2_ prefixed to all bzip2 symbols? */
#undef HAVE_NEW_BZ2
/* Have BZ2_bzdopen() ? */
#undef HAVE_NEW_BZDOPEN
/* Do not have BZ2_ prefixed to all bzip2 symbols? */
#undef HAVE_OLD_BZ2
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdio.h> header file. */
#undef HAVE_STDIO_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the `strsep' function. */
#undef HAVE_STRSEP
/* Define to 1 if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <sys/utsname.h> header file. */
#undef HAVE_SYS_UTSNAME_H
/* Define to 1 if you have the <sys/wait.h> header file. */
#undef HAVE_SYS_WAIT_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the <zlib.h> header file. */
#undef HAVE_ZLIB_H
/* Disable all network support */
#undef NO_NETWORK
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* The size of a `int', as computed by sizeof. */
#undef SIZEOF_INT
/* The size of a `long', as computed by sizeof. */
#undef SIZEOF_LONG
/* The size of a `short', as computed by sizeof. */
#undef SIZEOF_SHORT
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Enable use of dynamically loadable modules? */
#undef USE_MODULES
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
#undef inline
#endif
/* Define to `signed short' if <sys/types.h> does not define. */
#undef int16_t
/* Define to `signed short' if <sys/types.h> does not define. */
#undef int32_t
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef uint
/* Define to `unsigned short' if <sys/types.h> does not define. */
#undef uint16_t
/* Define to `unsigned short' if <sys/types.h> does not define. */
#undef uint32_t
|
Added configure.
more than 10,000 changes
Added configure.in.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
dnl Process this file with autoconf to produce a configure script.
AC_REVISION($Revision $)
AC_INIT
AC_CONFIG_HEADER(config.h)
dnl Checks for programs.
AC_PROG_CC
AC_PROG_MAKE_SET
AC_PROG_INSTALL
DC_PROG_GCC
dnl Checks for libraries.
DC_CHK_DLOPEN
DC_CHK_MODULE(z, comp_zlib.c comp_mzlib.c comp_mzlib2.c, HAVE_LIBZ)
DC_CHK_MODULE(bz2, comp_bzlib.c, HAVE_LIBBZ2)
DC_CHK_MODULE(mcrypt, cipher_serpent.c, HAVE_LIBMCRYPT)
DC_CHK_MODULE_VAR(lzo, comp_lzoox.c comp_lzooy.c comp_lzota.c, HAVE_LIBLZO, MODLIBSCOND)
DC_ASK_CHKVERS
DC_ASK_NETWORK
DC_ASK_DEBUG
DC_ASK_MODULE
DC_ASK_DEBIAN
DC_CHK_URANDOM
dnl Checks for header files.
AC_CHECK_HEADERS(zlib.h getopt.h stdio.h strings.h string.h unistd.h stdint.h inttypes.h bzlib.h sys/utsname.h sys/socket.h sys/wait.h lzoconf.h lzo1x.h lzo1y.h lzo2a.h dirent.h mcrypt.h dlfcn.h)
dnl Checks for typedefs.
AC_CHECK_TYPE(uint, unsigned int)
dnl Checks for structures.
dnl Checks for compiler characteristics.
AC_C_INLINE
AC_CHECK_SIZEOF(long, 4)
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(short, 2)
DC_DO_TYPE(uint32_t, unsigned, 4)
DC_DO_TYPE(int32_t, signed, 4)
DC_DO_TYPE(uint16_t, unsigned, 2)
DC_DO_TYPE(int16_t, signed, 2)
dnl Checks for library functions.
AC_CHECK_LIB(z, compress2, AC_DEFINE(HAVE_COMPRESS2, [], [Have more versatile compress2() ?]))
AC_CHECK_LIB(z, gzdopen, AC_DEFINE(HAVE_GZDOPEN, [], [Have gzdopen() ?]))
AC_CHECK_LIB(bz2, bzBuffToBuffCompress, AC_DEFINE(HAVE_OLD_BZ2, [], [Do not have BZ2_ prefixed to all bzip2 symbols?]))
AC_CHECK_LIB(bz2, BZ2_bzBuffToBuffCompress, AC_DEFINE(HAVE_NEW_BZ2, [], [Have BZ2_ prefixed to all bzip2 symbols?]))
AC_CHECK_LIB(bz2, _BZ2_bzBuffToBuffCompress, AC_DEFINE(HAVE_NEW_BZ2, [], [Have BZ2_ prefixed to all bzip2 symbols?]))
AC_CHECK_LIB(bz2, bzdopen, AC_DEFINE(HAVE_BZDOPEN, [], [Have bzdopen() ?]))
AC_CHECK_LIB(bz2, BZ2_bzdopen, AC_DEFINE(HAVE_NEW_BZDOPEN, [], [Have BZ2_bzdopen() ?]))
AC_REPLACE_FUNCS(getopt strsep getpass mkstemp)
dnl Checks for system services.
AC_OUTPUT(Makefile)
|
Added crc.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#include "dact.h"
#include "crc.h"
uint32_t ELFCRC(const uint32_t start, const unsigned char *name, const uint32_t n) {
uint32_t i,h,g;
h=start;
for (i=0;i<n;i++) {
h = (h << 4) + (*name++);
if ((g = (h & 0xf0000000)))
h ^= (g >> 24);
h &= ~g;
}
return(h);
}
|
Added crc.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#ifndef _CRC_H
#define _CRC_H
#include "dact.h"
uint32_t ELFCRC(const uint32_t start, const unsigned char *name, const uint32_t n);
#endif
|
Added dact.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#include "dact.h"
#include <fcntl.h>
#include <stdio.h>
#include <ctype.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include "parse.h"
#include "dendian.h"
#include "crc.h"
#include "math.h"
#include "dact_common.h"
#include "algorithms.h"
#include "ciphers.h"
#include "module.h"
#include "header.h"
#include "parse.h"
#include "net.h"
#include "ui.h"
#ifdef HAVE_ZLIB_H
#include <zlib.h>
#endif
#ifdef HAVE_BZLIB_H
#include <bzlib.h>
#endif
int print_help(int argc, char **argv);
int dact_shutdown(int retval);
char *dact_getoutfilename(const char *orig, const int mode);
uint32_t dact_process_other(int src, const int dest, const uint32_t magic, const char *options);
int main(int argc, char **argv);
extern char *optarg;
extern int optind, opterr, optopt;
uint32_t DACT_BLK_SIZE=0;
char dact_nonetwork=0;
int print_help(int argc, char **argv) {
printf("DACT %i.%i.%i-%s by Keene Enterprises <dact@rkeene.org>\n", DACT_VER_MAJOR, DACT_VER_MINOR, DACT_VER_REVISION, DACT_VER_SUB);
printf("usage: %s [options...] [file ...]\n",argv[0]);
printf("Options:\n");
printf(" -d Decompress instead of compressing.\n");
printf(" -s Give statistics rather than compress or decompress.\n");
printf(" -f Force unsafe things to happen.\n");
printf(" -c (De)compress to stdout.\n");
printf(" -v Increase verbosity.\n");
printf(" -l List available algorithms.\n");
printf(" -n Toggle use of CRCs.\n");
printf(" -i Use stdin to read information from instead of /dev/tty.\n");
#ifndef DACT_UNSAFE
printf(" -C Complain when compression errors occur.\n");
#endif
printf(" -H Write only header (no data).\n");
printf(" -O Toggle writing original file name.\n");
printf(" -S Use speed-size as a metric rather than size.\n");
printf(" -h Give this help.\n");
printf(" -V Display DACT version (%i.%i.%i-%s).\n", DACT_VER_MAJOR, DACT_VER_MINOR, DACT_VER_REVISION, DACT_VER_SUB);
printf(" -N Upgrade DACT.\n");
printf(" -a Upgrade DACT modules.\n");
printf(" -b NN Use a block size of NN bytes for compression.\n");
printf(" -e NN Exclude algorithm NN from being used.\n");
printf(" -m CONF Load config file CONF.\n");
printf(" -o FILE Send output to FILE.\n");
printf(" -u URL Specify download location as URL.\n");
printf(" -p URL Parse URL and print results, then exit.\n");
printf(" -M COMMAND Execute COMMAND as if it had appeared in a config file.\n");
printf(" -D DESC Specify a description of DESC.\n");
printf(" -I NN Use ONLY 2 algorithms, NN and 0.\n");
printf(" -U FILE Use FILE to select download location.\n");
printf(" -E CIPHER Use CIPHER to encrypt data (LIST lists available ciphers.)\n");
printf(" file... File(s) to (de)compress. (If none given, use standard input).\n");
return(0);
}
int dact_blksize_calc(int fsize) {
if (fsize==0) return(DACT_BLK_SIZE_DEF);
if (fsize<(204800)) {
return(fsize+5);
}
return(((int) ((((float) fsize)/102400.0)-(0.9999999)))*65535);
}
int dact_upgrade_file(const char *name, const char *url_get, const char *url_ver, uint32_t version, const char *dest, const char *options) {
int newver, ifd=-1, ofd=-1, x=-1;
char *real_dest, *real_url_get, buf[4096];
if (dest==NULL) {
real_dest=parse_url_subst(DACT_BIN_DIR "@@FILE@@.so", name);
} else {
real_dest=parse_url_subst(dest, name);
}
real_url_get=parse_url_subst(url_get, name);
newver=dact_upgrade_file_checkver(name, url_ver, options);
if (newver>version) {
if (options[DACT_OPT_UPGRADE]) {
fprintf(stderr, "There is a new version of %s. NEW: %i.%i.%i, CURR: %i.%i.%i, fetching...\n", name, DACT_VER_PARTS(newver), DACT_VER_PARTS(version));
if ((ifd=open_net(real_url_get, O_RDONLY, 0))>=0) {
if ((ofd=open_net(real_dest, O_WRONLY|O_CREAT|O_TRUNC, S_IRWXU))>=0) {
while ((x=read(ifd, buf, sizeof(buf)))>0) {
write(ofd, buf, x);
}
close(ifd);
close(ofd);
if (x<0) PERROR("read");
} else {
PERROR_L(ofd, "open");
}
} else {
PERROR_L(ifd, "open");
}
} else {
fprintf(stderr, "There is a new version of %s. NEW: %i.%i.%i, CURR: %i.%i.%i\n", name, DACT_VER_PARTS(newver), DACT_VER_PARTS(version));
}
}
free(real_dest);
free(real_url_get);
return(x);
}
int dact_upgrade_file_checkver(const char *name, const char *url_ver, const char *options) {
#ifdef CHECK_VERSION
uint32_t rem_ver[4]={0, 0, 0, 0};
int fd;
char rem_vers[3][4]={{0,0,0,0},{0,0,0,0},{0,0,0,0}};
char *urlbuf, verbuf[9];
if (options[DACT_OPT_VERCHK]==0 && options[DACT_OPT_UPGRADE]==0) return(0);
urlbuf=parse_url_subst(url_ver, name);
if ((fd=open_net(urlbuf, O_RDONLY, 0))>=0) {
read(fd, &verbuf, 9);
close(fd);
memcpy(rem_vers[0], verbuf, 3);
memcpy(rem_vers[1], verbuf+3, 3);
memcpy(rem_vers[2], verbuf+6, 3);
rem_ver[0]=atoi(rem_vers[0]);
rem_ver[1]=atoi(rem_vers[1]);
rem_ver[2]=atoi(rem_vers[2]);
rem_ver[3]=(rem_ver[0]<<16)|(rem_ver[1]<<8)|(rem_ver[2]);
}
free(urlbuf);
return(rem_ver[3]);
#else
return(0);
#endif
}
int dact_upgrade(char *options) {
#ifdef DACT_DEBIAN_UPGRADE_PROC
char *buf;
int status=0, i;
if (getuid()==0) {
buf=dact_ui_getuserinput("Executing `apt-get update' okay [y/N]? ", 5, 0);
if (toupper(buf[0])!='Y') {
PRINTERR("Failed to upgrade DACT.");
free(buf);
return(-1);
}
free(buf);
if (fork()==0) {
execl("/usr/bin/apt-get","apt-get","update",NULL);
return(-1); /* Couldn't run binary. */
} else {
i=wait(&status);
if (WIFEXITED(status)) {
if (WEXITSTATUS(status)) {
PRINTERR("Failed to run `apt-get update'");
return(-1);
}
}
}
if (fork()==0) {
execl("/usr/bin/apt-get","apt-get","install","dact",NULL);
return(-1); /* Couldn't run binary. */
} else {
i=wait(&status);
if (WIFEXITED(status)) {
if (WEXITSTATUS(status)) {
PRINTERR("Failed to run `apt-get install dact'");
return(-1);
}
}
}
return(1);
}
#else
options[DACT_OPT_UPGRADE]=1;
return(dact_upgrade_file("dact", DACT_BIN_URL, DACT_BIN_URL_VER, DACT_BIN_VER, DACT_BIN, options));
#endif
}
#if 0
int dact_upgrade(const char *options, uint32_t *crcs) {
char *urlsubst, *buf, *dact_binfilebuf;
char dact_binfile[256];
int inFd, outFd;
uint32_t i;
#ifdef DACT_DEBIAN_UPGRADE_PROC
int status=0;
if (getuid()==0) {
buf=dact_ui_getuserinput("Executing `apt-get update' okay [y/N]? ", 5, 0);
if (toupper(buf[0])!='Y') {
PRINTERR("Failed to upgrade DACT.");
free(buf);
return(-1);
}
free(buf);
#ifdef WIN32
#error "Windows has no fork(), CreateProcess() instead"
#endif
if (fork()==0) {
execl("/usr/bin/apt-get","apt-get","update",NULL);
return(-1); /* Couldn't run binary. */
} else {
i=wait(&status);
if (WIFEXITED(status)) {
if (WEXITSTATUS(status)) {
PRINTERR("Failed to run `apt-get update'");
return(-1);
}
}
}
if (fork()==0) {
execl("/usr/bin/apt-get","apt-get","install","dact",NULL);
return(-1); /* Couldn't run binary. */
} else {
i=wait(&status);
if (WIFEXITED(status)) {
if (WEXITSTATUS(status)) {
PRINTERR("Failed to run `apt-get install dact'");
return(-1);
}
}
}
return(1);
}
#endif
if ((i=is_latest(options))) {
PRINTERR("**+");
PRINT_LINE; fprintf(stderr, "dact: **> CURR: DACT %i.%i.%i\n",DACT_VER_MAJOR, DACT_VER_MINOR, DACT_VER_REVISION);
PRINT_LINE; fprintf(stderr, "dact: **> NEW: DACT %i.%i.%i\n",i>>16,(i>>8)&0xff,i&0xff);
PRINTERR("**>");
PRINTERR("**-");
}
if ((inFd=open_net("http://www.rkeene.org/projects/rget/rget.cgi?project=dact&file=info", O_RDONLY))>=0) {
fprintf(stderr, "------------------------\n");
buf=malloc(1024);
while (1) {
i=read_f(inFd, buf, 1024);
write(STDERR_FILENO, buf, i);
if (i!=1024) break;
}
fprintf(stderr, "------------------------\n");
close(inFd);
free(buf);
}
#ifdef GO32
mkdir("c:/dact/", 0755);
strcpy(dact_binfile,"c:/dact/dact.exe");
#else
strncpy(dact_binfile,getenv("HOME"),sizeof(dact_binfile)-1);
strncat(dact_binfile,"/.dact/",sizeof(dact_binfile)-strlen(dact_binfile)-1);
mkdir(dact_binfile, 0755);
dact_binfilebuf=parse_url_subst("@@OSNM@@-@@ARCH@@/", "");
strncat(dact_binfile,dact_binfilebuf,sizeof(dact_binfile)-strlen(dact_binfile)-1);
free(dact_binfilebuf);
mkdir(dact_binfile, 0755);
strncat(dact_binfile,"dact.bin",sizeof(dact_binfile)-strlen(dact_binfile)-1);
#endif
urlsubst=parse_url_subst("http://www.rkeene.org/projects/rget/rget.cgi?os=@@OSNM@@&arch=@@ARCH@@&project=dact&file=bin&meth=gz","");
if ((outFd=open_net(dact_binfile, O_WRONLY|O_TRUNC|O_CREAT, 0755))<0) {
PERROR_L(outFd, "open_net");
return(-1);
}
if ((inFd=open_net(urlsubst, O_RDONLY, 0))<0) {
PERROR_L(inFd, "open_net");
return(-1);
}
if (!dact_process_file(inFd, outFd, DACT_MODE_DECMP, options, "dact", crcs,-1)) {
close(inFd);
close(outFd);
unlink(dact_binfile);
PRINTERR("Failed to upgrade DACT.");
return(-1);
}
close(inFd);
close(outFd);
if (!options[DACT_OPT_BINCHK]) {
PRINTERR("Note: You do not have binary_check set to `on' in your dact.conf.");
}
return(1);
}
uint32_t is_latest (const char *options) {
#if defined(CHECK_VERSION)
int fd;
char ver_maj[4]={0,0,0,0}, ver_min[4]={0,0,0,0}, ver_rev[4]={0,0,0,0};
char bigbuf[1024];
int vers[3];
if (options[DACT_OPT_VERCHK]==0) return(0);
if (getuid()==0) return(0);
if ((fd=createconnection_tcp("www.rkeene.org", 80))<0) return(0);
write(fd, "GET http://www.rkeene.org/devel/dact/VERSION\n", 45);
read(fd, &bigbuf,1024);
memcpy(ver_maj,bigbuf,3);
memcpy(ver_min,bigbuf+3,3);
memcpy(ver_rev,bigbuf+6,3);
closeconnection(fd);
vers[0]=atoi(ver_maj);
vers[1]=atoi(ver_min);
vers[2]=atoi(ver_rev);
if ( ((vers[0]<<16)|(vers[1]<<8)|vers[2]) > ((DACT_VER_MAJOR<<16)|(DACT_VER_MINOR<<8)|DACT_VER_REVISION) ) {
return((vers[0]<<16)|(vers[1]<<8)|vers[2]);
} else {
return(0);
}
#else
return(0);
#endif
}
#endif
int dact_shutdown(int retval) {
unload_modules();
dact_ui_deinit();
return(retval);
}
char *dact_getoutfilename(const char *orig, const int mode) {
char *ret=NULL;
int x=0;
switch (mode) {
case DACT_MODE_COMPR:
ret=malloc(strlen(orig)+5);
#ifdef GO32
strncpy(ret,orig,8);
for (x=0;x<strlen(ret);x++) {
if (ret[x]=='.') ret[x]='_';
}
strcat(ret,".dct");
#else
strcpy(ret,orig);
strcat(ret,".dct");
#endif
break;
case DACT_MODE_DECMP:
if (strcmp(&orig[strlen(orig)-4],".dct") && \
strcmp(&orig[strlen(orig)-4], ".bz2") && \
strcmp(&orig[strlen(orig)-5], ".tbz2") && \
strcmp(&orig[strlen(orig)-4], ".tgz") && \
strcmp(&orig[strlen(orig)-3], ".gz")) {
return(NULL);
}
/* XXX: I wonder if this breaks easily... */
x=(strrchr(orig,'.')-orig);
ret=malloc(x+1);
strncpy(ret,orig,x);
ret[x]=0;
break;
case DACT_MODE_STAT:
return(NULL);
break;
}
return(ret);
}
uint32_t dact_process_other(int src, const int dest, const uint32_t magic, const char *options) {
char *buf, tmpbuf[128]="/tmp/dactXXXXXX";
uint32_t filesize=0, x;
int tmpfd=0;
#if defined(HAVE_LIBBZ2) && (defined(HAVE_BZDOPEN) || defined(HAVE_NEW_BZDOPEN))
BZFILE *bzfd;
#endif
#if defined(HAVE_LIBZ) && defined(HAVE_GZDOPEN)
gzFile gzfd;
#endif
filesize=0; /* Fix a warning, that is all. */
/*
* bad and broke stuff XXX FIXME XXX FIXME XXX FIXME
* There has to be a better way to do this... I just want
* to rewind my socket/pipe 4 bytes... 4 bytes is all I ask
* Is that so much to ask for? Well?! Is it?! I don't
* think it is.
* I give up on this.
*
* Someone please fix it.
* -- Roy Keene <dact@rkeene.org>
*/
if (lseek_net(src, 0, SEEK_SET)<0) {
PRINTERR("This should not be happening.");
/*
* lseek_net() should make this obsolete.
* ... EXCEPT! when reading from stdin.
*
*/
tmpfd=mkstemp(tmpbuf);
write_de(tmpfd, magic, 4);
buf=malloc(1024);
while (1) {
x=read_f(src, buf, 1024);
write(tmpfd, buf, x);
if (x<1024) break;
}
close(src);
src=tmpfd;
lseek_net(src, 0, SEEK_SET); /* Now bitch. */
free(buf);
}
#if defined(HAVE_LIBZ) && defined(HAVE_GZDOPEN)
if ((magic&0xffff0000)==0x1f8b0000) { /* gzip */
dact_ui_status(DACT_UI_LVL_GEN, "Gunzipping...");
buf=malloc(1024);
gzfd=gzdopen(src, "r");
/*XXX: need to dact_ui_setup() */
while (1) {
dact_ui_incrblkcnt(1);
x=gzread(gzfd,buf,1024);
filesize+=write(dest, buf, x);
if (x<1024) break;
}
free(buf);
if (tmpfd!=0) unlink(tmpbuf);
return(filesize);
}
#endif
#if defined(HAVE_LIBBZ2) && (defined(HAVE_BZDOPEN) || defined(HAVE_NEW_BZDOPEN))
if ((magic&0xffffff00)==0x425a6800) { /* bzip2 */
dact_ui_status(DACT_UI_LVL_GEN, "Bunzipping...");
buf=malloc(1024);
#ifdef HAVE_NEW_BZDOPEN
bzfd=BZ2_bzdopen(src, "r");
#else
bzfd=bzdopen(src, "r");
#endif
/*XXX: need to dact_ui_setup() */
while(1) {
dact_ui_incrblkcnt(1);
#ifdef HAVE_NEW_BZDOPEN
x=BZ2_bzread(bzfd, buf, 1024);
#else
x=bzread(bzfd, buf, 1024);
#endif
filesize+=write(dest, buf, x);
if (x<1024) break;
}
free(buf);
if (tmpfd!=0) unlink(tmpbuf);
return(filesize);
}
#endif
return(0);
}
int main(int argc, char **argv) {
unsigned char options[20]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
signed char opt;
struct stat stat_buf;
char **in_files, *in_file=NULL, *out_file=NULL;
char dact_binfilebuf[256], *dact_binfile;
int filecnt=0;
int in_fd, out_fd;
int mode=DACT_MODE_COMPR, ciphernum=-1;
uint32_t crcs[6]={0,0,0,0,0,0};
uint32_t i,x;
dact_ui_init();
/* hack, to make upgrade work even if DACT_OPT_BINCHK is enabled, we must
* get the new version before executing it.
*/
if (argv[1]!=NULL) {
if (!strcmp(argv[1],"-N")) return(dact_upgrade(options));
if (!strcmp(argv[1],"-a")) options[DACT_OPT_UPGRADE]=1;
}
dact_config_loadfile(DACT_CONFIG_FILE, options);
#if !defined(GO32) && !defined(__WIN32__)
dact_binfilebuf[0]='\0';
if (getenv("HOME")) {
strncpy(dact_binfilebuf,getenv("HOME"),sizeof(dact_binfilebuf)-1);
}
strncat(dact_binfilebuf,"/.dact/dact.conf",sizeof(dact_binfilebuf)-strlen(dact_binfilebuf)-1);
dact_config_loadfile(dact_binfilebuf, options);
#endif
if (options[DACT_OPT_BINCHK]) {
dact_binfile=parse_url_subst(DACT_BIN, "");
if (strcmp(argv[0],dact_binfile)) {
if (!access(dact_binfile,X_OK)) {
argv[0]=dact_binfile;
#ifndef __MINGW32__
execv(dact_binfile, argv);
#else
execv(dact_binfile, (const char **) argv);
#endif
}
}
}
while ((opt=getopt(argc,argv,"adfsvcnhiNVHCM:E:p:I:m:e:lb:u:U:TPOD:o:"))!=-1) {
switch (opt) {
case 'a':
options[DACT_OPT_UPGRADE]=1;
break;
case 'd':
mode=DACT_MODE_DECMP;
break;
case 'f':
options[DACT_OPT_FORCE]++;
break;
case 's':
mode=DACT_MODE_STAT;
break;
case 'i':
dact_ui_setopt(DACT_UI_OPT_PASSSTDIN, 1);
break;
case 'c':
options[DACT_OPT_STDOUT]=!options[DACT_OPT_STDOUT];
break;
case 'b':
i=atoi2(optarg);
if (i<DACT_BLK_SIZE_MAX) DACT_BLK_SIZE=i;
break;
case 'v':
options[DACT_OPT_VERB]++;
dact_ui_setopt(DACT_UI_OPT_LEVEL,dact_ui_getopt(DACT_UI_OPT_LEVEL)+1);
break;
case 'n':
options[DACT_OPT_NOCRC]=!options[DACT_OPT_NOCRC];
break;
case 'p':
PRINT_LINE; fprintf(stderr, "dact: %s\n",parse_url_subst(optarg,"@@file@@"));
mode=DACT_MODE_RET;
break;
case 'C':
options[DACT_OPT_COMPLN]++;
break;
case 'm':
dact_config_loadfile(optarg, options);
break;
case 'e':
i=(atoi(optarg)&0xff);
algorithms[i]=DACT_FAILED_ALGO;
break;
case 'H':
options[DACT_OPT_HDONLY]=!options[DACT_OPT_HDONLY];
break;
case 'o':
out_file=parse_url_subst(optarg, "");
break;
case 'M':
dact_config_execute(optarg, options);
break;
case 'N':
PRINTERR("The `-N\' option must be the first and only argument passed to dact.");
return(0);
break;
case 'E':
strtolower(optarg);
x=hash_fourbyte(optarg, ' ');
if (x==hash_fourbyte("list", ' ')) {
PRINT_LINE; fprintf(stderr, "dact: Num | Name\n");
for (i=0;i<CIPHER_COUNT;i++) {
if (ciphers_name[i]!=NULL && ciphers[i]!=DACT_FAILED_ALGO) {
PRINT_LINE; fprintf(stderr, "dact: %3i | %s\n",i,ciphers_name[i]);
}
}
return(0);
}
for (i=0;i<CIPHER_COUNT;i++) {
if (ciphers_name[i]!=NULL && ciphers[i]!=DACT_FAILED_ALGO) {
if (x==hash_fourbyte(ciphers_name[i], ' ')) {
break;
}
}
}
if (i==CIPHER_COUNT) i=-1;
ciphernum=i;
if (ciphernum==-1) {
PRINTERR("No such cipher.");
return(-1);
}
break;
case 'l':
PRINT_LINE; fprintf(stderr, "dact: Num | Name\n");
for (i=0;i<255;i++) {
if (algorithms[i]==NULL || algorithms[i]==DACT_FAILED_ALGO) continue;
PRINT_LINE; fprintf(stderr, "dact: %3i | %s\n",i,algorithm_names[i]);
}
mode=DACT_MODE_RET;
break;
case 'I':
x=atoi(optarg);
for (i=1;i<255;i++) {
if (i!=x) algorithms[i]=NULL;
}
break;
case 'V':
printf("DACT %i.%i.%i-%s", DACT_VER_MAJOR, DACT_VER_MINOR, DACT_VER_REVISION, DACT_VER_SUB);
#if defined(__DATE__) && defined(__TIME__)
printf(" built on %s at %s",__DATE__,__TIME__);
#endif
#ifdef DACT_CONTACT
printf(" %s",DACT_CONTACT);
#endif
printf("\n");
return(0);
break;
case 'u':
dact_hdr_ext_regs(DACT_HDR_URL, optarg, strlen(optarg));
break;
case 'U':
dact_hdr_ext_regs(DACT_HDR_URLFILE, optarg, strlen(optarg));
break;
case 'D':
dact_hdr_ext_regs(DACT_HDR_DESC, optarg, strlen(optarg));
break;
case 'T':
options[DACT_OPT_TIME]=!options[DACT_OPT_TIME];
break;
case 'P':
options[DACT_OPT_PERM]=!options[DACT_OPT_PERM];
break;
case 'O':
options[DACT_OPT_ORIG]=!options[DACT_OPT_ORIG];
break;
case 'S':
options[DACT_OPT_SZSPD]=!options[DACT_OPT_SZSPD];
break;
case '?':
case ':':
case 'h':
return(print_help(argc,argv));
}
}
/*
* Check for a new version of DACT
*/
if ((i=dact_upgrade_file_checkver("dact", DACT_BIN_URL_VER, options))>DACT_BIN_VER) {
PRINTERR("**+");
PRINTERR("**> There is a new version of DACT available.");
PRINTERR("**>");
PRINT_LINE; fprintf(stderr, "dact: **> [CURR: DACT %i.%i.%i]\n",DACT_VER_MAJOR, DACT_VER_MINOR, DACT_VER_REVISION);
PRINT_LINE; fprintf(stderr, "dact: **> [NEW: DACT %i.%i.%i]\n",i>>16,(i>>8)&0xff,i&0xff);
PRINTERR("**>");
PRINTERR("**> Run `dact -N' to get it.");
PRINTERR("**> or get the source at: http://www.rkeene.org/devel/dact.tar.gz");
PRINTERR("**>");
PRINTERR("**-");
}
if (mode==DACT_MODE_RET) return(0);
in_files=&argv[optind];
/* Loop through extra parameters (files ...) and setup FDs for them */
do {
in_fd=-1;
out_fd=-1;
in_file=in_files[filecnt];
if (in_file!=NULL) {
/* Determine resulting file name */
if (out_file==NULL) out_file=dact_getoutfilename(in_file,mode);
if (!strcmp("-",in_file)) {
in_fd=STDIN_FILENO;
} else {
stat(in_file, &stat_buf);
if (S_ISDIR(stat_buf.st_mode)) {
fprintf(stderr, "dact: %s is a directory.",in_file);
continue;
}
if ((in_fd=open_net(in_file, O_RDONLY, 0))<0) {
fprintf(stderr, "dact: Can't open %s.\n",in_file);
PERROR_L(in_fd, "open");
continue;
}
}
if (out_file!=NULL) {
if (!strcmp("-",out_file)) options[DACT_OPT_STDOUT]=1;
/*
*
* This is a bad thing if this program is SUID root, which it NEVER EVER
* should be.
*
* DO NOT MAKE DACT SUID ROOT OR YOU WILL BE HACKED
*
* that should be a suffcient warning.
* (this is a mere race condition, but a severe warning should prevent
* people from complaining about it to me.)
*
*/
if (access(out_file,F_OK)!=-1 && options[DACT_OPT_FORCE]==0 && options[DACT_OPT_STDOUT]==0) {
fprintf(stderr, "dact: %s exists.\n",out_file);
close(in_fd);
continue;
}
if (!options[DACT_OPT_STDOUT]) {
if ((out_fd=open_net(out_file,O_WRONLY|O_CREAT|O_TRUNC,0644))<0) {
fprintf(stderr, "dact: Can't open %s for writing.\n",out_file);
PERROR_L(out_fd, "open");
continue;
}
}
}
if (options[DACT_OPT_STDOUT]) out_fd=STDOUT_FILENO;
}
/* Use STDIN/STDOUT if no files specified ... unless an outfile was specified... */
if (in_file==NULL && filecnt==0) {
/* ... But only if STDOUT isn't a terminal */
if (isatty(STDOUT_FILENO) && options[DACT_OPT_FORCE]==0) {
fprintf(stderr, "dact: Refusing to write compressed output to a terminal.\n");
} else {
out_fd=STDOUT_FILENO;
in_fd=STDIN_FILENO;
}
}
/* Okay, we're all done, now pass these to something to do the real stuff */
if (in_fd!=-1 && (out_fd!=-1 || mode==DACT_MODE_STAT)) {
crcs[1]=crcs[0]=0;
if (dact_process_file(in_fd, out_fd, mode, options, in_file, crcs, ciphernum)==0) {
close(in_fd);
close(out_fd);
if (out_fd!=STDOUT_FILENO) {
unlink(out_file);
}
return(dact_shutdown(-1));
}
}
/* Cleanup */
if (out_fd!=-1) close(out_fd);
if (in_fd!=-1) close(in_fd);
} while (in_files[filecnt++]!=NULL);
return(dact_shutdown(0));
}
|
Added dact.conf.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
version_check off
#block_size 0
#exclude_algo 0
use_urls on
color_ui off
network_access on
binary_check off
module_dir /usr/local/share/dact
module_load_all off
load_module comp_snibble
load_module comp_delta
load_module comp_text
load_module comp_rle
load_module cipher_chaos
load_module cipher_sub
load_module cipher_psub
load_module comp_lzoox
load_module comp_lzooy
load_module comp_lzota
load_module comp_bzlib
load_module comp_zlib
load_module comp_mzlib
load_module comp_mzlib2
|
Added dact.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#ifndef _DACT_H
#define _DACT_H
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#if (defined(WIN32) || defined(__WIN32__)) && !defined(__MINGW32__)
#warning Including WIN32.H !
#include "win32.h"
#endif
#include "comp_fail.h"
#ifndef DACT_CONTACT
#define DACT_CONTACT "<dact@rkeene.org>"
#endif
#ifndef DACT_KEY_SIZE
#define DACT_KEY_SIZE 2048
#endif
#define DACT_VER_MAJOR 0
#define DACT_VER_MINOR 8
#define DACT_VER_REVISION 37
#define DACT_VERSION "0.8.37"
#ifdef DEBUG
#define DACT_VER_SUB "dev"
#else
#define DACT_VER_SUB "rel"
#endif
#define DACT_MODE_COMPR 1
#define DACT_MODE_DECMP 2
#define DACT_MODE_STAT 3
#define DACT_MODE_RET 4
#define DACT_MODE_CINIT 5
#define DACT_MODE_CENC 6
#define DACT_MODE_CDEC 7
#define DACT_MODE_CIENC 11 /* CINIT+CENC */
#define DACT_MODE_DIDEC 12 /* CINIT+CDEC */
#define DACT_OPT_FORCE 0
#define DACT_OPT_STDOUT 1
#define DACT_OPT_VERB 2
#define DACT_OPT_COMPLN 3
#define DACT_OPT_VERCHK 4
#define DACT_OPT_BINCHK 5
#define DACT_OPT_TIME 6
#define DACT_OPT_PERM 7
#define DACT_OPT_ORIG 8
#define DACT_OPT_HDONLY 9
#define DACT_OPT_SZSPD 10
#define DACT_OPT_NOCRC 11
#define DACT_OPT_NETWORK 12
#define DACT_OPT_URL 13
#define DACT_OPT_UPGRADE 14
/* These should only be changed at the risk of breaking files.
* (in other words, they should not be changed if possible.
* Adding on to them is fine.)
*/
#define DACT_HDR_CRC0 0
#define DACT_HDR_CRC1 1
#define DACT_HDR_TIME 2
#define DACT_HDR_PERM 3
#define DACT_HDR_NAME 4
#define DACT_HDR_MD5SUM 5
#define DACT_HDR_DESC 6
#define DACT_HDR_URL 7
#define DACT_HDR_URLFILE 8
#define DACT_HDR_CIPHER 9
#define DACT_HDR_NOP 10
#define DACT_HDR_IDXDATA 11
#ifndef DACT_BLK_SIZE_MAX
#define DACT_BLK_SIZE_MAX 2147483647
#define MAX_DACT_BLK_SIZE DACT_BLK_SIZE_MAX
#endif
#ifndef DACT_BLK_SIZE_DEF
#define DACT_BLK_SIZE_DEF 8192
#endif
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#else
#include "getopt.h"
#endif
#ifndef HAVE_STRSEP
#include "strsep.h"
#endif
#ifndef HAVE_GETPASS
#include "getpass.h"
#endif
#ifndef HAVE_MKSTEMP
#include "mkstemp.h"
#endif
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#define DACT_MAGIC_NUMBER 0x444354C3
#define DACT_MAGIC_OFFSET 0
#define DACT_MAGIC_SIZE 4
#define DACT_MAGIC_PEOF 0xFF3FDE08
#define DACT_HDR_REG_SIZE 24
struct dact_header {
uint32_t size;
unsigned char algo;
};
extern uint32_t DACT_BLK_SIZE;
extern char dact_nonetwork;
#if defined(__FILE__) && defined(__LINE__) && defined(DEBUG)
#define PRINT_LINE fprintf(stderr, "%s:%07i:%s(): ", __FILE__, __LINE__, __func__)
#else
#define PRINT_LINE /**/
#endif
#define PERROR(error) { PRINT_LINE; perror("dact: " error); }
#define PERROR_L(errnum, error) { PRINT_LINE; fprintf(stderr, "%s: %s\n", error, strerror(abs(errnum))); }
#define PRINTERR(error) { PRINT_LINE; fprintf(stderr, "dact: " error "\n"); }
/* Win32 check here */
#ifdef DEBUG
#define SHOWVAL(x...) { PRINT_LINE; fprintf(stderr, "dact: %s=%li\n", #x, (long) (x)); }
#define SPOTVAR_NUM(x) { PRINT_LINE; fprintf(stderr, "dact: %s=%li\n", #x, (long) x); }
#define SPOTVAR_STR(x) { PRINT_LINE; fprintf(stderr, "dact: %s=\"%s\"\n", #x, x); }
#define CHECKPOINT PRINTERR("Checkpoint reached.")
#define DPRINTF(x...) { PRINT_LINE; fprintf(stderr, x); fprintf(stderr, "\n"); }
#else
#define SHOWVAL(x...) /**/
#define SPOTVAR_NUM(x) /**/
#define SPOTVAR_STR(x) /**/
#define CHECKPOINT /**/
#define DPRINTF(x...) /**/
#endif
#ifndef DACT_FAILED_ALGO
#define DACT_FAILED_ALGO comp_fail_algo
#endif
#ifndef HAVE_SYS_SOCKET_H
#define NO_NETWORK 1
#endif
#ifdef HAVE_DEV_URANDOM
#define RANDOM_DEV "/dev/urandom"
#endif
#ifndef DACT_VER_PARTS
#define DACT_VER_PARTS(x) ((x&0xff0000)>>16),((x&0xff00)>>8),(x&0xff)
#endif
#ifndef DACT_BIN_URL
#define DACT_BIN_URL "http://www.rkeene.org/projects/compression/dact/@@OSNM@@-@@ARCH@@/dact.bin"
#endif
#ifndef DACT_BIN_URL_VER
#define DACT_BIN_URL_VER "http://www.rkeene.org/projects/compression/dact/@@OSNM@@-@@ARCH@@/dact.ver"
#endif
#ifndef DACT_BIN_DIR
#define DACT_BIN_DIR "@@HOME@@/.dact/@@OSNM@@-@@ARCH@@/"
#endif
#ifndef DACT_BIN
#ifdef EXEEXT
#define DACT_BIN DACT_BIN_DIR "dact" EXEEXT
#else
#define DACT_BIN DACT_BIN_DIR "dact.bin"
#endif
#endif
#define DACT_BIN_VER ((DACT_VER_MAJOR<<16)|(DACT_VER_MINOR<<8)|DACT_VER_REVISION)
int print_help(int argc, char **argv);
int dact_blksize_calc(int fsize);
void dact_config_loadfile(const char *path, char *options);
int dact_config_execute(const char *cmd, char *options);
int dact_upgrade_file_checkver(const char *name, const char *url_ver, const char *options);
int dact_upgrade_file(const char *name, const char *url_get, const char *url_ver, uint32_t version, const char *dest, const char *options);
int dact_shutdown(int retval);
char *dact_getoutfilename(const char *orig, const int mode);
uint32_t dact_process_other(int src, const int dest, const uint32_t magic, const char *options);
uint32_t dact_blk_decompress(char *ret, const char *srcbuf, const uint32_t size, const char *options, const int algo);
uint32_t dact_blk_compress(char *algo, char *ret, const char *srcbuf, const uint32_t size, const char *options);
uint32_t dact_process_file(const int src, const int dest, const int mode, const char *options, const char *filename, uint32_t *crcs, int cipher);
int main(int argc, char **argv);
#endif/*_DACT_H*/
|
Added dact_common.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#include "dact.h"
#define __DACT_C
#include <fcntl.h>
#include <stdio.h>
#include <ctype.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include "parse.h"
#include "dendian.h"
#include "crc.h"
#include "math.h"
#include "dact_common.h"
#include "algorithms.h"
#include "ciphers.h"
#include "module.h"
#include "header.h"
#include "parse.h"
#include "net.h"
#include "ui.h"
#ifdef HAVE_ZLIB_H
#include <zlib.h>
#endif
#ifdef HAVE_BZLIB_H
#include <bzlib.h>
#endif
int dact_config_execute(const char *cmd, char *options) {
char *line=NULL, *line_s, *item_buf[4]={NULL, NULL, NULL, NULL};
int i;
line_s=line=strdup(cmd);
if (line[0]=='#') return(0);
while (line[strlen(line)-1]<32) line[strlen(line)-1]='\0';
for (i=0;i<4;i++) item_buf[i]=NULL;
for (i=0;i<4;i++) {
if ((item_buf[i]=strsep(&line, "\t "))==NULL) break;
if (item_buf[i][0]==0) i--;
}
if (item_buf[0]==NULL || item_buf[1]==NULL) return(0); /* This means all commands must have arguments. */
switch (ELFCRC(0, item_buf[0], strlen(item_buf[0]))) {
case 164209419: /* binary_check */
options[DACT_OPT_BINCHK]=!!strcmp(item_buf[1],"off");
break;
case 9456603: /* version_check */
options[DACT_OPT_VERCHK]=!!strcmp(item_buf[1],"off");
break;
case 204349618: /* module_dir */
if ((sizeof(moduledirectory)-strlen(moduledirectory)-1)<=0) break;
strncat(moduledirectory,":",sizeof(moduledirectory)-strlen(moduledirectory)-1);
strncat(moduledirectory,item_buf[1],sizeof(moduledirectory)-strlen(moduledirectory)-1);
break;
case 247248556: /* module_load_all */
if (strcmp(item_buf[1], "on")==0) {
init_modules();
load_modules_all(options);
}
break;
case 48402100: /* module_load */
case 106360197: /* load_module */
init_modules();
load_module(item_buf[1], options);
break;
case 164097267: /* network_access */
#ifndef NO_NETWORK
dact_nonetwork=!strcmp(item_buf[1],"off");
#endif
break;
case 209445231: /* exclude_algo */
i=(atoi(item_buf[1])&0xff);
algorithms[i]=DACT_FAILED_ALGO;
break;
case 168825941: /* block_size */
DACT_BLK_SIZE=atoi2(item_buf[1]);
break;
case 162975987: /* use_urls */
options[DACT_OPT_URL]=!!strcmp(item_buf[1],"off");
break;
case 104235033: /* color_ui */
dact_ui_setopt(DACT_UI_OPT_COLOR,!!strcmp(item_buf[1],"off"));
break;
case 164800901: /* module_upgrade */
if (strcmp(item_buf[1],"on")==0) options[DACT_OPT_UPGRADE]=1;
break;
case 63160590: /* pass_use_stdin */
case 191551086: /* use_stdin */
dact_ui_setopt(DACT_UI_OPT_PASSSTDIN, 1);
break;
#ifdef DEBUG
default:
fprintf(stderr, "Unknown command %s (%i)\n",item_buf[0],ELFCRC(0,item_buf[0],strlen(item_buf[0])));
break;
#endif
}
free(line_s);
return(1);
}
void dact_config_loadfile(const char *path, char *options) {
char *line=NULL;
FILE *cfd;
line=malloc(512);
if ((cfd=fopen(path,"r"))==NULL) return;
while (!feof(cfd)) {
fgets(line, 511, cfd);
dact_config_execute(line, options);
}
free(line);
fclose(cfd);
}
uint32_t dact_blk_decompress(char *ret, const char *srcbuf, const uint32_t size, const char *options, const int algo) {
uint32_t retval;
if (algo==0xff) return(0);
if (algorithms[algo]==NULL) {
PRINTERR("Algorithm unavailble.");
return(0);
}
retval=algorithms[algo](DACT_MODE_DECMP, NULL, srcbuf, ret, size);
return(retval);
}
uint32_t dact_blk_compress(char *algo, char *ret, const char *srcbuf, const uint32_t size, const char *options) {
char *tmpbuf, *smallbuf=NULL;
int i, highest_algo=0;
char smallest_algo;
uint32_t smallest_size=-1, x;
#ifndef DACT_UNSAFE
char *verif_bf=NULL;
uint32_t m;
if ((verif_bf=malloc(size))==NULL) { PERROR("malloc"); return(0); }
#endif
if ((tmpbuf=malloc(size*2))==NULL) { PERROR("malloc"); return(0); }
for (i=0;i<256;i++) {
if (algorithms[i]!=NULL && algorithms[i]!=DACT_FAILED_ALGO) highest_algo=i;
}
for (i=0;i<=highest_algo;i++) {
if (algorithms[i]!=NULL && algorithms[i]!=DACT_FAILED_ALGO) {
x=algorithms[i](DACT_MODE_COMPR, NULL, srcbuf, tmpbuf, size);
#ifndef DACT_UNSAFE
if ((x<smallest_size || smallest_size==-1) && x!=-1) {
m=algorithms[i](DACT_MODE_DECMP, NULL, tmpbuf, verif_bf, x);
if (memcmp(verif_bf, srcbuf,m) || m!=size) {
x=-1;
if (options[DACT_OPT_COMPLN]) {
dact_ui_status(DACT_UI_LVL_ALL, "Compression verification failed (ignoring)");
}
}
}
#endif
if ((x<smallest_size || smallest_size==-1) && x!=-1) {
smallest_size=x;
smallest_algo=i;
if (smallbuf!=NULL) free(smallbuf);
if ((smallbuf=malloc(smallest_size))==NULL) {
PERROR("malloc");
free(tmpbuf);
#ifndef DACT_UNSAFE
free(verif_bf);
#endif
return(0);
}
memcpy(smallbuf, tmpbuf, smallest_size);
}
if (options[DACT_OPT_VERB]>2) {
PRINT_LINE; fprintf(stderr, "dact: \033[%im----| %03i | %-7i | %s\033[0m\n", (smallest_algo==i)*7 , i, x, algorithm_names[i]);
}
}
}
free(tmpbuf);
#ifndef DACT_UNSAFE
free(verif_bf);
#endif
if (smallest_size==-1) {
return(0);
}
memcpy(algo, &smallest_algo, sizeof(char));
memcpy(ret, smallbuf, smallest_size);
/* This was MISSING ! memory leak. */
free(smallbuf);
return(smallest_size);
}
uint32_t dact_process_file(const int src, const int dest, const int mode, const char *options, const char *filename, uint32_t *crcs, int cipher) {
struct stat filestats;
FILE *extd_urlfile;
char *file_extd_urls[256];
unsigned char algo;
char ch;
char *in_buf, *out_buf, *hdr_buf, *keybuf=NULL, *tmpbuf=NULL;
char version[3]={DACT_VER_MAJOR, DACT_VER_MINOR, DACT_VER_REVISION};
char file_opts=0;
uint32_t bytes_read, retsize;
uint32_t filesize=0, blk_cnt=0, file_extd_size=0, blksize=0, fileoutsize=0;
uint32_t magic=0, file_extd_read=0, file_extd_urlcnt=0;
int blksize_size;
int x=0, new_fd, canlseek=0;
fstat(src,&filestats);
if (mode==DACT_MODE_COMPR) {
/*
* Calculate the default block size.
*/
if (DACT_BLK_SIZE==0) {
DACT_BLK_SIZE=dact_blksize_calc(filestats.st_size);
}
if (((in_buf=malloc(DACT_BLK_SIZE))==NULL) || \
((out_buf=malloc(DACT_BLK_SIZE*2))==NULL)) {
PERROR("malloc");
return(0);
}
dact_ui_setup(((float) (filestats.st_size/DACT_BLK_SIZE)+0.9999));
if (cipher!=-1) {
dact_hdr_ext_regn(DACT_HDR_CIPHER, cipher, sizeof(cipher));
keybuf=malloc(DACT_KEY_SIZE);
ciphers[cipher](NULL, NULL, 0, keybuf, DACT_MODE_CINIT+DACT_MODE_CENC);
}
blksize_size=BYTESIZE(DACT_BLK_SIZE);
if (!options[DACT_OPT_ORIG] && filename!=NULL)
dact_hdr_ext_regs(DACT_HDR_NAME, filename, strlen(filename));
file_extd_size=(dact_hdr_ext_size()+14); /* The +14 is for crc0 and crc1 */
write_de(dest, DACT_MAGIC_NUMBER, 4);
write(dest, &version[0], 1);
write(dest, &version[1], 1);
write(dest, &version[2], 1);
write_de(dest, 0, 4); /* Place holder for ORIG FILE SIZE */
write_de(dest, 0, 4); /* Place holder for NUM BLOCKS */
write_de(dest, DACT_BLK_SIZE, 4);
write_de(dest, file_opts, 1); /* XXX: Option byte... Or not? */
write_de(dest, file_extd_size, 4); /* Place holder for SIZEOF EXTENDED DTA */
/* Fill the header with NOPs incase we can't come back and put the CRCs */
ch=DACT_HDR_NOP;
for (x=0;x<file_extd_size;x++) write(dest, &ch, 1);
if (options[DACT_OPT_VERB]>1) {
PRINTERR("Blk | Algo | Size | Name");
PRINTERR("----+------+---------+---------------------------");
}
memset(in_buf,0,DACT_BLK_SIZE);
while ( (bytes_read=read_f(src, in_buf, DACT_BLK_SIZE))>0) {
filesize+=bytes_read;
blk_cnt++;
retsize=dact_blk_compress(&algo, out_buf, in_buf, DACT_BLK_SIZE, options);
/* CIPHER the data if an encryption algorithm is specified. */
if (cipher!=-1) {
tmpbuf=malloc(retsize*2);
x=ciphers[cipher](out_buf, tmpbuf, retsize, keybuf, DACT_MODE_CENC);
memcpy(out_buf,tmpbuf,x);
free(tmpbuf);
}
if (retsize>0) {
if (options[DACT_OPT_VERB]>1) {
if (options[DACT_OPT_VERB]>2) {
PRINTERR("^^^\\ /^^^^\\ /^^^^^^^\\ /^^^^^^^^^^^^^^^^^^^^^^^^^^");
}
PRINT_LINE; fprintf(stderr, "dact: %03i | %03i | %-7i | %s\n",blk_cnt,algo,retsize,algorithm_names[algo]);
if (options[DACT_OPT_VERB]>2) {
PRINTERR("___/ \\____/ \\_______/ \\__________________________");
}
}
dact_ui_incrblkcnt(1);
dact_ui_status(DACT_UI_LVL_GEN, "Algorithm ");
dact_ui_status_append(DACT_UI_LVL_GEN,algorithm_names[algo]);
crcs[0]=ELFCRC(crcs[0], out_buf, retsize);
/* Do not generate a CRC of the plaintext if encrypting */
if (cipher==-1) {
crcs[1]=ELFCRC(crcs[1], in_buf, DACT_BLK_SIZE);
}
if (!options[DACT_OPT_HDONLY]) {
write(dest, &algo, 1);
write_de(dest, retsize, blksize_size);
if (write(dest, out_buf, retsize)!=retsize) {
PERROR("write");
free(in_buf);
free(out_buf);
return(0);
}
}
} else {
PRINTERR("Compression resulted in 0-byte block.");
free(in_buf);
free(out_buf);
return(0);
}
memset(in_buf,0,DACT_BLK_SIZE);
}
if (bytes_read<0) {
PERROR("read");
}
free(in_buf);
free(out_buf);
if (lseek_net(dest, 7, SEEK_SET)<0) {
/* If we can't rewind the stream, put magic+fileisze */
write_de(dest, DACT_MAGIC_PEOF, 4);
write_de(dest, filesize, 4);
} else {
write_de(dest, filesize, 4);
write_de(dest, blk_cnt, 4);
}
if (lseek_net(dest, DACT_HDR_REG_SIZE, SEEK_SET)>0) {
if (!options[DACT_OPT_NOCRC]) {
dact_hdr_ext_regn(DACT_HDR_CRC0, crcs[0], 4);
dact_hdr_ext_regn(DACT_HDR_CRC1, crcs[1], 4);
}
write(dest, dact_hdr_ext_data(), dact_hdr_ext_size());
}
dact_hdr_ext_clear();
return(filesize);
}
if (mode==DACT_MODE_DECMP) {
dact_ui_status(DACT_UI_LVL_GEN, "Decompressing.");
dact_hdr_ext_clear();
read_de(src, &magic, 4, sizeof(magic));
if (magic!=DACT_MAGIC_NUMBER) {
dact_ui_status(DACT_UI_LVL_GEN, "Bad DACT magic, checking others...");
return(dact_process_other(src,dest,magic,options));
}
read(src, &version[0], 1);
read(src, &version[1], 1);
read(src, &version[2], 1);
read_de(src, &filesize, 4, sizeof(filesize));
read_de(src, &blk_cnt, 4, sizeof(blk_cnt));
read_de(src, &DACT_BLK_SIZE, 4, sizeof(DACT_BLK_SIZE));
read(src, &file_opts, 1);
read_de(src, &file_extd_size, 4, sizeof(file_extd_size));
while (file_extd_read<file_extd_size) {
x=0;
read(src, &ch, 1);
if (ch!=DACT_HDR_NOP) read_de(src, &x, 2, sizeof(x));
switch (ch) {
case DACT_HDR_CRC0:
read_de(src, &crcs[2], 4, sizeof(crcs[2]));
if (crcs[4]!=0 && crcs[2]!=crcs[4]) {
dact_ui_status(DACT_UI_LVL_GEN, "CRC error.");
if (!options[DACT_OPT_NOCRC])
return(0);
}
break;
case DACT_HDR_CRC1:
read_de(src, &crcs[3], 4, sizeof(crcs[3]));
if (crcs[5]!=0 && crcs[3]!=crcs[5]) {
dact_ui_status(DACT_UI_LVL_GEN, "CRC error.");
if (!options[DACT_OPT_NOCRC])
return(0);
}
break;
/*
XXX: Todo, make this do something...
case DACT_HDR_NAME:
break;
*/
case DACT_HDR_URL:
hdr_buf=malloc(x+1);
read_f(src, hdr_buf, x);
hdr_buf[x]=0;
file_extd_urls[file_extd_urlcnt++]=parse_url_subst(hdr_buf,filename);
free(hdr_buf);
break;
case DACT_HDR_URLFILE:
hdr_buf=malloc(x+1);
read_f(src, hdr_buf, x);
hdr_buf[x]=0;
extd_urlfile=fopen(hdr_buf, "r");
free(hdr_buf); /* We shouldn't need this anymore. */
if (extd_urlfile==NULL) break;
hdr_buf=malloc(4096);
while (1) {
fgets(hdr_buf, 4095, extd_urlfile);
if (feof(extd_urlfile)) break;
hdr_buf=strsep(&hdr_buf,"\n");
file_extd_urls[file_extd_urlcnt++]=parse_url_subst(hdr_buf,filename);
}
free(hdr_buf);
break;
case DACT_HDR_DESC:
hdr_buf=malloc(x+1);
read_f(src, hdr_buf, x);
hdr_buf[x]=0;
fprintf(stderr, "DESC: %s\n",hdr_buf);
free(hdr_buf);
break;
case DACT_HDR_CIPHER:
read_de(src,&cipher,x,sizeof(cipher));
break;
case DACT_HDR_NOP:
x=-2;
break;
default:
hdr_buf=malloc(x);
read_f(src, hdr_buf, x);
free(hdr_buf);
break;
}
file_extd_read+=(x+3);
}
if (options[DACT_OPT_URL]) {
for (x=0;x<file_extd_urlcnt;x++) {
dact_ui_status(DACT_UI_LVL_GEN,"Trying to get remote url ");
dact_ui_status_append(DACT_UI_LVL_SPEC, file_extd_urls[x]);
if ((new_fd=open_net(file_extd_urls[x],O_RDONLY,0))<0) {
dact_ui_status(DACT_UI_LVL_GEN, "Failed.");
continue;
}
close(src);
crcs[4]=crcs[2];
crcs[5]=crcs[3];
return(dact_process_file(new_fd, dest, mode, options, filename, crcs, cipher));
}
}
/*
XXX: Even if we don't resolve it here, we can resolve it later...
Should we even bother to do it here if we can?
XXX: When CAN'T we rewind a read stream?
When it's a pipe
*/
if (filesize==0) {
/* See if we can rewind our stream, so when we get to the end, we can come back! */
if (lseek_net(src, 1, SEEK_SET)==1) { /* MAJOR BUG HERE! was: lseek(src,1,SEEK_SET)==0 which will always be false. */
canlseek=1;
lseek_net(src, -8, SEEK_END);
read_de(src, &magic, 4, sizeof(magic));
if (magic!=DACT_MAGIC_PEOF) {
dact_ui_status(DACT_UI_LVL_GEN, "File is corrupt.");
return(0);
}
read_de(src, &filesize, 4, sizeof(filesize));
lseek_net(src, DACT_HDR_REG_SIZE+file_extd_size, SEEK_SET);
} else {
canlseek=0;
}
}
if (((out_buf=malloc(DACT_BLK_SIZE))==NULL) ) {
PERROR("malloc");
return(0);
}
blksize_size=BYTESIZE(DACT_BLK_SIZE);
dact_ui_setup((int)(((float) filesize/(float) DACT_BLK_SIZE)+0.9999));
if (cipher!=-1) {
keybuf=malloc(DACT_KEY_SIZE);
ciphers[cipher](NULL, NULL, 0, keybuf, DACT_MODE_CINIT+DACT_MODE_CDEC);
}
while (1) {
if (read(src, &algo, 1)==0) break;
if (algo==0xff) break; /* 0xff is reserved for EOF */
read_de(src, &blksize, blksize_size, sizeof(blksize));
if ((in_buf=malloc(blksize))==NULL) {
PERROR("malloc");
free(out_buf);
return(0);
}
read_f(src, in_buf, blksize);
crcs[0]=ELFCRC(crcs[0],in_buf,blksize);
if (cipher!=-1) {
tmpbuf=malloc(blksize*2);
x=ciphers[cipher](in_buf, tmpbuf, blksize, keybuf, DACT_MODE_CDEC);
memcpy(in_buf,tmpbuf,x);
free(tmpbuf);
}
/*
* If the filesize is not specified, try to find it in the stream...
* this is pretty stupid, because if we can't rewind OUR read stream
* we're SOL... do we really need the filesize that badly? I guess
* we do to truncate the last of it... Adding more checks in here..
*
* This will never get used, canlseek will be 1 only if we can sucessfully
* seek, in which case, we have done it above.
*/
#if 0
if (filesize==0 && canlseek) {
read_de(src, &magic, 4);
read_de(src, &filesize, 4);
if (read(src, &x, 1)==0) {
if (magic!=DACT_MAGIC_PEOF) {
dact_ui_status(DACT_UI_LVL_GEN, "Stream is corrupt.");
free(in_buf);
free(out_buf);
return(0);
}
} else {
lseek(src, -9, SEEK_CUR);
filesize=0;
}
}
#endif
if ((bytes_read=dact_blk_decompress(out_buf, in_buf, blksize, 0, algo))==0) {
if (cipher!=-1) {
PRINTERR("Decompression resulted in 0-byte block. Invalid key?");
} else {
PRINTERR("Decompression resulted in 0-byte block.");
}
}
fileoutsize+=bytes_read;
/* If ciphering, don't try to calculate this CRC. */
if (cipher==-1) {
crcs[1]=ELFCRC(crcs[1],out_buf,bytes_read);
}
dact_ui_incrblkcnt(1);
if (fileoutsize>filesize && filesize!=0) {
write(dest, out_buf, DACT_BLK_SIZE-(fileoutsize-filesize));
} else {
write(dest, out_buf, bytes_read);
}
free(in_buf);
}
free(out_buf);
if ((crcs[0]!=crcs[2] && crcs[0]!=0 && crcs[2]!=0) \
|| (crcs[1]!=crcs[3] && crcs[1]!=0 && crcs[3]!=0)) {
dact_ui_status(DACT_UI_LVL_GEN, "CRC error.");
if (!options[DACT_OPT_NOCRC] || options[DACT_OPT_FORCE]<1)
return(0);
}
dact_hdr_ext_clear();
return(filesize);
}
if (mode==DACT_MODE_STAT) {
read_de(src, &magic, 4, sizeof(magic));
read(src, &version[0], 1);
read(src, &version[1], 1);
read(src, &version[2], 1);
read_de(src, &filesize, 4, sizeof(filesize));
read_de(src, &blk_cnt, 4, sizeof(blk_cnt));
read_de(src, &DACT_BLK_SIZE, 4, sizeof(DACT_BLK_SIZE));
read(src, &file_opts, 1);
read_de(src, &file_extd_size, 4, sizeof(file_extd_size));
printf("File : %s\n", filename);
printf("Magic : 0x%08x",magic);
if (magic!=DACT_MAGIC_NUMBER) {
printf(" (bad magic)\n");
return(0);
} else {
printf("\n");
}
if (filesize==0) {
lseek_net(src, -8, SEEK_END);
read_de(src, &magic, 4, sizeof(magic));
read_de(src, &filesize, 4, sizeof(filesize));
if (magic!=DACT_MAGIC_PEOF) {
PRINTERR("Bad magic, corrupt stream.");
return(0);
}
}
fileoutsize=lseek_net(src, 0, SEEK_END);
printf("Dact Version : %i.%i.%i\n",version[0],version[1],version[2]);
printf("Block Size : %i\n", DACT_BLK_SIZE);
printf("Block Header Size : %i\n", BYTESIZE(DACT_BLK_SIZE)+1);
printf("Compressed Size : %i\n", fileoutsize);
printf("Uncompressed Size : %i\n", filesize);
printf("Ratio : %2.3f to 1.0\n", ((float) filesize)/((float) fileoutsize) );
lseek_net(src, DACT_HDR_REG_SIZE, SEEK_SET);
while (file_extd_read<file_extd_size) {
x=0;
read(src, &ch, 1);
if (ch!=DACT_HDR_NOP) read_de(src, &x, 2, sizeof(x));
switch (ch) {
case DACT_HDR_CRC0:
read_de(src, &crcs[2], 4, sizeof(crcs[2]));
printf("CRC 0 : 0x%08x\n", crcs[2]);
break;
case DACT_HDR_CRC1:
read_de(src, &crcs[3], 4, sizeof(crcs[3]));
printf("CRC 1 : 0x%08x\n", crcs[3]);
break;
case DACT_HDR_NAME:
hdr_buf=malloc(x+1);
read_f(src, hdr_buf, x);
hdr_buf[x]=0;
printf("Original Name : %s\n", hdr_buf);
free(hdr_buf);
break;
case DACT_HDR_URL:
hdr_buf=malloc(x+1);
read_f(src, hdr_buf, x);
hdr_buf[x]=0;
file_extd_urls[file_extd_urlcnt++]=parse_url_subst(hdr_buf,filename);
free(hdr_buf);
break;
case DACT_HDR_URLFILE:
hdr_buf=malloc(x+1);
read_f(src, hdr_buf, x);
hdr_buf[x]=0;
printf("Download Loc File : %s\n", hdr_buf);
extd_urlfile=fopen(hdr_buf, "r");
free(hdr_buf); /* We shouldn't need this anymore. */
if (extd_urlfile==NULL) break;
hdr_buf=malloc(4096);
while (1) {
fgets(hdr_buf, 4095, extd_urlfile);
if (feof(extd_urlfile)) break;
hdr_buf=strsep(&hdr_buf,"\n");
file_extd_urls[file_extd_urlcnt++]=parse_url_subst(hdr_buf,filename);
}
free(hdr_buf);
break;
case DACT_HDR_DESC:
hdr_buf=malloc(x+1);
read_f(src, hdr_buf, x);
hdr_buf[x]=0;
printf("Description : %s\n", hdr_buf);
free(hdr_buf);
break;
case DACT_HDR_CIPHER:
read_de(src, &cipher, x, sizeof(cipher));
printf("Ciphered using : %s\n", ciphers_name[cipher]);
break;
case DACT_HDR_NOP:
x=-2;
break;
default:
hdr_buf=malloc(x);
read_f(src, hdr_buf, x);
free(hdr_buf);
break;
}
file_extd_read+=(x+3);
}
for (x=0;x<file_extd_urlcnt;x++) {
printf("Download Location : %s",file_extd_urls[x]);
if (options[DACT_OPT_VERB]) {
if ((new_fd=open_net(file_extd_urls[x],O_RDONLY, 0))<0) {
printf(" [broken]\n");
continue;
}
close(new_fd);
}
printf("\n");
}
blk_cnt=0;
blksize_size=BYTESIZE(DACT_BLK_SIZE);
if (options[DACT_OPT_VERB]) {
lseek_net(src, DACT_HDR_REG_SIZE+file_extd_size, SEEK_SET);
printf("\n");
printf("Break down: \n");
printf(" Blk | Algo | Size | Name\n");
printf(" ----+------+---------+---------------------------\n");
while (1) {
if (read(src, &algo, 1)==0) break;
if (algo==0xff) break; /* 0xff is reserved for EOF */
read_de(src, &blksize, blksize_size, sizeof(blksize));
lseek_net(src, blksize, SEEK_CUR);
printf(" %03i | %03i | %-7i | %s\n",blk_cnt,algo,blksize,algorithm_names[algo]);
blk_cnt++;
}
}
printf("\n");
return(1);
}
return(0);
}
|
Added dact_common.h.
|
|
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
|
#ifndef _DACT_COMMON_H
#define _DACT_COMMON_H
#include "dact.h"
int dact_config_execute(const char *cmd, char *options);
void dact_config_loadfile(const char *path, char *options);
uint32_t dact_blk_decompress(char *ret, const char *srcbuf, const uint32_t size, const char *options, const int algo);
uint32_t dact_blk_compress(char *algo, char *ret, const char *srcbuf, const uint32_t size, const char *options);
uint32_t dact_process_file(const int src, const int dest, const int mode, const char *options, const char *filename, uint32_t *crcs, int cipher);
#endif
|
Added dendian.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#include "dact.h"
#include <stdio.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include "dendian.h"
int write_de(const int dst, const uint32_t num, const int sze) {
unsigned char buf[4]={0, 0, 0, 0};
int i,x=0,v;
for (i=0;i<sze;i++) {
buf[sze-i-1]=((num&(0xff<<(i*8)))>>(i*8));
}
for (i=0;i<sze;i++) {
if ((v=write(dst, &buf[i], 1))<0) {
PERROR("write");
return(-1);
}
x+=v;
}
return(x);
}
int read_de(const int src, void *dest, const int sze, const int out_sze) {
unsigned char ch;
uint32_t ret=0;
int i;
for (i=0;i<sze;i++) {
if (read(src, &ch, 1)<1) {
PERROR("read");
return(-1);
}
ret|=ch<<(8*(sze-i-1));
}
memcpy(dest, &ret, out_sze);
return(sze);
}
|
Added dendian.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#ifndef __ENDIAN_LOCAL_H
#define __ENDIAN_LOCAL_H
int write_de(const int dst, const uint32_t num, const int sze);
int read_de(const int src, void *dest, const int sze, const int out_sze);
/*
#ifdef __DACT_C
unsigned char ENDIAN_LOCAL_BUF[4]={0, 0, 0, 0};
#endif
#define WRITE_2BYTE_DE(x,y) 2; \
ENDIAN_LOCAL_BUF[0]=((y&0xff00) >> 8); \
ENDIAN_LOCAL_BUF[1]=((y&0x00ff)); \
write(x,&ENDIAN_LOCAL_BUF[0],1); \
write(x,&ENDIAN_LOCAL_BUF[1],1)
#define WRITE_4BYTE_DE(x,y) 4; \
ENDIAN_LOCAL_BUF[0]=((y&0xff000000) >> 24); \
ENDIAN_LOCAL_BUF[1]=((y&0x00ff0000) >> 16); \
ENDIAN_LOCAL_BUF[2]=((y&0x0000ff00) >> 8); \
ENDIAN_LOCAL_BUF[3]=((y&0x000000ff)); \
write(x,&ENDIAN_LOCAL_BUF[0],1); \
write(x,&ENDIAN_LOCAL_BUF[1],1); \
write(x,&ENDIAN_LOCAL_BUF[2],1); \
write(x,&ENDIAN_LOCAL_BUF[3],1)
#define READ_2BYTE_DE(x,y) (read(x,&ENDIAN_LOCAL_BUF[0],1)+ \
read(x,&ENDIAN_LOCAL_BUF[1],1)); \
y=((ENDIAN_LOCAL_BUF[0]<<8)|ENDIAN_LOCAL_BUF[1])
#define READ_4BYTE_DE(x,y) (read(x,&ENDIAN_LOCAL_BUF[0],1)+\
read(x,&ENDIAN_LOCAL_BUF[1],1)+\
read(x,&ENDIAN_LOCAL_BUF[2],1)+\
read(x,&ENDIAN_LOCAL_BUF[3],1)); \
y=((ENDIAN_LOCAL_BUF[0]<<24)|(ENDIAN_LOCAL_BUF[1]<<16)|(ENDIAN_LOCAL_BUF[2]<<8)|ENDIAN_LOCAL_BUF[3])
#define WRITE_NBYTE_DE(x,y,n) (((int) (n/2))*2); if (n<=2) { WRITE_2BYTE_DE(x,y); } else { WRITE_4BYTE_DE(x,y); }
#define READ_NBYTE_DE(x,y,n) (((int) (n/2))*2); if (n<=2) { READ_2BYTE_DE(x,y); } else { READ_4BYTE_DE(x,y); }
*/
#endif
|
Added getopt.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
|
/* Getopt for GNU.
NOTE: getopt is now part of the C library, so if you don't know what
"Keep this file name-space clean" means, talk to drepper@gnu.org
before changing it!
Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98
Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@gnu.org.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA. */
/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
Ditto for AIX 3.2 and <stdlib.h>. */
#ifndef _NO_PROTO
# define _NO_PROTO
#endif
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#if !defined __STDC__ || !__STDC__
/* This is a separate conditional since some stdc systems
reject `defined (const)'. */
# ifndef const
# define const
# endif
#endif
#include <stdio.h>
/* Comment out all this code if we are using the GNU C Library, and are not
actually compiling the library itself. This code is part of the GNU C
Library, but also included in many other GNU distributions. Compiling
and linking in this code is a waste when using the GNU C library
(especially if it is a shared library). Rather than having every GNU
program understand `configure --with-gnu-libc' and omit the object files,
it is simpler to just do this in the source for each such file. */
#define GETOPT_INTERFACE_VERSION 2
#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2
# include <gnu-versions.h>
# if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
# define ELIDE_CODE
# endif
#endif
#ifndef ELIDE_CODE
/* This needs to come after some library #include
to get __GNU_LIBRARY__ defined. */
#ifdef __GNU_LIBRARY__
/* Don't include stdlib.h for non-GNU C libraries because some of them
contain conflicting prototypes for getopt. */
# include <stdlib.h>
# include <unistd.h>
#endif /* GNU C library. */
#ifdef VMS
# include <unixlib.h>
# if HAVE_STRING_H - 0
# include <string.h>
# endif
#endif
#ifndef _
/* This is for other GNU distributions with internationalized messages.
When compiling libc, the _ macro is predefined. */
# ifdef HAVE_LIBINTL_H
# include <libintl.h>
# define _(msgid) gettext (msgid)
# else
# define _(msgid) (msgid)
# endif
#endif
/* This version of `getopt' appears to the caller like standard Unix `getopt'
but it behaves differently for the user, since it allows the user
to intersperse the options with the other arguments.
As `getopt' works, it permutes the elements of ARGV so that,
when it is done, all the options precede everything else. Thus
all application programs are extended to handle flexible argument order.
Setting the environment variable POSIXLY_CORRECT disables permutation.
Then the behavior is completely standard.
GNU application programs can use a third alternative mode in which
they can distinguish the relative order of options and other arguments. */
#include "getopt.h"
/* For communication from `getopt' to the caller.
When `getopt' finds an option that takes an argument,
the argument value is returned here.
Also, when `ordering' is RETURN_IN_ORDER,
each non-option ARGV-element is returned here. */
char *optarg = NULL;
/* Index in ARGV of the next element to be scanned.
This is used for communication to and from the caller
and for communication between successive calls to `getopt'.
On entry to `getopt', zero means this is the first call; initialize.
When `getopt' returns -1, this is the index of the first of the
non-option elements that the caller should itself scan.
Otherwise, `optind' communicates from one call to the next
how much of ARGV has been scanned so far. */
/* 1003.2 says this must be 1 before any call. */
int optind = 1;
/* Formerly, initialization of getopt depended on optind==0, which
causes problems with re-calling getopt as programs generally don't
know that. */
int __getopt_initialized = 0;
/* The next char to be scanned in the option-element
in which the last option character we returned was found.
This allows us to pick up the scan where we left off.
If this is zero, or a null string, it means resume the scan
by advancing to the next ARGV-element. */
static char *nextchar;
/* Callers store zero here to inhibit the error message
for unrecognized options. */
int opterr = 1;
/* Set to an option character which was unrecognized.
This must be initialized on some systems to avoid linking in the
system's own getopt implementation. */
int optopt = '?';
/* Describe how to deal with options that follow non-option ARGV-elements.
If the caller did not specify anything,
the default is REQUIRE_ORDER if the environment variable
POSIXLY_CORRECT is defined, PERMUTE otherwise.
REQUIRE_ORDER means don't recognize them as options;
stop option processing when the first non-option is seen.
This is what Unix does.
This mode of operation is selected by either setting the environment
variable POSIXLY_CORRECT, or using `+' as the first character
of the list of option characters.
PERMUTE is the default. We permute the contents of ARGV as we scan,
so that eventually all the non-options are at the end. This allows options
to be given in any order, even with programs that were not written to
expect this.
RETURN_IN_ORDER is an option available to programs that were written
to expect options and other ARGV-elements in any order and that care about
the ordering of the two. We describe each non-option ARGV-element
as if it were the argument of an option with character code 1.
Using `-' as the first character of the list of option characters
selects this mode of operation.
The special argument `--' forces an end of option-scanning regardless
of the value of `ordering'. In the case of RETURN_IN_ORDER, only
`--' can cause `getopt' to return -1 with `optind' != ARGC. */
static enum
{
REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
} ordering;
/* Value of POSIXLY_CORRECT environment variable. */
static char *posixly_correct;
#ifdef __GNU_LIBRARY__
/* We want to avoid inclusion of string.h with non-GNU libraries
because there are many ways it can cause trouble.
On some systems, it contains special magic macros that don't work
in GCC. */
# include <string.h>
# define my_index strchr
#else
# if HAVE_STRING_H
# include <string.h>
# else
# if HAVE_STRINGS_H
# include <strings.h>
# endif
# endif
/* Avoid depending on library functions or files
whose names are inconsistent. */
#ifndef getenv
#ifdef __cplusplus
extern "C" {
#endif
extern char *getenv (const char *name);
#ifdef __cplusplus
}
#endif
#endif
static char *
my_index (const char *str, int chr)
{
while (*str)
{
if (*str == chr)
return (char *) str;
str++;
}
return 0;
}
/* If using GCC, we can safely declare strlen this way.
If not using GCC, it is ok not to declare it. */
#ifdef __GNUC__
/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h.
That was relevant to code that was here before. */
# if (!defined __STDC__ || !__STDC__) && !defined strlen
/* gcc with -traditional declares the built-in strlen to return int,
and has done so at least since version 2.4.5. -- rms. */
extern int strlen (const char *);
# endif /* not __STDC__ */
#endif /* __GNUC__ */
#endif /* not __GNU_LIBRARY__ */
/* Handle permutation of arguments. */
/* Describe the part of ARGV that contains non-options that have
been skipped. `first_nonopt' is the index in ARGV of the first of them;
`last_nonopt' is the index after the last of them. */
static int first_nonopt;
static int last_nonopt;
#ifdef _LIBC
/* Bash 2.0 gives us an environment variable containing flags
indicating ARGV elements that should not be considered arguments. */
/* Defined in getopt_init.c */
extern char *__getopt_nonoption_flags;
static int nonoption_flags_max_len;
static int nonoption_flags_len;
static int original_argc;
static char *const *original_argv;
/* Make sure the environment variable bash 2.0 puts in the environment
is valid for the getopt call we must make sure that the ARGV passed
to getopt is that one passed to the process. */
static void
__attribute__ ((unused))
store_args_and_env (int argc, char *const *argv)
{
/* XXX This is no good solution. We should rather copy the args so
that we can compare them later. But we must not use malloc(3). */
original_argc = argc;
original_argv = argv;
}
# ifdef text_set_element
text_set_element (__libc_subinit, store_args_and_env);
# endif /* text_set_element */
# define SWAP_FLAGS(ch1, ch2) \
if (nonoption_flags_len > 0) \
{ \
char __tmp = __getopt_nonoption_flags[ch1]; \
__getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \
__getopt_nonoption_flags[ch2] = __tmp; \
}
#else /* !_LIBC */
# define SWAP_FLAGS(ch1, ch2)
#endif /* _LIBC */
/* Exchange two adjacent subsequences of ARGV.
One subsequence is elements [first_nonopt,last_nonopt)
which contains all the non-options that have been skipped so far.
The other is elements [last_nonopt,optind), which contains all
the options processed since those non-options were skipped.
`first_nonopt' and `last_nonopt' are relocated so that they describe
the new indices of the non-options in ARGV after they are moved. */
#if defined __STDC__ && __STDC__
static void exchange (char **);
#endif
static void
exchange (char **argv)
{
int bottom = first_nonopt;
int middle = last_nonopt;
int top = optind;
char *tem;
/* Exchange the shorter segment with the far end of the longer segment.
That puts the shorter segment into the right place.
It leaves the longer segment in the right place overall,
but it consists of two parts that need to be swapped next. */
#ifdef _LIBC
/* First make sure the handling of the `__getopt_nonoption_flags'
string can work normally. Our top argument must be in the range
of the string. */
if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len)
{
/* We must extend the array. The user plays games with us and
presents new arguments. */
char *new_str = malloc (top + 1);
if (new_str == NULL)
nonoption_flags_len = nonoption_flags_max_len = 0;
else
{
memset (__mempcpy (new_str, __getopt_nonoption_flags,
nonoption_flags_max_len),
'\0', top + 1 - nonoption_flags_max_len);
nonoption_flags_max_len = top + 1;
__getopt_nonoption_flags = new_str;
}
}
#endif
while (top > middle && middle > bottom)
{
if (top - middle > middle - bottom)
{
/* Bottom segment is the short one. */
int len = middle - bottom;
register int i;
/* Swap it with the top part of the top segment. */
for (i = 0; i < len; i++)
{
tem = argv[bottom + i];
argv[bottom + i] = argv[top - (middle - bottom) + i];
argv[top - (middle - bottom) + i] = tem;
SWAP_FLAGS (bottom + i, top - (middle - bottom) + i);
}
/* Exclude the moved bottom segment from further swapping. */
top -= len;
}
else
{
/* Top segment is the short one. */
int len = top - middle;
register int i;
/* Swap it with the bottom part of the bottom segment. */
for (i = 0; i < len; i++)
{
tem = argv[bottom + i];
argv[bottom + i] = argv[middle + i];
argv[middle + i] = tem;
SWAP_FLAGS (bottom + i, middle + i);
}
/* Exclude the moved top segment from further swapping. */
bottom += len;
}
}
/* Update records for the slots the non-options now occupy. */
first_nonopt += (optind - last_nonopt);
last_nonopt = optind;
}
/* Initialize the internal data when the first call is made. */
#if defined __STDC__ && __STDC__
static const char *_getopt_initialize (int, char *const *, const char *);
#endif
static const char *
_getopt_initialize (int argc, char *const *argv, const char *optstring)
{
/* Start processing options with ARGV-element 1 (since ARGV-element 0
is the program name); the sequence of previously skipped
non-option ARGV-elements is empty. */
first_nonopt = last_nonopt = optind;
nextchar = NULL;
posixly_correct = getenv ("POSIXLY_CORRECT");
/* Determine how to handle the ordering of options and nonoptions. */
if (optstring[0] == '-')
{
ordering = RETURN_IN_ORDER;
++optstring;
}
else if (optstring[0] == '+')
{
ordering = REQUIRE_ORDER;
++optstring;
}
else if (posixly_correct != NULL)
ordering = REQUIRE_ORDER;
else
ordering = PERMUTE;
#ifdef _LIBC
if (posixly_correct == NULL
&& argc == original_argc && argv == original_argv)
{
if (nonoption_flags_max_len == 0)
{
if (__getopt_nonoption_flags == NULL
|| __getopt_nonoption_flags[0] == '\0')
nonoption_flags_max_len = -1;
else
{
const char *orig_str = __getopt_nonoption_flags;
int len = nonoption_flags_max_len = strlen (orig_str);
if (nonoption_flags_max_len < argc)
nonoption_flags_max_len = argc;
__getopt_nonoption_flags =
(char *) malloc (nonoption_flags_max_len);
if (__getopt_nonoption_flags == NULL)
nonoption_flags_max_len = -1;
else
memset (__mempcpy (__getopt_nonoption_flags, orig_str, len),
'\0', nonoption_flags_max_len - len);
}
}
nonoption_flags_len = nonoption_flags_max_len;
}
else
nonoption_flags_len = 0;
#endif
return optstring;
}
/* Scan elements of ARGV (whose length is ARGC) for option characters
given in OPTSTRING.
If an element of ARGV starts with '-', and is not exactly "-" or "--",
then it is an option element. The characters of this element
(aside from the initial '-') are option characters. If `getopt'
is called repeatedly, it returns successively each of the option characters
from each of the option elements.
If `getopt' finds another option character, it returns that character,
updating `optind' and `nextchar' so that the next call to `getopt' can
resume the scan with the following option character or ARGV-element.
If there are no more option characters, `getopt' returns -1.
Then `optind' is the index in ARGV of the first ARGV-element
that is not an option. (The ARGV-elements have been permuted
so that those that are not options now come last.)
OPTSTRING is a string containing the legitimate option characters.
If an option character is seen that is not listed in OPTSTRING,
return '?' after printing an error message. If you set `opterr' to
zero, the error message is suppressed but we still return '?'.
If a char in OPTSTRING is followed by a colon, that means it wants an arg,
so the following text in the same ARGV-element, or the text of the following
ARGV-element, is returned in `optarg'. Two colons mean an option that
wants an optional arg; if there is text in the current ARGV-element,
it is returned in `optarg', otherwise `optarg' is set to zero.
If OPTSTRING starts with `-' or `+', it requests different methods of
handling the non-option ARGV-elements.
See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.
Long-named options begin with `--' instead of `-'.
Their names may be abbreviated as long as the abbreviation is unique
or is an exact match for some defined option. If they have an
argument, it follows the option name in the same ARGV-element, separated
from the option name by a `=', or else the in next ARGV-element.
When `getopt' finds a long-named option, it returns 0 if that option's
`flag' field is nonzero, the value of the option's `val' field
if the `flag' field is zero.
The elements of ARGV aren't really const, because we permute them.
But we pretend they're const in the prototype to be compatible
with other systems.
LONGOPTS is a vector of `struct option' terminated by an
element containing a name which is zero.
LONGIND returns the index in LONGOPT of the long-named option found.
It is only valid when a long-named option has been found by the most
recent call.
If LONG_ONLY is nonzero, '-' as well as '--' can introduce
long-named options. */
int
_getopt_internal (int argc, char *const *argv, const char *optstring, const struct option *longopts, int *longind, int long_only)
{
optarg = NULL;
if (optind == 0 || !__getopt_initialized)
{
if (optind == 0)
optind = 1; /* Don't scan ARGV[0], the program name. */
optstring = _getopt_initialize (argc, argv, optstring);
__getopt_initialized = 1;
}
/* Test whether ARGV[optind] points to a non-option argument.
Either it does not have option syntax, or there is an environment flag
from the shell indicating it is not an option. The later information
is only used when the used in the GNU libc. */
#ifdef _LIBC
# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \
|| (optind < nonoption_flags_len \
&& __getopt_nonoption_flags[optind] == '1'))
#else
# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0')
#endif
if (nextchar == NULL || *nextchar == '\0')
{
/* Advance to the next ARGV-element. */
/* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been
moved back by the user (who may also have changed the arguments). */
if (last_nonopt > optind)
last_nonopt = optind;
if (first_nonopt > optind)
first_nonopt = optind;
if (ordering == PERMUTE)
{
/* If we have just processed some options following some non-options,
exchange them so that the options come first. */
if (first_nonopt != last_nonopt && last_nonopt != optind)
exchange ((char **) argv);
else if (last_nonopt != optind)
first_nonopt = optind;
/* Skip any additional non-options
and extend the range of non-options previously skipped. */
while (optind < argc && NONOPTION_P)
optind++;
last_nonopt = optind;
}
/* The special ARGV-element `--' means premature end of options.
Skip it like a null option,
then exchange with previous non-options as if it were an option,
then skip everything else like a non-option. */
if (optind != argc && !strcmp (argv[optind], "--"))
{
optind++;
if (first_nonopt != last_nonopt && last_nonopt != optind)
exchange ((char **) argv);
else if (first_nonopt == last_nonopt)
first_nonopt = optind;
last_nonopt = argc;
optind = argc;
}
/* If we have done all the ARGV-elements, stop the scan
and back over any non-options that we skipped and permuted. */
if (optind == argc)
{
/* Set the next-arg-index to point at the non-options
that we previously skipped, so the caller will digest them. */
if (first_nonopt != last_nonopt)
optind = first_nonopt;
return -1;
}
/* If we have come to a non-option and did not permute it,
either stop the scan or describe it to the caller and pass it by. */
if (NONOPTION_P)
{
if (ordering == REQUIRE_ORDER)
return -1;
optarg = argv[optind++];
return 1;
}
/* We have found another option-ARGV-element.
Skip the initial punctuation. */
nextchar = (argv[optind] + 1
+ (longopts != NULL && argv[optind][1] == '-'));
}
/* Decode the current option-ARGV-element. */
/* Check whether the ARGV-element is a long option.
If long_only and the ARGV-element has the form "-f", where f is
a valid short option, don't consider it an abbreviated form of
a long option that starts with f. Otherwise there would be no
way to give the -f short option.
On the other hand, if there's a long option "fubar" and
the ARGV-element is "-fu", do consider that an abbreviation of
the long option, just like "--fu", and not "-f" with arg "u".
This distinction seems to be the most useful approach. */
if (longopts != NULL
&& (argv[optind][1] == '-'
|| (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1])))))
{
char *nameend;
const struct option *p;
const struct option *pfound = NULL;
int exact = 0;
int ambig = 0;
int indfound = -1;
int option_index;
for (nameend = nextchar; *nameend && *nameend != '='; nameend++)
/* Do nothing. */ ;
/* Test all long options for either exact match
or abbreviated matches. */
for (p = longopts, option_index = 0; p->name; p++, option_index++)
if (!strncmp (p->name, nextchar, nameend - nextchar))
{
if ((unsigned int) (nameend - nextchar)
== (unsigned int) strlen (p->name))
{
/* Exact match found. */
pfound = p;
indfound = option_index;
exact = 1;
break;
}
else if (pfound == NULL)
{
/* First nonexact match found. */
pfound = p;
indfound = option_index;
}
else
/* Second or later nonexact match found. */
ambig = 1;
}
if (ambig && !exact)
{
if (opterr)
fprintf (stderr, _("%s: option `%s' is ambiguous\n"),
argv[0], argv[optind]);
nextchar += strlen (nextchar);
optind++;
optopt = 0;
return '?';
}
if (pfound != NULL)
{
option_index = indfound;
optind++;
if (*nameend)
{
/* Don't test has_arg with >, because some C compilers don't
allow it to be used on enums. */
if (pfound->has_arg)
optarg = nameend + 1;
else
{
if (opterr)
{
if (argv[optind - 1][1] == '-')
/* --option */
fprintf (stderr,
_("%s: option `--%s' doesn't allow an argument\n"),
argv[0], pfound->name);
else
/* +option or -option */
fprintf (stderr,
_("%s: option `%c%s' doesn't allow an argument\n"),
argv[0], argv[optind - 1][0], pfound->name);
nextchar += strlen (nextchar);
optopt = pfound->val;
return '?';
}
}
}
else if (pfound->has_arg == 1)
{
if (optind < argc)
optarg = argv[optind++];
else
{
if (opterr)
fprintf (stderr,
_("%s: option `%s' requires an argument\n"),
argv[0], argv[optind - 1]);
nextchar += strlen (nextchar);
optopt = pfound->val;
return optstring[0] == ':' ? ':' : '?';
}
}
nextchar += strlen (nextchar);
if (longind != NULL)
*longind = option_index;
if (pfound->flag)
{
*(pfound->flag) = pfound->val;
return 0;
}
return pfound->val;
}
/* Can't find it as a long option. If this is not getopt_long_only,
or the option starts with '--' or is not a valid short
option, then it's an error.
Otherwise interpret it as a short option. */
if (!long_only || argv[optind][1] == '-'
|| my_index (optstring, *nextchar) == NULL)
{
if (opterr)
{
if (argv[optind][1] == '-')
/* --option */
fprintf (stderr, _("%s: unrecognized option `--%s'\n"),
argv[0], nextchar);
else
/* +option or -option */
fprintf (stderr, _("%s: unrecognized option `%c%s'\n"),
argv[0], argv[optind][0], nextchar);
}
nextchar = (char *) "";
optind++;
optopt = 0;
return '?';
}
}
/* Look at and handle the next short option-character. */
{
char c = *nextchar++;
char *temp = my_index (optstring, c);
/* Increment `optind' when we start to process its last character. */
if (*nextchar == '\0')
++optind;
if (temp == NULL || c == ':')
{
if (opterr)
{
if (posixly_correct)
/* 1003.2 specifies the format of this message. */
fprintf (stderr, _("%s: illegal option -- %c\n"),
argv[0], c);
else
fprintf (stderr, _("%s: invalid option -- %c\n"),
argv[0], c);
}
optopt = c;
return '?';
}
/* Convenience. Treat POSIX -W foo same as long option --foo */
if (temp[0] == 'W' && temp[1] == ';')
{
char *nameend;
const struct option *p;
const struct option *pfound = NULL;
int exact = 0;
int ambig = 0;
int indfound = 0;
int option_index;
/* This is an option that requires an argument. */
if (*nextchar != '\0')
{
optarg = nextchar;
/* If we end this ARGV-element by taking the rest as an arg,
we must advance to the next element now. */
optind++;
}
else if (optind == argc)
{
if (opterr)
{
/* 1003.2 specifies the format of this message. */
fprintf (stderr, _("%s: option requires an argument -- %c\n"),
argv[0], c);
}
optopt = c;
if (optstring[0] == ':')
c = ':';
else
c = '?';
return c;
}
else
/* We already incremented `optind' once;
increment it again when taking next ARGV-elt as argument. */
optarg = argv[optind++];
/* optarg is now the argument, see if it's in the
table of longopts. */
for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++)
/* Do nothing. */ ;
/* Test all long options for either exact match
or abbreviated matches. */
for (p = longopts, option_index = 0; p->name; p++, option_index++)
if (!strncmp (p->name, nextchar, nameend - nextchar))
{
if ((unsigned int) (nameend - nextchar) == strlen (p->name))
{
/* Exact match found. */
pfound = p;
indfound = option_index;
exact = 1;
break;
}
else if (pfound == NULL)
{
/* First nonexact match found. */
pfound = p;
indfound = option_index;
}
else
/* Second or later nonexact match found. */
ambig = 1;
}
if (ambig && !exact)
{
if (opterr)
fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"),
argv[0], argv[optind]);
nextchar += strlen (nextchar);
optind++;
return '?';
}
if (pfound != NULL)
{
option_index = indfound;
if (*nameend)
{
/* Don't test has_arg with >, because some C compilers don't
allow it to be used on enums. */
if (pfound->has_arg)
optarg = nameend + 1;
else
{
if (opterr)
fprintf (stderr, _("\
%s: option `-W %s' doesn't allow an argument\n"),
argv[0], pfound->name);
nextchar += strlen (nextchar);
return '?';
}
}
else if (pfound->has_arg == 1)
{
if (optind < argc)
optarg = argv[optind++];
else
{
if (opterr)
fprintf (stderr,
_("%s: option `%s' requires an argument\n"),
argv[0], argv[optind - 1]);
nextchar += strlen (nextchar);
return optstring[0] == ':' ? ':' : '?';
}
}
nextchar += strlen (nextchar);
if (longind != NULL)
*longind = option_index;
if (pfound->flag)
{
*(pfound->flag) = pfound->val;
return 0;
}
return pfound->val;
}
nextchar = NULL;
return 'W'; /* Let the application handle it. */
}
if (temp[1] == ':')
{
if (temp[2] == ':')
{
/* This is an option that accepts an argument optionally. */
if (*nextchar != '\0')
{
optarg = nextchar;
optind++;
}
else
optarg = NULL;
nextchar = NULL;
}
else
{
/* This is an option that requires an argument. */
if (*nextchar != '\0')
{
optarg = nextchar;
/* If we end this ARGV-element by taking the rest as an arg,
we must advance to the next element now. */
optind++;
}
else if (optind == argc)
{
if (opterr)
{
/* 1003.2 specifies the format of this message. */
fprintf (stderr,
_("%s: option requires an argument -- %c\n"),
argv[0], c);
}
optopt = c;
if (optstring[0] == ':')
c = ':';
else
c = '?';
}
else
/* We already incremented `optind' once;
increment it again when taking next ARGV-elt as argument. */
optarg = argv[optind++];
nextchar = NULL;
}
}
return c;
}
}
int
getopt (int argc, char *const *argv, const char *optstring)
{
return _getopt_internal (argc, argv, optstring,
(const struct option *) 0,
(int *) 0,
0);
}
#endif /* Not ELIDE_CODE. */
#ifdef TEST
/* Compile with -DTEST to make an executable for use in testing
the above definition of `getopt'. */
int
main (argc, argv)
int argc;
char **argv;
{
int c;
int digit_optind = 0;
while (1)
{
int this_option_optind = optind ? optind : 1;
c = getopt (argc, argv, "abc:d:0123456789");
if (c == -1)
break;
switch (c)
{
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
if (digit_optind != 0 && digit_optind != this_option_optind)
printf ("digits occur in two different argv-elements.\n");
digit_optind = this_option_optind;
printf ("option %c\n", c);
break;
case 'a':
printf ("option a\n");
break;
case 'b':
printf ("option b\n");
break;
case 'c':
printf ("option c with value `%s'\n", optarg);
break;
case '?':
break;
default:
printf ("?? getopt returned character code 0%o ??\n", c);
}
}
if (optind < argc)
{
printf ("non-option ARGV-elements: ");
while (optind < argc)
printf ("%s ", argv[optind++]);
printf ("\n");
}
exit (0);
}
#endif /* TEST */
|
Added getopt.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
/* Declarations for getopt.
Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@gnu.org.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA. */
#ifndef _GETOPT_H
#define _GETOPT_H 1
#ifdef __cplusplus
extern "C" {
#endif
/* For communication from `getopt' to the caller.
When `getopt' finds an option that takes an argument,
the argument value is returned here.
Also, when `ordering' is RETURN_IN_ORDER,
each non-option ARGV-element is returned here. */
extern char *optarg;
/* Index in ARGV of the next element to be scanned.
This is used for communication to and from the caller
and for communication between successive calls to `getopt'.
On entry to `getopt', zero means this is the first call; initialize.
When `getopt' returns -1, this is the index of the first of the
non-option elements that the caller should itself scan.
Otherwise, `optind' communicates from one call to the next
how much of ARGV has been scanned so far. */
extern int optind;
/* Callers store zero here to inhibit the error message `getopt' prints
for unrecognized options. */
extern int opterr;
/* Set to an option character which was unrecognized. */
extern int optopt;
/* Describe the long-named options requested by the application.
The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
of `struct option' terminated by an element containing a name which is
zero.
The field `has_arg' is:
no_argument (or 0) if the option does not take an argument,
required_argument (or 1) if the option requires an argument,
optional_argument (or 2) if the option takes an optional argument.
If the field `flag' is not NULL, it points to a variable that is set
to the value given in the field `val' when the option is found, but
left unchanged if the option is not found.
To have a long-named option do something other than set an `int' to
a compiled-in constant, such as set a value from `optarg', set the
option's `flag' field to zero and its `val' field to a nonzero
value (the equivalent single-letter option character, if there is
one). For long options that have a zero `flag' field, `getopt'
returns the contents of the `val' field. */
struct option
{
#if defined (__STDC__) && __STDC__
const char *name;
#else
char *name;
#endif
/* has_arg can't be an enum because some compilers complain about
type mismatches in all the code that assumes it is an int. */
int has_arg;
int *flag;
int val;
};
/* Names for the values of the `has_arg' field of `struct option'. */
#define no_argument 0
#define required_argument 1
#define optional_argument 2
#if defined (__STDC__) && __STDC__
#ifdef __GNU_LIBRARY__
/* Many other libraries have conflicting prototypes for getopt, with
differences in the consts, in stdlib.h. To avoid compilation
errors, only prototype getopt for the GNU C library. */
extern int getopt (int argc, char *const *argv, const char *shortopts);
#else /* not __GNU_LIBRARY__ */
extern int getopt ();
#endif /* __GNU_LIBRARY__ */
extern int getopt_long (int argc, char *const *argv, const char *shortopts,
const struct option *longopts, int *longind);
extern int getopt_long_only (int argc, char *const *argv,
const char *shortopts,
const struct option *longopts, int *longind);
/* Internal only. Users should not call this directly. */
extern int _getopt_internal (int argc, char *const *argv,
const char *shortopts,
const struct option *longopts, int *longind,
int long_only);
#else /* not __STDC__ */
extern int getopt ();
extern int getopt_long ();
extern int getopt_long_only ();
extern int _getopt_internal ();
#endif /* __STDC__ */
#ifdef __cplusplus
}
#endif
#endif /* getopt.h */
|
Added getpass.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#include "dact.h"
#ifndef HAVE_GETPASS
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#include "getpass.h"
char *getpass(const char *prompt) {
static char buf[127];
FILE *fp=NULL;
fprintf(stderr, "%s", prompt);
fp=fopen("/dev/tty", "w");
if (fp==NULL) fp=stdin;
fgets(buf, sizeof(buf), fp);
while (buf[strlen(buf)-1]<' ') buf[strlen(buf)-1]='\0';
if (fp!=stdin) fclose(fp);
return(buf);
}
#endif
|
Added getpass.h.
|
|
>
>
>
>
>
>
|
1
2
3
4
5
6
|
#ifndef _LOCAL_GETPASS_H
#define _LOCAL_GETPASS_H
char *getpass(const char *prompt);
#endif
|
Added header.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#include "dact.h"
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#include <stdio.h>
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include "header.h"
char *dact_hdr_ext_val=NULL;
uint32_t dact_hdr_ext_sze=0;
uint32_t dact_hdr_ext_pos=0;
int dact_hdr_ext_alloc(uint32_t size) {
if (dact_hdr_ext_val==NULL) {
if (!(dact_hdr_ext_val=malloc(DACT_HEADER_BLKSIZE))) {
dact_hdr_ext_val=NULL;
return(0);
}
dact_hdr_ext_sze=DACT_HEADER_BLKSIZE;
}
if ((dact_hdr_ext_pos+size)>(dact_hdr_ext_sze)) {
dact_hdr_ext_sze=(((dact_hdr_ext_pos+size-1)/DACT_HEADER_BLKSIZE)+1)*DACT_HEADER_BLKSIZE;
dact_hdr_ext_val=realloc(dact_hdr_ext_val,dact_hdr_ext_sze);
}
return(1);
}
int dact_hdr_ext_regs(const int id, const char *val, const uint32_t size) {
if (!dact_hdr_ext_alloc(size+3)) return(0);
dact_hdr_ext_val[dact_hdr_ext_pos]=(id&0xff);
dact_hdr_ext_val[dact_hdr_ext_pos+1]=((size>>8)&0xff);
dact_hdr_ext_val[dact_hdr_ext_pos+2]=(size&0xff);
memcpy(dact_hdr_ext_val+dact_hdr_ext_pos+3,val,size);
dact_hdr_ext_pos+=(size+3);
return(1);
}
int dact_hdr_ext_regn(const int id, const uint32_t val, const uint32_t size) {
int i;
if (!dact_hdr_ext_alloc(size+3)) return(0);
dact_hdr_ext_val[dact_hdr_ext_pos]=(id&0xff);
dact_hdr_ext_val[dact_hdr_ext_pos+1]=((size>>8)&0xff);
dact_hdr_ext_val[dact_hdr_ext_pos+2]=(size&0xff);
for (i=0;i<size;i++) {
dact_hdr_ext_val[dact_hdr_ext_pos+3+i]=((val>>((size-i-1)*8)) &0xff);
}
dact_hdr_ext_pos+=(size+3);
return(1);
}
uint32_t dact_hdr_ext_size(void) {
return(dact_hdr_ext_pos);
}
char *dact_hdr_ext_data(void) {
memset(dact_hdr_ext_val+dact_hdr_ext_pos, DACT_HDR_NOP, dact_hdr_ext_sze-dact_hdr_ext_pos);
return(dact_hdr_ext_val);
}
void dact_hdr_ext_clear(void) {
if (dact_hdr_ext_val!=NULL) free(dact_hdr_ext_val);
dact_hdr_ext_pos=0;
dact_hdr_ext_sze=0;
dact_hdr_ext_val=NULL;
return;
}
|
Added header.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#ifndef _HEADER_H
#define _HEADER_H
#include "dact.h"
#ifndef DACT_HEADER_BLKSIZE
#define DACT_HEADER_BLKSIZE 1024
#endif
int dact_hdr_ext_regs(const int id, const char *val, const uint32_t size);
int dact_hdr_ext_regn(const int id, const uint32_t val, const uint32_t size);
uint32_t dact_hdr_ext_size(void);
char *dact_hdr_ext_data(void);
int dact_hdr_ext_alloc(uint32_t size);
void dact_hdr_ext_clear(void);
#endif
|
Added install-sh.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
|
#!/bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5 (mit/util/scripts/install.sh).
#
# Copyright 1991 by the Massachusetts Institute of Technology
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission. M.I.T. makes no representations about the
# suitability of this software for any purpose. It is provided "as is"
# without express or implied warranty.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
else
true
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d $dst ]; then
instcmd=:
chmodcmd=""
else
instcmd=mkdir
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f $src -o -d $src ]
then
true
else
echo "install: $src does not exist"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
else
true
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
else
true
fi
fi
## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
IFS="${IFS-${defaultIFS}}"
oIFS="${IFS}"
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}"
pathcomp=''
while [ $# -ne 0 ] ; do
pathcomp="${pathcomp}${1}"
shift
if [ ! -d "${pathcomp}" ] ;
then
$mkdirprog "${pathcomp}"
else
true
fi
pathcomp="${pathcomp}/"
done
fi
if [ x"$dir_arg" != x ]
then
$doit $instcmd $dst &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
else
# If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ]
then
dstfile=`basename $dst`
else
dstfile=`basename $dst $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
if [ x"$dstfile" = x ]
then
dstfile=`basename $dst`
else
true
fi
# Make a temp file name in the proper directory.
dsttmp=$dstdir/#inst.$$#
# Move or copy the file name to the temp name
$doit $instcmd $src $dsttmp &&
trap "rm -f ${dsttmp}" 0 &&
# and set any options; do chmod last to preserve setuid bits
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
# Now rename the file to the real destination.
$doit $rmcmd -f $dstdir/$dstfile &&
$doit $mvcmd $dsttmp $dstdir/$dstfile
fi &&
exit 0
|
Added libdact.c.
|
|
>
>
>
>
>
>
|
1
2
3
4
5
6
|
#include "dact.h"
#include "dact_common.h"
int dact_BuffToBuffCompress(void) {
return(0);
}
|
Added math.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#ifndef _LOCAL_MATH_H
#define _LOCAL_MATH_H
#include <math.h>
#ifndef M_LN2l
#define M_LN2l 0.6931471805599453094172321214581766L /* log_e 2 */
#endif
#define BYTESIZE(x) ((int) ((float) (((log(x+1)/M_LN2l) + 7.99999999) / 8.0000)))
#endif
|
Added mkstemp.c.
|
|
>
>
>
|
1
2
3
|
int mkstemp(char *template) {
return(-1);
}
|
Added mkstemp.h.
|
|
>
>
>
>
>
>
|
1
2
3
4
5
6
|
#ifndef _LOCAL_MKSTEMP_H
#define _LOCAL_MKSTEMP_H
int mkstemp(char *template);
#endif
|
Added module.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#include "dact.h"
#include "module.h"
#ifdef HAVE_DLOPEN
#ifdef HAVE_DLFCN_H
#include <dlfcn.h>
#endif
#include <stdio.h>
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <fcntl.h>
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#ifdef HAVE_DIRENT_H
#include <dirent.h>
#endif
#include "algorithms.h"
#include "ciphers.h"
#include "parse.h"
#include "net.h"
#include "ui.h"
char moduledirectory[2048] = "@@HOME@@/.dact/@@OSNM@@-@@ARCH@@/";
void *modules[256];
int modules_initialized = 0;
int modules_count = 0;
int init_modules (void) {
int i;
if (modules_initialized!=0) return(DACT_MOD_FAIL);
modules_initialized=1;
for (i=0;i<256;i++) {
modules[i]=NULL;
}
return(DACT_MOD_OK);
}
int unload_modules (void) {
int i;
if (modules_initialized==0) return(DACT_MOD_FAIL);
for (i=0;i<256;i++) {
if (modules[i]!=NULL)
dlclose(modules[i]);
}
return(DACT_MOD_OK);
}
int load_modules_all(const char *options) {
#ifdef HAVE_DIRENT_H
struct dirent *dinfo;
char *mdircpy, *tmpbuf, *mbuf, *fname, fullfname[1024];
DIR *dirtype;
mdircpy=parse_url_subst(moduledirectory, "");
mbuf=mdircpy;
while ((tmpbuf=strsep(&mbuf, ":"))) {
if ((dirtype=opendir(tmpbuf))==NULL) continue;
while ((dinfo=readdir(dirtype))!=NULL) {
fname=dinfo->d_name;
if (strcmp(fname+strlen(fname)-3,".so")==0) {
strncpy(fullfname, tmpbuf, sizeof(fullfname));
strncat(fullfname, "/", sizeof(fullfname)-strlen(fullfname));
strncat(fullfname, fname, sizeof(fullfname)-strlen(fullfname));
load_module(fullfname, options);
}
}
closedir(dirtype);
}
free(mdircpy);
#else
PRINTERR("I don't know how to handle this.")
#endif
return(DACT_MOD_OK);
}
int load_module (char *modulename, const char *options) {
char modulefile[256], *tmpbuf, *mbuf, *mdircpy;
void *mh=NULL;
uint32_t algo_num, module_type=DACT_MOD_TYPE_COMP;
uint32_t dc_ver=0, dc_req=0, dact_ver;
char *dc_url_get=NULL, *dc_url_ver=NULL, *dc_sign=NULL;
if (strchr(modulename,'/')==NULL) {
mdircpy=parse_url_subst(moduledirectory, "");
mbuf=mdircpy;
while ((tmpbuf=strsep(&mbuf, ":"))) {
snprintf(modulefile, sizeof(modulefile)-1, "%s/%s.so",tmpbuf,modulename);
if ((mh=dlopen(modulefile, RTLD_GLOBAL|RTLD_LAZY))!=NULL) break;
}
free(mdircpy);
} else {
strncpy(modulefile, modulename, sizeof(modulefile)-1);
if ((mh=dlopen(modulefile, RTLD_GLOBAL|RTLD_LAZY))==NULL) {
PRINTERR("Could not load module.");
return(DACT_MOD_FAIL);
}
}
if (!mh) return(DACT_MOD_FAIL);
if (dlsym(mh,"DC_NUM")==NULL \
|| dlsym(mh, "DC_NAME")==NULL \
|| dlsym(mh, "DC_ALGO")==NULL) {
dact_ui_status(DACT_UI_LVL_SPEC, modulefile);
dact_ui_status_append(DACT_UI_LVL_SPEC, " is not a dact module.");
dlclose(mh);
return(DACT_MOD_FAIL);
}
if (dlsym(mh, "DC_TYPE")!=NULL) {
memcpy(&module_type,dlsym(mh,"DC_TYPE"),sizeof(module_type));
}
memcpy(&algo_num,dlsym(mh,"DC_NUM"),sizeof(algo_num));
if (dlsym(mh, "DC_VER")!=NULL) memcpy(&dc_ver, dlsym(mh, "DC_VER"), sizeof(dc_ver));
if (dlsym(mh, "DC_REQUIRE")!=NULL) memcpy(&dc_req, dlsym(mh, "DC_REQUIRE"), sizeof(dc_req));
if (dlsym(mh, "DC_URL_GET")!=NULL) memcpy(&dc_url_get, dlsym(mh, "DC_URL_GET"), sizeof(dc_url_get));
if (dlsym(mh, "DC_URL_VER")!=NULL) memcpy(&dc_url_ver, dlsym(mh, "DC_URL_VER"), sizeof(dc_url_ver));
if (dlsym(mh, "DC_SIGN")!=NULL) memcpy(&dc_sign, dlsym(mh, "DC_SIGN"), sizeof(dc_sign));
if (dc_url_get!=NULL && dc_url_ver!=NULL && dc_ver!=0 && modulename[0]!='/') {
dact_upgrade_file(modulename, dc_url_get, dc_url_ver, dc_ver, NULL, options);
}
if (dc_req!=0) {
dact_ver=(DACT_VER_MAJOR<<16)|(DACT_VER_MINOR<<8)|(DACT_VER_REVISION);
switch (dc_req&0xff000000) {
case DACT_MOD_REQ_ATLEAST:
if (dact_ver<(dc_req&0xffffff)) {
fprintf(stderr, "%s requires atleast DACT %i.%i.%i, this is DACT %i.%i.%i\n",modulefile,DACT_VER_PARTS(dc_req), DACT_VER_MAJOR, DACT_VER_MINOR, DACT_VER_REVISION);
dlclose(mh);
return(DACT_MOD_FAIL);
}
break;
case DACT_MOD_REQ_EXACTLY:
if ((dc_req&0xffffff)!=dact_ver) {
fprintf(stderr, "%s requires DACT %i.%i.%i, this is DACT %i.%i.%i\n",modulefile, DACT_VER_PARTS(dc_req), DACT_VER_MAJOR, DACT_VER_MINOR, DACT_VER_REVISION);
dlclose(mh);
return(DACT_MOD_FAIL);
}
break;
case DACT_MOD_REQ_ATMOST:
if (dact_ver>(dc_req&0xffffff)) {
fprintf(stderr, "%s requires atmost DACT %i.%i.%i, this is DACT %i.%i.%i\n",modulefile,DACT_VER_PARTS(dc_req), DACT_VER_MAJOR, DACT_VER_MINOR, DACT_VER_REVISION);
dlclose(mh);
return(DACT_MOD_FAIL);
}
break;
}
}
if (modules_count>255) {
modules[modules_count++]=mh;
}
switch (module_type) {
case DACT_MOD_TYPE_COMP:
if (algo_num>=((sizeof(algorithms))/(sizeof(*algorithms)))) return(DACT_MOD_FAIL);
if (algorithms[algo_num]!=DACT_FAILED_ALGO && algorithms[algo_num]!=NULL) {
dlclose(mh);
return(DACT_MOD_FAIL);
}
memcpy(&algorithms[algo_num],dlsym(mh, "DC_ALGO"),sizeof(algorithms[0]));
memcpy(&algorithm_names[algo_num],dlsym(mh,"DC_NAME"),sizeof(algorithm_names[0]));
return(DACT_MOD_OK);
case DACT_MOD_TYPE_ENC:
if (algo_num>=CIPHER_COUNT) {
printf("Encryption algorithm number too high, ignoring %i\n", algo_num);
return(DACT_MOD_FAIL);
}
if (ciphers[algo_num]!=DACT_FAILED_ALGO && ciphers[algo_num]!=NULL) {
return(DACT_MOD_FAIL);
}
memcpy(&ciphers[algo_num],dlsym(mh, "DC_ALGO"),sizeof(algorithms[0]));
memcpy(&ciphers_name[algo_num],dlsym(mh, "DC_NAME"),sizeof(ciphers_name[0]));
return(DACT_MOD_OK);
}
return(DACT_MOD_FAIL);
}
#else
char moduledirectory[2048] = ".";
void *modules[256];
int modules_initialized = 0;
int modules_count = 0;
int init_modules(void) { return(DACT_MOD_FAIL); }
int unload_modules(void) { return(DACT_MOD_FAIL); }
int load_module(char *modulename, const char *options) { return(DACT_MOD_FAIL); }
int load_modules_all(const char *options) { return(DACT_MOD_FAIL); }
#endif
|
Added module.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#ifndef _MODULE_H
#define _MODULE_H
#include "dact.h"
int init_modules (void);
int unload_modules (void);
int load_module (char *modulename, const char *options);
int load_modules_all(const char *options);
#define DACT_MOD_OK 0
#define DACT_MOD_FAIL (-1)
#define DACT_MOD_TYPE_COMP 0
#define DACT_MOD_TYPE_ENC 1
#define DACT_MOD_REQ_ATLEAST (0x01000000)
#define DACT_MOD_REQ_EXACTLY (0x02000000)
#define DACT_MOD_REQ_ATMOST (0x03000000)
extern char moduledirectory[2048];
extern void *modules[256];
extern int modules_initialized;
extern int modules_count;
#endif/*_MODULE_H*/
|
Added net.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
/*
* Network related functions
*/
#include "dact.h"
#include "net.h"
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#include <stdarg.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <fcntl.h>
#ifndef NO_NETWORK
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdlib.h>
#include <string.h>
#include <netdb.h>
#include <errno.h>
#include <stdio.h>
#include "parse.h"
#include "crc.h"
//extern int errno;
struct dact_url_info {
char *url;
int flags;
mode_t mode;
};
struct dact_url_info dact_urls[256];
/*
* Create a listening port on tcp port PORT
*/
int createlisten(int port)
{
struct sockaddr_in localname;
int sockFd;
sockFd=socket(AF_INET,SOCK_STREAM,IPPROTO_IP);
localname.sin_family=AF_INET;
localname.sin_port=htons(port);
localname.sin_addr.s_addr=INADDR_ANY;
if (bind(sockFd,(struct sockaddr *) & localname,sizeof(localname))==-1) { perror("bind");return(-1); }
if (listen(sockFd,1024)==-1) { perror("listen"); return(-1); }
return(sockFd);
}
/*
* Close that socket, yeah.
*/
void closeconnection(int sockfd) {
shutdown(sockfd, 1);
close(sockfd);
}
int createconnection_tcp(char *host, int port) {
int sockid;
struct hostent *hostinfo;
struct sockaddr_in sock;
if (dact_nonetwork) return(-EPERM);
if ((hostinfo=gethostbyname(host))==NULL) {
#ifdef HAVE_INET_ATON
if (!inet_aton(host,&sock.sin_addr))
#else
if ( (sock.sin_addr.s_addr=inet_addr(host) )==-1)
#endif
return(-1);
} else {
/* Should we assign here? */
memcpy(&sock.sin_addr.s_addr,hostinfo->h_addr_list[0],hostinfo->h_length);
}
sock.sin_family=AF_INET;
sock.sin_port=htons(port);
if ((sockid=socket(AF_INET, SOCK_STREAM, 0))<0)
return(-1);
if (connect(sockid, (struct sockaddr *) &sock, sizeof(sock))<0) {
close(sockid);
return(-1);
}
return(sockid);
}
int open_net(const char *pathname, int flags, mode_t mode) {
char scheme[5], host[512], file[1024];
char username[128], password[128];
char *read_buf, *read_buf_s=NULL;
char *smallbuf, *tmpbuf;
int port, fd, x, ftpfd=-1, retrmode=0;
if (!parse_url(pathname,scheme,username,password,host,&port,file)) {
if ((fd=createconnection_tcp(host,port))<0) return(-1);
switch (ELFCRC(0, scheme, strlen(scheme))) {
case 457648: /* http */
if ((flags&O_WRONLY)==O_WRONLY || (flags&O_RDWR)==O_RDWR) {
close(fd);
return(-1);
}
read_buf_s=read_buf=malloc(50);
write(fd, "GET ", 4);
write(fd, file, strlen(file));
write(fd, " HTTP/1.0\nHost: ",16);
write(fd, host, strlen(host));
write(fd, "\n", 1);
if (strcmp(username, "")) {
smallbuf=malloc(strlen(password)+strlen(username)+3);
smallbuf[0]=0;
strcat(smallbuf,username);
strcat(smallbuf,":");
strcat(smallbuf,password);
tmpbuf=mime64(smallbuf);
write(fd, "Authorization: Basic ", 21);
write(fd, tmpbuf, strlen(tmpbuf));
free(tmpbuf);
free(smallbuf);
write(fd, "\n", 1);
}
write(fd, "\n", 1);
x=read(fd, read_buf, 50);
strsep(&read_buf," ");
if (strncmp("200 ",read_buf,4) && strncmp("302 ",read_buf,4)) {
free(read_buf_s);
close(fd);
// errno=ENOENT;
return(-ENOENT);
}
retrmode=read_buf[0];
read_buf=read_buf_s;
read_buf[4]=0;
while (1) {
read(fd, read_buf, 1);
if (read_buf[0]==read_buf[2]&&read_buf[0]=='\n') break;
if (!strncmp(":noi", read_buf, 4) && retrmode=='3') {
tmpbuf=smallbuf=malloc(512);
read(fd, read_buf, 1);
read(fd, smallbuf, 510);
close(fd);
return(open_net(strsep(&smallbuf,"\r\n"),flags,mode));
free(tmpbuf);
}
read_buf[3]=read_buf[2];
read_buf[2]=read_buf[1];
read_buf[1]=read_buf[0];
}
free(read_buf_s);
if (dact_urls[fd].url!=NULL) free(dact_urls[fd].url);
dact_urls[fd].url=strdup(pathname);
dact_urls[fd].flags=flags;
dact_urls[fd].mode=mode;
return(fd);
break;
case 28080: /* ftp */
if ((flags&O_RDWR)==O_RDWR) {
close(fd);
return(-1);
}
read_buf_s=read_buf=malloc(1024);
read_buf[0]=0;
while (1) {
if ((x=read(fd, read_buf, 1024))<1024) {
if (x<0) {
free(read_buf_s);
// errno=EIO;
return(-EIO);
}
/* It's waiting for input... */
}
read_buf[x]=0;
while ((smallbuf=strsep(&read_buf,"\n"))!=NULL) {
switch (ELFCRC(0, smallbuf, 4)) {
case 231456: /* 550 */
if (ftpfd!=-1) close(ftpfd);
close(fd);
free(read_buf_s);
// errno=ENOENT;
return(-ENOENT);
break;
case 230944: /* 530 */
if (ftpfd!=-1) close(ftpfd);
close(fd);
free(read_buf_s);
// errno=EIO;
return(-EIO);
break;
case 231504: /* 553 */
if (ftpfd!=-1) close(ftpfd);
close(fd);
free(read_buf_s);
// errno=EPERM;
return(-EPERM);
break;
case 218400: /* 220 */
write(fd, "USER ", 5);
if (strcmp(username,"")) {
write(fd, username, strlen(username));
} else {
write(fd, "anonymous", 9);
}
write(fd, "\n", 1);
break;
case 222768: /* 331 */
write(fd, "PASS ", 5);
if (strcmp(password,"")) {
write(fd, password, strlen(password));
} else {
write(fd, "user@host.com", 13);
}
write(fd, "\n", 1);
break;
case 218512: /* 227 */
strsep(&smallbuf,"(");
host[0]=0;
for (x=0;x<4;x++) {
strncat(host,strsep(&smallbuf,","),5);
strcat(host,".");
}
host[strlen(host)-1]=0;
port=(atoi(strsep(&smallbuf,","))<<8)+atoi(strsep(&smallbuf,")\n\r "));
write(fd, "TYPE I\n", 7);
break;
case 217888:
if ((flags&O_RDONLY)==O_RDONLY) write(fd,"RETR ",5);
if ((flags&O_WRONLY)==O_WRONLY) write(fd,"STOR ",5);
write(fd, file, strlen(file));
write(fd, "\n", 1);
if ((ftpfd=createconnection_tcp(host,port))<0) {
close(fd);
// errno=ENOENT;
return(-ENOENT);
}
break;
case 215072: /* 150 */
if (dact_urls[ftpfd].url!=NULL) free(dact_urls[ftpfd].url);
dact_urls[ftpfd].url=strdup(pathname);
dact_urls[ftpfd].flags=flags;
dact_urls[ftpfd].mode=mode;
return(ftpfd);
break;
case 218656: /* 230 */
write(fd, "PASV\n", 5);
break;
default:
#ifdef DEBUG_FTP
PRINT_LINE; fprintf(stderr, "dact: Unknown cmd %i (%s)\n",ELFCRC(0,smallbuf,4),smallbuf);
#endif
break;
}
}
read_buf=read_buf_s;
}
break;
}
free(read_buf_s);
close(fd);
} else {
fd=open(pathname,flags,mode);
if (dact_urls[fd].url!=NULL) free(dact_urls[fd].url);
dact_urls[fd].url=strdup(pathname);
dact_urls[fd].flags=flags;
dact_urls[fd].mode=mode;
return(fd);
}
return(-1);
}
off_t lseek_net(int filedes, off_t offset, int whence) {
struct stat file_status;
int newfd;
fstat(filedes, &file_status);
if (S_ISSOCK(file_status.st_mode)) {
if (whence==SEEK_END) return(-1);
if (offset!=0 || whence!=SEEK_SET) return(-1); /* For now ... */
if (dact_urls[filedes].url==NULL) return(-1);
if ((newfd=open_net(dact_urls[filedes].url,dact_urls[filedes].flags,dact_urls[filedes].mode))<0) return(-1);
close(filedes);
dup2(newfd,filedes);
return(0);
}
return(lseek(filedes,offset,whence));
}
#else
int createlisten(int port) { return(-1); }
void closeconnection(int sockfd) { return; }
int createconnection_tcp(char *host, int port) { return(-1); }
int open_net(const char *pathname, int flags, mode_t mode) {
return(open(pathname,flags,mode));
}
off_t lseek_net(int filedes, off_t offset, int whence) {
return(lseek(filedes,offset,whence));
}
#endif
|
Added net.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#ifndef _DACT_NET_H
#define _DACT_NET_H
#include "dact.h"
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
int createlisten(int port);
void closeconnection(int sockfd);
int createconnection_tcp(char *host, int port);
int open_net(const char *pathname, int flags, mode_t mode);
off_t lseek_net(int filedes, off_t offset, int whence);
#endif
|
Added parse.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
/*
Help, my atoi() is broken.
*/
#include "dact.h"
#ifdef HAVE_SYS_UTSNAME_H
#include <sys/utsname.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <dirent.h>
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#include <stdio.h>
#include <ctype.h>
#include <math.h>
#include "buffer.h"
#include "parse.h"
#include "crc.h"
#include "ui.h"
uint32_t atoi2(const char *n) {
uint32_t retval=0;
int i,m;
if (n==NULL) return(0);
m=strcspn(n,".");
for (i=0;i<m;i++) retval+=(n[i]-48)*pow(10,m-i-1);
return(retval);
}
/* Parse those stupid netscape-style URLs, icky.
* And I know this REALLY crummy looking, but it works
* (albeit, probably not perfectly) suffciently well.
* -- Roy Keene <rkeene@Rkeene.org>
* `scheme' will never exceed 5 bytes
* `username' will never exceed 128 bytes
* `password' will never exceed 128 bytes
* `host' will never exceed 512 bytes
* `file' will never exceed 1024 bytes
*/
int parse_url(const char *url, char *scheme, char *username, char *password, char *host, int *port, unsigned char *file) {
char *local_url=NULL, *local_url_s, *fbuf;
int i;
if (strstr(url,"://")==NULL) { /* Make sure we have an URL */
strncpy(file,url,1023);
return(1);
};
local_url_s=local_url=strdup(url);
*port=0;
file[1]=0;
strncpy(scheme,strsep(&local_url,":"),5);
local_url+=2;
strncpy(host,strsep(&local_url,"/"),512);
if (local_url!=NULL) strncpy(file+1,local_url,1022);
file[0]='/';
fbuf=malloc(1024);
file[0]='/';
fbuf[0]='\0';
for (i=0;i<strlen(file);i++) {
if ((strlen(fbuf)+4)>=1023) break;
if (file[i]<33 || file[i]>127) {
if (file[i]==32) { strcat(fbuf, "+"); } else { sprintf(fbuf, "%s%%%02x", fbuf, file[i]); }
} else {
sprintf(fbuf, "%s%c", fbuf, file[i]);
}
}
strncpy(file, fbuf, 1023);
file[1023]=0;
free(fbuf);
password[0]=0;
if (strchr(host,'@')!=NULL) {
local_url=local_url_s; /* Doh! This was missing. */
strcpy(local_url,host);
strncpy(username,strsep(&local_url,"@:"),128);
if (strchr(local_url,'@')!=NULL)
strncpy(password,strsep(&local_url,"@"),128);
strcpy(host,local_url);
} else {
strcpy(username,"");
}
if (strchr(host,':')!=NULL) {
local_url=local_url_s;
strcpy(local_url,host);
strcpy(host,strsep(&local_url,":"));
*port=atoi(local_url);
} else {
if (!strcasecmp(scheme,"http")) *port=80;
if (!strcasecmp(scheme,"ftp")) *port=21;
}
free(local_url_s);
strtolower(scheme);
return(0);
}
/*
Replace
@@HOME@@ Home directory (getenv("HOME"))
@@OSNM@@ OS Name (linux, freebsd, sunos, etc)
@@OSVR@@ OS version (2.2.x, 4.2, 5.8, etc)
@@OSVS@@ OS version (short) (2.2, 4.2, 5.8, etc)
@@ARCH@@ Arch (i386, sparc64, sun4u, sun4m, etc)
@@DIST@@ If OSNM=Linux, distribution of Linux.
@@FILE@@ Name of compressed file.
@@DTVR@@ Version of DACT (maj.min.rev)
@@DTVS@@ Version of DACT (short) (maj.min)
@@DTID@@ DACT identifier (dact-maj.min.rev-(dev|rel)-(no)modules-(no)debian-(no)network-(no)vercheck)
@@PASS@@ Prompt for Password
@@USER@@ Prompt for Username
@@ATSN@@ Put an `@'
*/
char *parse_url_subst(const char *src, const char *fname) {
#ifdef HAVE_SYS_UTSNAME_H
static struct utsname system_info;
#else
static struct {
char *sysname;
char *machine;
char *release;
} system_info;
#endif
static int sysinfo_init=0;
uint32_t cmd=0, x, strsz;
const char *loc=src, *ploc=loc;
char *ret, *ret_s, found=0, *smbuf;
if (!strstr((char *) src,"@@")) return(strdup(src));
ret_s=ret=calloc(1024,1);
if (!sysinfo_init) {
#ifdef HAVE_SYS_UTSNAME_H
uname(&system_info);
strtolower(system_info.sysname);
strtolower(system_info.machine);
#else
system_info.sysname="(unknown)";
system_info.machine="(unknown)";
system_info.release="0.0";
#endif
sysinfo_init=1;
}
while (strstr(loc,"@@")) {
cmd=ELFCRC(0, loc=strstr(loc, "@@")+2, 4);
loc+=6;
strsz=(loc-ploc-8);
memcpy(ret, ploc, strsz);
ret+=strsz;
if ((ret-ret_s)>(1024-128)) break;
switch (cmd) {
case 288376: /* ARCH-done */
x=strlen(system_info.machine);
if (x>127) break;
memcpy(ret,system_info.machine,x);
ret+=x;
break;
case 346157: /* OSNM-done */
x=strlen(system_info.sysname);
if (x>127) break;
memcpy(ret,system_info.sysname,x);
ret+=x;
break;
case 346290: /* OSVR-done */
if (strlen(system_info.release)>127) break;
for (x=0;x<strlen(system_info.release);x++) {
if (isdigit((int) system_info.release[x]) || system_info.release[x]=='.') {
ret[0]=system_info.release[x];
ret++;
} else {
break;
}
}
break;
case 346291: /* OSVS-done */
if (strlen(system_info.release)>127) break;
for (x=0;x<strlen(system_info.release);x++) {
if (system_info.release[x]=='.' && found) break;
if (system_info.release[x]=='.') found=1;
if (isdigit((int) system_info.release[x]) || found) {
ret[0]=system_info.release[x];
ret++;
}
}
break;
case 306693: /* FILE-done */
x=strlen(fname);
if (x>127) break;
memcpy(ret,fname,x);
ret+=x;
break;
case 298628: /* DIST-done */
if (!strcmp("linux",system_info.sysname)) {
smbuf=parse_url_subst_dist();
if (smbuf==NULL) break;
x=strlen(smbuf);
if (x>127) break;
memcpy(ret, smbuf, x);
ret+=x;
}
break;
case 301490: /* DTVR-done */
smbuf=malloc(128);
sprintf(smbuf, "%i.%i.%i", DACT_VER_MAJOR, DACT_VER_MINOR, DACT_VER_REVISION);
x=strlen(smbuf);
memcpy(ret, smbuf, x);
ret+=x;
free(smbuf);
break;
case 301491: /* DTVS-done */
smbuf=malloc(128);
sprintf(smbuf, "%i.%i", DACT_VER_MAJOR, DACT_VER_MINOR);
x=strlen(smbuf);
memcpy(ret, smbuf, x);
ret+=x;
free(smbuf);
break;
case 345731: /* PASS-done */
smbuf=dact_ui_getuserinput("Enter password: ", 128, 1);
x=strlen(smbuf);
if (x>127) break;
memcpy(ret, smbuf, x);
ret+=x;
free(smbuf);
break;
case 370594: /* USER-done */
smbuf=dact_ui_getuserinput("Enter username: ", 128, 0);
x=strlen(smbuf);
if (x>127) break;
memcpy(ret, smbuf, x);
ret+=x;
free(smbuf);
break;
case 289150: /* ATSN-done */
ret[0]='@';
ret+=1;
break;
case 316437: /* HOME-done*/
if (!(smbuf=getenv("HOME"))) break;
x=strlen(smbuf);
if (x>127) break;
memcpy(ret, smbuf, x);
ret+=x;
break;
case 301268: /* DTID */
smbuf=malloc(128);
sprintf(smbuf, "dact-%i.%i.%i-%s-%smodules-%sdebian-%snetwork-%svercheck", DACT_VER_MAJOR, DACT_VER_MINOR, DACT_VER_REVISION,
#ifdef DEBUG
"dev",
#else
"rel",
#endif
#ifdef USE_MODULES
"",
#else
"no",
#endif
#ifdef DACT_DEBIAN_UPGRADE_PROC
"",
#else
"no",
#endif
#ifndef NO_NETWORK
"",
#else
"no",
#endif
#ifdef CHECK_VERSION
""
#else
"no"
#endif
);
x=strlen(smbuf);
if (x>127) break;
memcpy(ret, smbuf, x);
ret+=x;
break;
#ifdef DEBUG
default:
PRINT_LINE; fprintf(stderr, "Unknown cmd (%i) [src=%s].\n",cmd,src);
break;
#endif
}
ploc=loc;
}
memcpy(ret, loc, strlen(loc));
return(ret_s);
}
char *parse_url_subst_dist(void) {
DIR *dirfd=NULL;
struct dirent *info=NULL;
static char retbuf[128]="unknown";
char *buf;
/*
Round 1: check for /etc/DISTRIBUTION-version or /etc/DISTRIBUTION-release
*/
dirfd=opendir("/etc/.");
while ((info=readdir(dirfd)) != NULL) {
if ((buf=strstr(info->d_name,"-version"))!=NULL) {
buf[0]=0;
strncpy(retbuf, info->d_name, sizeof(retbuf));
return(retbuf);
}
if ((buf=strstr(info->d_name,"_version"))!=NULL) {
buf[0]=0;
strncpy(retbuf, info->d_name, sizeof(retbuf));
return(retbuf);
}
if ((buf=strstr(info->d_name,"-release"))!=NULL) {
buf[0]=0;
strncpy(retbuf, info->d_name, sizeof(retbuf));
return(retbuf);
}
}
/*
Round 2: ??? (distinguish between older versions of Slackware
and Unknown distributions..)
*/
return(retbuf);
}
void strtolower(char *str) {
uint32_t x=0;
while (str[x]) { str[x]=tolower(str[x]); x++; }
}
char *mime64(unsigned char *str) {
int x=strlen(str);
return(mimes64(str,&x));
}
char *mimes64(unsigned char *str, int *size) {
char *ret;
char mimeabet[64]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
int i=0, x=0, m, bit_buf_sze;
uint32_t bit_buf_sto;
bit_buf_sze=bit_buffer_size(); /* Save the bit buffer, in case in use */
bit_buf_sto=bit_buffer_read(bit_buf_sze);
if ((ret=malloc((int) ((((float)(*size))*1.5)+7)))==NULL) return(NULL);
while (i<(*size)) {
while (bit_buffer_size()>=6) ret[x++]=mimeabet[bit_buffer_read(6)];
if ((bit_buffer_size()+8)<=32) bit_buffer_write(str[i++],8);
}
while (bit_buffer_size()>=6) ret[x++]=mimeabet[bit_buffer_read(6)];
if ((m=bit_buffer_size())) ret[x++]=mimeabet[bit_buffer_read(m)<<(6-m)];
while (x&3) ret[x++]='=';
bit_buffer_write(bit_buf_sto, bit_buf_sze); /* Restore it */
*size=x;
ret[x]='\0';
return(ret);
}
char *demime64(unsigned char *str) {
char *ret;
char mimeabet[64]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
int i=0, x=0, m, bit_buf_sze;
uint32_t bit_buf_sto;
bit_buf_sze=bit_buffer_size(); /* Save the bit buffer, in case in use */
bit_buf_sto=bit_buffer_read(bit_buf_sze);
if ((ret=malloc((int) ((((float)strlen(str))*0.75)+6)))==NULL) return(NULL);
while (i<strlen(str)) {
if (str[i]=='=') break;
while (bit_buffer_size()>=8) ret[x++]=bit_buffer_read(8);
if ((bit_buffer_size()+6)<=32) bit_buffer_write(strchr(mimeabet,str[i++])-mimeabet,6);
}
while (bit_buffer_size()>=8) ret[x++]=bit_buffer_read(8);
if ((m=bit_buffer_size())) ret[x++]=bit_buffer_read(m)<<(8-m);
bit_buffer_write(bit_buf_sto, bit_buf_sze); /* Restore it */
return(ret);
}
int32_t read_f(int fd, void *buf, size_t count) {
int32_t i=0,x;
while (i!=count) {
x=read(fd,(void *) (((char *) buf)+i),count-i);
if (x==0) break;
/* Damn typos, read_f was broken here because x<0 was typed as x>0 */
if (x<0) return(x);
i+=x;
}
return(i);
}
uint32_t hash_fourbyte(unsigned char *str, const char term) {
uint32_t ret=0;
int i;
for (i=0;i<4;i++) {
if (!str[i] || str[i]==term) break;
ret+=(str[i]<<(i*8));
}
return(ret);
}
|
Added parse.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#ifndef _PARSE_C
#define _PARSE_C
#include "dact.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
uint32_t atoi2(const char *n);
int parse_url(const char *url, char *scheme, char *username, char *password, char *host, int *port, unsigned char *file);
void strtolower(char *str);
char *parse_url_subst(const char *src, const char *fname);
char *parse_url_subst_dist(void);
char *mime64(unsigned char *str);
char *mimes64(unsigned char *str, int *size);
char *demime64(unsigned char *str);
int32_t read_f(int fd, void *buf, size_t count);
uint32_t hash_fourbyte(unsigned char *str, const char term);
#endif
|
Added patch-magic-file.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
#! /bin/sh
if test $1 = "prefix"; then
prefix=$2
shift
shift
fi
if test -w "$1" -a ! "$1" = ""; then
MAGIC="$1"
elif test -w ${prefix}/usr/share/magic; then
MAGIC="${prefix}/usr/share/magic"
elif test -w ${prefix}/usr/local/share/magic; then
MAGIC="${prefix}/usr/local/share/magic"
elif test -w ${prefix}/etc/magic; then
MAGIC="${prefix}/etc/magic"
else
echo "Cannot find magic file to patch."
exit
fi
if grep "^[^#].*belong" $MAGIC 2>/dev/null >/dev/null; then
LONG=belong
SHORT=beshort
else
LONG=long
SHORT=short
fi
if grep "\\\\b" $MAGIC 2>/dev/null >/dev/null; then
BS="\\b"
else
BS=""
fi
if grep DACT $MAGIC 2>/dev/null >/dev/null; then
exit
else
echo "
#------------------------------------------------------------------------------
# dact: file(1) magic for DACT compressed files
#
0 $LONG 0x444354C3 DACT compressed data
>4 byte >-1 (version %i.
>5 byte >-1 $BS%i.
>6 byte >-1 $BS%i)
>7 $LONG >0 $BS, original size: %i bytes
>15 $LONG >30 $BS, block size: %i bytes
" >> $MAGIC
fi
|
Added rget.txt.
|
|
>
|
1
|
http://www.rkeene.org/projects/rget/rget.cgi?dist=@@DIST@@&os=@@OSNM@@&osver=@@OSVS@@&arch=@@ARCH@@&request=@@FILE@@&ver=@@DTVS@@
|
Added sort.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#include "dact.h"
#include "sort.h"
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include <stdio.h>
/*
Bubble Sort
*/
void int_sort (uint32_t array[], unsigned int listsize, int mode) {
uint32_t *mod_array=NULL;
unsigned int temp,i,j;
mode=(!!mode);
if (mode) {
mod_array=malloc(listsize*sizeof(uint32_t));
for (i=0;i<listsize;i++) mod_array[i]=i;
}
for (i=0;i<(listsize);i++) {
for (j=0;j<(listsize-1);j++) {
if (array[j] < array[j+1]) {
temp = array[j];
array[j] = array[j+1];
array[j+1] = temp;
switch (mode) {
case 0 : break;
case 1 :
temp=mod_array[j];
mod_array[j]=mod_array[j+1];
mod_array[j+1]=temp;
}
}
}
}
if (mode) {
memcpy(array, mod_array, listsize*sizeof(uint32_t));
free(mod_array);
}
}
/*
I have no idea what this sort is called, if it has a name
(I just made one that I thought would work well.)
*/
void int_sort_fast (uint32_t array[], unsigned int elements, int mode) {
uint32_t *hold_array;
uint32_t *mod_array=NULL;
unsigned int i, x, cnt=0;
unsigned char sizeint=sizeof(uint32_t);
mode=(!!mode);
hold_array=calloc((elements+1),sizeint);
if (mode) {
mod_array=malloc(elements*sizeint);
for (i=0;i<elements;i++) mod_array[i]=i;
}
for (i=0;i<elements;i++) {
if (array[i]==0) continue;
for (x=0;x<cnt+1;x++) {
if (array[i] > hold_array[x]) {
if (x<cnt) {
memmove(hold_array+x+1,hold_array+x,(cnt-x+1)*sizeint);
}
hold_array[x]=array[i];
switch (mode) {
case 0: break;
case 1:
memmove(mod_array+x+1,mod_array+x,(cnt-x+1)*sizeint);
mod_array[x]=i;
}
break;
}
}
cnt++;
}
if (mode) {
memcpy(array,mod_array,elements*sizeint);
free(mod_array);
} else {
memcpy(array,hold_array,elements*sizeint);
}
free(hold_array);
}
/*
Sort really quickly
*/
void int_sort_really_fast (uint32_t array[], unsigned int elements, int mode) {
uint16_t list_items[0x10000];
/* uint16_t list_items[0x10000][0x10001]; */
int i,f=0,m;
memset(list_items,0,sizeof(list_items));
for (i=0;i<elements;i++) {
list_items[array[i]]++;
}
for (i=0xffff;i;i--) {
if (list_items[i]!=0) {
for (m=0;m<list_items[i];m++) array[f++]=i;
}
}
return;
}
|
Added sort.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#ifndef _DACT_SORT_H
#define _DACT_SORT_H
#include "dact.h"
void int_sort (uint32_t array[], unsigned int listsize, int mode);
void int_sort_fast (uint32_t array[], unsigned int elements, int mode);
void int_sort_really_fast (uint32_t array[], unsigned int elements, int mode);
#endif
|
Added stdint.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#ifndef _STDINT_H
#define _STDINT_H
#include "config.h"
#ifndef uint32_t
#if SIZEOF_INT == 4
#define uint32_t unsigned int
#define int32_t int
#elif SIZEOF_SHORT == 4
#define uint32_t unsigned short
#define int32_t short
#elif SIZEOF_LONG == 4
#define uint32_t unsigned long
#define int32_t long
#endif
#endif/* !uint32_t */
#ifndef uint16_t
#if SIZEOF_INT == 2
#define uint16_t unsigned int
#define int16_t int
#elif SIZEOF_SHORT == 2
#define uint16_t unsigned short
#define int16_t short
#elif SIZEOF_LONG == 2
#define uint16_t unsigned long
#define int16_t long
#endif
#endif/* !uint16_t */
#endif/*_STDINT_H*/
|
Added strsep.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
/* Compliments of Jay Freeman <saurik@saurik.com> */
#include <string.h>
char *strsep(char **stringp, const char *delim) {
char *ret = *stringp;
if (ret == NULL) return(NULL); /* grrr */
if ((*stringp = strpbrk(*stringp, delim)) != NULL) {
*((*stringp)++) = '\0';
}
return(ret);
}
|
Added strsep.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
/* Compliments of Jay Freeman <saurik@saurik.com> */
#ifndef _DACT_STRSEP_H
#define _DACT_STRSEP_H
char *strsep(char **stringp, const char *delim);
#endif
|
Added ui.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
/*
* Default DACT UI, this will probably be made modulizable.
*
* -- Roy Keene <rkeene@RKeene.org>
*
*/
#include "dact.h"
#include "ui.h"
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <stdio.h>
char dact_ui_statusvar[128];
void dact_ui_update(void) {
static int drawing=0;
float done;
char *bar1, *bar2;
int width=80,percent;
if (!dact_ui_getopt(DACT_UI_OPT_LEVEL)) return; /* LEVEL 0 is Quiet */
percent=dact_ui_getopt(DACT_UI_OPT_PERCENT);
if (getenv("COLUMNS")!=NULL) width=atoi(getenv("COLUMNS"));
if (width<10) return;
width=(width>30?10:5);
if (percent>100) percent=100;
if (percent>-1) {
done=(((float) width)*(((float) percent)/100));
bar1=malloc((int) done+2);
bar2=malloc((int) (width-done)+3);
memset(bar1,'#',(int) done);
memset(bar2,'.',(int) (width-done+0.9999999));
bar1[(int) done]=0;
bar2[(int) (width-done+0.9999999)]=0;
} else {
bar2=malloc(width+1);
memset(bar2,'?',width);
bar2[width]=0;
bar1=bar2+width;
percent=0;
}
if (dact_ui_getopt(DACT_UI_OPT_COLOR)) {
fprintf(stderr, "=> \033[1;30m[\033[1;32m%s\033[1;37m%s\033[1;30m] \033[1;37m%03i\033[0;31m%%\033[0m",bar1,bar2,percent);
} else {
fprintf(stderr, "=> [%s%s] %03i%%",bar1,bar2,percent);
}
fprintf(stderr, " [%c] | Status: %s\033[K\r",*("|/-\\"+(drawing&3)),dact_ui_statusvar);
fflush(stderr);
free(bar2);
if (bar1!=(bar2+width)) free(bar1);
drawing++;
return;
}
void dact_ui_init(void /*for now*/) {
dact_ui_setopt(DACT_UI_OPT_COLOR, 1);
dact_ui_status(0,"Initialized.");
}
void dact_ui_deinit(void) {
if (dact_ui_getopt(DACT_UI_OPT_LEVEL)) fprintf(stderr, "\n");
}
void dact_ui_percentdone(int percent) {
dact_ui_setopt(DACT_UI_OPT_PERCENT,percent);
dact_ui_update();
}
void dact_ui_incrblkcnt(int n) {
static uint32_t blkcnt=0;
uint32_t blocks;
if (n==0) blkcnt=0;
blkcnt+=n;
blocks=dact_ui_getopt(DACT_UI_OPT_FILEBLKS);
if (blocks==0) {
dact_ui_percentdone(-1);
return;
}
dact_ui_percentdone((int) ((float) (((float) blkcnt/(float) blocks)*100)));
}
int32_t dact_ui_optmanip(int action, int opt, int32_t val) {
static int opts[10]={0,0,0,0,0,0,0,0,0};
if (opt>=(sizeof(opts)/sizeof(int))) return(-1);
switch (action) {
case DACT_UI_MANIP_GET:
return(opts[opt]);
break;
case DACT_UI_MANIP_SET:
return(opts[opt]=val);
break;
}
return(-1);
}
int32_t dact_ui_getopt(int opt) {
return(dact_ui_optmanip(DACT_UI_MANIP_GET, opt, 0));
}
int dact_ui_setopt(int opt, int32_t val) {
return(dact_ui_optmanip(DACT_UI_MANIP_SET, opt, val));
}
void dact_ui_status(int level, const char *status) {
if (level>dact_ui_getopt(DACT_UI_OPT_LEVEL)) return;
strncpy(dact_ui_statusvar,status,sizeof(dact_ui_statusvar)-1);
dact_ui_update();
}
void dact_ui_status_append(int level, const char *status) {
if (level>dact_ui_getopt(DACT_UI_OPT_LEVEL)) return;
strncat(dact_ui_statusvar,status,sizeof(dact_ui_statusvar)-strlen(dact_ui_statusvar)-2);
dact_ui_update();
}
void dact_ui_setup(uint32_t blocks) {
dact_ui_setopt(DACT_UI_OPT_FILEBLKS,blocks);
dact_ui_incrblkcnt(0);
}
char *dact_ui_getuserinput(char *prompt, unsigned int n, int password) {
char *ret;
FILE *fd;
if (password) {
if (n<128) return(NULL);
ret=getpass(prompt);
return(ret);
}
if (dact_ui_getopt(DACT_UI_OPT_PASSSTDIN)==1) {
fd=stdin;
} else {
fd=fopen("/dev/tty", "r");
}
if ((ret=malloc(n))==NULL) return(NULL);
fprintf(stderr, "%s", prompt);
fflush(stderr);
fgets(ret, n, fd);
ret=strsep(&ret, "\n\r");
if (fd!=stdin) fclose(fd);
return(ret);
}
/*
void dact_ui_debug()
*/
|
Added ui.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
/*
* Copyright (C) 2001, 2002, and 2003 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#ifndef _DACT_UI_H
#define _DACT_UI_H
#define DACT_UI_MANIP_SET 0
#define DACT_UI_MANIP_GET 1
#define DACT_UI_OPT_COLOR 0
#define DACT_UI_OPT_LEVEL 1
#define DACT_UI_OPT_FILEBLKS 2
#define DACT_UI_OPT_PERCENT 3
#define DACT_UI_OPT_PASSSTDIN 4
#define DACT_UI_LVL_ALL 0
#define DACT_UI_LVL_GEN 1
#define DACT_UI_LVL_SPEC 2
#define DACT_UI_LVL_DEBUG 3
#define DACT_UI_LVL_VSPEC 6
void dact_ui_percentdone(int percent);
void dact_ui_incrblkcnt(int n);
void dact_ui_init(void);
int32_t dact_ui_optmanip(int action, int opt, int32_t val);
int32_t dact_ui_getopt(int opt);
int dact_ui_setopt(int opt, int32_t val);
void dact_ui_status(int level, const char *status);
void dact_ui_setup(uint32_t blocks);
void dact_ui_update(void);
void dact_ui_deinit(void);
void dact_ui_status_append(int level, const char *status);
char *dact_ui_getuserinput(char *prompt, unsigned int n, int password);
#endif
|
Added win32.h.
|
|
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
|
#ifndef _LOCAL_WIN32_H
#define _LOCAL_WIN32_H
#undef HAVE_UNISTD_H
#define HAVE_STDLIB_H 1
#endif
|
Added work/.dct.
cannot compute difference between binary files
Added work/Makefile.
|
|
>
>
>
>
>
|
1
2
3
4
5
|
all:
cd ../; make all
%:
cd ../; make $@
|
Added work/Makefile.dct.
cannot compute difference between binary files
Added work/acconfig.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
/* Define to the unsigned int type. */
#undef uint
/* Define to activate module loader. */
#undef USE_MODULES
/* Define for automatic version check. */
#undef CHECK_VERSION
/* Define to activate debugging mode. */
#undef DEBUG
/* Define if you have the bz2 library (-lbz2). */
#undef HAVE_LIBBZ2
/* Define if you have the z library (-lz). */
#undef HAVE_LIBZ
/* Define if yuo have the lzo library (-llzo) */
#undef HAVE_LIBLZO
/* Define if you have the compress2 function. */
#undef HAVE_COMPRESS2
/* Define if you have a newer libbz2 implementation function. */
#undef HAVE_NEW_BZ2
/* Define if you have the inet_aton function. */
#undef HAVE_INET_ATON
/* Define if you want to disable network support */
#undef NO_NETWORK
/* Define if you have gzdopen() in -lz, for native support of .gz files */
#undef HAVE_GZDOPEN
/* Define if you have bzdopen() in -lbz2, for native support of .bz2 files */
#undef HAVE_BZDOPEN
/* Define if you have a new bzip2 implementation that uses BZ2_name */
#undef HAVE_NEW_BZDOPEN
/* Define if you have /dev/urandom */
#undef HAVE_DEV_URANDOM
/* Define if you have the libmcrypt library installed */
#undef HAVE_LIBMCRYPT
/* Define to the unsigned 32 bit type. */
#undef uint32_t
/* Define to the signed 32 bit type. */
#undef int32_t
/* Define to the unsigned 16 bit type. */
#undef uint16_t
/* Define to the signed 16 bit type*/
#undef int16_t
/* Define if you want to use the Debian upgrade process */
#undef DACT_DEBIAN_UPGRADE_PROC
|
Added work/bin/bunzip2.
cannot compute difference between binary files
Added work/bin/bzcat.
cannot compute difference between binary files
Added work/bin/bzcmp.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
#!/bin/sh
# sh is buggy on RS/6000 AIX 3.2. Replace above line with #!/bin/ksh
# Bzcmp/diff wrapped for bzip2,
# adapted from zdiff by Philippe Troin <phil@fifi.org> for Debian GNU/Linux.
# Bzcmp and bzdiff are used to invoke the cmp or the diff pro-
# gram on compressed files. All options specified are passed
# directly to cmp or diff. If only 1 file is specified, then
# the files compared are file1 and an uncompressed file1.gz.
# If two files are specified, then they are uncompressed (if
# necessary) and fed to cmp or diff. The exit status from cmp
# or diff is preserved.
PATH="/usr/bin:$PATH"; export PATH
prog=`echo $0 | sed 's|.*/||'`
case "$prog" in
*cmp) comp=${CMP-cmp} ;;
*) comp=${DIFF-diff} ;;
esac
OPTIONS=
FILES=
for ARG
do
case "$ARG" in
-*) OPTIONS="$OPTIONS $ARG";;
*) if test -f "$ARG"; then
FILES="$FILES $ARG"
else
echo "${prog}: $ARG not found or not a regular file"
exit 1
fi ;;
esac
done
if test -z "$FILES"; then
echo "Usage: $prog [${comp}_options] file [file]"
exit 1
fi
tmp=`tempfile -d /tmp -p bz` || {
echo 'cannot create a temporary file' >&2
exit 1
}
set $FILES
if test $# -eq 1; then
FILE=`echo "$1" | sed 's/.bz2$//'`
bzip2 -cd "$FILE.bz2" | $comp $OPTIONS - "$FILE"
STAT="$?"
elif test $# -eq 2; then
case "$1" in
*.bz2)
case "$2" in
*.bz2)
F=`echo "$2" | sed 's|.*/||;s|.bz2$||'`
bzip2 -cdfq "$2" > $tmp
bzip2 -cdfq "$1" | $comp $OPTIONS - $tmp
STAT="$?"
/bin/rm -f $tmp;;
*) bzip2 -cdfq "$1" | $comp $OPTIONS - "$2"
STAT="$?";;
esac;;
*) case "$2" in
*.bz2)
bzip2 -cdfq "$2" | $comp $OPTIONS "$1" -
STAT="$?";;
*) $comp $OPTIONS "$1" "$2"
STAT="$?";;
esac;;
esac
exit "$STAT"
else
echo "Usage: $prog [${comp}_options] file [file]"
exit 1
fi
|
Added work/bin/bzdiff.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
#!/bin/sh
# sh is buggy on RS/6000 AIX 3.2. Replace above line with #!/bin/ksh
# Bzcmp/diff wrapped for bzip2,
# adapted from zdiff by Philippe Troin <phil@fifi.org> for Debian GNU/Linux.
# Bzcmp and bzdiff are used to invoke the cmp or the diff pro-
# gram on compressed files. All options specified are passed
# directly to cmp or diff. If only 1 file is specified, then
# the files compared are file1 and an uncompressed file1.gz.
# If two files are specified, then they are uncompressed (if
# necessary) and fed to cmp or diff. The exit status from cmp
# or diff is preserved.
PATH="/usr/bin:$PATH"; export PATH
prog=`echo $0 | sed 's|.*/||'`
case "$prog" in
*cmp) comp=${CMP-cmp} ;;
*) comp=${DIFF-diff} ;;
esac
OPTIONS=
FILES=
for ARG
do
case "$ARG" in
-*) OPTIONS="$OPTIONS $ARG";;
*) if test -f "$ARG"; then
FILES="$FILES $ARG"
else
echo "${prog}: $ARG not found or not a regular file"
exit 1
fi ;;
esac
done
if test -z "$FILES"; then
echo "Usage: $prog [${comp}_options] file [file]"
exit 1
fi
tmp=`tempfile -d /tmp -p bz` || {
echo 'cannot create a temporary file' >&2
exit 1
}
set $FILES
if test $# -eq 1; then
FILE=`echo "$1" | sed 's/.bz2$//'`
bzip2 -cd "$FILE.bz2" | $comp $OPTIONS - "$FILE"
STAT="$?"
elif test $# -eq 2; then
case "$1" in
*.bz2)
case "$2" in
*.bz2)
F=`echo "$2" | sed 's|.*/||;s|.bz2$||'`
bzip2 -cdfq "$2" > $tmp
bzip2 -cdfq "$1" | $comp $OPTIONS - $tmp
STAT="$?"
/bin/rm -f $tmp;;
*) bzip2 -cdfq "$1" | $comp $OPTIONS - "$2"
STAT="$?";;
esac;;
*) case "$2" in
*.bz2)
bzip2 -cdfq "$2" | $comp $OPTIONS "$1" -
STAT="$?";;
*) $comp $OPTIONS "$1" "$2"
STAT="$?";;
esac;;
esac
exit "$STAT"
else
echo "Usage: $prog [${comp}_options] file [file]"
exit 1
fi
|
Added work/bin/bzegrep.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
#!/bin/sh
# Bzgrep wrapped for bzip2,
# adapted from zgrep by Philippe Troin <phil@fifi.org> for Debian GNU/Linux.
## zgrep notice:
## zgrep -- a wrapper around a grep program that decompresses files as needed
## Adapted from a version sent by Charles Levert <charles@comm.polymtl.ca>
PATH="/usr/bin:$PATH"; export PATH
prog=`echo $0 | sed 's|.*/||'`
case "$prog" in
*egrep) grep=${EGREP-egrep} ;;
*fgrep) grep=${FGREP-fgrep} ;;
*) grep=${GREP-grep} ;;
esac
pat=""
while test $# -ne 0; do
case "$1" in
-e | -f) opt="$opt $1"; shift; pat="$1"
if test "$grep" = grep; then # grep is buggy with -e on SVR4
grep=egrep
fi;;
-A | -B) opt="$opt $1 $2"; shift;;
-*) opt="$opt $1";;
*) if test -z "$pat"; then
pat="$1"
else
break;
fi;;
esac
shift
done
if test -z "$pat"; then
echo "grep through bzip2 files"
echo "usage: $prog [grep_options] pattern [files]"
exit 1
fi
list=0
silent=0
op=`echo "$opt" | sed -e 's/ //g' -e 's/-//g'`
case "$op" in
*l*) list=1
esac
case "$op" in
*h*) silent=1
esac
if test $# -eq 0; then
bzip2 -cdfq | $grep $opt "$pat"
exit $?
fi
res=0
for i do
if test -f "$i"; then :; else if test -f "$i.bz2"; then i="$i.bz2"; fi; fi
if test $list -eq 1; then
bzip2 -cdfq "$i" | $grep $opt "$pat" 2>&1 > /dev/null && echo $i
r=$?
elif test $# -eq 1 -o $silent -eq 1; then
bzip2 -cdfq "$i" | $grep $opt "$pat"
r=$?
else
bzip2 -cdfq "$i" | $grep $opt "$pat" | sed "s|^|${i}:|"
r=$?
fi
test "$r" -ne 0 && res="$r"
done
exit $res
|
Added work/bin/bzfgrep.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
#!/bin/sh
# Bzgrep wrapped for bzip2,
# adapted from zgrep by Philippe Troin <phil@fifi.org> for Debian GNU/Linux.
## zgrep notice:
## zgrep -- a wrapper around a grep program that decompresses files as needed
## Adapted from a version sent by Charles Levert <charles@comm.polymtl.ca>
PATH="/usr/bin:$PATH"; export PATH
prog=`echo $0 | sed 's|.*/||'`
case "$prog" in
*egrep) grep=${EGREP-egrep} ;;
*fgrep) grep=${FGREP-fgrep} ;;
*) grep=${GREP-grep} ;;
esac
pat=""
while test $# -ne 0; do
case "$1" in
-e | -f) opt="$opt $1"; shift; pat="$1"
if test "$grep" = grep; then # grep is buggy with -e on SVR4
grep=egrep
fi;;
-A | -B) opt="$opt $1 $2"; shift;;
-*) opt="$opt $1";;
*) if test -z "$pat"; then
pat="$1"
else
break;
fi;;
esac
shift
done
if test -z "$pat"; then
echo "grep through bzip2 files"
echo "usage: $prog [grep_options] pattern [files]"
exit 1
fi
list=0
silent=0
op=`echo "$opt" | sed -e 's/ //g' -e 's/-//g'`
case "$op" in
*l*) list=1
esac
case "$op" in
*h*) silent=1
esac
if test $# -eq 0; then
bzip2 -cdfq | $grep $opt "$pat"
exit $?
fi
res=0
for i do
if test -f "$i"; then :; else if test -f "$i.bz2"; then i="$i.bz2"; fi; fi
if test $list -eq 1; then
bzip2 -cdfq "$i" | $grep $opt "$pat" 2>&1 > /dev/null && echo $i
r=$?
elif test $# -eq 1 -o $silent -eq 1; then
bzip2 -cdfq "$i" | $grep $opt "$pat"
r=$?
else
bzip2 -cdfq "$i" | $grep $opt "$pat" | sed "s|^|${i}:|"
r=$?
fi
test "$r" -ne 0 && res="$r"
done
exit $res
|
Added work/bin/bzgrep.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
#!/bin/sh
# Bzgrep wrapped for bzip2,
# adapted from zgrep by Philippe Troin <phil@fifi.org> for Debian GNU/Linux.
## zgrep notice:
## zgrep -- a wrapper around a grep program that decompresses files as needed
## Adapted from a version sent by Charles Levert <charles@comm.polymtl.ca>
PATH="/usr/bin:$PATH"; export PATH
prog=`echo $0 | sed 's|.*/||'`
case "$prog" in
*egrep) grep=${EGREP-egrep} ;;
*fgrep) grep=${FGREP-fgrep} ;;
*) grep=${GREP-grep} ;;
esac
pat=""
while test $# -ne 0; do
case "$1" in
-e | -f) opt="$opt $1"; shift; pat="$1"
if test "$grep" = grep; then # grep is buggy with -e on SVR4
grep=egrep
fi;;
-A | -B) opt="$opt $1 $2"; shift;;
-*) opt="$opt $1";;
*) if test -z "$pat"; then
pat="$1"
else
break;
fi;;
esac
shift
done
if test -z "$pat"; then
echo "grep through bzip2 files"
echo "usage: $prog [grep_options] pattern [files]"
exit 1
fi
list=0
silent=0
op=`echo "$opt" | sed -e 's/ //g' -e 's/-//g'`
case "$op" in
*l*) list=1
esac
case "$op" in
*h*) silent=1
esac
if test $# -eq 0; then
bzip2 -cdfq | $grep $opt "$pat"
exit $?
fi
res=0
for i do
if test -f "$i"; then :; else if test -f "$i.bz2"; then i="$i.bz2"; fi; fi
if test $list -eq 1; then
bzip2 -cdfq "$i" | $grep $opt "$pat" 2>&1 > /dev/null && echo $i
r=$?
elif test $# -eq 1 -o $silent -eq 1; then
bzip2 -cdfq "$i" | $grep $opt "$pat"
r=$?
else
bzip2 -cdfq "$i" | $grep $opt "$pat" | sed "s|^|${i}:|"
r=$?
fi
test "$r" -ne 0 && res="$r"
done
exit $res
|
Added work/bin/bzip2.
cannot compute difference between binary files
Added work/bin/bzip2recover.
cannot compute difference between binary files
Added work/bin/bzless.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
#!/bin/sh
# Bzmore wrapped for bzip2,
# adapted from zmore by Philippe Troin <phil@fifi.org> for Debian GNU/Linux.
PATH="/usr/bin:$PATH"; export PATH
prog=`echo $0 | sed 's|.*/||'`
case "$prog" in
*less) more=less ;;
*) more=more ;;
esac
if test "`echo -n a`" = "-n a"; then
# looks like a SysV system:
n1=''; n2='\c'
else
n1='-n'; n2=''
fi
oldtty=`stty -g 2>/dev/null`
if stty -cbreak 2>/dev/null; then
cb='cbreak'; ncb='-cbreak'
else
# 'stty min 1' resets eof to ^a on both SunOS and SysV!
cb='min 1 -icanon'; ncb='icanon eof ^d'
fi
if test $? -eq 0 -a -n "$oldtty"; then
trap 'stty $oldtty 2>/dev/null; exit' 0 2 3 5 10 13 15
else
trap 'stty $ncb echo 2>/dev/null; exit' 0 2 3 5 10 13 15
fi
if test $# = 0; then
if test -t 0; then
echo usage: $prog files...
else
bzip2 -cdfq | eval $more
fi
else
FIRST=1
for FILE
do
if test $FIRST -eq 0; then
echo $n1 "--More--(Next file: $FILE)$n2"
stty $cb -echo 2>/dev/null
ANS=`dd bs=1 count=1 2>/dev/null`
stty $ncb echo 2>/dev/null
echo " "
if test "$ANS" = 'e' -o "$ANS" = 'q'; then
exit
fi
fi
if test "$ANS" != 's'; then
echo "------> $FILE <------"
bzip2 -cdfq "$FILE" | eval $more
fi
if test -t; then
FIRST=0
fi
done
fi
|
Added work/bin/bzmore.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
#!/bin/sh
# Bzmore wrapped for bzip2,
# adapted from zmore by Philippe Troin <phil@fifi.org> for Debian GNU/Linux.
PATH="/usr/bin:$PATH"; export PATH
prog=`echo $0 | sed 's|.*/||'`
case "$prog" in
*less) more=less ;;
*) more=more ;;
esac
if test "`echo -n a`" = "-n a"; then
# looks like a SysV system:
n1=''; n2='\c'
else
n1='-n'; n2=''
fi
oldtty=`stty -g 2>/dev/null`
if stty -cbreak 2>/dev/null; then
cb='cbreak'; ncb='-cbreak'
else
# 'stty min 1' resets eof to ^a on both SunOS and SysV!
cb='min 1 -icanon'; ncb='icanon eof ^d'
fi
if test $? -eq 0 -a -n "$oldtty"; then
trap 'stty $oldtty 2>/dev/null; exit' 0 2 3 5 10 13 15
else
trap 'stty $ncb echo 2>/dev/null; exit' 0 2 3 5 10 13 15
fi
if test $# = 0; then
if test -t 0; then
echo usage: $prog files...
else
bzip2 -cdfq | eval $more
fi
else
FIRST=1
for FILE
do
if test $FIRST -eq 0; then
echo $n1 "--More--(Next file: $FILE)$n2"
stty $cb -echo 2>/dev/null
ANS=`dd bs=1 count=1 2>/dev/null`
stty $ncb echo 2>/dev/null
echo " "
if test "$ANS" = 'e' -o "$ANS" = 'q'; then
exit
fi
fi
if test "$ANS" != 's'; then
echo "------> $FILE <------"
bzip2 -cdfq "$FILE" | eval $more
fi
if test -t; then
FIRST=0
fi
done
fi
|
Added work/comp_range/.cvsignore.
Added work/comp_range/CVS/Entries.
|
|
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
|
/.cvsignore/1.1/Sat Sep 23 03:30:13 2000//
/qsmodel.c/1.2/Sat Sep 23 03:32:32 2000//
/qsmodel.h/1.1/Sat Sep 23 03:16:13 2000//
/rangecod.h/1.1/Sat Sep 23 03:16:13 2000//
/port.h/1.3/Mon Sep 25 18:14:28 2000//
/rangecod.c/1.4/Mon Sep 25 18:14:28 2000//
/Makefile.in/1.2/Fri Mar 23 07:33:46 2001//
D
|
Added work/comp_range/CVS/Repository.
Added work/comp_range/CVS/Root.
|
|
>
|
1
|
:pserver:rkeene@cvs.saurik.com:/cvs/dact
|
Added work/comp_range/Makefile.
|
|
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
|
CC = $CC
CFLAGS = -O3 -Wall -I../
LDFLAGS = -L../
all: rangecod.o qsmodel.o
clean:
rm -f *.o
rangecod.o: rangecod.c rangecod.h port.h
qsmodel.o: qsmodel.c qsmodel.h
|
Added work/comp_range/Makefile.in.
|
|
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
|
CC = $CC
CFLAGS = -O3 -Wall -I../
LDFLAGS = -L../
all: rangecod.o qsmodel.o
clean:
rm -f *.o
rangecod.o: rangecod.c rangecod.h port.h
qsmodel.o: qsmodel.c qsmodel.h
|
Added work/comp_range/comp_range.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
|
/*
* Copyright (C) 2001 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
/*
Use "Range Encoding."
http://www.compressconsult.com/ or http://eiunix.tuwien.ac.at/~michael
michael@compressconsult.com michael@eiunix.tuwien.ac.at
*/
#include "dact.h"
#include "comp_range.h"
#include <stdio.h>
#include <stdlib.h>
#include "buffer.h"
#include "comp_range/rangecod.h"
#include "comp_range/port.h"
char *tmp_block;
int count_i=0;
/*
mode - DACT_MODE_COMPR or DACT_MODE_DECMP
Determine whether to compress or decompress.
prev_block - Previous (uncompressed) block.
curr_block - The data to be compressed.
out_block - Where to put data after compression.
blk_size - Size of prev_block and curr_block.
*/
#if defined(USE_MODULES) && defined(AS_MODULE)
#include "module.h"
uint32_t DC_NUM=7;
uint32_t DC_TYPE=DACT_MOD_TYPE_COMP;
void *DC_ALGO=comp_range_algo;
char *DC_NAME="Range Encoding (MOD)";
#endif
int comp_range_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
switch(mode) {
case DACT_MODE_COMPR:
return(comp_range_compress(prev_block,curr_block,out_block,blk_size));
break; /* Heh */
case DACT_MODE_DECMP:
return(comp_range_decompress(prev_block,curr_block,out_block,blk_size));
break;
default:
printf("Unsupported mode: %i\n", mode);
return(-1);
}
}
int comp_range_compress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
unsigned int ch;
freq counts[257];
rangecoder rc;
int i,x;
if ((tmp_block=malloc(DACT_BLK_SIZE))==NULL) {
return(-1);
}
count_i=0;
for (x=0;x<DACT_BLK_SIZE;x++) tmp_block[x]=0;
byte_buffer_purge();
byte_buffer_write(curr_block, blk_size);
start_encoding(&rc,0,0);
encode_freq(&rc,1,1,2);
for (x=0;x<257;x++) counts[x]=0;
for (x=0;x<blk_size;x++) counts[curr_block[x]]++;
for (x=0;x<256;x++) {
encode_short(&rc,counts[x]);
/* printf("={ 0x%02x, 0x%04x }\n",x,counts[x]); */
}
counts[256]=blk_size;
for (x=256; x; x--) counts[x-1]=counts[x]-counts[x-1];
for (i=0;i<blk_size;i++) {
ch=curr_block[i];
/* printf("i=%5i ch=0x%02x -- counts[ch+1]=0x%02x counts[ch]=0x%02x\n",i,ch,counts[ch+1],counts[ch]); */
encode_freq(&rc,counts[ch+1]-counts[ch],counts[ch],counts[256]);
}
encode_freq(&rc,1,0,2);
done_encoding(&rc);
if (count_i>blk_size) return(-1);
for (i=0;i<count_i;i++) {
out_block[i]=tmp_block[i];
}
free(tmp_block);
return(count_i);
}
int comp_range_decompress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size) {
int i,x;
int blocksize;
freq counts[257], tmp, cf, symbol;
rangecoder rc;
tmp_block=malloc(DACT_BLK_SIZE);
byte_buffer_purge();
byte_buffer_write(curr_block, blk_size);
count_i=0;
for (x=0;x<DACT_BLK_SIZE;x++) tmp_block[x]=0;
start_decoding(&rc);
cf = decode_culfreq(&rc,2);
decode_update(&rc,1,1,2);
for (x=0; x<256; x++) counts[x]=decode_short(&rc);
blocksize=0;
for (x=0; x<256; x++) {
tmp=counts[x];
counts[x]=blocksize;
blocksize+=tmp;
}
counts[256]=blocksize;
for (i=0; i<blocksize; i++) {
cf=decode_culfreq(&rc,counts[256]);
for (symbol=0; counts[symbol+1]<=cf; symbol++) { /**/; }
decode_update(&rc, counts[symbol+1]-counts[symbol],counts[symbol],counts[256]);
incoming_data(symbol);
}
done_decoding(&rc);
// Why am I not memcpy()'ing?
for (i=0;i<count_i;i++) out_block[i]=tmp_block[i];
free(tmp_block);
return(count_i);
}
void incoming_data(unsigned char value) {
if (count_i<=(BYTE_BUFF_SIZE))
tmp_block[count_i++]=value;
}
|
Added work/comp_range/comp_range.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
/*
* Copyright (C) 2001 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: dact@rkeene.org
*/
#ifndef _COMP_RANGE_H
#define _COMP_RANGE_H
#include "dact.h"
#include "config.h"
#if defined(USE_MODULES) && !defined(AS_MODULE)
#define comp_range_algo DACT_FAILED_ALGO
#else
int comp_range_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
int comp_range_compress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
int comp_range_decompress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
#endif
void incoming_data(unsigned char value);
#endif
|
Added work/comp_range/port.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
#ifndef port_h
#define port_h
#include <limits.h>
#include <sys/types.h>
#if INT_MAX > 0x7FFF
typedef unsigned short uint2; /* two-byte integer (large arrays) */
typedef unsigned int uint4; /* four-byte integers (range needed) */
#else
typedef unsigned int uint2;
typedef unsigned long uint4;
#endif
#endif
|
Added work/comp_range/qsmodel.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
|
/*
qsmodel.c headerfile for quasistatic probability model
(c) Michael Schindler
1997, 1998
http://www.compressconsult.com/ or http://eiunix.tuwien.ac.at/~michael
michael@compressconsult.com michael@eiunix.tuwien.ac.at
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. It may be that this
program violates local patents in your country, however it is
belived (NO WARRANTY!) to be patent-free here in Austria.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA.
Qsmodel is a quasistatic probability model that periodically
(at chooseable intervals) updates probabilities of symbols;
it also allows to initialize probabilities. Updating is done more
frequent in the beginning, so it adapts very fast even without
initialisation.
it provides function for creation, deletion, query for probabilities
and symbols and model updating.
for usage see example.c
*/
#include "qsmodel.h"
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
/* default tablesize 1<<TBLSHIFT */
#define TBLSHIFT 7
/* rescale frequency counts */
static void dorescale( qsmodel *m)
{ int i, cf, missing;
if (m->nextleft) /* we have some more before actual rescaling */
{ m->incr++;
m->left = m->nextleft;
m->nextleft = 0;
return;
}
if (m->rescale < m->targetrescale) /* double rescale interval if needed */
{ m->rescale <<= 1;
if (m->rescale > m->targetrescale)
m->rescale = m->targetrescale;
}
cf = missing = m->cf[m->n]; /* do actual rescaling */
for(i=m->n-1; i; i--)
{ int tmp = m->newf[i];
cf -= tmp;
m->cf[i] = cf;
tmp = tmp>>1 | 1;
missing -= tmp;
m->newf[i] = tmp;
}
if (cf!=m->newf[0])
{ fprintf(stderr,"BUG: rescaling left %d total frequency\n",cf);
deleteqsmodel(m);
exit(1);
}
m->newf[0] = m->newf[0]>>1 | 1;
missing -= m->newf[0];
m->incr = missing / m->rescale;
m->nextleft = missing % m->rescale;
m->left = m->rescale - m->nextleft;
if (m->search != NULL)
{ i=m->n;
while (i)
{ int start, end;
end = (m->cf[i]-1) >> m->searchshift;
i--;
start = m->cf[i] >> m->searchshift;
while (start<=end)
{ m->search[start] = i;
start++;
}
}
}
}
/* initialisation of qsmodel */
/* m qsmodel to be initialized */
/* n number of symbols in that model */
/* lg_totf base2 log of total frequency count */
/* rescale desired rescaling interval, should be < 1<<(lg_totf+1) */
/* init array of int's to be used for initialisation (NULL ok) */
/* compress set to 1 on compression, 0 on decompression */
void initqsmodel( qsmodel *m, int n, int lg_totf, int rescale, int *init, int compress )
{ m->n = n;
m->targetrescale = rescale;
m->searchshift = lg_totf - TBLSHIFT;
if (m->searchshift < 0)
m->searchshift = 0;
m->cf = malloc((n+1)*sizeof(uint2));
m->newf = malloc((n+1)*sizeof(uint2));
m->cf[n] = 1<<lg_totf;
m->cf[0] = 0;
if (compress)
m->search = NULL;
else
{ m->search = malloc(((1<<TBLSHIFT)+1)*sizeof(uint2));
m->search[1<<TBLSHIFT] = n-1;
}
resetqsmodel(m, init);
}
/* reinitialisation of qsmodel */
/* m qsmodel to be initialized */
/* init array of int's to be used for initialisation (NULL ok) */
void resetqsmodel( qsmodel *m, int *init)
{ int i, end, initval;
m->rescale = m->n>>4 | 2;
m->nextleft = 0;
if (init == NULL)
{ initval = m->cf[m->n] / m->n;
end = m->cf[m->n] % m->n;
for (i=0; i<end; i++)
m->newf[i] = initval+1;
for (; i<m->n; i++)
m->newf[i] = initval;
} else
for(i=0; i<m->n; i++)
m->newf[i] = init[i];
dorescale(m);
}
/* deletion of qsmodel m */
void deleteqsmodel( qsmodel *m )
{ free(m->cf);
free(m->newf);
if (m->search != NULL)
free(m->search);
}
/* retrieval of estimated frequencies for a symbol */
/* m qsmodel to be questioned */
/* sym symbol for which data is desired; must be <n */
/* sy_f frequency of that symbol */
/* lt_f frequency of all smaller symbols together */
/* the total frequency is 1<<lg_totf */
void qsgetfreq( qsmodel *m, int sym, int *sy_f, int *lt_f )
{ *sy_f = m->cf[sym+1] - (*lt_f = m->cf[sym]);
}
/* find out symbol for a given cumulative frequency */
/* m qsmodel to be questioned */
/* lt_f cumulative frequency */
int qsgetsym( qsmodel *m, int lt_f )
{ int lo, hi;
uint2 *tmp;
tmp = m->search+(lt_f>>m->searchshift);
lo = *tmp;
hi = *(tmp+1) + 1;
while (lo+1 < hi )
{ int mid = (lo+hi)>>1;
if (lt_f < m->cf[mid])
hi = mid;
else
lo = mid;
}
return lo;
}
/* update model */
/* m qsmodel to be updated */
/* sym symbol that occurred (must be <n from init) */
void qsupdate( qsmodel *m, int sym )
{ if (m->left <= 0)
dorescale(m);
m->left--;
m->newf[sym] += m->incr;
}
|
Added work/comp_range/qsmodel.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
#ifndef QSMODEL_H
#define QSMODEL_H
/*
qsmodel.h headerfile for quasistatic probability model
(c) Michael Schindler
1997, 1998
http://www.compressconsult.com/ or http://eiunix.tuwien.ac.at/~michael
michael@compressconsult.com michael@eiunix.tuwien.ac.at
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. It may be that this
program violates local patents in your country, however it is
belived (NO WARRANTY!) to be patent-free here in Austria.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA.
Qsmodel is a quasistatic probability model that periodically
(at chooseable intervals) updates probabilities of symbols;
it also allows to initialize probabilities. Updating is done more
frequent in the beginning, so it adapts very fast even without
initialisation.
it provides function for creation, deletion, query for probabilities
and symbols and model updating.
for usage see example.c
*/
#include "port.h"
typedef struct {
int n, /* number of symbols */
left, /* symbols to next rescale */
nextleft, /* symbols with other increment */
rescale, /* intervals between rescales */
targetrescale, /* should be interval between rescales */
incr, /* increment per update */
searchshift; /* shift for lt_freq before using as index */
uint2 *cf, /* array of cumulative frequencies */
*newf, /* array for collecting ststistics */
*search; /* structure for searching on decompression */
} qsmodel;
/* initialisation of qsmodel */
/* m qsmodel to be initialized */
/* n number of symbols in that model */
/* lg_totf base2 log of total frequency count */
/* rescale desired rescaling interval, should be < 1<<(lg_totf+1) */
/* init array of int's to be used for initialisation (NULL ok) */
/* compress set to 1 on compression, 0 on decompression */
void initqsmodel( qsmodel *m, int n, int lg_totf, int rescale,
int *init, int compress );
/* reinitialisation of qsmodel */
/* m qsmodel to be initialized */
/* init array of int's to be used for initialisation (NULL ok) */
void resetqsmodel( qsmodel *m, int *init);
/* deletion of qsmodel m */
void deleteqsmodel( qsmodel *m );
/* retrieval of estimated frequencies for a symbol */
/* m qsmodel to be questioned */
/* sym symbol for which data is desired; must be <n */
/* sy_f frequency of that symbol */
/* lt_f frequency of all smaller symbols together */
/* the total frequency is 1<<lg_totf */
void qsgetfreq( qsmodel *m, int sym, int *sy_f, int *lt_f );
/* find out symbol for a given cumulative frequency */
/* m qsmodel to be questioned */
/* lt_f cumulative frequency */
int qsgetsym( qsmodel *m, int lt_f );
/* update model */
/* m qsmodel to be updated */
/* sym symbol that occurred (must be <n from init) */
void qsupdate( qsmodel *m, int sym );
#endif
|
Added work/comp_range/rangecod.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
|
/*
rangecod.c range encoding
(c) Michael Schindler
1997, 1998, 1999
http://www.compressconsult.com/ or http://eiunix.tuwien.ac.at/~michael
michael@compressconsult.com michael@eiunix.tuwien.ac.at
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. It may be that this
program violates local patents in your country, however it is
belived (NO WARRANTY!) to be patent-free. Glen Langdon also
confirmed my poinion that IBM UK did not protect that method.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA.
Range encoding is based on an article by G.N.N. Martin, submitted
March 1979 and presented on the Video & Data Recording Conference,
Southampton, July 24-27, 1979. If anyone can name the original
copyright holder of that article please contact me; this might
allow me to make that article available on the net for general
public.
Range coding is closely related to arithmetic coding, except that
it does renormalisation in larger units than bits and is thus
faster. An earlier version of this code was distributed as byte
oriented arithmetic coding, but then I had no knowledge of Martin's
paper from 1997.
The input and output is done by the inbyte and outbyte macros
defined in the .c file; change them as needed; the first parameter
passed to them is a pointer to the rangecoder structure; extend that
structure as needed (and don't forget to initialize the values in
start_encoding resp. start_decoding). This distribution writes to
stdout and reads from stdin.
There are no global or static var's, so if the IO is thread save the
whole rangecoder is - unless GLOBALRANGECODER in rangecod.h is defined.
For error recovery the last 3 bytes written contain the total number
of bytes written since starting the encoder. This can be used to
locate the beginning of a block if you have only the end. The header
size you pass to initrangecoder is included in that count.
There is a supplementary file called renorm95.c available at the
website (www.compressconsult.com/rangecoder/) that changes the range
coder to an arithmetic coder for speed comparisons.
define RENORM95 if you want the arithmetic coder type renormalisation.
Requires renorm95.c
Note that the old version does not write out the bytes since init.
you should not define GLOBALRANGECODER then. This Flag is provided
only for spped comparisons between both renormalizations, see my
data compression conference article 1998 for details.
*/
/* #define RENORM95 */
/*
define NOWARN if you do not expect more than 2^32 outstanding bytes
since I recommend restarting the coder in intervals of less than
2^23 symbols for error tolerance this is not expected
*/
#define NOWARN
/*
define EXTRAFAST for increased speed; you loose compression and
compatibility in exchange.
*/
/* #define EXTRAFAST */
#include <stdio.h> /* fprintf(), getchar(), putchar(), NULL */
#include "port.h"
#include "rangecod.h"
/* SIZE OF RANGE ENCODING CODE VALUES. */
#define CODE_BITS 32
#define Top_value ((code_value)1 << (CODE_BITS-1))
/* all IO is done by these macros - change them if you want to */
/* no checking is done - do it here if you want it */
/* cod is a pointer to the used rangecoder */
/* #define outbyte(cod,x) putchar(x)
#define inbyte(cod) getchar()
*/
#include "../buffer.h"
#include "../comp_range.h"
#define outbyte(cod,x) incoming_data(x);
#define inbyte(cod) byte_buffer_read_1();
#ifdef RENORM95
#include "renorm95.c"
#else
#define SHIFT_BITS (CODE_BITS - 9)
#define EXTRA_BITS ((CODE_BITS-2) % 8 + 1)
#define Bottom_value (Top_value >> 8)
#ifdef NOWARN
#ifdef GLOBALRANGECODER
char coderversion[]="rangecoder 1.1c NOWARN GLOBAL (c) 1997-1999 Michael Schindler";
#else
char coderversion[]="rangecoder 1.1c NOWARN (c) 1997-1999 Michael Schindler";
#endif
#else /*NOWARN*/
#ifdef GLOBALRANGECODER
char coderversion[]="rangecoder 1.1c GLOBAL (c) 1997-1999 Michael Schindler";
#else
char coderversion[]="rangecoder 1.1c (c) 1997-1999 Michael Schindler";
#endif
#endif /*NOWARN*/
#endif /*RENORM95*/
#ifdef GLOBALRANGECODER
/* if this is defined we'll make a global variable rngc and */
/* make RNGC use that var; we'll also omit unneeded parameters */
static rangecoder rngc;
#define RNGC (rngc)
#define M_outbyte(a) outbyte(&rngc,a)
#define M_inbyte inbyte(&rngc)
#define enc_normalize(rc) M_enc_normalize()
#define dec_normalize(rc) M_dec_normalize()
#else
#define RNGC (*rc)
#define M_outbyte(a) outbyte(rc,a)
#define M_inbyte inbyte(rc)
#endif
/* rc is the range coder to be used */
/* c is written as first byte in the datastream */
/* one could do without c, but then you have an additional if */
/* per outputbyte. */
void start_encoding( rangecoder *rc, char c, int initlength )
{ RNGC.low = 0; /* Full code range */
RNGC.range = Top_value;
RNGC.buffer = c;
RNGC.help = 0; /* No bytes to follow */
RNGC.bytecount = initlength;
}
#ifndef RENORM95
/* I do the normalization before I need a defined state instead of */
/* after messing it up. This simplifies starting and ending. */
static inline void enc_normalize( rangecoder *rc )
{ while(RNGC.range <= Bottom_value) /* do we need renormalisation? */
{ if (RNGC.low < (code_value)0xff<<SHIFT_BITS) /* no carry possible --> output */
{ M_outbyte(RNGC.buffer);
for(; RNGC.help; RNGC.help--)
M_outbyte(0xff);
RNGC.buffer = (unsigned char)(RNGC.low >> SHIFT_BITS);
} else if (RNGC.low & Top_value) /* carry now, no future carry */
{ M_outbyte(RNGC.buffer+1);
for(; RNGC.help; RNGC.help--)
M_outbyte(0);
RNGC.buffer = (unsigned char)(RNGC.low >> SHIFT_BITS);
} else /* passes on a potential carry */
#ifdef NOWARN
RNGC.help++;
#else
if (RNGC.bytestofollow++ == 0xffffffffL)
{ fprintf(stderr,"Too many bytes outstanding - File too large\n");
exit(1);
}
#endif
RNGC.range <<= 8;
RNGC.low = (RNGC.low<<8) & (Top_value-1);
RNGC.bytecount++;
}
}
#endif
/* Encode a symbol using frequencies */
/* rc is the range coder to be used */
/* sy_f is the interval length (frequency of the symbol) */
/* lt_f is the lower end (frequency sum of < symbols) */
/* tot_f is the total interval length (total frequency sum) */
/* or (faster): tot_f = (code_value)1<<shift */
void encode_freq( rangecoder *rc, freq sy_f, freq lt_f, freq tot_f )
{ code_value r, tmp;
enc_normalize( rc );
r = RNGC.range / tot_f;
tmp = r * lt_f;
RNGC.low += tmp;
#ifdef EXTRAFAST
RNGC.range = r * sy_f;
#else
if (lt_f+sy_f < tot_f)
RNGC.range = r * sy_f;
else
RNGC.range -= tmp;
#endif
}
void encode_shift( rangecoder *rc, freq sy_f, freq lt_f, freq shift )
{ code_value r, tmp;
enc_normalize( rc );
r = RNGC.range >> shift;
tmp = r * lt_f;
RNGC.low += tmp;
#ifdef EXTRAFAST
RNGC.range = r * sy_f;
#else
if ((lt_f+sy_f) >> shift)
RNGC.range -= tmp;
else
RNGC.range = r * sy_f;
#endif
}
#ifndef RENORM95
/* Finish encoding */
/* rc is the range coder to be used */
/* actually not that many bytes need to be output, but who */
/* cares. I output them because decode will read them :) */
/* the return value is the number of bytes written */
uint4 done_encoding( rangecoder *rc )
{ uint tmp;
enc_normalize(rc); /* now we have a normalized state */
RNGC.bytecount += 5;
if ((RNGC.low & (Bottom_value-1)) < (RNGC.bytecount>>1))
tmp = RNGC.low >> SHIFT_BITS;
else
tmp = (RNGC.low >> SHIFT_BITS) + 1;
if (tmp > 0xff) /* we have a carry */
{ M_outbyte(RNGC.buffer+1);
for(; RNGC.help; RNGC.help--)
M_outbyte(0);
} else /* no carry */
{ M_outbyte(RNGC.buffer);
for(; RNGC.help; RNGC.help--)
M_outbyte(0xff);
}
M_outbyte(tmp & 0xff);
M_outbyte((RNGC.bytecount>>16) & 0xff);
M_outbyte((RNGC.bytecount>>8) & 0xff);
M_outbyte(RNGC.bytecount & 0xff);
return RNGC.bytecount;
}
/* Start the decoder */
/* rc is the range coder to be used */
/* returns the char from start_encoding or EOF */
int start_decoding( rangecoder *rc )
{ int c = M_inbyte;
if (c==EOF)
return EOF;
RNGC.buffer = M_inbyte;
RNGC.low = RNGC.buffer >> (8-EXTRA_BITS);
RNGC.range = (code_value)1 << EXTRA_BITS;
return c;
}
static inline void dec_normalize( rangecoder *rc )
{ while (RNGC.range <= Bottom_value)
{ RNGC.low = (RNGC.low<<8) | ((RNGC.buffer<<EXTRA_BITS)&0xff);
RNGC.buffer = M_inbyte;
RNGC.low |= RNGC.buffer >> (8-EXTRA_BITS);
RNGC.range <<= 8;
}
}
#endif
/* Calculate culmulative frequency for next symbol. Does NO update!*/
/* rc is the range coder to be used */
/* tot_f is the total frequency */
/* or: totf is (code_value)1<<shift */
/* returns the culmulative frequency */
freq decode_culfreq( rangecoder *rc, freq tot_f )
{ freq tmp;
dec_normalize(rc);
RNGC.help = RNGC.range/tot_f;
tmp = RNGC.low/RNGC.help;
#ifdef EXTRAFAST
return tmp;
#else
return (tmp>=tot_f ? tot_f-1 : tmp);
#endif
}
freq decode_culshift( rangecoder *rc, freq shift )
{ freq tmp;
dec_normalize(rc);
RNGC.help = RNGC.range>>shift;
tmp = RNGC.low/RNGC.help;
#ifdef EXTRAFAST
return tmp;
#else
return (tmp>>shift ? ((code_value)1<<shift)-1 : tmp);
#endif
}
/* Update decoding state */
/* rc is the range coder to be used */
/* sy_f is the interval length (frequency of the symbol) */
/* lt_f is the lower end (frequency sum of < symbols) */
/* tot_f is the total interval length (total frequency sum) */
void decode_update( rangecoder *rc, freq sy_f, freq lt_f, freq tot_f)
{ code_value tmp;
tmp = RNGC.help * lt_f;
RNGC.low -= tmp;
#ifdef EXTRAFAST
RNGC.range = RNGC.help * sy_f;
#else
if (lt_f + sy_f < tot_f)
RNGC.range = RNGC.help * sy_f;
else
RNGC.range -= tmp;
#endif
}
/* Decode a byte/short without modelling */
/* rc is the range coder to be used */
unsigned char decode_byte(rangecoder *rc)
{ unsigned char tmp = decode_culshift(rc,8);
decode_update( rc,1,tmp,(freq)1<<8);
return tmp;
}
unsigned short decode_short(rangecoder *rc)
{ unsigned short tmp = decode_culshift(rc,16);
decode_update( rc,1,tmp,(freq)1<<16);
return tmp;
}
/* Finish decoding */
/* rc is the range coder to be used */
void done_decoding( rangecoder *rc )
{ dec_normalize(rc); /* normalize to use up all bytes */
}
|
Added work/comp_range/rangecod.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
|
#ifndef rangecod_h
#define rangecod_h
/*
rangecod.h headerfile for range encoding
(c) Michael Schindler
1997, 1998, 1999
http://www.compressconsult.com/ or http://eiunix.tuwien.ac.at/~michael
michael@compressconsult.com michael@eiunix.tuwien.ac.at
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. It may be that this
program violates local patents in your country, however it is
belived (NO WARRANTY!) to be patent-free here in Austria. Glen
Langdon also confirmed my poinion that IBM UK did not protect that
method.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA.
Range encoding is based on an article by G.N.N. Martin, submitted
March 1979 and presented on the Video & Data Recording Conference,
Southampton, July 24-27, 1979. If anyone can name the original
copyright holder of that article please contact me; this might
allow me to make that article available on the net for general
public.
Range coding is closely related to arithmetic coding, except that
it does renormalisation in larger units than bits and is thus
faster. An earlier version of this code was distributed as byte
oriented arithmetic coding, but then I had no knowledge of Martin's
paper from 1979.
The input and output is done by the INBYTE and OUTBYTE macros
defined in the .c file; change them as needed; the first parameter
passed to them is a pointer to the rangecoder structure; extend that
structure as needed (and don't forget to initialize the values in
start_encoding resp. start_decoding). This distribution writes to
stdout and reads from stdin.
There are no global or static var's, so if the IO is thread save the
whole rangecoder is - unless GLOBALRANGECODER in rangecod.h is defined.
For error recovery the last 3 bytes written contain the total number
of bytes written since starting the encoder. This can be used to
locate the beginning of a block if you have only the end.
For some application using a global coder variable may provide a better
performance. This will allow you to use only one coder at a time and
will destroy thread savety. To enabble this feature uncomment the
#define GLOBALRANGECODER line below.
*/
/* #define GLOBALRANGECODER */
#include "port.h"
#if 0 /* done in port.h */
#include <limits.h>
#if INT_MAX > 0xffff
typedef unsigned int uint4;
typedef unsigned short uint2;
#else
typedef unsigned long uint4;
typedef unsigned int uint2;
#endif
#endif
extern char coderversion[];
typedef uint4 code_value; /* Type of an rangecode value */
/* must accomodate 32 bits */
/* it is highly recommended that the total frequency count is less */
/* than 1 << 19 to minimize rounding effects. */
/* the total frequency count MUST be less than 1<<23 */
typedef uint4 freq;
/* make the following private in the arithcoder object in C++ */
typedef struct {
uint4 low, /* low end of interval */
range, /* length of interval */
help; /* bytes_to_follow resp. intermediate value */
unsigned char buffer;/* buffer for input/output */
/* the following is used only when encoding */
uint4 bytecount; /* counter for outputed bytes */
/* insert fields you need for input/output below this line! */
} rangecoder;
/* supply the following as methods of the arithcoder object */
/* omit the first parameter then (C++) */
#ifdef GLOBALRANGECODER
#define start_encoding(rc,a,b) M_start_encoding(a,b)
#define encode_freq(rc,a,b,c) M_encode_freq(a,b,c)
#define encode_shift(rc,a,b,c) M_encode_shift(a,b,c)
#define done_encoding(rc) M_done_encoding()
#define start_decoding(rc) M_start_decoding()
#define decode_culfreq(rc,a) M_decode_culfreq(a)
#define decode_culshift(rc,a) M_decode_culshift(a)
#define decode_update(rc,a,b,c) M_decode_update(a,b,c)
#define decode_byte(rc) M_decode_byte()
#define decode_short(rc) M_decode_short()
#define done_decoding(rc) M_done_decoding()
#endif
/* Start the encoder */
/* rc is the range coder to be used */
/* c is written as first byte in the datastream (header,...) */
void start_encoding( rangecoder *rc, char c, int initlength);
/* Encode a symbol using frequencies */
/* rc is the range coder to be used */
/* sy_f is the interval length (frequency of the symbol) */
/* lt_f is the lower end (frequency sum of < symbols) */
/* tot_f is the total interval length (total frequency sum) */
/* or (a lot faster): tot_f = 1<<shift */
void encode_freq( rangecoder *rc, freq sy_f, freq lt_f, freq tot_f );
void encode_shift( rangecoder *rc, freq sy_f, freq lt_f, freq shift );
/* Encode a byte/short without modelling */
/* rc is the range coder to be used */
/* b,s is the data to be encoded */
#define encode_byte(ac,b) encode_shift(ac,(freq)1,(freq)(b),(freq)8)
#define encode_short(ac,s) encode_shift(ac,(freq)1,(freq)(s),(freq)16)
/* Finish encoding */
/* rc is the range coder to be shut down */
/* returns number of bytes written */
uint4 done_encoding( rangecoder *rc );
/* Start the decoder */
/* rc is the range coder to be used */
/* returns the char from start_encoding or EOF */
int start_decoding( rangecoder *rc );
/* Calculate culmulative frequency for next symbol. Does NO update!*/
/* rc is the range coder to be used */
/* tot_f is the total frequency */
/* or: totf is 1<<shift */
/* returns the <= culmulative frequency */
freq decode_culfreq( rangecoder *rc, freq tot_f );
freq decode_culshift( rangecoder *ac, freq shift );
/* Update decoding state */
/* rc is the range coder to be used */
/* sy_f is the interval length (frequency of the symbol) */
/* lt_f is the lower end (frequency sum of < symbols) */
/* tot_f is the total interval length (total frequency sum) */
void decode_update( rangecoder *rc, freq sy_f, freq lt_f, freq tot_f);
#define decode_update_shift(rc,f1,f2,f3) decode_update((rc),(f1),(f2),(freq)1<<(f3));
/* Decode a byte/short without modelling */
/* rc is the range coder to be used */
unsigned char decode_byte(rangecoder *rc);
unsigned short decode_short(rangecoder *rc);
/* Finish decoding */
/* rc is the range coder to be used */
void done_decoding( rangecoder *rc );
#endif
|
Added work/contrib/chaoscipher/.cipher_chaos.c.swp.
cannot compute difference between binary files
Added work/contrib/chaoscipher/chaos.430.1000000.c-out.jpg.
Added work/contrib/chaoscipher/cipher_chaos.
cannot compute difference between binary files
Added work/contrib/chaoscipher/cipher_chaos.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#define R(x) 4*x
#define NORM(x) { x+=0.000001; while(x<1) x*=10; while(x>=1) x/=10; }
#define BEST(x,y,m) { \
y=((int) (x*8)); \
y=((((int) (x*pow(10,(y+2))))-(((int) (x*pow(10,(y-1))))*1000))); \
if (y==999 || y==0) { \
y=((int) (x*10000))/10; \
} else { \
if (y<250 && y>124 && m) { y=((y-125)*8); m=!m; } \
} \
}
#define CEST(x,y,m) { \
y=((int) (x*100000))&0xff; \
}
char *cipher_chaos_encrypt(const char *src, const char *key, const int srclen) {
}
#ifdef DEBUG_CIPHER_CHAOS
int main(int argc, char **argv) {
double x;
int y,m=0,i,imx;
int hist[1000];
m=atoi(argv[1]);
imx=atoi(argv[2]);
x=m;
NORM(x);
printf("Primer=%f (%i iterations)\n",x,imx);
for (i=0;i<1000;i++) {
hist[i]=0;
}
for (i=0;i<imx;i++) {
CEST(x,y,m);
hist[y]++;
printf("%i %i\n",i,y);
x=R(x)*(1-x);
NORM(x);
}
for (i=0;i<256;i++) {
fprintf(stderr, "%i %i\n",i,hist[i]);
}
}
#endif
|
Added work/contrib/huff/comp_huff.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
|
/*
* Copyright (C) 2000 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: rkeene@rkeene.org
*/
/*
Classic 8-Bit Huffman compression algorithm
Colin Fowler Jun 2001
NOTES / TODO
------------
Is NOT endian safe - can't exchange data between machines with
different endianess (read and write header of ints with memcpy)
(use ntohl and htonl for a quick fix?)
Header is 1k - Fix this. I'll rarely get 4gigabytes of the same char
but we have to allow for that. Will be easy to cut it down to 512b
using shorts if a block contains no char with a count above 64k and
down further to 256b is a block contains no char with a count above 255
Flag this in the first byte of the header.
It's SLOW SLOW SLOW and SLOW. Make it faster.
Look into using lookup tables for decoding.
Gprof the code.
most likely optimise the huff_write_out() and the
huff_bit_write_dict()
Reorder the functions so the code is more readable
Check for gcc'isms and other stuff another compiler will bork on
Set your tabs to 8 Spaces to make this readable
*/
#include "dact.h"
#include "comp_huff.h"
#include "buffer.h"
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
huff_node *new_huff_node(unsigned int count, huff_node *left, huff_node *right, unsigned char value)
{
huff_node *retval;
retval = (huff_node *)malloc(sizeof(huff_node));
retval->left_parent = left;
retval->right_parent = right;
retval->count = count;
retval->value = value;
return retval;
}
huff_dict_entry *new_huff_dict_entry()
{
huff_dict_entry * retval;
retval = (huff_dict_entry *)malloc(sizeof(huff_dict_entry));
retval->bits=0;
return retval;
}
/* Write a 0 or a 1 to a huffman dictionary entry */
void huff_dict_write_bit(huff_dict_entry *to_mod, unsigned char bit_to_add)
{
/* if it's a 0 we dont need to do anything
because the dictionary is already full of 0's. Just increment the
number of bits and exit
*/
to_mod->entry[to_mod->bits] = bit_to_add;
to_mod->bits++;
}
/* write out dictionary entries to the bit buffer */
void huff_write_out(huff_dict_entry *to_write, char *out_block, unsigned int *g)
{
int i;
for( i=to_write->bits -1 ; i>=0; i--) {
bit_buffer_write(to_write->entry[i],1);
while (bit_buffer_size()>=8)
out_block[(*g)++]=((unsigned char) (bit_buffer_read(8)));
}
}
/*
mode - DACT_MODE_COMPR or DACT_MODE_DECMP
Determine whether to compress or decompress.
prev_block - Previous (uncompressed) block.
curr_block - The data to be compressed.
out_block - Where to put data after compression.
blk_size - Size of prev_block and curr_block.
*/
int comp_huff_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size)
{
switch(mode) {
case DACT_MODE_COMPR:
return(comp_huff_compress(prev_block,curr_block,out_block,blk_size));
break; /* Heh */
case DACT_MODE_DECMP:
return(comp_huff_decompress(prev_block,curr_block,out_block,blk_size));
break;
default:
printf("Unsupported mode: %i\n", mode);
return(-1);
}
}
int huff_node_qsort_compare(huff_node **a, huff_node **b)
{
if( (*a)->count > (*b)->count) return -1;
if( (*a)->count < (*b)->count) return 1;
/* must be equal then */
return 0;
}
int comp_huff_compress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size)
{
unsigned int byte_count, i, byte;
unsigned char *curr_byte;
huff_node *tree_top[256]; /* an array of 256 pointers that always holds top of the tree */
huff_node *root_node; /* the root of the tree */
huff_dict_entry *dictionary[256]; /* the dictionary */
unsigned int g=1024; /* index in out_block to start of compressed data */
unsigned int header[256]; /* the huffman header */
unsigned char bogus_bits;
/* build the header */
for( byte=0; byte<=255; byte++) {
byte_count=0;
curr_byte=curr_block;
for(i=0; i<blk_size; i++) {
if ( *curr_byte == byte)
byte_count++;
curr_byte++;
}
header[byte]=byte_count;
}
root_node = huff_build_tree(header, tree_top, blk_size);
huff_build_dict(root_node, tree_top, dictionary);
/* free the tree */
tree_free(root_node);
/* save the header here */
/* urghhh 256 ints - This is REAL stupid as it's not endian safe and
its not processor register size (int) safe. It's only for testing tho :)
*/
memcpy(out_block, header, sizeof(header));
bit_buffer_purge();
/* Read the buffer and apply the dictionary */
curr_byte = curr_block;
for( i=0; i<blk_size; i++) {
huff_write_out(dictionary[*curr_byte], out_block, &g);
/* damn I read the example wrong and spent 1/2 an hour
thinking the bit_buffer corresponded to the out block. doh :)
*/
while (bit_buffer_size()>=8)
out_block[g++]=((unsigned char) (bit_buffer_read(8)));
curr_byte++;
}
/* We may not have the all our compressed data completely aligned on a
char boundary so we'll pad them
*/
bogus_bits = 8 - bit_buffer_size();
bit_buffer_write(0,bogus_bits);
out_block[g++]=((unsigned char) (bit_buffer_read(8)));
/* free the dictionary */
dict_free(dictionary);
return(g);
}
int comp_huff_decompress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size)
{
huff_node *tree_top[256]; /* an array of 256 pointers that always holds top of the tree */
huff_node *root_node; /* the root of the tree */
huff_node *c_node; /* current node pointer */
unsigned int g=1024; /* index in curr_block to start of compressed data */
unsigned int f=0; /* index in the out_block to the uncompressed data */
unsigned int header[256]; /* the huffman header */
unsigned char c_bit; /* current bit */
/* read in the header */
memcpy(header, curr_block, sizeof(header));
/* build tree */
root_node = huff_build_tree(header, tree_top, DACT_BLK_SIZE);
/* Start at the root node. If a nodes parent is NULL we have traversed
the tree from bottom to top and decoded the huffman code
*/
bit_buffer_purge();
while(1) {
c_node = root_node;
while (c_node->right_parent != NULL) {
if(bit_buffer_size() == 0)
bit_buffer_write(curr_block[g++],8);
c_bit = bit_buffer_read(1);
if( c_bit == 0) {
c_node = c_node->right_parent;
} else {
c_node = c_node->left_parent;
}
}
out_block[f++] = c_node->value;
if (f == DACT_BLK_SIZE) break;
}
/* destroy tree */
tree_free(root_node);
return f;
}
huff_node *huff_build_tree(int header[256], huff_node *tree_top[256], int blk_size)
{
signed int i, t;
huff_node *curr_nodes[256]; /* this one hold pointers to the current level of the tree */
huff_node *tmp_node; /* a temporary node pointer ... */
unsigned int count;
unsigned int small, small2;
/*initialise the tree top and the current level on the tree */
for( i=0; i<256; i++) {
tree_top[i] = new_huff_node(header[i], NULL, NULL, i);
curr_nodes[i] = tree_top[i];
}
/* go down each level -
*/
for( i=255; i>0; i--) {
small=0;
small2=i;
for( t=0; t<i; t++) {
if(curr_nodes[t]->count <= curr_nodes[small]->count) {
small=t;
}
}
for( t=0; t<=i; t++) {
if(curr_nodes[t]->count <= curr_nodes[small2]->count) {
if (t != small) {
small2=t;
}
}
}
/* now make that node */
count = curr_nodes[small]->count + curr_nodes[small2]->count;
tmp_node = new_huff_node(count, curr_nodes[small], curr_nodes[small2], 0);
curr_nodes[small]->child = curr_nodes[small2]->child = tmp_node;
/* curr_nodes holds the current level and we're moving down
one so there's one less node - the 2 we added together are no longer in the curr_nodes
the new node we created is
*/
if(small2 == i) {
curr_nodes[small]=tmp_node;
} else if(small == i) {
curr_nodes[small2]=tmp_node;
} else {
curr_nodes[small]=curr_nodes[i];
curr_nodes[small2]=tmp_node;
}
}
/* tmp_node is now the root node */
return tmp_node;
}
void huff_build_dict(huff_node *root_node, huff_node *tree_top[256], huff_dict_entry *dictionary[256])
{
int i;
huff_node *tmp_node; /* a temporary node pointer ... */
huff_node *c_node; /* current node pointer */
for( i=0; i<256; i++)
dictionary[i] = new_huff_dict_entry();
/* Now to build the dictionary */
for( i=0; i<256; i++) {
c_node = tree_top[i];
while (c_node != root_node) {
tmp_node = c_node;
c_node = c_node->child;
/* ok where did we come from? if its left its a 1
if it's right a 0
*/
if( c_node->right_parent == tmp_node ) {
huff_dict_write_bit(dictionary[i],0);
} else {
huff_dict_write_bit(dictionary[i],1);
}
}
}
}
void dict_free(huff_dict_entry *dictionary[256])
{
unsigned int i;
for( i=0; i<256; i++)
free(dictionary[i]);
}
void tree_free(huff_node *root)
{
if( root != NULL ) {
tree_free(root->left_parent);
tree_free(root->right_parent);
free(root);
}
fflush(stdout);
}
|
Added work/contrib/huff/comp_huff.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
#ifndef _COMP_HUFF_H
#define _COMP_HUFF_H
typedef struct _huff_node huff_node;
typedef struct _huff_dict_entry huff_dict_entry;
struct _huff_node
{
huff_node *child;
huff_node *left_parent;
huff_node *right_parent;
long long count;
unsigned char value;
};
/* Am I on crack ? 256 ints to hold 256 BITS ??. Err no. I used to use
32 chars (256bits) for this and some bit manipulation but it was realllllly
slow. Since this gets called a LOT it's not a big deal to use 1k of mem
to hold a dictionary :)
*/
struct _huff_dict_entry
{
unsigned char bits;
unsigned int entry[256];
};
/* comp_huff.c */
huff_node *new_huff_node(unsigned int count, huff_node *left, huff_node *right, unsigned char value);
huff_dict_entry *new_huff_dict_entry(void);
void huff_dict_write_bit(huff_dict_entry *to_mod, unsigned char bit_to_add);
void huff_write_out(huff_dict_entry *to_write, char *out_block, unsigned int *g);
int comp_huff_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
int huff_node_qsort_compare(huff_node **a, huff_node **b);
int comp_huff_compress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
int comp_huff_decompress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
huff_node *huff_build_tree(int header[256], huff_node *tree_top[256], int blk_size);
void huff_build_dict(huff_node *root_node, huff_node *tree_top[256], huff_dict_entry *dictionary[256]);
void dict_free(huff_dict_entry *dictionary[256]);
void tree_free(huff_node *root);
/* comp_huff_adaptive.c */
int comp_huff_adaptive_algo(int mode, unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
int comp_huff_adaptive_compress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
int comp_huff_adaptive_decompress(unsigned char *prev_block, unsigned char *curr_block, char *out_block, int blk_size);
#endif
|
Added work/contrib/ll/Makefile.
|
|
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
|
CC = gcc
CFLAGS = -I../../ -Wall
ll: ll.o ../../linklist.o
../../linklist.o: ../../linklist.c
ll.o: ll.c
clean:
rm ../../linklist.o ll.o
|
Added work/contrib/ll/ll.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include "linklist.h"
int main(void) {
struct linklist_info *joe;
joe=linklist_init(LINKLIST_TYPE_DOUBLE);
linklist_add(joe, LINKLIST_MODE_APPEND);
printf("%s\n",joe->link_curr);
printf("%i\n",joe->link_cnt);
return(0);
}
|
Added work/contrib/lzo/lzo-1.08.tar.gz.
cannot compute difference between binary files
Added work/contrib/lzo/lzo-1.08/AUTHORS.
|
|
>
>
>
|
1
2
3
|
Authors of LZO:
Markus F.X.J. Oberhumer. Invented, designed and implemented LZO.
|
Added work/contrib/lzo/lzo-1.08/B/00README.TXT.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
Simple make drivers for DOS, Windows, OS/2 and other systems
============================================================
This directory contains a bunch of simple make drivers - I've tried
to make them as foolproof as possible.
To build LZO for your system type `b\OS\COMPILER' in the base directory,
e.g. `b\win32\mc120.bat' will build the Win32 Microsoft C v12.0 (aka
Visual C++ 6) version.
After building do a basic test by running `ltest -mlzo COPYING'.
util\check.sh is an example of a more thorough test driver.
Please send me your additional/improved versions.
Overview:
---------
b\dos16\bc40.bat Borland C 4.0
b\dos16\dmc.bat Digital Mars C/C++ 8.28
b\dos16\mc70.bat Microsoft C 7.0
b\dos16\mc80.bat Microsoft C 8.0 Visual C 1.5
b\dos16\wc105.bat Watcom C 10.5
b\dos32\dj1.bat djgpp v1 + gcc 2.6.3 (1)
b\dos32\dj2.bat djgpp v2 + gcc (1)
b\dos32\dmc.bat Digital Mars C/C++ 8.28
b\dos32\emx.bat emx + gcc (1)
b\dos32\wc105.bat Watcom C 10.5 (1)
b\os2\emx_aout.cmd emx A.OUT + gcc (1) (3)
b\os2\wc105.cmd Watcom C 10.5 (1) (3)
b\palmos\gcc_lib.sh gcc 2.7.2 cross-compiler
b\tos\gcc258.g gcc 2.5.8
b\tos\pc.prj Pure C 1.0 (Sep 20 1991)
b\win16\wc105.bat Watcom C 10.5
b\win16\wc105dll.bat Watcom C 10.5 DLL
b\win32\bc55.bat Borland C 5.5.1
b\win32\dmc.bat Digital Mars C/C++ 8.28 (1)
b\win32\cygwin.bat Cygnus Win32 + gcc (1)
b\win32\mc120.bat Microsoft C 12.0 Visual C 6.0 (2)
b\win32\mc120dll.bat Microsoft C 12.0 DLL
b\win32\mingw.bat Mingw32 + gcc (1)
b\win32\wc105.bat Watcom C 10.5 (1)
b\win32\wc105dll.bat Watcom C 10.5 DLL
Notes:
(1) includes support for i386 assembler versions
(2) you need MASM (or another assembler) for the assembler versions
(3) not tested as of version 1.08
Useful tools
============
GNU make, GNU fileutils for DOS / Windows 3.1 / Windows 95/98/ME:
ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/
GNU make, GNU fileutils for Windows NT/2000
ftp://ftp.cygnus.com
GNU make, GNU fileutils for OS2
ftp://hobbes.nmsu.edu/pub/os2/
GNU make, GNU fileutils, gulam, MiNT for TOS (Atari ST)
http://www.freemint.de
ftp://archive.umich.edu
nasm assembler
ftp://ftp.simtel.net/pub/simtelnet/asmutl/
ftp://sunsite.unc.edu/pub/Linux/devel/lang/assemblers/
|
Added work/contrib/lzo/lzo-1.08/B/autoconf.opt.
|
|
>
>
>
|
1
2
3
|
-I.
-DHAVE_CONFIG_H
-DLZO_HAVE_CONFIG_H
|
Added work/contrib/lzo/lzo-1.08/B/clean.bat.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
|
@echo off
set RM=rm -f
%RM% *.err *.map *.o *.obj *.tds
%RM% src\i386\d_asm3\*.obj
%RM% liblzo.a lzo.dll lzo.exp lzo.lib
%RM% ltest.exe
%RM% dict.exe lpack.exe overlap.exe precomp.exe precomp2.exe simple.exe
%RM% align.exe chksum.exe
%RM% testmini.exe
|
Added work/contrib/lzo/lzo-1.08/B/dos16/bc40.bat.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
rem /* DOS 16 bit - Borland C 4.0
rem * a very simple make driver
rem * Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
rem */
@if "%LZO_ECHO%"=="n" echo off
set CC=bcc -ml
set CFLAGS=-Iinclude -h- -d -O -w -4
REM set CFLAGS=%CFLAGS% -Ff -D__LZO_STRICT_16BIT
set MYLIB=lzo.lib
echo Compiling, please be patient...
%CC% %CFLAGS% -DLZO_BUILD -Isrc -c src\*.c
@if errorlevel 1 goto error
if exist %MYLIB% del %MYLIB%
tlib %MYLIB% @b\dos16\bc40.rsp
@if errorlevel 1 goto error
%CC% %CFLAGS% -Iltest ltest\ltest.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Iexamples examples\simple.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc tests\align.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc tests\chksum.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Iminilzo -etestmini.exe minilzo\*.c
@if errorlevel 1 goto error
@echo Done.
@goto end
:error
echo error!
:end
@call b\unset.bat
|
Added work/contrib/lzo/lzo-1.08/B/dos16/bc40.rsp.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
+alloc.obj &
+io.obj &
+lzo1.obj &
+lzo1_99.obj &
+lzo1a.obj &
+lzo1a_99.obj &
+lzo1b_1.obj &
+lzo1b_2.obj &
+lzo1b_3.obj &
+lzo1b_4.obj &
+lzo1b_5.obj &
+lzo1b_6.obj &
+lzo1b_7.obj &
+lzo1b_8.obj &
+lzo1b_9.obj &
+lzo1b_99.obj &
+lzo1b_9x.obj &
+lzo1b_cc.obj &
+lzo1b_d1.obj &
+lzo1b_d2.obj &
+lzo1b_rr.obj &
+lzo1b_xx.obj &
+lzo1c_1.obj &
+lzo1c_2.obj &
+lzo1c_3.obj &
+lzo1c_4.obj &
+lzo1c_5.obj &
+lzo1c_6.obj &
+lzo1c_7.obj &
+lzo1c_8.obj &
+lzo1c_9.obj &
+lzo1c_99.obj &
+lzo1c_9x.obj &
+lzo1c_cc.obj &
+lzo1c_d1.obj &
+lzo1c_d2.obj &
+lzo1c_rr.obj &
+lzo1c_xx.obj &
+lzo1f_1.obj &
+lzo1f_9x.obj &
+lzo1f_d1.obj &
+lzo1f_d2.obj &
+lzo1x_1.obj &
+lzo1x_1k.obj &
+lzo1x_1l.obj &
+lzo1x_1o.obj &
+lzo1x_9x.obj &
+lzo1x_d1.obj &
+lzo1x_d2.obj &
+lzo1x_d3.obj &
+lzo1x_o.obj &
+lzo1y_1.obj &
+lzo1y_9x.obj &
+lzo1y_d1.obj &
+lzo1y_d2.obj &
+lzo1y_d3.obj &
+lzo1y_o.obj &
+lzo1z_9x.obj &
+lzo1z_d1.obj &
+lzo1z_d2.obj &
+lzo1z_d3.obj &
+lzo2a_9x.obj &
+lzo2a_d1.obj &
+lzo2a_d2.obj &
+lzo_crc.obj &
+lzo_dll.obj &
+lzo_init.obj &
+lzo_ptr.obj &
+lzo_str.obj &
+lzo_util.obj
|
Added work/contrib/lzo/lzo-1.08/B/dos16/dmc.bat.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
rem /* DOS 16 bit - Digital Mars C/C++ 8.28
rem * a very simple make driver
rem * Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
rem */
@if "%LZO_ECHO%"=="n" echo off
set CC=sc -ml
set CFLAGS=-Iinclude -o -w-
REM set CFLAGS=%CFLAGS% -D__LZO_STRICT_16BIT
set MYLIB=lzo.lib
echo Compiling, please be patient...
for %%i in (src\*.c) do %CC% %CFLAGS% -DLZO_BUILD -c %%i
@if errorlevel 1 goto error
if exist %MYLIB% del %MYLIB%
lib %MYLIB% /b /c /n /noi @b\dos16\dmc.rsp
@if errorlevel 1 goto error
%CC% %CFLAGS% -Iltest ltest\ltest.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Iexamples examples\simple.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc tests\align.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc tests\chksum.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Iminilzo -otestmini.exe minilzo\testmini.c minilzo\minilzo.c
@if errorlevel 1 goto error
@echo Done.
@goto end
:error
echo error!
:end
@call b\unset.bat
|
Added work/contrib/lzo/lzo-1.08/B/dos16/dmc.rsp.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
+alloc.obj &
+io.obj &
+lzo1.obj &
+lzo1_99.obj &
+lzo1a.obj &
+lzo1a_99.obj &
+lzo1b_1.obj &
+lzo1b_2.obj &
+lzo1b_3.obj &
+lzo1b_4.obj &
+lzo1b_5.obj &
+lzo1b_6.obj &
+lzo1b_7.obj &
+lzo1b_8.obj &
+lzo1b_9.obj &
+lzo1b_99.obj &
+lzo1b_9x.obj &
+lzo1b_cc.obj &
+lzo1b_d1.obj &
+lzo1b_d2.obj &
+lzo1b_rr.obj &
+lzo1b_xx.obj &
+lzo1c_1.obj &
+lzo1c_2.obj &
+lzo1c_3.obj &
+lzo1c_4.obj &
+lzo1c_5.obj &
+lzo1c_6.obj &
+lzo1c_7.obj &
+lzo1c_8.obj &
+lzo1c_9.obj &
+lzo1c_99.obj &
+lzo1c_9x.obj &
+lzo1c_cc.obj &
+lzo1c_d1.obj &
+lzo1c_d2.obj &
+lzo1c_rr.obj &
+lzo1c_xx.obj &
+lzo1f_1.obj &
+lzo1f_9x.obj &
+lzo1f_d1.obj &
+lzo1f_d2.obj &
+lzo1x_1.obj &
+lzo1x_1k.obj &
+lzo1x_1l.obj &
+lzo1x_1o.obj &
+lzo1x_9x.obj &
+lzo1x_d1.obj &
+lzo1x_d2.obj &
+lzo1x_d3.obj &
+lzo1x_o.obj &
+lzo1y_1.obj &
+lzo1y_9x.obj &
+lzo1y_d1.obj &
+lzo1y_d2.obj &
+lzo1y_d3.obj &
+lzo1y_o.obj &
+lzo1z_9x.obj &
+lzo1z_d1.obj &
+lzo1z_d2.obj &
+lzo1z_d3.obj &
+lzo2a_9x.obj &
+lzo2a_d1.obj &
+lzo2a_d2.obj &
+lzo_crc.obj &
+lzo_dll.obj &
+lzo_init.obj &
+lzo_ptr.obj &
+lzo_str.obj &
+lzo_util.obj
|
Added work/contrib/lzo/lzo-1.08/B/dos16/mc70.bat.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
rem /* DOS 16 bit - Microsoft C 7.0
rem * a very simple make driver
rem * Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
rem */
@if "%LZO_ECHO%"=="n" echo off
set CC=cl -nologo -f- -AL
set CFLAGS=-Iinclude -O -G2 -W3
REM set CFLAGS=%CFLAGS% -D__LZO_STRICT_16BIT
set MYLIB=lzo.lib
echo Compiling, please be patient...
%CC% %CFLAGS% -DLZO_BUILD -c src\*.c
@if errorlevel 1 goto error
if exist %MYLIB% del %MYLIB%
lib /nologo %MYLIB% @b\dos16\mc70.rsp;
@if errorlevel 1 goto error
%CC% %CFLAGS% ltest\ltest.c %MYLIB% setargv.obj
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\lpack.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\overlap.c %MYLIB% setargv.obj
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\simple.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc tests\align.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc tests\chksum.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Fetestmini.exe minilzo\*.c
@if errorlevel 1 goto error
@echo Done.
@goto end
:error
echo error!
:end
@call b\unset.bat
|
Added work/contrib/lzo/lzo-1.08/B/dos16/mc70.rsp.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
+alloc.obj &
+io.obj &
+lzo1.obj &
+lzo1_99.obj &
+lzo1a.obj &
+lzo1a_99.obj &
+lzo1b_1.obj &
+lzo1b_2.obj &
+lzo1b_3.obj &
+lzo1b_4.obj &
+lzo1b_5.obj &
+lzo1b_6.obj &
+lzo1b_7.obj &
+lzo1b_8.obj &
+lzo1b_9.obj &
+lzo1b_99.obj &
+lzo1b_9x.obj &
+lzo1b_cc.obj &
+lzo1b_d1.obj &
+lzo1b_d2.obj &
+lzo1b_rr.obj &
+lzo1b_xx.obj &
+lzo1c_1.obj &
+lzo1c_2.obj &
+lzo1c_3.obj &
+lzo1c_4.obj &
+lzo1c_5.obj &
+lzo1c_6.obj &
+lzo1c_7.obj &
+lzo1c_8.obj &
+lzo1c_9.obj &
+lzo1c_99.obj &
+lzo1c_9x.obj &
+lzo1c_cc.obj &
+lzo1c_d1.obj &
+lzo1c_d2.obj &
+lzo1c_rr.obj &
+lzo1c_xx.obj &
+lzo1f_1.obj &
+lzo1f_9x.obj &
+lzo1f_d1.obj &
+lzo1f_d2.obj &
+lzo1x_1.obj &
+lzo1x_1k.obj &
+lzo1x_1l.obj &
+lzo1x_1o.obj &
+lzo1x_9x.obj &
+lzo1x_d1.obj &
+lzo1x_d2.obj &
+lzo1x_d3.obj &
+lzo1x_o.obj &
+lzo1y_1.obj &
+lzo1y_9x.obj &
+lzo1y_d1.obj &
+lzo1y_d2.obj &
+lzo1y_d3.obj &
+lzo1y_o.obj &
+lzo1z_9x.obj &
+lzo1z_d1.obj &
+lzo1z_d2.obj &
+lzo1z_d3.obj &
+lzo2a_9x.obj &
+lzo2a_d1.obj &
+lzo2a_d2.obj &
+lzo_crc.obj &
+lzo_dll.obj &
+lzo_init.obj &
+lzo_ptr.obj &
+lzo_str.obj &
+lzo_util.obj
|
Added work/contrib/lzo/lzo-1.08/B/dos16/mc80.bat.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
rem /* DOS 16 bit - Microsoft C 8.0 (Visual C 1.5)
rem * a very simple make driver
rem * Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
rem */
@if "%LZO_ECHO%"=="n" echo off
set CC=cl -nologo -AL
set CFLAGS=-Iinclude -O2 -G2 -W3
REM set CFLAGS=%CFLAGS% -D__LZO_STRICT_16BIT
set MYLIB=lzo.lib
echo Compiling, please be patient...
%CC% %CFLAGS% -DLZO_BUILD -c src\*.c
@if errorlevel 1 goto error
if exist %MYLIB% del %MYLIB%
lib /nologo %MYLIB% @b\dos16\mc70.rsp;
@if errorlevel 1 goto error
%CC% %CFLAGS% ltest\ltest.c %MYLIB% setargv.obj /link /NOE
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\lpack.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\overlap.c %MYLIB% setargv.obj /link /NOE
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\simple.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc tests\align.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc tests\chksum.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Fetestmini.exe minilzo\*.c
@if errorlevel 1 goto error
@echo Done.
@goto end
:error
echo error!
:end
@call b\unset.bat
|
Added work/contrib/lzo/lzo-1.08/B/dos16/wc105.bat.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
rem /* DOS 16 bit - Watcom C 10.5
rem * a very simple make driver
rem * Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
rem */
@if "%LZO_ECHO%"=="n" echo off
set _CC=wcl -zq -ml -5 -bt#dos
set CFLAGS=-Iinclude -wx -oneatx
REM set CFLAGS=%CFLAGS% -D__LZO_STRICT_16BIT
set MYLIB=lzo.lib
echo Compiling, please be patient...
set CC=%_CC%
%CC% %CFLAGS% -DLZO_BUILD -zc -c src\*.c
@if errorlevel 1 goto error
if exist %MYLIB% del %MYLIB%
wlib -q -b -n -t %MYLIB% @b\dos16\wc105.rsp
@if errorlevel 1 goto error
set CC=%_CC% -zc -l#dos
%CC% %CFLAGS% ltest\ltest.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\lpack.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\overlap.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\simple.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc tests\align.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc tests\chksum.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -fe#testmini.exe minilzo\*.c
@if errorlevel 1 goto error
@echo Done.
@goto end
:error
echo error!
:end
@call b\unset.bat
|
Added work/contrib/lzo/lzo-1.08/B/dos16/wc105.rsp.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
+'alloc.obj'
+'io.obj'
+'lzo1.obj'
+'lzo1_99.obj'
+'lzo1a.obj'
+'lzo1a_99.obj'
+'lzo1b_1.obj'
+'lzo1b_2.obj'
+'lzo1b_3.obj'
+'lzo1b_4.obj'
+'lzo1b_5.obj'
+'lzo1b_6.obj'
+'lzo1b_7.obj'
+'lzo1b_8.obj'
+'lzo1b_9.obj'
+'lzo1b_99.obj'
+'lzo1b_9x.obj'
+'lzo1b_cc.obj'
+'lzo1b_d1.obj'
+'lzo1b_d2.obj'
+'lzo1b_rr.obj'
+'lzo1b_xx.obj'
+'lzo1c_1.obj'
+'lzo1c_2.obj'
+'lzo1c_3.obj'
+'lzo1c_4.obj'
+'lzo1c_5.obj'
+'lzo1c_6.obj'
+'lzo1c_7.obj'
+'lzo1c_8.obj'
+'lzo1c_9.obj'
+'lzo1c_99.obj'
+'lzo1c_9x.obj'
+'lzo1c_cc.obj'
+'lzo1c_d1.obj'
+'lzo1c_d2.obj'
+'lzo1c_rr.obj'
+'lzo1c_xx.obj'
+'lzo1f_1.obj'
+'lzo1f_9x.obj'
+'lzo1f_d1.obj'
+'lzo1f_d2.obj'
+'lzo1x_1.obj'
+'lzo1x_1k.obj'
+'lzo1x_1l.obj'
+'lzo1x_1o.obj'
+'lzo1x_9x.obj'
+'lzo1x_d1.obj'
+'lzo1x_d2.obj'
+'lzo1x_d3.obj'
+'lzo1x_o.obj'
+'lzo1y_1.obj'
+'lzo1y_9x.obj'
+'lzo1y_d1.obj'
+'lzo1y_d2.obj'
+'lzo1y_d3.obj'
+'lzo1y_o.obj'
+'lzo1z_9x.obj'
+'lzo1z_d1.obj'
+'lzo1z_d2.obj'
+'lzo1z_d3.obj'
+'lzo2a_9x.obj'
+'lzo2a_d1.obj'
+'lzo2a_d2.obj'
+'lzo_crc.obj'
+'lzo_dll.obj'
+'lzo_init.obj'
+'lzo_ptr.obj'
+'lzo_str.obj'
+'lzo_util.obj'
|
Added work/contrib/lzo/lzo-1.08/B/dos32/dj1.bat.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
rem /* DOS 32 bit - gcc 2.6.3 (djgpp v1)
rem * a very simple make driver
rem * Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
rem */
@if "%LZO_ECHO%"=="n" echo off
set EXTRA_CFLAGS=
set CC=gcc
set CFLAGS=@b\gcc.opt @b\dos32\dj1.opt @b\gcc_lzo.opt %EXTRA_CFLAGS%
set ASFLAGS=-x assembler-with-cpp -Wall
set MYLIB=liblzo.a
echo Compiling, please be patient...
%CC% %CFLAGS% -DLZO_BUILD -Isrc -c src\*.c
@if errorlevel 1 goto error
%CC% %ASFLAGS% -DLZO_BUILD -Isrc/i386/src -c src\i386\src\*.s
@if errorlevel 1 goto error
if exist %MYLIB% del %MYLIB%
ar rcs %MYLIB% @b\dos32\dj1.rsp
@if errorlevel 1 goto error
set CFLAGS=@b\gcc.opt @b\dos32\dj1.opt %EXTRA_CFLAGS%
%CC% -s %CFLAGS% -Iltest ltest\ltest.c %MYLIB% -o ltest.out
@if errorlevel 1 goto error
coff2exe ltest.out
%CC% -s %CFLAGS% examples\dict.c %MYLIB% -o dict.out
@if errorlevel 1 goto error
coff2exe dict.out
%CC% -s %CFLAGS% examples\lpack.c %MYLIB% -o lpack.out
@if errorlevel 1 goto error
coff2exe lpack.out
%CC% -s %CFLAGS% examples\overlap.c %MYLIB% -o overlap.out
@if errorlevel 1 goto error
coff2exe overlap.out
%CC% -s %CFLAGS% examples\precomp.c %MYLIB% -o precomp.out
@if errorlevel 1 goto error
coff2exe precomp.out
%CC% -s %CFLAGS% examples\precomp2.c %MYLIB% -o precomp2.out
@if errorlevel 1 goto error
coff2exe precomp2.out
%CC% -s %CFLAGS% examples\simple.c %MYLIB% -o simple.out
@if errorlevel 1 goto error
coff2exe simple.out
%CC% -s %CFLAGS% -Isrc tests\align.c %MYLIB% -o align.out
@if errorlevel 1 goto error
coff2exe align.out
%CC% -s %CFLAGS% -Isrc tests\chksum.c %MYLIB% -o chksum.out
@if errorlevel 1 goto error
coff2exe chksum.out
set CFLAGS=@b\gcc.opt @b\dos32\dj1.opt @b\gcc_lzo.opt %EXTRA_CFLAGS%
%CC% -s %CFLAGS% -Iminilzo minilzo\*.c -o testmini.out
@if errorlevel 1 goto error
coff2exe testmini.out
@echo Done.
@goto end
:error
echo error!
:end
@call b\unset.bat
|
Added work/contrib/lzo/lzo-1.08/B/dos32/dj1.opt.
|
|
>
>
>
>
|
1
2
3
4
|
-W
-pedantic
-fforce-addr
-fno-strength-reduce
|
Added work/contrib/lzo/lzo-1.08/B/dos32/dj1.rsp.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
alloc.o
io.o
lzo1.o
lzo1_99.o
lzo1a.o
lzo1a_99.o
lzo1b_1.o
lzo1b_2.o
lzo1b_3.o
lzo1b_4.o
lzo1b_5.o
lzo1b_6.o
lzo1b_7.o
lzo1b_8.o
lzo1b_9.o
lzo1b_99.o
lzo1b_9x.o
lzo1b_cc.o
lzo1b_d1.o
lzo1b_d2.o
lzo1b_rr.o
lzo1b_xx.o
lzo1c_1.o
lzo1c_2.o
lzo1c_3.o
lzo1c_4.o
lzo1c_5.o
lzo1c_6.o
lzo1c_7.o
lzo1c_8.o
lzo1c_9.o
lzo1c_99.o
lzo1c_9x.o
lzo1c_cc.o
lzo1c_d1.o
lzo1c_d2.o
lzo1c_rr.o
lzo1c_xx.o
lzo1f_1.o
lzo1f_9x.o
lzo1f_d1.o
lzo1f_d2.o
lzo1x_1.o
lzo1x_1k.o
lzo1x_1l.o
lzo1x_1o.o
lzo1x_9x.o
lzo1x_d1.o
lzo1x_d2.o
lzo1x_d3.o
lzo1x_o.o
lzo1y_1.o
lzo1y_9x.o
lzo1y_d1.o
lzo1y_d2.o
lzo1y_d3.o
lzo1y_o.o
lzo1z_9x.o
lzo1z_d1.o
lzo1z_d2.o
lzo1z_d3.o
lzo2a_9x.o
lzo2a_d1.o
lzo2a_d2.o
lzo_crc.o
lzo_dll.o
lzo_init.o
lzo_ptr.o
lzo_str.o
lzo_util.o
lzo1c_s1.o
lzo1c_s2.o
lzo1f_f1.o
lzo1f_f2.o
lzo1x_f1.o
lzo1x_f2.o
lzo1x_s1.o
lzo1x_s2.o
lzo1y_f1.o
lzo1y_f2.o
lzo1y_s1.o
lzo1y_s2.o
|
Added work/contrib/lzo/lzo-1.08/B/dos32/dj2.bat.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
rem /* DOS 32 bit - gcc (djgpp v2)
rem * a very simple make driver
rem * Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
rem */
@if "%LZO_ECHO%"=="n" echo off
set EXTRA_CFLAGS=
set CC=gcc
set CFLAGS=@b/gcc.opt @b/dos32/dj2.opt @b/gcc_lzo.opt %EXTRA_CFLAGS%
set ASFLAGS=-x assembler-with-cpp -Wall
set MYLIB=liblzo.a
echo Compiling, please be patient...
%CC% %CFLAGS% -DLZO_BUILD -c src/*.c
@if errorlevel 1 goto error
%CC% %ASFLAGS% -DLZO_BUILD -c src/i386/src/*.s
@if errorlevel 1 goto error
if exist %MYLIB% del %MYLIB%
ar rcs %MYLIB% @b/dos32/dj2.rsp
@if errorlevel 1 goto error
set CFLAGS=@b/gcc.opt @b/dos32/dj2.opt %EXTRA_CFLAGS%
%CC% -s %CFLAGS% ltest/ltest.c %MYLIB% -o ltest.exe
@if errorlevel 1 goto error
%CC% -s %CFLAGS% examples/dict.c %MYLIB% -o dict.exe
@if errorlevel 1 goto error
%CC% -s %CFLAGS% examples/lpack.c %MYLIB% -o lpack.exe
@if errorlevel 1 goto error
%CC% -s %CFLAGS% examples/overlap.c %MYLIB% -o overlap.exe
@if errorlevel 1 goto error
%CC% -s %CFLAGS% examples/precomp.c %MYLIB% -o precomp.exe
@if errorlevel 1 goto error
%CC% -s %CFLAGS% examples/precomp2.c %MYLIB% -o precomp2.exe
@if errorlevel 1 goto error
%CC% -s %CFLAGS% examples/simple.c %MYLIB% -o simple.exe
@if errorlevel 1 goto error
%CC% -s %CFLAGS% -Isrc tests/align.c %MYLIB% -o align.exe
@if errorlevel 1 goto error
%CC% -s %CFLAGS% -Isrc tests/chksum.c %MYLIB% -o chksum.exe
@if errorlevel 1 goto error
set CFLAGS=@b/gcc.opt @b/dos32/dj2.opt @b/gcc_lzo.opt %EXTRA_CFLAGS%
%CC% -s %CFLAGS% minilzo/*.c -o testmini.exe
@if errorlevel 1 goto error
@echo Done.
@goto end
:error
echo error!
:end
@call b\unset.bat
|
Added work/contrib/lzo/lzo-1.08/B/dos32/dj2.opt.
|
|
>
>
>
>
>
>
|
1
2
3
4
5
6
|
-Wp,-lang-c89
-W
-pedantic
-fforce-addr
-fomit-frame-pointer
-fno-strength-reduce
|
Added work/contrib/lzo/lzo-1.08/B/dos32/dj2.rsp.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
alloc.o
io.o
lzo1.o
lzo1_99.o
lzo1a.o
lzo1a_99.o
lzo1b_1.o
lzo1b_2.o
lzo1b_3.o
lzo1b_4.o
lzo1b_5.o
lzo1b_6.o
lzo1b_7.o
lzo1b_8.o
lzo1b_9.o
lzo1b_99.o
lzo1b_9x.o
lzo1b_cc.o
lzo1b_d1.o
lzo1b_d2.o
lzo1b_rr.o
lzo1b_xx.o
lzo1c_1.o
lzo1c_2.o
lzo1c_3.o
lzo1c_4.o
lzo1c_5.o
lzo1c_6.o
lzo1c_7.o
lzo1c_8.o
lzo1c_9.o
lzo1c_99.o
lzo1c_9x.o
lzo1c_cc.o
lzo1c_d1.o
lzo1c_d2.o
lzo1c_rr.o
lzo1c_xx.o
lzo1f_1.o
lzo1f_9x.o
lzo1f_d1.o
lzo1f_d2.o
lzo1x_1.o
lzo1x_1k.o
lzo1x_1l.o
lzo1x_1o.o
lzo1x_9x.o
lzo1x_d1.o
lzo1x_d2.o
lzo1x_d3.o
lzo1x_o.o
lzo1y_1.o
lzo1y_9x.o
lzo1y_d1.o
lzo1y_d2.o
lzo1y_d3.o
lzo1y_o.o
lzo1z_9x.o
lzo1z_d1.o
lzo1z_d2.o
lzo1z_d3.o
lzo2a_9x.o
lzo2a_d1.o
lzo2a_d2.o
lzo_crc.o
lzo_dll.o
lzo_init.o
lzo_ptr.o
lzo_str.o
lzo_util.o
lzo1c_s1.o
lzo1c_s2.o
lzo1f_f1.o
lzo1f_f2.o
lzo1x_f1.o
lzo1x_f2.o
lzo1x_s1.o
lzo1x_s2.o
lzo1y_f1.o
lzo1y_f2.o
lzo1y_s1.o
lzo1y_s2.o
|
Added work/contrib/lzo/lzo-1.08/B/dos32/dmc.bat.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
rem /* DOS 32 bit - Digital Mars C/C++
rem * a very simple make driver
rem * Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
rem */
@if "%LZO_ECHO%"=="n" echo off
set CC=sc -mx
set CFLAGS=-Iinclude -o -w-
set MYLIB=lzo.lib
echo Compiling, please be patient...
for %%i in (src\*.c) do %CC% %CFLAGS% -c %%i
@if errorlevel 1 goto error
if exist %MYLIB% del %MYLIB%
lib %MYLIB% /b /c /n /noi @b\dos32\dmc.rsp
@if errorlevel 1 goto error
%CC% %CFLAGS% -Iltest ltest\ltest.c %MYLIB% x32.lib
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\dict.c %MYLIB% x32.lib
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\lpack.c %MYLIB% x32.lib
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\overlap.c %MYLIB% x32.lib
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\precomp.c %MYLIB% x32.lib
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\precomp2.c %MYLIB% x32.lib
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\simple.c %MYLIB% x32.lib
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc tests\align.c %MYLIB% x32.lib
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc tests\chksum.c %MYLIB% x32.lib
@if errorlevel 1 goto error
%CC% %CFLAGS% -Iminilzo -otestmini.exe minilzo\testmini.c minilzo\minilzo.c
@if errorlevel 1 goto error
@echo Done.
@goto end
:error
echo error!
:end
@call b\unset.bat
|
Added work/contrib/lzo/lzo-1.08/B/dos32/dmc.rsp.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
+alloc.obj &
+io.obj &
+lzo1.obj &
+lzo1_99.obj &
+lzo1a.obj &
+lzo1a_99.obj &
+lzo1b_1.obj &
+lzo1b_2.obj &
+lzo1b_3.obj &
+lzo1b_4.obj &
+lzo1b_5.obj &
+lzo1b_6.obj &
+lzo1b_7.obj &
+lzo1b_8.obj &
+lzo1b_9.obj &
+lzo1b_99.obj &
+lzo1b_9x.obj &
+lzo1b_cc.obj &
+lzo1b_d1.obj &
+lzo1b_d2.obj &
+lzo1b_rr.obj &
+lzo1b_xx.obj &
+lzo1c_1.obj &
+lzo1c_2.obj &
+lzo1c_3.obj &
+lzo1c_4.obj &
+lzo1c_5.obj &
+lzo1c_6.obj &
+lzo1c_7.obj &
+lzo1c_8.obj &
+lzo1c_9.obj &
+lzo1c_99.obj &
+lzo1c_9x.obj &
+lzo1c_cc.obj &
+lzo1c_d1.obj &
+lzo1c_d2.obj &
+lzo1c_rr.obj &
+lzo1c_xx.obj &
+lzo1f_1.obj &
+lzo1f_9x.obj &
+lzo1f_d1.obj &
+lzo1f_d2.obj &
+lzo1x_1.obj &
+lzo1x_1k.obj &
+lzo1x_1l.obj &
+lzo1x_1o.obj &
+lzo1x_9x.obj &
+lzo1x_d1.obj &
+lzo1x_d2.obj &
+lzo1x_d3.obj &
+lzo1x_o.obj &
+lzo1y_1.obj &
+lzo1y_9x.obj &
+lzo1y_d1.obj &
+lzo1y_d2.obj &
+lzo1y_d3.obj &
+lzo1y_o.obj &
+lzo1z_9x.obj &
+lzo1z_d1.obj &
+lzo1z_d2.obj &
+lzo1z_d3.obj &
+lzo2a_9x.obj &
+lzo2a_d1.obj &
+lzo2a_d2.obj &
+lzo_crc.obj &
+lzo_dll.obj &
+lzo_init.obj &
+lzo_ptr.obj &
+lzo_str.obj &
+lzo_util.obj
|
Added work/contrib/lzo/lzo-1.08/B/dos32/emx.bat.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
rem /* DOS 32 bit - gcc (emx)
rem * a very simple make driver
rem * Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
rem */
@if "%LZO_ECHO%"=="n" echo off
@rem workaround a problem with the RSX extender when running under Win95
set SAVE_LFN=%LFN%
set LFN=n
set EXTRA_CFLAGS=
REM set EXTRA_CFLAGS=-fbounds-checking
set CC=gcc
set CFLAGS=@b\gcc.opt @b\dos32\emx.opt @b\gcc_lzo.opt %EXTRA_CFLAGS%
set ASFLAGS=-x assembler-with-cpp -Wall
set MYLIB=lzo.a
echo Compiling, please be patient...
%CC% %CFLAGS% -DLZO_BUILD -c src\*.c
@if errorlevel 1 goto error
%CC% %ASFLAGS% -DLZO_BUILD -c src\i386\src\*.s
@if errorlevel 1 goto error
if exist %MYLIB% del %MYLIB%
ar rcs %MYLIB% @b\dos32\emx.rsp
@if errorlevel 1 goto error
set CFLAGS=@b\gcc.opt @b\dos32\emx.opt %EXTRA_CFLAGS%
%CC% -s %CFLAGS% ltest\ltest.c %MYLIB% -o ltest.exe
@if errorlevel 1 goto error
%CC% -s %CFLAGS% examples\dict.c %MYLIB% -o dict.exe
@if errorlevel 1 goto error
%CC% -s %CFLAGS% examples\lpack.c %MYLIB% -o lpack.exe
@if errorlevel 1 goto error
%CC% -s %CFLAGS% examples\overlap.c %MYLIB% -o overlap.exe
@if errorlevel 1 goto error
%CC% -s %CFLAGS% examples\precomp.c %MYLIB% -o precomp.exe
@if errorlevel 1 goto error
%CC% -s %CFLAGS% examples\precomp2.c %MYLIB% -o precomp2.exe
@if errorlevel 1 goto error
%CC% -s %CFLAGS% examples\simple.c %MYLIB% -o simple.exe
@if errorlevel 1 goto error
%CC% -s %CFLAGS% -Isrc tests\align.c %MYLIB% -o align.exe
@if errorlevel 1 goto error
%CC% -s %CFLAGS% -Isrc tests\chksum.c %MYLIB% -o chksum.exe
@if errorlevel 1 goto error
%CC% -s %CFLAGS% minilzo\*.c -o testmini.exe
@if errorlevel 1 goto error
@echo Done.
@goto end
:error
echo error!
:end
set LFN=%SAVE_LFN%
set SAVE_LFN=
@call b\unset.bat
|
Added work/contrib/lzo/lzo-1.08/B/dos32/emx.opt.
|
|
>
>
>
|
1
2
3
|
-Wp,-lang-c89
-fforce-addr
-fno-strength-reduce
|
Added work/contrib/lzo/lzo-1.08/B/dos32/emx.rsp.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
alloc.o
io.o
lzo1.o
lzo1_99.o
lzo1a.o
lzo1a_99.o
lzo1b_1.o
lzo1b_2.o
lzo1b_3.o
lzo1b_4.o
lzo1b_5.o
lzo1b_6.o
lzo1b_7.o
lzo1b_8.o
lzo1b_9.o
lzo1b_99.o
lzo1b_9x.o
lzo1b_cc.o
lzo1b_d1.o
lzo1b_d2.o
lzo1b_rr.o
lzo1b_xx.o
lzo1c_1.o
lzo1c_2.o
lzo1c_3.o
lzo1c_4.o
lzo1c_5.o
lzo1c_6.o
lzo1c_7.o
lzo1c_8.o
lzo1c_9.o
lzo1c_99.o
lzo1c_9x.o
lzo1c_cc.o
lzo1c_d1.o
lzo1c_d2.o
lzo1c_rr.o
lzo1c_xx.o
lzo1f_1.o
lzo1f_9x.o
lzo1f_d1.o
lzo1f_d2.o
lzo1x_1.o
lzo1x_1k.o
lzo1x_1l.o
lzo1x_1o.o
lzo1x_9x.o
lzo1x_d1.o
lzo1x_d2.o
lzo1x_d3.o
lzo1x_o.o
lzo1y_1.o
lzo1y_9x.o
lzo1y_d1.o
lzo1y_d2.o
lzo1y_d3.o
lzo1y_o.o
lzo1z_9x.o
lzo1z_d1.o
lzo1z_d2.o
lzo1z_d3.o
lzo2a_9x.o
lzo2a_d1.o
lzo2a_d2.o
lzo_crc.o
lzo_dll.o
lzo_init.o
lzo_ptr.o
lzo_str.o
lzo_util.o
lzo1c_s1.o
lzo1c_s2.o
lzo1f_f1.o
lzo1f_f2.o
lzo1x_f1.o
lzo1x_f2.o
lzo1x_s1.o
lzo1x_s2.o
lzo1y_f1.o
lzo1y_f2.o
lzo1y_s1.o
lzo1y_s2.o
|
Added work/contrib/lzo/lzo-1.08/B/dos32/wc105.bat.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
rem /* DOS 32 bit - Watcom C 10.5
rem * a very simple make driver
rem * Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
rem */
@if "%LZO_ECHO%"=="n" echo off
REM set WCGMEMORY=4096
REM set WCGMEMORY=?
set _CC=wcl386 -zq -mf -5r -bt#dos
set CFLAGS=-Iinclude -wx -oneatx
set MYLIB=lzo.lib
echo Compiling, please be patient...
set CC=%_CC%
REM set CC=%CC% -cc++
%CC% %CFLAGS% -DLZO_BUILD -zc -c src\*.c
@if errorlevel 1 goto error
%CC% -DLZO_BUILD -wx -c src\i386\d_asm2\*.asm
@if errorlevel 1 goto error
if exist %MYLIB% del %MYLIB%
wlib -q -b -n -t %MYLIB% @b\dos32\wc105.rsp
@if errorlevel 1 goto error
set CC=%_CC% -zc -l#dos4g
%CC% %CFLAGS% ltest\ltest.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\dict.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\lpack.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\overlap.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\precomp.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\precomp2.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\simple.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc tests\align.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc tests\chksum.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -fe#testmini.exe minilzo\*.c
@if errorlevel 1 goto error
@echo Done.
@goto end
:error
echo error!
:end
@call b\unset.bat
|
Added work/contrib/lzo/lzo-1.08/B/dos32/wc105.rsp.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
+'alloc.obj'
+'io.obj'
+'lzo1.obj'
+'lzo1_99.obj'
+'lzo1a.obj'
+'lzo1a_99.obj'
+'lzo1b_1.obj'
+'lzo1b_2.obj'
+'lzo1b_3.obj'
+'lzo1b_4.obj'
+'lzo1b_5.obj'
+'lzo1b_6.obj'
+'lzo1b_7.obj'
+'lzo1b_8.obj'
+'lzo1b_9.obj'
+'lzo1b_99.obj'
+'lzo1b_9x.obj'
+'lzo1b_cc.obj'
+'lzo1b_d1.obj'
+'lzo1b_d2.obj'
+'lzo1b_rr.obj'
+'lzo1b_xx.obj'
+'lzo1c_1.obj'
+'lzo1c_2.obj'
+'lzo1c_3.obj'
+'lzo1c_4.obj'
+'lzo1c_5.obj'
+'lzo1c_6.obj'
+'lzo1c_7.obj'
+'lzo1c_8.obj'
+'lzo1c_9.obj'
+'lzo1c_99.obj'
+'lzo1c_9x.obj'
+'lzo1c_cc.obj'
+'lzo1c_d1.obj'
+'lzo1c_d2.obj'
+'lzo1c_rr.obj'
+'lzo1c_xx.obj'
+'lzo1f_1.obj'
+'lzo1f_9x.obj'
+'lzo1f_d1.obj'
+'lzo1f_d2.obj'
+'lzo1x_1.obj'
+'lzo1x_1k.obj'
+'lzo1x_1l.obj'
+'lzo1x_1o.obj'
+'lzo1x_9x.obj'
+'lzo1x_d1.obj'
+'lzo1x_d2.obj'
+'lzo1x_d3.obj'
+'lzo1x_o.obj'
+'lzo1y_1.obj'
+'lzo1y_9x.obj'
+'lzo1y_d1.obj'
+'lzo1y_d2.obj'
+'lzo1y_d3.obj'
+'lzo1y_o.obj'
+'lzo1z_9x.obj'
+'lzo1z_d1.obj'
+'lzo1z_d2.obj'
+'lzo1z_d3.obj'
+'lzo2a_9x.obj'
+'lzo2a_d1.obj'
+'lzo2a_d2.obj'
+'lzo_crc.obj'
+'lzo_dll.obj'
+'lzo_init.obj'
+'lzo_ptr.obj'
+'lzo_str.obj'
+'lzo_util.obj'
+'lzo1c_s1.obj'
+'lzo1c_s2.obj'
+'lzo1f_f1.obj'
+'lzo1f_f2.obj'
+'lzo1x_f1.obj'
+'lzo1x_f2.obj'
+'lzo1x_s1.obj'
+'lzo1x_s2.obj'
+'lzo1y_f1.obj'
+'lzo1y_f2.obj'
+'lzo1y_s1.obj'
+'lzo1y_s2.obj'
|
Added work/contrib/lzo/lzo-1.08/B/gcc.opt.
|
|
>
>
>
>
>
|
1
2
3
4
5
|
-Iinclude
-Wall
-Wcast-align
-Wwrite-strings
-O2
|
Added work/contrib/lzo/lzo-1.08/B/gcc_lzo.opt.
|
|
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
|
-Wbad-function-cast
-Wcast-qual
-Wimplicit
-Wmissing-declarations
-Wmissing-prototypes
-Wnested-externs
-Wpointer-arith
-Wshadow
-Wstrict-prototypes
-Wno-uninitialized
|
Added work/contrib/lzo/lzo-1.08/B/os2/00README.TXT.
|
|
>
>
>
>
>
>
|
1
2
3
4
5
6
|
NOTE:
=====
OS/2 support is completely UNTESTED.
Please send me your build files.
|
Added work/contrib/lzo/lzo-1.08/B/os2/emx_aout.cmd.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
rem /* OS/2 32 bit - gcc 2.7.2.1 (emx 0.9c - A.OUT)
rem * a very simple make driver
rem * Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
rem */
@if "%LZO_ECHO%"=="n" echo off
set EXTRA_CFLAGS=
REM set EXTRA_CFLAGS=-fbounds-checking
set CC=gcc
set CFLAGS=@b\gcc.opt @b\os2\emx_aout.opt @b\gcc_lzo.opt %EXTRA_CFLAGS%
set ASFLAGS=-x assembler-with-cpp -Wall
set MYLIB=lzo.a
echo Compiling, please be patient...
%CC% %CFLAGS% -c src\*.c
@if errorlevel 1 goto error
%CC% %ASFLAGS% -c src\i386\src\*.s
@if errorlevel 1 goto error
if exist %MYLIB% del %MYLIB%
ar rcs %MYLIB% @b\os2\emx_aout.rsp
@if errorlevel 1 goto error
set CFLAGS=@b\gcc.opt @b\os2\emx_aout.opt %EXTRA_CFLAGS%
%CC% -s %CFLAGS% ltest\ltest.c %MYLIB% -o ltest.exe
@if errorlevel 1 goto error
%CC% -s %CFLAGS% examples\dict.c %MYLIB% -o dict.exe
@if errorlevel 1 goto error
%CC% -s %CFLAGS% examples\lpack.c %MYLIB% -o lpack.exe
@if errorlevel 1 goto error
%CC% -s %CFLAGS% examples\overlap.c %MYLIB% -o overlap.exe
@if errorlevel 1 goto error
%CC% -s %CFLAGS% examples\precomp.c %MYLIB% -o precomp.exe
@if errorlevel 1 goto error
%CC% -s %CFLAGS% examples\precomp2.c %MYLIB% -o precomp2.exe
@if errorlevel 1 goto error
%CC% -s %CFLAGS% examples\simple.c %MYLIB% -o simple.exe
@if errorlevel 1 goto error
%CC% -s %CFLAGS% -Isrc tests\align.c %MYLIB% -o align.exe
@if errorlevel 1 goto error
%CC% -s %CFLAGS% -Isrc tests\chksum.c %MYLIB% -o chksum.exe
@if errorlevel 1 goto error
%CC% -s %CFLAGS% minilzo\*.c -o testmini.exe
@if errorlevel 1 goto error
echo Done.
goto end
:error
echo error!
:end
|
Added work/contrib/lzo/lzo-1.08/B/os2/emx_aout.opt.
|
|
>
>
>
|
1
2
3
|
-Wp,-lang-c89
-fforce-addr
-fno-strength-reduce
|
Added work/contrib/lzo/lzo-1.08/B/os2/emx_aout.rsp.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
alloc.o
io.o
lzo1.o
lzo1_99.o
lzo1a.o
lzo1a_99.o
lzo1b_1.o
lzo1b_2.o
lzo1b_3.o
lzo1b_4.o
lzo1b_5.o
lzo1b_6.o
lzo1b_7.o
lzo1b_8.o
lzo1b_9.o
lzo1b_99.o
lzo1b_9x.o
lzo1b_cc.o
lzo1b_d1.o
lzo1b_d2.o
lzo1b_rr.o
lzo1b_xx.o
lzo1c_1.o
lzo1c_2.o
lzo1c_3.o
lzo1c_4.o
lzo1c_5.o
lzo1c_6.o
lzo1c_7.o
lzo1c_8.o
lzo1c_9.o
lzo1c_99.o
lzo1c_9x.o
lzo1c_cc.o
lzo1c_d1.o
lzo1c_d2.o
lzo1c_rr.o
lzo1c_xx.o
lzo1f_1.o
lzo1f_9x.o
lzo1f_d1.o
lzo1f_d2.o
lzo1x_1.o
lzo1x_1k.o
lzo1x_1l.o
lzo1x_1o.o
lzo1x_9x.o
lzo1x_d1.o
lzo1x_d2.o
lzo1x_d3.o
lzo1x_o.o
lzo1y_1.o
lzo1y_9x.o
lzo1y_d1.o
lzo1y_d2.o
lzo1y_d3.o
lzo1y_o.o
lzo1z_9x.o
lzo1z_d1.o
lzo1z_d2.o
lzo1z_d3.o
lzo2a_9x.o
lzo2a_d1.o
lzo2a_d2.o
lzo_crc.o
lzo_dll.o
lzo_init.o
lzo_ptr.o
lzo_str.o
lzo_util.o
lzo1c_s1.o
lzo1c_s2.o
lzo1f_f1.o
lzo1f_f2.o
lzo1x_f1.o
lzo1x_f2.o
lzo1x_s1.o
lzo1x_s2.o
lzo1y_f1.o
lzo1y_f2.o
lzo1y_s1.o
lzo1y_s2.o
|
Added work/contrib/lzo/lzo-1.08/B/os2/wc105.cmd.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
rem /* OS/2 32 bit - Watcom C 10.5
rem * a very simple make driver
rem * Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
rem */
@if "%LZO_ECHO%"=="n" echo off
set _CC=wcl386 -zq -mf -5r -bt#os2v2
set CFLAGS=-Iinclude -wx -oneatx
set MYLIB=lzo.lib
echo Compiling, please be patient...
set CC=%_CC%
%CC% %CFLAGS% -zc -c src\*.c
@if errorlevel 1 goto error
%CC% -wx -c src\i386\d_asm2\*.asm
@if errorlevel 1 goto error
if exist %MYLIB% del %MYLIB%
wlib -q -b -n -t %MYLIB% @b\os2\wc105.rsp
@if errorlevel 1 goto error
set CC=%_CC% -zc -l#os2v2
%CC% %CFLAGS% ltest\ltest.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\dict.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\lpack.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\overlap.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\precomp.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\precomp2.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\simple.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc tests\align.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc tests\chksum.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -fe#testmini.exe minilzo\*.c
@if errorlevel 1 goto error
echo Done.
goto end
:error
echo error!
:end
|
Added work/contrib/lzo/lzo-1.08/B/os2/wc105.rsp.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
+'alloc.obj'
+'io.obj'
+'lzo1.obj'
+'lzo1_99.obj'
+'lzo1a.obj'
+'lzo1a_99.obj'
+'lzo1b_1.obj'
+'lzo1b_2.obj'
+'lzo1b_3.obj'
+'lzo1b_4.obj'
+'lzo1b_5.obj'
+'lzo1b_6.obj'
+'lzo1b_7.obj'
+'lzo1b_8.obj'
+'lzo1b_9.obj'
+'lzo1b_99.obj'
+'lzo1b_9x.obj'
+'lzo1b_cc.obj'
+'lzo1b_d1.obj'
+'lzo1b_d2.obj'
+'lzo1b_rr.obj'
+'lzo1b_xx.obj'
+'lzo1c_1.obj'
+'lzo1c_2.obj'
+'lzo1c_3.obj'
+'lzo1c_4.obj'
+'lzo1c_5.obj'
+'lzo1c_6.obj'
+'lzo1c_7.obj'
+'lzo1c_8.obj'
+'lzo1c_9.obj'
+'lzo1c_99.obj'
+'lzo1c_9x.obj'
+'lzo1c_cc.obj'
+'lzo1c_d1.obj'
+'lzo1c_d2.obj'
+'lzo1c_rr.obj'
+'lzo1c_xx.obj'
+'lzo1f_1.obj'
+'lzo1f_9x.obj'
+'lzo1f_d1.obj'
+'lzo1f_d2.obj'
+'lzo1x_1.obj'
+'lzo1x_1k.obj'
+'lzo1x_1l.obj'
+'lzo1x_1o.obj'
+'lzo1x_9x.obj'
+'lzo1x_d1.obj'
+'lzo1x_d2.obj'
+'lzo1x_d3.obj'
+'lzo1x_o.obj'
+'lzo1y_1.obj'
+'lzo1y_9x.obj'
+'lzo1y_d1.obj'
+'lzo1y_d2.obj'
+'lzo1y_d3.obj'
+'lzo1y_o.obj'
+'lzo1z_9x.obj'
+'lzo1z_d1.obj'
+'lzo1z_d2.obj'
+'lzo1z_d3.obj'
+'lzo2a_9x.obj'
+'lzo2a_d1.obj'
+'lzo2a_d2.obj'
+'lzo_crc.obj'
+'lzo_dll.obj'
+'lzo_init.obj'
+'lzo_ptr.obj'
+'lzo_str.obj'
+'lzo_util.obj'
+'lzo1c_s1.obj'
+'lzo1c_s2.obj'
+'lzo1f_f1.obj'
+'lzo1f_f2.obj'
+'lzo1x_f1.obj'
+'lzo1x_f2.obj'
+'lzo1x_s1.obj'
+'lzo1x_s2.obj'
+'lzo1y_f1.obj'
+'lzo1y_f2.obj'
+'lzo1y_s1.obj'
+'lzo1y_s2.obj'
|
Added work/contrib/lzo/lzo-1.08/B/palmos/00README.TXT.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
Notes for m68k-palmos-coff-gcc 2.7.2.2-kgpd-071097 cross-compiler under Win32.
I had to patch the following include files (see below)
1) both <sys/types.h> and <stddef.h> typedef size_t
2) <limits.h> is broken as gcc seems to imply the `-mshort' switch
If your compiler doesn't find <stdlib.h> then copy the file
m68k-palmos-coff/include/PalmOS/System/Unix/unix_stdlib.h
Cross-compilation using m68k-palmos-coff.tools040a2.Linux-ELF.tar.gz
didn't work for me because of missing include files and libraries.
*** lib/gcc-lib/m68k-palmos-coff/2.7.2.2-kgpd-071097/include/sys/types.org Thu Jul 10 08:33:21 1997
--- lib/gcc-lib/m68k-palmos-coff/2.7.2.2-kgpd-071097/include/sys/types.h Mon Dec 22 23:46:35 1997
***************
*** 45,49 ****
--- 45,51 ----
typedef unsigned int tcflag_t;
+ #if 0
typedef unsigned long size_t;
+ #endif
#endif
*** lib/gcc-lib/m68k-palmos-coff/2.7.2.2-kgpd-071097/include/limits.org Thu Jul 10 08:25:01 1997
--- lib/gcc-lib/m68k-palmos-coff/2.7.2.2-kgpd-071097/include/limits.h Tue Dec 23 01:21:29 1997
***************
*** 40,44 ****
/* Minimum and maximum values a `signed short int' can hold. */
#undef SHRT_MIN
! #define SHRT_MIN (-32768)
#undef SHRT_MAX
#define SHRT_MAX 32767
--- 40,44 ----
/* Minimum and maximum values a `signed short int' can hold. */
#undef SHRT_MIN
! #define SHRT_MIN (-32767-1)
#undef SHRT_MAX
#define SHRT_MAX 32767
***************
*** 46,54 ****
/* Maximum value an `unsigned short int' can hold. (Minimum is 0). */
#undef USHRT_MAX
! #define USHRT_MAX 65535
/* Minimum and maximum values a `signed int' can hold. */
#ifndef __INT_MAX__
! #define __INT_MAX__ 2147483647
#endif
#undef INT_MIN
--- 46,54 ----
/* Maximum value an `unsigned short int' can hold. (Minimum is 0). */
#undef USHRT_MAX
! #define USHRT_MAX 65535U
/* Minimum and maximum values a `signed int' can hold. */
#ifndef __INT_MAX__
! #define __INT_MAX__ 32767
#endif
#undef INT_MIN
|
Added work/contrib/lzo/lzo-1.08/B/palmos/gcc_bin.sh.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#! /bin/sh
set -e
# /* PalmOS - m68k-palmos-coff-gcc 2.7.2.2-kgpd-071097
# * a very simple make driver
# * Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
# */
CC="m68k-palmos-coff-gcc"
CFLAGS="-I. -Iinclude -O2 -Wall -W -DFILE=void"
OBJRES=m68k-palmos-coff-obj-res
PILRC=pilrc
BUILDPRC=build-prc
LIBS="-static liblzo.a -lc"
rm -f *.grc
$CC $CFLAGS -o simple.out B/palmos/simple.c $LIBS -Wl,-Map,simple.map
$OBJRES simple.out
$BUILDPRC simple.prc "LZO-simple" LZOa *.grc
rm -f *.grc
echo "Done."
|
Added work/contrib/lzo/lzo-1.08/B/palmos/gcc_lib.sh.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#! /bin/sh
set -e
# /* PalmOS - m68k-palmos-coff-gcc 2.7.2.2-kgpd-071097
# * a very simple make driver
# * Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
# */
CC="m68k-palmos-coff-gcc"
CFLAGS="-Iinclude -O2 -fomit-frame-pointer -Wall -W -Wno-uninitialized"
CFLAGS="$CFLAGS -DNO_STDIO_H"
# CFLAGS="$CFLAGS -DNO_STDLIB_H"
# CFLAGS="$CFLAGS -S"
# CFLAGS="$CFLAGS -DLZO_DEBUG"
MYLIB=liblzo.a
rm -f *.o $MYLIB
echo Compiling, please be patient...
$CC -x c $CFLAGS -DSIZEOF_SIZE_T=4 -c src/*.[cC]
m68k-palmos-coff-ar rcs $MYLIB *.o
echo "Done."
|
Added work/contrib/lzo/lzo-1.08/B/palmos/simple.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
/* simple.c -- the annotated simple example program for the LZO library
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#pragma pack(2)
#include <Common.h>
#include <System/SysAll.h>
#include <UI/UIAll.h>
#if 1
#include <lzo1x.h>
#undef LZO1X_1_MEM_COMPRESS
#define LZO1X_1_MEM_COMPRESS LZO1X_1_11_MEM_COMPRESS
#define lzo1x_1_compress lzo1x_1_11_compress
#define IN_LEN 8192
#endif
#define main test
#include "examples/simple.c"
#undef main
/*************************************************************************
//
**************************************************************************/
DWord PilotMain(Word cmd, Ptr cmdPBP, Word launchFlags)
{
int r;
if (cmd != 0)
return 0;
r = test(0,NULL);
for (;;)
{
EventType e;
EvtGetEvent(&e,100);
if (e.eType == appStopEvent)
break;
if (!SysHandleEvent(&e))
FrmHandleEvent(FrmGetActiveForm(),&e);
}
return 0;
}
/*
vi:ts=4
*/
|
Added work/contrib/lzo/lzo-1.08/B/prepare.bat.
|
|
>
>
>
|
1
2
3
|
@call b\unset.bat
set NASM=-isrc/i386/d_asm3/
set NASMENV=%NASM%
|
Added work/contrib/lzo/lzo-1.08/B/tos/gcc258.g.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
# /* TOS (Atari ST) - gcc 2.5.8
# * a very simple make driver (gulam shell)
# * Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
# */
# --- 16-bit integers ---
alias gcc 'gcc -mshort -DSIZEOF_SIZE_T=4 -Iinclude'
set MYLIB lzo16.olb
# --- 32-bit integers ---
alias gcc 'gcc -Iinclude'
set MYLIB lzo.olb
set batch_echo 0
set env_style mw
rm $MYLIB
rm *.o
foreach f { src\*.c }
echo "Compiling $f"
gcc -Wall -W -Wno-uninitialized -O2 -fomit-frame-pointer -c $f
endfor
### gcc-ar rcs $MYLIB *.o
foreach f { *.o }
gcc-ar rs $MYLIB $f
endfor
set batch_echo 1
gcc -s -Wall -O2 ltest\ltest.c $MYLIB -o ltest.ttp
gcc -s -Wall -O2 -Isrc tests\align.c $MYLIB -o align.ttp
gcc -s -Wall -O2 tests\chksum.c $MYLIB -o chksum.ttp
gcc -s -Wall -O2 tests\sizes.c $MYLIB -o sizes.ttp
gcc -s -Wall -O2 examples\dict.c $MYLIB -o dict.ttp
gcc -s -Wall -O2 examples\lpack.c $MYLIB -o lpack.ttp
gcc -s -Wall -O2 examples\overlap.c $MYLIB -o overlap.ttp
gcc -s -Wall -O2 examples\precomp.c $MYLIB -o precomp.ttp
gcc -s -Wall -O2 examples\precomp2.c $MYLIB -o precomp2.ttp
gcc -s -Wall -O2 examples\simple.c $MYLIB -o simple.ttp
set batch_echo 0
unalias gcc
echo Done.
|
Added work/contrib/lzo/lzo-1.08/B/tos/pc.prj.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
;
; pc.prj -- project file for Pure C 1.0 (Sep 20 1991)
;
; name of executable program
ltest.ttp
; ----- compiler options -----
;; .C[-DSIZEOF_SIZE_T=4]
;; .C[-DLZO_BYTE_ORDER=4321]
;; .C[-DLZO_NO_SYS_TYPES_H]
;; .C[-DLZO_DEBUG]
.C[-P] ; use absolute calls
.C[-Iinclude]
.C[-W -W-rch]
.C[-L48] ; maximum identifier length
;; .C[-G] ; size optimization
;; .C[-Y] ; add debug information
; ----- linker options -----
.L[-S=8192] ; stacksize
;; .L[-Y] ; add debug information
;; .L[-G] ; add global symbols
;; .L[-L] ; add local symbols
; ----- assembler options -----
;; .S[-Y] ; add debug information
= ; list of modules follows...
PCXSTART.O ; startup code
ltest\ltest.c
pclib.prj
PCFLTLIB.LIB ; floating point library
PCSTDLIB.LIB ; standard library
; PCEXTLIB.LIB ; extended library
; PCBGILIB.LIB ; BGI library
; PCTOSLIB.LIB ; TOS library
; PCGEMLIB.LIB ; AES and VDI library
|
Added work/contrib/lzo/lzo-1.08/B/tos/pc.txt.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
;
; pc.prj -- project file for Pure C 1.0 (Sep 20 1991)
;
; This file is part of the LZO real-time data compression library.
;
; Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
;
; The LZO library is free software; you can redistribute it and/or
; modify it under the terms of the GNU General Public License as
; published by the Free Software Foundation; either version 2 of
; the License, or (at your option) any later version.
;
; The LZO library is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with the LZO library; see the file COPYING.
; If not, write to the Free Software Foundation, Inc.,
; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
;
; Markus F.X.J. Oberhumer
; <markus@oberhumer.com>
;
;
; Just for fun I've ported LZO to my old Atari ST. This fine machine
; is powered by a Motorola 68000 CPU with 16-bit ints, 32-bit longs,
; 32-bit size_t and a flat memory with 32-bit pointers.
;
;
; WARNING:
; do *not* use Turbo C 2.03 (the predecessor of Pure C) - the
; implementation of arrays that are indexed by long integers is
; broken and wrong code will be produced in some cases
;
|
Added work/contrib/lzo/lzo-1.08/B/tos/pclib.prj.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
;
; pclib.prj -- project file for Pure C 1.0 (Sep 20 1991)
;
; name of the library
lzo.lib
; ----- compiler options -----
.C[-DSIZEOF_SIZE_T=4]
.C[-DMFX_BYTE_ORDER=4321]
.C[-DLZO_NO_SYS_TYPES_H]
;; .C[-DLZO_DEBUG]
.C[-P] ; use absolute calls
.C[-Iinclude]
.C[-W -W-rch]
.C[-L48] ; maximum identifier length
;; .C[-G] ; size optimization
;; .C[-Y] ; add debug information
; ----- linker options -----
.L[-J] ; create a library
;; .L[-Y] ; add debug information
;; .L[-G] ; add global symbols
;; .L[-L] ; add local symbols
; ----- assembler options -----
;; .S[-Y] ; add debug information
= ; list of modules follows...
src\alloc.c
src\io.c
src\lzo1.c
src\lzo1_99.c
src\lzo1a.c
src\lzo1a_99.c
src\lzo1b_1.c
src\lzo1b_2.c
src\lzo1b_3.c
src\lzo1b_4.c
src\lzo1b_5.c
src\lzo1b_6.c
src\lzo1b_7.c
src\lzo1b_8.c
src\lzo1b_9.c
src\lzo1b_99.c
src\lzo1b_9x.c
src\lzo1b_cc.c
src\lzo1b_d1.c
src\lzo1b_d2.c
src\lzo1b_rr.c
src\lzo1b_xx.c
src\lzo1c_1.c
src\lzo1c_2.c
src\lzo1c_3.c
src\lzo1c_4.c
src\lzo1c_5.c
src\lzo1c_6.c
src\lzo1c_7.c
src\lzo1c_8.c
src\lzo1c_9.c
src\lzo1c_99.c
src\lzo1c_9x.c
src\lzo1c_cc.c
src\lzo1c_d1.c
src\lzo1c_d2.c
src\lzo1c_rr.c
src\lzo1c_xx.c
src\lzo1f_1.c
src\lzo1f_9x.c
src\lzo1f_d1.c
src\lzo1f_d2.c
src\lzo1x_1.c
src\lzo1x_1k.c
src\lzo1x_1l.c
src\lzo1x_1o.c
src\lzo1x_9x.c
src\lzo1x_d1.c
src\lzo1x_d2.c
src\lzo1x_d3.c
src\lzo1x_o.c
src\lzo1y_1.c
src\lzo1y_9x.c
src\lzo1y_d1.c
src\lzo1y_d2.c
src\lzo1y_d3.c
src\lzo1y_o.c
src\lzo1z_9x.c
src\lzo1z_d1.c
src\lzo1z_d2.c
src\lzo1z_d3.c
src\lzo2a_9x.c
src\lzo2a_d1.c
src\lzo2a_d2.c
src\lzo_crc.c
src\lzo_dll.c
src\lzo_init.c
src\lzo_ptr.c
src\lzo_str.c
src\lzo_util.c
|
Added work/contrib/lzo/lzo-1.08/B/unset.bat.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
@set ASFLAGS=
@set CC=
@set _CC=
@set CFLAGS=
@set CPPFLAGS=
@set CXXFLAGS=
@set DEFS=
@set EXTRA_CFLAGS=
@set LDFLAGS=
@set LDLIBS=
@set LIBS=
@set MYLIB=
@set NASM=
@set NASM_FLAGS=
@set NASMENV=
@set WCGMEMORY=
|
Added work/contrib/lzo/lzo-1.08/B/win16/00README.TXT.
|
|
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
|
NOTE:
=====
The 16-bit Windows version is pretty slow.
Use the 32-bit Windows version whenever possible (it should also
work under Windows 3.1 + Win32s) because it is *much* faster.
|
Added work/contrib/lzo/lzo-1.08/B/win16/mc70.bat.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
rem /* Windows 16 bit (LIB) - Microsoft C 7.0
rem * a very simple make driver
rem * Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
rem */
@if "%LZO_ECHO%"=="n" echo off
set CC=cl -nologo -f- -AL -Mq
set CFLAGS=-Iinclude -O -G2 -W3
REM set CFLAGS=%CFLAGS% -D__LZO_STRICT_16BIT
set MYLIB=lzo.lib
echo Compiling, please be patient...
%CC% %CFLAGS% -DLZO_BUILD -c src\*.c
@if errorlevel 1 goto error
if exist %MYLIB% del %MYLIB%
lib /nologo %MYLIB% @b\win16\mc70.rsp;
@if errorlevel 1 goto error
%CC% %CFLAGS% ltest\ltest.c %MYLIB% setargv.obj
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\lpack.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\overlap.c %MYLIB% setargv.obj
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\simple.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc tests\align.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc tests\chksum.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Fetestmini.exe minilzo\*.c
@if errorlevel 1 goto error
@echo Done.
@goto end
:error
echo error!
:end
@call b\unset.bat
|
Added work/contrib/lzo/lzo-1.08/B/win16/mc70.rsp.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
+alloc.obj &
+io.obj &
+lzo1.obj &
+lzo1_99.obj &
+lzo1a.obj &
+lzo1a_99.obj &
+lzo1b_1.obj &
+lzo1b_2.obj &
+lzo1b_3.obj &
+lzo1b_4.obj &
+lzo1b_5.obj &
+lzo1b_6.obj &
+lzo1b_7.obj &
+lzo1b_8.obj &
+lzo1b_9.obj &
+lzo1b_99.obj &
+lzo1b_9x.obj &
+lzo1b_cc.obj &
+lzo1b_d1.obj &
+lzo1b_d2.obj &
+lzo1b_rr.obj &
+lzo1b_xx.obj &
+lzo1c_1.obj &
+lzo1c_2.obj &
+lzo1c_3.obj &
+lzo1c_4.obj &
+lzo1c_5.obj &
+lzo1c_6.obj &
+lzo1c_7.obj &
+lzo1c_8.obj &
+lzo1c_9.obj &
+lzo1c_99.obj &
+lzo1c_9x.obj &
+lzo1c_cc.obj &
+lzo1c_d1.obj &
+lzo1c_d2.obj &
+lzo1c_rr.obj &
+lzo1c_xx.obj &
+lzo1f_1.obj &
+lzo1f_9x.obj &
+lzo1f_d1.obj &
+lzo1f_d2.obj &
+lzo1x_1.obj &
+lzo1x_1k.obj &
+lzo1x_1l.obj &
+lzo1x_1o.obj &
+lzo1x_9x.obj &
+lzo1x_d1.obj &
+lzo1x_d2.obj &
+lzo1x_d3.obj &
+lzo1x_o.obj &
+lzo1y_1.obj &
+lzo1y_9x.obj &
+lzo1y_d1.obj &
+lzo1y_d2.obj &
+lzo1y_d3.obj &
+lzo1y_o.obj &
+lzo1z_9x.obj &
+lzo1z_d1.obj &
+lzo1z_d2.obj &
+lzo1z_d3.obj &
+lzo2a_9x.obj &
+lzo2a_d1.obj &
+lzo2a_d2.obj &
+lzo_crc.obj &
+lzo_dll.obj &
+lzo_init.obj &
+lzo_ptr.obj &
+lzo_str.obj &
+lzo_util.obj
|
Added work/contrib/lzo/lzo-1.08/B/win16/wc105.bat.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
rem /* Windows 16 bit (LIB) - Watcom C 10.5
rem * a very simple make driver
rem * Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
rem */
@if "%LZO_ECHO%"=="n" echo off
set _CC=wcl -zq -ml -5 -bt#windows
set CFLAGS=-Iinclude -wx -oneatx
REM set CFLAGS=%CFLAGS% -D__LZO_STRICT_16BIT
set MYLIB=lzo.lib
echo Compiling, please be patient...
set CC=%_CC%
%CC% %CFLAGS% -DLZO_BUILD -zc -c src\*.c
@if errorlevel 1 goto error
if exist %MYLIB% del %MYLIB%
wlib -q -b -n -t %MYLIB% @b\win16\wc105.rsp
@if errorlevel 1 goto error
set CC=%_CC% -zc -bw -l#windows
%CC% %CFLAGS% ltest\ltest.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\lpack.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\overlap.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\simple.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc tests\align.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc tests\chksum.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -fe#testmini.exe minilzo\*.c
@if errorlevel 1 goto error
@echo Done.
@goto end
:error
echo error!
:end
@call b\unset.bat
|
Added work/contrib/lzo/lzo-1.08/B/win16/wc105.rsp.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
+'alloc.obj'
+'io.obj'
+'lzo1.obj'
+'lzo1_99.obj'
+'lzo1a.obj'
+'lzo1a_99.obj'
+'lzo1b_1.obj'
+'lzo1b_2.obj'
+'lzo1b_3.obj'
+'lzo1b_4.obj'
+'lzo1b_5.obj'
+'lzo1b_6.obj'
+'lzo1b_7.obj'
+'lzo1b_8.obj'
+'lzo1b_9.obj'
+'lzo1b_99.obj'
+'lzo1b_9x.obj'
+'lzo1b_cc.obj'
+'lzo1b_d1.obj'
+'lzo1b_d2.obj'
+'lzo1b_rr.obj'
+'lzo1b_xx.obj'
+'lzo1c_1.obj'
+'lzo1c_2.obj'
+'lzo1c_3.obj'
+'lzo1c_4.obj'
+'lzo1c_5.obj'
+'lzo1c_6.obj'
+'lzo1c_7.obj'
+'lzo1c_8.obj'
+'lzo1c_9.obj'
+'lzo1c_99.obj'
+'lzo1c_9x.obj'
+'lzo1c_cc.obj'
+'lzo1c_d1.obj'
+'lzo1c_d2.obj'
+'lzo1c_rr.obj'
+'lzo1c_xx.obj'
+'lzo1f_1.obj'
+'lzo1f_9x.obj'
+'lzo1f_d1.obj'
+'lzo1f_d2.obj'
+'lzo1x_1.obj'
+'lzo1x_1k.obj'
+'lzo1x_1l.obj'
+'lzo1x_1o.obj'
+'lzo1x_9x.obj'
+'lzo1x_d1.obj'
+'lzo1x_d2.obj'
+'lzo1x_d3.obj'
+'lzo1x_o.obj'
+'lzo1y_1.obj'
+'lzo1y_9x.obj'
+'lzo1y_d1.obj'
+'lzo1y_d2.obj'
+'lzo1y_d3.obj'
+'lzo1y_o.obj'
+'lzo1z_9x.obj'
+'lzo1z_d1.obj'
+'lzo1z_d2.obj'
+'lzo1z_d3.obj'
+'lzo2a_9x.obj'
+'lzo2a_d1.obj'
+'lzo2a_d2.obj'
+'lzo_crc.obj'
+'lzo_dll.obj'
+'lzo_init.obj'
+'lzo_ptr.obj'
+'lzo_str.obj'
+'lzo_util.obj'
|
Added work/contrib/lzo/lzo-1.08/B/win16/wc105dll.bat.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
rem /* Windows 16 bit (DLL) - Watcom C 10.5
rem * a very simple make driver
rem * Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
rem */
@if "%LZO_ECHO%"=="n" echo off
set _CC=wcl -zq -ml -5 -bt#windows
set CFLAGS=-Iinclude -wx -oneatx
REM set CFLAGS=%CFLAGS% -D__LZO_STRICT_16BIT
set MYDLL=lzo16.dll
set MYLIB=lzo16.lib
echo Compiling, please be patient...
set CC=%_CC%
%CC% %CFLAGS% -DLZO_BUILD_DLL -zc -zu -bd -D__LZO_EXPORT2=__export -c src\*.c
@if errorlevel 1 goto error
if exist %MYDLL% del %MYDLL%
if exist %MYLIB% del %MYLIB%
wlink name %MYDLL% @b\win16\wc105dll.def @b\win16\wc105dll.rsp
@if errorlevel 1 goto error
wlib -q -b -n -t %MYLIB% +%MYDLL%
@if errorlevel 1 goto error
set CC=%_CC% -zc -l#windows
set CFLAGS=%CFLAGS% -DLZO_USE_DLL -DLZO_NO_ASM
%CC% %CFLAGS% ltest\ltest.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\lpack.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\overlap.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\simple.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc tests\align.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc tests\chksum.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -fe#testmini.exe minilzo\*.c
@if errorlevel 1 goto error
@echo Done.
@goto end
:error
echo error!
:end
@call b\unset.bat
|
Added work/contrib/lzo/lzo-1.08/B/win16/wc105dll.def.
|
|
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
|
debug all
system windows_dll initglobal memory
option description 'LZO real-time data compression library, Copyright (C) Markus F.X.J. Oberhumer'
option version=1.07
# option map
# option symfile=symbols.sym
|
Added work/contrib/lzo/lzo-1.08/B/win16/wc105dll.rsp.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
file alloc.obj
file io.obj
file lzo1.obj
file lzo1_99.obj
file lzo1a.obj
file lzo1a_99.obj
file lzo1b_1.obj
file lzo1b_2.obj
file lzo1b_3.obj
file lzo1b_4.obj
file lzo1b_5.obj
file lzo1b_6.obj
file lzo1b_7.obj
file lzo1b_8.obj
file lzo1b_9.obj
file lzo1b_99.obj
file lzo1b_9x.obj
file lzo1b_cc.obj
file lzo1b_d1.obj
file lzo1b_d2.obj
file lzo1b_rr.obj
file lzo1b_xx.obj
file lzo1c_1.obj
file lzo1c_2.obj
file lzo1c_3.obj
file lzo1c_4.obj
file lzo1c_5.obj
file lzo1c_6.obj
file lzo1c_7.obj
file lzo1c_8.obj
file lzo1c_9.obj
file lzo1c_99.obj
file lzo1c_9x.obj
file lzo1c_cc.obj
file lzo1c_d1.obj
file lzo1c_d2.obj
file lzo1c_rr.obj
file lzo1c_xx.obj
file lzo1f_1.obj
file lzo1f_9x.obj
file lzo1f_d1.obj
file lzo1f_d2.obj
file lzo1x_1.obj
file lzo1x_1k.obj
file lzo1x_1l.obj
file lzo1x_1o.obj
file lzo1x_9x.obj
file lzo1x_d1.obj
file lzo1x_d2.obj
file lzo1x_d3.obj
file lzo1x_o.obj
file lzo1y_1.obj
file lzo1y_9x.obj
file lzo1y_d1.obj
file lzo1y_d2.obj
file lzo1y_d3.obj
file lzo1y_o.obj
file lzo1z_9x.obj
file lzo1z_d1.obj
file lzo1z_d2.obj
file lzo1z_d3.obj
file lzo2a_9x.obj
file lzo2a_d1.obj
file lzo2a_d2.obj
file lzo_crc.obj
file lzo_dll.obj
file lzo_init.obj
file lzo_ptr.obj
file lzo_str.obj
file lzo_util.obj
|
Added work/contrib/lzo/lzo-1.08/B/win32/00README.TXT.
|
|
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
|
NOTE:
=====
All build scripts, executables and DLLs should work
under both Windows 95/98 and Windows NT, and probably also
under Windows 3.1 + Win32s.
|
Added work/contrib/lzo/lzo-1.08/B/win32/bc55.bat.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
rem /* Windows 32 bit (LIB) - Borland C/C++ 5.5.1
rem * a very simple make driver
rem * Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
rem */
@if "%LZO_ECHO%"=="n" echo off
set CC=bcc32
set CFLAGS=-Iinclude -O2 -d -w -w-aus
set MYLIB=lzo.lib
echo Compiling, please be patient...
%CC% %CFLAGS% -DLZO_BUILD -Isrc -c src\*.c
@if errorlevel 1 goto error
if exist %MYLIB% del %MYLIB%
tlib %MYLIB% @b\win32\bc55.rsp
@if errorlevel 1 goto error
%CC% %CFLAGS% -Iltest ltest\ltest.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\dict.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\lpack.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\overlap.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\precomp.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\precomp2.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\simple.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc tests\align.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc tests\chksum.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Iminilzo -etestmini.exe minilzo\*.c
@if errorlevel 1 goto error
@echo Done.
@goto end
:error
echo error!
:end
@call b\unset.bat
|
Added work/contrib/lzo/lzo-1.08/B/win32/bc55.rsp.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
+alloc.obj &
+io.obj &
+lzo1.obj &
+lzo1_99.obj &
+lzo1a.obj &
+lzo1a_99.obj &
+lzo1b_1.obj &
+lzo1b_2.obj &
+lzo1b_3.obj &
+lzo1b_4.obj &
+lzo1b_5.obj &
+lzo1b_6.obj &
+lzo1b_7.obj &
+lzo1b_8.obj &
+lzo1b_9.obj &
+lzo1b_99.obj &
+lzo1b_9x.obj &
+lzo1b_cc.obj &
+lzo1b_d1.obj &
+lzo1b_d2.obj &
+lzo1b_rr.obj &
+lzo1b_xx.obj &
+lzo1c_1.obj &
+lzo1c_2.obj &
+lzo1c_3.obj &
+lzo1c_4.obj &
+lzo1c_5.obj &
+lzo1c_6.obj &
+lzo1c_7.obj &
+lzo1c_8.obj &
+lzo1c_9.obj &
+lzo1c_99.obj &
+lzo1c_9x.obj &
+lzo1c_cc.obj &
+lzo1c_d1.obj &
+lzo1c_d2.obj &
+lzo1c_rr.obj &
+lzo1c_xx.obj &
+lzo1f_1.obj &
+lzo1f_9x.obj &
+lzo1f_d1.obj &
+lzo1f_d2.obj &
+lzo1x_1.obj &
+lzo1x_1k.obj &
+lzo1x_1l.obj &
+lzo1x_1o.obj &
+lzo1x_9x.obj &
+lzo1x_d1.obj &
+lzo1x_d2.obj &
+lzo1x_d3.obj &
+lzo1x_o.obj &
+lzo1y_1.obj &
+lzo1y_9x.obj &
+lzo1y_d1.obj &
+lzo1y_d2.obj &
+lzo1y_d3.obj &
+lzo1y_o.obj &
+lzo1z_9x.obj &
+lzo1z_d1.obj &
+lzo1z_d2.obj &
+lzo1z_d3.obj &
+lzo2a_9x.obj &
+lzo2a_d1.obj &
+lzo2a_d2.obj &
+lzo_crc.obj &
+lzo_dll.obj &
+lzo_init.obj &
+lzo_ptr.obj &
+lzo_str.obj &
+lzo_util.obj
|
Added work/contrib/lzo/lzo-1.08/B/win32/cygwin.bat.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
rem /* Windows 32 bit (LIB) - Cygnus GNU-Win32 Development Kit
rem * a very simple make driver
rem * Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
rem */
@if "%LZO_ECHO%"=="n" echo off
set CC=gcc -s
set CFLAGS=-Iinclude -O2 -fomit-frame-pointer -Wall -W -Wno-uninitialized
set ASFLAGS=-x assembler-with-cpp -Wall
set MYLIB=liblzo.a
del *.o
echo Compiling, please be patient...
%CC% -x c %CFLAGS% -DLZO_BUILD -c src/*.[cC]
@if errorlevel 1 goto error
%CC% %ASFLAGS% -DLZO_BUILD -c src/i386/src/*.[sS]
@if errorlevel 1 goto error
if exist %MYLIB% del %MYLIB%
ar rcs %MYLIB% *.o
@if errorlevel 1 goto error
%CC% %CFLAGS% -o ltest.exe ltest/ltest.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -o dict.exe examples/dict.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -o lpack.exe examples/lpack.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -o overlap.exe examples/overlap.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -o precomp.exe examples/precomp.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -o precomp2.exe examples/precomp2.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -o simple.exe examples/simple.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc -o align.exe tests/align.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc -o chksum.exe tests/chksum.c %MYLIB%
@if errorlevel 1 goto error
%CC% -x c %CFLAGS% -o testmini.exe minilzo/*.[cC]
@if errorlevel 1 goto error
@echo Done.
@goto end
:error
echo error!
:end
@call b\unset.bat
|
Added work/contrib/lzo/lzo-1.08/B/win32/dmc.bat.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
rem /* Windows 32 bit (LIB) - Digital Mars C/C++ 8.28
rem * a very simple make driver
rem * Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
rem */
@if "%LZO_ECHO%"=="n" echo off
set CC=sc -mn
set CFLAGS=-Iinclude -o -w-
set MYLIB=lzo.lib
echo Compiling, please be patient...
for %%i in (src\*.c) do %CC% %CFLAGS% -c %%i
@if errorlevel 1 goto error
if exist %MYLIB% del %MYLIB%
lib %MYLIB% /b /c /n /noi @b\win32\dmc.rsp
@if errorlevel 1 goto error
%CC% %CFLAGS% -Iltest ltest\ltest.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\dict.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\lpack.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\overlap.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\precomp.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\precomp2.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\simple.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc tests\align.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc tests\chksum.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Iminilzo -otestmini.exe minilzo\testmini.c minilzo\minilzo.c
@if errorlevel 1 goto error
@echo Done.
@goto end
:error
echo error!
:end
@call b\unset.bat
|
Added work/contrib/lzo/lzo-1.08/B/win32/dmc.rsp.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
+alloc.obj &
+io.obj &
+lzo1.obj &
+lzo1_99.obj &
+lzo1a.obj &
+lzo1a_99.obj &
+lzo1b_1.obj &
+lzo1b_2.obj &
+lzo1b_3.obj &
+lzo1b_4.obj &
+lzo1b_5.obj &
+lzo1b_6.obj &
+lzo1b_7.obj &
+lzo1b_8.obj &
+lzo1b_9.obj &
+lzo1b_99.obj &
+lzo1b_9x.obj &
+lzo1b_cc.obj &
+lzo1b_d1.obj &
+lzo1b_d2.obj &
+lzo1b_rr.obj &
+lzo1b_xx.obj &
+lzo1c_1.obj &
+lzo1c_2.obj &
+lzo1c_3.obj &
+lzo1c_4.obj &
+lzo1c_5.obj &
+lzo1c_6.obj &
+lzo1c_7.obj &
+lzo1c_8.obj &
+lzo1c_9.obj &
+lzo1c_99.obj &
+lzo1c_9x.obj &
+lzo1c_cc.obj &
+lzo1c_d1.obj &
+lzo1c_d2.obj &
+lzo1c_rr.obj &
+lzo1c_xx.obj &
+lzo1f_1.obj &
+lzo1f_9x.obj &
+lzo1f_d1.obj &
+lzo1f_d2.obj &
+lzo1x_1.obj &
+lzo1x_1k.obj &
+lzo1x_1l.obj &
+lzo1x_1o.obj &
+lzo1x_9x.obj &
+lzo1x_d1.obj &
+lzo1x_d2.obj &
+lzo1x_d3.obj &
+lzo1x_o.obj &
+lzo1y_1.obj &
+lzo1y_9x.obj &
+lzo1y_d1.obj &
+lzo1y_d2.obj &
+lzo1y_d3.obj &
+lzo1y_o.obj &
+lzo1z_9x.obj &
+lzo1z_d1.obj &
+lzo1z_d2.obj &
+lzo1z_d3.obj &
+lzo2a_9x.obj &
+lzo2a_d1.obj &
+lzo2a_d2.obj &
+lzo_crc.obj &
+lzo_dll.obj &
+lzo_init.obj &
+lzo_ptr.obj &
+lzo_str.obj &
+lzo_util.obj
|
Added work/contrib/lzo/lzo-1.08/B/win32/mc120.bat.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
rem /* Windows 32 bit (LIB) - Microsoft 32-bit C/C++ Compiler 12.00
rem * a very simple make driver
rem * Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
rem */
@if "%LZO_ECHO%"=="n" echo off
set _CC=cl -nologo -MD
set CFLAGS=-Iinclude -O2 -GF -W3
set MYLIB=lzo.lib
echo Compiling, please be patient...
set CC=%_CC%
%CC% %CFLAGS% -DLZO_BUILD -c src\*.c
@if errorlevel 1 goto error
if exist %MYLIB% del %MYLIB%
lib -nologo -out:%MYLIB% @b\win32\mc120.rsp
@if errorlevel 1 goto error
set CC=%_CC% -DLZO_NO_ASM
%CC% %CFLAGS% ltest\ltest.c %MYLIB% setargv.obj
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\dict.c %MYLIB% setargv.obj
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\lpack.c %MYLIB% setargv.obj
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\overlap.c %MYLIB% setargv.obj
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\precomp.c %MYLIB% setargv.obj
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\precomp2.c %MYLIB% setargv.obj
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\simple.c %MYLIB% setargv.obj
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc tests\align.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc tests\chksum.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Fetestmini.exe minilzo\*.c
@if errorlevel 1 goto error
@echo Done.
@goto end
:error
echo error!
:end
@call b\unset.bat
|
Added work/contrib/lzo/lzo-1.08/B/win32/mc120.rsp.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
.\alloc.obj
.\io.obj
.\lzo1.obj
.\lzo1_99.obj
.\lzo1a.obj
.\lzo1a_99.obj
.\lzo1b_1.obj
.\lzo1b_2.obj
.\lzo1b_3.obj
.\lzo1b_4.obj
.\lzo1b_5.obj
.\lzo1b_6.obj
.\lzo1b_7.obj
.\lzo1b_8.obj
.\lzo1b_9.obj
.\lzo1b_99.obj
.\lzo1b_9x.obj
.\lzo1b_cc.obj
.\lzo1b_d1.obj
.\lzo1b_d2.obj
.\lzo1b_rr.obj
.\lzo1b_xx.obj
.\lzo1c_1.obj
.\lzo1c_2.obj
.\lzo1c_3.obj
.\lzo1c_4.obj
.\lzo1c_5.obj
.\lzo1c_6.obj
.\lzo1c_7.obj
.\lzo1c_8.obj
.\lzo1c_9.obj
.\lzo1c_99.obj
.\lzo1c_9x.obj
.\lzo1c_cc.obj
.\lzo1c_d1.obj
.\lzo1c_d2.obj
.\lzo1c_rr.obj
.\lzo1c_xx.obj
.\lzo1f_1.obj
.\lzo1f_9x.obj
.\lzo1f_d1.obj
.\lzo1f_d2.obj
.\lzo1x_1.obj
.\lzo1x_1k.obj
.\lzo1x_1l.obj
.\lzo1x_1o.obj
.\lzo1x_9x.obj
.\lzo1x_d1.obj
.\lzo1x_d2.obj
.\lzo1x_d3.obj
.\lzo1x_o.obj
.\lzo1y_1.obj
.\lzo1y_9x.obj
.\lzo1y_d1.obj
.\lzo1y_d2.obj
.\lzo1y_d3.obj
.\lzo1y_o.obj
.\lzo1z_9x.obj
.\lzo1z_d1.obj
.\lzo1z_d2.obj
.\lzo1z_d3.obj
.\lzo2a_9x.obj
.\lzo2a_d1.obj
.\lzo2a_d2.obj
.\lzo_crc.obj
.\lzo_dll.obj
.\lzo_init.obj
.\lzo_ptr.obj
.\lzo_str.obj
.\lzo_util.obj
|
Added work/contrib/lzo/lzo-1.08/B/win32/mc120asm.rsp.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
.\alloc.obj
.\io.obj
.\lzo1.obj
.\lzo1_99.obj
.\lzo1a.obj
.\lzo1a_99.obj
.\lzo1b_1.obj
.\lzo1b_2.obj
.\lzo1b_3.obj
.\lzo1b_4.obj
.\lzo1b_5.obj
.\lzo1b_6.obj
.\lzo1b_7.obj
.\lzo1b_8.obj
.\lzo1b_9.obj
.\lzo1b_99.obj
.\lzo1b_9x.obj
.\lzo1b_cc.obj
.\lzo1b_d1.obj
.\lzo1b_d2.obj
.\lzo1b_rr.obj
.\lzo1b_xx.obj
.\lzo1c_1.obj
.\lzo1c_2.obj
.\lzo1c_3.obj
.\lzo1c_4.obj
.\lzo1c_5.obj
.\lzo1c_6.obj
.\lzo1c_7.obj
.\lzo1c_8.obj
.\lzo1c_9.obj
.\lzo1c_99.obj
.\lzo1c_9x.obj
.\lzo1c_cc.obj
.\lzo1c_d1.obj
.\lzo1c_d2.obj
.\lzo1c_rr.obj
.\lzo1c_xx.obj
.\lzo1f_1.obj
.\lzo1f_9x.obj
.\lzo1f_d1.obj
.\lzo1f_d2.obj
.\lzo1x_1.obj
.\lzo1x_1k.obj
.\lzo1x_1l.obj
.\lzo1x_1o.obj
.\lzo1x_9x.obj
.\lzo1x_d1.obj
.\lzo1x_d2.obj
.\lzo1x_d3.obj
.\lzo1x_o.obj
.\lzo1y_1.obj
.\lzo1y_9x.obj
.\lzo1y_d1.obj
.\lzo1y_d2.obj
.\lzo1y_d3.obj
.\lzo1y_o.obj
.\lzo1z_9x.obj
.\lzo1z_d1.obj
.\lzo1z_d2.obj
.\lzo1z_d3.obj
.\lzo2a_9x.obj
.\lzo2a_d1.obj
.\lzo2a_d2.obj
.\lzo_crc.obj
.\lzo_dll.obj
.\lzo_init.obj
.\lzo_ptr.obj
.\lzo_str.obj
.\lzo_util.obj
.\lzo1c_s1.obj
.\lzo1c_s2.obj
.\lzo1f_f1.obj
.\lzo1f_f2.obj
.\lzo1x_f1.obj
.\lzo1x_f2.obj
.\lzo1x_s1.obj
.\lzo1x_s2.obj
.\lzo1y_f1.obj
.\lzo1y_f2.obj
.\lzo1y_s1.obj
.\lzo1y_s2.obj
|
Added work/contrib/lzo/lzo-1.08/B/win32/mc120dll.bat.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
rem /* Windows 32 bit (DLL) - Microsoft 32-bit C/C++ Compiler 12.00
rem * a very simple make driver
rem * Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
rem */
@if "%LZO_ECHO%"=="n" echo off
set CC=cl -nologo -MD
set CFLAGS=-Iinclude -O2 -GF -W3
set MYDLL=lzo.dll
set MYLIB=lzo.lib
echo Compiling, please be patient...
%CC% %CFLAGS% -DLZO_BUILD_DLL -D__LZO_EXPORT1#__declspec(dllexport) -c src\*.c
@if errorlevel 1 goto error
if exist %MYDLL% del %MYDLL%
if exist %MYLIB% del %MYLIB%
link @b\win32\mc120dll.def -implib:%MYLIB% -out:%MYDLL% @b\win32\mc120dll.rsp
@if errorlevel 1 goto error
set CFLAGS=%CFLAGS% -DLZO_USE_DLL -DLZO_NO_ASM
%CC% %CFLAGS% ltest\ltest.c %MYLIB% setargv.obj
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\dict.c %MYLIB% setargv.obj
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\lpack.c %MYLIB% setargv.obj
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\overlap.c %MYLIB% setargv.obj
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\precomp.c %MYLIB% setargv.obj
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\precomp2.c %MYLIB% setargv.obj
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\simple.c %MYLIB% setargv.obj
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc tests\align.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc tests\chksum.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Fetestmini.exe minilzo\*.c
@if errorlevel 1 goto error
@echo Done.
@goto end
:error
echo error!
:end
@call b\unset.bat
|
Added work/contrib/lzo/lzo-1.08/B/win32/mc120dll.def.
|
|
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
|
-nologo
-dll
-incremental:no
-opt:noref
-release
-comment:"LZO real-time data compression library. Copyright (C) Markus F.X.J. Oberhumer"
-version:1.07
|
Added work/contrib/lzo/lzo-1.08/B/win32/mc120dll.rsp.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
.\alloc.obj
.\io.obj
.\lzo1.obj
.\lzo1_99.obj
.\lzo1a.obj
.\lzo1a_99.obj
.\lzo1b_1.obj
.\lzo1b_2.obj
.\lzo1b_3.obj
.\lzo1b_4.obj
.\lzo1b_5.obj
.\lzo1b_6.obj
.\lzo1b_7.obj
.\lzo1b_8.obj
.\lzo1b_9.obj
.\lzo1b_99.obj
.\lzo1b_9x.obj
.\lzo1b_cc.obj
.\lzo1b_d1.obj
.\lzo1b_d2.obj
.\lzo1b_rr.obj
.\lzo1b_xx.obj
.\lzo1c_1.obj
.\lzo1c_2.obj
.\lzo1c_3.obj
.\lzo1c_4.obj
.\lzo1c_5.obj
.\lzo1c_6.obj
.\lzo1c_7.obj
.\lzo1c_8.obj
.\lzo1c_9.obj
.\lzo1c_99.obj
.\lzo1c_9x.obj
.\lzo1c_cc.obj
.\lzo1c_d1.obj
.\lzo1c_d2.obj
.\lzo1c_rr.obj
.\lzo1c_xx.obj
.\lzo1f_1.obj
.\lzo1f_9x.obj
.\lzo1f_d1.obj
.\lzo1f_d2.obj
.\lzo1x_1.obj
.\lzo1x_1k.obj
.\lzo1x_1l.obj
.\lzo1x_1o.obj
.\lzo1x_9x.obj
.\lzo1x_d1.obj
.\lzo1x_d2.obj
.\lzo1x_d3.obj
.\lzo1x_o.obj
.\lzo1y_1.obj
.\lzo1y_9x.obj
.\lzo1y_d1.obj
.\lzo1y_d2.obj
.\lzo1y_d3.obj
.\lzo1y_o.obj
.\lzo1z_9x.obj
.\lzo1z_d1.obj
.\lzo1z_d2.obj
.\lzo1z_d3.obj
.\lzo2a_9x.obj
.\lzo2a_d1.obj
.\lzo2a_d2.obj
.\lzo_crc.obj
.\lzo_dll.obj
.\lzo_init.obj
.\lzo_ptr.obj
.\lzo_str.obj
.\lzo_util.obj
|
Added work/contrib/lzo/lzo-1.08/B/win32/mingw.bat.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
rem /* Windows 32 bit (LIB) - Mingw32 GNU-Win32
rem * a very simple make driver
rem * Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
rem */
@if "%LZO_ECHO%"=="n" echo off
set CC=gcc -mno-cygwin -s
set CFLAGS=-Iinclude -O2 -fomit-frame-pointer -Wall -W -Wno-uninitialized
set ASFLAGS=-x assembler-with-cpp -Wall
set MYLIB=liblzo.a
del *.o
echo Compiling, please be patient...
%CC% -x c %CFLAGS% -DLZO_BUILD -c src/*.c
@if errorlevel 1 goto error
%CC% %ASFLAGS% -DLZO_BUILD -c src/i386/src/*.s
@if errorlevel 1 goto error
if exist %MYLIB% del %MYLIB%
ar rcs %MYLIB% *.o
@if errorlevel 1 goto error
%CC% %CFLAGS% -o ltest.exe ltest/ltest.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -o dict.exe examples/dict.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -o lpack.exe examples/lpack.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -o overlap.exe examples/overlap.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -o precomp.exe examples/precomp.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -o precomp2.exe examples/precomp2.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -o simple.exe examples/simple.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc -o align.exe tests/align.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc -o chksum.exe tests/chksum.c %MYLIB%
@if errorlevel 1 goto error
%CC% -x c %CFLAGS% -o testmini.exe minilzo/*.c
@if errorlevel 1 goto error
@echo Done.
@goto end
:error
echo error!
:end
@call b\unset.bat
|
Added work/contrib/lzo/lzo-1.08/B/win32/mingw.txt.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
As of Mingw32 980309 the <limits.h> header is broken.
Apply this small patch:
*** limits.h.org Wed Nov 26 00:35:52 1997
--- limits.h Tue Apr 28 02:06:04 1998
***************
*** 78,82 ****
#define SHRT_MIN (-SHRT_MAX-1)
! #define USHRT_MAX ((unsigned short) (2U * SHRT_MAX + 1))
/*
--- 78,82 ----
#define SHRT_MIN (-SHRT_MAX-1)
! #define USHRT_MAX 65535
/*
|
Added work/contrib/lzo/lzo-1.08/B/win32/wc105.bat.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
rem /* Windows 32 bit (LIB) - Watcom C 10.5
rem * a very simple make driver
rem * Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
rem */
@if "%LZO_ECHO%"=="n" echo off
set _CC=wcl386 -zq -mf -5r -bt#nt
set CFLAGS=-Iinclude -wx -oneatx
set MYLIB=lzo.lib
echo Compiling, please be patient...
set CC=%_CC%
%CC% %CFLAGS% -DLZO_BUILD -zc -c src\*.c
@if errorlevel 1 goto error
%CC% -DLZO_BUILD -wx -c src\i386\d_asm2\*.asm
@if errorlevel 1 goto error
if exist %MYLIB% del %MYLIB%
wlib -q -b -n -t %MYLIB% @b\win32\wc105.rsp
@if errorlevel 1 goto error
set CC=%_CC% -zc -l#nt
%CC% %CFLAGS% ltest\ltest.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\dict.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\lpack.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\overlap.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\precomp.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\precomp2.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\simple.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc tests\align.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc tests\chksum.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -fe#testmini.exe minilzo\*.c
@if errorlevel 1 goto error
@echo Done.
@goto end
:error
echo error!
:end
@call b\unset.bat
|
Added work/contrib/lzo/lzo-1.08/B/win32/wc105.rsp.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
+'alloc.obj'
+'io.obj'
+'lzo1.obj'
+'lzo1_99.obj'
+'lzo1a.obj'
+'lzo1a_99.obj'
+'lzo1b_1.obj'
+'lzo1b_2.obj'
+'lzo1b_3.obj'
+'lzo1b_4.obj'
+'lzo1b_5.obj'
+'lzo1b_6.obj'
+'lzo1b_7.obj'
+'lzo1b_8.obj'
+'lzo1b_9.obj'
+'lzo1b_99.obj'
+'lzo1b_9x.obj'
+'lzo1b_cc.obj'
+'lzo1b_d1.obj'
+'lzo1b_d2.obj'
+'lzo1b_rr.obj'
+'lzo1b_xx.obj'
+'lzo1c_1.obj'
+'lzo1c_2.obj'
+'lzo1c_3.obj'
+'lzo1c_4.obj'
+'lzo1c_5.obj'
+'lzo1c_6.obj'
+'lzo1c_7.obj'
+'lzo1c_8.obj'
+'lzo1c_9.obj'
+'lzo1c_99.obj'
+'lzo1c_9x.obj'
+'lzo1c_cc.obj'
+'lzo1c_d1.obj'
+'lzo1c_d2.obj'
+'lzo1c_rr.obj'
+'lzo1c_xx.obj'
+'lzo1f_1.obj'
+'lzo1f_9x.obj'
+'lzo1f_d1.obj'
+'lzo1f_d2.obj'
+'lzo1x_1.obj'
+'lzo1x_1k.obj'
+'lzo1x_1l.obj'
+'lzo1x_1o.obj'
+'lzo1x_9x.obj'
+'lzo1x_d1.obj'
+'lzo1x_d2.obj'
+'lzo1x_d3.obj'
+'lzo1x_o.obj'
+'lzo1y_1.obj'
+'lzo1y_9x.obj'
+'lzo1y_d1.obj'
+'lzo1y_d2.obj'
+'lzo1y_d3.obj'
+'lzo1y_o.obj'
+'lzo1z_9x.obj'
+'lzo1z_d1.obj'
+'lzo1z_d2.obj'
+'lzo1z_d3.obj'
+'lzo2a_9x.obj'
+'lzo2a_d1.obj'
+'lzo2a_d2.obj'
+'lzo_crc.obj'
+'lzo_dll.obj'
+'lzo_init.obj'
+'lzo_ptr.obj'
+'lzo_str.obj'
+'lzo_util.obj'
+'lzo1c_s1.obj'
+'lzo1c_s2.obj'
+'lzo1f_f1.obj'
+'lzo1f_f2.obj'
+'lzo1x_f1.obj'
+'lzo1x_f2.obj'
+'lzo1x_s1.obj'
+'lzo1x_s2.obj'
+'lzo1y_f1.obj'
+'lzo1y_f2.obj'
+'lzo1y_s1.obj'
+'lzo1y_s2.obj'
|
Added work/contrib/lzo/lzo-1.08/B/win32/wc105dll.bat.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
rem /* Windows 32 bit (DLL) - Watcom C 10.5
rem * a very simple make driver
rem * Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
rem */
@if "%LZO_ECHO%"=="n" echo off
set _CC=wcl386 -zq -mf -5r -bt#nt
set CFLAGS=-Iinclude -wx -oneatx
set MYDLL=lzo.dll
set MYLIB=lzo.lib
echo Compiling, please be patient...
set CC=%_CC%
%CC% %CFLAGS% -DLZO_BUILD_DLL -zc -bd -D__LZO_EXPORT2=__export -c src\*.c
@if errorlevel 1 goto error
set CC=%_CC%
%CC% -wx -c src\i386\d_asm2\*.asm
@if errorlevel 1 goto error
if exist %MYDLL% del %MYDLL%
if exist %MYLIB% del %MYLIB%
wlink name %MYDLL% @b\win32\wc105dll.def @b\win32\wc105dll.rsp
@if errorlevel 1 goto error
wlib -q -b -n -t %MYLIB% +%MYDLL%
@if errorlevel 1 goto error
set CC=%_CC% -zc -l#nt
set CFLAGS=%CFLAGS% -DLZO_USE_DLL -DLZO_NO_ASM
%CC% %CFLAGS% ltest\ltest.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\dict.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\lpack.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\overlap.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\precomp.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\precomp2.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% examples\simple.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc tests\align.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -Isrc tests\chksum.c %MYLIB%
@if errorlevel 1 goto error
%CC% %CFLAGS% -fe#testmini.exe minilzo\*.c
@if errorlevel 1 goto error
@echo Done.
@goto end
:error
echo error!
:end
@call b\unset.bat
|
Added work/contrib/lzo/lzo-1.08/B/win32/wc105dll.def.
|
|
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
|
debug all
system nt_dll initglobal
option description 'LZO real-time data compression library, Copyright (C) Markus F.X.J. Oberhumer'
option version=1.07
# option map
# option symfile=symbols.sym
|
Added work/contrib/lzo/lzo-1.08/B/win32/wc105dll.rsp.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
file alloc.obj
file io.obj
file lzo1.obj
file lzo1_99.obj
file lzo1a.obj
file lzo1a_99.obj
file lzo1b_1.obj
file lzo1b_2.obj
file lzo1b_3.obj
file lzo1b_4.obj
file lzo1b_5.obj
file lzo1b_6.obj
file lzo1b_7.obj
file lzo1b_8.obj
file lzo1b_9.obj
file lzo1b_99.obj
file lzo1b_9x.obj
file lzo1b_cc.obj
file lzo1b_d1.obj
file lzo1b_d2.obj
file lzo1b_rr.obj
file lzo1b_xx.obj
file lzo1c_1.obj
file lzo1c_2.obj
file lzo1c_3.obj
file lzo1c_4.obj
file lzo1c_5.obj
file lzo1c_6.obj
file lzo1c_7.obj
file lzo1c_8.obj
file lzo1c_9.obj
file lzo1c_99.obj
file lzo1c_9x.obj
file lzo1c_cc.obj
file lzo1c_d1.obj
file lzo1c_d2.obj
file lzo1c_rr.obj
file lzo1c_xx.obj
file lzo1f_1.obj
file lzo1f_9x.obj
file lzo1f_d1.obj
file lzo1f_d2.obj
file lzo1x_1.obj
file lzo1x_1k.obj
file lzo1x_1l.obj
file lzo1x_1o.obj
file lzo1x_9x.obj
file lzo1x_d1.obj
file lzo1x_d2.obj
file lzo1x_d3.obj
file lzo1x_o.obj
file lzo1y_1.obj
file lzo1y_9x.obj
file lzo1y_d1.obj
file lzo1y_d2.obj
file lzo1y_d3.obj
file lzo1y_o.obj
file lzo1z_9x.obj
file lzo1z_d1.obj
file lzo1z_d2.obj
file lzo1z_d3.obj
file lzo2a_9x.obj
file lzo2a_d1.obj
file lzo2a_d2.obj
file lzo_crc.obj
file lzo_dll.obj
file lzo_init.obj
file lzo_ptr.obj
file lzo_str.obj
file lzo_util.obj
|
Added work/contrib/lzo/lzo-1.08/BUGS.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
============================================================================
LZO -- a real-time data compression library
============================================================================
LZO is free of any known bugs.
Nevertheless LZO has been reported to break the optimizer of some
compilers including gcc 2.7.2.1 (AIX, IRIX) and Watcom C 9.5.
So if `ltest' reports data decompression errors you should recompile
everything without optimizations and see if that fixes the problem.
I'd like to hear about optimizer problems and possible workarounds.
Known compiler problems:
------------------------
some versions of gcc use `-O2 -fno-strength-reduce'
some versions of gcc use `-O2 -fno-schedule-insns -fno-schedule-insns2'
Watcom C 9.5 compile with `-oneax' instead of `-oneatx'
|
Added work/contrib/lzo/lzo-1.08/COPYING.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
|
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
|
Added work/contrib/lzo/lzo-1.08/ChangeLog.
|
|
>
>
>
|
1
2
3
|
Sorry, no detailed ChangeLog available yet.
Please see the file NEWS for a list of user visible changes.
|
Added work/contrib/lzo/lzo-1.08/INSTALL.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
|
Introduction
============
This installation guide is for UNIX (Autoconf) systems.
For DOS, Windows and OS/2 please read the file b/00readme.txt.
Quick start
-----------
./configure
make
make check
make test (run a full test)
make install (when logged in as root)
The makefiles should work with most versions of `make' - in
case of troubles I recommend using GNU make.
Shared libraries
----------------
LZO uses Libtool so that shared libraries are supported on
many systems. If you want to build shared libraries type
`./configure --enable-shared'.
Assembler versions
------------------
Assembler versions of the decompressors are built by default on
i386 systems that use GNU C. If your system does not use `gas' or
there are some other problems (e.g. in combination with shared libraries)
you can disable them by typing `./configure --disable-asm'.
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, a file
`config.cache' that saves the results of its tests to speed up
reconfiguring, and a file `config.log' containing compiler output
(useful mainly for debugging `configure').
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If at some point `config.cache'
contains results you don't want to keep, you may remove or edit it.
The file `configure.in' is used to create `configure' by a program
called `autoconf'. You only need `configure.in' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. You can give `configure'
initial values for variables by setting them in the environment. Using
a Bourne-compatible shell, you can do that on the command line like
this:
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
Or on systems that have the `env' program, you can do it like this:
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=PATH' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' can not figure out
automatically, but needs to determine by the type of host the package
will run on. Usually `configure' can figure that out, but if it prints
a message saying it can not guess the host type, give it the
`--host=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name with three fields:
CPU-COMPANY-SYSTEM
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the host type.
If you are building compiler tools for cross-compiling, you can also
use the `--target=TYPE' option to select the type of system they will
produce code for and the `--build=TYPE' option to select the type of
system on which you are compiling the package.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Operation Controls
==================
`configure' recognizes the following options to control how it
operates.
`--cache-file=FILE'
Use and save the results of the tests in FILE instead of
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
debugging `configure'.
`--help'
Print a summary of the options to `configure', and exit.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--version'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`configure' also accepts some other, not widely useful, options.
|
Added work/contrib/lzo/lzo-1.08/Makefile.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
|
# Makefile.in generated by automake 1.6.2 from Makefile.am.
# Makefile. Generated from Makefile.in by configure.
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
#
# Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
#
SHELL = /bin/sh
srcdir = .
top_srcdir = .
prefix = /usr/local
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
sbindir = ${exec_prefix}/sbin
libexecdir = ${exec_prefix}/libexec
datadir = ${prefix}/share
sysconfdir = ${prefix}/etc
sharedstatedir = ${prefix}/com
localstatedir = ${prefix}/var
libdir = ${exec_prefix}/lib
infodir = ${prefix}/info
mandir = ${prefix}/man
includedir = ${prefix}/include
oldincludedir = /usr/include
pkgdatadir = $(datadir)/lzo
pkglibdir = $(libdir)/lzo
pkgincludedir = $(includedir)/lzo
top_builddir = .
ACLOCAL = ${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run aclocal-1.6
AUTOCONF = ${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run autoconf
AUTOMAKE = ${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run automake-1.6
AUTOHEADER = ${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run autoheader
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = /usr/bin/ginstall -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_SCRIPT = ${INSTALL}
INSTALL_HEADER = $(INSTALL_DATA)
transform = s,x,x,
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
host_alias =
host_triplet = i586-pc-linux-gnu
EXEEXT =
OBJEXT = o
PATH_SEPARATOR = :
AMTAR = ${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run tar
AS = @AS@
ASFLAGS = -x assembler-with-cpp
AWK = gawk
CC = gcc
CFLAGS_GCC_OMIT_FRAME_POINTER = -fomit-frame-pointer
CFLAGS_O =
CFLAGS_W =
CFLAGS_W_PEDANTIC =
CLEANFILES = *.bb *.bbg *.da *.gcov bb.out bbtrace* gmon.out
CPP = gcc -E
DEPDIR = .deps
DLLTOOL = @DLLTOOL@
ECHO = echo
INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
LIBTOOL = $(SHELL) $(top_builddir)/libtool
LN_S = ln -s
LZO_ASM_OBJECTS = $(LZO_ASM_OBJECTS_GCC_i386)
LZO_CFLAGS =
MAINT = #
MFX_ARCH = i386
MFX_CC = GCC
MFX_CPU = i586
MOSTLYCLEANFILES = *.i
NASM =
OBJDUMP = @OBJDUMP@
PACKAGE = lzo
RANLIB = ranlib
SRC_VPATH = /i386/src
STRIP = strip
VERSION = 1.08
am__include = include
am__quote =
install_sh = /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/install-sh
liblzo = $(top_builddir)/src/liblzo.la
ltest_LIBS =
AUTOMAKE_OPTIONS = 1.6 gnu
SUBDIRS = include src ltest examples tests minilzo
EXTRA_DIST = BUGS
ACLOCAL_AMFLAGS = -I acconfig/m4
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/acconfig/mkinstalldirs
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
DIST_SOURCES =
RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \
uninstall-info-recursive all-recursive install-data-recursive \
install-exec-recursive installdirs-recursive install-recursive \
uninstall-recursive check-recursive installcheck-recursive
DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \
Makefile.in NEWS THANKS acconfig.h acconfig/compile \
acconfig/config.guess acconfig/config.sub acconfig/depcomp \
acconfig/install-sh acconfig/ltmain.sh acconfig/mdate-sh \
acconfig/missing acconfig/mkinstalldirs acconfig/py-compile \
acconfig/ylwrap acinclude.m4 aclocal.m4 config.hin configure \
configure.in
DIST_SUBDIRS = $(SUBDIRS)
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
.SUFFIXES:
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log
$(srcdir)/Makefile.in: # Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu Makefile
Makefile: # $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)
$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(srcdir)/configure: # $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): # configure.in acinclude.m4 acconfig/m4/bool.m4 acconfig/m4/byteorder.m4 acconfig/m4/ccansi.m4 acconfig/m4/ccbugcast.m4 acconfig/m4/checkergcc.m4 acconfig/m4/cross.m4 acconfig/m4/findfile.m4 acconfig/m4/gccbugsi.m4 acconfig/m4/gccbugsr.m4 acconfig/m4/gnumake.m4 acconfig/m4/limits.m4 acconfig/m4/memcmp.m4 acconfig/m4/pipe.m4 acconfig/m4/promote.m4
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
config.h: stamp-h1
@if test ! -f $@; then \
rm -f stamp-h1; \
$(MAKE) stamp-h1; \
else :; fi
stamp-h1: $(srcdir)/config.hin $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h
$(srcdir)/config.hin: # $(top_srcdir)/configure.in $(ACLOCAL_M4) $(top_srcdir)/acconfig.h
cd $(top_srcdir) && $(AUTOHEADER)
touch $(srcdir)/config.hin
distclean-hdr:
-rm -f config.h stamp-h1
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@set fnord $$MAKEFLAGS; amf=$$2; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@set fnord $$MAKEFLAGS; amf=$$2; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ETAGS = etags
ETAGSFLAGS =
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.hin $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) config.hin $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = .
distdir = $(PACKAGE)-$(VERSION)
am__remove_distdir = \
{ test ! -d $(distdir) \
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -fr $(distdir); }; }
GZIP_ENV = --best
distcleancheck_listfiles = find . -type f -print
distdir: $(DISTFILES)
$(am__remove_distdir)
mkdir $(distdir)
$(mkinstalldirs) $(distdir)/acconfig
@list='$(DISTFILES)'; for file in $$list; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkinstalldirs) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
(cd $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$(top_distdir)" \
distdir=../$(distdir)/$$subdir \
distdir) \
|| exit 1; \
fi; \
done
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="${top_distdir}" distdir="$(distdir)" \
dist-hook
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r $(distdir)
dist-gzip: distdir
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
dist dist-all: distdir
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
$(am__remove_distdir)
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
chmod -R a-w $(distdir); chmod a+w $(distdir)
mkdir $(distdir)/=build
mkdir $(distdir)/=inst
chmod a-w $(distdir)
dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \
&& cd $(distdir)/=build \
&& ../configure --srcdir=.. --prefix=$$dc_install_base \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& (test `find $$dc_install_base -type f -print | wc -l` -le 1 \
|| { echo "ERROR: files left after uninstall:" ; \
find $$dc_install_base -type f -print ; \
exit 1; } >&2 ) \
&& $(MAKE) $(AM_MAKEFLAGS) dist-gzip \
&& rm -f $(distdir).tar.gz \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
$(am__remove_distdir)
@echo "$(distdir).tar.gz is ready for distribution" | \
sed 'h;s/./=/g;p;x;p;x'
distcleancheck: distclean
if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) check-local
check: check-recursive
all-am: Makefile config.h
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
distclean-am: clean-am distclean-generic distclean-hdr distclean-libtool \
distclean-tags
dvi: dvi-recursive
dvi-am:
info: info-recursive
info-am:
install-data-am:
install-exec-am:
install-info: install-info-recursive
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf autom4te.cache
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
uninstall-am: uninstall-info-am
uninstall-info: uninstall-info-recursive
.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am check-local \
clean clean-generic clean-libtool clean-recursive dist dist-all \
dist-gzip distcheck distclean distclean-generic distclean-hdr \
distclean-libtool distclean-recursive distclean-tags \
distcleancheck distdir dvi dvi-am dvi-recursive info info-am \
info-recursive install install-am install-data install-data-am \
install-data-recursive install-exec install-exec-am \
install-exec-recursive install-info install-info-am \
install-info-recursive install-man install-recursive \
install-strip installcheck installcheck-am installdirs \
installdirs-am installdirs-recursive maintainer-clean \
maintainer-clean-generic maintainer-clean-recursive mostlyclean \
mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \
tags tags-recursive uninstall uninstall-am uninstall-info-am \
uninstall-info-recursive uninstall-recursive
# /***********************************************************************
# // automake targets
# ************************************************************************/
dist-hook:
-rm -rf ./$(distdir)/acconfig/
cp -rpi $(srcdir)/B/ $(srcdir)/acconfig/ $(srcdir)/doc/ $(srcdir)/util/ $(distdir)/
-rm -f `find ./$(distdir)/ -type l -print`
-rm -f ./$(distdir)/util/*.fil
check-local: all-am
./ltest/ltest -mlzo -n2 -q $(top_srcdir)/COPYING
@echo
@echo "All checks passed."
@echo
# /***********************************************************************
# // special targets
# ************************************************************************/
basic-test: all
./ltest/ltest -mlzo -n2 -q $(top_srcdir)/COPYING
./tests/align
./tests/chksum
./examples/simple
./minilzo/testmini
test: all
./ltest/ltest -mavail -n10 -q $(top_srcdir)/COPYING
$(SHELL) -e $(top_srcdir)/util/check.sh $(top_srcdir)
./tests/align
./tests/chksum
./examples/simple
./minilzo/testmini
@echo
@echo "All tests passed. Now you are ready to install LZO."
@echo
ltest:
cd src && $(MAKE)
cd ltest && $(MAKE) ltest
#linux-shared:
# CC="$(CC)" $(SHELL) -e $(srcdir)/b/linux/shared.sh
#.PHONY: basic-test check-local dist-hook linux-shared ltest test
#-include $(top_srcdir)/maint/make/top.mk
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
|
Added work/contrib/lzo/lzo-1.08/Makefile.am.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
## Process this file with automake to create Makefile.in
#
# Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
#
AUTOMAKE_OPTIONS = 1.6 gnu
SUBDIRS = include src ltest examples tests minilzo
EXTRA_DIST = BUGS
ACLOCAL_AMFLAGS = -I acconfig/m4
# /***********************************************************************
# // automake targets
# ************************************************************************/
dist-hook:
-rm -rf ./$(distdir)/acconfig/
cp -rpi $(srcdir)/B/ $(srcdir)/acconfig/ $(srcdir)/doc/ $(srcdir)/util/ $(distdir)/
-rm -f `find ./$(distdir)/ -type l -print`
-rm -f ./$(distdir)/util/*.fil
check-local: all-am
./ltest/ltest -mlzo -n2 -q $(top_srcdir)/COPYING
@echo
@echo "All checks passed."
@echo
# /***********************************************************************
# // special targets
# ************************************************************************/
basic-test: all
./ltest/ltest -mlzo -n2 -q $(top_srcdir)/COPYING
./tests/align
./tests/chksum
./examples/simple
./minilzo/testmini
test: all
./ltest/ltest -mavail -n10 -q $(top_srcdir)/COPYING
$(SHELL) -e $(top_srcdir)/util/check.sh $(top_srcdir)
./tests/align
./tests/chksum
./examples/simple
./minilzo/testmini
@echo
@echo "All tests passed. Now you are ready to install LZO."
@echo
ltest:
cd src && $(MAKE)
cd ltest && $(MAKE) ltest
@MAINT@linux-shared:
@MAINT@ CC="$(CC)" $(SHELL) -e $(srcdir)/b/linux/shared.sh
@MAINT@@GMAKE_TRUE@.PHONY: basic-test check-local dist-hook linux-shared ltest test
@MAINT@@GMAKE_TRUE@-include $(top_srcdir)/maint/make/top.mk
|
Added work/contrib/lzo/lzo-1.08/Makefile.in.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
|
# Makefile.in generated by automake 1.6.2 from Makefile.am.
# @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
#
# Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
#
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = .
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
host_alias = @host_alias@
host_triplet = @host@
EXEEXT = @EXEEXT@
OBJEXT = @OBJEXT@
PATH_SEPARATOR = @PATH_SEPARATOR@
AMTAR = @AMTAR@
AS = @AS@
ASFLAGS = @ASFLAGS@
AWK = @AWK@
CC = @CC@
CFLAGS_GCC_OMIT_FRAME_POINTER = @CFLAGS_GCC_OMIT_FRAME_POINTER@
CFLAGS_O = @CFLAGS_O@
CFLAGS_W = @CFLAGS_W@
CFLAGS_W_PEDANTIC = @CFLAGS_W_PEDANTIC@
CLEANFILES = @CLEANFILES@
CPP = @CPP@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
ECHO = @ECHO@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LZO_ASM_OBJECTS = @LZO_ASM_OBJECTS@
LZO_CFLAGS = @LZO_CFLAGS@
MAINT = @MAINT@
MFX_ARCH = @MFX_ARCH@
MFX_CC = @MFX_CC@
MFX_CPU = @MFX_CPU@
MOSTLYCLEANFILES = @MOSTLYCLEANFILES@
NASM = @NASM@
OBJDUMP = @OBJDUMP@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
SRC_VPATH = @SRC_VPATH@
STRIP = @STRIP@
VERSION = @VERSION@
am__include = @am__include@
am__quote = @am__quote@
install_sh = @install_sh@
liblzo = @liblzo@
ltest_LIBS = @ltest_LIBS@
AUTOMAKE_OPTIONS = 1.6 gnu
SUBDIRS = include src ltest examples tests minilzo
EXTRA_DIST = BUGS
ACLOCAL_AMFLAGS = -I acconfig/m4
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/acconfig/mkinstalldirs
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
DIST_SOURCES =
RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \
uninstall-info-recursive all-recursive install-data-recursive \
install-exec-recursive installdirs-recursive install-recursive \
uninstall-recursive check-recursive installcheck-recursive
DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \
Makefile.in NEWS THANKS acconfig.h acconfig/compile \
acconfig/config.guess acconfig/config.sub acconfig/depcomp \
acconfig/install-sh acconfig/ltmain.sh acconfig/mdate-sh \
acconfig/missing acconfig/mkinstalldirs acconfig/py-compile \
acconfig/ylwrap acinclude.m4 aclocal.m4 config.hin configure \
configure.in
DIST_SUBDIRS = $(SUBDIRS)
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
.SUFFIXES:
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu Makefile
Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)
$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in acinclude.m4 acconfig/m4/bool.m4 acconfig/m4/byteorder.m4 acconfig/m4/ccansi.m4 acconfig/m4/ccbugcast.m4 acconfig/m4/checkergcc.m4 acconfig/m4/cross.m4 acconfig/m4/findfile.m4 acconfig/m4/gccbugsi.m4 acconfig/m4/gccbugsr.m4 acconfig/m4/gnumake.m4 acconfig/m4/limits.m4 acconfig/m4/memcmp.m4 acconfig/m4/pipe.m4 acconfig/m4/promote.m4
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
config.h: stamp-h1
@if test ! -f $@; then \
rm -f stamp-h1; \
$(MAKE) stamp-h1; \
else :; fi
stamp-h1: $(srcdir)/config.hin $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h
$(srcdir)/config.hin: @MAINTAINER_MODE_TRUE@ $(top_srcdir)/configure.in $(ACLOCAL_M4) $(top_srcdir)/acconfig.h
cd $(top_srcdir) && $(AUTOHEADER)
touch $(srcdir)/config.hin
distclean-hdr:
-rm -f config.h stamp-h1
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@set fnord $$MAKEFLAGS; amf=$$2; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@set fnord $$MAKEFLAGS; amf=$$2; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ETAGS = etags
ETAGSFLAGS =
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.hin $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) config.hin $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = .
distdir = $(PACKAGE)-$(VERSION)
am__remove_distdir = \
{ test ! -d $(distdir) \
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -fr $(distdir); }; }
GZIP_ENV = --best
distcleancheck_listfiles = find . -type f -print
distdir: $(DISTFILES)
$(am__remove_distdir)
mkdir $(distdir)
$(mkinstalldirs) $(distdir)/acconfig
@list='$(DISTFILES)'; for file in $$list; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkinstalldirs) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
(cd $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$(top_distdir)" \
distdir=../$(distdir)/$$subdir \
distdir) \
|| exit 1; \
fi; \
done
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="${top_distdir}" distdir="$(distdir)" \
dist-hook
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r $(distdir)
dist-gzip: distdir
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
dist dist-all: distdir
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
$(am__remove_distdir)
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
chmod -R a-w $(distdir); chmod a+w $(distdir)
mkdir $(distdir)/=build
mkdir $(distdir)/=inst
chmod a-w $(distdir)
dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \
&& cd $(distdir)/=build \
&& ../configure --srcdir=.. --prefix=$$dc_install_base \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& (test `find $$dc_install_base -type f -print | wc -l` -le 1 \
|| { echo "ERROR: files left after uninstall:" ; \
find $$dc_install_base -type f -print ; \
exit 1; } >&2 ) \
&& $(MAKE) $(AM_MAKEFLAGS) dist-gzip \
&& rm -f $(distdir).tar.gz \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
$(am__remove_distdir)
@echo "$(distdir).tar.gz is ready for distribution" | \
sed 'h;s/./=/g;p;x;p;x'
distcleancheck: distclean
if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) check-local
check: check-recursive
all-am: Makefile config.h
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
distclean-am: clean-am distclean-generic distclean-hdr distclean-libtool \
distclean-tags
dvi: dvi-recursive
dvi-am:
info: info-recursive
info-am:
install-data-am:
install-exec-am:
install-info: install-info-recursive
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf autom4te.cache
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
uninstall-am: uninstall-info-am
uninstall-info: uninstall-info-recursive
.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am check-local \
clean clean-generic clean-libtool clean-recursive dist dist-all \
dist-gzip distcheck distclean distclean-generic distclean-hdr \
distclean-libtool distclean-recursive distclean-tags \
distcleancheck distdir dvi dvi-am dvi-recursive info info-am \
info-recursive install install-am install-data install-data-am \
install-data-recursive install-exec install-exec-am \
install-exec-recursive install-info install-info-am \
install-info-recursive install-man install-recursive \
install-strip installcheck installcheck-am installdirs \
installdirs-am installdirs-recursive maintainer-clean \
maintainer-clean-generic maintainer-clean-recursive mostlyclean \
mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \
tags tags-recursive uninstall uninstall-am uninstall-info-am \
uninstall-info-recursive uninstall-recursive
# /***********************************************************************
# // automake targets
# ************************************************************************/
dist-hook:
-rm -rf ./$(distdir)/acconfig/
cp -rpi $(srcdir)/B/ $(srcdir)/acconfig/ $(srcdir)/doc/ $(srcdir)/util/ $(distdir)/
-rm -f `find ./$(distdir)/ -type l -print`
-rm -f ./$(distdir)/util/*.fil
check-local: all-am
./ltest/ltest -mlzo -n2 -q $(top_srcdir)/COPYING
@echo
@echo "All checks passed."
@echo
# /***********************************************************************
# // special targets
# ************************************************************************/
basic-test: all
./ltest/ltest -mlzo -n2 -q $(top_srcdir)/COPYING
./tests/align
./tests/chksum
./examples/simple
./minilzo/testmini
test: all
./ltest/ltest -mavail -n10 -q $(top_srcdir)/COPYING
$(SHELL) -e $(top_srcdir)/util/check.sh $(top_srcdir)
./tests/align
./tests/chksum
./examples/simple
./minilzo/testmini
@echo
@echo "All tests passed. Now you are ready to install LZO."
@echo
ltest:
cd src && $(MAKE)
cd ltest && $(MAKE) ltest
@MAINT@linux-shared:
@MAINT@ CC="$(CC)" $(SHELL) -e $(srcdir)/b/linux/shared.sh
@MAINT@@GMAKE_TRUE@.PHONY: basic-test check-local dist-hook linux-shared ltest test
@MAINT@@GMAKE_TRUE@-include $(top_srcdir)/maint/make/top.mk
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
|
Added work/contrib/lzo/lzo-1.08/NEWS.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
|
============================================================================
User visible changes for LZO -- a real-time data compression library
============================================================================
Changes in 1.08 (12 Jul 2002)
* much better support for cross compiling
* straighten out ANSI-conforming compiler checks
* avoid harmless compiler warnings reported by -Wcast-align
* fixed some sign extension problems on rather exotic machines where
sizeof(size_t) < sizeof(ptrdiff_t) and sizeof(lzo_uint) == sizeof(size_t)
* updated the configure system to use the latest Autoconf, Automake
and Libtool versions
Changes in 1.07 (18 Oct 2000)
* Default to `--disable-shared' (I'm getting tired of Libtool's
shared library build problems, this time AIX was the culprit)
* As usual, updated the configure system to use the latest
Autoconf, Automake and Libtool versions.
* avoid some harmless compiler warnings.
Changes in 1.06 (29 Nov 1999)
* Updated the configure system to use Autoconf 2.13, Automake 1.4 and
Libtool 1.3.3. This should hopefully fix the shared-library build
problems that were reported on some machines.
* enhanced example programs a little bit
Changes in 1.05 (14 Apr 1998)
* just a one-line change in the configure script to workaround
a HPUX and IRIX building problem
Changes in 1.04 (15 Mar 1998)
* workaround a bug in cpp under HPUX 10.20
* adapted for Automake 1.2f and Libtool 1.1
Changes in 1.03 (18 Jan 1998)
* minor compression ratio improvement
* extended example program to show how to do overlapping compression
* assembler changes, added support for the nasm assembler
* better support for cross-compiling
* some cleanups
Changes in 1.02 (07 Dec 1997)
* improved LZO1X-999 and LZO1Y-999 compression ratio a little bit again
* introduced compression levels for LZO1X-999 and LZO1Y-999
* added support for preset dictionaries
* implemented LZO1X-1(12): needs 16 kB for compression
* new algorithm LZO1Z: this is another variant of LZO1X
* added example program: how to use preset dictionaries
* added example program: how to do in-place decompression
* added a little file-packer example program
* LZO now works cleanly under checkergcc
* strict 16-bit memory model is working (but not officially supported)
* shared libraries are supported on many platforms
* adapted for Automake 1.2d and Libtool 1.0h
Changes in 1.01 (10 Aug 1997)
* improved LZO1X-999 and LZO1Y-999 compression ratio a little bit
* i386+gcc: significant speedup of the C version of the LZO1, LZO1A,
LZO1B and LZO1C decompressors
* added example programs that show how to generate pre-compressed data
* added Makefiles for DOS, Windows and OS/2 targets
Changes in 1.00 (13 Jul 1997)
* added miniLZO - can be easily included in your project
* improved documentation, added LZO.FAQ
* added build scripts for many systems where Autoconf is not available:
Windows 3.1 (LIB+DLL), Windows 95/NT (LIB+DLL), DOS (16+32 bit), OS/2
* adapted for Automake 1.2 and Libtool 1.0
Changes in 0.90 (27 Jun 1997): never released
* LZO now uses GNU Automake 1.0 - lots of configuration changes
* added LZO1X-1(11): this version needs only 8 kB for compression
* implemented LZO1Y-1
* added i386 assembler decompressors for MASM/TASM/WASM
* the name of some assembler functions changed
* the numeric value of some error codes changed
* portability fixes
Changes in 0.29 (04 May 1997)
* Linux ELF shared library support
* workaround for gcc 2.7.2 optimizer bug under AIX
* added lzo_crc32() checksum
Changes in 0.28 (22 Feb 1997)
* new algorithm LZO1Y: LZO1Y-999 and LZO1Y decompressor
* added lzo1x_optimize() and lzo1y_optimize()
* minor speedup in assembler decompressors (i386+gcc)
* ltest.c rewritten
Changes in 0.27 (19 Jan 1997)
* fixed a bug in LZO1B-999 and LZO1C-999 that could produce
invalid compressed data in very rare cases
Changes in 0.26 (18 Jan 1997): never released
* implemented LZO1B-999
* renamed LZO1D to LZO2A (also updated all docs)
* some cleanups
Changes in 0.25 (28 Dec 1996): never released
* some portability fixes (LZO now works on my old Atari ST :-)
* adapted for Autoconf 2.12
Changes in 0.24 (30 Nov 1996): never released
* improved performance of LZO1X assembler decompressor on a Pentium (i386+gcc)
Changes in 0.23 (23 Nov 1996)
* added LZO1C, LZO1F and LZO1X decompressors in assembler (i386+gcc)
* added corresponding LZO_PUBLIC to all LZO_EXTERN functions
* added support for Microsoft C 7.0 (16-bit DOS)
* introduced lzo_uint32. This could prove useful for a strict 16-bit
version that doesn't use `huge' pointers.
* all algorithms use incremental hashing now
* some cleanups and portability fixes
Changes in 0.22 (19 Sep 1996)
* LZO1X: minor decompressor speedup, added some checks in safe decompressor
* Autoconf: added detection of gcc strength-reduction bug
* Makefile changes
Changes in 0.21 (08 Sep 1996)
* LZO now uses GNU Autoconf 2.10 - lots of configuration changes
* a few cosmetical changes
Changes in 0.20 (11 Aug 1996)
* new algorithm LZO1X: LZO1X-1, LZO1X-999 and LZO1X decompressor
* significantly speeded up LZO1B, LZO1C and LZO1F decompressors
on CPUs which allow unaligned memory access (e.g. Intel i386)
* greatly speeded up LZO2A-999 compressor at the cost of some memory
* some cleanups, portability fixes and minor speedups
Changes in 0.16 (22 Jul 1996)
* speeded up LZO1F decompressor a little bit
* improved LZO1F-999 compression ratio
Changes in 0.15 (10 Jul 1996)
* new algorithm LZO1F: LZO1F-1, LZO1F-999 and LZO1F decompressor
* improved LZO2A-999 compression ratio
* removed LZO1E as it is dominated by LZO1F
Changes in 0.14 (06 Jul 1996): never released
* experimental algorithms: LZO1E and LZO1F
* added LZO_EXTERN to all prototypes. Useful when building a DLL.
* improved LZO1C-999 and LZO2A-999 compression ratio a little bit
* fixed progress indicator callback (it was called only once)
Changes in 0.13 (20 Jun 1996)
* some speed improvements in LZO1C-999 and LZO2A-999
Changes in 0.12 (18 Jun 1996): never released
* added LZO1C-999, a slow but nearly optimal compressor
intended for generating pre-compressed data
* added tests for lookbehind-overrun in all safe decompressors
* source tree completely rearranged, some filenames changed
* extensions changed: a .ch file is a C source code that is included
for reasons of code sharing
* new algorithm LZO2A: LZO2A-999 and LZO2A decompressor. There is
no fast compressor yet.
* some cleanups
Changes in 0.11 (29 May 1996)
* source tree rearranged
* LZO now compiles fine as a C++ library (interface still has C linkage)
* improved overall compression ratio a little bit
* LZO1B-99/LZO1C-99 now search for longer matches
* incremental hash is working, it's a little bit faster
* Makefile changed
* added lzo_uint and lzo_sizeof in some places
* split LZO1B compressor into even more include-files
Changes in 0.10 (20 May 1996): first public release of the LZO library
* includes LZO1, LZO1A, LZO1B and LZO1C algorithms
(compression levels 1-9 and 99)
14 Mar 1996:
* public release of the LZO1A algorithm
04 Mar 1996:
* public release of the LZO1 algorithm
|
Added work/contrib/lzo/lzo-1.08/README.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
============================================================================
LZO -- a real-time data compression library
============================================================================
Please read the file doc/LZO.TXT for an introduction to LZO.
See the file doc/LZO.FAQ for various tidbits of information.
See the file NEWS for a list of major changes in the current release.
See the file INSTALL for compilation and installation instructions.
For a quick start how to use LZO look at examples/lpack.c.
Directory overview:
-------------------
acconfig Autoconf configuration files (UNIX specific)
B various support files for DOS, Windows, OS/2, ...
doc documentation
examples example programs
include public header files
minilzo a lightweight subset for easy inclusion in your project
src library source
tests more or less exotic test programs
util some utility scripts
Have fun,
Markus
http://www.oberhumer.com/opensource/lzo/
|
Added work/contrib/lzo/lzo-1.08/THANKS.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
I want to thank the following people for giving feedback, doing
beta-testing or helping me some other way:
Charles W. Sandmann <sandmann@clio.rice.edu>
Frank Donahoe <fdonahoe@wilkes1.wilkes.edu>
Holger Berger <Holger.Berger@rus.uni-stuttgart.de>
Jean-loup Gailly <jloup@gzip.org>
Laszlo Molnar <ml1050@freemail.c3.hu>
Mark Adler <madler@alumni.caltech.edu>
Paul D. Eccles <pde@sd.inri.com>
Rodolphe Ortalo <ortalo@laas.fr>
William Magro <wmagro@TC.Cornell.EDU>
Wolfgang Lugmayr <W.Lugmayr@infosys.tuwien.ac.at>
Natascha
|
Added work/contrib/lzo/lzo-1.08/acconfig.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
/* acconfig.h -- autoheader configuration file
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#ifndef __LZO_CONFIG_H
#define __LZO_CONFIG_H
/* $TOP$ */
@TOP@
/* acconfig.h
Descriptive text for the C preprocessor macros that
the distributed Autoconf macros can define.
No software package will use all of them; autoheader copies the ones
your configure.in uses into your configuration header file templates.
The entries are in sort -df order: alphabetical, case insensitive,
ignoring punctuation (such as underscores). Although this order
can split up related entries, it makes it easier to check whether
a given entry is in the file.
Leave the following blank line there!! Autoheader needs it. */
/* Define if your machine can copy aligned words much faster than bytes. */
#undef LZO_ALIGNED_OK_4
/* Define for machines where assembler versions are not available. */
#undef LZO_NO_ASM
/* Define for machines that can access unaligned short words. */
#undef LZO_UNALIGNED_OK_2
/* Define for machines that can access unaligned words. */
#undef LZO_UNALIGNED_OK_4
/* Define to your architecture name. */
#undef MFX_ARCH
/* Define for machines where ".align 4" means align to a 4 byte boundary. */
#undef MFX_ASM_ALIGN_BYTES
/* Define for machines where ".align 4" means align to a 2**4 boundary. */
#undef MFX_ASM_ALIGN_PTWO
/* Define for i386 machines where the ebp register is reserved. */
#undef MFX_ASM_CANNOT_USE_EBP
/* Define for machines where the assmbler understands ".type". */
#undef MFX_ASM_HAVE_TYPE
/* Define for machines where global symbols don't have leading underscores. */
#undef MFX_ASM_NAME_NO_UNDERSCORES
/* Define if your compiler is broken. */
#undef MFX_PROG_CC_BUG_SIGNED_TO_UNSIGNED_CASTING
/* Define to your byte order. */
#undef MFX_BYTE_ORDER
/* Define to your CPU name. */
#undef MFX_CPU
/* Define if your memcmp is broken. */
#undef NO_MEMCMP
/* Leave that blank line there!! Autoheader needs it.
If you're adding to this file, keep in mind:
The entries are in sort -df order: alphabetical, case insensitive,
ignoring punctuation (such as underscores). */
@BOTTOM@
/* $BOTTOM$ */
#ifdef __cplusplus
# undef /**/ const
#endif
#if defined(HAVE_SYS_RESOURCE_H) && !defined(TIME_WITH_SYS_TIME)
# undef /**/ HAVE_SYS_RESOURCE_H
#endif
#if defined(HAVE_SYS_TIMES_H) && !defined(TIME_WITH_SYS_TIME)
# undef /**/ HAVE_SYS_TIMES_H
#endif
#if !defined(HAVE_LIBZ)
# undef /**/ HAVE_ZLIB_H
#endif
#if defined(NO_MEMCMP)
# undef /**/ HAVE_MEMCMP
#endif
#if (SIZEOF_CHAR_P <= 0)
# undef /**/ SIZEOF_CHAR_P
#endif
#if (SIZEOF_PTRDIFF_T <= 0)
# undef /**/ SIZEOF_PTRDIFF_T
#endif
#if (SIZEOF_UNSIGNED <= 0)
# undef /**/ SIZEOF_UNSIGNED
#endif
#if (SIZEOF_UNSIGNED_LONG <= 0)
# undef /**/ SIZEOF_UNSIGNED_LONG
#endif
#if (SIZEOF_UNSIGNED_SHORT <= 0)
# undef /**/ SIZEOF_UNSIGNED_SHORT
#endif
#if (SIZEOF_SIZE_T <= 0)
# undef /**/ SIZEOF_SIZE_T
#endif
#endif /* already included */
/*
vi:ts=4
*/
|
Added work/contrib/lzo/lzo-1.08/acconfig/compile.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
#! /bin/sh
# Wrapper for compilers which do not understand `-c -o'.
# Copyright 1999, 2000 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Usage:
# compile PROGRAM [ARGS]...
# `-o FOO.o' is removed from the args passed to the actual compile.
prog=$1
shift
ofile=
cfile=
args=
while test $# -gt 0; do
case "$1" in
-o)
# configure might choose to run compile as `compile cc -o foo foo.c'.
# So we do something ugly here.
ofile=$2
shift
case "$ofile" in
*.o | *.obj)
;;
*)
args="$args -o $ofile"
ofile=
;;
esac
;;
*.c)
cfile=$1
args="$args $1"
;;
*)
args="$args $1"
;;
esac
shift
done
if test -z "$ofile" || test -z "$cfile"; then
# If no `-o' option was seen then we might have been invoked from a
# pattern rule where we don't need one. That is ok -- this is a
# normal compilation that the losing compiler can handle. If no
# `.c' file was seen then we are probably linking. That is also
# ok.
exec "$prog" $args
fi
# Name of file we expect compiler to create.
cofile=`echo $cfile | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
# Create the lock directory.
# Note: use `[/.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo $cofile | sed -e 's|[/.-]|_|g'`.d
while true; do
if mkdir $lockdir > /dev/null 2>&1; then
break
fi
sleep 1
done
# FIXME: race condition here if user kills between mkdir and trap.
trap "rmdir $lockdir; exit 1" 1 2 15
# Run the compile.
"$prog" $args
status=$?
if test -f "$cofile"; then
mv "$cofile" "$ofile"
fi
rmdir $lockdir
exit $status
|
Added work/contrib/lzo/lzo-1.08/acconfig/config.guess.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
|
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002 Free Software Foundation, Inc.
timestamp='2002-07-09'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Per Bothner <per@bothner.com>.
# Please send patches to <config-patches@gnu.org>. Submit a context
# diff and a properly formatted ChangeLog entry.
#
# This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and
# exits with 0. Otherwise, it exits with 1.
#
# The plan is that this can be called by configure scripts if you
# don't specify an explicit build system type.
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION]
Output the configuration name of the system \`$me' is run on.
Operation modes:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit 0 ;;
--version | -v )
echo "$version" ; exit 0 ;;
--help | --h* | -h )
echo "$usage"; exit 0 ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "$me: invalid option $1$help" >&2
exit 1 ;;
* )
break ;;
esac
done
if test $# != 0; then
echo "$me: too many arguments$help" >&2
exit 1
fi
trap 'exit 1' 1 2 15
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
# compiler to aid in system detection is discouraged as it requires
# temporary files to be created and, as you can see below, it is a
# headache to deal with in a portable fashion.
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
# use `HOST_CC' if defined, but it is deprecated.
# This shell variable is my proudest work .. or something. --bje
set_cc_for_build='tmpdir=${TMPDIR-/tmp}/config-guess-$$ ;
(old=`umask` && umask 077 && mkdir $tmpdir && umask $old && unset old)
|| (echo "$me: cannot create $tmpdir" >&2 && exit 1) ;
dummy=$tmpdir/dummy ;
files="$dummy.c $dummy.o $dummy.rel $dummy" ;
trap '"'"'rm -f $files; rmdir $tmpdir; exit 1'"'"' 1 2 15 ;
case $CC_FOR_BUILD,$HOST_CC,$CC in
,,) echo "int x;" > $dummy.c ;
for c in cc gcc c89 c99 ; do
if ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; then
CC_FOR_BUILD="$c"; break ;
fi ;
done ;
rm -f $files ;
if test x"$CC_FOR_BUILD" = x ; then
CC_FOR_BUILD=no_compiler_found ;
fi
;;
,,*) CC_FOR_BUILD=$CC ;;
,*,*) CC_FOR_BUILD=$HOST_CC ;;
esac ;
unset files'
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
PATH=$PATH:/.attbin ; export PATH
fi
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or
# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
# switched to ELF, *-*-netbsd* would select the old
# object file format. This provides both forward
# compatibility and a consistent mechanism for selecting the
# object file format.
#
# Note: NetBSD doesn't particularly care about the vendor
# portion of the name. We always set it to "unknown".
sysctl="sysctl -n hw.machine_arch"
UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
/usr/sbin/$sysctl 2>/dev/null || echo unknown)`
case "${UNAME_MACHINE_ARCH}" in
armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
esac
# The Operating System including object format, if it has switched
# to ELF recently, or will in the future.
case "${UNAME_MACHINE_ARCH}" in
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
eval $set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep __ELF__ >/dev/null
then
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
# Return netbsd for either. FIX?
os=netbsd
else
os=netbsdelf
fi
;;
*)
os=netbsd
;;
esac
# The OS release
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
exit 0 ;;
amiga:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
arc:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
hp300:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
mac68k:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
macppc:OpenBSD:*:*)
echo powerpc-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
mvme68k:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
mvme88k:OpenBSD:*:*)
echo m88k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
mvmeppc:OpenBSD:*:*)
echo powerpc-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
pmax:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
sgi:OpenBSD:*:*)
echo mipseb-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
sun3:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
wgrisc:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
*:OpenBSD:*:*)
echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
alpha:OSF1:*:*)
if test $UNAME_RELEASE = "V4.0"; then
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
fi
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
cat <<EOF >$dummy.s
.data
\$Lformat:
.byte 37,100,45,37,120,10,0 # "%d-%x\n"
.text
.globl main
.align 4
.ent main
main:
.frame \$30,16,\$26,0
ldgp \$29,0(\$27)
.prologue 1
.long 0x47e03d80 # implver \$0
lda \$2,-1
.long 0x47e20c21 # amask \$2,\$1
lda \$16,\$Lformat
mov \$0,\$17
not \$1,\$18
jsr \$26,printf
ldgp \$29,0(\$26)
mov 0,\$16
jsr \$26,exit
.end main
EOF
eval $set_cc_for_build
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
if test "$?" = 0 ; then
case `$dummy` in
0-0)
UNAME_MACHINE="alpha"
;;
1-0)
UNAME_MACHINE="alphaev5"
;;
1-1)
UNAME_MACHINE="alphaev56"
;;
1-101)
UNAME_MACHINE="alphapca56"
;;
2-303)
UNAME_MACHINE="alphaev6"
;;
2-307)
UNAME_MACHINE="alphaev67"
;;
2-1307)
UNAME_MACHINE="alphaev68"
;;
esac
fi
rm -f $dummy.s $dummy && rmdir $tmpdir
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
exit 0 ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead
# of the specific Alpha model?
echo alpha-pc-interix
exit 0 ;;
21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5
exit 0 ;;
Amiga*:UNIX_System_V:4.0:*)
echo m68k-unknown-sysv4
exit 0;;
*:[Aa]miga[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-amigaos
exit 0 ;;
*:[Mm]orph[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-morphos
exit 0 ;;
*:OS/390:*:*)
echo i370-ibm-openedition
exit 0 ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit 0;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
exit 0;;
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
if test "`(/bin/universe) 2>/dev/null`" = att ; then
echo pyramid-pyramid-sysv3
else
echo pyramid-pyramid-bsd
fi
exit 0 ;;
NILE*:*:*:dcosx)
echo pyramid-pyramid-svr4
exit 0 ;;
DRS?6000:UNIX_SV:4.2*:7*)
case `/usr/bin/uname -p` in
sparc) echo sparc-icl-nx7 && exit 0 ;;
esac ;;
sun4H:SunOS:5.*:*)
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
i86pc:SunOS:5.*:*)
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
sun4*:SunOS:*:*)
case "`/usr/bin/arch -k`" in
Series*|S4*)
UNAME_RELEASE=`uname -v`
;;
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
exit 0 ;;
sun3*:SunOS:*:*)
echo m68k-sun-sunos${UNAME_RELEASE}
exit 0 ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
case "`/bin/arch`" in
sun3)
echo m68k-sun-sunos${UNAME_RELEASE}
;;
sun4)
echo sparc-sun-sunos${UNAME_RELEASE}
;;
esac
exit 0 ;;
aushp:SunOS:*:*)
echo sparc-auspex-sunos${UNAME_RELEASE}
exit 0 ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
# "atarist" or "atariste" at least should have a processor
# > m68000). The system name ranges from "MiNT" over "FreeMiNT"
# to the lowercase version "mint" (or "freemint"). Finally
# the system name "TOS" denotes a system which is actually not
# MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit 0 ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit 0 ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit 0 ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
echo m68k-milan-mint${UNAME_RELEASE}
exit 0 ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
echo m68k-hades-mint${UNAME_RELEASE}
exit 0 ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
echo m68k-unknown-mint${UNAME_RELEASE}
exit 0 ;;
powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE}
exit 0 ;;
RISC*:Mach:*:*)
echo mips-dec-mach_bsd4.3
exit 0 ;;
RISC*:ULTRIX:*:*)
echo mips-dec-ultrix${UNAME_RELEASE}
exit 0 ;;
VAX*:ULTRIX*:*:*)
echo vax-dec-ultrix${UNAME_RELEASE}
exit 0 ;;
2020:CLIX:*:* | 2430:CLIX:*:*)
echo clipper-intergraph-clix${UNAME_RELEASE}
exit 0 ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
#endif
#if defined (host_mips) && defined (MIPSEB)
#if defined (SYSTYPE_SYSV)
printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_SVR4)
printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
#endif
#endif
exit (-1);
}
EOF
$CC_FOR_BUILD $dummy.c -o $dummy \
&& $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
&& rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
rm -f $dummy.c $dummy && rmdir $tmpdir
echo mips-mips-riscos${UNAME_RELEASE}
exit 0 ;;
Motorola:PowerMAX_OS:*:*)
echo powerpc-motorola-powermax
exit 0 ;;
Night_Hawk:*:*:PowerMAX_OS)
echo powerpc-harris-powermax
exit 0 ;;
Night_Hawk:Power_UNIX:*:*)
echo powerpc-harris-powerunix
exit 0 ;;
m88k:CX/UX:7*:*)
echo m88k-harris-cxux7
exit 0 ;;
m88k:*:4*:R4*)
echo m88k-motorola-sysv4
exit 0 ;;
m88k:*:3*:R3*)
echo m88k-motorola-sysv3
exit 0 ;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
[ ${TARGET_BINARY_INTERFACE}x = x ]
then
echo m88k-dg-dgux${UNAME_RELEASE}
else
echo m88k-dg-dguxbcs${UNAME_RELEASE}
fi
else
echo i586-dg-dgux${UNAME_RELEASE}
fi
exit 0 ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
exit 0 ;;
M88*:*:R3*:*)
# Delta 88k system running SVR3
echo m88k-motorola-sysv3
exit 0 ;;
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
echo m88k-tektronix-sysv3
exit 0 ;;
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
echo m68k-tektronix-bsd
exit 0 ;;
*:IRIX*:*:*)
echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
exit 0 ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
i*86:AIX:*:*)
echo i386-ibm-aix
exit 0 ;;
ia64:AIX:*:*)
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
exit 0 ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include <sys/systemcfg.h>
main()
{
if (!__power_pc())
exit(1);
puts("powerpc-ibm-aix3.2.5");
exit(0);
}
EOF
$CC_FOR_BUILD $dummy.c -o $dummy && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
rm -f $dummy.c $dummy && rmdir $tmpdir
echo rs6000-ibm-aix3.2.5
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2.4
else
echo rs6000-ibm-aix3.2
fi
exit 0 ;;
*:AIX:*:[45])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
fi
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${IBM_ARCH}-ibm-aix${IBM_REV}
exit 0 ;;
*:AIX:*:*)
echo rs6000-ibm-aix
exit 0 ;;
ibmrt:4.4BSD:*|romp-ibm:BSD:*)
echo romp-ibm-bsd4.4
exit 0 ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
exit 0 ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
echo rs6000-bull-bosx
exit 0 ;;
DPX/2?00:B.O.S.:*:*)
echo m68k-bull-sysv3
exit 0 ;;
9000/[34]??:4.3bsd:1.*:*)
echo m68k-hp-bsd
exit 0 ;;
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
echo m68k-hp-bsd4.4
exit 0 ;;
9000/[34678]??:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
case "${UNAME_MACHINE}" in
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
if [ -x /usr/bin/getconf ]; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case "${sc_cpu_version}" in
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
case "${sc_kernel_bits}" in
32) HP_ARCH="hppa2.0n" ;;
64) HP_ARCH="hppa2.0w" ;;
'') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
esac ;;
esac
fi
if [ "${HP_ARCH}" = "" ]; then
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#define _HPUX_SOURCE
#include <stdlib.h>
#include <unistd.h>
int main ()
{
#if defined(_SC_KERNEL_BITS)
long bits = sysconf(_SC_KERNEL_BITS);
#endif
long cpu = sysconf (_SC_CPU_VERSION);
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
case CPU_PA_RISC2_0:
#if defined(_SC_KERNEL_BITS)
switch (bits)
{
case 64: puts ("hppa2.0w"); break;
case 32: puts ("hppa2.0n"); break;
default: puts ("hppa2.0"); break;
} break;
#else /* !defined(_SC_KERNEL_BITS) */
puts ("hppa2.0"); break;
#endif
default: puts ("hppa1.0"); break;
}
exit (0);
}
EOF
(CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`$dummy`
if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
rm -f $dummy.c $dummy && rmdir $tmpdir
fi ;;
esac
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit 0 ;;
ia64:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ia64-hp-hpux${HPUX_REV}
exit 0 ;;
3050*:HI-UX:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include <unistd.h>
int
main ()
{
long cpu = sysconf (_SC_CPU_VERSION);
/* The order matters, because CPU_IS_HP_MC68K erroneously returns
true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
results, however. */
if (CPU_IS_PA_RISC (cpu))
{
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
default: puts ("hppa-hitachi-hiuxwe2"); break;
}
}
else if (CPU_IS_HP_MC68K (cpu))
puts ("m68k-hitachi-hiuxwe2");
else puts ("unknown-hitachi-hiuxwe2");
exit (0);
}
EOF
$CC_FOR_BUILD $dummy.c -o $dummy && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
rm -f $dummy.c $dummy && rmdir $tmpdir
echo unknown-hitachi-hiuxwe2
exit 0 ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
echo hppa1.1-hp-bsd
exit 0 ;;
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
exit 0 ;;
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
echo hppa1.0-hp-mpeix
exit 0 ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
echo hppa1.1-hp-osf
exit 0 ;;
hp8??:OSF1:*:*)
echo hppa1.0-hp-osf
exit 0 ;;
i*86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
echo ${UNAME_MACHINE}-unknown-osf1mk
else
echo ${UNAME_MACHINE}-unknown-osf1
fi
exit 0 ;;
parisc*:Lites*:*:*)
echo hppa1.1-hp-lites
exit 0 ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
exit 0 ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit 0 ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd
exit 0 ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd
exit 0 ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
exit 0 ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*[A-Z]90:*:*:*)
echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*T3D:*:*:*)
echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*T3E:*:*:*)
echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*SV1:*:*:*)
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit 0 ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit 0 ;;
sparc*:BSD/OS:*:*)
echo sparc-unknown-bsdi${UNAME_RELEASE}
exit 0 ;;
*:BSD/OS:*:*)
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit 0 ;;
*:FreeBSD:*:*)
# Determine whether the default compiler uses glibc.
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include <features.h>
#if __GLIBC__ >= 2
LIBC=gnu
#else
LIBC=
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
rm -f $dummy.c && rmdir $tmpdir
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
exit 0 ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
exit 0 ;;
i*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit 0 ;;
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit 0 ;;
x86:Interix*:3*)
echo i386-pc-interix3
exit 0 ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
# UNAME_MACHINE based on the output of uname instead of i386?
echo i386-pc-interix
exit 0 ;;
i*:UWIN*:*)
echo ${UNAME_MACHINE}-pc-uwin
exit 0 ;;
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin
exit 0 ;;
prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
*:GNU:*:*)
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit 0 ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit 0 ;;
arm*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
mips:Linux:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#undef CPU
#undef mips
#undef mipsel
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
CPU=mipsel
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
CPU=mips
#else
CPU=
#endif
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
rm -f $dummy.c && rmdir $tmpdir
test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0
;;
ppc:Linux:*:*)
echo powerpc-unknown-linux-gnu
exit 0 ;;
ppc64:Linux:*:*)
echo powerpc64-unknown-linux-gnu
exit 0 ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
EV5) UNAME_MACHINE=alphaev5 ;;
EV56) UNAME_MACHINE=alphaev56 ;;
PCA56) UNAME_MACHINE=alphapca56 ;;
PCA57) UNAME_MACHINE=alphapca56 ;;
EV6) UNAME_MACHINE=alphaev6 ;;
EV67) UNAME_MACHINE=alphaev67 ;;
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
exit 0 ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
PA7*) echo hppa1.1-unknown-linux-gnu ;;
PA8*) echo hppa2.0-unknown-linux-gnu ;;
*) echo hppa-unknown-linux-gnu ;;
esac
exit 0 ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
echo hppa64-unknown-linux-gnu
exit 0 ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux
exit 0 ;;
sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
x86_64:Linux:*:*)
echo x86_64-unknown-linux-gnu
exit 0 ;;
i*86:Linux:*:*)
# The BFD linker knows what the default object file format is, so
# first see if it will tell us. cd to the root directory to prevent
# problems with other programs or directories called `ld' in the path.
# Set LC_ALL=C to ensure ld outputs messages in English.
ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
| sed -ne '/supported targets:/!d
s/[ ][ ]*/ /g
s/.*supported targets: *//
s/ .*//
p'`
case "$ld_supported_targets" in
elf32-i386)
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
;;
a.out-i386-linux)
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
exit 0 ;;
coff-i386)
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
exit 0 ;;
"")
# Either a pre-BFD a.out linker (linux-gnuoldld) or
# one that does not give us useful --help.
echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
exit 0 ;;
esac
# Determine whether the default compiler is a.out or elf
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include <features.h>
#ifdef __ELF__
# ifdef __GLIBC__
# if __GLIBC__ >= 2
LIBC=gnu
# else
LIBC=gnulibc1
# endif
# else
LIBC=gnulibc1
# endif
#else
#ifdef __INTEL_COMPILER
LIBC=gnu
#else
LIBC=gnuaout
#endif
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
rm -f $dummy.c && rmdir $tmpdir
test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both
# sysname and nodename.
echo i386-sequent-sysv4
exit 0 ;;
i*86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
# I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit 0 ;;
i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
else
echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
fi
exit 0 ;;
i*86:*:5:[78]*)
case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
exit 0 ;;
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
elif /bin/uname -X 2>/dev/null >/dev/null ; then
UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
&& UNAME_MACHINE=i686
(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
&& UNAME_MACHINE=i686
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
else
echo ${UNAME_MACHINE}-pc-sysv32
fi
exit 0 ;;
i*86:*DOS:*:*)
echo ${UNAME_MACHINE}-pc-msdosdjgpp
exit 0 ;;
pc:*:*:*)
# Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i386.
echo i386-pc-msdosdjgpp
exit 0 ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
exit 0 ;;
paragon:*:*:*)
echo i860-intel-osf1
exit 0 ;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
fi
exit 0 ;;
mini*:CTIX:SYS*5:*)
# "miniframe"
echo m68010-convergent-sysv
exit 0 ;;
M68*:*:R3V[567]*:*)
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& echo i486-ncr-sysv4.3${OS_REL} && exit 0
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& echo i486-ncr-sysv4 && exit 0 ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
echo m68k-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit 0 ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
TSUNAMI:LynxOS:2.*:*)
echo sparc-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
rs6000:LynxOS:2.*:*)
echo rs6000-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
echo powerpc-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv${UNAME_RELEASE}
exit 0 ;;
RM*:ReliantUNIX-*:*:*)
echo mips-sni-sysv4
exit 0 ;;
RM*:SINIX-*:*:*)
echo mips-sni-sysv4
exit 0 ;;
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
echo ${UNAME_MACHINE}-sni-sysv4
else
echo ns32k-sni-sysv
fi
exit 0 ;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says <Richard.M.Bartel@ccMail.Census.GOV>
echo i586-unisys-sysv4
exit 0 ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes <hewes@openmarket.com>.
# How about differentiating between stratus architectures? -djm
echo hppa1.1-stratus-sysv4
exit 0 ;;
*:*:*:FTX*)
# From seanf@swdc.stratus.com.
echo i860-stratus-sysv4
exit 0 ;;
*:VOS:*:*)
# From Paul.Green@stratus.com.
echo hppa1.1-stratus-vos
exit 0 ;;
mc68*:A/UX:*:*)
echo m68k-apple-aux${UNAME_RELEASE}
exit 0 ;;
news*:NEWS-OS:6*:*)
echo mips-sony-newsos6
exit 0 ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
else
echo mips-unknown-sysv${UNAME_RELEASE}
fi
exit 0 ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
echo powerpc-be-beos
exit 0 ;;
BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
echo powerpc-apple-beos
exit 0 ;;
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
echo i586-pc-beos
exit 0 ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
exit 0 ;;
SX-5:SUPER-UX:*:*)
echo sx5-nec-superux${UNAME_RELEASE}
exit 0 ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
*:Rhapsody:*:*)
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
*:Darwin:*:*)
echo `uname -p`-apple-darwin${UNAME_RELEASE}
exit 0 ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
if test "$UNAME_PROCESSOR" = "x86"; then
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
fi
echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
exit 0 ;;
*:QNX:*:4*)
echo i386-pc-qnx
exit 0 ;;
NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
exit 0 ;;
*:NonStop-UX:*:*)
echo mips-compaq-nonstopux
exit 0 ;;
BS2000:POSIX*:*:*)
echo bs2000-siemens-sysv
exit 0 ;;
DS/*:UNIX_System_V:*:*)
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
exit 0 ;;
*:Plan9:*:*)
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
# operating systems.
if test "$cputype" = "386"; then
UNAME_MACHINE=i386
else
UNAME_MACHINE="$cputype"
fi
echo ${UNAME_MACHINE}-unknown-plan9
exit 0 ;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
echo ${UNAME_MACHINE}-pc-os2-emx
exit 0 ;;
*:TOPS-10:*:*)
echo pdp10-unknown-tops10
exit 0 ;;
*:TENEX:*:*)
echo pdp10-unknown-tenex
exit 0 ;;
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
echo pdp10-dec-tops20
exit 0 ;;
XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
echo pdp10-xkl-tops20
exit 0 ;;
*:TOPS-20:*:*)
echo pdp10-unknown-tops20
exit 0 ;;
*:ITS:*:*)
echo pdp10-unknown-its
exit 0 ;;
i*86:XTS-300:*:STOP)
echo ${UNAME_MACHINE}-unknown-stop
exit 0 ;;
i*86:atheos:*:*)
echo ${UNAME_MACHINE}-unknown-atheos
exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
eval $set_cc_for_build
cat >$dummy.c <<EOF
#ifdef _SEQUENT_
# include <sys/types.h>
# include <sys/utsname.h>
#endif
main ()
{
#if defined (sony)
#if defined (MIPSEB)
/* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
I don't know.... */
printf ("mips-sony-bsd\n"); exit (0);
#else
#include <sys/param.h>
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
"4"
#else
""
#endif
); exit (0);
#endif
#endif
#if defined (__arm) && defined (__acorn) && defined (__unix)
printf ("arm-acorn-riscix"); exit (0);
#endif
#if defined (hp300) && !defined (hpux)
printf ("m68k-hp-bsd\n"); exit (0);
#endif
#if defined (NeXT)
#if !defined (__ARCHITECTURE__)
#define __ARCHITECTURE__ "m68k"
#endif
int version;
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
if (version < 4)
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
else
printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
exit (0);
#endif
#if defined (MULTIMAX) || defined (n16)
#if defined (UMAXV)
printf ("ns32k-encore-sysv\n"); exit (0);
#else
#if defined (CMU)
printf ("ns32k-encore-mach\n"); exit (0);
#else
printf ("ns32k-encore-bsd\n"); exit (0);
#endif
#endif
#endif
#if defined (__386BSD__)
printf ("i386-pc-bsd\n"); exit (0);
#endif
#if defined (sequent)
#if defined (i386)
printf ("i386-sequent-dynix\n"); exit (0);
#endif
#if defined (ns32000)
printf ("ns32k-sequent-dynix\n"); exit (0);
#endif
#endif
#if defined (_SEQUENT_)
struct utsname un;
uname(&un);
if (strncmp(un.version, "V2", 2) == 0) {
printf ("i386-sequent-ptx2\n"); exit (0);
}
if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
printf ("i386-sequent-ptx1\n"); exit (0);
}
printf ("i386-sequent-ptx\n"); exit (0);
#endif
#if defined (vax)
# if !defined (ultrix)
# include <sys/param.h>
# if defined (BSD)
# if BSD == 43
printf ("vax-dec-bsd4.3\n"); exit (0);
# else
# if BSD == 199006
printf ("vax-dec-bsd4.3reno\n"); exit (0);
# else
printf ("vax-dec-bsd\n"); exit (0);
# endif
# endif
# else
printf ("vax-dec-bsd\n"); exit (0);
# endif
# else
printf ("vax-dec-ultrix\n"); exit (0);
# endif
#endif
#if defined (alliant) && defined (i860)
printf ("i860-alliant-bsd\n"); exit (0);
#endif
exit (1);
}
EOF
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
rm -f $dummy.c $dummy && rmdir $tmpdir
# Apollos put the system type in the environment.
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
# Convex versions that predate uname can use getsysinfo(1)
if [ -x /usr/convex/getsysinfo ]
then
case `getsysinfo -f cpu_type` in
c1*)
echo c1-convex-bsd
exit 0 ;;
c2*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit 0 ;;
c34*)
echo c34-convex-bsd
exit 0 ;;
c38*)
echo c38-convex-bsd
exit 0 ;;
c4*)
echo c4-convex-bsd
exit 0 ;;
esac
fi
cat >&2 <<EOF
$0: unable to guess system type
This script, last modified $timestamp, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
ftp://ftp.gnu.org/pub/gnu/config/
If the version you run ($0) is already up to date, please
send the following data and any information you think might be
pertinent to <config-patches@gnu.org> in order to provide the needed
information to handle your system.
config.guess timestamp = $timestamp
uname -m = `(uname -m) 2>/dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
uname -s = `(uname -s) 2>/dev/null || echo unknown`
uname -v = `(uname -v) 2>/dev/null || echo unknown`
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
hostinfo = `(hostinfo) 2>/dev/null`
/bin/universe = `(/bin/universe) 2>/dev/null`
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
/bin/arch = `(/bin/arch) 2>/dev/null`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
UNAME_MACHINE = ${UNAME_MACHINE}
UNAME_RELEASE = ${UNAME_RELEASE}
UNAME_SYSTEM = ${UNAME_SYSTEM}
UNAME_VERSION = ${UNAME_VERSION}
EOF
exit 1
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
|
Added work/contrib/lzo/lzo-1.08/acconfig/config.sub.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
|
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002 Free Software Foundation, Inc.
timestamp='2002-07-03'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
# can handle that machine. It does not imply ALL GNU software can.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Please send patches to <config-patches@gnu.org>. Submit a context
# diff and a properly formatted ChangeLog entry.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
# If it is invalid, we print an error message on stderr and exit with code 1.
# Otherwise, we print the canonical config type on stdout and succeed.
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
# that are meaningful with *any* GNU software.
# Each package is responsible for reporting which valid configurations
# it does not support. The user should be able to distinguish
# a failure to support a valid configuration from a meaningless
# configuration.
# The goal of this file is to map all the various variations of a given
# machine specification into a single specification in the form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# or in some cases, the newer four-part form:
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# It is wrong to echo any other type of specification.
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION] CPU-MFR-OPSYS
$0 [OPTION] ALIAS
Canonicalize a configuration name.
Operation modes:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit 0 ;;
--version | -v )
echo "$version" ; exit 0 ;;
--help | --h* | -h )
echo "$usage"; exit 0 ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "$me: invalid option $1$help"
exit 1 ;;
*local*)
# First pass through any local machine types.
echo $1
exit 0;;
* )
break ;;
esac
done
case $# in
0) echo "$me: missing argument$help" >&2
exit 1;;
1) ;;
*) echo "$me: too many arguments$help" >&2
exit 1;;
esac
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | freebsd*-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
*)
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
if [ $basic_machine != $1 ]
then os=`echo $1 | sed 's/.*-/-/'`
else os=; fi
;;
esac
### Let's recognize common machines as not being operating systems so
### that things like config.sub decstation-3100 work. We also
### recognize some manufacturers as not being operating systems, so we
### can provide default operating systems below.
case $os in
-sun*os*)
# Prevent following clause from handling this invalid input.
;;
-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-apple | -axis)
os=
basic_machine=$1
;;
-sim | -cisco | -oki | -wec | -winbond)
os=
basic_machine=$1
;;
-scout)
;;
-wrs)
os=-vxworks
basic_machine=$1
;;
-chorusos*)
os=-chorusos
basic_machine=$1
;;
-chorusrdb)
os=-chorusrdb
basic_machine=$1
;;
-hiux*)
os=-hiuxwe2
;;
-sco5)
os=-sco3.2v5
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco4)
os=-sco3.2v4
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco3.2.[4-9]*)
os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco3.2v[4-9]*)
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco*)
os=-sco3.2v2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-udk*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-isc)
os=-isc2.2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-clix*)
basic_machine=clipper-intergraph
;;
-isc*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-lynx*)
os=-lynxos
;;
-ptx*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
;;
-windowsnt*)
os=`echo $os | sed -e 's/windowsnt/winnt/'`
;;
-psos*)
os=-psos
;;
-mint | -mint[0-9]*)
basic_machine=m68k-atari
os=-mint
;;
esac
# Decode aliases for certain CPU-COMPANY combinations.
case $basic_machine in
# Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below.
1750a | 580 \
| a29k \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
| fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
| ip2k \
| m32r | m68000 | m68k | m88k | mcore \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
| mips64orion | mips64orionel \
| mips64vr4100 | mips64vr4100el \
| mips64vr4300 | mips64vr4300el \
| mips64vr5000 | mips64vr5000el \
| mipsisa32 | mipsisa32el \
| mipsisa64 | mipsisa64el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
| ns16k | ns32k \
| openrisc | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \
| sh | sh[1234] | sh3e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
| strongarm \
| tahoe | thumb | tic80 | tron \
| v850 | v850e \
| we32k \
| x86 | xscale | xstormy16 | xtensa \
| z8k)
basic_machine=$basic_machine-unknown
;;
m6811 | m68hc11 | m6812 | m68hc12)
# Motorola 68HC11/12.
basic_machine=$basic_machine-unknown
os=-none
;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
i*86 | x86_64)
basic_machine=$basic_machine-pc
;;
# Object if more than one company name word.
*-*-*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
;;
# Recognize the basic CPU types with company name.
580-* \
| a29k-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* \
| bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c54x-* \
| clipper-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* \
| m32r-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | mcore-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
| mips64orion-* | mips64orionel-* \
| mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* \
| mips64vr5000-* | mips64vr5000el-* \
| mipsisa32-* | mipsisa32el-* \
| mipsisa64-* | mipsisa64el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipstx39 | mipstx39el \
| none-* | np1-* | ns16k-* | ns32k-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \
| romp-* | rs6000-* \
| sh-* | sh[1234]-* | sh3e-* | sh[34]eb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
| sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
| tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \
| v850-* | v850e-* | vax-* \
| we32k-* \
| x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
| xtensa-* \
| ymp-* \
| z8k-*)
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
386bsd)
basic_machine=i386-unknown
os=-bsd
;;
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
basic_machine=m68000-att
;;
3b*)
basic_machine=we32k-att
;;
a29khif)
basic_machine=a29k-amd
os=-udi
;;
adobe68k)
basic_machine=m68010-adobe
os=-scout
;;
alliant | fx80)
basic_machine=fx80-alliant
;;
altos | altos3068)
basic_machine=m68k-altos
;;
am29k)
basic_machine=a29k-none
os=-bsd
;;
amdahl)
basic_machine=580-amdahl
os=-sysv
;;
amiga | amiga-*)
basic_machine=m68k-unknown
;;
amigaos | amigados)
basic_machine=m68k-unknown
os=-amigaos
;;
amigaunix | amix)
basic_machine=m68k-unknown
os=-sysv4
;;
apollo68)
basic_machine=m68k-apollo
os=-sysv
;;
apollo68bsd)
basic_machine=m68k-apollo
os=-bsd
;;
aux)
basic_machine=m68k-apple
os=-aux
;;
balance)
basic_machine=ns32k-sequent
os=-dynix
;;
c90)
basic_machine=c90-cray
os=-unicos
;;
convex-c1)
basic_machine=c1-convex
os=-bsd
;;
convex-c2)
basic_machine=c2-convex
os=-bsd
;;
convex-c32)
basic_machine=c32-convex
os=-bsd
;;
convex-c34)
basic_machine=c34-convex
os=-bsd
;;
convex-c38)
basic_machine=c38-convex
os=-bsd
;;
cray | j90)
basic_machine=j90-cray
os=-unicos
;;
crds | unos)
basic_machine=m68k-crds
;;
cris | cris-* | etrax*)
basic_machine=cris-axis
;;
da30 | da30-*)
basic_machine=m68k-da30
;;
decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
basic_machine=mips-dec
;;
decsystem10* | dec10*)
basic_machine=pdp10-dec
os=-tops10
;;
decsystem20* | dec20*)
basic_machine=pdp10-dec
os=-tops20
;;
delta | 3300 | motorola-3300 | motorola-delta \
| 3300-motorola | delta-motorola)
basic_machine=m68k-motorola
;;
delta88)
basic_machine=m88k-motorola
os=-sysv3
;;
dpx20 | dpx20-*)
basic_machine=rs6000-bull
os=-bosx
;;
dpx2* | dpx2*-bull)
basic_machine=m68k-bull
os=-sysv3
;;
ebmon29k)
basic_machine=a29k-amd
os=-ebmon
;;
elxsi)
basic_machine=elxsi-elxsi
os=-bsd
;;
encore | umax | mmax)
basic_machine=ns32k-encore
;;
es1800 | OSE68k | ose68k | ose | OSE)
basic_machine=m68k-ericsson
os=-ose
;;
fx2800)
basic_machine=i860-alliant
;;
genix)
basic_machine=ns32k-ns
;;
gmicro)
basic_machine=tron-gmicro
os=-sysv
;;
go32)
basic_machine=i386-pc
os=-go32
;;
h3050r* | hiux*)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
;;
h8300hms)
basic_machine=h8300-hitachi
os=-hms
;;
h8300xray)
basic_machine=h8300-hitachi
os=-xray
;;
h8500hms)
basic_machine=h8500-hitachi
os=-hms
;;
harris)
basic_machine=m88k-harris
os=-sysv3
;;
hp300-*)
basic_machine=m68k-hp
;;
hp300bsd)
basic_machine=m68k-hp
os=-bsd
;;
hp300hpux)
basic_machine=m68k-hp
os=-hpux
;;
hp3k9[0-9][0-9] | hp9[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hp9k2[0-9][0-9] | hp9k31[0-9])
basic_machine=m68000-hp
;;
hp9k3[2-9][0-9])
basic_machine=m68k-hp
;;
hp9k6[0-9][0-9] | hp6[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hp9k7[0-79][0-9] | hp7[0-79][0-9])
basic_machine=hppa1.1-hp
;;
hp9k78[0-9] | hp78[0-9])
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][13679] | hp8[0-9][13679])
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][0-9] | hp8[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hppa-next)
os=-nextstep3
;;
hppaosf)
basic_machine=hppa1.1-hp
os=-osf
;;
hppro)
basic_machine=hppa1.1-hp
os=-proelf
;;
i370-ibm* | ibm*)
basic_machine=i370-ibm
;;
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
i*86v32)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv32
;;
i*86v4*)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv4
;;
i*86v)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv
;;
i*86sol2)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-solaris2
;;
i386mach)
basic_machine=i386-mach
os=-mach
;;
i386-vsta | vsta)
basic_machine=i386-unknown
os=-vsta
;;
iris | iris4d)
basic_machine=mips-sgi
case $os in
-irix*)
;;
*)
os=-irix4
;;
esac
;;
isi68 | isi)
basic_machine=m68k-isi
os=-sysv
;;
m88k-omron*)
basic_machine=m88k-omron
;;
magnum | m3230)
basic_machine=mips-mips
os=-sysv
;;
merlin)
basic_machine=ns32k-utek
os=-sysv
;;
mingw32)
basic_machine=i386-pc
os=-mingw32
;;
miniframe)
basic_machine=m68000-convergent
;;
*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
basic_machine=m68k-atari
os=-mint
;;
mips3*-*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
;;
mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;;
mmix*)
basic_machine=mmix-knuth
os=-mmixware
;;
monitor)
basic_machine=m68k-rom68k
os=-coff
;;
morphos)
basic_machine=powerpc-unknown
os=-morphos
;;
msdos)
basic_machine=i386-pc
os=-msdos
;;
mvs)
basic_machine=i370-ibm
os=-mvs
;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
;;
netbsd386)
basic_machine=i386-unknown
os=-netbsd
;;
netwinder)
basic_machine=armv4l-rebel
os=-linux
;;
news | news700 | news800 | news900)
basic_machine=m68k-sony
os=-newsos
;;
news1000)
basic_machine=m68030-sony
os=-newsos
;;
news-3600 | risc-news)
basic_machine=mips-sony
os=-newsos
;;
necv70)
basic_machine=v70-nec
os=-sysv
;;
next | m*-next )
basic_machine=m68k-next
case $os in
-nextstep* )
;;
-ns2*)
os=-nextstep2
;;
*)
os=-nextstep3
;;
esac
;;
nh3000)
basic_machine=m68k-harris
os=-cxux
;;
nh[45]000)
basic_machine=m88k-harris
os=-cxux
;;
nindy960)
basic_machine=i960-intel
os=-nindy
;;
mon960)
basic_machine=i960-intel
os=-mon960
;;
nonstopux)
basic_machine=mips-compaq
os=-nonstopux
;;
np1)
basic_machine=np1-gould
;;
nsr-tandem)
basic_machine=nsr-tandem
;;
op50n-* | op60c-*)
basic_machine=hppa1.1-oki
os=-proelf
;;
or32 | or32-*)
basic_machine=or32-unknown
os=-coff
;;
OSE68000 | ose68000)
basic_machine=m68000-ericsson
os=-ose
;;
os68k)
basic_machine=m68k-none
os=-os68k
;;
pa-hitachi)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
;;
paragon)
basic_machine=i860-intel
os=-osf
;;
pbd)
basic_machine=sparc-tti
;;
pbb)
basic_machine=m68k-tti
;;
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
pentium | p5 | k5 | k6 | nexgen | viac3)
basic_machine=i586-pc
;;
pentiumpro | p6 | 6x86 | athlon)
basic_machine=i686-pc
;;
pentiumii | pentium2)
basic_machine=i686-pc
;;
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumpro-* | p6-* | 6x86-* | athlon-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumii-* | pentium2-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pn)
basic_machine=pn-gould
;;
power) basic_machine=power-ibm
;;
ppc) basic_machine=powerpc-unknown
;;
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown
;;
ppcle-* | powerpclittle-*)
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppc64) basic_machine=powerpc64-unknown
;;
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppc64le | powerpc64little | ppc64-le | powerpc64-little)
basic_machine=powerpc64le-unknown
;;
ppc64le-* | powerpc64little-*)
basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ps2)
basic_machine=i386-ibm
;;
pw32)
basic_machine=i586-unknown
os=-pw32
;;
rom68k)
basic_machine=m68k-rom68k
os=-coff
;;
rm[46]00)
basic_machine=mips-siemens
;;
rtpc | rtpc-*)
basic_machine=romp-ibm
;;
s390 | s390-*)
basic_machine=s390-ibm
;;
s390x | s390x-*)
basic_machine=s390x-ibm
;;
sa29200)
basic_machine=a29k-amd
os=-udi
;;
sequent)
basic_machine=i386-sequent
;;
sh)
basic_machine=sh-hitachi
os=-hms
;;
sparclite-wrs | simso-wrs)
basic_machine=sparclite-wrs
os=-vxworks
;;
sps7)
basic_machine=m68k-bull
os=-sysv2
;;
spur)
basic_machine=spur-unknown
;;
st2000)
basic_machine=m68k-tandem
;;
stratus)
basic_machine=i860-stratus
os=-sysv4
;;
sun2)
basic_machine=m68000-sun
;;
sun2os3)
basic_machine=m68000-sun
os=-sunos3
;;
sun2os4)
basic_machine=m68000-sun
os=-sunos4
;;
sun3os3)
basic_machine=m68k-sun
os=-sunos3
;;
sun3os4)
basic_machine=m68k-sun
os=-sunos4
;;
sun4os3)
basic_machine=sparc-sun
os=-sunos3
;;
sun4os4)
basic_machine=sparc-sun
os=-sunos4
;;
sun4sol2)
basic_machine=sparc-sun
os=-solaris2
;;
sun3 | sun3-*)
basic_machine=m68k-sun
;;
sun4)
basic_machine=sparc-sun
;;
sun386 | sun386i | roadrunner)
basic_machine=i386-sun
;;
sv1)
basic_machine=sv1-cray
os=-unicos
;;
symmetry)
basic_machine=i386-sequent
os=-dynix
;;
t3d)
basic_machine=alpha-cray
os=-unicos
;;
t3e)
basic_machine=alphaev5-cray
os=-unicos
;;
t90)
basic_machine=t90-cray
os=-unicos
;;
tic54x | c54x*)
basic_machine=tic54x-unknown
os=-coff
;;
tx39)
basic_machine=mipstx39-unknown
;;
tx39el)
basic_machine=mipstx39el-unknown
;;
toad1)
basic_machine=pdp10-xkl
os=-tops20
;;
tower | tower-32)
basic_machine=m68k-ncr
;;
udi29k)
basic_machine=a29k-amd
os=-udi
;;
ultra3)
basic_machine=a29k-nyu
os=-sym1
;;
v810 | necv810)
basic_machine=v810-nec
os=-none
;;
vaxv)
basic_machine=vax-dec
os=-sysv
;;
vms)
basic_machine=vax-dec
os=-vms
;;
vpp*|vx|vx-*)
basic_machine=f301-fujitsu
;;
vxworks960)
basic_machine=i960-wrs
os=-vxworks
;;
vxworks68)
basic_machine=m68k-wrs
os=-vxworks
;;
vxworks29k)
basic_machine=a29k-wrs
os=-vxworks
;;
w65*)
basic_machine=w65-wdc
os=-none
;;
w89k-*)
basic_machine=hppa1.1-winbond
os=-proelf
;;
windows32)
basic_machine=i386-pc
os=-windows32-msvcrt
;;
xps | xps100)
basic_machine=xps100-honeywell
;;
ymp)
basic_machine=ymp-cray
os=-unicos
;;
z8k-*-coff)
basic_machine=z8k-unknown
os=-sim
;;
none)
basic_machine=none-none
os=-none
;;
# Here we handle the default manufacturer of certain CPU types. It is in
# some cases the only manufacturer, in others, it is the most popular.
w89k)
basic_machine=hppa1.1-winbond
;;
op50n)
basic_machine=hppa1.1-oki
;;
op60c)
basic_machine=hppa1.1-oki
;;
romp)
basic_machine=romp-ibm
;;
rs6000)
basic_machine=rs6000-ibm
;;
vax)
basic_machine=vax-dec
;;
pdp10)
# there are many clones, so DEC is not a safe bet
basic_machine=pdp10-unknown
;;
pdp11)
basic_machine=pdp11-dec
;;
we32k)
basic_machine=we32k-att
;;
sh3 | sh4 | sh3eb | sh4eb | sh[1234]le | sh3ele)
basic_machine=sh-unknown
;;
sh64)
basic_machine=sh64-unknown
;;
sparc | sparcv9 | sparcv9b)
basic_machine=sparc-sun
;;
cydra)
basic_machine=cydra-cydrome
;;
orion)
basic_machine=orion-highlevel
;;
orion105)
basic_machine=clipper-highlevel
;;
mac | mpw | mac-mpw)
basic_machine=m68k-apple
;;
pmac | pmac-mpw)
basic_machine=powerpc-apple
;;
c4x*)
basic_machine=c4x-none
os=-coff
;;
*-unknown)
# Make sure to match an already-canonicalized machine name.
;;
*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
;;
esac
# Here we canonicalize certain aliases for manufacturers.
case $basic_machine in
*-digital*)
basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
;;
*-commodore*)
basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
;;
*)
;;
esac
# Decode manufacturer-specific aliases for certain operating systems.
if [ x"$os" != x"" ]
then
case $os in
# First match some system type aliases
# that might get confused with valid system types.
# -solaris* is a basic system type, with this one exception.
-solaris1 | -solaris1.*)
os=`echo $os | sed -e 's|solaris1|sunos4|'`
;;
-solaris)
os=-solaris2
;;
-svr4*)
os=-sysv4
;;
-unixware*)
os=-sysv4.2uw
;;
-gnu/linux*)
os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
;;
# First accept the basic system types.
# The portable systems comes first.
# Each alternative MUST END IN A *, to match a version number.
# -sysv* is not here because it comes later, after sysvr4.
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* | -powermax*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
case $basic_machine in
x86-* | i*86-*)
;;
*)
os=-nto$os
;;
esac
;;
-nto*)
os=-nto-qnx
;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
;;
-mac*)
os=`echo $os | sed -e 's|mac|macos|'`
;;
-linux*)
os=`echo $os | sed -e 's|linux|linux-gnu|'`
;;
-sunos5*)
os=`echo $os | sed -e 's|sunos5|solaris2|'`
;;
-sunos6*)
os=`echo $os | sed -e 's|sunos6|solaris3|'`
;;
-opened*)
os=-openedition
;;
-wince*)
os=-wince
;;
-osfrose*)
os=-osfrose
;;
-osf*)
os=-osf
;;
-utek*)
os=-bsd
;;
-dynix*)
os=-bsd
;;
-acis*)
os=-aos
;;
-atheos*)
os=-atheos
;;
-386bsd)
os=-bsd
;;
-ctix* | -uts*)
os=-sysv
;;
-nova*)
os=-rtmk-nova
;;
-ns2 )
os=-nextstep2
;;
-nsk*)
os=-nsk
;;
# Preserve the version number of sinix5.
-sinix5.*)
os=`echo $os | sed -e 's|sinix|sysv|'`
;;
-sinix*)
os=-sysv4
;;
-triton*)
os=-sysv3
;;
-oss*)
os=-sysv3
;;
-svr4)
os=-sysv4
;;
-svr3)
os=-sysv3
;;
-sysvr4)
os=-sysv4
;;
# This must come after -sysvr4.
-sysv*)
;;
-ose*)
os=-ose
;;
-es1800*)
os=-ose
;;
-xenix)
os=-xenix
;;
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
os=-mint
;;
-none)
;;
*)
# Get rid of the `-' at the beginning of $os.
os=`echo $os | sed 's/[^-]*-//'`
echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
exit 1
;;
esac
else
# Here we handle the default operating systems that come with various machines.
# The value should be what the vendor currently ships out the door with their
# machine or put another way, the most popular os provided with the machine.
# Note that if you're going to try to match "-MANUFACTURER" here (say,
# "-sun"), then you have to tell the case statement up towards the top
# that MANUFACTURER isn't an operating system. Otherwise, code above
# will signal an error saying that MANUFACTURER isn't an operating
# system, and we'll never get to this point.
case $basic_machine in
*-acorn)
os=-riscix1.2
;;
arm*-rebel)
os=-linux
;;
arm*-semi)
os=-aout
;;
# This must come before the *-dec entry.
pdp10-*)
os=-tops20
;;
pdp11-*)
os=-none
;;
*-dec | vax-*)
os=-ultrix4.2
;;
m68*-apollo)
os=-domain
;;
i386-sun)
os=-sunos4.0.2
;;
m68000-sun)
os=-sunos3
# This also exists in the configure program, but was not the
# default.
# os=-sunos4
;;
m68*-cisco)
os=-aout
;;
mips*-cisco)
os=-elf
;;
mips*-*)
os=-elf
;;
or32-*)
os=-coff
;;
*-tti) # must be before sparc entry or we get the wrong os.
os=-sysv3
;;
sparc-* | *-sun)
os=-sunos4.1.1
;;
*-be)
os=-beos
;;
*-ibm)
os=-aix
;;
*-wec)
os=-proelf
;;
*-winbond)
os=-proelf
;;
*-oki)
os=-proelf
;;
*-hp)
os=-hpux
;;
*-hitachi)
os=-hiux
;;
i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
os=-sysv
;;
*-cbm)
os=-amigaos
;;
*-dg)
os=-dgux
;;
*-dolphin)
os=-sysv3
;;
m68k-ccur)
os=-rtu
;;
m88k-omron*)
os=-luna
;;
*-next )
os=-nextstep
;;
*-sequent)
os=-ptx
;;
*-crds)
os=-unos
;;
*-ns)
os=-genix
;;
i370-*)
os=-mvs
;;
*-next)
os=-nextstep3
;;
*-gould)
os=-sysv
;;
*-highlevel)
os=-bsd
;;
*-encore)
os=-bsd
;;
*-sgi)
os=-irix
;;
*-siemens)
os=-sysv4
;;
*-masscomp)
os=-rtu
;;
f30[01]-fujitsu | f700-fujitsu)
os=-uxpv
;;
*-rom68k)
os=-coff
;;
*-*bug)
os=-coff
;;
*-apple)
os=-macos
;;
*-atari*)
os=-mint
;;
*)
os=-none
;;
esac
fi
# Here we handle the case where we know the os, and the CPU type, but not the
# manufacturer. We pick the logical manufacturer.
vendor=unknown
case $basic_machine in
*-unknown)
case $os in
-riscix*)
vendor=acorn
;;
-sunos*)
vendor=sun
;;
-aix*)
vendor=ibm
;;
-beos*)
vendor=be
;;
-hpux*)
vendor=hp
;;
-mpeix*)
vendor=hp
;;
-hiux*)
vendor=hitachi
;;
-unos*)
vendor=crds
;;
-dgux*)
vendor=dg
;;
-luna*)
vendor=omron
;;
-genix*)
vendor=ns
;;
-mvs* | -opened*)
vendor=ibm
;;
-ptx*)
vendor=sequent
;;
-vxsim* | -vxworks* | -windiss*)
vendor=wrs
;;
-aux*)
vendor=apple
;;
-hms*)
vendor=hitachi
;;
-mpw* | -macos*)
vendor=apple
;;
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
vendor=atari
;;
-vos*)
vendor=stratus
;;
esac
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
esac
echo $basic_machine$os
exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
|
Added work/contrib/lzo/lzo-1.08/acconfig/depcomp.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
|
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
# Copyright 1999, 2000 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# `libtool' can also be set to `yes' or `no'.
if test -z "$depfile"; then
base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'`
dir=`echo "$object" | sed 's,/.*$,/,'`
if test "$dir" = "$object"; then
dir=
fi
# FIXME: should be _deps on DOS.
depfile="$dir.deps/$base"
fi
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
"$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say).
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
## The second -e expression handles DOS-style file names with drive letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the `deleted header file' problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
tr ' ' '
' < "$tmpdepfile" |
## Some versions of gcc put a space before the `:'. On the theory
## that the space means something, we add a space to the output as
## well.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like `#:fec' to the end of the
# dependency line.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
tr '
' ' ' >> $depfile
echo >> $depfile
# The second pass generates a dummy entry for each header file.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> $depfile
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. This file always lives in the current directory.
# Also, the AIX compiler puts `$object:' at the start of each line;
# $object doesn't have directory information.
stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
tmpdepfile="$stripped.u"
outname="$stripped.o"
if test "$libtool" = yes; then
"$@" -Wc,-M
else
"$@" -M
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
if test -f "$tmpdepfile"; then
# Each line is of the form `foo.o: dependent.h'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in `foo.d' instead, so we check for that too.
# Subdirectories are respected.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
tmpdepfile1="$dir.libs/$base.lo.d"
tmpdepfile2="$dir.libs/$base.d"
"$@" -Wc,-MD
else
tmpdepfile1="$dir$base.o.d"
tmpdepfile2="$dir$base.d"
"$@" -MD
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
if test -f "$tmpdepfile1"; then
tmpdepfile="$tmpdepfile1"
else
tmpdepfile="$tmpdepfile2"
fi
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a space and a tab in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the proprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'. We will use -o /dev/null later,
# however we can't do the remplacement now because
# `-o $object' might simply not be used
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
"$@" -o /dev/null $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tr ' ' '
' < "$tmpdepfile" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# X makedepend
shift
cleared=no
for arg in "$@"; do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
-*)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix="`echo $object | sed 's/^.*\././'`"
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
sed '1,2d' "$tmpdepfile" | tr ' ' '
' | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the proprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E |
sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the proprocessed file to stdout, regardless of -o,
# because we must use -o when running libtool.
"$@" || exit $?
IFS=" "
for arg
do
case "$arg" in
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
echo " " >> "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
|
Added work/contrib/lzo/lzo-1.08/acconfig/install-sh.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
|
#!/bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5 (mit/util/scripts/install.sh).
#
# Copyright 1991 by the Massachusetts Institute of Technology
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission. M.I.T. makes no representations about the
# suitability of this software for any purpose. It is provided "as is"
# without express or implied warranty.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
else
:
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d $dst ]; then
instcmd=:
chmodcmd=""
else
instcmd=$mkdirprog
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f "$src" ] || [ -d "$src" ]
then
:
else
echo "install: $src does not exist"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
else
:
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
else
:
fi
fi
## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
IFS="${IFS-${defaultIFS}}"
oIFS="${IFS}"
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}"
pathcomp=''
while [ $# -ne 0 ] ; do
pathcomp="${pathcomp}${1}"
shift
if [ ! -d "${pathcomp}" ] ;
then
$mkdirprog "${pathcomp}"
else
:
fi
pathcomp="${pathcomp}/"
done
fi
if [ x"$dir_arg" != x ]
then
$doit $instcmd $dst &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi
else
# If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ]
then
dstfile=`basename $dst`
else
dstfile=`basename $dst $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
if [ x"$dstfile" = x ]
then
dstfile=`basename $dst`
else
:
fi
# Make a temp file name in the proper directory.
dsttmp=$dstdir/#inst.$$#
# Move or copy the file name to the temp name
$doit $instcmd $src $dsttmp &&
trap "rm -f ${dsttmp}" 0 &&
# and set any options; do chmod last to preserve setuid bits
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi &&
# Now rename the file to the real destination.
$doit $rmcmd -f $dstdir/$dstfile &&
$doit $mvcmd $dsttmp $dstdir/$dstfile
fi &&
exit 0
|
Added work/contrib/lzo/lzo-1.08/acconfig/ltmain.sh.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
|
# ltmain.sh - Provide generalized library-building support services.
# NOTE: Changing this file will not affect anything until you rerun configure.
#
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
# Free Software Foundation, Inc.
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Check that we have a working $echo.
if test "X$1" = X--no-reexec; then
# Discard the --no-reexec flag, and continue.
shift
elif test "X$1" = X--fallback-echo; then
# Avoid inline document here, it may be left over
:
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
# Yippee, $echo works!
:
else
# Restart under the correct shell, and then maybe $echo will work.
exec $SHELL "$0" --no-reexec ${1+"$@"}
fi
if test "X$1" = X--fallback-echo; then
# used as fallback echo
shift
cat <<EOF
$*
EOF
exit 0
fi
# The name of this program.
progname=`$echo "$0" | ${SED} 's%^.*/%%'`
modename="$progname"
# Constants.
PROGRAM=ltmain.sh
PACKAGE=libtool
VERSION=1.4.2a
TIMESTAMP=" (1.922.2.93 2002/05/06 15:02:58)"
default_mode=
help="Try \`$progname --help' for more information."
magic="%%%MAGIC variable%%%"
mkdir="mkdir"
mv="mv -f"
rm="rm -f"
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
Xsed="${SED}"' -e 1s/^X//'
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
# test EBCDIC or ASCII
case `echo A|od -x` in
*[Cc]1*) # EBCDIC based system
SP2NL="tr '\100' '\n'"
NL2SP="tr '\r\n' '\100\100'"
;;
*) # Assume ASCII based system
SP2NL="tr '\040' '\012'"
NL2SP="tr '\015\012' '\040\040'"
;;
esac
# NLS nuisances.
# Only set LANG and LC_ALL to C if already set.
# These must not be set unconditionally because not all systems understand
# e.g. LANG=C (notably SCO).
# We save the old values to restore during execute mode.
if test "${LC_ALL+set}" = set; then
save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
fi
if test "${LANG+set}" = set; then
save_LANG="$LANG"; LANG=C; export LANG
fi
# Make sure IFS has a sensible default
: ${IFS=" "}
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
echo "$modename: not configured to build any kind of library" 1>&2
echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
exit 1
fi
# Global variables.
mode=$default_mode
nonopt=
prev=
prevopt=
run=
show="$echo"
show_help=
execute_dlfiles=
lo2o="s/\\.lo\$/.${objext}/"
o2lo="s/\\.${objext}\$/.lo/"
# Parse our command line options once, thoroughly.
while test $# -gt 0
do
arg="$1"
shift
case $arg in
-*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
# If the previous option needs an argument, assign it.
if test -n "$prev"; then
case $prev in
execute_dlfiles)
execute_dlfiles="$execute_dlfiles $arg"
;;
*)
eval "$prev=\$arg"
;;
esac
prev=
prevopt=
continue
fi
# Have we seen a non-optional argument yet?
case $arg in
--help)
show_help=yes
;;
--version)
echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
exit 0
;;
--config)
${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
exit 0
;;
--debug)
echo "$progname: enabling shell trace mode"
set -x
;;
--dry-run | -n)
run=:
;;
--features)
echo "host: $host"
if test "$build_libtool_libs" = yes; then
echo "enable shared libraries"
else
echo "disable shared libraries"
fi
if test "$build_old_libs" = yes; then
echo "enable static libraries"
else
echo "disable static libraries"
fi
exit 0
;;
--finish) mode="finish" ;;
--mode) prevopt="--mode" prev=mode ;;
--mode=*) mode="$optarg" ;;
--preserve-dup-deps) duplicate_deps="yes" ;;
--quiet | --silent)
show=:
;;
-dlopen)
prevopt="-dlopen"
prev=execute_dlfiles
;;
-*)
$echo "$modename: unrecognized option \`$arg'" 1>&2
$echo "$help" 1>&2
exit 1
;;
*)
nonopt="$arg"
break
;;
esac
done
if test -n "$prevopt"; then
$echo "$modename: option \`$prevopt' requires an argument" 1>&2
$echo "$help" 1>&2
exit 1
fi
# If this variable is set in any of the actions, the command in it
# will be execed at the end. This prevents here-documents from being
# left over by shells.
exec_cmd=
if test -z "$show_help"; then
# Infer the operation mode.
if test -z "$mode"; then
case $nonopt in
*cc | *++ | gcc* | *-gcc*)
mode=link
for arg
do
case $arg in
-c)
mode=compile
break
;;
esac
done
;;
*db | *dbx | *strace | *truss)
mode=execute
;;
*install*|cp|mv)
mode=install
;;
*rm)
mode=uninstall
;;
*)
# If we have no mode, but dlfiles were specified, then do execute mode.
test -n "$execute_dlfiles" && mode=execute
# Just use the default operation mode.
if test -z "$mode"; then
if test -n "$nonopt"; then
$echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
else
$echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
fi
fi
;;
esac
fi
# Only execute mode is allowed to have -dlopen flags.
if test -n "$execute_dlfiles" && test "$mode" != execute; then
$echo "$modename: unrecognized option \`-dlopen'" 1>&2
$echo "$help" 1>&2
exit 1
fi
# Change the help message to a mode-specific one.
generic_help="$help"
help="Try \`$modename --help --mode=$mode' for more information."
# These modes are in order of execution frequency so that they run quickly.
case $mode in
# libtool compile mode
compile)
modename="$modename: compile"
# Get the compilation command and the source file.
base_compile=
prev=
lastarg=
srcfile="$nonopt"
suppress_output=
user_target=no
for arg
do
case $prev in
"") ;;
xcompiler)
# Aesthetically quote the previous argument.
prev=
lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
case $arg in
# Double-quote args containing other shell metacharacters.
# Many Bourne shells cannot handle close brackets correctly
# in scan sets, so we specify it separately.
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
arg="\"$arg\""
;;
esac
# Add the previous argument to base_compile.
if test -z "$base_compile"; then
base_compile="$lastarg"
else
base_compile="$base_compile $lastarg"
fi
continue
;;
esac
# Accept any command-line options.
case $arg in
-o)
if test "$user_target" != "no"; then
$echo "$modename: you cannot specify \`-o' more than once" 1>&2
exit 1
fi
user_target=next
;;
-static)
build_old_libs=yes
continue
;;
-prefer-pic)
pic_mode=yes
continue
;;
-prefer-non-pic)
pic_mode=no
continue
;;
-Xcompiler)
prev=xcompiler
continue
;;
-Wc,*)
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
lastarg=
save_ifs="$IFS"; IFS=','
for arg in $args; do
IFS="$save_ifs"
# Double-quote args containing other shell metacharacters.
# Many Bourne shells cannot handle close brackets correctly
# in scan sets, so we specify it separately.
case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
arg="\"$arg\""
;;
esac
lastarg="$lastarg $arg"
done
IFS="$save_ifs"
lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
# Add the arguments to base_compile.
if test -z "$base_compile"; then
base_compile="$lastarg"
else
base_compile="$base_compile $lastarg"
fi
continue
;;
esac
case $user_target in
next)
# The next one is the -o target name
user_target=yes
continue
;;
yes)
# We got the output file
user_target=set
libobj="$arg"
continue
;;
esac
# Accept the current argument as the source file.
lastarg="$srcfile"
srcfile="$arg"
# Aesthetically quote the previous argument.
# Backslashify any backslashes, double quotes, and dollar signs.
# These are the only characters that are still specially
# interpreted inside of double-quoted scrings.
lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
# Double-quote args containing other shell metacharacters.
# Many Bourne shells cannot handle close brackets correctly
# in scan sets, so we specify it separately.
case $lastarg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
lastarg="\"$lastarg\""
;;
esac
# Add the previous argument to base_compile.
if test -z "$base_compile"; then
base_compile="$lastarg"
else
base_compile="$base_compile $lastarg"
fi
done
case $user_target in
set)
;;
no)
# Get the name of the library object.
libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
;;
*)
$echo "$modename: you must specify a target with \`-o'" 1>&2
exit 1
;;
esac
# Recognize several different file suffixes.
# If the user specifies -o file.o, it is replaced with file.lo
xform='[cCFSfmso]'
case $libobj in
*.ada) xform=ada ;;
*.adb) xform=adb ;;
*.ads) xform=ads ;;
*.asm) xform=asm ;;
*.c++) xform=c++ ;;
*.cc) xform=cc ;;
*.cpp) xform=cpp ;;
*.cxx) xform=cxx ;;
*.f90) xform=f90 ;;
*.for) xform=for ;;
esac
libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
case $libobj in
*.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
*)
$echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
exit 1
;;
esac
if test -z "$base_compile"; then
$echo "$modename: you must specify a compilation command" 1>&2
$echo "$help" 1>&2
exit 1
fi
# Delete any leftover library objects.
if test "$build_old_libs" = yes; then
removelist="$obj $libobj"
else
removelist="$libobj"
fi
$run $rm $removelist
trap "$run $rm $removelist; exit 1" 1 2 15
# On Cygwin there's no "real" PIC flag so we must build both object types
case $host_os in
cygwin* | mingw* | pw32* | os2*)
pic_mode=default
;;
esac
if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
# non-PIC code in shared libraries is not supported
pic_mode=default
fi
# Calculate the filename of the output object if compiler does
# not support -o with -c
if test "$compiler_c_o" = no; then
output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
lockfile="$output_obj.lock"
removelist="$removelist $output_obj $lockfile"
trap "$run $rm $removelist; exit 1" 1 2 15
else
need_locks=no
lockfile=
fi
# Lock this critical section if it is needed
# We use this script file to make the link, it avoids creating a new file
if test "$need_locks" = yes; then
until $run ln "$0" "$lockfile" 2>/dev/null; do
$show "Waiting for $lockfile to be removed"
sleep 2
done
elif test "$need_locks" = warn; then
if test -f "$lockfile"; then
echo "\
*** ERROR, $lockfile exists and contains:
`cat $lockfile 2>/dev/null`
This indicates that another process is trying to use the same
temporary object file, and libtool could not work around it because
your compiler does not support \`-c' and \`-o' together. If you
repeat this compilation, it may succeed, by chance, but you had better
avoid parallel builds (make -j) in this platform, or get a better
compiler."
$run $rm $removelist
exit 1
fi
echo $srcfile > "$lockfile"
fi
if test -n "$fix_srcfile_path"; then
eval srcfile=\"$fix_srcfile_path\"
fi
# Only build a PIC object if we are building libtool libraries.
if test "$build_libtool_libs" = yes; then
# Without this assignment, base_compile gets emptied.
fbsd_hideous_sh_bug=$base_compile
if test "$pic_mode" != no; then
# All platforms use -DPIC, to notify preprocessed assembler code.
command="$base_compile $srcfile $pic_flag -DPIC"
else
# Don't build PIC code
command="$base_compile $srcfile"
fi
if test "$build_old_libs" = yes; then
lo_libobj="$libobj"
dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
if test "X$dir" = "X$libobj"; then
dir="$objdir"
else
dir="$dir/$objdir"
fi
libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
if test -d "$dir"; then
$show "$rm $libobj"
$run $rm $libobj
else
$show "$mkdir $dir"
$run $mkdir $dir
status=$?
if test $status -ne 0 && test ! -d $dir; then
exit $status
fi
fi
fi
if test "$compiler_o_lo" = yes; then
output_obj="$libobj"
command="$command -o $output_obj"
elif test "$compiler_c_o" = yes; then
output_obj="$obj"
command="$command -o $output_obj"
fi
$run $rm "$output_obj"
$show "$command"
if $run eval "$command"; then :
else
test -n "$output_obj" && $run $rm $removelist
exit 1
fi
if test "$need_locks" = warn &&
test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
echo "\
*** ERROR, $lockfile contains:
`cat $lockfile 2>/dev/null`
but it should contain:
$srcfile
This indicates that another process is trying to use the same
temporary object file, and libtool could not work around it because
your compiler does not support \`-c' and \`-o' together. If you
repeat this compilation, it may succeed, by chance, but you had better
avoid parallel builds (make -j) in this platform, or get a better
compiler."
$run $rm $removelist
exit 1
fi
# Just move the object if needed, then go on to compile the next one
if test x"$output_obj" != x"$libobj"; then
$show "$mv $output_obj $libobj"
if $run $mv $output_obj $libobj; then :
else
error=$?
$run $rm $removelist
exit $error
fi
fi
# If we have no pic_flag, then copy the object into place and finish.
if (test -z "$pic_flag" || test "$pic_mode" != default) &&
test "$build_old_libs" = yes; then
# Rename the .lo from within objdir to obj
if test -f $obj; then
$show $rm $obj
$run $rm $obj
fi
$show "$mv $libobj $obj"
if $run $mv $libobj $obj; then :
else
error=$?
$run $rm $removelist
exit $error
fi
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
if test "X$xdir" = "X$obj"; then
xdir="."
else
xdir="$xdir"
fi
baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
# Now arrange that obj and lo_libobj become the same file
$show "(cd $xdir && $LN_S $baseobj $libobj)"
if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
# Unlock the critical section if it was locked
if test "$need_locks" != no; then
$run $rm "$lockfile"
fi
exit 0
else
error=$?
$run $rm $removelist
exit $error
fi
fi
# Allow error messages only from the first compilation.
suppress_output=' >/dev/null 2>&1'
fi
# Only build a position-dependent object if we build old libraries.
if test "$build_old_libs" = yes; then
if test "$pic_mode" != yes; then
# Don't build PIC code
command="$base_compile $srcfile"
else
# All platforms use -DPIC, to notify preprocessed assembler code.
command="$base_compile $srcfile $pic_flag -DPIC"
fi
if test "$compiler_c_o" = yes; then
command="$command -o $obj"
output_obj="$obj"
fi
# Suppress compiler output if we already did a PIC compilation.
command="$command$suppress_output"
$run $rm "$output_obj"
$show "$command"
if $run eval "$command"; then :
else
$run $rm $removelist
exit 1
fi
if test "$need_locks" = warn &&
test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
echo "\
*** ERROR, $lockfile contains:
`cat $lockfile 2>/dev/null`
but it should contain:
$srcfile
This indicates that another process is trying to use the same
temporary object file, and libtool could not work around it because
your compiler does not support \`-c' and \`-o' together. If you
repeat this compilation, it may succeed, by chance, but you had better
avoid parallel builds (make -j) in this platform, or get a better
compiler."
$run $rm $removelist
exit 1
fi
# Just move the object if needed
if test x"$output_obj" != x"$obj"; then
$show "$mv $output_obj $obj"
if $run $mv $output_obj $obj; then :
else
error=$?
$run $rm $removelist
exit $error
fi
fi
# Create an invalid libtool object if no PIC, so that we do not
# accidentally link it into a program.
if test "$build_libtool_libs" != yes; then
$show "echo timestamp > $libobj"
$run eval "echo timestamp > \$libobj" || exit $?
else
# Move the .lo from within objdir
$show "$mv $libobj $lo_libobj"
if $run $mv $libobj $lo_libobj; then :
else
error=$?
$run $rm $removelist
exit $error
fi
fi
fi
# Unlock the critical section if it was locked
if test "$need_locks" != no; then
$run $rm "$lockfile"
fi
exit 0
;;
# libtool link mode
link | relink)
modename="$modename: link"
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
# It is impossible to link a dll without this setting, and
# we shouldn't force the makefile maintainer to figure out
# which system we are compiling for in order to pass an extra
# flag for every libtool invokation.
# allow_undefined=no
# FIXME: Unfortunately, there are problems with the above when trying
# to make a dll which has undefined symbols, in which case not
# even a static library is built. For now, we need to specify
# -no-undefined on the libtool link line when we can be certain
# that all symbols are satisfied, otherwise we get a static library.
allow_undefined=yes
;;
*)
allow_undefined=yes
;;
esac
libtool_args="$nonopt"
compile_command="$nonopt"
finalize_command="$nonopt"
compile_rpath=
finalize_rpath=
compile_shlibpath=
finalize_shlibpath=
convenience=
old_convenience=
deplibs=
old_deplibs=
compiler_flags=
linker_flags=
dllsearchpath=
lib_search_path=`pwd`
avoid_version=no
dlfiles=
dlprefiles=
dlself=no
export_dynamic=no
export_symbols=
export_symbols_regex=
generated=
libobjs=
ltlibs=
module=no
no_install=no
objs=
prefer_static_libs=no
preload=no
prev=
prevarg=
release=
rpath=
xrpath=
perm_rpath=
temp_rpath=
thread_safe=no
vinfo=
# We need to know -static, to get the right output filenames.
for arg
do
case $arg in
-all-static | -static)
if test "X$arg" = "X-all-static"; then
if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
$echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
fi
if test -n "$link_static_flag"; then
dlopen_self=$dlopen_self_static
fi
else
if test -z "$pic_flag" && test -n "$link_static_flag"; then
dlopen_self=$dlopen_self_static
fi
fi
build_libtool_libs=no
build_old_libs=yes
prefer_static_libs=yes
break
;;
esac
done
# See if our shared archives depend on static archives.
test -n "$old_archive_from_new_cmds" && build_old_libs=yes
# Go through the arguments, transforming them on the way.
while test $# -gt 0; do
arg="$1"
shift
case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
;;
*) qarg=$arg ;;
esac
libtool_args="$libtool_args $qarg"
# If the previous option needs an argument, assign it.
if test -n "$prev"; then
case $prev in
output)
compile_command="$compile_command @OUTPUT@"
finalize_command="$finalize_command @OUTPUT@"
;;
esac
case $prev in
dlfiles|dlprefiles)
if test "$preload" = no; then
# Add the symbol object into the linking commands.
compile_command="$compile_command @SYMFILE@"
finalize_command="$finalize_command @SYMFILE@"
preload=yes
fi
case $arg in
*.la | *.lo) ;; # We handle these cases below.
force)
if test "$dlself" = no; then
dlself=needless
export_dynamic=yes
fi
prev=
continue
;;
self)
if test "$prev" = dlprefiles; then
dlself=yes
elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
dlself=yes
else
dlself=needless
export_dynamic=yes
fi
prev=
continue
;;
*)
if test "$prev" = dlfiles; then
dlfiles="$dlfiles $arg"
else
dlprefiles="$dlprefiles $arg"
fi
prev=
continue
;;
esac
;;
expsyms)
export_symbols="$arg"
if test ! -f "$arg"; then
$echo "$modename: symbol file \`$arg' does not exist"
exit 1
fi
prev=
continue
;;
expsyms_regex)
export_symbols_regex="$arg"
prev=
continue
;;
release)
release="-$arg"
prev=
continue
;;
rpath | xrpath)
# We need an absolute path.
case $arg in
[\\/]* | [A-Za-z]:[\\/]*) ;;
*)
$echo "$modename: only absolute run-paths are allowed" 1>&2
exit 1
;;
esac
if test "$prev" = rpath; then
case "$rpath " in
*" $arg "*) ;;
*) rpath="$rpath $arg" ;;
esac
else
case "$xrpath " in
*" $arg "*) ;;
*) xrpath="$xrpath $arg" ;;
esac
fi
prev=
continue
;;
xcompiler)
compiler_flags="$compiler_flags $qarg"
prev=
compile_command="$compile_command $qarg"
finalize_command="$finalize_command $qarg"
continue
;;
xlinker)
linker_flags="$linker_flags $qarg"
compiler_flags="$compiler_flags $wl$qarg"
prev=
compile_command="$compile_command $wl$qarg"
finalize_command="$finalize_command $wl$qarg"
continue
;;
*)
eval "$prev=\"\$arg\""
prev=
continue
;;
esac
fi # test -n $prev
prevarg="$arg"
case $arg in
-all-static)
if test -n "$link_static_flag"; then
compile_command="$compile_command $link_static_flag"
finalize_command="$finalize_command $link_static_flag"
fi
continue
;;
-allow-undefined)
# FIXME: remove this flag sometime in the future.
$echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
continue
;;
-avoid-version)
avoid_version=yes
continue
;;
-dlopen)
prev=dlfiles
continue
;;
-dlpreopen)
prev=dlprefiles
continue
;;
-export-dynamic)
export_dynamic=yes
continue
;;
-export-symbols | -export-symbols-regex)
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
$echo "$modename: more than one -exported-symbols argument is not allowed"
exit 1
fi
if test "X$arg" = "X-export-symbols"; then
prev=expsyms
else
prev=expsyms_regex
fi
continue
;;
# The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
# so, if we see these flags be careful not to treat them like -L
-L[A-Z][A-Z]*:*)
case $with_gcc/$host in
no/*-*-irix* | no/*-*-nonstopux*)
compile_command="$compile_command $arg"
finalize_command="$finalize_command $arg"
;;
esac
continue
;;
-L*)
dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
# We need an absolute path.
case $dir in
[\\/]* | [A-Za-z]:[\\/]*) ;;
*)
absdir=`cd "$dir" && pwd`
if test -z "$absdir"; then
$echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
exit 1
fi
dir="$absdir"
;;
esac
case "$deplibs " in
*" -L$dir "*) ;;
*)
deplibs="$deplibs -L$dir"
lib_search_path="$lib_search_path $dir"
;;
esac
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
case :$dllsearchpath: in
*":$dir:"*) ;;
*) dllsearchpath="$dllsearchpath:$dir";;
esac
;;
esac
continue
;;
-l*)
if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
case $host in
*-*-cygwin* | *-*-pw32* | *-*-beos*)
# These systems don't actually have a C or math library (as such)
continue
;;
*-*-mingw* | *-*-os2*)
# These systems don't actually have a C library (as such)
test "X$arg" = "X-lc" && continue
;;
*-*-openbsd* | *-*-freebsd*)
# Do not include libc due to us having libc/libc_r.
test "X$arg" = "X-lc" && continue
;;
esac
elif test "X$arg" = "X-lc_r"; then
case $host in
*-*-openbsd* | *-*-freebsd*)
# Do not include libc_r directly, use -pthread flag.
continue
;;
esac
fi
deplibs="$deplibs $arg"
continue
;;
-module)
module=yes
continue
;;
-no-fast-install)
fast_install=no
continue
;;
-no-install)
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
# The PATH hackery in wrapper scripts is required on Windows
# in order for the loader to find any dlls it needs.
$echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
$echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
fast_install=no
;;
*) no_install=yes ;;
esac
continue
;;
-no-undefined)
allow_undefined=no
continue
;;
-o) prev=output ;;
-release)
prev=release
continue
;;
-rpath)
prev=rpath
continue
;;
-R)
prev=xrpath
continue
;;
-R*)
dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
# We need an absolute path.
case $dir in
[\\/]* | [A-Za-z]:[\\/]*) ;;
*)
$echo "$modename: only absolute run-paths are allowed" 1>&2
exit 1
;;
esac
case "$xrpath " in
*" $dir "*) ;;
*) xrpath="$xrpath $dir" ;;
esac
continue
;;
-static)
# The effects of -static are defined in a previous loop.
# We used to do the same as -all-static on platforms that
# didn't have a PIC flag, but the assumption that the effects
# would be equivalent was wrong. It would break on at least
# Digital Unix and AIX.
continue
;;
-thread-safe)
thread_safe=yes
continue
;;
-version-info)
prev=vinfo
continue
;;
-Wc,*)
args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
arg=
save_ifs="$IFS"; IFS=','
for flag in $args; do
IFS="$save_ifs"
case $flag in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
flag="\"$flag\""
;;
esac
arg="$arg $wl$flag"
compiler_flags="$compiler_flags $flag"
done
IFS="$save_ifs"
arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
;;
-Wl,*)
args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
arg=
save_ifs="$IFS"; IFS=','
for flag in $args; do
IFS="$save_ifs"
case $flag in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
flag="\"$flag\""
;;
esac
arg="$arg $wl$flag"
compiler_flags="$compiler_flags $wl$flag"
linker_flags="$linker_flags $flag"
done
IFS="$save_ifs"
arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
;;
-Xcompiler)
prev=xcompiler
continue
;;
-Xlinker)
prev=xlinker
continue
;;
# Some other compiler flag.
-* | +*)
# Unknown arguments in both finalize_command and compile_command need
# to be aesthetically quoted because they are evaled later.
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
arg="\"$arg\""
;;
esac
;;
*.lo | *.$objext)
# A library or standard object.
if test "$prev" = dlfiles; then
# This file was specified with -dlopen.
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
dlfiles="$dlfiles $arg"
prev=
continue
else
# If libtool objects are unsupported, then we need to preload.
prev=dlprefiles
fi
fi
if test "$prev" = dlprefiles; then
# Preload the old-style object.
dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
prev=
else
case $arg in
*.lo) libobjs="$libobjs $arg" ;;
*) objs="$objs $arg" ;;
esac
fi
;;
*.$libext)
# An archive.
deplibs="$deplibs $arg"
old_deplibs="$old_deplibs $arg"
continue
;;
*.la)
# A libtool-controlled library.
if test "$prev" = dlfiles; then
# This library was specified with -dlopen.
dlfiles="$dlfiles $arg"
prev=
elif test "$prev" = dlprefiles; then
# The library was specified with -dlpreopen.
dlprefiles="$dlprefiles $arg"
prev=
else
deplibs="$deplibs $arg"
fi
continue
;;
# Some other compiler argument.
*)
# Unknown arguments in both finalize_command and compile_command need
# to be aesthetically quoted because they are evaled later.
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
arg="\"$arg\""
;;
esac
;;
esac # arg
# Now actually substitute the argument into the commands.
if test -n "$arg"; then
compile_command="$compile_command $arg"
finalize_command="$finalize_command $arg"
fi
done # argument parsing loop
if test -n "$prev"; then
$echo "$modename: the \`$prevarg' option requires an argument" 1>&2
$echo "$help" 1>&2
exit 1
fi
if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
eval arg=\"$export_dynamic_flag_spec\"
compile_command="$compile_command $arg"
finalize_command="$finalize_command $arg"
fi
# calculate the name of the file, without its directory
outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
libobjs_save="$libobjs"
if test -n "$shlibpath_var"; then
# get the directories listed in $shlibpath_var
eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
else
shlib_search_path=
fi
eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
if test "X$output_objdir" = "X$output"; then
output_objdir="$objdir"
else
output_objdir="$output_objdir/$objdir"
fi
# Create the object directory.
if test ! -d $output_objdir; then
$show "$mkdir $output_objdir"
$run $mkdir $output_objdir
status=$?
if test $status -ne 0 && test ! -d $output_objdir; then
exit $status
fi
fi
# Determine the type of output
case $output in
"")
$echo "$modename: you must specify an output file" 1>&2
$echo "$help" 1>&2
exit 1
;;
*.$libext) linkmode=oldlib ;;
*.lo | *.$objext) linkmode=obj ;;
*.la) linkmode=lib ;;
*) linkmode=prog ;; # Anything else should be a program.
esac
specialdeplibs=
libs=
# Find all interdependent deplibs by searching for libraries
# that are linked more than once (e.g. -la -lb -la)
for deplib in $deplibs; do
if test "X$duplicate_deps" = "Xyes" ; then
case "$libs " in
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
esac
fi
libs="$libs $deplib"
done
deplibs=
newdependency_libs=
newlib_search_path=
need_relink=no # whether we're linking any uninstalled libtool libraries
notinst_deplibs= # not-installed libtool libraries
notinst_path= # paths that contain not-installed libtool libraries
case $linkmode in
lib)
passes="conv link"
for file in $dlfiles $dlprefiles; do
case $file in
*.la) ;;
*)
$echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
exit 1
;;
esac
done
;;
prog)
compile_deplibs=
finalize_deplibs=
alldeplibs=no
newdlfiles=
newdlprefiles=
passes="conv scan dlopen dlpreopen link"
;;
*) passes="conv"
;;
esac
for pass in $passes; do
if test $linkmode = prog; then
# Determine which files to process
case $pass in
dlopen)
libs="$dlfiles"
save_deplibs="$deplibs" # Collect dlpreopened libraries
deplibs=
;;
dlpreopen) libs="$dlprefiles" ;;
link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
esac
fi
for deplib in $libs; do
lib=
found=no
case $deplib in
-l*)
if test $linkmode = oldlib && test $linkmode = obj; then
$echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
continue
fi
if test $pass = conv; then
deplibs="$deplib $deplibs"
continue
fi
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
# Search the libtool library
lib="$searchdir/lib${name}.la"
if test -f "$lib"; then
found=yes
break
fi
done
if test "$found" != yes; then
# deplib doesn't seem to be a libtool library
if test "$linkmode,$pass" = "prog,link"; then
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
else
deplibs="$deplib $deplibs"
test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
fi
continue
fi
;; # -l
-L*)
case $linkmode in
lib)
deplibs="$deplib $deplibs"
test $pass = conv && continue
newdependency_libs="$deplib $newdependency_libs"
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
;;
prog)
if test $pass = conv; then
deplibs="$deplib $deplibs"
continue
fi
if test $pass = scan; then
deplibs="$deplib $deplibs"
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
else
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
fi
;;
*)
$echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
;;
esac # linkmode
continue
;; # -L
-R*)
if test $pass = link; then
dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
# Make sure the xrpath contains only unique directories.
case "$xrpath " in
*" $dir "*) ;;
*) xrpath="$xrpath $dir" ;;
esac
fi
deplibs="$deplib $deplibs"
continue
;;
*.la) lib="$deplib" ;;
*.$libext)
if test $pass = conv; then
deplibs="$deplib $deplibs"
continue
fi
case $linkmode in
lib)
if test "$deplibs_check_method" != pass_all; then
echo
echo "*** Warning: Trying to link with static lib archive $deplib."
echo "*** I have the capability to make that library automatically link in when"
echo "*** you link to this library. But I can only do this if you have a"
echo "*** shared version of the library, which you do not appear to have"
echo "*** because the file extensions .$libext of this argument makes me believe"
echo "*** that it is just a static archive that I should not used here."
else
echo
echo "*** Warning: Linking the shared library $output against the"
echo "*** static library $deplib is not portable!"
deplibs="$deplib $deplibs"
fi
continue
;;
prog)
if test $pass != link; then
deplibs="$deplib $deplibs"
else
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
fi
continue
;;
esac # linkmode
;; # *.$libext
*.lo | *.$objext)
if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
# If there is no dlopen support or we're linking statically,
# we need to preload.
newdlprefiles="$newdlprefiles $deplib"
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
else
newdlfiles="$newdlfiles $deplib"
fi
continue
;;
%DEPLIBS%)
alldeplibs=yes
continue
;;
esac # case $deplib
if test $found = yes || test -f "$lib"; then :
else
$echo "$modename: cannot find the library \`$lib'" 1>&2
exit 1
fi
# Check to see that this really is a libtool archive.
if (${SED} -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
else
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
exit 1
fi
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
test "X$ladir" = "X$lib" && ladir="."
dlname=
dlopen=
dlpreopen=
libdir=
library_names=
old_library=
# If the library was installed with an old release of libtool,
# it will not redefine variable installed.
installed=yes
# Read the .la file
case $lib in
*/* | *\\*) . $lib ;;
*) . ./$lib ;;
esac
if test "$linkmode,$pass" = "lib,link" ||
test "$linkmode,$pass" = "prog,scan" ||
{ test $linkmode = oldlib && test $linkmode = obj; }; then
# Add dl[pre]opened files of deplib
test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
fi
if test $pass = conv; then
# Only check for convenience libraries
deplibs="$lib $deplibs"
if test -z "$libdir"; then
if test -z "$old_library"; then
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
exit 1
fi
# It is a libtool convenience library, so add in its objects.
convenience="$convenience $ladir/$objdir/$old_library"
old_convenience="$old_convenience $ladir/$objdir/$old_library"
tmp_libs=
for deplib in $dependency_libs; do
deplibs="$deplib $deplibs"
if test "X$duplicate_deps" = "Xyes" ; then
case "$tmp_libs " in
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
esac
fi
tmp_libs="$tmp_libs $deplib"
done
elif test $linkmode != prog && test $linkmode != lib; then
$echo "$modename: \`$lib' is not a convenience library" 1>&2
exit 1
fi
continue
fi # $pass = conv
# Get the name of the library we link against.
linklib=
for l in $old_library $library_names; do
linklib="$l"
done
if test -z "$linklib"; then
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
exit 1
fi
# This library was specified with -dlopen.
if test $pass = dlopen; then
if test -z "$libdir"; then
$echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
exit 1
fi
if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
# If there is no dlname, no dlopen support or we're linking
# statically, we need to preload.
dlprefiles="$dlprefiles $lib"
else
newdlfiles="$newdlfiles $lib"
fi
continue
fi # $pass = dlopen
# We need an absolute path.
case $ladir in
[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
*)
abs_ladir=`cd "$ladir" && pwd`
if test -z "$abs_ladir"; then
$echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
$echo "$modename: passing it literally to the linker, although it might fail" 1>&2
abs_ladir="$ladir"
fi
;;
esac
laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
# Find the relevant object directory and library name.
if test "X$installed" = Xyes; then
if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
$echo "$modename: warning: library \`$lib' was moved." 1>&2
dir="$ladir"
absdir="$abs_ladir"
libdir="$abs_ladir"
else
dir="$libdir"
absdir="$libdir"
fi
else
dir="$ladir/$objdir"
absdir="$abs_ladir/$objdir"
# Remove this search path later
notinst_path="$notinst_path $abs_ladir"
fi # $installed = yes
name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
# This library was specified with -dlpreopen.
if test $pass = dlpreopen; then
if test -z "$libdir"; then
$echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
exit 1
fi
# Prefer using a static library (so that no silly _DYNAMIC symbols
# are required to link).
if test -n "$old_library"; then
newdlprefiles="$newdlprefiles $dir/$old_library"
# Otherwise, use the dlname, so that lt_dlopen finds it.
elif test -n "$dlname"; then
newdlprefiles="$newdlprefiles $dir/$dlname"
else
newdlprefiles="$newdlprefiles $dir/$linklib"
fi
fi # $pass = dlpreopen
if test -z "$libdir"; then
# Link the convenience library
if test $linkmode = lib; then
deplibs="$dir/$old_library $deplibs"
elif test "$linkmode,$pass" = "prog,link"; then
compile_deplibs="$dir/$old_library $compile_deplibs"
finalize_deplibs="$dir/$old_library $finalize_deplibs"
else
deplibs="$lib $deplibs"
fi
continue
fi
if test $linkmode = prog && test $pass != link; then
newlib_search_path="$newlib_search_path $ladir"
deplibs="$lib $deplibs"
linkalldeplibs=no
if test "$link_all_deplibs" != no || test -z "$library_names" ||
test "$build_libtool_libs" = no; then
linkalldeplibs=yes
fi
tmp_libs=
for deplib in $dependency_libs; do
case $deplib in
-L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
esac
# Need to link against all dependency_libs?
if test $linkalldeplibs = yes; then
deplibs="$deplib $deplibs"
else
# Need to hardcode shared library paths
# or/and link against static libraries
newdependency_libs="$deplib $newdependency_libs"
fi
if test "X$duplicate_deps" = "Xyes" ; then
case "$tmp_libs " in
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
esac
fi
tmp_libs="$tmp_libs $deplib"
done # for deplib
continue
fi # $linkmode = prog...
link_static=no # Whether the deplib will be linked statically
if test -n "$library_names" &&
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
# Link against this shared library
if test "$linkmode,$pass" = "prog,link" ||
{ test $linkmode = lib && test $hardcode_into_libs = yes; }; then
# Hardcode the library path.
# Skip directories that are in the system default run-time
# search path.
case " $sys_lib_dlsearch_path " in
*" $absdir "*) ;;
*)
case "$compile_rpath " in
*" $absdir "*) ;;
*) compile_rpath="$compile_rpath $absdir"
esac
;;
esac
case " $sys_lib_dlsearch_path " in
*" $libdir "*) ;;
*)
case "$finalize_rpath " in
*" $libdir "*) ;;
*) finalize_rpath="$finalize_rpath $libdir"
esac
;;
esac
if test $linkmode = prog; then
# We need to hardcode the library path
if test -n "$shlibpath_var"; then
# Make sure the rpath contains only unique directories.
case "$temp_rpath " in
*" $dir "*) ;;
*" $absdir "*) ;;
*) temp_rpath="$temp_rpath $dir" ;;
esac
fi
fi
fi # $linkmode,$pass = prog,link...
if test "$alldeplibs" = yes &&
{ test "$deplibs_check_method" = pass_all ||
{ test "$build_libtool_libs" = yes &&
test -n "$library_names"; }; }; then
# We only need to search for static libraries
continue
fi
if test "$installed" = no; then
notinst_deplibs="$notinst_deplibs $lib"
need_relink=yes
fi
if test -n "$old_archive_from_expsyms_cmds"; then
# figure out the soname
set dummy $library_names
realname="$2"
shift; shift
libname=`eval \\$echo \"$libname_spec\"`
# use dlname if we got it. it's perfectly good, no?
if test -n "$dlname"; then
soname="$dlname"
elif test -n "$soname_spec"; then
# bleh windows
case $host in
*cygwin*)
major=`expr $current - $age`
versuffix="-$major"
;;
esac
eval soname=\"$soname_spec\"
else
soname="$realname"
fi
# Make a new name for the extract_expsyms_cmds to use
soroot="$soname"
soname=`echo $soroot | ${SED} -e 's/^.*\///'`
newlib="libimp-`echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
# If the library has no export list, then create one now
if test -f "$output_objdir/$soname-def"; then :
else
$show "extracting exported symbol list from \`$soname'"
save_ifs="$IFS"; IFS='~'
eval cmds=\"$extract_expsyms_cmds\"
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd" || exit $?
done
IFS="$save_ifs"
fi
# Create $newlib
if test -f "$output_objdir/$newlib"; then :; else
$show "generating import library for \`$soname'"
save_ifs="$IFS"; IFS='~'
eval cmds=\"$old_archive_from_expsyms_cmds\"
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd" || exit $?
done
IFS="$save_ifs"
fi
# make sure the library variables are pointing to the new library
dir=$output_objdir
linklib=$newlib
fi # test -n $old_archive_from_expsyms_cmds
if test $linkmode = prog || test "$mode" != relink; then
add_shlibpath=
add_dir=
add=
lib_linked=yes
case $hardcode_action in
immediate | unsupported)
if test "$hardcode_direct" = no; then
add="$dir/$linklib"
elif test "$hardcode_minus_L" = no; then
case $host in
*-*-sunos*) add_shlibpath="$dir" ;;
esac
add_dir="-L$dir"
add="-l$name"
elif test "$hardcode_shlibpath_var" = no; then
add_shlibpath="$dir"
add="-l$name"
else
lib_linked=no
fi
;;
relink)
if test "$hardcode_direct" = yes; then
add="$dir/$linklib"
elif test "$hardcode_minus_L" = yes; then
add_dir="-L$dir"
add="-l$name"
elif test "$hardcode_shlibpath_var" = yes; then
add_shlibpath="$dir"
add="-l$name"
else
lib_linked=no
fi
;;
*) lib_linked=no ;;
esac
if test "$lib_linked" != yes; then
$echo "$modename: configuration error: unsupported hardcode properties"
exit 1
fi
if test -n "$add_shlibpath"; then
case :$compile_shlibpath: in
*":$add_shlibpath:"*) ;;
*) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
esac
fi
if test $linkmode = prog; then
test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
test -n "$add" && compile_deplibs="$add $compile_deplibs"
else
test -n "$add_dir" && deplibs="$add_dir $deplibs"
test -n "$add" && deplibs="$add $deplibs"
if test "$hardcode_direct" != yes && \
test "$hardcode_minus_L" != yes && \
test "$hardcode_shlibpath_var" = yes; then
case :$finalize_shlibpath: in
*":$libdir:"*) ;;
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
esac
fi
fi
fi
if test $linkmode = prog || test "$mode" = relink; then
add_shlibpath=
add_dir=
add=
# Finalize command for both is simple: just hardcode it.
if test "$hardcode_direct" = yes; then
add="$libdir/$linklib"
elif test "$hardcode_minus_L" = yes; then
add_dir="-L$libdir"
add="-l$name"
elif test "$hardcode_shlibpath_var" = yes; then
case :$finalize_shlibpath: in
*":$libdir:"*) ;;
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
esac
add="-l$name"
else
# We cannot seem to hardcode it, guess we'll fake it.
add_dir="-L$libdir"
add="-l$name"
fi
if test $linkmode = prog; then
test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
else
test -n "$add_dir" && deplibs="$add_dir $deplibs"
test -n "$add" && deplibs="$add $deplibs"
fi
fi
elif test $linkmode = prog; then
if test "$alldeplibs" = yes &&
{ test "$deplibs_check_method" = pass_all ||
{ test "$build_libtool_libs" = yes &&
test -n "$library_names"; }; }; then
# We only need to search for static libraries
continue
fi
# Try to link the static library
# Here we assume that one of hardcode_direct or hardcode_minus_L
# is not unsupported. This is valid on all known static and
# shared platforms.
if test "$hardcode_direct" != unsupported; then
test -n "$old_library" && linklib="$old_library"
compile_deplibs="$dir/$linklib $compile_deplibs"
finalize_deplibs="$dir/$linklib $finalize_deplibs"
else
compile_deplibs="-l$name -L$dir $compile_deplibs"
finalize_deplibs="-l$name -L$dir $finalize_deplibs"
fi
elif test "$build_libtool_libs" = yes; then
# Not a shared library
if test "$deplibs_check_method" != pass_all; then
# We're trying link a shared library against a static one
# but the system doesn't support it.
# Just print a warning and add the library to dependency_libs so
# that the program can be linked against the static library.
echo
echo "*** Warning: This system can not link to static lib archive $lib."
echo "*** I have the capability to make that library automatically link in when"
echo "*** you link to this library. But I can only do this if you have a"
echo "*** shared version of the library, which you do not appear to have."
if test "$module" = yes; then
echo "*** But as you try to build a module library, libtool will still create "
echo "*** a static module, that should work as long as the dlopening application"
echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
if test -z "$global_symbol_pipe"; then
echo
echo "*** However, this would only work if libtool was able to extract symbol"
echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
echo "*** not find such a program. So, this module is probably useless."
echo "*** \`nm' from GNU binutils and a full rebuild may help."
fi
if test "$build_old_libs" = no; then
build_libtool_libs=module
build_old_libs=yes
else
build_libtool_libs=no
fi
fi
else
convenience="$convenience $dir/$old_library"
old_convenience="$old_convenience $dir/$old_library"
deplibs="$dir/$old_library $deplibs"
link_static=yes
fi
fi # link shared/static library?
if test $linkmode = lib; then
if test -n "$dependency_libs" &&
{ test $hardcode_into_libs != yes || test $build_old_libs = yes ||
test $link_static = yes; }; then
# Extract -R from dependency_libs
temp_deplibs=
for libdir in $dependency_libs; do
case $libdir in
-R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
case " $xrpath " in
*" $temp_xrpath "*) ;;
*) xrpath="$xrpath $temp_xrpath";;
esac;;
*) temp_deplibs="$temp_deplibs $libdir";;
esac
done
dependency_libs="$temp_deplibs"
fi
newlib_search_path="$newlib_search_path $absdir"
# Link against this library
test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
# ... and its dependency_libs
tmp_libs=
for deplib in $dependency_libs; do
newdependency_libs="$deplib $newdependency_libs"
if test "X$duplicate_deps" = "Xyes" ; then
case "$tmp_libs " in
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
esac
fi
tmp_libs="$tmp_libs $deplib"
done
if test $link_all_deplibs != no; then
# Add the search paths of all dependency libraries
for deplib in $dependency_libs; do
case $deplib in
-L*) path="$deplib" ;;
*.la)
dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
test "X$dir" = "X$deplib" && dir="."
# We need an absolute path.
case $dir in
[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
*)
absdir=`cd "$dir" && pwd`
if test -z "$absdir"; then
$echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
absdir="$dir"
fi
;;
esac
if grep "^installed=no" $deplib > /dev/null; then
path="-L$absdir/$objdir"
else
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
if test -z "$libdir"; then
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
exit 1
fi
if test "$absdir" != "$libdir"; then
$echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
fi
path="-L$absdir"
fi
;;
*) continue ;;
esac
case " $deplibs " in
*" $path "*) ;;
*) deplibs="$deplibs $path" ;;
esac
done
fi # link_all_deplibs != no
fi # linkmode = lib
done # for deplib in $libs
if test $pass = dlpreopen; then
# Link the dlpreopened libraries before other libraries
for deplib in $save_deplibs; do
deplibs="$deplib $deplibs"
done
fi
if test $pass != dlopen; then
test $pass != scan && dependency_libs="$newdependency_libs"
if test $pass != conv; then
# Make sure lib_search_path contains only unique directories.
lib_search_path=
for dir in $newlib_search_path; do
case "$lib_search_path " in
*" $dir "*) ;;
*) lib_search_path="$lib_search_path $dir" ;;
esac
done
newlib_search_path=
fi
if test "$linkmode,$pass" != "prog,link"; then
vars="deplibs"
else
vars="compile_deplibs finalize_deplibs"
fi
for var in $vars dependency_libs; do
# Add libraries to $var in reverse order
eval tmp_libs=\"\$$var\"
new_libs=
for deplib in $tmp_libs; do
case $deplib in
-L*) new_libs="$deplib $new_libs" ;;
*)
case " $specialdeplibs " in
*" $deplib "*) new_libs="$deplib $new_libs" ;;
*)
case " $new_libs " in
*" $deplib "*) ;;
*) new_libs="$deplib $new_libs" ;;
esac
;;
esac
;;
esac
done
tmp_libs=
for deplib in $new_libs; do
case $deplib in
-L*)
case " $tmp_libs " in
*" $deplib "*) ;;
*) tmp_libs="$tmp_libs $deplib" ;;
esac
;;
*) tmp_libs="$tmp_libs $deplib" ;;
esac
done
eval $var=\"$tmp_libs\"
done # for var
fi
if test "$pass" = "conv" &&
{ test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then
libs="$deplibs" # reset libs
deplibs=
fi
done # for pass
if test $linkmode = prog; then
dlfiles="$newdlfiles"
dlprefiles="$newdlprefiles"
fi
case $linkmode in
oldlib)
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
fi
if test -n "$rpath"; then
$echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
fi
if test -n "$xrpath"; then
$echo "$modename: warning: \`-R' is ignored for archives" 1>&2
fi
if test -n "$vinfo"; then
$echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
fi
if test -n "$release"; then
$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
fi
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
fi
# Now set the variables for building old libraries.
build_libtool_libs=no
oldlibs="$output"
objs="$objs$old_deplibs"
;;
lib)
# Make sure we only generate libraries of the form `libNAME.la'.
case $outputname in
lib*)
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
eval libname=\"$libname_spec\"
;;
*)
if test "$module" = no; then
$echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
$echo "$help" 1>&2
exit 1
fi
if test "$need_lib_prefix" != no; then
# Add the "lib" prefix for modules if required
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
eval libname=\"$libname_spec\"
else
libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
fi
;;
esac
if test -n "$objs"; then
if test "$deplibs_check_method" != pass_all; then
$echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
exit 1
else
echo
echo "*** Warning: Linking the shared library $output against the non-libtool"
echo "*** objects $objs is not portable!"
libobjs="$libobjs $objs"
fi
fi
if test "$dlself" != no; then
$echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
fi
set dummy $rpath
if test $# -gt 2; then
$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
fi
install_libdir="$2"
oldlibs=
if test -z "$rpath"; then
if test "$build_libtool_libs" = yes; then
# Building a libtool convenience library.
libext=al
oldlibs="$output_objdir/$libname.$libext $oldlibs"
build_libtool_libs=convenience
build_old_libs=yes
fi
if test -n "$vinfo"; then
$echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
fi
if test -n "$release"; then
$echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
fi
else
# Parse the version information argument.
save_ifs="$IFS"; IFS=':'
set dummy $vinfo 0 0 0
IFS="$save_ifs"
if test -n "$8"; then
$echo "$modename: too many parameters to \`-version-info'" 1>&2
$echo "$help" 1>&2
exit 1
fi
current="$2"
revision="$3"
age="$4"
# Check that each of the things are valid numbers.
case $current in
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
*)
$echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
exit 1
;;
esac
case $revision in
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
*)
$echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
exit 1
;;
esac
case $age in
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
*)
$echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
exit 1
;;
esac
if test $age -gt $current; then
$echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
exit 1
fi
# Calculate the version variables.
major=
versuffix=
verstring=
case $version_type in
none) ;;
darwin)
# Like Linux, but with the current version available in
# verstring for coding it into the library header
major=.`expr $current - $age`
versuffix="$major.$age.$revision"
# Darwin ld doesn't like 0 for these options...
minor_current=`expr $current + 1`
verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
;;
freebsd-aout)
major=".$current"
versuffix=".$current.$revision";
;;
freebsd-elf)
major=".$current"
versuffix=".$current";
;;
irix | nonstopux)
major=`expr $current - $age + 1`
case $version_type in
nonstopux) verstring_prefix=nonstopux ;;
*) verstring_prefix=sgi ;;
esac
verstring="$verstring_prefix$major.$revision"
# Add in all the interfaces that we are compatible with.
loop=$revision
while test $loop != 0; do
iface=`expr $revision - $loop`
loop=`expr $loop - 1`
verstring="$verstring_prefix$major.$iface:$verstring"
done
# Before this point, $major must not contain `.'.
major=.$major
versuffix="$major.$revision"
;;
linux)
major=.`expr $current - $age`
versuffix="$major.$age.$revision"
;;
osf)
major=`expr $current - $age`
versuffix=".$current.$age.$revision"
verstring="$current.$age.$revision"
# Add in all the interfaces that we are compatible with.
loop=$age
while test $loop != 0; do
iface=`expr $current - $loop`
loop=`expr $loop - 1`
verstring="$verstring:${iface}.0"
done
# Make executables depend on our current version.
verstring="$verstring:${current}.0"
;;
sunos)
major=".$current"
versuffix=".$current.$revision"
;;
windows)
# Use '-' rather than '.', since we only want one
# extension on DOS 8.3 filesystems.
major=`expr $current - $age`
versuffix="-$major"
;;
*)
$echo "$modename: unknown library version type \`$version_type'" 1>&2
echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
exit 1
;;
esac
# Clear the version info if we defaulted, and they specified a release.
if test -z "$vinfo" && test -n "$release"; then
major=
verstring="0.0"
case $version_type in
darwin)
# we can't check for "0.0" in archive_cmds due to quoting
# problems, so we reset it completely
verstring=""
;;
*)
verstring="0.0"
;;
esac
if test "$need_version" = no; then
versuffix=
else
versuffix=".0.0"
fi
fi
# Remove version info from name if versioning should be avoided
if test "$avoid_version" = yes && test "$need_version" = no; then
major=
versuffix=
verstring=""
fi
# Check to see if the archive will have undefined symbols.
if test "$allow_undefined" = yes; then
if test "$allow_undefined_flag" = unsupported; then
$echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
build_libtool_libs=no
build_old_libs=yes
fi
else
# Don't allow undefined symbols.
allow_undefined_flag="$no_undefined_flag"
fi
fi
if test "$mode" != relink; then
# Remove our outputs.
$show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
$run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
fi
# Now set the variables for building old libraries.
if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
oldlibs="$oldlibs $output_objdir/$libname.$libext"
# Transform .lo files to .o files.
oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
fi
# Eliminate all temporary directories.
for path in $notinst_path; do
lib_search_path=`echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
deplibs=`echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
dependency_libs=`echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
done
if test -n "$xrpath"; then
# If the user specified any rpath flags, then add them.
temp_xrpath=
for libdir in $xrpath; do
temp_xrpath="$temp_xrpath -R$libdir"
case "$finalize_rpath " in
*" $libdir "*) ;;
*) finalize_rpath="$finalize_rpath $libdir" ;;
esac
done
if test $hardcode_into_libs != yes || test $build_old_libs = yes; then
dependency_libs="$temp_xrpath $dependency_libs"
fi
fi
# Make sure dlfiles contains only unique files that won't be dlpreopened
old_dlfiles="$dlfiles"
dlfiles=
for lib in $old_dlfiles; do
case " $dlprefiles $dlfiles " in
*" $lib "*) ;;
*) dlfiles="$dlfiles $lib" ;;
esac
done
# Make sure dlprefiles contains only unique files
old_dlprefiles="$dlprefiles"
dlprefiles=
for lib in $old_dlprefiles; do
case "$dlprefiles " in
*" $lib "*) ;;
*) dlprefiles="$dlprefiles $lib" ;;
esac
done
if test "$build_libtool_libs" = yes; then
if test -n "$rpath"; then
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
# these systems don't actually have a c library (as such)!
;;
*-*-rhapsody* | *-*-darwin1.[012])
# Rhapsody C library is in the System framework
deplibs="$deplibs -framework System"
;;
*-*-netbsd*)
# Don't link with libc until the a.out ld.so is fixed.
;;
*-*-openbsd* | *-*-freebsd*)
# Do not include libc due to us having libc/libc_r.
;;
*)
# Add libc to deplibs on all other systems if necessary.
if test $build_libtool_need_lc = "yes"; then
deplibs="$deplibs -lc"
fi
;;
esac
fi
# Transform deplibs into only deplibs that can be linked in shared.
name_save=$name
libname_save=$libname
release_save=$release
versuffix_save=$versuffix
major_save=$major
# I'm not sure if I'm treating the release correctly. I think
# release should show up in the -l (ie -lgmp5) so we don't want to
# add it in twice. Is that correct?
release=""
versuffix=""
major=""
newdeplibs=
droppeddeps=no
case $deplibs_check_method in
pass_all)
# Don't check for shared/static. Everything works.
# This might be a little naive. We might want to check
# whether the library exists or not. But this is on
# osf3 & osf4 and I'm not really sure... Just
# implementing what was already the behaviour.
newdeplibs=$deplibs
;;
test_compile)
# This code stresses the "libraries are programs" paradigm to its
# limits. Maybe even breaks it. We compile a program, linking it
# against the deplibs as a proxy for the library. Then we can check
# whether they linked in statically or dynamically with ldd.
$rm conftest.c
cat > conftest.c <<EOF
int main() { return 0; }
EOF
$rm conftest
$CC -o conftest conftest.c $deplibs
if test $? -eq 0 ; then
ldd_output=`ldd conftest`
for i in $deplibs; do
name="`expr $i : '-l\(.*\)'`"
# If $name is empty we are operating on a -L argument.
if test -n "$name" && test "$name" != "0"; then
libname=`eval \\$echo \"$libname_spec\"`
deplib_matches=`eval \\$echo \"$library_names_spec\"`
set dummy $deplib_matches
deplib_match=$2
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
newdeplibs="$newdeplibs $i"
else
droppeddeps=yes
echo
echo "*** Warning: dynamic linker does not accept needed library $i."
echo "*** I have the capability to make that library automatically link in when"
echo "*** you link to this library. But I can only do this if you have a"
echo "*** shared version of the library, which I believe you do not have"
echo "*** because a test_compile did reveal that the linker did not use it for"
echo "*** its dynamic dependency list that programs get resolved with at runtime."
fi
else
newdeplibs="$newdeplibs $i"
fi
done
else
# Error occured in the first compile. Let's try to salvage
# the situation: Compile a separate program for each library.
for i in $deplibs; do
name="`expr $i : '-l\(.*\)'`"
# If $name is empty we are operating on a -L argument.
if test -n "$name" && test "$name" != "0"; then
$rm conftest
$CC -o conftest conftest.c $i
# Did it work?
if test $? -eq 0 ; then
ldd_output=`ldd conftest`
libname=`eval \\$echo \"$libname_spec\"`
deplib_matches=`eval \\$echo \"$library_names_spec\"`
set dummy $deplib_matches
deplib_match=$2
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
newdeplibs="$newdeplibs $i"
else
droppeddeps=yes
echo
echo "*** Warning: dynamic linker does not accept needed library $i."
echo "*** I have the capability to make that library automatically link in when"
echo "*** you link to this library. But I can only do this if you have a"
echo "*** shared version of the library, which you do not appear to have"
echo "*** because a test_compile did reveal that the linker did not use this one"
echo "*** as a dynamic dependency that programs can get resolved with at runtime."
fi
else
droppeddeps=yes
echo
echo "*** Warning! Library $i is needed by this library but I was not able to"
echo "*** make it link in! You will probably need to install it or some"
echo "*** library that it depends on before this library will be fully"
echo "*** functional. Installing it before continuing would be even better."
fi
else
newdeplibs="$newdeplibs $i"
fi
done
fi
;;
file_magic*)
set dummy $deplibs_check_method
file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
for a_deplib in $deplibs; do
name="`expr $a_deplib : '-l\(.*\)'`"
# If $name is empty we are operating on a -L argument.
if test -n "$name" && test "$name" != "0"; then
libname=`eval \\$echo \"$libname_spec\"`
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
for potent_lib in $potential_libs; do
# Follow soft links.
if ls -lLd "$potent_lib" 2>/dev/null \
| grep " -> " >/dev/null; then
continue
fi
# The statement above tries to avoid entering an
# endless loop below, in case of cyclic links.
# We might still enter an endless loop, since a link
# loop can be closed while we follow links,
# but so what?
potlib="$potent_lib"
while test -h "$potlib" 2>/dev/null; do
potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
case $potliblink in
[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
esac
done
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
| ${SED} 10q \
| egrep "$file_magic_regex" > /dev/null; then
newdeplibs="$newdeplibs $a_deplib"
a_deplib=""
break 2
fi
done
done
if test -n "$a_deplib" ; then
droppeddeps=yes
echo
echo "*** Warning: linker path does not have real file for library $a_deplib."
echo "*** I have the capability to make that library automatically link in when"
echo "*** you link to this library. But I can only do this if you have a"
echo "*** shared version of the library, which you do not appear to have"
echo "*** because I did check the linker path looking for a file starting"
if test -z "$potlib" ; then
echo "*** with $libname but no candidates were found. (...for file magic test)"
else
echo "*** with $libname and none of the candidates passed a file format test"
echo "*** using a file magic. Last file checked: $potlib"
fi
fi
else
# Add a -L argument.
newdeplibs="$newdeplibs $a_deplib"
fi
done # Gone through all deplibs.
;;
match_pattern*)
set dummy $deplibs_check_method
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
for a_deplib in $deplibs; do
name="`expr $a_deplib : '-l\(.*\)'`"
# If $name is empty we are operating on a -L argument.
if test -n "$name" && test "$name" != "0"; then
libname=`eval \\$echo \"$libname_spec\"`
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
for potent_lib in $potential_libs; do
potlib="$potent_lib" # see symlink-check below in file_magic test
if eval echo \"$potent_lib\" 2>/dev/null \
| ${SED} 10q \
| egrep "$match_pattern_regex" > /dev/null; then
newdeplibs="$newdeplibs $a_deplib"
a_deplib=""
break 2
fi
done
done
if test -n "$a_deplib" ; then
droppeddeps=yes
echo
echo "*** Warning: linker path does not have real file for library $a_deplib."
echo "*** I have the capability to make that library automatically link in when"
echo "*** you link to this library. But I can only do this if you have a"
echo "*** shared version of the library, which you do not appear to have"
echo "*** because I did check the linker path looking for a file starting"
if test -z "$potlib" ; then
echo "*** with $libname but no candidates were found. (...for regex pattern test)"
else
echo "*** with $libname and none of the candidates passed a file format test"
echo "*** using a regex pattern. Last file checked: $potlib"
fi
fi
else
# Add a -L argument.
newdeplibs="$newdeplibs $a_deplib"
fi
done # Gone through all deplibs.
;;
none | unknown | *)
newdeplibs=""
if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
-e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
grep . >/dev/null; then
echo
if test "X$deplibs_check_method" = "Xnone"; then
echo "*** Warning: inter-library dependencies are not supported in this platform."
else
echo "*** Warning: inter-library dependencies are not known to be supported."
fi
echo "*** All declared inter-library dependencies are being dropped."
droppeddeps=yes
fi
;;
esac
versuffix=$versuffix_save
major=$major_save
release=$release_save
libname=$libname_save
name=$name_save
case $host in
*-*-rhapsody* | *-*-darwin1.[012])
# On Rhapsody replace the C library is the System framework
newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
;;
esac
if test "$droppeddeps" = yes; then
if test "$module" = yes; then
echo
echo "*** Warning: libtool could not satisfy all declared inter-library"
echo "*** dependencies of module $libname. Therefore, libtool will create"
echo "*** a static module, that should work as long as the dlopening"
echo "*** application is linked with the -dlopen flag."
if test -z "$global_symbol_pipe"; then
echo
echo "*** However, this would only work if libtool was able to extract symbol"
echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
echo "*** not find such a program. So, this module is probably useless."
echo "*** \`nm' from GNU binutils and a full rebuild may help."
fi
if test "$build_old_libs" = no; then
oldlibs="$output_objdir/$libname.$libext"
build_libtool_libs=module
build_old_libs=yes
else
build_libtool_libs=no
fi
else
echo "*** The inter-library dependencies that have been dropped here will be"
echo "*** automatically added whenever a program is linked with this library"
echo "*** or is declared to -dlopen it."
if test $allow_undefined = no; then
echo
echo "*** Since this library must not contain undefined symbols,"
echo "*** because either the platform does not support them or"
echo "*** it was explicitly requested with -no-undefined,"
echo "*** libtool will only create a static version of it."
if test "$build_old_libs" = no; then
oldlibs="$output_objdir/$libname.$libext"
build_libtool_libs=module
build_old_libs=yes
else
build_libtool_libs=no
fi
fi
fi
fi
# Done checking deplibs!
deplibs=$newdeplibs
fi
# All the library-specific variables (install_libdir is set above).
library_names=
old_library=
dlname=
# Test again, we may have decided not to build it any more
if test "$build_libtool_libs" = yes; then
if test $hardcode_into_libs = yes; then
# Hardcode the library paths
hardcode_libdirs=
dep_rpath=
rpath="$finalize_rpath"
test "$mode" != relink && rpath="$compile_rpath$rpath"
for libdir in $rpath; do
if test -n "$hardcode_libdir_flag_spec"; then
if test -n "$hardcode_libdir_separator"; then
if test -z "$hardcode_libdirs"; then
hardcode_libdirs="$libdir"
else
# Just accumulate the unique libdirs.
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
;;
*)
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
;;
esac
fi
else
eval flag=\"$hardcode_libdir_flag_spec\"
dep_rpath="$dep_rpath $flag"
fi
elif test -n "$runpath_var"; then
case "$perm_rpath " in
*" $libdir "*) ;;
*) perm_rpath="$perm_rpath $libdir" ;;
esac
fi
done
# Substitute the hardcoded libdirs into the rpath.
if test -n "$hardcode_libdir_separator" &&
test -n "$hardcode_libdirs"; then
libdir="$hardcode_libdirs"
eval dep_rpath=\"$hardcode_libdir_flag_spec\"
fi
if test -n "$runpath_var" && test -n "$perm_rpath"; then
# We should set the runpath_var.
rpath=
for dir in $perm_rpath; do
rpath="$rpath$dir:"
done
eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
fi
test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
fi
shlibpath="$finalize_shlibpath"
test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
if test -n "$shlibpath"; then
eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
fi
# Get the real and link names of the library.
eval library_names=\"$library_names_spec\"
set dummy $library_names
realname="$2"
shift; shift
if test -n "$soname_spec"; then
eval soname=\"$soname_spec\"
else
soname="$realname"
fi
test -z "$dlname" && dlname=$soname
lib="$output_objdir/$realname"
for link
do
linknames="$linknames $link"
done
# Ensure that we have .o objects for linkers which dislike .lo
# (e.g. aix) in case we are running --disable-static
for obj in $libobjs; do
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
if test "X$xdir" = "X$obj"; then
xdir="."
else
xdir="$xdir"
fi
baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
if test ! -f $xdir/$oldobj; then
$show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
$run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
fi
done
# Use standard objects if they are pic
test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
# Prepare the list of exported symbols
if test -z "$export_symbols"; then
if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
$show "generating symbol list for \`$libname.la'"
export_symbols="$output_objdir/$libname.exp"
$run $rm $export_symbols
eval cmds=\"$export_symbols_cmds\"
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd" || exit $?
done
IFS="$save_ifs"
if test -n "$export_symbols_regex"; then
$show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
$run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
$show "$mv \"${export_symbols}T\" \"$export_symbols\""
$run eval '$mv "${export_symbols}T" "$export_symbols"'
fi
fi
fi
if test -n "$export_symbols" && test -n "$include_expsyms"; then
$run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
fi
if test -n "$convenience"; then
if test -n "$whole_archive_flag_spec"; then
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
else
gentop="$output_objdir/${outputname}x"
$show "${rm}r $gentop"
$run ${rm}r "$gentop"
$show "mkdir $gentop"
$run mkdir "$gentop"
status=$?
if test $status -ne 0 && test ! -d "$gentop"; then
exit $status
fi
generated="$generated $gentop"
for xlib in $convenience; do
# Extract the objects.
case $xlib in
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
*) xabs=`pwd`"/$xlib" ;;
esac
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
xdir="$gentop/$xlib"
$show "${rm}r $xdir"
$run ${rm}r "$xdir"
$show "mkdir $xdir"
$run mkdir "$xdir"
status=$?
if test $status -ne 0 && test ! -d "$xdir"; then
exit $status
fi
$show "(cd $xdir && $AR x $xabs)"
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
done
fi
fi
if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
eval flag=\"$thread_safe_flag_spec\"
linker_flags="$linker_flags $flag"
fi
# Make a backup of the uninstalled library when relinking
if test "$mode" = relink; then
$run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
fi
# Do each of the archive commands.
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
eval cmds=\"$archive_expsym_cmds\"
else
save_deplibs="$deplibs"
for conv in $convenience; do
tmp_deplibs=
for test_deplib in $deplibs; do
if test "$test_deplib" != "$conv"; then
tmp_deplibs="$tmp_deplibs $test_deplib"
fi
done
deplibs="$tmp_deplibs"
done
eval cmds=\"$archive_cmds\"
deplibs="$save_deplibs"
fi
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd" || exit $?
done
IFS="$save_ifs"
# Restore the uninstalled library and exit
if test "$mode" = relink; then
$run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
exit 0
fi
# Create links to the real library.
for linkname in $linknames; do
if test "$realname" != "$linkname"; then
$show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
$run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
fi
done
# If -module or -export-dynamic was specified, set the dlname.
if test "$module" = yes || test "$export_dynamic" = yes; then
# On all known operating systems, these are identical.
dlname="$soname"
fi
fi
;;
obj)
if test -n "$deplibs"; then
$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
fi
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
fi
if test -n "$rpath"; then
$echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
fi
if test -n "$xrpath"; then
$echo "$modename: warning: \`-R' is ignored for objects" 1>&2
fi
if test -n "$vinfo"; then
$echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
fi
if test -n "$release"; then
$echo "$modename: warning: \`-release' is ignored for objects" 1>&2
fi
case $output in
*.lo)
if test -n "$objs$old_deplibs"; then
$echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
exit 1
fi
libobj="$output"
obj=`$echo "X$output" | $Xsed -e "$lo2o"`
;;
*)
libobj=
obj="$output"
;;
esac
# Delete the old objects.
$run $rm $obj $libobj
# Objects from convenience libraries. This assumes
# single-version convenience libraries. Whenever we create
# different ones for PIC/non-PIC, this we'll have to duplicate
# the extraction.
reload_conv_objs=
gentop=
# reload_cmds runs $LD directly, so let us get rid of
# -Wl from whole_archive_flag_spec
wl=
if test -n "$convenience"; then
if test -n "$whole_archive_flag_spec"; then
eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
else
gentop="$output_objdir/${obj}x"
$show "${rm}r $gentop"
$run ${rm}r "$gentop"
$show "mkdir $gentop"
$run mkdir "$gentop"
status=$?
if test $status -ne 0 && test ! -d "$gentop"; then
exit $status
fi
generated="$generated $gentop"
for xlib in $convenience; do
# Extract the objects.
case $xlib in
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
*) xabs=`pwd`"/$xlib" ;;
esac
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
xdir="$gentop/$xlib"
$show "${rm}r $xdir"
$run ${rm}r "$xdir"
$show "mkdir $xdir"
$run mkdir "$xdir"
status=$?
if test $status -ne 0 && test ! -d "$xdir"; then
exit $status
fi
$show "(cd $xdir && $AR x $xabs)"
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
done
fi
fi
# Create the old-style object.
reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
output="$obj"
eval cmds=\"$reload_cmds\"
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd" || exit $?
done
IFS="$save_ifs"
# Exit if we aren't doing a library object file.
if test -z "$libobj"; then
if test -n "$gentop"; then
$show "${rm}r $gentop"
$run ${rm}r $gentop
fi
exit 0
fi
if test "$build_libtool_libs" != yes; then
if test -n "$gentop"; then
$show "${rm}r $gentop"
$run ${rm}r $gentop
fi
# Create an invalid libtool object if no PIC, so that we don't
# accidentally link it into a program.
$show "echo timestamp > $libobj"
$run eval "echo timestamp > $libobj" || exit $?
exit 0
fi
if test -n "$pic_flag" || test "$pic_mode" != default; then
# Only do commands if we really have different PIC objects.
reload_objs="$libobjs $reload_conv_objs"
output="$libobj"
eval cmds=\"$reload_cmds\"
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd" || exit $?
done
IFS="$save_ifs"
else
# Just create a symlink.
$show $rm $libobj
$run $rm $libobj
xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
if test "X$xdir" = "X$libobj"; then
xdir="."
else
xdir="$xdir"
fi
baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
$show "(cd $xdir && $LN_S $oldobj $baseobj)"
$run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
fi
if test -n "$gentop"; then
$show "${rm}r $gentop"
$run ${rm}r $gentop
fi
exit 0
;;
prog)
case $host in
*cygwin*) output=`echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
esac
if test -n "$vinfo"; then
$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
fi
if test -n "$release"; then
$echo "$modename: warning: \`-release' is ignored for programs" 1>&2
fi
if test "$preload" = yes; then
if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
test "$dlopen_self_static" = unknown; then
$echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
fi
fi
case $host in
*-*-rhapsody* | *-*-darwin1.[012])
# On Rhapsody replace the C library is the System framework
compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
;;
esac
compile_command="$compile_command $compile_deplibs"
finalize_command="$finalize_command $finalize_deplibs"
if test -n "$rpath$xrpath"; then
# If the user specified any rpath flags, then add them.
for libdir in $rpath $xrpath; do
# This is the magic to use -rpath.
case "$finalize_rpath " in
*" $libdir "*) ;;
*) finalize_rpath="$finalize_rpath $libdir" ;;
esac
done
fi
# Now hardcode the library paths
rpath=
hardcode_libdirs=
for libdir in $compile_rpath $finalize_rpath; do
if test -n "$hardcode_libdir_flag_spec"; then
if test -n "$hardcode_libdir_separator"; then
if test -z "$hardcode_libdirs"; then
hardcode_libdirs="$libdir"
else
# Just accumulate the unique libdirs.
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
;;
*)
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
;;
esac
fi
else
eval flag=\"$hardcode_libdir_flag_spec\"
rpath="$rpath $flag"
fi
elif test -n "$runpath_var"; then
case "$perm_rpath " in
*" $libdir "*) ;;
*) perm_rpath="$perm_rpath $libdir" ;;
esac
fi
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
case :$dllsearchpath: in
*":$libdir:"*) ;;
*) dllsearchpath="$dllsearchpath:$libdir";;
esac
;;
esac
done
# Substitute the hardcoded libdirs into the rpath.
if test -n "$hardcode_libdir_separator" &&
test -n "$hardcode_libdirs"; then
libdir="$hardcode_libdirs"
eval rpath=\" $hardcode_libdir_flag_spec\"
fi
compile_rpath="$rpath"
rpath=
hardcode_libdirs=
for libdir in $finalize_rpath; do
if test -n "$hardcode_libdir_flag_spec"; then
if test -n "$hardcode_libdir_separator"; then
if test -z "$hardcode_libdirs"; then
hardcode_libdirs="$libdir"
else
# Just accumulate the unique libdirs.
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
;;
*)
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
;;
esac
fi
else
eval flag=\"$hardcode_libdir_flag_spec\"
rpath="$rpath $flag"
fi
elif test -n "$runpath_var"; then
case "$finalize_perm_rpath " in
*" $libdir "*) ;;
*) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
esac
fi
done
# Substitute the hardcoded libdirs into the rpath.
if test -n "$hardcode_libdir_separator" &&
test -n "$hardcode_libdirs"; then
libdir="$hardcode_libdirs"
eval rpath=\" $hardcode_libdir_flag_spec\"
fi
finalize_rpath="$rpath"
if test -n "$libobjs" && test "$build_old_libs" = yes; then
# Transform all the library objects into standard objects.
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
fi
dlsyms=
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
if test -n "$NM" && test -n "$global_symbol_pipe"; then
dlsyms="${outputname}S.c"
else
$echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
fi
fi
if test -n "$dlsyms"; then
case $dlsyms in
"") ;;
*.c)
# Discover the nlist of each of the dlfiles.
nlist="$output_objdir/${outputname}.nm"
$show "$rm $nlist ${nlist}S ${nlist}T"
$run $rm "$nlist" "${nlist}S" "${nlist}T"
# Parse the name list into a source file.
$show "creating $output_objdir/$dlsyms"
test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
#ifdef __cplusplus
extern \"C\" {
#endif
/* Prevent the only kind of declaration conflicts we can make. */
#define lt_preloaded_symbols some_other_symbol
/* External symbol declarations for the compiler. */\
"
if test "$dlself" = yes; then
$show "generating symbol list for \`$output'"
test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
# Add our own program objects to the symbol list.
progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
for arg in $progfiles; do
$show "extracting global C symbols from \`$arg'"
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
done
if test -n "$exclude_expsyms"; then
$run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
$run eval '$mv "$nlist"T "$nlist"'
fi
if test -n "$export_symbols_regex"; then
$run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
$run eval '$mv "$nlist"T "$nlist"'
fi
# Prepare the list of exported symbols
if test -z "$export_symbols"; then
export_symbols="$output_objdir/$output.exp"
$run $rm $export_symbols
$run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
else
$run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
$run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
$run eval 'mv "$nlist"T "$nlist"'
fi
fi
for arg in $dlprefiles; do
$show "extracting global C symbols from \`$arg'"
name=`echo "$arg" | ${SED} -e 's%^.*/%%'`
$run eval 'echo ": $name " >> "$nlist"'
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
done
if test -z "$run"; then
# Make sure we have at least an empty file.
test -f "$nlist" || : > "$nlist"
if test -n "$exclude_expsyms"; then
egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
$mv "$nlist"T "$nlist"
fi
# Try sorting and uniquifying the output.
if grep -v "^: " < "$nlist" |
if sort -k 3 </dev/null >/dev/null 2>&1; then
sort -k 3
else
sort +2
fi |
uniq > "$nlist"S; then
:
else
grep -v "^: " < "$nlist" > "$nlist"S
fi
if test -f "$nlist"S; then
eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
else
echo '/* NONE */' >> "$output_objdir/$dlsyms"
fi
$echo >> "$output_objdir/$dlsyms" "\
#undef lt_preloaded_symbols
#if defined (__STDC__) && __STDC__
# define lt_ptr void *
#else
# define lt_ptr char *
# define const
#endif
/* The mapping between symbol names and symbols. */
const struct {
const char *name;
lt_ptr address;
}
lt_preloaded_symbols[] =
{\
"
eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
$echo >> "$output_objdir/$dlsyms" "\
{0, (lt_ptr) 0}
};
/* This works around a problem in FreeBSD linker */
#ifdef FREEBSD_WORKAROUND
static const void *lt_preloaded_setup() {
return lt_preloaded_symbols;
}
#endif
#ifdef __cplusplus
}
#endif\
"
fi
pic_flag_for_symtable=
case $host in
# compiling the symbol table file with pic_flag works around
# a FreeBSD bug that causes programs to crash when -lm is
# linked before any other PIC object. But we must not use
# pic_flag when linking with -static. The problem exists in
# FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
*-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
case "$compile_command " in
*" -static "*) ;;
*) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
esac;;
*-*-hpux*)
case "$compile_command " in
*" -static "*) ;;
*) pic_flag_for_symtable=" $pic_flag -DPIC";;
esac
esac
# Now compile the dynamic symbol file.
$show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
$run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
# Clean up the generated files.
$show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
$run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
# Transform the symbol file into the correct name.
compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
;;
*)
$echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
exit 1
;;
esac
else
# We keep going just in case the user didn't refer to
# lt_preloaded_symbols. The linker will fail if global_symbol_pipe
# really was required.
# Nullify the symbol file.
compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
fi
if test $need_relink = no || test "$build_libtool_libs" != yes; then
# Replace the output file specification.
compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
link_command="$compile_command$compile_rpath"
# We have no uninstalled library dependencies, so finalize right now.
$show "$link_command"
$run eval "$link_command"
status=$?
# Delete the generated files.
if test -n "$dlsyms"; then
$show "$rm $output_objdir/${outputname}S.${objext}"
$run $rm "$output_objdir/${outputname}S.${objext}"
fi
exit $status
fi
if test -n "$shlibpath_var"; then
# We should set the shlibpath_var
rpath=
for dir in $temp_rpath; do
case $dir in
[\\/]* | [A-Za-z]:[\\/]*)
# Absolute path.
rpath="$rpath$dir:"
;;
*)
# Relative path: add a thisdir entry.
rpath="$rpath\$thisdir/$dir:"
;;
esac
done
temp_rpath="$rpath"
fi
if test -n "$compile_shlibpath$finalize_shlibpath"; then
compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
fi
if test -n "$finalize_shlibpath"; then
finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
fi
compile_var=
finalize_var=
if test -n "$runpath_var"; then
if test -n "$perm_rpath"; then
# We should set the runpath_var.
rpath=
for dir in $perm_rpath; do
rpath="$rpath$dir:"
done
compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
fi
if test -n "$finalize_perm_rpath"; then
# We should set the runpath_var.
rpath=
for dir in $finalize_perm_rpath; do
rpath="$rpath$dir:"
done
finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
fi
fi
if test "$no_install" = yes; then
# We don't need to create a wrapper script.
link_command="$compile_var$compile_command$compile_rpath"
# Replace the output file specification.
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
# Delete the old output file.
$run $rm $output
# Link the executable and exit
$show "$link_command"
$run eval "$link_command" || exit $?
exit 0
fi
if test "$hardcode_action" = relink; then
# Fast installation is not supported
link_command="$compile_var$compile_command$compile_rpath"
relink_command="$finalize_var$finalize_command$finalize_rpath"
$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
$echo "$modename: \`$output' will be relinked during installation" 1>&2
else
if test "$fast_install" != no; then
link_command="$finalize_var$compile_command$finalize_rpath"
if test "$fast_install" = yes; then
relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
else
# fast_install is set to needless
relink_command=
fi
else
link_command="$compile_var$compile_command$compile_rpath"
relink_command="$finalize_var$finalize_command$finalize_rpath"
fi
fi
# Replace the output file specification.
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
# Delete the old output files.
$run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
$show "$link_command"
$run eval "$link_command" || exit $?
# Now create the wrapper script.
$show "creating $output"
# Quote the relink command for shipping.
if test -n "$relink_command"; then
# Preserve any variables that may affect compiler behavior
for var in $variables_saved_for_relink; do
if eval test -z \"\${$var+set}\"; then
relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
elif eval var_value=\$$var; test -z "$var_value"; then
relink_command="$var=; export $var; $relink_command"
else
var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
relink_command="$var=\"$var_value\"; export $var; $relink_command"
fi
done
relink_command="(cd `pwd`; $relink_command)"
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
fi
# Quote $echo for shipping.
if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
case $0 in
[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
*) qecho="$SHELL `pwd`/$0 --fallback-echo";;
esac
qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
else
qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
fi
# Only actually do things if our run command is non-null.
if test -z "$run"; then
# win32 will think the script is a binary if it has
# a .exe suffix, so we strip it off here.
case $output in
*.exe) output=`echo $output|${SED} 's,.exe$,,'` ;;
esac
# test for cygwin because mv fails w/o .exe extensions
case $host in
*cygwin*) exeext=.exe ;;
*) exeext= ;;
esac
$rm $output
trap "$rm $output; exit 1" 1 2 15
$echo > $output "\
#! $SHELL
# $output - temporary wrapper script for $objdir/$outputname
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
#
# The $output program cannot be directly executed until all the libtool
# libraries that it depends on are installed.
#
# This wrapper script should never be moved out of the build directory.
# If it is, it will not operate correctly.
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
Xsed="${SED}"' -e 1s/^X//'
sed_quote_subst='$sed_quote_subst'
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
relink_command=\"$relink_command\"
# This environment variable determines our operation mode.
if test \"\$libtool_install_magic\" = \"$magic\"; then
# install mode needs the following variable:
notinst_deplibs='$notinst_deplibs'
else
# When we are sourced in execute mode, \$file and \$echo are already set.
if test \"\$libtool_execute_magic\" != \"$magic\"; then
echo=\"$qecho\"
file=\"\$0\"
# Make sure echo works.
if test \"X\$1\" = X--no-reexec; then
# Discard the --no-reexec flag, and continue.
shift
elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
# Yippee, \$echo works!
:
else
# Restart under the correct shell, and then maybe \$echo will work.
exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
fi
fi\
"
$echo >> $output "\
# Find the directory that this script lives in.
thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
test \"x\$thisdir\" = \"x\$file\" && thisdir=.
# Follow symbolic links until we get to the real thisdir.
file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
while test -n \"\$file\"; do
destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
# If there was a directory component, then change thisdir.
if test \"x\$destdir\" != \"x\$file\"; then
case \"\$destdir\" in
[\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
*) thisdir=\"\$thisdir/\$destdir\" ;;
esac
fi
file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
done
# Try to get the absolute directory name.
absdir=\`cd \"\$thisdir\" && pwd\`
test -n \"\$absdir\" && thisdir=\"\$absdir\"
"
if test "$fast_install" = yes; then
echo >> $output "\
program=lt-'$outputname'$exeext
progdir=\"\$thisdir/$objdir\"
if test ! -f \"\$progdir/\$program\" || \\
{ file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
test \"X\$file\" != \"X\$progdir/\$program\"; }; then
file=\"\$\$-\$program\"
if test ! -d \"\$progdir\"; then
$mkdir \"\$progdir\"
else
$rm \"\$progdir/\$file\"
fi"
echo >> $output "\
# relink executable if necessary
if test -n \"\$relink_command\"; then
if relink_command_output=\`eval \$relink_command 2>&1\`; then :
else
$echo \"\$relink_command_output\" >&2
$rm \"\$progdir/\$file\"
exit 1
fi
fi
$mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
{ $rm \"\$progdir/\$program\";
$mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
$rm \"\$progdir/\$file\"
fi"
else
echo >> $output "\
program='$outputname'
progdir=\"\$thisdir/$objdir\"
"
fi
echo >> $output "\
if test -f \"\$progdir/\$program\"; then"
# Export our shlibpath_var if we have one.
if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
$echo >> $output "\
# Add our own library path to $shlibpath_var
$shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
# Some systems cannot cope with colon-terminated $shlibpath_var
# The second colon is a workaround for a bug in BeOS R4 ${SED}
$shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
export $shlibpath_var
"
fi
# fixup the dll searchpath if we need to.
if test -n "$dllsearchpath"; then
$echo >> $output "\
# Add the dll search path components to the executable PATH
PATH=$dllsearchpath:\$PATH
"
fi
$echo >> $output "\
if test \"\$libtool_execute_magic\" != \"$magic\"; then
# Run the actual program with our arguments.
"
case $host in
# win32 systems need to use the prog path for dll
# lookup to work
*-*-cygwin* | *-*-pw32*)
$echo >> $output "\
exec \$progdir/\$program \${1+\"\$@\"}
"
;;
# Backslashes separate directories on plain windows
*-*-mingw | *-*-os2*)
$echo >> $output "\
exec \$progdir\\\\\$program \${1+\"\$@\"}
"
;;
*)
$echo >> $output "\
# Export the path to the program.
PATH=\"\$progdir:\$PATH\"
export PATH
exec \$program \${1+\"\$@\"}
"
;;
esac
$echo >> $output "\
\$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
exit 1
fi
else
# The program doesn't exist.
\$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
\$echo \"This script is just a wrapper for \$program.\" 1>&2
echo \"See the $PACKAGE documentation for more information.\" 1>&2
exit 1
fi
fi\
"
chmod +x $output
fi
exit 0
;;
esac
# See if we need to build an old-fashioned archive.
for oldlib in $oldlibs; do
if test "$build_libtool_libs" = convenience; then
oldobjs="$libobjs_save"
addlibs="$convenience"
build_libtool_libs=no
else
if test "$build_libtool_libs" = module; then
oldobjs="$libobjs_save"
build_libtool_libs=no
else
oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
fi
addlibs="$old_convenience"
fi
if test -n "$addlibs"; then
gentop="$output_objdir/${outputname}x"
$show "${rm}r $gentop"
$run ${rm}r "$gentop"
$show "mkdir $gentop"
$run mkdir "$gentop"
status=$?
if test $status -ne 0 && test ! -d "$gentop"; then
exit $status
fi
generated="$generated $gentop"
# Add in members from convenience archives.
for xlib in $addlibs; do
# Extract the objects.
case $xlib in
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
*) xabs=`pwd`"/$xlib" ;;
esac
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
xdir="$gentop/$xlib"
$show "${rm}r $xdir"
$run ${rm}r "$xdir"
$show "mkdir $xdir"
$run mkdir "$xdir"
status=$?
if test $status -ne 0 && test ! -d "$xdir"; then
exit $status
fi
$show "(cd $xdir && $AR x $xabs)"
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
done
fi
# Do each command in the archive commands.
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
eval cmds=\"$old_archive_from_new_cmds\"
else
# Ensure that we have .o objects in place in case we decided
# not to build a shared library, and have fallen back to building
# static libs even though --disable-static was passed!
for oldobj in $oldobjs; do
if test ! -f $oldobj; then
xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
if test "X$xdir" = "X$oldobj"; then
xdir="."
else
xdir="$xdir"
fi
baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
$show "(cd $xdir && ${LN_S} $obj $baseobj)"
$run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
fi
done
eval cmds=\"$old_archive_cmds\"
fi
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd" || exit $?
done
IFS="$save_ifs"
done
if test -n "$generated"; then
$show "${rm}r$generated"
$run ${rm}r$generated
fi
# Now create the libtool archive.
case $output in
*.la)
old_library=
test "$build_old_libs" = yes && old_library="$libname.$libext"
$show "creating $output"
# Preserve any variables that may affect compiler behavior
for var in $variables_saved_for_relink; do
if eval test -z \"\${$var+set}\"; then
relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
elif eval var_value=\$$var; test -z "$var_value"; then
relink_command="$var=; export $var; $relink_command"
else
var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
relink_command="$var=\"$var_value\"; export $var; $relink_command"
fi
done
# Quote the link command for shipping.
relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args)"
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
# Only create the output if not a dry run.
if test -z "$run"; then
for installed in no yes; do
if test "$installed" = yes; then
if test -z "$install_libdir"; then
break
fi
output="$output_objdir/$outputname"i
# Replace all uninstalled libtool libraries with the installed ones
newdependency_libs=
for deplib in $dependency_libs; do
case $deplib in
*.la)
name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
if test -z "$libdir"; then
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
exit 1
fi
newdependency_libs="$newdependency_libs $libdir/$name"
;;
*) newdependency_libs="$newdependency_libs $deplib" ;;
esac
done
dependency_libs="$newdependency_libs"
newdlfiles=
for lib in $dlfiles; do
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
if test -z "$libdir"; then
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
exit 1
fi
newdlfiles="$newdlfiles $libdir/$name"
done
dlfiles="$newdlfiles"
newdlprefiles=
for lib in $dlprefiles; do
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
if test -z "$libdir"; then
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
exit 1
fi
newdlprefiles="$newdlprefiles $libdir/$name"
done
dlprefiles="$newdlprefiles"
fi
$rm $output
# place dlname in correct position for cygwin
tdlname=$dlname
case $host,$output,$installed,$module,$dlname in
*cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
esac
$echo > $output "\
# $outputname - a libtool library file
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
#
# Please DO NOT delete this file!
# It is necessary for linking the library.
# The name that we can dlopen(3).
dlname='$tdlname'
# Names of this library.
library_names='$library_names'
# The name of the static archive.
old_library='$old_library'
# Libraries that this one depends upon.
dependency_libs='$dependency_libs'
# Version information for $libname.
current=$current
age=$age
revision=$revision
# Is this an already installed library?
installed=$installed
# Files to dlopen/dlpreopen
dlopen='$dlfiles'
dlpreopen='$dlprefiles'
# Directory that this library needs to be installed in:
libdir='$install_libdir'"
if test "$installed" = no && test $need_relink = yes; then
$echo >> $output "\
relink_command=\"$relink_command\""
fi
done
fi
# Do a symbolic link so that the libtool archive can be found in
# LD_LIBRARY_PATH before the program is installed.
$show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
$run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
;;
esac
exit 0
;;
# libtool install mode
install)
modename="$modename: install"
# There may be an optional sh(1) argument at the beginning of
# install_prog (especially on Windows NT).
if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
# Allow the use of GNU shtool's install command.
$echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
# Aesthetically quote it.
arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
arg="\"$arg\""
;;
esac
install_prog="$arg "
arg="$1"
shift
else
install_prog=
arg="$nonopt"
fi
# The real first argument should be the name of the installation program.
# Aesthetically quote it.
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
arg="\"$arg\""
;;
esac
install_prog="$install_prog$arg"
# We need to accept at least all the BSD install flags.
dest=
files=
opts=
prev=
install_type=
isdir=no
stripme=
for arg
do
if test -n "$dest"; then
files="$files $dest"
dest="$arg"
continue
fi
case $arg in
-d) isdir=yes ;;
-f) prev="-f" ;;
-g) prev="-g" ;;
-m) prev="-m" ;;
-o) prev="-o" ;;
-s)
stripme=" -s"
continue
;;
-*) ;;
*)
# If the previous option needed an argument, then skip it.
if test -n "$prev"; then
prev=
else
dest="$arg"
continue
fi
;;
esac
# Aesthetically quote the argument.
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
arg="\"$arg\""
;;
esac
install_prog="$install_prog $arg"
done
if test -z "$install_prog"; then
$echo "$modename: you must specify an install program" 1>&2
$echo "$help" 1>&2
exit 1
fi
if test -n "$prev"; then
$echo "$modename: the \`$prev' option requires an argument" 1>&2
$echo "$help" 1>&2
exit 1
fi
if test -z "$files"; then
if test -z "$dest"; then
$echo "$modename: no file or destination specified" 1>&2
else
$echo "$modename: you must specify a destination" 1>&2
fi
$echo "$help" 1>&2
exit 1
fi
# Strip any trailing slash from the destination.
dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
# Check to see that the destination is a directory.
test -d "$dest" && isdir=yes
if test "$isdir" = yes; then
destdir="$dest"
destname=
else
destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
test "X$destdir" = "X$dest" && destdir=.
destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
# Not a directory, so check to see that there is only one file specified.
set dummy $files
if test $# -gt 2; then
$echo "$modename: \`$dest' is not a directory" 1>&2
$echo "$help" 1>&2
exit 1
fi
fi
case $destdir in
[\\/]* | [A-Za-z]:[\\/]*) ;;
*)
for file in $files; do
case $file in
*.lo) ;;
*)
$echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
$echo "$help" 1>&2
exit 1
;;
esac
done
;;
esac
# This variable tells wrapper scripts just to set variables rather
# than running their programs.
libtool_install_magic="$magic"
staticlibs=
future_libdirs=
current_libdirs=
for file in $files; do
# Do each installation.
case $file in
*.$libext)
# Do the static libraries later.
staticlibs="$staticlibs $file"
;;
*.la)
# Check to see that this really is a libtool archive.
if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
else
$echo "$modename: \`$file' is not a valid libtool archive" 1>&2
$echo "$help" 1>&2
exit 1
fi
library_names=
old_library=
relink_command=
# If there is no directory component, then add one.
case $file in
*/* | *\\*) . $file ;;
*) . ./$file ;;
esac
# Add the libdir to current_libdirs if it is the destination.
if test "X$destdir" = "X$libdir"; then
case "$current_libdirs " in
*" $libdir "*) ;;
*) current_libdirs="$current_libdirs $libdir" ;;
esac
else
# Note the libdir as a future libdir.
case "$future_libdirs " in
*" $libdir "*) ;;
*) future_libdirs="$future_libdirs $libdir" ;;
esac
fi
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
test "X$dir" = "X$file/" && dir=
dir="$dir$objdir"
if test -n "$relink_command"; then
$echo "$modename: warning: relinking \`$file'" 1>&2
$show "$relink_command"
if $run eval "$relink_command"; then :
else
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
continue
fi
fi
# See the names of the shared library.
set dummy $library_names
if test -n "$2"; then
realname="$2"
shift
shift
srcname="$realname"
test -n "$relink_command" && srcname="$realname"T
# Install the shared library and build the symlinks.
$show "$install_prog $dir/$srcname $destdir/$realname"
$run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
if test -n "$stripme" && test -n "$striplib"; then
$show "$striplib $destdir/$realname"
$run eval "$striplib $destdir/$realname" || exit $?
fi
if test $# -gt 0; then
# Delete the old symlinks, and create new ones.
for linkname
do
if test "$linkname" != "$realname"; then
$show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
$run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
fi
done
fi
# Do each command in the postinstall commands.
lib="$destdir/$realname"
eval cmds=\"$postinstall_cmds\"
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd" || exit $?
done
IFS="$save_ifs"
fi
# Install the pseudo-library for information purposes.
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
instname="$dir/$name"i
$show "$install_prog $instname $destdir/$name"
$run eval "$install_prog $instname $destdir/$name" || exit $?
# Maybe install the static library, too.
test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
;;
*.lo)
# Install (i.e. copy) a libtool object.
# Figure out destination file name, if it wasn't already specified.
if test -n "$destname"; then
destfile="$destdir/$destname"
else
destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
destfile="$destdir/$destfile"
fi
# Deduce the name of the destination old-style object file.
case $destfile in
*.lo)
staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
;;
*.$objext)
staticdest="$destfile"
destfile=
;;
*)
$echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
$echo "$help" 1>&2
exit 1
;;
esac
# Install the libtool object if requested.
if test -n "$destfile"; then
$show "$install_prog $file $destfile"
$run eval "$install_prog $file $destfile" || exit $?
fi
# Install the old object if enabled.
if test "$build_old_libs" = yes; then
# Deduce the name of the old-style object file.
staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
$show "$install_prog $staticobj $staticdest"
$run eval "$install_prog \$staticobj \$staticdest" || exit $?
fi
exit 0
;;
*)
# Figure out destination file name, if it wasn't already specified.
if test -n "$destname"; then
destfile="$destdir/$destname"
else
destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
destfile="$destdir/$destfile"
fi
# Do a test to see if this is really a libtool program.
case $host in
*cygwin*|*mingw*)
wrapper=`echo $file | ${SED} -e 's,.exe$,,'`
;;
*)
wrapper=$file
;;
esac
if (${SED} -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
notinst_deplibs=
relink_command=
# If there is no directory component, then add one.
case $file in
*/* | *\\*) . $wrapper ;;
*) . ./$wrapper ;;
esac
# Check the variables that should have been set.
if test -z "$notinst_deplibs"; then
$echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
exit 1
fi
finalize=yes
for lib in $notinst_deplibs; do
# Check to see that each library is installed.
libdir=
if test -f "$lib"; then
# If there is no directory component, then add one.
case $lib in
*/* | *\\*) . $lib ;;
*) . ./$lib ;;
esac
fi
libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
if test -n "$libdir" && test ! -f "$libfile"; then
$echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
finalize=no
fi
done
relink_command=
# If there is no directory component, then add one.
case $file in
*/* | *\\*) . $wrapper ;;
*) . ./$wrapper ;;
esac
outputname=
if test "$fast_install" = no && test -n "$relink_command"; then
if test "$finalize" = yes && test -z "$run"; then
tmpdir="/tmp"
test -n "$TMPDIR" && tmpdir="$TMPDIR"
tmpdir="$tmpdir/libtool-$$"
if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
else
$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
continue
fi
file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
outputname="$tmpdir/$file"
# Replace the output file specification.
relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
$show "$relink_command"
if $run eval "$relink_command"; then :
else
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
${rm}r "$tmpdir"
continue
fi
file="$outputname"
else
$echo "$modename: warning: cannot relink \`$file'" 1>&2
fi
else
# Install the binary that we compiled earlier.
file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
fi
fi
# remove .exe since cygwin /usr/bin/install will append another
# one anyways
case $install_prog,$host in
/usr/bin/install*,*cygwin*)
case $file:$destfile in
*.exe:*.exe)
# this is ok
;;
*.exe:*)
destfile=$destfile.exe
;;
*:*.exe)
destfile=`echo $destfile | ${SED} -e 's,.exe$,,'`
;;
esac
;;
esac
$show "$install_prog$stripme $file $destfile"
$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
test -n "$outputname" && ${rm}r "$tmpdir"
;;
esac
done
for file in $staticlibs; do
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
# Set up the ranlib parameters.
oldlib="$destdir/$name"
$show "$install_prog $file $oldlib"
$run eval "$install_prog \$file \$oldlib" || exit $?
if test -n "$stripme" && test -n "$striplib"; then
$show "$old_striplib $oldlib"
$run eval "$old_striplib $oldlib" || exit $?
fi
# Do each command in the postinstall commands.
eval cmds=\"$old_postinstall_cmds\"
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd" || exit $?
done
IFS="$save_ifs"
done
if test -n "$future_libdirs"; then
$echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
fi
if test -n "$current_libdirs"; then
# Maybe just do a dry run.
test -n "$run" && current_libdirs=" -n$current_libdirs"
exec_cmd='$SHELL $0 --finish$current_libdirs'
else
exit 0
fi
;;
# libtool finish mode
finish)
modename="$modename: finish"
libdirs="$nonopt"
admincmds=
if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
for dir
do
libdirs="$libdirs $dir"
done
for libdir in $libdirs; do
if test -n "$finish_cmds"; then
# Do each command in the finish commands.
eval cmds=\"$finish_cmds\"
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd" || admincmds="$admincmds
$cmd"
done
IFS="$save_ifs"
fi
if test -n "$finish_eval"; then
# Do the single finish_eval.
eval cmds=\"$finish_eval\"
$run eval "$cmds" || admincmds="$admincmds
$cmds"
fi
done
fi
# Exit here if they wanted silent mode.
test "$show" = ":" && exit 0
echo "----------------------------------------------------------------------"
echo "Libraries have been installed in:"
for libdir in $libdirs; do
echo " $libdir"
done
echo
echo "If you ever happen to want to link against installed libraries"
echo "in a given directory, LIBDIR, you must either use libtool, and"
echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
echo "flag during linking and do at least one of the following:"
if test -n "$shlibpath_var"; then
echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
echo " during execution"
fi
if test -n "$runpath_var"; then
echo " - add LIBDIR to the \`$runpath_var' environment variable"
echo " during linking"
fi
if test -n "$hardcode_libdir_flag_spec"; then
libdir=LIBDIR
eval flag=\"$hardcode_libdir_flag_spec\"
echo " - use the \`$flag' linker flag"
fi
if test -n "$admincmds"; then
echo " - have your system administrator run these commands:$admincmds"
fi
if test -f /etc/ld.so.conf; then
echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
fi
echo
echo "See any operating system documentation about shared libraries for"
echo "more information, such as the ld(1) and ld.so(8) manual pages."
echo "----------------------------------------------------------------------"
exit 0
;;
# libtool execute mode
execute)
modename="$modename: execute"
# The first argument is the command name.
cmd="$nonopt"
if test -z "$cmd"; then
$echo "$modename: you must specify a COMMAND" 1>&2
$echo "$help"
exit 1
fi
# Handle -dlopen flags immediately.
for file in $execute_dlfiles; do
if test ! -f "$file"; then
$echo "$modename: \`$file' is not a file" 1>&2
$echo "$help" 1>&2
exit 1
fi
dir=
case $file in
*.la)
# Check to see that this really is a libtool archive.
if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
else
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
$echo "$help" 1>&2
exit 1
fi
# Read the libtool library.
dlname=
library_names=
# If there is no directory component, then add one.
case $file in
*/* | *\\*) . $file ;;
*) . ./$file ;;
esac
# Skip this library if it cannot be dlopened.
if test -z "$dlname"; then
# Warn if it was a shared library.
test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
continue
fi
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
test "X$dir" = "X$file" && dir=.
if test -f "$dir/$objdir/$dlname"; then
dir="$dir/$objdir"
else
$echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
exit 1
fi
;;
*.lo)
# Just add the directory containing the .lo file.
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
test "X$dir" = "X$file" && dir=.
;;
*)
$echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
continue
;;
esac
# Get the absolute pathname.
absdir=`cd "$dir" && pwd`
test -n "$absdir" && dir="$absdir"
# Now add the directory to shlibpath_var.
if eval "test -z \"\$$shlibpath_var\""; then
eval "$shlibpath_var=\"\$dir\""
else
eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
fi
done
# This variable tells wrapper scripts just to set shlibpath_var
# rather than running their programs.
libtool_execute_magic="$magic"
# Check if any of the arguments is a wrapper script.
args=
for file
do
case $file in
-*) ;;
*)
# Do a test to see if this is really a libtool program.
if (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
# If there is no directory component, then add one.
case $file in
*/* | *\\*) . $file ;;
*) . ./$file ;;
esac
# Transform arg to wrapped name.
file="$progdir/$program"
fi
;;
esac
# Quote arguments (to preserve shell metacharacters).
file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
args="$args \"$file\""
done
if test -z "$run"; then
if test -n "$shlibpath_var"; then
# Export the shlibpath_var.
eval "export $shlibpath_var"
fi
# Restore saved enviroment variables
if test "${save_LC_ALL+set}" = set; then
LC_ALL="$save_LC_ALL"; export LC_ALL
fi
if test "${save_LANG+set}" = set; then
LANG="$save_LANG"; export LANG
fi
# Now prepare to actually exec the command.
exec_cmd="\$cmd$args"
else
# Display what would be done.
if test -n "$shlibpath_var"; then
eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
$echo "export $shlibpath_var"
fi
$echo "$cmd$args"
exit 0
fi
;;
# libtool clean and uninstall mode
clean | uninstall)
modename="$modename: $mode"
rm="$nonopt"
files=
rmforce=
exit_status=0
# This variable tells wrapper scripts just to set variables rather
# than running their programs.
libtool_install_magic="$magic"
for arg
do
case $arg in
-f) rm="$rm $arg"; rmforce=yes ;;
-*) rm="$rm $arg" ;;
*) files="$files $arg" ;;
esac
done
if test -z "$rm"; then
$echo "$modename: you must specify an RM program" 1>&2
$echo "$help" 1>&2
exit 1
fi
rmdirs=
for file in $files; do
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
if test "X$dir" = "X$file"; then
dir=.
objdir="$objdir"
else
objdir="$dir/$objdir"
fi
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
test $mode = uninstall && objdir="$dir"
# Remember objdir for removal later, being careful to avoid duplicates
if test $mode = clean; then
case " $rmdirs " in
*" $objdir "*) ;;
*) rmdirs="$rmdirs $objdir" ;;
esac
fi
# Don't error if the file doesn't exist and rm -f was used.
if (test -L "$file") >/dev/null 2>&1 \
|| (test -h "$file") >/dev/null 2>&1 \
|| test -f "$file"; then
:
elif test -d "$file"; then
exit_status=1
continue
elif test "$rmforce" = yes; then
continue
fi
rmfiles="$file"
case $name in
*.la)
# Possibly a libtool archive, so verify it.
if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
. $dir/$name
# Delete the libtool libraries and symlinks.
for n in $library_names; do
rmfiles="$rmfiles $objdir/$n"
done
test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
if test $mode = uninstall; then
if test -n "$library_names"; then
# Do each command in the postuninstall commands.
eval cmds=\"$postuninstall_cmds\"
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd"
if test $? != 0 && test "$rmforce" != yes; then
exit_status=1
fi
done
IFS="$save_ifs"
fi
if test -n "$old_library"; then
# Do each command in the old_postuninstall commands.
eval cmds=\"$old_postuninstall_cmds\"
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd"
if test $? != 0 && test "$rmforce" != yes; then
exit_status=1
fi
done
IFS="$save_ifs"
fi
# FIXME: should reinstall the best remaining shared library.
fi
fi
;;
*.lo)
if test "$build_old_libs" = yes; then
oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
rmfiles="$rmfiles $dir/$oldobj"
fi
;;
*)
# Do a test to see if this is a libtool program.
if test $mode = clean &&
(${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
relink_command=
. $dir/$file
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
if test "$fast_install" = yes && test -n "$relink_command"; then
rmfiles="$rmfiles $objdir/lt-$name"
fi
fi
;;
esac
$show "$rm $rmfiles"
$run $rm $rmfiles || exit_status=1
done
# Try to remove the ${objdir}s in the directories where we deleted files
for dir in $rmdirs; do
if test -d "$dir"; then
$show "rmdir $dir"
$run rmdir $dir >/dev/null 2>&1
fi
done
exit $exit_status
;;
"")
$echo "$modename: you must specify a MODE" 1>&2
$echo "$generic_help" 1>&2
exit 1
;;
esac
if test -z "$exec_cmd"; then
$echo "$modename: invalid operation mode \`$mode'" 1>&2
$echo "$generic_help" 1>&2
exit 1
fi
fi # test -z "$show_help"
if test -n "$exec_cmd"; then
eval exec $exec_cmd
exit 1
fi
# We need to display help for each of the modes.
case $mode in
"") $echo \
"Usage: $modename [OPTION]... [MODE-ARG]...
Provide generalized library-building support services.
--config show all configuration variables
--debug enable verbose shell tracing
-n, --dry-run display commands without modifying any files
--features display basic configuration information and exit
--finish same as \`--mode=finish'
--help display this help message and exit
--mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
--quiet same as \`--silent'
--silent don't print informational messages
--version print version information
MODE must be one of the following:
clean remove files from the build directory
compile compile a source file into a libtool object
execute automatically set library path, then run a program
finish complete the installation of libtool libraries
install install libraries or executables
link create a library or an executable
uninstall remove libraries from an installed directory
MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
a more detailed description of MODE."
exit 0
;;
clean)
$echo \
"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
Remove files from the build directory.
RM is the name of the program to use to delete files associated with each FILE
(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
to RM.
If FILE is a libtool library, object or program, all the files associated
with it are deleted. Otherwise, only FILE itself is deleted using RM."
;;
compile)
$echo \
"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
Compile a source file into a libtool library object.
This mode accepts the following additional options:
-o OUTPUT-FILE set the output file name to OUTPUT-FILE
-prefer-pic try to building PIC objects only
-prefer-non-pic try to building non-PIC objects only
-static always build a \`.o' file suitable for static linking
COMPILE-COMMAND is a command to be used in creating a \`standard' object file
from the given SOURCEFILE.
The output file name is determined by removing the directory component from
SOURCEFILE, then substituting the C source code suffix \`.c' with the
library object suffix, \`.lo'."
;;
execute)
$echo \
"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
Automatically set library path, then run a program.
This mode accepts the following additional options:
-dlopen FILE add the directory containing FILE to the library path
This mode sets the library path environment variable according to \`-dlopen'
flags.
If any of the ARGS are libtool executable wrappers, then they are translated
into their corresponding uninstalled binary, and any of their required library
directories are added to the library path.
Then, COMMAND is executed, with ARGS as arguments."
;;
finish)
$echo \
"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
Complete the installation of libtool libraries.
Each LIBDIR is a directory that contains libtool libraries.
The commands that this mode executes may require superuser privileges. Use
the \`--dry-run' option if you just want to see what would be executed."
;;
install)
$echo \
"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
Install executables or libraries.
INSTALL-COMMAND is the installation command. The first component should be
either the \`install' or \`cp' program.
The rest of the components are interpreted as arguments to that command (only
BSD-compatible install options are recognized)."
;;
link)
$echo \
"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
Link object files or libraries together to form another library, or to
create an executable program.
LINK-COMMAND is a command using the C compiler that you would use to create
a program from several object files.
The following components of LINK-COMMAND are treated specially:
-all-static do not do any dynamic linking at all
-avoid-version do not add a version suffix if possible
-dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
-dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
-export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
-export-symbols SYMFILE
try to export only the symbols listed in SYMFILE
-export-symbols-regex REGEX
try to export only the symbols matching REGEX
-LLIBDIR search LIBDIR for required installed libraries
-lNAME OUTPUT-FILE requires the installed library libNAME
-module build a library that can dlopened
-no-fast-install disable the fast-install mode
-no-install link a not-installable executable
-no-undefined declare that a library does not refer to external symbols
-o OUTPUT-FILE create OUTPUT-FILE from the specified objects
-release RELEASE specify package release information
-rpath LIBDIR the created library will eventually be installed in LIBDIR
-R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
-static do not do any dynamic linking of libtool libraries
-version-info CURRENT[:REVISION[:AGE]]
specify library version info [each variable defaults to 0]
All other options (arguments beginning with \`-') are ignored.
Every other argument is treated as a filename. Files ending in \`.la' are
treated as uninstalled libtool libraries, other files are standard or library
object files.
If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
only library objects (\`.lo' files) may be specified, and \`-rpath' is
required, except when creating a convenience library.
If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
using \`ar' and \`ranlib', or on Windows using \`lib'.
If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
is created, otherwise an executable program is created."
;;
uninstall)
$echo \
"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
Remove libraries from an installation directory.
RM is the name of the program to use to delete files associated with each FILE
(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
to RM.
If FILE is a libtool library, all the files associated with it are deleted.
Otherwise, only FILE itself is deleted using RM."
;;
*)
$echo "$modename: invalid operation mode \`$mode'" 1>&2
$echo "$help" 1>&2
exit 1
;;
esac
echo
$echo "Try \`$modename --help' for more information about other modes."
exit 0
# Local Variables:
# mode:shell-script
# sh-indentation:2
# End:
|
Added work/contrib/lzo/lzo-1.08/acconfig/m4/bool.m4.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
dnl ### Checking for builtin bool type.
# serial 1
AC_DEFUN(mfx_CHECK_BOOL,
[
AC_MSG_CHECKING([for bool])
AC_CACHE_VAL(mfx_cv_have_bool,
[
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([],
[bool a = true; bool b = false;],
[mfx_cv_have_bool="yes"],
[mfx_cv_have_bool="no"])
]) dnl end AC_CHECK_VAL
AC_MSG_RESULT($mfx_cv_have_bool)
if test "X$mfx_cv_have_bool" = "Xyes"; then
AC_DEFINE(HAVE_BOOL)
fi
])
|
Added work/contrib/lzo/lzo-1.08/acconfig/m4/byteorder.m4.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
## --------------------------------------------------------- ##
## Check the byte order. ##
## Adapted from AC_C_BIGENDIAN. ##
## --------------------------------------------------------- ##
# serial 1
AC_DEFUN(mfx_C_BYTE_ORDER,
[AC_CACHE_CHECK([the byte order], mfx_cv_c_byte_order,
[AC_RUN_IFELSE([AC_LANG_PROGRAM([], [[
union { long l; char c[sizeof(long)]; } u;
u.l = 1; exit(u.c[0] == 1);
]])],
[mfx_cv_c_byte_order=4321],
[mfx_cv_c_byte_order=1234],
[mfx_cv_c_byte_order=unknown])])
if test "X$mfx_cv_c_byte_order" = X1234; then
AC_DEFINE_UNQUOTED(MFX_BYTE_ORDER,1234)
fi
if test "X$mfx_cv_c_byte_order" = X4321; then
AC_DEFINE_UNQUOTED(MFX_BYTE_ORDER,4321)
fi
])
|
Added work/contrib/lzo/lzo-1.08/acconfig/m4/ccansi.m4.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
|
## ---------------------------------------------------------- ##
## ANSIfy the C compiler and preprocessor whenever possible. ##
## From Franc,ois Pinard and Markus Oberhumer. ##
## ---------------------------------------------------------- ##
# serial 2
# @defmac mfx_PROG_CC_ANSI
# @maindex PROG_CC_ANSI
# @ovindex CC
# If the C compiler in not in ANSI C mode by default, try to add an option
# to output variable @code{CC} to make it so. This macro tries various
# options that select ANSI C on some system or another. It considers the
# compiler to be in ANSI C mode if it handles function prototypes correctly.
#
# If you use this macro, you should check after calling it whether the C
# compiler has been set to accept ANSI C; if not, the shell variable
# @code{mfx_cv_prog_cc_ansi} is set to @samp{no}. If you wrote your source
# code in ANSI C, you can make an un-ANSIfied copy of it by using the
# program @code{ansi2knr}, which comes with Ghostscript.
# @end defmac
AC_DEFUN(mfx_PROG_CC_ANSI,
[AC_REQUIRE([AC_PROG_CC])dnl
AC_BEFORE([$0], [AC_C_INLINE])dnl
AC_BEFORE([$0], [AC_C_CONST])dnl
dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
dnl a magic option to avoid problems with ANSI preprocessor commands
dnl like #elif.
AC_BEFORE([$0], [AC_PROG_CPP])
AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
AC_CACHE_VAL(mfx_cv_prog_cc_ansi,
[mfx_cv_prog_cc_ansi=no
ac_save_CC="$CC"
# Don't try gcc -ansi; that turns off useful extensions and
# breaks some systems' header files.
# AIX -qlanglvl=ansi
# Ultrix and OSF/1 -std1
# HP-UX 10.20 and later -Ae
# HP-UX older versions -Aa -D_HPUX_SOURCE
# SVR4 -Xc -D__EXTENSIONS__
for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
CC="$ac_save_CC $ac_arg"
AC_TRY_COMPILE(
[#include <sys/types.h>
#if !defined(NO_STDIO_H)
#include <sys/stat.h>
#include <stdio.h>
#endif
#include <stdarg.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
# include <limits.h> /* note the space */
#if defined(NO_STDIO_H)
typedef struct { int dummy; } FILE;
struct stat;
#endif
#if 1 && !defined(UINT_MAX)
# error "this is an error"
# include "choke me"
#elif 0 || !defined(UINT_MAX)
# error "this is an error"
# include "choke me"
#elif !defined(UINT_MAX)
# error "this is an error"
# include "choke me"
#elif !(1-1)
/* ok */
#else
# error "this is an error"
# include "choke me"
#endif
#define STRINGIZE(x) #x
#define MACRO_EXPAND(x) STRINGIZE(x)
extern volatile signed char flag;
extern char *s ( void );
char *s ( void )
{
static char n[] = MACRO_EXPAND(UINT_MAX);
return flag ? n : n + 1;
}
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
struct buf { int x; };
FILE * (*rcsopen) (struct buf *, struct stat *, int);
static char *e (char **p, int i)
{
return p[i];
}
static char *f (char * (*g) (char **, int), char **p, ...)
{
char *s;
va_list v;
va_start (v,p);
s = g (p, va_arg (v,int));
va_end (v);
return s;
}
int test (int i, double x);
struct s1 {int (*f) (int a);};
struct s2 {int (*f) (double a);};
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
int argc;
char **argv;
], [
return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
],
[mfx_cv_prog_cc_ansi="$ac_arg"; break])
done
CC="$ac_save_CC"
])
if test -z "$mfx_cv_prog_cc_ansi"; then
AC_MSG_RESULT([none needed])
else
AC_MSG_RESULT($mfx_cv_prog_cc_ansi)
fi
case "x$mfx_cv_prog_cc_ansi" in
x|xno) ;;
*) CC="$CC $mfx_cv_prog_cc_ansi" ;;
esac
])
|
Added work/contrib/lzo/lzo-1.08/acconfig/m4/ccbugcast.m4.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
## --------------------------------------------------------- ##
## Checking if compiler correctly cast signed to unsigned. ##
## Adapted from zsh. ##
## --------------------------------------------------------- ##
# serial 1
AC_DEFUN(mfx_PROG_CC_BUG_SIGNED_TO_UNSIGNED_CASTING,
[AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_CPP])dnl
AC_CACHE_CHECK([whether signed to unsigned casting is broken],
mfx_cv_prog_cc_bug_signed_to_unsigned_casting,
[AC_TRY_COMPILE([], [#undef SIGNED
#if defined(__STDC__) || defined(__cplusplus)
#define SIGNED signed
#else
#define SIGNED
#endif
char x[1 - 2 * ( (int)((unsigned char)((SIGNED char) -1)) != 255 )];
],
mfx_cv_prog_cc_bug_signed_to_unsigned_casting=no,
mfx_cv_prog_cc_bug_signed_to_unsigned_casting=yes)])
])
|
Added work/contrib/lzo/lzo-1.08/acconfig/m4/checkergcc.m4.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
## --------------------------------------------------------- ##
## Check for checkergcc. ##
## Adapted from AC_PROG_CC_GNU. ##
## --------------------------------------------------------- ##
# serial 1
AC_DEFUN(mfx_PROG_CC_CHECKERGCC,
[AC_CACHE_CHECK([whether we are using checkergcc], mfx_cv_prog_checkergcc,
[dnl The semicolon is to pacify NeXT's syntax-checking cpp.
cat > conftest.c <<EOF
#ifdef __GNUC__
#ifdef __CHECKER__
yes;
#endif
#endif
EOF
if AC_TRY_COMMAND(${CC-cc} -E conftest.c) | egrep yes >/dev/null 2>&1; then
mfx_cv_prog_checkergcc=yes
else
mfx_cv_prog_checkergcc=no
fi])])
|
Added work/contrib/lzo/lzo-1.08/acconfig/m4/cross.m4.
|
|
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
|
AC_DEFUN(mfx_CHECK_CROSS,
[
AC_REQUIRE([AC_PROG_CC])
if test "X$cross_compiling" = Xyes; then
if test "X$build" = "X$host"; then
AC_MSG_ERROR([you are cross compiling - please use the \`--host=' option])
fi
fi
])
|
Added work/contrib/lzo/lzo-1.08/acconfig/m4/findfile.m4.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
## ------------------------------------------------------------------------
## Find a file (or one of more files in a list of dirs)
## ------------------------------------------------------------------------
# serial 1
dnl mfx_FIND_FILE(FILES, DIRECTORIES, VAR-FOR-DIR)
AC_DEFUN(mfx_FIND_FILE,
[
$3=""
for mfx_ac_dir in $2; do
for mfx_ac_file in $1; do
if test -r "$mfx_ac_dir/$mfx_ac_file"; then
$3="$mfx_ac_dir"
break 2
fi
done
done
])
|
Added work/contrib/lzo/lzo-1.08/acconfig/m4/gccbugsi.m4.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
## --------------------------------------------------------- ##
## Check if gcc suffers the '-fschedule-insns' bug. ##
## --------------------------------------------------------- ##
# serial 1
AC_DEFUN(mfx_PROG_GCC_BUG_SCHEDULE_INSNS,
[AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_CPP])dnl
if test "$ac_cv_prog_gcc" = yes; then
mfx_save_cflags="$CFLAGS"
CFLAGS="-O2 -fschedule-insns -fschedule-insns2"
AC_CACHE_CHECK([whether ${CC-cc} suffers the -fschedule-insns bug],
mfx_cv_prog_gcc_bug_schedule_insns,
[AC_RUN_IFELSE([AC_LANG_PROGRAM([], [[
/* gcc schedule-insns optimization bug on RS6000 platforms.
* Adapted from bug-report by Assar Westerlund <assar@sics.se>
* Compile and run it using gcc -O2 -fno-schedule-insns and
* gcc -O2 -fschedule-insns.
*/
const int clone[] = {1, 2, 0}; const int *q;
q = clone; exit(*q ? 0 : 1);
]])],
[mfx_cv_prog_gcc_bug_schedule_insns=no],
[mfx_cv_prog_gcc_bug_schedule_insns=yes],
[mfx_cv_prog_gcc_bug_schedule_insns=unknown])])
CFLAGS="$mfx_save_cflags"
fi
])
|
Added work/contrib/lzo/lzo-1.08/acconfig/m4/gccbugsr.m4.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
## --------------------------------------------------------- ##
## Check if gcc suffers the '-fstrength-reduce' bug. ##
## --------------------------------------------------------- ##
# serial 1
AC_DEFUN(mfx_PROG_GCC_BUG_STRENGTH_REDUCE,
[AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_CPP])dnl
if test "$ac_cv_prog_gcc" = yes; then
mfx_save_cflags="$CFLAGS"
CFLAGS="-O2 -fstrength-reduce"
AC_CACHE_CHECK([whether ${CC-cc} suffers the -fstrength-reduce bug],
mfx_cv_prog_gcc_bug_strength_reduce,
[AC_TRY_RUN([
/* gcc strength-reduce optimization bug on Intel platforms.
* Adapted from bug-report by John E. Davis <davis@space.mit.edu>
* Compile and run it using gcc -O2 -fno-strength-reduce and
* gcc -O2 -fstrength-reduce.
*/
int a[3]; unsigned an = 3;
int strength_reduce_bug();
int main() { unsigned j;
for (j = 0; j < an; j++)
a[j] = (int)j - 3;
return strength_reduce_bug(); }
int strength_reduce_bug()
{ return a[0] != -3 || a[1] != -2 || a[2] != -1; }],
[mfx_cv_prog_gcc_bug_strength_reduce=no],
[mfx_cv_prog_gcc_bug_strength_reduce=yes],
[mfx_cv_prog_gcc_bug_strength_reduce=unknown])])
CFLAGS="$mfx_save_cflags"
fi
])
|
Added work/contrib/lzo/lzo-1.08/acconfig/m4/gnumake.m4.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
## --------------------------------------------------------- ##
## Check for GNU make (do not cache this setting) ##
## Adapted from AM_MISSING_PROG and AM_PROG_LD_GNU. ##
## --------------------------------------------------------- ##
# serial 1
dnl mfx_PROG_MAKE_GNU(NAME)
AC_DEFUN(mfx_PROG_MAKE_GNU,
[AC_MSG_CHECKING([whether we are using GNU make])
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
if (${MAKE-make} --version) 2>&1 </dev/null | grep 'GNU' >/dev/null; then
$1=yes
AC_MSG_RESULT(yes)
else
$1=no
AC_MSG_RESULT(no)
fi
AC_SUBST($1)])
|
Added work/contrib/lzo/lzo-1.08/acconfig/m4/limits.m4.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
## --------------------------------------------------------- ##
## Check for a sane <limits.h> header. ##
## --------------------------------------------------------- ##
# serial 1
AC_DEFUN(mfx_CHECK_HEADER_SANE_LIMITS_H,
[AC_CACHE_CHECK([whether limits.h is sane],
mfx_cv_header_sane_limits_h,
[AC_TRY_COMPILE([#include <limits.h>
#define MFX_0xffff 0xffff
#define MFX_0xffffffffL 4294967295ul
#if !defined(CHAR_BIT) || (CHAR_BIT != 8)
# include "error CHAR_BIT"
#endif
#if !defined(UCHAR_MAX)
# include "error UCHAR_MAX"
#endif
#if !defined(USHRT_MAX)
# include "error USHRT_MAX"
#endif
#if !defined(UINT_MAX)
# include "error UINT_MAX"
#endif
#if !defined(ULONG_MAX)
# include "error ULONG_MAX"
#endif
#if !defined(SHRT_MAX)
# include "error SHRT_MAX"
#endif
#if !defined(INT_MAX)
# include "error INT_MAX"
#endif
#if !defined(LONG_MAX)
# include "error LONG_MAX"
#endif
#if (UCHAR_MAX < 1)
# include "error UCHAR_MAX"
#endif
#if (USHRT_MAX < 1)
# include "error USHRT_MAX"
#endif
#if (UINT_MAX < 1)
# include "error UINT_MAX"
#endif
#if (ULONG_MAX < 1)
# include "error ULONG_MAX"
#endif
#if (UCHAR_MAX < 0xff)
# include "error UCHAR_MAX"
#endif
#if (USHRT_MAX < MFX_0xffff)
# include "error USHRT_MAX"
#endif
#if (UINT_MAX < MFX_0xffff)
# include "error UINT_MAX"
#endif
#if (ULONG_MAX < MFX_0xffffffffL)
# include "error ULONG_MAX"
#endif
#if (USHRT_MAX > UINT_MAX)
# include "error USHRT_MAX vs UINT_MAX"
#endif
#if (UINT_MAX > ULONG_MAX)
# include "error UINT_MAX vs ULONG_MAX"
#endif
],[
#if (USHRT_MAX == MFX_0xffff)
{ typedef char a_short2[1 - 2 * !(sizeof(short) == 2)]; }
#elif (USHRT_MAX >= MFX_0xffff)
{ typedef char a_short2[1 - 2 * !(sizeof(short) > 2)]; }
#endif
#if (UINT_MAX == MFX_0xffff)
{ typedef char a_int2[1 - 2 * !(sizeof(int) == 2)]; }
#elif (UINT_MAX >= MFX_0xffff)
{ typedef char a_int2[1 - 2 * !(sizeof(int) > 2)]; }
#endif
#if (ULONG_MAX == MFX_0xffff)
{ typedef char a_long2[1 - 2 * !(sizeof(long) == 2)]; }
#elif (ULONG_MAX >= MFX_0xffff)
{ typedef char a_long2[1 - 2 * !(sizeof(long) > 2)]; }
#endif
#if (USHRT_MAX == MFX_0xffffffffL)
{ typedef char a_short4[1 - 2 * !(sizeof(short) == 4)]; }
#elif (USHRT_MAX >= MFX_0xffffffffL)
{ typedef char a_short4[1 - 2 * !(sizeof(short) > 4)]; }
#endif
#if (UINT_MAX == MFX_0xffffffffL)
{ typedef char a_int4[1 - 2 * !(sizeof(int) == 4)]; }
#elif (UINT_MAX >= MFX_0xffffffffL)
{ typedef char a_int4[1 - 2 * !(sizeof(int) > 4)]; }
#endif
#if (ULONG_MAX == MFX_0xffffffffL)
{ typedef char a_long4[1 - 2 * !(sizeof(long) == 4)]; }
#elif (ULONG_MAX >= MFX_0xffffffffL)
{ typedef char a_long4[1 - 2 * !(sizeof(long) > 4)]; }
#endif
],
mfx_cv_header_sane_limits_h=yes,
mfx_cv_header_sane_limits_h=no)])
])
|
Added work/contrib/lzo/lzo-1.08/acconfig/m4/memcmp.m4.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
## --------------------------------------------------------- ##
## Check for working memcmp. ##
## Adapted from AC_FUNC_MEMCMP. ##
## --------------------------------------------------------- ##
# serial 1
AC_DEFUN(mfx_FUNC_MEMCMP,
[AC_CACHE_CHECK([for working memcmp], mfx_cv_func_memcmp,
[AC_RUN_IFELSE([AC_LANG_PROGRAM([[
#include <string.h>
]], [[
unsigned char c0 = 0x40, c1 = 0x80, c2 = 0x81;
char aa[21], bb[21];
int i, j;
if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0)
exit(1);
for (i = 0; i < 4; i++) {
for (j = 0; j < 4; j++) {
char *a = aa + i; char *b = bb + j;
strcpy(a, "0000000012222222");
strcpy(b, "0000000021111111");
if (memcmp(a, b, 16) >= 0)
exit(1);
}
}
]])],
[mfx_cv_func_memcmp=yes],
[mfx_cv_func_memcmp=no],
[mfx_cv_func_memcmp=unknown])])
if test "$mfx_cv_func_memcmp" = no; then
AC_DEFINE(NO_MEMCMP)
fi
])
|
Added work/contrib/lzo/lzo-1.08/acconfig/m4/pipe.m4.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
## --------------------------------------------------------- ##
## Check if gcc accepts '-pipe'. ##
## Adapted from AC_PROG_CC and AC_PROG_GCC_TRADITIONAL. ##
## --------------------------------------------------------- ##
# serial 1
AC_DEFUN(mfx_PROG_GCC_PIPE,
[AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_CPP])dnl
if test "$ac_cv_prog_gcc" = yes; then
AC_CACHE_CHECK([whether ${CC-cc} accepts -pipe], mfx_cv_prog_gcc_pipe,
[echo 'int main() { return 0; }' > conftest.c
if test -z "`${CC-cc} -pipe -c conftest.c 2>&1`"; then
mfx_cv_prog_gcc_pipe=yes
else
mfx_cv_prog_gcc_pipe=no
fi
rm -f conftest*
])
if test "$mfx_cv_prog_gcc_pipe" = yes; then
CC="$CC -pipe"
fi
fi
])
|
Added work/contrib/lzo/lzo-1.08/acconfig/m4/promote.m4.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
## --------------------------------------------------------- ##
## Check how the compiler promotes integrals. ##
## --------------------------------------------------------- ##
# serial 1
AC_DEFUN(mfx_PROG_CC_INTEGRAL_PROMOTION,
[AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_CPP])dnl
AC_CACHE_CHECK([how the compiler promotes integrals],
mfx_cv_prog_cc_integral_promotion,
[AC_TRY_COMPILE([], [
char x[1 - 2 * ( (((unsigned char)128) << (int)(8*sizeof(int)-8)) >= 0 )];
],
mfx_cv_prog_cc_integral_promotion="ANSI C (value-preserving)",
mfx_cv_prog_cc_integral_promotion="Classic (unsigned-preserving)")])
])
|
Added work/contrib/lzo/lzo-1.08/acconfig/mdate-sh.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
#!/bin/sh
# Get modification time of a file or directory and pretty-print it.
# Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
# written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Prevent date giving response in another language.
LANG=C
export LANG
LC_ALL=C
export LC_ALL
LC_TIME=C
export LC_TIME
# Get the extended ls output of the file or directory.
# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below.
if ls -L /dev/null 1>/dev/null 2>&1; then
set - x`ls -L -l -d $1`
else
set - x`ls -l -d $1`
fi
# The month is at least the fourth argument
# (3 shifts here, the next inside the loop).
shift
shift
shift
# Find the month. Next argument is day, followed by the year or time.
month=
until test $month
do
shift
case $1 in
Jan) month=January; nummonth=1;;
Feb) month=February; nummonth=2;;
Mar) month=March; nummonth=3;;
Apr) month=April; nummonth=4;;
May) month=May; nummonth=5;;
Jun) month=June; nummonth=6;;
Jul) month=July; nummonth=7;;
Aug) month=August; nummonth=8;;
Sep) month=September; nummonth=9;;
Oct) month=October; nummonth=10;;
Nov) month=November; nummonth=11;;
Dec) month=December; nummonth=12;;
esac
done
day=$2
# Here we have to deal with the problem that the ls output gives either
# the time of day or the year.
case $3 in
*:*) set `date`; eval year=\$$#
case $2 in
Jan) nummonthtod=1;;
Feb) nummonthtod=2;;
Mar) nummonthtod=3;;
Apr) nummonthtod=4;;
May) nummonthtod=5;;
Jun) nummonthtod=6;;
Jul) nummonthtod=7;;
Aug) nummonthtod=8;;
Sep) nummonthtod=9;;
Oct) nummonthtod=10;;
Nov) nummonthtod=11;;
Dec) nummonthtod=12;;
esac
# For the first six month of the year the time notation can also
# be used for files modified in the last year.
if (expr $nummonth \> $nummonthtod) > /dev/null;
then
year=`expr $year - 1`
fi;;
*) year=$3;;
esac
# The result.
echo $day $month $year
|
Added work/contrib/lzo/lzo-1.08/acconfig/missing.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
|
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
# Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
run=:
# In the cases where this matters, `missing' is being run in the
# srcdir already.
if test -f configure.ac; then
configure_ac=configure.ac
else
configure_ac=configure.in
fi
case "$1" in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case "$1" in
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
--run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing 0.4 - GNU automake"
;;
-*)
echo 1>&2 "$0: Unknown \`$1' option"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
;;
aclocal*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
case "$f" in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
esac
done
touch $touch_files
;;
automake*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
sed 's/\.am$/.in/' |
while read f; do touch "$f"; done
;;
autom4te)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is needed, and you do not seem to have it handy on your
system. You might have modified some files without having the
proper tools for further handling them.
You can get \`$1Help2man' as part of \`Autoconf' from any GNU
archive site."
file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo "#! /bin/sh"
echo "# Created by GNU Automake missing as a replacement of"
echo "# $ $@"
echo "exit 0"
chmod +x $file
exit 1
fi
;;
bison|yacc)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if [ ! -f y.tab.h ]; then
echo >y.tab.h
fi
if [ ! -f y.tab.c ]; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex|flex)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if [ ! -f lex.yy.c ]; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
help2man)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
fi
if [ -f "$file" ]; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
exit 1
fi
;;
makeinfo)
if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
# We have makeinfo, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
fi
touch $file
;;
tar)
shift
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
fi
# We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error
# messages.
if (gnutar --version > /dev/null 2>&1); then
gnutar "$@" && exit 0
fi
if (gtar --version > /dev/null 2>&1); then
gtar "$@" && exit 0
fi
firstarg="$1"
if shift; then
case "$firstarg" in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0
;;
esac
case "$firstarg" in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0
;;
esac
fi
echo 1>&2 "\
WARNING: I can't seem to be able to run \`tar' with the given arguments.
You may want to install GNU tar or Free paxutils, or check the
command line arguments."
exit 1
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and you do not seem to have it handy on your
system. You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequirements for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;;
esac
exit 0
|
Added work/contrib/lzo/lzo-1.08/acconfig/mkinstalldirs.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain
# $Id: mkinstalldirs,v 1.3 2002/03/08 12:44:47 akim Exp $
errstatus=0
dirmode=""
usage="\
Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
# process command line arguments
while test $# -gt 0 ; do
case "${1}" in
-h | --help | --h* ) # -h for help
echo "${usage}" 1>&2; exit 0 ;;
-m ) # -m PERM arg
shift
test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
dirmode="${1}"
shift ;;
-- ) shift; break ;; # stop option processing
-* ) echo "${usage}" 1>&2; exit 1 ;; # unknown option
* ) break ;; # first non-opt arg
esac
done
for file
do
if test -d "$file"; then
shift
else
break
fi
done
case $# in
0) exit 0 ;;
esac
case $dirmode in
'')
if mkdir -p -- . 2>/dev/null; then
echo "mkdir -p -- $*"
exec mkdir -p -- "$@"
fi ;;
*)
if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
echo "mkdir -m $dirmode -p -- $*"
exec mkdir -m "$dirmode" -p -- "$@"
fi ;;
esac
for file
do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
for d
do
pathcomp="$pathcomp$d"
case "$pathcomp" in
-* ) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp"
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
else
if test ! -z "$dirmode"; then
echo "chmod $dirmode $pathcomp"
lasterr=""
chmod "$dirmode" "$pathcomp" || lasterr=$?
if test ! -z "$lasterr"; then
errstatus=$lasterr
fi
fi
fi
fi
pathcomp="$pathcomp/"
done
done
exit $errstatus
# Local Variables:
# mode: shell-script
# sh-indentation: 3
# End:
# mkinstalldirs ends here
|
Added work/contrib/lzo/lzo-1.08/acconfig/py-compile.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
#!/bin/sh
# py-compile - Compile a Python program
# Copyright 2000, 2001 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# called as "py-compile [--basedir DIR] PY_FILES ...
if [ -z "$PYTHON" ]; then
PYTHON=python
fi
basedir=
case "$1" in
--basedir)
basedir=$2
shift 2
;;
--help)
echo "Usage: py-compile [--basedir DIR] PY_FILES ..."
echo "Byte compile some python scripts. This should be performed"
echo "after they have been moved to the final installation location"
exit 0
;;
--version)
echo "py-compile version 0.0"
exit 0
;;
esac
if [ $# = 0 ]; then
echo "No files given to $0" 1>&2
exit 1
fi
# if basedir was given, then it should be prepended to filenames before
# byte compilation.
if [ -z "$basedir" ]; then
trans="path = file"
else
trans="path = os.path.join('$basedir', file)"
fi
$PYTHON -c "
import sys, os, string, py_compile
files = '''$*'''
print 'Byte-compiling python modules...'
for file in string.split(files):
$trans
if not os.path.exists(path) or not (len(path) >= 3 and path[-3:] == '.py'):
continue
print file,
sys.stdout.flush()
py_compile.compile(path)
print" || exit $?
# this will fail for python < 1.5, but that doesn't matter ...
$PYTHON -O -c "
import sys, os, string, py_compile
files = '''$*'''
print 'Byte-compiling python modules (optimised versions) ...'
for file in string.split(files):
$trans
if not os.path.exists(path) or not (len(path) >= 3 and path[-3:] == '.py'):
continue
print file,
sys.stdout.flush()
py_compile.compile(path)
print" 2>/dev/null || :
|
Added work/contrib/lzo/lzo-1.08/acconfig/scripts/findexe.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
#! /usr/bin/env python2.2
##
## vi:ts=4:et
##
##---------------------------------------------------------------------------##
## Author:
## Markus F.X.J. Oberhumer <markus@oberhumer.com>
## Copyright:
## Distributed under the terms of the GNU General Public License.
## Description:
## xx
## Usage:
## python findexe ls
## python findexe "python*" [glob expression]
##---------------------------------------------------------------------------##
import fnmatch, getopt, os, re, string, sys
# /***********************************************************************
# //
# ************************************************************************/
opts = {
"abspath": 0,
"realpath": 0,
}
def getname(n):
if opts.get("abspath"):
n = os.path.abspath(n)
if opts.get("realpath"):
n = os.path.realpath(n)
if opts.get("normpath"):
n = os.path.normpath(n)
if opts.get("normcase"):
n = os.path.normcase(n)
return n
def main(argv):
longopts = opts.keys()
longopts.sort()
xopts, xargs = getopt.getopt(argv[1:], "", longopts)
##print xopts, xargs
for o, a in xopts:
if o[:2] == "--":
o = o[2:]
assert o
##print o, a
if not a: a = 1
opts[o] = a
#
path = os.environ.get("PATH", "")
path = string.splitfields(path, os.pathsep)
#
re_flags = 0
if os.name == "nt": re_flags = re.I
patterns = []
for pat in xargs:
p = fnmatch.translate(pat)
r = re.compile(p, re_flags)
patterns.append(r)
#
result = []
for dir in path:
if not dir or not os.path.isdir(dir):
continue
try:
names = os.listdir(dir)
except:
names = []
names.sort()
for n in names:
for pat in patterns:
if pat.match(n):
fn = os.path.join(dir, n)
if os.path.isfile(fn):
exe = getname(fn)
if not exe in result:
result.append(exe)
for r in result:
print r
if __name__ == "__main__":
sys.exit(main(sys.argv))
|
Added work/contrib/lzo/lzo-1.08/acconfig/scripts/ls_subdirs.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
#! /usr/bin/env python
##
## vi:ts=4:et
##
##---------------------------------------------------------------------------##
## Author:
## Markus F.X.J. Oberhumer <markus@oberhumer.com>
## Copyright:
## Distributed under the terms of the GNU General Public License.
## Description:
## List files. See ls(1).
## Usage:
## python ls_subdirs dirs...
##---------------------------------------------------------------------------##
import getopt, os, re, stat, sys
# /***********************************************************************
# //
# ************************************************************************/
opts = {
"all": 0,
"abspath": 0,
"basename": 0,
"normcase": 0,
"normpath": 0,
}
def ls(dir):
if not os.path.isdir(dir):
return
#
files = os.listdir(dir)
files.sort()
for f in files:
if not f or f == "." or f == "..":
continue
if f[0] == "." and not opts.get("all"):
continue
if dir == ".":
relname = f
else:
relname = os.path.join(dir, f)
st = os.lstat(relname)
#
# check file type
#
if not os.path.isdir(relname):
continue
#
# print
#
if opts.get("abspath"):
p = os.path.abspath(relname)
elif opts.get("basename"):
p = os.path.basename(relname)
assert p == f
else:
p = relname
if opts.get("normpath"):
p = os.path.normpath(p)
if opts.get("normcase"):
p = os.path.normcase(p)
print p
# /***********************************************************************
# //
# ************************************************************************/
def main(argv):
longopts = opts.keys()
longopts.sort()
xopts, xargs = getopt.getopt(argv[1:], "", longopts)
##print xopts, xargs
for o, a in xopts:
if o[:2] == "--":
o = o[2:]
assert o
##print o, a
if not a: a = 1
opts[o] = a
if not xargs:
xargs = ["."]
for arg in xargs:
ls(arg)
return 0
if __name__ == "__main__":
sys.exit(main(sys.argv))
|
Added work/contrib/lzo/lzo-1.08/acconfig/shtool.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
|
#!/bin/sh
##
## GNU shtool -- The GNU Portable Shell Tool
## Copyright (c) 1994-2002 Ralf S. Engelschall <rse@engelschall.com>
##
## See http://www.gnu.org/software/shtool/ for more information.
## See ftp://ftp.gnu.org/gnu/shtool/ for latest version.
##
## Version: 1.6.0 (01-Feb-2002)
## Contents: all available modules
##
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
## USA, or contact Ralf S. Engelschall <rse@engelschall.com>.
##
## NOTICE: Given that you include this file verbatim into your own
## source tree, you are justified in saying that it remains separate
## from your package, and that this way you are simply just using GNU
## shtool. So, in this situation, there is no requirement that your
## package itself is licensed under the GNU General Public License in
## order to take advantage of GNU shtool.
##
##
## Usage: shtool [<options>] [<cmd-name> [<cmd-options>] [<cmd-args>]]
##
## Available commands:
## echo Print string with optional construct expansion
## mdate Pretty-print modification time of a file or dir
## table Pretty-print a field-separated list as a table
## prop Display progress with a running propeller
## move Move files with simultaneous substitution
## install Install a program, script or datafile
## mkdir Make one or more directories
## mkln Make link with calculation of relative paths
## mkshadow Make a shadow tree through symbolic links
## fixperm Fix file permissions inside a source tree
## rotate Logfile rotation
## tarball Roll distribution tarballs
## subst Apply sed(1) substitution operations
## guessos Simple operating system guesser
## arx Extended archive command
## slo Separate linker options by library class
## scpp Sharing C Pre-Processor
## version Maintain a version information file
## path Deal with program paths
##
if [ $# -eq 0 ]; then
echo "$0:Error: invalid command line" 1>&2
echo "$0:Hint: run \`$0 -h' for usage" 1>&2
exit 1
fi
if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then
echo "This is GNU shtool, version 1.6.0 (01-Feb-2002)"
echo "Copyright (c) 1994-2002 Ralf S. Engelschall <rse@engelschall.com>"
echo "Report bugs to <bug-shtool@gnu.org>"
echo ''
echo "Usage: shtool [<options>] [<cmd-name> [<cmd-options>] [<cmd-args>]]"
echo ''
echo 'Available global <options>:'
echo ' -v, --version display shtool version information'
echo ' -h, --help display shtool usage help page (this one)'
echo ' -d, --debug display shell trace information'
echo ' -r, --recreate recreate this shtool script via shtoolize'
echo ''
echo 'Available <cmd-name> [<cmd-options>] [<cmd-args>]:'
echo ' echo [-n|--newline] [-e|--expand] [<str> ...]'
echo ' mdate [-n|--newline] [-z|--zero] [-s|--shorten] [-d|--digits]'
echo ' [-f|--field-sep <str>] [-o|--order <spec>] <path>'
echo ' table [-F|--field-sep <sep>] [-w|--width <width>] [-c|--columns'
echo ' <cols>] [-s|--strip <strip>] <str><sep><str>...'
echo ' prop [-p|--prefix <str>]'
echo ' move [-v|--verbose] [-t|--trace] [-e|--expand] [-p|--preserve]'
echo ' <src-file> <dst-file>'
echo ' install [-v|--verbose] [-t|--trace] [-c|--copy] [-C|--compare-copy]'
echo ' [-s|--strip] [-m|--mode <mode>] [-o|--owner <owner>]'
echo ' [-g|--group <group>] [-e|--exec <sed-cmd>] <file> [<file>'
echo ' ...] <path>'
echo ' mkdir [-t|--trace] [-f|--force] [-p|--parents] [-m|--mode'
echo ' <mode>] <dir> [<dir> ...]'
echo ' mkln [-t|--trace] [-f|--force] [-s|--symbolic] <src-path>'
echo ' [<src-path> ...] <dst-path>'
echo ' mkshadow [-v|--verbose] [-t|--trace] [-a|--all] <src-dir> <dst-dir>'
echo ' fixperm [-v|--verbose] [-t|--trace] <path> [<path> ...]'
echo ' rotate [-v|--verbose] [-t|--trace] [-f|--force] [-n|--num-files'
echo ' <count>] [-s|--min-size <size>] [-c|--copy] [-r|--remove]'
echo ' [-a|--archive-dir <dir>] [-z|--compress [<tool>:]<level>]'
echo ' [-b|--background] [-d|--delay] [-p|--pad <len>] [-o|--owner'
echo ' <owner>] [-g|--group <group>] [-m|--mode <mode>] [-M|--migrate'
echo ' <cmd>] [-P|--prolog <cmd>] [-E|--epilog <cmd>] <file> [...]'
echo ' tarball [-t|--trace] [-v|--verbose] [-o|--output <tarball>]'
echo ' [-c|--compress <prog>] [-d|--directory <dir>] [-u|--user'
echo ' <user>] [-g|--group <group>] [-e|--exclude <pattern>]'
echo ' <path> [<path> ...]'
echo ' subst [-v|--verbose] [-t|--trace] [-n|--nop] [-s|--stealth]'
echo ' [-i|--interactive] [-b|--backup <ext>] [-e|--exec <cmd>]'
echo ' [-f|--file <cmd-file>] [<file>] [...]'
echo ' guessos '
echo ' arx [-t|--trace] [-C|--command <cmd>] <op> <archive> [<file>'
echo ' ...]'
echo ' slo [-p|--prefix <str>] -- -L<dir> -l<lib> [-L<dir> -l<lib>'
echo ' ...]'
echo ' scpp [-v|--verbose] [-p|--preserve] [-f|--filter <filter>]'
echo ' [-o|--output <ofile>] [-t|--template <tfile>] [-M|--mark'
echo ' <mark>] [-D|--define <dname>] [-C|--class <cname>]'
echo ' <file> [<file> ...]'
echo ' version [-l|--language <lang>] [-n|--name <name>] [-p|--prefix'
echo ' <prefix>] [-s|--set <version>] [-e|--edit] [-i|--increase'
echo ' <knob>] [-d|--display <type>] <file>'
echo ' path [-s|--suppress] [-r|--reverse] [-d|--dirname] [-b|--basename]'
echo ' [-m|--magic] [-p|--path <path>] <str> [<str> ...]'
echo ''
exit 0
fi
if [ ".$1" = ".-v" -o ".$1" = ."--version" ]; then
echo "GNU shtool 1.6.0 (01-Feb-2002)"
exit 0
fi
if [ ".$1" = ".-r" -o ".$1" = ."--recreate" ]; then
shtoolize -oshtool all
exit 0
fi
if [ ".$1" = ".-d" -o ".$1" = ."--debug" ]; then
shift
set -x
fi
name=`echo "$0" | sed -e 's;.*/\([^/]*\)$;\1;' -e 's;-sh$;;' -e 's;\.sh$;;'`
case "$name" in
echo|mdate|table|prop|move|install|mkdir|mkln|mkshadow|fixperm|rotate|tarball|subst|guessos|arx|slo|scpp|version|path )
# implicit tool command selection
tool="$name"
;;
* )
# explicit tool command selection
tool="$1"
shift
;;
esac
arg_spec=""
opt_spec=""
gen_tmpfile=no
##
## DISPATCH INTO SCRIPT PROLOG
##
case $tool in
echo )
str_tool="echo"
str_usage="[-n|--newline] [-e|--expand] [<str> ...]"
arg_spec="0+"
opt_spec="n.e."
opt_alias="n:newline,e:expand"
opt_n=no
opt_e=no
;;
mdate )
str_tool="mdate"
str_usage="[-n|--newline] [-z|--zero] [-s|--shorten] [-d|--digits] [-f|--field-sep <str>] [-o|--order <spec>] <path>"
arg_spec="1="
opt_spec="n.z.s.d.f:o:"
opt_alias="n:newline,z:zero,s:shorten,d:digits,f:field-sep,o:order"
opt_n=no
opt_z=no
opt_s=no
opt_d=no
opt_f=" "
opt_o="dmy"
;;
table )
str_tool="table"
str_usage="[-F|--field-sep <sep>] [-w|--width <width>] [-c|--columns <cols>] [-s|--strip <strip>] <str><sep><str>..."
arg_spec="1+"
opt_spec="F:w:c:s:"
opt_alias="F:field-sep,w:width,c:columns,s:strip"
opt_F=":"
opt_w=15
opt_c=3
opt_s=79
;;
prop )
str_tool="prop"
str_usage="[-p|--prefix <str>]"
arg_spec="0="
opt_spec="p:"
opt_alias="p:prefix"
opt_p=""
;;
move )
str_tool="move"
str_usage="[-v|--verbose] [-t|--trace] [-e|--expand] [-p|--preserve] <src-file> <dst-file>"
arg_spec="2="
opt_spec="v.t.e.p."
opt_alias="v:verbose,t:trace,e:expand,p:preserve"
opt_v=no
opt_t=no
opt_e=no
opt_p=no
;;
install )
str_tool="install"
str_usage="[-v|--verbose] [-t|--trace] [-c|--copy] [-C|--compare-copy] [-s|--strip] [-m|--mode <mode>] [-o|--owner <owner>] [-g|--group <group>] [-e|--exec <sed-cmd>] <file> [<file> ...] <path>"
arg_spec="2+"
opt_spec="v.t.c.C.s.m:o:g:e+"
opt_alias="v:verbose,t:trace,c:copy,C:compare-copy,s:strip,m:mode,o:owner,g:group,e:exec"
opt_v=no
opt_t=no
opt_c=no
opt_C=no
opt_s=no
opt_m="0755"
opt_o=""
opt_g=""
opt_e=""
;;
mkdir )
str_tool="mkdir"
str_usage="[-t|--trace] [-f|--force] [-p|--parents] [-m|--mode <mode>] <dir> [<dir> ...]"
arg_spec="1+"
opt_spec="t.f.p.m:"
opt_alias="t:trace,f:force,p:parents,m:mode"
opt_t=no
opt_f=no
opt_p=no
opt_m=""
;;
mkln )
str_tool="mkln"
str_usage="[-t|--trace] [-f|--force] [-s|--symbolic] <src-path> [<src-path> ...] <dst-path>"
arg_spec="2+"
opt_spec="t.f.s."
opt_alias="t:trace,f:force,s:symbolic"
opt_t=no
opt_f=no
opt_s=no
;;
mkshadow )
str_tool="mkshadow"
str_usage="[-v|--verbose] [-t|--trace] [-a|--all] <src-dir> <dst-dir>"
arg_spec="2="
opt_spec="v.t.a."
opt_alias="v:verbose,t:trace,a:all"
opt_v=no
opt_t=no
opt_a=no
;;
fixperm )
str_tool="fixperm"
str_usage="[-v|--verbose] [-t|--trace] <path> [<path> ...]"
arg_spec="1+"
opt_spec="v.t."
opt_alias="v:verbose,t:trace"
opt_v=no
opt_t=no
;;
rotate )
str_tool="rotate"
str_usage="[-v|--verbose] [-t|--trace] [-f|--force] [-n|--num-files <count>] [-s|--min-size <size>] [-c|--copy] [-r|--remove] [-a|--archive-dir <dir>] [-z|--compress [<tool>:]<level>] [-b|--background] [-d|--delay] [-p|--pad <len>] [-o|--owner <owner>] [-g|--group <group>] [-m|--mode <mode>] [-M|--migrate <cmd>] [-P|--prolog <cmd>] [-E|--epilog <cmd>] <file> [...]"
arg_spec="1+"
opt_spec="v.t.f.n:s:c.r.a:z:b.d.p:o:g:m:M:P:E:"
opt_alias="v:verbose,t:trace,f:force,n:num-files,s:size,m:min-size,c:copy,r:remove,a:archive-dir,z:compress,b:background,d:delay,p:pad,o:owner,g:group,m:mode,M:migrate,P:prolog,E:epilog"
opt_v=no
opt_t=no
opt_f=no
opt_n=10
opt_s=""
opt_c=no
opt_r=no
opt_a=""
opt_z=""
opt_b=no
opt_d=no
opt_p=1
opt_o=""
opt_g=""
opt_m=""
opt_M=""
opt_P=""
opt_E=""
;;
tarball )
str_tool="tarball"
str_usage="[-t|--trace] [-v|--verbose] [-o|--output <tarball>] [-c|--compress <prog>] [-d|--directory <dir>] [-u|--user <user>] [-g|--group <group>] [-e|--exclude <pattern>] <path> [<path> ...]"
gen_tmpfile=yes
arg_spec="1+"
opt_spec="t.v.o:c:d:u:g:e:"
opt_alias="t:trace,v:verbose,o:output,c:compress,d:directory,u:user,g:group,e:exclude"
opt_t=no
opt_v=no
opt_o=""
opt_c=""
opt_d=""
opt_u=""
opt_g=""
opt_e="CVS,\\.cvsignore,\\.[oa]\$"
;;
subst )
str_tool="subst"
str_usage="[-v|--verbose] [-t|--trace] [-n|--nop] [-s|--stealth] [-i|--interactive] [-b|--backup <ext>] [-e|--exec <cmd>] [-f|--file <cmd-file>] [<file>] [...]"
gen_tmpfile=yes
arg_spec="0+"
opt_spec="v.t.n.s.i.b:e+f:"
opt_alias="v:verbose,t:trace,n:nop,s:stealth,i:interactive,b:backup,e:exec,f:file"
opt_v=no
opt_t=no
opt_n=no
opt_s=no
opt_i=no
opt_b=""
opt_e=""
opt_f=""
;;
guessos )
str_tool="guessos"
str_usage=""
arg_spec="0="
opt_spec=""
opt_alias=""
;;
arx )
str_tool="arx"
str_usage="[-t|--trace] [-C|--command <cmd>] <op> <archive> [<file> ...]"
arg_spec="2+"
opt_spec="t.C:"
opt_alias="t:trace,C:command"
opt_t=no
opt_C="ar"
;;
slo )
str_tool="slo"
str_usage="[-p|--prefix <str>] -- -L<dir> -l<lib> [-L<dir> -l<lib> ...]"
arg_spec="1+"
opt_spec="p:"
opt_alias="p:prefix"
opt_p="SLO_"
;;
scpp )
str_tool="scpp"
str_usage="[-v|--verbose] [-p|--preserve] [-f|--filter <filter>] [-o|--output <ofile>] [-t|--template <tfile>] [-M|--mark <mark>] [-D|--define <dname>] [-C|--class <cname>] <file> [<file> ...]"
gen_tmpfile=yes
arg_spec="1+"
opt_spec="v.p.f+o:t:M:D:C:"
opt_alias="v:verbose,p:preserve,f:filter,o:output,t:template,M:mark,D:define,C:class"
opt_v=no
opt_p=no
opt_f=""
opt_o="lib.h"
opt_t="lib.h.in"
opt_M="%%MARK%%"
opt_D="cpp"
opt_C="intern"
;;
version )
str_tool="version"
str_usage="[-l|--language <lang>] [-n|--name <name>] [-p|--prefix <prefix>] [-s|--set <version>] [-e|--edit] [-i|--increase <knob>] [-d|--display <type>] <file>"
arg_spec="1="
opt_spec="l:n:p:s:i:e.d:"
opt_alias="l:language,n:name,p:prefix,s:set,e:edit,i:increase,d:display"
opt_l="txt"
opt_n="unknown"
opt_p=""
opt_s=""
opt_e="no"
opt_i=""
opt_d="short"
;;
path )
str_tool="path"
str_usage="[-s|--suppress] [-r|--reverse] [-d|--dirname] [-b|--basename] [-m|--magic] [-p|--path <path>] <str> [<str> ...]"
gen_tmpfile=yes
arg_spec="1+"
opt_spec="s.r.d.b.m.p:"
opt_alias="s:suppress,r:reverse,d:dirname,b:basename,m:magic,p:path"
opt_s=no
opt_r=no
opt_d=no
opt_b=no
opt_m=no
opt_p="$PATH"
;;
-* )
echo "$0:Error: unknown option \`$tool'" 2>&1
echo "$0:Hint: run \`$0 -h' for usage" 2>&1
exit 1
;;
* )
echo "$0:Error: unknown command \`$tool'" 2>&1
echo "$0:Hint: run \`$0 -h' for usage" 2>&1
exit 1
;;
esac
##
## COMMON UTILITY CODE
##
# commonly used ASCII values
ASC_TAB=" "
ASC_NL="
"
# determine name of tool
if [ ".$tool" != . ]; then
# used inside shtool script
toolcmd="$0 $tool"
toolcmdhelp="shtool $tool"
msgprefix="shtool:$tool"
else
# used as standalone script
toolcmd="$0"
toolcmdhelp="sh $0"
msgprefix="$str_tool"
fi
# parse argument specification string
eval `echo $arg_spec |\
sed -e 's/^\([0-9]*\)\([+=]\)/arg_NUMS=\1; arg_MODE=\2/'`
# parse option specification string
eval `echo h.$opt_spec |\
sed -e 's/\([a-zA-Z0-9]\)\([.:+]\)/opt_MODE_\1=\2;/g'`
# parse option alias string
eval `echo h:help,$opt_alias |\
tr 'x-' 'x_' | sed -e 's/\([a-zA-Z0-9]\):\([^,]*\),*/opt_ALIAS_\2=\1;/g'`
# interate over argument line
opt_PREV=''
while [ $# -gt 0 ]; do
# special option stops processing
if [ ".$1" = ".--" ]; then
shift
break
fi
# determine option and argument
opt_ARG_OK=no
if [ ".$opt_PREV" != . ]; then
# merge previous seen option with argument
opt_OPT="$opt_PREV"
opt_ARG="$1"
opt_ARG_OK=yes
opt_PREV=''
else
# split argument into option and argument
case "$1" in
--[a-zA-Z0-9]*=*)
eval `echo "x$1" |\
sed -e 's/^x--\([a-zA-Z0-9-]*\)=\(.*\)$/opt_OPT="\1";opt_ARG="\2"/'`
opt_STR=`echo $opt_OPT | tr 'x-' 'x_'`
eval "opt_OPT=\${opt_ALIAS_${opt_STR}-${opt_OPT}}"
;;
--[a-zA-Z0-9]*)
opt_OPT=`echo "x$1" | cut -c4-`
opt_STR=`echo $opt_OPT | tr 'x-' 'x_'`
eval "opt_OPT=\${opt_ALIAS_${opt_STR}-${opt_OPT}}"
opt_ARG=''
;;
-[a-zA-Z0-9]*)
eval `echo "x$1" |\
sed -e 's/^x-\([a-zA-Z0-9]\)/opt_OPT="\1";/' \
-e 's/";\(.*\)$/"; opt_ARG="\1"/'`
;;
-[a-zA-Z0-9])
opt_OPT=`echo "x$1" | cut -c3-`
opt_ARG=''
;;
*)
break
;;
esac
fi
# eat up option
shift
# determine whether option needs an argument
eval "opt_MODE=\$opt_MODE_${opt_OPT}"
if [ ".$opt_ARG" = . -a ".$opt_ARG_OK" != .yes ]; then
if [ ".$opt_MODE" = ".:" -o ".$opt_MODE" = ".+" ]; then
opt_PREV="$opt_OPT"
continue
fi
fi
# process option
case $opt_MODE in
'.' )
# boolean option
eval "opt_${opt_OPT}=yes"
;;
':' )
# option with argument (multiple occurances override)
eval "opt_${opt_OPT}=\"\$opt_ARG\""
;;
'+' )
# option with argument (multiple occurances append)
eval "opt_${opt_OPT}=\"\$opt_${opt_OPT}\${ASC_NL}\$opt_ARG\""
;;
* )
echo "$msgprefix:Error: unknown option: \`$opt_OPT'" 1>&2
echo "$msgprefix:Hint: run \`$toolcmdhelp -h' or \`man shtool' for details" 1>&2
exit 1
;;
esac
done
if [ ".$opt_PREV" != . ]; then
echo "$msgprefix:Error: missing argument to option \`$opt_PREV'" 1>&2
echo "$msgprefix:Hint: run \`$toolcmdhelp -h' or \`man shtool' for details" 1>&2
exit 1
fi
# process help option
if [ ".$opt_h" = .yes ]; then
echo "Usage: $toolcmdhelp $str_usage"
exit 0
fi
# complain about incorrect number of arguments
case $arg_MODE in
'=' )
if [ $# -ne $arg_NUMS ]; then
echo "$msgprefix:Error: invalid number of arguments (exactly $arg_NUMS expected)" 1>&2
echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2
exit 1
fi
;;
'+' )
if [ $# -lt $arg_NUMS ]; then
echo "$msgprefix:Error: invalid number of arguments (at least $arg_NUMS expected)" 1>&2
echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2
exit 1
fi
;;
esac
# establish a temporary file on request
if [ ".$gen_tmpfile" = .yes ]; then
if [ ".$TMPDIR" != . ]; then
tmpdir="$TMPDIR"
elif [ ".$TEMPDIR" != . ]; then
tmpdir="$TEMPDIR"
else
tmpdir="/tmp"
fi
tmpfile="$tmpdir/.shtool.$$"
rm -f $tmpfile >/dev/null 2>&1
touch $tmpfile
chmod 600 $tmpfile
fi
##
## DISPATCH INTO SCRIPT BODY
##
case $tool in
echo )
##
## echo -- Print string with optional construct expansion
## Copyright (c) 1998-2002 Ralf S. Engelschall <rse@engelschall.com>
## Originally written for WML as buildinfo
##
text="$*"
# check for broken escape sequence expansion
seo=''
bytes=`echo '\1' | wc -c | awk '{ printf("%s", $1); }'`
if [ ".$bytes" != .3 ]; then
bytes=`echo -E '\1' | wc -c | awk '{ printf("%s", $1); }'`
if [ ".$bytes" = .3 ]; then
seo='-E'
fi
fi
# check for existing -n option (to suppress newline)
minusn=''
bytes=`echo -n 123 2>/dev/null | wc -c | awk '{ printf("%s", $1); }'`
if [ ".$bytes" = .3 ]; then
minusn='-n'
fi
# determine terminal bold sequence
term_bold=''
term_norm=''
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[Bb]'`" != . ]; then
case $TERM in
# for the most important terminal types we directly know the sequences
xterm|xterm*|vt220|vt220*)
term_bold=`awk 'BEGIN { printf("%c%c%c%c", 27, 91, 49, 109); }' </dev/null 2>/dev/null`
term_norm=`awk 'BEGIN { printf("%c%c%c", 27, 91, 109); }' </dev/null 2>/dev/null`
;;
vt100|vt100*)
term_bold=`awk 'BEGIN { printf("%c%c%c%c%c%c", 27, 91, 49, 109, 0, 0); }' </dev/null 2>/dev/null`
term_norm=`awk 'BEGIN { printf("%c%c%c%c%c", 27, 91, 109, 0, 0); }' </dev/null 2>/dev/null`
;;
# for all others, we try to use a possibly existing `tput' or `tcout' utility
* )
paths=`echo $PATH | sed -e 's/:/ /g'`
for tool in tput tcout; do
for dir in $paths; do
if [ -r "$dir/$tool" ]; then
for seq in bold md smso; do # 'smso' is last
bold="`$dir/$tool $seq 2>/dev/null`"
if [ ".$bold" != . ]; then
term_bold="$bold"
break
fi
done
if [ ".$term_bold" != . ]; then
for seq in sgr0 me rmso reset; do # 'reset' is last
norm="`$dir/$tool $seq 2>/dev/null`"
if [ ".$norm" != . ]; then
term_norm="$norm"
break
fi
done
fi
break
fi
done
if [ ".$term_bold" != . -a ".$term_norm" != . ]; then
break;
fi
done
;;
esac
if [ ".$term_bold" = . -o ".$term_norm" = . ]; then
echo "$msgprefix:Warning: unable to determine terminal sequence for bold mode" 1>&2
fi
fi
# determine user name
username=''
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[uUgG]'`" != . ]; then
username="$LOGNAME"
if [ ".$username" = . ]; then
username="$USER"
if [ ".$username" = . ]; then
username="`(whoami) 2>/dev/null |\
awk '{ printf("%s", $1); }'`"
if [ ".$username" = . ]; then
username="`(who am i) 2>/dev/null |\
awk '{ printf("%s", $1); }'`"
if [ ".$username" = . ]; then
username='unknown'
fi
fi
fi
fi
fi
# determine user id
userid=''
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%U'`" != . ]; then
userid="`(id -u) 2>/dev/null`"
if [ ".$userid" = . ]; then
str="`(id) 2>/dev/null`"
if [ ".`echo $str | grep '^uid[ ]*=[ ]*[0-9]*('`" != . ]; then
userid=`echo $str | sed -e 's/^uid[ ]*=[ ]*//' -e 's/(.*//'`
fi
if [ ".$userid" = . ]; then
userid=`egrep "^${username}:" /etc/passwd 2>/dev/null | \
sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'`
if [ ".$userid" = . ]; then
userid=`(ypcat passwd) 2>/dev/null |
egrep "^${username}:" | \
sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'`
if [ ".$userid" = . ]; then
userid='?'
fi
fi
fi
fi
fi
# determine (primary) group id
groupid=''
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[gG]'`" != . ]; then
groupid=`egrep "^${username}:" /etc/passwd 2>/dev/null | \
sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'`
if [ ".$groupid" = . ]; then
groupid=`(ypcat passwd) 2>/dev/null | egrep "^${username}:" | \
sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'`
if [ ".$groupid" = . ]; then
groupid='?'
fi
fi
fi
# determine (primary) group name
groupname=''
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%g'`" != . ]; then
groupname=`egrep "^[^:]*:[^:]*:${groupid}:" /etc/group 2>/dev/null | \
sed -e 's/:.*$//'`
if [ ".$groupname" = . ]; then
groupname=`(ypcat group) 2>/dev/null | \
egrep "^[^:]*:[^:]*:${groupid}:" | \
sed -e 's/:.*$//'`
if [ ".$groupname" = . ]; then
groupname='?'
fi
fi
fi
# determine host and domain name
hostname=''
domainname=''
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%h'`" != . ]; then
hostname="`(uname -n) 2>/dev/null |\
awk '{ printf("%s", $1); }'`"
if [ ".$hostname" = . ]; then
hostname="`(hostname) 2>/dev/null |\
awk '{ printf("%s", $1); }'`"
if [ ".$hostname" = . ]; then
hostname='unknown'
fi
fi
case $hostname in
*.* )
domainname=".`echo $hostname | cut -d. -f2-`"
hostname="`echo $hostname | cut -d. -f1`"
;;
esac
fi
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%d'`" != . ]; then
if [ ".$domainname" = . ]; then
if [ -f /etc/resolv.conf ]; then
domainname="`egrep '^[ ]*domain' /etc/resolv.conf | head -1 |\
sed -e 's/.*domain//' \
-e 's/^[ ]*//' -e 's/^ *//' -e 's/^ *//' \
-e 's/^\.//' -e 's/^/./' |\
awk '{ printf("%s", $1); }'`"
if [ ".$domainname" = . ]; then
domainname="`egrep '^[ ]*search' /etc/resolv.conf | head -1 |\
sed -e 's/.*search//' \
-e 's/^[ ]*//' -e 's/^ *//' -e 's/^ *//' \
-e 's/ .*//' -e 's/ .*//' \
-e 's/^\.//' -e 's/^/./' |\
awk '{ printf("%s", $1); }'`"
fi
fi
fi
fi
# determine current time
time_day=''
time_month=''
time_year=''
time_monthname=''
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[DMYm]'`" != . ]; then
time_day=`date '+%d'`
time_month=`date '+%m'`
time_year=`date '+%Y' 2>/dev/null`
if [ ".$time_year" = . ]; then
time_year=`date '+%y'`
case $time_year in
[5-9][0-9]) time_year="19$time_year" ;;
[0-4][0-9]) time_year="20$time_year" ;;
esac
fi
case $time_month in
1|01) time_monthname='Jan' ;;
2|02) time_monthname='Feb' ;;
3|03) time_monthname='Mar' ;;
4|04) time_monthname='Apr' ;;
5|05) time_monthname='May' ;;
6|06) time_monthname='Jun' ;;
7|07) time_monthname='Jul' ;;
8|08) time_monthname='Aug' ;;
9|09) time_monthname='Sep' ;;
10) time_monthname='Oct' ;;
11) time_monthname='Nov' ;;
12) time_monthname='Dec' ;;
esac
fi
# expand special ``%x'' constructs
if [ ".$opt_e" = .yes ]; then
text=`echo $seo "$text" |\
sed -e "s/%B/${term_bold}/g" \
-e "s/%b/${term_norm}/g" \
-e "s/%u/${username}/g" \
-e "s/%U/${userid}/g" \
-e "s/%g/${groupname}/g" \
-e "s/%G/${groupid}/g" \
-e "s/%h/${hostname}/g" \
-e "s/%d/${domainname}/g" \
-e "s/%D/${time_day}/g" \
-e "s/%M/${time_month}/g" \
-e "s/%Y/${time_year}/g" \
-e "s/%m/${time_monthname}/g" 2>/dev/null`
fi
# create output
if [ .$opt_n = .no ]; then
echo $seo "$text"
else
# the harder part: echo -n is best, because
# awk may complain about some \xx sequences.
if [ ".$minusn" != . ]; then
echo $seo $minusn "$text"
else
echo dummy | awk '{ printf("%s", TEXT); }' TEXT="$text"
fi
fi
;;
mdate )
##
## mdate -- Pretty-print modification time of a file or dir
## Copyright (c) 1995-1997 Free Software Foundation, Inc.
## Originally idea and basis code by Ulrich Drepper
## Enhanced by Ralf S. Engelschall for shtool
##
fod="$1"
case "$opt_o" in
[dmy][dmy][dmy] )
;;
* ) echo "$msgprefix:Error: invalid argument to option \`-o': $opt_o" 1>&2
exit 1
;;
esac
if [ ! -r "$fod" ]; then
echo "$msgprefix:Error: file or directory not found: $fod" 1>&2
exit 1
fi
# prevent "date" giving response in another language
LANG=C; export LANG
LC_ALL=C; export LC_ALL
LC_TIME=C; export LC_TIME
# get the extended ls output of the file or directory.
if ls -L /dev/null >/dev/null 2>&1; then
set - x`ls -L -l -d $fod`
else
set - x`ls -l -d $fod`
fi
# The month is at least the fourth argument
# (3 shifts here, the next inside the loop).
shift; shift; shift
# Find the month. Next argument is day, followed by the year or time.
month=""
while [ ".$month" = . ]; do
shift
case $1 in
Jan) month=January; nummonth=1 ;;
Feb) month=February; nummonth=2 ;;
Mar) month=March; nummonth=3 ;;
Apr) month=April; nummonth=4 ;;
May) month=May; nummonth=5 ;;
Jun) month=June; nummonth=6 ;;
Jul) month=July; nummonth=7 ;;
Aug) month=August; nummonth=8 ;;
Sep) month=September; nummonth=9 ;;
Oct) month=October; nummonth=10 ;;
Nov) month=November; nummonth=11 ;;
Dec) month=December; nummonth=12 ;;
esac
done
day="$2"
year="$3"
# We finally have to deal with the problem that the "ls" output
# gives either the time of the day or the year.
case $year in
*:*)
this_year=`date '+%Y' 2>/dev/null`
if [ ".$this_year" = . ]; then
this_year=`date '+%y'`
case $this_year in
[5-9][0-9]) this_year="19$this_year" ;;
[0-4][0-9]) this_year="20$this_year" ;;
esac
fi
# for the following months of the last year the time notation
# is usually also used for files modified in the last year.
this_month=`date '+%m'`
if (expr $nummonth \> $this_month) >/dev/null; then
this_year=`expr $this_year - 1`
fi
year="$this_year"
;;
esac
# Optionally fill day and month with leeding zeros
if [ ".$opt_z" = .yes ]; then
case $day in
[0-9][0-9] ) ;;
[0-9] ) day="0$day" ;;
esac
case $nummonth in
[0-9][0-9] ) ;;
[0-9] ) nummonth="0$nummonth" ;;
esac
fi
# Optionally use digits for month
if [ ".$opt_d" = .yes ]; then
month="$nummonth"
fi
# Optionally shorten the month name to three characters
if [ ".$opt_s" = .yes ]; then
month=`echo $month | cut -c1-3`
fi
# Output the resulting date string
echo dummy | awk '{
for (i = 0; i < 3; i++) {
now = substr(order, 1, 1);
order = substr(order, 2);
if (now == "d")
out = day;
else if (now == "m")
out = month;
else if (now == "y")
out = year;
if (i < 2)
printf("%s%s", out, field);
else
printf("%s", out);
}
if (newline != "yes")
printf("\n");
}' "day=$day" "month=$month" "year=$year" \
"field=$opt_f" "order=$opt_o" "newline=$opt_n"
;;
table )
##
## table -- Pretty-print a field-separated list as a table
## Copyright (c) 1998-2002 Ralf S. Engelschall <rse@engelschall.com>
## Originally written for Apache
##
if [ $opt_c -gt 4 ]; then
echo "$msgprefix:Error: Invalid number of colums (1..4 allowed only)" 1>&2
exit 1
fi
case "x$opt_F" in
x? ) ;;
* ) echo "$msgprefix:Error: Invalid separator (one char allowed only)" 1>&2; exit 1 ;;
esac
# split the list into a table
list=`
IFS="$opt_F"
for entry in $*; do
if [ ".$entry" != . ]; then
echo "$entry"
fi
done |\
awk "
BEGIN { list = \"\"; n = 0; }
{
list = list \\$1;
n = n + 1;
if (n < $opt_c) {
list = list \":\";
}
if (n == $opt_c) {
list = list \"\\n\";
n = 0;
}
}
END { print list; }
"
`
# format table cells and make sure table
# doesn't exceed maximum width
OIFS="$IFS"
IFS='
'
for entry in $list; do
case $opt_c in
1 ) eval "echo \"\${entry}\" | awk -F: '{ printf(\"%-${opt_w}s\\n\", \$1); }'" ;;
2 ) eval "echo \"\${entry}\" | awk -F: '{ printf(\"%-${opt_w}s %-${opt_w}s\\n\", \$1, \$2); }'" ;;
3 ) eval "echo \"\${entry}\" | awk -F: '{ printf(\"%-${opt_w}s %-${opt_w}s %-${opt_w}s\\n\", \$1, \$2, \$3); }'" ;;
4 ) eval "echo \"\${entry}\" | awk -F: '{ printf(\"%-${opt_w}s %-${opt_w}s %-${opt_w}s %-${opt_w}s\\n\", \$1, \$2, \$3, \$4); }'" ;;
esac
done |\
awk "{
if (length(\$0) > $opt_s) {
printf(\"%s\\n\", substr(\$0, 0, $opt_s-1));
} else {
print \$0;
}
}"
IFS="$OIFS"
;;
prop )
##
## prop -- Display progress with a running propeller
## Copyright (c) 1998-2002 Ralf S. Engelschall <rse@engelschall.com>
## Originally written for mod_ssl
##
perl=''
for dir in `echo $PATH | sed -e 's/:/ /g'` .; do
if [ -f "$dir/perl" ]; then
perl="$dir/perl"
break
fi
done
if [ ".$perl" != . ]; then
# Perl is preferred because writing to STDERR in
# Perl really writes immediately as one would expect
$perl -e '
@p = ("|","/","-","\\");
$i = 0;
while (<STDIN>) {
printf(STDERR "\r%s...%s\b", $ARGV[0], $p[$i++]);
$i = 0 if ($i > 3);
}
printf(STDERR "\r%s \n", $ARGV[0]);
' "$opt_p"
else
# But if Perl doesn't exists we use Awk even
# some Awk's buffer even the /dev/stderr writing :-(
awk '
BEGIN {
split("|#/#-#\\", p, "#");
i = 1;
}
{
printf("\r%s%c\b", prefix, p[i++]) > "/dev/stderr";
if (i > 4) { i = 1; }
}
END {
printf("\r%s \n", prefix) > "/dev/stderr";
}
' "prefix=$opt_p"
fi
;;
move )
##
## move -- Move files with simultaneous substitution
## Copyright (c) 1999-2002 Ralf S. Engelschall <rse@engelschall.com>
## Originally written for shtool
##
src="$1"
dst="$2"
# consistency checks
if [ ".$src" = . -o ".$dst" = . ]; then
echo "$msgprefix:Error: Invalid arguments" 1>&2
exit 1
fi
if [ ".$src" = ".$dst" ]; then
echo "$msgprefix:Error: Source and destination files are the same" 1>&2
exit 1
fi
expsrc="$src"
if [ ".$opt_e" = .yes ]; then
expsrc="`echo $expsrc`"
fi
if [ ".$opt_e" = .yes ]; then
if [ ".`echo "$src" | sed -e 's;^.*\\*.*$;;'`" = ".$src" ]; then
echo "$msgprefix:Error: Source doesn't contain wildcard ('*'): $dst" 1>&2
exit 1
fi
if [ ".`echo "$dst" | sed -e 's;^.*%[1-9].*$;;'`" = ".$dst" ]; then
echo "$msgprefix:Error: Destination doesn't contain substitution ('%N'): $dst" 1>&2
exit 1
fi
if [ ".$expsrc" = ".$src" ]; then
echo "$msgprefix:Error: Sources not found or no asterisk : $src" 1>&2
exit 1
fi
else
if [ ! -r "$src" ]; then
echo "$msgprefix:Error: Source not found: $src" 1>&2
exit 1
fi
fi
# determine substitution patterns
if [ ".$opt_e" = .yes ]; then
srcpat=`echo "$src" | sed -e 's/\\./\\\\./g' -e 's/;/\\;/g' -e 's;\\*;\\\\(.*\\\\);g'`
dstpat=`echo "$dst" | sed -e 's;%\([1-9]\);\\\\\1;g'`
fi
# iterate over source(s)
for onesrc in $expsrc; do
if [ .$opt_e = .yes ]; then
onedst=`echo $onesrc | sed -e "s;$srcpat;$dstpat;"`
else
onedst="$dst"
fi
errorstatus=0
if [ ".$opt_v" = .yes ]; then
echo "$onesrc -> $onedst"
fi
if [ ".$opt_p" = .yes ]; then
if [ -r $onedst ]; then
if cmp -s $onesrc $onedst; then
if [ ".$opt_t" = .yes ]; then
echo "rm -f $onesrc" 1>&2
fi
rm -f $onesrc || errorstatus=$?
else
if [ ".$opt_t" = .yes ]; then
echo "mv -f $onesrc $onedst" 1>&2
fi
mv -f $onesrc $onedst || errorstatus=$?
fi
else
if [ ".$opt_t" = .yes ]; then
echo "mv -f $onesrc $onedst" 1>&2
fi
mv -f $onesrc $onedst || errorstatus=$?
fi
else
if [ ".$opt_t" = .yes ]; then
echo "mv -f $onesrc $onedst" 1>&2
fi
mv -f $onesrc $onedst || errorstatus=$?
fi
if [ $errorstatus -ne 0 ]; then
break;
fi
done
exit $errorstatus
;;
install )
##
## install -- Install a program, script or datafile
## Copyright (c) 1997-2002 Ralf S. Engelschall <rse@engelschall.com>
## Originally written for shtool
##
# determine source(s) and destination
argc=$#
srcs=""
while [ $# -gt 1 ]; do
srcs="$srcs $1"
shift
done
dstpath="$1"
# type check for destination
dstisdir=0
if [ -d $dstpath ]; then
dstpath=`echo "$dstpath" | sed -e 's:/$::'`
dstisdir=1
fi
# consistency check for destination
if [ $argc -gt 2 -a $dstisdir = 0 ]; then
echo "$msgprefix:Error: multiple sources require destination to be directory" 1>&2
exit 1
fi
# iterate over all source(s)
for src in $srcs; do
dst=$dstpath
# if destination is a directory, append the input filename
if [ $dstisdir = 1 ]; then
dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'`
dst="$dst/$dstfile"
fi
# check for correct arguments
if [ ".$src" = ".$dst" ]; then
echo "$msgprefix:Warning: source and destination are the same - skipped" 1>&2
continue
fi
if [ -d "$src" ]; then
echo "$msgprefix:Warning: source \`$src' is a directory - skipped" 1>&2
continue
fi
# make a temp file name in the destination directory
dsttmp=`echo $dst |\
sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;' \
-e "s;\$;/#INST@$$#;"`
# verbosity
if [ ".$opt_v" = .yes ]; then
echo "$src -> $dst" 1>&2
fi
# copy or move the file name to the temp name
# (because we might be not allowed to change the source)
if [ ".$opt_C" = .yes ]; then
opt_c=yes
fi
if [ ".$opt_c" = .yes ]; then
if [ ".$opt_t" = .yes ]; then
echo "cp $src $dsttmp" 1>&2
fi
cp $src $dsttmp || exit $?
else
if [ ".$opt_t" = .yes ]; then
echo "mv $src $dsttmp" 1>&2
fi
mv $src $dsttmp || exit $?
fi
# adjust the target file
if [ ".$opt_e" != . ]; then
sed='sed'
OIFS="$IFS"; IFS="$ASC_NL"; set -- $opt_e; IFS="$OIFS"
for e
do
sed="$sed -e '$e'"
done
cp $dsttmp $dsttmp.old
eval "$sed <$dsttmp.old >$dsttmp" || exit $?
rm -f $dsttmp.old
fi
if [ ".$opt_s" = .yes ]; then
if [ ".$opt_t" = .yes ]; then
echo "strip $dsttmp" 1>&2
fi
strip $dsttmp || exit $?
fi
if [ ".$opt_o" != . ]; then
if [ ".$opt_t" = .yes ]; then
echo "chown $opt_o $dsttmp" 1>&2
fi
chown $opt_o $dsttmp || exit $?
fi
if [ ".$opt_g" != . ]; then
if [ ".$opt_t" = .yes ]; then
echo "chgrp $opt_g $dsttmp" 1>&2
fi
chgrp $opt_g $dsttmp || exit $?
fi
if [ ".$opt_m" != ".-" ]; then
if [ ".$opt_t" = .yes ]; then
echo "chmod $opt_m $dsttmp" 1>&2
fi
chmod $opt_m $dsttmp || exit $?
fi
# determine whether to do a quick install
# (has to be done _after_ the strip was already done)
quick=no
if [ ".$opt_C" = .yes ]; then
if [ -r $dst ]; then
if cmp -s $src $dst; then
quick=yes
fi
fi
fi
# finally, install the file to the real destination
if [ $quick = yes ]; then
if [ ".$opt_t" = .yes ]; then
echo "rm -f $dsttmp" 1>&2
fi
rm -f $dsttmp
else
if [ ".$opt_t" = .yes ]; then
echo "rm -f $dst && mv $dsttmp $dst" 1>&2
fi
rm -f $dst && mv $dsttmp $dst
fi
done
;;
mkdir )
##
## mkdir -- Make one or more directories
## Copyright (c) 1996-2002 Ralf S. Engelschall <rse@engelschall.com>
## Originally written for public domain by Noah Friedman <friedman@prep.ai.mit.edu>
## Cleaned up and enhanced for shtool
##
errstatus=0
for p in ${1+"$@"}; do
# if the directory already exists...
if [ -d "$p" ]; then
if [ ".$opt_f" = .no -a ".$opt_p" = .no ]; then
echo "$msgprefix:Error: directory already exists: $p" 1>&2
errstatus=1
break
else
continue
fi
fi
# if the directory has to be created...
if [ ".$opt_p" = .no ]; then
if [ ".$opt_t" = .yes ]; then
echo "mkdir $p" 1>&2
fi
mkdir $p || errstatus=$?
if [ ".$opt_m" != . ]; then
if [ ".$opt_t" = .yes ]; then
echo "chmod $opt_m $p" 1>&2
fi
chmod $opt_m $p || errstatus=$?
fi
else
# the smart situation
set fnord `echo ":$p" |\
sed -e 's/^:\//%/' \
-e 's/^://' \
-e 's/\// /g' \
-e 's/^%/\//'`
shift
pathcomp=''
for d in ${1+"$@"}; do
pathcomp="$pathcomp$d"
case "$pathcomp" in
-* ) pathcomp="./$pathcomp" ;;
esac
if [ ! -d "$pathcomp" ]; then
if [ ".$opt_t" = .yes ]; then
echo "mkdir $pathcomp" 1>&2
fi
mkdir $pathcomp || errstatus=$?
if [ ".$opt_m" != . ]; then
if [ ".$opt_t" = .yes ]; then
echo "chmod $opt_m $pathcomp" 1>&2
fi
chmod $opt_m $pathcomp || errstatus=$?
fi
fi
pathcomp="$pathcomp/"
done
fi
done
exit $errstatus
;;
mkln )
##
## mkln -- Make link with calculation of relative paths
## Copyright (c) 1999-2002 Ralf S. Engelschall <rse@engelschall.com>
## Originally written for shtool
##
args=$?
srcs=""
while [ $# -gt 1 ]; do
srcs="$srcs $1"
shift
done
dst="$1"
if [ ! -d $dst ]; then
if [ $args -gt 2 ]; then
echo "$msgprefix:Error: multiple sources not allowed when target isn't a directory" 1>&2
exit 1
fi
fi
# determine link options
lnopt=""
if [ ".$opt_f" = .yes ]; then
lnopt="$lnopt -f"
fi
if [ ".$opt_s" = .yes ]; then
lnopt="$lnopt -s"
fi
# iterate over sources
for src in $srcs; do
# determine if one of the paths is an absolute path,
# because then we _have_ to use an absolute symlink
oneisabs=0
srcisabs=0
dstisabs=0
case $src in
/* ) oneisabs=1; srcisabs=1 ;;
esac
case $dst in
/* ) oneisabs=1; dstisabs=1 ;;
esac
# split source and destination into dir and base name
if [ -d $src ]; then
srcdir=`echo $src | sed -e 's;/*$;;'`
srcbase=""
else
srcdir=`echo $src | sed -e 's;^[^/]*$;;' -e 's;^\(.*/\)[^/]*$;\1;' -e 's;\(.\)/$;\1;'`
srcbase=`echo $src | sed -e 's;.*/\([^/]*\)$;\1;'`
fi
if [ -d $dst ]; then
dstdir=`echo $dst | sed -e 's;/*$;;'`
dstbase=""
else
dstdir=`echo $dst | sed -e 's;^[^/]*$;;' -e 's;^\(.*/\)[^/]*$;\1;' -e 's;\(.\)/$;\1;'`
dstbase=`echo $dst | sed -e 's;.*/\([^/]*\)$;\1;'`
fi
# consistency check
if [ ".$dstdir" != . ]; then
if [ ! -d $dstdir ]; then
echo "$msgprefix:Error: destination directory not found: $dstdir" 1>&2
exit 1
fi
fi
# make sure the source is reachable from the destination
if [ $dstisabs = 1 ]; then
if [ $srcisabs = 0 ]; then
if [ -d $srcdir ]; then
srcdir="`cd $srcdir; pwd | sed -e 's;/*$;;'`"
srcisabs=1
oneisabs=1
fi
fi
fi
# split away a common prefix
prefix=""
if [ ".$srcdir" = ".$dstdir" -a ".$srcdir" != . ]; then
prefix="$srcdir/"
srcdir=""
dstdir=""
else
while [ ".$srcdir" != . -a ".$dstdir" != . ]; do
presrc=`echo $srcdir | sed -e 's;^\([^/]*\)/.*;\1;'`
predst=`echo $dstdir | sed -e 's;^\([^/]*\)/.*;\1;'`
if [ ".$presrc" != ".$predst" ]; then
break
fi
prefix="$prefix$presrc/"
srcdir=`echo $srcdir | sed -e 's;^[^/]*/*;;'`
dstdir=`echo $dstdir | sed -e 's;^[^/]*/*;;'`
done
fi
# destination prefix is just the common prefix
dstpre="$prefix"
# determine source prefix which is the reverse directory
# step-up corresponding to the destination directory
srcpre=""
if [ $oneisabs = 0 ] || [ ".$prefix" != . -a ".$prefix" != ./ ]; then
pl="$dstdir/"
OIFS="$IFS"; IFS='/'
for pe in $pl; do
[ ".$pe" = . ] && continue
srcpre="../$srcpre"
done
IFS="$OIFS"
else
if [ $srcisabs = 1 ]; then
srcpre="$prefix"
fi
fi
# determine destination symlink name
if [ ".$dstbase" = . ]; then
if [ ".$srcbase" != . ]; then
dstbase="$srcbase"
else
dstbase=`echo "$prefix$srcdir" | sed -e 's;/*$;;' -e 's;.*/\([^/]*\)$;\1;'`
fi
fi
# now finalize source and destination directory paths
srcdir=`echo $srcdir | sed -e 's;\([^/]\)$;\1/;'`
dstdir=`echo $dstdir | sed -e 's;\([^/]\)$;\1/;'`
# run the final link command
if [ ".$opt_t" = .yes ]; then
echo "ln$lnopt $srcpre$srcdir$srcbase $dstpre$dstdir$dstbase"
fi
eval ln$lnopt $srcpre$srcdir$srcbase $dstpre$dstdir$dstbase
done
;;
mkshadow )
##
## mkshadow -- Make a shadow tree through symbolic links
## Copyright (c) 1998-2002 Ralf S. Engelschall <rse@engelschall.com>
## Originally written for Apache
##
# source and destination directory
src=`echo "$1" | sed -e 's:/$::' -e 's:^\./\(.\):\1:'`
dst=`echo "$2" | sed -e 's:/$::' -e 's:^\./\(.\):\1:'`
# check whether source exists
if [ ! -d $src ]; then
echo "$msgprefix:Error: source directory not found: \`$src'" 1>&2
exit 1
fi
# determine if one of the paths is an absolute path,
# because then we have to use an absolute symlink
oneisabs=0
case $src in
/* ) oneisabs=1 ;;
esac
case $dst in
/* ) oneisabs=1 ;;
esac
# determine reverse directory for destination directory
dstrevdir=''
if [ $oneisabs = 0 ]; then
# derive reverse path from forward path
pwd=`pwd`
OIFS="$IFS"; IFS='/'
for pe in $dst; do
if [ "x$pe" = "x.." ]; then
OIFS2="$IFS"; IFS="$DIFS"
eval `echo "$pwd" |\
sed -e 's:\([^/]*\)$:; dir="\1":' \
-e 's:^\(.*\)/[^/]*;:pwd="\1";:'\
-e 's:^;:pwd="";:'`
dstrevdir="$dir/$dstrevdir"
IFS="$OIFS2"
else
dstrevdir="../$dstrevdir"
fi
done
IFS="$OIFS"
else
src="`cd $src; pwd`";
fi
# create directory tree at destination
if [ ! -d $dst ]; then
if [ ".$opt_t" = .yes ]; then
echo "mkdir $dst" 1>&2
fi
mkdir $dst
fi
if [ ".$opt_a" = .yes ]; then
DIRS=`cd $src; find . -type d -print |\
sed -e '/^\.$/d' -e 's:^\./::'`
else
DIRS=`cd $src; find . -type d -print |\
sed -e '/\/CVS/d' -e '/^\.$/d' -e 's:^\./::'`
fi
for dir in $DIRS; do
if [ ".$opt_t" = .yes ]; then
echo "mkdir $dst/$dir" 1>&2
fi
mkdir $dst/$dir
done
# fill directory tree with symlinks to files
if [ ".$opt_a" = .yes ]; then
FILES="`cd $src; find . -depth -print |\
sed -e 's/^\.\///'`"
else
FILES="`cd $src; find . -depth -print |\
sed -e '/\.o$/d' -e '/\.a$/d' -e '/\.so$/d' \
-e '/\.cvsignore$/d' -e '/\/CVS/d' \
-e '/\/\.#/d' -e '/\.orig$/d' \
-e 's/^\.\///'`"
fi
for file in $FILES; do
# don't use `-type f' above for find because of symlinks
if [ -d "$src/$file" ]; then
continue
fi
basename=`echo $file | sed -e 's:^.*/::'`
dir=`echo $file | sed -e 's:[^/]*$::' -e 's:/$::' -e 's:$:/:' -e 's:^/$::'`
from=`echo "$src/$file" | sed -e 's/^\.\///'`
to="$dst/$dir$basename"
if [ $oneisabs = 0 ]; then
if [ ".$dir" != . ]; then
subdir=`echo $dir | sed -e 's:/$::'`
# derive reverse path from forward path
revdir=''
OIFS="$IFS"; IFS='/'
for pe in $subdir; do
revdir="../$revdir"
done
IFS="$OIFS"
# finalize from
from="$revdir$from"
fi
from="$dstrevdir$from"
fi
if [ ".$opt_v" = .yes ]; then
echo " $to" 1>&2
fi
if [ ".$opt_t" = .yes ]; then
echo "ln -s $from $to" 1>&2
fi
ln -s $from $to
done
;;
fixperm )
##
## fixperm -- Fix file permissions inside a source tree
## Copyright (c) 1996-2002 Ralf S. Engelschall <rse@engelschall.com>
## Originally written for ePerl
##
paths="$*"
# check whether the test command supports the -x option
if [ -x /bin/sh ] 2>/dev/null; then
minusx="-x"
else
minusx="-r"
fi
# iterate over paths
for p in $paths; do
for file in `find $p -depth -print`; do
if [ -f $file ]; then
if [ $minusx $file ]; then
if [ ".$opt_v" = .yes ]; then
echo "-rwxrwxr-x $file" 2>&1
fi
if [ ".$opt_t" = .yes ]; then
echo "chmod 775 $file" 2>&1
fi
chmod 775 $file
else
if [ ".$opt_v" = .yes ]; then
echo "-rw-rw-r-- $file" 2>&1
fi
if [ ".$opt_t" = .yes ]; then
echo "chmod 664 $file" 2>&1
fi
chmod 664 $file
fi
continue
fi
if [ -d $file ]; then
if [ ".$opt_v" = .yes ]; then
echo "drwxrwxr-x $file" 2>&1
fi
if [ ".$opt_t" = .yes ]; then
echo "chmod 775 $file" 2>&1
fi
chmod 775 $file
continue
fi
if [ ".$opt_v" = .yes ]; then
echo "?????????? $file" 2>&1
fi
done
done
;;
rotate )
##
## rotate -- Logfile rotation
## Copyright (c) 2001-2002 Ralf S. Engelschall <rse@engelschall.com>
## Originally written for use in OpenPKG
##
# make sure we have at least one file to rotate
if [ ".$opt_n" = .0 ]; then
echo "$msgprefix:Error: invalid argument \`$opt_n' to option -n." 1>&2
exit 1
fi
# canonicalize -s option argument
if [ ".$opt_s" != . ]; then
if [ ".`expr $opt_s : '[0-9]*$'`" != .0 ]; then
:
elif [ ".`expr $opt_s : '[0-9]*[Kk]$'`" != .0 ]; then
opt_s=`expr $opt_s : '\([0-9]*\)[Kk]$'`
opt_s=`expr $opt_s \* 1024`
elif [ ".`expr $opt_s : '[0-9]*[Mm]$'`" != .0 ]; then
opt_s=`expr $opt_s : '\([0-9]*\)[Mm]$'`
opt_s=`expr $opt_s \* 1048576` # 1024*1024
elif [ ".`expr $opt_s : '[0-9]*[Gg]$'`" != .0 ]; then
opt_s=`expr $opt_s : '\([0-9]*\)[Gg]$'`
opt_s=`expr $opt_s \* 1073741824` # 1024*1024*1024
else
echo "$msgprefix:Error: invalid argument \`$opt_s' to option -s." 1>&2
exit 1
fi
fi
# option -d/-z consistency
if [ ".$opt_d" = .yes -a ".$opt_z" = . ]; then
echo "$msgprefix:Error: option -d requires option -z." 1>&2
exit 1
fi
# make sure target directory exists
if [ ".$opt_a" != . ]; then
if [ ! -d $opt_a ]; then
if [ ".$opt_f" = .no ]; then
echo "$msgprefix:Error: archive directory \`$opt_a' does not exist." 1>&2
exit 1
fi
mkdir $opt_a || exit $?
chmod 755 $opt_a
fi
if [ ! -w $opt_a ]; then
echo "$msgprefix:Error: archive directory \`$opt_a' not writable." 1>&2
exit 1
fi
fi
# determine compression approach
if [ ".$opt_z" != . ]; then
comp_lvl="$opt_z"
comp_prg=""
case $comp_lvl in
*:* ) eval `echo $comp_lvl |\
sed -e 's%^\(.*\):\(.*\)$%comp_prg="\1"; comp_lvl="\2"%'` ;;
esac
# compression level consistency
case $comp_lvl in
[0-9] )
;;
* ) echo "$msgprefix:Error: invalid compression level \`$comp_lvl'" 1>&2
exit 1
;;
esac
# determine a suitable compression tool
if [ ".$comp_prg" = . ]; then
# check whether the test command supports the -x option
if [ -x /bin/sh ] 2>/dev/null; then
minusx="-x"
else
minusx="-r"
fi
# search for tools in $PATH
paths="`echo $PATH |\
sed -e 's%/*:%:%g' -e 's%/*$%%' \
-e 's/^:/.:/' -e 's/::/:.:/g' -e 's/:$/:./' \
-e 's/:/ /g'`"
for prg in bzip2 gzip compress; do
for path in $paths; do
if [ $minusx "$path/$prg" -a ! -d "$path/$prg" ]; then
comp_prg="$prg"
break
fi
done
if [ ".$comp_prg" != . ]; then
break
fi
done
if [ ".$comp_prg" = . ]; then
echo "$msgprefix:Error: no suitable compression tool found in \$PATH" 1>&2
exit 1
fi
fi
# determine standard compression extension
# and make sure it is a known tool
case $comp_prg in
*/bzip2 | bzip2 ) comp_ext="bz2" comp_lvl="-$comp_lvl" ;;
*/gzip | gzip ) comp_ext="gz" comp_lvl="-$comp_lvl" ;;
*/compress | compress ) comp_ext="Z"; comp_lvl="" ;;
* ) echo "$msgprefix:Error: tool \`$comp_prg' is not a known compression tool" 1>&2
exit 1
;;
esac
comp_suf=".$comp_ext"
fi
# iterate over all given logfile arguments
for file in $*; do
# make sure the logfile exists
if [ ! -f $file ]; then
if [ ".$opt_f" = .yes ]; then
continue
fi
echo "$msgprefix:Error: logfile \`$file' not found" 1>&2
exit 1
fi
# determine log directory (where original logfile is placed)
ldir="."
case $file in
*/* ) eval `echo $file | sed -e 's%^\(.*\)/\([^/]*\)$%ldir="\1"; file="\2";%'` ;;
esac
# determine archive directory (where rotated logfiles are placed)
adir="$ldir"
if [ ".$opt_a" != . ]; then
case "$opt_a" in
/* | ./* ) adir="$opt_a" ;;
* ) adir="$ldir/$opt_a" ;;
esac
fi
# optionally take logfile size into account
if [ ".$opt_s" != . ]; then
# determine size of logfile
set -- `ls -l $ldir/$file | sed -e 's; -> .*$;;' -e 's;[ ][ ]*; ;g'`
n=`expr $# - 4`
eval "size=\`echo \${$n}\`"
# skip logfile if size is still too small
if [ $size -lt $opt_s ]; then
if [ ".$opt_v" = .yes ]; then
echo "$ldir/$file: still too small in size -- skipping"
fi
continue
fi
fi
# verbosity
if [ ".$opt_v" = .yes ]; then
echo "rotating $ldir/$file"
fi
# execute prolog
if [ ".$opt_P" != . ]; then
if [ ".$opt_t" = .yes ]; then
echo "$opt_P"
fi
eval $opt_P
[ $? -ne 0 ] && exit $?
fi
# kick away out-rotated logfile
n=`expr $opt_n - 1`
n=`echo dummy | awk "{ printf(\"%0${opt_p}d\", n); }" n=$n`
if [ -f "${adir}/${file}.${n}${comp_suf}" ]; then
# optionally migrate away the out-rotated logfile
if [ ".$opt_M" != . ]; then
if [ ".$opt_t" = .yes ]; then
echo "$opt_M ${adir}/${file}.${n}${comp_suf}"
fi
eval "$opt_M ${adir}/${file}.${n}${comp_suf}"
[ $? -ne 0 ] && exit $?
fi
# finally get rid of the out-rotated logfile
if [ ".$opt_t" = .yes ]; then
echo "rm -f ${adir}/${file}.${n}${comp_suf}"
fi
rm -f ${adir}/${file}.${n}${comp_suf} || exit $?
fi
# rotate already archived logfiles
while [ $n -gt 0 ]; do
m=$n
n=`expr $n - 1`
n=`echo dummy | awk "{ printf(\"%0${opt_p}d\", n); }" n=$n`
if [ $n -eq 0 -a ".$opt_d" = .yes ]; then
# special case: first rotation file under delayed compression situation
if [ ! -f "${adir}/${file}.${n}" ]; then
continue
fi
# compress file (delayed)
if [ ".$opt_b" = .yes ]; then
if [ ".$opt_t" = .yes ]; then
echo "mv ${adir}/${file}.${n} ${adir}/${file}.${m}"
fi
mv ${adir}/${file}.${n} ${adir}/${file}.${m} || exit $?
if [ ".$opt_t" = .yes ]; then
echo "(${comp_prg} ${comp_lvl} <${adir}/${file}.${m} >${adir}/${file}.${m}${comp_suf}; rm -f ${adir}/${file}.${m}) &"
fi
( ${comp_prg} ${comp_lvl} \
<${adir}/${file}.${m} \
>${adir}/${file}.${m}${comp_suf} || exit $?
rm -f ${adir}/${file}.${m} || exit $?
) </dev/null >/dev/null 2>&1 &
else
if [ ".$opt_t" = .yes ]; then
echo "${comp_prg} ${comp_lvl} <${adir}/${file}.${n} >${adir}/${file}.${m}${comp_suf}"
fi
${comp_prg} ${comp_lvl} \
<${adir}/${file}.${n} \
>${adir}/${file}.${m}${comp_suf} || exit $?
if [ ".$opt_t" = .yes ]; then
echo "rm -f ${adir}/${file}.${n}"
fi
rm -f ${adir}/${file}.${n} || exit $?
fi
# fix file attributes
if [ ".$opt_o" != . ]; then
if [ ".$opt_t" = .yes ]; then
echo "chown $opt_o ${adir}/${file}.${m}${comp_suf}"
fi
chown $opt_o ${adir}/${file}.${m}${comp_suf} || exit $?
fi
if [ ".$opt_g" != . ]; then
if [ ".$opt_t" = .yes ]; then
echo "chgrp $opt_g ${adir}/${file}.${m}${comp_suf}"
fi
chgrp $opt_g ${adir}/${file}.${m}${comp_suf} || exit $?
fi
if [ ".$opt_m" != . ]; then
if [ ".$opt_t" = .yes ]; then
echo "chmod $opt_m ${adir}/${file}.${m}${comp_suf}"
fi
chmod $opt_m ${adir}/${file}.${m}${comp_suf} || exit $?
fi
else
# standard case: second and following rotation file
if [ ! -f "${adir}/${file}.${n}${comp_suf}" ]; then
continue
fi
if [ ".$opt_t" = .yes ]; then
echo "mv ${adir}/${file}.${n}${comp_suf} ${adir}/${file}.${m}${comp_suf}"
fi
mv ${adir}/${file}.${n}${comp_suf} ${adir}/${file}.${m}${comp_suf} || exit $?
fi
done
# move away current logfile
if [ ".$opt_c" = .yes ]; then
# approach: copy[+truncate]
if [ ".$opt_t" = .yes ]; then
echo "cp -p ${ldir}/${file} ${adir}/${file}.${n}"
fi
cp -p ${ldir}/${file} ${adir}/${file}.${n} || exit $?
if [ ".$opt_r" = .no ]; then
if [ ".$opt_t" = .yes ]; then
echo "cp /dev/null ${ldir}/${file}"
fi
cp /dev/null ${ldir}/${file} || exit $?
fi
else
# approach: move[+touch]
if [ ".$opt_t" = .yes ]; then
echo "mv ${ldir}/${file} ${adir}/${file}.${n}"
fi
mv ${ldir}/${file} ${adir}/${file}.${n} || exit $?
if [ ".$opt_r" = .no ]; then
if [ ".$opt_t" = .yes ]; then
echo "touch ${ldir}/${file}"
fi
touch ${ldir}/${file} || exit $?
# fix file attributes
if [ ".$opt_o" != . ]; then
if [ ".$opt_t" = .yes ]; then
echo "chown $opt_o ${ldir}/${file}"
fi
chown $opt_o ${ldir}/${file} || exit $?
fi
if [ ".$opt_g" != . ]; then
if [ ".$opt_t" = .yes ]; then
echo "chgrp $opt_g ${ldir}/${file}"
fi
chgrp $opt_g ${ldir}/${file} || exit $?
fi
if [ ".$opt_m" != . ]; then
if [ ".$opt_t" = .yes ]; then
echo "chmod $opt_m ${ldir}/${file}"
fi
chmod $opt_m ${ldir}/${file} || exit $?
fi
fi
fi
# regular compression step
if [ ".$opt_z" != . -a ".$opt_d" = .no ]; then
# compress file
if [ ".$opt_b" = .yes ]; then
if [ ".$opt_t" = .yes ]; then
echo "(${comp_prg} ${comp_lvl} <${adir}/${file}.${n} >${adir}/${file}.${n}${comp_suf}; rm -f ${adir}/${file}.${n}) &"
fi
( ${comp_prg} ${comp_lvl} \
<${adir}/${file}.${n} \
>${adir}/${file}.${n}${comp_suf} || exit $?
rm -f ${adir}/${file}.${n} || exit $?
) </dev/null >/dev/null 2>&1 &
else
if [ ".$opt_t" = .yes ]; then
echo "${comp_prg} ${comp_lvl} <${adir}/${file}.${n} >${adir}/${file}.${n}${comp_suf}"
fi
${comp_prg} ${comp_lvl} \
<${adir}/${file}.${n} \
>${adir}/${file}.${n}${comp_suf} || exit $?
if [ ".$opt_t" = .yes ]; then
echo "rm -f ${opt_a}${file}.${n}"
fi
rm -f ${adir}/${file}.${n} || exit $?
fi
# fix file attributes
if [ ".$opt_o" != . ]; then
if [ ".$opt_t" = .yes ]; then
echo "chown $opt_o ${adir}/${file}.${n}${comp_suf}"
fi
chown $opt_o ${adir}/${file}.${n}${comp_suf} || exit $?
fi
if [ ".$opt_g" != . ]; then
if [ ".$opt_t" = .yes ]; then
echo "chgrp $opt_g ${adir}/${file}.${n}${comp_suf}"
fi
chgrp $opt_g ${adir}/${file}.${n}${comp_suf} || exit $?
fi
if [ ".$opt_m" != . ]; then
if [ ".$opt_t" = .yes ]; then
echo "chmod $opt_m ${adir}/${file}.${n}${comp_suf}"
fi
chmod $opt_m ${adir}/${file}.${n}${comp_suf} || exit $?
fi
fi
# execute epilog
if [ ".$opt_E" != . ]; then
if [ ".$opt_t" = .yes ]; then
echo "$opt_E"
fi
eval $opt_E
[ $? -ne 0 ] && exit $?
fi
done
;;
tarball )
##
## tarball -- Roll distribution tarballs
## Copyright (c) 1999-2002 Ralf S. Engelschall <rse@engelschall.com>
## Originally written for shtool
##
srcs="$*"
# check whether the test command supports the -x option
if [ -x /bin/sh ] 2>/dev/null; then
minusx="-x"
else
minusx="-r"
fi
# find the tools
paths="`echo $PATH |\
sed -e 's%/*:%:%g' -e 's%/*$%%' \
-e 's/^:/.:/' -e 's/::/:.:/g' -e 's/:$/:./' \
-e 's/:/ /g'`"
for spec in find:gfind,find tar:gtar,tar tardy:tardy,tarcust; do
prg=`echo $spec | sed -e 's/:.*$//'`
tools=`echo $spec | sed -e 's/^.*://'`
eval "prg_${prg}=''"
# iterate over tools
for tool in `echo $tools | sed -e 's/,/ /g'`; do
# iterate over paths
for path in $paths; do
if [ $minusx "$path/$tool" -a ! -d "$path/$tool" ]; then
eval "prg_${prg}=\"$path/$tool\""
break
fi
done
eval "val=\$prg_${prg}"
if [ ".$val" != . ]; then
break
fi
done
done
# expand source paths
exclude=''
for pat in `echo $opt_e | sed 's/,/ /g'`; do
exclude="$exclude | grep -v '$pat'"
done
if [ ".$opt_t" = .yes ]; then
echo "cp /dev/null $tmpfile.lst" 1>&2
fi
cp /dev/null $tmpfile.lst
for src in $srcs; do
if [ -d $src ]; then
if [ ".$opt_t" = .yes ]; then
echo "(cd $src && $prg_find . -type f -depth -print) | sed -e 's:^\\.\$::' -e 's:^\\./::' | cat $exclude >>$tmpfile.lst" 1>&2
fi
(cd $src && $prg_find . -type f -depth -print) |\
sed -e 's:^\.$::' -e 's:^\./::' | eval cat $exclude >>$tmpfile.lst
else
if [ ".$opt_t" = .yes ]; then
echo "echo $src >>$tmpfile.lst" 1>&2
fi
echo $src >>$tmpfile.lst
fi
done
sort <$tmpfile.lst >$tmpfile.lst.n
mv $tmpfile.lst.n $tmpfile.lst
if [ ".$opt_v" = .yes ]; then
cat $tmpfile.lst | sed -e 's/^/ /' 1>&2
fi
# determine tarball file and directory name
if [ ".$opt_o" != . ]; then
tarfile="$opt_o"
if [ ".$opt_d" != . ]; then
tarname="$opt_d"
else
tarname=`echo $tarfile | sed -e 's/\.tar.*$//' -e 's;.*/\([^/]*\)$;\1;'`
fi
else
if [ ".$opt_d" != . ]; then
tarname="$opt_d"
elif [ -d "$from" ]; then
tarname=`echo $from | sed -e 's;.*/\([^/]*\)$;\1;'`
else
tarname="out"
fi
tarfile="$tarname.tar"
fi
# roll the tarball
compress=''
if [ ".$opt_c" != . ]; then
compress="| $opt_c"
fi
if [ ".$prg_tardy" != . ]; then
# the elegant hackers way
tardy_opt="--prefix=$tarname"
tardy_opt="$tardy_opt --user_number=0 --group_number=0" # security!
if [ ".$opt_u" != . ]; then
tardy_opt="$tardy_opt --user_name=$opt_u"
fi
if [ ".$opt_g" != . ]; then
tardy_opt="$tardy_opt --group_name=$opt_g"
fi
if [ ".$opt_t" = .yes ]; then
echo "cat $tmpfile.lst | xargs $prg_tar cf - | $prg_tardy $tardy_opt | cat $compress >$tmpfile.out" 1>&2
fi
cat $tmpfile.lst |\
xargs $prg_tar cf - |\
$prg_tardy $tardy_opt |\
eval cat $compress >$tmpfile.out
if [ ".$opt_t" = .yes ]; then
echo "cp $tmpfile.out $tarfile" 1>&2
fi
cp $tmpfile.out $tarfile
else
# the portable standard way
if [ ".$opt_t" = .yes ]; then
echo "mkdir $tmpdir/$tarname" 1>&2
fi
mkdir $tmpdir/$tarname || exit 1
if [ ".$opt_t" = .yes ]; then
echo "cat $tmpfile.lst | xargs $prg_tar cf - | (cd $tmpdir/$tarname && $prg_tar xf -)" 1>&2
fi
cat $tmpfile.lst |\
xargs $prg_tar cf - |\
(cd $tmpdir/$tarname && $prg_tar xf -)
if [ ".$opt_u" != . ]; then
if [ ".$opt_t" = .yes ]; then
echo "chown -R $opt_u $tmpdir/$tarname >/dev/null 2>&1" 2>&1
fi
chown -R $opt_u $tmpdir/$tarname >/dev/null 2>&1 ||\
echo "$msgprefix:Warning: cannot set user name \`$opt_u' (would require root priviledges)"
fi
if [ ".$opt_g" != . ]; then
if [ ".$opt_t" = .yes ]; then
echo "chgrp -R $opt_g $tmpdir/$tarname >/dev/null 2>&1" 2>&1
fi
chgrp -R $opt_g $tmpdir/$tarname >/dev/null 2>&1 ||\
echo "$msgprefix:Warning: cannot set group name \`$opt_g' (would require root priviledges)"
fi
if [ ".$opt_t" = .yes ]; then
echo "(cd $tmpdir && $prg_find $tarname -type f -depth -print | sort | xargs $prg_tar cf -) | cat $compress >$tmpfile.out" 1>&2
fi
(cd $tmpdir && $prg_find $tarname -type f -depth -print | sort | xargs $prg_tar cf -) |\
eval cat $compress >$tmpfile.out
if [ ".$opt_t" = .yes ]; then
echo "cp $tmpfile.out $tarfile" 1>&2
fi
cp $tmpfile.out $tarfile
if [ ".$opt_t" = .yes ]; then
echo "rm -rf $tmpdir/$tarname" 1>&2
fi
rm -rf $tmpdir/$tarname
fi
# cleanup
if [ ".$opt_t" = .yes ]; then
echo "rm -f $tmpfile.lst $tmpfile.out" 1>&2
fi
rm -f $tmpfile.lst $tmpfile.out
;;
subst )
##
## subst -- Apply sed(1) substitution operations
## Copyright (c) 2001-2002 Ralf S. Engelschall <rse@engelschall.com>
## Originally written for OpenPKG's rpmtool
##
# remember optional list of file(s)
files="$*"
# parameter consistency check
if [ $# -eq 0 -a ".$opt_b" != . ]; then
echo "$msgprefix:Error: option -b cannot be applied to stdin" 1>&2
exit 1
fi
if [ $# -eq 0 -a ".$opt_s" = .yes ]; then
echo "$msgprefix:Error: option -s cannot be applied to stdin" 1>&2
exit 1
fi
# build underlying sed(1) command
sedcmd='sed'
if [ ".$opt_e" != . ]; then
OIFS="$IFS"; IFS="$ASC_NL"; set -- $opt_e; IFS="$OIFS"
for e
do
sedcmd="$sedcmd -e '$e'"
done
elif [ ".$opt_f" != . ]; then
if [ ! -f $opt_f ]; then
echo "$msgprefix:Error: command file \`$opt_f' not found or not a regular file" 1>&2
exit 1
fi
sedcmd="$sedcmd -f '$opt_f'"
else
echo "$msgprefix:Error: either -e option(s) or -f option required" 1>&2
exit 1
fi
# determine extension for original file
orig=".orig"
if [ ".$opt_b" != . ]; then
orig="$opt_b"
fi
# apply sed(1) operation(s)
if [ ".$files" != . ]; then
# apply operation(s) to files
for file in $files; do
test ".$file" = . && continue
if [ ! -f $file ]; then
echo "$msgprefix:Warning: file \`$file' not found or not a regular file" 1>&2
continue
fi
# handle interactive mode
if [ ".$opt_i" = .yes ]; then
eval "$sedcmd <$file >$file.new"
skip=no
if cmp $file $file.new >/dev/null 2>&1; then
rm -f $file.new
skip=yes
else
(diff -u1 $file $file.new >$tmpfile) 2>/dev/null
if [ ".`cat $tmpfile`" = . ]; then
(diff -C1 $file $file.new >$tmpfile) 2>/dev/null
if [ ".`cat $tmpfile`" = . ]; then
echo "$msgprefix:Warning: unable to show difference for file \`$file'" 1>&2
cp /dev/null $tmpfile
fi
fi
rm -f $file.new
cat $tmpfile
echo dummy | awk '{ printf("%s", TEXT); }' TEXT=">>> Apply [Y/n]: "
read input
if [ ".$input" != .Y ] &&\
[ ".$input" != .y ] &&\
[ ".$input" != . ]; then
skip=yes
fi
fi
if [ ".$skip" = .yes ]; then
if [ ".$opt_v" = .yes ]; then
echo "file \`$file' -- skipped" 1>&2
fi
continue
fi
fi
# apply sed(1) operation(s)
if [ ".$opt_v" = .yes ]; then
echo "patching \`$file'" 1>&2
fi
if [ ".$opt_t" = .yes ]; then
echo "\$ cp -p $file $file$orig"
echo "\$ $sedcmd <$file$orig >$file"
fi
if [ ".$opt_n" = .no ]; then
cp -p $file $file$orig
eval "$sedcmd <$file$orig >$file"
fi
# optionally fix timestamp
if [ ".$opt_s" = .yes ]; then
if [ ".$opt_t" = .yes ]; then
echo "\$ touch -r $file$orig $file"
fi
if [ ".$opt_n" = .no ]; then
touch -r $file$orig $file
fi
fi
# optionally remove preserved original file
if [ ".$opt_b" = . ]; then
if [ ".$opt_t" = .yes ]; then
echo "\$ rm -f $file$orig"
fi
if [ ".$opt_n" = .no ]; then
rm -f $file$orig
fi
fi
done
else
# apply operation(s) to stdin/stdout
if [ ".$opt_v" = .yes ]; then
echo "patching <stdin>" 1>&2
fi
if [ ".$opt_t" = .yes ]; then
echo "\$ $sedcmd"
fi
if [ ".$opt_n" = .no ]; then
eval "$sedcmd"
fi
fi
;;
guessos )
##
## guessos -- Simple operating system guesser
## Copyright (c) 1996-1999 The Apache Group, http://www.apache.org/
## The Apache license applies (see http://www.apache.org/docs/LICENSE)
## Originally written for Apache
##
MACHINE=`(uname -m) 2>/dev/null` || MACHINE=`(uname -p) 2>/dev/null` || MACHINE="unknown"
RELEASE=`(uname -r) 2>/dev/null` || RELEASE="unknown"
SYSTEM=`(uname -s) 2>/dev/null` || SYSTEM="unknown"
VERSION=`(uname -v) 2>/dev/null` || VERSION="unknown"
XREL=`(uname -X) 2>/dev/null | grep "^Release" | awk '{print $3}'`
if [ "x$XREL" != "x" ]; then
if [ -f /etc/kconfig ]; then
case "$XREL" in
4.0|4.1) echo "${MACHINE}-whatever-isc4"; exit 0 ;;
esac
else
case "$XREL" in
3.2v4.2)
echo "whatever-whatever-sco3"; exit 0
;;
3.2v5.0*)
echo "whatever-whatever-sco5"; exit 0
;;
4.2MP)
if [ "x$VERSION" = "x2.1.1" ]; then
echo "${MACHINE}-whatever-unixware211"; exit 0
elif [ "x$VERSION" = "x2.1.2" ]; then
echo "${MACHINE}-whatever-unixware212"; exit 0
else
echo "${MACHINE}-whatever-unixware2"; exit 0
fi
;;
4.2)
echo "whatever-whatever-unixware1"; exit 0
;;
5)
case "$VERSION" in
7*) echo "${MACHINE}-whatever-unixware7"; exit 0 ;;
esac
;;
esac
fi
fi
case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
MiNT:*)
echo "m68k-atari-mint"; exit 0
;;
A/UX:*)
echo "m68k-apple-aux3"; exit 0
;;
AIX:*)
MACH=`echo $MACHINE | sed -e 's;[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F];;'`
echo "${MACH}-ibm-aix${VERSION}.${RELEASE}"; exit 0
;;
dgux:*)
echo "${MACHINE}-dg-dgux"; exit 0
;;
HI-UX:*)
echo "${MACHINE}-hi-hiux"; exit 0
;;
HP-UX:*)
HPUXVER=`echo ${RELEASE}|sed -e 's/[^.]*.[0B]*//'`
MACHINE=`echo ${MACHINE}|sed -e 's:/:_:'`
echo "${MACHINE}-hp-hpux${HPUXVER}"; exit 0
;;
IRIX:*)
if [ -f /usr/lib32/mips4/libm.so ]; then
echo "${MACHINE}/32-sgi-irix${RELEASE}"; exit 0
else
echo "${MACHINE}-sgi-irix${RELEASE}"; exit 0
fi
;;
IRIX64:*)
echo "${MACHINE}/64-sgi-irix${RELEASE}"; exit 0
;;
Linux:*)
V='whatever'
case "$MACHINE" in
i?86) V='pc' ;;
esac
R=''
case "$RELEASE" in
[1-9].*) R=`echo $RELEASE | cut -c1` ;;
esac
echo "${MACHINE}-${V}-linux-gnu${R}"; exit 0
;;
LynxOS:*)
echo "${MACHINE}-lynx-lynxos"; exit 0
;;
BSD/386|BSD/OS:3.*)
echo "${MACHINE}-whatever-bsdi3"; exit 0
;;
BSD/386:*:*:*486*|BSD/OS:*:*:*:*486*)
echo "i486-whatever-bsdi"; exit 0
;;
BSD/386:*|BSD/OS:*)
echo "${MACHINE}-whatever-bsdi"; exit 0
;;
FreeBSD:*)
VERS=`echo ${RELEASE} | sed -e 's/[-(].*//'`
MACH=`/sbin/sysctl -n hw.model`
ARCH='whatever'
case ${MACH} in
*386* ) MACH="i386" ;;
*486* ) MACH="i486" ;;
Pentium\ II*) MACH="i686" ;;
Pentium* ) MACH="i586" ;;
Alpha* ) MACH="alpha" ;;
* ) MACH="$MACHINE" ;;
esac
case ${MACH} in
i[0-9]86 ) ARCH="pc" ;;
esac
echo "${MACH}-${ARCH}-freebsd${VERS}"; exit 0
;;
NetBSD:*:*:*486*)
echo "i486-whatever-netbsd${RELEASE}"; exit 0
;;
NetBSD:*)
echo "${MACHINE}-whatever-netbsd${RELEASE}"; exit 0
;;
OpenBSD:*)
echo "${MACHINE}-whatever-openbsd"; exit 0
;;
OSF1:*:*:*alpha*)
VERS=`echo $RELEASE | sed -e 's;^V;;'`
echo "${MACHINE}-dec-osf${VERS}"; exit 0
;;
QNX:*)
if [ "$VERSION" -gt 422 ]; then
echo "${MACHINE}-qssl-qnx32"
else
echo "${MACHINE}-qssl-qnx"
fi
exit 0
;;
Paragon*:*:*:*)
echo "i860-intel-osf1"; exit 0
;;
SunOS:5.*)
VERSION=`echo $RELEASE | sed -e 's;^5\.;;'`
echo "${MACHINE}-sun-solaris2.${VERSION}"; exit 0
;;
SunOS:*)
echo "${MACHINE}-sun-sunos4"; exit 0
;;
UNIX_System_V:4.*:*)
echo "${MACHINE}-whatever-sysv4"; exit 0
;;
unix:3.0.9*:*:88k)
echo "${MACHINE}-encore-sysv4"; exit 0
;;
*:4*:R4*:m88k)
echo "${MACHINE}-whatever-sysv4"; exit 0
;;
UnixWare:5:99*:*)
# Gemini, beta release of next rev of unixware
echo "${MACHINE}-whatever-unixware212"; exit 0
;;
DYNIX/ptx:4*:*)
echo "${MACHINE}-whatever-sysv4"; exit 0
;;
*:4.0:3.0:[345][0-9]?? | *:4.0:3.0:3[34]??[/,]* | library:*)
echo "x86-ncr-sysv4"; exit 0
;;
ULTRIX:*)
echo "${MACHINE}-unknown-ultrix"; exit 0
;;
SINIX-?:* | ReliantUNIX-?:*)
echo "${MACHINE}-siemens-sysv4"; exit 0
;;
POSIX*BS2000)
echo "${MACHINE}-siemens-sysv4"; exit 0
;;
machten:*)
echo "${MACHINE}-tenon-${SYSTEM}"; exit 0;
;;
ConvexOS:*:11.*:*)
echo "${MACHINE}-v11-${SYSTEM}"; exit 0;
;;
UNIX_SV:*:*:maxion)
echo "${MACHINE}-ccur-sysv4"; exit 0;
;;
PowerMAX_OS:*:*:Night_Hawk)
MACHINE=`uname -p`
echo "${MACHINE}-concurrent-powermax"; exit 0;
;;
UNIX_SV:*)
if [ -d /usr/nec ];then
echo "mips-nec-sysv4"; exit 0;
fi
;;
NonStop-UX:4.[02]*:[BC]*:*)
echo "${MACHINE}-tandem-sysv4"; exit 0;
;;
Rhapsody:*:*:*)
case "${MACHINE}" in
"Power Macintosh") MACHINE=powerpc ;;
esac
echo "${MACHINE}-apple-rhapsody${RELEASE}"; exit 0
;;
"Mac OS":*:*:*)
MACHINE=`uname -p`
echo "${MACHINE}-apple-macos${RELEASE}"; exit 0
;;
"RISC iX":*)
echo "arm-whatever-riscix"; exit 0;
;;
*:4.0:2:*)
echo "whatever-unisys-sysv4"; exit 0;
;;
*:*:dcosx:NILE*)
echo "pyramid-pyramid-svr4"; exit 0;
;;
*:*:*:"DRS 6000")
echo "drs6000-whatever-whatever"; exit 0;
;;
AmigaOS:*:*:* )
echo "${MACHINE}-whatever-${SYSTEM}${RELEASE}"; exit 0
;;
esac
# Now NeXT
ISNEXT=`(hostinfo) 2>/dev/null`
case "$ISNEXT" in
*NeXT*)
# Swiped from a friendly uname clone for NEXT/OPEN Step.
NEXTOSVER="`hostinfo | sed -n 's/.*NeXT Mach \([0-9\.]*\).*/\1/p'`"
if [ "$NEXTOSVER" -gt 3.3 ]; then
NEXTOS="openstep"
else
NEXTOS="nextstep"
fi
NEXTREL="`hostinfo | sed -n 's/.*NeXT Mach \([0-9\.]*\).*/\1/p'`"
NEXTARCH=`arch`
echo "${NEXTARCH}-next-${NEXTOS}${NEXTREL}" ; exit 0
;;
esac
# Fallback
echo "${MACHINE}-unknown-${SYSTEM}/${RELEASE}/${VERSION}"
;;
arx )
##
## arx -- Extended archive command
## Copyright (c) 1999-2002 Ralf S. Engelschall <rse@engelschall.com>
## Originally written for shtool
##
ar_prg="$opt_C"
ar_cmd="$1"; shift
archive="$1"; shift
files="$*"
# walk through the file list and expand archives members
tmpdir=`echo $archive | sed -e 's;[^/]*$;.arx;'`
nfiles=''
if [ ".$files" != . ]; then
for file in $files; do
if [ ! -f $file ]; then
echo "$msgprefix:Error: input file not found: $file" 1>&2
exit 1
fi
case $file in
*.a )
if [ ! -d $tmpdir ]; then
if [ ".$opt_t" = .yes ]; then
echo "mkdir $tmpdir" 1>&2
fi
mkdir $tmpdir
fi
case $tmpdir in
.arx )
from="../$file"
;;
* )
dir=`echo $file | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;'`
base=`echo $file | sed -e 's;.*/\([^/]*\)$;\1;'`
from="`cd $dir; pwd`/$base"
;;
esac
if [ ".$opt_t" = .yes ]; then
echo "(cd $tmpdir && $ar_prg x $from)" 1>&2
fi
(cd $tmpdir && eval $ar_prg x $from)
if [ $? -ne 0 ]; then
echo "$msgprefix:Error: member extraction failed for archive: $file" 1>&2
exit 1
fi
for member in - `eval $ar_prg t $file | sed -e '/_\.SYMDEF/d'`; do
[ ".$member" = .- ] && continue
nfiles="$nfiles $tmpdir/$member"
done
;;
* )
nfiles="$nfiles $file"
;;
esac
done
fi
# run the final archive command
if [ ".$opt_t" = .yes ]; then
echo "$ar_prg $ar_cmd $archive $nfiles" 1>&2
fi
eval $ar_prg $ar_cmd $archive $nfiles
if [ $? -ne 0 ]; then
echo "$msgprefix:Error: archive command failed" 1>&2
exit $?
fi
# cleanup and die gracefully
if [ -d $tmpdir ]; then
if [ ".$opt_t" = .yes ]; then
echo "rm -rf $tmpdir" 1>&2
fi
rm -rf $tmpdir
fi
;;
slo )
##
## slo -- Separate linker options by library class
## Copyright (c) 1998-2002 Ralf S. Engelschall <rse@engelschall.com>
## Originally written for Apache
##
DIFS="$IFS"
# parse out -L and -l options from command line
DIRS=''
LIBS=''
ARGV=''
optprev=''
for opt
do
# concatenate with previous option if exists
if [ ".$optprev" != . ]; then
opt="${optprev}${opt}";
optprev=''
fi
# remember options for arg if used stand-alone
if [ ".$opt" = ".-L" -o ".$opt" = ".-l" ]; then
optprev="$opt"
continue;
fi
# split argument into option plus option argument
arg="`echo $opt | cut -c3-`"
opt="`echo $opt | cut -c1-2`"
# store into containers
case $opt in
-L) DIRS="$DIRS:$arg" ;;
-l) LIBS="$LIBS:$arg" ;;
*) ARGV="$ARGV $opt" ;;
esac
done
# set linker default directories
DIRS_DEFAULT='/lib:/usr/lib'
if [ ".$LD_LIBRARY_PATH" != . ]; then
DIRS_DEFAULT="$DIRS_DEFAULT:$LD_LIBRARY_PATH"
fi
# sort options by class
DIRS_OBJ=''
LIBS_OBJ=''
DIRS_PIC=''
LIBS_PIC=''
DIRS_DSO=''
LIBS_DSO=''
# for each library...
OIFS="$IFS"; IFS=':'
for lib in $LIBS; do
[ ".$lib" = . ] && continue
found='no'
found_indefdir='no'
found_type=''
found_dir=''
# for each directory...
OIFS2="$IFS"; IFS=":$DIFS"
for dir in ${DIRS} switch-to-defdirs ${DIRS_DEFAULT}; do
[ ".$dir" = . ] && continue
[ ".$dir" = .switch-to-defdirs ] && found_indefdir=yes
[ ! -d $dir ] && continue
# search the file
OIFS3="$IFS"; IFS="$DIFS"
for file in '' `cd $dir && ls lib${lib}.* 2>/dev/null`; do
[ ".$file" = . ] && continue
case $file in
*.so|*.so.[0-9]*|*.sl|*.sl.[0-9]* )
found=yes;
found_type=DSO;
break
;;
*.lo|*.la )
found=yes;
found_type=PIC
;;
*.a )
if [ ".$found_type" = . ]; then
found=yes
found_type=OBJ
fi
;;
esac
done
IFS="$OIFS3"
if [ ".$found" = .yes ]; then
found_dir="$dir"
break
fi
done
IFS="$OIFS2"
if [ ".$found" = .yes ]; then
if [ ".$found_indefdir" != .yes ]; then
eval "dirlist=\"\${DIRS_${found_type}}:\""
if [ ".`echo \"$dirlist\" | fgrep :$found_dir:`" = . ]; then
eval "DIRS_${found_type}=\"\$DIRS_${found_type}:${found_dir}\""
fi
eval "LIBS_${found_type}=\"\$LIBS_${found_type}:$lib\""
else
eval "LIBS_${found_type}=\"\$LIBS_${found_type}:$lib\""
fi
else
LIBS_OBJ="$LIBS_OBJ:$lib"
#dirlist="`echo $DIRS $DIRS_DEFAULT | sed -e 's/:/ /g'`"
#echo "slo:Warning: library \"$lib\" not found in any of the following dirs:" 2>&1
#echo "slo:Warning: $dirlist" 1>&1
fi
done
IFS="$OIFS"
# also pass-through unused dirs even if it's useless
OIFS="$IFS"; IFS=':'
for dir in $DIRS; do
dirlist="${DIRS_OBJ}:${DIRS_PIC}:${DIRS_DSO}:"
if [ ".`echo \"$dirlist\" | fgrep :$dir:`" = . ]; then
DIRS_OBJ="$DIRS_OBJ:$dir"
fi
done
IFS="$OIFS"
# reassemble the options but separated by type
for type in OBJ PIC DSO; do
OIFS="$IFS"; IFS=':'
eval "libs=\"\$LIBS_${type}\""
opts=''
for lib in $libs; do
[ ".$lib" = . ] && continue
opts="$opts -l$lib"
done
eval "LIBS_${type}=\"$opts\""
eval "dirs=\"\$DIRS_${type}\""
opts=''
for dir in $dirs; do
[ ".$dir" = . ] && continue
opts="$opts -L$dir"
done
eval "DIRS_${type}=\"$opts\""
IFS="$OIFS"
done
# give back results
for var in ARGV DIRS_OBJ LIBS_OBJ DIRS_PIC LIBS_PIC DIRS_DSO LIBS_DSO; do
eval "val=\"\$${var}\""
val="`echo $val | sed -e 's/^ *//'`"
echo "${opt_p}${var}=\"${val}\""
done
;;
scpp )
##
## scpp -- Sharing C Pre-Processor
## Copyright (c) 1999-2002 Ralf S. Engelschall <rse@engelschall.com>
## Originally written for GNU Pth
##
srcs="$*"
output="${opt_o}.n"
# find a reasonable Awk
awk=''
paths=`echo $PATH |\
sed -e 's%/*:%:%g' -e 's%/$%%' \
-e 's/^:/.:/' -e 's/::/:.:/g' -e 's/:$/:./' \
-e 's/:/ /g'`
for name in gawk nawk awk; do
for path in $paths; do
if [ -r "$path/$name" ]; then
awk="$path/$name"
break
fi
done
if [ ".$awk" != . ]; then
break
fi
done
if [ ".$awk" = . ]; then
echo "$msgprefix:Error: cannot find a reasonable Awk" 1>&2
exit 1
fi
# parse source file(s)
if [ ".$opt_v" = .yes ]; then
echo "Parsing:" | $awk '{ printf("%s", $0); }' 1>&2
fi
for src in $srcs; do
if [ ".$opt_v" = .yes ]; then
echo $src | $awk '{ printf(" %s", $0); }' 1>&2
fi
if [ ".$opt_f" != . ]; then
inputcmd="sed"
OIFS="$IFS"; IFS="$ASC_NL"; set -- $opt_f; IFS="$OIFS"
for e
do
inputcmd="$inputcmd -e '$e'"
done
inputcmd="$inputcmd $src"
else
inputcmd="cat $src"
fi
$inputcmd |\
$awk '
BEGIN {
ln = 0;
fln = 0;
level = 0;
mode = "";
store = "";
}
{
ln++;
}
/^#if.*/ {
level++;
}
/^#if [a-zA-Z_][a-zA-Z0-9_]* *$/ {
if ($2 == define) {
mode = "D";
printf("D:#line %d \"%s\"\n", ln, src);
next;
}
}
/^#endif.*/ {
level--;
if (mode == "D" && level == 0) {
mode = "";
next;
}
}
/^[a-zA-Z_][a-zA-Z0-9_].*;.*/ {
if ($1 == class) {
printf("V:#line %d \"%s\"\n", ln, src);
printf("V:%s\n", $0);
printf("J:%s\n", $0);
next;
}
}
/^[a-zA-Z_][a-zA-Z0-9_].*=.*/ {
if ($1 == class) {
printf("V:#line %d \"%s\"\n", ln, src);
printf("V:%s\n", $0);
printf("J:%s\n", $0);
next;
}
}
/^[a-zA-Z_][a-zA-Z0-9_]*/ {
if ($1 == class) {
fln = ln;
store = $0;
mode = "F";
next;
}
}
/^\{ *$/ {
if (mode == "F") {
printf("F:#line %d \"%s\"\n", fln, src);
printf("F:%s;\n", store);
printf("I:%s;\n", store);
store = "";
mode = "";
next;
}
}
{
if (mode == "D")
printf("D:%s\n", $0);
else if (mode == "F")
store = store " " $0;
}
' "src=$src" "define=$opt_D" "class=$opt_C" >>$tmpfile
done
if [ ".$opt_v" = .yes ]; then
echo "" 1>&2
fi
# start generating output header
echo "/* $opt_o -- autogenerated from $opt_t, DO NOT EDIT! */" >$output
echo "#line 1 \"$opt_t\"" >>$output
sed <$opt_t -e "1,/^${opt_M} *\$/p" -e 'd' |\
sed -e "/^${opt_M} *\$/d" >>$output
# merge in the define blocks
grep '^D:' $tmpfile | sed -e 's/^D://' >>$output
# generate standard prolog
echo "#line 1 \"_ON_THE_FLY_\"" >>$output
echo "" >>$output
echo "/* make sure the scpp source extensions are skipped */" >>$output
echo "#define $opt_D 0" >>$output
echo "#define $opt_C /**/" >>$output
# generate namespace hiding for variables
echo "" >>$output
echo "/* move intern variables to hidden namespace */" >>$output
grep '^J:' $tmpfile | sed >>$output \
-e 's/^J://' \
-e 's/ */ /g' \
-e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\)\[\];.*$/#define \1 __\1/' \
-e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\)\[\] =.*$/#define \1 __\1/' \
-e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\);.*$/#define \1 __\1/' \
-e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\) =.*$/#define \1 __\1/'
# generate namespace hiding for functions
echo "" >>$output
echo "/* move intern functions to hidden namespace */" >>$output
grep '^I:' $tmpfile | sed >>$output \
-e 's/^I://' \
-e 's/\([ (]\) */\1/g' \
-e 's/ *\([),]\)/\1/g' \
-e 's/^[^(]*[ *]\([a-zA-Z0-9_]*\)(.*$/#define \1 __\1/'
# generate prototypes for variables
echo "" >>$output
echo "/* prototypes for intern variables */" >>$output
grep '^V:' $tmpfile | sed >>$output \
-e 's/^V://' \
-e 's/ */ /g' \
-e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\[\]\);.*$/\1;/' \
-e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\[\]\) =.*$/\1;/' \
-e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\);.*$/\1;/' \
-e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\) =.*$/\1;/' \
-e 's/ ;/;/g' \
-e "s/^$opt_C /extern /"
# generate prototypes for functions
echo "" >>$output
echo "/* prototypes for intern functions */" >>$output
grep '^F:' $tmpfile | sed >>$output \
-e 's/^F://' \
-e 's/\([ (]\) */\1/g' \
-e 's/ *\([),]\)/\1/g' \
-e 's/\([* ]\)[a-zA-Z0-9_]*,/\1,/g' \
-e 's/\([* ]\)[a-zA-Z0-9_]*);/\1);/g' \
-e 's/(\*[a-zA-Z0-9_]*)(/(*)(/g' \
-e 's/\([ (]\) */\1/g' \
-e 's/ *\([),]\)/\1/g' \
-e "s/^$opt_C /extern /"
# finish generating output header
n=`(echo ''; sed <$opt_t -e "1,/^${opt_M} *\$/p" -e 'd') |\
wc -l | sed -e 's;^ *\([0-9]*\) *$;\1;'`
echo "#line $n \"$opt_t\"" >>$output
sed <$opt_t -e "/^${opt_M} *\$/,\$p" -e 'd' |\
sed -e "/^${opt_M} *\$/d" >>$output
# create final output file
if [ -f $opt_o ]; then
if [ ".$opt_p" = .yes ]; then
grep -v '^#line' $opt_o >$tmpfile.o
grep -v '^#line' $output >$tmpfile.n
out_old="$tmpfile.o"
out_new="$tmpfile.n"
else
out_old="$opt_o"
out_new="$output"
fi
if cmp -s $out_old $out_new; then
:
else
cp $output $opt_o
fi
else
cp $output $opt_o
fi
rm -f $output
rm -f $tmpfile $tmpfile.* >/dev/null 2>&1
;;
version )
##
## version -- Maintain a version information file
## Copyright (c) 1994-2002 Ralf S. Engelschall <rse@engelschall.com>
## Originally written for ePerl, rewritten from scratch for shtool
##
file="$1"
# determine prefix and name
name="$opt_n"
prefix="$opt_p"
# determine current version
triple="$opt_s"
if [ ".$triple" != . ]; then
# use given triple
if [ ".`echo $triple | grep '[0-9]*.[0-9]*[sabp.][0-9]*'`" = . ]; then
echo "$msgprefix:Error: invalid argument to option \`-s': \`$opt_s'" 1>&2
exit 1
fi
eval `echo $triple |\
sed -e 's%\([0-9]*\)\.\([0-9]*\)\([sabp.]\)\([0-9]*\).*%\
ver="\1";rev="\2";typ="\3";lev="\4"%'`
tim=calc
elif [ -r $file ]; then
# determine triple from given file
eval `grep 'Version [0-9]*.[0-9]*[sabp.][0-9]* ([0-9]*-[a-zA-Z]*-[0-9]*)' $file |\
head -1 | sed -e 's%.*Version \([0-9]*\)\.\([0-9]*\)\([sabp.]\)\([0-9]*\) (\([0-9]*-[a-zA-Z]*-[0-9]*\)).*%\
ver="\1";rev="\2";typ="\3";lev="\4";tim="\5"%'`
else
# intialise to first version
ver=0
rev=1
typ=.
lev=0
tim=calc
fi
# determine new version in batch
if [ ".$opt_i" != . ]; then
case $opt_i in
v ) ver=`expr $ver + 1`
rev=0
lev=0
;;
r ) rev=`expr $rev + 1`
lev=0
;;
l ) lev=`expr $lev + 1`
;;
* ) echo "$msgprefix:Error: invalid argument to option \`-i': \`$opt_i'" 1>&2
exit 1
;;
esac
tim=calc
fi
# determine new version interactively
if [ ".$opt_e" = .yes ]; then
echo "old version: ${ver}.${rev}${typ}${lev}"
while [ 1 ]; do
echo dummy | awk '{ printf("new version: "); }'
read triple
case $triple in
[0-9]*.[0-9]*[sabp.][0-9]* )
;;
* ) echo "$msgprefix:Error: invalid version string entered: \`$triple'" 1>&2
continue
;;
esac
break
done
eval `echo $triple |\
sed -e 's%^\([0-9]*\)\.\([0-9]*\)\([sabp.]\)\([0-9]*\)$%\
ver="\1";rev="\2";typ="\3";lev="\4"%'`
tim=calc
fi
# determine hexadecimal and libtool value of version
case $typ in
a ) typnum=0; levnum=$lev ;;
b ) typnum=1; levnum=$lev ;;
p | . ) typnum=2; levnum=$lev ;;
s ) typnum=15; levnum=255 ;; # snapshots are special
esac
hex=`echo "$ver:$rev:$typnum:$levnum" |\
awk -F: '{ printf("0x%x%02x%1x%02x", $1, $2, $3, $4); }' |\
tr 'abcdef' 'ABCDEF'`
ltv=`echo "$ver:$rev:$typnum:$levnum" |\
awk -F: '{ printf("%d:%d", $1*10 + $2, $3*10 + $4); }'`
# determine date
if [ ".$tim" = .calc ]; then
day=`date '+%d'`
month=`date '+%m'`
year=`date '+%Y' 2>/dev/null`
if [ ".$time_year" = . ]; then
year=`date '+%y'`
case $year in
[5-9][0-9]) year="19$year" ;;
[0-4][0-9]) year="20$year" ;;
esac
fi
case $month in
1|01) month='Jan' ;;
2|02) month='Feb' ;;
3|03) month='Mar' ;;
4|04) month='Apr' ;;
5|05) month='May' ;;
6|06) month='Jun' ;;
7|07) month='Jul' ;;
8|08) month='Aug' ;;
9|09) month='Sep' ;;
10) month='Oct' ;;
11) month='Nov' ;;
12) month='Dec' ;;
esac
tim="${day}-${month}-${year}"
fi
# perform result actions
mode=show
if [ ".$opt_i" != . ]; then
mode=edit
elif [ ".$opt_e" = .yes ]; then
mode=edit
elif [ ".$opt_s" != . ]; then
mode=edit
fi
if [ ".$mode" = .show ]; then
# just display the current version
case $opt_d in
short )
echo "${ver}.${rev}${typ}${lev}"
;;
long )
echo "${ver}.${rev}${typ}${lev} ($tim)"
;;
libtool )
echo "${ltv}"
;;
hex )
echo "${hex}"
;;
* ) echo "$msgprefix:Error: invalid argument to option \`-d': \`$opt_d'" 1>&2
exit 1
;;
esac
else
# update the version file
# pre-generate various strings
triple="${ver}.${rev}${typ}${lev}"
vHex="$hex"
vShort="${triple}"
vLong="${triple} (${tim})"
vTeX="This is ${name}, Version ${triple} (${tim})"
vGNU="${name} ${triple} (${tim})"
vWeb="${name}/${triple}"
vSCCS="@(#)${name} ${triple} (${tim})"
vRCS="\$Id: ${name} ${triple} (${tim}) \$"
# determine string out of filename
# (do NOT try to optimize this in any way because of portability)
filestr=`echo $file |\
tr 'abcdefghijklmnopqrstuvwxyz./%+' \
'ABCDEFGHIJKLMNOPQRSTUVWXYZ____' | sed -e 's/-/_/g'`
# generate uppercase prefix
prefixupper=`echo $prefix |\
tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
# create the version file according the the selected language
echo "new version: ${vLong}"
cp /dev/null $file
case $opt_l in
txt )
echo >>$file ""
echo >>$file " ${file} -- Version Information for ${name} (syntax: Text)"
echo >>$file " [automatically generated and maintained by GNU shtool]"
echo >>$file ""
echo >>$file " $vTeX"
echo >>$file ""
;;
c )
echo >>$file "/*"
echo >>$file "** ${file} -- Version Information for ${name} (syntax: C/C++)"
echo >>$file "** [automatically generated and maintained by GNU shtool]"
echo >>$file "*/"
echo >>$file ""
echo >>$file "#ifdef _${filestr}_AS_HEADER_"
echo >>$file ""
echo >>$file "#ifndef _${filestr}_"
echo >>$file "#define _${filestr}_"
echo >>$file ""
echo >>$file "#define ${prefixupper}VERSION ${vHex}"
echo >>$file ""
echo >>$file "typedef struct {"
echo >>$file " const int v_hex;"
echo >>$file " const char *v_short;"
echo >>$file " const char *v_long;"
echo >>$file " const char *v_tex;"
echo >>$file " const char *v_gnu;"
echo >>$file " const char *v_web;"
echo >>$file " const char *v_sccs;"
echo >>$file " const char *v_rcs;"
echo >>$file "} ${prefix}version_t;"
echo >>$file ""
echo >>$file "extern ${prefix}version_t ${prefix}version;"
echo >>$file ""
echo >>$file "#endif /* _${filestr}_ */"
echo >>$file ""
echo >>$file "#else /* _${filestr}_AS_HEADER_ */"
echo >>$file ""
echo >>$file "#define _${filestr}_AS_HEADER_"
echo >>$file "#include \"${file}\""
echo >>$file "#undef _${filestr}_AS_HEADER_"
echo >>$file ""
echo >>$file "${prefix}version_t ${prefix}version = {"
echo >>$file " ${vHex},"
echo >>$file " \"${vShort}\","
echo >>$file " \"${vLong}\","
echo >>$file " \"${vTeX}\","
echo >>$file " \"${vGNU}\","
echo >>$file " \"${vWeb}\","
echo >>$file " \"${vSCCS}\","
echo >>$file " \"${vRCS}\""
echo >>$file "};"
echo >>$file ""
echo >>$file "#endif /* _${filestr}_AS_HEADER_ */"
echo >>$file ""
;;
perl )
echo >>$file "##"
echo >>$file "## ${file} -- Version Information for ${name} (syntax: Perl)"
echo >>$file "## [automatically generated and maintained by GNU shtool]"
echo >>$file "##"
echo >>$file ""
echo >>$file "my \$${prefix}version = {"
echo >>$file " 'v_hex' => ${vHex},"
echo >>$file " 'v_short' => \"${vShort}\","
echo >>$file " 'v_long' => \"${vLong}\","
echo >>$file " 'v_tex' => \"${vTeX}\","
echo >>$file " 'v_gnu' => \"${vGNU}\","
echo >>$file " 'v_web' => \"${vWeb}\","
echo >>$file " 'v_sccs' => \"${vSCCS}\","
echo >>$file " 'v_rcs' => \"\\${vRCS}/\""
echo >>$file "};"
echo >>$file ""
echo >>$file "1;"
echo >>$file ""
;;
python )
echo >>$file "##"
echo >>$file "## ${file} -- Version Information for ${name} (syntax: Python)"
echo >>$file "## [automatically generated and maintained by GNU shtool]"
echo >>$file "##"
echo >>$file ""
echo >>$file "class ${prefix}version:"
echo >>$file " v_hex = ${vHex}"
echo >>$file " v_short = \"${vShort}\""
echo >>$file " v_long = \"${vLong}\""
echo >>$file " v_tex = \"${vTeX}\""
echo >>$file " v_gnu = \"${vGNU}\""
echo >>$file " v_web = \"${vWeb}\""
echo >>$file " v_sccs = \"${vSCCS}\""
echo >>$file " v_rcs = \"${vRCS}\""
echo >>$file ""
;;
* ) echo "$msgprefix:Error: invalid argument to option \`-l': \`$opt_l'" 1>&2
exit 1
;;
esac
fi
;;
path )
##
## path -- Deal with program paths
## Copyright (c) 1998-2002 Ralf S. Engelschall <rse@engelschall.com>
## Originally written for Apache
##
namelist="$*"
# check whether the test command supports the -x option
if [ -x /bin/sh ] 2>/dev/null; then
minusx="-x"
else
minusx="-r"
fi
# split path string
paths="`echo $opt_p |\
sed -e 's/^:/.:/' \
-e 's/::/:.:/g' \
-e 's/:$/:./' \
-e 's/:/ /g'`"
# SPECIAL REQUEST
# translate forward to reverse path
if [ ".$opt_r" = .yes ]; then
if [ "x$namelist" = "x." ]; then
rp='.'
else
rp=''
for pe in `IFS="$IFS/"; echo $namelist`; do
rp="../$rp"
done
fi
echo $rp | sed -e 's:/$::'
exit 0
fi
# SPECIAL REQUEST
# strip out directory or base name
if [ ".$opt_d" = .yes ]; then
echo "$namelist" |\
sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'
exit 0
fi
if [ ".$opt_b" = .yes ]; then
echo "$namelist" |\
sed -e 's;.*/\([^/]*\)$;\1;'
exit 0
fi
# MAGIC SITUATION
# Perl Interpreter (perl)
if [ ".$opt_m" = .yes -a ".$namelist" = .perl ]; then
rm -f $tmpfile >/dev/null 2>&1
touch $tmpfile
found=0
pc=99
for dir in $paths; do
dir=`echo $dir | sed -e 's;/*$;;'`
nc=99
for name in perl perl5 miniperl; do
if [ $minusx "$dir/$name" -a ! -d "$dir/$name" ]; then
perl="$dir/$name"
pv=`$perl -e 'printf("%.3f", $]);'`
echo "$pv:$pc:$nc:$perl" >>$tmpfile
found=1
fi
nc=`expr $nc - 1`
done
pc=`expr $pc - 1`
done
if [ $found = 1 ]; then
perl="`cat $tmpfile | sort -u | tail -1 | cut -d: -f4`"
rm -f $tmpfile >/dev/null 2>&1
echo "$perl"
exit 0
fi
rm -f $tmpfile >/dev/null 2>&1
exit 1
fi
# MAGIC SITUATION
# C pre-processor (cpp)
if [ ".$opt_m" = .yes -a ".$namelist" = .cpp ]; then
echo >$tmpfile.c "#include <assert.h>"
echo >>$tmpfile.c "Syntax Error"
# 1. try the standard cc -E approach
cpp="${CC-cc} -E"
(eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out
my_error=`grep -v '^ *+' $tmpfile.out`
if [ ".$my_error" != . ]; then
# 2. try the cc -E approach and GCC's -traditional-ccp option
cpp="${CC-cc} -E -traditional-cpp"
(eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out
my_error=`grep -v '^ *+' $tmpfile.out`
if [ ".$my_error" != . ]; then
# 3. try a standalone cpp command in path and lib dirs
for path in $paths /lib /usr/lib /usr/local/lib; do
path=`echo $path | sed -e 's;/*$;;'`
if [ $minusx "$path/cpp" -a ! -d "$path/cpp" ]; then
cpp="$path/cpp"
break
fi
done
if [ ".$cpp" != . ]; then
(eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out
my_error=`grep -v '^ *+' $tmpfile.out`
if [ ".$my_error" != . ]; then
# ok, we gave up...
cpp=''
fi
fi
fi
fi
rm -f $tmpfile >/dev/null 2>&1
rm -f $tmpfile.c $tmpfile.out >/dev/null 2>&1
if [ ".$cpp" != . ]; then
echo "$cpp"
exit 0
fi
exit 1
fi
# STANDARD SITUATION
# iterate over names
for name in $namelist; do
# iterate over paths
for path in $paths; do
path=`echo $path | sed -e 's;/*$;;'`
if [ $minusx "$path/$name" -a ! -d "$path/$name" ]; then
if [ ".$opt_s" != .yes ]; then
echo "$path/$name"
fi
exit 0
fi
done
done
exit 1
;;
esac
exit 0
##EOF##
|
Added work/contrib/lzo/lzo-1.08/acconfig/ylwrap.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
|
#! /bin/sh
# ylwrap - wrapper for lex/yacc invocations.
#
# Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002 Free Software
# Foundation, Inc.
#
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Usage:
# ylwrap INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]...
# * INPUT is the input file
# * OUTPUT is file PROG generates
# * DESIRED is file we actually want
# * PROGRAM is program to run
# * ARGS are passed to PROG
# Any number of OUTPUT,DESIRED pairs may be used.
# The input.
input="$1"
shift
case "$input" in
[\\/]* | ?:[\\/]*)
# Absolute path; do nothing.
;;
*)
# Relative path. Make it absolute.
input="`pwd`/$input"
;;
esac
pairlist=
while test "$#" -ne 0; do
if test "$1" = "--"; then
shift
break
fi
pairlist="$pairlist $1"
shift
done
# The program to run.
prog="$1"
shift
# Make any relative path in $prog absolute.
case "$prog" in
[\\/]* | ?:[\\/]*) ;;
*[\\/]*) prog="`pwd`/$prog" ;;
esac
# FIXME: add hostname here for parallel makes that run commands on
# other machines. But that might take us over the 14-char limit.
dirname=ylwrap$$
trap "cd `pwd`; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15
mkdir $dirname || exit 1
cd $dirname
case $# in
0) $prog "$input" ;;
*) $prog "$@" "$input" ;;
esac
status=$?
if test $status -eq 0; then
set X $pairlist
shift
first=yes
# Since DOS filename conventions don't allow two dots,
# the DOS version of Bison writes out y_tab.c instead of y.tab.c
# and y_tab.h instead of y.tab.h. Test to see if this is the case.
y_tab_nodot="no"
if test -f y_tab.c || test -f y_tab.h; then
y_tab_nodot="yes"
fi
# The directory holding the input.
input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'`
# Quote $INPUT_DIR so we can use it in a regexp.
# FIXME: really we should care about more than `.' and `\'.
input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'`
while test "$#" -ne 0; do
from="$1"
# Handle y_tab.c and y_tab.h output by DOS
if test $y_tab_nodot = "yes"; then
if test $from = "y.tab.c"; then
from="y_tab.c"
else
if test $from = "y.tab.h"; then
from="y_tab.h"
fi
fi
fi
if test -f "$from"; then
# If $2 is an absolute path name, then just use that,
# otherwise prepend `../'.
case "$2" in
[\\/]* | ?:[\\/]*) target="$2";;
*) target="../$2";;
esac
# Edit out `#line' or `#' directives.
#
# We don't want the resulting debug information to point at
# an absolute srcdir; it is better for it to just mention the
# .y file with no path.
#
# We want to use the real output file name, not yy.lex.c for
# instance.
#
# We want the include guards to be adjusted too.
FROM=`echo "$from" | sed \
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
-e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
TARGET=`echo "$2" | sed \
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
-e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
sed "/^#/{s,$input_rx,,;s,$from,$2,;s,$FORM,$TO,;}" "$from" >"$target" ||
status=$?
else
# A missing file is only an error for the first file. This
# is a blatant hack to let us support using "yacc -d". If -d
# is not specified, we don't want an error when the header
# file is "missing".
if test $first = yes; then
status=1
fi
fi
shift
shift
first=no
done
else
status=$?
fi
# Remove the directory.
cd ..
rm -rf $dirname
exit $status
|
Added work/contrib/lzo/lzo-1.08/acinclude.m4.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
## --------------------------------------------------------- ##
## My own customization. ##
## --------------------------------------------------------- ##
# serial 4
AC_DEFUN(mfx_CUSTOMIZE,
[
mfx_PROG_CC_BUG_SIGNED_TO_UNSIGNED_CASTING
mfx_PROG_GCC_BUG_SCHEDULE_INSNS
mfx_PROG_GCC_BUG_STRENGTH_REDUCE
dnl /***********************************************************************
dnl // Prepare some macros
dnl ************************************************************************/
CFLAGS_GCC_OMIT_FRAME_POINTER=""
if test "X$GCC" = Xyes; then
CFLAGS_GCC_OMIT_FRAME_POINTER="-fomit-frame-pointer"
if test "X$mfx_cv_prog_checkergcc" = Xyes; then
CFLAGS_GCC_OMIT_FRAME_POINTER="-fno-omit-frame-pointer"
fi
if test "X$enable_debug" = Xyes; then
CFLAGS_GCC_OMIT_FRAME_POINTER="-fno-omit-frame-pointer"
fi
if test "X$enable_profiling" = Xyes; then
CFLAGS_GCC_OMIT_FRAME_POINTER="-fno-omit-frame-pointer"
fi
if test "X$enable_coverage" = Xyes; then
CFLAGS_GCC_OMIT_FRAME_POINTER="-fno-omit-frame-pointer"
fi
fi
AC_SUBST(CFLAGS_GCC_OMIT_FRAME_POINTER)dnl
if test "X$enable_debug" = Xyes; then
if test "X$GCC" = Xyes -a "X$USE_MAINTAINER_MODE" = Xyes; then
test "$ac_cv_prog_cc_g" = yes && CFLAGS="$CFLAGS -g"
test "$ac_cv_prog_cxx_g" = yes && CXXFLAGS="$CXXFLAGS -g"
else
test "$ac_cv_prog_cc_g" = yes && CFLAGS="$CFLAGS -g"
test "$ac_cv_prog_cxx_g" = yes && CXXFLAGS="$CXXFLAGS -g"
fi
fi
dnl /***********************************************************************
dnl // Compiler and architecture for use in makefiles
dnl ************************************************************************/
AC_SUBST(MFX_CC)
AC_SUBST(MFX_ARCH)
AC_SUBST(MFX_CPU)
MFX_CC="unknown"
MFX_ARCH="unknown"
MFX_CPU="$host_cpu"
if test "X$cross_compiling" = Xyes; then
if test "X$build" = "X$host"; then
MFX_CPU="unknown"
fi
fi
MFX_CPU=`echo "$MFX_CPU" | sed -e 's/[^a-zA-Z0-9]//g'`
if test "X$GCC" = Xyes; then
MFX_CC="GCC"
if test "X$enable_debug" = Xyes; then
CFLAGS="$CFLAGS -O0"
else
CFLAGS="$CFLAGS -O2"
fi
CFLAGS="$CFLAGS -Wall -Wcast-align -Wcast-qual -Wwrite-strings"
case $MFX_CPU in
i[[3456789]]86)
MFX_ARCH="i386"
mfx_unaligned_ok_2="yes"
mfx_unaligned_ok_4="yes"
CFLAGS="$CFLAGS -fno-strength-reduce"
;;
*)
if test "X$mfx_cv_prog_gcc_bug_strength_reduce" = Xyes; then
CFLAGS="$CFLAGS -fno-strength-reduce"
fi
;;
esac
if test "X$mfx_cv_prog_gcc_bug_schedule_insns" = Xyes; then
CFLAGS="$CFLAGS -fno-schedule-insns -fno-schedule-insns2"
fi
fi
if test "X$GCC" = Xyes; then
AC_CACHE_CHECK([whether ${CC-cc} accepts -fstrict-aliasing],
mfx_cv_prog_gcc_f_strict_aliasing,
[echo 'extern int x; int x = 0;' > conftest.cc
if test -z "`${CC-cc} -fstrict-aliasing -c conftest.cc 2>&1`"; then
mfx_cv_prog_gcc_f_strict_aliasing=yes
else
mfx_cv_prog_gcc_f_strict_aliasing=no
fi
rm -f conftest*
])
if test "X$mfx_cv_prog_gcc_f_strict_aliasing" = Xyes; then
CFLAGS="$CFLAGS -fstrict-aliasing"
fi
fi
MFX_ARCH=`echo "$MFX_ARCH" | sed -e 's/[^a-zA-Z0-9]//g'`
AC_DEFINE_UNQUOTED(MFX_ARCH,"$MFX_ARCH")
AC_DEFINE_UNQUOTED(MFX_CPU,"$MFX_CPU")
])
|
Added work/contrib/lzo/lzo-1.08/aclocal.m4.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
|
# aclocal.m4 generated automatically by aclocal 1.6.2 -*- Autoconf -*-
# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
# serial 4
AC_DEFUN(mfx_CUSTOMIZE,
[
mfx_PROG_CC_BUG_SIGNED_TO_UNSIGNED_CASTING
mfx_PROG_GCC_BUG_SCHEDULE_INSNS
mfx_PROG_GCC_BUG_STRENGTH_REDUCE
dnl /***********************************************************************
dnl // Prepare some macros
dnl ************************************************************************/
CFLAGS_GCC_OMIT_FRAME_POINTER=""
if test "X$GCC" = Xyes; then
CFLAGS_GCC_OMIT_FRAME_POINTER="-fomit-frame-pointer"
if test "X$mfx_cv_prog_checkergcc" = Xyes; then
CFLAGS_GCC_OMIT_FRAME_POINTER="-fno-omit-frame-pointer"
fi
if test "X$enable_debug" = Xyes; then
CFLAGS_GCC_OMIT_FRAME_POINTER="-fno-omit-frame-pointer"
fi
if test "X$enable_profiling" = Xyes; then
CFLAGS_GCC_OMIT_FRAME_POINTER="-fno-omit-frame-pointer"
fi
if test "X$enable_coverage" = Xyes; then
CFLAGS_GCC_OMIT_FRAME_POINTER="-fno-omit-frame-pointer"
fi
fi
AC_SUBST(CFLAGS_GCC_OMIT_FRAME_POINTER)dnl
if test "X$enable_debug" = Xyes; then
if test "X$GCC" = Xyes -a "X$USE_MAINTAINER_MODE" = Xyes; then
test "$ac_cv_prog_cc_g" = yes && CFLAGS="$CFLAGS -g"
test "$ac_cv_prog_cxx_g" = yes && CXXFLAGS="$CXXFLAGS -g"
else
test "$ac_cv_prog_cc_g" = yes && CFLAGS="$CFLAGS -g"
test "$ac_cv_prog_cxx_g" = yes && CXXFLAGS="$CXXFLAGS -g"
fi
fi
dnl /***********************************************************************
dnl // Compiler and architecture for use in makefiles
dnl ************************************************************************/
AC_SUBST(MFX_CC)
AC_SUBST(MFX_ARCH)
AC_SUBST(MFX_CPU)
MFX_CC="unknown"
MFX_ARCH="unknown"
MFX_CPU="$host_cpu"
if test "X$cross_compiling" = Xyes; then
if test "X$build" = "X$host"; then
MFX_CPU="unknown"
fi
fi
MFX_CPU=`echo "$MFX_CPU" | sed -e 's/[^a-zA-Z0-9]//g'`
if test "X$GCC" = Xyes; then
MFX_CC="GCC"
if test "X$enable_debug" = Xyes; then
CFLAGS="$CFLAGS -O0"
else
CFLAGS="$CFLAGS -O2"
fi
CFLAGS="$CFLAGS -Wall -Wcast-align -Wcast-qual -Wwrite-strings"
case $MFX_CPU in
i[[3456789]]86)
MFX_ARCH="i386"
mfx_unaligned_ok_2="yes"
mfx_unaligned_ok_4="yes"
CFLAGS="$CFLAGS -fno-strength-reduce"
;;
*)
if test "X$mfx_cv_prog_gcc_bug_strength_reduce" = Xyes; then
CFLAGS="$CFLAGS -fno-strength-reduce"
fi
;;
esac
if test "X$mfx_cv_prog_gcc_bug_schedule_insns" = Xyes; then
CFLAGS="$CFLAGS -fno-schedule-insns -fno-schedule-insns2"
fi
fi
if test "X$GCC" = Xyes; then
AC_CACHE_CHECK([whether ${CC-cc} accepts -fstrict-aliasing],
mfx_cv_prog_gcc_f_strict_aliasing,
[echo 'extern int x; int x = 0;' > conftest.cc
if test -z "`${CC-cc} -fstrict-aliasing -c conftest.cc 2>&1`"; then
mfx_cv_prog_gcc_f_strict_aliasing=yes
else
mfx_cv_prog_gcc_f_strict_aliasing=no
fi
rm -f conftest*
])
if test "X$mfx_cv_prog_gcc_f_strict_aliasing" = Xyes; then
CFLAGS="$CFLAGS -fstrict-aliasing"
fi
fi
MFX_ARCH=`echo "$MFX_ARCH" | sed -e 's/[^a-zA-Z0-9]//g'`
AC_DEFINE_UNQUOTED(MFX_ARCH,"$MFX_ARCH")
AC_DEFINE_UNQUOTED(MFX_CPU,"$MFX_CPU")
])
# serial 1
AC_DEFUN(mfx_PROG_CC_BUG_SIGNED_TO_UNSIGNED_CASTING,
[AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_CPP])dnl
AC_CACHE_CHECK([whether signed to unsigned casting is broken],
mfx_cv_prog_cc_bug_signed_to_unsigned_casting,
[AC_TRY_COMPILE([], [#undef SIGNED
#if defined(__STDC__) || defined(__cplusplus)
#define SIGNED signed
#else
#define SIGNED
#endif
char x[1 - 2 * ( (int)((unsigned char)((SIGNED char) -1)) != 255 )];
],
mfx_cv_prog_cc_bug_signed_to_unsigned_casting=no,
mfx_cv_prog_cc_bug_signed_to_unsigned_casting=yes)])
])
# serial 1
AC_DEFUN(mfx_PROG_GCC_BUG_SCHEDULE_INSNS,
[AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_CPP])dnl
if test "$ac_cv_prog_gcc" = yes; then
mfx_save_cflags="$CFLAGS"
CFLAGS="-O2 -fschedule-insns -fschedule-insns2"
AC_CACHE_CHECK([whether ${CC-cc} suffers the -fschedule-insns bug],
mfx_cv_prog_gcc_bug_schedule_insns,
[AC_RUN_IFELSE([AC_LANG_PROGRAM([], [[
/* gcc schedule-insns optimization bug on RS6000 platforms.
* Adapted from bug-report by Assar Westerlund <assar@sics.se>
* Compile and run it using gcc -O2 -fno-schedule-insns and
* gcc -O2 -fschedule-insns.
*/
const int clone[] = {1, 2, 0}; const int *q;
q = clone; exit(*q ? 0 : 1);
]])],
[mfx_cv_prog_gcc_bug_schedule_insns=no],
[mfx_cv_prog_gcc_bug_schedule_insns=yes],
[mfx_cv_prog_gcc_bug_schedule_insns=unknown])])
CFLAGS="$mfx_save_cflags"
fi
])
# serial 1
AC_DEFUN(mfx_PROG_GCC_BUG_STRENGTH_REDUCE,
[AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_CPP])dnl
if test "$ac_cv_prog_gcc" = yes; then
mfx_save_cflags="$CFLAGS"
CFLAGS="-O2 -fstrength-reduce"
AC_CACHE_CHECK([whether ${CC-cc} suffers the -fstrength-reduce bug],
mfx_cv_prog_gcc_bug_strength_reduce,
[AC_TRY_RUN([
/* gcc strength-reduce optimization bug on Intel platforms.
* Adapted from bug-report by John E. Davis <davis@space.mit.edu>
* Compile and run it using gcc -O2 -fno-strength-reduce and
* gcc -O2 -fstrength-reduce.
*/
int a[3]; unsigned an = 3;
int strength_reduce_bug();
int main() { unsigned j;
for (j = 0; j < an; j++)
a[j] = (int)j - 3;
return strength_reduce_bug(); }
int strength_reduce_bug()
{ return a[0] != -3 || a[1] != -2 || a[2] != -1; }],
[mfx_cv_prog_gcc_bug_strength_reduce=no],
[mfx_cv_prog_gcc_bug_strength_reduce=yes],
[mfx_cv_prog_gcc_bug_strength_reduce=unknown])])
CFLAGS="$mfx_save_cflags"
fi
])
AC_DEFUN(mfx_CHECK_CROSS,
[
AC_REQUIRE([AC_PROG_CC])
if test "X$cross_compiling" = Xyes; then
if test "X$build" = "X$host"; then
AC_MSG_ERROR([you are cross compiling - please use the \`--host=' option])
fi
fi
])
# serial 2
# @defmac mfx_PROG_CC_ANSI
# @maindex PROG_CC_ANSI
# @ovindex CC
# If the C compiler in not in ANSI C mode by default, try to add an option
# to output variable @code{CC} to make it so. This macro tries various
# options that select ANSI C on some system or another. It considers the
# compiler to be in ANSI C mode if it handles function prototypes correctly.
#
# If you use this macro, you should check after calling it whether the C
# compiler has been set to accept ANSI C; if not, the shell variable
# @code{mfx_cv_prog_cc_ansi} is set to @samp{no}. If you wrote your source
# code in ANSI C, you can make an un-ANSIfied copy of it by using the
# program @code{ansi2knr}, which comes with Ghostscript.
# @end defmac
AC_DEFUN(mfx_PROG_CC_ANSI,
[AC_REQUIRE([AC_PROG_CC])dnl
AC_BEFORE([$0], [AC_C_INLINE])dnl
AC_BEFORE([$0], [AC_C_CONST])dnl
dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
dnl a magic option to avoid problems with ANSI preprocessor commands
dnl like #elif.
AC_BEFORE([$0], [AC_PROG_CPP])
AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
AC_CACHE_VAL(mfx_cv_prog_cc_ansi,
[mfx_cv_prog_cc_ansi=no
ac_save_CC="$CC"
# Don't try gcc -ansi; that turns off useful extensions and
# breaks some systems' header files.
# AIX -qlanglvl=ansi
# Ultrix and OSF/1 -std1
# HP-UX 10.20 and later -Ae
# HP-UX older versions -Aa -D_HPUX_SOURCE
# SVR4 -Xc -D__EXTENSIONS__
for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
CC="$ac_save_CC $ac_arg"
AC_TRY_COMPILE(
[#include <sys/types.h>
#if !defined(NO_STDIO_H)
#include <sys/stat.h>
#include <stdio.h>
#endif
#include <stdarg.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
# include <limits.h> /* note the space */
#if defined(NO_STDIO_H)
typedef struct { int dummy; } FILE;
struct stat;
#endif
#if 1 && !defined(UINT_MAX)
# error "this is an error"
# include "choke me"
#elif 0 || !defined(UINT_MAX)
# error "this is an error"
# include "choke me"
#elif !defined(UINT_MAX)
# error "this is an error"
# include "choke me"
#elif !(1-1)
/* ok */
#else
# error "this is an error"
# include "choke me"
#endif
#define STRINGIZE(x) #x
#define MACRO_EXPAND(x) STRINGIZE(x)
extern volatile signed char flag;
extern char *s ( void );
char *s ( void )
{
static char n[] = MACRO_EXPAND(UINT_MAX);
return flag ? n : n + 1;
}
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
struct buf { int x; };
FILE * (*rcsopen) (struct buf *, struct stat *, int);
static char *e (char **p, int i)
{
return p[i];
}
static char *f (char * (*g) (char **, int), char **p, ...)
{
char *s;
va_list v;
va_start (v,p);
s = g (p, va_arg (v,int));
va_end (v);
return s;
}
int test (int i, double x);
struct s1 {int (*f) (int a);};
struct s2 {int (*f) (double a);};
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
int argc;
char **argv;
], [
return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
],
[mfx_cv_prog_cc_ansi="$ac_arg"; break])
done
CC="$ac_save_CC"
])
if test -z "$mfx_cv_prog_cc_ansi"; then
AC_MSG_RESULT([none needed])
else
AC_MSG_RESULT($mfx_cv_prog_cc_ansi)
fi
case "x$mfx_cv_prog_cc_ansi" in
x|xno) ;;
*) CC="$CC $mfx_cv_prog_cc_ansi" ;;
esac
])
# Do all the work for Automake. -*- Autoconf -*-
# This macro actually does too much some checks are only needed if
# your package does certain things. But this isn't really a big deal.
# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# serial 8
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4,
# will think it sees a *use*, and therefore will trigger all it's
# C support machinery. Also note that it means that autoscan, seeing
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
AC_PREREQ([2.52])
# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
# the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
# AM_INIT_AUTOMAKE([OPTIONS])
# -----------------------------------------------
# The call with PACKAGE and VERSION arguments is the old style
# call (pre autoconf-2.50), which is being phased out. PACKAGE
# and VERSION should now be passed to AC_INIT and removed from
# the call to AM_INIT_AUTOMAKE.
# We support both call styles for the transition. After
# the next Automake release, Autoconf can make the AC_INIT
# arguments mandatory, and then we can depend on a new Autoconf
# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
AC_REQUIRE([AC_PROG_INSTALL])dnl
# test to see if srcdir already configured
if test "`cd $srcdir && pwd`" != "`pwd`" &&
test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
# Define the identity of the package.
dnl Distinguish between old-style and new-style calls.
m4_ifval([$2],
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
AC_SUBST([PACKAGE], [$1])dnl
AC_SUBST([VERSION], [$2])],
[_AM_SET_OPTIONS([$1])dnl
AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl
AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl
_AM_IF_OPTION([no-define],,
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
# Some tools Automake needs.
AC_REQUIRE([AM_SANITY_CHECK])dnl
AC_REQUIRE([AC_ARG_PROGRAM])dnl
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
AM_MISSING_PROG(AUTOCONF, autoconf)
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
AM_MISSING_PROG(AUTOHEADER, autoheader)
AM_MISSING_PROG(MAKEINFO, makeinfo)
AM_MISSING_PROG(AMTAR, tar)
AM_PROG_INSTALL_SH
AM_PROG_INSTALL_STRIP
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
_AM_IF_OPTION([no-dependencies],,
[AC_PROVIDE_IFELSE([AC_PROG_][CC],
[_AM_DEPENDENCIES(CC)],
[define([AC_PROG_][CC],
defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl
AC_PROVIDE_IFELSE([AC_PROG_][CXX],
[_AM_DEPENDENCIES(CXX)],
[define([AC_PROG_][CXX],
defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl
])
])
# Copyright 2002 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# AM_AUTOMAKE_VERSION(VERSION)
# ----------------------------
# Automake X.Y traces this macro to ensure aclocal.m4 has been
# generated from the m4 files accompanying Automake X.Y.
AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.6"])
# AM_SET_CURRENT_AUTOMAKE_VERSION
# -------------------------------
# Call AM_AUTOMAKE_VERSION so it can be traced.
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.6.2])])
# Helper functions for option handling. -*- Autoconf -*-
# Copyright 2001, 2002 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# serial 2
# _AM_MANGLE_OPTION(NAME)
# -----------------------
AC_DEFUN([_AM_MANGLE_OPTION],
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
# _AM_SET_OPTION(NAME)
# ------------------------------
# Set option NAME. Presently that only means defining a flag for this option.
AC_DEFUN([_AM_SET_OPTION],
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
# _AM_SET_OPTIONS(OPTIONS)
# ----------------------------------
# OPTIONS is a space-separated list of Automake options.
AC_DEFUN([_AM_SET_OPTIONS],
[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
# -------------------------------------------
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
#
# Check to make sure that the build environment is sane.
#
# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# serial 3
# AM_SANITY_CHECK
# ---------------
AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
echo timestamp > conftest.file
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
if test "$[*]" = "X"; then
# -L didn't work.
set X `ls -t $srcdir/configure conftest.file`
fi
rm -f conftest.file
if test "$[*]" != "X $srcdir/configure conftest.file" \
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
alias in your environment])
fi
test "$[2]" = conftest.file
)
then
# Ok.
:
else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
AC_MSG_RESULT(yes)])
# -*- Autoconf -*-
# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# serial 3
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
AC_DEFUN([AM_MISSING_PROG],
[AC_REQUIRE([AM_MISSING_HAS_RUN])
$1=${$1-"${am_missing_run}$2"}
AC_SUBST($1)])
# AM_MISSING_HAS_RUN
# ------------------
# Define MISSING if not defined so far and test if it supports --run.
# If it does, set am_missing_run to use it, otherwise, to nothing.
AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
# Use eval to expand $SHELL
if eval "$MISSING --run true"; then
am_missing_run="$MISSING --run "
else
am_missing_run=
AC_MSG_WARN([`missing' script is too old or missing])
fi
])
# AM_AUX_DIR_EXPAND
# Copyright 2001 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
#
# Of course, Automake must honor this variable whenever it calls a
# tool from the auxiliary directory. The problem is that $srcdir (and
# therefore $ac_aux_dir as well) can be either absolute or relative,
# depending on how configure is run. This is pretty annoying, since
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
# source directory, any form will work fine, but in subdirectories a
# relative path needs to be adjusted first.
#
# $ac_aux_dir/missing
# fails when called from a subdirectory if $ac_aux_dir is relative
# $top_srcdir/$ac_aux_dir/missing
# fails if $ac_aux_dir is absolute,
# fails when called from a subdirectory in a VPATH build with
# a relative $ac_aux_dir
#
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
# are both prefixed by $srcdir. In an in-source build this is usually
# harmless because $srcdir is `.', but things will broke when you
# start a VPATH build or use an absolute $srcdir.
#
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
# and then we would define $MISSING as
# MISSING="\${SHELL} $am_aux_dir/missing"
# This will work as long as MISSING is not called from configure, because
# unfortunately $(top_srcdir) has no meaning in configure.
# However there are other variables, like CC, which are often used in
# configure, and could therefore not use this "fixed" $ac_aux_dir.
#
# Another solution, used here, is to always expand $ac_aux_dir to an
# absolute PATH. The drawback is that using absolute paths prevent a
# configured tree to be moved without reconfiguration.
# Rely on autoconf to set up CDPATH properly.
AC_PREREQ([2.50])
AC_DEFUN([AM_AUX_DIR_EXPAND], [
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
])
# AM_PROG_INSTALL_SH
# ------------------
# Define $install_sh.
# Copyright 2001 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
install_sh=${install_sh-"$am_aux_dir/install-sh"}
AC_SUBST(install_sh)])
# AM_PROG_INSTALL_STRIP
# Copyright 2001 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# One issue with vendor `install' (even GNU) is that you can't
# specify the program used to strip binaries. This is especially
# annoying in cross-compiling environments, where the build's strip
# is unlikely to handle the host's binaries.
# Fortunately install-sh will honor a STRIPPROG variable, so we
# always use install-sh in `make install-strip', and initialize
# STRIPPROG with the value of the STRIP variable (set by the user).
AC_DEFUN([AM_PROG_INSTALL_STRIP],
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
# Installed binaries are usually stripped using `strip' when the user
# run `make install-strip'. However `strip' might not be the right
# tool to use in cross-compilation environments, therefore Automake
# will honor the `STRIP' environment variable to overrule this program.
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
if test "$cross_compiling" != no; then
AC_CHECK_TOOL([STRIP], [strip], :)
fi
INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
# serial 4 -*- Autoconf -*-
# Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4,
# will think it sees a *use*, and therefore will trigger all it's
# C support machinery. Also note that it means that autoscan, seeing
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
# _AM_DEPENDENCIES(NAME)
# ----------------------
# See how the compiler implements dependency checking.
# NAME is "CC", "CXX", "GCJ", or "OBJC".
# We try a few techniques and use that to set a single cache variable.
#
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
# dependency, and given that the user is not expected to run this macro,
# just rely on AC_PROG_CC.
AC_DEFUN([_AM_DEPENDENCIES],
[AC_REQUIRE([AM_SET_DEPDIR])dnl
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
AC_REQUIRE([AM_DEP_TRACK])dnl
ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
[$1], CXX, [depcc="$CXX" am_compiler_list=],
[$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
[$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
[depcc="$$1" am_compiler_list=])
AC_CACHE_CHECK([dependency style of $depcc],
[am_cv_$1_dependencies_compiler_type],
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
# instance it was reported that on HP-UX the gcc test will end up
# making a dummy file named `D' -- because `-MD' means `put the output
# in D'.
mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory.
cp "$am_depcomp" conftest.dir
cd conftest.dir
am_cv_$1_dependencies_compiler_type=none
if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
fi
for depmode in $am_compiler_list; do
# We need to recreate these files for each test, as the compiler may
# overwrite some of them when testing with obscure command lines.
# This happens at least with the AIX C compiler.
echo '#include "conftest.h"' > conftest.c
echo 'int i;' > conftest.h
echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
case $depmode in
nosideeffect)
# after this tag, mechanisms are not by side-effect, so they'll
# only be used when explicitly requested
if test "x$enable_dependency_tracking" = xyes; then
continue
else
break
fi
;;
none) break ;;
esac
# We check with `-c' and `-o' for the sake of the "dashmstdout"
# mode. It turns out that the SunPro C++ compiler does not properly
# handle `-M -o', and we need to detect this.
if depmode=$depmode \
source=conftest.c object=conftest.o \
depfile=conftest.Po tmpdepfile=conftest.TPo \
$SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
grep conftest.h conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
am_cv_$1_dependencies_compiler_type=$depmode
break
fi
done
cd ..
rm -rf conftest.dir
else
am_cv_$1_dependencies_compiler_type=none
fi
])
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
])
# AM_SET_DEPDIR
# -------------
# Choose a directory name for dependency files.
# This macro is AC_REQUIREd in _AM_DEPENDENCIES
AC_DEFUN([AM_SET_DEPDIR],
[rm -f .deps 2>/dev/null
mkdir .deps 2>/dev/null
if test -d .deps; then
DEPDIR=.deps
else
# MS-DOS does not allow filenames that begin with a dot.
DEPDIR=_deps
fi
rmdir .deps 2>/dev/null
AC_SUBST([DEPDIR])
])
# AM_DEP_TRACK
# ------------
AC_DEFUN([AM_DEP_TRACK],
[AC_ARG_ENABLE(dependency-tracking,
[ --disable-dependency-tracking Speeds up one-time builds
--enable-dependency-tracking Do not reject slow dependency extractors])
if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\'
fi
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
AC_SUBST([AMDEPBACKSLASH])
])
# Generate code to set up dependency tracking. -*- Autoconf -*-
# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
#serial 2
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
[for mf in $CONFIG_FILES; do
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
# We used to match only the files named `Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
# So let's grep whole file.
if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
dirpart=`AS_DIRNAME("$mf")`
else
continue
fi
grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
# Extract the definition of DEP_FILES from the Makefile without
# running `make'.
DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
test -z "$DEPDIR" && continue
# When using ansi2knr, U may be empty or an underscore; expand it
U=`sed -n -e '/^U = / s///p' < "$mf"`
test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
# We invoke sed twice because it is the simplest approach to
# changing $(DEPDIR) to its actual value in the expansion.
for file in `sed -n -e '
/^DEP_FILES = .*\\\\$/ {
s/^DEP_FILES = //
:loop
s/\\\\$//
p
n
/\\\\$/ b loop
p
}
/^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`AS_DIRNAME(["$file"])`
AS_MKDIR_P([$dirpart/$fdir])
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
done
done
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
# AM_OUTPUT_DEPENDENCY_COMMANDS
# -----------------------------
# This macro should only be invoked once -- use via AC_REQUIRE.
#
# This code is only required when automatic dependency tracking
# is enabled. FIXME. This creates each `.P' file that we will
# need in order to bootstrap the dependency handling code.
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AC_CONFIG_COMMANDS([depfiles],
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
])
# Copyright 2001 Free Software Foundation, Inc. -*- Autoconf -*-
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# serial 2
# AM_MAKE_INCLUDE()
# -----------------
# Check to see how make treats includes.
AC_DEFUN([AM_MAKE_INCLUDE],
[am_make=${MAKE-make}
cat > confinc << 'END'
doit:
@echo done
END
# If we don't find an include directive, just comment out the code.
AC_MSG_CHECKING([for style of include used by $am_make])
am__include="#"
am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
# We grep out `Entering directory' and `Leaving directory'
# messages which can occur if `w' ends up in MAKEFLAGS.
# In particular we don't look at `^make:' because GNU make might
# be invoked under some other name (usually "gmake"), in which
# case it prints its new name instead of `make'.
if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
am__include=include
am__quote=
_am_result=GNU
fi
# Now try BSD make style include.
if test "$am__include" = "#"; then
echo '.include "confinc"' > confmf
if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
am__include=.include
am__quote="\""
_am_result=BSD
fi
fi
AC_SUBST(am__include)
AC_SUBST(am__quote)
AC_MSG_RESULT($_am_result)
rm -f confinc confmf
])
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# serial 5
AC_PREREQ(2.52)
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
# Define a conditional.
AC_DEFUN([AM_CONDITIONAL],
[ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
AC_SUBST([$1_TRUE])
AC_SUBST([$1_FALSE])
if $2; then
$1_TRUE=
$1_FALSE='#'
else
$1_TRUE='#'
$1_FALSE=
fi
AC_CONFIG_COMMANDS_PRE(
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
AC_MSG_ERROR([conditional \"$1\" was never defined.
Usually this means the macro was only invoked conditionally.])
fi])])
# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
AC_PREREQ([2.52])
# serial 6
# When config.status generates a header, we must update the stamp-h file.
# This file resides in the same directory as the config header
# that is generated. We must strip everything past the first ":",
# and everything past the last "/".
# _AM_DIRNAME(PATH)
# -----------------
# Like AS_DIRNAME, only do it during macro expansion
AC_DEFUN([_AM_DIRNAME],
[m4_if(regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,
m4_if(regexp([$1], [^//\([^/]\|$\)]), -1,
m4_if(regexp([$1], [^/.*]), -1,
[.],
patsubst([$1], [^\(/\).*], [\1])),
patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl
])# _AM_DIRNAME
# The stamp files are numbered to have different names.
# We could number them on a directory basis, but that's additional
# complications, let's have a unique counter.
m4_define([_AM_STAMP_Count], [0])
# _AM_STAMP(HEADER)
# -----------------
# The name of the stamp file for HEADER.
AC_DEFUN([_AM_STAMP],
[m4_define([_AM_STAMP_Count], m4_incr(_AM_STAMP_Count))dnl
AS_ESCAPE(_AM_DIRNAME(patsubst([$1],
[:.*])))/stamp-h[]_AM_STAMP_Count])
# _AM_CONFIG_HEADER(HEADER[:SOURCES], COMMANDS, INIT-COMMANDS)
# ------------------------------------------------------------
# We used to try to get a real timestamp in stamp-h. But the fear is that
# that will cause unnecessary cvs conflicts.
AC_DEFUN([_AM_CONFIG_HEADER],
[# Add the stamp file to the list of files AC keeps track of,
# along with our hook.
AC_CONFIG_HEADERS([$1],
[# update the timestamp
echo 'timestamp for $1' >"_AM_STAMP([$1])"
$2],
[$3])
])# _AM_CONFIG_HEADER
# AM_CONFIG_HEADER(HEADER[:SOURCES]..., COMMANDS, INIT-COMMANDS)
# --------------------------------------------------------------
AC_DEFUN([AM_CONFIG_HEADER],
[AC_FOREACH([_AM_File], [$1], [_AM_CONFIG_HEADER(_AM_File, [$2], [$3])])
])# AM_CONFIG_HEADER
# Add --enable-maintainer-mode option to configure.
# From Jim Meyering
# Copyright 1996, 1998, 2000, 2001 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# serial 1
AC_DEFUN([AM_MAINTAINER_MODE],
[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
dnl maintainer-mode is disabled by default
AC_ARG_ENABLE(maintainer-mode,
[ --enable-maintainer-mode enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer],
USE_MAINTAINER_MODE=$enableval,
USE_MAINTAINER_MODE=no)
AC_MSG_RESULT([$USE_MAINTAINER_MODE])
AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
MAINT=$MAINTAINER_MODE_TRUE
AC_SUBST(MAINT)dnl
]
)
# serial 1
dnl mfx_PROG_MAKE_GNU(NAME)
AC_DEFUN(mfx_PROG_MAKE_GNU,
[AC_MSG_CHECKING([whether we are using GNU make])
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
if (${MAKE-make} --version) 2>&1 </dev/null | grep 'GNU' >/dev/null; then
$1=yes
AC_MSG_RESULT(yes)
else
$1=no
AC_MSG_RESULT(no)
fi
AC_SUBST($1)])
# libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
# serial 46 AC_PROG_LIBTOOL
AC_DEFUN([AC_PROG_LIBTOOL],
[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
# This can be used to rebuild libtool when needed
LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
# Always use our own libtool.
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
AC_SUBST(LIBTOOL)dnl
# Prevent multiple expansion
define([AC_PROG_LIBTOOL], [])
])
AC_DEFUN([AC_LIBTOOL_SETUP],
[AC_PREREQ(2.13)dnl
AC_REQUIRE([AC_ENABLE_SHARED])dnl
AC_REQUIRE([AC_ENABLE_STATIC])dnl
AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_LD])dnl
AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
AC_REQUIRE([AC_PROG_NM])dnl
AC_REQUIRE([LT_AC_PROG_SED])dnl
AC_REQUIRE([AC_PROG_LN_S])dnl
AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
AC_REQUIRE([AC_OBJEXT])dnl
AC_REQUIRE([AC_EXEEXT])dnl
dnl
_LT_AC_PROG_ECHO_BACKSLASH
# Only perform the check for file, if the check method requires it
case $deplibs_check_method in
file_magic*)
if test "$file_magic_cmd" = '$MAGIC_CMD'; then
AC_PATH_MAGIC
fi
;;
esac
AC_CHECK_TOOL(RANLIB, ranlib, :)
AC_CHECK_TOOL(STRIP, strip, :)
ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
enable_win32_dll=yes, enable_win32_dll=no)
AC_ARG_ENABLE(libtool-lock,
[ --disable-libtool-lock avoid locking (might break parallel builds)])
test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
# Some flags need to be propagated to the compiler or linker for good
# libtool support.
case $host in
*-*-irix6*)
# Find out which ABI we are using.
echo '[#]line __oline__ "configure"' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
case `/usr/bin/file conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -32"
;;
*N32*)
LD="${LD-ld} -n32"
;;
*64-bit*)
LD="${LD-ld} -64"
;;
esac
fi
rm -rf conftest*
;;
*-*-sco3.2v5*)
# On SCO OpenServer 5, we need -belf to get full-featured binaries.
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
[AC_LANG_SAVE
AC_LANG_C
AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
AC_LANG_RESTORE])
if test x"$lt_cv_cc_needs_belf" != x"yes"; then
# this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
CFLAGS="$SAVE_CFLAGS"
fi
;;
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(AS, as, false)
AC_CHECK_TOOL(OBJDUMP, objdump, false)
# recent cygwin and mingw systems supply a stub DllMain which the user
# can override, but on older systems we have to supply one
AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
[AC_TRY_LINK([],
[extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
DllMain (0, 0, 0);],
[lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
case $host/$CC in
*-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
# old mingw systems require "-dll" to link a DLL, while more recent ones
# require "-mdll"
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -mdll"
AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
[AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
CFLAGS="$SAVE_CFLAGS" ;;
*-*-cygwin* | *-*-pw32*)
# cygwin systems need to pass --dll to the linker, and not link
# crt.o which will require a WinMain@16 definition.
lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
esac
;;
])
esac
_LT_AC_LTCONFIG_HACK
])
# AC_LIBTOOL_HEADER_ASSERT
# ------------------------
AC_DEFUN([AC_LIBTOOL_HEADER_ASSERT],
[AC_CACHE_CHECK([whether $CC supports assert without backlinking],
[lt_cv_func_assert_works],
[case $host in
*-*-solaris*)
if test "$GCC" = yes && test "$with_gnu_ld" != yes; then
case `$CC --version 2>/dev/null` in
[[12]].*) lt_cv_func_assert_works=no ;;
*) lt_cv_func_assert_works=yes ;;
esac
fi
;;
esac])
if test "x$lt_cv_func_assert_works" = xyes; then
AC_CHECK_HEADERS(assert.h)
fi
])# AC_LIBTOOL_HEADER_ASSERT
# _LT_AC_CHECK_DLFCN
# --------------------
AC_DEFUN([_LT_AC_CHECK_DLFCN],
[AC_CHECK_HEADERS(dlfcn.h)
])# _LT_AC_CHECK_DLFCN
# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
# ---------------------------------
AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
[AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AC_PROG_NM])
AC_REQUIRE([AC_OBJEXT])
# Check for command to grab the raw symbol name followed by C symbol from nm.
AC_MSG_CHECKING([command to parse $NM output])
AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [dnl
# These are sane defaults that work on at least a few old systems.
# [They come from Ultrix. What could be older than Ultrix?!! ;)]
# Character class describing NM global symbol codes.
symcode='[[BCDEGRST]]'
# Regexp to match symbols that can be accessed directly from C.
sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
# Transform the above into a raw symbol and a C symbol.
symxfrm='\1 \2\3 \3'
# Transform an extracted symbol line into a proper C declaration
lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
# Transform an extracted symbol line into symbol name and symbol address
lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
# Define system-specific variables.
case $host_os in
aix*)
symcode='[[BCDT]]'
;;
cygwin* | mingw* | pw32*)
symcode='[[ABCDGISTW]]'
;;
hpux*) # Its linker distinguishes data from code symbols
lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
;;
irix* | nonstopux*)
symcode='[[BCDEGRST]]'
;;
solaris* | sysv5*)
symcode='[[BDT]]'
;;
sysv4)
symcode='[[DFNSTU]]'
;;
esac
# Handle CRLF in mingw tool chain
opt_cr=
case $host_os in
mingw*)
opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
;;
esac
# If we're using GNU nm, then use its standard symbol codes.
if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
symcode='[[ABCDGISTW]]'
fi
# Try without a prefix undercore, then with it.
for ac_symprfx in "" "_"; do
# Write the raw and C identifiers.
lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
# Check to see that the pipe works correctly.
pipe_works=no
rm -f conftest*
cat > conftest.$ac_ext <<EOF
#ifdef __cplusplus
extern "C" {
#endif
char nm_test_var;
void nm_test_func(){}
#ifdef __cplusplus
}
#endif
int main(){nm_test_var='a';nm_test_func();return(0);}
EOF
if AC_TRY_EVAL(ac_compile); then
# Now try to grab the symbols.
nlist=conftest.nm
if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
# Try sorting and uniquifying the output.
if sort "$nlist" | uniq > "$nlist"T; then
mv -f "$nlist"T "$nlist"
else
rm -f "$nlist"T
fi
# Make sure that we snagged all the symbols we need.
if egrep ' nm_test_var$' "$nlist" >/dev/null; then
if egrep ' nm_test_func$' "$nlist" >/dev/null; then
cat <<EOF > conftest.$ac_ext
#ifdef __cplusplus
extern "C" {
#endif
EOF
# Now generate the symbol file.
eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
cat <<EOF >> conftest.$ac_ext
#if defined (__STDC__) && __STDC__
# define lt_ptr void *
#else
# define lt_ptr char *
# define const
#endif
/* The mapping between symbol names and symbols. */
const struct {
const char *name;
lt_ptr address;
}
lt_preloaded_symbols[[]] =
{
EOF
sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
cat <<\EOF >> conftest.$ac_ext
{0, (lt_ptr) 0}
};
#ifdef __cplusplus
}
#endif
EOF
# Now try linking the two files.
mv conftest.$ac_objext conftstm.$ac_objext
save_LIBS="$LIBS"
save_CFLAGS="$CFLAGS"
LIBS="conftstm.$ac_objext"
CFLAGS="$CFLAGS$no_builtin_flag"
if AC_TRY_EVAL(ac_link) && test -s conftest; then
pipe_works=yes
fi
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
else
echo "cannot find nm_test_func in $nlist" >&AC_FD_CC
fi
else
echo "cannot find nm_test_var in $nlist" >&AC_FD_CC
fi
else
echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC
fi
else
echo "$progname: failed program was:" >&AC_FD_CC
cat conftest.$ac_ext >&5
fi
rm -f conftest* conftst*
# Do not use the global_symbol_pipe unless it works.
if test "$pipe_works" = yes; then
break
else
lt_cv_sys_global_symbol_pipe=
fi
done
])
global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
if test -z "$lt_cv_sys_global_symbol_pipe"; then
global_symbol_to_cdecl=
global_symbol_to_c_name_address=
else
global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
fi
if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
then
AC_MSG_RESULT(failed)
else
AC_MSG_RESULT(ok)
fi
]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
# ---------------------------------
AC_DEFUN([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR],
[# Find the correct PATH separator. Usually this is `:', but
# DJGPP uses `;' like DOS.
if test "X${PATH_SEPARATOR+set}" != Xset; then
UNAME=${UNAME-`uname 2>/dev/null`}
case X$UNAME in
*-DOS) lt_cv_sys_path_separator=';' ;;
*) lt_cv_sys_path_separator=':' ;;
esac
PATH_SEPARATOR=$lt_cv_sys_path_separator
fi
])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
# _LT_AC_PROG_ECHO_BACKSLASH
# --------------------------
# Add some code to the start of the generated configure script which
# will find an echo command which doesn't interpret backslashes.
AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
[ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
[AC_DIVERT_PUSH(NOTICE)])
_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
# Check that we are running under the correct shell.
SHELL=${CONFIG_SHELL-/bin/sh}
case X$ECHO in
X*--fallback-echo)
# Remove one level of quotation (which was required for Make).
ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
;;
esac
echo=${ECHO-echo}
if test "X[$]1" = X--no-reexec; then
# Discard the --no-reexec flag, and continue.
shift
elif test "X[$]1" = X--fallback-echo; then
# Avoid inline document here, it may be left over
:
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
# Yippee, $echo works!
:
else
# Restart under the correct shell.
exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
fi
if test "X[$]1" = X--fallback-echo; then
# used as fallback echo
shift
cat <<EOF
$*
EOF
exit 0
fi
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
if test -z "$ECHO"; then
if test "X${echo_test_string+set}" != Xset; then
# find a string as large as possible, as long as the shell can cope with it
for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
# expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
if (echo_test_string="`eval $cmd`") 2>/dev/null &&
echo_test_string="`eval $cmd`" &&
(test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
then
break
fi
done
fi
if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
test "X$echo_testing_string" = "X$echo_test_string"; then
:
else
# The Solaris, AIX, and Digital Unix default echo programs unquote
# backslashes. This makes it impossible to quote backslashes using
# echo "$something" | sed 's/\\/\\\\/g'
#
# So, first we look for a working echo in the user's PATH.
IFS="${IFS= }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
for dir in $PATH /usr/ucb; do
if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
test "X$echo_testing_string" = "X$echo_test_string"; then
echo="$dir/echo"
break
fi
done
IFS="$save_ifs"
if test "X$echo" = Xecho; then
# We didn't find a better echo, so look for alternatives.
if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
test "X$echo_testing_string" = "X$echo_test_string"; then
# This shell has a builtin print -r that does the trick.
echo='print -r'
elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
test "X$CONFIG_SHELL" != X/bin/ksh; then
# If we have ksh, try running configure again with it.
ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
export ORIGINAL_CONFIG_SHELL
CONFIG_SHELL=/bin/ksh
export CONFIG_SHELL
exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
else
# Try using printf.
echo='printf %s\n'
if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
test "X$echo_testing_string" = "X$echo_test_string"; then
# Cool, printf works
:
elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
test "X$echo_testing_string" = 'X\t' &&
echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
test "X$echo_testing_string" = "X$echo_test_string"; then
CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
export CONFIG_SHELL
SHELL="$CONFIG_SHELL"
export SHELL
echo="$CONFIG_SHELL [$]0 --fallback-echo"
elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
test "X$echo_testing_string" = 'X\t' &&
echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
test "X$echo_testing_string" = "X$echo_test_string"; then
echo="$CONFIG_SHELL [$]0 --fallback-echo"
else
# maybe with a smaller string...
prev=:
for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
then
break
fi
prev="$cmd"
done
if test "$prev" != 'sed 50q "[$]0"'; then
echo_test_string=`eval $prev`
export echo_test_string
exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
else
# Oops. We lost completely, so just stick with echo.
echo=echo
fi
fi
fi
fi
fi
fi
# Copy echo and quote the copy suitably for passing to libtool from
# the Makefile, instead of quoting the original, which is used later.
ECHO=$echo
if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
fi
AC_SUBST(ECHO)
AC_DIVERT_POP
])# _LT_AC_PROG_ECHO_BACKSLASH
# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
# ------------------------------------------------------------------
AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
[if test "$cross_compiling" = yes; then :
[$4]
else
AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
[#line __oline__ "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
#include <dlfcn.h>
#endif
#include <stdio.h>
#ifdef RTLD_GLOBAL
# define LT_DLGLOBAL RTLD_GLOBAL
#else
# ifdef DL_GLOBAL
# define LT_DLGLOBAL DL_GLOBAL
# else
# define LT_DLGLOBAL 0
# endif
#endif
/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
find out it does not work in some platform. */
#ifndef LT_DLLAZY_OR_NOW
# ifdef RTLD_LAZY
# define LT_DLLAZY_OR_NOW RTLD_LAZY
# else
# ifdef DL_LAZY
# define LT_DLLAZY_OR_NOW DL_LAZY
# else
# ifdef RTLD_NOW
# define LT_DLLAZY_OR_NOW RTLD_NOW
# else
# ifdef DL_NOW
# define LT_DLLAZY_OR_NOW DL_NOW
# else
# define LT_DLLAZY_OR_NOW 0
# endif
# endif
# endif
# endif
#endif
#ifdef __cplusplus
extern "C" void exit (int);
#endif
void fnord() { int i=42;}
int main ()
{
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
int status = $lt_dlunknown;
if (self)
{
if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
/* dlclose (self); */
}
exit (status);
}]
EOF
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
(./conftest; exit; ) 2>/dev/null
lt_status=$?
case x$lt_status in
x$lt_dlno_uscore) $1 ;;
x$lt_dlneed_uscore) $2 ;;
x$lt_unknown|x*) $3 ;;
esac
else :
# compilation failed
$3
fi
fi
rm -fr conftest*
])# _LT_AC_TRY_DLOPEN_SELF
# AC_LIBTOOL_DLOPEN_SELF
# -------------------
AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
[if test "x$enable_dlopen" != xyes; then
enable_dlopen=unknown
enable_dlopen_self=unknown
enable_dlopen_self_static=unknown
else
lt_cv_dlopen=no
lt_cv_dlopen_libs=
case $host_os in
beos*)
lt_cv_dlopen="load_add_on"
lt_cv_dlopen_libs=
lt_cv_dlopen_self=yes
;;
cygwin* | mingw* | pw32*)
lt_cv_dlopen="LoadLibrary"
lt_cv_dlopen_libs=
;;
*)
AC_CHECK_FUNC([shl_load],
[lt_cv_dlopen="shl_load"],
[AC_CHECK_LIB([dld], [shl_load],
[lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
[AC_CHECK_FUNC([dlopen],
[lt_cv_dlopen="dlopen"],
[AC_CHECK_LIB([dl], [dlopen],
[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
[AC_CHECK_LIB([svld], [dlopen],
[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
[AC_CHECK_LIB([dld], [dld_link],
[lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
])
])
])
])
])
;;
esac
if test "x$lt_cv_dlopen" != xno; then
enable_dlopen=yes
else
enable_dlopen=no
fi
case $lt_cv_dlopen in
dlopen)
save_CPPFLAGS="$CPPFLAGS"
AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
save_LDFLAGS="$LDFLAGS"
eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
save_LIBS="$LIBS"
LIBS="$lt_cv_dlopen_libs $LIBS"
AC_CACHE_CHECK([whether a program can dlopen itself],
lt_cv_dlopen_self, [dnl
_LT_AC_TRY_DLOPEN_SELF(
lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
])
if test "x$lt_cv_dlopen_self" = xyes; then
LDFLAGS="$LDFLAGS $link_static_flag"
AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
lt_cv_dlopen_self_static, [dnl
_LT_AC_TRY_DLOPEN_SELF(
lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
])
fi
CPPFLAGS="$save_CPPFLAGS"
LDFLAGS="$save_LDFLAGS"
LIBS="$save_LIBS"
;;
esac
case $lt_cv_dlopen_self in
yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
*) enable_dlopen_self=unknown ;;
esac
case $lt_cv_dlopen_self_static in
yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
*) enable_dlopen_self_static=unknown ;;
esac
fi
])# AC_LIBTOOL_DLOPEN_SELF
AC_DEFUN([_LT_AC_LTCONFIG_HACK],
[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
Xsed='sed -e s/^X//'
sed_quote_subst='s/\([[\\"\\`$\\\\]]\)/\\\1/g'
# Same as above, but do not quote variable references.
double_quote_subst='s/\([[\\"\\`\\\\]]\)/\\\1/g'
# Sed substitution to delay expansion of an escaped shell variable in a
# double_quote_subst'ed string.
delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
# Constants:
rm="rm -f"
# Global variables:
default_ofile=libtool
can_build_shared=yes
# All known linkers require a `.a' archive for static linking (except M$VC,
# which needs '.lib').
libext=a
ltmain="$ac_aux_dir/ltmain.sh"
ofile="$default_ofile"
with_gnu_ld="$lt_cv_prog_gnu_ld"
need_locks="$enable_libtool_lock"
old_CC="$CC"
old_CFLAGS="$CFLAGS"
# Set sane defaults for various variables
test -z "$AR" && AR=ar
test -z "$AR_FLAGS" && AR_FLAGS=cru
test -z "$AS" && AS=as
test -z "$CC" && CC=cc
test -z "$DLLTOOL" && DLLTOOL=dlltool
test -z "$LD" && LD=ld
test -z "$LN_S" && LN_S="ln -s"
test -z "$MAGIC_CMD" && MAGIC_CMD=file
test -z "$NM" && NM=nm
test -z "$OBJDUMP" && OBJDUMP=objdump
test -z "$RANLIB" && RANLIB=:
test -z "$STRIP" && STRIP=:
test -z "$ac_objext" && ac_objext=o
if test x"$host" != x"$build"; then
ac_tool_prefix=${host_alias}-
else
ac_tool_prefix=
fi
# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
case $host_os in
linux-gnu*) ;;
linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
esac
case $host_os in
aix3*)
# AIX sometimes has problems with the GCC collect2 program. For some
# reason, if we set the COLLECT_NAMES environment variable, the problems
# vanish in a puff of smoke.
if test "X${COLLECT_NAMES+set}" != Xset; then
COLLECT_NAMES=
export COLLECT_NAMES
fi
;;
esac
# Determine commands to create old-style static archives.
old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
old_postinstall_cmds='chmod 644 $oldlib'
old_postuninstall_cmds=
if test -n "$RANLIB"; then
case $host_os in
openbsd*)
old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
;;
*)
old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
;;
esac
old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
fi
# Allow CC to be a program name with arguments.
set dummy $CC
compiler="[$]2"
AC_MSG_CHECKING([for objdir])
rm -f .libs 2>/dev/null
mkdir .libs 2>/dev/null
if test -d .libs; then
objdir=.libs
else
# MS-DOS does not allow filenames that begin with a dot.
objdir=_libs
fi
rmdir .libs 2>/dev/null
AC_MSG_RESULT($objdir)
AC_ARG_WITH(pic,
[ --with-pic try to use only PIC/non-PIC objects [default=use both]],
pic_mode="$withval", pic_mode=default)
test -z "$pic_mode" && pic_mode=default
# We assume here that the value for lt_cv_prog_cc_pic will not be cached
# in isolation, and that seeing it set (from the cache) indicates that
# the associated values are set (in the cache) correctly too.
AC_MSG_CHECKING([for $compiler option to produce PIC])
AC_CACHE_VAL(lt_cv_prog_cc_pic,
[ lt_cv_prog_cc_pic=
lt_cv_prog_cc_shlib=
lt_cv_prog_cc_wl=
lt_cv_prog_cc_static=
lt_cv_prog_cc_no_builtin=
lt_cv_prog_cc_can_build_shared=$can_build_shared
if test "$GCC" = yes; then
lt_cv_prog_cc_wl='-Wl,'
lt_cv_prog_cc_static='-static'
case $host_os in
aix*)
# Below there is a dirty hack to force normal static linking with -ldl
# The problem is because libdl dynamically linked with both libc and
# libC (AIX C++ library), which obviously doesn't included in libraries
# list by gcc. This cause undefined symbols with -static flags.
# This hack allows C programs to be linked with "-static -ldl", but
# not sure about C++ programs.
lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
;;
amigaos*)
# FIXME: we need at least 68020 code to build shared libraries, but
# adding the `-m68020' flag to GCC prevents building anything better,
# like `-m68040'.
lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
;;
beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
darwin* | rhapsody*)
# PIC is the default on this platform
# Common symbols not allowed in MH_DYLIB files
lt_cv_prog_cc_pic='-fno-common'
;;
cygwin* | mingw* | pw32* | os2*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
lt_cv_prog_cc_pic='-DDLL_EXPORT'
;;
sysv4*MP*)
if test -d /usr/nec; then
lt_cv_prog_cc_pic=-Kconform_pic
fi
;;
*)
lt_cv_prog_cc_pic='-fPIC'
;;
esac
else
# PORTME Check for PIC flags for the system compiler.
case $host_os in
aix3* | aix4* | aix5*)
lt_cv_prog_cc_wl='-Wl,'
# All AIX code is PIC.
if test "$host_cpu" = ia64; then
# AIX 5 now supports IA64 processor
lt_cv_prog_cc_static='-Bstatic'
else
lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
fi
;;
hpux9* | hpux10* | hpux11*)
# Is there a better lt_cv_prog_cc_static that works with the bundled CC?
lt_cv_prog_cc_wl='-Wl,'
lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
lt_cv_prog_cc_pic='+Z'
;;
irix5* | irix6* | nonstopux*)
lt_cv_prog_cc_wl='-Wl,'
lt_cv_prog_cc_static='-non_shared'
# PIC (with -KPIC) is the default.
;;
cygwin* | mingw* | pw32* | os2*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
lt_cv_prog_cc_pic='-DDLL_EXPORT'
;;
newsos6)
lt_cv_prog_cc_pic='-KPIC'
lt_cv_prog_cc_static='-Bstatic'
;;
osf3* | osf4* | osf5*)
# All OSF/1 code is PIC.
lt_cv_prog_cc_wl='-Wl,'
lt_cv_prog_cc_static='-non_shared'
;;
sco3.2v5*)
lt_cv_prog_cc_pic='-Kpic'
lt_cv_prog_cc_static='-dn'
lt_cv_prog_cc_shlib='-belf'
;;
solaris*)
lt_cv_prog_cc_pic='-KPIC'
lt_cv_prog_cc_static='-Bstatic'
lt_cv_prog_cc_wl='-Wl,'
;;
sunos4*)
lt_cv_prog_cc_pic='-PIC'
lt_cv_prog_cc_static='-Bstatic'
lt_cv_prog_cc_wl='-Qoption ld '
;;
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
lt_cv_prog_cc_pic='-KPIC'
lt_cv_prog_cc_static='-Bstatic'
lt_cv_prog_cc_wl='-Wl,'
;;
uts4*)
lt_cv_prog_cc_pic='-pic'
lt_cv_prog_cc_static='-Bstatic'
;;
sysv4*MP*)
if test -d /usr/nec ;then
lt_cv_prog_cc_pic='-Kconform_pic'
lt_cv_prog_cc_static='-Bstatic'
fi
;;
*)
lt_cv_prog_cc_can_build_shared=no
;;
esac
fi
])
if test -z "$lt_cv_prog_cc_pic"; then
AC_MSG_RESULT([none])
else
AC_MSG_RESULT([$lt_cv_prog_cc_pic])
# Check to make sure the pic_flag actually works.
AC_MSG_CHECKING([if $compiler PIC flag $lt_cv_prog_cc_pic works])
AC_CACHE_VAL(lt_cv_prog_cc_pic_works, [dnl
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
AC_TRY_COMPILE([], [], [dnl
case $host_os in
hpux9* | hpux10* | hpux11*)
# On HP-UX, both CC and GCC only warn that PIC is supported... then
# they create non-PIC objects. So, if there were any warnings, we
# assume that PIC is not supported.
if test -s conftest.err; then
lt_cv_prog_cc_pic_works=no
else
lt_cv_prog_cc_pic_works=yes
fi
;;
*)
lt_cv_prog_cc_pic_works=yes
;;
esac
], [dnl
lt_cv_prog_cc_pic_works=no
])
CFLAGS="$save_CFLAGS"
])
if test "X$lt_cv_prog_cc_pic_works" = Xno; then
lt_cv_prog_cc_pic=
lt_cv_prog_cc_can_build_shared=no
else
lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
fi
AC_MSG_RESULT([$lt_cv_prog_cc_pic_works])
fi
# Check for any special shared library compilation flags.
if test -n "$lt_cv_prog_cc_shlib"; then
AC_MSG_WARN([\`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries])
if echo "$old_CC $old_CFLAGS " | egrep -e "[[ ]]$lt_cv_prog_cc_shlib[[ ]]" >/dev/null; then :
else
AC_MSG_WARN([add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure])
lt_cv_prog_cc_can_build_shared=no
fi
fi
AC_MSG_CHECKING([if $compiler static flag $lt_cv_prog_cc_static works])
AC_CACHE_VAL([lt_cv_prog_cc_static_works], [dnl
lt_cv_prog_cc_static_works=no
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
AC_TRY_LINK([], [], [lt_cv_prog_cc_static_works=yes])
LDFLAGS="$save_LDFLAGS"
])
# Belt *and* braces to stop my trousers falling down:
test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
AC_MSG_RESULT([$lt_cv_prog_cc_static_works])
pic_flag="$lt_cv_prog_cc_pic"
special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
wl="$lt_cv_prog_cc_wl"
link_static_flag="$lt_cv_prog_cc_static"
no_builtin_flag="$lt_cv_prog_cc_no_builtin"
can_build_shared="$lt_cv_prog_cc_can_build_shared"
# Check to see if options -o and -c are simultaneously supported by compiler
AC_MSG_CHECKING([if $compiler supports -c -o file.$ac_objext])
AC_CACHE_VAL([lt_cv_compiler_c_o], [
$rm -r conftest 2>/dev/null
mkdir conftest
cd conftest
echo "int some_variable = 0;" > conftest.$ac_ext
mkdir out
# According to Tom Tromey, Ian Lance Taylor reported there are C compilers
# that will create temporary files in the current directory regardless of
# the output directory. Thus, making CWD read-only will cause this test
# to fail, enabling locking or at least warning the user not to do parallel
# builds.
chmod -w .
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
compiler_c_o=no
if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
if test -s out/conftest.err; then
lt_cv_compiler_c_o=no
else
lt_cv_compiler_c_o=yes
fi
else
# Append any errors to the config.log.
cat out/conftest.err 1>&AC_FD_CC
lt_cv_compiler_c_o=no
fi
CFLAGS="$save_CFLAGS"
chmod u+w .
$rm conftest* out/*
rmdir out
cd ..
rmdir conftest
$rm -r conftest 2>/dev/null
])
compiler_c_o=$lt_cv_compiler_c_o
AC_MSG_RESULT([$compiler_c_o])
if test x"$compiler_c_o" = x"yes"; then
# Check to see if we can write to a .lo
AC_MSG_CHECKING([if $compiler supports -c -o file.lo])
AC_CACHE_VAL([lt_cv_compiler_o_lo], [
lt_cv_compiler_o_lo=no
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -c -o conftest.lo"
save_objext="$ac_objext"
ac_objext=lo
AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
if test -s conftest.err; then
lt_cv_compiler_o_lo=no
else
lt_cv_compiler_o_lo=yes
fi
])
ac_objext="$save_objext"
CFLAGS="$save_CFLAGS"
])
compiler_o_lo=$lt_cv_compiler_o_lo
AC_MSG_RESULT([$compiler_o_lo])
else
compiler_o_lo=no
fi
# Check to see if we can do hard links to lock some files if needed
hard_links="nottested"
if test "$compiler_c_o" = no && test "$need_locks" != no; then
# do not overwrite the value of need_locks provided by the user
AC_MSG_CHECKING([if we can lock with hard links])
hard_links=yes
$rm conftest*
ln conftest.a conftest.b 2>/dev/null && hard_links=no
touch conftest.a
ln conftest.a conftest.b 2>&5 || hard_links=no
ln conftest.a conftest.b 2>/dev/null && hard_links=no
AC_MSG_RESULT([$hard_links])
if test "$hard_links" = no; then
AC_MSG_WARN([\`$CC' does not support \`-c -o', so \`make -j' may be unsafe])
need_locks=warn
fi
else
need_locks=no
fi
if test "$GCC" = yes; then
# Check to see if options -fno-rtti -fno-exceptions are supported by compiler
AC_MSG_CHECKING([if $compiler supports -fno-rtti -fno-exceptions])
echo "int some_variable = 0;" > conftest.$ac_ext
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
compiler_rtti_exceptions=no
AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
if test -s conftest.err; then
compiler_rtti_exceptions=no
else
compiler_rtti_exceptions=yes
fi
])
CFLAGS="$save_CFLAGS"
AC_MSG_RESULT([$compiler_rtti_exceptions])
if test "$compiler_rtti_exceptions" = "yes"; then
no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
else
no_builtin_flag=' -fno-builtin'
fi
fi
# See if the linker supports building shared libraries.
AC_MSG_CHECKING([whether the linker ($LD) supports shared libraries])
allow_undefined_flag=
no_undefined_flag=
need_lib_prefix=unknown
need_version=unknown
# when you set need_version to no, make sure it does not cause -set_version
# flags to be left without arguments
archive_cmds=
archive_expsym_cmds=
old_archive_from_new_cmds=
old_archive_from_expsyms_cmds=
export_dynamic_flag_spec=
whole_archive_flag_spec=
thread_safe_flag_spec=
hardcode_into_libs=no
hardcode_libdir_flag_spec=
hardcode_libdir_separator=
hardcode_direct=no
hardcode_minus_L=no
hardcode_shlibpath_var=unsupported
runpath_var=
link_all_deplibs=unknown
always_export_symbols=no
export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
# include_expsyms should be a list of space-separated symbols to be *always*
# included in the symbol list
include_expsyms=
# exclude_expsyms can be an egrep regular expression of symbols to exclude
# it will be wrapped by ` (' and `)$', so one must not match beginning or
# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
# as well as any symbol that contains `d'.
exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
# platforms (ab)use it in PIC code, but their linkers get confused if
# the symbol is explicitly referenced. Since portable code cannot
# rely on this symbol name, it's probably fine to never include it in
# preloaded symbol tables.
extract_expsyms_cmds=
case $host_os in
cygwin* | mingw* | pw32*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
if test "$GCC" != yes; then
with_gnu_ld=no
fi
;;
openbsd*)
with_gnu_ld=no
;;
esac
ld_shlibs=yes
if test "$with_gnu_ld" = yes; then
# If archive_cmds runs LD, not CC, wlarc should be empty
wlarc='${wl}'
# See if GNU ld supports shared libraries.
case $host_os in
aix3* | aix4* | aix5*)
# On AIX, the GNU linker is very broken
# Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
ld_shlibs=no
cat <<EOF 1>&2
*** Warning: the GNU linker, at least up to release 2.9.1, is reported
*** to be unable to reliably create shared libraries on AIX.
*** Therefore, libtool is disabling shared libraries support. If you
*** really care for shared libraries, you may want to modify your PATH
*** so that a non-GNU linker is found, and then restart.
EOF
;;
amigaos*)
archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
# Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
# that the semantics of dynamic libraries on AmigaOS, at least up
# to version 4, is to share data among multiple programs linked
# with the same dynamic library. Since this doesn't match the
# behavior of shared libraries on other platforms, we can use
# them.
ld_shlibs=no
;;
beos*)
if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
allow_undefined_flag=unsupported
# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
# support --undefined. This deserves some investigation. FIXME
archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
else
ld_shlibs=no
fi
;;
cygwin* | mingw* | pw32*)
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
hardcode_libdir_flag_spec='-L$libdir'
allow_undefined_flag=unsupported
always_export_symbols=yes
extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
test -f $output_objdir/impgen.exe || (cd $output_objdir && \
if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
else $CC -o impgen impgen.c ; fi)~
$output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
# cygwin and mingw dlls have different entry points and sets of symbols
# to exclude.
# FIXME: what about values for MSVC?
dll_entry=__cygwin_dll_entry@12
dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
case $host_os in
mingw*)
# mingw values
dll_entry=_DllMainCRTStartup@12
dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
;;
esac
# mingw and cygwin differ, and it's simplest to just exclude the union
# of the two symbol sets.
dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
# recent cygwin and mingw systems supply a stub DllMain which the user
# can override, but on older systems we have to supply one (in ltdll.c)
if test "x$lt_cv_need_dllmain" = "xyes"; then
ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~
test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
else
ltdll_obj=
ltdll_cmds=
fi
# Extract the symbol export list from an `--export-all' def file,
# then regenerate the def file from the symbol export list, so that
# the compiled dll only exports the symbol export list.
# Be careful not to strip the DATA tag left be newer dlltools.
export_symbols_cmds="$ltdll_cmds"'
$DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
sed -e "1,/EXPORTS/d" -e "s/ @ [[0-9]]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
# If the export-symbols file already is a .def file (1st line
# is EXPORTS), use it as is.
# If DATA tags from a recent dlltool are present, honour them!
archive_expsym_cmds='if test "x`sed 1q $export_symbols`" = xEXPORTS; then
cp $export_symbols $output_objdir/$soname-def;
else
echo EXPORTS > $output_objdir/$soname-def;
_lt_hint=1;
cat $export_symbols | while read symbol; do
set dummy \$symbol;
case \[$]# in
2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
4) echo " \[$]2 \[$]3 \[$]4 ; " >> $output_objdir/$soname-def; _lt_hint=`expr \$_lt_hint - 1`;;
*) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
esac;
_lt_hint=`expr 1 + \$_lt_hint`;
done;
fi~
'"$ltdll_cmds"'
$CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
$DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
$CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
$DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~
$CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
;;
netbsd*)
if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
else
archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
fi
;;
solaris* | sysv5*)
if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
ld_shlibs=no
cat <<EOF 1>&2
*** Warning: The releases 2.8.* of the GNU linker cannot reliably
*** create shared libraries on Solaris systems. Therefore, libtool
*** is disabling shared libraries support. We urge you to upgrade GNU
*** binutils to release 2.9.1 or newer. Another option is to modify
*** your PATH or compiler configuration so that the native linker is
*** used, and then restart.
EOF
elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
ld_shlibs=no
fi
;;
sunos4*)
archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
wlarc=
hardcode_direct=yes
hardcode_shlibpath_var=no
;;
*)
if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
ld_shlibs=no
fi
;;
esac
if test "$ld_shlibs" = yes; then
runpath_var=LD_RUN_PATH
hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
export_dynamic_flag_spec='${wl}--export-dynamic'
case $host_os in
cygwin* | mingw* | pw32*)
# dlltool doesn't understand --whole-archive et. al.
whole_archive_flag_spec=
;;
*)
# ancient GNU ld didn't support --whole-archive et. al.
if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
else
whole_archive_flag_spec=
fi
;;
esac
fi
else
# PORTME fill in a description of your system's linker (not GNU ld)
case $host_os in
aix3*)
allow_undefined_flag=unsupported
always_export_symbols=yes
archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
# Note: this linker hardcodes the directories in LIBPATH if there
# are no directories specified by -L.
hardcode_minus_L=yes
if test "$GCC" = yes && test -z "$link_static_flag"; then
# Neither direct hardcoding nor static linking is supported with a
# broken collect2.
hardcode_direct=unsupported
fi
;;
aix4* | aix5*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
aix_use_runtimelinking=no
exp_sym_flag='-Bexport'
no_entry_flag=""
else
aix_use_runtimelinking=no
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
for ld_flag in $LDFLAGS; do
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
aix_use_runtimelinking=yes
break
fi
done
esac
exp_sym_flag='-bexport'
no_entry_flag='-bnoentry'
fi
# When large executables or shared objects are built, AIX ld can
# have problems creating the table of contents. If linking a library
# or program results in "error TOC overflow" add -mminimal-toc to
# CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
# enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
hardcode_direct=yes
archive_cmds=''
hardcode_libdir_separator=':'
if test "$GCC" = yes; then
case $host_os in aix4.[[012]]|aix4.[[012]].*)
collect2name=`${CC} -print-prog-name=collect2`
if test -f "$collect2name" && \
strings "$collect2name" | grep resolve_lib_name >/dev/null
then
# We have reworked collect2
hardcode_direct=yes
else
# We have old collect2
hardcode_direct=unsupported
# It fails to find uninstalled libraries when the uninstalled
# path is not listed in the libpath. Setting hardcode_minus_L
# to unsupported forces relinking
hardcode_minus_L=yes
hardcode_libdir_flag_spec='-L$libdir'
hardcode_libdir_separator=
fi
esac
shared_flag='-shared'
else
# not using gcc
if test "$host_cpu" = ia64; then
shared_flag='${wl}-G'
else
if test "$aix_use_runtimelinking" = yes; then
shared_flag='${wl}-G'
else
shared_flag='${wl}-bM:SRE'
fi
fi
fi
# It seems that -bexpall can do strange things, so it is better to
# generate a list of symbols to export.
always_export_symbols=yes
if test "$aix_use_runtimelinking" = yes; then
# Warning - without using the other runtime loading flags (-brtl),
# -berok will link without error, but may produce a broken library.
allow_undefined_flag='-berok'
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
else
if test "$host_cpu" = ia64; then
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
allow_undefined_flag="-z nodefs"
archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
else
hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
# Warning - without using the other run time loading flags,
# -berok will link without error, but may produce a broken library.
allow_undefined_flag='${wl}-berok'
# This is a bit strange, but is similar to how AIX traditionally builds
# it's shared libraries.
archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname'
fi
fi
;;
amigaos*)
archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
# see comment about different semantics on the GNU ld section
ld_shlibs=no
;;
cygwin* | mingw* | pw32*)
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
hardcode_libdir_flag_spec=' '
allow_undefined_flag=unsupported
# Tell ltmain to make .lib files, not .a files.
libext=lib
# FIXME: Setting linknames here is a bad hack.
archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
# The linker will automatically build a .lib file if we build a DLL.
old_archive_from_new_cmds='true'
# FIXME: Should let the user specify the lib program.
old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
fix_srcfile_path='`cygpath -w "$srcfile"`'
;;
darwin* | rhapsody*)
case "$host_os" in
rhapsody* | darwin1.[[012]])
allow_undefined_flag='-undefined suppress'
;;
*) # Darwin 1.3 on
allow_undefined_flag='-flat_namespace -undefined suppress'
;;
esac
# FIXME: Relying on posixy $() will cause problems for
# cross-compilation, but unfortunately the echo tests do not
# yet detect zsh echo's removal of \ escapes. Also zsh mangles
# `"' quotes if we put them in here... so don't!
archive_cmds='$nonopt $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $verstring'
# We need to add '_' to the symbols in $export_symbols first
#archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
hardcode_direct=yes
hardcode_shlibpath_var=no
whole_archive_flag_spec='-all_load $convenience'
;;
freebsd1*)
ld_shlibs=no
;;
# FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
# support. Future versions do this automatically, but an explicit c++rt0.o
# does not break anything, and helps significantly (at the cost of a little
# extra space).
freebsd2.2*)
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
hardcode_shlibpath_var=no
;;
# Unfortunately, older versions of FreeBSD 2 do not have this feature.
freebsd2*)
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
hardcode_direct=yes
hardcode_minus_L=yes
hardcode_shlibpath_var=no
;;
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
freebsd*)
archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
hardcode_shlibpath_var=no
;;
hpux9* | hpux10* | hpux11*)
case $host_os in
hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
*) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
esac
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
hardcode_direct=yes
hardcode_minus_L=yes # Not in the search PATH, but as the default
# location of the library.
export_dynamic_flag_spec='${wl}-E'
;;
irix5* | irix6* | nonstopux*)
if test "$GCC" = yes; then
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
else
archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
fi
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
link_all_deplibs=yes
;;
netbsd*)
if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
else
archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
fi
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
hardcode_shlibpath_var=no
;;
newsos6)
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
hardcode_direct=yes
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
hardcode_shlibpath_var=no
;;
openbsd*)
hardcode_direct=yes
hardcode_shlibpath_var=no
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags'
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
export_dynamic_flag_spec='${wl}-E'
else
case "$host_os" in
openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
hardcode_libdir_flag_spec='-R$libdir'
;;
*)
archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags'
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
;;
esac
fi
;;
os2*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
allow_undefined_flag=unsupported
archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
;;
osf3*)
if test "$GCC" = yes; then
allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
else
allow_undefined_flag=' -expect_unresolved \*'
archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
fi
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
osf4* | osf5*) # as osf3* with the addition of -msym flag
if test "$GCC" = yes; then
allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
else
allow_undefined_flag=' -expect_unresolved \*'
archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
#Both c and cxx compiler support -rpath directly
hardcode_libdir_flag_spec='-rpath $libdir'
fi
hardcode_libdir_separator=:
;;
sco3.2v5*)
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
hardcode_shlibpath_var=no
runpath_var=LD_RUN_PATH
hardcode_runpath_var=yes
export_dynamic_flag_spec='${wl}-Bexport'
;;
solaris*)
# gcc --version < 3.0 without binutils cannot create self contained
# shared libraries reliably, requiring libgcc.a to resolve some of
# the object symbols generated in some cases. Libraries that use
# assert need libgcc.a to resolve __eprintf, for example. Linking
# a copy of libgcc.a into every shared library to guarantee resolving
# such symbols causes other problems: According to Tim Van Holder
# <tim.van.holder@pandora.be>, C++ libraries end up with a separate
# (to the application) exception stack for one thing.
no_undefined_flag=' -z defs'
if test "$GCC" = yes; then
case `$CC --version 2>/dev/null` in
[[12]].*)
cat <<EOF 1>&2
*** Warning: Releases of GCC earlier than version 3.0 cannot reliably
*** create self contained shared libraries on Solaris systems, without
*** introducing a dependency on libgcc.a. Therefore, libtool is disabling
*** -no-undefined support, which will at least allow you to build shared
*** libraries. However, you may find that when you link such libraries
*** into an application without using GCC, you have to manually add
*** \`gcc --print-libgcc-file-name\` to the link command. We urge you to
*** upgrade to a newer version of GCC. Another option is to rebuild your
*** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.
EOF
no_undefined_flag=
;;
esac
fi
# $CC -shared without GNU ld will not create a library from C++
# object files and a static libstdc++, better avoid it by now
archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
hardcode_libdir_flag_spec='-R$libdir'
hardcode_shlibpath_var=no
case $host_os in
solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
*) # Supported since Solaris 2.6 (maybe 2.5.1?)
whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
esac
link_all_deplibs=yes
;;
sunos4*)
if test "x$host_vendor" = xsequent; then
# Use $CC to link under sequent, because it throws in some extra .o
# files that make .init and .fini sections work.
archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
else
archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
fi
hardcode_libdir_flag_spec='-L$libdir'
hardcode_direct=yes
hardcode_minus_L=yes
hardcode_shlibpath_var=no
;;
sysv4)
case $host_vendor in
sni)
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
hardcode_direct=yes # is this really true???
;;
siemens)
## LD is ld it makes a PLAMLIB
## CC just makes a GrossModule.
archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
reload_cmds='$CC -r -o $output$reload_objs'
hardcode_direct=no
;;
motorola)
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
hardcode_direct=no #Motorola manual says yes, but my tests say they lie
;;
esac
runpath_var='LD_RUN_PATH'
hardcode_shlibpath_var=no
;;
sysv4.3*)
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
hardcode_shlibpath_var=no
export_dynamic_flag_spec='-Bexport'
;;
sysv5*)
no_undefined_flag=' -z text'
# $CC -shared without GNU ld will not create a library from C++
# object files and a static libstdc++, better avoid it by now
archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
hardcode_libdir_flag_spec=
hardcode_shlibpath_var=no
runpath_var='LD_RUN_PATH'
;;
uts4*)
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
hardcode_libdir_flag_spec='-L$libdir'
hardcode_shlibpath_var=no
;;
dgux*)
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
hardcode_libdir_flag_spec='-L$libdir'
hardcode_shlibpath_var=no
;;
sysv4*MP*)
if test -d /usr/nec; then
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
hardcode_shlibpath_var=no
runpath_var=LD_RUN_PATH
hardcode_runpath_var=yes
ld_shlibs=yes
fi
;;
sysv4.2uw2*)
archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
hardcode_direct=yes
hardcode_minus_L=no
hardcode_shlibpath_var=no
hardcode_runpath_var=yes
runpath_var=LD_RUN_PATH
;;
sysv5uw7* | unixware7*)
no_undefined_flag='${wl}-z ${wl}text'
if test "$GCC" = yes; then
archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
else
archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
fi
runpath_var='LD_RUN_PATH'
hardcode_shlibpath_var=no
;;
*)
ld_shlibs=no
;;
esac
fi
AC_MSG_RESULT([$ld_shlibs])
test "$ld_shlibs" = no && can_build_shared=no
# Check hardcoding attributes.
AC_MSG_CHECKING([how to hardcode library paths into programs])
hardcode_action=
if test -n "$hardcode_libdir_flag_spec" || \
test -n "$runpath_var"; then
# We can hardcode non-existant directories.
if test "$hardcode_direct" != no &&
# If the only mechanism to avoid hardcoding is shlibpath_var, we
# have to relink, otherwise we might link with an installed library
# when we should be linking with a yet-to-be-installed one
## test "$hardcode_shlibpath_var" != no &&
test "$hardcode_minus_L" != no; then
# Linking always hardcodes the temporary library directory.
hardcode_action=relink
else
# We can link without hardcoding, and we can hardcode nonexisting dirs.
hardcode_action=immediate
fi
else
# We cannot hardcode anything, or else we can only hardcode existing
# directories.
hardcode_action=unsupported
fi
AC_MSG_RESULT([$hardcode_action])
striplib=
old_striplib=
AC_MSG_CHECKING([whether stripping libraries is possible])
if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
test -z "$striplib" && striplib="$STRIP --strip-unneeded"
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
reload_cmds='$LD$reload_flag -o $output$reload_objs'
test -z "$deplibs_check_method" && deplibs_check_method=unknown
# PORTME Fill in your ld.so characteristics
AC_MSG_CHECKING([dynamic linker characteristics])
library_names_spec=
libname_spec='lib$name'
soname_spec=
postinstall_cmds=
postuninstall_cmds=
finish_cmds=
finish_eval=
shlibpath_var=
shlibpath_overrides_runpath=unknown
version_type=none
dynamic_linker="$host_os ld.so"
sys_lib_dlsearch_path_spec="/lib /usr/lib"
sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
case $host_os in
aix3*)
version_type=linux
library_names_spec='${libname}${release}.so$versuffix $libname.a'
shlibpath_var=LIBPATH
# AIX has no versioning support, so we append a major version to the name.
soname_spec='${libname}${release}.so$major'
;;
aix4* | aix5*)
version_type=linux
if test "$host_cpu" = ia64; then
# AIX 5 supports IA64
library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
shlibpath_var=LD_LIBRARY_PATH
else
# With GCC up to 2.95.x, collect2 would create an import file
# for dependence libraries. The import file would start with
# the line `#! .'. This would cause the generated library to
# depend on `.', always an invalid library. This was fixed in
# development snapshots of GCC prior to 3.0.
case $host_os in
aix4 | aix4.[[01]] | aix4.[[01]].*)
if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
echo ' yes '
echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
:
else
can_build_shared=no
fi
;;
esac
# AIX (on Power*) has no versioning support, so currently we can
# not hardcode correct soname into executable. Probably we can
# add versioning support to collect2, so additional links can
# be useful in future.
if test "$aix_use_runtimelinking" = yes; then
# If using run time linking (on AIX 4.2 or later) use lib<name>.so
# instead of lib<name>.a to let people know that these are not
# typical AIX shared libraries.
library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
else
# We preserve .a as extension for shared libraries through AIX4.2
# and later when we are not doing run time linking.
library_names_spec='${libname}${release}.a $libname.a'
soname_spec='${libname}${release}.so$major'
fi
shlibpath_var=LIBPATH
fi
;;
amigaos*)
library_names_spec='$libname.ixlibrary $libname.a'
# Create ${libname}_ixlibrary.a entries in /sys/libs.
finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
;;
beos*)
library_names_spec='${libname}.so'
dynamic_linker="$host_os ld.so"
shlibpath_var=LIBRARY_PATH
;;
bsdi4*)
version_type=linux
need_version=no
library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
soname_spec='${libname}${release}.so$major'
finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
shlibpath_var=LD_LIBRARY_PATH
sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
export_dynamic_flag_spec=-rdynamic
# the default ld.so.conf also contains /usr/contrib/lib and
# /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
# libtool to hard-code these into programs
;;
cygwin* | mingw* | pw32*)
version_type=windows
need_version=no
need_lib_prefix=no
case $GCC,$host_os in
yes,cygwin*)
library_names_spec='$libname.dll.a'
soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
dldir=$destdir/`dirname \$dlpath`~
test -d \$dldir || mkdir -p \$dldir~
$install_prog .libs/$dlname \$dldir/$dlname'
postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
dlpath=$dir/\$dldll~
$rm \$dlpath'
;;
yes,mingw*)
library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g" -e "s,=/,/,g"`
;;
yes,pw32*)
library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
;;
*)
library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $libname.lib'
;;
esac
dynamic_linker='Win32 ld.exe'
# FIXME: first we should search . and the directory the executable is in
shlibpath_var=PATH
;;
darwin* | rhapsody*)
dynamic_linker="$host_os dyld"
version_type=darwin
need_lib_prefix=no
need_version=no
# FIXME: Relying on posixy $() will cause problems for
# cross-compilation, but unfortunately the echo tests do not
# yet detect zsh echo's removal of \ escapes.
library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)'
soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
shlibpath_overrides_runpath=yes
shlibpath_var=DYLD_LIBRARY_PATH
;;
freebsd1*)
dynamic_linker=no
;;
freebsd*)
objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
version_type=freebsd-$objformat
case $version_type in
freebsd-elf*)
library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
need_version=no
need_lib_prefix=no
;;
freebsd-*)
library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
need_version=yes
;;
esac
shlibpath_var=LD_LIBRARY_PATH
case $host_os in
freebsd2*)
shlibpath_overrides_runpath=yes
;;
*)
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
esac
;;
gnu*)
version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
soname_spec='${libname}${release}.so$major'
shlibpath_var=LD_LIBRARY_PATH
hardcode_into_libs=yes
;;
hpux9* | hpux10* | hpux11*)
# Give a soname corresponding to the major version so that dld.sl refuses to
# link against other versions.
dynamic_linker="$host_os dld.sl"
version_type=sunos
need_lib_prefix=no
need_version=no
shlibpath_var=SHLIB_PATH
shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
soname_spec='${libname}${release}.sl$major'
# HP-UX runs *really* slowly unless shared libraries are mode 555.
postinstall_cmds='chmod 555 $lib'
;;
irix5* | irix6* | nonstopux*)
case $host_os in
nonstopux*) version_type=nonstopux ;;
*) version_type=irix ;;
esac
need_lib_prefix=no
need_version=no
soname_spec='${libname}${release}.so$major'
library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
case $host_os in
irix5* | nonstopux*)
libsuff= shlibsuff=
;;
*)
case $LD in # libtool.m4 will add one of these switches to LD
*-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
*-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
*-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
*) libsuff= shlibsuff= libmagic=never-match;;
esac
;;
esac
shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
shlibpath_overrides_runpath=no
sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
;;
# No shared lib support for Linux oldld, aout, or coff.
linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
dynamic_linker=no
;;
# This must be Linux ELF.
linux-gnu*)
version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
soname_spec='${libname}${release}.so$major'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
# This implies no fast_install, which is unacceptable.
# Some rework will be needed to allow for fast_install
# before this can be enabled.
hardcode_into_libs=yes
# We used to test for /lib/ld.so.1 and disable shared libraries on
# powerpc, because MkLinux only supported shared libraries with the
# GNU dynamic linker. Since this was broken with cross compilers,
# most powerpc-linux boxes support dynamic linking these days and
# people can always --disable-shared, the test was removed, and we
# assume the GNU/Linux dynamic linker is in use.
dynamic_linker='GNU/Linux ld.so'
;;
netbsd*)
version_type=sunos
need_lib_prefix=no
need_version=no
if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
dynamic_linker='NetBSD (a.out) ld.so'
else
library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
soname_spec='${libname}${release}.so$major'
dynamic_linker='NetBSD ld.elf_so'
fi
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
;;
newsos6)
version_type=linux
library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
;;
openbsd*)
version_type=sunos
need_lib_prefix=no
need_version=no
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
case "$host_os" in
openbsd2.[[89]] | openbsd2.[[89]].*)
shlibpath_overrides_runpath=no
;;
*)
shlibpath_overrides_runpath=yes
;;
esac
else
shlibpath_overrides_runpath=yes
fi
library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
shlibpath_var=LD_LIBRARY_PATH
;;
os2*)
libname_spec='$name'
need_lib_prefix=no
library_names_spec='$libname.dll $libname.a'
dynamic_linker='OS/2 ld.exe'
shlibpath_var=LIBPATH
;;
osf3* | osf4* | osf5*)
version_type=osf
need_version=no
soname_spec='${libname}${release}.so'
library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
shlibpath_var=LD_LIBRARY_PATH
sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
;;
sco3.2v5*)
version_type=osf
soname_spec='${libname}${release}.so$major'
library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
shlibpath_var=LD_LIBRARY_PATH
;;
solaris*)
version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
soname_spec='${libname}${release}.so$major'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
# ldd complains unless libraries are executable
postinstall_cmds='chmod +x $lib'
;;
sunos4*)
version_type=sunos
library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
if test "$with_gnu_ld" = yes; then
need_lib_prefix=no
fi
need_version=yes
;;
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
version_type=linux
library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
soname_spec='${libname}${release}.so$major'
shlibpath_var=LD_LIBRARY_PATH
case $host_vendor in
sni)
shlibpath_overrides_runpath=no
need_lib_prefix=no
export_dynamic_flag_spec='${wl}-Blargedynsym'
runpath_var=LD_RUN_PATH
;;
siemens)
need_lib_prefix=no
;;
motorola)
need_lib_prefix=no
need_version=no
shlibpath_overrides_runpath=no
sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
;;
esac
;;
uts4*)
version_type=linux
library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
soname_spec='${libname}${release}.so$major'
shlibpath_var=LD_LIBRARY_PATH
;;
dgux*)
version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
soname_spec='${libname}${release}.so$major'
shlibpath_var=LD_LIBRARY_PATH
;;
sysv4*MP*)
if test -d /usr/nec ;then
version_type=linux
library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
soname_spec='$libname.so.$major'
shlibpath_var=LD_LIBRARY_PATH
fi
;;
*)
dynamic_linker=no
;;
esac
AC_MSG_RESULT([$dynamic_linker])
test "$dynamic_linker" = no && can_build_shared=no
# Report the final consequences.
AC_MSG_CHECKING([if libtool supports shared libraries])
AC_MSG_RESULT([$can_build_shared])
AC_MSG_CHECKING([whether to build shared libraries])
test "$can_build_shared" = "no" && enable_shared=no
# On AIX, shared libraries and static libraries use the same namespace, and
# are all built from PIC.
case "$host_os" in
aix3*)
test "$enable_shared" = yes && enable_static=no
if test -n "$RANLIB"; then
archive_cmds="$archive_cmds~\$RANLIB \$lib"
postinstall_cmds='$RANLIB $lib'
fi
;;
aix4*)
if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
test "$enable_shared" = yes && enable_static=no
fi
;;
esac
AC_MSG_RESULT([$enable_shared])
AC_MSG_CHECKING([whether to build static libraries])
# Make sure either enable_shared or enable_static is yes.
test "$enable_shared" = yes || enable_static=yes
AC_MSG_RESULT([$enable_static])
if test "$hardcode_action" = relink; then
# Fast installation is not supported
enable_fast_install=no
elif test "$shlibpath_overrides_runpath" = yes ||
test "$enable_shared" = no; then
# Fast installation is not necessary
enable_fast_install=needless
fi
variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
if test "$GCC" = yes; then
variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
fi
AC_LIBTOOL_DLOPEN_SELF
if test "$enable_shared" = yes && test "$GCC" = yes; then
case $archive_cmds in
*'~'*)
# FIXME: we may have to deal with multi-command sequences.
;;
'$CC '*)
# Test whether the compiler implicitly links with -lc since on some
# systems, -lgcc has to come before -lc. If gcc already passes -lc
# to ld, don't add -lc before -lgcc.
AC_MSG_CHECKING([whether -lc should be explicitly linked in])
AC_CACHE_VAL([lt_cv_archive_cmds_need_lc],
[$rm conftest*
echo 'static int dummy;' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
soname=conftest
lib=conftest
libobjs=conftest.$ac_objext
deplibs=
wl=$lt_cv_prog_cc_wl
compiler_flags=-v
linker_flags=-v
verstring=
output_objdir=.
libname=conftest
save_allow_undefined_flag=$allow_undefined_flag
allow_undefined_flag=
if AC_TRY_EVAL(archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
then
lt_cv_archive_cmds_need_lc=no
else
lt_cv_archive_cmds_need_lc=yes
fi
allow_undefined_flag=$save_allow_undefined_flag
else
cat conftest.err 1>&5
fi])
AC_MSG_RESULT([$lt_cv_archive_cmds_need_lc])
;;
esac
fi
need_lc=${lt_cv_archive_cmds_need_lc-yes}
# The second clause should only fire when bootstrapping the
# libtool distribution, otherwise you forgot to ship ltmain.sh
# with your package, and you will get complaints that there are
# no rules to generate ltmain.sh.
if test -f "$ltmain"; then
:
else
# If there is no Makefile yet, we rely on a make rule to execute
# `config.status --recheck' to rerun these tests and create the
# libtool script then.
test -f Makefile && make "$ltmain"
fi
if test -f "$ltmain"; then
trap "$rm \"${ofile}T\"; exit 1" 1 2 15
$rm -f "${ofile}T"
echo creating $ofile
# Now quote all the things that may contain metacharacters while being
# careful not to overquote the AC_SUBSTed values. We take copies of the
# variables and quote the copies for generation of the libtool script.
for var in echo old_CC old_CFLAGS SED \
AR AR_FLAGS CC LD LN_S NM SHELL \
reload_flag reload_cmds wl \
pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
thread_safe_flag_spec whole_archive_flag_spec libname_spec \
library_names_spec soname_spec \
RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
old_striplib striplib file_magic_cmd export_symbols_cmds \
deplibs_check_method allow_undefined_flag no_undefined_flag \
finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
global_symbol_to_c_name_address \
hardcode_libdir_flag_spec hardcode_libdir_separator \
sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
case $var in
reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
old_postinstall_cmds | old_postuninstall_cmds | \
export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
postinstall_cmds | postuninstall_cmds | \
finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
# Double-quote double-evaled strings.
eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
;;
*)
eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
;;
esac
done
cat <<__EOF__ > "${ofile}T"
#! $SHELL
# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
#
# Copyright (C) 1996-2000 Free Software Foundation, Inc.
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# A sed that does not truncate output.
SED=$lt_SED
# Sed that helps us avoid accidentally triggering echo(1) options like -n.
Xsed="${SED} -e s/^X//"
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
# ### BEGIN LIBTOOL CONFIG
# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
# Shell to use when invoking shell scripts.
SHELL=$lt_SHELL
# Whether or not to build shared libraries.
build_libtool_libs=$enable_shared
# Whether or not to build static libraries.
build_old_libs=$enable_static
# Whether or not to add -lc for building shared libraries.
build_libtool_need_lc=$need_lc
# Whether or not to optimize for fast installation.
fast_install=$enable_fast_install
# The host system.
host_alias=$host_alias
host=$host
# An echo program that does not interpret backslashes.
echo=$lt_echo
# The archiver.
AR=$lt_AR
AR_FLAGS=$lt_AR_FLAGS
# The default C compiler.
CC=$lt_CC
# Is the compiler the GNU C compiler?
with_gcc=$GCC
# The linker used to build libraries.
LD=$lt_LD
# Whether we need hard or soft links.
LN_S=$lt_LN_S
# A BSD-compatible nm program.
NM=$lt_NM
# A symbol stripping program
STRIP=$STRIP
# Used to examine libraries when file_magic_cmd begins "file"
MAGIC_CMD=$MAGIC_CMD
# Used on cygwin: DLL creation program.
DLLTOOL="$DLLTOOL"
# Used on cygwin: object dumper.
OBJDUMP="$OBJDUMP"
# Used on cygwin: assembler.
AS="$AS"
# The name of the directory that contains temporary libtool files.
objdir=$objdir
# How to create reloadable object files.
reload_flag=$lt_reload_flag
reload_cmds=$lt_reload_cmds
# How to pass a linker flag through the compiler.
wl=$lt_wl
# Object file suffix (normally "o").
objext="$ac_objext"
# Old archive suffix (normally "a").
libext="$libext"
# Executable file suffix (normally "").
exeext="$exeext"
# Additional compiler flags for building library objects.
pic_flag=$lt_pic_flag
pic_mode=$pic_mode
# Does compiler simultaneously support -c and -o options?
compiler_c_o=$lt_compiler_c_o
# Can we write directly to a .lo ?
compiler_o_lo=$lt_compiler_o_lo
# Must we lock files when doing compilation ?
need_locks=$lt_need_locks
# Do we need the lib prefix for modules?
need_lib_prefix=$need_lib_prefix
# Do we need a version for libraries?
need_version=$need_version
# Whether dlopen is supported.
dlopen_support=$enable_dlopen
# Whether dlopen of programs is supported.
dlopen_self=$enable_dlopen_self
# Whether dlopen of statically linked programs is supported.
dlopen_self_static=$enable_dlopen_self_static
# Compiler flag to prevent dynamic linking.
link_static_flag=$lt_link_static_flag
# Compiler flag to turn off builtin functions.
no_builtin_flag=$lt_no_builtin_flag
# Compiler flag to allow reflexive dlopens.
export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
# Compiler flag to generate shared objects directly from archives.
whole_archive_flag_spec=$lt_whole_archive_flag_spec
# Compiler flag to generate thread-safe objects.
thread_safe_flag_spec=$lt_thread_safe_flag_spec
# Library versioning type.
version_type=$version_type
# Format of library name prefix.
libname_spec=$lt_libname_spec
# List of archive names. First name is the real one, the rest are links.
# The last name is the one that the linker finds with -lNAME.
library_names_spec=$lt_library_names_spec
# The coded name of the library, if different from the real name.
soname_spec=$lt_soname_spec
# Commands used to build and install an old-style archive.
RANLIB=$lt_RANLIB
old_archive_cmds=$lt_old_archive_cmds
old_postinstall_cmds=$lt_old_postinstall_cmds
old_postuninstall_cmds=$lt_old_postuninstall_cmds
# Create an old-style archive from a shared archive.
old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
# Create a temporary old-style archive to link instead of a shared archive.
old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
# Commands used to build and install a shared archive.
archive_cmds=$lt_archive_cmds
archive_expsym_cmds=$lt_archive_expsym_cmds
postinstall_cmds=$lt_postinstall_cmds
postuninstall_cmds=$lt_postuninstall_cmds
# Commands to strip libraries.
old_striplib=$lt_old_striplib
striplib=$lt_striplib
# Method to check whether dependent libraries are shared objects.
deplibs_check_method=$lt_deplibs_check_method
# Command to use when deplibs_check_method == file_magic.
file_magic_cmd=$lt_file_magic_cmd
# Flag that allows shared libraries with undefined symbols to be built.
allow_undefined_flag=$lt_allow_undefined_flag
# Flag that forces no undefined symbols.
no_undefined_flag=$lt_no_undefined_flag
# Commands used to finish a libtool library installation in a directory.
finish_cmds=$lt_finish_cmds
# Same as above, but a single script fragment to be evaled but not shown.
finish_eval=$lt_finish_eval
# Take the output of nm and produce a listing of raw symbols and C names.
global_symbol_pipe=$lt_global_symbol_pipe
# Transform the output of nm in a proper C declaration
global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
# Transform the output of nm in a C name address pair
global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address
# This is the shared library runtime path variable.
runpath_var=$runpath_var
# This is the shared library path variable.
shlibpath_var=$shlibpath_var
# Is shlibpath searched before the hard-coded library search path?
shlibpath_overrides_runpath=$shlibpath_overrides_runpath
# How to hardcode a shared library path into an executable.
hardcode_action=$hardcode_action
# Whether we should hardcode library paths into libraries.
hardcode_into_libs=$hardcode_into_libs
# Flag to hardcode \$libdir into a binary during linking.
# This must work even if \$libdir does not exist.
hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
# Whether we need a single -rpath flag with a separated argument.
hardcode_libdir_separator=$lt_hardcode_libdir_separator
# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
# resulting binary.
hardcode_direct=$hardcode_direct
# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
# resulting binary.
hardcode_minus_L=$hardcode_minus_L
# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
# the resulting binary.
hardcode_shlibpath_var=$hardcode_shlibpath_var
# Variables whose values should be saved in libtool wrapper scripts and
# restored at relink time.
variables_saved_for_relink="$variables_saved_for_relink"
# Whether libtool must link a program against all its dependency libraries.
link_all_deplibs=$link_all_deplibs
# Compile-time system search path for libraries
sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
# Run-time system search path for libraries
sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
# Fix the shell variable \$srcfile for the compiler.
fix_srcfile_path="$fix_srcfile_path"
# Set to yes if exported symbols are required.
always_export_symbols=$always_export_symbols
# The commands to list exported symbols.
export_symbols_cmds=$lt_export_symbols_cmds
# The commands to extract the exported symbol list from a shared archive.
extract_expsyms_cmds=$lt_extract_expsyms_cmds
# Symbols that should not be listed in the preloaded symbols.
exclude_expsyms=$lt_exclude_expsyms
# Symbols that must always be exported.
include_expsyms=$lt_include_expsyms
# ### END LIBTOOL CONFIG
__EOF__
case $host_os in
aix3*)
cat <<\EOF >> "${ofile}T"
# AIX sometimes has problems with the GCC collect2 program. For some
# reason, if we set the COLLECT_NAMES environment variable, the problems
# vanish in a puff of smoke.
if test "X${COLLECT_NAMES+set}" != Xset; then
COLLECT_NAMES=
export COLLECT_NAMES
fi
EOF
;;
esac
case $host_os in
cygwin* | mingw* | pw32* | os2*)
cat <<'EOF' >> "${ofile}T"
# This is a source program that is used to create dlls on Windows
# Don't remove nor modify the starting and closing comments
# /* ltdll.c starts here */
# #define WIN32_LEAN_AND_MEAN
# #include <windows.h>
# #undef WIN32_LEAN_AND_MEAN
# #include <stdio.h>
#
# #ifndef __CYGWIN__
# # ifdef __CYGWIN32__
# # define __CYGWIN__ __CYGWIN32__
# # endif
# #endif
#
# #ifdef __cplusplus
# extern "C" {
# #endif
# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
# #ifdef __cplusplus
# }
# #endif
#
# #ifdef __CYGWIN__
# #include <cygwin/cygwin_dll.h>
# DECLARE_CYGWIN_DLL( DllMain );
# #endif
# HINSTANCE __hDllInstance_base;
#
# BOOL APIENTRY
# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
# {
# __hDllInstance_base = hInst;
# return TRUE;
# }
# /* ltdll.c ends here */
# This is a source program that is used to create import libraries
# on Windows for dlls which lack them. Don't remove nor modify the
# starting and closing comments
# /* impgen.c starts here */
# /* Copyright (C) 1999-2000 Free Software Foundation, Inc.
#
# This file is part of GNU libtool.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# */
#
# #include <stdio.h> /* for printf() */
# #include <unistd.h> /* for open(), lseek(), read() */
# #include <fcntl.h> /* for O_RDONLY, O_BINARY */
# #include <string.h> /* for strdup() */
#
# /* O_BINARY isn't required (or even defined sometimes) under Unix */
# #ifndef O_BINARY
# #define O_BINARY 0
# #endif
#
# static unsigned int
# pe_get16 (fd, offset)
# int fd;
# int offset;
# {
# unsigned char b[2];
# lseek (fd, offset, SEEK_SET);
# read (fd, b, 2);
# return b[0] + (b[1]<<8);
# }
#
# static unsigned int
# pe_get32 (fd, offset)
# int fd;
# int offset;
# {
# unsigned char b[4];
# lseek (fd, offset, SEEK_SET);
# read (fd, b, 4);
# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
# }
#
# static unsigned int
# pe_as32 (ptr)
# void *ptr;
# {
# unsigned char *b = ptr;
# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
# }
#
# int
# main (argc, argv)
# int argc;
# char *argv[];
# {
# int dll;
# unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
# unsigned long export_rva, export_size, nsections, secptr, expptr;
# unsigned long name_rvas, nexp;
# unsigned char *expdata, *erva;
# char *filename, *dll_name;
#
# filename = argv[1];
#
# dll = open(filename, O_RDONLY|O_BINARY);
# if (dll < 1)
# return 1;
#
# dll_name = filename;
#
# for (i=0; filename[i]; i++)
# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
# dll_name = filename + i +1;
#
# pe_header_offset = pe_get32 (dll, 0x3c);
# opthdr_ofs = pe_header_offset + 4 + 20;
# num_entries = pe_get32 (dll, opthdr_ofs + 92);
#
# if (num_entries < 1) /* no exports */
# return 1;
#
# export_rva = pe_get32 (dll, opthdr_ofs + 96);
# export_size = pe_get32 (dll, opthdr_ofs + 100);
# nsections = pe_get16 (dll, pe_header_offset + 4 +2);
# secptr = (pe_header_offset + 4 + 20 +
# pe_get16 (dll, pe_header_offset + 4 + 16));
#
# expptr = 0;
# for (i = 0; i < nsections; i++)
# {
# char sname[8];
# unsigned long secptr1 = secptr + 40 * i;
# unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
# unsigned long vsize = pe_get32 (dll, secptr1 + 16);
# unsigned long fptr = pe_get32 (dll, secptr1 + 20);
# lseek(dll, secptr1, SEEK_SET);
# read(dll, sname, 8);
# if (vaddr <= export_rva && vaddr+vsize > export_rva)
# {
# expptr = fptr + (export_rva - vaddr);
# if (export_rva + export_size > vaddr + vsize)
# export_size = vsize - (export_rva - vaddr);
# break;
# }
# }
#
# expdata = (unsigned char*)malloc(export_size);
# lseek (dll, expptr, SEEK_SET);
# read (dll, expdata, export_size);
# erva = expdata - export_rva;
#
# nexp = pe_as32 (expdata+24);
# name_rvas = pe_as32 (expdata+32);
#
# printf ("EXPORTS\n");
# for (i = 0; i<nexp; i++)
# {
# unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
# printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
# }
#
# return 0;
# }
# /* impgen.c ends here */
EOF
;;
esac
# We use sed instead of cat because bash on DJGPP gets confused if
# if finds mixed CR/LF and LF-only lines. Since sed operates in
# text mode, it properly converts lines to CR/LF. This bash problem
# is reportedly fixed, but why not run on old versions too?
sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
mv -f "${ofile}T" "$ofile" || \
(rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
chmod +x "$ofile"
fi
])# _LT_AC_LTCONFIG_HACK
# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
# AC_ENABLE_SHARED - implement the --enable-shared flag
# Usage: AC_ENABLE_SHARED[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
AC_DEFUN([AC_ENABLE_SHARED],
[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(shared,
changequote(<<, >>)dnl
<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
changequote([, ])dnl
[p=${PACKAGE-default}
case $enableval in
yes) enable_shared=yes ;;
no) enable_shared=no ;;
*)
enable_shared=no
# Look at the argument we got. We use all the common list separators.
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
for pkg in $enableval; do
if test "X$pkg" = "X$p"; then
enable_shared=yes
fi
done
IFS="$ac_save_ifs"
;;
esac],
enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
])
# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
AC_DEFUN([AC_DISABLE_SHARED],
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_ENABLE_SHARED(no)])
# AC_ENABLE_STATIC - implement the --enable-static flag
# Usage: AC_ENABLE_STATIC[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
AC_DEFUN([AC_ENABLE_STATIC],
[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(static,
changequote(<<, >>)dnl
<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
changequote([, ])dnl
[p=${PACKAGE-default}
case $enableval in
yes) enable_static=yes ;;
no) enable_static=no ;;
*)
enable_static=no
# Look at the argument we got. We use all the common list separators.
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
for pkg in $enableval; do
if test "X$pkg" = "X$p"; then
enable_static=yes
fi
done
IFS="$ac_save_ifs"
;;
esac],
enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
])
# AC_DISABLE_STATIC - set the default static flag to --disable-static
AC_DEFUN([AC_DISABLE_STATIC],
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_ENABLE_STATIC(no)])
# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
AC_DEFUN([AC_ENABLE_FAST_INSTALL],
[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(fast-install,
changequote(<<, >>)dnl
<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
changequote([, ])dnl
[p=${PACKAGE-default}
case $enableval in
yes) enable_fast_install=yes ;;
no) enable_fast_install=no ;;
*)
enable_fast_install=no
# Look at the argument we got. We use all the common list separators.
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
for pkg in $enableval; do
if test "X$pkg" = "X$p"; then
enable_fast_install=yes
fi
done
IFS="$ac_save_ifs"
;;
esac],
enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
])
# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
AC_DEFUN([AC_DISABLE_FAST_INSTALL],
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_ENABLE_FAST_INSTALL(no)])
# AC_LIBTOOL_PICMODE - implement the --with-pic flag
# Usage: AC_LIBTOOL_PICMODE[(MODE)]
# Where MODE is either `yes' or `no'. If omitted, it defaults to
# `both'.
AC_DEFUN([AC_LIBTOOL_PICMODE],
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
pic_mode=ifelse($#,1,$1,default)])
# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
AC_DEFUN([AC_PATH_TOOL_PREFIX],
[AC_MSG_CHECKING([for $1])
AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
[case $MAGIC_CMD in
/*)
lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
;;
?:/*)
lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
;;
*)
ac_save_MAGIC_CMD="$MAGIC_CMD"
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
dnl $ac_dummy forces splitting on constant user-supplied paths.
dnl POSIX.2 word splitting is done only on the output of word expansions,
dnl not every word. This closes a longstanding sh security hole.
ac_dummy="ifelse([$2], , $PATH, [$2])"
for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$1; then
lt_cv_path_MAGIC_CMD="$ac_dir/$1"
if test -n "$file_magic_test_file"; then
case $deplibs_check_method in
"file_magic "*)
file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
egrep "$file_magic_regex" > /dev/null; then
:
else
cat <<EOF 1>&2
*** Warning: the command libtool uses to detect shared libraries,
*** $file_magic_cmd, produces output that libtool cannot recognize.
*** The result is that libtool may fail to recognize shared libraries
*** as such. This will affect the creation of libtool libraries that
*** depend on shared libraries, but programs linked with such libtool
*** libraries will work regardless of this problem. Nevertheless, you
*** may want to report the problem to your system manager and/or to
*** bug-libtool@gnu.org
EOF
fi ;;
esac
fi
break
fi
done
IFS="$ac_save_ifs"
MAGIC_CMD="$ac_save_MAGIC_CMD"
;;
esac])
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
if test -n "$MAGIC_CMD"; then
AC_MSG_RESULT($MAGIC_CMD)
else
AC_MSG_RESULT(no)
fi
])
# AC_PATH_MAGIC - find a file program which can recognise a shared library
AC_DEFUN([AC_PATH_MAGIC],
[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH)
if test -z "$lt_cv_path_MAGIC_CMD"; then
if test -n "$ac_tool_prefix"; then
AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
else
MAGIC_CMD=:
fi
fi
])
# AC_PROG_LD - find the path to the GNU or non-GNU linker
AC_DEFUN([AC_PROG_LD],
[AC_ARG_WITH(gnu-ld,
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
ac_prog=ld
if test "$GCC" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
AC_MSG_CHECKING([for ld used by GCC])
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
*)
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
esac
case $ac_prog in
# Accept absolute paths.
[[\\/]]* | [[A-Za-z]]:[[\\/]]*)
re_direlt='/[[^/]][[^/]]*/\.\./'
# Canonicalize the path of ld
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
done
test -z "$LD" && LD="$ac_prog"
;;
"")
# If it fails, then pretend we aren't using GCC.
ac_prog=ld
;;
*)
# If it is relative, then search for the first ld in PATH.
with_gnu_ld=unknown
;;
esac
elif test "$with_gnu_ld" = yes; then
AC_MSG_CHECKING([for GNU ld])
else
AC_MSG_CHECKING([for non-GNU ld])
fi
AC_CACHE_VAL(lt_cv_path_LD,
[if test -z "$LD"; then
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
lt_cv_path_LD="$ac_dir/$ac_prog"
# Check to see if the program is GNU ld. I'd rather use --version,
# but apparently some GNU ld's only accept -v.
# Break only if it was the GNU/non-GNU ld that we prefer.
if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
test "$with_gnu_ld" != no && break
else
test "$with_gnu_ld" != yes && break
fi
fi
done
IFS="$ac_save_ifs"
else
lt_cv_path_LD="$LD" # Let the user override the test with a path.
fi])
LD="$lt_cv_path_LD"
if test -n "$LD"; then
AC_MSG_RESULT($LD)
else
AC_MSG_RESULT(no)
fi
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
AC_PROG_LD_GNU
])
# AC_PROG_LD_GNU -
AC_DEFUN([AC_PROG_LD_GNU],
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
lt_cv_prog_gnu_ld=yes
else
lt_cv_prog_gnu_ld=no
fi])
with_gnu_ld=$lt_cv_prog_gnu_ld
])
# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
# -- PORTME Some linkers may need a different reload flag.
AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
[AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag,
[lt_cv_ld_reload_flag='-r'])
reload_flag=$lt_cv_ld_reload_flag
test -n "$reload_flag" && reload_flag=" $reload_flag"
])
# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
# -- PORTME fill in with the dynamic library characteristics
AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
[AC_CACHE_CHECK([how to recognise dependent libraries],
lt_cv_deplibs_check_method,
[lt_cv_file_magic_cmd='$MAGIC_CMD'
lt_cv_file_magic_test_file=
lt_cv_deplibs_check_method='unknown'
# Need to set the preceding variable on all platforms that support
# interlibrary dependencies.
# 'none' -- dependencies not supported.
# `unknown' -- same as none, but documents that we really don't know.
# 'pass_all' -- all dependencies passed with no checks.
# 'test_compile' -- check by making test program.
# 'file_magic [[regex]]' -- check by looking for files in library path
# which responds to the $file_magic_cmd with a given egrep regex.
# If you have `file' or equivalent on your system and you're not sure
# whether `pass_all' will *always* work, you probably want this one.
case $host_os in
aix4* | aix5*)
lt_cv_deplibs_check_method=pass_all
;;
beos*)
lt_cv_deplibs_check_method=pass_all
;;
bsdi4*)
lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
lt_cv_file_magic_cmd='/usr/bin/file -L'
lt_cv_file_magic_test_file=/shlib/libc.so
;;
cygwin* | mingw* | pw32*)
lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
lt_cv_file_magic_cmd='$OBJDUMP -f'
;;
darwin* | rhapsody*)
lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
lt_cv_file_magic_cmd='/usr/bin/file -L'
case "$host_os" in
rhapsody* | darwin1.[[012]])
lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
;;
*) # Darwin 1.3 on
lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
;;
esac
;;
freebsd*)
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
case $host_cpu in
i*86 )
# Not sure whether the presence of OpenBSD here was a mistake.
# Let's accept both of them until this is cleared up.
lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library'
lt_cv_file_magic_cmd=/usr/bin/file
lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
;;
esac
else
lt_cv_deplibs_check_method=pass_all
fi
;;
gnu*)
lt_cv_deplibs_check_method=pass_all
;;
hpux10.20*|hpux11*)
lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
lt_cv_file_magic_cmd=/usr/bin/file
lt_cv_file_magic_test_file=/usr/lib/libc.sl
;;
irix5* | irix6* | nonstopux*)
case $host_os in
irix5* | nonstopux*)
# this will be overridden with pass_all, but let us keep it just in case
lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
;;
*)
case $LD in
*-32|*"-32 ") libmagic=32-bit;;
*-n32|*"-n32 ") libmagic=N32;;
*-64|*"-64 ") libmagic=64-bit;;
*) libmagic=never-match;;
esac
# this will be overridden with pass_all, but let us keep it just in case
lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1"
;;
esac
lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
lt_cv_deplibs_check_method=pass_all
;;
# This must be Linux ELF.
linux-gnu*)
case $host_cpu in
alpha* | hppa* | i*86 | mips | mipsel | powerpc* | sparc* | ia64*)
lt_cv_deplibs_check_method=pass_all ;;
*)
# glibc up to 2.1.1 does not perform some relocations on ARM
lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;
esac
lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
;;
netbsd*)
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so\.[[0-9]]+\.[[0-9]]+$'
else
lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$'
fi
;;
newos6*)
lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
lt_cv_file_magic_cmd=/usr/bin/file
lt_cv_file_magic_test_file=/usr/lib/libnls.so
;;
openbsd*)
lt_cv_file_magic_cmd=/usr/bin/file
lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
else
lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
fi
;;
osf3* | osf4* | osf5*)
# this will be overridden with pass_all, but let us keep it just in case
lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
lt_cv_file_magic_test_file=/shlib/libc.so
lt_cv_deplibs_check_method=pass_all
;;
sco3.2v5*)
lt_cv_deplibs_check_method=pass_all
;;
solaris*)
lt_cv_deplibs_check_method=pass_all
lt_cv_file_magic_test_file=/lib/libc.so
;;
sysv5uw[[78]]* | sysv4*uw2*)
lt_cv_deplibs_check_method=pass_all
;;
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
case $host_vendor in
motorola)
lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
;;
ncr)
lt_cv_deplibs_check_method=pass_all
;;
sequent)
lt_cv_file_magic_cmd='/bin/file'
lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
;;
sni)
lt_cv_file_magic_cmd='/bin/file'
lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
lt_cv_file_magic_test_file=/lib/libc.so
;;
siemens)
lt_cv_deplibs_check_method=pass_all
;;
esac
;;
esac
])
file_magic_cmd=$lt_cv_file_magic_cmd
deplibs_check_method=$lt_cv_deplibs_check_method
])
# AC_PROG_NM - find the path to a BSD-compatible name lister
AC_DEFUN([AC_PROG_NM],
[AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
AC_MSG_CHECKING([for BSD-compatible nm])
AC_CACHE_VAL(lt_cv_path_NM,
[if test -n "$NM"; then
# Let the user override the test.
lt_cv_path_NM="$NM"
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
test -z "$ac_dir" && ac_dir=.
tmp_nm=$ac_dir/${ac_tool_prefix}nm
if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
# Check to see if the nm accepts a BSD-compat flag.
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
# nm: unknown option "B" ignored
# Tru64's nm complains that /dev/null is an invalid object file
if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
lt_cv_path_NM="$tmp_nm -B"
break
elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
lt_cv_path_NM="$tmp_nm -p"
break
else
lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
continue # so that we can try to find one that supports BSD flags
fi
fi
done
IFS="$ac_save_ifs"
test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
fi])
NM="$lt_cv_path_NM"
AC_MSG_RESULT([$NM])
])
# AC_CHECK_LIBM - check for math library
AC_DEFUN([AC_CHECK_LIBM],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
LIBM=
case $host in
*-*-beos* | *-*-cygwin* | *-*-pw32*)
# These system don't have libm
;;
*-ncr-sysv4.3*)
AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
;;
*)
AC_CHECK_LIB(m, main, LIBM="-lm")
;;
esac
])
# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
# the libltdl convenience library and LTDLINCL to the include flags for
# the libltdl header and adds --enable-ltdl-convenience to the
# configure arguments. Note that LIBLTDL and LTDLINCL are not
# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
# with '${top_builddir}/' and LTDLINCL will be prefixed with
# '${top_srcdir}/' (note the single quotes!). If your package is not
# flat and you're not using automake, define top_builddir and
# top_srcdir appropriately in the Makefiles.
AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
case $enable_ltdl_convenience in
no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
"") enable_ltdl_convenience=yes
ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
esac
LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
# For backwards non-gettext consistent compatibility...
INCLTDL="$LTDLINCL"
])
# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
# the libltdl installable library and LTDLINCL to the include flags for
# the libltdl header and adds --enable-ltdl-install to the configure
# arguments. Note that LIBLTDL and LTDLINCL are not AC_SUBSTed, nor is
# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed
# with '${top_srcdir}/' (note the single quotes!). If your package is
# not flat and you're not using automake, define top_builddir and
# top_srcdir appropriately in the Makefiles.
# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_CHECK_LIB(ltdl, main,
[test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
[if test x"$enable_ltdl_install" = xno; then
AC_MSG_WARN([libltdl not installed, but installation disabled])
else
enable_ltdl_install=yes
fi
])
if test x"$enable_ltdl_install" = x"yes"; then
ac_configure_args="$ac_configure_args --enable-ltdl-install"
LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
else
ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
LIBLTDL="-lltdl"
LTDLINCL=
fi
# For backwards non-gettext consistent compatibility...
INCLTDL="$LTDLINCL"
])
# old names
AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL])
AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
AC_DEFUN([AM_PROG_LD], [AC_PROG_LD])
AC_DEFUN([AM_PROG_NM], [AC_PROG_NM])
# This is just to silence aclocal about the macro not being used
ifelse([AC_DISABLE_FAST_INSTALL])
# NOTE: This macro has been submitted for inclusion into #
# GNU Autoconf as AC_PROG_SED. When it is available in #
# a released version of Autoconf we should remove this #
# macro and use it instead. #
# LT_AC_PROG_SED
# --------------
# Check for a fully-functional sed program, that truncates
# as few characters as possible. Prefer GNU sed if found.
AC_DEFUN([LT_AC_PROG_SED],
[AC_MSG_CHECKING([for a sed that does not truncate output])
AC_CACHE_VAL(lt_cv_path_SED,
[# Loop through the user's path and test for sed and gsed.
# Then use that list of sed's as ones to test for truncation.
as_executable_p="test -f"
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_prog in sed gsed; do
for ac_exec_ext in '' $ac_executable_extensions; do
if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
_sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext"
fi
done
done
done
# Create a temporary directory, and hook for its removal unless debugging.
$debug ||
{
trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
trap '{ (exit 1); exit 1; }' 1 2 13 15
}
# Create a (secure) tmp directory for tmp files.
: ${TMPDIR=/tmp}
{
tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXXXXXX") 2>/dev/null` &&
test -n "$tmp" && test -d "$tmp"
} ||
{
tmp=$TMPDIR/sed$$-$RANDOM
(umask 077 && mkdir $tmp)
} ||
{
echo "$me: cannot create a temporary directory in $TMPDIR" >&2
{ (exit 1); exit 1; }
}
_max=0
_count=0
# Add /usr/xpg4/bin/sed as it is typically found on Solaris
# along with /bin/sed that truncates output.
for _sed in $_sed_list /usr/xpg4/bin/sed; do
test ! -f ${_sed} && break
cat /dev/null > "$tmp/sed.in"
_count=0
echo ${ECHO_N-$ac_n} "0123456789${ECHO_C-$ac_c}" >"$tmp/sed.in"
# Check for GNU sed and select it if it is found.
if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then
lt_cv_path_SED=${_sed}
break;
fi
while true; do
cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp"
mv "$tmp/sed.tmp" "$tmp/sed.in"
cp "$tmp/sed.in" "$tmp/sed.nl"
echo >>"$tmp/sed.nl"
${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break
cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break
# 40000 chars as input seems more than enough
test $_count -gt 10 && break
_count=`expr $_count + 1`
if test $_count -gt $_max; then
_max=$_count
lt_cv_path_SED=$_sed
fi
done
done
rm -rf "$tmp"
])
if test "X$SED" != "X"; then
lt_cv_path_SED=$SED
else
SED=$lt_cv_path_SED
fi
AC_MSG_RESULT([$SED])
])
# Copyright 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# serial 1
AC_DEFUN([AM_WITH_DMALLOC],
[AC_MSG_CHECKING([if malloc debugging is wanted])
AC_ARG_WITH(dmalloc,
[ --with-dmalloc use dmalloc, as in
http://www.dmalloc.com/dmalloc.tar.gz],
[if test "$withval" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(WITH_DMALLOC,1,
[Define if using the dmalloc debugging malloc package])
LIBS="$LIBS -ldmalloc"
LDFLAGS="$LDFLAGS -g"
else
AC_MSG_RESULT(no)
fi], [AC_MSG_RESULT(no)])
])
# serial 1
AC_DEFUN(mfx_PROG_CC_INTEGRAL_PROMOTION,
[AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_CPP])dnl
AC_CACHE_CHECK([how the compiler promotes integrals],
mfx_cv_prog_cc_integral_promotion,
[AC_TRY_COMPILE([], [
char x[1 - 2 * ( (((unsigned char)128) << (int)(8*sizeof(int)-8)) >= 0 )];
],
mfx_cv_prog_cc_integral_promotion="ANSI C (value-preserving)",
mfx_cv_prog_cc_integral_promotion="Classic (unsigned-preserving)")])
])
# serial 1
AC_DEFUN(mfx_PROG_CC_CHECKERGCC,
[AC_CACHE_CHECK([whether we are using checkergcc], mfx_cv_prog_checkergcc,
[dnl The semicolon is to pacify NeXT's syntax-checking cpp.
cat > conftest.c <<EOF
#ifdef __GNUC__
#ifdef __CHECKER__
yes;
#endif
#endif
EOF
if AC_TRY_COMMAND(${CC-cc} -E conftest.c) | egrep yes >/dev/null 2>&1; then
mfx_cv_prog_checkergcc=yes
else
mfx_cv_prog_checkergcc=no
fi])])
# serial 1
AC_DEFUN(mfx_PROG_GCC_PIPE,
[AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_CPP])dnl
if test "$ac_cv_prog_gcc" = yes; then
AC_CACHE_CHECK([whether ${CC-cc} accepts -pipe], mfx_cv_prog_gcc_pipe,
[echo 'int main() { return 0; }' > conftest.c
if test -z "`${CC-cc} -pipe -c conftest.c 2>&1`"; then
mfx_cv_prog_gcc_pipe=yes
else
mfx_cv_prog_gcc_pipe=no
fi
rm -f conftest*
])
if test "$mfx_cv_prog_gcc_pipe" = yes; then
CC="$CC -pipe"
fi
fi
])
# serial 1
AC_DEFUN(mfx_CHECK_HEADER_SANE_LIMITS_H,
[AC_CACHE_CHECK([whether limits.h is sane],
mfx_cv_header_sane_limits_h,
[AC_TRY_COMPILE([#include <limits.h>
#define MFX_0xffff 0xffff
#define MFX_0xffffffffL 4294967295ul
#if !defined(CHAR_BIT) || (CHAR_BIT != 8)
# include "error CHAR_BIT"
#endif
#if !defined(UCHAR_MAX)
# include "error UCHAR_MAX"
#endif
#if !defined(USHRT_MAX)
# include "error USHRT_MAX"
#endif
#if !defined(UINT_MAX)
# include "error UINT_MAX"
#endif
#if !defined(ULONG_MAX)
# include "error ULONG_MAX"
#endif
#if !defined(SHRT_MAX)
# include "error SHRT_MAX"
#endif
#if !defined(INT_MAX)
# include "error INT_MAX"
#endif
#if !defined(LONG_MAX)
# include "error LONG_MAX"
#endif
#if (UCHAR_MAX < 1)
# include "error UCHAR_MAX"
#endif
#if (USHRT_MAX < 1)
# include "error USHRT_MAX"
#endif
#if (UINT_MAX < 1)
# include "error UINT_MAX"
#endif
#if (ULONG_MAX < 1)
# include "error ULONG_MAX"
#endif
#if (UCHAR_MAX < 0xff)
# include "error UCHAR_MAX"
#endif
#if (USHRT_MAX < MFX_0xffff)
# include "error USHRT_MAX"
#endif
#if (UINT_MAX < MFX_0xffff)
# include "error UINT_MAX"
#endif
#if (ULONG_MAX < MFX_0xffffffffL)
# include "error ULONG_MAX"
#endif
#if (USHRT_MAX > UINT_MAX)
# include "error USHRT_MAX vs UINT_MAX"
#endif
#if (UINT_MAX > ULONG_MAX)
# include "error UINT_MAX vs ULONG_MAX"
#endif
],[
#if (USHRT_MAX == MFX_0xffff)
{ typedef char a_short2[1 - 2 * !(sizeof(short) == 2)]; }
#elif (USHRT_MAX >= MFX_0xffff)
{ typedef char a_short2[1 - 2 * !(sizeof(short) > 2)]; }
#endif
#if (UINT_MAX == MFX_0xffff)
{ typedef char a_int2[1 - 2 * !(sizeof(int) == 2)]; }
#elif (UINT_MAX >= MFX_0xffff)
{ typedef char a_int2[1 - 2 * !(sizeof(int) > 2)]; }
#endif
#if (ULONG_MAX == MFX_0xffff)
{ typedef char a_long2[1 - 2 * !(sizeof(long) == 2)]; }
#elif (ULONG_MAX >= MFX_0xffff)
{ typedef char a_long2[1 - 2 * !(sizeof(long) > 2)]; }
#endif
#if (USHRT_MAX == MFX_0xffffffffL)
{ typedef char a_short4[1 - 2 * !(sizeof(short) == 4)]; }
#elif (USHRT_MAX >= MFX_0xffffffffL)
{ typedef char a_short4[1 - 2 * !(sizeof(short) > 4)]; }
#endif
#if (UINT_MAX == MFX_0xffffffffL)
{ typedef char a_int4[1 - 2 * !(sizeof(int) == 4)]; }
#elif (UINT_MAX >= MFX_0xffffffffL)
{ typedef char a_int4[1 - 2 * !(sizeof(int) > 4)]; }
#endif
#if (ULONG_MAX == MFX_0xffffffffL)
{ typedef char a_long4[1 - 2 * !(sizeof(long) == 4)]; }
#elif (ULONG_MAX >= MFX_0xffffffffL)
{ typedef char a_long4[1 - 2 * !(sizeof(long) > 4)]; }
#endif
],
mfx_cv_header_sane_limits_h=yes,
mfx_cv_header_sane_limits_h=no)])
])
# serial 1
AC_DEFUN(mfx_C_BYTE_ORDER,
[AC_CACHE_CHECK([the byte order], mfx_cv_c_byte_order,
[AC_RUN_IFELSE([AC_LANG_PROGRAM([], [[
union { long l; char c[sizeof(long)]; } u;
u.l = 1; exit(u.c[0] == 1);
]])],
[mfx_cv_c_byte_order=4321],
[mfx_cv_c_byte_order=1234],
[mfx_cv_c_byte_order=unknown])])
if test "X$mfx_cv_c_byte_order" = X1234; then
AC_DEFINE_UNQUOTED(MFX_BYTE_ORDER,1234)
fi
if test "X$mfx_cv_c_byte_order" = X4321; then
AC_DEFINE_UNQUOTED(MFX_BYTE_ORDER,4321)
fi
])
# serial 1
AC_DEFUN(mfx_FUNC_MEMCMP,
[AC_CACHE_CHECK([for working memcmp], mfx_cv_func_memcmp,
[AC_RUN_IFELSE([AC_LANG_PROGRAM([[
#include <string.h>
]], [[
unsigned char c0 = 0x40, c1 = 0x80, c2 = 0x81;
char aa[21], bb[21];
int i, j;
if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0)
exit(1);
for (i = 0; i < 4; i++) {
for (j = 0; j < 4; j++) {
char *a = aa + i; char *b = bb + j;
strcpy(a, "0000000012222222");
strcpy(b, "0000000021111111");
if (memcmp(a, b, 16) >= 0)
exit(1);
}
}
]])],
[mfx_cv_func_memcmp=yes],
[mfx_cv_func_memcmp=no],
[mfx_cv_func_memcmp=unknown])])
if test "$mfx_cv_func_memcmp" = no; then
AC_DEFINE(NO_MEMCMP)
fi
])
|
Added work/contrib/lzo/lzo-1.08/config.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
|
/* config.h. Generated by configure. */
/* config.hin. Generated from configure.in by autoheader. */
/* acconfig.h -- autoheader configuration file
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#ifndef __LZO_CONFIG_H
#define __LZO_CONFIG_H
/* $TOP$ */
/* acconfig.h
Descriptive text for the C preprocessor macros that
the distributed Autoconf macros can define.
No software package will use all of them; autoheader copies the ones
your configure.in uses into your configuration header file templates.
The entries are in sort -df order: alphabetical, case insensitive,
ignoring punctuation (such as underscores). Although this order
can split up related entries, it makes it easier to check whether
a given entry is in the file.
Leave the following blank line there!! Autoheader needs it. */
/* Define if your machine can copy aligned words much faster than bytes. */
/* #undef LZO_ALIGNED_OK_4 */
/* Define for machines where assembler versions are not available. */
/* #undef LZO_NO_ASM */
/* Define for machines that can access unaligned short words. */
#define LZO_UNALIGNED_OK_2 1
/* Define for machines that can access unaligned words. */
#define LZO_UNALIGNED_OK_4 1
/* Define to your architecture name. */
#define MFX_ARCH "i386"
/* Define for machines where ".align 4" means align to a 4 byte boundary. */
#define MFX_ASM_ALIGN_BYTES 1
/* Define for machines where ".align 4" means align to a 2**4 boundary. */
/* #undef MFX_ASM_ALIGN_PTWO */
/* Define for i386 machines where the ebp register is reserved. */
/* #undef MFX_ASM_CANNOT_USE_EBP */
/* Define for machines where the assmbler understands ".type". */
#define MFX_ASM_HAVE_TYPE 1
/* Define for machines where global symbols don't have leading underscores. */
#define MFX_ASM_NAME_NO_UNDERSCORES 1
/* Define if your compiler is broken. */
/* #undef MFX_PROG_CC_BUG_SIGNED_TO_UNSIGNED_CASTING */
/* Define to your byte order. */
#define MFX_BYTE_ORDER 1234
/* Define to your CPU name. */
#define MFX_CPU "i586"
/* Define if your memcmp is broken. */
/* #undef NO_MEMCMP */
/* Leave that blank line there!! Autoheader needs it.
If you're adding to this file, keep in mind:
The entries are in sort -df order: alphabetical, case insensitive,
ignoring punctuation (such as underscores). */
/* Define to 1 if you have the <assert.h> header file. */
#define HAVE_ASSERT_H 1
/* Define to 1 if you have the `atol' function. */
#define HAVE_ATOL 1
/* Define to 1 if you have the <ctype.h> header file. */
#define HAVE_CTYPE_H 1
/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1
/* Define to 1 if you have the <endian.h> header file. */
#define HAVE_ENDIAN_H 1
/* Define to 1 if you have the `fstat' function. */
#define HAVE_FSTAT 1
/* Define to 1 if you have the `getrusage' function. */
#define HAVE_GETRUSAGE 1
/* Define to 1 if you have the `gettimeofday' function. */
#define HAVE_GETTIMEOFDAY 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the `z' library (-lz). */
/* #undef HAVE_LIBZ */
/* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1
/* Define to 1 if you have the `lstat' function. */
#define HAVE_LSTAT 1
/* Define to 1 if you have the `memcmp' function. */
#define HAVE_MEMCMP 1
/* Define to 1 if you have the `memcpy' function. */
#define HAVE_MEMCPY 1
/* Define to 1 if you have the `memicmp' function. */
/* #undef HAVE_MEMICMP */
/* Define to 1 if you have the `memmove' function. */
#define HAVE_MEMMOVE 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the `memset' function. */
#define HAVE_MEMSET 1
/* Define to 1 if you have the <signal.h> header file. */
#define HAVE_SIGNAL_H 1
/* Define to 1 if you have the `stat' function. */
#define HAVE_STAT 1
/* Define to 1 if you have the <stddef.h> header file. */
#define HAVE_STDDEF_H 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the `strcasecmp' function. */
#define HAVE_STRCASECMP 1
/* Define to 1 if you have the `stricmp' function. */
/* #undef HAVE_STRICMP */
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the `strncasecmp' function. */
#define HAVE_STRNCASECMP 1
/* Define to 1 if you have the `strnicmp' function. */
/* #undef HAVE_STRNICMP */
/* Define to 1 if you have the <sys/endian.h> header file. */
/* #undef HAVE_SYS_ENDIAN_H */
/* Define to 1 if you have the <sys/param.h> header file. */
#define HAVE_SYS_PARAM_H 1
/* Define to 1 if you have the <sys/resource.h> header file. */
#define HAVE_SYS_RESOURCE_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/times.h> header file. */
#define HAVE_SYS_TIMES_H 1
/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the `times' function. */
#define HAVE_TIMES 1
/* Define to 1 if you have the <time.h> header file. */
#define HAVE_TIME_H 1
/* Define to 1 if you have the <unchecked.h> header file. */
/* #undef HAVE_UNCHECKED_H */
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if you have the <zlib.h> header file. */
#define HAVE_ZLIB_H 1
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
/* #undef NO_MINUS_C_MINUS_O */
/* Name of package */
#define PACKAGE "lzo"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT ""
/* Define to the full name of this package. */
#define PACKAGE_NAME "lzo"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "lzo 1.08"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "lzo"
/* Define to the version of this package. */
#define PACKAGE_VERSION "1.08"
/* The size of a `char *', as computed by sizeof. */
#define SIZEOF_CHAR_P 4
/* The size of a `ptrdiff_t', as computed by sizeof. */
#define SIZEOF_PTRDIFF_T 4
/* The size of a `size_t', as computed by sizeof. */
#define SIZEOF_SIZE_T 4
/* The size of a `unsigned', as computed by sizeof. */
#define SIZEOF_UNSIGNED 4
/* The size of a `unsigned long', as computed by sizeof. */
#define SIZEOF_UNSIGNED_LONG 4
/* The size of a `unsigned short', as computed by sizeof. */
#define SIZEOF_UNSIGNED_SHORT 2
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME 1
/* Version number of package */
#define VERSION "1.08"
/* Define if using the dmalloc debugging malloc package */
/* #undef WITH_DMALLOC */
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
/* Define to `long' if <sys/types.h> does not define. */
/* #undef ptrdiff_t */
/* Define to `unsigned' if <sys/types.h> does not define. */
/* #undef size_t */
/* $BOTTOM$ */
#ifdef __cplusplus
# undef /**/ const
#endif
#if defined(HAVE_SYS_RESOURCE_H) && !defined(TIME_WITH_SYS_TIME)
# undef /**/ HAVE_SYS_RESOURCE_H
#endif
#if defined(HAVE_SYS_TIMES_H) && !defined(TIME_WITH_SYS_TIME)
# undef /**/ HAVE_SYS_TIMES_H
#endif
#if !defined(HAVE_LIBZ)
# undef /**/ HAVE_ZLIB_H
#endif
#if defined(NO_MEMCMP)
# undef /**/ HAVE_MEMCMP
#endif
#if (SIZEOF_CHAR_P <= 0)
# undef /**/ SIZEOF_CHAR_P
#endif
#if (SIZEOF_PTRDIFF_T <= 0)
# undef /**/ SIZEOF_PTRDIFF_T
#endif
#if (SIZEOF_UNSIGNED <= 0)
# undef /**/ SIZEOF_UNSIGNED
#endif
#if (SIZEOF_UNSIGNED_LONG <= 0)
# undef /**/ SIZEOF_UNSIGNED_LONG
#endif
#if (SIZEOF_UNSIGNED_SHORT <= 0)
# undef /**/ SIZEOF_UNSIGNED_SHORT
#endif
#if (SIZEOF_SIZE_T <= 0)
# undef /**/ SIZEOF_SIZE_T
#endif
#endif /* already included */
/*
vi:ts=4
*/
|
Added work/contrib/lzo/lzo-1.08/config.hin.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
|
/* config.hin. Generated from configure.in by autoheader. */
/* acconfig.h -- autoheader configuration file
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#ifndef __LZO_CONFIG_H
#define __LZO_CONFIG_H
/* $TOP$ */
/* acconfig.h
Descriptive text for the C preprocessor macros that
the distributed Autoconf macros can define.
No software package will use all of them; autoheader copies the ones
your configure.in uses into your configuration header file templates.
The entries are in sort -df order: alphabetical, case insensitive,
ignoring punctuation (such as underscores). Although this order
can split up related entries, it makes it easier to check whether
a given entry is in the file.
Leave the following blank line there!! Autoheader needs it. */
/* Define if your machine can copy aligned words much faster than bytes. */
#undef LZO_ALIGNED_OK_4
/* Define for machines where assembler versions are not available. */
#undef LZO_NO_ASM
/* Define for machines that can access unaligned short words. */
#undef LZO_UNALIGNED_OK_2
/* Define for machines that can access unaligned words. */
#undef LZO_UNALIGNED_OK_4
/* Define to your architecture name. */
#undef MFX_ARCH
/* Define for machines where ".align 4" means align to a 4 byte boundary. */
#undef MFX_ASM_ALIGN_BYTES
/* Define for machines where ".align 4" means align to a 2**4 boundary. */
#undef MFX_ASM_ALIGN_PTWO
/* Define for i386 machines where the ebp register is reserved. */
#undef MFX_ASM_CANNOT_USE_EBP
/* Define for machines where the assmbler understands ".type". */
#undef MFX_ASM_HAVE_TYPE
/* Define for machines where global symbols don't have leading underscores. */
#undef MFX_ASM_NAME_NO_UNDERSCORES
/* Define if your compiler is broken. */
#undef MFX_PROG_CC_BUG_SIGNED_TO_UNSIGNED_CASTING
/* Define to your byte order. */
#undef MFX_BYTE_ORDER
/* Define to your CPU name. */
#undef MFX_CPU
/* Define if your memcmp is broken. */
#undef NO_MEMCMP
/* Leave that blank line there!! Autoheader needs it.
If you're adding to this file, keep in mind:
The entries are in sort -df order: alphabetical, case insensitive,
ignoring punctuation (such as underscores). */
/* Define to 1 if you have the <assert.h> header file. */
#undef HAVE_ASSERT_H
/* Define to 1 if you have the `atol' function. */
#undef HAVE_ATOL
/* Define to 1 if you have the <ctype.h> header file. */
#undef HAVE_CTYPE_H
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the <endian.h> header file. */
#undef HAVE_ENDIAN_H
/* Define to 1 if you have the `fstat' function. */
#undef HAVE_FSTAT
/* Define to 1 if you have the `getrusage' function. */
#undef HAVE_GETRUSAGE
/* Define to 1 if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the `z' library (-lz). */
#undef HAVE_LIBZ
/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
/* Define to 1 if you have the `lstat' function. */
#undef HAVE_LSTAT
/* Define to 1 if you have the `memcmp' function. */
#undef HAVE_MEMCMP
/* Define to 1 if you have the `memcpy' function. */
#undef HAVE_MEMCPY
/* Define to 1 if you have the `memicmp' function. */
#undef HAVE_MEMICMP
/* Define to 1 if you have the `memmove' function. */
#undef HAVE_MEMMOVE
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `memset' function. */
#undef HAVE_MEMSET
/* Define to 1 if you have the <signal.h> header file. */
#undef HAVE_SIGNAL_H
/* Define to 1 if you have the `stat' function. */
#undef HAVE_STAT
/* Define to 1 if you have the <stddef.h> header file. */
#undef HAVE_STDDEF_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the `strcasecmp' function. */
#undef HAVE_STRCASECMP
/* Define to 1 if you have the `stricmp' function. */
#undef HAVE_STRICMP
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the `strncasecmp' function. */
#undef HAVE_STRNCASECMP
/* Define to 1 if you have the `strnicmp' function. */
#undef HAVE_STRNICMP
/* Define to 1 if you have the <sys/endian.h> header file. */
#undef HAVE_SYS_ENDIAN_H
/* Define to 1 if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
/* Define to 1 if you have the <sys/resource.h> header file. */
#undef HAVE_SYS_RESOURCE_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/times.h> header file. */
#undef HAVE_SYS_TIMES_H
/* Define to 1 if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the `times' function. */
#undef HAVE_TIMES
/* Define to 1 if you have the <time.h> header file. */
#undef HAVE_TIME_H
/* Define to 1 if you have the <unchecked.h> header file. */
#undef HAVE_UNCHECKED_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the <zlib.h> header file. */
#undef HAVE_ZLIB_H
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
#undef NO_MINUS_C_MINUS_O
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* The size of a `char *', as computed by sizeof. */
#undef SIZEOF_CHAR_P
/* The size of a `ptrdiff_t', as computed by sizeof. */
#undef SIZEOF_PTRDIFF_T
/* The size of a `size_t', as computed by sizeof. */
#undef SIZEOF_SIZE_T
/* The size of a `unsigned', as computed by sizeof. */
#undef SIZEOF_UNSIGNED
/* The size of a `unsigned long', as computed by sizeof. */
#undef SIZEOF_UNSIGNED_LONG
/* The size of a `unsigned short', as computed by sizeof. */
#undef SIZEOF_UNSIGNED_SHORT
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
/* Version number of package */
#undef VERSION
/* Define if using the dmalloc debugging malloc package */
#undef WITH_DMALLOC
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define to `long' if <sys/types.h> does not define. */
#undef ptrdiff_t
/* Define to `unsigned' if <sys/types.h> does not define. */
#undef size_t
/* $BOTTOM$ */
#ifdef __cplusplus
# undef /**/ const
#endif
#if defined(HAVE_SYS_RESOURCE_H) && !defined(TIME_WITH_SYS_TIME)
# undef /**/ HAVE_SYS_RESOURCE_H
#endif
#if defined(HAVE_SYS_TIMES_H) && !defined(TIME_WITH_SYS_TIME)
# undef /**/ HAVE_SYS_TIMES_H
#endif
#if !defined(HAVE_LIBZ)
# undef /**/ HAVE_ZLIB_H
#endif
#if defined(NO_MEMCMP)
# undef /**/ HAVE_MEMCMP
#endif
#if (SIZEOF_CHAR_P <= 0)
# undef /**/ SIZEOF_CHAR_P
#endif
#if (SIZEOF_PTRDIFF_T <= 0)
# undef /**/ SIZEOF_PTRDIFF_T
#endif
#if (SIZEOF_UNSIGNED <= 0)
# undef /**/ SIZEOF_UNSIGNED
#endif
#if (SIZEOF_UNSIGNED_LONG <= 0)
# undef /**/ SIZEOF_UNSIGNED_LONG
#endif
#if (SIZEOF_UNSIGNED_SHORT <= 0)
# undef /**/ SIZEOF_UNSIGNED_SHORT
#endif
#if (SIZEOF_SIZE_T <= 0)
# undef /**/ SIZEOF_SIZE_T
#endif
#endif /* already included */
/*
vi:ts=4
*/
|
Added work/contrib/lzo/lzo-1.08/config.log.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
|
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by lzo configure 1.08, which was
generated by GNU Autoconf 2.53. Invocation command line was
$ ./configure --enable-shared
## --------- ##
## Platform. ##
## --------- ##
hostname = unleaded
uname -m = i586
uname -r = 2.2.21
uname -s = Linux
uname -v = #7 Sun Jul 28 02:21:25 CDT 2002
/usr/bin/uname -p = unknown
/bin/uname -X = unknown
/bin/arch = i586
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /usr/local/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/X11R6/bin
PATH: /usr/openwin/bin
PATH: /usr/games
PATH: /usr/local/jdk1.3.1_01/bin
PATH: /usr/local/mysql/bin
PATH: .
## ----------- ##
## Core tests. ##
## ----------- ##
configure:1418: checking build system type
configure:1436: result: i586-pc-linux-gnu
configure:1444: checking host system type
configure:1458: result: i586-pc-linux-gnu
configure:1466: checking target system type
configure:1480: result: i586-pc-linux-gnu
configure:1570: checking for gcc
configure:1586: found /usr/local/bin/gcc
configure:1596: result: gcc
configure:1840: checking for C compiler version
configure:1843: gcc --version </dev/null >&5
pgcc-2.95.2
configure:1846: $? = 0
configure:1848: gcc -v </dev/null >&5
Reading specs from /usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/specs
gcc version pgcc-2.95.2 19991024 (release)
configure:1851: $? = 0
configure:1853: gcc -V </dev/null >&5
gcc: argument to `-V' is missing
configure:1856: $? = 1
configure:1882: checking for C compiler default output
configure:1885: gcc conftest.c >&5
configure:1888: $? = 0
configure:1921: result: a.out
configure:1926: checking whether the C compiler works
configure:1932: ./a.out
configure:1935: $? = 0
configure:1950: result: yes
configure:1957: checking whether we are cross compiling
configure:1959: result: no
configure:1962: checking for suffix of executables
configure:1964: gcc -o conftest conftest.c >&5
configure:1967: $? = 0
configure:1989: result:
configure:1995: checking for suffix of object files
configure:2019: gcc -c conftest.c >&5
configure:2022: $? = 0
configure:2041: result: o
configure:2045: checking whether we are using the GNU C compiler
configure:2072: gcc -c conftest.c >&5
configure:2075: $? = 0
configure:2078: test -s conftest.o
configure:2081: $? = 0
configure:2093: result: yes
configure:2099: checking whether gcc accepts -g
configure:2123: gcc -c -g conftest.c >&5
configure:2126: $? = 0
configure:2129: test -s conftest.o
configure:2132: $? = 0
configure:2142: result: yes
configure:2169: gcc -c conftest.c >&5
conftest.c:2: parse error before `me'
configure:2172: $? = 1
configure: failed program was:
#ifndef __cplusplus
choke me
#endif
configure:2296: checking for gcc option to accept ANSI C
configure:2394: gcc -c conftest.c >&5
configure:2397: $? = 0
configure:2400: test -s conftest.o
configure:2403: $? = 0
configure:2417: result: none needed
configure:2441: checking for a BSD-compatible install
configure:2495: result: /usr/bin/ginstall -c
configure:2506: checking whether build environment is sane
configure:2549: result: yes
configure:2582: checking for gawk
configure:2598: found /usr/bin/gawk
configure:2608: result: gawk
configure:2618: checking whether make sets ${MAKE}
configure:2638: result: yes
configure:2667: checking for style of include used by make
configure:2695: result: GNU
configure:2857: checking dependency style of gcc
configure:2919: result: gcc
configure:2931: checking whether to enable maintainer-specific portions of Makefiles
configure:2940: result: no
configure:2956: checking whether we are using GNU make
configure:2962: result: yes
configure:3033: checking if malloc debugging is wanted
configure:3054: result: no
configure:3098: checking how to run the C preprocessor
configure:3124: gcc -E conftest.c
configure:3130: $? = 0
configure:3157: gcc -E conftest.c
configure:3153: ac_nonexistent.h: No such file or directory
configure:3163: $? = 1
configure: failed program was:
#line 3152 "configure"
#include "confdefs.h"
#include <ac_nonexistent.h>
configure:3200: result: gcc -E
configure:3215: gcc -E conftest.c
configure:3221: $? = 0
configure:3248: gcc -E conftest.c
configure:3244: ac_nonexistent.h: No such file or directory
configure:3254: $? = 1
configure: failed program was:
#line 3243 "configure"
#include "confdefs.h"
#include <ac_nonexistent.h>
configure:3294: checking whether gcc and cc understand -c and -o together
configure:3327: gcc -c conftest.c -o conftest.o >&5
configure:3330: $? = 0
configure:3332: gcc -c conftest.c -o conftest.o >&5
configure:3335: $? = 0
configure:3342: cc -c conftest.c >&5
configure:3345: $? = 0
configure:3348: cc -c conftest.c -o conftest.o >&5
configure:3351: $? = 0
configure:3353: cc -c conftest.c -o conftest.o >&5
configure:3356: $? = 0
configure:3374: result: yes
configure:3386: checking how the compiler promotes integrals
configure:3412: gcc -c conftest.c >&5
configure:3415: $? = 0
configure:3418: test -s conftest.o
configure:3421: $? = 0
configure:3431: result: ANSI C (value-preserving)
configure:3434: checking whether we are using checkergcc
configure:3447: gcc -E conftest.c
configure:3450: $? = 0
configure:3457: result: no
configure:3489: checking whether to build a debug version
configure:3491: result: no
configure:3504: checking whether to build a profiling version
configure:3506: result: no
configure:3518: checking whether to build a coverage version
configure:3520: result: no
configure:3576: checking for ld used by GCC
configure:3639: result: /usr/bin/ld
configure:3648: checking if the linker (/usr/bin/ld) is GNU ld
GNU ld version 2.9.1 (with BFD 2.9.1.0.25)
configure:3660: result: yes
configure:3665: checking for /usr/bin/ld option to reload object files
configure:3672: result: -r
configure:3677: checking for BSD-compatible nm
configure:3713: result: /usr/bin/nm -B
configure:3716: checking for a sed that does not truncate output
configure:3798: result: /usr/bin/sed
configure:3801: checking whether ln -s works
configure:3805: result: yes
configure:3812: checking how to recognise dependent libraries
configure:3993: result: pass_all
configure:4004: checking command to parse /usr/bin/nm -B output
configure:4085: gcc -c conftest.c >&5
configure:4088: $? = 0
configure:4092: /usr/bin/nm -B conftest.o \| sed -n -e 's/^.*[ ]\([ABCDGISTW][ABCDGISTW]*\)[ ][ ]*\(\)\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2\3 \3/p' \> conftest.nm
configure:4095: $? = 0
configure:4147: gcc -o conftest conftest.c conftstm.o >&5
configure:4150: $? = 0
configure:4194: result: ok
configure:4199: checking for ANSI C header files
configure:4213: gcc -E conftest.c
configure:4219: $? = 0
configure:4304: gcc -o conftest conftest.c >&5
configure:4307: $? = 0
configure:4309: ./conftest
configure:4312: $? = 0
configure:4326: result: yes
configure:4350: checking for sys/types.h
configure:4363: gcc -c conftest.c >&5
configure:4366: $? = 0
configure:4369: test -s conftest.o
configure:4372: $? = 0
configure:4382: result: yes
configure:4350: checking for sys/stat.h
configure:4363: gcc -c conftest.c >&5
configure:4366: $? = 0
configure:4369: test -s conftest.o
configure:4372: $? = 0
configure:4382: result: yes
configure:4350: checking for stdlib.h
configure:4363: gcc -c conftest.c >&5
configure:4366: $? = 0
configure:4369: test -s conftest.o
configure:4372: $? = 0
configure:4382: result: yes
configure:4350: checking for string.h
configure:4363: gcc -c conftest.c >&5
configure:4366: $? = 0
configure:4369: test -s conftest.o
configure:4372: $? = 0
configure:4382: result: yes
configure:4350: checking for memory.h
configure:4363: gcc -c conftest.c >&5
configure:4366: $? = 0
configure:4369: test -s conftest.o
configure:4372: $? = 0
configure:4382: result: yes
configure:4350: checking for strings.h
configure:4363: gcc -c conftest.c >&5
configure:4366: $? = 0
configure:4369: test -s conftest.o
configure:4372: $? = 0
configure:4382: result: yes
configure:4350: checking for inttypes.h
configure:4363: gcc -c conftest.c >&5
configure:4366: $? = 0
configure:4369: test -s conftest.o
configure:4372: $? = 0
configure:4382: result: yes
configure:4350: checking for stdint.h
configure:4363: gcc -c conftest.c >&5
configure:4366: $? = 0
configure:4369: test -s conftest.o
configure:4372: $? = 0
configure:4382: result: yes
configure:4350: checking for unistd.h
configure:4363: gcc -c conftest.c >&5
configure:4366: $? = 0
configure:4369: test -s conftest.o
configure:4372: $? = 0
configure:4382: result: yes
configure:4408: checking dlfcn.h usability
configure:4417: gcc -c conftest.c >&5
configure:4420: $? = 0
configure:4423: test -s conftest.o
configure:4426: $? = 0
configure:4435: result: yes
configure:4439: checking dlfcn.h presence
configure:4446: gcc -E conftest.c
configure:4452: $? = 0
configure:4470: result: yes
configure:4488: checking for dlfcn.h
configure:4495: result: yes
configure:4693: checking for ranlib
configure:4709: found /usr/bin/ranlib
configure:4720: result: ranlib
configure:4773: checking for strip
configure:4789: found /usr/bin/strip
configure:4800: result: strip
configure:5011: checking for objdir
configure:5022: result: .libs
configure:5039: checking for gcc option to produce PIC
configure:5185: result: -fPIC
configure:5189: checking if gcc PIC flag -fPIC works
configure:5215: gcc -c -fPIC -DPIC conftest.c >&5
configure:5218: $? = 0
configure:5221: test -s conftest.o
configure:5224: $? = 0
configure:5261: result: yes
configure:5277: checking if gcc static flag -static works
configure:5304: gcc -o conftest -static conftest.c >&5
configure:5307: $? = 0
configure:5310: test -s conftest
configure:5313: $? = 0
configure:5328: result: yes
configure:5340: checking if gcc supports -c -o file.o
configure:5362: gcc -c -o out/conftest2.o conftest.c >&5
configure:5384: result: yes
configure:5389: checking if gcc supports -c -o file.lo
configure:5419: gcc -c -c -o conftest.lo conftest.c >&5
configure:5422: $? = 0
configure:5425: test -s conftest.lo
configure:5428: $? = 0
configure:5449: result: yes
configure:5480: checking if gcc supports -fno-rtti -fno-exceptions
configure:5505: gcc -c -fno-rtti -fno-exceptions -c conftest.c conftest.c >&5
configure:5508: $? = 0
configure:5511: test -s conftest.o
configure:5514: $? = 0
configure:5530: result: yes
configure:5541: checking whether the linker (/usr/bin/ld) supports shared libraries
configure:6233: result: yes
configure:6238: checking how to hardcode library paths into programs
configure:6262: result: immediate
configure:6267: checking whether stripping libraries is possible
configure:6272: result: yes
configure:6283: checking dynamic linker characteristics
configure:6685: result: GNU/Linux ld.so
configure:6690: checking if libtool supports shared libraries
configure:6692: result: yes
configure:6695: checking whether to build shared libraries
configure:6716: result: yes
configure:6719: checking whether to build static libraries
configure:6723: result: yes
configure:7385: checking whether -lc should be explicitly linked in
configure:7393: gcc -c conftest.c >&5
configure:7396: $? = 0
configure:7410: gcc -shared conftest.o -v -Wl,-soname -Wl,conftest -o conftest 2\>\&1 \| grep -lc \>/dev/null 2\>\&1
configure:7413: $? = 0
configure:7426: result: no
configure:8017: checking for nasm
configure:8046: result: no
configure:8137: checking for ANSI C header files
configure:8264: result: yes
configure:8274: checking whether time.h and sys/time.h may both be included
configure:8302: gcc -c conftest.c >&5
configure:8305: $? = 0
configure:8308: test -s conftest.o
configure:8311: $? = 0
configure:8321: result: yes
configure:8351: checking assert.h usability
configure:8360: gcc -c conftest.c >&5
configure:8363: $? = 0
configure:8366: test -s conftest.o
configure:8369: $? = 0
configure:8378: result: yes
configure:8382: checking assert.h presence
configure:8389: gcc -E conftest.c
configure:8395: $? = 0
configure:8413: result: yes
configure:8431: checking for assert.h
configure:8438: result: yes
configure:8351: checking ctype.h usability
configure:8360: gcc -c conftest.c >&5
configure:8363: $? = 0
configure:8366: test -s conftest.o
configure:8369: $? = 0
configure:8378: result: yes
configure:8382: checking ctype.h presence
configure:8389: gcc -E conftest.c
configure:8395: $? = 0
configure:8413: result: yes
configure:8431: checking for ctype.h
configure:8438: result: yes
configure:8351: checking limits.h usability
configure:8360: gcc -c conftest.c >&5
configure:8363: $? = 0
configure:8366: test -s conftest.o
configure:8369: $? = 0
configure:8378: result: yes
configure:8382: checking limits.h presence
configure:8389: gcc -E conftest.c
configure:8395: $? = 0
configure:8413: result: yes
configure:8431: checking for limits.h
configure:8438: result: yes
configure:8351: checking signal.h usability
configure:8360: gcc -c conftest.c >&5
configure:8363: $? = 0
configure:8366: test -s conftest.o
configure:8369: $? = 0
configure:8378: result: yes
configure:8382: checking signal.h presence
configure:8389: gcc -E conftest.c
configure:8395: $? = 0
configure:8413: result: yes
configure:8431: checking for signal.h
configure:8438: result: yes
configure:8351: checking stddef.h usability
configure:8360: gcc -c conftest.c >&5
configure:8363: $? = 0
configure:8366: test -s conftest.o
configure:8369: $? = 0
configure:8378: result: yes
configure:8382: checking stddef.h presence
configure:8389: gcc -E conftest.c
configure:8395: $? = 0
configure:8413: result: yes
configure:8431: checking for stddef.h
configure:8438: result: yes
configure:8351: checking time.h usability
configure:8360: gcc -c conftest.c >&5
configure:8363: $? = 0
configure:8366: test -s conftest.o
configure:8369: $? = 0
configure:8378: result: yes
configure:8382: checking time.h presence
configure:8389: gcc -E conftest.c
configure:8395: $? = 0
configure:8413: result: yes
configure:8431: checking for time.h
configure:8438: result: yes
configure:8342: checking for unistd.h
configure:8347: result: yes
configure:8468: checking sys/param.h usability
configure:8477: gcc -c conftest.c >&5
configure:8480: $? = 0
configure:8483: test -s conftest.o
configure:8486: $? = 0
configure:8495: result: yes
configure:8499: checking sys/param.h presence
configure:8506: gcc -E conftest.c
configure:8512: $? = 0
configure:8530: result: yes
configure:8548: checking for sys/param.h
configure:8555: result: yes
configure:8468: checking sys/resource.h usability
configure:8477: gcc -c conftest.c >&5
configure:8480: $? = 0
configure:8483: test -s conftest.o
configure:8486: $? = 0
configure:8495: result: yes
configure:8499: checking sys/resource.h presence
configure:8506: gcc -E conftest.c
configure:8512: $? = 0
configure:8530: result: yes
configure:8548: checking for sys/resource.h
configure:8555: result: yes
configure:8468: checking sys/time.h usability
configure:8477: gcc -c conftest.c >&5
configure:8480: $? = 0
configure:8483: test -s conftest.o
configure:8486: $? = 0
configure:8495: result: yes
configure:8499: checking sys/time.h presence
configure:8506: gcc -E conftest.c
configure:8512: $? = 0
configure:8530: result: yes
configure:8548: checking for sys/time.h
configure:8555: result: yes
configure:8468: checking sys/times.h usability
configure:8477: gcc -c conftest.c >&5
configure:8480: $? = 0
configure:8483: test -s conftest.o
configure:8486: $? = 0
configure:8495: result: yes
configure:8499: checking sys/times.h presence
configure:8506: gcc -E conftest.c
configure:8512: $? = 0
configure:8530: result: yes
configure:8548: checking for sys/times.h
configure:8555: result: yes
configure:8584: checking endian.h usability
configure:8593: gcc -c conftest.c >&5
configure:8596: $? = 0
configure:8599: test -s conftest.o
configure:8602: $? = 0
configure:8611: result: yes
configure:8615: checking endian.h presence
configure:8622: gcc -E conftest.c
configure:8628: $? = 0
configure:8646: result: yes
configure:8664: checking for endian.h
configure:8671: result: yes
configure:8584: checking sys/endian.h usability
configure:8593: gcc -c conftest.c >&5
configure:8621: sys/endian.h: No such file or directory
configure:8596: $? = 1
configure: failed program was:
#line 8586 "configure"
#include "confdefs.h"
#include <stdio.h>
#if HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#if HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#if STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#else
# if HAVE_STDLIB_H
# include <stdlib.h>
# endif
#endif
#if HAVE_STRING_H
# if !STDC_HEADERS && HAVE_MEMORY_H
# include <memory.h>
# endif
# include <string.h>
#endif
#if HAVE_STRINGS_H
# include <strings.h>
#endif
#if HAVE_INTTYPES_H
# include <inttypes.h>
#else
# if HAVE_STDINT_H
# include <stdint.h>
# endif
#endif
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <sys/endian.h>
configure:8611: result: no
configure:8615: checking sys/endian.h presence
configure:8622: gcc -E conftest.c
configure:8618: sys/endian.h: No such file or directory
configure:8628: $? = 1
configure: failed program was:
#line 8617 "configure"
#include "confdefs.h"
#include <sys/endian.h>
configure:8646: result: no
configure:8664: checking for sys/endian.h
configure:8671: result: no
configure:8584: checking unchecked.h usability
configure:8593: gcc -c conftest.c >&5
configure:8621: unchecked.h: No such file or directory
configure:8596: $? = 1
configure: failed program was:
#line 8586 "configure"
#include "confdefs.h"
#include <stdio.h>
#if HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#if HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#if STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#else
# if HAVE_STDLIB_H
# include <stdlib.h>
# endif
#endif
#if HAVE_STRING_H
# if !STDC_HEADERS && HAVE_MEMORY_H
# include <memory.h>
# endif
# include <string.h>
#endif
#if HAVE_STRINGS_H
# include <strings.h>
#endif
#if HAVE_INTTYPES_H
# include <inttypes.h>
#else
# if HAVE_STDINT_H
# include <stdint.h>
# endif
#endif
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <unchecked.h>
configure:8611: result: no
configure:8615: checking unchecked.h presence
configure:8622: gcc -E conftest.c
configure:8618: unchecked.h: No such file or directory
configure:8628: $? = 1
configure: failed program was:
#line 8617 "configure"
#include "confdefs.h"
#include <unchecked.h>
configure:8646: result: no
configure:8664: checking for unchecked.h
configure:8671: result: no
configure:8698: checking zlib.h usability
configure:8707: gcc -c conftest.c >&5
configure:8710: $? = 0
configure:8713: test -s conftest.o
configure:8716: $? = 0
configure:8725: result: yes
configure:8729: checking zlib.h presence
configure:8736: gcc -E conftest.c
configure:8742: $? = 0
configure:8760: result: yes
configure:8778: checking for zlib.h
configure:8785: result: yes
configure:8804: checking whether limits.h is sane
configure:8916: gcc -c conftest.c >&5
configure:8919: $? = 0
configure:8922: test -s conftest.o
configure:8925: $? = 0
configure:8935: result: yes
configure:8949: checking for ptrdiff_t
configure:8976: gcc -c conftest.c >&5
configure:8979: $? = 0
configure:8982: test -s conftest.o
configure:8985: $? = 0
configure:8995: result: yes
configure:9007: checking for size_t
configure:9034: gcc -c conftest.c >&5
configure:9037: $? = 0
configure:9040: test -s conftest.o
configure:9043: $? = 0
configure:9053: result: yes
configure:9066: checking for unsigned short
configure:9093: gcc -c conftest.c >&5
configure:9096: $? = 0
configure:9099: test -s conftest.o
configure:9102: $? = 0
configure:9112: result: yes
configure:9115: checking size of unsigned short
configure:9393: gcc -o conftest conftest.c >&5
configure:9396: $? = 0
configure:9398: ./conftest
configure:9401: $? = 0
configure:9421: result: 2
configure:9428: checking for unsigned
configure:9455: gcc -c conftest.c >&5
configure:9458: $? = 0
configure:9461: test -s conftest.o
configure:9464: $? = 0
configure:9474: result: yes
configure:9477: checking size of unsigned
configure:9755: gcc -o conftest conftest.c >&5
configure:9758: $? = 0
configure:9760: ./conftest
configure:9763: $? = 0
configure:9783: result: 4
configure:9790: checking for unsigned long
configure:9817: gcc -c conftest.c >&5
configure:9820: $? = 0
configure:9823: test -s conftest.o
configure:9826: $? = 0
configure:9836: result: yes
configure:9839: checking size of unsigned long
configure:10117: gcc -o conftest conftest.c >&5
configure:10120: $? = 0
configure:10122: ./conftest
configure:10125: $? = 0
configure:10145: result: 4
configure:10152: checking for char *
configure:10179: gcc -c conftest.c >&5
configure:10182: $? = 0
configure:10185: test -s conftest.o
configure:10188: $? = 0
configure:10198: result: yes
configure:10201: checking size of char *
configure:10479: gcc -o conftest conftest.c >&5
configure:10482: $? = 0
configure:10484: ./conftest
configure:10487: $? = 0
configure:10507: result: 4
configure:10514: checking for ptrdiff_t
configure:10560: result: yes
configure:10563: checking size of ptrdiff_t
configure:10841: gcc -o conftest conftest.c >&5
configure:10844: $? = 0
configure:10846: ./conftest
configure:10849: $? = 0
configure:10869: result: 4
configure:10876: checking for size_t
configure:10922: result: yes
configure:10925: checking size of size_t
configure:11203: gcc -o conftest conftest.c >&5
configure:11206: $? = 0
configure:11208: ./conftest
configure:11211: $? = 0
configure:11231: result: 4
configure:11244: checking for gcc option to accept ANSI C
configure:11307: gcc -c conftest.c >&5
configure:11310: $? = 0
configure:11313: test -s conftest.o
configure:11316: $? = 0
configure:11333: result: none needed
configure:11341: checking for an ANSI C-conforming const
configure:11411: gcc -c conftest.c >&5
configure:11414: $? = 0
configure:11417: test -s conftest.o
configure:11420: $? = 0
configure:11430: result: yes
configure:11441: checking the byte order
configure:11471: gcc -o conftest conftest.c >&5
configure:11474: $? = 0
configure:11476: ./conftest
configure:11479: $? = 1
configure: program exited with status 1
configure: failed program was:
#line 11449 "configure"
#include "confdefs.h"
#ifdef F77_DUMMY_MAIN
# ifdef __cplusplus
extern "C"
# endif
int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
union { long l; char c[sizeof(long)]; } u;
u.l = 1; exit(u.c[0] == 1);
;
return 0;
}
configure:11492: result: 1234
configure:11520: checking for memcmp
configure:11563: gcc -o conftest conftest.c >&5
configure:11535: warning: conflicting types for built-in function `memcmp'
configure:11566: $? = 0
configure:11569: test -s conftest
configure:11572: $? = 0
configure:11582: result: yes
configure:11520: checking for memcpy
configure:11563: gcc -o conftest conftest.c >&5
configure:11535: warning: conflicting types for built-in function `memcpy'
configure:11566: $? = 0
configure:11569: test -s conftest
configure:11572: $? = 0
configure:11582: result: yes
configure:11520: checking for memmove
configure:11563: gcc -o conftest conftest.c >&5
configure:11566: $? = 0
configure:11569: test -s conftest
configure:11572: $? = 0
configure:11582: result: yes
configure:11520: checking for memset
configure:11563: gcc -o conftest conftest.c >&5
configure:11535: warning: conflicting types for built-in function `memset'
configure:11566: $? = 0
configure:11569: test -s conftest
configure:11572: $? = 0
configure:11582: result: yes
configure:11600: checking for memicmp
configure:11643: gcc -o conftest conftest.c >&5
/tmp/cc2BIZuf.o: In function `main':
/tmp/cc2BIZuf.o(.text+0x9): undefined reference to `memicmp'
collect2: ld returned 1 exit status
configure:11646: $? = 1
configure: failed program was:
#line 11605 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char memicmp (); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char memicmp ();
char (*f) ();
#ifdef F77_DUMMY_MAIN
# ifdef __cplusplus
extern "C"
# endif
int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_memicmp) || defined (__stub___memicmp)
choke me
#else
f = memicmp;
#endif
;
return 0;
}
configure:11662: result: no
configure:11600: checking for strcasecmp
configure:11643: gcc -o conftest conftest.c >&5
configure:11646: $? = 0
configure:11649: test -s conftest
configure:11652: $? = 0
configure:11662: result: yes
configure:11600: checking for strncasecmp
configure:11643: gcc -o conftest conftest.c >&5
configure:11646: $? = 0
configure:11649: test -s conftest
configure:11652: $? = 0
configure:11662: result: yes
configure:11600: checking for stricmp
configure:11643: gcc -o conftest conftest.c >&5
/tmp/ccWoGtOj.o: In function `main':
/tmp/ccWoGtOj.o(.text+0x9): undefined reference to `stricmp'
collect2: ld returned 1 exit status
configure:11646: $? = 1
configure: failed program was:
#line 11605 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char stricmp (); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char stricmp ();
char (*f) ();
#ifdef F77_DUMMY_MAIN
# ifdef __cplusplus
extern "C"
# endif
int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_stricmp) || defined (__stub___stricmp)
choke me
#else
f = stricmp;
#endif
;
return 0;
}
configure:11662: result: no
configure:11600: checking for strnicmp
configure:11643: gcc -o conftest conftest.c >&5
/tmp/ccR5jRhn.o: In function `main':
/tmp/ccR5jRhn.o(.text+0x9): undefined reference to `strnicmp'
collect2: ld returned 1 exit status
configure:11646: $? = 1
configure: failed program was:
#line 11605 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char strnicmp (); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char strnicmp ();
char (*f) ();
#ifdef F77_DUMMY_MAIN
# ifdef __cplusplus
extern "C"
# endif
int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_strnicmp) || defined (__stub___strnicmp)
choke me
#else
f = strnicmp;
#endif
;
return 0;
}
configure:11662: result: no
configure:11682: checking for atol
configure:11725: gcc -o conftest conftest.c >&5
configure:11728: $? = 0
configure:11731: test -s conftest
configure:11734: $? = 0
configure:11744: result: yes
configure:11682: checking for fstat
configure:11725: gcc -o conftest conftest.c >&5
configure:11728: $? = 0
configure:11731: test -s conftest
configure:11734: $? = 0
configure:11744: result: yes
configure:11682: checking for getrusage
configure:11725: gcc -o conftest conftest.c >&5
configure:11728: $? = 0
configure:11731: test -s conftest
configure:11734: $? = 0
configure:11744: result: yes
configure:11682: checking for gettimeofday
configure:11725: gcc -o conftest conftest.c >&5
configure:11728: $? = 0
configure:11731: test -s conftest
configure:11734: $? = 0
configure:11744: result: yes
configure:11682: checking for lstat
configure:11725: gcc -o conftest conftest.c >&5
configure:11728: $? = 0
configure:11731: test -s conftest
configure:11734: $? = 0
configure:11744: result: yes
configure:11682: checking for stat
configure:11725: gcc -o conftest conftest.c >&5
configure:11728: $? = 0
configure:11731: test -s conftest
configure:11734: $? = 0
configure:11744: result: yes
configure:11682: checking for times
configure:11725: gcc -o conftest conftest.c >&5
configure:11728: $? = 0
configure:11731: test -s conftest
configure:11734: $? = 0
configure:11744: result: yes
configure:11754: checking for working memcmp
configure:11798: gcc -o conftest conftest.c >&5
configure:11801: $? = 0
configure:11803: ./conftest
configure:11806: $? = 0
configure:11819: result: yes
configure:11840: checking whether signed to unsigned casting is broken
configure:11871: gcc -c conftest.c >&5
configure:11874: $? = 0
configure:11877: test -s conftest.o
configure:11880: $? = 0
configure:11890: result: no
configure:11896: checking whether gcc suffers the -fschedule-insns bug
configure:11931: gcc -o conftest -O2 -fschedule-insns -fschedule-insns2 conftest.c >&5
configure:11934: $? = 0
configure:11936: ./conftest
configure:11939: $? = 0
configure:11952: result: no
configure:11960: checking whether gcc suffers the -fstrength-reduce bug
configure:11987: gcc -o conftest -O2 -fstrength-reduce conftest.c >&5
configure:11990: $? = 0
configure:11992: ./conftest
configure:11995: $? = 0
configure:12008: result: no
configure:12086: checking whether gcc accepts -fstrict-aliasing
configure:12100: result: yes
configure:12162: checking the alignment of the assembler
configure:12201: gcc -o conftest -O2 -Wall -Wcast-align -Wcast-qual -Wwrite-strings -fno-strength-reduce -fstrict-aliasing conftest.c >&5
configure:12184: warning: return-type defaults to `int'
configure:12204: $? = 0
configure:12206: ./conftest
configure:12209: $? = 0
configure:12222: result: 4
configure:12241: checking whether global symbols need underscores
configure:12276: gcc -o conftest -O2 -Wall -Wcast-align -Wcast-qual -Wwrite-strings -fno-strength-reduce -fstrict-aliasing conftest.c >&5
configure:12249: warning: `test' defined but not used
configure:12279: $? = 0
configure:12282: test -s conftest
configure:12285: $? = 0
configure:12292: result: no
configure:12308: checking whether the assembler understands .type
configure:12317: gcc -c -x assembler-with-cpp conftest.s 1>&5
configure:12320: $? = 0
configure:12326: result: yes
configure:12339: checking whether the assembler works
configure:12348: gcc -c -x assembler-with-cpp -I./src/i386/src conftest.s 1>&5
configure:12351: $? = 0
configure:12361: result: yes
configure:12366: checking whether to build assembler versions
configure:12368: result: yes
configure:12518: creating ./config.status
## ---------------------- ##
## Running config.status. ##
## ---------------------- ##
This file was extended by lzo config.status 1.08, which was
generated by GNU Autoconf 2.53. Invocation command line was
CONFIG_FILES =
CONFIG_HEADERS =
CONFIG_LINKS =
CONFIG_COMMANDS =
$ ./config.status
on unleaded
config.status:644: creating Makefile
config.status:644: creating examples/Makefile
config.status:644: creating include/Makefile
config.status:644: creating ltest/Makefile
config.status:644: creating minilzo/Makefile
config.status:644: creating src/Makefile
config.status:644: creating tests/Makefile
config.status:748: creating config.h
config.status:1058: executing depfiles commands
## ---------------- ##
## Cache variables. ##
## ---------------- ##
ac_cv_build=i586-pc-linux-gnu
ac_cv_build_alias=i586-pc-linux-gnu
ac_cv_c_compiler_gnu=yes
ac_cv_c_const=yes
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_exeext=
ac_cv_func_atol=yes
ac_cv_func_fstat=yes
ac_cv_func_getrusage=yes
ac_cv_func_gettimeofday=yes
ac_cv_func_lstat=yes
ac_cv_func_memcmp=yes
ac_cv_func_memcpy=yes
ac_cv_func_memicmp=no
ac_cv_func_memmove=yes
ac_cv_func_memset=yes
ac_cv_func_stat=yes
ac_cv_func_strcasecmp=yes
ac_cv_func_stricmp=no
ac_cv_func_strncasecmp=yes
ac_cv_func_strnicmp=no
ac_cv_func_times=yes
ac_cv_header_assert_h=yes
ac_cv_header_ctype_h=yes
ac_cv_header_dlfcn_h=yes
ac_cv_header_endian_h=yes
ac_cv_header_inttypes_h=yes
ac_cv_header_limits_h=yes
ac_cv_header_memory_h=yes
ac_cv_header_signal_h=yes
ac_cv_header_stdc=yes
ac_cv_header_stddef_h=yes
ac_cv_header_stdint_h=yes
ac_cv_header_stdlib_h=yes
ac_cv_header_string_h=yes
ac_cv_header_strings_h=yes
ac_cv_header_sys_endian_h=no
ac_cv_header_sys_param_h=yes
ac_cv_header_sys_resource_h=yes
ac_cv_header_sys_stat_h=yes
ac_cv_header_sys_time_h=yes
ac_cv_header_sys_times_h=yes
ac_cv_header_sys_types_h=yes
ac_cv_header_time=yes
ac_cv_header_time_h=yes
ac_cv_header_unchecked_h=no
ac_cv_header_unistd_h=yes
ac_cv_header_zlib_h=yes
ac_cv_host=i586-pc-linux-gnu
ac_cv_host_alias=i586-pc-linux-gnu
ac_cv_objext=o
ac_cv_path_install='/usr/bin/ginstall -c'
ac_cv_prog_AWK=gawk
ac_cv_prog_CPP='gcc -E'
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_ac_ct_RANLIB=ranlib
ac_cv_prog_ac_ct_STRIP=strip
ac_cv_prog_cc_g=yes
ac_cv_prog_cc_gcc_c_o=yes
ac_cv_prog_cc_stdc=
ac_cv_prog_make_make_set=yes
ac_cv_sizeof_char_p=4
ac_cv_sizeof_ptrdiff_t=4
ac_cv_sizeof_size_t=4
ac_cv_sizeof_unsigned=4
ac_cv_sizeof_unsigned_long=4
ac_cv_sizeof_unsigned_short=2
ac_cv_target=i586-pc-linux-gnu
ac_cv_target_alias=i586-pc-linux-gnu
ac_cv_type_char_p=yes
ac_cv_type_ptrdiff_t=yes
ac_cv_type_size_t=yes
ac_cv_type_unsigned=yes
ac_cv_type_unsigned_long=yes
ac_cv_type_unsigned_short=yes
am_cv_CC_dependencies_compiler_type=gcc
lt_cv_archive_cmds_need_lc=no
lt_cv_compiler_c_o=yes
lt_cv_compiler_o_lo=yes
lt_cv_deplibs_check_method=pass_all
lt_cv_file_magic_cmd='$MAGIC_CMD'
lt_cv_file_magic_test_file='/lib/libc.so.6 /lib/libc-2.1.2.so /lib/libc-2.1.3.so'
lt_cv_global_symbol_to_c_name_address='sed -n -e '\''s/^: \([^ ]*\) $/ {\"\1\", (lt_ptr) 0},/p'\'' -e '\''s/^[BCDEGRST] \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr) \&\2},/p'\'''
lt_cv_global_symbol_to_cdecl='sed -n -e '\''s/^. .* \(.*\)$/extern char \1;/p'\'''
lt_cv_ld_reload_flag=-r
lt_cv_path_LD=/usr/bin/ld
lt_cv_path_NM='/usr/bin/nm -B'
lt_cv_path_SED=/usr/bin/sed
lt_cv_prog_cc_can_build_shared=yes
lt_cv_prog_cc_no_builtin=
lt_cv_prog_cc_pic=' -fPIC'
lt_cv_prog_cc_pic_works=yes
lt_cv_prog_cc_shlib=
lt_cv_prog_cc_static=-static
lt_cv_prog_cc_static_works=yes
lt_cv_prog_cc_wl=-Wl,
lt_cv_prog_gnu_ld=yes
lt_cv_sys_global_symbol_pipe='sed -n -e '\''s/^.*[ ]\([ABCDGISTW][ABCDGISTW]*\)[ ][ ]*\(\)\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2\3 \3/p'\'''
lt_cv_sys_path_separator=:
mfx_cv_asm_align=4
mfx_cv_c_byte_order=1234
mfx_cv_func_memcmp=yes
mfx_cv_header_sane_limits_h=yes
mfx_cv_prog_cc_ansi=
mfx_cv_prog_cc_bug_signed_to_unsigned_casting=no
mfx_cv_prog_cc_integral_promotion='ANSI C (value-preserving)'
mfx_cv_prog_checkergcc=no
mfx_cv_prog_gcc_bug_schedule_insns=no
mfx_cv_prog_gcc_bug_strength_reduce=no
mfx_cv_prog_gcc_f_strict_aliasing=yes
## ----------- ##
## confdefs.h. ##
## ----------- ##
#define PACKAGE_NAME "lzo"
#define PACKAGE_TARNAME "lzo"
#define PACKAGE_VERSION "1.08"
#define PACKAGE_STRING "lzo 1.08"
#define PACKAGE_BUGREPORT ""
#define PACKAGE "lzo"
#define VERSION "1.08"
#define STDC_HEADERS 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_MEMORY_H 1
#define HAVE_STRINGS_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_UNISTD_H 1
#define HAVE_DLFCN_H 1
#define STDC_HEADERS 1
#define TIME_WITH_SYS_TIME 1
#define HAVE_ASSERT_H 1
#define HAVE_CTYPE_H 1
#define HAVE_LIMITS_H 1
#define HAVE_SIGNAL_H 1
#define HAVE_STDDEF_H 1
#define HAVE_TIME_H 1
#define HAVE_UNISTD_H 1
#define HAVE_SYS_PARAM_H 1
#define HAVE_SYS_RESOURCE_H 1
#define HAVE_SYS_TIME_H 1
#define HAVE_SYS_TIMES_H 1
#define HAVE_ENDIAN_H 1
#define HAVE_ZLIB_H 1
#define SIZEOF_UNSIGNED_SHORT 2
#define SIZEOF_UNSIGNED 4
#define SIZEOF_UNSIGNED_LONG 4
#define SIZEOF_CHAR_P 4
#define SIZEOF_PTRDIFF_T 4
#define SIZEOF_SIZE_T 4
#define MFX_BYTE_ORDER 1234
#define HAVE_MEMCMP 1
#define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1
#define HAVE_MEMSET 1
#define HAVE_STRCASECMP 1
#define HAVE_STRNCASECMP 1
#define HAVE_ATOL 1
#define HAVE_FSTAT 1
#define HAVE_GETRUSAGE 1
#define HAVE_GETTIMEOFDAY 1
#define HAVE_LSTAT 1
#define HAVE_STAT 1
#define HAVE_TIMES 1
#define MFX_ARCH "i386"
#define MFX_CPU "i586"
#define LZO_UNALIGNED_OK_2 1
#define LZO_UNALIGNED_OK_4 1
#define MFX_ASM_ALIGN_BYTES 1
#define MFX_ASM_NAME_NO_UNDERSCORES 1
#define MFX_ASM_HAVE_TYPE 1
configure: exit 0
|
Added work/contrib/lzo/lzo-1.08/config.status.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
|
#! /bin/sh
# Generated by configure.
# Run this file to recreate the current configuration.
# Compiler output produced by configure, useful for debugging
# configure, is in config.log if it exists.
debug=false
SHELL=${CONFIG_SHELL-/bin/sh}
## --------------------- ##
## M4sh Initialization. ##
## --------------------- ##
# Be Bourne compatible
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
set -o posix
fi
# NLS nuisances.
# Support unset when possible.
if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
as_unset=unset
else
as_unset=false
fi
(set +x; test -n "`(LANG=C; export LANG) 2>&1`") &&
{ $as_unset LANG || test "${LANG+set}" != set; } ||
{ LANG=C; export LANG; }
(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") &&
{ $as_unset LC_ALL || test "${LC_ALL+set}" != set; } ||
{ LC_ALL=C; export LC_ALL; }
(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") &&
{ $as_unset LC_TIME || test "${LC_TIME+set}" != set; } ||
{ LC_TIME=C; export LC_TIME; }
(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") &&
{ $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } ||
{ LC_CTYPE=C; export LC_CTYPE; }
(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") &&
{ $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } ||
{ LANGUAGE=C; export LANGUAGE; }
(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") &&
{ $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } ||
{ LC_COLLATE=C; export LC_COLLATE; }
(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") &&
{ $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } ||
{ LC_NUMERIC=C; export LC_NUMERIC; }
(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") &&
{ $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } ||
{ LC_MESSAGES=C; export LC_MESSAGES; }
# Name of the executable.
as_me=`(basename "$0") 2>/dev/null ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)$' \| \
. : '\(.\)' 2>/dev/null ||
echo X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
/^X\/\(\/\/\)$/{ s//\1/; q; }
/^X\/\(\/\).*/{ s//\1/; q; }
s/.*/./; q'`
# PATH needs CR, and LINENO needs CR and PATH.
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits
# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
echo "#! /bin/sh" >conftest.sh
echo "exit 0" >>conftest.sh
chmod +x conftest.sh
if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then
PATH_SEPARATOR=';'
else
PATH_SEPARATOR=:
fi
rm -f conftest.sh
fi
as_lineno_1=$LINENO
as_lineno_2=$LINENO
as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
test "x$as_lineno_1" != "x$as_lineno_2" &&
test "x$as_lineno_3" = "x$as_lineno_2" || {
# Find who we are. Look in the path if we contain no path at all
# relative or not.
case $0 in
*[\\/]* ) as_myself=$0 ;;
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
done
;;
esac
# We did not find ourselves, most probably we were run as `sh COMMAND'
# in which case we are not to be found in the path.
if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
{ { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
{ (exit 1); exit 1; }; }
fi
case $CONFIG_SHELL in
'')
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for as_base in sh bash ksh sh5; do
case $as_dir in
/*)
if ("$as_dir/$as_base" -c '
as_lineno_1=$LINENO
as_lineno_2=$LINENO
as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
test "x$as_lineno_1" != "x$as_lineno_2" &&
test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
CONFIG_SHELL=$as_dir/$as_base
export CONFIG_SHELL
exec "$CONFIG_SHELL" "$0" ${1+"$@"}
fi;;
esac
done
done
;;
esac
# Create $as_me.lineno as a copy of $as_myself, but with $LINENO
# uniformly replaced by the line number. The first 'sed' inserts a
# line-number line before each line; the second 'sed' does the real
# work. The second script uses 'N' to pair each line-number line
# with the numbered line, and appends trailing '-' during
# substitution so that $LINENO is not a special case at line end.
# (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
# second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
sed '=' <$as_myself |
sed '
N
s,$,-,
: loop
s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
t loop
s,-$,,
s,^['$as_cr_digits']*\n,,
' >$as_me.lineno &&
chmod +x $as_me.lineno ||
{ { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
{ (exit 1); exit 1; }; }
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
# original and so on. Autoconf is especially sensible to this).
. ./$as_me.lineno
# Exit status is that of the last command.
exit
}
case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
*c*,-n*) ECHO_N= ECHO_C='
' ECHO_T=' ' ;;
*c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
*) ECHO_N= ECHO_C='\c' ECHO_T= ;;
esac
if expr a : '\(a\)' >/dev/null 2>&1; then
as_expr=expr
else
as_expr=false
fi
rm -f conf$$ conf$$.exe conf$$.file
echo >conf$$.file
if ln -s conf$$.file conf$$ 2>/dev/null; then
# We could just check for DJGPP; but this test a) works b) is more generic
# and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
if test -f conf$$.exe; then
# Don't use ln at all; we don't have any links
as_ln_s='cp -p'
else
as_ln_s='ln -s'
fi
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
as_ln_s='cp -p'
fi
rm -f conf$$ conf$$.exe conf$$.file
as_executable_p="test -f"
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
# Sed expression to map a string onto a valid variable name.
as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
# IFS
# We need space, tab and new line, in precisely that order.
as_nl='
'
IFS=" $as_nl"
# CDPATH.
$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; }
exec 6>&1
# Open the log real soon, to keep \$[0] and so on meaningful, and to
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling. Logging --version etc. is OK.
exec 5>>config.log
{
echo
sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## Running $as_me. ##
_ASBOX
} >&5
cat >&5 <<_CSEOF
This file was extended by lzo $as_me 1.08, which was
generated by GNU Autoconf 2.53. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
CONFIG_LINKS = $CONFIG_LINKS
CONFIG_COMMANDS = $CONFIG_COMMANDS
$ $0 $@
_CSEOF
echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
echo >&5
config_files=" Makefile examples/Makefile include/Makefile ltest/Makefile minilzo/Makefile src/Makefile tests/Makefile"
config_headers=" config.h:config.hin"
config_commands=" depfiles"
ac_cs_usage="\
\`$as_me' instantiates files from templates according to the
current configuration.
Usage: $0 [OPTIONS] [FILE]...
-h, --help print this help, then exit
-V, --version print version number, then exit
-d, --debug don't remove temporary files
--recheck update $as_me by reconfiguring in the same conditions
--file=FILE[:TEMPLATE]
instantiate the configuration file FILE
--header=FILE[:TEMPLATE]
instantiate the configuration header FILE
Configuration files:
$config_files
Configuration headers:
$config_headers
Configuration commands:
$config_commands
Report bugs to <bug-autoconf@gnu.org>."
ac_cs_version="\
lzo config.status 1.08
configured by ./configure, generated by GNU Autoconf 2.53,
with options \"'--enable-shared'\"
Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
srcdir=.
INSTALL="/usr/bin/ginstall -c"
# If no file are specified by the user, then we need to provide default
# value. By we need to know if files were specified by the user.
ac_need_defaults=:
while test $# != 0
do
case $1 in
--*=*)
ac_option=`expr "x$1" : 'x\([^=]*\)='`
ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
shift
set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
shift
;;
-*);;
*) # This is not an option, so the user has probably given explicit
# arguments.
ac_need_defaults=false;;
esac
case $1 in
# Handling of the options.
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
echo "running /bin/sh ./configure " '--enable-shared' " --no-create --no-recursion"
exec /bin/sh ./configure '--enable-shared' --no-create --no-recursion ;;
--version | --vers* | -V )
echo "$ac_cs_version"; exit 0 ;;
--he | --h)
# Conflict between --help and --header
{ { echo "$as_me:$LINENO: error: ambiguous option: $1
Try \`$0 --help' for more information." >&5
echo "$as_me: error: ambiguous option: $1
Try \`$0 --help' for more information." >&2;}
{ (exit 1); exit 1; }; };;
--help | --hel | -h )
echo "$ac_cs_usage"; exit 0 ;;
--debug | --d* | -d )
debug=: ;;
--file | --fil | --fi | --f )
shift
CONFIG_FILES="$CONFIG_FILES $1"
ac_need_defaults=false;;
--header | --heade | --head | --hea )
shift
CONFIG_HEADERS="$CONFIG_HEADERS $1"
ac_need_defaults=false;;
# This is an error.
-*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
Try \`$0 --help' for more information." >&5
echo "$as_me: error: unrecognized option: $1
Try \`$0 --help' for more information." >&2;}
{ (exit 1); exit 1; }; } ;;
*) ac_config_targets="$ac_config_targets $1" ;;
esac
shift
done
#
# INIT-COMMANDS section.
#
AMDEP_TRUE="" ac_aux_dir="acconfig"
for ac_config_target in $ac_config_targets
do
case "$ac_config_target" in
# Handling of arguments.
"Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"examples/Makefile" ) CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;;
"include/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
"ltest/Makefile" ) CONFIG_FILES="$CONFIG_FILES ltest/Makefile" ;;
"minilzo/Makefile" ) CONFIG_FILES="$CONFIG_FILES minilzo/Makefile" ;;
"src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
"tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
"depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
"config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.hin" ;;
*) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
{ (exit 1); exit 1; }; };;
esac
done
# If the user did not use the arguments to specify the items to instantiate,
# then the envvar interface is used. Set only those that are not.
# We use the long form for the default assignment because of an extremely
# bizarre bug on SunOS 4.1.3.
if $ac_need_defaults; then
test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
fi
# Create a temporary directory, and hook for its removal unless debugging.
$debug ||
{
trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
trap '{ (exit 1); exit 1; }' 1 2 13 15
}
# Create a (secure) tmp directory for tmp files.
: ${TMPDIR=/tmp}
{
tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
test -n "$tmp" && test -d "$tmp"
} ||
{
tmp=$TMPDIR/cs$$-$RANDOM
(umask 077 && mkdir $tmp)
} ||
{
echo "$me: cannot create a temporary directory in $TMPDIR" >&2
{ (exit 1); exit 1; }
}
#
# CONFIG_FILES section.
#
# No need to generate the scripts if there are no CONFIG_FILES.
# This happens for instance when ./config.status config.h
if test -n "$CONFIG_FILES"; then
# Protect against being on the right side of a sed subst in config.status.
sed 's/,@/@@/; s/@,/@@/; s/,;t t$/@;t t/; /@;t t$/s/[\\&,]/\\&/g;
s/@@/,@/; s/@@/@,/; s/@;t t$/,;t t/' >$tmp/subs.sed <<\CEOF
s,@SHELL@,/bin/sh,;t t
s,@PATH_SEPARATOR@,:,;t t
s,@PACKAGE_NAME@,lzo,;t t
s,@PACKAGE_TARNAME@,lzo,;t t
s,@PACKAGE_VERSION@,1.08,;t t
s,@PACKAGE_STRING@,lzo 1.08,;t t
s,@PACKAGE_BUGREPORT@,,;t t
s,@exec_prefix@,${prefix},;t t
s,@prefix@,/usr/local,;t t
s,@program_transform_name@,s,x,x,,;t t
s,@bindir@,${exec_prefix}/bin,;t t
s,@sbindir@,${exec_prefix}/sbin,;t t
s,@libexecdir@,${exec_prefix}/libexec,;t t
s,@datadir@,${prefix}/share,;t t
s,@sysconfdir@,${prefix}/etc,;t t
s,@sharedstatedir@,${prefix}/com,;t t
s,@localstatedir@,${prefix}/var,;t t
s,@libdir@,${exec_prefix}/lib,;t t
s,@includedir@,${prefix}/include,;t t
s,@oldincludedir@,/usr/include,;t t
s,@infodir@,${prefix}/info,;t t
s,@mandir@,${prefix}/man,;t t
s,@build_alias@,,;t t
s,@host_alias@,,;t t
s,@target_alias@,,;t t
s,@DEFS@,-DHAVE_CONFIG_H,;t t
s,@ECHO_C@,,;t t
s,@ECHO_N@,-n,;t t
s,@ECHO_T@,,;t t
s,@LIBS@,,;t t
s,@build@,i586-pc-linux-gnu,;t t
s,@build_cpu@,i586,;t t
s,@build_vendor@,pc,;t t
s,@build_os@,linux-gnu,;t t
s,@host@,i586-pc-linux-gnu,;t t
s,@host_cpu@,i586,;t t
s,@host_vendor@,pc,;t t
s,@host_os@,linux-gnu,;t t
s,@target@,i586-pc-linux-gnu,;t t
s,@target_cpu@,i586,;t t
s,@target_vendor@,pc,;t t
s,@target_os@,linux-gnu,;t t
s,@CFLAGS_O@,,;t t
s,@CFLAGS_W@,,;t t
s,@CFLAGS_W_PEDANTIC@,,;t t
s,@ASFLAGS@, -x assembler-with-cpp,;t t
s,@LZO_CFLAGS@,,;t t
s,@CC@,gcc,;t t
s,@CFLAGS@, -O2 -Wall -Wcast-align -Wcast-qual -Wwrite-strings -fno-strength-reduce -fstrict-aliasing,;t t
s,@LDFLAGS@,,;t t
s,@CPPFLAGS@, -DLZO_HAVE_CONFIG_H,;t t
s,@ac_ct_CC@,gcc,;t t
s,@EXEEXT@,,;t t
s,@OBJEXT@,o,;t t
s,@INSTALL_PROGRAM@,${INSTALL},;t t
s,@INSTALL_SCRIPT@,${INSTALL},;t t
s,@INSTALL_DATA@,${INSTALL} -m 644,;t t
s,@PACKAGE@,lzo,;t t
s,@VERSION@,1.08,;t t
s,@ACLOCAL@,${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run aclocal-1.6,;t t
s,@AUTOCONF@,${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run autoconf,;t t
s,@AUTOMAKE@,${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run automake-1.6,;t t
s,@AUTOHEADER@,${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run autoheader,;t t
s,@MAKEINFO@,${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run makeinfo,;t t
s,@AMTAR@,${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run tar,;t t
s,@install_sh@,/home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/install-sh,;t t
s,@STRIP@,strip,;t t
s,@ac_ct_STRIP@,strip,;t t
s,@INSTALL_STRIP_PROGRAM@,${SHELL} $(install_sh) -c -s,;t t
s,@AWK@,gawk,;t t
s,@SET_MAKE@,,;t t
s,@DEPDIR@,.deps,;t t
s,@am__include@,include,;t t
s,@am__quote@,,;t t
s,@AMDEP_TRUE@,,;t t
s,@AMDEP_FALSE@,#,;t t
s,@AMDEPBACKSLASH@,\,;t t
s,@CCDEPMODE@,depmode=gcc,;t t
s,@MAINTAINER_MODE_TRUE@,#,;t t
s,@MAINTAINER_MODE_FALSE@,,;t t
s,@MAINT@,#,;t t
s,@mfx_GMAKE@,yes,;t t
s,@GMAKE_TRUE@,,;t t
s,@GMAKE_FALSE@,#,;t t
s,@MOSTLYCLEANFILES@,*.i,;t t
s,@CLEANFILES@,*.bb *.bbg *.da *.gcov bb.out bbtrace* gmon.out,;t t
s,@CPP@,gcc -E,;t t
s,@LN_S@,ln -s,;t t
s,@ECHO@,echo,;t t
s,@RANLIB@,ranlib,;t t
s,@ac_ct_RANLIB@,ranlib,;t t
s,@LIBTOOL@,$(SHELL) $(top_builddir)/libtool,;t t
s,@liblzo@,$(top_builddir)/src/liblzo.la,;t t
s,@NASM@,,;t t
s,@ltest_LIBS@,,;t t
s,@CFLAGS_GCC_OMIT_FRAME_POINTER@,-fomit-frame-pointer,;t t
s,@MFX_CC@,GCC,;t t
s,@MFX_ARCH@,i386,;t t
s,@MFX_CPU@,i586,;t t
s,@SRC_VPATH@,/i386/src,;t t
s,@LZO_ASM_OBJECTS@,$(LZO_ASM_OBJECTS_GCC_i386),;t t
CEOF
# Split the substitutions into bite-sized pieces for seds with
# small command number limits, like on Digital OSF/1 and HP-UX.
ac_max_sed_lines=48
ac_sed_frag=1 # Number of current file.
ac_beg=1 # First line for current file.
ac_end=$ac_max_sed_lines # Line after last line for current file.
ac_more_lines=:
ac_sed_cmds=
while $ac_more_lines; do
if test $ac_beg -gt 1; then
sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
else
sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
fi
if test ! -s $tmp/subs.frag; then
ac_more_lines=false
else
# The purpose of the label and of the branching condition is to
# speed up the sed processing (if there are no `@' at all, there
# is no need to browse any of the substitutions).
# These are the two extra sed commands mentioned above.
(echo ':t
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
if test -z "$ac_sed_cmds"; then
ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
else
ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
fi
ac_sed_frag=`expr $ac_sed_frag + 1`
ac_beg=$ac_end
ac_end=`expr $ac_end + $ac_max_sed_lines`
fi
done
if test -z "$ac_sed_cmds"; then
ac_sed_cmds=cat
fi
fi # test -n "$CONFIG_FILES"
for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
case $ac_file in
- | *:- | *:-:* ) # input from stdin
cat >$tmp/stdin
ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
*:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
* ) ac_file_in=$ac_file.in ;;
esac
# Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
ac_dir=`(dirname "$ac_file") 2>/dev/null ||
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$ac_file" : 'X\(//\)[^/]' \| \
X"$ac_file" : 'X\(//\)$' \| \
X"$ac_file" : 'X\(/\)' \| \
. : '\(.\)' 2>/dev/null ||
echo X"$ac_file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
/^X\(\/\/\)[^/].*/{ s//\1/; q; }
/^X\(\/\/\)$/{ s//\1/; q; }
/^X\(\/\).*/{ s//\1/; q; }
s/.*/./; q'`
{ case "$ac_dir" in
[\\/]* | ?:[\\/]* ) as_incr_dir=;;
*) as_incr_dir=.;;
esac
as_dummy="$ac_dir"
for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
case $as_mkdir_dir in
# Skip DOS drivespec
?:) as_incr_dir=$as_mkdir_dir ;;
*)
as_incr_dir=$as_incr_dir/$as_mkdir_dir
test -d "$as_incr_dir" ||
mkdir "$as_incr_dir" ||
{ { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5
echo "$as_me: error: cannot create \"$ac_dir\"" >&2;}
{ (exit 1); exit 1; }; }
;;
esac
done; }
ac_builddir=.
if test "$ac_dir" != .; then
ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
# A "../" for each directory in $ac_dir_suffix.
ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
else
ac_dir_suffix= ac_top_builddir=
fi
case $srcdir in
.) # No --srcdir option. We are building in place.
ac_srcdir=.
if test -z "$ac_top_builddir"; then
ac_top_srcdir=.
else
ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
fi ;;
[\\/]* | ?:[\\/]* ) # Absolute path.
ac_srcdir=$srcdir$ac_dir_suffix;
ac_top_srcdir=$srcdir ;;
*) # Relative path.
ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
ac_top_srcdir=$ac_top_builddir$srcdir ;;
esac
# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
# absolute.
ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd`
ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
case $INSTALL in
[\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
*) ac_INSTALL=$ac_top_builddir$INSTALL ;;
esac
if test x"$ac_file" != x-; then
{ echo "$as_me:$LINENO: creating $ac_file" >&5
echo "$as_me: creating $ac_file" >&6;}
rm -f "$ac_file"
fi
# Let's still pretend it is `configure' which instantiates (i.e., don't
# use $as_me), people would be surprised to read:
# /* config.h. Generated by config.status. */
if test x"$ac_file" = x-; then
configure_input=
else
configure_input="$ac_file. "
fi
configure_input=$configure_input"Generated from `echo $ac_file_in |
sed 's,.*/,,'` by configure."
# First look for the input files in the build tree, otherwise in the
# src tree.
ac_file_inputs=`IFS=:
for f in $ac_file_in; do
case $f in
-) echo $tmp/stdin ;;
[\\/$]*)
# Absolute (can't be DOS-style, as IFS=:)
test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
echo $f;;
*) # Relative
if test -f "$f"; then
# Build tree
echo $f
elif test -f "$srcdir/$f"; then
# Source tree
echo $srcdir/$f
else
# /dev/null tree
{ { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
fi;;
esac
done` || { (exit 1); exit 1; }
sed "/^[ ]*VPATH[ ]*=/{
s/:*\$(srcdir):*/:/;
s/:*\${srcdir}:*/:/;
s/:*@srcdir@:*/:/;
s/^\([^=]*=[ ]*\):*/\1/;
s/:*$//;
s/^[^=]*=[ ]*$//;
}
:t
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
s,@configure_input@,$configure_input,;t t
s,@srcdir@,$ac_srcdir,;t t
s,@abs_srcdir@,$ac_abs_srcdir,;t t
s,@top_srcdir@,$ac_top_srcdir,;t t
s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
s,@builddir@,$ac_builddir,;t t
s,@abs_builddir@,$ac_abs_builddir,;t t
s,@top_builddir@,$ac_top_builddir,;t t
s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
s,@INSTALL@,$ac_INSTALL,;t t
" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
rm -f $tmp/stdin
if test x"$ac_file" != x-; then
mv $tmp/out $ac_file
else
cat $tmp/out
rm -f $tmp/out
fi
done
#
# CONFIG_HEADER section.
#
# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
# NAME is the cpp macro being defined and VALUE is the value it is being given.
#
# ac_d sets the value in "#define NAME VALUE" lines.
ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
ac_dB='[ ].*$,\1#\2'
ac_dC=' '
ac_dD=',;t'
# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
ac_uB='$,\1#\2define\3'
ac_uC=' '
ac_uD=',;t'
for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
case $ac_file in
- | *:- | *:-:* ) # input from stdin
cat >$tmp/stdin
ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
*:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
* ) ac_file_in=$ac_file.in ;;
esac
test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
echo "$as_me: creating $ac_file" >&6;}
# First look for the input files in the build tree, otherwise in the
# src tree.
ac_file_inputs=`IFS=:
for f in $ac_file_in; do
case $f in
-) echo $tmp/stdin ;;
[\\/$]*)
# Absolute (can't be DOS-style, as IFS=:)
test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
echo $f;;
*) # Relative
if test -f "$f"; then
# Build tree
echo $f
elif test -f "$srcdir/$f"; then
# Source tree
echo $srcdir/$f
else
# /dev/null tree
{ { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
fi;;
esac
done` || { (exit 1); exit 1; }
# Remove the trailing spaces.
sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
# Handle all the #define templates only if necessary.
if egrep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then
# If there are no defines, we may have an empty if/fi
:
cat >$tmp/defines.sed <<CEOF
/^[ ]*#[ ]*define/!b
t clr
: clr
${ac_dA}PACKAGE_NAME${ac_dB}PACKAGE_NAME${ac_dC}"lzo"${ac_dD}
${ac_dA}PACKAGE_TARNAME${ac_dB}PACKAGE_TARNAME${ac_dC}"lzo"${ac_dD}
${ac_dA}PACKAGE_VERSION${ac_dB}PACKAGE_VERSION${ac_dC}"1.08"${ac_dD}
${ac_dA}PACKAGE_STRING${ac_dB}PACKAGE_STRING${ac_dC}"lzo 1.08"${ac_dD}
${ac_dA}PACKAGE_BUGREPORT${ac_dB}PACKAGE_BUGREPORT${ac_dC}""${ac_dD}
${ac_dA}PACKAGE${ac_dB}PACKAGE${ac_dC}"lzo"${ac_dD}
${ac_dA}VERSION${ac_dB}VERSION${ac_dC}"1.08"${ac_dD}
${ac_dA}STDC_HEADERS${ac_dB}STDC_HEADERS${ac_dC}1${ac_dD}
${ac_dA}HAVE_SYS_TYPES_H${ac_dB}HAVE_SYS_TYPES_H${ac_dC}1${ac_dD}
${ac_dA}HAVE_SYS_STAT_H${ac_dB}HAVE_SYS_STAT_H${ac_dC}1${ac_dD}
${ac_dA}HAVE_STDLIB_H${ac_dB}HAVE_STDLIB_H${ac_dC}1${ac_dD}
${ac_dA}HAVE_STRING_H${ac_dB}HAVE_STRING_H${ac_dC}1${ac_dD}
${ac_dA}HAVE_MEMORY_H${ac_dB}HAVE_MEMORY_H${ac_dC}1${ac_dD}
${ac_dA}HAVE_STRINGS_H${ac_dB}HAVE_STRINGS_H${ac_dC}1${ac_dD}
${ac_dA}HAVE_INTTYPES_H${ac_dB}HAVE_INTTYPES_H${ac_dC}1${ac_dD}
${ac_dA}HAVE_STDINT_H${ac_dB}HAVE_STDINT_H${ac_dC}1${ac_dD}
${ac_dA}HAVE_UNISTD_H${ac_dB}HAVE_UNISTD_H${ac_dC}1${ac_dD}
${ac_dA}HAVE_DLFCN_H${ac_dB}HAVE_DLFCN_H${ac_dC}1${ac_dD}
${ac_dA}STDC_HEADERS${ac_dB}STDC_HEADERS${ac_dC}1${ac_dD}
${ac_dA}TIME_WITH_SYS_TIME${ac_dB}TIME_WITH_SYS_TIME${ac_dC}1${ac_dD}
${ac_dA}HAVE_ASSERT_H${ac_dB}HAVE_ASSERT_H${ac_dC}1${ac_dD}
${ac_dA}HAVE_CTYPE_H${ac_dB}HAVE_CTYPE_H${ac_dC}1${ac_dD}
${ac_dA}HAVE_LIMITS_H${ac_dB}HAVE_LIMITS_H${ac_dC}1${ac_dD}
${ac_dA}HAVE_SIGNAL_H${ac_dB}HAVE_SIGNAL_H${ac_dC}1${ac_dD}
${ac_dA}HAVE_STDDEF_H${ac_dB}HAVE_STDDEF_H${ac_dC}1${ac_dD}
${ac_dA}HAVE_TIME_H${ac_dB}HAVE_TIME_H${ac_dC}1${ac_dD}
${ac_dA}HAVE_UNISTD_H${ac_dB}HAVE_UNISTD_H${ac_dC}1${ac_dD}
${ac_dA}HAVE_SYS_PARAM_H${ac_dB}HAVE_SYS_PARAM_H${ac_dC}1${ac_dD}
${ac_dA}HAVE_SYS_RESOURCE_H${ac_dB}HAVE_SYS_RESOURCE_H${ac_dC}1${ac_dD}
${ac_dA}HAVE_SYS_TIME_H${ac_dB}HAVE_SYS_TIME_H${ac_dC}1${ac_dD}
${ac_dA}HAVE_SYS_TIMES_H${ac_dB}HAVE_SYS_TIMES_H${ac_dC}1${ac_dD}
${ac_dA}HAVE_ENDIAN_H${ac_dB}HAVE_ENDIAN_H${ac_dC}1${ac_dD}
${ac_dA}HAVE_ZLIB_H${ac_dB}HAVE_ZLIB_H${ac_dC}1${ac_dD}
${ac_dA}SIZEOF_UNSIGNED_SHORT${ac_dB}SIZEOF_UNSIGNED_SHORT${ac_dC}2${ac_dD}
${ac_dA}SIZEOF_UNSIGNED${ac_dB}SIZEOF_UNSIGNED${ac_dC}4${ac_dD}
${ac_dA}SIZEOF_UNSIGNED_LONG${ac_dB}SIZEOF_UNSIGNED_LONG${ac_dC}4${ac_dD}
${ac_dA}SIZEOF_CHAR_P${ac_dB}SIZEOF_CHAR_P${ac_dC}4${ac_dD}
${ac_dA}SIZEOF_PTRDIFF_T${ac_dB}SIZEOF_PTRDIFF_T${ac_dC}4${ac_dD}
CEOF
sed -f $tmp/defines.sed $tmp/in >$tmp/out
rm -f $tmp/in
mv $tmp/out $tmp/in
cat >$tmp/defines.sed <<CEOF
/^[ ]*#[ ]*define/!b
t clr
: clr
${ac_dA}SIZEOF_SIZE_T${ac_dB}SIZEOF_SIZE_T${ac_dC}4${ac_dD}
${ac_dA}MFX_BYTE_ORDER${ac_dB}MFX_BYTE_ORDER${ac_dC}1234${ac_dD}
${ac_dA}HAVE_MEMCMP${ac_dB}HAVE_MEMCMP${ac_dC}1${ac_dD}
${ac_dA}HAVE_MEMCPY${ac_dB}HAVE_MEMCPY${ac_dC}1${ac_dD}
${ac_dA}HAVE_MEMMOVE${ac_dB}HAVE_MEMMOVE${ac_dC}1${ac_dD}
${ac_dA}HAVE_MEMSET${ac_dB}HAVE_MEMSET${ac_dC}1${ac_dD}
${ac_dA}HAVE_STRCASECMP${ac_dB}HAVE_STRCASECMP${ac_dC}1${ac_dD}
${ac_dA}HAVE_STRNCASECMP${ac_dB}HAVE_STRNCASECMP${ac_dC}1${ac_dD}
${ac_dA}HAVE_ATOL${ac_dB}HAVE_ATOL${ac_dC}1${ac_dD}
${ac_dA}HAVE_FSTAT${ac_dB}HAVE_FSTAT${ac_dC}1${ac_dD}
${ac_dA}HAVE_GETRUSAGE${ac_dB}HAVE_GETRUSAGE${ac_dC}1${ac_dD}
${ac_dA}HAVE_GETTIMEOFDAY${ac_dB}HAVE_GETTIMEOFDAY${ac_dC}1${ac_dD}
${ac_dA}HAVE_LSTAT${ac_dB}HAVE_LSTAT${ac_dC}1${ac_dD}
${ac_dA}HAVE_STAT${ac_dB}HAVE_STAT${ac_dC}1${ac_dD}
${ac_dA}HAVE_TIMES${ac_dB}HAVE_TIMES${ac_dC}1${ac_dD}
${ac_dA}MFX_ARCH${ac_dB}MFX_ARCH${ac_dC}"i386"${ac_dD}
${ac_dA}MFX_CPU${ac_dB}MFX_CPU${ac_dC}"i586"${ac_dD}
${ac_dA}LZO_UNALIGNED_OK_2${ac_dB}LZO_UNALIGNED_OK_2${ac_dC}1${ac_dD}
${ac_dA}LZO_UNALIGNED_OK_4${ac_dB}LZO_UNALIGNED_OK_4${ac_dC}1${ac_dD}
${ac_dA}MFX_ASM_ALIGN_BYTES${ac_dB}MFX_ASM_ALIGN_BYTES${ac_dC}1${ac_dD}
${ac_dA}MFX_ASM_NAME_NO_UNDERSCORES${ac_dB}MFX_ASM_NAME_NO_UNDERSCORES${ac_dC}1${ac_dD}
${ac_dA}MFX_ASM_HAVE_TYPE${ac_dB}MFX_ASM_HAVE_TYPE${ac_dC}1${ac_dD}
CEOF
sed -f $tmp/defines.sed $tmp/in >$tmp/out
rm -f $tmp/in
mv $tmp/out $tmp/in
fi # egrep
# Handle all the #undef templates
cat >$tmp/undefs.sed <<CEOF
/^[ ]*#[ ]*undef/!b
t clr
: clr
${ac_uA}PACKAGE_NAME${ac_uB}PACKAGE_NAME${ac_uC}"lzo"${ac_uD}
${ac_uA}PACKAGE_TARNAME${ac_uB}PACKAGE_TARNAME${ac_uC}"lzo"${ac_uD}
${ac_uA}PACKAGE_VERSION${ac_uB}PACKAGE_VERSION${ac_uC}"1.08"${ac_uD}
${ac_uA}PACKAGE_STRING${ac_uB}PACKAGE_STRING${ac_uC}"lzo 1.08"${ac_uD}
${ac_uA}PACKAGE_BUGREPORT${ac_uB}PACKAGE_BUGREPORT${ac_uC}""${ac_uD}
${ac_uA}PACKAGE${ac_uB}PACKAGE${ac_uC}"lzo"${ac_uD}
${ac_uA}VERSION${ac_uB}VERSION${ac_uC}"1.08"${ac_uD}
${ac_uA}STDC_HEADERS${ac_uB}STDC_HEADERS${ac_uC}1${ac_uD}
${ac_uA}HAVE_SYS_TYPES_H${ac_uB}HAVE_SYS_TYPES_H${ac_uC}1${ac_uD}
${ac_uA}HAVE_SYS_STAT_H${ac_uB}HAVE_SYS_STAT_H${ac_uC}1${ac_uD}
${ac_uA}HAVE_STDLIB_H${ac_uB}HAVE_STDLIB_H${ac_uC}1${ac_uD}
${ac_uA}HAVE_STRING_H${ac_uB}HAVE_STRING_H${ac_uC}1${ac_uD}
${ac_uA}HAVE_MEMORY_H${ac_uB}HAVE_MEMORY_H${ac_uC}1${ac_uD}
${ac_uA}HAVE_STRINGS_H${ac_uB}HAVE_STRINGS_H${ac_uC}1${ac_uD}
${ac_uA}HAVE_INTTYPES_H${ac_uB}HAVE_INTTYPES_H${ac_uC}1${ac_uD}
${ac_uA}HAVE_STDINT_H${ac_uB}HAVE_STDINT_H${ac_uC}1${ac_uD}
${ac_uA}HAVE_UNISTD_H${ac_uB}HAVE_UNISTD_H${ac_uC}1${ac_uD}
${ac_uA}HAVE_DLFCN_H${ac_uB}HAVE_DLFCN_H${ac_uC}1${ac_uD}
${ac_uA}STDC_HEADERS${ac_uB}STDC_HEADERS${ac_uC}1${ac_uD}
${ac_uA}TIME_WITH_SYS_TIME${ac_uB}TIME_WITH_SYS_TIME${ac_uC}1${ac_uD}
${ac_uA}HAVE_ASSERT_H${ac_uB}HAVE_ASSERT_H${ac_uC}1${ac_uD}
${ac_uA}HAVE_CTYPE_H${ac_uB}HAVE_CTYPE_H${ac_uC}1${ac_uD}
${ac_uA}HAVE_LIMITS_H${ac_uB}HAVE_LIMITS_H${ac_uC}1${ac_uD}
${ac_uA}HAVE_SIGNAL_H${ac_uB}HAVE_SIGNAL_H${ac_uC}1${ac_uD}
${ac_uA}HAVE_STDDEF_H${ac_uB}HAVE_STDDEF_H${ac_uC}1${ac_uD}
${ac_uA}HAVE_TIME_H${ac_uB}HAVE_TIME_H${ac_uC}1${ac_uD}
${ac_uA}HAVE_UNISTD_H${ac_uB}HAVE_UNISTD_H${ac_uC}1${ac_uD}
${ac_uA}HAVE_SYS_PARAM_H${ac_uB}HAVE_SYS_PARAM_H${ac_uC}1${ac_uD}
${ac_uA}HAVE_SYS_RESOURCE_H${ac_uB}HAVE_SYS_RESOURCE_H${ac_uC}1${ac_uD}
${ac_uA}HAVE_SYS_TIME_H${ac_uB}HAVE_SYS_TIME_H${ac_uC}1${ac_uD}
${ac_uA}HAVE_SYS_TIMES_H${ac_uB}HAVE_SYS_TIMES_H${ac_uC}1${ac_uD}
${ac_uA}HAVE_ENDIAN_H${ac_uB}HAVE_ENDIAN_H${ac_uC}1${ac_uD}
${ac_uA}HAVE_ZLIB_H${ac_uB}HAVE_ZLIB_H${ac_uC}1${ac_uD}
${ac_uA}SIZEOF_UNSIGNED_SHORT${ac_uB}SIZEOF_UNSIGNED_SHORT${ac_uC}2${ac_uD}
${ac_uA}SIZEOF_UNSIGNED${ac_uB}SIZEOF_UNSIGNED${ac_uC}4${ac_uD}
${ac_uA}SIZEOF_UNSIGNED_LONG${ac_uB}SIZEOF_UNSIGNED_LONG${ac_uC}4${ac_uD}
${ac_uA}SIZEOF_CHAR_P${ac_uB}SIZEOF_CHAR_P${ac_uC}4${ac_uD}
${ac_uA}SIZEOF_PTRDIFF_T${ac_uB}SIZEOF_PTRDIFF_T${ac_uC}4${ac_uD}
CEOF
sed -f $tmp/undefs.sed $tmp/in >$tmp/out
rm -f $tmp/in
mv $tmp/out $tmp/in
cat >$tmp/undefs.sed <<CEOF
/^[ ]*#[ ]*undef/!b
t clr
: clr
${ac_uA}SIZEOF_SIZE_T${ac_uB}SIZEOF_SIZE_T${ac_uC}4${ac_uD}
${ac_uA}MFX_BYTE_ORDER${ac_uB}MFX_BYTE_ORDER${ac_uC}1234${ac_uD}
${ac_uA}HAVE_MEMCMP${ac_uB}HAVE_MEMCMP${ac_uC}1${ac_uD}
${ac_uA}HAVE_MEMCPY${ac_uB}HAVE_MEMCPY${ac_uC}1${ac_uD}
${ac_uA}HAVE_MEMMOVE${ac_uB}HAVE_MEMMOVE${ac_uC}1${ac_uD}
${ac_uA}HAVE_MEMSET${ac_uB}HAVE_MEMSET${ac_uC}1${ac_uD}
${ac_uA}HAVE_STRCASECMP${ac_uB}HAVE_STRCASECMP${ac_uC}1${ac_uD}
${ac_uA}HAVE_STRNCASECMP${ac_uB}HAVE_STRNCASECMP${ac_uC}1${ac_uD}
${ac_uA}HAVE_ATOL${ac_uB}HAVE_ATOL${ac_uC}1${ac_uD}
${ac_uA}HAVE_FSTAT${ac_uB}HAVE_FSTAT${ac_uC}1${ac_uD}
${ac_uA}HAVE_GETRUSAGE${ac_uB}HAVE_GETRUSAGE${ac_uC}1${ac_uD}
${ac_uA}HAVE_GETTIMEOFDAY${ac_uB}HAVE_GETTIMEOFDAY${ac_uC}1${ac_uD}
${ac_uA}HAVE_LSTAT${ac_uB}HAVE_LSTAT${ac_uC}1${ac_uD}
${ac_uA}HAVE_STAT${ac_uB}HAVE_STAT${ac_uC}1${ac_uD}
${ac_uA}HAVE_TIMES${ac_uB}HAVE_TIMES${ac_uC}1${ac_uD}
${ac_uA}MFX_ARCH${ac_uB}MFX_ARCH${ac_uC}"i386"${ac_uD}
${ac_uA}MFX_CPU${ac_uB}MFX_CPU${ac_uC}"i586"${ac_uD}
${ac_uA}LZO_UNALIGNED_OK_2${ac_uB}LZO_UNALIGNED_OK_2${ac_uC}1${ac_uD}
${ac_uA}LZO_UNALIGNED_OK_4${ac_uB}LZO_UNALIGNED_OK_4${ac_uC}1${ac_uD}
${ac_uA}MFX_ASM_ALIGN_BYTES${ac_uB}MFX_ASM_ALIGN_BYTES${ac_uC}1${ac_uD}
${ac_uA}MFX_ASM_NAME_NO_UNDERSCORES${ac_uB}MFX_ASM_NAME_NO_UNDERSCORES${ac_uC}1${ac_uD}
${ac_uA}MFX_ASM_HAVE_TYPE${ac_uB}MFX_ASM_HAVE_TYPE${ac_uC}1${ac_uD}
s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
CEOF
sed -f $tmp/undefs.sed $tmp/in >$tmp/out
rm -f $tmp/in
mv $tmp/out $tmp/in
# Let's still pretend it is `configure' which instantiates (i.e., don't
# use $as_me), people would be surprised to read:
# /* config.h. Generated by config.status. */
if test x"$ac_file" = x-; then
echo "/* Generated by configure. */" >$tmp/config.h
else
echo "/* $ac_file. Generated by configure. */" >$tmp/config.h
fi
cat $tmp/in >>$tmp/config.h
rm -f $tmp/in
if test x"$ac_file" != x-; then
if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
{ echo "$as_me:$LINENO: $ac_file is unchanged" >&5
echo "$as_me: $ac_file is unchanged" >&6;}
else
ac_dir=`(dirname "$ac_file") 2>/dev/null ||
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$ac_file" : 'X\(//\)[^/]' \| \
X"$ac_file" : 'X\(//\)$' \| \
X"$ac_file" : 'X\(/\)' \| \
. : '\(.\)' 2>/dev/null ||
echo X"$ac_file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
/^X\(\/\/\)[^/].*/{ s//\1/; q; }
/^X\(\/\/\)$/{ s//\1/; q; }
/^X\(\/\).*/{ s//\1/; q; }
s/.*/./; q'`
{ case "$ac_dir" in
[\\/]* | ?:[\\/]* ) as_incr_dir=;;
*) as_incr_dir=.;;
esac
as_dummy="$ac_dir"
for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
case $as_mkdir_dir in
# Skip DOS drivespec
?:) as_incr_dir=$as_mkdir_dir ;;
*)
as_incr_dir=$as_incr_dir/$as_mkdir_dir
test -d "$as_incr_dir" ||
mkdir "$as_incr_dir" ||
{ { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5
echo "$as_me: error: cannot create \"$ac_dir\"" >&2;}
{ (exit 1); exit 1; }; }
;;
esac
done; }
rm -f $ac_file
mv $tmp/config.h $ac_file
fi
else
cat $tmp/config.h
rm -f $tmp/config.h
fi
# Run the commands associated with the file.
case $ac_file in
config.h ) # update the timestamp
echo 'timestamp for config.h:config.hin' >"./stamp-h1"
;;
esac
done
#
# CONFIG_COMMANDS section.
#
for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$ac_dest" : 'X\(//\)[^/]' \| \
X"$ac_dest" : 'X\(//\)$' \| \
X"$ac_dest" : 'X\(/\)' \| \
. : '\(.\)' 2>/dev/null ||
echo X"$ac_dest" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
/^X\(\/\/\)[^/].*/{ s//\1/; q; }
/^X\(\/\/\)$/{ s//\1/; q; }
/^X\(\/\).*/{ s//\1/; q; }
s/.*/./; q'`
ac_builddir=.
if test "$ac_dir" != .; then
ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
# A "../" for each directory in $ac_dir_suffix.
ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
else
ac_dir_suffix= ac_top_builddir=
fi
case $srcdir in
.) # No --srcdir option. We are building in place.
ac_srcdir=.
if test -z "$ac_top_builddir"; then
ac_top_srcdir=.
else
ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
fi ;;
[\\/]* | ?:[\\/]* ) # Absolute path.
ac_srcdir=$srcdir$ac_dir_suffix;
ac_top_srcdir=$srcdir ;;
*) # Relative path.
ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
ac_top_srcdir=$ac_top_builddir$srcdir ;;
esac
# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
# absolute.
ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd`
ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
{ echo "$as_me:$LINENO: executing $ac_dest commands" >&5
echo "$as_me: executing $ac_dest commands" >&6;}
case $ac_dest in
depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
# We used to match only the files named `Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
# So let's grep whole file.
if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
dirpart=`(dirname "$mf") 2>/dev/null ||
$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$mf" : 'X\(//\)[^/]' \| \
X"$mf" : 'X\(//\)$' \| \
X"$mf" : 'X\(/\)' \| \
. : '\(.\)' 2>/dev/null ||
echo X"$mf" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
/^X\(\/\/\)[^/].*/{ s//\1/; q; }
/^X\(\/\/\)$/{ s//\1/; q; }
/^X\(\/\).*/{ s//\1/; q; }
s/.*/./; q'`
else
continue
fi
grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
# Extract the definition of DEP_FILES from the Makefile without
# running `make'.
DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
test -z "$DEPDIR" && continue
# When using ansi2knr, U may be empty or an underscore; expand it
U=`sed -n -e '/^U = / s///p' < "$mf"`
test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
# We invoke sed twice because it is the simplest approach to
# changing $(DEPDIR) to its actual value in the expansion.
for file in `sed -n -e '
/^DEP_FILES = .*\\\\$/ {
s/^DEP_FILES = //
:loop
s/\\\\$//
p
n
/\\\\$/ b loop
p
}
/^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`(dirname "$file") 2>/dev/null ||
$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$file" : 'X\(//\)[^/]' \| \
X"$file" : 'X\(//\)$' \| \
X"$file" : 'X\(/\)' \| \
. : '\(.\)' 2>/dev/null ||
echo X"$file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
/^X\(\/\/\)[^/].*/{ s//\1/; q; }
/^X\(\/\/\)$/{ s//\1/; q; }
/^X\(\/\).*/{ s//\1/; q; }
s/.*/./; q'`
{ case $dirpart/$fdir in
[\\/]* | ?:[\\/]* ) as_incr_dir=;;
*) as_incr_dir=.;;
esac
as_dummy=$dirpart/$fdir
for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
case $as_mkdir_dir in
# Skip DOS drivespec
?:) as_incr_dir=$as_mkdir_dir ;;
*)
as_incr_dir=$as_incr_dir/$as_mkdir_dir
test -d "$as_incr_dir" ||
mkdir "$as_incr_dir" ||
{ { echo "$as_me:$LINENO: error: cannot create $dirpart/$fdir" >&5
echo "$as_me: error: cannot create $dirpart/$fdir" >&2;}
{ (exit 1); exit 1; }; }
;;
esac
done; }
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
done
done
;;
esac
done
{ (exit 0); exit 0; }
|
Added work/contrib/lzo/lzo-1.08/configure.
more than 10,000 changes
Added work/contrib/lzo/lzo-1.08/configure.in.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
|
dnl Process this file with autoconf to produce a configure script.
#
# configure.in -- autoconf configuration for the LZO library
#
# This file is part of the LZO real-time data compression library.
#
# Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
# Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
# Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
# Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
# Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
# Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
# Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
#
# The LZO library is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
#
# The LZO library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with the LZO library; see the file COPYING.
# If not, write to the Free Software Foundation, Inc.,
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# Markus F.X.J. Oberhumer
# <markus@oberhumer.com>
#
# /***********************************************************************
# // Init autoconf
# ************************************************************************/
AC_PREREQ(2.53)
AC_INIT(lzo,1.08)
AC_CONFIG_SRCDIR(src/lzo_init.c)
AC_CONFIG_AUX_DIR(acconfig)
AC_PREFIX_DEFAULT(/usr/local)
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
# /***********************************************************************
# // Prepare local settings
# ************************************************************************/
CPPFLAGS="$CPPFLAGS"
CFLAGS="$CFLAGS"
CXXFLAGS="$CXXFLAGS"
CFLAGS_O=""
CFLAGS_W=""
CFLAGS_W_PEDANTIC=""
AC_SUBST(CFLAGS_O)
AC_SUBST(CFLAGS_W)
AC_SUBST(CFLAGS_W_PEDANTIC)
AC_SUBST(ASFLAGS)
AC_SUBST(LZO_CFLAGS)
mfx_settings="./Conf.settings"
if test -r "$mfx_settings"; then
echo "loading settings $mfx_settings"
mfx_settings_stage=1
. $mfx_settings
fi
# /***********************************************************************
# // Init automake
# ************************************************************************/
AC_PROG_CC
mfx_CHECK_CROSS
mfx_PROG_CC_ANSI
AM_INIT_AUTOMAKE(lzo,1.08)
AM_CONFIG_HEADER(config.h:config.hin)
AM_MAINTAINER_MODE
mfx_PROG_MAKE_GNU(mfx_GMAKE)
AM_CONDITIONAL(GMAKE, test x$mfx_GMAKE = xyes)
MOSTLYCLEANFILES='*.i'
CLEANFILES='*.bb *.bbg *.da *.gcov bb.out bbtrace* gmon.out'
AC_SUBST(MOSTLYCLEANFILES)
AC_SUBST(CLEANFILES)
mfx_enable_static="$enable_static"
mfx_enable_shared="$enable_shared"
AC_ENABLE_STATIC
AC_DISABLE_SHARED
AM_WITH_DMALLOC
dnl Allow the --disable-asm flag to stop us from building assembler functions.
AC_ARG_ENABLE(asm,
[ --enable-asm try to build assembler versions [default=yes]],
[test "$enableval" = no && enable_asm=no])
test "$enable_asm" = no || enable_asm=yes
AC_ARG_ENABLE(debug,
[ --enable-debug build a debug version [default=no]],
[test "$enableval" = yes && enable_debug=yes])
test "$enable_debug" = yes || enable_debug=no
AC_ARG_ENABLE(profiling,
[ --enable-profiling build a profiling version [default=no]],
[test "$enableval" = yes && enable_profiling=yes])
test "$enable_profiling" = yes || enable_profiling=no
AC_ARG_ENABLE(coverage,
[ --enable-coverage build a coverage version [default=no]],
[test "$enableval" = yes && enable_coverage=yes])
test "$enable_coverage" = yes || enable_coverage=no
# /***********************************************************************
# // Checks for compiler
# ************************************************************************/
AC_EXEEXT
AC_PROG_CPP
AC_PROG_CC_C_O
mfx_PROG_CC_INTEGRAL_PROMOTION
mfx_PROG_CC_CHECKERGCC
dnl gcc -pipe makes troubles on some architectures (e.g. cygwin32)
if test "$USE_MAINTAINER_MODE" = yes; then
mfx_PROG_GCC_PIPE
fi
if test "$enable_debug" = yes; then
CPPFLAGS="$CPPFLAGS -DLZO_DEBUG"
fi
AC_MSG_CHECKING([whether to build a debug version])
AC_MSG_RESULT($enable_debug)
if test "$GCC" = yes; then
if test "$enable_profiling" = yes; then
dnl x="-pg -ax"
x="-pg"
LZO_CFLAGS="$LZO_CFLAGS $x"
LDFLAGS="$LDFLAGS $x"
fi
else
enable_profiling=no
fi
AC_MSG_CHECKING([whether to build a profiling version])
AC_MSG_RESULT($enable_profiling)
if test "$GCC" = yes; then
if test "$enable_coverage" = yes; then
x="-fprofile-arcs -ftest-coverage"
LZO_CFLAGS="$LZO_CFLAGS -DLZO_COVERAGE $x -O0"
fi
else
enable_coverage=no
fi
AC_MSG_CHECKING([whether to build a coverage version])
AC_MSG_RESULT($enable_coverage)
# /***********************************************************************
# // Initialize libtool
# ************************************************************************/
dnl maintainer defaults to --disable-shared
if test "$USE_MAINTAINER_MODE" = yes; then
test -z "$mfx_enable_shared" && enable_shared=no
fi
AC_PROG_LIBTOOL
if test "$USE_MAINTAINER_MODE" = yes; then
dnl configure libtool: use /bin/ash (it's quite a bit faster), be silent
if test -x /bin/ash; then
LIBTOOL='/bin/ash $(top_builddir)/libtool'
fi
LIBTOOL="$LIBTOOL --silent"
fi
liblzo='$(top_builddir)/src/liblzo.la'
AC_SUBST(liblzo)
# /***********************************************************************
# // Checks for other programs
# ************************************************************************/
AC_CHECK_PROG(NASM,nasm,nasm)
# /***********************************************************************
# // Checks for libraries
# ************************************************************************/
if test "$USE_MAINTAINER_MODE" = yes; then
if test "$mfx_cv_prog_checkergcc" = no; then
mfx_save_LIBS="$LIBS"
AC_CHECK_LIB(z,gzputs)
ltest_LIBS="$LIBS"
LIBS="$mfx_save_LIBS"
AC_SUBST(ltest_LIBS)
fi
fi
# /***********************************************************************
# // Checks for system and library header files
# ************************************************************************/
AC_HEADER_STDC
AC_HEADER_TIME
AC_CHECK_HEADERS(assert.h ctype.h limits.h signal.h stddef.h time.h unistd.h)
AC_CHECK_HEADERS(sys/param.h sys/resource.h sys/time.h sys/times.h)
AC_CHECK_HEADERS(endian.h sys/endian.h unchecked.h)
AC_CHECK_HEADERS(zlib.h)
if test "$ac_cv_header_limits_h" = no; then
AC_MSG_ERROR([<limits.h> header not found found])
fi
mfx_CHECK_HEADER_SANE_LIMITS_H
if test "$mfx_cv_header_sane_limits_h" = no; then
AC_MSG_ERROR([your limits.h header is broken - for details see config.log])
fi
# /***********************************************************************
# // Checks for typedefs and structures
# ************************************************************************/
AC_CHECK_TYPE(ptrdiff_t,long)
AC_TYPE_SIZE_T
AC_CHECK_SIZEOF(unsigned short)
AC_CHECK_SIZEOF(unsigned)
AC_CHECK_SIZEOF(unsigned long)
AC_CHECK_SIZEOF(char *)
AC_CHECK_SIZEOF(ptrdiff_t)
AC_CHECK_SIZEOF(size_t)
# /***********************************************************************
# // Checks for compiler characteristics
# ************************************************************************/
AC_C_CONST
dnl not available when cross-compiling
mfx_C_BYTE_ORDER
# /***********************************************************************
# // Checks for library functions
# ************************************************************************/
AC_CHECK_FUNCS(memcmp memcpy memmove memset)
AC_CHECK_FUNCS(memicmp strcasecmp strncasecmp stricmp strnicmp)
AC_CHECK_FUNCS(atol fstat getrusage gettimeofday lstat stat times)
mfx_FUNC_MEMCMP
# /***********************************************************************
# // Checks for system services
# ************************************************************************/
# /***********************************************************************
# // Customization
# ************************************************************************/
mfx_CUSTOMIZE
AC_SUBST(SRC_VPATH)
SRC_VPATH=""
if test "$GCC" = yes; then
if test "$MFX_ARCH" = "i386"; then
SRC_VPATH="/${MFX_ARCH}/src"
enable_asm=yes
fi
fi
if test "$mfx_unaligned_ok_2" = yes; then
AC_DEFINE(LZO_UNALIGNED_OK_2)
fi
if test "$mfx_unaligned_ok_4" = yes; then
AC_DEFINE(LZO_UNALIGNED_OK_4)
fi
dnl never activate this by default
if test "1" = "2"; then
AC_DEFINE(LZO_ALIGNED_OK_4)
fi
# /***********************************************************************
# // Checks for assembler support
# ************************************************************************/
if test "$GCC" = yes; then
ASFLAGS="$ASFLAGS -x assembler-with-cpp"
fi
mfx_asflags=""
mfx_compile_s='${CC-cc} -c $ASFLAGS $CPPFLAGS $mfx_asflags conftest.s 1>&AC_FD_CC'
AC_CACHE_CHECK(the alignment of the assembler, mfx_cv_asm_align,
[AC_TRY_RUN([#include <stdio.h>
int test() {
#if defined(__GNUC__)
__asm__ __volatile__ ("
.align 4
mfx_a1:
.byte 0
.align 4
mfx_a2:
");
#endif
return 0;
}
main() {
#if defined(__GNUC__)
extern char mfx_a1 __asm__("mfx_a1");
extern char mfx_a2 __asm__("mfx_a2");
long l = &mfx_a2 - &mfx_a1;
FILE *f = fopen("conftestval", "w");
if (!f) exit(1);
fprintf(f, "%ld\n", l);
exit(0);
#else
exit(2);
#endif
}],
mfx_cv_asm_align=`cat conftestval`,
mfx_cv_asm_align="0",
mfx_cv_asm_align="0")])
if test "$mfx_cv_asm_align" = "16"; then
AC_DEFINE(MFX_ASM_ALIGN_PTWO)
else
AC_DEFINE(MFX_ASM_ALIGN_BYTES)
fi
if test "$mfx_cv_asm_align" = "0"; then
enable_asm=no
fi
if test "$enable_asm" = yes; then
AC_MSG_CHECKING([whether global symbols need underscores])
AC_TRY_LINK([
#ifdef __cplusplus
extern "C"
#endif
int mfx_asm_func();
static void test() {
__asm__ __volatile__("
.globl mfx_asm_func
mfx_asm_func:
.byte 0
");
}
], [
return mfx_asm_func();
], [
AC_DEFINE(MFX_ASM_NAME_NO_UNDERSCORES)
AC_MSG_RESULT(no)
], [
AC_MSG_RESULT(yes)
])
fi
if test "$enable_asm" = yes; then
AC_MSG_CHECKING([whether the assembler understands .type])
cat > conftest.s <<EOF
[#]line __oline__ "configure"
#include "confdefs.h"
.type test,@function ; .globl test ; test:
.byte 0
.size test,.-test
EOF
if AC_TRY_EVAL(mfx_compile_s); then
AC_DEFINE(MFX_ASM_HAVE_TYPE)
AC_MSG_RESULT(yes)
else
echo "configure: failed program was:" >&AC_FD_CC
cat conftest.s >&AC_FD_CC
AC_MSG_RESULT(no)
fi
rm -rf conftest*
fi
if test "$enable_asm" = yes; then
AC_MSG_CHECKING([whether the assembler works])
cat > conftest.s <<EOF
[#]line __oline__ "configure"
#include "confdefs.h"
#define IN_CONFIGURE
#include "lzo1x_f2.s"
EOF
mfx_asflags="-I$srcdir/src/$MFX_ARCH/src"
if AC_TRY_EVAL(mfx_compile_s); then
:
else
echo "configure: failed program was:" >&AC_FD_CC
cat conftest.s >&AC_FD_CC
enable_asm=no
fi
mfx_asflags=""
rm -rf conftest*
AC_MSG_RESULT($enable_asm)
fi
AC_MSG_CHECKING([whether to build assembler versions])
AC_MSG_RESULT($enable_asm)
AC_SUBST(LZO_ASM_OBJECTS)
LZO_ASM_OBJECTS=""
if test "$enable_asm" = yes; then
LZO_ASM_OBJECTS="\$(LZO_ASM_OBJECTS_${MFX_CC}_${MFX_ARCH})"
else
AC_DEFINE(LZO_NO_ASM)
fi
mfx_asflags=""
mfx_compile_s=""
# /***********************************************************************
# // Maintainer uses -Werror and lots of pedantic warnings.
# // This is not enabled by default because it requires
# // very clean system headers.
# ************************************************************************/
if test "$USE_MAINTAINER_MODE" = yes; then
if test "$GCC" = yes; then
x=`grep -h '^-' $srcdir/B/gcc_lzo.opt`
x=`echo $x`
CFLAGS_W_PEDANTIC="$CFLAGS_W_PEDANTIC -W -pedantic $x"
#
Werror="-Werror"
test "$enable_debug" = yes && Werror=""
test "$mfx_cv_prog_checkergcc" = yes && Werror=""
test -z "$Werror" || CFLAGS_W="$CFLAGS_W $Werror"
fi
fi
CPPFLAGS="$CPPFLAGS -DLZO_HAVE_CONFIG_H"
test "$USE_MAINTAINER_MODE" = yes && CPPFLAGS="$CPPFLAGS -DMAINT"
# /***********************************************************************
# // Write output files
# ************************************************************************/
AC_OUTPUT(Makefile examples/Makefile include/Makefile ltest/Makefile minilzo/Makefile src/Makefile tests/Makefile)
|
Added work/contrib/lzo/lzo-1.08/doc/LTEST.TXT.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
The test driver `ltest' has grown into a fairly powerful program
of it's own. Here is a short description of the various options.
[ to be written - this is only a very first draft ]
Usage:
======
ltest [option..] file...
Basic options:
==============
-m# compression method
-b# set input block size (default 262144, max 1310720)
-n# number of compression/decompression runs
-c# number of compression runs
-d# number of decompression runs
-S use safe decompressor (if available)
-A use assembler decompressor (if available)
-F use fast assembler decompressor (if available)
-O optimize compressed data (if available)
-s DIR process Calgary Corpus test suite in directory `DIR'
-@ read list of files to compress from stdin
-q be quiet
-L display software license
More about `-m':
================
Use `-m' to list all available methods.
You can select methods by number:
-m71
You can select methods by name:
-mlzo1x-1
-mlzo1x-999
-mlzo1x-1(11)
You can select some predefined method groups:
-mall
-mlzo
-mm1
-mm99
-mm999
-m1x999
-m1y999
You can specify multiple methods/groups separated by ',':
-m1,2,3,4
-m1,2,3,4,lzo1x-1,m99,81
And finally you can use multiple `-m' options:
-m962,972 -mm99,982,m1
Other options:
==============
--max-data-length=LEN
--dict=FILE
--max-dict-length=LEN
--dump=FILE
--adler32
--crc32
--execution-time
--totals
|
Added work/contrib/lzo/lzo-1.08/doc/LZO.FAQ.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
|
============================================================================
LZO Frequently Asked Questions
============================================================================
I hate reading docs - just tell me how to add compression to my program
=======================================================================
This is for the impatient: take a look at examples/simple.c and
examples/lpack.c and see how easy this is.
But you will come back to read the documentation later, won't you ?
Can you explain the naming conventions of the algorithms ?
==========================================================
Let's take a look at LZO1X:
The algorithm name is LZO1X.
The algorithm category is LZO1.
Various compression levels are implemented.
LZO1X-999
!---------- algorithm category
!--------- algorithm type
!!!----- compression level (1-9, 99, 999)
LZO1X-1(11)
!---------- algorithm category
!--------- algorithm type
!------- compression level (1-9, 99, 999)
!!---- memory level (memory requirements for compression)
All compression/memory levels generate the same compressed data format,
so e.g. the LZO1X decompressor handles all LZO1X-* compression levels
(for more information about the decompressors see below).
Category LZO1 algorithms: compressed data format is strictly byte aligned
Category LZO2 algorithms: uses bit-shifting, slower decompression
Why are there so many algorithms ?
==================================
Because of historical reasons - I want to support unlimited
backward compatibility.
Don't get misled by the size of the library - using one algorithm
increases the size of your application by only a few kB.
If you just want to add a little bit of data compression to your
application you may be looking for miniLZO.
See minilzo/README.LZO for more information.
Which algorithm should I use ?
==============================
LZO1X seems to be best choice in many cases, so:
- when going for speed use LZO1X-1
- when generating pre-compressed data use LZO1X-999
- if you have little memory available for compression use LZO1X-1(11)
or LZO1X-1(12)
Of course, your mileage may vary, and you are encouraged to run your
own experiments. Try LZO1Y and LZO1F next.
What's the difference between the decompressors per algorithm ?
===============================================================
Once again let's use LZO1X for explanation:
- lzo1x_decompress
The `standard' decompressor. Pretty fast - use this whenever possible.
This decompressor expects valid compressed data.
If the compressed data gets corrupted somehow (e.g. transmission
via an erroneous channel, disk errors, ...) it will probably crash
your application because absolutely no additional checks are done.
- lzo1x_decompress_safe
The `safe' decompressor. Somewhat slower.
This decompressor will catch all compressed data violations and
return an error code in this case - it will never crash.
- lzo1x_decompress_asm
Same as lzo1x_decompress - written in assembler.
- lzo1x_decompress_asm_safe
Same as lzo1x_decompress_safe - written in assembler.
- lzo1x_decompress_asm_fast
Similar to lzo1x_decompress_asm - but even faster.
For reasons of speed this decompressor can write 1 to 3 bytes
past the end of the decompressed (output) block.
[ technical note: because data is transferred in 32-bit units ]
Use this when you are decompressing from one memory block to
another memory block - just provide output space for 3 extra bytes.
You shouldn't use it if e.g. you are directly decompressing to video
memory (because the extra bytes will be visible on screen).
- lzo1x_decompress_asm_fast_safe
This is the safe version of lzo1x_decompress_asm_fast.
Notes:
------
- When using a safe decompressor you must pass the number of
bytes available in `dst' via the parameter `dst_len'.
- If you want to be sure that your data is not corrupted you must
use a checksum - just using the safe decompressor is not enough,
because many data errors will not result in a compressed data violation.
- Assembler versions are only available for the i386 family yet.
Please see also src/i386/00readme.txt
- You should test if the assembler versions are actually faster
than the C version on your machine - some compilers can do a very
good optimization job and they also can optimize the code
for a specific processor.
What is this optimization thing ?
=================================
The compressors use a heuristic approach - they sometimes code
information that doesn't improve compression ratio.
Optimization removes this superfluos information in order to
increase decompression speed.
Optimization works similar to decompression except that the
compressed data is modified as well. The length of the compressed
data block will not change - only the compressed data-bytes will
get rearranged a little bit.
Don't expect too much, though - my tests have shown that the
optimization step improves decompression speed by about 1-3%.
I need even more decompression speed...
=======================================
Many modern processors (DEC Alpha, MIPS, ...) can transfer 32-bit words
much faster than bytes - this can significantly speed up decompression.
So after verifying that everything works fine you can try if activating
the LZO_ALIGNED_OK_4 macro improves LZO1X and LZO1Y decompression
performance. Change the file config.h accordingly and recompile everything.
On a i386/i486/Pentium you should use the assembler versions.
How can I reduce memory requirements when (de)compressing ?
===========================================================
If you cleverly arrange your data, you can do an overlapping (in-place)
decompression which means that you can decompress to the *same*
block where the compressed data resides. This effectively removes
the space requirements for holding the compressed data block.
This technique is essential e.g. for usage in an executable packer.
You can also partly overlay the buffers when doing compression.
See examples/overlap.c for a working example.
Can you give a cookbook for using pre-compressed data ?
=======================================================
Let's assume you use LZO1X-999.
1) pre-compression step
- call lzo_init()
- call lzo1x_999_compress()
- call lzo1x_optimize()
- compute an adler32 checksum of the *compressed* data
- store the compressed data and the checksum in a file
- if you are paranoid you can verify decompression now
2) decompression step within your application
- call lzo_init()
- load your compressed data and the checksum
- verify the checksum of the compressed data
(so that you can use the standard decompressor)
- decompress
See examples/precomp.c and examples/precomp2.c for a working example.
How much can my data expand during compression ?
================================================
LZO will expand incompressible data by a little amount.
I still haven't computed the exact values, but I suggest using
these formulas for a worst-case expansion calculation:
LZO1* algorithms:
-----------------
output_block_size = input_block_size + (input_block_size / 64) + 16 + 3
This is about 101.6% for a large block size.
LZO2* algorithms:
-----------------
output_block_size = input_block_size + (input_block_size / 8) + 128 + 3
|
Added work/contrib/lzo/lzo-1.08/doc/LZO.TXT.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
============================================================================
LZO -- a real-time data compression library
============================================================================
Author : Markus Franz Xaver Johannes Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/opensource/lzo/
Version : 1.08
Date : 12-Jul-2002
Abstract
--------
LZO is a portable lossless data compression library written in ANSI C.
It offers pretty fast compression and very fast decompression.
Decompression requires no memory.
In addition there are slower compression levels achieving a quite
competitive compression ratio while still decompressing at
this very high speed.
LZO is distributed under the GNU General Public License.
Introduction
------------
LZO is a data compression library which is suitable for data
de-/compression in real-time. This means it favours speed
over compression ratio.
I named it LZO standing for Lempel-Ziv-Oberhumer.
LZO is written in ANSI C. Both the source code and the compressed
data format are designed to be portable across platforms.
LZO implements a number of algorithms with the following features:
- Decompression is simple and *very* fast.
- Requires no memory for decompression.
- Compression is pretty fast.
- Requires 64 kB of memory for compression.
- Allows you to dial up extra compression at a speed cost in the
compressor. The speed of the decompressor is not reduced.
- Includes compression levels for generating pre-compressed
data which achieve a quite competitive compression ratio.
- There is also a compression level which needs only 8 kB for compression.
- Algorithm is thread safe.
- Algorithm is lossless.
LZO supports overlapping compression and in-place decompression.
Design criteria
---------------
LZO was designed with speed in mind. Decompressor speed has been
favoured over compressor speed. Real-time decompression should be
possible for virtually any application. The implementation of the
LZO1X decompressor in optimized i386 assembler code runs about at
the third of the speed of a memcpy() - and even faster for many files.
In fact I first wrote the decompressor of each algorithm thereby
defining the compressed data format, verified it with manually
created test data and at last added the compressor.
Performance
-----------
To keep you interested, here is an overview of the average results
when compressing the (in-)famous Calgary Corpus test suite with
a blocksize of 256 kB, running on my old Intel Pentium 133.
The naming convention of the various algorithms goes LZOxx-N, where N is
the compression level. Range 1-9 indicates the fast standard levels using
64 kB memory for compression. Level 99 offers better compression at the
cost of more memory (256 kB), and is still reasonably fast.
Level 999 achieves nearly optimal compression - but it is slow
and uses much memory, and is mainly intended for generating
pre-compressed data.
The C version of LZO1X-1 is about 4-5 times faster than the fastest
zlib compression level, and it also outperforms other algorithms
like LZRW1-A and LZV in both compression ratio and compression speed
and decompression speed.
+------------------------------------------------------------------------+
| Algorithm Length CxB ComLen %Remn Bits Com K/s Dec K/s |
| --------- ------ --- ------ ----- ---- ------- ------- |
| LZO1-1 224401 1 117362 53.1 4.25 4665.24 13341.98 |
| LZO1-99 224401 1 101560 46.7 3.73 1373.29 13823.40 |
| |
| LZO1A-1 224401 1 115174 51.7 4.14 4937.83 14410.35 |
| LZO1A-99 224401 1 99958 45.5 3.64 1362.72 14734.17 |
| |
| LZO1B-1 224401 1 109590 49.6 3.97 4565.53 15438.34 |
| LZO1B-2 224401 1 106235 48.4 3.88 4297.33 15492.79 |
| LZO1B-3 224401 1 104395 47.8 3.83 4018.21 15373.52 |
| LZO1B-4 224401 1 104828 47.4 3.79 3024.48 15100.11 |
| LZO1B-5 224401 1 102724 46.7 3.73 2827.82 15427.62 |
| LZO1B-6 224401 1 101210 46.0 3.68 2615.96 15325.68 |
| LZO1B-7 224401 1 101388 46.0 3.68 2430.89 15361.47 |
| LZO1B-8 224401 1 99453 45.2 3.62 2183.87 15402.77 |
| LZO1B-9 224401 1 99118 45.0 3.60 1677.06 15069.60 |
| LZO1B-99 224401 1 95399 43.6 3.48 1286.87 15656.11 |
| LZO1B-999 224401 1 83934 39.1 3.13 232.40 16445.05 |
| |
| LZO1C-1 224401 1 111735 50.4 4.03 4883.08 15570.91 |
| LZO1C-2 224401 1 108652 49.3 3.94 4424.24 15733.14 |
| LZO1C-3 224401 1 106810 48.7 3.89 4127.65 15645.69 |
| LZO1C-4 224401 1 105717 47.7 3.82 3007.92 15346.44 |
| LZO1C-5 224401 1 103605 47.0 3.76 2829.15 15153.88 |
| LZO1C-6 224401 1 102585 46.5 3.72 2631.37 15257.58 |
| LZO1C-7 224401 1 101937 46.2 3.70 2378.57 15492.49 |
| LZO1C-8 224401 1 100779 45.6 3.65 2171.93 15386.07 |
| LZO1C-9 224401 1 100255 45.4 3.63 1691.44 15194.68 |
| LZO1C-99 224401 1 97252 44.1 3.53 1462.88 15341.37 |
| LZO1C-999 224401 1 87740 40.2 3.21 306.44 16411.94 |
| |
| LZO1F-1 224401 1 113412 50.8 4.07 4755.97 16074.12 |
| LZO1F-999 224401 1 89599 40.3 3.23 280.68 16553.90 |
| |
| LZO1X-1(11) 224401 1 118810 52.6 4.21 4544.42 15879.04 |
| LZO1X-1(12) 224401 1 113675 50.6 4.05 4411.15 15721.59 |
| LZO1X-1 224401 1 109323 49.4 3.95 4991.76 15584.89 |
| LZO1X-1(15) 224401 1 108500 49.1 3.93 5077.50 15744.56 |
| LZO1X-999 224401 1 82854 38.0 3.04 135.77 16548.48 |
| |
| LZO1Y-1 224401 1 110820 49.8 3.98 4952.52 15638.82 |
| LZO1Y-999 224401 1 83614 38.2 3.05 135.07 16385.40 |
| |
| LZO1Z-999 224401 1 83034 38.0 3.04 133.31 10553.74 |
| |
| LZO2A-999 224401 1 87880 40.0 3.20 301.21 8115.75 |
| |
| memcpy() 224401 1 224401 100.0 8.00 60956.83 59124.58 |
+------------------------------------------------------------------------+
Notes:
- CxB is the number of blocks
- K/s is the speed measured in 1000 uncompressed bytes per second
- the assembler decompressors are even faster
Short documentation
-------------------
LZO is a block compression algorithm - it compresses and decompresses
a block of data. Block size must be the same for compression
and decompression.
LZO compresses a block of data into matches (a sliding dictionary)
and runs of non-matching literals. LZO takes care about long matches
and long literal runs so that it produces good results on highly
redundant data and deals acceptably with non-compressible data.
When dealing with uncompressible data, LZO expands the input
block by a maximum of 16 bytes per 1024 bytes input (probably
only by a maximum of 8 bytes, I still have to compute the exact
value).
I have verified LZO using such tools as Richard W.M. Jones's bounds
checking gcc and Tristan Gingold's checkergcc. And in addition to
compressing gigabytes of files when tuning some parameters I have also
consulted various `lint' programs to spot potential portability problems.
LZO is free of any known bugs.
The algorithms
--------------
There are too many algorithms implemented. But I want to support
unlimited backward compatibility, so I will not reduce the LZO
distribution in the future.
As the many object files are mostly independent of each other, the
size overhead for an executable statically linked with the LZO library
is usually pretty low (just a few kB) because the linker will only add
the modules that you are actually using.
I first published LZO1 and LZO1A in the Internet newsgroups
comp.compression and comp.compression.research in March 1996.
They are mainly included for compatibility reasons. The LZO2A
decompressor is too slow, and there is no fast compressor anyway.
My experiments have shown that LZO1B is good with a large blocksize
or with very redundant data, LZO1F is good with a small blocksize or
with binary data and that LZO1X is often the best choice of all.
LZO1Y and LZO1Z are almost identical to LZO1X - they can achieve a
better compression ratio on some files.
Beware, your mileage may vary.
Usage of the library
--------------------
Despite of its size, the basic usage of LZO is really very simple.
Let's assume you want to compress some data with LZO1X-1:
A) compression
* include <lzo1x.h>
call lzo_init()
compress your data with lzo1x_1_compress()
* link your application with the LZO library
B) decompression
* include <lzo1x.h>
call lzo_init()
decompress your data with lzo1x_decompress()
* link your application with the LZO library
The program examples/simple.c shows a fully working example.
See also LZO.FAQ for more information.
Building LZO
------------
As LZO uses Autoconf+Automake+Libtool the building process under
UNIX systems should be very unproblematic. Shared libraries are
supported on many architectures as well.
For detailed instructions see the file INSTALL.
Please note that due to the design of the ELF executable format
the performance of a shared library on i386 systems (e.g. Linux)
is a little bit slower, so you may want to link your applications
with the static version (liblzo.a) anyway.
For building under DOS, Win16, Win32, OS/2 and other systems
take a look at the file b/00readme.txt.
In case of troubles (like decompression data errors) try recompiling
everything without optimizations - LZO may break the optimizer
of your compiler. See the file BUGS.
LZO is written in ANSI C. In particular this means:
- your compiler must understand prototypes
- your compiler must understand prototypes in function pointers
- your compiler must correctly promote integrals ("value-preserving")
- your preprocessor must implement #elif, #error and stringizing
- you must have a conforming and correct <limits.h> header
- you must have <stddef.h>, <string.h> and other ANSI C headers
- you should have size_t and ptrdiff_t
Portability
-----------
I have built and tested LZO successfully on a variety of platforms
including DOS (16 + 32 bit), Windows 3.1 (16-bit), Windows 95,
Windows NT, Linux, HP-UX and a DEC Alpha (64-bit).
LZO is also reported to work under AIX, ConvexOS, IRIX, MacOS, PalmOS (Pilot),
PSX (Sony Playstation), Solaris, SunOS, TOS (Atari ST) and VxWorks.
Furthermore it is said that its performance on a Cray is superior
to all other machines...
And I think it would be much fun to translate the decompressors
to Z-80 or 6502 assembly.
The future
----------
Here is what I'm planning for the next months. No promises, though...
- interfaces to Perl, Java, Python, Delphi, Visual Basic, ...
- improve documentation and API reference
Some comments about the source code
-----------------------------------
Be warned: the main source code in the `src' directory is a
real pain to understand as I've experimented with hundreds of slightly
different versions. It contains many #if and some gotos, and
is *completely optimized for speed* and not for readability.
Code sharing of the different algorithms is implemented by stressing
the preprocessor - this can be really confusing. Lots of marcos and
assertions don't make things better.
Nevertheless LZO compiles very quietly on a variety of
compilers with the highest warning levels turned on, even
in C++ mode.
Copyright
---------
LZO is Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
Markus Franz Xaver Johannes Oberhumer
LZO is distributed under the terms of the GNU General Public License (GPL).
See the file COPYING.
Special licenses for commercial and other applications which
are not willing to accept the GNU General Public License
are available by contacting the author.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQE9LPc3TWFXqwsgQ8kRAshxAKC4PM57IiR1Rp2Xs02qo1eU+00JuQCfcb/Q
E19vPy1o7426KliMJ5tHgVQ=
=wxji
-----END PGP SIGNATURE-----
|
Added work/contrib/lzo/lzo-1.08/doc/LZOAPI.TXT.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
|
============================================================================
LZO -- a real-time data compression library LIBRARY REFERENCE
============================================================================
[ to be written - this is only a very first draft ]
[ please read LZO.FAQ first ]
Table of Contents
=================
1 Introduction to the LZO Library Reference
1.1 Preliminary notes
1.2 Headers
2 General
2.1 The memory model
2.2 Public integral types
2.3 Public pointer types
2.4 Public function types
3 Function reference
3.1 Initialization
3.2 Compression
3.3 Decompression
3.4 Optimization
3.5 String functions
3.6 Checksum functions
3.7 Version functions
4 Variable reference
1 Introduction to the LZO Library Reference
=============================================
1.1 Preliminary notes
---------------------
- `C90' is short for ISO 9899-1990, the ANSI/ISO standard for the C
programming language
1.2 Headers
-----------
This section briefly describes the headers.
<lzoconf.h>
Contains definitions for the basic integral and pointer types,
provides wrappers for the library calling conventions, defines
error codes and contains prototypes for the generic functions.
This file is automatically included by all LZO headers.
<lzo1.h>
<lzo1a.h>
<lzo1b.h>
<lzo1c.h>
<lzo1f.h>
<lzo1x.h>
<lzo1y.h>
<lzo1z.h>
<lzo2a.h>
These files provide definitions and prototypes for the
actual (de-)compression functions.
<lzo16bit.h>
Provides definitions for building and running LZO under a
strict 16-bit memory model. Not officially supported.
2 General
=========
2.1 The memory model
--------------------
The documentation indicates that LZO requires 32-bit integers. It's
not the integer size that really matters, though, but the memory
model. If your memory model allows to access pointers at 32-bit
offsets, then there is no problem at all - LZO works fine on my
old Atari ST, which has 16 bit integers and a flat 32-bit memory model.
Using `huge' 32-bit pointers under 16-bit DOS is a workaround for this.
While LZO also works with a strict 16-bit memory model, I don't officially
support this because this limits the maximum block size to 64 kB - and this
makes the library incompatible with other platforms, i.e. you cannot
decompress larger blocks compressed on those platforms.
2.2 Public integral types
-------------------------
lzo_uint
used as size_t, must be 32 bits or more for compatibility reasons
lzo_uint32
*must* be 32 bits or more
lzo_bool
can store the values 0 ("false") and 1 ("true")
lzo_byte
unsigned char (memory model specific)
2.3 Public pointer types
------------------------
All pointer types are memory model specific.
lzo_voidp
pointer to void
lzo_bytep
pointer to unsigned char
lzo_bytepp
array of pointers to unsigned char
2.4 Public function types
-------------------------
lzo_compress_t
lzo_decompress_t
lzo_optimize_t
lzo_progress_callback_t
3 Function reference
====================
3.1 Initialization
------------------
int lzo_init ( void );
This function initializes the LZO library. It must be the first LZO
function you call, and you cannot use any of the other LZO library
functions if the call fails.
Return value:
Returns LZO_E_OK on success, error code otherwise.
Note:
This function is actually implemented using a macro.
3.2 Compression
---------------
All compressors compress the memory block at `src' with the uncompressed
length `src_len' to the address given by `dst'.
The length of the compressed blocked will be returned in the variable
pointed by `dst_len'.
The two blocks may overlap under certain conditions (see examples/overlap.c).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#include <lzo1x.h>
int lzo1x_1_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uint *dst_len,
lzo_voidp wrkmem );
Algorithm: LZO1X
Compression level: LZO1X-1
Memory requirements: LZO1X_1_MEM_COMPRESS (64 kB)
This compressor is pretty fast.
Return value:
Always returns LZO_E_OK (this function can never fail).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#include <lzo1x.h>
int lzo1x_999_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uint *dst_len,
lzo_voidp wrkmem );
Algorithm: LZO1X
Compression level: LZO1X-999
Memory requirements: LZO1X_999_MEM_COMPRESS (448 kB)
This compressor is quite slow but achieves a good compression
ratio. It is mainly intended for generating pre-compressed data.
Return value:
Always returns LZO_E_OK (this function can never fail).
[ ... lots of other compressors ... ]
3.3 Decompression
-----------------
All decompressors decompress the memory block at `src' with the compressed
length `src_len' to the address given by `dst'.
The length of the decompressed block will be returned in the variable
pointed by `dst_len' - on error the number of bytes that have
been decompressed so far will be returned.
The safe decompressors expect that the number of bytes available in
the `dst' block is passed via the variable pointed by `dst_len'.
The two blocks may overlap under certain conditions (see examples/overlap.c).
Description of return values:
LZO_E_OK
Success.
LZO_E_INPUT_NOT_CONSUMED
The end of the compressed block has been detected before all
bytes in the compressed block have been used.
This may actually not be an error (if `src_len' is too large).
LZO_E_INPUT_OVERRUN
The decompressor requested more bytes from the compressed
block than available.
Your data is corrupted (or `src_len' is too small).
LZO_E_OUTPUT_OVERRUN
The decompressor requested to write more bytes to the uncompressed
block than available.
Either your data is corrupted or you should increase the number of
available bytes passed in `dst_len'.
LZO_E_LOOKBEHIND_OVERRUN
Your data is corrupted.
LZO_E_EOF_NOT_FOUND
No EOF code was found in the compressed block.
Your data is corrupted (or `src_len' is too small).
LZO_E_ERROR
Any other error (data corrupted).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#include <lzo1x.h>
int lzo1x_decompress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uint *dst_len,
lzo_voidp wrkmem );
Algorithm: LZO1X
Memory requirements: 0
[ ... lots of other decompressors ... ]
4 Variable reference
====================
The variables are listed alphabetically.
[ no public variables yet ]
--------------------------- END OF LZOAPI.TXT ------------------------------
|
Added work/contrib/lzo/lzo-1.08/examples/.deps/dict.Po.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
dict.o : \
dict.c ../include/lzo1x.h ../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lutil.h \
/usr/include/stdio.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h \
/usr/include/bits/types.h /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
/usr/include/bits/stdio.h /usr/include/stdlib.h \
/usr/include/sys/types.h /usr/include/time.h /usr/include/endian.h \
/usr/include/bits/endian.h /usr/include/sys/select.h \
/usr/include/bits/select.h /usr/include/bits/sigset.h \
/usr/include/sys/sysmacros.h /usr/include/alloca.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/ctype.h \
/usr/include/unistd.h /usr/include/bits/posix_opt.h \
/usr/include/bits/confname.h /usr/include/getopt.h \
/usr/include/sys/stat.h /usr/include/bits/stat.h ../include/lzoutil.h \
/usr/include/bits/time.h
dict.c :
../include/lzo1x.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lutil.h :
/usr/include/stdio.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h :
/usr/include/bits/types.h :
/usr/include/libio.h :
/usr/include/_G_config.h :
/usr/include/bits/stdio_lim.h :
/usr/include/bits/stdio.h :
/usr/include/stdlib.h :
/usr/include/sys/types.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/alloca.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/ctype.h :
/usr/include/unistd.h :
/usr/include/bits/posix_opt.h :
/usr/include/bits/confname.h :
/usr/include/getopt.h :
/usr/include/sys/stat.h :
/usr/include/bits/stat.h :
../include/lzoutil.h :
/usr/include/bits/time.h :
|
Added work/contrib/lzo/lzo-1.08/examples/.deps/lpack.Po.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
lpack.o : \
lpack.c ../include/lzo1x.h ../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lutil.h \
/usr/include/stdio.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h \
/usr/include/bits/types.h /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
/usr/include/bits/stdio.h /usr/include/stdlib.h \
/usr/include/sys/types.h /usr/include/time.h /usr/include/endian.h \
/usr/include/bits/endian.h /usr/include/sys/select.h \
/usr/include/bits/select.h /usr/include/bits/sigset.h \
/usr/include/sys/sysmacros.h /usr/include/alloca.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/ctype.h \
/usr/include/unistd.h /usr/include/bits/posix_opt.h \
/usr/include/bits/confname.h /usr/include/getopt.h \
/usr/include/sys/stat.h /usr/include/bits/stat.h ../include/lzoutil.h
lpack.c :
../include/lzo1x.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lutil.h :
/usr/include/stdio.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h :
/usr/include/bits/types.h :
/usr/include/libio.h :
/usr/include/_G_config.h :
/usr/include/bits/stdio_lim.h :
/usr/include/bits/stdio.h :
/usr/include/stdlib.h :
/usr/include/sys/types.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/alloca.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/ctype.h :
/usr/include/unistd.h :
/usr/include/bits/posix_opt.h :
/usr/include/bits/confname.h :
/usr/include/getopt.h :
/usr/include/sys/stat.h :
/usr/include/bits/stat.h :
../include/lzoutil.h :
|
Added work/contrib/lzo/lzo-1.08/examples/.deps/overlap.Po.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
overlap.o : \
overlap.c ../include/lzo1x.h ../include/lzoconf.h \
../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lutil.h \
/usr/include/stdio.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h \
/usr/include/bits/types.h /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
/usr/include/bits/stdio.h /usr/include/stdlib.h \
/usr/include/sys/types.h /usr/include/time.h /usr/include/endian.h \
/usr/include/bits/endian.h /usr/include/sys/select.h \
/usr/include/bits/select.h /usr/include/bits/sigset.h \
/usr/include/sys/sysmacros.h /usr/include/alloca.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/ctype.h \
/usr/include/unistd.h /usr/include/bits/posix_opt.h \
/usr/include/bits/confname.h /usr/include/getopt.h \
/usr/include/sys/stat.h /usr/include/bits/stat.h ../include/lzoutil.h
overlap.c :
../include/lzo1x.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lutil.h :
/usr/include/stdio.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h :
/usr/include/bits/types.h :
/usr/include/libio.h :
/usr/include/_G_config.h :
/usr/include/bits/stdio_lim.h :
/usr/include/bits/stdio.h :
/usr/include/stdlib.h :
/usr/include/sys/types.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/alloca.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/ctype.h :
/usr/include/unistd.h :
/usr/include/bits/posix_opt.h :
/usr/include/bits/confname.h :
/usr/include/getopt.h :
/usr/include/sys/stat.h :
/usr/include/bits/stat.h :
../include/lzoutil.h :
|
Added work/contrib/lzo/lzo-1.08/examples/.deps/precomp.Po.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
precomp.o : \
precomp.c ../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h \
../include/lzo1x.h ../include/lzo1y.h lutil.h /usr/include/stdio.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h \
/usr/include/bits/types.h /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
/usr/include/bits/stdio.h /usr/include/stdlib.h \
/usr/include/sys/types.h /usr/include/time.h /usr/include/endian.h \
/usr/include/bits/endian.h /usr/include/sys/select.h \
/usr/include/bits/select.h /usr/include/bits/sigset.h \
/usr/include/sys/sysmacros.h /usr/include/alloca.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/ctype.h \
/usr/include/unistd.h /usr/include/bits/posix_opt.h \
/usr/include/bits/confname.h /usr/include/getopt.h \
/usr/include/sys/stat.h /usr/include/bits/stat.h ../include/lzoutil.h \
/usr/include/assert.h
precomp.c :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
../include/lzo1x.h :
../include/lzo1y.h :
lutil.h :
/usr/include/stdio.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h :
/usr/include/bits/types.h :
/usr/include/libio.h :
/usr/include/_G_config.h :
/usr/include/bits/stdio_lim.h :
/usr/include/bits/stdio.h :
/usr/include/stdlib.h :
/usr/include/sys/types.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/alloca.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/ctype.h :
/usr/include/unistd.h :
/usr/include/bits/posix_opt.h :
/usr/include/bits/confname.h :
/usr/include/getopt.h :
/usr/include/sys/stat.h :
/usr/include/bits/stat.h :
../include/lzoutil.h :
/usr/include/assert.h :
|
Added work/contrib/lzo/lzo-1.08/examples/.deps/precomp2.Po.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
precomp2.o : \
precomp2.c ../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h \
../include/lzo1x.h ../include/lzo1y.h lutil.h /usr/include/stdio.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h \
/usr/include/bits/types.h /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
/usr/include/bits/stdio.h /usr/include/stdlib.h \
/usr/include/sys/types.h /usr/include/time.h /usr/include/endian.h \
/usr/include/bits/endian.h /usr/include/sys/select.h \
/usr/include/bits/select.h /usr/include/bits/sigset.h \
/usr/include/sys/sysmacros.h /usr/include/alloca.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/ctype.h \
/usr/include/unistd.h /usr/include/bits/posix_opt.h \
/usr/include/bits/confname.h /usr/include/getopt.h \
/usr/include/sys/stat.h /usr/include/bits/stat.h ../include/lzoutil.h \
/usr/include/assert.h
precomp2.c :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
../include/lzo1x.h :
../include/lzo1y.h :
lutil.h :
/usr/include/stdio.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h :
/usr/include/bits/types.h :
/usr/include/libio.h :
/usr/include/_G_config.h :
/usr/include/bits/stdio_lim.h :
/usr/include/bits/stdio.h :
/usr/include/stdlib.h :
/usr/include/sys/types.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/alloca.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/ctype.h :
/usr/include/unistd.h :
/usr/include/bits/posix_opt.h :
/usr/include/bits/confname.h :
/usr/include/getopt.h :
/usr/include/sys/stat.h :
/usr/include/bits/stat.h :
../include/lzoutil.h :
/usr/include/assert.h :
|
Added work/contrib/lzo/lzo-1.08/examples/.deps/simple.Po.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
simple.o : \
simple.c ../include/lzo1x.h ../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lutil.h \
/usr/include/stdio.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h \
/usr/include/bits/types.h /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
/usr/include/bits/stdio.h /usr/include/stdlib.h \
/usr/include/sys/types.h /usr/include/time.h /usr/include/endian.h \
/usr/include/bits/endian.h /usr/include/sys/select.h \
/usr/include/bits/select.h /usr/include/bits/sigset.h \
/usr/include/sys/sysmacros.h /usr/include/alloca.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/ctype.h \
/usr/include/unistd.h /usr/include/bits/posix_opt.h \
/usr/include/bits/confname.h /usr/include/getopt.h \
/usr/include/sys/stat.h /usr/include/bits/stat.h ../include/lzoutil.h
simple.c :
../include/lzo1x.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lutil.h :
/usr/include/stdio.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h :
/usr/include/bits/types.h :
/usr/include/libio.h :
/usr/include/_G_config.h :
/usr/include/bits/stdio_lim.h :
/usr/include/bits/stdio.h :
/usr/include/stdlib.h :
/usr/include/sys/types.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/alloca.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/ctype.h :
/usr/include/unistd.h :
/usr/include/bits/posix_opt.h :
/usr/include/bits/confname.h :
/usr/include/getopt.h :
/usr/include/sys/stat.h :
/usr/include/bits/stat.h :
../include/lzoutil.h :
|
Added work/contrib/lzo/lzo-1.08/examples/.libs/dict.
cannot compute difference between binary files
Added work/contrib/lzo/lzo-1.08/examples/.libs/lpack.
cannot compute difference between binary files
Added work/contrib/lzo/lzo-1.08/examples/.libs/overlap.
cannot compute difference between binary files
Added work/contrib/lzo/lzo-1.08/examples/.libs/precomp.
cannot compute difference between binary files
Added work/contrib/lzo/lzo-1.08/examples/.libs/precomp2.
cannot compute difference between binary files
Added work/contrib/lzo/lzo-1.08/examples/.libs/simple.
cannot compute difference between binary files
Added work/contrib/lzo/lzo-1.08/examples/Makefile.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
|
# Makefile.in generated by automake 1.6.2 from Makefile.am.
# examples/Makefile. Generated from Makefile.in by configure.
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
#
# Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
#
SHELL = /bin/sh
srcdir = .
top_srcdir = ..
prefix = /usr/local
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
sbindir = ${exec_prefix}/sbin
libexecdir = ${exec_prefix}/libexec
datadir = ${prefix}/share
sysconfdir = ${prefix}/etc
sharedstatedir = ${prefix}/com
localstatedir = ${prefix}/var
libdir = ${exec_prefix}/lib
infodir = ${prefix}/info
mandir = ${prefix}/man
includedir = ${prefix}/include
oldincludedir = /usr/include
pkgdatadir = $(datadir)/lzo
pkglibdir = $(libdir)/lzo
pkgincludedir = $(includedir)/lzo
top_builddir = ..
ACLOCAL = ${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run aclocal-1.6
AUTOCONF = ${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run autoconf
AUTOMAKE = ${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run automake-1.6
AUTOHEADER = ${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run autoheader
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = /usr/bin/ginstall -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_SCRIPT = ${INSTALL}
INSTALL_HEADER = $(INSTALL_DATA)
transform = s,x,x,
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
host_alias =
host_triplet = i586-pc-linux-gnu
EXEEXT =
OBJEXT = o
PATH_SEPARATOR = :
AMTAR = ${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run tar
AS = @AS@
ASFLAGS = -x assembler-with-cpp
AWK = gawk
CC = gcc
CFLAGS_GCC_OMIT_FRAME_POINTER = -fomit-frame-pointer
CFLAGS_O =
CFLAGS_W =
CFLAGS_W_PEDANTIC =
CLEANFILES = *.bb *.bbg *.da *.gcov bb.out bbtrace* gmon.out
CPP = gcc -E
DEPDIR = .deps
DLLTOOL = @DLLTOOL@
ECHO = echo
INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
LIBTOOL = $(SHELL) $(top_builddir)/libtool
LN_S = ln -s
LZO_ASM_OBJECTS = $(LZO_ASM_OBJECTS_GCC_i386)
LZO_CFLAGS =
MAINT = #
MFX_ARCH = i386
MFX_CC = GCC
MFX_CPU = i586
MOSTLYCLEANFILES = *.i
NASM =
OBJDUMP = @OBJDUMP@
PACKAGE = lzo
RANLIB = ranlib
SRC_VPATH = /i386/src
STRIP = strip
VERSION = 1.08
am__include = include
am__quote =
install_sh = /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/install-sh
liblzo = $(top_builddir)/src/liblzo.la
ltest_LIBS =
AUTOMAKE_OPTIONS = 1.6
INCLUDES = -I$(top_srcdir)/include
CFLAGS = -O2 -Wall -Wcast-align -Wcast-qual -Wwrite-strings -fno-strength-reduce -fstrict-aliasing $(CFLAGS_O) $(CFLAGS_W)
noinst_PROGRAMS = dict lpack overlap precomp precomp2 simple
LDADD = $(top_builddir)/src/liblzo.la
EXTRA_DIST = lutil.h
subdir = examples
mkinstalldirs = $(SHELL) $(top_srcdir)/acconfig/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
noinst_PROGRAMS = dict$(EXEEXT) lpack$(EXEEXT) overlap$(EXEEXT) \
precomp$(EXEEXT) precomp2$(EXEEXT) simple$(EXEEXT)
PROGRAMS = $(noinst_PROGRAMS)
dict_SOURCES = dict.c
dict_OBJECTS = dict.$(OBJEXT)
dict_LDADD = $(LDADD)
dict_DEPENDENCIES =
dict_LDFLAGS =
lpack_SOURCES = lpack.c
lpack_OBJECTS = lpack.$(OBJEXT)
lpack_LDADD = $(LDADD)
lpack_DEPENDENCIES =
lpack_LDFLAGS =
overlap_SOURCES = overlap.c
overlap_OBJECTS = overlap.$(OBJEXT)
overlap_LDADD = $(LDADD)
overlap_DEPENDENCIES =
overlap_LDFLAGS =
precomp_SOURCES = precomp.c
precomp_OBJECTS = precomp.$(OBJEXT)
precomp_LDADD = $(LDADD)
precomp_DEPENDENCIES =
precomp_LDFLAGS =
precomp2_SOURCES = precomp2.c
precomp2_OBJECTS = precomp2.$(OBJEXT)
precomp2_LDADD = $(LDADD)
precomp2_DEPENDENCIES =
precomp2_LDFLAGS =
simple_SOURCES = simple.c
simple_OBJECTS = simple.$(OBJEXT)
simple_LDADD = $(LDADD)
simple_DEPENDENCIES =
simple_LDFLAGS =
DEFS = -DHAVE_CONFIG_H
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
CPPFLAGS = -DLZO_HAVE_CONFIG_H
LDFLAGS =
LIBS =
depcomp = $(SHELL) $(top_srcdir)/acconfig/depcomp
am__depfiles_maybe = depfiles
DEP_FILES = ./$(DEPDIR)/dict.Po ./$(DEPDIR)/lpack.Po \
./$(DEPDIR)/overlap.Po ./$(DEPDIR)/precomp.Po \
./$(DEPDIR)/precomp2.Po ./$(DEPDIR)/simple.Po
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
$(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
DIST_SOURCES = dict.c lpack.c overlap.c precomp.c precomp2.c simple.c
DIST_COMMON = Makefile.am Makefile.in
SOURCES = dict.c lpack.c overlap.c precomp.c precomp2.c simple.c
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: # Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu examples/Makefile
Makefile: # $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
clean-noinstPROGRAMS:
@list='$(noinst_PROGRAMS)'; for p in $$list; do \
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
echo " rm -f $$p $$f"; \
rm -f $$p $$f ; \
done
dict$(EXEEXT): $(dict_OBJECTS) $(dict_DEPENDENCIES)
@rm -f dict$(EXEEXT)
$(LINK) $(dict_LDFLAGS) $(dict_OBJECTS) $(dict_LDADD) $(LIBS)
lpack$(EXEEXT): $(lpack_OBJECTS) $(lpack_DEPENDENCIES)
@rm -f lpack$(EXEEXT)
$(LINK) $(lpack_LDFLAGS) $(lpack_OBJECTS) $(lpack_LDADD) $(LIBS)
overlap$(EXEEXT): $(overlap_OBJECTS) $(overlap_DEPENDENCIES)
@rm -f overlap$(EXEEXT)
$(LINK) $(overlap_LDFLAGS) $(overlap_OBJECTS) $(overlap_LDADD) $(LIBS)
precomp$(EXEEXT): $(precomp_OBJECTS) $(precomp_DEPENDENCIES)
@rm -f precomp$(EXEEXT)
$(LINK) $(precomp_LDFLAGS) $(precomp_OBJECTS) $(precomp_LDADD) $(LIBS)
precomp2$(EXEEXT): $(precomp2_OBJECTS) $(precomp2_DEPENDENCIES)
@rm -f precomp2$(EXEEXT)
$(LINK) $(precomp2_LDFLAGS) $(precomp2_OBJECTS) $(precomp2_LDADD) $(LIBS)
simple$(EXEEXT): $(simple_OBJECTS) $(simple_DEPENDENCIES)
@rm -f simple$(EXEEXT)
$(LINK) $(simple_LDFLAGS) $(simple_OBJECTS) $(simple_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT) core *.core
distclean-compile:
-rm -f *.tab.c
include ./$(DEPDIR)/dict.Po
include ./$(DEPDIR)/lpack.Po
include ./$(DEPDIR)/overlap.Po
include ./$(DEPDIR)/precomp.Po
include ./$(DEPDIR)/precomp2.Po
include ./$(DEPDIR)/simple.Po
distclean-depend:
-rm -rf ./$(DEPDIR)
.c.o:
source='$<' object='$@' libtool=no \
depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' \
$(CCDEPMODE) $(depcomp) \
$(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
.c.obj:
source='$<' object='$@' libtool=no \
depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' \
$(CCDEPMODE) $(depcomp) \
$(COMPILE) -c `cygpath -w $<`
.c.lo:
source='$<' object='$@' libtool=yes \
depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' \
$(CCDEPMODE) $(depcomp) \
$(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
CCDEPMODE = depmode=gcc
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
ETAGS = etags
ETAGSFLAGS =
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@list='$(DISTFILES)'; for file in $$list; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkinstalldirs) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS)
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
mostlyclean-am
distclean: distclean-am
distclean-am: clean-am distclean-compile distclean-depend \
distclean-generic distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
info: info-am
info-am:
install-data-am:
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
uninstall-am: uninstall-info-am
.PHONY: GTAGS all all-am check check-am clean clean-generic \
clean-libtool clean-noinstPROGRAMS distclean distclean-compile \
distclean-depend distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am info info-am install \
install-am install-data install-data-am install-exec \
install-exec-am install-info install-info-am install-man \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
tags uninstall uninstall-am uninstall-info-am
$(top_builddir)/src/liblzo.la:
cd $(top_builddir)/src && $(MAKE) all
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
|
Added work/contrib/lzo/lzo-1.08/examples/Makefile.am.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
## Process this file with automake to create Makefile.in
#
# Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
#
AUTOMAKE_OPTIONS = 1.6
INCLUDES = -I$(top_srcdir)/include
CFLAGS = @CFLAGS@ $(CFLAGS_O) $(CFLAGS_W)
noinst_PROGRAMS = dict lpack overlap precomp precomp2 simple
LDADD = @liblzo@
EXTRA_DIST = lutil.h
@liblzo@:
cd $(top_builddir)/src && $(MAKE) all
|
Added work/contrib/lzo/lzo-1.08/examples/Makefile.in.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
|
# Makefile.in generated by automake 1.6.2 from Makefile.am.
# @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
#
# Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
#
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
host_alias = @host_alias@
host_triplet = @host@
EXEEXT = @EXEEXT@
OBJEXT = @OBJEXT@
PATH_SEPARATOR = @PATH_SEPARATOR@
AMTAR = @AMTAR@
AS = @AS@
ASFLAGS = @ASFLAGS@
AWK = @AWK@
CC = @CC@
CFLAGS_GCC_OMIT_FRAME_POINTER = @CFLAGS_GCC_OMIT_FRAME_POINTER@
CFLAGS_O = @CFLAGS_O@
CFLAGS_W = @CFLAGS_W@
CFLAGS_W_PEDANTIC = @CFLAGS_W_PEDANTIC@
CLEANFILES = @CLEANFILES@
CPP = @CPP@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
ECHO = @ECHO@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LZO_ASM_OBJECTS = @LZO_ASM_OBJECTS@
LZO_CFLAGS = @LZO_CFLAGS@
MAINT = @MAINT@
MFX_ARCH = @MFX_ARCH@
MFX_CC = @MFX_CC@
MFX_CPU = @MFX_CPU@
MOSTLYCLEANFILES = @MOSTLYCLEANFILES@
NASM = @NASM@
OBJDUMP = @OBJDUMP@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
SRC_VPATH = @SRC_VPATH@
STRIP = @STRIP@
VERSION = @VERSION@
am__include = @am__include@
am__quote = @am__quote@
install_sh = @install_sh@
liblzo = @liblzo@
ltest_LIBS = @ltest_LIBS@
AUTOMAKE_OPTIONS = 1.6
INCLUDES = -I$(top_srcdir)/include
CFLAGS = @CFLAGS@ $(CFLAGS_O) $(CFLAGS_W)
noinst_PROGRAMS = dict lpack overlap precomp precomp2 simple
LDADD = @liblzo@
EXTRA_DIST = lutil.h
subdir = examples
mkinstalldirs = $(SHELL) $(top_srcdir)/acconfig/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
noinst_PROGRAMS = dict$(EXEEXT) lpack$(EXEEXT) overlap$(EXEEXT) \
precomp$(EXEEXT) precomp2$(EXEEXT) simple$(EXEEXT)
PROGRAMS = $(noinst_PROGRAMS)
dict_SOURCES = dict.c
dict_OBJECTS = dict.$(OBJEXT)
dict_LDADD = $(LDADD)
dict_DEPENDENCIES =
dict_LDFLAGS =
lpack_SOURCES = lpack.c
lpack_OBJECTS = lpack.$(OBJEXT)
lpack_LDADD = $(LDADD)
lpack_DEPENDENCIES =
lpack_LDFLAGS =
overlap_SOURCES = overlap.c
overlap_OBJECTS = overlap.$(OBJEXT)
overlap_LDADD = $(LDADD)
overlap_DEPENDENCIES =
overlap_LDFLAGS =
precomp_SOURCES = precomp.c
precomp_OBJECTS = precomp.$(OBJEXT)
precomp_LDADD = $(LDADD)
precomp_DEPENDENCIES =
precomp_LDFLAGS =
precomp2_SOURCES = precomp2.c
precomp2_OBJECTS = precomp2.$(OBJEXT)
precomp2_LDADD = $(LDADD)
precomp2_DEPENDENCIES =
precomp2_LDFLAGS =
simple_SOURCES = simple.c
simple_OBJECTS = simple.$(OBJEXT)
simple_LDADD = $(LDADD)
simple_DEPENDENCIES =
simple_LDFLAGS =
DEFS = @DEFS@
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
depcomp = $(SHELL) $(top_srcdir)/acconfig/depcomp
am__depfiles_maybe = depfiles
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/dict.Po ./$(DEPDIR)/lpack.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/overlap.Po ./$(DEPDIR)/precomp.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/precomp2.Po ./$(DEPDIR)/simple.Po
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
$(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
DIST_SOURCES = dict.c lpack.c overlap.c precomp.c precomp2.c simple.c
DIST_COMMON = Makefile.am Makefile.in
SOURCES = dict.c lpack.c overlap.c precomp.c precomp2.c simple.c
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu examples/Makefile
Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
clean-noinstPROGRAMS:
@list='$(noinst_PROGRAMS)'; for p in $$list; do \
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
echo " rm -f $$p $$f"; \
rm -f $$p $$f ; \
done
dict$(EXEEXT): $(dict_OBJECTS) $(dict_DEPENDENCIES)
@rm -f dict$(EXEEXT)
$(LINK) $(dict_LDFLAGS) $(dict_OBJECTS) $(dict_LDADD) $(LIBS)
lpack$(EXEEXT): $(lpack_OBJECTS) $(lpack_DEPENDENCIES)
@rm -f lpack$(EXEEXT)
$(LINK) $(lpack_LDFLAGS) $(lpack_OBJECTS) $(lpack_LDADD) $(LIBS)
overlap$(EXEEXT): $(overlap_OBJECTS) $(overlap_DEPENDENCIES)
@rm -f overlap$(EXEEXT)
$(LINK) $(overlap_LDFLAGS) $(overlap_OBJECTS) $(overlap_LDADD) $(LIBS)
precomp$(EXEEXT): $(precomp_OBJECTS) $(precomp_DEPENDENCIES)
@rm -f precomp$(EXEEXT)
$(LINK) $(precomp_LDFLAGS) $(precomp_OBJECTS) $(precomp_LDADD) $(LIBS)
precomp2$(EXEEXT): $(precomp2_OBJECTS) $(precomp2_DEPENDENCIES)
@rm -f precomp2$(EXEEXT)
$(LINK) $(precomp2_LDFLAGS) $(precomp2_OBJECTS) $(precomp2_LDADD) $(LIBS)
simple$(EXEEXT): $(simple_OBJECTS) $(simple_DEPENDENCIES)
@rm -f simple$(EXEEXT)
$(LINK) $(simple_LDFLAGS) $(simple_OBJECTS) $(simple_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT) core *.core
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dict.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lpack.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/overlap.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/precomp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/precomp2.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple.Po@am__quote@
distclean-depend:
-rm -rf ./$(DEPDIR)
.c.o:
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
.c.obj:
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(COMPILE) -c `cygpath -w $<`
.c.lo:
@AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
CCDEPMODE = @CCDEPMODE@
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
ETAGS = etags
ETAGSFLAGS =
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@list='$(DISTFILES)'; for file in $$list; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkinstalldirs) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS)
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
mostlyclean-am
distclean: distclean-am
distclean-am: clean-am distclean-compile distclean-depend \
distclean-generic distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
info: info-am
info-am:
install-data-am:
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
uninstall-am: uninstall-info-am
.PHONY: GTAGS all all-am check check-am clean clean-generic \
clean-libtool clean-noinstPROGRAMS distclean distclean-compile \
distclean-depend distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am info info-am install \
install-am install-data install-data-am install-exec \
install-exec-am install-info install-info-am install-man \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
tags uninstall uninstall-am uninstall-info-am
@liblzo@:
cd $(top_builddir)/src && $(MAKE) all
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
|
Added work/contrib/lzo/lzo-1.08/examples/dict.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
#! /bin/sh
# dict - temporary wrapper script for .libs/dict
# Generated by ltmain.sh - GNU libtool 1.4.2a (1.922.2.93 2002/05/06 15:02:58)
#
# The dict program cannot be directly executed until all the libtool
# libraries that it depends on are installed.
#
# This wrapper script should never be moved out of the build directory.
# If it is, it will not operate correctly.
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
Xsed=/usr/bin/sed' -e 1s/^X//'
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
if test "${CDPATH+set}" = set; then CDPATH=:; export CDPATH; fi
relink_command="(cd /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/examples; { test -z \"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { LIBRARY_PATH=; export LIBRARY_PATH; }; }; { test -z \"\${COMPILER_PATH+set}\" || unset COMPILER_PATH || { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z \"\${GCC_EXEC_PREFIX+set}\" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=; export GCC_EXEC_PREFIX; }; }; { test -z \"\${LD_RUN_PATH+set}\" || unset LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; { test -z \"\${LD_LIBRARY_PATH+set}\" || unset LD_LIBRARY_PATH || { LD_LIBRARY_PATH=; export LD_LIBRARY_PATH; }; }; PATH=\"/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/openwin/bin:/usr/games:/usr/local/jdk1.3.1_01/bin:/usr/local/mysql/bin:.\"; export PATH; gcc -O2 -Wall -Wcast-align -Wcast-qual -Wwrite-strings -fno-strength-reduce -fstrict-aliasing -o \$progdir/\$file dict.o ../src/.libs/liblzo.so -Wl,--rpath -Wl,/home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/src/.libs -Wl,--rpath -Wl,/usr/local/lib)"
# This environment variable determines our operation mode.
if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
# install mode needs the following variable:
notinst_deplibs=' ../src/liblzo.la'
else
# When we are sourced in execute mode, $file and $echo are already set.
if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
echo="echo"
file="$0"
# Make sure echo works.
if test "X$1" = X--no-reexec; then
# Discard the --no-reexec flag, and continue.
shift
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
# Yippee, $echo works!
:
else
# Restart under the correct shell, and then maybe $echo will work.
exec /bin/sh "$0" --no-reexec ${1+"$@"}
fi
fi
# Find the directory that this script lives in.
thisdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
test "x$thisdir" = "x$file" && thisdir=.
# Follow symbolic links until we get to the real thisdir.
file=`ls -ld "$file" | /usr/bin/sed -n 's/.*-> //p'`
while test -n "$file"; do
destdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
# If there was a directory component, then change thisdir.
if test "x$destdir" != "x$file"; then
case "$destdir" in
[\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;;
*) thisdir="$thisdir/$destdir" ;;
esac
fi
file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
file=`ls -ld "$thisdir/$file" | /usr/bin/sed -n 's/.*-> //p'`
done
# Try to get the absolute directory name.
absdir=`cd "$thisdir" && pwd`
test -n "$absdir" && thisdir="$absdir"
program=lt-'dict'
progdir="$thisdir/.libs"
if test ! -f "$progdir/$program" || \
{ file=`ls -1dt "$progdir/$program" "$progdir/../$program" 2>/dev/null | /usr/bin/sed 1q`; \
test "X$file" != "X$progdir/$program"; }; then
file="$$-$program"
if test ! -d "$progdir"; then
mkdir "$progdir"
else
rm -f "$progdir/$file"
fi
# relink executable if necessary
if test -n "$relink_command"; then
if relink_command_output=`eval $relink_command 2>&1`; then :
else
echo "$relink_command_output" >&2
rm -f "$progdir/$file"
exit 1
fi
fi
mv -f "$progdir/$file" "$progdir/$program" 2>/dev/null ||
{ rm -f "$progdir/$program";
mv -f "$progdir/$file" "$progdir/$program"; }
rm -f "$progdir/$file"
fi
if test -f "$progdir/$program"; then
if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
# Run the actual program with our arguments.
# Export the path to the program.
PATH="$progdir:$PATH"
export PATH
exec $program ${1+"$@"}
$echo "$0: cannot exec $program ${1+"$@"}"
exit 1
fi
else
# The program doesn't exist.
$echo "$0: error: $progdir/$program does not exist" 1>&2
$echo "This script is just a wrapper for $program." 1>&2
echo "See the libtool documentation for more information." 1>&2
exit 1
fi
fi
|
Added work/contrib/lzo/lzo-1.08/examples/dict.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
|
/* dict.c -- example program: how to use preset dictionaries
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/*************************************************************************
// This program shows how to use preset dictionaries.
//
// Please study LZO.FAQ and simple.c first.
**************************************************************************/
#include <lzo1x.h>
#include "lutil.h"
#include <time.h>
static const char *progname = NULL;
#define DICT_LEN 0xbfff
static lzo_byte dict [ DICT_LEN ];
static lzo_uint dict_len = 0;
static lzo_uint32 dict_adler32;
/*************************************************************************
//
**************************************************************************/
static lzo_uint total_n = 0;
static lzo_uint total_c_len = 0;
static lzo_uint total_d_len = 0;
static void print_file ( const char *name, lzo_uint d_len, lzo_uint c_len )
{
double perc;
perc = (d_len > 0) ? c_len * 100.0 / d_len : 0;
printf(" | %-30s %9ld -> %9ld %7.2f%% |\n",
name, (long) d_len, (long) c_len, perc);
total_n++;
total_c_len += c_len;
total_d_len += d_len;
}
/*************************************************************************
//
**************************************************************************/
int do_file ( const char *in_name, int level )
{
int r;
lzo_byte *in;
lzo_byte *out;
lzo_byte *newb;
lzo_byte *wrkmem;
lzo_uint in_len;
lzo_uint out_len;
lzo_uint new_len;
long l;
FILE *f;
/*
* Step 1: open the input file
*/
f = fopen(in_name,"rb");
if (f == 0)
{
printf("%s: cannot open file %s\n", progname, in_name);
return 0; /* no error */
}
fseek(f,0,SEEK_END);
l = ftell(f);
fseek(f,0,SEEK_SET);
if (l <= 0)
{
printf("%s: %s: empty file -- skipping\n", progname, in_name);
fclose(f);
return 0;
}
in_len = (lzo_uint) l;
/*
* Step 2: allocate compression buffers and read the file
*/
in = (lzo_bytep) lzo_malloc(in_len);
out = (lzo_bytep) lzo_malloc(in_len + in_len / 64 + 16 + 3);
newb = (lzo_bytep) lzo_malloc(in_len);
wrkmem = (lzo_bytep) lzo_malloc(LZO1X_999_MEM_COMPRESS);
if (in == NULL || out == NULL || newb == NULL || wrkmem == NULL)
{
printf("%s: out of memory\n", progname);
exit(1);
}
in_len = lzo_fread(f,in,in_len);
fclose(f);
/*
* Step 3: compress from `in' to `out' with LZO1X-999
*/
r = lzo1x_999_compress_level(in,in_len,out,&out_len,wrkmem,
dict, dict_len, 0, level);
if (r != LZO_E_OK)
{
/* this should NEVER happen */
printf("internal error - compression failed: %d\n", r);
return 1;
}
print_file(in_name,in_len,out_len);
/*
* Step 4: decompress again, now going from `out' to `newb'
*/
new_len = in_len;
r = lzo1x_decompress_dict_safe(out,out_len,newb,&new_len,NULL,dict,dict_len);
if (r != LZO_E_OK)
{
/* this should NEVER happen */
printf("internal error - decompression failed: %d\n", r);
return 1;
}
/*
* Step 5: verify decompression
*/
if (new_len != in_len || lzo_memcmp(in,newb,in_len) != 0)
{
/* this should NEVER happen */
printf("internal error - decompression data error\n");
return 1;
}
/* free buffers in reverse order to help malloc() */
lzo_free(wrkmem);
lzo_free(newb);
lzo_free(out);
lzo_free(in);
return 0;
}
/*************************************************************************
//
**************************************************************************/
int main(int argc, char *argv[])
{
int i = 1;
int r;
const char *dict_name;
FILE *f;
time_t t_total;
int level = 7;
#if defined(__EMX__)
_response(&argc,&argv);
_wildcard(&argc,&argv);
#endif
printf("\nLZO real-time data compression library (v%s, %s).\n",
lzo_version_string(), lzo_version_date());
printf("Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer\n\n");
progname = argv[0];
if (i < argc && argv[i][0] == '-' && isdigit(argv[i][1]))
level = atoi(&argv[i++][1]);
if (i + 1 >= argc || level < 1 || level > 9)
{
printf("usage: %s [-level] [ dictionary-file | -n ] file...\n", progname);
exit(1);
}
printf("Compression level is LZO1X-999/%d\n", level);
/*
* Step 1: initialize the LZO library
*/
if (lzo_init() != LZO_E_OK)
{
printf("lzo_init() failed !!!\n");
exit(1);
}
/*
* Step 2: prepare the dictionary
*/
dict_name = argv[i++];
if (strcmp(dict_name,"-n") == 0)
{
dict_name = "empty";
dict_len = 0;
}
else
{
f = fopen(dict_name,"rb");
if (!f)
{
printf("%s: cannot open dictionary file %s\n", progname, dict_name);
exit(1);
}
dict_len = lzo_fread(f,dict,DICT_LEN);
fclose(f);
}
dict_adler32 = lzo_adler32(0,NULL,0);
dict_adler32 = lzo_adler32(dict_adler32,dict,dict_len);
printf("Using dictionary '%s', %ld bytes, ID 0x%08lx.\n",
dict_name, (long) dict_len, (long) dict_adler32);
/*
* Step 3: process files
*/
t_total = time(NULL);
for (r = 0; r == 0 && i < argc; i++)
r = do_file(argv[i], level);
t_total = time(NULL) - t_total;
if (total_n > 1)
print_file("***TOTALS***",total_d_len,total_c_len);
printf("Dictionary compression test %s, execution time %lu seconds.\n",
r == 0 ? "passed" : "FAILED", (long) t_total);
return r;
}
/*
vi:ts=4
*/
|
Added work/contrib/lzo/lzo-1.08/examples/lpack.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
#! /bin/sh
# lpack - temporary wrapper script for .libs/lpack
# Generated by ltmain.sh - GNU libtool 1.4.2a (1.922.2.93 2002/05/06 15:02:58)
#
# The lpack program cannot be directly executed until all the libtool
# libraries that it depends on are installed.
#
# This wrapper script should never be moved out of the build directory.
# If it is, it will not operate correctly.
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
Xsed=/usr/bin/sed' -e 1s/^X//'
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
if test "${CDPATH+set}" = set; then CDPATH=:; export CDPATH; fi
relink_command="(cd /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/examples; { test -z \"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { LIBRARY_PATH=; export LIBRARY_PATH; }; }; { test -z \"\${COMPILER_PATH+set}\" || unset COMPILER_PATH || { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z \"\${GCC_EXEC_PREFIX+set}\" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=; export GCC_EXEC_PREFIX; }; }; { test -z \"\${LD_RUN_PATH+set}\" || unset LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; { test -z \"\${LD_LIBRARY_PATH+set}\" || unset LD_LIBRARY_PATH || { LD_LIBRARY_PATH=; export LD_LIBRARY_PATH; }; }; PATH=\"/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/openwin/bin:/usr/games:/usr/local/jdk1.3.1_01/bin:/usr/local/mysql/bin:.\"; export PATH; gcc -O2 -Wall -Wcast-align -Wcast-qual -Wwrite-strings -fno-strength-reduce -fstrict-aliasing -o \$progdir/\$file lpack.o ../src/.libs/liblzo.so -Wl,--rpath -Wl,/home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/src/.libs -Wl,--rpath -Wl,/usr/local/lib)"
# This environment variable determines our operation mode.
if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
# install mode needs the following variable:
notinst_deplibs=' ../src/liblzo.la'
else
# When we are sourced in execute mode, $file and $echo are already set.
if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
echo="echo"
file="$0"
# Make sure echo works.
if test "X$1" = X--no-reexec; then
# Discard the --no-reexec flag, and continue.
shift
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
# Yippee, $echo works!
:
else
# Restart under the correct shell, and then maybe $echo will work.
exec /bin/sh "$0" --no-reexec ${1+"$@"}
fi
fi
# Find the directory that this script lives in.
thisdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
test "x$thisdir" = "x$file" && thisdir=.
# Follow symbolic links until we get to the real thisdir.
file=`ls -ld "$file" | /usr/bin/sed -n 's/.*-> //p'`
while test -n "$file"; do
destdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
# If there was a directory component, then change thisdir.
if test "x$destdir" != "x$file"; then
case "$destdir" in
[\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;;
*) thisdir="$thisdir/$destdir" ;;
esac
fi
file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
file=`ls -ld "$thisdir/$file" | /usr/bin/sed -n 's/.*-> //p'`
done
# Try to get the absolute directory name.
absdir=`cd "$thisdir" && pwd`
test -n "$absdir" && thisdir="$absdir"
program=lt-'lpack'
progdir="$thisdir/.libs"
if test ! -f "$progdir/$program" || \
{ file=`ls -1dt "$progdir/$program" "$progdir/../$program" 2>/dev/null | /usr/bin/sed 1q`; \
test "X$file" != "X$progdir/$program"; }; then
file="$$-$program"
if test ! -d "$progdir"; then
mkdir "$progdir"
else
rm -f "$progdir/$file"
fi
# relink executable if necessary
if test -n "$relink_command"; then
if relink_command_output=`eval $relink_command 2>&1`; then :
else
echo "$relink_command_output" >&2
rm -f "$progdir/$file"
exit 1
fi
fi
mv -f "$progdir/$file" "$progdir/$program" 2>/dev/null ||
{ rm -f "$progdir/$program";
mv -f "$progdir/$file" "$progdir/$program"; }
rm -f "$progdir/$file"
fi
if test -f "$progdir/$program"; then
if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
# Run the actual program with our arguments.
# Export the path to the program.
PATH="$progdir:$PATH"
export PATH
exec $program ${1+"$@"}
$echo "$0: cannot exec $program ${1+"$@"}"
exit 1
fi
else
# The program doesn't exist.
$echo "$0: error: $progdir/$program does not exist" 1>&2
$echo "This script is just a wrapper for $program." 1>&2
echo "See the libtool documentation for more information." 1>&2
exit 1
fi
fi
|
Added work/contrib/lzo/lzo-1.08/examples/lpack.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
|
/* lpack.c -- LZO example program: a simple file packer
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/*************************************************************************
// NOTE: this is an example program, so do not use to backup your data
//
// This program lacks things like sophisticated file handling but is
// pretty complete regarding compression - it should provide a good
// starting point for adaption for you applications.
//
// Please study LZO.FAQ and simple.c first.
**************************************************************************/
#include <lzo1x.h>
#include "lutil.h"
static const char *progname = NULL;
static unsigned long total_in = 0;
static unsigned long total_out = 0;
static lzo_bool debug = 0;
/* magic file header for lpack-compressed files */
static const unsigned char magic[7] =
{ 0x00, 0xe9, 0x4c, 0x5a, 0x4f, 0xff, 0x1a };
/*************************************************************************
// file IO
**************************************************************************/
lzo_uint xread(FILE *f, lzo_voidp buf, lzo_uint len, lzo_bool allow_eof)
{
lzo_uint l;
l = lzo_fread(f,buf,len);
if (l > len)
{
fprintf(stderr,"\nsomething's wrong with your C library !!!\n");
exit(1);
}
if (l != len && !allow_eof)
{
fprintf(stderr,"\nread error - premature end of file\n");
exit(1);
}
total_in += l;
return l;
}
lzo_uint xwrite(FILE *f, const lzo_voidp buf, lzo_uint len)
{
if (f != NULL && lzo_fwrite(f,buf,len) != len)
{
fprintf(stderr,"\nwrite error (disk full ?)\n");
exit(1);
}
total_out += len;
return len;
}
int xgetc(FILE *f)
{
unsigned char c;
xread(f,(lzo_bytep) &c,1,0);
return c;
}
void xputc(FILE *f, int c)
{
unsigned char cc = (unsigned char) c;
xwrite(f,(lzo_bytep) &cc,1);
}
/* read and write portable 32-bit integers */
lzo_uint32 xread32(FILE *f)
{
unsigned char b[4];
lzo_uint32 v;
xread(f,b,4,0);
v = (lzo_uint32) b[3] << 0;
v |= (lzo_uint32) b[2] << 8;
v |= (lzo_uint32) b[1] << 16;
v |= (lzo_uint32) b[0] << 24;
return v;
}
void xwrite32(FILE *f, lzo_uint32 v)
{
unsigned char b[4];
b[3] = (unsigned char) (v >> 0);
b[2] = (unsigned char) (v >> 8);
b[1] = (unsigned char) (v >> 16);
b[0] = (unsigned char) (v >> 24);
xwrite(f,b,4);
}
/*************************************************************************
// compress
//
// possible improvement: we could use overlapping compression to
// save some memory - see overlap.c. This would require some minor
// changes in the decompression code as well, because if a block
// turns out to be incompressible we would still have to store it in its
// compressed (slightly enlarged) form because the original (uncompressed)
// data would have been lost during the overlapping compression.
**************************************************************************/
int do_compress(FILE *fi, FILE *fo, int level, lzo_uint block_size)
{
int r = 0;
lzo_byte *in = NULL;
lzo_byte *out = NULL;
lzo_byte *wrkmem = NULL;
lzo_uint in_len;
lzo_uint out_len;
lzo_uint32 wrk_len = 0;
lzo_uint32 flags = 1;
int method = 0x1;
lzo_uint32 checksum;
total_in = total_out = 0;
/*
* Step 1: write magic header, flags & block size, init checksum
*/
xwrite(fo,magic,sizeof(magic));
xwrite32(fo,flags);
xputc(fo,method); /* compression method */
xputc(fo,level); /* compression level */
xwrite32(fo,block_size);
checksum = lzo_adler32(0,NULL,0);
/*
* Step 2: allocate compression buffers and work-memory
*/
in = (lzo_bytep) lzo_malloc(block_size);
out = (lzo_bytep) lzo_malloc(block_size + block_size / 64 + 16 + 3);
#if !defined(LZO_999_UNSUPPORTED)
if (level == 9)
wrk_len = LZO1X_999_MEM_COMPRESS;
else
#endif
wrk_len = LZO1X_1_MEM_COMPRESS;
wrkmem = (lzo_bytep) lzo_malloc(wrk_len);
if (in == NULL || out == NULL || wrkmem == NULL)
{
printf("%s: out of memory\n", progname);
r = 1;
goto err;
}
/*
* Step 3: process blocks
*/
for (;;)
{
/* read block */
in_len = xread(fi,in,block_size,1);
if (in_len <= 0)
break;
/* update checksum */
checksum = lzo_adler32(checksum,in,in_len);
/* clear wrkmem (not needed, only for debug purposes) */
if (debug)
lzo_memset(wrkmem,0xff,wrk_len);
/* compress block */
#if !defined(LZO_999_UNSUPPORTED)
if (level == 9)
r = lzo1x_999_compress(in,in_len,out,&out_len,wrkmem);
else
#endif
r = lzo1x_1_compress(in,in_len,out,&out_len,wrkmem);
if (r != LZO_E_OK || out_len > in_len + in_len / 64 + 16 + 3)
{
/* this should NEVER happen */
printf("internal error - compression failed: %d\n", r);
r = 2;
goto err;
}
/* write uncompressed block size */
xwrite32(fo,in_len);
if (out_len < in_len)
{
/* write compressed block */
xwrite32(fo,out_len);
xwrite(fo,out,out_len);
}
else
{
/* not compressible - write uncompressed block */
xwrite32(fo,in_len);
xwrite(fo,in,in_len);
}
}
/* write EOF marker */
xwrite32(fo,0);
/* write checksum */
xwrite32(fo,checksum);
r = 0;
err:
lzo_free(wrkmem);
lzo_free(out);
lzo_free(in);
return r;
}
/*************************************************************************
// decompress / test
//
// We are using overlapping (in-place) decompression to save some
// memory - see overlap.c.
**************************************************************************/
int do_decompress(FILE *fi, FILE *fo)
{
int r = 0;
lzo_byte *buf = NULL;
lzo_uint buf_len;
unsigned char m [ sizeof(magic) ];
lzo_uint32 flags;
int method;
int level;
lzo_uint block_size;
lzo_uint32 checksum;
total_in = total_out = 0;
/*
* Step 1: check magic header, read flags & block size, init checksum
*/
if (xread(fi,m,sizeof(magic),1) != sizeof(magic) ||
memcmp(m,magic,sizeof(magic)) != 0)
{
printf("%s: header error - this file is not compressed by lpack\n", progname);
r = 1;
goto err;
}
flags = xread32(fi);
method = xgetc(fi);
level = xgetc(fi);
if (method != 1)
{
printf("%s: header error - invalid method %d (level %d)\n",
progname, method, level);
r = 2;
goto err;
}
block_size = xread32(fi);
if (block_size < 1024 || block_size > 1024*1024L)
{
printf("%s: header error - invalid block size %ld\n",
progname, (long) block_size);
r = 3;
goto err;
}
checksum = lzo_adler32(0,NULL,0);
/*
* Step 2: allocate buffer for in-place decompression
*/
buf_len = block_size + block_size / 64 + 16 + 3;
buf = (lzo_bytep) lzo_malloc(buf_len);
if (buf == NULL)
{
printf("%s: out of memory\n", progname);
r = 4;
goto err;
}
/*
* Step 3: process blocks
*/
for (;;)
{
lzo_byte *in;
lzo_byte *out;
lzo_uint in_len;
lzo_uint out_len;
/* read uncompressed size */
out_len = xread32(fi);
/* exit if last block (EOF marker) */
if (out_len == 0)
break;
/* read compressed size */
in_len = xread32(fi);
/* sanity check of the size values */
if (in_len > block_size || out_len > block_size ||
in_len == 0 || in_len > out_len)
{
printf("%s: block size error - data corrupted\n", progname);
r = 5;
goto err;
}
/* place compressed block at the top of the buffer */
in = buf + buf_len - in_len;
out = buf;
/* read compressed block data */
xread(fi,in,in_len,0);
if (in_len < out_len)
{
/* decompress - use safe decompressor as data might be corrupted
* during a file transfer */
lzo_uint new_len = out_len;
r = lzo1x_decompress_safe(in,in_len,out,&new_len,NULL);
if (r != LZO_E_OK || new_len != out_len)
{
printf("%s: compressed data violation\n", progname);
r = 6;
goto err;
}
/* write decompressed block */
xwrite(fo,out,out_len);
/* update checksum */
if (flags & 1)
checksum = lzo_adler32(checksum,out,out_len);
}
else
{
/* write original (incompressible) block */
xwrite(fo,in,in_len);
/* update checksum */
if (flags & 1)
checksum = lzo_adler32(checksum,in,in_len);
}
}
/* read and verify checksum */
if (flags & 1)
{
lzo_uint32 c = xread32(fi);
if (c != checksum)
{
printf("%s: checksum error - data corrupted\n", progname);
r = 7;
goto err;
}
}
r = 0;
err:
lzo_free(buf);
return r;
}
/*************************************************************************
//
**************************************************************************/
static void usage(void)
{
printf("usage: %s [-9] input-file output-file (compress)\n", progname);
printf("usage: %s -d input-file output-file (decompress)\n", progname);
printf("usage: %s -t input-file... (test)\n", progname);
exit(1);
}
/* open input file */
static FILE *xopen_fi(const char *name)
{
FILE *f;
f = fopen(name,"rb");
if (f == NULL)
{
printf("%s: cannot open input file %s\n", progname, name);
exit(1);
}
#if defined(HAVE_STAT) && defined(S_ISREG)
{
struct stat st;
#if defined(HAVE_LSTAT)
if (lstat(name,&st) != 0 || !S_ISREG(st.st_mode))
#else
if (stat(name,&st) != 0 || !S_ISREG(st.st_mode))
#endif
{
printf("%s: %s is not a regular file\n", progname, name);
fclose(f);
exit(1);
}
}
#endif
return f;
}
/* open output file */
static FILE *xopen_fo(const char *name)
{
FILE *f;
#if 1
/* this is an example program, so make sure we don't overwrite a file */
f = fopen(name,"rb");
if (f != NULL)
{
printf("%s: file %s already exists -- not overwritten\n", progname, name);
fclose(f);
exit(1);
}
#endif
f = fopen(name,"wb");
if (f == NULL)
{
printf("%s: cannot open output file %s\n", progname, name);
exit(1);
}
return f;
}
/*************************************************************************
//
**************************************************************************/
int main(int argc, char *argv[])
{
int i = 1;
int r = 0;
FILE *fi = NULL;
FILE *fo = NULL;
const char *in_name = NULL;
const char *out_name = NULL;
lzo_bool opt_decompress = 0;
lzo_bool opt_test = 0;
int opt_level = 1;
lzo_uint opt_block_size = (256*1024L);
#if defined(__EMX__)
_response(&argc,&argv);
_wildcard(&argc,&argv);
#endif
printf("\nLZO real-time data compression library (v%s, %s).\n",
lzo_version_string(), lzo_version_date());
printf("Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer\n\n");
printf(
"*** DISCLAIMER ***\n"
" This is an example program, do not use to backup your data !\n"
" Get LZOP if you're interested into a full-featured packer.\n"
" See http://www.oberhumer.com/opensource/lzop/\n"
"\n");
progname = argv[0];
while (i < argc && argv[i][0] == '-')
{
if (strcmp(argv[i],"-d") == 0)
opt_decompress = 1;
else if (strcmp(argv[i],"-t") == 0)
opt_test = 1;
#if !defined(LZO_999_UNSUPPORTED)
else if (strcmp(argv[i],"-9") == 0)
opt_level = 9;
#endif
else if (argv[i][1] == 'b' && argv[i][2])
{
#if (LZO_UINT_MAX > UINT_MAX) && defined(HAVE_ATOL)
lzo_int b = atol(&argv[i][2]);
#else
lzo_int b = atoi(&argv[i][2]);
#endif
if (b >= 1024L && b <= 1024*1024L)
opt_block_size = b;
}
else if (strcmp(argv[i],"--debug") == 0)
debug = 1;
else
usage();
i++;
}
if (opt_test && i >= argc)
usage();
if (!opt_test && i + 2 != argc)
usage();
/*
* Step 1: initialize the LZO library
*/
if (lzo_init() != LZO_E_OK)
{
printf("lzo_init() failed !!!\n");
exit(1);
}
/*
* Step 2: process file
*/
if (opt_test)
{
while (i < argc && r == 0)
{
in_name = argv[i++];
fi = xopen_fi(in_name);
r = do_decompress(fi,NULL);
if (r == 0)
printf("%s: %s tested ok (%ld -> %ld bytes)\n",
progname, in_name, total_in, total_out);
fclose(fi);
fi = NULL;
}
}
else if (opt_decompress)
{
in_name = argv[i++];
out_name = argv[i++];
fi = xopen_fi(in_name);
fo = xopen_fo(out_name);
r = do_decompress(fi,fo);
if (r == 0)
printf("%s: decompressed %ld into %ld bytes\n",
progname, total_in, total_out);
}
else
{
in_name = argv[i++];
out_name = argv[i++];
fi = xopen_fi(in_name);
fo = xopen_fo(out_name);
r = do_compress(fi,fo,opt_level,opt_block_size);
if (r == 0)
printf("%s: compressed %ld into %ld bytes\n",
progname, total_in, total_out);
}
if (fi) fclose(fi);
if (fo) fclose(fo);
return r;
}
/*
vi:ts=4
*/
|
Added work/contrib/lzo/lzo-1.08/examples/lutil.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
/* lutil.h -- utilities
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include <lzoconf.h>
#include <stdio.h>
#include <stddef.h>
#if !defined(NO_STDLIB_H)
# include <stdlib.h>
#endif
#include <string.h>
#include <ctype.h>
#if defined(HAVE_UNISTD_H) || defined(__DJGPP__) || defined(__EMX__)
# include <unistd.h>
#elif defined(__CYGWIN__) || defined(__CYGWIN32__) || defined(__MINGW32__)
# include <unistd.h>
#endif
#if defined(HAVE_STAT)
# include <sys/types.h>
# include <sys/stat.h>
#endif
/* allow the example programs to work with previous versions */
#if (LZO_VERSION < 0x1030)
# define LZO1X_1_MEM_COMPRESS LZO1X_MEM_COMPRESS
# define lzo_malloc(s) ((lzo_byte *) malloc(s))
# define lzo_free(p) ((p) ? (void)free(p) : (void)0)
#endif
#if (LZO_VERSION < 0x1030)
# define lzo_fread(f,b,s) (fread(b,1,s,f))
# define lzo_fwrite(f,b,s) (fwrite(b,1,s,f))
#else
# include <lzoutil.h>
#endif
/* some systems have a xmalloc in their C library... */
#undef xmalloc
#undef xfree
#undef xread
#undef xwrite
#undef xputc
#undef xgetc
#undef xread32
#undef xwrite32
#define xmalloc my_xmalloc
#define xfree my_xfree
#define HEAP_ALLOC(var,size) \
lzo_align_t __LZO_MMODEL var [ ((size) + (sizeof(lzo_align_t) - 1)) / sizeof(lzo_align_t) ]
/*
vi:ts=4
*/
|
Added work/contrib/lzo/lzo-1.08/examples/overlap.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
#! /bin/sh
# overlap - temporary wrapper script for .libs/overlap
# Generated by ltmain.sh - GNU libtool 1.4.2a (1.922.2.93 2002/05/06 15:02:58)
#
# The overlap program cannot be directly executed until all the libtool
# libraries that it depends on are installed.
#
# This wrapper script should never be moved out of the build directory.
# If it is, it will not operate correctly.
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
Xsed=/usr/bin/sed' -e 1s/^X//'
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
if test "${CDPATH+set}" = set; then CDPATH=:; export CDPATH; fi
relink_command="(cd /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/examples; { test -z \"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { LIBRARY_PATH=; export LIBRARY_PATH; }; }; { test -z \"\${COMPILER_PATH+set}\" || unset COMPILER_PATH || { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z \"\${GCC_EXEC_PREFIX+set}\" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=; export GCC_EXEC_PREFIX; }; }; { test -z \"\${LD_RUN_PATH+set}\" || unset LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; { test -z \"\${LD_LIBRARY_PATH+set}\" || unset LD_LIBRARY_PATH || { LD_LIBRARY_PATH=; export LD_LIBRARY_PATH; }; }; PATH=\"/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/openwin/bin:/usr/games:/usr/local/jdk1.3.1_01/bin:/usr/local/mysql/bin:.\"; export PATH; gcc -O2 -Wall -Wcast-align -Wcast-qual -Wwrite-strings -fno-strength-reduce -fstrict-aliasing -o \$progdir/\$file overlap.o ../src/.libs/liblzo.so -Wl,--rpath -Wl,/home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/src/.libs -Wl,--rpath -Wl,/usr/local/lib)"
# This environment variable determines our operation mode.
if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
# install mode needs the following variable:
notinst_deplibs=' ../src/liblzo.la'
else
# When we are sourced in execute mode, $file and $echo are already set.
if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
echo="echo"
file="$0"
# Make sure echo works.
if test "X$1" = X--no-reexec; then
# Discard the --no-reexec flag, and continue.
shift
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
# Yippee, $echo works!
:
else
# Restart under the correct shell, and then maybe $echo will work.
exec /bin/sh "$0" --no-reexec ${1+"$@"}
fi
fi
# Find the directory that this script lives in.
thisdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
test "x$thisdir" = "x$file" && thisdir=.
# Follow symbolic links until we get to the real thisdir.
file=`ls -ld "$file" | /usr/bin/sed -n 's/.*-> //p'`
while test -n "$file"; do
destdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
# If there was a directory component, then change thisdir.
if test "x$destdir" != "x$file"; then
case "$destdir" in
[\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;;
*) thisdir="$thisdir/$destdir" ;;
esac
fi
file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
file=`ls -ld "$thisdir/$file" | /usr/bin/sed -n 's/.*-> //p'`
done
# Try to get the absolute directory name.
absdir=`cd "$thisdir" && pwd`
test -n "$absdir" && thisdir="$absdir"
program=lt-'overlap'
progdir="$thisdir/.libs"
if test ! -f "$progdir/$program" || \
{ file=`ls -1dt "$progdir/$program" "$progdir/../$program" 2>/dev/null | /usr/bin/sed 1q`; \
test "X$file" != "X$progdir/$program"; }; then
file="$$-$program"
if test ! -d "$progdir"; then
mkdir "$progdir"
else
rm -f "$progdir/$file"
fi
# relink executable if necessary
if test -n "$relink_command"; then
if relink_command_output=`eval $relink_command 2>&1`; then :
else
echo "$relink_command_output" >&2
rm -f "$progdir/$file"
exit 1
fi
fi
mv -f "$progdir/$file" "$progdir/$program" 2>/dev/null ||
{ rm -f "$progdir/$program";
mv -f "$progdir/$file" "$progdir/$program"; }
rm -f "$progdir/$file"
fi
if test -f "$progdir/$program"; then
if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
# Run the actual program with our arguments.
# Export the path to the program.
PATH="$progdir:$PATH"
export PATH
exec $program ${1+"$@"}
$echo "$0: cannot exec $program ${1+"$@"}"
exit 1
fi
else
# The program doesn't exist.
$echo "$0: error: $progdir/$program does not exist" 1>&2
$echo "This script is just a wrapper for $program." 1>&2
echo "See the libtool documentation for more information." 1>&2
exit 1
fi
fi
|
Added work/contrib/lzo/lzo-1.08/examples/overlap.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
|
/* overlap.c -- example program: overlapping (de)compression
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/*************************************************************************
// This program shows how to do overlapping compression and
// in-place decompression.
//
// Please study LZO.FAQ and simple.c first.
**************************************************************************/
#include <lzo1x.h>
#include "lutil.h"
/* Overhead (in bytes) for the in-place decompression buffer.
* Most files need only 16 !
* (try `overlap -16 file' or even `overlap -8 file')
*
* Worst case (for files that are compressible by only a few bytes)
* is 'in_len / 64 + 16 + 3'. See step 5a) below.
*
* For overlapping compression '0xbfff + in_len / 64 + 16 + 3' bytes
* will be needed. See step 4a) below.
*/
static lzo_uint opt_overhead = 0; /* assume worst case */
#if 0 && defined(__GNUC__) && defined(__i386__)
/* used for test purposes only */
LZO_EXTERN_CDECL(int)
lzo1x_decompress_asm_fast ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ )
__asm__("_lzo1x_decompress_asm_fast");
#endif
/*************************************************************************
//
**************************************************************************/
static const char *progname = NULL;
static unsigned long total_files = 0;
static unsigned long total_in = 0;
static lzo_byte *xmalloc(lzo_uint len)
{
lzo_byte *p;
p = (lzo_bytep) lzo_malloc(len > 0 ? len : 1);
if (p == NULL)
{
printf("%s: out of memory\n", progname);
exit(1);
}
return p;
}
/*************************************************************************
//
**************************************************************************/
int do_file ( const char *in_name )
{
int r;
FILE *f = NULL;
long l;
lzo_byte *wrkmem = NULL;
lzo_byte *in = NULL;
lzo_uint in_len; /* uncompressed length */
lzo_byte *out = NULL;
lzo_uint out_len; /* compressed length */
lzo_byte *overlap = NULL;
lzo_uint overhead;
lzo_uint offset;
lzo_uint new_len = 0;
/*
* Step 1: open the input file
*/
f = fopen(in_name,"rb");
if (f == NULL)
{
printf("%s: %s: cannot open file\n", progname, in_name);
goto next_file;
}
fseek(f,0,SEEK_END);
l = ftell(f);
fseek(f,0,SEEK_SET);
if (l <= 0)
{
printf("%s: %s: empty file -- skipping\n", progname, in_name);
goto next_file;
}
in_len = (lzo_uint) l;
/*
* Step 2: allocate compression buffers and read the file
*/
in = xmalloc(in_len);
out = xmalloc(in_len + in_len / 64 + 16 + 3);
wrkmem = xmalloc(LZO1X_1_MEM_COMPRESS);
in_len = lzo_fread(f,in,in_len);
fclose(f); f = NULL;
printf("%s: %s: read %ld bytes\n", progname, in_name, (long) in_len);
total_files++;
total_in += in_len;
/*
* Step 3: compress from `in' to `out' with LZO1X-1
*/
r = lzo1x_1_compress(in,in_len,out,&out_len,wrkmem);
if (r != LZO_E_OK || out_len > in_len + in_len / 64 + 16 + 3)
{
/* this should NEVER happen */
printf("internal error - compression failed: %d\n", r);
exit(1);
}
printf("%-26s %8lu -> %8lu\n", "LZO1X-1:", (long) in_len, (long) out_len);
/***** Step 4: overlapping compression *****/
/*
* Step 4a: allocate the `overlap' buffer for overlapping compression
*/
overhead = in_len > 0xbfff ? 0xbfff : in_len;
overhead += in_len / 64 + 16 + 3;
overlap = xmalloc(in_len + overhead);
/*
* Step 4b: prepare data in `overlap' buffer.
* copy uncompressed data at the top of the overlap buffer
*/
/*** offset = in_len + overhead - in_len; ***/
offset = overhead;
lzo_memcpy(overlap + offset, in, in_len);
/*
* Step 4c: do an in-place compression within the `overlap' buffer
*/
r = lzo1x_1_compress(overlap+offset,in_len,overlap,&new_len,wrkmem);
if (r != LZO_E_OK)
{
/* this should NEVER happen */
printf("overlapping compression failed: %d\n", r);
exit(1);
}
/*
* Step 4d: verify overlapping compression
*/
if (new_len != out_len || lzo_memcmp(out,overlap,out_len) != 0)
{
/* As compression is non-deterministic there can be a difference
* in the representation of the compressed data (but this usually
* happens very seldom). So we have to verify the overlapping
* compression by doing a temporary decompression.
*/
lzo_uint l = in_len;
lzo_byte *tmp = xmalloc(l);
r = lzo1x_decompress_safe(overlap,new_len,tmp,&l,NULL);
if (r != LZO_E_OK || l != in_len || lzo_memcmp(in,tmp,l) != 0)
{
/* this should NEVER happen */
printf("overlapping compression data error\n");
exit(1);
}
lzo_free(tmp);
}
printf("overlapping compression: %8lu -> %8lu overhead: %7ld\n",
(long) in_len, (long) new_len, (long) overhead);
lzo_free(overlap); overlap = NULL;
/***** Step 5: overlapping decompression *****/
/*
* Step 5a: allocate the `overlap' buffer for in-place decompression
*/
if (opt_overhead == 0 || out_len >= in_len)
overhead = in_len / 64 + 16 + 3;
else
overhead = opt_overhead;
overlap = xmalloc(in_len + overhead);
/*
* Step 5b: prepare data in `overlap' buffer.
* copy compressed data at the top of the overlap buffer
*/
offset = in_len + overhead - out_len;
lzo_memcpy(overlap + offset, out, out_len);
/*
* Step 5c: do an in-place decompression within the `overlap' buffer
*/
new_len = in_len;
#if 1
r = lzo1x_decompress(overlap+offset,out_len,overlap,&new_len,NULL);
#else
r = lzo1x_decompress_asm_fast(overlap+offset,out_len,overlap,&new_len,NULL);
#endif
if (r != LZO_E_OK)
{
/* this may happen if overhead is too small */
printf("overlapping decompression failed: %d - increase `opt_overhead'\n", r);
exit(1);
}
/*
* Step 5d: verify decompression
*/
if (new_len != in_len || lzo_memcmp(in,overlap,in_len) != 0)
{
/* this may happen if overhead is too small */
printf("overlapping decompression data error - increase `opt_overhead'\n");
exit(1);
}
printf("overlapping decompression: %8lu -> %8lu overhead: %7ld\n",
(long) out_len, (long) new_len, (long) overhead);
lzo_free(overlap); overlap = NULL;
next_file:
lzo_free(overlap);
lzo_free(wrkmem);
lzo_free(out);
lzo_free(in);
if (f) fclose(f);
return 0;
}
/*************************************************************************
//
**************************************************************************/
int main(int argc, char *argv[])
{
int r;
int i = 1;
#if defined(__EMX__)
_response(&argc,&argv);
_wildcard(&argc,&argv);
#endif
printf("\nLZO real-time data compression library (v%s, %s).\n",
lzo_version_string(), lzo_version_date());
printf("Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer\n\n");
progname = argv[0];
if (i < argc && argv[i][0] == '-')
opt_overhead = atoi(&argv[i++][1]);
#if 1
if (opt_overhead != 0 && opt_overhead < 8)
{
printf("%s: invalid overhead value %ld\n", progname, (long)opt_overhead);
exit(1);
}
#endif
if (i >= argc)
{
printf("usage: %s [-overhead_in_bytes] file..\n", progname);
exit(1);
}
/*
* Step 1: initialize the LZO library
*/
if (lzo_init() != LZO_E_OK)
{
printf("lzo_init() failed !!!\n");
exit(1);
}
/*
* Step 2: process files
*/
for (r = 0; r == 0 && i < argc; i++)
r = do_file(argv[i]);
printf("\nDone. Successfully processed %lu bytes in %lu files.\n",
total_in, total_files);
return r;
}
/*
vi:ts=4
*/
|
Added work/contrib/lzo/lzo-1.08/examples/precomp.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
#! /bin/sh
# precomp - temporary wrapper script for .libs/precomp
# Generated by ltmain.sh - GNU libtool 1.4.2a (1.922.2.93 2002/05/06 15:02:58)
#
# The precomp program cannot be directly executed until all the libtool
# libraries that it depends on are installed.
#
# This wrapper script should never be moved out of the build directory.
# If it is, it will not operate correctly.
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
Xsed=/usr/bin/sed' -e 1s/^X//'
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
if test "${CDPATH+set}" = set; then CDPATH=:; export CDPATH; fi
relink_command="(cd /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/examples; { test -z \"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { LIBRARY_PATH=; export LIBRARY_PATH; }; }; { test -z \"\${COMPILER_PATH+set}\" || unset COMPILER_PATH || { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z \"\${GCC_EXEC_PREFIX+set}\" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=; export GCC_EXEC_PREFIX; }; }; { test -z \"\${LD_RUN_PATH+set}\" || unset LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; { test -z \"\${LD_LIBRARY_PATH+set}\" || unset LD_LIBRARY_PATH || { LD_LIBRARY_PATH=; export LD_LIBRARY_PATH; }; }; PATH=\"/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/openwin/bin:/usr/games:/usr/local/jdk1.3.1_01/bin:/usr/local/mysql/bin:.\"; export PATH; gcc -O2 -Wall -Wcast-align -Wcast-qual -Wwrite-strings -fno-strength-reduce -fstrict-aliasing -o \$progdir/\$file precomp.o ../src/.libs/liblzo.so -Wl,--rpath -Wl,/home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/src/.libs -Wl,--rpath -Wl,/usr/local/lib)"
# This environment variable determines our operation mode.
if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
# install mode needs the following variable:
notinst_deplibs=' ../src/liblzo.la'
else
# When we are sourced in execute mode, $file and $echo are already set.
if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
echo="echo"
file="$0"
# Make sure echo works.
if test "X$1" = X--no-reexec; then
# Discard the --no-reexec flag, and continue.
shift
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
# Yippee, $echo works!
:
else
# Restart under the correct shell, and then maybe $echo will work.
exec /bin/sh "$0" --no-reexec ${1+"$@"}
fi
fi
# Find the directory that this script lives in.
thisdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
test "x$thisdir" = "x$file" && thisdir=.
# Follow symbolic links until we get to the real thisdir.
file=`ls -ld "$file" | /usr/bin/sed -n 's/.*-> //p'`
while test -n "$file"; do
destdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
# If there was a directory component, then change thisdir.
if test "x$destdir" != "x$file"; then
case "$destdir" in
[\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;;
*) thisdir="$thisdir/$destdir" ;;
esac
fi
file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
file=`ls -ld "$thisdir/$file" | /usr/bin/sed -n 's/.*-> //p'`
done
# Try to get the absolute directory name.
absdir=`cd "$thisdir" && pwd`
test -n "$absdir" && thisdir="$absdir"
program=lt-'precomp'
progdir="$thisdir/.libs"
if test ! -f "$progdir/$program" || \
{ file=`ls -1dt "$progdir/$program" "$progdir/../$program" 2>/dev/null | /usr/bin/sed 1q`; \
test "X$file" != "X$progdir/$program"; }; then
file="$$-$program"
if test ! -d "$progdir"; then
mkdir "$progdir"
else
rm -f "$progdir/$file"
fi
# relink executable if necessary
if test -n "$relink_command"; then
if relink_command_output=`eval $relink_command 2>&1`; then :
else
echo "$relink_command_output" >&2
rm -f "$progdir/$file"
exit 1
fi
fi
mv -f "$progdir/$file" "$progdir/$program" 2>/dev/null ||
{ rm -f "$progdir/$program";
mv -f "$progdir/$file" "$progdir/$program"; }
rm -f "$progdir/$file"
fi
if test -f "$progdir/$program"; then
if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
# Run the actual program with our arguments.
# Export the path to the program.
PATH="$progdir:$PATH"
export PATH
exec $program ${1+"$@"}
$echo "$0: cannot exec $program ${1+"$@"}"
exit 1
fi
else
# The program doesn't exist.
$echo "$0: error: $progdir/$program does not exist" 1>&2
$echo "This script is just a wrapper for $program." 1>&2
echo "See the libtool documentation for more information." 1>&2
exit 1
fi
fi
|
Added work/contrib/lzo/lzo-1.08/examples/precomp.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
|
/* precomp.c -- example program: how to generate pre-compressed data
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/*************************************************************************
// This program shows how to generate pre-compressed data.
//
// Please study LZO.FAQ and simple.c first.
//
// We will be trying both LZO1X-999 and LZO1Y-999 and choose
// the algorithm that achieves the best compression ratio.
**************************************************************************/
#include <lzoconf.h>
#if defined(LZO_999_UNSUPPORTED)
# error "compression level 999 not supported on this 16-bit system"
#endif
#include <lzo1x.h>
#include <lzo1y.h>
#define USE_LZO1X
#define USE_LZO1Y
#define PARANOID
/*************************************************************************
//
**************************************************************************/
#include "lutil.h"
#include <assert.h>
int main(int argc, char *argv[])
{
int r;
lzo_byte *in;
lzo_uint in_len;
lzo_byte *out;
lzo_uint out_len = 0;
lzo_byte *wrkmem;
lzo_uint wrk_len;
lzo_uint best_len;
int best_compress = -1;
lzo_uint orig_len;
lzo_uint32 uncompressed_checksum;
lzo_uint32 compressed_checksum;
FILE *f;
const char *progname = NULL;
const char *in_name = NULL;
const char *out_name = NULL;
long l;
#if defined(__EMX__)
_response(&argc,&argv);
_wildcard(&argc,&argv);
#endif
printf("\nLZO real-time data compression library (v%s, %s).\n",
lzo_version_string(), lzo_version_date());
printf("Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer\n\n");
progname = argv[0];
if (argc < 2 || argc > 3)
{
printf("usage: %s file [output-file]\n", progname);
exit(1);
}
in_name = argv[1];
out_name = (argc > 2) ? argv[2] : NULL;
/*
* Step 1: initialize the LZO library
*/
if (lzo_init() != LZO_E_OK)
{
printf("lzo_init() failed !!!\n");
exit(1);
}
/*
* Step 2: allocate the work-memory
*/
wrk_len = 1;
#ifdef USE_LZO1X
if (wrk_len < LZO1X_999_MEM_COMPRESS)
wrk_len = LZO1X_999_MEM_COMPRESS;
#endif
#ifdef USE_LZO1Y
if (wrk_len < LZO1Y_999_MEM_COMPRESS)
wrk_len = LZO1Y_999_MEM_COMPRESS;
#endif
wrkmem = (lzo_bytep) lzo_malloc(wrk_len);
if (wrkmem == NULL)
{
printf("%s: out of memory\n", progname);
exit(1);
}
/*
* Step 3: open the input file
*/
f = fopen(in_name,"rb");
if (f == NULL)
{
printf("%s: cannot open file %s\n", progname, in_name);
exit(1);
}
fseek(f,0,SEEK_END);
l = ftell(f);
fseek(f,0,SEEK_SET);
if (l <= 0)
{
printf("%s: %s: empty file\n", progname, in_name);
fclose(f);
exit(1);
}
in_len = (lzo_uint) l;
best_len = in_len;
/*
* Step 4: allocate compression buffers and read the file
*/
in = (lzo_bytep) lzo_malloc(in_len);
out = (lzo_bytep) lzo_malloc(in_len + in_len / 64 + 16 + 3);
if (in == NULL || out == NULL)
{
printf("%s: out of memory\n", progname);
exit(1);
}
in_len = lzo_fread(f,in,in_len);
printf("%s: loaded file %s: %ld bytes\n", progname, in_name, (long) in_len);
fclose(f);
/*
* Step 5: compute a checksum of the uncompressed data
*/
uncompressed_checksum = lzo_adler32(0,NULL,0);
uncompressed_checksum = lzo_adler32(uncompressed_checksum,in,in_len);
/*
* Step 6a: compress from `in' to `out' with LZO1X-999
*/
#ifdef USE_LZO1X
r = lzo1x_999_compress(in,in_len,out,&out_len,wrkmem);
if (r != LZO_E_OK)
{
/* this should NEVER happen */
printf("internal error - compression failed: %d\n", r);
exit(1);
}
printf("LZO1X-999: %8lu -> %8lu\n", (long) in_len, (long) out_len);
if (out_len < best_len)
{
best_len = out_len;
best_compress = 1; /* LZO1X-999 */
}
#endif /* USE_LZO1X */
/*
* Step 6b: compress from `in' to `out' with LZO1Y-999
*/
#ifdef USE_LZO1Y
r = lzo1y_999_compress(in,in_len,out,&out_len,wrkmem);
if (r != LZO_E_OK)
{
/* this should NEVER happen */
printf("internal error - compression failed: %d\n", r);
exit(1);
}
printf("LZO1Y-999: %8lu -> %8lu\n", (long) in_len, (long) out_len);
if (out_len < best_len)
{
best_len = out_len;
best_compress = 2; /* LZO1Y-999 */
}
#endif /* USE_LZO1Y */
/*
* Step 7: check if compressible
*/
if (best_len >= in_len)
{
printf("This file contains incompressible data.\n");
return 0;
}
/*
* Step 8: compress data again using the best compressor found
*/
if (best_compress == 1)
r = lzo1x_999_compress(in,in_len,out,&out_len,wrkmem);
else if (best_compress == 2)
r = lzo1y_999_compress(in,in_len,out,&out_len,wrkmem);
else
r = -100;
assert(r == LZO_E_OK);
assert(out_len == best_len);
/*
* Step 9: optimize compressed data (compressed data is in `out' buffer)
*/
#if 1
/* Optimization does not require any data in the buffer that will
* hold the uncompressed data. To prove this, we clear the buffer.
*/
lzo_memset(in,0,in_len);
#endif
orig_len = in_len;
if (best_compress == 1)
r = lzo1x_optimize(out,out_len,in,&orig_len,NULL);
else if (best_compress == 2)
r = lzo1y_optimize(out,out_len,in,&orig_len,NULL);
else
r = -100;
if (r != LZO_E_OK || orig_len != in_len)
{
/* this should NEVER happen */
printf("internal error - optimization failed: %d\n", r);
exit(1);
}
/*
* Step 10: compute a checksum of the compressed data
*/
compressed_checksum = lzo_adler32(0,NULL,0);
compressed_checksum = lzo_adler32(compressed_checksum,out,out_len);
/*
* Step 11: write compressed data to a file
*/
printf("%s: %s: %ld -> %ld, checksum 0x%08lx 0x%08lx\n",
progname, in_name, (long) in_len, (long) out_len,
(long) uncompressed_checksum, (long) compressed_checksum);
if (out_name && out_name[0])
{
printf("%s: writing to file %s\n", progname, out_name);
f = fopen(out_name,"wb");
if (f == NULL)
{
printf("%s: cannot open output file %s\n", progname, out_name);
exit(1);
}
if (lzo_fwrite(f,out,out_len) != out_len || fclose(f) != 0)
{
printf("%s: write error !!\n", progname);
exit(1);
}
}
/*
* Step 12: verify decompression
*/
#ifdef PARANOID
orig_len = in_len;
if (best_compress == 1)
r = lzo1x_decompress(out,out_len,in,&orig_len,NULL);
else if (best_compress == 2)
r = lzo1y_decompress(out,out_len,in,&orig_len,NULL);
else
r = -100;
if (r != LZO_E_OK || orig_len != in_len)
{
/* this should NEVER happen */
printf("internal error - decompression failed: %d\n", r);
exit(1);
}
if (uncompressed_checksum != lzo_adler32(lzo_adler32(0,NULL,0),in,in_len))
{
/* this should NEVER happen */
printf("internal error - decompression data error\n");
exit(1);
}
/* Now you could also verify decompression under similar conditions as in
* your application, e.g. overlapping assembler decompression etc.
*/
#endif
lzo_free(in);
lzo_free(out);
lzo_free(wrkmem);
return 0;
}
/*
vi:ts=4
*/
|
Added work/contrib/lzo/lzo-1.08/examples/precomp2.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
#! /bin/sh
# precomp2 - temporary wrapper script for .libs/precomp2
# Generated by ltmain.sh - GNU libtool 1.4.2a (1.922.2.93 2002/05/06 15:02:58)
#
# The precomp2 program cannot be directly executed until all the libtool
# libraries that it depends on are installed.
#
# This wrapper script should never be moved out of the build directory.
# If it is, it will not operate correctly.
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
Xsed=/usr/bin/sed' -e 1s/^X//'
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
if test "${CDPATH+set}" = set; then CDPATH=:; export CDPATH; fi
relink_command="(cd /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/examples; { test -z \"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { LIBRARY_PATH=; export LIBRARY_PATH; }; }; { test -z \"\${COMPILER_PATH+set}\" || unset COMPILER_PATH || { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z \"\${GCC_EXEC_PREFIX+set}\" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=; export GCC_EXEC_PREFIX; }; }; { test -z \"\${LD_RUN_PATH+set}\" || unset LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; { test -z \"\${LD_LIBRARY_PATH+set}\" || unset LD_LIBRARY_PATH || { LD_LIBRARY_PATH=; export LD_LIBRARY_PATH; }; }; PATH=\"/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/openwin/bin:/usr/games:/usr/local/jdk1.3.1_01/bin:/usr/local/mysql/bin:.\"; export PATH; gcc -O2 -Wall -Wcast-align -Wcast-qual -Wwrite-strings -fno-strength-reduce -fstrict-aliasing -o \$progdir/\$file precomp2.o ../src/.libs/liblzo.so -Wl,--rpath -Wl,/home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/src/.libs -Wl,--rpath -Wl,/usr/local/lib)"
# This environment variable determines our operation mode.
if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
# install mode needs the following variable:
notinst_deplibs=' ../src/liblzo.la'
else
# When we are sourced in execute mode, $file and $echo are already set.
if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
echo="echo"
file="$0"
# Make sure echo works.
if test "X$1" = X--no-reexec; then
# Discard the --no-reexec flag, and continue.
shift
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
# Yippee, $echo works!
:
else
# Restart under the correct shell, and then maybe $echo will work.
exec /bin/sh "$0" --no-reexec ${1+"$@"}
fi
fi
# Find the directory that this script lives in.
thisdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
test "x$thisdir" = "x$file" && thisdir=.
# Follow symbolic links until we get to the real thisdir.
file=`ls -ld "$file" | /usr/bin/sed -n 's/.*-> //p'`
while test -n "$file"; do
destdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
# If there was a directory component, then change thisdir.
if test "x$destdir" != "x$file"; then
case "$destdir" in
[\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;;
*) thisdir="$thisdir/$destdir" ;;
esac
fi
file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
file=`ls -ld "$thisdir/$file" | /usr/bin/sed -n 's/.*-> //p'`
done
# Try to get the absolute directory name.
absdir=`cd "$thisdir" && pwd`
test -n "$absdir" && thisdir="$absdir"
program=lt-'precomp2'
progdir="$thisdir/.libs"
if test ! -f "$progdir/$program" || \
{ file=`ls -1dt "$progdir/$program" "$progdir/../$program" 2>/dev/null | /usr/bin/sed 1q`; \
test "X$file" != "X$progdir/$program"; }; then
file="$$-$program"
if test ! -d "$progdir"; then
mkdir "$progdir"
else
rm -f "$progdir/$file"
fi
# relink executable if necessary
if test -n "$relink_command"; then
if relink_command_output=`eval $relink_command 2>&1`; then :
else
echo "$relink_command_output" >&2
rm -f "$progdir/$file"
exit 1
fi
fi
mv -f "$progdir/$file" "$progdir/$program" 2>/dev/null ||
{ rm -f "$progdir/$program";
mv -f "$progdir/$file" "$progdir/$program"; }
rm -f "$progdir/$file"
fi
if test -f "$progdir/$program"; then
if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
# Run the actual program with our arguments.
# Export the path to the program.
PATH="$progdir:$PATH"
export PATH
exec $program ${1+"$@"}
$echo "$0: cannot exec $program ${1+"$@"}"
exit 1
fi
else
# The program doesn't exist.
$echo "$0: error: $progdir/$program does not exist" 1>&2
$echo "This script is just a wrapper for $program." 1>&2
echo "See the libtool documentation for more information." 1>&2
exit 1
fi
fi
|
Added work/contrib/lzo/lzo-1.08/examples/precomp2.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
|
/* precomp2.c -- example program: how to generate pre-compressed data
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/*************************************************************************
// This program shows how to generate pre-compressed data.
//
// Please study precomp.c first.
//
// We will be trying LZO1X-999 and LZO1Y-999, and we will be trying
// various parameters using the internal interface to squeeze out
// a little bit of extra compression.
//
// NOTE: this program can be quite slow for highly redundant files
**************************************************************************/
#include <lzoconf.h>
#if defined(LZO_999_UNSUPPORTED)
# error "compression level 999 not supported on this 16-bit system"
#endif
#include <lzo1x.h>
#include <lzo1y.h>
LZO_EXTERN(int)
lzo1x_999_compress_internal ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem,
const lzo_byte *dict, lzo_uint dict_len,
lzo_progress_callback_t cb,
int try_lazy,
lzo_uint good_length,
lzo_uint max_lazy,
lzo_uint nice_length,
lzo_uint max_chain,
lzo_uint32 flags );
LZO_EXTERN(int)
lzo1y_999_compress_internal ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem,
const lzo_byte *dict, lzo_uint dict_len,
lzo_progress_callback_t cb,
int try_lazy,
lzo_uint good_length,
lzo_uint max_lazy,
lzo_uint nice_length,
lzo_uint max_chain,
lzo_uint32 flags );
#define USE_LZO1X
#define USE_LZO1Y
#define PARANOID
/*************************************************************************
//
**************************************************************************/
#include "lutil.h"
#include <assert.h>
int main(int argc, char *argv[])
{
int r;
int lazy;
const int max_try_lazy = 5;
const lzo_uint big = 65536L; /* can result in very slow compression */
const lzo_uint32 flags = 0x1;
lzo_byte *in;
lzo_uint in_len;
lzo_byte *out;
lzo_uint out_len = 0;
lzo_byte *wrkmem;
lzo_uint wrk_len;
lzo_uint best_len;
int best_compress = -1;
int best_lazy = -1;
lzo_uint orig_len;
lzo_uint32 uncompressed_checksum;
lzo_uint32 compressed_checksum;
FILE *f;
const char *progname = NULL;
const char *in_name = NULL;
const char *out_name = NULL;
long l;
#if defined(__EMX__)
_response(&argc,&argv);
_wildcard(&argc,&argv);
#endif
printf("\nLZO real-time data compression library (v%s, %s).\n",
lzo_version_string(), lzo_version_date());
printf("Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer\n\n");
progname = argv[0];
if (argc < 2 || argc > 3)
{
printf("usage: %s file [output-file]\n", progname);
exit(1);
}
in_name = argv[1];
out_name = (argc > 2) ? argv[2] : NULL;
/*
* Step 1: initialize the LZO library
*/
if (lzo_init() != LZO_E_OK)
{
printf("lzo_init() failed !!!\n");
exit(1);
}
/*
* Step 2: allocate the work-memory
*/
wrk_len = 1;
#ifdef USE_LZO1X
if (wrk_len < LZO1X_999_MEM_COMPRESS)
wrk_len = LZO1X_999_MEM_COMPRESS;
#endif
#ifdef USE_LZO1Y
if (wrk_len < LZO1Y_999_MEM_COMPRESS)
wrk_len = LZO1Y_999_MEM_COMPRESS;
#endif
wrkmem = (lzo_bytep) lzo_malloc(wrk_len);
if (wrkmem == NULL)
{
printf("%s: out of memory\n", progname);
exit(1);
}
/*
* Step 3: open the input file
*/
f = fopen(in_name,"rb");
if (f == NULL)
{
printf("%s: cannot open file %s\n", progname, in_name);
exit(1);
}
fseek(f,0,SEEK_END);
l = ftell(f);
fseek(f,0,SEEK_SET);
if (l <= 0)
{
printf("%s: %s: empty file\n", progname, in_name);
fclose(f);
exit(1);
}
in_len = (lzo_uint) l;
best_len = in_len;
/*
* Step 4: allocate compression buffers and read the file
*/
in = (lzo_bytep) lzo_malloc(in_len);
out = (lzo_bytep) lzo_malloc(in_len + in_len / 64 + 16 + 3);
if (in == NULL || out == NULL)
{
printf("%s: out of memory\n", progname);
exit(1);
}
in_len = lzo_fread(f,in,in_len);
printf("%s: loaded file %s: %ld bytes\n", progname, in_name, (long) in_len);
fclose(f);
/*
* Step 5: compute a checksum of the uncompressed data
*/
uncompressed_checksum = lzo_adler32(0,NULL,0);
uncompressed_checksum = lzo_adler32(uncompressed_checksum,in,in_len);
/*
* Step 6a: compress from `in' to `out' with LZO1X-999
*/
#ifdef USE_LZO1X
for (lazy = 0; lazy <= max_try_lazy; lazy++)
{
r = lzo1x_999_compress_internal(in,in_len,out,&out_len,wrkmem,
NULL, 0, 0,
lazy, big, big, big, big, flags);
if (r != LZO_E_OK)
{
/* this should NEVER happen */
printf("internal error - compression failed: %d\n", r);
exit(1);
}
printf("LZO1X-999: lazy =%2d: %8lu -> %8lu\n",
lazy, (long) in_len, (long) out_len);
if (out_len < best_len)
{
best_len = out_len;
best_lazy = lazy;
best_compress = 1; /* LZO1X-999 */
}
}
#endif /* USE_LZO1X */
/*
* Step 6b: compress from `in' to `out' with LZO1Y-999
*/
#ifdef USE_LZO1Y
for (lazy = 0; lazy <= max_try_lazy; lazy++)
{
r = lzo1y_999_compress_internal(in,in_len,out,&out_len,wrkmem,
NULL, 0, 0,
lazy, big, big, big, big, flags);
if (r != LZO_E_OK)
{
/* this should NEVER happen */
printf("internal error - compression failed: %d\n", r);
exit(1);
}
printf("LZO1Y-999: lazy =%2d: %8lu -> %8lu\n",
lazy, (long) in_len, (long) out_len);
if (out_len < best_len)
{
best_len = out_len;
best_lazy = lazy;
best_compress = 2; /* LZO1Y-999 */
}
}
#endif /* USE_LZO1Y */
/*
* Step 7: check if compressible
*/
if (best_len >= in_len)
{
printf("This file contains incompressible data.\n");
return 0;
}
/*
* Step 8: compress data again using the best compressor found
*/
if (best_compress == 1)
r = lzo1x_999_compress_internal(in,in_len,out,&out_len,wrkmem,
NULL, 0, 0,
best_lazy, big, big, big, big, flags);
else if (best_compress == 2)
r = lzo1y_999_compress_internal(in,in_len,out,&out_len,wrkmem,
NULL, 0, 0,
best_lazy, big, big, big, big, flags);
else
r = -100;
assert(r == LZO_E_OK);
assert(out_len == best_len);
/*
* Step 9: optimize compressed data (compressed data is in `out' buffer)
*/
#if 1
/* Optimization does not require any data in the buffer that will
* hold the uncompressed data. To prove this, we clear the buffer.
*/
lzo_memset(in,0,in_len);
#endif
orig_len = in_len;
if (best_compress == 1)
r = lzo1x_optimize(out,out_len,in,&orig_len,NULL);
else if (best_compress == 2)
r = lzo1y_optimize(out,out_len,in,&orig_len,NULL);
else
r = -100;
if (r != LZO_E_OK || orig_len != in_len)
{
/* this should NEVER happen */
printf("internal error - optimization failed: %d\n", r);
exit(1);
}
/*
* Step 10: compute a checksum of the compressed data
*/
compressed_checksum = lzo_adler32(0,NULL,0);
compressed_checksum = lzo_adler32(compressed_checksum,out,out_len);
/*
* Step 11: write compressed data to a file
*/
printf("%s: %s: %ld -> %ld, checksum 0x%08lx 0x%08lx\n",
progname, in_name, (long) in_len, (long) out_len,
(long) uncompressed_checksum, (long) compressed_checksum);
if (out_name && out_name[0])
{
printf("%s: writing to file %s\n", progname, out_name);
f = fopen(out_name,"wb");
if (f == NULL)
{
printf("%s: cannot open output file %s\n", progname, out_name);
exit(1);
}
if (lzo_fwrite(f,out,out_len) != out_len || fclose(f) != 0)
{
printf("%s: write error !!\n", progname);
exit(1);
}
}
/*
* Step 12: verify decompression
*/
#ifdef PARANOID
orig_len = in_len;
if (best_compress == 1)
r = lzo1x_decompress(out,out_len,in,&orig_len,NULL);
else if (best_compress == 2)
r = lzo1y_decompress(out,out_len,in,&orig_len,NULL);
else
r = -100;
if (r != LZO_E_OK || orig_len != in_len)
{
/* this should NEVER happen */
printf("internal error - decompression failed: %d\n", r);
exit(1);
}
if (uncompressed_checksum != lzo_adler32(lzo_adler32(0,NULL,0),in,in_len))
{
/* this should NEVER happen */
printf("internal error - decompression data error\n");
exit(1);
}
/* Now you could also verify decompression under similar conditions as in
* your application, e.g. overlapping assembler decompression etc.
*/
#endif
lzo_free(in);
lzo_free(out);
lzo_free(wrkmem);
return 0;
}
/*
vi:ts=4
*/
|
Added work/contrib/lzo/lzo-1.08/examples/simple.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
#! /bin/sh
# simple - temporary wrapper script for .libs/simple
# Generated by ltmain.sh - GNU libtool 1.4.2a (1.922.2.93 2002/05/06 15:02:58)
#
# The simple program cannot be directly executed until all the libtool
# libraries that it depends on are installed.
#
# This wrapper script should never be moved out of the build directory.
# If it is, it will not operate correctly.
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
Xsed=/usr/bin/sed' -e 1s/^X//'
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
if test "${CDPATH+set}" = set; then CDPATH=:; export CDPATH; fi
relink_command="(cd /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/examples; { test -z \"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { LIBRARY_PATH=; export LIBRARY_PATH; }; }; { test -z \"\${COMPILER_PATH+set}\" || unset COMPILER_PATH || { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z \"\${GCC_EXEC_PREFIX+set}\" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=; export GCC_EXEC_PREFIX; }; }; { test -z \"\${LD_RUN_PATH+set}\" || unset LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; { test -z \"\${LD_LIBRARY_PATH+set}\" || unset LD_LIBRARY_PATH || { LD_LIBRARY_PATH=; export LD_LIBRARY_PATH; }; }; PATH=\"/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/openwin/bin:/usr/games:/usr/local/jdk1.3.1_01/bin:/usr/local/mysql/bin:.\"; export PATH; gcc -O2 -Wall -Wcast-align -Wcast-qual -Wwrite-strings -fno-strength-reduce -fstrict-aliasing -o \$progdir/\$file simple.o ../src/.libs/liblzo.so -Wl,--rpath -Wl,/home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/src/.libs -Wl,--rpath -Wl,/usr/local/lib)"
# This environment variable determines our operation mode.
if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
# install mode needs the following variable:
notinst_deplibs=' ../src/liblzo.la'
else
# When we are sourced in execute mode, $file and $echo are already set.
if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
echo="echo"
file="$0"
# Make sure echo works.
if test "X$1" = X--no-reexec; then
# Discard the --no-reexec flag, and continue.
shift
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
# Yippee, $echo works!
:
else
# Restart under the correct shell, and then maybe $echo will work.
exec /bin/sh "$0" --no-reexec ${1+"$@"}
fi
fi
# Find the directory that this script lives in.
thisdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
test "x$thisdir" = "x$file" && thisdir=.
# Follow symbolic links until we get to the real thisdir.
file=`ls -ld "$file" | /usr/bin/sed -n 's/.*-> //p'`
while test -n "$file"; do
destdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
# If there was a directory component, then change thisdir.
if test "x$destdir" != "x$file"; then
case "$destdir" in
[\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;;
*) thisdir="$thisdir/$destdir" ;;
esac
fi
file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
file=`ls -ld "$thisdir/$file" | /usr/bin/sed -n 's/.*-> //p'`
done
# Try to get the absolute directory name.
absdir=`cd "$thisdir" && pwd`
test -n "$absdir" && thisdir="$absdir"
program=lt-'simple'
progdir="$thisdir/.libs"
if test ! -f "$progdir/$program" || \
{ file=`ls -1dt "$progdir/$program" "$progdir/../$program" 2>/dev/null | /usr/bin/sed 1q`; \
test "X$file" != "X$progdir/$program"; }; then
file="$$-$program"
if test ! -d "$progdir"; then
mkdir "$progdir"
else
rm -f "$progdir/$file"
fi
# relink executable if necessary
if test -n "$relink_command"; then
if relink_command_output=`eval $relink_command 2>&1`; then :
else
echo "$relink_command_output" >&2
rm -f "$progdir/$file"
exit 1
fi
fi
mv -f "$progdir/$file" "$progdir/$program" 2>/dev/null ||
{ rm -f "$progdir/$program";
mv -f "$progdir/$file" "$progdir/$program"; }
rm -f "$progdir/$file"
fi
if test -f "$progdir/$program"; then
if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
# Run the actual program with our arguments.
# Export the path to the program.
PATH="$progdir:$PATH"
export PATH
exec $program ${1+"$@"}
$echo "$0: cannot exec $program ${1+"$@"}"
exit 1
fi
else
# The program doesn't exist.
$echo "$0: error: $progdir/$program does not exist" 1>&2
$echo "This script is just a wrapper for $program." 1>&2
echo "See the libtool documentation for more information." 1>&2
exit 1
fi
fi
|
Added work/contrib/lzo/lzo-1.08/examples/simple.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
|
/* simple.c -- the annotated simple example program for the LZO library
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/*************************************************************************
// This program shows the basic usage of the LZO library.
// We will compress a block of data and decompress again.
//
// See also LZO.FAQ
**************************************************************************/
/* We will be using the LZO1X-1 algorithm, so we have
* to include <lzo1x.h>
*/
#include <lzo1x.h>
/* We want to compress the data block at `in' with length `IN_LEN' to
* the block at `out'. Because the input block may be incompressible,
* we must provide a little more output space in case that compression
* is not possible.
*/
#ifndef IN_LEN
#define IN_LEN (128*1024L)
#endif
#define OUT_LEN (IN_LEN + IN_LEN / 64 + 16 + 3)
/*************************************************************************
//
**************************************************************************/
#include "lutil.h"
int main(int argc, char *argv[])
{
int r;
lzo_byte *in;
lzo_byte *out;
lzo_byte *wrkmem;
lzo_uint in_len;
lzo_uint out_len;
lzo_uint new_len;
#if defined(__EMX__)
_response(&argc,&argv);
_wildcard(&argc,&argv);
#endif
if (argc < 0 && argv == NULL) /* avoid warning about unused args */
return 0;
printf("\nLZO real-time data compression library (v%s, %s).\n",
lzo_version_string(), lzo_version_date());
printf("Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer\n\n");
/*
* Step 1: initialize the LZO library
*/
if (lzo_init() != LZO_E_OK)
{
printf("lzo_init() failed !!!\n");
return 4;
}
/*
* Step 2: allocate blocks and the work-memory
*/
in = (lzo_bytep) lzo_malloc(IN_LEN);
out = (lzo_bytep) lzo_malloc(OUT_LEN);
wrkmem = (lzo_bytep) lzo_malloc(LZO1X_1_MEM_COMPRESS);
if (in == NULL || out == NULL || wrkmem == NULL)
{
printf("out of memory\n");
return 3;
}
/*
* Step 3: prepare the input block that will get compressed.
* We just fill it with zeros in this example program,
* but you would use your real-world data here.
*/
in_len = IN_LEN;
lzo_memset(in,0,in_len);
/*
* Step 4: compress from `in' to `out' with LZO1X-1
*/
r = lzo1x_1_compress(in,in_len,out,&out_len,wrkmem);
if (r == LZO_E_OK)
printf("compressed %lu bytes into %lu bytes\n",
(long) in_len, (long) out_len);
else
{
/* this should NEVER happen */
printf("internal error - compression failed: %d\n", r);
return 2;
}
/* check for an incompressible block */
if (out_len >= in_len)
{
printf("This block contains incompressible data.\n");
return 0;
}
/*
* Step 5: decompress again, now going from `out' to `in'
*/
r = lzo1x_decompress(out,out_len,in,&new_len,NULL);
if (r == LZO_E_OK && new_len == in_len)
printf("decompressed %lu bytes back into %lu bytes\n",
(long) out_len, (long) in_len);
else
{
/* this should NEVER happen */
printf("internal error - decompression failed: %d\n", r);
return 1;
}
lzo_free(wrkmem);
lzo_free(out);
lzo_free(in);
printf("Simple compression test passed.\n");
return 0;
}
/*
vi:ts=4
*/
|
Added work/contrib/lzo/lzo-1.08/include/Makefile.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
|
# Makefile.in generated by automake 1.6.2 from Makefile.am.
# include/Makefile. Generated from Makefile.in by configure.
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
#
# Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
#
SHELL = /bin/sh
srcdir = .
top_srcdir = ..
prefix = /usr/local
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
sbindir = ${exec_prefix}/sbin
libexecdir = ${exec_prefix}/libexec
datadir = ${prefix}/share
sysconfdir = ${prefix}/etc
sharedstatedir = ${prefix}/com
localstatedir = ${prefix}/var
libdir = ${exec_prefix}/lib
infodir = ${prefix}/info
mandir = ${prefix}/man
includedir = ${prefix}/include
oldincludedir = /usr/include
pkgdatadir = $(datadir)/lzo
pkglibdir = $(libdir)/lzo
pkgincludedir = $(includedir)/lzo
top_builddir = ..
ACLOCAL = ${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run aclocal-1.6
AUTOCONF = ${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run autoconf
AUTOMAKE = ${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run automake-1.6
AUTOHEADER = ${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run autoheader
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = /usr/bin/ginstall -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_SCRIPT = ${INSTALL}
INSTALL_HEADER = $(INSTALL_DATA)
transform = s,x,x,
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
host_alias =
host_triplet = i586-pc-linux-gnu
EXEEXT =
OBJEXT = o
PATH_SEPARATOR = :
AMTAR = ${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run tar
AS = @AS@
ASFLAGS = -x assembler-with-cpp
AWK = gawk
CC = gcc
CFLAGS_GCC_OMIT_FRAME_POINTER = -fomit-frame-pointer
CFLAGS_O =
CFLAGS_W =
CFLAGS_W_PEDANTIC =
CLEANFILES = *.bb *.bbg *.da *.gcov bb.out bbtrace* gmon.out
CPP = gcc -E
DEPDIR = .deps
DLLTOOL = @DLLTOOL@
ECHO = echo
INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
LIBTOOL = $(SHELL) $(top_builddir)/libtool
LN_S = ln -s
LZO_ASM_OBJECTS = $(LZO_ASM_OBJECTS_GCC_i386)
LZO_CFLAGS =
MAINT = #
MFX_ARCH = i386
MFX_CC = GCC
MFX_CPU = i586
MOSTLYCLEANFILES = *.i
NASM =
OBJDUMP = @OBJDUMP@
PACKAGE = lzo
RANLIB = ranlib
SRC_VPATH = /i386/src
STRIP = strip
VERSION = 1.08
am__include = include
am__quote =
install_sh = /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/install-sh
liblzo = $(top_builddir)/src/liblzo.la
ltest_LIBS =
include_HEADERS = \
lzoconf.h lzoutil.h lzo16bit.h \
lzo1.h lzo1a.h lzo1b.h lzo1c.h lzo1f.h lzo1x.h lzo1y.h lzo1z.h \
lzo2a.h
subdir = include
mkinstalldirs = $(SHELL) $(top_srcdir)/acconfig/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
DIST_SOURCES =
HEADERS = $(include_HEADERS)
DIST_COMMON = $(include_HEADERS) Makefile.am Makefile.in
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: # Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu include/Makefile
Makefile: # $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
includeHEADERS_INSTALL = $(INSTALL_HEADER)
install-includeHEADERS: $(include_HEADERS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(includedir)
@list='$(include_HEADERS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f="`echo $$p | sed -e 's|^.*/||'`"; \
echo " $(includeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(includedir)/$$f"; \
$(includeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(includedir)/$$f; \
done
uninstall-includeHEADERS:
@$(NORMAL_UNINSTALL)
@list='$(include_HEADERS)'; for p in $$list; do \
f="`echo $$p | sed -e 's|^.*/||'`"; \
echo " rm -f $(DESTDIR)$(includedir)/$$f"; \
rm -f $(DESTDIR)$(includedir)/$$f; \
done
ETAGS = etags
ETAGSFLAGS =
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@list='$(DISTFILES)'; for file in $$list; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkinstalldirs) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(HEADERS)
installdirs:
$(mkinstalldirs) $(DESTDIR)$(includedir)
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
distclean-am: clean-am distclean-generic distclean-libtool \
distclean-tags
dvi: dvi-am
dvi-am:
info: info-am
info-am:
install-data-am: install-includeHEADERS
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
uninstall-am: uninstall-includeHEADERS uninstall-info-am
.PHONY: GTAGS all all-am check check-am clean clean-generic \
clean-libtool distclean distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am info info-am install \
install-am install-data install-data-am install-exec \
install-exec-am install-includeHEADERS install-info \
install-info-am install-man install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool tags uninstall uninstall-am \
uninstall-includeHEADERS uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
|
Added work/contrib/lzo/lzo-1.08/include/Makefile.am.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
|
## Process this file with automake to create Makefile.in
#
# Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
#
## includedir = ${prefix}/include
include_HEADERS = \
lzoconf.h lzoutil.h lzo16bit.h \
lzo1.h lzo1a.h lzo1b.h lzo1c.h lzo1f.h lzo1x.h lzo1y.h lzo1z.h \
lzo2a.h
|
Added work/contrib/lzo/lzo-1.08/include/Makefile.in.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
|
# Makefile.in generated by automake 1.6.2 from Makefile.am.
# @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
#
# Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
#
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
host_alias = @host_alias@
host_triplet = @host@
EXEEXT = @EXEEXT@
OBJEXT = @OBJEXT@
PATH_SEPARATOR = @PATH_SEPARATOR@
AMTAR = @AMTAR@
AS = @AS@
ASFLAGS = @ASFLAGS@
AWK = @AWK@
CC = @CC@
CFLAGS_GCC_OMIT_FRAME_POINTER = @CFLAGS_GCC_OMIT_FRAME_POINTER@
CFLAGS_O = @CFLAGS_O@
CFLAGS_W = @CFLAGS_W@
CFLAGS_W_PEDANTIC = @CFLAGS_W_PEDANTIC@
CLEANFILES = @CLEANFILES@
CPP = @CPP@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
ECHO = @ECHO@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LZO_ASM_OBJECTS = @LZO_ASM_OBJECTS@
LZO_CFLAGS = @LZO_CFLAGS@
MAINT = @MAINT@
MFX_ARCH = @MFX_ARCH@
MFX_CC = @MFX_CC@
MFX_CPU = @MFX_CPU@
MOSTLYCLEANFILES = @MOSTLYCLEANFILES@
NASM = @NASM@
OBJDUMP = @OBJDUMP@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
SRC_VPATH = @SRC_VPATH@
STRIP = @STRIP@
VERSION = @VERSION@
am__include = @am__include@
am__quote = @am__quote@
install_sh = @install_sh@
liblzo = @liblzo@
ltest_LIBS = @ltest_LIBS@
include_HEADERS = \
lzoconf.h lzoutil.h lzo16bit.h \
lzo1.h lzo1a.h lzo1b.h lzo1c.h lzo1f.h lzo1x.h lzo1y.h lzo1z.h \
lzo2a.h
subdir = include
mkinstalldirs = $(SHELL) $(top_srcdir)/acconfig/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
DIST_SOURCES =
HEADERS = $(include_HEADERS)
DIST_COMMON = $(include_HEADERS) Makefile.am Makefile.in
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu include/Makefile
Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
includeHEADERS_INSTALL = $(INSTALL_HEADER)
install-includeHEADERS: $(include_HEADERS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(includedir)
@list='$(include_HEADERS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f="`echo $$p | sed -e 's|^.*/||'`"; \
echo " $(includeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(includedir)/$$f"; \
$(includeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(includedir)/$$f; \
done
uninstall-includeHEADERS:
@$(NORMAL_UNINSTALL)
@list='$(include_HEADERS)'; for p in $$list; do \
f="`echo $$p | sed -e 's|^.*/||'`"; \
echo " rm -f $(DESTDIR)$(includedir)/$$f"; \
rm -f $(DESTDIR)$(includedir)/$$f; \
done
ETAGS = etags
ETAGSFLAGS =
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@list='$(DISTFILES)'; for file in $$list; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkinstalldirs) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(HEADERS)
installdirs:
$(mkinstalldirs) $(DESTDIR)$(includedir)
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
distclean-am: clean-am distclean-generic distclean-libtool \
distclean-tags
dvi: dvi-am
dvi-am:
info: info-am
info-am:
install-data-am: install-includeHEADERS
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
uninstall-am: uninstall-includeHEADERS uninstall-info-am
.PHONY: GTAGS all all-am check check-am clean clean-generic \
clean-libtool distclean distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am info info-am install \
install-am install-data install-data-am install-exec \
install-exec-am install-includeHEADERS install-info \
install-info-am install-man install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool tags uninstall uninstall-am \
uninstall-includeHEADERS uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
|
Added work/contrib/lzo/lzo-1.08/include/lzo1.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
/* lzo1.h -- public interface of the LZO1 compression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/opensource/lzo/
*/
#ifndef __LZO1_H
#define __LZO1_H
#ifndef __LZOCONF_H
#include <lzoconf.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/***********************************************************************
//
************************************************************************/
/* Memory required for the wrkmem parameter.
* When the required size is 0, you can also pass a NULL pointer.
*/
#define LZO1_MEM_COMPRESS ((lzo_uint32) (8192L * lzo_sizeof_dict_t))
#define LZO1_MEM_DECOMPRESS (0)
LZO_EXTERN(int)
lzo1_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
LZO_EXTERN(int)
lzo1_decompress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
/***********************************************************************
// better compression ratio at the cost of more memory and time
************************************************************************/
#define LZO1_99_MEM_COMPRESS ((lzo_uint32) (65536L * lzo_sizeof_dict_t))
#if !defined(LZO_99_UNSUPPORTED)
LZO_EXTERN(int)
lzo1_99_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* already included */
|
Added work/contrib/lzo/lzo-1.08/include/lzo16bit.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
/* lzo16bit.h -- configuration for the strict 16-bit memory model
This file is part of the LZO real-time data compression library.
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/opensource/lzo/
*/
/*
* NOTE:
* the strict 16-bit memory model is *not* officially supported.
* This file is only included for the sake of completeness.
*/
#ifndef __LZOCONF_H
# include <lzoconf.h>
#endif
#ifndef __LZO16BIT_H
#define __LZO16BIT_H
#if defined(__LZO_STRICT_16BIT)
#if (UINT_MAX < LZO_0xffffffffL)
#ifdef __cplusplus
extern "C" {
#endif
/***********************************************************************
//
************************************************************************/
#ifndef LZO_99_UNSUPPORTED
#define LZO_99_UNSUPPORTED
#endif
#ifndef LZO_999_UNSUPPORTED
#define LZO_999_UNSUPPORTED
#endif
typedef unsigned int lzo_uint;
typedef int lzo_int;
#define LZO_UINT_MAX UINT_MAX
#define LZO_INT_MAX INT_MAX
#define lzo_sizeof_dict_t sizeof(lzo_uint)
/***********************************************************************
//
************************************************************************/
#if defined(__LZO_DOS16) || defined(__LZO_WIN16)
#if 0
#define __LZO_MMODEL __far
#else
#define __LZO_MMODEL
#endif
#endif /* defined(__LZO_DOS16) || defined(__LZO_WIN16) */
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* (UINT_MAX < LZO_0xffffffffL) */
#endif /* defined(__LZO_STRICT_16BIT) */
#endif /* already included */
|
Added work/contrib/lzo/lzo-1.08/include/lzo1a.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
/* lzo1a.h -- public interface of the LZO1A compression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/opensource/lzo/
*/
#ifndef __LZO1A_H
#define __LZO1A_H
#ifndef __LZOCONF_H
#include <lzoconf.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/***********************************************************************
//
************************************************************************/
/* Memory required for the wrkmem parameter.
* When the required size is 0, you can also pass a NULL pointer.
*/
#define LZO1A_MEM_COMPRESS ((lzo_uint32) (8192L * lzo_sizeof_dict_t))
#define LZO1A_MEM_DECOMPRESS (0)
LZO_EXTERN(int)
lzo1a_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
LZO_EXTERN(int)
lzo1a_decompress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
/***********************************************************************
// better compression ratio at the cost of more memory and time
************************************************************************/
#define LZO1A_99_MEM_COMPRESS ((lzo_uint32) (65536L * lzo_sizeof_dict_t))
#if !defined(LZO_99_UNSUPPORTED)
LZO_EXTERN(int)
lzo1a_99_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* already included */
|
Added work/contrib/lzo/lzo-1.08/include/lzo1b.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
|
/* lzo1b.h -- public interface of the LZO1B compression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/opensource/lzo/
*/
#ifndef __LZO1B_H
#define __LZO1B_H
#ifndef __LZOCONF_H
#include <lzoconf.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/***********************************************************************
//
************************************************************************/
/* Memory required for the wrkmem parameter.
* When the required size is 0, you can also pass a NULL pointer.
*/
#define LZO1B_MEM_COMPRESS ((lzo_uint32) (16384L * lzo_sizeof_dict_t))
#define LZO1B_MEM_DECOMPRESS (0)
/* compression levels */
#define LZO1B_BEST_SPEED 1
#define LZO1B_BEST_COMPRESSION 9
#define LZO1B_DEFAULT_COMPRESSION (-1) /* fastest by default */
LZO_EXTERN(int)
lzo1b_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem,
int compression_level );
/* decompression */
LZO_EXTERN(int)
lzo1b_decompress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
/* safe decompression with overrun testing */
LZO_EXTERN(int)
lzo1b_decompress_safe ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
/***********************************************************************
//
************************************************************************/
LZO_EXTERN(int)
lzo1b_1_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
LZO_EXTERN(int)
lzo1b_2_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
LZO_EXTERN(int)
lzo1b_3_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
LZO_EXTERN(int)
lzo1b_4_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
LZO_EXTERN(int)
lzo1b_5_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
LZO_EXTERN(int)
lzo1b_6_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
LZO_EXTERN(int)
lzo1b_7_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
LZO_EXTERN(int)
lzo1b_8_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
LZO_EXTERN(int)
lzo1b_9_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
/***********************************************************************
// better compression ratio at the cost of more memory and time
************************************************************************/
#define LZO1B_99_MEM_COMPRESS ((lzo_uint32) (65536L * lzo_sizeof_dict_t))
#if !defined(LZO_99_UNSUPPORTED)
LZO_EXTERN(int)
lzo1b_99_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
#endif
#define LZO1B_999_MEM_COMPRESS ((lzo_uint32) (3 * 65536L * sizeof(lzo_uint32)))
#if !defined(LZO_999_UNSUPPORTED)
LZO_EXTERN(int)
lzo1b_999_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* already included */
|
Added work/contrib/lzo/lzo-1.08/include/lzo1c.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
|
/* lzo1c.h -- public interface of the LZO1C compression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/opensource/lzo/
*/
#ifndef __LZO1C_H
#define __LZO1C_H
#ifndef __LZOCONF_H
#include <lzoconf.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/***********************************************************************
//
************************************************************************/
/* Memory required for the wrkmem parameter.
* When the required size is 0, you can also pass a NULL pointer.
*/
#define LZO1C_MEM_COMPRESS ((lzo_uint32) (16384L * lzo_sizeof_dict_t))
#define LZO1C_MEM_DECOMPRESS (0)
/* compression levels */
#define LZO1C_BEST_SPEED 1
#define LZO1C_BEST_COMPRESSION 9
#define LZO1C_DEFAULT_COMPRESSION (-1) /* fastest by default */
LZO_EXTERN(int)
lzo1c_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem,
int compression_level );
/* decompression */
LZO_EXTERN(int)
lzo1c_decompress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
/* safe decompression with overrun testing */
LZO_EXTERN(int)
lzo1c_decompress_safe ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
/***********************************************************************
//
************************************************************************/
LZO_EXTERN(int)
lzo1c_1_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
LZO_EXTERN(int)
lzo1c_2_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
LZO_EXTERN(int)
lzo1c_3_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
LZO_EXTERN(int)
lzo1c_4_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
LZO_EXTERN(int)
lzo1c_5_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
LZO_EXTERN(int)
lzo1c_6_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
LZO_EXTERN(int)
lzo1c_7_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
LZO_EXTERN(int)
lzo1c_8_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
LZO_EXTERN(int)
lzo1c_9_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
/***********************************************************************
// better compression ratio at the cost of more memory and time
************************************************************************/
#define LZO1C_99_MEM_COMPRESS ((lzo_uint32) (65536L * lzo_sizeof_dict_t))
#if !defined(LZO_99_UNSUPPORTED)
LZO_EXTERN(int)
lzo1c_99_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
#endif
#define LZO1C_999_MEM_COMPRESS ((lzo_uint32) (5 * 16384L * sizeof(short)))
#if !defined(LZO_999_UNSUPPORTED)
LZO_EXTERN(int)
lzo1c_999_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* already included */
|
Added work/contrib/lzo/lzo-1.08/include/lzo1f.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
/* lzo1f.h -- public interface of the LZO1F compression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/opensource/lzo/
*/
#ifndef __LZO1F_H
#define __LZO1F_H
#ifndef __LZOCONF_H
#include <lzoconf.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/***********************************************************************
//
************************************************************************/
/* Memory required for the wrkmem parameter.
* When the required size is 0, you can also pass a NULL pointer.
*/
#define LZO1F_MEM_COMPRESS ((lzo_uint32) (16384L * lzo_sizeof_dict_t))
#define LZO1F_MEM_DECOMPRESS (0)
/* decompression */
LZO_EXTERN(int)
lzo1f_decompress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
/* safe decompression with overrun testing */
LZO_EXTERN(int)
lzo1f_decompress_safe ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
/***********************************************************************
//
************************************************************************/
LZO_EXTERN(int)
lzo1f_1_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
/***********************************************************************
// better compression ratio at the cost of more memory and time
************************************************************************/
#define LZO1F_999_MEM_COMPRESS ((lzo_uint32) (5 * 16384L * sizeof(short)))
#if !defined(LZO_999_UNSUPPORTED)
LZO_EXTERN(int)
lzo1f_999_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* already included */
|
Added work/contrib/lzo/lzo-1.08/include/lzo1x.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
|
/* lzo1x.h -- public interface of the LZO1X compression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/opensource/lzo/
*/
#ifndef __LZO1X_H
#define __LZO1X_H
#ifndef __LZOCONF_H
#include <lzoconf.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/***********************************************************************
//
************************************************************************/
/* Memory required for the wrkmem parameter.
* When the required size is 0, you can also pass a NULL pointer.
*/
#define LZO1X_MEM_COMPRESS LZO1X_1_MEM_COMPRESS
#define LZO1X_MEM_DECOMPRESS (0)
#define LZO1X_MEM_OPTIMIZE (0)
/* decompression */
LZO_EXTERN(int)
lzo1x_decompress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
/* safe decompression with overrun testing */
LZO_EXTERN(int)
lzo1x_decompress_safe ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
/***********************************************************************
//
************************************************************************/
#define LZO1X_1_MEM_COMPRESS ((lzo_uint32) (16384L * lzo_sizeof_dict_t))
LZO_EXTERN(int)
lzo1x_1_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
/***********************************************************************
// special compressor versions
************************************************************************/
/* this version needs only 8 kB work memory */
#define LZO1X_1_11_MEM_COMPRESS ((lzo_uint32) (2048L * lzo_sizeof_dict_t))
LZO_EXTERN(int)
lzo1x_1_11_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
/* this version needs 16 kB work memory */
#define LZO1X_1_12_MEM_COMPRESS ((lzo_uint32) (4096L * lzo_sizeof_dict_t))
LZO_EXTERN(int)
lzo1x_1_12_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
/* use this version if you need a little more compression speed */
#define LZO1X_1_15_MEM_COMPRESS ((lzo_uint32) (32768L * lzo_sizeof_dict_t))
LZO_EXTERN(int)
lzo1x_1_15_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
/***********************************************************************
// better compression ratio at the cost of more memory and time
************************************************************************/
#define LZO1X_999_MEM_COMPRESS ((lzo_uint32) (14 * 16384L * sizeof(short)))
#if !defined(LZO_999_UNSUPPORTED)
LZO_EXTERN(int)
lzo1x_999_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
#endif
/***********************************************************************
//
************************************************************************/
#if !defined(LZO_999_UNSUPPORTED)
LZO_EXTERN(int)
lzo1x_999_compress_dict ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem,
const lzo_byte *dict, lzo_uint dict_len );
LZO_EXTERN(int)
lzo1x_999_compress_level ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem,
const lzo_byte *dict, lzo_uint dict_len,
lzo_progress_callback_t cb,
int compression_level );
#endif
LZO_EXTERN(int)
lzo1x_decompress_dict_safe ( const lzo_byte *in, lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem /* NOT USED */,
const lzo_byte *dict, lzo_uint dict_len );
/***********************************************************************
// optimize a compressed data block
************************************************************************/
LZO_EXTERN(int)
lzo1x_optimize ( lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem );
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* already included */
|
Added work/contrib/lzo/lzo-1.08/include/lzo1y.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
|
/* lzo1y.h -- public interface of the LZO1Y compression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/opensource/lzo/
*/
#ifndef __LZO1Y_H
#define __LZO1Y_H
#ifndef __LZOCONF_H
#include <lzoconf.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/***********************************************************************
//
************************************************************************/
/* Memory required for the wrkmem parameter.
* When the required size is 0, you can also pass a NULL pointer.
*/
#define LZO1Y_MEM_COMPRESS ((lzo_uint32) (16384L * lzo_sizeof_dict_t))
#define LZO1Y_MEM_DECOMPRESS (0)
#define LZO1Y_MEM_OPTIMIZE (0)
/* decompression */
LZO_EXTERN(int)
lzo1y_decompress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
/* safe decompression with overrun testing */
LZO_EXTERN(int)
lzo1y_decompress_safe ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
/***********************************************************************
//
************************************************************************/
LZO_EXTERN(int)
lzo1y_1_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
/***********************************************************************
// better compression ratio at the cost of more memory and time
************************************************************************/
#define LZO1Y_999_MEM_COMPRESS ((lzo_uint32) (14 * 16384L * sizeof(short)))
#if !defined(LZO_999_UNSUPPORTED)
LZO_EXTERN(int)
lzo1y_999_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
#endif
/***********************************************************************
//
************************************************************************/
#if !defined(LZO_999_UNSUPPORTED)
LZO_EXTERN(int)
lzo1y_999_compress_dict ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem,
const lzo_byte *dict, lzo_uint dict_len );
LZO_EXTERN(int)
lzo1y_999_compress_level ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem,
const lzo_byte *dict, lzo_uint dict_len,
lzo_progress_callback_t cb,
int compression_level );
#endif
LZO_EXTERN(int)
lzo1y_decompress_dict_safe ( const lzo_byte *in, lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem /* NOT USED */,
const lzo_byte *dict, lzo_uint dict_len );
/***********************************************************************
// optimize a compressed data block
************************************************************************/
LZO_EXTERN(int)
lzo1y_optimize ( lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem );
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* already included */
|
Added work/contrib/lzo/lzo-1.08/include/lzo1z.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
|
/* lzo1z.h -- public interface of the LZO1Z compression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/opensource/lzo/
*/
#ifndef __LZO1Z_H
#define __LZO1Z_H
#ifndef __LZOCONF_H
#include <lzoconf.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/***********************************************************************
//
************************************************************************/
/* Memory required for the wrkmem parameter.
* When the required size is 0, you can also pass a NULL pointer.
*/
#define LZO1Z_MEM_COMPRESS ((lzo_uint32) (16384L * lzo_sizeof_dict_t))
#define LZO1Z_MEM_DECOMPRESS (0)
#define LZO1Z_MEM_OPTIMIZE (0)
/* decompression */
LZO_EXTERN(int)
lzo1z_decompress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
/* safe decompression with overrun testing */
LZO_EXTERN(int)
lzo1z_decompress_safe ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
/***********************************************************************
//
************************************************************************/
#if 0
/* not yet implemented */
LZO_EXTERN(int)
lzo1z_1_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
#endif
/***********************************************************************
// better compression ratio at the cost of more memory and time
************************************************************************/
#define LZO1Z_999_MEM_COMPRESS ((lzo_uint32) (14 * 16384L * sizeof(short)))
#if !defined(LZO_999_UNSUPPORTED)
LZO_EXTERN(int)
lzo1z_999_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
#endif
/***********************************************************************
//
************************************************************************/
#if !defined(LZO_999_UNSUPPORTED)
LZO_EXTERN(int)
lzo1z_999_compress_dict ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem,
const lzo_byte *dict, lzo_uint dict_len );
LZO_EXTERN(int)
lzo1z_999_compress_level ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem,
const lzo_byte *dict, lzo_uint dict_len,
lzo_progress_callback_t cb,
int compression_level );
#endif
LZO_EXTERN(int)
lzo1z_decompress_dict_safe ( const lzo_byte *in, lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem /* NOT USED */,
const lzo_byte *dict, lzo_uint dict_len );
/***********************************************************************
// optimize a compressed data block
************************************************************************/
#if 0
/* not yet implemented */
LZO_EXTERN(int)
lzo1z_optimize ( lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem );
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* already included */
|
Added work/contrib/lzo/lzo-1.08/include/lzo2a.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
/* lzo2a.h -- public interface of the LZO2A compression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/opensource/lzo/
*/
#ifndef __LZO2A_H
#define __LZO2A_H
#ifndef __LZOCONF_H
#include <lzoconf.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/***********************************************************************
//
************************************************************************/
#define LZO2A_MEM_DECOMPRESS (0)
/* decompression */
LZO_EXTERN(int)
lzo2a_decompress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
/* safe decompression with overrun testing */
LZO_EXTERN(int)
lzo2a_decompress_safe ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
/***********************************************************************
// better compression ratio at the cost of more memory and time
************************************************************************/
#define LZO2A_999_MEM_COMPRESS ((lzo_uint32) (8 * 16384L * sizeof(short)))
#if !defined(LZO_999_UNSUPPORTED)
LZO_EXTERN(int)
lzo2a_999_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* already included */
|
Added work/contrib/lzo/lzo-1.08/include/lzoconf.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
|
/* lzoconf.h -- configuration for the LZO real-time data compression library
This file is part of the LZO real-time data compression library.
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/opensource/lzo/
*/
#ifndef __LZOCONF_H
#define __LZOCONF_H
#define LZO_VERSION 0x1080
#define LZO_VERSION_STRING "1.08"
#define LZO_VERSION_DATE "Jul 12 2002"
/* internal Autoconf configuration file - only used when building LZO */
#if defined(LZO_HAVE_CONFIG_H)
# include <config.h>
#endif
#include <limits.h>
#ifdef __cplusplus
extern "C" {
#endif
/***********************************************************************
// LZO requires a conforming <limits.h>
************************************************************************/
#if !defined(CHAR_BIT) || (CHAR_BIT != 8)
# error "invalid CHAR_BIT"
#endif
#if !defined(UCHAR_MAX) || !defined(UINT_MAX) || !defined(ULONG_MAX)
# error "check your compiler installation"
#endif
#if (USHRT_MAX < 1) || (UINT_MAX < 1) || (ULONG_MAX < 1)
# error "your limits.h macros are broken"
#endif
/* workaround a cpp bug under hpux 10.20 */
#define LZO_0xffffffffL 4294967295ul
#if !defined(LZO_UINT32_C)
# if (UINT_MAX < LZO_0xffffffffL)
# define LZO_UINT32_C(c) c ## UL
# else
# define LZO_UINT32_C(c) c ## U
# endif
#endif
/***********************************************************************
// architecture defines
************************************************************************/
#if !defined(__LZO_WIN) && !defined(__LZO_DOS) && !defined(__LZO_OS2)
# if defined(__WINDOWS__) || defined(_WINDOWS) || defined(_Windows)
# define __LZO_WIN
# elif defined(__WIN32__) || defined(_WIN32) || defined(WIN32)
# define __LZO_WIN
# elif defined(__NT__) || defined(__NT_DLL__) || defined(__WINDOWS_386__)
# define __LZO_WIN
# elif defined(__DOS__) || defined(__MSDOS__) || defined(MSDOS)
# define __LZO_DOS
# elif defined(__OS2__) || defined(__OS2V2__) || defined(OS2)
# define __LZO_OS2
# elif defined(__palmos__)
# define __LZO_PALMOS
# elif defined(__TOS__) || defined(__atarist__)
# define __LZO_TOS
# endif
#endif
#if (UINT_MAX < LZO_0xffffffffL)
# if defined(__LZO_WIN)
# define __LZO_WIN16
# elif defined(__LZO_DOS)
# define __LZO_DOS16
# elif defined(__LZO_PALMOS)
# define __LZO_PALMOS16
# elif defined(__LZO_TOS)
# define __LZO_TOS16
# elif defined(__C166__)
# else
/* porting hint: for pure 16-bit architectures try compiling
* everything with -D__LZO_STRICT_16BIT */
# error "16-bit target not supported - contact me for porting hints"
# endif
#endif
#if !defined(__LZO_i386)
# if defined(__LZO_DOS) || defined(__LZO_WIN16)
# define __LZO_i386
# elif defined(__i386__) || defined(__386__) || defined(_M_IX86)
# define __LZO_i386
# endif
#endif
#if defined(__LZO_STRICT_16BIT)
# if (UINT_MAX < LZO_0xffffffffL)
# include <lzo16bit.h>
# endif
#endif
/* memory checkers */
#if !defined(__LZO_CHECKER)
# if defined(__BOUNDS_CHECKING_ON)
# define __LZO_CHECKER
# elif defined(__CHECKER__)
# define __LZO_CHECKER
# elif defined(__INSURE__)
# define __LZO_CHECKER
# elif defined(__PURIFY__)
# define __LZO_CHECKER
# endif
#endif
/***********************************************************************
// integral and pointer types
************************************************************************/
/* Integral types with 32 bits or more */
#if !defined(LZO_UINT32_MAX)
# if (UINT_MAX >= LZO_0xffffffffL)
typedef unsigned int lzo_uint32;
typedef int lzo_int32;
# define LZO_UINT32_MAX UINT_MAX
# define LZO_INT32_MAX INT_MAX
# define LZO_INT32_MIN INT_MIN
# elif (ULONG_MAX >= LZO_0xffffffffL)
typedef unsigned long lzo_uint32;
typedef long lzo_int32;
# define LZO_UINT32_MAX ULONG_MAX
# define LZO_INT32_MAX LONG_MAX
# define LZO_INT32_MIN LONG_MIN
# else
# error "lzo_uint32"
# endif
#endif
/* lzo_uint is used like size_t */
#if !defined(LZO_UINT_MAX)
# if (UINT_MAX >= LZO_0xffffffffL)
typedef unsigned int lzo_uint;
typedef int lzo_int;
# define LZO_UINT_MAX UINT_MAX
# define LZO_INT_MAX INT_MAX
# define LZO_INT_MIN INT_MIN
# elif (ULONG_MAX >= LZO_0xffffffffL)
typedef unsigned long lzo_uint;
typedef long lzo_int;
# define LZO_UINT_MAX ULONG_MAX
# define LZO_INT_MAX LONG_MAX
# define LZO_INT_MIN LONG_MIN
# else
# error "lzo_uint"
# endif
#endif
typedef int lzo_bool;
/***********************************************************************
// memory models
************************************************************************/
/* Memory model for the public code segment. */
#if !defined(__LZO_CMODEL)
# if defined(__LZO_DOS16) || defined(__LZO_WIN16)
# define __LZO_CMODEL __far
# elif defined(__LZO_i386) && defined(__WATCOMC__)
# define __LZO_CMODEL __near
# else
# define __LZO_CMODEL
# endif
#endif
/* Memory model for the public data segment. */
#if !defined(__LZO_DMODEL)
# if defined(__LZO_DOS16) || defined(__LZO_WIN16)
# define __LZO_DMODEL __far
# elif defined(__LZO_i386) && defined(__WATCOMC__)
# define __LZO_DMODEL __near
# else
# define __LZO_DMODEL
# endif
#endif
/* Memory model that allows to access memory at offsets of lzo_uint. */
#if !defined(__LZO_MMODEL)
# if (LZO_UINT_MAX <= UINT_MAX)
# define __LZO_MMODEL
# elif defined(__LZO_DOS16) || defined(__LZO_WIN16)
# define __LZO_MMODEL __huge
# define LZO_999_UNSUPPORTED
# elif defined(__LZO_PALMOS16) || defined(__LZO_TOS16)
# define __LZO_MMODEL
# else
# error "__LZO_MMODEL"
# endif
#endif
/* no typedef here because of const-pointer issues */
#define lzo_byte unsigned char __LZO_MMODEL
#define lzo_bytep unsigned char __LZO_MMODEL *
#define lzo_charp char __LZO_MMODEL *
#define lzo_voidp void __LZO_MMODEL *
#define lzo_shortp short __LZO_MMODEL *
#define lzo_ushortp unsigned short __LZO_MMODEL *
#define lzo_uint32p lzo_uint32 __LZO_MMODEL *
#define lzo_int32p lzo_int32 __LZO_MMODEL *
#define lzo_uintp lzo_uint __LZO_MMODEL *
#define lzo_intp lzo_int __LZO_MMODEL *
#define lzo_voidpp lzo_voidp __LZO_MMODEL *
#define lzo_bytepp lzo_bytep __LZO_MMODEL *
#ifndef lzo_sizeof_dict_t
# define lzo_sizeof_dict_t sizeof(lzo_bytep)
#endif
/***********************************************************************
// calling conventions and function types
************************************************************************/
/* linkage */
#if !defined(__LZO_EXTERN_C)
# ifdef __cplusplus
# define __LZO_EXTERN_C extern "C"
# else
# define __LZO_EXTERN_C extern
# endif
#endif
/* calling convention */
#if !defined(__LZO_CDECL)
# if defined(__LZO_DOS16) || defined(__LZO_WIN16)
# define __LZO_CDECL __LZO_CMODEL __cdecl
# elif defined(__LZO_i386) && defined(_MSC_VER)
# define __LZO_CDECL __LZO_CMODEL __cdecl
# elif defined(__LZO_i386) && defined(__WATCOMC__)
# define __LZO_CDECL __LZO_CMODEL __cdecl
# else
# define __LZO_CDECL __LZO_CMODEL
# endif
#endif
#if !defined(__LZO_ENTRY)
# define __LZO_ENTRY __LZO_CDECL
#endif
/* C++ exception specification for extern "C" function types */
#if !defined(__cplusplus)
# undef LZO_NOTHROW
# define LZO_NOTHROW
#elif !defined(LZO_NOTHROW)
# define LZO_NOTHROW
#endif
typedef int
(__LZO_ENTRY *lzo_compress_t) ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
typedef int
(__LZO_ENTRY *lzo_decompress_t) ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
typedef int
(__LZO_ENTRY *lzo_optimize_t) ( lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
typedef int
(__LZO_ENTRY *lzo_compress_dict_t)(const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem,
const lzo_byte *dict, lzo_uint dict_len );
typedef int
(__LZO_ENTRY *lzo_decompress_dict_t)(const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem,
const lzo_byte *dict, lzo_uint dict_len );
/* assembler versions always use __cdecl */
typedef int
(__LZO_CDECL *lzo_compress_asm_t)( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
typedef int
(__LZO_CDECL *lzo_decompress_asm_t)( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
/* a progress indicator callback function */
typedef void (__LZO_ENTRY *lzo_progress_callback_t) (lzo_uint, lzo_uint);
/***********************************************************************
// export information
************************************************************************/
/* DLL export information */
#if !defined(__LZO_EXPORT1)
# define __LZO_EXPORT1
#endif
#if !defined(__LZO_EXPORT2)
# define __LZO_EXPORT2
#endif
/* exported calling convention for C functions */
#if !defined(LZO_PUBLIC)
# define LZO_PUBLIC(_rettype) \
__LZO_EXPORT1 _rettype __LZO_EXPORT2 __LZO_ENTRY
#endif
#if !defined(LZO_EXTERN)
# define LZO_EXTERN(_rettype) __LZO_EXTERN_C LZO_PUBLIC(_rettype)
#endif
#if !defined(LZO_PRIVATE)
# define LZO_PRIVATE(_rettype) static _rettype __LZO_ENTRY
#endif
/* exported __cdecl calling convention for assembler functions */
#if !defined(LZO_PUBLIC_CDECL)
# define LZO_PUBLIC_CDECL(_rettype) \
__LZO_EXPORT1 _rettype __LZO_EXPORT2 __LZO_CDECL
#endif
#if !defined(LZO_EXTERN_CDECL)
# define LZO_EXTERN_CDECL(_rettype) __LZO_EXTERN_C LZO_PUBLIC_CDECL(_rettype)
#endif
/* exported global variables (LZO currently uses no static variables and
* is fully thread safe) */
#if !defined(LZO_PUBLIC_VAR)
# define LZO_PUBLIC_VAR(_type) \
__LZO_EXPORT1 _type __LZO_EXPORT2 __LZO_DMODEL
#endif
#if !defined(LZO_EXTERN_VAR)
# define LZO_EXTERN_VAR(_type) extern LZO_PUBLIC_VAR(_type)
#endif
/***********************************************************************
// error codes and prototypes
************************************************************************/
/* Error codes for the compression/decompression functions. Negative
* values are errors, positive values will be used for special but
* normal events.
*/
#define LZO_E_OK 0
#define LZO_E_ERROR (-1)
#define LZO_E_OUT_OF_MEMORY (-2) /* not used right now */
#define LZO_E_NOT_COMPRESSIBLE (-3) /* not used right now */
#define LZO_E_INPUT_OVERRUN (-4)
#define LZO_E_OUTPUT_OVERRUN (-5)
#define LZO_E_LOOKBEHIND_OVERRUN (-6)
#define LZO_E_EOF_NOT_FOUND (-7)
#define LZO_E_INPUT_NOT_CONSUMED (-8)
/* lzo_init() should be the first function you call.
* Check the return code !
*
* lzo_init() is a macro to allow checking that the library and the
* compiler's view of various types are consistent.
*/
#define lzo_init() __lzo_init2(LZO_VERSION,(int)sizeof(short),(int)sizeof(int),\
(int)sizeof(long),(int)sizeof(lzo_uint32),(int)sizeof(lzo_uint),\
(int)lzo_sizeof_dict_t,(int)sizeof(char *),(int)sizeof(lzo_voidp),\
(int)sizeof(lzo_compress_t))
LZO_EXTERN(int) __lzo_init2(unsigned,int,int,int,int,int,int,int,int,int);
/* version functions (useful for shared libraries) */
LZO_EXTERN(unsigned) lzo_version(void);
LZO_EXTERN(const char *) lzo_version_string(void);
LZO_EXTERN(const char *) lzo_version_date(void);
LZO_EXTERN(const lzo_charp) _lzo_version_string(void);
LZO_EXTERN(const lzo_charp) _lzo_version_date(void);
/* string functions */
LZO_EXTERN(int)
lzo_memcmp(const lzo_voidp _s1, const lzo_voidp _s2, lzo_uint _len);
LZO_EXTERN(lzo_voidp)
lzo_memcpy(lzo_voidp _dest, const lzo_voidp _src, lzo_uint _len);
LZO_EXTERN(lzo_voidp)
lzo_memmove(lzo_voidp _dest, const lzo_voidp _src, lzo_uint _len);
LZO_EXTERN(lzo_voidp)
lzo_memset(lzo_voidp _s, int _c, lzo_uint _len);
/* checksum functions */
LZO_EXTERN(lzo_uint32)
lzo_adler32(lzo_uint32 _adler, const lzo_byte *_buf, lzo_uint _len);
LZO_EXTERN(lzo_uint32)
lzo_crc32(lzo_uint32 _c, const lzo_byte *_buf, lzo_uint _len);
/* misc. */
LZO_EXTERN(lzo_bool) lzo_assert(int _expr);
LZO_EXTERN(int) _lzo_config_check(void);
typedef union { lzo_bytep p; lzo_uint u; } __lzo_pu_u;
typedef union { lzo_bytep p; lzo_uint32 u32; } __lzo_pu32_u;
typedef union { void *vp; lzo_bytep bp; lzo_uint32 u32; long l; } lzo_align_t;
/* align a char pointer on a boundary that is a multiple of `size' */
LZO_EXTERN(unsigned) __lzo_align_gap(const lzo_voidp _ptr, lzo_uint _size);
#define LZO_PTR_ALIGN_UP(_ptr,_size) \
((_ptr) + (lzo_uint) __lzo_align_gap((const lzo_voidp)(_ptr),(lzo_uint)(_size)))
/* deprecated - only for backward compatibility */
#define LZO_ALIGN(_ptr,_size) LZO_PTR_ALIGN_UP(_ptr,_size)
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* already included */
|
Added work/contrib/lzo/lzo-1.08/include/lzoutil.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
/* lzoutil.h -- utilitiy functions for use by applications
This file is part of the LZO real-time data compression library.
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/opensource/lzo/
*/
#ifndef __LZOUTIL_H
#define __LZOUTIL_H
#ifndef __LZOCONF_H
#include <lzoconf.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/***********************************************************************
// portable memory allocation
//
// The LZO library does not allocate any memory (you always pass a
// pre-allocated pointer via the `wrkmem' parameter), but these
// functions are handy for application programs.
************************************************************************/
LZO_EXTERN(lzo_voidp) lzo_alloc(lzo_uint _nelems, lzo_uint _size);
LZO_EXTERN(lzo_voidp) lzo_malloc(lzo_uint _size);
LZO_EXTERN(void) lzo_free(lzo_voidp _ptr);
typedef lzo_voidp (__LZO_ENTRY *lzo_alloc_hook_t) (lzo_uint, lzo_uint);
typedef void (__LZO_ENTRY *lzo_free_hook_t) (lzo_voidp);
LZO_EXTERN_VAR(lzo_alloc_hook_t) lzo_alloc_hook;
LZO_EXTERN_VAR(lzo_free_hook_t) lzo_free_hook;
/***********************************************************************
// portable file io
************************************************************************/
#if !defined(LZO_FILEP)
# define LZO_FILEP void *
#endif
LZO_EXTERN(lzo_uint)
lzo_fread(LZO_FILEP f, lzo_voidp buf, lzo_uint size);
LZO_EXTERN(lzo_uint)
lzo_fwrite(LZO_FILEP f, const lzo_voidp buf, lzo_uint size);
#if (LZO_UINT_MAX <= UINT_MAX)
# define lzo_fread(f,b,s) (fread(b,1,s,f))
# define lzo_fwrite(f,b,s) (fwrite(b,1,s,f))
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* already included */
|
Added work/contrib/lzo/lzo-1.08/libtool.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
|
#! /bin/sh
# libtool - Provide generalized library-building support services.
# Generated automatically by (GNU lzo 1.08)
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
#
# Copyright (C) 1996-2000 Free Software Foundation, Inc.
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# A sed that does not truncate output.
SED="/usr/bin/sed"
# Sed that helps us avoid accidentally triggering echo(1) options like -n.
Xsed="/usr/bin/sed -e s/^X//"
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
# ### BEGIN LIBTOOL CONFIG
# Libtool was configured on host unleaded:
# Shell to use when invoking shell scripts.
SHELL="/bin/sh"
# Whether or not to build shared libraries.
build_libtool_libs=yes
# Whether or not to build static libraries.
build_old_libs=yes
# Whether or not to add -lc for building shared libraries.
build_libtool_need_lc=no
# Whether or not to optimize for fast installation.
fast_install=yes
# The host system.
host_alias=
host=i586-pc-linux-gnu
# An echo program that does not interpret backslashes.
echo="echo"
# The archiver.
AR="ar"
AR_FLAGS="cru"
# The default C compiler.
CC="gcc"
# Is the compiler the GNU C compiler?
with_gcc=yes
# The linker used to build libraries.
LD="/usr/bin/ld"
# Whether we need hard or soft links.
LN_S="ln -s"
# A BSD-compatible nm program.
NM="/usr/bin/nm -B"
# A symbol stripping program
STRIP=strip
# Used to examine libraries when file_magic_cmd begins "file"
MAGIC_CMD=file
# Used on cygwin: DLL creation program.
DLLTOOL="dlltool"
# Used on cygwin: object dumper.
OBJDUMP="objdump"
# Used on cygwin: assembler.
AS="as"
# The name of the directory that contains temporary libtool files.
objdir=.libs
# How to create reloadable object files.
reload_flag=" -r"
reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
# How to pass a linker flag through the compiler.
wl="-Wl,"
# Object file suffix (normally "o").
objext="o"
# Old archive suffix (normally "a").
libext="a"
# Executable file suffix (normally "").
exeext=""
# Additional compiler flags for building library objects.
pic_flag=" -fPIC"
pic_mode=default
# Does compiler simultaneously support -c and -o options?
compiler_c_o="yes"
# Can we write directly to a .lo ?
compiler_o_lo="yes"
# Must we lock files when doing compilation ?
need_locks="no"
# Do we need the lib prefix for modules?
need_lib_prefix=no
# Do we need a version for libraries?
need_version=no
# Whether dlopen is supported.
dlopen_support=unknown
# Whether dlopen of programs is supported.
dlopen_self=unknown
# Whether dlopen of statically linked programs is supported.
dlopen_self_static=unknown
# Compiler flag to prevent dynamic linking.
link_static_flag="-static"
# Compiler flag to turn off builtin functions.
no_builtin_flag=" -fno-builtin -fno-rtti -fno-exceptions"
# Compiler flag to allow reflexive dlopens.
export_dynamic_flag_spec="\${wl}--export-dynamic"
# Compiler flag to generate shared objects directly from archives.
whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
# Compiler flag to generate thread-safe objects.
thread_safe_flag_spec=""
# Library versioning type.
version_type=linux
# Format of library name prefix.
libname_spec="lib\$name"
# List of archive names. First name is the real one, the rest are links.
# The last name is the one that the linker finds with -lNAME.
library_names_spec="\${libname}\${release}.so\$versuffix \${libname}\${release}.so\$major \$libname.so"
# The coded name of the library, if different from the real name.
soname_spec="\${libname}\${release}.so\$major"
# Commands used to build and install an old-style archive.
RANLIB="ranlib"
old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
old_postuninstall_cmds=""
# Create an old-style archive from a shared archive.
old_archive_from_new_cmds=""
# Create a temporary old-style archive to link instead of a shared archive.
old_archive_from_expsyms_cmds=""
# Commands used to build and install a shared archive.
archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
archive_expsym_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
postinstall_cmds=""
postuninstall_cmds=""
# Commands to strip libraries.
old_striplib="strip --strip-debug"
striplib="strip --strip-unneeded"
# Method to check whether dependent libraries are shared objects.
deplibs_check_method="pass_all"
# Command to use when deplibs_check_method == file_magic.
file_magic_cmd="\$MAGIC_CMD"
# Flag that allows shared libraries with undefined symbols to be built.
allow_undefined_flag=""
# Flag that forces no undefined symbols.
no_undefined_flag=""
# Commands used to finish a libtool library installation in a directory.
finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
# Same as above, but a single script fragment to be evaled but not shown.
finish_eval=""
# Take the output of nm and produce a listing of raw symbols and C names.
global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGISTW][ABCDGISTW]*\\)[ ][ ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
# Transform the output of nm in a proper C declaration
global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern char \\1;/p'"
# Transform the output of nm in a C name address pair
global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
# This is the shared library runtime path variable.
runpath_var=LD_RUN_PATH
# This is the shared library path variable.
shlibpath_var=LD_LIBRARY_PATH
# Is shlibpath searched before the hard-coded library search path?
shlibpath_overrides_runpath=no
# How to hardcode a shared library path into an executable.
hardcode_action=immediate
# Whether we should hardcode library paths into libraries.
hardcode_into_libs=yes
# Flag to hardcode $libdir into a binary during linking.
# This must work even if $libdir does not exist.
hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
# Whether we need a single -rpath flag with a separated argument.
hardcode_libdir_separator=""
# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
# resulting binary.
hardcode_direct=no
# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
# resulting binary.
hardcode_minus_L=no
# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
# the resulting binary.
hardcode_shlibpath_var=unsupported
# Variables whose values should be saved in libtool wrapper scripts and
# restored at relink time.
variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
# Whether libtool must link a program against all its dependency libraries.
link_all_deplibs=unknown
# Compile-time system search path for libraries
sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
# Run-time system search path for libraries
sys_lib_dlsearch_path_spec="/lib /usr/lib"
# Fix the shell variable $srcfile for the compiler.
fix_srcfile_path=""
# Set to yes if exported symbols are required.
always_export_symbols=no
# The commands to list exported symbols.
export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | sed 's/.* //' | sort | uniq > \$export_symbols"
# The commands to extract the exported symbol list from a shared archive.
extract_expsyms_cmds=""
# Symbols that should not be listed in the preloaded symbols.
exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
# Symbols that must always be exported.
include_expsyms=""
# ### END LIBTOOL CONFIG
# ltmain.sh - Provide generalized library-building support services.
# NOTE: Changing this file will not affect anything until you rerun configure.
#
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
# Free Software Foundation, Inc.
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Check that we have a working $echo.
if test "X$1" = X--no-reexec; then
# Discard the --no-reexec flag, and continue.
shift
elif test "X$1" = X--fallback-echo; then
# Avoid inline document here, it may be left over
:
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
# Yippee, $echo works!
:
else
# Restart under the correct shell, and then maybe $echo will work.
exec $SHELL "$0" --no-reexec ${1+"$@"}
fi
if test "X$1" = X--fallback-echo; then
# used as fallback echo
shift
cat <<EOF
$*
EOF
exit 0
fi
# The name of this program.
progname=`$echo "$0" | ${SED} 's%^.*/%%'`
modename="$progname"
# Constants.
PROGRAM=ltmain.sh
PACKAGE=libtool
VERSION=1.4.2a
TIMESTAMP=" (1.922.2.93 2002/05/06 15:02:58)"
default_mode=
help="Try \`$progname --help' for more information."
magic="%%%MAGIC variable%%%"
mkdir="mkdir"
mv="mv -f"
rm="rm -f"
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
Xsed="${SED}"' -e 1s/^X//'
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
# test EBCDIC or ASCII
case `echo A|od -x` in
*[Cc]1*) # EBCDIC based system
SP2NL="tr '\100' '\n'"
NL2SP="tr '\r\n' '\100\100'"
;;
*) # Assume ASCII based system
SP2NL="tr '\040' '\012'"
NL2SP="tr '\015\012' '\040\040'"
;;
esac
# NLS nuisances.
# Only set LANG and LC_ALL to C if already set.
# These must not be set unconditionally because not all systems understand
# e.g. LANG=C (notably SCO).
# We save the old values to restore during execute mode.
if test "${LC_ALL+set}" = set; then
save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
fi
if test "${LANG+set}" = set; then
save_LANG="$LANG"; LANG=C; export LANG
fi
# Make sure IFS has a sensible default
: ${IFS=" "}
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
echo "$modename: not configured to build any kind of library" 1>&2
echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
exit 1
fi
# Global variables.
mode=$default_mode
nonopt=
prev=
prevopt=
run=
show="$echo"
show_help=
execute_dlfiles=
lo2o="s/\\.lo\$/.${objext}/"
o2lo="s/\\.${objext}\$/.lo/"
# Parse our command line options once, thoroughly.
while test $# -gt 0
do
arg="$1"
shift
case $arg in
-*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
# If the previous option needs an argument, assign it.
if test -n "$prev"; then
case $prev in
execute_dlfiles)
execute_dlfiles="$execute_dlfiles $arg"
;;
*)
eval "$prev=\$arg"
;;
esac
prev=
prevopt=
continue
fi
# Have we seen a non-optional argument yet?
case $arg in
--help)
show_help=yes
;;
--version)
echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
exit 0
;;
--config)
${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
exit 0
;;
--debug)
echo "$progname: enabling shell trace mode"
set -x
;;
--dry-run | -n)
run=:
;;
--features)
echo "host: $host"
if test "$build_libtool_libs" = yes; then
echo "enable shared libraries"
else
echo "disable shared libraries"
fi
if test "$build_old_libs" = yes; then
echo "enable static libraries"
else
echo "disable static libraries"
fi
exit 0
;;
--finish) mode="finish" ;;
--mode) prevopt="--mode" prev=mode ;;
--mode=*) mode="$optarg" ;;
--preserve-dup-deps) duplicate_deps="yes" ;;
--quiet | --silent)
show=:
;;
-dlopen)
prevopt="-dlopen"
prev=execute_dlfiles
;;
-*)
$echo "$modename: unrecognized option \`$arg'" 1>&2
$echo "$help" 1>&2
exit 1
;;
*)
nonopt="$arg"
break
;;
esac
done
if test -n "$prevopt"; then
$echo "$modename: option \`$prevopt' requires an argument" 1>&2
$echo "$help" 1>&2
exit 1
fi
# If this variable is set in any of the actions, the command in it
# will be execed at the end. This prevents here-documents from being
# left over by shells.
exec_cmd=
if test -z "$show_help"; then
# Infer the operation mode.
if test -z "$mode"; then
case $nonopt in
*cc | *++ | gcc* | *-gcc*)
mode=link
for arg
do
case $arg in
-c)
mode=compile
break
;;
esac
done
;;
*db | *dbx | *strace | *truss)
mode=execute
;;
*install*|cp|mv)
mode=install
;;
*rm)
mode=uninstall
;;
*)
# If we have no mode, but dlfiles were specified, then do execute mode.
test -n "$execute_dlfiles" && mode=execute
# Just use the default operation mode.
if test -z "$mode"; then
if test -n "$nonopt"; then
$echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
else
$echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
fi
fi
;;
esac
fi
# Only execute mode is allowed to have -dlopen flags.
if test -n "$execute_dlfiles" && test "$mode" != execute; then
$echo "$modename: unrecognized option \`-dlopen'" 1>&2
$echo "$help" 1>&2
exit 1
fi
# Change the help message to a mode-specific one.
generic_help="$help"
help="Try \`$modename --help --mode=$mode' for more information."
# These modes are in order of execution frequency so that they run quickly.
case $mode in
# libtool compile mode
compile)
modename="$modename: compile"
# Get the compilation command and the source file.
base_compile=
prev=
lastarg=
srcfile="$nonopt"
suppress_output=
user_target=no
for arg
do
case $prev in
"") ;;
xcompiler)
# Aesthetically quote the previous argument.
prev=
lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
case $arg in
# Double-quote args containing other shell metacharacters.
# Many Bourne shells cannot handle close brackets correctly
# in scan sets, so we specify it separately.
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
arg="\"$arg\""
;;
esac
# Add the previous argument to base_compile.
if test -z "$base_compile"; then
base_compile="$lastarg"
else
base_compile="$base_compile $lastarg"
fi
continue
;;
esac
# Accept any command-line options.
case $arg in
-o)
if test "$user_target" != "no"; then
$echo "$modename: you cannot specify \`-o' more than once" 1>&2
exit 1
fi
user_target=next
;;
-static)
build_old_libs=yes
continue
;;
-prefer-pic)
pic_mode=yes
continue
;;
-prefer-non-pic)
pic_mode=no
continue
;;
-Xcompiler)
prev=xcompiler
continue
;;
-Wc,*)
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
lastarg=
save_ifs="$IFS"; IFS=','
for arg in $args; do
IFS="$save_ifs"
# Double-quote args containing other shell metacharacters.
# Many Bourne shells cannot handle close brackets correctly
# in scan sets, so we specify it separately.
case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
arg="\"$arg\""
;;
esac
lastarg="$lastarg $arg"
done
IFS="$save_ifs"
lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
# Add the arguments to base_compile.
if test -z "$base_compile"; then
base_compile="$lastarg"
else
base_compile="$base_compile $lastarg"
fi
continue
;;
esac
case $user_target in
next)
# The next one is the -o target name
user_target=yes
continue
;;
yes)
# We got the output file
user_target=set
libobj="$arg"
continue
;;
esac
# Accept the current argument as the source file.
lastarg="$srcfile"
srcfile="$arg"
# Aesthetically quote the previous argument.
# Backslashify any backslashes, double quotes, and dollar signs.
# These are the only characters that are still specially
# interpreted inside of double-quoted scrings.
lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
# Double-quote args containing other shell metacharacters.
# Many Bourne shells cannot handle close brackets correctly
# in scan sets, so we specify it separately.
case $lastarg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
lastarg="\"$lastarg\""
;;
esac
# Add the previous argument to base_compile.
if test -z "$base_compile"; then
base_compile="$lastarg"
else
base_compile="$base_compile $lastarg"
fi
done
case $user_target in
set)
;;
no)
# Get the name of the library object.
libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
;;
*)
$echo "$modename: you must specify a target with \`-o'" 1>&2
exit 1
;;
esac
# Recognize several different file suffixes.
# If the user specifies -o file.o, it is replaced with file.lo
xform='[cCFSfmso]'
case $libobj in
*.ada) xform=ada ;;
*.adb) xform=adb ;;
*.ads) xform=ads ;;
*.asm) xform=asm ;;
*.c++) xform=c++ ;;
*.cc) xform=cc ;;
*.cpp) xform=cpp ;;
*.cxx) xform=cxx ;;
*.f90) xform=f90 ;;
*.for) xform=for ;;
esac
libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
case $libobj in
*.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
*)
$echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
exit 1
;;
esac
if test -z "$base_compile"; then
$echo "$modename: you must specify a compilation command" 1>&2
$echo "$help" 1>&2
exit 1
fi
# Delete any leftover library objects.
if test "$build_old_libs" = yes; then
removelist="$obj $libobj"
else
removelist="$libobj"
fi
$run $rm $removelist
trap "$run $rm $removelist; exit 1" 1 2 15
# On Cygwin there's no "real" PIC flag so we must build both object types
case $host_os in
cygwin* | mingw* | pw32* | os2*)
pic_mode=default
;;
esac
if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
# non-PIC code in shared libraries is not supported
pic_mode=default
fi
# Calculate the filename of the output object if compiler does
# not support -o with -c
if test "$compiler_c_o" = no; then
output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
lockfile="$output_obj.lock"
removelist="$removelist $output_obj $lockfile"
trap "$run $rm $removelist; exit 1" 1 2 15
else
need_locks=no
lockfile=
fi
# Lock this critical section if it is needed
# We use this script file to make the link, it avoids creating a new file
if test "$need_locks" = yes; then
until $run ln "$0" "$lockfile" 2>/dev/null; do
$show "Waiting for $lockfile to be removed"
sleep 2
done
elif test "$need_locks" = warn; then
if test -f "$lockfile"; then
echo "\
*** ERROR, $lockfile exists and contains:
`cat $lockfile 2>/dev/null`
This indicates that another process is trying to use the same
temporary object file, and libtool could not work around it because
your compiler does not support \`-c' and \`-o' together. If you
repeat this compilation, it may succeed, by chance, but you had better
avoid parallel builds (make -j) in this platform, or get a better
compiler."
$run $rm $removelist
exit 1
fi
echo $srcfile > "$lockfile"
fi
if test -n "$fix_srcfile_path"; then
eval srcfile=\"$fix_srcfile_path\"
fi
# Only build a PIC object if we are building libtool libraries.
if test "$build_libtool_libs" = yes; then
# Without this assignment, base_compile gets emptied.
fbsd_hideous_sh_bug=$base_compile
if test "$pic_mode" != no; then
# All platforms use -DPIC, to notify preprocessed assembler code.
command="$base_compile $srcfile $pic_flag -DPIC"
else
# Don't build PIC code
command="$base_compile $srcfile"
fi
if test "$build_old_libs" = yes; then
lo_libobj="$libobj"
dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
if test "X$dir" = "X$libobj"; then
dir="$objdir"
else
dir="$dir/$objdir"
fi
libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
if test -d "$dir"; then
$show "$rm $libobj"
$run $rm $libobj
else
$show "$mkdir $dir"
$run $mkdir $dir
status=$?
if test $status -ne 0 && test ! -d $dir; then
exit $status
fi
fi
fi
if test "$compiler_o_lo" = yes; then
output_obj="$libobj"
command="$command -o $output_obj"
elif test "$compiler_c_o" = yes; then
output_obj="$obj"
command="$command -o $output_obj"
fi
$run $rm "$output_obj"
$show "$command"
if $run eval "$command"; then :
else
test -n "$output_obj" && $run $rm $removelist
exit 1
fi
if test "$need_locks" = warn &&
test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
echo "\
*** ERROR, $lockfile contains:
`cat $lockfile 2>/dev/null`
but it should contain:
$srcfile
This indicates that another process is trying to use the same
temporary object file, and libtool could not work around it because
your compiler does not support \`-c' and \`-o' together. If you
repeat this compilation, it may succeed, by chance, but you had better
avoid parallel builds (make -j) in this platform, or get a better
compiler."
$run $rm $removelist
exit 1
fi
# Just move the object if needed, then go on to compile the next one
if test x"$output_obj" != x"$libobj"; then
$show "$mv $output_obj $libobj"
if $run $mv $output_obj $libobj; then :
else
error=$?
$run $rm $removelist
exit $error
fi
fi
# If we have no pic_flag, then copy the object into place and finish.
if (test -z "$pic_flag" || test "$pic_mode" != default) &&
test "$build_old_libs" = yes; then
# Rename the .lo from within objdir to obj
if test -f $obj; then
$show $rm $obj
$run $rm $obj
fi
$show "$mv $libobj $obj"
if $run $mv $libobj $obj; then :
else
error=$?
$run $rm $removelist
exit $error
fi
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
if test "X$xdir" = "X$obj"; then
xdir="."
else
xdir="$xdir"
fi
baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
# Now arrange that obj and lo_libobj become the same file
$show "(cd $xdir && $LN_S $baseobj $libobj)"
if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
# Unlock the critical section if it was locked
if test "$need_locks" != no; then
$run $rm "$lockfile"
fi
exit 0
else
error=$?
$run $rm $removelist
exit $error
fi
fi
# Allow error messages only from the first compilation.
suppress_output=' >/dev/null 2>&1'
fi
# Only build a position-dependent object if we build old libraries.
if test "$build_old_libs" = yes; then
if test "$pic_mode" != yes; then
# Don't build PIC code
command="$base_compile $srcfile"
else
# All platforms use -DPIC, to notify preprocessed assembler code.
command="$base_compile $srcfile $pic_flag -DPIC"
fi
if test "$compiler_c_o" = yes; then
command="$command -o $obj"
output_obj="$obj"
fi
# Suppress compiler output if we already did a PIC compilation.
command="$command$suppress_output"
$run $rm "$output_obj"
$show "$command"
if $run eval "$command"; then :
else
$run $rm $removelist
exit 1
fi
if test "$need_locks" = warn &&
test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
echo "\
*** ERROR, $lockfile contains:
`cat $lockfile 2>/dev/null`
but it should contain:
$srcfile
This indicates that another process is trying to use the same
temporary object file, and libtool could not work around it because
your compiler does not support \`-c' and \`-o' together. If you
repeat this compilation, it may succeed, by chance, but you had better
avoid parallel builds (make -j) in this platform, or get a better
compiler."
$run $rm $removelist
exit 1
fi
# Just move the object if needed
if test x"$output_obj" != x"$obj"; then
$show "$mv $output_obj $obj"
if $run $mv $output_obj $obj; then :
else
error=$?
$run $rm $removelist
exit $error
fi
fi
# Create an invalid libtool object if no PIC, so that we do not
# accidentally link it into a program.
if test "$build_libtool_libs" != yes; then
$show "echo timestamp > $libobj"
$run eval "echo timestamp > \$libobj" || exit $?
else
# Move the .lo from within objdir
$show "$mv $libobj $lo_libobj"
if $run $mv $libobj $lo_libobj; then :
else
error=$?
$run $rm $removelist
exit $error
fi
fi
fi
# Unlock the critical section if it was locked
if test "$need_locks" != no; then
$run $rm "$lockfile"
fi
exit 0
;;
# libtool link mode
link | relink)
modename="$modename: link"
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
# It is impossible to link a dll without this setting, and
# we shouldn't force the makefile maintainer to figure out
# which system we are compiling for in order to pass an extra
# flag for every libtool invokation.
# allow_undefined=no
# FIXME: Unfortunately, there are problems with the above when trying
# to make a dll which has undefined symbols, in which case not
# even a static library is built. For now, we need to specify
# -no-undefined on the libtool link line when we can be certain
# that all symbols are satisfied, otherwise we get a static library.
allow_undefined=yes
;;
*)
allow_undefined=yes
;;
esac
libtool_args="$nonopt"
compile_command="$nonopt"
finalize_command="$nonopt"
compile_rpath=
finalize_rpath=
compile_shlibpath=
finalize_shlibpath=
convenience=
old_convenience=
deplibs=
old_deplibs=
compiler_flags=
linker_flags=
dllsearchpath=
lib_search_path=`pwd`
avoid_version=no
dlfiles=
dlprefiles=
dlself=no
export_dynamic=no
export_symbols=
export_symbols_regex=
generated=
libobjs=
ltlibs=
module=no
no_install=no
objs=
prefer_static_libs=no
preload=no
prev=
prevarg=
release=
rpath=
xrpath=
perm_rpath=
temp_rpath=
thread_safe=no
vinfo=
# We need to know -static, to get the right output filenames.
for arg
do
case $arg in
-all-static | -static)
if test "X$arg" = "X-all-static"; then
if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
$echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
fi
if test -n "$link_static_flag"; then
dlopen_self=$dlopen_self_static
fi
else
if test -z "$pic_flag" && test -n "$link_static_flag"; then
dlopen_self=$dlopen_self_static
fi
fi
build_libtool_libs=no
build_old_libs=yes
prefer_static_libs=yes
break
;;
esac
done
# See if our shared archives depend on static archives.
test -n "$old_archive_from_new_cmds" && build_old_libs=yes
# Go through the arguments, transforming them on the way.
while test $# -gt 0; do
arg="$1"
shift
case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
;;
*) qarg=$arg ;;
esac
libtool_args="$libtool_args $qarg"
# If the previous option needs an argument, assign it.
if test -n "$prev"; then
case $prev in
output)
compile_command="$compile_command @OUTPUT@"
finalize_command="$finalize_command @OUTPUT@"
;;
esac
case $prev in
dlfiles|dlprefiles)
if test "$preload" = no; then
# Add the symbol object into the linking commands.
compile_command="$compile_command @SYMFILE@"
finalize_command="$finalize_command @SYMFILE@"
preload=yes
fi
case $arg in
*.la | *.lo) ;; # We handle these cases below.
force)
if test "$dlself" = no; then
dlself=needless
export_dynamic=yes
fi
prev=
continue
;;
self)
if test "$prev" = dlprefiles; then
dlself=yes
elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
dlself=yes
else
dlself=needless
export_dynamic=yes
fi
prev=
continue
;;
*)
if test "$prev" = dlfiles; then
dlfiles="$dlfiles $arg"
else
dlprefiles="$dlprefiles $arg"
fi
prev=
continue
;;
esac
;;
expsyms)
export_symbols="$arg"
if test ! -f "$arg"; then
$echo "$modename: symbol file \`$arg' does not exist"
exit 1
fi
prev=
continue
;;
expsyms_regex)
export_symbols_regex="$arg"
prev=
continue
;;
release)
release="-$arg"
prev=
continue
;;
rpath | xrpath)
# We need an absolute path.
case $arg in
[\\/]* | [A-Za-z]:[\\/]*) ;;
*)
$echo "$modename: only absolute run-paths are allowed" 1>&2
exit 1
;;
esac
if test "$prev" = rpath; then
case "$rpath " in
*" $arg "*) ;;
*) rpath="$rpath $arg" ;;
esac
else
case "$xrpath " in
*" $arg "*) ;;
*) xrpath="$xrpath $arg" ;;
esac
fi
prev=
continue
;;
xcompiler)
compiler_flags="$compiler_flags $qarg"
prev=
compile_command="$compile_command $qarg"
finalize_command="$finalize_command $qarg"
continue
;;
xlinker)
linker_flags="$linker_flags $qarg"
compiler_flags="$compiler_flags $wl$qarg"
prev=
compile_command="$compile_command $wl$qarg"
finalize_command="$finalize_command $wl$qarg"
continue
;;
*)
eval "$prev=\"\$arg\""
prev=
continue
;;
esac
fi # test -n $prev
prevarg="$arg"
case $arg in
-all-static)
if test -n "$link_static_flag"; then
compile_command="$compile_command $link_static_flag"
finalize_command="$finalize_command $link_static_flag"
fi
continue
;;
-allow-undefined)
# FIXME: remove this flag sometime in the future.
$echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
continue
;;
-avoid-version)
avoid_version=yes
continue
;;
-dlopen)
prev=dlfiles
continue
;;
-dlpreopen)
prev=dlprefiles
continue
;;
-export-dynamic)
export_dynamic=yes
continue
;;
-export-symbols | -export-symbols-regex)
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
$echo "$modename: more than one -exported-symbols argument is not allowed"
exit 1
fi
if test "X$arg" = "X-export-symbols"; then
prev=expsyms
else
prev=expsyms_regex
fi
continue
;;
# The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
# so, if we see these flags be careful not to treat them like -L
-L[A-Z][A-Z]*:*)
case $with_gcc/$host in
no/*-*-irix* | no/*-*-nonstopux*)
compile_command="$compile_command $arg"
finalize_command="$finalize_command $arg"
;;
esac
continue
;;
-L*)
dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
# We need an absolute path.
case $dir in
[\\/]* | [A-Za-z]:[\\/]*) ;;
*)
absdir=`cd "$dir" && pwd`
if test -z "$absdir"; then
$echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
exit 1
fi
dir="$absdir"
;;
esac
case "$deplibs " in
*" -L$dir "*) ;;
*)
deplibs="$deplibs -L$dir"
lib_search_path="$lib_search_path $dir"
;;
esac
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
case :$dllsearchpath: in
*":$dir:"*) ;;
*) dllsearchpath="$dllsearchpath:$dir";;
esac
;;
esac
continue
;;
-l*)
if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
case $host in
*-*-cygwin* | *-*-pw32* | *-*-beos*)
# These systems don't actually have a C or math library (as such)
continue
;;
*-*-mingw* | *-*-os2*)
# These systems don't actually have a C library (as such)
test "X$arg" = "X-lc" && continue
;;
*-*-openbsd* | *-*-freebsd*)
# Do not include libc due to us having libc/libc_r.
test "X$arg" = "X-lc" && continue
;;
esac
elif test "X$arg" = "X-lc_r"; then
case $host in
*-*-openbsd* | *-*-freebsd*)
# Do not include libc_r directly, use -pthread flag.
continue
;;
esac
fi
deplibs="$deplibs $arg"
continue
;;
-module)
module=yes
continue
;;
-no-fast-install)
fast_install=no
continue
;;
-no-install)
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
# The PATH hackery in wrapper scripts is required on Windows
# in order for the loader to find any dlls it needs.
$echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
$echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
fast_install=no
;;
*) no_install=yes ;;
esac
continue
;;
-no-undefined)
allow_undefined=no
continue
;;
-o) prev=output ;;
-release)
prev=release
continue
;;
-rpath)
prev=rpath
continue
;;
-R)
prev=xrpath
continue
;;
-R*)
dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
# We need an absolute path.
case $dir in
[\\/]* | [A-Za-z]:[\\/]*) ;;
*)
$echo "$modename: only absolute run-paths are allowed" 1>&2
exit 1
;;
esac
case "$xrpath " in
*" $dir "*) ;;
*) xrpath="$xrpath $dir" ;;
esac
continue
;;
-static)
# The effects of -static are defined in a previous loop.
# We used to do the same as -all-static on platforms that
# didn't have a PIC flag, but the assumption that the effects
# would be equivalent was wrong. It would break on at least
# Digital Unix and AIX.
continue
;;
-thread-safe)
thread_safe=yes
continue
;;
-version-info)
prev=vinfo
continue
;;
-Wc,*)
args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
arg=
save_ifs="$IFS"; IFS=','
for flag in $args; do
IFS="$save_ifs"
case $flag in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
flag="\"$flag\""
;;
esac
arg="$arg $wl$flag"
compiler_flags="$compiler_flags $flag"
done
IFS="$save_ifs"
arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
;;
-Wl,*)
args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
arg=
save_ifs="$IFS"; IFS=','
for flag in $args; do
IFS="$save_ifs"
case $flag in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
flag="\"$flag\""
;;
esac
arg="$arg $wl$flag"
compiler_flags="$compiler_flags $wl$flag"
linker_flags="$linker_flags $flag"
done
IFS="$save_ifs"
arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
;;
-Xcompiler)
prev=xcompiler
continue
;;
-Xlinker)
prev=xlinker
continue
;;
# Some other compiler flag.
-* | +*)
# Unknown arguments in both finalize_command and compile_command need
# to be aesthetically quoted because they are evaled later.
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
arg="\"$arg\""
;;
esac
;;
*.lo | *.$objext)
# A library or standard object.
if test "$prev" = dlfiles; then
# This file was specified with -dlopen.
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
dlfiles="$dlfiles $arg"
prev=
continue
else
# If libtool objects are unsupported, then we need to preload.
prev=dlprefiles
fi
fi
if test "$prev" = dlprefiles; then
# Preload the old-style object.
dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
prev=
else
case $arg in
*.lo) libobjs="$libobjs $arg" ;;
*) objs="$objs $arg" ;;
esac
fi
;;
*.$libext)
# An archive.
deplibs="$deplibs $arg"
old_deplibs="$old_deplibs $arg"
continue
;;
*.la)
# A libtool-controlled library.
if test "$prev" = dlfiles; then
# This library was specified with -dlopen.
dlfiles="$dlfiles $arg"
prev=
elif test "$prev" = dlprefiles; then
# The library was specified with -dlpreopen.
dlprefiles="$dlprefiles $arg"
prev=
else
deplibs="$deplibs $arg"
fi
continue
;;
# Some other compiler argument.
*)
# Unknown arguments in both finalize_command and compile_command need
# to be aesthetically quoted because they are evaled later.
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
arg="\"$arg\""
;;
esac
;;
esac # arg
# Now actually substitute the argument into the commands.
if test -n "$arg"; then
compile_command="$compile_command $arg"
finalize_command="$finalize_command $arg"
fi
done # argument parsing loop
if test -n "$prev"; then
$echo "$modename: the \`$prevarg' option requires an argument" 1>&2
$echo "$help" 1>&2
exit 1
fi
if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
eval arg=\"$export_dynamic_flag_spec\"
compile_command="$compile_command $arg"
finalize_command="$finalize_command $arg"
fi
# calculate the name of the file, without its directory
outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
libobjs_save="$libobjs"
if test -n "$shlibpath_var"; then
# get the directories listed in $shlibpath_var
eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
else
shlib_search_path=
fi
eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
if test "X$output_objdir" = "X$output"; then
output_objdir="$objdir"
else
output_objdir="$output_objdir/$objdir"
fi
# Create the object directory.
if test ! -d $output_objdir; then
$show "$mkdir $output_objdir"
$run $mkdir $output_objdir
status=$?
if test $status -ne 0 && test ! -d $output_objdir; then
exit $status
fi
fi
# Determine the type of output
case $output in
"")
$echo "$modename: you must specify an output file" 1>&2
$echo "$help" 1>&2
exit 1
;;
*.$libext) linkmode=oldlib ;;
*.lo | *.$objext) linkmode=obj ;;
*.la) linkmode=lib ;;
*) linkmode=prog ;; # Anything else should be a program.
esac
specialdeplibs=
libs=
# Find all interdependent deplibs by searching for libraries
# that are linked more than once (e.g. -la -lb -la)
for deplib in $deplibs; do
if test "X$duplicate_deps" = "Xyes" ; then
case "$libs " in
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
esac
fi
libs="$libs $deplib"
done
deplibs=
newdependency_libs=
newlib_search_path=
need_relink=no # whether we're linking any uninstalled libtool libraries
notinst_deplibs= # not-installed libtool libraries
notinst_path= # paths that contain not-installed libtool libraries
case $linkmode in
lib)
passes="conv link"
for file in $dlfiles $dlprefiles; do
case $file in
*.la) ;;
*)
$echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
exit 1
;;
esac
done
;;
prog)
compile_deplibs=
finalize_deplibs=
alldeplibs=no
newdlfiles=
newdlprefiles=
passes="conv scan dlopen dlpreopen link"
;;
*) passes="conv"
;;
esac
for pass in $passes; do
if test $linkmode = prog; then
# Determine which files to process
case $pass in
dlopen)
libs="$dlfiles"
save_deplibs="$deplibs" # Collect dlpreopened libraries
deplibs=
;;
dlpreopen) libs="$dlprefiles" ;;
link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
esac
fi
for deplib in $libs; do
lib=
found=no
case $deplib in
-l*)
if test $linkmode = oldlib && test $linkmode = obj; then
$echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
continue
fi
if test $pass = conv; then
deplibs="$deplib $deplibs"
continue
fi
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
# Search the libtool library
lib="$searchdir/lib${name}.la"
if test -f "$lib"; then
found=yes
break
fi
done
if test "$found" != yes; then
# deplib doesn't seem to be a libtool library
if test "$linkmode,$pass" = "prog,link"; then
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
else
deplibs="$deplib $deplibs"
test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
fi
continue
fi
;; # -l
-L*)
case $linkmode in
lib)
deplibs="$deplib $deplibs"
test $pass = conv && continue
newdependency_libs="$deplib $newdependency_libs"
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
;;
prog)
if test $pass = conv; then
deplibs="$deplib $deplibs"
continue
fi
if test $pass = scan; then
deplibs="$deplib $deplibs"
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
else
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
fi
;;
*)
$echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
;;
esac # linkmode
continue
;; # -L
-R*)
if test $pass = link; then
dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
# Make sure the xrpath contains only unique directories.
case "$xrpath " in
*" $dir "*) ;;
*) xrpath="$xrpath $dir" ;;
esac
fi
deplibs="$deplib $deplibs"
continue
;;
*.la) lib="$deplib" ;;
*.$libext)
if test $pass = conv; then
deplibs="$deplib $deplibs"
continue
fi
case $linkmode in
lib)
if test "$deplibs_check_method" != pass_all; then
echo
echo "*** Warning: Trying to link with static lib archive $deplib."
echo "*** I have the capability to make that library automatically link in when"
echo "*** you link to this library. But I can only do this if you have a"
echo "*** shared version of the library, which you do not appear to have"
echo "*** because the file extensions .$libext of this argument makes me believe"
echo "*** that it is just a static archive that I should not used here."
else
echo
echo "*** Warning: Linking the shared library $output against the"
echo "*** static library $deplib is not portable!"
deplibs="$deplib $deplibs"
fi
continue
;;
prog)
if test $pass != link; then
deplibs="$deplib $deplibs"
else
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
fi
continue
;;
esac # linkmode
;; # *.$libext
*.lo | *.$objext)
if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
# If there is no dlopen support or we're linking statically,
# we need to preload.
newdlprefiles="$newdlprefiles $deplib"
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
else
newdlfiles="$newdlfiles $deplib"
fi
continue
;;
%DEPLIBS%)
alldeplibs=yes
continue
;;
esac # case $deplib
if test $found = yes || test -f "$lib"; then :
else
$echo "$modename: cannot find the library \`$lib'" 1>&2
exit 1
fi
# Check to see that this really is a libtool archive.
if (${SED} -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
else
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
exit 1
fi
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
test "X$ladir" = "X$lib" && ladir="."
dlname=
dlopen=
dlpreopen=
libdir=
library_names=
old_library=
# If the library was installed with an old release of libtool,
# it will not redefine variable installed.
installed=yes
# Read the .la file
case $lib in
*/* | *\\*) . $lib ;;
*) . ./$lib ;;
esac
if test "$linkmode,$pass" = "lib,link" ||
test "$linkmode,$pass" = "prog,scan" ||
{ test $linkmode = oldlib && test $linkmode = obj; }; then
# Add dl[pre]opened files of deplib
test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
fi
if test $pass = conv; then
# Only check for convenience libraries
deplibs="$lib $deplibs"
if test -z "$libdir"; then
if test -z "$old_library"; then
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
exit 1
fi
# It is a libtool convenience library, so add in its objects.
convenience="$convenience $ladir/$objdir/$old_library"
old_convenience="$old_convenience $ladir/$objdir/$old_library"
tmp_libs=
for deplib in $dependency_libs; do
deplibs="$deplib $deplibs"
if test "X$duplicate_deps" = "Xyes" ; then
case "$tmp_libs " in
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
esac
fi
tmp_libs="$tmp_libs $deplib"
done
elif test $linkmode != prog && test $linkmode != lib; then
$echo "$modename: \`$lib' is not a convenience library" 1>&2
exit 1
fi
continue
fi # $pass = conv
# Get the name of the library we link against.
linklib=
for l in $old_library $library_names; do
linklib="$l"
done
if test -z "$linklib"; then
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
exit 1
fi
# This library was specified with -dlopen.
if test $pass = dlopen; then
if test -z "$libdir"; then
$echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
exit 1
fi
if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
# If there is no dlname, no dlopen support or we're linking
# statically, we need to preload.
dlprefiles="$dlprefiles $lib"
else
newdlfiles="$newdlfiles $lib"
fi
continue
fi # $pass = dlopen
# We need an absolute path.
case $ladir in
[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
*)
abs_ladir=`cd "$ladir" && pwd`
if test -z "$abs_ladir"; then
$echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
$echo "$modename: passing it literally to the linker, although it might fail" 1>&2
abs_ladir="$ladir"
fi
;;
esac
laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
# Find the relevant object directory and library name.
if test "X$installed" = Xyes; then
if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
$echo "$modename: warning: library \`$lib' was moved." 1>&2
dir="$ladir"
absdir="$abs_ladir"
libdir="$abs_ladir"
else
dir="$libdir"
absdir="$libdir"
fi
else
dir="$ladir/$objdir"
absdir="$abs_ladir/$objdir"
# Remove this search path later
notinst_path="$notinst_path $abs_ladir"
fi # $installed = yes
name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
# This library was specified with -dlpreopen.
if test $pass = dlpreopen; then
if test -z "$libdir"; then
$echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
exit 1
fi
# Prefer using a static library (so that no silly _DYNAMIC symbols
# are required to link).
if test -n "$old_library"; then
newdlprefiles="$newdlprefiles $dir/$old_library"
# Otherwise, use the dlname, so that lt_dlopen finds it.
elif test -n "$dlname"; then
newdlprefiles="$newdlprefiles $dir/$dlname"
else
newdlprefiles="$newdlprefiles $dir/$linklib"
fi
fi # $pass = dlpreopen
if test -z "$libdir"; then
# Link the convenience library
if test $linkmode = lib; then
deplibs="$dir/$old_library $deplibs"
elif test "$linkmode,$pass" = "prog,link"; then
compile_deplibs="$dir/$old_library $compile_deplibs"
finalize_deplibs="$dir/$old_library $finalize_deplibs"
else
deplibs="$lib $deplibs"
fi
continue
fi
if test $linkmode = prog && test $pass != link; then
newlib_search_path="$newlib_search_path $ladir"
deplibs="$lib $deplibs"
linkalldeplibs=no
if test "$link_all_deplibs" != no || test -z "$library_names" ||
test "$build_libtool_libs" = no; then
linkalldeplibs=yes
fi
tmp_libs=
for deplib in $dependency_libs; do
case $deplib in
-L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
esac
# Need to link against all dependency_libs?
if test $linkalldeplibs = yes; then
deplibs="$deplib $deplibs"
else
# Need to hardcode shared library paths
# or/and link against static libraries
newdependency_libs="$deplib $newdependency_libs"
fi
if test "X$duplicate_deps" = "Xyes" ; then
case "$tmp_libs " in
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
esac
fi
tmp_libs="$tmp_libs $deplib"
done # for deplib
continue
fi # $linkmode = prog...
link_static=no # Whether the deplib will be linked statically
if test -n "$library_names" &&
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
# Link against this shared library
if test "$linkmode,$pass" = "prog,link" ||
{ test $linkmode = lib && test $hardcode_into_libs = yes; }; then
# Hardcode the library path.
# Skip directories that are in the system default run-time
# search path.
case " $sys_lib_dlsearch_path " in
*" $absdir "*) ;;
*)
case "$compile_rpath " in
*" $absdir "*) ;;
*) compile_rpath="$compile_rpath $absdir"
esac
;;
esac
case " $sys_lib_dlsearch_path " in
*" $libdir "*) ;;
*)
case "$finalize_rpath " in
*" $libdir "*) ;;
*) finalize_rpath="$finalize_rpath $libdir"
esac
;;
esac
if test $linkmode = prog; then
# We need to hardcode the library path
if test -n "$shlibpath_var"; then
# Make sure the rpath contains only unique directories.
case "$temp_rpath " in
*" $dir "*) ;;
*" $absdir "*) ;;
*) temp_rpath="$temp_rpath $dir" ;;
esac
fi
fi
fi # $linkmode,$pass = prog,link...
if test "$alldeplibs" = yes &&
{ test "$deplibs_check_method" = pass_all ||
{ test "$build_libtool_libs" = yes &&
test -n "$library_names"; }; }; then
# We only need to search for static libraries
continue
fi
if test "$installed" = no; then
notinst_deplibs="$notinst_deplibs $lib"
need_relink=yes
fi
if test -n "$old_archive_from_expsyms_cmds"; then
# figure out the soname
set dummy $library_names
realname="$2"
shift; shift
libname=`eval \\$echo \"$libname_spec\"`
# use dlname if we got it. it's perfectly good, no?
if test -n "$dlname"; then
soname="$dlname"
elif test -n "$soname_spec"; then
# bleh windows
case $host in
*cygwin*)
major=`expr $current - $age`
versuffix="-$major"
;;
esac
eval soname=\"$soname_spec\"
else
soname="$realname"
fi
# Make a new name for the extract_expsyms_cmds to use
soroot="$soname"
soname=`echo $soroot | ${SED} -e 's/^.*\///'`
newlib="libimp-`echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
# If the library has no export list, then create one now
if test -f "$output_objdir/$soname-def"; then :
else
$show "extracting exported symbol list from \`$soname'"
save_ifs="$IFS"; IFS='~'
eval cmds=\"$extract_expsyms_cmds\"
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd" || exit $?
done
IFS="$save_ifs"
fi
# Create $newlib
if test -f "$output_objdir/$newlib"; then :; else
$show "generating import library for \`$soname'"
save_ifs="$IFS"; IFS='~'
eval cmds=\"$old_archive_from_expsyms_cmds\"
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd" || exit $?
done
IFS="$save_ifs"
fi
# make sure the library variables are pointing to the new library
dir=$output_objdir
linklib=$newlib
fi # test -n $old_archive_from_expsyms_cmds
if test $linkmode = prog || test "$mode" != relink; then
add_shlibpath=
add_dir=
add=
lib_linked=yes
case $hardcode_action in
immediate | unsupported)
if test "$hardcode_direct" = no; then
add="$dir/$linklib"
elif test "$hardcode_minus_L" = no; then
case $host in
*-*-sunos*) add_shlibpath="$dir" ;;
esac
add_dir="-L$dir"
add="-l$name"
elif test "$hardcode_shlibpath_var" = no; then
add_shlibpath="$dir"
add="-l$name"
else
lib_linked=no
fi
;;
relink)
if test "$hardcode_direct" = yes; then
add="$dir/$linklib"
elif test "$hardcode_minus_L" = yes; then
add_dir="-L$dir"
add="-l$name"
elif test "$hardcode_shlibpath_var" = yes; then
add_shlibpath="$dir"
add="-l$name"
else
lib_linked=no
fi
;;
*) lib_linked=no ;;
esac
if test "$lib_linked" != yes; then
$echo "$modename: configuration error: unsupported hardcode properties"
exit 1
fi
if test -n "$add_shlibpath"; then
case :$compile_shlibpath: in
*":$add_shlibpath:"*) ;;
*) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
esac
fi
if test $linkmode = prog; then
test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
test -n "$add" && compile_deplibs="$add $compile_deplibs"
else
test -n "$add_dir" && deplibs="$add_dir $deplibs"
test -n "$add" && deplibs="$add $deplibs"
if test "$hardcode_direct" != yes && \
test "$hardcode_minus_L" != yes && \
test "$hardcode_shlibpath_var" = yes; then
case :$finalize_shlibpath: in
*":$libdir:"*) ;;
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
esac
fi
fi
fi
if test $linkmode = prog || test "$mode" = relink; then
add_shlibpath=
add_dir=
add=
# Finalize command for both is simple: just hardcode it.
if test "$hardcode_direct" = yes; then
add="$libdir/$linklib"
elif test "$hardcode_minus_L" = yes; then
add_dir="-L$libdir"
add="-l$name"
elif test "$hardcode_shlibpath_var" = yes; then
case :$finalize_shlibpath: in
*":$libdir:"*) ;;
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
esac
add="-l$name"
else
# We cannot seem to hardcode it, guess we'll fake it.
add_dir="-L$libdir"
add="-l$name"
fi
if test $linkmode = prog; then
test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
else
test -n "$add_dir" && deplibs="$add_dir $deplibs"
test -n "$add" && deplibs="$add $deplibs"
fi
fi
elif test $linkmode = prog; then
if test "$alldeplibs" = yes &&
{ test "$deplibs_check_method" = pass_all ||
{ test "$build_libtool_libs" = yes &&
test -n "$library_names"; }; }; then
# We only need to search for static libraries
continue
fi
# Try to link the static library
# Here we assume that one of hardcode_direct or hardcode_minus_L
# is not unsupported. This is valid on all known static and
# shared platforms.
if test "$hardcode_direct" != unsupported; then
test -n "$old_library" && linklib="$old_library"
compile_deplibs="$dir/$linklib $compile_deplibs"
finalize_deplibs="$dir/$linklib $finalize_deplibs"
else
compile_deplibs="-l$name -L$dir $compile_deplibs"
finalize_deplibs="-l$name -L$dir $finalize_deplibs"
fi
elif test "$build_libtool_libs" = yes; then
# Not a shared library
if test "$deplibs_check_method" != pass_all; then
# We're trying link a shared library against a static one
# but the system doesn't support it.
# Just print a warning and add the library to dependency_libs so
# that the program can be linked against the static library.
echo
echo "*** Warning: This system can not link to static lib archive $lib."
echo "*** I have the capability to make that library automatically link in when"
echo "*** you link to this library. But I can only do this if you have a"
echo "*** shared version of the library, which you do not appear to have."
if test "$module" = yes; then
echo "*** But as you try to build a module library, libtool will still create "
echo "*** a static module, that should work as long as the dlopening application"
echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
if test -z "$global_symbol_pipe"; then
echo
echo "*** However, this would only work if libtool was able to extract symbol"
echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
echo "*** not find such a program. So, this module is probably useless."
echo "*** \`nm' from GNU binutils and a full rebuild may help."
fi
if test "$build_old_libs" = no; then
build_libtool_libs=module
build_old_libs=yes
else
build_libtool_libs=no
fi
fi
else
convenience="$convenience $dir/$old_library"
old_convenience="$old_convenience $dir/$old_library"
deplibs="$dir/$old_library $deplibs"
link_static=yes
fi
fi # link shared/static library?
if test $linkmode = lib; then
if test -n "$dependency_libs" &&
{ test $hardcode_into_libs != yes || test $build_old_libs = yes ||
test $link_static = yes; }; then
# Extract -R from dependency_libs
temp_deplibs=
for libdir in $dependency_libs; do
case $libdir in
-R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
case " $xrpath " in
*" $temp_xrpath "*) ;;
*) xrpath="$xrpath $temp_xrpath";;
esac;;
*) temp_deplibs="$temp_deplibs $libdir";;
esac
done
dependency_libs="$temp_deplibs"
fi
newlib_search_path="$newlib_search_path $absdir"
# Link against this library
test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
# ... and its dependency_libs
tmp_libs=
for deplib in $dependency_libs; do
newdependency_libs="$deplib $newdependency_libs"
if test "X$duplicate_deps" = "Xyes" ; then
case "$tmp_libs " in
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
esac
fi
tmp_libs="$tmp_libs $deplib"
done
if test $link_all_deplibs != no; then
# Add the search paths of all dependency libraries
for deplib in $dependency_libs; do
case $deplib in
-L*) path="$deplib" ;;
*.la)
dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
test "X$dir" = "X$deplib" && dir="."
# We need an absolute path.
case $dir in
[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
*)
absdir=`cd "$dir" && pwd`
if test -z "$absdir"; then
$echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
absdir="$dir"
fi
;;
esac
if grep "^installed=no" $deplib > /dev/null; then
path="-L$absdir/$objdir"
else
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
if test -z "$libdir"; then
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
exit 1
fi
if test "$absdir" != "$libdir"; then
$echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
fi
path="-L$absdir"
fi
;;
*) continue ;;
esac
case " $deplibs " in
*" $path "*) ;;
*) deplibs="$deplibs $path" ;;
esac
done
fi # link_all_deplibs != no
fi # linkmode = lib
done # for deplib in $libs
if test $pass = dlpreopen; then
# Link the dlpreopened libraries before other libraries
for deplib in $save_deplibs; do
deplibs="$deplib $deplibs"
done
fi
if test $pass != dlopen; then
test $pass != scan && dependency_libs="$newdependency_libs"
if test $pass != conv; then
# Make sure lib_search_path contains only unique directories.
lib_search_path=
for dir in $newlib_search_path; do
case "$lib_search_path " in
*" $dir "*) ;;
*) lib_search_path="$lib_search_path $dir" ;;
esac
done
newlib_search_path=
fi
if test "$linkmode,$pass" != "prog,link"; then
vars="deplibs"
else
vars="compile_deplibs finalize_deplibs"
fi
for var in $vars dependency_libs; do
# Add libraries to $var in reverse order
eval tmp_libs=\"\$$var\"
new_libs=
for deplib in $tmp_libs; do
case $deplib in
-L*) new_libs="$deplib $new_libs" ;;
*)
case " $specialdeplibs " in
*" $deplib "*) new_libs="$deplib $new_libs" ;;
*)
case " $new_libs " in
*" $deplib "*) ;;
*) new_libs="$deplib $new_libs" ;;
esac
;;
esac
;;
esac
done
tmp_libs=
for deplib in $new_libs; do
case $deplib in
-L*)
case " $tmp_libs " in
*" $deplib "*) ;;
*) tmp_libs="$tmp_libs $deplib" ;;
esac
;;
*) tmp_libs="$tmp_libs $deplib" ;;
esac
done
eval $var=\"$tmp_libs\"
done # for var
fi
if test "$pass" = "conv" &&
{ test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then
libs="$deplibs" # reset libs
deplibs=
fi
done # for pass
if test $linkmode = prog; then
dlfiles="$newdlfiles"
dlprefiles="$newdlprefiles"
fi
case $linkmode in
oldlib)
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
fi
if test -n "$rpath"; then
$echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
fi
if test -n "$xrpath"; then
$echo "$modename: warning: \`-R' is ignored for archives" 1>&2
fi
if test -n "$vinfo"; then
$echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
fi
if test -n "$release"; then
$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
fi
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
fi
# Now set the variables for building old libraries.
build_libtool_libs=no
oldlibs="$output"
objs="$objs$old_deplibs"
;;
lib)
# Make sure we only generate libraries of the form `libNAME.la'.
case $outputname in
lib*)
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
eval libname=\"$libname_spec\"
;;
*)
if test "$module" = no; then
$echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
$echo "$help" 1>&2
exit 1
fi
if test "$need_lib_prefix" != no; then
# Add the "lib" prefix for modules if required
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
eval libname=\"$libname_spec\"
else
libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
fi
;;
esac
if test -n "$objs"; then
if test "$deplibs_check_method" != pass_all; then
$echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
exit 1
else
echo
echo "*** Warning: Linking the shared library $output against the non-libtool"
echo "*** objects $objs is not portable!"
libobjs="$libobjs $objs"
fi
fi
if test "$dlself" != no; then
$echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
fi
set dummy $rpath
if test $# -gt 2; then
$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
fi
install_libdir="$2"
oldlibs=
if test -z "$rpath"; then
if test "$build_libtool_libs" = yes; then
# Building a libtool convenience library.
libext=al
oldlibs="$output_objdir/$libname.$libext $oldlibs"
build_libtool_libs=convenience
build_old_libs=yes
fi
if test -n "$vinfo"; then
$echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
fi
if test -n "$release"; then
$echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
fi
else
# Parse the version information argument.
save_ifs="$IFS"; IFS=':'
set dummy $vinfo 0 0 0
IFS="$save_ifs"
if test -n "$8"; then
$echo "$modename: too many parameters to \`-version-info'" 1>&2
$echo "$help" 1>&2
exit 1
fi
current="$2"
revision="$3"
age="$4"
# Check that each of the things are valid numbers.
case $current in
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
*)
$echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
exit 1
;;
esac
case $revision in
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
*)
$echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
exit 1
;;
esac
case $age in
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
*)
$echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
exit 1
;;
esac
if test $age -gt $current; then
$echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
exit 1
fi
# Calculate the version variables.
major=
versuffix=
verstring=
case $version_type in
none) ;;
darwin)
# Like Linux, but with the current version available in
# verstring for coding it into the library header
major=.`expr $current - $age`
versuffix="$major.$age.$revision"
# Darwin ld doesn't like 0 for these options...
minor_current=`expr $current + 1`
verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
;;
freebsd-aout)
major=".$current"
versuffix=".$current.$revision";
;;
freebsd-elf)
major=".$current"
versuffix=".$current";
;;
irix | nonstopux)
major=`expr $current - $age + 1`
case $version_type in
nonstopux) verstring_prefix=nonstopux ;;
*) verstring_prefix=sgi ;;
esac
verstring="$verstring_prefix$major.$revision"
# Add in all the interfaces that we are compatible with.
loop=$revision
while test $loop != 0; do
iface=`expr $revision - $loop`
loop=`expr $loop - 1`
verstring="$verstring_prefix$major.$iface:$verstring"
done
# Before this point, $major must not contain `.'.
major=.$major
versuffix="$major.$revision"
;;
linux)
major=.`expr $current - $age`
versuffix="$major.$age.$revision"
;;
osf)
major=`expr $current - $age`
versuffix=".$current.$age.$revision"
verstring="$current.$age.$revision"
# Add in all the interfaces that we are compatible with.
loop=$age
while test $loop != 0; do
iface=`expr $current - $loop`
loop=`expr $loop - 1`
verstring="$verstring:${iface}.0"
done
# Make executables depend on our current version.
verstring="$verstring:${current}.0"
;;
sunos)
major=".$current"
versuffix=".$current.$revision"
;;
windows)
# Use '-' rather than '.', since we only want one
# extension on DOS 8.3 filesystems.
major=`expr $current - $age`
versuffix="-$major"
;;
*)
$echo "$modename: unknown library version type \`$version_type'" 1>&2
echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
exit 1
;;
esac
# Clear the version info if we defaulted, and they specified a release.
if test -z "$vinfo" && test -n "$release"; then
major=
verstring="0.0"
case $version_type in
darwin)
# we can't check for "0.0" in archive_cmds due to quoting
# problems, so we reset it completely
verstring=""
;;
*)
verstring="0.0"
;;
esac
if test "$need_version" = no; then
versuffix=
else
versuffix=".0.0"
fi
fi
# Remove version info from name if versioning should be avoided
if test "$avoid_version" = yes && test "$need_version" = no; then
major=
versuffix=
verstring=""
fi
# Check to see if the archive will have undefined symbols.
if test "$allow_undefined" = yes; then
if test "$allow_undefined_flag" = unsupported; then
$echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
build_libtool_libs=no
build_old_libs=yes
fi
else
# Don't allow undefined symbols.
allow_undefined_flag="$no_undefined_flag"
fi
fi
if test "$mode" != relink; then
# Remove our outputs.
$show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
$run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
fi
# Now set the variables for building old libraries.
if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
oldlibs="$oldlibs $output_objdir/$libname.$libext"
# Transform .lo files to .o files.
oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
fi
# Eliminate all temporary directories.
for path in $notinst_path; do
lib_search_path=`echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
deplibs=`echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
dependency_libs=`echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
done
if test -n "$xrpath"; then
# If the user specified any rpath flags, then add them.
temp_xrpath=
for libdir in $xrpath; do
temp_xrpath="$temp_xrpath -R$libdir"
case "$finalize_rpath " in
*" $libdir "*) ;;
*) finalize_rpath="$finalize_rpath $libdir" ;;
esac
done
if test $hardcode_into_libs != yes || test $build_old_libs = yes; then
dependency_libs="$temp_xrpath $dependency_libs"
fi
fi
# Make sure dlfiles contains only unique files that won't be dlpreopened
old_dlfiles="$dlfiles"
dlfiles=
for lib in $old_dlfiles; do
case " $dlprefiles $dlfiles " in
*" $lib "*) ;;
*) dlfiles="$dlfiles $lib" ;;
esac
done
# Make sure dlprefiles contains only unique files
old_dlprefiles="$dlprefiles"
dlprefiles=
for lib in $old_dlprefiles; do
case "$dlprefiles " in
*" $lib "*) ;;
*) dlprefiles="$dlprefiles $lib" ;;
esac
done
if test "$build_libtool_libs" = yes; then
if test -n "$rpath"; then
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
# these systems don't actually have a c library (as such)!
;;
*-*-rhapsody* | *-*-darwin1.[012])
# Rhapsody C library is in the System framework
deplibs="$deplibs -framework System"
;;
*-*-netbsd*)
# Don't link with libc until the a.out ld.so is fixed.
;;
*-*-openbsd* | *-*-freebsd*)
# Do not include libc due to us having libc/libc_r.
;;
*)
# Add libc to deplibs on all other systems if necessary.
if test $build_libtool_need_lc = "yes"; then
deplibs="$deplibs -lc"
fi
;;
esac
fi
# Transform deplibs into only deplibs that can be linked in shared.
name_save=$name
libname_save=$libname
release_save=$release
versuffix_save=$versuffix
major_save=$major
# I'm not sure if I'm treating the release correctly. I think
# release should show up in the -l (ie -lgmp5) so we don't want to
# add it in twice. Is that correct?
release=""
versuffix=""
major=""
newdeplibs=
droppeddeps=no
case $deplibs_check_method in
pass_all)
# Don't check for shared/static. Everything works.
# This might be a little naive. We might want to check
# whether the library exists or not. But this is on
# osf3 & osf4 and I'm not really sure... Just
# implementing what was already the behaviour.
newdeplibs=$deplibs
;;
test_compile)
# This code stresses the "libraries are programs" paradigm to its
# limits. Maybe even breaks it. We compile a program, linking it
# against the deplibs as a proxy for the library. Then we can check
# whether they linked in statically or dynamically with ldd.
$rm conftest.c
cat > conftest.c <<EOF
int main() { return 0; }
EOF
$rm conftest
$CC -o conftest conftest.c $deplibs
if test $? -eq 0 ; then
ldd_output=`ldd conftest`
for i in $deplibs; do
name="`expr $i : '-l\(.*\)'`"
# If $name is empty we are operating on a -L argument.
if test -n "$name" && test "$name" != "0"; then
libname=`eval \\$echo \"$libname_spec\"`
deplib_matches=`eval \\$echo \"$library_names_spec\"`
set dummy $deplib_matches
deplib_match=$2
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
newdeplibs="$newdeplibs $i"
else
droppeddeps=yes
echo
echo "*** Warning: dynamic linker does not accept needed library $i."
echo "*** I have the capability to make that library automatically link in when"
echo "*** you link to this library. But I can only do this if you have a"
echo "*** shared version of the library, which I believe you do not have"
echo "*** because a test_compile did reveal that the linker did not use it for"
echo "*** its dynamic dependency list that programs get resolved with at runtime."
fi
else
newdeplibs="$newdeplibs $i"
fi
done
else
# Error occured in the first compile. Let's try to salvage
# the situation: Compile a separate program for each library.
for i in $deplibs; do
name="`expr $i : '-l\(.*\)'`"
# If $name is empty we are operating on a -L argument.
if test -n "$name" && test "$name" != "0"; then
$rm conftest
$CC -o conftest conftest.c $i
# Did it work?
if test $? -eq 0 ; then
ldd_output=`ldd conftest`
libname=`eval \\$echo \"$libname_spec\"`
deplib_matches=`eval \\$echo \"$library_names_spec\"`
set dummy $deplib_matches
deplib_match=$2
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
newdeplibs="$newdeplibs $i"
else
droppeddeps=yes
echo
echo "*** Warning: dynamic linker does not accept needed library $i."
echo "*** I have the capability to make that library automatically link in when"
echo "*** you link to this library. But I can only do this if you have a"
echo "*** shared version of the library, which you do not appear to have"
echo "*** because a test_compile did reveal that the linker did not use this one"
echo "*** as a dynamic dependency that programs can get resolved with at runtime."
fi
else
droppeddeps=yes
echo
echo "*** Warning! Library $i is needed by this library but I was not able to"
echo "*** make it link in! You will probably need to install it or some"
echo "*** library that it depends on before this library will be fully"
echo "*** functional. Installing it before continuing would be even better."
fi
else
newdeplibs="$newdeplibs $i"
fi
done
fi
;;
file_magic*)
set dummy $deplibs_check_method
file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
for a_deplib in $deplibs; do
name="`expr $a_deplib : '-l\(.*\)'`"
# If $name is empty we are operating on a -L argument.
if test -n "$name" && test "$name" != "0"; then
libname=`eval \\$echo \"$libname_spec\"`
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
for potent_lib in $potential_libs; do
# Follow soft links.
if ls -lLd "$potent_lib" 2>/dev/null \
| grep " -> " >/dev/null; then
continue
fi
# The statement above tries to avoid entering an
# endless loop below, in case of cyclic links.
# We might still enter an endless loop, since a link
# loop can be closed while we follow links,
# but so what?
potlib="$potent_lib"
while test -h "$potlib" 2>/dev/null; do
potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
case $potliblink in
[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
esac
done
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
| ${SED} 10q \
| egrep "$file_magic_regex" > /dev/null; then
newdeplibs="$newdeplibs $a_deplib"
a_deplib=""
break 2
fi
done
done
if test -n "$a_deplib" ; then
droppeddeps=yes
echo
echo "*** Warning: linker path does not have real file for library $a_deplib."
echo "*** I have the capability to make that library automatically link in when"
echo "*** you link to this library. But I can only do this if you have a"
echo "*** shared version of the library, which you do not appear to have"
echo "*** because I did check the linker path looking for a file starting"
if test -z "$potlib" ; then
echo "*** with $libname but no candidates were found. (...for file magic test)"
else
echo "*** with $libname and none of the candidates passed a file format test"
echo "*** using a file magic. Last file checked: $potlib"
fi
fi
else
# Add a -L argument.
newdeplibs="$newdeplibs $a_deplib"
fi
done # Gone through all deplibs.
;;
match_pattern*)
set dummy $deplibs_check_method
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
for a_deplib in $deplibs; do
name="`expr $a_deplib : '-l\(.*\)'`"
# If $name is empty we are operating on a -L argument.
if test -n "$name" && test "$name" != "0"; then
libname=`eval \\$echo \"$libname_spec\"`
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
for potent_lib in $potential_libs; do
potlib="$potent_lib" # see symlink-check below in file_magic test
if eval echo \"$potent_lib\" 2>/dev/null \
| ${SED} 10q \
| egrep "$match_pattern_regex" > /dev/null; then
newdeplibs="$newdeplibs $a_deplib"
a_deplib=""
break 2
fi
done
done
if test -n "$a_deplib" ; then
droppeddeps=yes
echo
echo "*** Warning: linker path does not have real file for library $a_deplib."
echo "*** I have the capability to make that library automatically link in when"
echo "*** you link to this library. But I can only do this if you have a"
echo "*** shared version of the library, which you do not appear to have"
echo "*** because I did check the linker path looking for a file starting"
if test -z "$potlib" ; then
echo "*** with $libname but no candidates were found. (...for regex pattern test)"
else
echo "*** with $libname and none of the candidates passed a file format test"
echo "*** using a regex pattern. Last file checked: $potlib"
fi
fi
else
# Add a -L argument.
newdeplibs="$newdeplibs $a_deplib"
fi
done # Gone through all deplibs.
;;
none | unknown | *)
newdeplibs=""
if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
-e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
grep . >/dev/null; then
echo
if test "X$deplibs_check_method" = "Xnone"; then
echo "*** Warning: inter-library dependencies are not supported in this platform."
else
echo "*** Warning: inter-library dependencies are not known to be supported."
fi
echo "*** All declared inter-library dependencies are being dropped."
droppeddeps=yes
fi
;;
esac
versuffix=$versuffix_save
major=$major_save
release=$release_save
libname=$libname_save
name=$name_save
case $host in
*-*-rhapsody* | *-*-darwin1.[012])
# On Rhapsody replace the C library is the System framework
newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
;;
esac
if test "$droppeddeps" = yes; then
if test "$module" = yes; then
echo
echo "*** Warning: libtool could not satisfy all declared inter-library"
echo "*** dependencies of module $libname. Therefore, libtool will create"
echo "*** a static module, that should work as long as the dlopening"
echo "*** application is linked with the -dlopen flag."
if test -z "$global_symbol_pipe"; then
echo
echo "*** However, this would only work if libtool was able to extract symbol"
echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
echo "*** not find such a program. So, this module is probably useless."
echo "*** \`nm' from GNU binutils and a full rebuild may help."
fi
if test "$build_old_libs" = no; then
oldlibs="$output_objdir/$libname.$libext"
build_libtool_libs=module
build_old_libs=yes
else
build_libtool_libs=no
fi
else
echo "*** The inter-library dependencies that have been dropped here will be"
echo "*** automatically added whenever a program is linked with this library"
echo "*** or is declared to -dlopen it."
if test $allow_undefined = no; then
echo
echo "*** Since this library must not contain undefined symbols,"
echo "*** because either the platform does not support them or"
echo "*** it was explicitly requested with -no-undefined,"
echo "*** libtool will only create a static version of it."
if test "$build_old_libs" = no; then
oldlibs="$output_objdir/$libname.$libext"
build_libtool_libs=module
build_old_libs=yes
else
build_libtool_libs=no
fi
fi
fi
fi
# Done checking deplibs!
deplibs=$newdeplibs
fi
# All the library-specific variables (install_libdir is set above).
library_names=
old_library=
dlname=
# Test again, we may have decided not to build it any more
if test "$build_libtool_libs" = yes; then
if test $hardcode_into_libs = yes; then
# Hardcode the library paths
hardcode_libdirs=
dep_rpath=
rpath="$finalize_rpath"
test "$mode" != relink && rpath="$compile_rpath$rpath"
for libdir in $rpath; do
if test -n "$hardcode_libdir_flag_spec"; then
if test -n "$hardcode_libdir_separator"; then
if test -z "$hardcode_libdirs"; then
hardcode_libdirs="$libdir"
else
# Just accumulate the unique libdirs.
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
;;
*)
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
;;
esac
fi
else
eval flag=\"$hardcode_libdir_flag_spec\"
dep_rpath="$dep_rpath $flag"
fi
elif test -n "$runpath_var"; then
case "$perm_rpath " in
*" $libdir "*) ;;
*) perm_rpath="$perm_rpath $libdir" ;;
esac
fi
done
# Substitute the hardcoded libdirs into the rpath.
if test -n "$hardcode_libdir_separator" &&
test -n "$hardcode_libdirs"; then
libdir="$hardcode_libdirs"
eval dep_rpath=\"$hardcode_libdir_flag_spec\"
fi
if test -n "$runpath_var" && test -n "$perm_rpath"; then
# We should set the runpath_var.
rpath=
for dir in $perm_rpath; do
rpath="$rpath$dir:"
done
eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
fi
test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
fi
shlibpath="$finalize_shlibpath"
test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
if test -n "$shlibpath"; then
eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
fi
# Get the real and link names of the library.
eval library_names=\"$library_names_spec\"
set dummy $library_names
realname="$2"
shift; shift
if test -n "$soname_spec"; then
eval soname=\"$soname_spec\"
else
soname="$realname"
fi
test -z "$dlname" && dlname=$soname
lib="$output_objdir/$realname"
for link
do
linknames="$linknames $link"
done
# Ensure that we have .o objects for linkers which dislike .lo
# (e.g. aix) in case we are running --disable-static
for obj in $libobjs; do
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
if test "X$xdir" = "X$obj"; then
xdir="."
else
xdir="$xdir"
fi
baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
if test ! -f $xdir/$oldobj; then
$show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
$run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
fi
done
# Use standard objects if they are pic
test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
# Prepare the list of exported symbols
if test -z "$export_symbols"; then
if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
$show "generating symbol list for \`$libname.la'"
export_symbols="$output_objdir/$libname.exp"
$run $rm $export_symbols
eval cmds=\"$export_symbols_cmds\"
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd" || exit $?
done
IFS="$save_ifs"
if test -n "$export_symbols_regex"; then
$show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
$run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
$show "$mv \"${export_symbols}T\" \"$export_symbols\""
$run eval '$mv "${export_symbols}T" "$export_symbols"'
fi
fi
fi
if test -n "$export_symbols" && test -n "$include_expsyms"; then
$run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
fi
if test -n "$convenience"; then
if test -n "$whole_archive_flag_spec"; then
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
else
gentop="$output_objdir/${outputname}x"
$show "${rm}r $gentop"
$run ${rm}r "$gentop"
$show "mkdir $gentop"
$run mkdir "$gentop"
status=$?
if test $status -ne 0 && test ! -d "$gentop"; then
exit $status
fi
generated="$generated $gentop"
for xlib in $convenience; do
# Extract the objects.
case $xlib in
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
*) xabs=`pwd`"/$xlib" ;;
esac
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
xdir="$gentop/$xlib"
$show "${rm}r $xdir"
$run ${rm}r "$xdir"
$show "mkdir $xdir"
$run mkdir "$xdir"
status=$?
if test $status -ne 0 && test ! -d "$xdir"; then
exit $status
fi
$show "(cd $xdir && $AR x $xabs)"
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
done
fi
fi
if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
eval flag=\"$thread_safe_flag_spec\"
linker_flags="$linker_flags $flag"
fi
# Make a backup of the uninstalled library when relinking
if test "$mode" = relink; then
$run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
fi
# Do each of the archive commands.
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
eval cmds=\"$archive_expsym_cmds\"
else
save_deplibs="$deplibs"
for conv in $convenience; do
tmp_deplibs=
for test_deplib in $deplibs; do
if test "$test_deplib" != "$conv"; then
tmp_deplibs="$tmp_deplibs $test_deplib"
fi
done
deplibs="$tmp_deplibs"
done
eval cmds=\"$archive_cmds\"
deplibs="$save_deplibs"
fi
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd" || exit $?
done
IFS="$save_ifs"
# Restore the uninstalled library and exit
if test "$mode" = relink; then
$run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
exit 0
fi
# Create links to the real library.
for linkname in $linknames; do
if test "$realname" != "$linkname"; then
$show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
$run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
fi
done
# If -module or -export-dynamic was specified, set the dlname.
if test "$module" = yes || test "$export_dynamic" = yes; then
# On all known operating systems, these are identical.
dlname="$soname"
fi
fi
;;
obj)
if test -n "$deplibs"; then
$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
fi
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
fi
if test -n "$rpath"; then
$echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
fi
if test -n "$xrpath"; then
$echo "$modename: warning: \`-R' is ignored for objects" 1>&2
fi
if test -n "$vinfo"; then
$echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
fi
if test -n "$release"; then
$echo "$modename: warning: \`-release' is ignored for objects" 1>&2
fi
case $output in
*.lo)
if test -n "$objs$old_deplibs"; then
$echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
exit 1
fi
libobj="$output"
obj=`$echo "X$output" | $Xsed -e "$lo2o"`
;;
*)
libobj=
obj="$output"
;;
esac
# Delete the old objects.
$run $rm $obj $libobj
# Objects from convenience libraries. This assumes
# single-version convenience libraries. Whenever we create
# different ones for PIC/non-PIC, this we'll have to duplicate
# the extraction.
reload_conv_objs=
gentop=
# reload_cmds runs $LD directly, so let us get rid of
# -Wl from whole_archive_flag_spec
wl=
if test -n "$convenience"; then
if test -n "$whole_archive_flag_spec"; then
eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
else
gentop="$output_objdir/${obj}x"
$show "${rm}r $gentop"
$run ${rm}r "$gentop"
$show "mkdir $gentop"
$run mkdir "$gentop"
status=$?
if test $status -ne 0 && test ! -d "$gentop"; then
exit $status
fi
generated="$generated $gentop"
for xlib in $convenience; do
# Extract the objects.
case $xlib in
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
*) xabs=`pwd`"/$xlib" ;;
esac
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
xdir="$gentop/$xlib"
$show "${rm}r $xdir"
$run ${rm}r "$xdir"
$show "mkdir $xdir"
$run mkdir "$xdir"
status=$?
if test $status -ne 0 && test ! -d "$xdir"; then
exit $status
fi
$show "(cd $xdir && $AR x $xabs)"
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
done
fi
fi
# Create the old-style object.
reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
output="$obj"
eval cmds=\"$reload_cmds\"
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd" || exit $?
done
IFS="$save_ifs"
# Exit if we aren't doing a library object file.
if test -z "$libobj"; then
if test -n "$gentop"; then
$show "${rm}r $gentop"
$run ${rm}r $gentop
fi
exit 0
fi
if test "$build_libtool_libs" != yes; then
if test -n "$gentop"; then
$show "${rm}r $gentop"
$run ${rm}r $gentop
fi
# Create an invalid libtool object if no PIC, so that we don't
# accidentally link it into a program.
$show "echo timestamp > $libobj"
$run eval "echo timestamp > $libobj" || exit $?
exit 0
fi
if test -n "$pic_flag" || test "$pic_mode" != default; then
# Only do commands if we really have different PIC objects.
reload_objs="$libobjs $reload_conv_objs"
output="$libobj"
eval cmds=\"$reload_cmds\"
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd" || exit $?
done
IFS="$save_ifs"
else
# Just create a symlink.
$show $rm $libobj
$run $rm $libobj
xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
if test "X$xdir" = "X$libobj"; then
xdir="."
else
xdir="$xdir"
fi
baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
$show "(cd $xdir && $LN_S $oldobj $baseobj)"
$run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
fi
if test -n "$gentop"; then
$show "${rm}r $gentop"
$run ${rm}r $gentop
fi
exit 0
;;
prog)
case $host in
*cygwin*) output=`echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
esac
if test -n "$vinfo"; then
$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
fi
if test -n "$release"; then
$echo "$modename: warning: \`-release' is ignored for programs" 1>&2
fi
if test "$preload" = yes; then
if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
test "$dlopen_self_static" = unknown; then
$echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
fi
fi
case $host in
*-*-rhapsody* | *-*-darwin1.[012])
# On Rhapsody replace the C library is the System framework
compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
;;
esac
compile_command="$compile_command $compile_deplibs"
finalize_command="$finalize_command $finalize_deplibs"
if test -n "$rpath$xrpath"; then
# If the user specified any rpath flags, then add them.
for libdir in $rpath $xrpath; do
# This is the magic to use -rpath.
case "$finalize_rpath " in
*" $libdir "*) ;;
*) finalize_rpath="$finalize_rpath $libdir" ;;
esac
done
fi
# Now hardcode the library paths
rpath=
hardcode_libdirs=
for libdir in $compile_rpath $finalize_rpath; do
if test -n "$hardcode_libdir_flag_spec"; then
if test -n "$hardcode_libdir_separator"; then
if test -z "$hardcode_libdirs"; then
hardcode_libdirs="$libdir"
else
# Just accumulate the unique libdirs.
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
;;
*)
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
;;
esac
fi
else
eval flag=\"$hardcode_libdir_flag_spec\"
rpath="$rpath $flag"
fi
elif test -n "$runpath_var"; then
case "$perm_rpath " in
*" $libdir "*) ;;
*) perm_rpath="$perm_rpath $libdir" ;;
esac
fi
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
case :$dllsearchpath: in
*":$libdir:"*) ;;
*) dllsearchpath="$dllsearchpath:$libdir";;
esac
;;
esac
done
# Substitute the hardcoded libdirs into the rpath.
if test -n "$hardcode_libdir_separator" &&
test -n "$hardcode_libdirs"; then
libdir="$hardcode_libdirs"
eval rpath=\" $hardcode_libdir_flag_spec\"
fi
compile_rpath="$rpath"
rpath=
hardcode_libdirs=
for libdir in $finalize_rpath; do
if test -n "$hardcode_libdir_flag_spec"; then
if test -n "$hardcode_libdir_separator"; then
if test -z "$hardcode_libdirs"; then
hardcode_libdirs="$libdir"
else
# Just accumulate the unique libdirs.
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
;;
*)
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
;;
esac
fi
else
eval flag=\"$hardcode_libdir_flag_spec\"
rpath="$rpath $flag"
fi
elif test -n "$runpath_var"; then
case "$finalize_perm_rpath " in
*" $libdir "*) ;;
*) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
esac
fi
done
# Substitute the hardcoded libdirs into the rpath.
if test -n "$hardcode_libdir_separator" &&
test -n "$hardcode_libdirs"; then
libdir="$hardcode_libdirs"
eval rpath=\" $hardcode_libdir_flag_spec\"
fi
finalize_rpath="$rpath"
if test -n "$libobjs" && test "$build_old_libs" = yes; then
# Transform all the library objects into standard objects.
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
fi
dlsyms=
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
if test -n "$NM" && test -n "$global_symbol_pipe"; then
dlsyms="${outputname}S.c"
else
$echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
fi
fi
if test -n "$dlsyms"; then
case $dlsyms in
"") ;;
*.c)
# Discover the nlist of each of the dlfiles.
nlist="$output_objdir/${outputname}.nm"
$show "$rm $nlist ${nlist}S ${nlist}T"
$run $rm "$nlist" "${nlist}S" "${nlist}T"
# Parse the name list into a source file.
$show "creating $output_objdir/$dlsyms"
test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
#ifdef __cplusplus
extern \"C\" {
#endif
/* Prevent the only kind of declaration conflicts we can make. */
#define lt_preloaded_symbols some_other_symbol
/* External symbol declarations for the compiler. */\
"
if test "$dlself" = yes; then
$show "generating symbol list for \`$output'"
test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
# Add our own program objects to the symbol list.
progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
for arg in $progfiles; do
$show "extracting global C symbols from \`$arg'"
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
done
if test -n "$exclude_expsyms"; then
$run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
$run eval '$mv "$nlist"T "$nlist"'
fi
if test -n "$export_symbols_regex"; then
$run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
$run eval '$mv "$nlist"T "$nlist"'
fi
# Prepare the list of exported symbols
if test -z "$export_symbols"; then
export_symbols="$output_objdir/$output.exp"
$run $rm $export_symbols
$run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
else
$run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
$run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
$run eval 'mv "$nlist"T "$nlist"'
fi
fi
for arg in $dlprefiles; do
$show "extracting global C symbols from \`$arg'"
name=`echo "$arg" | ${SED} -e 's%^.*/%%'`
$run eval 'echo ": $name " >> "$nlist"'
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
done
if test -z "$run"; then
# Make sure we have at least an empty file.
test -f "$nlist" || : > "$nlist"
if test -n "$exclude_expsyms"; then
egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
$mv "$nlist"T "$nlist"
fi
# Try sorting and uniquifying the output.
if grep -v "^: " < "$nlist" |
if sort -k 3 </dev/null >/dev/null 2>&1; then
sort -k 3
else
sort +2
fi |
uniq > "$nlist"S; then
:
else
grep -v "^: " < "$nlist" > "$nlist"S
fi
if test -f "$nlist"S; then
eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
else
echo '/* NONE */' >> "$output_objdir/$dlsyms"
fi
$echo >> "$output_objdir/$dlsyms" "\
#undef lt_preloaded_symbols
#if defined (__STDC__) && __STDC__
# define lt_ptr void *
#else
# define lt_ptr char *
# define const
#endif
/* The mapping between symbol names and symbols. */
const struct {
const char *name;
lt_ptr address;
}
lt_preloaded_symbols[] =
{\
"
eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
$echo >> "$output_objdir/$dlsyms" "\
{0, (lt_ptr) 0}
};
/* This works around a problem in FreeBSD linker */
#ifdef FREEBSD_WORKAROUND
static const void *lt_preloaded_setup() {
return lt_preloaded_symbols;
}
#endif
#ifdef __cplusplus
}
#endif\
"
fi
pic_flag_for_symtable=
case $host in
# compiling the symbol table file with pic_flag works around
# a FreeBSD bug that causes programs to crash when -lm is
# linked before any other PIC object. But we must not use
# pic_flag when linking with -static. The problem exists in
# FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
*-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
case "$compile_command " in
*" -static "*) ;;
*) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
esac;;
*-*-hpux*)
case "$compile_command " in
*" -static "*) ;;
*) pic_flag_for_symtable=" $pic_flag -DPIC";;
esac
esac
# Now compile the dynamic symbol file.
$show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
$run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
# Clean up the generated files.
$show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
$run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
# Transform the symbol file into the correct name.
compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
;;
*)
$echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
exit 1
;;
esac
else
# We keep going just in case the user didn't refer to
# lt_preloaded_symbols. The linker will fail if global_symbol_pipe
# really was required.
# Nullify the symbol file.
compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
fi
if test $need_relink = no || test "$build_libtool_libs" != yes; then
# Replace the output file specification.
compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
link_command="$compile_command$compile_rpath"
# We have no uninstalled library dependencies, so finalize right now.
$show "$link_command"
$run eval "$link_command"
status=$?
# Delete the generated files.
if test -n "$dlsyms"; then
$show "$rm $output_objdir/${outputname}S.${objext}"
$run $rm "$output_objdir/${outputname}S.${objext}"
fi
exit $status
fi
if test -n "$shlibpath_var"; then
# We should set the shlibpath_var
rpath=
for dir in $temp_rpath; do
case $dir in
[\\/]* | [A-Za-z]:[\\/]*)
# Absolute path.
rpath="$rpath$dir:"
;;
*)
# Relative path: add a thisdir entry.
rpath="$rpath\$thisdir/$dir:"
;;
esac
done
temp_rpath="$rpath"
fi
if test -n "$compile_shlibpath$finalize_shlibpath"; then
compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
fi
if test -n "$finalize_shlibpath"; then
finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
fi
compile_var=
finalize_var=
if test -n "$runpath_var"; then
if test -n "$perm_rpath"; then
# We should set the runpath_var.
rpath=
for dir in $perm_rpath; do
rpath="$rpath$dir:"
done
compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
fi
if test -n "$finalize_perm_rpath"; then
# We should set the runpath_var.
rpath=
for dir in $finalize_perm_rpath; do
rpath="$rpath$dir:"
done
finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
fi
fi
if test "$no_install" = yes; then
# We don't need to create a wrapper script.
link_command="$compile_var$compile_command$compile_rpath"
# Replace the output file specification.
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
# Delete the old output file.
$run $rm $output
# Link the executable and exit
$show "$link_command"
$run eval "$link_command" || exit $?
exit 0
fi
if test "$hardcode_action" = relink; then
# Fast installation is not supported
link_command="$compile_var$compile_command$compile_rpath"
relink_command="$finalize_var$finalize_command$finalize_rpath"
$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
$echo "$modename: \`$output' will be relinked during installation" 1>&2
else
if test "$fast_install" != no; then
link_command="$finalize_var$compile_command$finalize_rpath"
if test "$fast_install" = yes; then
relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
else
# fast_install is set to needless
relink_command=
fi
else
link_command="$compile_var$compile_command$compile_rpath"
relink_command="$finalize_var$finalize_command$finalize_rpath"
fi
fi
# Replace the output file specification.
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
# Delete the old output files.
$run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
$show "$link_command"
$run eval "$link_command" || exit $?
# Now create the wrapper script.
$show "creating $output"
# Quote the relink command for shipping.
if test -n "$relink_command"; then
# Preserve any variables that may affect compiler behavior
for var in $variables_saved_for_relink; do
if eval test -z \"\${$var+set}\"; then
relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
elif eval var_value=\$$var; test -z "$var_value"; then
relink_command="$var=; export $var; $relink_command"
else
var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
relink_command="$var=\"$var_value\"; export $var; $relink_command"
fi
done
relink_command="(cd `pwd`; $relink_command)"
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
fi
# Quote $echo for shipping.
if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
case $0 in
[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
*) qecho="$SHELL `pwd`/$0 --fallback-echo";;
esac
qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
else
qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
fi
# Only actually do things if our run command is non-null.
if test -z "$run"; then
# win32 will think the script is a binary if it has
# a .exe suffix, so we strip it off here.
case $output in
*.exe) output=`echo $output|${SED} 's,.exe$,,'` ;;
esac
# test for cygwin because mv fails w/o .exe extensions
case $host in
*cygwin*) exeext=.exe ;;
*) exeext= ;;
esac
$rm $output
trap "$rm $output; exit 1" 1 2 15
$echo > $output "\
#! $SHELL
# $output - temporary wrapper script for $objdir/$outputname
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
#
# The $output program cannot be directly executed until all the libtool
# libraries that it depends on are installed.
#
# This wrapper script should never be moved out of the build directory.
# If it is, it will not operate correctly.
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
Xsed="${SED}"' -e 1s/^X//'
sed_quote_subst='$sed_quote_subst'
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
relink_command=\"$relink_command\"
# This environment variable determines our operation mode.
if test \"\$libtool_install_magic\" = \"$magic\"; then
# install mode needs the following variable:
notinst_deplibs='$notinst_deplibs'
else
# When we are sourced in execute mode, \$file and \$echo are already set.
if test \"\$libtool_execute_magic\" != \"$magic\"; then
echo=\"$qecho\"
file=\"\$0\"
# Make sure echo works.
if test \"X\$1\" = X--no-reexec; then
# Discard the --no-reexec flag, and continue.
shift
elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
# Yippee, \$echo works!
:
else
# Restart under the correct shell, and then maybe \$echo will work.
exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
fi
fi\
"
$echo >> $output "\
# Find the directory that this script lives in.
thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
test \"x\$thisdir\" = \"x\$file\" && thisdir=.
# Follow symbolic links until we get to the real thisdir.
file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
while test -n \"\$file\"; do
destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
# If there was a directory component, then change thisdir.
if test \"x\$destdir\" != \"x\$file\"; then
case \"\$destdir\" in
[\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
*) thisdir=\"\$thisdir/\$destdir\" ;;
esac
fi
file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
done
# Try to get the absolute directory name.
absdir=\`cd \"\$thisdir\" && pwd\`
test -n \"\$absdir\" && thisdir=\"\$absdir\"
"
if test "$fast_install" = yes; then
echo >> $output "\
program=lt-'$outputname'$exeext
progdir=\"\$thisdir/$objdir\"
if test ! -f \"\$progdir/\$program\" || \\
{ file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
test \"X\$file\" != \"X\$progdir/\$program\"; }; then
file=\"\$\$-\$program\"
if test ! -d \"\$progdir\"; then
$mkdir \"\$progdir\"
else
$rm \"\$progdir/\$file\"
fi"
echo >> $output "\
# relink executable if necessary
if test -n \"\$relink_command\"; then
if relink_command_output=\`eval \$relink_command 2>&1\`; then :
else
$echo \"\$relink_command_output\" >&2
$rm \"\$progdir/\$file\"
exit 1
fi
fi
$mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
{ $rm \"\$progdir/\$program\";
$mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
$rm \"\$progdir/\$file\"
fi"
else
echo >> $output "\
program='$outputname'
progdir=\"\$thisdir/$objdir\"
"
fi
echo >> $output "\
if test -f \"\$progdir/\$program\"; then"
# Export our shlibpath_var if we have one.
if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
$echo >> $output "\
# Add our own library path to $shlibpath_var
$shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
# Some systems cannot cope with colon-terminated $shlibpath_var
# The second colon is a workaround for a bug in BeOS R4 ${SED}
$shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
export $shlibpath_var
"
fi
# fixup the dll searchpath if we need to.
if test -n "$dllsearchpath"; then
$echo >> $output "\
# Add the dll search path components to the executable PATH
PATH=$dllsearchpath:\$PATH
"
fi
$echo >> $output "\
if test \"\$libtool_execute_magic\" != \"$magic\"; then
# Run the actual program with our arguments.
"
case $host in
# win32 systems need to use the prog path for dll
# lookup to work
*-*-cygwin* | *-*-pw32*)
$echo >> $output "\
exec \$progdir/\$program \${1+\"\$@\"}
"
;;
# Backslashes separate directories on plain windows
*-*-mingw | *-*-os2*)
$echo >> $output "\
exec \$progdir\\\\\$program \${1+\"\$@\"}
"
;;
*)
$echo >> $output "\
# Export the path to the program.
PATH=\"\$progdir:\$PATH\"
export PATH
exec \$program \${1+\"\$@\"}
"
;;
esac
$echo >> $output "\
\$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
exit 1
fi
else
# The program doesn't exist.
\$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
\$echo \"This script is just a wrapper for \$program.\" 1>&2
echo \"See the $PACKAGE documentation for more information.\" 1>&2
exit 1
fi
fi\
"
chmod +x $output
fi
exit 0
;;
esac
# See if we need to build an old-fashioned archive.
for oldlib in $oldlibs; do
if test "$build_libtool_libs" = convenience; then
oldobjs="$libobjs_save"
addlibs="$convenience"
build_libtool_libs=no
else
if test "$build_libtool_libs" = module; then
oldobjs="$libobjs_save"
build_libtool_libs=no
else
oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
fi
addlibs="$old_convenience"
fi
if test -n "$addlibs"; then
gentop="$output_objdir/${outputname}x"
$show "${rm}r $gentop"
$run ${rm}r "$gentop"
$show "mkdir $gentop"
$run mkdir "$gentop"
status=$?
if test $status -ne 0 && test ! -d "$gentop"; then
exit $status
fi
generated="$generated $gentop"
# Add in members from convenience archives.
for xlib in $addlibs; do
# Extract the objects.
case $xlib in
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
*) xabs=`pwd`"/$xlib" ;;
esac
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
xdir="$gentop/$xlib"
$show "${rm}r $xdir"
$run ${rm}r "$xdir"
$show "mkdir $xdir"
$run mkdir "$xdir"
status=$?
if test $status -ne 0 && test ! -d "$xdir"; then
exit $status
fi
$show "(cd $xdir && $AR x $xabs)"
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
done
fi
# Do each command in the archive commands.
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
eval cmds=\"$old_archive_from_new_cmds\"
else
# Ensure that we have .o objects in place in case we decided
# not to build a shared library, and have fallen back to building
# static libs even though --disable-static was passed!
for oldobj in $oldobjs; do
if test ! -f $oldobj; then
xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
if test "X$xdir" = "X$oldobj"; then
xdir="."
else
xdir="$xdir"
fi
baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
$show "(cd $xdir && ${LN_S} $obj $baseobj)"
$run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
fi
done
eval cmds=\"$old_archive_cmds\"
fi
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd" || exit $?
done
IFS="$save_ifs"
done
if test -n "$generated"; then
$show "${rm}r$generated"
$run ${rm}r$generated
fi
# Now create the libtool archive.
case $output in
*.la)
old_library=
test "$build_old_libs" = yes && old_library="$libname.$libext"
$show "creating $output"
# Preserve any variables that may affect compiler behavior
for var in $variables_saved_for_relink; do
if eval test -z \"\${$var+set}\"; then
relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
elif eval var_value=\$$var; test -z "$var_value"; then
relink_command="$var=; export $var; $relink_command"
else
var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
relink_command="$var=\"$var_value\"; export $var; $relink_command"
fi
done
# Quote the link command for shipping.
relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args)"
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
# Only create the output if not a dry run.
if test -z "$run"; then
for installed in no yes; do
if test "$installed" = yes; then
if test -z "$install_libdir"; then
break
fi
output="$output_objdir/$outputname"i
# Replace all uninstalled libtool libraries with the installed ones
newdependency_libs=
for deplib in $dependency_libs; do
case $deplib in
*.la)
name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
if test -z "$libdir"; then
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
exit 1
fi
newdependency_libs="$newdependency_libs $libdir/$name"
;;
*) newdependency_libs="$newdependency_libs $deplib" ;;
esac
done
dependency_libs="$newdependency_libs"
newdlfiles=
for lib in $dlfiles; do
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
if test -z "$libdir"; then
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
exit 1
fi
newdlfiles="$newdlfiles $libdir/$name"
done
dlfiles="$newdlfiles"
newdlprefiles=
for lib in $dlprefiles; do
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
if test -z "$libdir"; then
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
exit 1
fi
newdlprefiles="$newdlprefiles $libdir/$name"
done
dlprefiles="$newdlprefiles"
fi
$rm $output
# place dlname in correct position for cygwin
tdlname=$dlname
case $host,$output,$installed,$module,$dlname in
*cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
esac
$echo > $output "\
# $outputname - a libtool library file
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
#
# Please DO NOT delete this file!
# It is necessary for linking the library.
# The name that we can dlopen(3).
dlname='$tdlname'
# Names of this library.
library_names='$library_names'
# The name of the static archive.
old_library='$old_library'
# Libraries that this one depends upon.
dependency_libs='$dependency_libs'
# Version information for $libname.
current=$current
age=$age
revision=$revision
# Is this an already installed library?
installed=$installed
# Files to dlopen/dlpreopen
dlopen='$dlfiles'
dlpreopen='$dlprefiles'
# Directory that this library needs to be installed in:
libdir='$install_libdir'"
if test "$installed" = no && test $need_relink = yes; then
$echo >> $output "\
relink_command=\"$relink_command\""
fi
done
fi
# Do a symbolic link so that the libtool archive can be found in
# LD_LIBRARY_PATH before the program is installed.
$show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
$run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
;;
esac
exit 0
;;
# libtool install mode
install)
modename="$modename: install"
# There may be an optional sh(1) argument at the beginning of
# install_prog (especially on Windows NT).
if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
# Allow the use of GNU shtool's install command.
$echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
# Aesthetically quote it.
arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
arg="\"$arg\""
;;
esac
install_prog="$arg "
arg="$1"
shift
else
install_prog=
arg="$nonopt"
fi
# The real first argument should be the name of the installation program.
# Aesthetically quote it.
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
arg="\"$arg\""
;;
esac
install_prog="$install_prog$arg"
# We need to accept at least all the BSD install flags.
dest=
files=
opts=
prev=
install_type=
isdir=no
stripme=
for arg
do
if test -n "$dest"; then
files="$files $dest"
dest="$arg"
continue
fi
case $arg in
-d) isdir=yes ;;
-f) prev="-f" ;;
-g) prev="-g" ;;
-m) prev="-m" ;;
-o) prev="-o" ;;
-s)
stripme=" -s"
continue
;;
-*) ;;
*)
# If the previous option needed an argument, then skip it.
if test -n "$prev"; then
prev=
else
dest="$arg"
continue
fi
;;
esac
# Aesthetically quote the argument.
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
arg="\"$arg\""
;;
esac
install_prog="$install_prog $arg"
done
if test -z "$install_prog"; then
$echo "$modename: you must specify an install program" 1>&2
$echo "$help" 1>&2
exit 1
fi
if test -n "$prev"; then
$echo "$modename: the \`$prev' option requires an argument" 1>&2
$echo "$help" 1>&2
exit 1
fi
if test -z "$files"; then
if test -z "$dest"; then
$echo "$modename: no file or destination specified" 1>&2
else
$echo "$modename: you must specify a destination" 1>&2
fi
$echo "$help" 1>&2
exit 1
fi
# Strip any trailing slash from the destination.
dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
# Check to see that the destination is a directory.
test -d "$dest" && isdir=yes
if test "$isdir" = yes; then
destdir="$dest"
destname=
else
destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
test "X$destdir" = "X$dest" && destdir=.
destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
# Not a directory, so check to see that there is only one file specified.
set dummy $files
if test $# -gt 2; then
$echo "$modename: \`$dest' is not a directory" 1>&2
$echo "$help" 1>&2
exit 1
fi
fi
case $destdir in
[\\/]* | [A-Za-z]:[\\/]*) ;;
*)
for file in $files; do
case $file in
*.lo) ;;
*)
$echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
$echo "$help" 1>&2
exit 1
;;
esac
done
;;
esac
# This variable tells wrapper scripts just to set variables rather
# than running their programs.
libtool_install_magic="$magic"
staticlibs=
future_libdirs=
current_libdirs=
for file in $files; do
# Do each installation.
case $file in
*.$libext)
# Do the static libraries later.
staticlibs="$staticlibs $file"
;;
*.la)
# Check to see that this really is a libtool archive.
if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
else
$echo "$modename: \`$file' is not a valid libtool archive" 1>&2
$echo "$help" 1>&2
exit 1
fi
library_names=
old_library=
relink_command=
# If there is no directory component, then add one.
case $file in
*/* | *\\*) . $file ;;
*) . ./$file ;;
esac
# Add the libdir to current_libdirs if it is the destination.
if test "X$destdir" = "X$libdir"; then
case "$current_libdirs " in
*" $libdir "*) ;;
*) current_libdirs="$current_libdirs $libdir" ;;
esac
else
# Note the libdir as a future libdir.
case "$future_libdirs " in
*" $libdir "*) ;;
*) future_libdirs="$future_libdirs $libdir" ;;
esac
fi
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
test "X$dir" = "X$file/" && dir=
dir="$dir$objdir"
if test -n "$relink_command"; then
$echo "$modename: warning: relinking \`$file'" 1>&2
$show "$relink_command"
if $run eval "$relink_command"; then :
else
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
continue
fi
fi
# See the names of the shared library.
set dummy $library_names
if test -n "$2"; then
realname="$2"
shift
shift
srcname="$realname"
test -n "$relink_command" && srcname="$realname"T
# Install the shared library and build the symlinks.
$show "$install_prog $dir/$srcname $destdir/$realname"
$run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
if test -n "$stripme" && test -n "$striplib"; then
$show "$striplib $destdir/$realname"
$run eval "$striplib $destdir/$realname" || exit $?
fi
if test $# -gt 0; then
# Delete the old symlinks, and create new ones.
for linkname
do
if test "$linkname" != "$realname"; then
$show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
$run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
fi
done
fi
# Do each command in the postinstall commands.
lib="$destdir/$realname"
eval cmds=\"$postinstall_cmds\"
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd" || exit $?
done
IFS="$save_ifs"
fi
# Install the pseudo-library for information purposes.
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
instname="$dir/$name"i
$show "$install_prog $instname $destdir/$name"
$run eval "$install_prog $instname $destdir/$name" || exit $?
# Maybe install the static library, too.
test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
;;
*.lo)
# Install (i.e. copy) a libtool object.
# Figure out destination file name, if it wasn't already specified.
if test -n "$destname"; then
destfile="$destdir/$destname"
else
destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
destfile="$destdir/$destfile"
fi
# Deduce the name of the destination old-style object file.
case $destfile in
*.lo)
staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
;;
*.$objext)
staticdest="$destfile"
destfile=
;;
*)
$echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
$echo "$help" 1>&2
exit 1
;;
esac
# Install the libtool object if requested.
if test -n "$destfile"; then
$show "$install_prog $file $destfile"
$run eval "$install_prog $file $destfile" || exit $?
fi
# Install the old object if enabled.
if test "$build_old_libs" = yes; then
# Deduce the name of the old-style object file.
staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
$show "$install_prog $staticobj $staticdest"
$run eval "$install_prog \$staticobj \$staticdest" || exit $?
fi
exit 0
;;
*)
# Figure out destination file name, if it wasn't already specified.
if test -n "$destname"; then
destfile="$destdir/$destname"
else
destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
destfile="$destdir/$destfile"
fi
# Do a test to see if this is really a libtool program.
case $host in
*cygwin*|*mingw*)
wrapper=`echo $file | ${SED} -e 's,.exe$,,'`
;;
*)
wrapper=$file
;;
esac
if (${SED} -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
notinst_deplibs=
relink_command=
# If there is no directory component, then add one.
case $file in
*/* | *\\*) . $wrapper ;;
*) . ./$wrapper ;;
esac
# Check the variables that should have been set.
if test -z "$notinst_deplibs"; then
$echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
exit 1
fi
finalize=yes
for lib in $notinst_deplibs; do
# Check to see that each library is installed.
libdir=
if test -f "$lib"; then
# If there is no directory component, then add one.
case $lib in
*/* | *\\*) . $lib ;;
*) . ./$lib ;;
esac
fi
libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
if test -n "$libdir" && test ! -f "$libfile"; then
$echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
finalize=no
fi
done
relink_command=
# If there is no directory component, then add one.
case $file in
*/* | *\\*) . $wrapper ;;
*) . ./$wrapper ;;
esac
outputname=
if test "$fast_install" = no && test -n "$relink_command"; then
if test "$finalize" = yes && test -z "$run"; then
tmpdir="/tmp"
test -n "$TMPDIR" && tmpdir="$TMPDIR"
tmpdir="$tmpdir/libtool-$$"
if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
else
$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
continue
fi
file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
outputname="$tmpdir/$file"
# Replace the output file specification.
relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
$show "$relink_command"
if $run eval "$relink_command"; then :
else
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
${rm}r "$tmpdir"
continue
fi
file="$outputname"
else
$echo "$modename: warning: cannot relink \`$file'" 1>&2
fi
else
# Install the binary that we compiled earlier.
file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
fi
fi
# remove .exe since cygwin /usr/bin/install will append another
# one anyways
case $install_prog,$host in
/usr/bin/install*,*cygwin*)
case $file:$destfile in
*.exe:*.exe)
# this is ok
;;
*.exe:*)
destfile=$destfile.exe
;;
*:*.exe)
destfile=`echo $destfile | ${SED} -e 's,.exe$,,'`
;;
esac
;;
esac
$show "$install_prog$stripme $file $destfile"
$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
test -n "$outputname" && ${rm}r "$tmpdir"
;;
esac
done
for file in $staticlibs; do
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
# Set up the ranlib parameters.
oldlib="$destdir/$name"
$show "$install_prog $file $oldlib"
$run eval "$install_prog \$file \$oldlib" || exit $?
if test -n "$stripme" && test -n "$striplib"; then
$show "$old_striplib $oldlib"
$run eval "$old_striplib $oldlib" || exit $?
fi
# Do each command in the postinstall commands.
eval cmds=\"$old_postinstall_cmds\"
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd" || exit $?
done
IFS="$save_ifs"
done
if test -n "$future_libdirs"; then
$echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
fi
if test -n "$current_libdirs"; then
# Maybe just do a dry run.
test -n "$run" && current_libdirs=" -n$current_libdirs"
exec_cmd='$SHELL $0 --finish$current_libdirs'
else
exit 0
fi
;;
# libtool finish mode
finish)
modename="$modename: finish"
libdirs="$nonopt"
admincmds=
if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
for dir
do
libdirs="$libdirs $dir"
done
for libdir in $libdirs; do
if test -n "$finish_cmds"; then
# Do each command in the finish commands.
eval cmds=\"$finish_cmds\"
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd" || admincmds="$admincmds
$cmd"
done
IFS="$save_ifs"
fi
if test -n "$finish_eval"; then
# Do the single finish_eval.
eval cmds=\"$finish_eval\"
$run eval "$cmds" || admincmds="$admincmds
$cmds"
fi
done
fi
# Exit here if they wanted silent mode.
test "$show" = ":" && exit 0
echo "----------------------------------------------------------------------"
echo "Libraries have been installed in:"
for libdir in $libdirs; do
echo " $libdir"
done
echo
echo "If you ever happen to want to link against installed libraries"
echo "in a given directory, LIBDIR, you must either use libtool, and"
echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
echo "flag during linking and do at least one of the following:"
if test -n "$shlibpath_var"; then
echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
echo " during execution"
fi
if test -n "$runpath_var"; then
echo " - add LIBDIR to the \`$runpath_var' environment variable"
echo " during linking"
fi
if test -n "$hardcode_libdir_flag_spec"; then
libdir=LIBDIR
eval flag=\"$hardcode_libdir_flag_spec\"
echo " - use the \`$flag' linker flag"
fi
if test -n "$admincmds"; then
echo " - have your system administrator run these commands:$admincmds"
fi
if test -f /etc/ld.so.conf; then
echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
fi
echo
echo "See any operating system documentation about shared libraries for"
echo "more information, such as the ld(1) and ld.so(8) manual pages."
echo "----------------------------------------------------------------------"
exit 0
;;
# libtool execute mode
execute)
modename="$modename: execute"
# The first argument is the command name.
cmd="$nonopt"
if test -z "$cmd"; then
$echo "$modename: you must specify a COMMAND" 1>&2
$echo "$help"
exit 1
fi
# Handle -dlopen flags immediately.
for file in $execute_dlfiles; do
if test ! -f "$file"; then
$echo "$modename: \`$file' is not a file" 1>&2
$echo "$help" 1>&2
exit 1
fi
dir=
case $file in
*.la)
# Check to see that this really is a libtool archive.
if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
else
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
$echo "$help" 1>&2
exit 1
fi
# Read the libtool library.
dlname=
library_names=
# If there is no directory component, then add one.
case $file in
*/* | *\\*) . $file ;;
*) . ./$file ;;
esac
# Skip this library if it cannot be dlopened.
if test -z "$dlname"; then
# Warn if it was a shared library.
test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
continue
fi
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
test "X$dir" = "X$file" && dir=.
if test -f "$dir/$objdir/$dlname"; then
dir="$dir/$objdir"
else
$echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
exit 1
fi
;;
*.lo)
# Just add the directory containing the .lo file.
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
test "X$dir" = "X$file" && dir=.
;;
*)
$echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
continue
;;
esac
# Get the absolute pathname.
absdir=`cd "$dir" && pwd`
test -n "$absdir" && dir="$absdir"
# Now add the directory to shlibpath_var.
if eval "test -z \"\$$shlibpath_var\""; then
eval "$shlibpath_var=\"\$dir\""
else
eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
fi
done
# This variable tells wrapper scripts just to set shlibpath_var
# rather than running their programs.
libtool_execute_magic="$magic"
# Check if any of the arguments is a wrapper script.
args=
for file
do
case $file in
-*) ;;
*)
# Do a test to see if this is really a libtool program.
if (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
# If there is no directory component, then add one.
case $file in
*/* | *\\*) . $file ;;
*) . ./$file ;;
esac
# Transform arg to wrapped name.
file="$progdir/$program"
fi
;;
esac
# Quote arguments (to preserve shell metacharacters).
file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
args="$args \"$file\""
done
if test -z "$run"; then
if test -n "$shlibpath_var"; then
# Export the shlibpath_var.
eval "export $shlibpath_var"
fi
# Restore saved enviroment variables
if test "${save_LC_ALL+set}" = set; then
LC_ALL="$save_LC_ALL"; export LC_ALL
fi
if test "${save_LANG+set}" = set; then
LANG="$save_LANG"; export LANG
fi
# Now prepare to actually exec the command.
exec_cmd="\$cmd$args"
else
# Display what would be done.
if test -n "$shlibpath_var"; then
eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
$echo "export $shlibpath_var"
fi
$echo "$cmd$args"
exit 0
fi
;;
# libtool clean and uninstall mode
clean | uninstall)
modename="$modename: $mode"
rm="$nonopt"
files=
rmforce=
exit_status=0
# This variable tells wrapper scripts just to set variables rather
# than running their programs.
libtool_install_magic="$magic"
for arg
do
case $arg in
-f) rm="$rm $arg"; rmforce=yes ;;
-*) rm="$rm $arg" ;;
*) files="$files $arg" ;;
esac
done
if test -z "$rm"; then
$echo "$modename: you must specify an RM program" 1>&2
$echo "$help" 1>&2
exit 1
fi
rmdirs=
for file in $files; do
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
if test "X$dir" = "X$file"; then
dir=.
objdir="$objdir"
else
objdir="$dir/$objdir"
fi
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
test $mode = uninstall && objdir="$dir"
# Remember objdir for removal later, being careful to avoid duplicates
if test $mode = clean; then
case " $rmdirs " in
*" $objdir "*) ;;
*) rmdirs="$rmdirs $objdir" ;;
esac
fi
# Don't error if the file doesn't exist and rm -f was used.
if (test -L "$file") >/dev/null 2>&1 \
|| (test -h "$file") >/dev/null 2>&1 \
|| test -f "$file"; then
:
elif test -d "$file"; then
exit_status=1
continue
elif test "$rmforce" = yes; then
continue
fi
rmfiles="$file"
case $name in
*.la)
# Possibly a libtool archive, so verify it.
if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
. $dir/$name
# Delete the libtool libraries and symlinks.
for n in $library_names; do
rmfiles="$rmfiles $objdir/$n"
done
test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
if test $mode = uninstall; then
if test -n "$library_names"; then
# Do each command in the postuninstall commands.
eval cmds=\"$postuninstall_cmds\"
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd"
if test $? != 0 && test "$rmforce" != yes; then
exit_status=1
fi
done
IFS="$save_ifs"
fi
if test -n "$old_library"; then
# Do each command in the old_postuninstall commands.
eval cmds=\"$old_postuninstall_cmds\"
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd"
if test $? != 0 && test "$rmforce" != yes; then
exit_status=1
fi
done
IFS="$save_ifs"
fi
# FIXME: should reinstall the best remaining shared library.
fi
fi
;;
*.lo)
if test "$build_old_libs" = yes; then
oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
rmfiles="$rmfiles $dir/$oldobj"
fi
;;
*)
# Do a test to see if this is a libtool program.
if test $mode = clean &&
(${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
relink_command=
. $dir/$file
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
if test "$fast_install" = yes && test -n "$relink_command"; then
rmfiles="$rmfiles $objdir/lt-$name"
fi
fi
;;
esac
$show "$rm $rmfiles"
$run $rm $rmfiles || exit_status=1
done
# Try to remove the ${objdir}s in the directories where we deleted files
for dir in $rmdirs; do
if test -d "$dir"; then
$show "rmdir $dir"
$run rmdir $dir >/dev/null 2>&1
fi
done
exit $exit_status
;;
"")
$echo "$modename: you must specify a MODE" 1>&2
$echo "$generic_help" 1>&2
exit 1
;;
esac
if test -z "$exec_cmd"; then
$echo "$modename: invalid operation mode \`$mode'" 1>&2
$echo "$generic_help" 1>&2
exit 1
fi
fi # test -z "$show_help"
if test -n "$exec_cmd"; then
eval exec $exec_cmd
exit 1
fi
# We need to display help for each of the modes.
case $mode in
"") $echo \
"Usage: $modename [OPTION]... [MODE-ARG]...
Provide generalized library-building support services.
--config show all configuration variables
--debug enable verbose shell tracing
-n, --dry-run display commands without modifying any files
--features display basic configuration information and exit
--finish same as \`--mode=finish'
--help display this help message and exit
--mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
--quiet same as \`--silent'
--silent don't print informational messages
--version print version information
MODE must be one of the following:
clean remove files from the build directory
compile compile a source file into a libtool object
execute automatically set library path, then run a program
finish complete the installation of libtool libraries
install install libraries or executables
link create a library or an executable
uninstall remove libraries from an installed directory
MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
a more detailed description of MODE."
exit 0
;;
clean)
$echo \
"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
Remove files from the build directory.
RM is the name of the program to use to delete files associated with each FILE
(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
to RM.
If FILE is a libtool library, object or program, all the files associated
with it are deleted. Otherwise, only FILE itself is deleted using RM."
;;
compile)
$echo \
"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
Compile a source file into a libtool library object.
This mode accepts the following additional options:
-o OUTPUT-FILE set the output file name to OUTPUT-FILE
-prefer-pic try to building PIC objects only
-prefer-non-pic try to building non-PIC objects only
-static always build a \`.o' file suitable for static linking
COMPILE-COMMAND is a command to be used in creating a \`standard' object file
from the given SOURCEFILE.
The output file name is determined by removing the directory component from
SOURCEFILE, then substituting the C source code suffix \`.c' with the
library object suffix, \`.lo'."
;;
execute)
$echo \
"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
Automatically set library path, then run a program.
This mode accepts the following additional options:
-dlopen FILE add the directory containing FILE to the library path
This mode sets the library path environment variable according to \`-dlopen'
flags.
If any of the ARGS are libtool executable wrappers, then they are translated
into their corresponding uninstalled binary, and any of their required library
directories are added to the library path.
Then, COMMAND is executed, with ARGS as arguments."
;;
finish)
$echo \
"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
Complete the installation of libtool libraries.
Each LIBDIR is a directory that contains libtool libraries.
The commands that this mode executes may require superuser privileges. Use
the \`--dry-run' option if you just want to see what would be executed."
;;
install)
$echo \
"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
Install executables or libraries.
INSTALL-COMMAND is the installation command. The first component should be
either the \`install' or \`cp' program.
The rest of the components are interpreted as arguments to that command (only
BSD-compatible install options are recognized)."
;;
link)
$echo \
"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
Link object files or libraries together to form another library, or to
create an executable program.
LINK-COMMAND is a command using the C compiler that you would use to create
a program from several object files.
The following components of LINK-COMMAND are treated specially:
-all-static do not do any dynamic linking at all
-avoid-version do not add a version suffix if possible
-dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
-dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
-export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
-export-symbols SYMFILE
try to export only the symbols listed in SYMFILE
-export-symbols-regex REGEX
try to export only the symbols matching REGEX
-LLIBDIR search LIBDIR for required installed libraries
-lNAME OUTPUT-FILE requires the installed library libNAME
-module build a library that can dlopened
-no-fast-install disable the fast-install mode
-no-install link a not-installable executable
-no-undefined declare that a library does not refer to external symbols
-o OUTPUT-FILE create OUTPUT-FILE from the specified objects
-release RELEASE specify package release information
-rpath LIBDIR the created library will eventually be installed in LIBDIR
-R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
-static do not do any dynamic linking of libtool libraries
-version-info CURRENT[:REVISION[:AGE]]
specify library version info [each variable defaults to 0]
All other options (arguments beginning with \`-') are ignored.
Every other argument is treated as a filename. Files ending in \`.la' are
treated as uninstalled libtool libraries, other files are standard or library
object files.
If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
only library objects (\`.lo' files) may be specified, and \`-rpath' is
required, except when creating a convenience library.
If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
using \`ar' and \`ranlib', or on Windows using \`lib'.
If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
is created, otherwise an executable program is created."
;;
uninstall)
$echo \
"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
Remove libraries from an installation directory.
RM is the name of the program to use to delete files associated with each FILE
(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
to RM.
If FILE is a libtool library, all the files associated with it are deleted.
Otherwise, only FILE itself is deleted using RM."
;;
*)
$echo "$modename: invalid operation mode \`$mode'" 1>&2
$echo "$help" 1>&2
exit 1
;;
esac
echo
$echo "Try \`$modename --help' for more information about other modes."
exit 0
# Local Variables:
# mode:shell-script
# sh-indentation:2
# End:
|
Added work/contrib/lzo/lzo-1.08/ltest/.deps/ltest.Po.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
ltest.o : \
ltest.c ../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/stdio.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h \
/usr/include/libio.h /usr/include/_G_config.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/stdio.h \
/usr/include/stdlib.h /usr/include/alloca.h /usr/include/string.h \
/usr/include/bits/string.h /usr/include/bits/string2.h \
/usr/include/ctype.h /usr/include/assert.h /usr/include/unistd.h \
/usr/include/bits/posix_opt.h /usr/include/bits/confname.h \
/usr/include/getopt.h ../include/lzoutil.h mygetopt.h mygetopt.ch \
timer.h /usr/include/sys/time.h /usr/include/bits/time.h \
../include/lzo1.h ../include/lzo1a.h ../include/lzo1b.h \
../include/lzo1c.h ../include/lzo1f.h ../include/lzo1x.h \
../include/lzo1y.h ../include/lzo1z.h ../include/lzo2a.h asm.h wrap.h \
wrapmisc.h db.h
ltest.c :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/stdio.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h :
/usr/include/libio.h :
/usr/include/_G_config.h :
/usr/include/bits/stdio_lim.h :
/usr/include/bits/stdio.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/ctype.h :
/usr/include/assert.h :
/usr/include/unistd.h :
/usr/include/bits/posix_opt.h :
/usr/include/bits/confname.h :
/usr/include/getopt.h :
../include/lzoutil.h :
mygetopt.h :
mygetopt.ch :
timer.h :
/usr/include/sys/time.h :
/usr/include/bits/time.h :
../include/lzo1.h :
../include/lzo1a.h :
../include/lzo1b.h :
../include/lzo1c.h :
../include/lzo1f.h :
../include/lzo1x.h :
../include/lzo1y.h :
../include/lzo1z.h :
../include/lzo2a.h :
asm.h :
wrap.h :
wrapmisc.h :
db.h :
|
Added work/contrib/lzo/lzo-1.08/ltest/.libs/ltest.
cannot compute difference between binary files
Added work/contrib/lzo/lzo-1.08/ltest/Makefile.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
|
# Makefile.in generated by automake 1.6.2 from Makefile.am.
# ltest/Makefile. Generated from Makefile.in by configure.
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
#
# Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
#
### LZO_DEBUG = -DLZO_DEBUG
### LZO_DEBUG = -DLZO_DEBUG -g -fno-omit-frame-pointer
SHELL = /bin/sh
srcdir = .
top_srcdir = ..
prefix = /usr/local
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
sbindir = ${exec_prefix}/sbin
libexecdir = ${exec_prefix}/libexec
datadir = ${prefix}/share
sysconfdir = ${prefix}/etc
sharedstatedir = ${prefix}/com
localstatedir = ${prefix}/var
libdir = ${exec_prefix}/lib
infodir = ${prefix}/info
mandir = ${prefix}/man
includedir = ${prefix}/include
oldincludedir = /usr/include
pkgdatadir = $(datadir)/lzo
pkglibdir = $(libdir)/lzo
pkgincludedir = $(includedir)/lzo
top_builddir = ..
ACLOCAL = ${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run aclocal-1.6
AUTOCONF = ${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run autoconf
AUTOMAKE = ${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run automake-1.6
AUTOHEADER = ${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run autoheader
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = /usr/bin/ginstall -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_SCRIPT = ${INSTALL}
INSTALL_HEADER = $(INSTALL_DATA)
transform = s,x,x,
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
host_alias =
host_triplet = i586-pc-linux-gnu
EXEEXT =
OBJEXT = o
PATH_SEPARATOR = :
AMTAR = ${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run tar
AS = @AS@
ASFLAGS = -x assembler-with-cpp
AWK = gawk
CC = gcc
CFLAGS_GCC_OMIT_FRAME_POINTER = -fomit-frame-pointer
CFLAGS_O =
CFLAGS_W =
CFLAGS_W_PEDANTIC =
CLEANFILES = *.bb *.bbg *.da *.gcov bb.out bbtrace* gmon.out
CPP = gcc -E
DEPDIR = .deps
DLLTOOL = @DLLTOOL@
ECHO = echo
INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
LIBTOOL = $(SHELL) $(top_builddir)/libtool
LN_S = ln -s
LZO_ASM_OBJECTS = $(LZO_ASM_OBJECTS_GCC_i386)
LZO_CFLAGS =
MAINT = #
MFX_ARCH = i386
MFX_CC = GCC
MFX_CPU = i586
MOSTLYCLEANFILES = *.i
NASM =
OBJDUMP = @OBJDUMP@
PACKAGE = lzo
RANLIB = ranlib
SRC_VPATH = /i386/src
STRIP = strip
VERSION = 1.08
am__include = include
am__quote =
install_sh = /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/install-sh
liblzo = $(top_builddir)/src/liblzo.la
ltest_LIBS =
INCLUDES = -I$(top_srcdir)/include
CFLAGS = -O2 -Wall -Wcast-align -Wcast-qual -Wwrite-strings -fno-strength-reduce -fstrict-aliasing $(CFLAGS_O) $(CFLAGS_W) $(LZO_DEBUG)
noinst_PROGRAMS = ltest
ltest_SOURCES = ltest.c asm.h db.h wrap.h wrapmisc.h timer.h mygetopt.ch mygetopt.h
ltest_LDADD = $(liblzo) $(ltest_LIBS)
ltest_DEPENDENCIES = $(liblzo)
subdir = ltest
mkinstalldirs = $(SHELL) $(top_srcdir)/acconfig/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
noinst_PROGRAMS = ltest$(EXEEXT)
PROGRAMS = $(noinst_PROGRAMS)
am_ltest_OBJECTS = ltest.$(OBJEXT)
ltest_OBJECTS = $(am_ltest_OBJECTS)
ltest_LDFLAGS =
DEFS = -DHAVE_CONFIG_H
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
CPPFLAGS = -DLZO_HAVE_CONFIG_H
LDFLAGS =
LIBS =
depcomp = $(SHELL) $(top_srcdir)/acconfig/depcomp
am__depfiles_maybe = depfiles
DEP_FILES = ./$(DEPDIR)/ltest.Po
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
$(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
DIST_SOURCES = $(ltest_SOURCES)
DIST_COMMON = Makefile.am Makefile.in
SOURCES = $(ltest_SOURCES)
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: # Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu ltest/Makefile
Makefile: # $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
clean-noinstPROGRAMS:
@list='$(noinst_PROGRAMS)'; for p in $$list; do \
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
echo " rm -f $$p $$f"; \
rm -f $$p $$f ; \
done
ltest$(EXEEXT): $(ltest_OBJECTS) $(ltest_DEPENDENCIES)
@rm -f ltest$(EXEEXT)
$(LINK) $(ltest_LDFLAGS) $(ltest_OBJECTS) $(ltest_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT) core *.core
distclean-compile:
-rm -f *.tab.c
include ./$(DEPDIR)/ltest.Po
distclean-depend:
-rm -rf ./$(DEPDIR)
.c.o:
source='$<' object='$@' libtool=no \
depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' \
$(CCDEPMODE) $(depcomp) \
$(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
.c.obj:
source='$<' object='$@' libtool=no \
depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' \
$(CCDEPMODE) $(depcomp) \
$(COMPILE) -c `cygpath -w $<`
.c.lo:
source='$<' object='$@' libtool=yes \
depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' \
$(CCDEPMODE) $(depcomp) \
$(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
CCDEPMODE = depmode=gcc
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
ETAGS = etags
ETAGSFLAGS =
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@list='$(DISTFILES)'; for file in $$list; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkinstalldirs) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS)
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
mostlyclean-am
distclean: distclean-am
distclean-am: clean-am distclean-compile distclean-depend \
distclean-generic distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
info: info-am
info-am:
install-data-am:
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
uninstall-am: uninstall-info-am
.PHONY: GTAGS all all-am check check-am clean clean-generic \
clean-libtool clean-noinstPROGRAMS distclean distclean-compile \
distclean-depend distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am info info-am install \
install-am install-data install-data-am install-exec \
install-exec-am install-info install-info-am install-man \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
tags uninstall uninstall-am uninstall-info-am
$(top_builddir)/src/liblzo.la:
cd $(top_builddir)/src && $(MAKE) all
src:
cd $(top_builddir)/src && $(MAKE) all
$(MAKE) all
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
|
Added work/contrib/lzo/lzo-1.08/ltest/Makefile.am.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
## Process this file with automake to create Makefile.in
#
# Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
#
### LZO_DEBUG = -DLZO_DEBUG
### LZO_DEBUG = -DLZO_DEBUG -g -fno-omit-frame-pointer
INCLUDES = -I$(top_srcdir)/include
CFLAGS = @CFLAGS@ $(CFLAGS_O) $(CFLAGS_W) $(LZO_DEBUG)
noinst_PROGRAMS = ltest
ltest_SOURCES = ltest.c asm.h db.h wrap.h wrapmisc.h timer.h mygetopt.ch mygetopt.h
ltest_LDADD = $(liblzo) $(ltest_LIBS)
ltest_DEPENDENCIES = $(liblzo)
@liblzo@:
cd $(top_builddir)/src && $(MAKE) all
src:
cd $(top_builddir)/src && $(MAKE) all
$(MAKE) all
|
Added work/contrib/lzo/lzo-1.08/ltest/Makefile.in.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
|
# Makefile.in generated by automake 1.6.2 from Makefile.am.
# @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
#
# Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
#
### LZO_DEBUG = -DLZO_DEBUG
### LZO_DEBUG = -DLZO_DEBUG -g -fno-omit-frame-pointer
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
host_alias = @host_alias@
host_triplet = @host@
EXEEXT = @EXEEXT@
OBJEXT = @OBJEXT@
PATH_SEPARATOR = @PATH_SEPARATOR@
AMTAR = @AMTAR@
AS = @AS@
ASFLAGS = @ASFLAGS@
AWK = @AWK@
CC = @CC@
CFLAGS_GCC_OMIT_FRAME_POINTER = @CFLAGS_GCC_OMIT_FRAME_POINTER@
CFLAGS_O = @CFLAGS_O@
CFLAGS_W = @CFLAGS_W@
CFLAGS_W_PEDANTIC = @CFLAGS_W_PEDANTIC@
CLEANFILES = @CLEANFILES@
CPP = @CPP@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
ECHO = @ECHO@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LZO_ASM_OBJECTS = @LZO_ASM_OBJECTS@
LZO_CFLAGS = @LZO_CFLAGS@
MAINT = @MAINT@
MFX_ARCH = @MFX_ARCH@
MFX_CC = @MFX_CC@
MFX_CPU = @MFX_CPU@
MOSTLYCLEANFILES = @MOSTLYCLEANFILES@
NASM = @NASM@
OBJDUMP = @OBJDUMP@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
SRC_VPATH = @SRC_VPATH@
STRIP = @STRIP@
VERSION = @VERSION@
am__include = @am__include@
am__quote = @am__quote@
install_sh = @install_sh@
liblzo = @liblzo@
ltest_LIBS = @ltest_LIBS@
INCLUDES = -I$(top_srcdir)/include
CFLAGS = @CFLAGS@ $(CFLAGS_O) $(CFLAGS_W) $(LZO_DEBUG)
noinst_PROGRAMS = ltest
ltest_SOURCES = ltest.c asm.h db.h wrap.h wrapmisc.h timer.h mygetopt.ch mygetopt.h
ltest_LDADD = $(liblzo) $(ltest_LIBS)
ltest_DEPENDENCIES = $(liblzo)
subdir = ltest
mkinstalldirs = $(SHELL) $(top_srcdir)/acconfig/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
noinst_PROGRAMS = ltest$(EXEEXT)
PROGRAMS = $(noinst_PROGRAMS)
am_ltest_OBJECTS = ltest.$(OBJEXT)
ltest_OBJECTS = $(am_ltest_OBJECTS)
ltest_LDFLAGS =
DEFS = @DEFS@
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
depcomp = $(SHELL) $(top_srcdir)/acconfig/depcomp
am__depfiles_maybe = depfiles
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/ltest.Po
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
$(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
DIST_SOURCES = $(ltest_SOURCES)
DIST_COMMON = Makefile.am Makefile.in
SOURCES = $(ltest_SOURCES)
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu ltest/Makefile
Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
clean-noinstPROGRAMS:
@list='$(noinst_PROGRAMS)'; for p in $$list; do \
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
echo " rm -f $$p $$f"; \
rm -f $$p $$f ; \
done
ltest$(EXEEXT): $(ltest_OBJECTS) $(ltest_DEPENDENCIES)
@rm -f ltest$(EXEEXT)
$(LINK) $(ltest_LDFLAGS) $(ltest_OBJECTS) $(ltest_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT) core *.core
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ltest.Po@am__quote@
distclean-depend:
-rm -rf ./$(DEPDIR)
.c.o:
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
.c.obj:
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(COMPILE) -c `cygpath -w $<`
.c.lo:
@AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
CCDEPMODE = @CCDEPMODE@
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
ETAGS = etags
ETAGSFLAGS =
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@list='$(DISTFILES)'; for file in $$list; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkinstalldirs) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS)
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
mostlyclean-am
distclean: distclean-am
distclean-am: clean-am distclean-compile distclean-depend \
distclean-generic distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
info: info-am
info-am:
install-data-am:
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
uninstall-am: uninstall-info-am
.PHONY: GTAGS all all-am check check-am clean clean-generic \
clean-libtool clean-noinstPROGRAMS distclean distclean-compile \
distclean-depend distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am info info-am install \
install-am install-data install-data-am install-exec \
install-exec-am install-info install-info-am install-man \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
tags uninstall uninstall-am uninstall-info-am
@liblzo@:
cd $(top_builddir)/src && $(MAKE) all
src:
cd $(top_builddir)/src && $(MAKE) all
$(MAKE) all
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
|
Added work/contrib/lzo/lzo-1.08/ltest/asm.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
|
/* asm.h -- library assembler function prototypes
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/*************************************************************************
//
**************************************************************************/
#if !defined(LZO_ASM_NAME)
# if defined(__GNUC__)
# define LZO_ASM_NAME(x) __asm__("_" #x)
# else
# define LZO_ASM_NAME(x)
# endif
#endif
#if !defined(LZO_NO_ASM) && !defined(__LZO_NO_ASM)
# if defined(__LZO_i386) && (UINT_MAX == LZO_0xffffffffL)
# if defined(__GNUC__) || defined(__WATCOMC__)
# define LZO1C_HAVE_i386_DECOMPRESS_ASM
# define LZO1F_HAVE_i386_DECOMPRESS_ASM
# define LZO1X_HAVE_i386_DECOMPRESS_ASM
# define LZO1Y_HAVE_i386_DECOMPRESS_ASM
# endif
# endif
#endif
/*************************************************************************
//
**************************************************************************/
#if 1
/* LZO1B is not yet implemented in assembly */
# define lzo1b_decompress_asm 0
# define lzo1b_decompress_asm_safe 0
# define lzo1b_decompress_asm_fast 0
# define lzo1b_decompress_asm_fast_safe 0
#endif
#if defined(LZO1C_HAVE_i386_DECOMPRESS_ASM)
LZO_EXTERN_CDECL(int)
lzo1c_decompress_asm
( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ )
LZO_ASM_NAME(lzo1c_decompress_asm);
LZO_EXTERN_CDECL(int)
lzo1c_decompress_asm_safe
( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ )
LZO_ASM_NAME(lzo1c_decompress_asm_safe);
# define lzo1c_decompress_asm_fast 0
# define lzo1c_decompress_asm_fast_safe 0
#else
# define lzo1c_decompress_asm 0
# define lzo1c_decompress_asm_safe 0
# define lzo1c_decompress_asm_fast 0
# define lzo1c_decompress_asm_fast_safe 0
#endif
#if defined(LZO1F_HAVE_i386_DECOMPRESS_ASM)
# define lzo1f_decompress_asm 0
# define lzo1f_decompress_asm_safe 0
LZO_EXTERN_CDECL(int)
lzo1f_decompress_asm_fast
( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ )
LZO_ASM_NAME(lzo1f_decompress_asm_fast);
LZO_EXTERN_CDECL(int)
lzo1f_decompress_asm_fast_safe
(const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ )
LZO_ASM_NAME(lzo1f_decompress_asm_fast_safe);
#else
# define lzo1f_decompress_asm 0
# define lzo1f_decompress_asm_safe 0
# define lzo1f_decompress_asm_fast 0
# define lzo1f_decompress_asm_fast_safe 0
#endif
#if defined(LZO1X_HAVE_i386_DECOMPRESS_ASM)
LZO_EXTERN_CDECL(int)
lzo1x_decompress_asm ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ )
LZO_ASM_NAME(lzo1x_decompress_asm);
LZO_EXTERN_CDECL(int)
lzo1x_decompress_asm_safe
( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ )
LZO_ASM_NAME(lzo1x_decompress_asm_safe);
LZO_EXTERN_CDECL(int)
lzo1x_decompress_asm_fast
( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ )
LZO_ASM_NAME(lzo1x_decompress_asm_fast);
LZO_EXTERN_CDECL(int)
lzo1x_decompress_asm_fast_safe
(const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ )
LZO_ASM_NAME(lzo1x_decompress_asm_fast_safe);
#else
# define lzo1x_decompress_asm 0
# define lzo1x_decompress_asm_safe 0
# define lzo1x_decompress_asm_fast 0
# define lzo1x_decompress_asm_fast_safe 0
#endif
#if defined(LZO1Y_HAVE_i386_DECOMPRESS_ASM)
LZO_EXTERN_CDECL(int)
lzo1y_decompress_asm ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ )
LZO_ASM_NAME(lzo1y_decompress_asm);
LZO_EXTERN_CDECL(int)
lzo1y_decompress_asm_safe
( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ )
LZO_ASM_NAME(lzo1y_decompress_asm_safe);
LZO_EXTERN_CDECL(int)
lzo1y_decompress_asm_fast
( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ )
LZO_ASM_NAME(lzo1y_decompress_asm_fast);
LZO_EXTERN_CDECL(int)
lzo1y_decompress_asm_fast_safe
(const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ )
LZO_ASM_NAME(lzo1y_decompress_asm_fast_safe);
#else
# define lzo1y_decompress_asm 0
# define lzo1y_decompress_asm_safe 0
# define lzo1y_decompress_asm_fast 0
# define lzo1y_decompress_asm_fast_safe 0
#endif
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/ltest/db.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
|
/* db.h -- compression database
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/*************************************************************************
//
**************************************************************************/
#if defined(HAVE_LZO1_H)
{ "LZO1-1", M_LZO1, LZO1_MEM_COMPRESS, LZO1_MEM_DECOMPRESS,
lzo1_compress, 0,
lzo1_decompress, 0,
0, 0,
0, 0,
0, 0 },
#if !defined(LZO_99_UNSUPPORTED)
{ "LZO1-99", M_LZO1_99, LZO1_99_MEM_COMPRESS, LZO1_MEM_DECOMPRESS,
lzo1_99_compress, 0,
lzo1_decompress, 0,
0, 0,
0, 0,
0, 0 },
#endif
#endif
#if defined(HAVE_LZO1A_H)
{ "LZO1A-1", M_LZO1A, LZO1A_MEM_COMPRESS, LZO1A_MEM_DECOMPRESS,
lzo1a_compress, 0,
lzo1a_decompress, 0,
0, 0,
0, 0,
0, 0 },
#if !defined(LZO_99_UNSUPPORTED)
{ "LZO1A-99", M_LZO1A_99, LZO1A_99_MEM_COMPRESS, LZO1A_MEM_DECOMPRESS,
lzo1a_99_compress, 0,
lzo1a_decompress, 0,
0, 0,
0, 0,
0, 0 },
#endif
#endif
#if defined(HAVE_LZO1B_H)
{ "LZO1B-1", M_LZO1B_1, LZO1B_MEM_COMPRESS, LZO1B_MEM_DECOMPRESS,
lzo1b_1_compress, 0,
lzo1b_decompress, lzo1b_decompress_safe,
lzo1b_decompress_asm, lzo1b_decompress_asm_safe,
lzo1b_decompress_asm_fast, lzo1b_decompress_asm_fast_safe,
0, 0 },
{ "LZO1B-2", M_LZO1B_2, LZO1B_MEM_COMPRESS, LZO1B_MEM_DECOMPRESS,
lzo1b_2_compress, 0,
lzo1b_decompress, lzo1b_decompress_safe,
lzo1b_decompress_asm, lzo1b_decompress_asm_safe,
lzo1b_decompress_asm_fast, lzo1b_decompress_asm_fast_safe,
0, 0 },
{ "LZO1B-3", M_LZO1B_3, LZO1B_MEM_COMPRESS, LZO1B_MEM_DECOMPRESS,
lzo1b_3_compress, 0,
lzo1b_decompress, lzo1b_decompress_safe,
lzo1b_decompress_asm, lzo1b_decompress_asm_safe,
lzo1b_decompress_asm_fast, lzo1b_decompress_asm_fast_safe,
0, 0 },
{ "LZO1B-4", M_LZO1B_4, LZO1B_MEM_COMPRESS, LZO1B_MEM_DECOMPRESS,
lzo1b_4_compress, 0,
lzo1b_decompress, lzo1b_decompress_safe,
lzo1b_decompress_asm, lzo1b_decompress_asm_safe,
lzo1b_decompress_asm_fast, lzo1b_decompress_asm_fast_safe,
0, 0 },
{ "LZO1B-5", M_LZO1B_5, LZO1B_MEM_COMPRESS, LZO1B_MEM_DECOMPRESS,
lzo1b_5_compress, 0,
lzo1b_decompress, lzo1b_decompress_safe,
lzo1b_decompress_asm, lzo1b_decompress_asm_safe,
lzo1b_decompress_asm_fast, lzo1b_decompress_asm_fast_safe,
0, 0 },
{ "LZO1B-6", M_LZO1B_6, LZO1B_MEM_COMPRESS, LZO1B_MEM_DECOMPRESS,
lzo1b_6_compress, 0,
lzo1b_decompress, lzo1b_decompress_safe,
lzo1b_decompress_asm, lzo1b_decompress_asm_safe,
lzo1b_decompress_asm_fast, lzo1b_decompress_asm_fast_safe,
0, 0 },
{ "LZO1B-7", M_LZO1B_7, LZO1B_MEM_COMPRESS, LZO1B_MEM_DECOMPRESS,
lzo1b_7_compress, 0,
lzo1b_decompress, lzo1b_decompress_safe,
lzo1b_decompress_asm, lzo1b_decompress_asm_safe,
lzo1b_decompress_asm_fast, lzo1b_decompress_asm_fast_safe,
0, 0 },
{ "LZO1B-8", M_LZO1B_8, LZO1B_MEM_COMPRESS, LZO1B_MEM_DECOMPRESS,
lzo1b_8_compress, 0,
lzo1b_decompress, lzo1b_decompress_safe,
lzo1b_decompress_asm, lzo1b_decompress_asm_safe,
lzo1b_decompress_asm_fast, lzo1b_decompress_asm_fast_safe,
0, 0 },
{ "LZO1B-9", M_LZO1B_9, LZO1B_MEM_COMPRESS, LZO1B_MEM_DECOMPRESS,
lzo1b_9_compress, 0,
lzo1b_decompress, lzo1b_decompress_safe,
lzo1b_decompress_asm, lzo1b_decompress_asm_safe,
lzo1b_decompress_asm_fast, lzo1b_decompress_asm_fast_safe,
0, 0 },
#if !defined(LZO_99_UNSUPPORTED)
{ "LZO1B-99", M_LZO1B_99, LZO1B_99_MEM_COMPRESS, LZO1B_MEM_DECOMPRESS,
lzo1b_99_compress, 0,
lzo1b_decompress, lzo1b_decompress_safe,
lzo1b_decompress_asm, lzo1b_decompress_asm_safe,
lzo1b_decompress_asm_fast, lzo1b_decompress_asm_fast_safe,
0, 0 },
#endif
#if !defined(LZO_999_UNSUPPORTED)
{ "LZO1B-999", M_LZO1B_999, LZO1B_999_MEM_COMPRESS, LZO1B_MEM_DECOMPRESS,
lzo1b_999_compress, 0,
lzo1b_decompress, lzo1b_decompress_safe,
lzo1b_decompress_asm, lzo1b_decompress_asm_safe,
lzo1b_decompress_asm_fast, lzo1b_decompress_asm_fast_safe,
0, 0 },
#endif
#endif
#if defined(HAVE_LZO1C_H)
{ "LZO1C-1", M_LZO1C_1, LZO1C_MEM_COMPRESS, LZO1C_MEM_DECOMPRESS,
lzo1c_1_compress, 0,
lzo1c_decompress, lzo1c_decompress_safe,
lzo1c_decompress_asm, lzo1c_decompress_asm_safe,
lzo1c_decompress_asm_fast, lzo1c_decompress_asm_fast_safe,
0, 0 },
{ "LZO1C-2", M_LZO1C_2, LZO1C_MEM_COMPRESS, LZO1C_MEM_DECOMPRESS,
lzo1c_2_compress, 0,
lzo1c_decompress, lzo1c_decompress_safe,
lzo1c_decompress_asm, lzo1c_decompress_asm_safe,
lzo1c_decompress_asm_fast, lzo1c_decompress_asm_fast_safe,
0, 0 },
{ "LZO1C-3", M_LZO1C_3, LZO1C_MEM_COMPRESS, LZO1C_MEM_DECOMPRESS,
lzo1c_3_compress, 0,
lzo1c_decompress, lzo1c_decompress_safe,
lzo1c_decompress_asm, lzo1c_decompress_asm_safe,
lzo1c_decompress_asm_fast, lzo1c_decompress_asm_fast_safe,
0, 0 },
{ "LZO1C-4", M_LZO1C_4, LZO1C_MEM_COMPRESS, LZO1C_MEM_DECOMPRESS,
lzo1c_4_compress, 0,
lzo1c_decompress, lzo1c_decompress_safe,
lzo1c_decompress_asm, lzo1c_decompress_asm_safe,
lzo1c_decompress_asm_fast, lzo1c_decompress_asm_fast_safe,
0, 0 },
{ "LZO1C-5", M_LZO1C_5, LZO1C_MEM_COMPRESS, LZO1C_MEM_DECOMPRESS,
lzo1c_5_compress, 0,
lzo1c_decompress, lzo1c_decompress_safe,
lzo1c_decompress_asm, lzo1c_decompress_asm_safe,
lzo1c_decompress_asm_fast, lzo1c_decompress_asm_fast_safe,
0, 0 },
{ "LZO1C-6", M_LZO1C_6, LZO1C_MEM_COMPRESS, LZO1C_MEM_DECOMPRESS,
lzo1c_6_compress, 0,
lzo1c_decompress, lzo1c_decompress_safe,
lzo1c_decompress_asm, lzo1c_decompress_asm_safe,
lzo1c_decompress_asm_fast, lzo1c_decompress_asm_fast_safe,
0, 0 },
{ "LZO1C-7", M_LZO1C_7, LZO1C_MEM_COMPRESS, LZO1C_MEM_DECOMPRESS,
lzo1c_7_compress, 0,
lzo1c_decompress, lzo1c_decompress_safe,
lzo1c_decompress_asm, lzo1c_decompress_asm_safe,
lzo1c_decompress_asm_fast, lzo1c_decompress_asm_fast_safe,
0, 0 },
{ "LZO1C-8", M_LZO1C_8, LZO1C_MEM_COMPRESS, LZO1C_MEM_DECOMPRESS,
lzo1c_8_compress, 0,
lzo1c_decompress, lzo1c_decompress_safe,
lzo1c_decompress_asm, lzo1c_decompress_asm_safe,
lzo1c_decompress_asm_fast, lzo1c_decompress_asm_fast_safe,
0, 0 },
{ "LZO1C-9", M_LZO1C_9, LZO1C_MEM_COMPRESS, LZO1C_MEM_DECOMPRESS,
lzo1c_9_compress, 0,
lzo1c_decompress, lzo1c_decompress_safe,
lzo1c_decompress_asm, lzo1c_decompress_asm_safe,
lzo1c_decompress_asm_fast, lzo1c_decompress_asm_fast_safe,
0, 0 },
#if !defined(LZO_99_UNSUPPORTED)
{ "LZO1C-99", M_LZO1C_99, LZO1C_99_MEM_COMPRESS, LZO1C_MEM_DECOMPRESS,
lzo1c_99_compress, 0,
lzo1c_decompress, lzo1c_decompress_safe,
lzo1c_decompress_asm, lzo1c_decompress_asm_safe,
lzo1c_decompress_asm_fast, lzo1c_decompress_asm_fast_safe,
0, 0 },
#endif
#if !defined(LZO_999_UNSUPPORTED)
{ "LZO1C-999", M_LZO1C_999, LZO1C_999_MEM_COMPRESS, LZO1C_MEM_DECOMPRESS,
lzo1c_999_compress, 0,
lzo1c_decompress, lzo1c_decompress_safe,
lzo1c_decompress_asm, lzo1c_decompress_asm_safe,
lzo1c_decompress_asm_fast, lzo1c_decompress_asm_fast_safe,
0, 0 },
#endif
#endif
#if defined(HAVE_LZO1F_H)
{ "LZO1F-1", M_LZO1F_1, LZO1F_MEM_COMPRESS, LZO1F_MEM_DECOMPRESS,
lzo1f_1_compress, 0,
lzo1f_decompress, lzo1f_decompress_safe,
lzo1f_decompress_asm, lzo1f_decompress_asm_safe,
lzo1f_decompress_asm_fast, lzo1f_decompress_asm_fast_safe,
0, 0 },
#if !defined(LZO_999_UNSUPPORTED)
{ "LZO1F-999", M_LZO1F_999, LZO1F_999_MEM_COMPRESS, LZO1F_MEM_DECOMPRESS,
lzo1f_999_compress, 0,
lzo1f_decompress, lzo1f_decompress_safe,
lzo1f_decompress_asm, lzo1f_decompress_asm_safe,
lzo1f_decompress_asm_fast, lzo1f_decompress_asm_fast_safe,
0, 0 },
#endif
#endif
#if defined(HAVE_LZO1X_H)
{ "LZO1X-1", M_LZO1X_1, LZO1X_1_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS,
lzo1x_1_compress, lzo1x_optimize,
lzo1x_decompress, lzo1x_decompress_safe,
lzo1x_decompress_asm, lzo1x_decompress_asm_safe,
lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe,
0, 0 },
#if 0
{ "LZO1XT-1", M_LZO1XT_1, LZO1XT_1_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS,
lzo1xt_1_compress, lzo1x_optimize,
lzo1x_decompress, lzo1x_decompress_safe,
lzo1x_decompress_asm, lzo1x_decompress_asm_safe,
lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe,
0, 0 },
#endif
{ "LZO1X-1(11)", M_LZO1X_1_11, LZO1X_1_11_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS,
lzo1x_1_11_compress, lzo1x_optimize,
lzo1x_decompress, lzo1x_decompress_safe,
lzo1x_decompress_asm, lzo1x_decompress_asm_safe,
lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe,
0, 0 },
{ "LZO1X-1(12)", M_LZO1X_1_12, LZO1X_1_12_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS,
lzo1x_1_12_compress, lzo1x_optimize,
lzo1x_decompress, lzo1x_decompress_safe,
lzo1x_decompress_asm, lzo1x_decompress_asm_safe,
lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe,
0, 0 },
{ "LZO1X-1(15)", M_LZO1X_1_15, LZO1X_1_15_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS,
lzo1x_1_15_compress, lzo1x_optimize,
lzo1x_decompress, lzo1x_decompress_safe,
lzo1x_decompress_asm, lzo1x_decompress_asm_safe,
lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe,
0, 0 },
#if !defined(LZO_999_UNSUPPORTED)
{ "LZO1X-999", M_LZO1X_999, LZO1X_999_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS,
lzo1x_999_compress, lzo1x_optimize,
lzo1x_decompress, lzo1x_decompress_safe,
lzo1x_decompress_asm, lzo1x_decompress_asm_safe,
lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe,
lzo1x_999_compress_dict, lzo1x_decompress_dict_safe },
#endif
#if !defined(LZO_999_UNSUPPORTED)
{ "LZO1X-999/1", 9721, LZO1X_999_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS,
lzo1x_999_1_compress, lzo1x_optimize,
lzo1x_decompress, lzo1x_decompress_safe,
lzo1x_decompress_asm, lzo1x_decompress_asm_safe,
lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe,
0, lzo1x_decompress_dict_safe },
{ "LZO1X-999/2", 9722, LZO1X_999_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS,
lzo1x_999_2_compress, lzo1x_optimize,
lzo1x_decompress, lzo1x_decompress_safe,
lzo1x_decompress_asm, lzo1x_decompress_asm_safe,
lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe,
0, lzo1x_decompress_dict_safe },
{ "LZO1X-999/3", 9723, LZO1X_999_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS,
lzo1x_999_3_compress, lzo1x_optimize,
lzo1x_decompress, lzo1x_decompress_safe,
lzo1x_decompress_asm, lzo1x_decompress_asm_safe,
lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe,
0, lzo1x_decompress_dict_safe },
{ "LZO1X-999/4", 9724, LZO1X_999_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS,
lzo1x_999_4_compress, lzo1x_optimize,
lzo1x_decompress, lzo1x_decompress_safe,
lzo1x_decompress_asm, lzo1x_decompress_asm_safe,
lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe,
0, lzo1x_decompress_dict_safe },
{ "LZO1X-999/5", 9725, LZO1X_999_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS,
lzo1x_999_5_compress, lzo1x_optimize,
lzo1x_decompress, lzo1x_decompress_safe,
lzo1x_decompress_asm, lzo1x_decompress_asm_safe,
lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe,
0, lzo1x_decompress_dict_safe },
{ "LZO1X-999/6", 9726, LZO1X_999_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS,
lzo1x_999_6_compress, lzo1x_optimize,
lzo1x_decompress, lzo1x_decompress_safe,
lzo1x_decompress_asm, lzo1x_decompress_asm_safe,
lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe,
0, lzo1x_decompress_dict_safe },
{ "LZO1X-999/7", 9727, LZO1X_999_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS,
lzo1x_999_7_compress, lzo1x_optimize,
lzo1x_decompress, lzo1x_decompress_safe,
lzo1x_decompress_asm, lzo1x_decompress_asm_safe,
lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe,
0, lzo1x_decompress_dict_safe },
{ "LZO1X-999/8", 9728, LZO1X_999_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS,
lzo1x_999_8_compress, lzo1x_optimize,
lzo1x_decompress, lzo1x_decompress_safe,
lzo1x_decompress_asm, lzo1x_decompress_asm_safe,
lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe,
0, lzo1x_decompress_dict_safe },
{ "LZO1X-999/9", 9729, LZO1X_999_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS,
lzo1x_999_9_compress, lzo1x_optimize,
lzo1x_decompress, lzo1x_decompress_safe,
lzo1x_decompress_asm, lzo1x_decompress_asm_safe,
lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe,
0, lzo1x_decompress_dict_safe },
#endif
#endif
#if defined(HAVE_LZO1Y_H)
{ "LZO1Y-1", M_LZO1Y_1, LZO1Y_MEM_COMPRESS, LZO1Y_MEM_DECOMPRESS,
lzo1y_1_compress, lzo1y_optimize,
lzo1y_decompress, lzo1y_decompress_safe,
lzo1y_decompress_asm, lzo1y_decompress_asm_safe,
lzo1y_decompress_asm_fast, lzo1y_decompress_asm_fast_safe,
0, lzo1y_decompress_dict_safe },
#if !defined(LZO_999_UNSUPPORTED)
{ "LZO1Y-999", M_LZO1Y_999, LZO1Y_999_MEM_COMPRESS, LZO1Y_MEM_DECOMPRESS,
lzo1y_999_compress, lzo1y_optimize,
lzo1y_decompress, lzo1y_decompress_safe,
lzo1y_decompress_asm, lzo1y_decompress_asm_safe,
lzo1y_decompress_asm_fast, lzo1y_decompress_asm_fast_safe,
lzo1y_999_compress_dict, lzo1y_decompress_dict_safe },
#endif
#if !defined(LZO_999_UNSUPPORTED)
{ "LZO1Y-999/1", 9821, LZO1Y_999_MEM_COMPRESS, LZO1Y_MEM_DECOMPRESS,
lzo1y_999_1_compress, lzo1y_optimize,
lzo1y_decompress, lzo1y_decompress_safe,
lzo1y_decompress_asm, lzo1y_decompress_asm_safe,
lzo1y_decompress_asm_fast, lzo1y_decompress_asm_fast_safe,
0, lzo1y_decompress_dict_safe },
{ "LZO1Y-999/2", 9822, LZO1Y_999_MEM_COMPRESS, LZO1Y_MEM_DECOMPRESS,
lzo1y_999_2_compress, lzo1y_optimize,
lzo1y_decompress, lzo1y_decompress_safe,
lzo1y_decompress_asm, lzo1y_decompress_asm_safe,
lzo1y_decompress_asm_fast, lzo1y_decompress_asm_fast_safe,
0, lzo1y_decompress_dict_safe },
{ "LZO1Y-999/3", 9823, LZO1Y_999_MEM_COMPRESS, LZO1Y_MEM_DECOMPRESS,
lzo1y_999_3_compress, lzo1y_optimize,
lzo1y_decompress, lzo1y_decompress_safe,
lzo1y_decompress_asm, lzo1y_decompress_asm_safe,
lzo1y_decompress_asm_fast, lzo1y_decompress_asm_fast_safe,
0, lzo1y_decompress_dict_safe },
{ "LZO1Y-999/4", 9824, LZO1Y_999_MEM_COMPRESS, LZO1Y_MEM_DECOMPRESS,
lzo1y_999_4_compress, lzo1y_optimize,
lzo1y_decompress, lzo1y_decompress_safe,
lzo1y_decompress_asm, lzo1y_decompress_asm_safe,
lzo1y_decompress_asm_fast, lzo1y_decompress_asm_fast_safe,
0, lzo1y_decompress_dict_safe },
{ "LZO1Y-999/5", 9825, LZO1Y_999_MEM_COMPRESS, LZO1Y_MEM_DECOMPRESS,
lzo1y_999_5_compress, lzo1y_optimize,
lzo1y_decompress, lzo1y_decompress_safe,
lzo1y_decompress_asm, lzo1y_decompress_asm_safe,
lzo1y_decompress_asm_fast, lzo1y_decompress_asm_fast_safe,
0, lzo1y_decompress_dict_safe },
{ "LZO1Y-999/6", 9826, LZO1Y_999_MEM_COMPRESS, LZO1Y_MEM_DECOMPRESS,
lzo1y_999_6_compress, lzo1y_optimize,
lzo1y_decompress, lzo1y_decompress_safe,
lzo1y_decompress_asm, lzo1y_decompress_asm_safe,
lzo1y_decompress_asm_fast, lzo1y_decompress_asm_fast_safe,
0, lzo1y_decompress_dict_safe },
{ "LZO1Y-999/7", 9827, LZO1Y_999_MEM_COMPRESS, LZO1Y_MEM_DECOMPRESS,
lzo1y_999_7_compress, lzo1y_optimize,
lzo1y_decompress, lzo1y_decompress_safe,
lzo1y_decompress_asm, lzo1y_decompress_asm_safe,
lzo1y_decompress_asm_fast, lzo1y_decompress_asm_fast_safe,
0, lzo1y_decompress_dict_safe },
{ "LZO1Y-999/8", 9828, LZO1Y_999_MEM_COMPRESS, LZO1Y_MEM_DECOMPRESS,
lzo1y_999_8_compress, lzo1y_optimize,
lzo1y_decompress, lzo1y_decompress_safe,
lzo1y_decompress_asm, lzo1y_decompress_asm_safe,
lzo1y_decompress_asm_fast, lzo1y_decompress_asm_fast_safe,
0, lzo1y_decompress_dict_safe },
{ "LZO1Y-999/9", 9829, LZO1Y_999_MEM_COMPRESS, LZO1Y_MEM_DECOMPRESS,
lzo1y_999_9_compress, lzo1y_optimize,
lzo1y_decompress, lzo1y_decompress_safe,
lzo1y_decompress_asm, lzo1y_decompress_asm_safe,
lzo1y_decompress_asm_fast, lzo1y_decompress_asm_fast_safe,
0, lzo1y_decompress_dict_safe },
#endif
#endif
#if defined(HAVE_LZO1Z_H)
#if !defined(LZO_999_UNSUPPORTED)
{ "LZO1Z-999", M_LZO1Z_999, LZO1Z_999_MEM_COMPRESS, LZO1Z_MEM_DECOMPRESS,
lzo1z_999_compress, 0,
lzo1z_decompress, lzo1z_decompress_safe,
0, 0,
0, 0,
lzo1z_999_compress_dict, lzo1z_decompress_dict_safe },
#endif
#endif
#if defined(HAVE_LZO2A_H)
#if !defined(LZO_999_UNSUPPORTED)
{ "LZO2A-999", M_LZO2A_999, LZO2A_999_MEM_COMPRESS, LZO2A_MEM_DECOMPRESS,
lzo2a_999_compress, 0,
lzo2a_decompress, lzo2a_decompress_safe,
0, 0,
0, 0,
0, 0 },
#endif
#endif
#if defined(HAVE_ZLIB_H)
{ "zlib-8/1", M_ZLIB_8_1, ZLIB_MEM_COMPRESS, ZLIB_MEM_DECOMPRESS,
zlib_8_1_compress, 0,
zlib_decompress, 0, 0, 0, 0, 0, 0, 0 },
{ "zlib-8/2", M_ZLIB_8_2, ZLIB_MEM_COMPRESS, ZLIB_MEM_DECOMPRESS,
zlib_8_2_compress, 0,
zlib_decompress, 0, 0, 0, 0, 0, 0, 0 },
{ "zlib-8/3", M_ZLIB_8_3, ZLIB_MEM_COMPRESS, ZLIB_MEM_DECOMPRESS,
zlib_8_3_compress, 0,
zlib_decompress, 0, 0, 0, 0, 0, 0, 0 },
{ "zlib-8/4", M_ZLIB_8_4, ZLIB_MEM_COMPRESS, ZLIB_MEM_DECOMPRESS,
zlib_8_4_compress, 0,
zlib_decompress, 0, 0, 0, 0, 0, 0, 0 },
{ "zlib-8/5", M_ZLIB_8_5, ZLIB_MEM_COMPRESS, ZLIB_MEM_DECOMPRESS,
zlib_8_5_compress, 0,
zlib_decompress, 0, 0, 0, 0, 0, 0, 0 },
{ "zlib-8/6", M_ZLIB_8_6, ZLIB_MEM_COMPRESS, ZLIB_MEM_DECOMPRESS,
zlib_8_6_compress, 0,
zlib_decompress, 0, 0, 0, 0, 0, 0, 0 },
{ "zlib-8/7", M_ZLIB_8_7, ZLIB_MEM_COMPRESS, ZLIB_MEM_DECOMPRESS,
zlib_8_7_compress, 0,
zlib_decompress, 0, 0, 0, 0, 0, 0, 0 },
{ "zlib-8/8", M_ZLIB_8_8, ZLIB_MEM_COMPRESS, ZLIB_MEM_DECOMPRESS,
zlib_8_8_compress, 0,
zlib_decompress, 0, 0, 0, 0, 0, 0, 0 },
{ "zlib-8/9", M_ZLIB_8_9, ZLIB_MEM_COMPRESS, ZLIB_MEM_DECOMPRESS,
zlib_8_9_compress, 0,
zlib_decompress, 0, 0, 0, 0, 0, 0, 0 },
#endif
{ "memcpy()", M_MEMCPY, 0, 0, memcpy_x_compress, 0,
memcpy_x_compress, 0, 0, 0, 0, 0, 0, 0 },
{ "memset()", M_MEMSET, 0, 0, memset_x_compress, 0,
memset_x_compress, 0, 0, 0, 0, 0, 0, 0 },
{ "adler32()", M_ADLER32, 0, 0, adler32_x_compress, 0,
adler32_x_compress, 0, 0, 0, 0, 0, 0, 0 },
{ "crc32()", M_CRC32, 0, 0, crc32_x_compress, 0,
crc32_x_compress, 0, 0, 0, 0, 0, 0, 0 },
#if defined(HAVE_ZLIB_H)
{ "z_adler32()", M_Z_ADLER32, 0, 0, zlib_adler32_x_compress, 0,
zlib_adler32_x_compress, 0, 0, 0, 0, 0, 0, 0 },
{ "z_crc32()", M_Z_CRC32, 0, 0, zlib_crc32_x_compress, 0,
zlib_crc32_x_compress, 0, 0, 0, 0, 0, 0, 0 },
#endif
#if defined(MFX)
# include "maint/t_db.ch"
#endif
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/ltest/ltest.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
#! /bin/sh
# ltest - temporary wrapper script for .libs/ltest
# Generated by ltmain.sh - GNU libtool 1.4.2a (1.922.2.93 2002/05/06 15:02:58)
#
# The ltest program cannot be directly executed until all the libtool
# libraries that it depends on are installed.
#
# This wrapper script should never be moved out of the build directory.
# If it is, it will not operate correctly.
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
Xsed=/usr/bin/sed' -e 1s/^X//'
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
if test "${CDPATH+set}" = set; then CDPATH=:; export CDPATH; fi
relink_command="(cd /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/ltest; { test -z \"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { LIBRARY_PATH=; export LIBRARY_PATH; }; }; { test -z \"\${COMPILER_PATH+set}\" || unset COMPILER_PATH || { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z \"\${GCC_EXEC_PREFIX+set}\" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=; export GCC_EXEC_PREFIX; }; }; { test -z \"\${LD_RUN_PATH+set}\" || unset LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; { test -z \"\${LD_LIBRARY_PATH+set}\" || unset LD_LIBRARY_PATH || { LD_LIBRARY_PATH=; export LD_LIBRARY_PATH; }; }; PATH=\"/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/openwin/bin:/usr/games:/usr/local/jdk1.3.1_01/bin:/usr/local/mysql/bin:.\"; export PATH; gcc -O2 -Wall -Wcast-align -Wcast-qual -Wwrite-strings -fno-strength-reduce -fstrict-aliasing -o \$progdir/\$file ltest.o ../src/.libs/liblzo.so -Wl,--rpath -Wl,/home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/src/.libs -Wl,--rpath -Wl,/usr/local/lib)"
# This environment variable determines our operation mode.
if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
# install mode needs the following variable:
notinst_deplibs=' ../src/liblzo.la'
else
# When we are sourced in execute mode, $file and $echo are already set.
if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
echo="echo"
file="$0"
# Make sure echo works.
if test "X$1" = X--no-reexec; then
# Discard the --no-reexec flag, and continue.
shift
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
# Yippee, $echo works!
:
else
# Restart under the correct shell, and then maybe $echo will work.
exec /bin/sh "$0" --no-reexec ${1+"$@"}
fi
fi
# Find the directory that this script lives in.
thisdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
test "x$thisdir" = "x$file" && thisdir=.
# Follow symbolic links until we get to the real thisdir.
file=`ls -ld "$file" | /usr/bin/sed -n 's/.*-> //p'`
while test -n "$file"; do
destdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
# If there was a directory component, then change thisdir.
if test "x$destdir" != "x$file"; then
case "$destdir" in
[\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;;
*) thisdir="$thisdir/$destdir" ;;
esac
fi
file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
file=`ls -ld "$thisdir/$file" | /usr/bin/sed -n 's/.*-> //p'`
done
# Try to get the absolute directory name.
absdir=`cd "$thisdir" && pwd`
test -n "$absdir" && thisdir="$absdir"
program=lt-'ltest'
progdir="$thisdir/.libs"
if test ! -f "$progdir/$program" || \
{ file=`ls -1dt "$progdir/$program" "$progdir/../$program" 2>/dev/null | /usr/bin/sed 1q`; \
test "X$file" != "X$progdir/$program"; }; then
file="$$-$program"
if test ! -d "$progdir"; then
mkdir "$progdir"
else
rm -f "$progdir/$file"
fi
# relink executable if necessary
if test -n "$relink_command"; then
if relink_command_output=`eval $relink_command 2>&1`; then :
else
echo "$relink_command_output" >&2
rm -f "$progdir/$file"
exit 1
fi
fi
mv -f "$progdir/$file" "$progdir/$program" 2>/dev/null ||
{ rm -f "$progdir/$program";
mv -f "$progdir/$file" "$progdir/$program"; }
rm -f "$progdir/$file"
fi
if test -f "$progdir/$program"; then
if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
# Run the actual program with our arguments.
# Export the path to the program.
PATH="$progdir:$PATH"
export PATH
exec $program ${1+"$@"}
$echo "$0: cannot exec $program ${1+"$@"}"
exit 1
fi
else
# The program doesn't exist.
$echo "$0: error: $progdir/$program does not exist" 1>&2
$echo "This script is just a wrapper for $program." 1>&2
echo "See the libtool documentation for more information." 1>&2
exit 1
fi
fi
|
Added work/contrib/lzo/lzo-1.08/ltest/ltest.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
|
/* ltest.c -- very comprehensive test driver for the LZO library
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include <lzoconf.h>
#if defined(LZO_HAVE_CONFIG_H)
# include <config.h>
# include <sys/types.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <ctype.h>
#include <limits.h>
#include <assert.h>
#if defined(__DJGPP__) || defined(__BORLANDC__)
# include <dir.h>
#endif
#if defined(HAVE_UNISTD_H) || defined(__DJGPP__) || defined(__EMX__)
# include <unistd.h>
#endif
#include <lzoutil.h>
#if defined(__LZO_DOS) || defined(__LZO_WIN)
# define HAVE_STRICMP 1
# define HAVE_STRNICMP 1
#endif
#if defined(HAVE_STRNICMP) && !defined(HAVE_STRNCASECMP)
# define strncasecmp strnicmp
#endif
#if 0
# define is_digit(x) (isdigit((unsigned char)(x)))
# define is_space(x) (isspace((unsigned char)(x)))
#else
# define is_digit(x) ((unsigned)(x) - '0' <= 9)
# define is_space(x) ((x)==' ' || (x)=='\t' || (x)=='\r' || (x)=='\n')
#endif
/*************************************************************************
// getopt & high resolution timer
**************************************************************************/
#include "mygetopt.h"
#include "mygetopt.ch"
#include "timer.h"
/*************************************************************************
// compression include section
**************************************************************************/
#define HAVE_LZO1_H
#define HAVE_LZO1A_H
#define HAVE_LZO1B_H
#define HAVE_LZO1C_H
#define HAVE_LZO1F_H
#define HAVE_LZO1X_H
#define HAVE_LZO1Y_H
#define HAVE_LZO1Z_H
#define HAVE_LZO2A_H
#if 1 && defined(MFX) && !defined(LZO_HAVE_CONFIG_H) && !defined(HAVE_ZLIB_H)
#define HAVE_ZLIB_H
#endif
#if defined(NO_ZLIB_H)
#undef HAVE_ZLIB_H
#endif
#if defined(__LZO_DOS16)
/* don't make this test program too big */
#undef HAVE_LZO1_H
#undef HAVE_LZO1A_H
#undef HAVE_LZO1C_H
#undef HAVE_LZO1Z_H
#undef HAVE_LZO2A_H
#undef HAVE_LZO2B_H
#undef HAVE_ZLIB_H
#endif
/* LZO algorithms */
#if defined(HAVE_LZO1_H)
# include <lzo1.h>
#endif
#if defined(HAVE_LZO1A_H)
# include <lzo1a.h>
#endif
#if defined(HAVE_LZO1B_H)
# include <lzo1b.h>
#endif
#if defined(HAVE_LZO1C_H)
# include <lzo1c.h>
#endif
#if defined(HAVE_LZO1F_H)
# include <lzo1f.h>
#endif
#if defined(HAVE_LZO1X_H)
# include <lzo1x.h>
#endif
#if defined(HAVE_LZO1Y_H)
# include <lzo1y.h>
#endif
#if defined(HAVE_LZO1Z_H)
# include <lzo1z.h>
#endif
#if defined(HAVE_LZO2A_H)
# include <lzo2a.h>
#endif
#if defined(HAVE_LZO2B_H)
# include <lzo2b.h>
#endif
/* other compressors */
#if defined(HAVE_ZLIB_H)
# include <zlib.h>
# define ALG_ZLIB
#endif
#if defined(MFX)
# include "maint/t_config.ch"
#endif
/*************************************************************************
// enumerate all methods
**************************************************************************/
enum {
/* compression algorithms */
M_LZO1B_1 = 1,
M_LZO1B_2, M_LZO1B_3, M_LZO1B_4, M_LZO1B_5,
M_LZO1B_6, M_LZO1B_7, M_LZO1B_8, M_LZO1B_9,
M_LZO1C_1 = 11,
M_LZO1C_2, M_LZO1C_3, M_LZO1C_4, M_LZO1C_5,
M_LZO1C_6, M_LZO1C_7, M_LZO1C_8, M_LZO1C_9,
M_LZO1 = 21,
M_LZO1A = 31,
M_LZO1B_99 = 901,
M_LZO1B_999 = 902,
M_LZO1C_99 = 911,
M_LZO1C_999 = 912,
M_LZO1_99 = 921,
M_LZO1A_99 = 931,
M_LZO1F_1 = 61,
M_LZO1F_999 = 962,
M_LZO1X_1 = 71,
M_LZO1X_1_11 = 111,
M_LZO1X_1_12 = 112,
M_LZO1X_1_15 = 115,
M_LZO1XT_1 = 171,
M_LZO1X_999 = 972,
M_LZO1Y_1 = 81,
M_LZO1Y_999 = 982,
M_LZO1Z_999 = 992,
M_LZO2A_999 = 942,
M_LZO2B_999 = 952,
M_LAST_LZO_COMPRESSOR = 998,
/* other compressors */
#if defined(ALG_ZLIB)
M_ZLIB_8_1 = 1101,
M_ZLIB_8_2, M_ZLIB_8_3, M_ZLIB_8_4, M_ZLIB_8_5,
M_ZLIB_8_6, M_ZLIB_8_7, M_ZLIB_8_8, M_ZLIB_8_9,
#endif
/* dummy compressor - for speed comparision */
M_MEMCPY = 999,
M_LAST_COMPRESSOR = 4999,
/* dummy algorithms - for speed comparision */
M_MEMSET = 5001,
/* checksum algorithms - for speed comparision */
M_ADLER32 = 6001,
M_CRC32 = 6002,
#if defined(ALG_ZLIB)
M_Z_ADLER32 = 6011,
M_Z_CRC32 = 6012,
#endif
M_UNUSED
};
#if defined(LZO_99_UNSUPPORTED)
#define M_LZO1_99 (-1)
#define M_LZO1A_99 (-1)
#define M_LZO1B_99 (-1)
#define M_LZO1C_99 (-1)
#endif
#if defined(LZO_999_UNSUPPORTED)
#define M_LZO1B_999 (-1)
#define M_LZO1C_999 (-1)
#define M_LZO1F_999 (-1)
#define M_LZO1X_999 (-1)
#define M_LZO1Y_999 (-1)
#define M_LZO1Z_999 (-1)
#define M_LZO2A_999 (-1)
#define M_LZO2B_999 (-1)
#endif
/*************************************************************************
// command line options
**************************************************************************/
#if defined(MAINT)
int opt_verbose = 1;
#else
int opt_verbose = 2;
#endif
int opt_c_loops = 0;
int opt_d_loops = 0;
const char *opt_calgary_corpus_path = NULL;
const char *opt_dump_compressed_data = NULL;
lzo_bool opt_use_safe_decompressor = 0;
lzo_bool opt_use_asm_decompressor = 0;
lzo_bool opt_use_asm_fast_decompressor = 0;
lzo_bool opt_optimize_compressed_data = 0;
int opt_dict = 0;
lzo_int opt_max_dict_len = LZO_INT_MAX;
const char *opt_dictionary_file = NULL;
lzo_bool opt_read_from_stdin = 0;
/* set these to 1 to measure the speed impact of a checksum */
lzo_bool opt_compute_adler32 = 0;
lzo_bool opt_compute_crc32 = 0;
static lzo_uint32 adler_in, adler_out;
static lzo_uint32 crc_in, crc_out;
lzo_bool opt_execution_time = 0;
lzo_bool opt_totals = 0;
static unsigned long total_n = 0;
static unsigned long total_c_len = 0;
static unsigned long total_d_len = 0;
static unsigned long total_blocks = 0;
static double total_c_kbs = 0.0;
static double total_d_kbs = 0.0;
lzo_bool opt_query = 0; /* query interface is not implemented yet */
static const lzo_bool opt_try_to_compress_0_bytes = 1;
static const char *argv0 = "";
#if defined(HAVE_LZO1X_H)
int default_method = M_LZO1X_1;
#elif defined(HAVE_LZO1B_H)
int default_method = M_LZO1B_1;
#elif defined(HAVE_LZO1C_H)
int default_method = M_LZO1C_1;
#elif defined(HAVE_LZO1F_H)
int default_method = M_LZO1F_1;
#elif defined(HAVE_LZO1Y_H)
int default_method = M_LZO1Y_1;
#else
int default_method = M_MEMCPY;
#endif
static const int benchmark_methods[] = {
M_LZO1B_1, M_LZO1B_9,
M_LZO1C_1, M_LZO1C_9,
M_LZO1F_1,
M_LZO1X_1,
0
};
static const int x1_methods[] = {
M_LZO1, M_LZO1A, M_LZO1B_1, M_LZO1C_1, M_LZO1F_1, M_LZO1X_1, M_LZO1Y_1,
0
};
static const int x99_methods[] = {
M_LZO1_99, M_LZO1A_99, M_LZO1B_99, M_LZO1C_99,
0
};
static const int x999_methods[] = {
M_LZO1B_999, M_LZO1C_999, M_LZO1F_999, M_LZO1X_999, M_LZO1Y_999,
M_LZO1Z_999,
M_LZO2A_999,
0
};
/* exit codes of this test program */
#define EXIT_OK 0
#define EXIT_USAGE 1
#define EXIT_FILE 2
#define EXIT_MEM 3
#define EXIT_ADLER 4
#define EXIT_LZO_ERROR 5
#define EXIT_LZO_INIT 6
#define EXIT_INTERNAL 7
/*************************************************************************
// memory setup
**************************************************************************/
#if 0 && (UINT_MAX >= LZO_0xffffffffL)
#define USE_MALLOC
#endif
#if defined(__LZO_STRICT_16BIT)
#define BLOCK_SIZE 32000u
#define MAX_BLOCK_SIZE (55*1024u)
#define DATA_LEN (63*1024u)
#define WRK_LEN (32*1024u)
#elif defined(__LZO_TOS) || defined(__LZO_WIN16)
/* adjust memory so that it works on a 4 meg machine */
#define BLOCK_SIZE (256*1024l)
#define MAX_BLOCK_SIZE (1*BLOCK_SIZE)
#define DATA_LEN (1024*1024l)
#define WRK_LEN (768*1024l)
#define USE_CORPUS
#elif (UINT_MAX >= LZO_0xffffffffL) /* 32 bit or more */
#define BLOCK_SIZE (256*1024l)
#define MAX_BLOCK_SIZE (5*256*1024l)
#define DATA_LEN (5*256*1024l)
#ifndef WRK_LEN
#define WRK_LEN (768*1024l * ((sizeof(long)+3)/4))
#endif
#define DICT_LEN 0xbfff
#define USE_DUMP
#define USE_CORPUS
#else
/* DOS 16 bit - have to squeeze everything into ~600 kB */
#define BLOCK_SIZE 32000u
#define MAX_BLOCK_SIZE 40000u
#define DATA_LEN (64*1024l)
#define WRK_LEN (64*1024l)
#endif
static lzo_uint opt_block_size = BLOCK_SIZE;
static lzo_uint opt_max_data_len = 0;
static lzo_byte _block1[MAX_BLOCK_SIZE * 9L / 8 + 256 + 1024];
static lzo_byte _block2[MAX_BLOCK_SIZE * 9L / 8 + 256 + 1024];
static lzo_byte _wrkmem[16 + WRK_LEN + 256 + 16];
#ifdef USE_MALLOC
#undef DATA_LEN
static lzo_byte *_data = NULL;
#else
static lzo_byte _data[DATA_LEN + 256];
#endif
#ifdef DICT_LEN
#define USE_DICT
static lzo_byte _dict[DICT_LEN];
static lzo_byte *dict = _dict;
static lzo_uint32 dict_adler32;
#else
static lzo_byte *dict = NULL;
#endif
static lzo_uint dict_len = 0;
/* align memory blocks (cache issues) */
static lzo_byte *block1 = NULL;
static lzo_byte *block2 = NULL;
static lzo_byte *wrkmem = NULL;
static lzo_byte *data = NULL;
static void align_mem(void)
{
block1 = LZO_PTR_ALIGN_UP(_block1,256);
block2 = LZO_PTR_ALIGN_UP(_block2,256);
wrkmem = LZO_PTR_ALIGN_UP(_wrkmem+16,256);
}
/* lock all memory to avoid any swapping to disk */
#if 0 && defined(__DJGPP__)
# include <crt0.h>
int _crt0_startup_flags = _CRT0_FLAG_LOCK_MEMORY;
#endif
/*************************************************************************
// dictionary support
**************************************************************************/
#ifdef USE_DICT
static void init_default_dict(void)
{
lzo_uint i, j, d, dd;
dict_len = DICT_LEN;
lzo_memset(dict,0,dict_len);
/* this default dictionary does not provide good contexts... */
dd = dict_len;
if (dd >= 16 * 256)
{
dd -= 16 * 256;
for (i = 0, d = dd; i < 256; i++)
for (j = 0; j < 16; j++)
dict[d++] = (unsigned char) i;
}
dict_adler32 = lzo_adler32(0,NULL,0);
dict_adler32 = lzo_adler32(dict_adler32,dict,dict_len);
}
static void read_dict(const char *file_name)
{
FILE *f;
dict_len = 0;
f = fopen(file_name,"rb");
if (f)
{
dict_len = lzo_fread(f,dict,DICT_LEN);
fclose(f);
dict_adler32 = lzo_adler32(0,NULL,0);
dict_adler32 = lzo_adler32(dict_adler32,dict,dict_len);
}
}
#endif
/*************************************************************************
// compression database
**************************************************************************/
typedef struct
{
const char * name;
int id;
lzo_uint32 mem_compress;
lzo_uint32 mem_decompress;
lzo_compress_t compress;
lzo_optimize_t optimize;
lzo_decompress_t decompress;
lzo_decompress_asm_t decompress_safe;
lzo_decompress_asm_t decompress_asm;
lzo_decompress_asm_t decompress_asm_safe;
lzo_decompress_asm_t decompress_asm_fast;
lzo_decompress_asm_t decompress_asm_fast_safe;
lzo_compress_dict_t compress_dict;
lzo_decompress_dict_t decompress_dict_safe;
}
compress_t;
#include "asm.h"
#include "wrap.h"
#define M_PRIVATE LZO_PRIVATE
#define m_uint lzo_uint
#define m_uint32 lzo_uint32
#define m_voidp lzo_voidp
#define m_bytep lzo_bytep
#define m_uintp lzo_uintp
#include "wrapmisc.h"
static const compress_t compress_database[] = {
#include "db.h"
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
/*************************************************************************
// method info
**************************************************************************/
static
lzo_decompress_t get_decomp_info ( const compress_t *c, const char **nn )
{
lzo_decompress_t d = 0;
const char *n = NULL;
/* safe has priority over asm/fast */
if (!d && opt_use_safe_decompressor && opt_use_asm_fast_decompressor)
{
d = c->decompress_asm_fast_safe;
n = " [fs]";
}
if (!d && opt_use_safe_decompressor && opt_use_asm_decompressor)
{
d = c->decompress_asm_safe;
n = " [as]";
}
if (!d && opt_use_safe_decompressor)
{
d = c->decompress_safe;
n = " [s]";
}
if (!d && opt_use_asm_fast_decompressor)
{
d = c->decompress_asm_fast;
n = " [f]";
}
if (!d && opt_use_asm_decompressor)
{
d = c->decompress_asm;
n = " [a]";
}
if (!d)
{
d = c->decompress;
n = "";
}
if (!d)
n = "(null)";
if (opt_dict && c->decompress_dict_safe)
n = "";
if (nn)
*nn = n;
return d;
}
static
const compress_t *info ( int method, FILE *f )
{
const compress_t *c = NULL;
const compress_t *db = compress_database;
size_t size = sizeof(compress_database) / sizeof(*(compress_database));
size_t i;
if (method > 0)
{
for (i = 0; i < size && db->name != NULL; i++, db++)
{
if (method == db->id &&
WRK_LEN >= db->mem_compress &&
WRK_LEN >= db->mem_decompress)
{
c = db;
break;
}
}
}
if (f != NULL)
{
if (c == NULL)
{
fprintf(f,"%s: invalid method %d\n",argv0,method);
exit(EXIT_USAGE);
}
else
{
const char *n;
get_decomp_info(c,&n);
fprintf(f,"%s%s",c->name,n);
}
}
return c;
}
static
const compress_t *find_method ( const char *name )
{
const compress_t *db = compress_database;
size_t size = sizeof(compress_database) / sizeof(*(compress_database));
size_t i;
for (i = 0; i < size && db->name != NULL; i++, db++)
{
size_t n = strlen(db->name);
#if defined(HAVE_STRNCASECMP)
if (strncasecmp(name,db->name,n) == 0 && (!name[n] || name[n] == ','))
return db;
#else
if (strncmp(name,db->name,n) == 0 && (!name[n] || name[n] == ','))
return db;
#endif
}
return NULL;
}
static
lzo_bool is_compressor ( const compress_t *c )
{
return (c->id <= M_LAST_COMPRESSOR || c->id >= 9721);
}
/*************************************************************************
// check that memory gets accessed within bounds
**************************************************************************/
#if 0 || defined(LZO_DEBUG)
static const lzo_bool opt_check_mem = 1;
#else
static const lzo_bool opt_check_mem = 0;
#endif
void init_mem_checker ( lzo_byte *mem, lzo_byte *mem_base,
lzo_uint32 l, unsigned char random_byte )
{
lzo_uint i;
lzo_uint len = (lzo_uint) l;
if (opt_check_mem && mem && mem_base)
{
for (i = 0; i < 16; i++)
mem[len+i] = random_byte++;
for (i = 0; i < 16 && mem - i > mem_base; i++)
mem[-1-i] = random_byte++;
#if 0 || defined(LZO_DEBUG)
/* fill in garbage */
random_byte |= 1;
for (i = 0; i < len; i++, random_byte += 2)
mem[i] = random_byte;
#endif
}
}
int check_mem ( lzo_byte *mem, lzo_byte *mem_base,
lzo_uint32 l, unsigned char random_byte )
{
lzo_uint i;
lzo_uint len = (lzo_uint) l;
if (opt_check_mem && mem && mem_base)
{
for (i = 0; i < 16; i++)
if (mem[len+i] != random_byte++)
return -1;
for (i = 0; i < 16 && mem - i > mem_base; i++)
if (mem[-1-i] != random_byte++)
return -1;
}
return 0;
}
/*************************************************************************
// compress a block
**************************************************************************/
static
int do_compress ( const compress_t *c,
const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len )
{
int r = -100;
if (c && c->compress && WRK_LEN >= c->mem_compress)
{
#if defined(__LZO_CHECKER)
/* malloc a block of the exact size to detect any overrun */
lzo_byte *w = wrkmem;
if (c->mem_compress > 0)
{
wrkmem = malloc(c->mem_compress);
/* must initialize memory - fill in garbage */
{
lzo_uint32 i;
unsigned char random_byte = (unsigned char) src_len;
random_byte |= 1;
for (i = 0; i < c->mem_compress; i++, random_byte += 2)
wrkmem[i] = random_byte;
}
}
else
wrkmem = NULL;
#else
unsigned char random_byte = (unsigned char) src_len;
init_mem_checker(wrkmem,_wrkmem,c->mem_compress,random_byte);
#endif
if (opt_dict && c->compress_dict)
r = c->compress_dict(src,src_len,dst,dst_len,wrkmem,dict,dict_len);
else
r = c->compress(src,src_len,dst,dst_len,wrkmem);
#if defined(__LZO_CHECKER)
if (wrkmem)
free(wrkmem);
wrkmem = w;
#else
if (check_mem(wrkmem,_wrkmem,c->mem_compress,random_byte) != 0)
printf("WARNING: wrkmem overwrite error (compress) !!!\n");
#endif
}
if (r == 0 && opt_compute_adler32)
{
lzo_uint32 adler;
adler = lzo_adler32(0, NULL, 0);
adler = lzo_adler32(adler, src, src_len);
adler_in = adler;
}
if (r == 0 && opt_compute_crc32)
{
lzo_uint32 crc;
crc = lzo_crc32(0, NULL, 0);
crc = lzo_crc32(crc, src, src_len);
crc_in = crc;
}
return r;
}
/*************************************************************************
// decompress a block
**************************************************************************/
static
int do_decompress ( const compress_t *c, lzo_decompress_t d,
const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len )
{
int r = -100;
if (c && d && WRK_LEN >= c->mem_decompress)
{
unsigned char random_byte = (unsigned char) src_len;
init_mem_checker(wrkmem,_wrkmem,c->mem_decompress,random_byte);
if (opt_dict && c->decompress_dict_safe)
r = c->decompress_dict_safe(src,src_len,dst,dst_len,wrkmem,dict,dict_len);
else
r = d(src,src_len,dst,dst_len,wrkmem);
if (check_mem(wrkmem,_wrkmem,c->mem_decompress,random_byte) != 0)
printf("WARNING: wrkmem overwrite error (decompress) !!!\n");
}
if (r == 0 && opt_compute_adler32)
{
lzo_uint32 adler;
adler = lzo_adler32(0, NULL, 0);
adler = lzo_adler32(adler, dst, *dst_len);
adler_out = adler;
}
if (r == 0 && opt_compute_crc32)
{
lzo_uint32 crc;
crc = lzo_crc32(0, NULL, 0);
crc = lzo_crc32(crc, dst, *dst_len);
crc_out = crc;
}
return r;
}
/*************************************************************************
// optimize a block
**************************************************************************/
static
int do_optimize ( const compress_t *c,
lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len )
{
if (c && c->optimize && WRK_LEN >= c->mem_decompress)
return c->optimize(src,src_len,dst,dst_len,wrkmem);
else
return 0;
}
/***********************************************************************
// read a file
************************************************************************/
static const char *last_file = NULL;
static lzo_uint last_len = 0;
static void unload_file(void)
{
last_file = NULL;
last_len = 0;
#ifdef USE_MALLOC
if (_data)
{
free(_data);
data = _data = NULL;
}
#endif
}
int load_file ( const char *file_name, lzo_uintp len )
{
FILE *f;
long ll = -1;
unsigned long ul;
lzo_uint l;
int r;
#if 0
if (last_file && strcmp(file_name,last_file) == 0)
{
*len = last_len;
return EXIT_OK;
}
#endif
*len = 0;
unload_file();
f = fopen(file_name,"rb");
if (f == NULL)
{
fprintf(stderr,"%s: ",file_name);
perror("fopen");
fflush(stderr);
return EXIT_FILE;
}
r = fseek(f,0,SEEK_END);
if (r == 0)
{
ll = ftell(f);
r = fseek(f,0,SEEK_SET);
}
if (r != 0 || ll < 0)
{
fprintf(stderr,"%s: ",file_name);
perror("fseek");
fflush(stderr);
return EXIT_FILE;
}
ul = ll;
#ifdef USE_MALLOC
l = (ul >= LZO_UINT_MAX - 512 ? LZO_UINT_MAX - 512 : (lzo_uint) ul);
if (opt_max_data_len > 0 && l > opt_max_data_len)
l = opt_max_data_len;
_data = malloc (l + 256);
if (_data == NULL)
{
perror("malloc");
fflush(stderr);
return EXIT_MEM;
}
#else
l = (ul >= DATA_LEN ? (lzo_uint) DATA_LEN : (lzo_uint) ul);
if (opt_max_data_len > 0 && l > opt_max_data_len)
l = opt_max_data_len;
#endif
data = LZO_PTR_ALIGN_UP(_data,256);
l = lzo_fread(f,data,l);
if (fclose(f) != 0)
{
unload_file();
fprintf(stderr,"%s: ",file_name);
perror("fclose");
fflush(stderr);
return EXIT_FILE;
}
last_file = file_name;
last_len = l;
*len = l;
return EXIT_OK;
}
/***********************************************************************
// print some compression statistics
************************************************************************/
static
void print_stats ( const char *method_name, const char *file_name,
int t_loops, int c_loops, int d_loops,
my_clock_t t_time, my_clock_t c_time, my_clock_t d_time,
unsigned long c_len, unsigned long d_len,
unsigned blocks )
{
unsigned long x_len = d_len;
unsigned long t_bytes, c_bytes, d_bytes;
double t_secs, c_secs, d_secs;
double t_kbs, c_kbs, d_kbs;
double perc, bits;
perc = (d_len > 0) ? c_len * 100.0 / d_len : 0;
bits = perc * 0.08;
c_bytes = x_len * c_loops * t_loops;
d_bytes = x_len * d_loops * t_loops;
t_bytes = c_bytes + d_bytes;
c_secs = c_time / (double)(MY_CLOCKS_PER_SEC);
c_kbs = (c_secs > 0.001) ? (c_bytes / c_secs) / 1000.0 : 0;
d_secs = d_time / (double)(MY_CLOCKS_PER_SEC);
d_kbs = (d_secs > 0.001) ? (d_bytes / d_secs) / 1000.0 : 0;
t_secs = t_time / (double)(MY_CLOCKS_PER_SEC);
t_kbs = (t_secs > 0.001) ? (t_bytes / t_secs) / 1000.0 : 0;
total_n++;
total_c_len += c_len;
total_d_len += d_len;
total_blocks += blocks;
total_c_kbs += c_kbs;
total_d_kbs += d_kbs;
if (opt_verbose >= 2)
{
printf(" compressed into %lu bytes, %.2f%% %.3f\n",
(long) c_len, perc, bits);
printf("%-15s %5d: ","overall", t_loops);
printf("%10lu bytes, %8.2f secs, %10.2f KB/sec\n",
t_bytes, t_secs, t_kbs);
printf("%-15s %5d: ","compress", c_loops);
printf("%10lu bytes, %8.2f secs, %10.2f KB/sec\n",
c_bytes, c_secs, c_kbs);
printf("%-15s %5d: ","decompress", d_loops);
printf("%10lu bytes, %8.2f secs, %10.2f KB/sec\n",
d_bytes, d_secs, d_kbs);
printf("\n");
}
/* create a line for util/table.pl */
if (opt_verbose >= 1)
{
/* get basename */
const char *n, *nn, *b;
for (nn = n = b = file_name; *nn; nn++)
if (*nn == '/' || *nn == '\\' || *nn == ':')
b = nn + 1;
else
n = b;
printf("%-12s | %-14s %7ld %4ld %7ld %6.1f %9.2f %9.2f |\n",
method_name, n,
(long) d_len, (long) blocks, (long) c_len, perc,
c_kbs, d_kbs);
}
if (opt_verbose >= 2)
printf("\n");
}
static
void print_totals ( void )
{
double perc;
perc = (total_d_len > 0) ? total_c_len * 100.0 / total_d_len : 0;
if (opt_verbose >= 1 && total_n > 1)
{
printf("%-12s %-14s %7ld %4ld %7ld %6.1f %9.2f %9.2f\n",
"-------", "***TOTALS***",
total_d_len, total_blocks, total_c_len, perc,
total_c_kbs / total_n, total_d_kbs / total_n);
}
}
/*************************************************************************
// compress and decompress a file
**************************************************************************/
static
int process_file ( const compress_t *c, lzo_decompress_t decompress,
const char *method_name,
const char *file_name, lzo_uint l,
int t_loops, int c_loops, int d_loops )
{
int i;
unsigned blocks = 0;
unsigned long compressed_len = 0;
my_clock_t t_time = 0, c_time = 0, d_time = 0;
my_clock_t t_start, c_start, d_start;
#ifdef USE_DUMP
FILE *dump = NULL;
if (opt_dump_compressed_data)
dump = fopen(opt_dump_compressed_data,"wb");
#endif
/* process the file */
t_start = my_clock();
for (i = 0; i < t_loops; i++)
{
lzo_uint len, c_len, c_len_max, d_len = 0;
lzo_byte *d = data;
len = l;
c_len = 0;
blocks = 0;
/* process blocks */
if (len > 0 || opt_try_to_compress_0_bytes) do
{
int j;
int r;
const lzo_uint bl = len > opt_block_size ? opt_block_size : len;
lzo_uint bl_overwrite = bl;
#if defined(__LZO_CHECKER)
lzo_byte *dd = NULL;
lzo_byte *b1 = NULL;
lzo_byte *b2 = NULL;
const lzo_uint b1_len = bl + bl / 64 + 16 + 3;
#else
lzo_byte * const dd = d;
lzo_byte * const b1 = block1;
lzo_byte * const b2 = block2;
const lzo_uint b1_len = sizeof(_block1) - 256;
unsigned char random_byte;
random_byte = (unsigned char) my_clock();
#endif
blocks++;
/* may overwrite 3 bytes past the end of the decompressed block */
if (opt_use_asm_fast_decompressor)
bl_overwrite += (lzo_uint) sizeof(int) - 1;
#if defined(__LZO_CHECKER)
/* malloc a block of the exact size to detect any overrun */
dd = malloc(bl_overwrite > 0 ? bl_overwrite : 1);
b1 = malloc(b1_len);
b2 = dd;
if (dd == NULL || b1 == NULL)
{
perror("malloc");
return EXIT_MEM;
}
if (bl > 0)
memcpy(dd,d,bl);
#endif
/* compress the block */
c_len = c_len_max = 0;
c_start = my_clock();
for (j = r = 0; r == 0 && j < c_loops; j++)
{
c_len = b1_len;
r = do_compress(c,dd,bl,b1,&c_len);
if (r == 0 && c_len > c_len_max)
c_len_max = c_len;
}
c_time += my_clock() - c_start;
if (r != 0)
{
printf(" compression failed in block %d (%d) (%lu %lu)\n",
blocks, r, (long)c_len, (long)bl);
return EXIT_LZO_ERROR;
}
/* optimize the block */
if (opt_optimize_compressed_data)
{
d_len = bl;
r = do_optimize(c,b1,c_len,b2,&d_len);
if (r != 0 || d_len != bl)
{
printf(" optimization failed in block %d (%d) "
"(%lu %lu %lu)\n", blocks, r,
(long)c_len, (long)d_len, (long)bl);
return EXIT_LZO_ERROR;
}
}
#ifdef USE_DUMP
/* dump compressed data to disk */
if (dump)
{
lzo_fwrite(dump,b1,c_len);
fflush(dump);
}
#endif
/* decompress the block and verify */
#if defined(__LZO_CHECKER)
lzo_memset(b2,0,bl_overwrite);
#else
init_mem_checker(b2,_block2,bl_overwrite,random_byte);
#endif
d_start = my_clock();
for (j = r = 0; r == 0 && j < d_loops; j++)
{
d_len = bl;
r = do_decompress(c,decompress,b1,c_len,b2,&d_len);
if (d_len != bl)
break;
}
d_time += my_clock() - d_start;
if (r != 0)
{
printf(" decompression failed in block %d (%d) "
"(%lu %lu %lu)\n", blocks, r,
(long)c_len, (long)d_len, (long)bl);
return EXIT_LZO_ERROR;
}
if (d_len != bl)
{
printf(" decompression size error in block %d (%lu %lu %lu)\n",
blocks, (long)c_len, (long)d_len, (long)bl);
return EXIT_LZO_ERROR;
}
if (is_compressor(c))
{
if (lzo_memcmp(d,b2,bl) != 0)
{
lzo_uint x = 0;
while (x < bl && b2[x] == d[x])
x++;
printf(" decompression data error in block %d at offset "
"%lu (%lu %lu)\n", blocks, (long)x,
(long)c_len, (long)d_len);
if (opt_compute_adler32)
printf(" checksum: 0x%08lx 0x%08lx\n",
(long)adler_in, (long)adler_out);
#if 0
printf("Orig: ");
r = (x >= 10) ? -10 : 0 - (int) x;
for (j = r; j <= 10 && x + j < bl; j++)
printf(" %02x", (int)d[x+j]);
printf("\nDecomp:");
for (j = r; j <= 10 && x + j < bl; j++)
printf(" %02x", (int)b2[x+j]);
printf("\n");
#endif
return EXIT_LZO_ERROR;
}
if ((opt_compute_adler32 && adler_in != adler_out) ||
(opt_compute_crc32 && crc_in != crc_out))
{
printf(" checksum error in block %d (%lu %lu)\n",
blocks, (long)c_len, (long)d_len);
printf(" adler32: 0x%08lx 0x%08lx\n",
(long)adler_in, (long)adler_out);
printf(" crc32: 0x%08lx 0x%08lx\n",
(long)crc_in, (long)crc_out);
return EXIT_LZO_ERROR;
}
}
#if defined(__LZO_CHECKER)
/* free in reverse order of allocations */
free(b1);
free(dd);
#else
if (check_mem(b2,_block2,bl_overwrite,random_byte) != 0)
{
printf(" decompression overwrite error in block %d "
"(%lu %lu %lu)\n",
blocks, (long)c_len, (long)d_len, (long)bl);
return EXIT_LZO_ERROR;
}
#endif
d += bl;
len -= bl;
compressed_len += c_len_max;
}
while (len > 0);
}
t_time += my_clock() - t_start;
#ifdef USE_DUMP
if (dump)
fclose(dump);
opt_dump_compressed_data = NULL; /* only dump the first file */
#endif
print_stats(method_name, file_name,
t_loops, c_loops, d_loops,
t_time, c_time, d_time,
compressed_len, l, blocks);
return EXIT_OK;
}
static
int do_file ( int method, const char *file_name,
int c_loops, int d_loops,
lzo_uint32 *p_adler, lzo_uint32 *p_crc )
{
int r;
const compress_t *c;
lzo_decompress_t decompress;
lzo_uint l;
lzo_uint32 adler, crc;
char method_name[32];
const char *n;
const int t_loops = 1;
lzo_byte *saved_dict = dict;
lzo_uint saved_dict_len = dict_len;
adler_in = adler_out = 0;
crc_in = crc_out = 0;
if (p_adler)
*p_adler = 0;
if (p_crc)
*p_crc = 0;
c = info(method,NULL);
if (c == NULL || c->name == NULL || c->compress == NULL)
return EXIT_INTERNAL;
decompress = get_decomp_info(c,&n);
if (!decompress || n == NULL || WRK_LEN < c->mem_decompress)
return EXIT_INTERNAL;
strcpy(method_name,c->name);
strcat(method_name,n);
if (c_loops < 1) c_loops = 1;
if (d_loops < 1) d_loops = 1;
fflush(stdout); fflush(stderr);
/* read the whole file */
r = load_file(file_name,&l);
if (r != 0)
return r;
/* compute some checksums */
adler = lzo_adler32(0, NULL, 0);
adler = lzo_adler32(adler, data, l);
if (p_adler)
*p_adler = adler;
crc = lzo_crc32(0, NULL, 0);
crc = lzo_crc32(crc, data, l);
if (p_crc)
*p_crc = crc;
#if 0 && defined(ALG_ZLIB)
{
uLong x;
x = adler32(0, Z_NULL, 0);
x = adler32(x, data, l);
if (x != adler)
return EXIT_LZO_ERROR;
x = crc32(0, Z_NULL, 0);
x = crc32(x, data, l);
if (x != crc)
return EXIT_LZO_ERROR;
}
#endif
if (opt_dict && dict)
if (opt_max_dict_len <= 0 && dict_len > l)
{
if (opt_max_dict_len == -1)
dict += dict_len - l; /* use end of dictionary */
dict_len = l;
}
if (opt_verbose >= 2)
{
printf("File %s: %lu bytes (0x%08lx, 0x%08lx)\n",
file_name, (long) l, (long) adler, (long) crc);
printf(" compressing %lu bytes (%d/%d/%d loops, %lu block-size)\n",
(long) l, t_loops, c_loops, d_loops, (long) opt_block_size);
printf(" %s\n", method_name);
}
r = process_file(c, decompress, method_name, file_name, l,
t_loops, c_loops, d_loops);
dict = saved_dict;
dict_len = saved_dict_len;
return r;
}
/*************************************************************************
// Calgary Corpus test suite driver
**************************************************************************/
#ifdef USE_CORPUS
typedef struct
{
const char *name;
int loops;
lzo_uint32 adler;
lzo_uint32 crc;
}
corpus_t;
static const corpus_t calgary_corpus[] =
{
{ "bib", 8, 0x4bd09e98L, 0xb856ebe8L },
{ "book1", 1, 0xd4d3613eL, 0x24e19972L },
{ "book2", 1, 0x6fe14cc3L, 0xba0f3f26L },
{ "geo", 6, 0xf3cc5be0L, 0x4d3a6ed0L },
{ "news", 2, 0x2ed405b8L, 0xcafac853L },
{ "obj1", 35, 0x3887dd2cL, 0xc7b0cd26L },
{ "obj2", 4, 0xf89407c4L, 0x3ae33007L },
{ "paper1", 17, 0xfe65ce62L, 0x2b6baca0L },
{ "paper2", 11, 0x1238b7c2L, 0xf76cba72L },
{ "pic", 4, 0xf61a5702L, 0x4b17e59cL },
{ "progc", 25, 0x4c00ba45L, 0x6fb16094L },
{ "progl", 20, 0x4cba738eL, 0xddbf6baaL },
{ "progp", 28, 0x7495b92bL, 0x493a1809L },
{ "trans", 15, 0x52a2cec8L, 0xcdec06a6L },
{ NULL, 0, 0x00000000L, 0x00000000L },
{ "paper3", 30, 0x50b727a9L, 0x00000000L },
{ "paper4", 30, 0xcb4a305fL, 0x00000000L },
{ "paper5", 30, 0x2ca8a6f3L, 0x00000000L },
{ "paper6", 30, 0x9ddbcfa4L, 0x00000000L },
{ NULL, 0, 0x00000000L, 0x00000000L }
};
static
int do_corpus ( const corpus_t *corpus, int method, const char *path,
int c_loops, int d_loops )
{
size_t i, n;
char name[256];
if (path == NULL || strlen(path) >= sizeof(name) - 12)
return EXIT_USAGE;
strcpy(name,path);
n = strlen(name);
if (n > 0 && name[n-1] != '/' && name[n-1] != '\\' && name[n-1] != ':')
{
strcat(name,"/");
n++;
}
for (i = 0; corpus[i].name != NULL; i++)
{
lzo_uint32 adler, crc;
int c = c_loops * corpus[i].loops;
int d = d_loops * corpus[i].loops;
int r;
strcpy(name+n,corpus[i].name);
r = do_file(method, name, c, d, &adler, &crc);
if (r != 0)
return r;
if (adler != corpus[i].adler)
{
printf(" invalid test suite\n");
return EXIT_ADLER;
}
if (corpus[i].crc && crc != corpus[i].crc)
{
printf(" internal checksum error !! (0x%08lx 0x%08lx)\n",
(long) crc, (long) corpus[i].crc);
return EXIT_INTERNAL;
}
}
return EXIT_OK;
}
#endif
/*************************************************************************
// usage
**************************************************************************/
static
void usage ( const char *name, int exit_code, lzo_bool show_methods )
{
FILE *f;
int i;
f = stdout;
fflush(stdout); fflush(stderr);
fprintf(f,"Usage: %s [option..] file...\n", name);
fprintf(f,"\n");
fprintf(f,"Options:\n");
fprintf(f," -m# compression method\n");
fprintf(f," -b# set input block size (default %ld, max %ld)\n",
(long) opt_block_size, (long) MAX_BLOCK_SIZE);
fprintf(f," -n# number of compression/decompression runs\n");
fprintf(f," -c# number of compression runs\n");
fprintf(f," -d# number of decompression runs\n");
fprintf(f," -S use safe decompressor (if available)\n");
fprintf(f," -A use assembler decompressor (if available)\n");
fprintf(f," -F use fast assembler decompressor (if available)\n");
fprintf(f," -O optimize compressed data (if available)\n");
#ifdef USE_CORPUS
fprintf(f," -s DIR process Calgary Corpus test suite in directory `DIR'\n");
#endif
fprintf(f," -@ read list of files to compress from stdin\n");
fprintf(f," -q be quiet\n");
fprintf(f," -Q be very quiet\n");
fprintf(f," -v be verbose\n");
fprintf(f," -L display software license\n");
if (show_methods)
{
#if defined(my_clock_desc)
fprintf(f,"\nAll timings are recorded using %s.\n",my_clock_desc);
#endif
fprintf(f,"\n\n");
fprintf(f,"The following compression methods are available:\n");
fprintf(f,"\n");
fprintf(f," usage name memory available extras\n");
fprintf(f," ----- ---- ------ ----------------\n");
for (i = 0; i <= M_LAST_COMPRESSOR; i++)
{
const compress_t *c;
c = info(i,NULL);
if (c)
{
char n[16];
static const char * const s[3] = {" ", ", ", ""};
int j = 0;
unsigned long m = c->mem_compress;
sprintf(n,"-m%d",i);
fprintf(f," %-6s %-12s",n,c->name);
#if 1
fprintf(f,"%9ld", m);
#else
m = (m + 1023) / 1024;
fprintf(f,"%6ld kB", m);
#endif
if (c->decompress_safe)
fprintf(f, "%s%s", j++ == 0 ? s[0] : s[1], "safe");
if (c->decompress_asm)
fprintf(f, "%s%s", j++ == 0 ? s[0] : s[1], "asm");
if (c->decompress_asm_safe)
fprintf(f, "%s%s", j++ == 0 ? s[0] : s[1], "asm+safe");
if (c->decompress_asm_fast)
fprintf(f, "%s%s", j++ == 0 ? s[0] : s[1], "fastasm");
if (c->decompress_asm_fast_safe)
fprintf(f, "%s%s", j++ == 0 ? s[0] : s[1], "fastasm+safe");
if (c->optimize)
fprintf(f, "%s%s", j++ == 0 ? s[0] : s[1], "optimize");
if (j > 0)
fprintf(f, s[2]);
fprintf(f,"\n");
}
}
}
else
{
fprintf(f,"\n");
fprintf(f,"Type '%s -m' to list all available methods.\n", name);
}
fflush(f);
if (exit_code < 0)
exit_code = EXIT_USAGE;
exit(exit_code);
}
static
void license(void)
{
FILE *f;
f = stdout;
fflush(stdout); fflush(stderr);
fprintf(f,
" The LZO library is free software; you can redistribute it and/or\n"
" modify it under the terms of the GNU General Public License as\n"
" published by the Free Software Foundation; either version 2 of\n"
" the License, or (at your option) any later version.\n"
"\n"
" The LZO library is distributed in the hope that it will be useful,\n"
" but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
" GNU General Public License for more details.\n"
"\n"
" You should have received a copy of the GNU General Public License\n"
" along with the LZO library; see the file COPYING.\n"
" If not, write to the Free Software Foundation, Inc.,\n"
" 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n"
"\n"
" Markus F.X.J. Oberhumer\n"
" <markus.oberhumer@jk.uni-linz.ac.at>\n"
" http://www.oberhumer.com/opensource/lzo/\n"
"\n"
);
fflush(f);
exit(EXIT_OK);
}
/*************************************************************************
// parse method option '-m'
**************************************************************************/
static int methods[256+1];
static int methods_n = 0;
static void add_method(int m)
{
int i;
if (m > 0)
{
if (!info(m,NULL))
info(m,stdout);
for (i = 0; i < methods_n; i++)
if (methods[i] == m)
return;
if (methods_n >= 256)
{
fprintf(stderr,"%s: too many methods\n",argv0);
exit(EXIT_USAGE);
}
methods[methods_n++] = m;
methods[methods_n] = 0;
}
}
static void add_methods(const int *ml)
{
while (*ml != 0)
add_method(*ml++);
}
static void add_all_methods(int first, int last)
{
int m;
for (m = first; m <= last; m++)
if (info(m,NULL) != NULL)
add_method(m);
}
static int m_strcmp(const char *a, const char *b)
{
size_t n;
if (a[0] == 0 || b[0] == 0)
return 1;
n = strlen(b);
if (strncmp(a,b,n) == 0 && (a[n] == 0 || a[n] == ','))
return 0;
return 1;
}
static lzo_bool m_strisdigit(const char *s)
{
for (;;)
{
if (!is_digit(*s))
return 0;
s++;
if (*s == 0 || *s == ',')
return 1;
}
}
static void parse_methods(const char *p)
{
const compress_t *c;
for (;;)
{
if (p == NULL || p[0] == 0)
usage(argv0,-1,1);
else if ((c = find_method(p)) != NULL)
add_method(c->id);
else if (m_strcmp(p,"all") == 0 || m_strcmp(p,"avail") == 0)
add_all_methods(1,M_LAST_COMPRESSOR);
else if (m_strcmp(p,"ALL") == 0)
{
add_all_methods(1,M_LAST_COMPRESSOR);
add_all_methods(9721,9729);
add_all_methods(9781,9789);
}
else if (m_strcmp(p,"lzo") == 0)
add_all_methods(1,M_MEMCPY);
else if (m_strcmp(p,"bench") == 0)
add_methods(benchmark_methods);
else if (m_strcmp(p,"m1") == 0)
add_methods(x1_methods);
else if (m_strcmp(p,"m99") == 0)
add_methods(x99_methods);
else if (m_strcmp(p,"m999") == 0)
add_methods(x999_methods);
else if (m_strcmp(p,"1x999") == 0)
add_all_methods(9721,9729);
else if (m_strcmp(p,"1y999") == 0)
add_all_methods(9821,9829);
#if defined(ALG_ZLIB)
else if (m_strcmp(p,"zlib") == 0)
add_all_methods(M_ZLIB_8_1,M_ZLIB_8_9);
#endif
#if defined(MFX)
# include "maint/t_opt_m.ch"
#endif
else if (m_strisdigit(p))
add_method(atoi(p));
else
{
printf("%s: invalid method '%s'\n\n",argv0,p);
exit(EXIT_USAGE);
}
while (*p && *p != ',')
p++;
while (*p == ',')
p++;
if (*p == 0)
return;
}
}
/*************************************************************************
// options
**************************************************************************/
enum {
OPT_LONGOPT_ONLY = 512,
OPT_ADLER32,
OPT_CALGARY_CORPUS,
OPT_CRC32,
OPT_DICT,
OPT_DUMP,
OPT_EXECUTION_TIME,
OPT_MAX_DATA_LEN,
OPT_MAX_DICT_LEN,
OPT_QUERY,
OPT_UNUSED
};
static const struct mfx_option longopts[] =
{
/* { name has_arg *flag val } */
{"help", 0, 0, 'h'+256}, /* give help */
{"license", 0, 0, 'L'}, /* display software license */
{"quiet", 0, 0, 'q'}, /* quiet mode */
{"verbose", 0, 0, 'v'}, /* verbose mode */
{"version", 0, 0, 'V'+256}, /* display version number */
{"adler32", 0, 0, OPT_ADLER32},
#ifdef USE_CORPUS
{"calgary-corpus", 1, 0, OPT_CALGARY_CORPUS},
{"corpus", 1, 0, OPT_CALGARY_CORPUS},
#endif
{"crc32", 0, 0, OPT_CRC32},
#ifdef USE_DICT
{"dict", 1, 0, OPT_DICT},
#endif
#ifdef USE_DUMP
{"dump-compressed", 1, 0, OPT_DUMP},
#endif
{"execution-time", 0, 0, OPT_EXECUTION_TIME},
{"max-data-length", 1, 0, OPT_MAX_DATA_LEN},
#ifdef USE_DICT
{"max-dict-length", 1, 0, OPT_MAX_DICT_LEN},
#endif
{"methods", 1, 0, 'm'},
{"query", 0, 0, OPT_QUERY},
{"totals", 0, 0, 'T'},
{ 0, 0, 0, 0 }
};
static int do_option(int optc)
{
switch (optc)
{
case 'A':
opt_use_asm_decompressor = 1;
break;
case 'b':
opt_block_size = MAX_BLOCK_SIZE;
if (mfx_optarg)
{
if (!mfx_optarg || !is_digit(mfx_optarg[0]))
return optc;
opt_block_size = atoi(mfx_optarg);
}
break;
case 'c':
case 'C':
if (!mfx_optarg || !is_digit(mfx_optarg[0]))
return optc;
opt_c_loops = atoi(mfx_optarg);
break;
case 'd':
case 'D':
if (!mfx_optarg || !is_digit(mfx_optarg[0]))
return optc;
opt_d_loops = atoi(mfx_optarg);
break;
case 'F':
opt_use_asm_fast_decompressor = 1;
break;
case 'h':
case 'H':
case '?':
case 'h'+256:
usage(argv0,EXIT_OK,0);
break;
case 'L':
license();
break;
case 'm':
parse_methods(mfx_optarg);
break;
case 'n':
if (!mfx_optarg || !is_digit(mfx_optarg[0]))
return optc;
opt_c_loops = opt_d_loops = atoi(mfx_optarg);
break;
case 'O':
opt_optimize_compressed_data = 1;
break;
case 'q':
opt_verbose = (opt_verbose > 1) ? opt_verbose - 1 : 1;
break;
case 'Q':
opt_verbose = 0;
break;
#ifdef USE_CORPUS
case 's':
case OPT_CALGARY_CORPUS:
if (!mfx_optarg || !mfx_optarg[0])
return optc;
opt_calgary_corpus_path = mfx_optarg;
break;
#endif
case 'S':
opt_use_safe_decompressor = 1;
break;
case 'T':
opt_totals = 1;
break;
case 'v':
opt_verbose = (opt_verbose < 2) ? 2 : opt_verbose + 1;
break;
case 'V':
case 'V'+256:
exit(EXIT_OK);
break;
case '@':
opt_read_from_stdin = 1;
break;
case '1': case '2': case '3': case '4': case '5':
case '6': case '7': case '8': case '9':
/* this is a dirty hack... */
parse_methods(nextchar-1);
if (nextchar[0])
{
nextchar = NULL;
mfx_optind++;
}
break;
case OPT_ADLER32:
opt_compute_adler32 = 1;
break;
case OPT_CRC32:
opt_compute_crc32 = 1;
break;
#ifdef USE_DICT
case OPT_DICT:
opt_dict = 1;
opt_dictionary_file = mfx_optarg;
break;
#endif
case OPT_EXECUTION_TIME:
opt_execution_time = 1;
break;
#ifdef USE_DUMP
case OPT_DUMP:
opt_dump_compressed_data = mfx_optarg;
break;
#endif
case OPT_MAX_DATA_LEN:
if (!mfx_optarg || !is_digit(mfx_optarg[0]))
return optc;
opt_max_data_len = atoi(mfx_optarg);
break;
#ifdef USE_DICT
case OPT_MAX_DICT_LEN:
if (!mfx_optarg || !(is_digit(mfx_optarg[0]) || mfx_optarg[0] == '-'))
return optc;
opt_max_dict_len = atoi(mfx_optarg);
break;
#endif
case OPT_QUERY:
opt_query = 1;
break;
case '\0':
return -1;
case ':':
return -2;
default:
fprintf(stderr,"%s: internal error in getopt (%d)\n",argv0,optc);
return -3;
}
return 0;
}
static int get_options(int argc, char **argv)
{
int optc;
mfx_optind = 0;
mfx_opterr = 1;
while ((optc = mfx_getopt_long (argc, argv,
#ifdef USE_CORPUS
"Ab::c:C:d:D:FhHLm::n:OqQs:STvV@123456789",
#else
"Ab::c:C:d:D:FhHLm::n:OqQSTvV@123456789",
#endif
longopts, (int *)0)) >= 0)
{
if (do_option(optc) != 0)
exit(EXIT_USAGE);
}
return mfx_optind;
}
/*************************************************************************
// main
**************************************************************************/
int main(int argc, char *argv[])
{
int r = EXIT_OK;
int i, ii;
int m;
time_t t_total;
#if defined(__EMX__)
_response(&argc,&argv);
_wildcard(&argc,&argv);
#endif
if (argv[0])
argv0 = argv[0];
align_mem();
(void) my_clock();
printf("\nLZO real-time data compression library (v%s, %s).\n",
LZO_VERSION_STRING, LZO_VERSION_DATE);
printf("Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer\n\n");
if (lzo_init() != LZO_E_OK)
{
printf("lzo_init() failed !!!\n");
exit(EXIT_LZO_INIT);
}
if (argc < 2)
usage(argv0,-1,0);
i = get_options(argc,argv);
if (methods_n == 0)
add_method(default_method);
if (methods_n > 1 && opt_read_from_stdin)
{
printf("%s: cannot use multiple methods and '-@'\n", argv0);
exit(EXIT_USAGE);
}
if (opt_block_size < 16)
opt_block_size = 16;
if (opt_block_size > MAX_BLOCK_SIZE)
opt_block_size = MAX_BLOCK_SIZE;
dict_len = 0;
#ifndef USE_DICT
opt_dict = 0;
#else
if (opt_dict)
{
opt_optimize_compressed_data = 0;
if (opt_dictionary_file)
{
read_dict(opt_dictionary_file);
if (opt_max_dict_len > 0 && dict_len > (lzo_uint) opt_max_dict_len)
dict_len = opt_max_dict_len;
if (dict_len > 0)
printf("Using dictionary '%s', %ld bytes, ID 0x%08lx.\n",
opt_dictionary_file,
(long) dict_len, (long) dict_adler32);
}
if (dict_len <= 0)
{
init_default_dict();
if (opt_max_dict_len > 0 && dict_len > (lzo_uint) opt_max_dict_len)
dict_len = opt_max_dict_len;
printf("Using default dictionary, %ld bytes, ID 0x%08lx.\n",
(long) dict_len, (long) dict_adler32);
}
if (opt_max_dict_len == -1)
printf("Dictionary size will be adjusted to file size.\n");
else if (opt_max_dict_len <= 0)
printf("Dictionary size will be adjusted to file size.\n");
}
#endif
t_total = time(NULL);
(void) my_clock();
ii = i;
for (m = 0; m < methods_n && r == EXIT_OK; m++)
{
int method = methods[m];
i = ii;
if (i >= argc && opt_calgary_corpus_path == NULL && !opt_read_from_stdin)
usage(argv0,-1,0);
if (m == 0 && opt_verbose >= 1)
printf("%lu block-size\n\n", (long) opt_block_size);
if (!info(method,NULL))
info(method,stdout);
#ifdef USE_CORPUS
if (opt_calgary_corpus_path != NULL)
r = do_corpus(calgary_corpus,method,opt_calgary_corpus_path,
opt_c_loops,opt_d_loops);
else
#endif
{
for ( ; i < argc && r == EXIT_OK; i++)
{
r = do_file(method,argv[i],opt_c_loops,opt_d_loops,NULL,NULL);
if (r == EXIT_FILE) /* ignore file errors */
r = EXIT_OK;
}
if (opt_read_from_stdin)
{
char buf[512], *p;
while (r == EXIT_OK && fgets(buf,sizeof(buf)-1,stdin) != NULL)
{
buf[sizeof(buf)-1] = 0;
p = buf + strlen(buf);
while (p > buf && is_space(p[-1]))
*--p = 0;
p = buf;
while (*p && is_space(*p))
p++;
if (*p)
r = do_file(method,p,opt_c_loops,opt_d_loops,NULL,NULL);
if (r == EXIT_FILE) /* ignore file errors */
r = EXIT_OK;
}
opt_read_from_stdin = 0;
}
}
}
t_total = time(NULL) - t_total;
if (opt_totals)
print_totals();
if (opt_execution_time || (methods_n > 1 && opt_verbose >= 1))
printf("\n%s: execution time: %lu seconds\n", argv0, (long) t_total);
if (r != EXIT_OK)
printf("\n%s: exit code: %d\n", argv0, r);
return r;
}
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/ltest/mygetopt.ch.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
|
/* Getopt for GNU.
NOTE: getopt is now part of the C library, so if you don't know what
"Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu
before changing it!
Copyright (C) 1987, 88, 89, 90, 91, 92, 1993
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifndef EOF
#include <stdio.h>
#include <string.h>
#endif
/* If GETOPT_COMPAT is defined, `+' as well as `--' can introduce a
long-named option. Because this is not POSIX.2 compliant, it is
being phased out. */
/* #define GETOPT_COMPAT */
#undef GETOPT_COMPAT
/* This version of `getopt' appears to the caller like standard Unix `getopt'
but it behaves differently for the user, since it allows the user
to intersperse the options with the other arguments.
As `getopt' works, it permutes the elements of ARGV so that,
when it is done, all the options precede everything else. Thus
all application programs are extended to handle flexible argument order.
Setting the environment variable POSIXLY_CORRECT disables permutation.
Then the behavior is completely standard.
GNU application programs can use a third alternative mode in which
they can distinguish the relative order of options and other arguments. */
#include "mygetopt.h"
#define option mfx_option
#define optarg mfx_optarg
#define optind mfx_optind
#define opterr mfx_opterr
#define optopt mfx_optopt
#define my_index strchr
#define my_strlen strlen
#undef BAD_OPTION
/* For communication from `getopt' to the caller.
When `getopt' finds an option that takes an argument,
the argument value is returned here.
Also, when `ordering' is RETURN_IN_ORDER,
each non-option ARGV-element is returned here. */
char *optarg = NULL;
/* Index in ARGV of the next element to be scanned.
This is used for communication to and from the caller
and for communication between successive calls to `getopt'.
On entry to `getopt', zero means this is the first call; initialize.
When `getopt' returns EOF, this is the index of the first of the
non-option elements that the caller should itself scan.
Otherwise, `optind' communicates from one call to the next
how much of ARGV has been scanned so far. */
/* XXX 1003.2 says this must be 1 before any call. */
int optind = 0;
/* The next char to be scanned in the option-element
in which the last option character we returned was found.
This allows us to pick up the scan where we left off.
If this is zero, or a null string, it means resume the scan
by advancing to the next ARGV-element. */
static char *nextchar;
/* Callers store zero here to inhibit the error message
for unrecognized options. */
int opterr = 1;
/* Set to an option character which was unrecognized.
This must be initialized on some systems to avoid linking in the
system's own getopt implementation. */
#define BAD_OPTION '\0'
int optopt = BAD_OPTION;
/* Describe how to deal with options that follow non-option ARGV-elements.
If the caller did not specify anything,
the default is REQUIRE_ORDER if the environment variable
POSIXLY_CORRECT is defined, PERMUTE otherwise.
REQUIRE_ORDER means don't recognize them as options;
stop option processing when the first non-option is seen.
This is what Unix does.
This mode of operation is selected by either setting the environment
variable POSIXLY_CORRECT, or using `+' as the first character
of the list of option characters.
PERMUTE is the default. We permute the contents of ARGV as we scan,
so that eventually all the non-options are at the end. This allows options
to be given in any order, even with programs that were not written to
expect this.
RETURN_IN_ORDER is an option available to programs that were written
to expect options and other ARGV-elements in any order and that care about
the ordering of the two. We describe each non-option ARGV-element
as if it were the argument of an option with character code 1.
Using `-' as the first character of the list of option characters
selects this mode of operation.
The special argument `--' forces an end of option-scanning regardless
of the value of `ordering'. In the case of RETURN_IN_ORDER, only
`--' can cause `getopt' to return EOF with `optind' != ARGC. */
static enum
{
REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
} ordering;
/* Handle permutation of arguments. */
/* Describe the part of ARGV that contains non-options that have
been skipped. `first_nonopt' is the index in ARGV of the first of them;
`last_nonopt' is the index after the last of them. */
static int first_nonopt;
static int last_nonopt;
/* Exchange two adjacent subsequences of ARGV.
One subsequence is elements [first_nonopt,last_nonopt)
which contains all the non-options that have been skipped so far.
The other is elements [last_nonopt,optind), which contains all
the options processed since those non-options were skipped.
`first_nonopt' and `last_nonopt' are relocated so that they describe
the new indices of the non-options in ARGV after they are moved.
To perform the swap, we first reverse the order of all elements. So
all options now come before all non options, but they are in the
wrong order. So we put back the options and non options in original
order by reversing them again. For example:
original input: a b c -x -y
reverse all: -y -x c b a
reverse options: -x -y c b a
reverse non options: -x -y a b c
*/
static void exchange (char **argv)
{
char *temp, **first, **last;
/* Reverse all the elements [first_nonopt, optind) */
first = &argv[first_nonopt];
last = &argv[optind-1];
while (first < last) {
temp = *first; *first = *last; *last = temp; first++; last--;
}
/* Put back the options in order */
first = &argv[first_nonopt];
first_nonopt += (optind - last_nonopt);
last = &argv[first_nonopt - 1];
while (first < last) {
temp = *first; *first = *last; *last = temp; first++; last--;
}
/* Put back the non options in order */
first = &argv[first_nonopt];
last_nonopt = optind;
last = &argv[last_nonopt-1];
while (first < last) {
temp = *first; *first = *last; *last = temp; first++; last--;
}
}
/* Scan elements of ARGV (whose length is ARGC) for option characters
given in OPTSTRING.
If an element of ARGV starts with '-', and is not exactly "-" or "--",
then it is an option element. The characters of this element
(aside from the initial '-') are option characters. If `getopt'
is called repeatedly, it returns successively each of the option characters
from each of the option elements.
If `getopt' finds another option character, it returns that character,
updating `optind' and `nextchar' so that the next call to `getopt' can
resume the scan with the following option character or ARGV-element.
If there are no more option characters, `getopt' returns `EOF'.
Then `optind' is the index in ARGV of the first ARGV-element
that is not an option. (The ARGV-elements have been permuted
so that those that are not options now come last.)
OPTSTRING is a string containing the legitimate option characters.
If an option character is seen that is not listed in OPTSTRING,
return BAD_OPTION after printing an error message. If you set `opterr' to
zero, the error message is suppressed but we still return BAD_OPTION.
If a char in OPTSTRING is followed by a colon, that means it wants an arg,
so the following text in the same ARGV-element, or the text of the following
ARGV-element, is returned in `optarg'. Two colons mean an option that
wants an optional arg; if there is text in the current ARGV-element,
it is returned in `optarg', otherwise `optarg' is set to zero.
If OPTSTRING starts with `-' or `+', it requests different methods of
handling the non-option ARGV-elements.
See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.
Long-named options begin with `--' instead of `-'.
Their names may be abbreviated as long as the abbreviation is unique
or is an exact match for some defined option. If they have an
argument, it follows the option name in the same ARGV-element, separated
from the option name by a `=', or else the in next ARGV-element.
When `getopt' finds a long-named option, it returns 0 if that option's
`flag' field is nonzero, the value of the option's `val' field
if the `flag' field is zero.
LONGOPTS is a vector of `struct option' terminated by an
element containing a name which is zero.
LONGIND returns the index in LONGOPT of the long-named option found.
It is only valid when a long-named option has been found by the most
recent call.
If LONG_ONLY is nonzero, '-' as well as '--' can introduce
long-named options. */
static int _getopt_internal (int argc, char **argv, const char *optstring,
const struct option *longopts, int *longind,
int long_only)
{
static char empty_string[1];
int option_index;
if (longind != NULL)
*longind = -1;
optarg = 0;
/* Initialize the internal data when the first call is made.
Start processing options with ARGV-element 1 (since ARGV-element 0
is the program name); the sequence of previously skipped
non-option ARGV-elements is empty. */
if (optind == 0)
{
first_nonopt = last_nonopt = optind = 1;
nextchar = NULL;
/* Determine how to handle the ordering of options and nonoptions. */
if (optstring[0] == '-')
{
ordering = RETURN_IN_ORDER;
++optstring;
}
else if (optstring[0] == '+')
{
ordering = REQUIRE_ORDER;
++optstring;
}
#if 0
else if (getenv ("POSIXLY_CORRECT") != NULL)
ordering = REQUIRE_ORDER;
#endif
else
ordering = PERMUTE;
}
if (nextchar == NULL || *nextchar == '\0')
{
if (ordering == PERMUTE)
{
/* If we have just processed some options following some non-options,
exchange them so that the options come first. */
if (first_nonopt != last_nonopt && last_nonopt != optind)
exchange (argv);
else if (last_nonopt != optind)
first_nonopt = optind;
/* Now skip any additional non-options
and extend the range of non-options previously skipped. */
while (optind < argc
&& (argv[optind][0] != '-' || argv[optind][1] == '\0')
#ifdef GETOPT_COMPAT
&& (longopts == NULL
|| argv[optind][0] != '+' || argv[optind][1] == '\0')
#endif /* GETOPT_COMPAT */
)
optind++;
last_nonopt = optind;
}
/* Special ARGV-element `--' means premature end of options.
Skip it like a null option,
then exchange with previous non-options as if it were an option,
then skip everything else like a non-option. */
if (optind != argc && !strcmp (argv[optind], "--"))
{
optind++;
if (first_nonopt != last_nonopt && last_nonopt != optind)
exchange (argv);
else if (first_nonopt == last_nonopt)
first_nonopt = optind;
last_nonopt = argc;
optind = argc;
}
/* If we have done all the ARGV-elements, stop the scan
and back over any non-options that we skipped and permuted. */
if (optind == argc)
{
/* Set the next-arg-index to point at the non-options
that we previously skipped, so the caller will digest them. */
if (first_nonopt != last_nonopt)
optind = first_nonopt;
return EOF;
}
/* If we have come to a non-option and did not permute it,
either stop the scan or describe it to the caller and pass it by. */
if ((argv[optind][0] != '-' || argv[optind][1] == '\0')
#ifdef GETOPT_COMPAT
&& (longopts == NULL
|| argv[optind][0] != '+' || argv[optind][1] == '\0')
#endif /* GETOPT_COMPAT */
)
{
if (ordering == REQUIRE_ORDER)
return EOF;
optarg = argv[optind++];
return 1;
}
/* We have found another option-ARGV-element.
Start decoding its characters. */
nextchar = (argv[optind] + 1
+ (longopts != NULL && argv[optind][1] == '-'));
}
if (longopts != NULL
&& ((argv[optind][0] == '-'
&& (argv[optind][1] == '-' || long_only))
#ifdef GETOPT_COMPAT
|| argv[optind][0] == '+'
#endif /* GETOPT_COMPAT */
))
{
const struct option *p;
char *s = nextchar;
int exact = 0;
int ambig = 0;
const struct option *pfound = NULL;
int indfound = 0;
int needexact = 0;
#if defined(__LZO_DOS) || defined(__LZO_WIN)
/* allow `--option#value' because you cannout assign a '='
to an environment variable under DOS command.com */
while (*s && *s != '=' && * s != '#')
s++;
#else
while (*s && *s != '=')
s++;
#endif
/* Test all options for either exact match or abbreviated matches. */
for (p = longopts, option_index = 0; p->name;
p++, option_index++)
if (!strncmp (p->name, nextchar, (unsigned) (s - nextchar)))
{
if (p->has_arg & 0x10)
needexact = 1;
if ((unsigned) (s - nextchar) == my_strlen (p->name))
{
/* Exact match found. */
pfound = p;
indfound = option_index;
exact = 1;
break;
}
else if (pfound == NULL)
{
/* First nonexact match found. */
pfound = p;
indfound = option_index;
}
else
/* Second nonexact match found. */
ambig = 1;
}
/* don't allow nonexact longoptions */
if (needexact && !exact)
{
if (opterr)
fprintf (stderr, "%s: unrecognized option `%s'\n",
argv[0], argv[optind]);
nextchar += my_strlen (nextchar);
optind++;
return BAD_OPTION;
}
if (ambig && !exact)
{
if (opterr)
fprintf (stderr, "%s: option `%s' is ambiguous\n",
argv[0], argv[optind]);
nextchar += my_strlen (nextchar);
optind++;
return BAD_OPTION;
}
if (pfound != NULL)
{
int have_arg = (s[0] != '\0');
if (have_arg && (pfound->has_arg & 0xf))
have_arg = (s[1] != '\0');
option_index = indfound;
optind++;
if (have_arg)
{
/* Don't test has_arg with >, because some C compilers don't
allow it to be used on enums. */
if (pfound->has_arg & 0xf)
optarg = s + 1;
else
{
if (opterr)
{
if (argv[optind - 1][1] == '-')
/* --option */
fprintf (stderr,
"%s: option `--%s' doesn't allow an argument\n",
argv[0], pfound->name);
else
/* +option or -option */
fprintf (stderr,
"%s: option `%c%s' doesn't allow an argument\n",
argv[0], argv[optind - 1][0], pfound->name);
}
nextchar += my_strlen (nextchar);
return BAD_OPTION;
}
}
else if ((pfound->has_arg & 0xf) == 1)
{
#if 0
if (optind < argc)
#else
if (optind < argc && (pfound->has_arg & 0x20) == 0)
#endif
optarg = argv[optind++];
else
{
if (opterr)
fprintf (stderr, "%s: option `--%s%s' requires an argument\n",
argv[0], pfound->name,
(pfound->has_arg & 0x20) ? "=" : "");
nextchar += my_strlen (nextchar);
return optstring[0] == ':' ? ':' : BAD_OPTION;
}
}
nextchar += my_strlen (nextchar);
if (longind != NULL)
*longind = option_index;
if (pfound->flag)
{
*(pfound->flag) = pfound->val;
return 0;
}
return pfound->val;
}
/* Can't find it as a long option. If this is not getopt_long_only,
or the option starts with '--' or is not a valid short
option, then it's an error.
Otherwise interpret it as a short option. */
if (!long_only || argv[optind][1] == '-'
#ifdef GETOPT_COMPAT
|| argv[optind][0] == '+'
#endif /* GETOPT_COMPAT */
|| my_index (optstring, *nextchar) == NULL)
{
if (opterr)
{
if (argv[optind][1] == '-')
/* --option */
fprintf (stderr, "%s: unrecognized option `--%s'\n",
argv[0], nextchar);
else
/* +option or -option */
fprintf (stderr, "%s: unrecognized option `%c%s'\n",
argv[0], argv[optind][0], nextchar);
}
nextchar = empty_string;
optind++;
return BAD_OPTION;
}
ambig = ambig;
}
/* Look at and handle the next option-character. */
{
char c = *nextchar++;
const char *temp = my_index (optstring, c);
/* Increment `optind' when we start to process its last character. */
if (*nextchar == '\0')
++optind;
if (temp == NULL || c == ':')
{
if (opterr)
{
#if 0
if (c < 040 || c >= 0177)
fprintf (stderr, "%s: unrecognized option, character code 0%o\n",
argv[0], c);
else
fprintf (stderr, "%s: unrecognized option `-%c'\n", argv[0], c);
#else
/* 1003.2 specifies the format of this message. */
fprintf (stderr, "%s: illegal option -- %c\n", argv[0], c);
#endif
}
optopt = c;
return BAD_OPTION;
}
if (temp[1] == ':')
{
if (temp[2] == ':')
{
/* This is an option that accepts an argument optionally. */
if (*nextchar != '\0')
{
optarg = nextchar;
optind++;
}
else
optarg = 0;
nextchar = NULL;
}
else
{
/* This is an option that requires an argument. */
if (*nextchar != '\0')
{
optarg = nextchar;
/* If we end this ARGV-element by taking the rest as an arg,
we must advance to the next element now. */
optind++;
}
else if (optind == argc)
{
if (opterr)
{
#if 0
fprintf (stderr, "%s: option `-%c' requires an argument\n",
argv[0], c);
#else
/* 1003.2 specifies the format of this message. */
fprintf (stderr, "%s: option requires an argument -- %c\n",
argv[0], c);
#endif
}
optopt = c;
if (optstring[0] == ':')
c = ':';
else
c = BAD_OPTION;
}
else
/* We already incremented `optind' once;
increment it again when taking next ARGV-elt as argument. */
optarg = argv[optind++];
nextchar = NULL;
}
}
return c;
}
}
int mfx_getopt(int argc, char **argv, const char *optstring)
{
return _getopt_internal (argc, argv, optstring,
(const struct option *) 0,
(int *) 0,
0);
}
int mfx_getopt_long(int argc, char **argv, const char *options,
const struct option *long_options, int *opt_index)
{
return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
}
#ifdef TEST
/* Compile with -DTEST to make an executable for use in testing
the above definition of `getopt'. */
int
main (argc, argv)
int argc;
char **argv;
{
int c;
int digit_optind = 0;
while (1)
{
int this_option_optind = optind ? optind : 1;
c = getopt (argc, argv, "abc:d:0123456789");
if (c == EOF)
break;
switch (c)
{
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
if (digit_optind != 0 && digit_optind != this_option_optind)
printf ("digits occur in two different argv-elements.\n");
digit_optind = this_option_optind;
printf ("option %c\n", c);
break;
case 'a':
printf ("option a\n");
break;
case 'b':
printf ("option b\n");
break;
case 'c':
printf ("option c with value `%s'\n", optarg);
break;
case BAD_OPTION:
break;
default:
printf ("?? getopt returned character code 0%o ??\n", c);
}
}
if (optind < argc)
{
printf ("non-option ARGV-elements: ");
while (optind < argc)
printf ("%s ", argv[optind++]);
printf ("\n");
}
exit (0);
}
#endif /* TEST */
|
Added work/contrib/lzo/lzo-1.08/ltest/mygetopt.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
/* Declarations for getopt.
Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifndef __MFX_GETOPT_H
#define __MFX_GETOPT_H 1
#ifdef __cplusplus
/*extern "C" {*/
#endif
/* For communication from `getopt' to the caller.
When `getopt' finds an option that takes an argument,
the argument value is returned here.
Also, when `ordering' is RETURN_IN_ORDER,
each non-option ARGV-element is returned here. */
extern char *mfx_optarg;
/* Index in ARGV of the next element to be scanned.
This is used for communication to and from the caller
and for communication between successive calls to `getopt'.
On entry to `getopt', zero means this is the first call; initialize.
When `getopt' returns EOF, this is the index of the first of the
non-option elements that the caller should itself scan.
Otherwise, `optind' communicates from one call to the next
how much of ARGV has been scanned so far. */
extern int mfx_optind;
/* Callers store zero here to inhibit the error message `getopt' prints
for unrecognized options. */
extern int mfx_opterr;
/* Set to an option character which was unrecognized. */
extern int mfx_optopt;
/* Describe the long-named options requested by the application.
The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
of `struct option' terminated by an element containing a name which is
zero.
The field `has_arg' is:
no_argument (or 0) if the option does not take an argument,
required_argument (or 1) if the option requires an argument,
optional_argument (or 2) if the option takes an optional argument.
If the field `flag' is not NULL, it points to a variable that is set
to the value given in the field `val' when the option is found, but
left unchanged if the option is not found.
To have a long-named option do something other than set an `int' to
a compiled-in constant, such as set a value from `optarg', set the
option's `flag' field to zero and its `val' field to a nonzero
value (the equivalent single-letter option character, if there is
one). For long options that have a zero `flag' field, `getopt'
returns the contents of the `val' field. */
struct mfx_option
{
const char *name;
/* has_arg can't be an enum because some compilers complain about
type mismatches in all the code that assumes it is an int. */
int has_arg;
int *flag;
int val;
};
/* Names for the values of the `has_arg' field of `struct option'. */
#define mfx_no_argument 0
#define mfx_required_argument 1
#define mfx_optional_argument 2
#define mfx_exact_argument 0x10 /* no abbrev. */
int mfx_getopt(int argc, char **argv, const char *shortopts);
int mfx_getopt_long(int argc, char **argv, const char *shortopts,
const struct mfx_option *longopts, int *longind);
#ifdef __cplusplus
/*}*/
#endif
#endif /* _GETOPT_H */
|
Added work/contrib/lzo/lzo-1.08/ltest/timer.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
|
/* timer.h -- high resolution timer
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/*************************************************************************
//
**************************************************************************/
#if defined(TIME_WITH_SYS_TIME)
# include <sys/time.h>
# include <time.h>
#else
# include <time.h>
#endif
#if !defined(CLOCKS_PER_SEC) && defined(CLK_TCK)
# define CLOCKS_PER_SEC CLK_TCK
#endif
/*************************************************************************
//
**************************************************************************/
#if 0 && defined(MAINT) && defined(__GNUC__) && defined(__i386__)
# define my_clock_t unsigned long long
# define MY_CLOCKS_PER_SEC (133*1024*1024.0)
#define RDTSC1(dest) \
__asm__ __volatile__ \
(".byte 0x0F, 0x31\n" \
"movl %%eax,(%%edi)\n" \
"movl %%edx,4(%%edi)\n" \
"cld \n" \
"nop \n nop \n nop \n" \
"nop \n nop \n nop \n" \
"nop \n nop \n" \
: : "D" (dest) : "eax", "edx")
#define RDTSC2(dest) \
__asm__ __volatile__ \
("clc \n" \
".byte 0x0F, 0x31\n" \
"movl %%eax,(%%edi)\n" \
"movl %%edx,4(%%edi)\n" \
: : "D" (dest) : "eax", "edx")
static my_clock_t my_clock(void)
{
my_clock_t now;
RDTSC2(&now);
return now;
}
/*************************************************************************
//
**************************************************************************/
#elif 0 && defined(__DJGPP__)
# include <dpmi.h>
extern int __bss_count;
static int wuclock_bss = -1;
static uclock_t wuclock_probe(void);
static uclock_t wuclock(void)
{
static struct
{
unsigned short lo, hi;
} vtd; /* address of the Virtual Timer Device API entry point */
static uclock_t base = 0;
uclock_t rv;
__dpmi_regs regs;
if (wuclock_bss != __bss_count)
{
memset(®s,0,sizeof(regs));
regs.x.ax = 0x1684;
regs.x.bx = 0x0005;
regs.x.di = 0;
regs.x.es = 0;
if (__dpmi_simulate_real_mode_interrupt(0x2F,®s))
return -1; /* error: VTD API not available */
vtd.lo = regs.x.di;
vtd.hi = regs.x.es;
if (!(vtd.lo | vtd.hi))
return -1; /* error: VTD API not available */
base = 0;
wuclock_bss = __bss_count;
}
memset(®s,0,sizeof(regs));
regs.x.ax = 0x0100;
regs.x.cs = vtd.hi;
regs.x.ip = vtd.lo;
if (__dpmi_simulate_real_mode_procedure_retf(®s))
return -1; /* error: VTD API call failed */
*((unsigned long *)&rv + 0) = regs.d.eax;
*((unsigned long *)&rv + 1) = regs.d.edx;
if (!base)
base = rv;
return rv - base;
}
static const char *my_clock_desc = "wuclock_probe()";
static uclock_t (*my_clock)(void) = wuclock_probe;
static uclock_t wuclock_probe(void)
{
uclock_t r = wuclock(); /* test if VTD API is available */
if (r == (uclock_t)-1)
{
my_clock_desc = "uclock()";
my_clock = uclock;
return uclock();
}
else
{
my_clock_desc = "wuclock()";
my_clock = wuclock;
return r;
}
}
# define my_clock_t uclock_t
# define MY_CLOCKS_PER_SEC UCLOCKS_PER_SEC
# define my_clock_desc my_clock_desc
/*************************************************************************
//
**************************************************************************/
#elif 1 && defined(__DJGPP__)
# define my_clock() uclock()
# define my_clock_t uclock_t
# define MY_CLOCKS_PER_SEC UCLOCKS_PER_SEC
# define my_clock_desc "uclock()"
/*************************************************************************
// adapted from djgpp library source
**************************************************************************/
#elif 1 && defined(__WATCOMC__) && (UINT_MAX == LZO_0xffffffffL) && (defined(MSDOS) || defined(__DOS__))
# include <dos.h>
# include <i86.h>
# include <conio.h>
#define uclock_t unsigned long
#define _farpeekl(_seg,_off) (* (unsigned long *) (_off))
static int __bss_count = 0;
static int uclock_bss = -1;
static uclock_t my_clock(void)
{
static uclock_t base = 0;
static unsigned long last_tics = 0;
unsigned char lsb, msb;
unsigned long tics, otics;
uclock_t rv;
if (uclock_bss != __bss_count)
{
/* switch the timer to mode 2 (rate generator) */
/* rather than mode 3 (square wave), which doesn't count linearly. */
outp(0x43, 0x34);
outp(0x40, 0xff);
outp(0x40, 0xff);
}
/* Make sure the numbers we get are consistent */
do {
otics = _farpeekl(_dos_ds, 0x46c);
outp(0x43, 0x00);
lsb = inp(0x40);
msb = inp(0x40);
tics = _farpeekl(_dos_ds, 0x46c);
} while (otics != tics);
/* calculate absolute time */
msb ^= 0xff;
lsb ^= 0xff;
rv = ((uclock_t)tics << 16) | (((unsigned)msb << 8) | lsb);
if (uclock_bss != __bss_count)
{
uclock_bss = __bss_count;
base = rv;
last_tics = 0;
}
#if 0
if (last_tics > tics) /* midnight happened */
base -= 0x1800b00000LL;
#endif
last_tics = tics;
/* return relative time */
return rv - base;
}
#undef _farpeekl
# define my_clock_t uclock_t
# define MY_CLOCKS_PER_SEC 1193180ul
# define my_clock_desc "uclock()"
/*************************************************************************
//
**************************************************************************/
#elif 0 && defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_GETRUSAGE)
# include <sys/resource.h>
static double my_clock(void)
{
struct rusage ru;
double d1, d2;
if (getrusage(RUSAGE_SELF,&ru) != 0)
return 0;
d1 = ru.ru_utime.tv_sec * 1000000.0 + ru.ru_utime.tv_usec;
d2 = ru.ru_stime.tv_sec * 1000000.0 + ru.ru_stime.tv_usec;
return d1 + d2;
}
# define my_clock_t double
# define MY_CLOCKS_PER_SEC 1000000
# define my_clock_desc "getrusage()"
/*************************************************************************
//
**************************************************************************/
#elif defined(TIME_WITH_SYS_TIME) && defined(HAVE_GETTIMEOFDAY)
static double my_clock(void)
{
struct timeval tv;
if (gettimeofday(&tv, 0) != 0)
return 0;
return tv.tv_sec * 1000000.0 + tv.tv_usec;
}
# define my_clock_t double
# define MY_CLOCKS_PER_SEC 1000000
# define my_clock_desc "gettimeofday()"
/*************************************************************************
//
**************************************************************************/
#else
# define my_clock() clock()
# define my_clock_t clock_t
# define MY_CLOCKS_PER_SEC CLOCKS_PER_SEC
# define my_clock_desc "clock()"
#endif
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/ltest/wrap.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
|
/* wrap.h -- wrapper functions
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/*************************************************************************
// compression levels of LZO1X-999 and LZO1Y-999
**************************************************************************/
#if defined(HAVE_LZO1X_H) && !defined(LZO_999_UNSUPPORTED)
LZO_PRIVATE(int)
lzo1x_999_1_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem )
{
return lzo1x_999_compress_level(src, src_len, dst, dst_len, wrkmem,
dict, dict_len, 0, 1);
}
LZO_PRIVATE(int)
lzo1x_999_2_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem )
{
return lzo1x_999_compress_level(src, src_len, dst, dst_len, wrkmem,
dict, dict_len, 0, 2);
}
LZO_PRIVATE(int)
lzo1x_999_3_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem )
{
return lzo1x_999_compress_level(src, src_len, dst, dst_len, wrkmem,
dict, dict_len, 0, 3);
}
LZO_PRIVATE(int)
lzo1x_999_4_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem )
{
return lzo1x_999_compress_level(src, src_len, dst, dst_len, wrkmem,
dict, dict_len, 0, 4);
}
LZO_PRIVATE(int)
lzo1x_999_5_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem )
{
return lzo1x_999_compress_level(src, src_len, dst, dst_len, wrkmem,
dict, dict_len, 0, 5);
}
LZO_PRIVATE(int)
lzo1x_999_6_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem )
{
return lzo1x_999_compress_level(src, src_len, dst, dst_len, wrkmem,
dict, dict_len, 0, 6);
}
LZO_PRIVATE(int)
lzo1x_999_7_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem )
{
return lzo1x_999_compress_level(src, src_len, dst, dst_len, wrkmem,
dict, dict_len, 0, 7);
}
LZO_PRIVATE(int)
lzo1x_999_8_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem )
{
return lzo1x_999_compress_level(src, src_len, dst, dst_len, wrkmem,
dict, dict_len, 0, 8);
}
LZO_PRIVATE(int)
lzo1x_999_9_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem )
{
return lzo1x_999_compress_level(src, src_len, dst, dst_len, wrkmem,
dict, dict_len, 0, 9);
}
#endif
#if defined(HAVE_LZO1Y_H) && !defined(LZO_999_UNSUPPORTED)
LZO_PRIVATE(int)
lzo1y_999_1_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem )
{
return lzo1y_999_compress_level(src, src_len, dst, dst_len, wrkmem,
dict, dict_len, 0, 1);
}
LZO_PRIVATE(int)
lzo1y_999_2_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem )
{
return lzo1y_999_compress_level(src, src_len, dst, dst_len, wrkmem,
dict, dict_len, 0, 2);
}
LZO_PRIVATE(int)
lzo1y_999_3_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem )
{
return lzo1y_999_compress_level(src, src_len, dst, dst_len, wrkmem,
dict, dict_len, 0, 3);
}
LZO_PRIVATE(int)
lzo1y_999_4_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem )
{
return lzo1y_999_compress_level(src, src_len, dst, dst_len, wrkmem,
dict, dict_len, 0, 4);
}
LZO_PRIVATE(int)
lzo1y_999_5_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem )
{
return lzo1y_999_compress_level(src, src_len, dst, dst_len, wrkmem,
dict, dict_len, 0, 5);
}
LZO_PRIVATE(int)
lzo1y_999_6_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem )
{
return lzo1y_999_compress_level(src, src_len, dst, dst_len, wrkmem,
dict, dict_len, 0, 6);
}
LZO_PRIVATE(int)
lzo1y_999_7_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem )
{
return lzo1y_999_compress_level(src, src_len, dst, dst_len, wrkmem,
dict, dict_len, 0, 7);
}
LZO_PRIVATE(int)
lzo1y_999_8_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem )
{
return lzo1y_999_compress_level(src, src_len, dst, dst_len, wrkmem,
dict, dict_len, 0, 8);
}
LZO_PRIVATE(int)
lzo1y_999_9_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem )
{
return lzo1y_999_compress_level(src, src_len, dst, dst_len, wrkmem,
dict, dict_len, 0, 9);
}
#endif
/*************************************************************************
// other wrappers (pseudo compressors)
**************************************************************************/
LZO_PRIVATE(int)
memcpy_x_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem )
{
lzo_memcpy(dst,src,src_len);
*dst_len = src_len;
if (wrkmem) wrkmem = 0; /* avoid warning */
return 0;
}
LZO_PRIVATE(int)
memset_x_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem )
{
lzo_memset(dst,0,src_len);
*dst_len = src_len;
if (src) src = 0; /* avoid warning */
if (wrkmem) wrkmem = 0; /* avoid warning */
return 0;
}
LZO_PRIVATE(int)
adler32_x_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem )
{
lzo_uint32 adler;
adler = lzo_adler32(0, NULL, 0);
adler = lzo_adler32(adler, dst, src_len);
*dst_len = src_len;
if (src) src = 0; /* avoid warning */
if (wrkmem) wrkmem = 0; /* avoid warning */
return 0;
}
LZO_PRIVATE(int)
crc32_x_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem )
{
lzo_uint32 crc;
crc = lzo_crc32(0, NULL, 0);
crc = lzo_crc32(crc, dst, src_len);
*dst_len = src_len;
if (src) src = 0; /* avoid warning */
if (wrkmem) wrkmem = 0; /* avoid warning */
return 0;
}
#if defined(MFX)
# include "maint/t_wrap.ch"
#endif
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/ltest/wrapmisc.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
|
/* wrapmisc.h -- misc wrapper functions for the test driver
This file is part of the LZO data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/*************************************************************************
// compression levels of zlib
**************************************************************************/
#if defined(ALG_ZLIB)
#if (ULONG_MAX > 0xffffffffL) /* 64 bits or more */
#define ZLIB_MEM_COMPRESS 600000L
#define ZLIB_MEM_DECOMPRESS 120000L
#else
#define ZLIB_MEM_COMPRESS 300000L
#define ZLIB_MEM_DECOMPRESS 60000L
#endif
#ifndef USE_MALLOC
static m_bytep zlib_heap_ptr = NULL;
static m_uint32 zlib_heap_used = 0;
static m_uint32 zlib_heap_size = 0;
static
voidpf zlib_zalloc ( voidpf opaque, unsigned items, unsigned size )
{
m_uint32 bytes = (m_uint32) items * size;
voidpf ptr = (voidpf) zlib_heap_ptr;
bytes = (bytes + 15u) & ~15u;
if (zlib_heap_used + bytes > zlib_heap_size)
return 0;
zlib_heap_ptr += bytes;
zlib_heap_used += bytes;
opaque = 0;
return ptr;
}
static
void zlib_zfree ( voidpf opaque, voidpf ptr )
{
opaque = 0;
ptr = 0;
}
#endif
static
void zlib_alloc_init ( z_stream *strm, m_voidp wrkmem, m_uint32 s )
{
#ifndef USE_MALLOC
zlib_heap_ptr = (m_bytep) wrkmem;
zlib_heap_size = s;
zlib_heap_used = 0;
strm->zalloc = (alloc_func) zlib_zalloc;
/*strm->zfree = (free_func) zlib_zfree;*/
strm->zfree = zlib_zfree;
#else
strm->zalloc = (alloc_func) 0;
strm->zfree = (free_func) 0;
#endif
}
int zlib_compress ( const m_bytep src, m_uint src_len,
m_bytep dst, m_uintp dst_len,
m_voidp wrkmem,
int c, int level )
{
/* use the undocumented feature to suppress the zlib header */
z_stream stream;
int err = Z_OK;
int flush = Z_FINISH;
int windowBits = opt_dict ? MAX_WBITS : -(MAX_WBITS);
#if 0
stream.next_in = (Bytef *) src; /* UNCONST */
#else
{
union { const m_bytep cp; m_bytep p; } u;
u.cp = src;
stream.next_in = (Bytef *) u.p; /* UNCONST */
}
#endif
stream.avail_in = src_len;
stream.next_out = (Bytef *) dst;
stream.avail_out = *dst_len;
*dst_len = 0;
zlib_alloc_init(&stream,wrkmem,ZLIB_MEM_COMPRESS);
#if 0
err = deflateInit(&stream, level);
#else
err = deflateInit2(&stream, level, c, windowBits,
MAX_MEM_LEVEL > 8 ? 8 : MAX_MEM_LEVEL,
Z_DEFAULT_STRATEGY);
#endif
if (err == Z_OK && opt_dict && dict)
err = deflateSetDictionary(&stream,dict,dict_len);
if (err == Z_OK)
{
err = deflate(&stream, flush);
if (err != Z_STREAM_END)
{
deflateEnd(&stream);
err = (err == Z_OK) ? Z_BUF_ERROR : err;
}
else
{
*dst_len = (m_uint) stream.total_out;
err = deflateEnd(&stream);
}
}
windowBits = windowBits;
return err;
}
M_PRIVATE(int)
zlib_decompress ( const m_bytep src, m_uint src_len,
m_bytep dst, m_uintp dst_len,
m_voidp wrkmem )
{
/* use the undocumented feature to suppress the zlib header */
z_stream stream;
int err = Z_OK;
int flush = Z_FINISH;
int windowBits = opt_dict ? MAX_WBITS : -(MAX_WBITS);
#if 0
stream.next_in = (Bytef *) src; /* UNCONST */
#else
{
union { const m_bytep cp; m_bytep p; } u;
u.cp = src;
stream.next_in = (Bytef *) u.p; /* UNCONST */
}
#endif
stream.avail_in = src_len;
stream.next_out = (Bytef *) dst;
stream.avail_out = *dst_len;
*dst_len = 0;
zlib_alloc_init(&stream,wrkmem,ZLIB_MEM_DECOMPRESS);
#if 0
err = inflateInit(&stream);
#else
if (windowBits < 0)
stream.avail_in++; /* inflate requires an extra "dummy" byte */
err = inflateInit2(&stream, windowBits);
#endif
while (err == Z_OK)
{
err = inflate(&stream, flush);
if (flush == Z_FINISH && err == Z_OK)
err = Z_BUF_ERROR;
if (err == Z_STREAM_END)
{
*dst_len = (m_uint) stream.total_out;
err = inflateEnd(&stream);
break;
}
else if (err == Z_NEED_DICT && opt_dict && dict)
err = inflateSetDictionary(&stream,dict,dict_len);
else if (err != Z_OK)
{
(void) inflateEnd(&stream);
break;
}
}
windowBits = windowBits;
return err;
}
M_PRIVATE(int)
zlib_8_1_compress ( const m_bytep src, m_uint src_len,
m_bytep dst, m_uintp dst_len,
m_voidp wrkmem )
{ return zlib_compress(src,src_len,dst,dst_len,wrkmem,Z_DEFLATED,1); }
M_PRIVATE(int)
zlib_8_2_compress ( const m_bytep src, m_uint src_len,
m_bytep dst, m_uintp dst_len,
m_voidp wrkmem )
{ return zlib_compress(src,src_len,dst,dst_len,wrkmem,Z_DEFLATED,2); }
M_PRIVATE(int)
zlib_8_3_compress ( const m_bytep src, m_uint src_len,
m_bytep dst, m_uintp dst_len,
m_voidp wrkmem )
{ return zlib_compress(src,src_len,dst,dst_len,wrkmem,Z_DEFLATED,3); }
M_PRIVATE(int)
zlib_8_4_compress ( const m_bytep src, m_uint src_len,
m_bytep dst, m_uintp dst_len,
m_voidp wrkmem )
{ return zlib_compress(src,src_len,dst,dst_len,wrkmem,Z_DEFLATED,4); }
M_PRIVATE(int)
zlib_8_5_compress ( const m_bytep src, m_uint src_len,
m_bytep dst, m_uintp dst_len,
m_voidp wrkmem )
{ return zlib_compress(src,src_len,dst,dst_len,wrkmem,Z_DEFLATED,5); }
M_PRIVATE(int)
zlib_8_6_compress ( const m_bytep src, m_uint src_len,
m_bytep dst, m_uintp dst_len,
m_voidp wrkmem )
{ return zlib_compress(src,src_len,dst,dst_len,wrkmem,Z_DEFLATED,6); }
M_PRIVATE(int)
zlib_8_7_compress ( const m_bytep src, m_uint src_len,
m_bytep dst, m_uintp dst_len,
m_voidp wrkmem )
{ return zlib_compress(src,src_len,dst,dst_len,wrkmem,Z_DEFLATED,7); }
M_PRIVATE(int)
zlib_8_8_compress ( const m_bytep src, m_uint src_len,
m_bytep dst, m_uintp dst_len,
m_voidp wrkmem )
{ return zlib_compress(src,src_len,dst,dst_len,wrkmem,Z_DEFLATED,8); }
M_PRIVATE(int)
zlib_8_9_compress ( const m_bytep src, m_uint src_len,
m_bytep dst, m_uintp dst_len,
m_voidp wrkmem )
{ return zlib_compress(src,src_len,dst,dst_len,wrkmem,Z_DEFLATED,9); }
#endif /* ALG_ZLIB */
/*************************************************************************
// compression levels of bzip2
**************************************************************************/
#if defined(ALG_BZIP2)
#endif /* ALG_BZIP2 */
/*************************************************************************
// other wrappers (pseudo compressors)
**************************************************************************/
#if defined(ALG_ZLIB)
M_PRIVATE(int)
zlib_adler32_x_compress ( const m_bytep src, m_uint src_len,
m_bytep dst, m_uintp dst_len,
m_voidp wrkmem )
{
uLong adler;
adler = adler32(0L, Z_NULL, 0);
adler = adler32(adler, dst, src_len);
*dst_len = src_len;
if (src) src = 0; /* avoid warning */
if (wrkmem) wrkmem = 0; /* avoid warning */
return 0;
}
M_PRIVATE(int)
zlib_crc32_x_compress ( const m_bytep src, m_uint src_len,
m_bytep dst, m_uintp dst_len,
m_voidp wrkmem )
{
uLong crc;
crc = crc32(0L, Z_NULL, 0);
crc = crc32(crc, dst, src_len);
*dst_len = src_len;
if (src) src = 0; /* avoid warning */
if (wrkmem) wrkmem = 0; /* avoid warning */
return 0;
}
#endif /* ALG_ZLIB */
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/minilzo/.deps/minilzo.Po.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
minilzo.o : \
minilzo.c ../config.h minilzo.h ../include/lzoconf.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/stdio.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h \
/usr/include/libio.h /usr/include/_G_config.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/stdio.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h
minilzo.c :
../config.h :
minilzo.h :
../include/lzoconf.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/stdio.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h :
/usr/include/libio.h :
/usr/include/_G_config.h :
/usr/include/bits/stdio_lim.h :
/usr/include/bits/stdio.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
|
Added work/contrib/lzo/lzo-1.08/minilzo/.deps/testmini.Po.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
testmini.o : \
testmini.c /usr/include/stdio.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h \
/usr/include/bits/types.h /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
/usr/include/bits/stdio.h /usr/include/stdlib.h \
/usr/include/sys/types.h /usr/include/time.h /usr/include/endian.h \
/usr/include/bits/endian.h /usr/include/sys/select.h \
/usr/include/bits/select.h /usr/include/bits/sigset.h \
/usr/include/sys/sysmacros.h /usr/include/alloca.h minilzo.h \
../include/lzoconf.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
/usr/include/bits/posix2_lim.h
testmini.c :
/usr/include/stdio.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h :
/usr/include/bits/types.h :
/usr/include/libio.h :
/usr/include/_G_config.h :
/usr/include/bits/stdio_lim.h :
/usr/include/bits/stdio.h :
/usr/include/stdlib.h :
/usr/include/sys/types.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/alloca.h :
minilzo.h :
../include/lzoconf.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
|
Added work/contrib/lzo/lzo-1.08/minilzo/Makefile.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
|
# Makefile.in generated by automake 1.6.2 from Makefile.am.
# minilzo/Makefile. Generated from Makefile.in by configure.
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
#
# Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
#
SHELL = /bin/sh
srcdir = .
top_srcdir = ..
prefix = /usr/local
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
sbindir = ${exec_prefix}/sbin
libexecdir = ${exec_prefix}/libexec
datadir = ${prefix}/share
sysconfdir = ${prefix}/etc
sharedstatedir = ${prefix}/com
localstatedir = ${prefix}/var
libdir = ${exec_prefix}/lib
infodir = ${prefix}/info
mandir = ${prefix}/man
includedir = ${prefix}/include
oldincludedir = /usr/include
pkgdatadir = $(datadir)/lzo
pkglibdir = $(libdir)/lzo
pkgincludedir = $(includedir)/lzo
top_builddir = ..
ACLOCAL = ${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run aclocal-1.6
AUTOCONF = ${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run autoconf
AUTOMAKE = ${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run automake-1.6
AUTOHEADER = ${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run autoheader
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = /usr/bin/ginstall -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_SCRIPT = ${INSTALL}
INSTALL_HEADER = $(INSTALL_DATA)
transform = s,x,x,
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
host_alias =
host_triplet = i586-pc-linux-gnu
EXEEXT =
OBJEXT = o
PATH_SEPARATOR = :
AMTAR = ${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run tar
AS = @AS@
ASFLAGS = -x assembler-with-cpp
AWK = gawk
CC = gcc
CFLAGS_GCC_OMIT_FRAME_POINTER = -fomit-frame-pointer
CFLAGS_O =
CFLAGS_W =
CFLAGS_W_PEDANTIC =
CLEANFILES = *.bb *.bbg *.da *.gcov bb.out bbtrace* gmon.out
CPP = gcc -E
DEPDIR = .deps
DLLTOOL = @DLLTOOL@
ECHO = echo
INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
LIBTOOL = $(SHELL) $(top_builddir)/libtool
LN_S = ln -s
LZO_ASM_OBJECTS = $(LZO_ASM_OBJECTS_GCC_i386)
LZO_CFLAGS =
MAINT = #
MFX_ARCH = i386
MFX_CC = GCC
MFX_CPU = i586
MOSTLYCLEANFILES = *.i
NASM =
OBJDUMP = @OBJDUMP@
PACKAGE = lzo
RANLIB = ranlib
SRC_VPATH = /i386/src
STRIP = strip
VERSION = 1.08
am__include = include
am__quote =
install_sh = /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/install-sh
liblzo = $(top_builddir)/src/liblzo.la
ltest_LIBS =
AUTOMAKE_OPTIONS = 1.6
# /***********************************************************************
# // compiler-architecture-CPU specific CFLAGS
# ************************************************************************/
A_CFLAGS = -O2 -Wall -Wcast-align -Wcast-qual -Wwrite-strings -fno-strength-reduce -fstrict-aliasing
A_CFLAGS_O =
A_CFLAGS_W =
LZO_CFLAGS_GCC =
LZO_CFLAGS_GCC_O =
LZO_CFLAGS_GCC_W = \
-Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
-Wno-uninitialized
LZO_CFLAGS_GCC_i386 =
LZO_CFLAGS_GCC_i386_O = -fomit-frame-pointer -fforce-addr
LZO_CFLAGS_GCC_i386_W =
LZO_CFLAGS_GCC_i386_i386_O = -m386
LZO_CFLAGS_GCC_i386_i486_O = -m486
LZO_CFLAGS_GCC_i386_i586_O =
LZO_CFLAGS_GCC_i386_i686_O =
L_CFLAGS = $(LZO_CFLAGS_@M_CC@) $(LZO_CFLAGS_@M_CC@_@M_ARCH@) $(LZO_CFLAGS_@M_CC@_@M_ARCH@_@M_CPU@)
L_CFLAGS_O = $(LZO_CFLAGS_@M_CC@_O) $(LZO_CFLAGS_@M_CC@_@M_ARCH@_O) $(LZO_CFLAGS_@M_CC@_@M_ARCH@_@M_CPU@_O)
L_CFLAGS_W = $(LZO_CFLAGS_@M_CC@_W) $(LZO_CFLAGS_@M_CC@_@M_ARCH@_W) $(LZO_CFLAGS_@M_CC@_@M_ARCH@_@M_CPU@_W)
# /***********************************************************************
# //
# ************************************************************************/
### LZO_DEBUG = -DLZO_DEBUG
INCLUDES = -I$(top_srcdir)/include
CPPFLAGS = -DLZO_HAVE_CONFIG_H -DMINILZO_HAVE_CONFIG_H
CFLAGS = $(A_CFLAGS) $(L_CFLAGS) $(A_CFLAGS_O) $(L_CFLAGS_O) $(A_CFLAGS_W) $(L_CFLAGS_W) $(LZO_CFLAGS) $(LZO_DEBUG)
noinst_PROGRAMS = testmini
minilzo_sources = \
README.LZO Makefile.lzo \
minilzo.h minilzo.c
testmini_SOURCES = testmini.c $(minilzo_sources)
subdir = minilzo
mkinstalldirs = $(SHELL) $(top_srcdir)/acconfig/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
noinst_PROGRAMS = testmini$(EXEEXT)
PROGRAMS = $(noinst_PROGRAMS)
am__objects_1 = minilzo.$(OBJEXT)
am_testmini_OBJECTS = testmini.$(OBJEXT) $(am__objects_1)
testmini_OBJECTS = $(am_testmini_OBJECTS)
testmini_LDADD = $(LDADD)
testmini_DEPENDENCIES =
testmini_LDFLAGS =
DEFS = -DHAVE_CONFIG_H
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
LDFLAGS =
LIBS =
depcomp = $(SHELL) $(top_srcdir)/acconfig/depcomp
am__depfiles_maybe = depfiles
DEP_FILES = ./$(DEPDIR)/minilzo.Po ./$(DEPDIR)/testmini.Po
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
$(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
DIST_SOURCES = $(testmini_SOURCES)
DIST_COMMON = Makefile.am Makefile.in
SOURCES = $(testmini_SOURCES)
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: # Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu minilzo/Makefile
Makefile: # $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
clean-noinstPROGRAMS:
@list='$(noinst_PROGRAMS)'; for p in $$list; do \
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
echo " rm -f $$p $$f"; \
rm -f $$p $$f ; \
done
testmini$(EXEEXT): $(testmini_OBJECTS) $(testmini_DEPENDENCIES)
@rm -f testmini$(EXEEXT)
$(LINK) $(testmini_LDFLAGS) $(testmini_OBJECTS) $(testmini_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT) core *.core
distclean-compile:
-rm -f *.tab.c
include ./$(DEPDIR)/minilzo.Po
include ./$(DEPDIR)/testmini.Po
distclean-depend:
-rm -rf ./$(DEPDIR)
.c.o:
source='$<' object='$@' libtool=no \
depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' \
$(CCDEPMODE) $(depcomp) \
$(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
.c.obj:
source='$<' object='$@' libtool=no \
depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' \
$(CCDEPMODE) $(depcomp) \
$(COMPILE) -c `cygpath -w $<`
.c.lo:
source='$<' object='$@' libtool=yes \
depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' \
$(CCDEPMODE) $(depcomp) \
$(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
CCDEPMODE = depmode=gcc
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
ETAGS = etags
ETAGSFLAGS =
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@list='$(DISTFILES)'; for file in $$list; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkinstalldirs) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS)
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
mostlyclean-am
distclean: distclean-am
distclean-am: clean-am distclean-compile distclean-depend \
distclean-generic distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
info: info-am
info-am:
install-data-am:
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
uninstall-am: uninstall-info-am
.PHONY: GTAGS all all-am check check-am clean clean-generic \
clean-libtool clean-noinstPROGRAMS distclean distclean-compile \
distclean-depend distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am info info-am install \
install-am install-data install-data-am install-exec \
install-exec-am install-info install-info-am install-man \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
tags uninstall uninstall-am uninstall-info-am
#-include $(top_srcdir)/maint/make/minilzo.mk
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
|
Added work/contrib/lzo/lzo-1.08/minilzo/Makefile.am.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
## Process this file with automake to create Makefile.in
#
# Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
#
AUTOMAKE_OPTIONS = 1.6
# /***********************************************************************
# // compiler-architecture-CPU specific CFLAGS
# ************************************************************************/
A_CFLAGS = @CFLAGS@
A_CFLAGS_O = @CFLAGS_O@
A_CFLAGS_W = @CFLAGS_W@
LZO_CFLAGS_GCC =
LZO_CFLAGS_GCC_O =
LZO_CFLAGS_GCC_W = \
-Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
-Wno-uninitialized
LZO_CFLAGS_GCC_i386 =
LZO_CFLAGS_GCC_i386_O = @CFLAGS_GCC_OMIT_FRAME_POINTER@ -fforce-addr
LZO_CFLAGS_GCC_i386_W =
LZO_CFLAGS_GCC_i386_i386_O = -m386
LZO_CFLAGS_GCC_i386_i486_O = -m486
LZO_CFLAGS_GCC_i386_i586_O =
LZO_CFLAGS_GCC_i386_i686_O =
L_CFLAGS = $(LZO_CFLAGS_@M_CC@) $(LZO_CFLAGS_@M_CC@_@M_ARCH@) $(LZO_CFLAGS_@M_CC@_@M_ARCH@_@M_CPU@)
L_CFLAGS_O = $(LZO_CFLAGS_@M_CC@_O) $(LZO_CFLAGS_@M_CC@_@M_ARCH@_O) $(LZO_CFLAGS_@M_CC@_@M_ARCH@_@M_CPU@_O)
L_CFLAGS_W = $(LZO_CFLAGS_@M_CC@_W) $(LZO_CFLAGS_@M_CC@_@M_ARCH@_W) $(LZO_CFLAGS_@M_CC@_@M_ARCH@_@M_CPU@_W)
# /***********************************************************************
# //
# ************************************************************************/
### LZO_DEBUG = -DLZO_DEBUG
INCLUDES = -I$(top_srcdir)/include
CPPFLAGS = @CPPFLAGS@ -DMINILZO_HAVE_CONFIG_H
CFLAGS = $(A_CFLAGS) $(L_CFLAGS) $(A_CFLAGS_O) $(L_CFLAGS_O) $(A_CFLAGS_W) $(L_CFLAGS_W) $(LZO_CFLAGS) $(LZO_DEBUG)
noinst_PROGRAMS = testmini
minilzo_sources = \
README.LZO Makefile.lzo \
minilzo.h minilzo.c
testmini_SOURCES = testmini.c $(minilzo_sources)
@MAINT@@GMAKE_TRUE@-include $(top_srcdir)/maint/make/minilzo.mk
|
Added work/contrib/lzo/lzo-1.08/minilzo/Makefile.in.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
|
# Makefile.in generated by automake 1.6.2 from Makefile.am.
# @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
#
# Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
#
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
host_alias = @host_alias@
host_triplet = @host@
EXEEXT = @EXEEXT@
OBJEXT = @OBJEXT@
PATH_SEPARATOR = @PATH_SEPARATOR@
AMTAR = @AMTAR@
AS = @AS@
ASFLAGS = @ASFLAGS@
AWK = @AWK@
CC = @CC@
CFLAGS_GCC_OMIT_FRAME_POINTER = @CFLAGS_GCC_OMIT_FRAME_POINTER@
CFLAGS_O = @CFLAGS_O@
CFLAGS_W = @CFLAGS_W@
CFLAGS_W_PEDANTIC = @CFLAGS_W_PEDANTIC@
CLEANFILES = @CLEANFILES@
CPP = @CPP@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
ECHO = @ECHO@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LZO_ASM_OBJECTS = @LZO_ASM_OBJECTS@
LZO_CFLAGS = @LZO_CFLAGS@
MAINT = @MAINT@
MFX_ARCH = @MFX_ARCH@
MFX_CC = @MFX_CC@
MFX_CPU = @MFX_CPU@
MOSTLYCLEANFILES = @MOSTLYCLEANFILES@
NASM = @NASM@
OBJDUMP = @OBJDUMP@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
SRC_VPATH = @SRC_VPATH@
STRIP = @STRIP@
VERSION = @VERSION@
am__include = @am__include@
am__quote = @am__quote@
install_sh = @install_sh@
liblzo = @liblzo@
ltest_LIBS = @ltest_LIBS@
AUTOMAKE_OPTIONS = 1.6
# /***********************************************************************
# // compiler-architecture-CPU specific CFLAGS
# ************************************************************************/
A_CFLAGS = @CFLAGS@
A_CFLAGS_O = @CFLAGS_O@
A_CFLAGS_W = @CFLAGS_W@
LZO_CFLAGS_GCC =
LZO_CFLAGS_GCC_O =
LZO_CFLAGS_GCC_W = \
-Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
-Wno-uninitialized
LZO_CFLAGS_GCC_i386 =
LZO_CFLAGS_GCC_i386_O = @CFLAGS_GCC_OMIT_FRAME_POINTER@ -fforce-addr
LZO_CFLAGS_GCC_i386_W =
LZO_CFLAGS_GCC_i386_i386_O = -m386
LZO_CFLAGS_GCC_i386_i486_O = -m486
LZO_CFLAGS_GCC_i386_i586_O =
LZO_CFLAGS_GCC_i386_i686_O =
L_CFLAGS = $(LZO_CFLAGS_@M_CC@) $(LZO_CFLAGS_@M_CC@_@M_ARCH@) $(LZO_CFLAGS_@M_CC@_@M_ARCH@_@M_CPU@)
L_CFLAGS_O = $(LZO_CFLAGS_@M_CC@_O) $(LZO_CFLAGS_@M_CC@_@M_ARCH@_O) $(LZO_CFLAGS_@M_CC@_@M_ARCH@_@M_CPU@_O)
L_CFLAGS_W = $(LZO_CFLAGS_@M_CC@_W) $(LZO_CFLAGS_@M_CC@_@M_ARCH@_W) $(LZO_CFLAGS_@M_CC@_@M_ARCH@_@M_CPU@_W)
# /***********************************************************************
# //
# ************************************************************************/
### LZO_DEBUG = -DLZO_DEBUG
INCLUDES = -I$(top_srcdir)/include
CPPFLAGS = @CPPFLAGS@ -DMINILZO_HAVE_CONFIG_H
CFLAGS = $(A_CFLAGS) $(L_CFLAGS) $(A_CFLAGS_O) $(L_CFLAGS_O) $(A_CFLAGS_W) $(L_CFLAGS_W) $(LZO_CFLAGS) $(LZO_DEBUG)
noinst_PROGRAMS = testmini
minilzo_sources = \
README.LZO Makefile.lzo \
minilzo.h minilzo.c
testmini_SOURCES = testmini.c $(minilzo_sources)
subdir = minilzo
mkinstalldirs = $(SHELL) $(top_srcdir)/acconfig/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
noinst_PROGRAMS = testmini$(EXEEXT)
PROGRAMS = $(noinst_PROGRAMS)
am__objects_1 = minilzo.$(OBJEXT)
am_testmini_OBJECTS = testmini.$(OBJEXT) $(am__objects_1)
testmini_OBJECTS = $(am_testmini_OBJECTS)
testmini_LDADD = $(LDADD)
testmini_DEPENDENCIES =
testmini_LDFLAGS =
DEFS = @DEFS@
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
depcomp = $(SHELL) $(top_srcdir)/acconfig/depcomp
am__depfiles_maybe = depfiles
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/minilzo.Po ./$(DEPDIR)/testmini.Po
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
$(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
DIST_SOURCES = $(testmini_SOURCES)
DIST_COMMON = Makefile.am Makefile.in
SOURCES = $(testmini_SOURCES)
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu minilzo/Makefile
Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
clean-noinstPROGRAMS:
@list='$(noinst_PROGRAMS)'; for p in $$list; do \
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
echo " rm -f $$p $$f"; \
rm -f $$p $$f ; \
done
testmini$(EXEEXT): $(testmini_OBJECTS) $(testmini_DEPENDENCIES)
@rm -f testmini$(EXEEXT)
$(LINK) $(testmini_LDFLAGS) $(testmini_OBJECTS) $(testmini_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT) core *.core
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minilzo.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testmini.Po@am__quote@
distclean-depend:
-rm -rf ./$(DEPDIR)
.c.o:
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
.c.obj:
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(COMPILE) -c `cygpath -w $<`
.c.lo:
@AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
CCDEPMODE = @CCDEPMODE@
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
ETAGS = etags
ETAGSFLAGS =
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@list='$(DISTFILES)'; for file in $$list; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkinstalldirs) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS)
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
mostlyclean-am
distclean: distclean-am
distclean-am: clean-am distclean-compile distclean-depend \
distclean-generic distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
info: info-am
info-am:
install-data-am:
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
uninstall-am: uninstall-info-am
.PHONY: GTAGS all all-am check check-am clean clean-generic \
clean-libtool clean-noinstPROGRAMS distclean distclean-compile \
distclean-depend distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am info info-am install \
install-am install-data install-data-am install-exec \
install-exec-am install-info install-info-am install-man \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
tags uninstall uninstall-am uninstall-info-am
@MAINT@@GMAKE_TRUE@-include $(top_srcdir)/maint/make/minilzo.mk
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
|
Added work/contrib/lzo/lzo-1.08/minilzo/Makefile.lzo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
#
# a very simple Makefile for miniLZO
#
# Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
#
SOURCES = testmini.c minilzo.c
default all:
@echo "Please choose one of the following targets:"
@echo " gcc gcc-i386 gcc-rs6000"
@echo " visualc watcomc watcomc16"
@echo " hpux hpux9"
#
# gcc
#
gcc:
gcc -Wall -O2 -s -o testmini $(SOURCES)
gcc-i386:
gcc -Wall -O2 -fomit-frame-pointer -fno-strength-reduce -s -o testmini $(SOURCES)
gcc-rs6000:
gcc -Wall -O2 -fno-schedule-insns -fno-schedule-insns2 -o testmini $(SOURCES)
#
# Windows
#
visualc:
cl -nologo -ML -W3 -O2 -GF $(SOURCES)
watcomc:
wcl386 -zq -mf -5r -zc -wx -oneatx $(SOURCES)
watcomc16:
wcl -zq -ml -5 -zc -wx -oneatx $(SOURCES)
#
# UNIX
#
hpux:
cc -Ae -o testmini $(SOURCES)
hpux9:
cc -Aa -D_HPUX_SOURCE -o testmini $(SOURCES)
#
# other targets
#
clean:
rm -f testmini testmini.exe *.err *.o *.obj core
|
Added work/contrib/lzo/lzo-1.08/minilzo/README.LZO.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
============================================================================
miniLZO -- mini subset of the LZO real-time data compression library
============================================================================
Author : Markus Franz Xaver Johannes Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/opensource/lzo/
Version : 1.08
Date : 12-Jul-2002
I've created miniLZO for projects where it is inconvenient to
include (or require) the full LZO source code just because you
want to add a little bit of data compression to your application.
miniLZO implements the LZO1X-1 compressor and both the standard and
safe LZO1X decompressor. Apart from fast compression it also useful
for situations where you want to use pre-compressed data files (which
must have been compressed with LZO1X-999).
miniLZO consists of one C source file and two header files:
minilzo.c
minilzo.h
lzoconf.h
To use miniLZO just copy these files into your source directory, add
minilzo.c to your Makefile and #include minilzo.h from your program.
Note: you also must distribute this file (`README.LZO') with your project.
minilzo.o compiles to about 6 kB (using gcc or Visual C on a i386), and
the sources are about 14 kB when packed with zip - so there's no more
excuse that your application doesn't support data compression :-)
For more information, documentation, example programs and other support
files (like Makefiles and build scripts) please download the full LZO
package from
http://www.oberhumer.com/opensource/lzo/
Have fun,
Markus
P.S. minilzo.c is generated automatically from the LZO sources and
therefore functionality is completely identical
Appendix A: building miniLZO
----------------------------
miniLZO is written such a way that it should compile and run
out-of-the-box on most machines.
If you are running on a very unusual architecture and lzo_init() fails then
you should first recompile with `-DLZO_DEBUG' to see what causes the failure.
The most probable case is something like `sizeof(char *) != sizeof(long)'.
After identifying the problem you can compile by adding some defines
like `-DSIZEOF_CHAR_P=8' to your Makefile.
The best solution is (of course) using Autoconf - if your project uses
Autoconf anyway just add `-DMINILZO_HAVE_CONFIG_H' to your compiler
flags when compiling minilzo.c. See the LZO distribution for an example
how to set up configure.in.
Appendix B: list of public functions available in miniLZO
---------------------------------------------------------
Library initialization
lzo_init()
Compression
lzo1x_1_compress()
Decompression
lzo1x_decompress()
lzo1x_decompress_safe()
Checksum functions
lzo_adler32()
Version functions
lzo_version()
lzo_version_string()
lzo_version_date()
Portable (but slow) string functions
lzo_memcmp()
lzo_memcpy()
lzo_memmove()
lzo_memset()
Appendix C: suggested macros for `configure.in' when using Autoconf
-------------------------------------------------------------------
Checks for typedefs and structures
AC_CHECK_TYPE(ptrdiff_t,long)
AC_TYPE_SIZE_T
AC_CHECK_SIZEOF(unsigned short)
AC_CHECK_SIZEOF(unsigned)
AC_CHECK_SIZEOF(unsigned long)
AC_CHECK_SIZEOF(char *)
AC_CHECK_SIZEOF(ptrdiff_t)
AC_CHECK_SIZEOF(size_t)
Checks for compiler characteristics
AC_C_CONST
Checks for library functions
AC_CHECK_FUNCS(memcmp memcpy memmove memset)
Appendix D: Copyright
---------------------
LZO and miniLZO are Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
Markus Franz Xaver Johannes Oberhumer
LZO and miniLZO are distributed under the terms of the GNU General
Public License (GPL). See the file COPYING.
Special licenses for commercial and other applications which
are not willing to accept the GNU General Public License
are available by contacting the author.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQE9LPb4TWFXqwsgQ8kRAi/wAKCZ9Iej+voGhmKATaViOPS9chxGUwCgh5Dk
uwMS2PQ7BXHT0vf4yz+3tTc=
=PsNp
-----END PGP SIGNATURE-----
|
Added work/contrib/lzo/lzo-1.08/minilzo/minilzo.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
|
/* minilzo.c -- mini subset of the LZO real-time data compression library
This file is part of the LZO real-time data compression library.
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/opensource/lzo/
*/
/*
* NOTE:
* the full LZO package can be found at
* http://www.oberhumer.com/opensource/lzo/
*/
#define __LZO_IN_MINILZO
#define LZO_BUILD
#ifdef MINILZO_HAVE_CONFIG_H
# include <config.h>
#endif
#undef LZO_HAVE_CONFIG_H
#include "minilzo.h"
#if !defined(MINILZO_VERSION) || (MINILZO_VERSION != 0x1080)
# error "version mismatch in miniLZO source files"
#endif
#ifdef MINILZO_HAVE_CONFIG_H
# define LZO_HAVE_CONFIG_H
#endif
#if !defined(LZO_NO_SYS_TYPES_H)
# include <sys/types.h>
#endif
#include <stdio.h>
#ifndef __LZO_CONF_H
#define __LZO_CONF_H
#if !defined(__LZO_IN_MINILZO)
# ifndef __LZOCONF_H
# include <lzoconf.h>
# endif
#endif
#if defined(__BOUNDS_CHECKING_ON)
# include <unchecked.h>
#else
# define BOUNDS_CHECKING_OFF_DURING(stmt) stmt
# define BOUNDS_CHECKING_OFF_IN_EXPR(expr) (expr)
#endif
#if !defined(LZO_HAVE_CONFIG_H)
# include <stddef.h>
# include <string.h>
# if !defined(NO_STDLIB_H)
# include <stdlib.h>
# endif
# define HAVE_MEMCMP
# define HAVE_MEMCPY
# define HAVE_MEMMOVE
# define HAVE_MEMSET
#else
# include <sys/types.h>
# if defined(HAVE_STDDEF_H)
# include <stddef.h>
# endif
# if defined(STDC_HEADERS)
# include <string.h>
# include <stdlib.h>
# endif
#endif
#if defined(__LZO_DOS16) || defined(__LZO_WIN16)
# define HAVE_MALLOC_H
# define HAVE_HALLOC
#endif
#undef NDEBUG
#if !defined(LZO_DEBUG)
# define NDEBUG
#endif
#if defined(LZO_DEBUG) || !defined(NDEBUG)
# if !defined(NO_STDIO_H)
# include <stdio.h>
# endif
#endif
#include <assert.h>
#if !defined(LZO_COMPILE_TIME_ASSERT)
# define LZO_COMPILE_TIME_ASSERT(expr) \
{ typedef int __lzo_compile_time_assert_fail[1 - 2 * !(expr)]; }
#endif
#if !defined(LZO_UNUSED)
# if 1
# define LZO_UNUSED(var) ((void)&var)
# elif 0
# define LZO_UNUSED(var) { typedef int __lzo_unused[sizeof(var) ? 2 : 1]; }
# else
# define LZO_UNUSED(parm) (parm = parm)
# endif
#endif
#if !defined(__inline__) && !defined(__GNUC__)
# if defined(__cplusplus)
# define __inline__ inline
# else
# define __inline__
# endif
#endif
#if defined(NO_MEMCMP)
# undef HAVE_MEMCMP
#endif
#if !defined(HAVE_MEMCMP)
# undef memcmp
# define memcmp lzo_memcmp
#endif
#if !defined(HAVE_MEMCPY)
# undef memcpy
# define memcpy lzo_memcpy
#endif
#if !defined(HAVE_MEMMOVE)
# undef memmove
# define memmove lzo_memmove
#endif
#if !defined(HAVE_MEMSET)
# undef memset
# define memset lzo_memset
#endif
#if 0
# define LZO_BYTE(x) ((unsigned char) (x))
#else
# define LZO_BYTE(x) ((unsigned char) ((x) & 0xff))
#endif
#define LZO_MAX(a,b) ((a) >= (b) ? (a) : (b))
#define LZO_MIN(a,b) ((a) <= (b) ? (a) : (b))
#define LZO_MAX3(a,b,c) ((a) >= (b) ? LZO_MAX(a,c) : LZO_MAX(b,c))
#define LZO_MIN3(a,b,c) ((a) <= (b) ? LZO_MIN(a,c) : LZO_MIN(b,c))
#define lzo_sizeof(type) ((lzo_uint) (sizeof(type)))
#define LZO_HIGH(array) ((lzo_uint) (sizeof(array)/sizeof(*(array))))
#define LZO_SIZE(bits) (1u << (bits))
#define LZO_MASK(bits) (LZO_SIZE(bits) - 1)
#define LZO_LSIZE(bits) (1ul << (bits))
#define LZO_LMASK(bits) (LZO_LSIZE(bits) - 1)
#define LZO_USIZE(bits) ((lzo_uint) 1 << (bits))
#define LZO_UMASK(bits) (LZO_USIZE(bits) - 1)
#define LZO_STYPE_MAX(b) (((1l << (8*(b)-2)) - 1l) + (1l << (8*(b)-2)))
#define LZO_UTYPE_MAX(b) (((1ul << (8*(b)-1)) - 1ul) + (1ul << (8*(b)-1)))
#if !defined(SIZEOF_UNSIGNED)
# if (UINT_MAX == 0xffff)
# define SIZEOF_UNSIGNED 2
# elif (UINT_MAX == LZO_0xffffffffL)
# define SIZEOF_UNSIGNED 4
# elif (UINT_MAX >= LZO_0xffffffffL)
# define SIZEOF_UNSIGNED 8
# else
# error "SIZEOF_UNSIGNED"
# endif
#endif
#if !defined(SIZEOF_UNSIGNED_LONG)
# if (ULONG_MAX == LZO_0xffffffffL)
# define SIZEOF_UNSIGNED_LONG 4
# elif (ULONG_MAX >= LZO_0xffffffffL)
# define SIZEOF_UNSIGNED_LONG 8
# else
# error "SIZEOF_UNSIGNED_LONG"
# endif
#endif
#if !defined(SIZEOF_SIZE_T)
# define SIZEOF_SIZE_T SIZEOF_UNSIGNED
#endif
#if !defined(SIZE_T_MAX)
# define SIZE_T_MAX LZO_UTYPE_MAX(SIZEOF_SIZE_T)
#endif
#if 1 && defined(__LZO_i386) && (UINT_MAX == LZO_0xffffffffL)
# if !defined(LZO_UNALIGNED_OK_2) && (USHRT_MAX == 0xffff)
# define LZO_UNALIGNED_OK_2
# endif
# if !defined(LZO_UNALIGNED_OK_4) && (LZO_UINT32_MAX == LZO_0xffffffffL)
# define LZO_UNALIGNED_OK_4
# endif
#endif
#if defined(LZO_UNALIGNED_OK_2) || defined(LZO_UNALIGNED_OK_4)
# if !defined(LZO_UNALIGNED_OK)
# define LZO_UNALIGNED_OK
# endif
#endif
#if defined(__LZO_NO_UNALIGNED)
# undef LZO_UNALIGNED_OK
# undef LZO_UNALIGNED_OK_2
# undef LZO_UNALIGNED_OK_4
#endif
#if defined(LZO_UNALIGNED_OK_2) && (USHRT_MAX != 0xffff)
# error "LZO_UNALIGNED_OK_2 must not be defined on this system"
#endif
#if defined(LZO_UNALIGNED_OK_4) && (LZO_UINT32_MAX != LZO_0xffffffffL)
# error "LZO_UNALIGNED_OK_4 must not be defined on this system"
#endif
#if defined(__LZO_NO_ALIGNED)
# undef LZO_ALIGNED_OK_4
#endif
#if defined(LZO_ALIGNED_OK_4) && (LZO_UINT32_MAX != LZO_0xffffffffL)
# error "LZO_ALIGNED_OK_4 must not be defined on this system"
#endif
#define LZO_LITTLE_ENDIAN 1234
#define LZO_BIG_ENDIAN 4321
#define LZO_PDP_ENDIAN 3412
#if !defined(LZO_BYTE_ORDER)
# if defined(MFX_BYTE_ORDER)
# define LZO_BYTE_ORDER MFX_BYTE_ORDER
# elif defined(__LZO_i386)
# define LZO_BYTE_ORDER LZO_LITTLE_ENDIAN
# elif defined(BYTE_ORDER)
# define LZO_BYTE_ORDER BYTE_ORDER
# elif defined(__BYTE_ORDER)
# define LZO_BYTE_ORDER __BYTE_ORDER
# endif
#endif
#if defined(LZO_BYTE_ORDER)
# if (LZO_BYTE_ORDER != LZO_LITTLE_ENDIAN) && \
(LZO_BYTE_ORDER != LZO_BIG_ENDIAN)
# error "invalid LZO_BYTE_ORDER"
# endif
#endif
#if defined(LZO_UNALIGNED_OK) && !defined(LZO_BYTE_ORDER)
# error "LZO_BYTE_ORDER is not defined"
#endif
#define LZO_OPTIMIZE_GNUC_i386_IS_BUGGY
#if defined(NDEBUG) && !defined(LZO_DEBUG) && !defined(__LZO_CHECKER)
# if defined(__GNUC__) && defined(__i386__)
# if !defined(LZO_OPTIMIZE_GNUC_i386_IS_BUGGY)
# define LZO_OPTIMIZE_GNUC_i386
# endif
# endif
#endif
__LZO_EXTERN_C int __lzo_init_done;
__LZO_EXTERN_C const lzo_byte __lzo_copyright[];
LZO_EXTERN(const lzo_byte *) lzo_copyright(void);
__LZO_EXTERN_C const lzo_uint32 _lzo_crc32_table[256];
#define _LZO_STRINGIZE(x) #x
#define _LZO_MEXPAND(x) _LZO_STRINGIZE(x)
#define _LZO_CONCAT2(a,b) a ## b
#define _LZO_CONCAT3(a,b,c) a ## b ## c
#define _LZO_CONCAT4(a,b,c,d) a ## b ## c ## d
#define _LZO_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e
#define _LZO_ECONCAT2(a,b) _LZO_CONCAT2(a,b)
#define _LZO_ECONCAT3(a,b,c) _LZO_CONCAT3(a,b,c)
#define _LZO_ECONCAT4(a,b,c,d) _LZO_CONCAT4(a,b,c,d)
#define _LZO_ECONCAT5(a,b,c,d,e) _LZO_CONCAT5(a,b,c,d,e)
#if 0
#define __LZO_IS_COMPRESS_QUERY(i,il,o,ol,w) ((lzo_voidp)(o) == (w))
#define __LZO_QUERY_COMPRESS(i,il,o,ol,w,n,s) \
(*ol = (n)*(s), LZO_E_OK)
#define __LZO_IS_DECOMPRESS_QUERY(i,il,o,ol,w) ((lzo_voidp)(o) == (w))
#define __LZO_QUERY_DECOMPRESS(i,il,o,ol,w,n,s) \
(*ol = (n)*(s), LZO_E_OK)
#define __LZO_IS_OPTIMIZE_QUERY(i,il,o,ol,w) ((lzo_voidp)(o) == (w))
#define __LZO_QUERY_OPTIMIZE(i,il,o,ol,w,n,s) \
(*ol = (n)*(s), LZO_E_OK)
#endif
#ifndef __LZO_PTR_H
#define __LZO_PTR_H
#ifdef __cplusplus
extern "C" {
#endif
#if defined(__LZO_DOS16) || defined(__LZO_WIN16)
# include <dos.h>
# if 1 && defined(__WATCOMC__)
# include <i86.h>
__LZO_EXTERN_C unsigned char _HShift;
# define __LZO_HShift _HShift
# elif 1 && defined(_MSC_VER)
__LZO_EXTERN_C unsigned short __near _AHSHIFT;
# define __LZO_HShift ((unsigned) &_AHSHIFT)
# elif defined(__LZO_WIN16)
# define __LZO_HShift 3
# else
# define __LZO_HShift 12
# endif
# if !defined(_FP_SEG) && defined(FP_SEG)
# define _FP_SEG FP_SEG
# endif
# if !defined(_FP_OFF) && defined(FP_OFF)
# define _FP_OFF FP_OFF
# endif
#endif
#if !defined(lzo_ptrdiff_t)
# if (UINT_MAX >= LZO_0xffffffffL)
typedef ptrdiff_t lzo_ptrdiff_t;
# else
typedef long lzo_ptrdiff_t;
# endif
#endif
#if !defined(__LZO_HAVE_PTR_T)
# if defined(lzo_ptr_t)
# define __LZO_HAVE_PTR_T
# endif
#endif
#if !defined(__LZO_HAVE_PTR_T)
# if defined(SIZEOF_CHAR_P) && defined(SIZEOF_UNSIGNED_LONG)
# if (SIZEOF_CHAR_P == SIZEOF_UNSIGNED_LONG)
typedef unsigned long lzo_ptr_t;
typedef long lzo_sptr_t;
# define __LZO_HAVE_PTR_T
# endif
# endif
#endif
#if !defined(__LZO_HAVE_PTR_T)
# if defined(SIZEOF_CHAR_P) && defined(SIZEOF_UNSIGNED)
# if (SIZEOF_CHAR_P == SIZEOF_UNSIGNED)
typedef unsigned int lzo_ptr_t;
typedef int lzo_sptr_t;
# define __LZO_HAVE_PTR_T
# endif
# endif
#endif
#if !defined(__LZO_HAVE_PTR_T)
# if defined(SIZEOF_CHAR_P) && defined(SIZEOF_UNSIGNED_SHORT)
# if (SIZEOF_CHAR_P == SIZEOF_UNSIGNED_SHORT)
typedef unsigned short lzo_ptr_t;
typedef short lzo_sptr_t;
# define __LZO_HAVE_PTR_T
# endif
# endif
#endif
#if !defined(__LZO_HAVE_PTR_T)
# if defined(LZO_HAVE_CONFIG_H) || defined(SIZEOF_CHAR_P)
# error "no suitable type for lzo_ptr_t"
# else
typedef unsigned long lzo_ptr_t;
typedef long lzo_sptr_t;
# define __LZO_HAVE_PTR_T
# endif
#endif
#if defined(__LZO_DOS16) || defined(__LZO_WIN16)
#define PTR(a) ((lzo_bytep) (a))
#define PTR_ALIGNED_4(a) ((_FP_OFF(a) & 3) == 0)
#define PTR_ALIGNED2_4(a,b) (((_FP_OFF(a) | _FP_OFF(b)) & 3) == 0)
#else
#define PTR(a) ((lzo_ptr_t) (a))
#define PTR_LINEAR(a) PTR(a)
#define PTR_ALIGNED_4(a) ((PTR_LINEAR(a) & 3) == 0)
#define PTR_ALIGNED_8(a) ((PTR_LINEAR(a) & 7) == 0)
#define PTR_ALIGNED2_4(a,b) (((PTR_LINEAR(a) | PTR_LINEAR(b)) & 3) == 0)
#define PTR_ALIGNED2_8(a,b) (((PTR_LINEAR(a) | PTR_LINEAR(b)) & 7) == 0)
#endif
#define PTR_LT(a,b) (PTR(a) < PTR(b))
#define PTR_GE(a,b) (PTR(a) >= PTR(b))
#define PTR_DIFF(a,b) ((lzo_ptrdiff_t) (PTR(a) - PTR(b)))
#define pd(a,b) ((lzo_uint) ((a)-(b)))
LZO_EXTERN(lzo_ptr_t)
__lzo_ptr_linear(const lzo_voidp ptr);
typedef union
{
char a_char;
unsigned char a_uchar;
short a_short;
unsigned short a_ushort;
int a_int;
unsigned int a_uint;
long a_long;
unsigned long a_ulong;
lzo_int a_lzo_int;
lzo_uint a_lzo_uint;
lzo_int32 a_lzo_int32;
lzo_uint32 a_lzo_uint32;
ptrdiff_t a_ptrdiff_t;
lzo_ptrdiff_t a_lzo_ptrdiff_t;
lzo_ptr_t a_lzo_ptr_t;
lzo_voidp a_lzo_voidp;
void * a_void_p;
lzo_bytep a_lzo_bytep;
lzo_bytepp a_lzo_bytepp;
lzo_uintp a_lzo_uintp;
lzo_uint * a_lzo_uint_p;
lzo_uint32p a_lzo_uint32p;
lzo_uint32 * a_lzo_uint32_p;
unsigned char * a_uchar_p;
char * a_char_p;
}
lzo_full_align_t;
#ifdef __cplusplus
}
#endif
#endif
#define LZO_DETERMINISTIC
#define LZO_DICT_USE_PTR
#if defined(__LZO_DOS16) || defined(__LZO_WIN16) || defined(__LZO_STRICT_16BIT)
# undef LZO_DICT_USE_PTR
#endif
#if defined(LZO_DICT_USE_PTR)
# define lzo_dict_t const lzo_bytep
# define lzo_dict_p lzo_dict_t __LZO_MMODEL *
#else
# define lzo_dict_t lzo_uint
# define lzo_dict_p lzo_dict_t __LZO_MMODEL *
#endif
#if !defined(lzo_moff_t)
#define lzo_moff_t lzo_uint
#endif
#endif
LZO_PUBLIC(lzo_ptr_t)
__lzo_ptr_linear(const lzo_voidp ptr)
{
lzo_ptr_t p;
#if defined(__LZO_DOS16) || defined(__LZO_WIN16)
p = (((lzo_ptr_t)(_FP_SEG(ptr))) << (16 - __LZO_HShift)) + (_FP_OFF(ptr));
#else
p = PTR_LINEAR(ptr);
#endif
return p;
}
LZO_PUBLIC(unsigned)
__lzo_align_gap(const lzo_voidp ptr, lzo_uint size)
{
lzo_ptr_t p, s, n;
assert(size > 0);
p = __lzo_ptr_linear(ptr);
s = (lzo_ptr_t) (size - 1);
#if 0
assert((size & (size - 1)) == 0);
n = ((p + s) & ~s) - p;
#else
n = (((p + s) / size) * size) - p;
#endif
assert((long)n >= 0);
assert(n <= s);
return (unsigned)n;
}
#ifndef __LZO_UTIL_H
#define __LZO_UTIL_H
#ifndef __LZO_CONF_H
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if 1 && defined(HAVE_MEMCPY)
#if !defined(__LZO_DOS16) && !defined(__LZO_WIN16)
#define MEMCPY8_DS(dest,src,len) \
memcpy(dest,src,len); \
dest += len; \
src += len
#endif
#endif
#if 0 && !defined(MEMCPY8_DS)
#define MEMCPY8_DS(dest,src,len) \
{ do { \
*dest++ = *src++; \
*dest++ = *src++; \
*dest++ = *src++; \
*dest++ = *src++; \
*dest++ = *src++; \
*dest++ = *src++; \
*dest++ = *src++; \
*dest++ = *src++; \
len -= 8; \
} while (len > 0); }
#endif
#if !defined(MEMCPY8_DS)
#define MEMCPY8_DS(dest,src,len) \
{ register lzo_uint __l = (len) / 8; \
do { \
*dest++ = *src++; \
*dest++ = *src++; \
*dest++ = *src++; \
*dest++ = *src++; \
*dest++ = *src++; \
*dest++ = *src++; \
*dest++ = *src++; \
*dest++ = *src++; \
} while (--__l > 0); }
#endif
#define MEMCPY_DS(dest,src,len) \
do *dest++ = *src++; \
while (--len > 0)
#define MEMMOVE_DS(dest,src,len) \
do *dest++ = *src++; \
while (--len > 0)
#if 0 && defined(LZO_OPTIMIZE_GNUC_i386)
#define BZERO8_PTR(s,l,n) \
__asm__ __volatile__( \
"movl %0,%%eax \n" \
"movl %1,%%edi \n" \
"movl %2,%%ecx \n" \
"cld \n" \
"rep \n" \
"stosl %%eax,(%%edi) \n" \
: \
:"g" (0),"g" (s),"g" (n) \
:"eax","edi","ecx", "memory", "cc" \
)
#elif (LZO_UINT_MAX <= SIZE_T_MAX) && defined(HAVE_MEMSET)
#if 1
#define BZERO8_PTR(s,l,n) memset((s),0,(lzo_uint)(l)*(n))
#else
#define BZERO8_PTR(s,l,n) memset((lzo_voidp)(s),0,(lzo_uint)(l)*(n))
#endif
#else
#define BZERO8_PTR(s,l,n) \
lzo_memset((lzo_voidp)(s),0,(lzo_uint)(l)*(n))
#endif
#if 0
#if defined(__GNUC__) && defined(__i386__)
unsigned char lzo_rotr8(unsigned char value, int shift);
extern __inline__ unsigned char lzo_rotr8(unsigned char value, int shift)
{
unsigned char result;
__asm__ __volatile__ ("movb %b1, %b0; rorb %b2, %b0"
: "=a"(result) : "g"(value), "c"(shift));
return result;
}
unsigned short lzo_rotr16(unsigned short value, int shift);
extern __inline__ unsigned short lzo_rotr16(unsigned short value, int shift)
{
unsigned short result;
__asm__ __volatile__ ("movw %b1, %b0; rorw %b2, %b0"
: "=a"(result) : "g"(value), "c"(shift));
return result;
}
#endif
#endif
#ifdef __cplusplus
}
#endif
#endif
LZO_PUBLIC(lzo_bool)
lzo_assert(int expr)
{
return (expr) ? 1 : 0;
}
/* If you use the LZO library in a product, you *must* keep this
* copyright string in the executable of your product.
*/
const lzo_byte __lzo_copyright[] =
#if !defined(__LZO_IN_MINLZO)
LZO_VERSION_STRING;
#else
"\n\n\n"
"LZO real-time data compression library.\n"
"Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 Markus Franz Xaver Johannes Oberhumer\n"
"<markus.oberhumer@jk.uni-linz.ac.at>\n"
"http://www.oberhumer.com/opensource/lzo/\n"
"\n"
"LZO version: v" LZO_VERSION_STRING ", " LZO_VERSION_DATE "\n"
"LZO build date: " __DATE__ " " __TIME__ "\n\n"
"LZO special compilation options:\n"
#ifdef __cplusplus
" __cplusplus\n"
#endif
#if defined(__PIC__)
" __PIC__\n"
#elif defined(__pic__)
" __pic__\n"
#endif
#if (UINT_MAX < LZO_0xffffffffL)
" 16BIT\n"
#endif
#if defined(__LZO_STRICT_16BIT)
" __LZO_STRICT_16BIT\n"
#endif
#if (UINT_MAX > LZO_0xffffffffL)
" UINT_MAX=" _LZO_MEXPAND(UINT_MAX) "\n"
#endif
#if (ULONG_MAX > LZO_0xffffffffL)
" ULONG_MAX=" _LZO_MEXPAND(ULONG_MAX) "\n"
#endif
#if defined(LZO_BYTE_ORDER)
" LZO_BYTE_ORDER=" _LZO_MEXPAND(LZO_BYTE_ORDER) "\n"
#endif
#if defined(LZO_UNALIGNED_OK_2)
" LZO_UNALIGNED_OK_2\n"
#endif
#if defined(LZO_UNALIGNED_OK_4)
" LZO_UNALIGNED_OK_4\n"
#endif
#if defined(LZO_ALIGNED_OK_4)
" LZO_ALIGNED_OK_4\n"
#endif
#if defined(LZO_DICT_USE_PTR)
" LZO_DICT_USE_PTR\n"
#endif
#if defined(__LZO_QUERY_COMPRESS)
" __LZO_QUERY_COMPRESS\n"
#endif
#if defined(__LZO_QUERY_DECOMPRESS)
" __LZO_QUERY_DECOMPRESS\n"
#endif
#if defined(__LZO_IN_MINILZO)
" __LZO_IN_MINILZO\n"
#endif
"\n\n"
"$Id: LZO " LZO_VERSION_STRING " built " __DATE__ " " __TIME__
#if defined(__GNUC__) && defined(__VERSION__)
" by gcc " __VERSION__
#elif defined(__BORLANDC__)
" by Borland C " _LZO_MEXPAND(__BORLANDC__)
#elif defined(_MSC_VER)
" by Microsoft C " _LZO_MEXPAND(_MSC_VER)
#elif defined(__PUREC__)
" by Pure C " _LZO_MEXPAND(__PUREC__)
#elif defined(__SC__)
" by Symantec C " _LZO_MEXPAND(__SC__)
#elif defined(__TURBOC__)
" by Turbo C " _LZO_MEXPAND(__TURBOC__)
#elif defined(__WATCOMC__)
" by Watcom C " _LZO_MEXPAND(__WATCOMC__)
#endif
" $\n"
"$Copyright: LZO (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 Markus Franz Xaver Johannes Oberhumer $\n";
#endif
LZO_PUBLIC(const lzo_byte *)
lzo_copyright(void)
{
return __lzo_copyright;
}
LZO_PUBLIC(unsigned)
lzo_version(void)
{
return LZO_VERSION;
}
LZO_PUBLIC(const char *)
lzo_version_string(void)
{
return LZO_VERSION_STRING;
}
LZO_PUBLIC(const char *)
lzo_version_date(void)
{
return LZO_VERSION_DATE;
}
LZO_PUBLIC(const lzo_charp)
_lzo_version_string(void)
{
return LZO_VERSION_STRING;
}
LZO_PUBLIC(const lzo_charp)
_lzo_version_date(void)
{
return LZO_VERSION_DATE;
}
#define LZO_BASE 65521u
#define LZO_NMAX 5552
#define LZO_DO1(buf,i) {s1 += buf[i]; s2 += s1;}
#define LZO_DO2(buf,i) LZO_DO1(buf,i); LZO_DO1(buf,i+1);
#define LZO_DO4(buf,i) LZO_DO2(buf,i); LZO_DO2(buf,i+2);
#define LZO_DO8(buf,i) LZO_DO4(buf,i); LZO_DO4(buf,i+4);
#define LZO_DO16(buf,i) LZO_DO8(buf,i); LZO_DO8(buf,i+8);
LZO_PUBLIC(lzo_uint32)
lzo_adler32(lzo_uint32 adler, const lzo_byte *buf, lzo_uint len)
{
lzo_uint32 s1 = adler & 0xffff;
lzo_uint32 s2 = (adler >> 16) & 0xffff;
int k;
if (buf == NULL)
return 1;
while (len > 0)
{
k = len < LZO_NMAX ? (int) len : LZO_NMAX;
len -= k;
if (k >= 16) do
{
LZO_DO16(buf,0);
buf += 16;
k -= 16;
} while (k >= 16);
if (k != 0) do
{
s1 += *buf++;
s2 += s1;
} while (--k > 0);
s1 %= LZO_BASE;
s2 %= LZO_BASE;
}
return (s2 << 16) | s1;
}
LZO_PUBLIC(int)
lzo_memcmp(const lzo_voidp s1, const lzo_voidp s2, lzo_uint len)
{
#if (LZO_UINT_MAX <= SIZE_T_MAX) && defined(HAVE_MEMCMP)
return memcmp(s1,s2,len);
#else
const lzo_byte *p1 = (const lzo_byte *) s1;
const lzo_byte *p2 = (const lzo_byte *) s2;
int d;
if (len > 0) do
{
d = *p1 - *p2;
if (d != 0)
return d;
p1++;
p2++;
}
while (--len > 0);
return 0;
#endif
}
LZO_PUBLIC(lzo_voidp)
lzo_memcpy(lzo_voidp dest, const lzo_voidp src, lzo_uint len)
{
#if (LZO_UINT_MAX <= SIZE_T_MAX) && defined(HAVE_MEMCPY)
return memcpy(dest,src,len);
#else
lzo_byte *p1 = (lzo_byte *) dest;
const lzo_byte *p2 = (const lzo_byte *) src;
if (len <= 0 || p1 == p2)
return dest;
do
*p1++ = *p2++;
while (--len > 0);
return dest;
#endif
}
LZO_PUBLIC(lzo_voidp)
lzo_memmove(lzo_voidp dest, const lzo_voidp src, lzo_uint len)
{
#if (LZO_UINT_MAX <= SIZE_T_MAX) && defined(HAVE_MEMMOVE)
return memmove(dest,src,len);
#else
lzo_byte *p1 = (lzo_byte *) dest;
const lzo_byte *p2 = (const lzo_byte *) src;
if (len <= 0 || p1 == p2)
return dest;
if (p1 < p2)
{
do
*p1++ = *p2++;
while (--len > 0);
}
else
{
p1 += len;
p2 += len;
do
*--p1 = *--p2;
while (--len > 0);
}
return dest;
#endif
}
LZO_PUBLIC(lzo_voidp)
lzo_memset(lzo_voidp s, int c, lzo_uint len)
{
#if (LZO_UINT_MAX <= SIZE_T_MAX) && defined(HAVE_MEMSET)
return memset(s,c,len);
#else
lzo_byte *p = (lzo_byte *) s;
if (len > 0) do
*p++ = LZO_BYTE(c);
while (--len > 0);
return s;
#endif
}
#if 0
# define IS_SIGNED(type) (((type) (1ul << (8 * sizeof(type) - 1))) < 0)
# define IS_UNSIGNED(type) (((type) (1ul << (8 * sizeof(type) - 1))) > 0)
#else
# define IS_SIGNED(type) (((type) (-1)) < ((type) 0))
# define IS_UNSIGNED(type) (((type) (-1)) > ((type) 0))
#endif
#define IS_POWER_OF_2(x) (((x) & ((x) - 1)) == 0)
static lzo_bool schedule_insns_bug(void);
static lzo_bool strength_reduce_bug(int *);
#if 0 || defined(LZO_DEBUG)
#include <stdio.h>
static lzo_bool __lzo_assert_fail(const char *s, unsigned line)
{
#if defined(__palmos__)
printf("LZO assertion failed in line %u: '%s'\n",line,s);
#else
fprintf(stderr,"LZO assertion failed in line %u: '%s'\n",line,s);
#endif
return 0;
}
# define __lzo_assert(x) ((x) ? 1 : __lzo_assert_fail(#x,__LINE__))
#else
# define __lzo_assert(x) ((x) ? 1 : 0)
#endif
#undef COMPILE_TIME_ASSERT
#if 0
# define COMPILE_TIME_ASSERT(expr) r &= __lzo_assert(expr)
#else
# define COMPILE_TIME_ASSERT(expr) LZO_COMPILE_TIME_ASSERT(expr)
#endif
static lzo_bool basic_integral_check(void)
{
lzo_bool r = 1;
COMPILE_TIME_ASSERT(CHAR_BIT == 8);
COMPILE_TIME_ASSERT(sizeof(char) == 1);
COMPILE_TIME_ASSERT(sizeof(short) >= 2);
COMPILE_TIME_ASSERT(sizeof(long) >= 4);
COMPILE_TIME_ASSERT(sizeof(int) >= sizeof(short));
COMPILE_TIME_ASSERT(sizeof(long) >= sizeof(int));
COMPILE_TIME_ASSERT(sizeof(lzo_uint) == sizeof(lzo_int));
COMPILE_TIME_ASSERT(sizeof(lzo_uint32) == sizeof(lzo_int32));
COMPILE_TIME_ASSERT(sizeof(lzo_uint32) >= 4);
COMPILE_TIME_ASSERT(sizeof(lzo_uint32) >= sizeof(unsigned));
#if defined(__LZO_STRICT_16BIT)
COMPILE_TIME_ASSERT(sizeof(lzo_uint) == 2);
#else
COMPILE_TIME_ASSERT(sizeof(lzo_uint) >= 4);
COMPILE_TIME_ASSERT(sizeof(lzo_uint) >= sizeof(unsigned));
#endif
#if (USHRT_MAX == 65535u)
COMPILE_TIME_ASSERT(sizeof(short) == 2);
#elif (USHRT_MAX == LZO_0xffffffffL)
COMPILE_TIME_ASSERT(sizeof(short) == 4);
#elif (USHRT_MAX >= LZO_0xffffffffL)
COMPILE_TIME_ASSERT(sizeof(short) > 4);
#endif
#if (UINT_MAX == 65535u)
COMPILE_TIME_ASSERT(sizeof(int) == 2);
#elif (UINT_MAX == LZO_0xffffffffL)
COMPILE_TIME_ASSERT(sizeof(int) == 4);
#elif (UINT_MAX >= LZO_0xffffffffL)
COMPILE_TIME_ASSERT(sizeof(int) > 4);
#endif
#if (ULONG_MAX == 65535ul)
COMPILE_TIME_ASSERT(sizeof(long) == 2);
#elif (ULONG_MAX == LZO_0xffffffffL)
COMPILE_TIME_ASSERT(sizeof(long) == 4);
#elif (ULONG_MAX >= LZO_0xffffffffL)
COMPILE_TIME_ASSERT(sizeof(long) > 4);
#endif
#if defined(SIZEOF_UNSIGNED)
COMPILE_TIME_ASSERT(SIZEOF_UNSIGNED == sizeof(unsigned));
#endif
#if defined(SIZEOF_UNSIGNED_LONG)
COMPILE_TIME_ASSERT(SIZEOF_UNSIGNED_LONG == sizeof(unsigned long));
#endif
#if defined(SIZEOF_UNSIGNED_SHORT)
COMPILE_TIME_ASSERT(SIZEOF_UNSIGNED_SHORT == sizeof(unsigned short));
#endif
#if !defined(__LZO_IN_MINILZO)
#if defined(SIZEOF_SIZE_T)
COMPILE_TIME_ASSERT(SIZEOF_SIZE_T == sizeof(size_t));
#endif
#endif
COMPILE_TIME_ASSERT(IS_UNSIGNED(unsigned char));
COMPILE_TIME_ASSERT(IS_UNSIGNED(unsigned short));
COMPILE_TIME_ASSERT(IS_UNSIGNED(unsigned));
COMPILE_TIME_ASSERT(IS_UNSIGNED(unsigned long));
COMPILE_TIME_ASSERT(IS_SIGNED(short));
COMPILE_TIME_ASSERT(IS_SIGNED(int));
COMPILE_TIME_ASSERT(IS_SIGNED(long));
COMPILE_TIME_ASSERT(IS_UNSIGNED(lzo_uint32));
COMPILE_TIME_ASSERT(IS_UNSIGNED(lzo_uint));
COMPILE_TIME_ASSERT(IS_SIGNED(lzo_int32));
COMPILE_TIME_ASSERT(IS_SIGNED(lzo_int));
COMPILE_TIME_ASSERT(INT_MAX == LZO_STYPE_MAX(sizeof(int)));
COMPILE_TIME_ASSERT(UINT_MAX == LZO_UTYPE_MAX(sizeof(unsigned)));
COMPILE_TIME_ASSERT(LONG_MAX == LZO_STYPE_MAX(sizeof(long)));
COMPILE_TIME_ASSERT(ULONG_MAX == LZO_UTYPE_MAX(sizeof(unsigned long)));
COMPILE_TIME_ASSERT(SHRT_MAX == LZO_STYPE_MAX(sizeof(short)));
COMPILE_TIME_ASSERT(USHRT_MAX == LZO_UTYPE_MAX(sizeof(unsigned short)));
COMPILE_TIME_ASSERT(LZO_UINT32_MAX == LZO_UTYPE_MAX(sizeof(lzo_uint32)));
COMPILE_TIME_ASSERT(LZO_UINT_MAX == LZO_UTYPE_MAX(sizeof(lzo_uint)));
#if !defined(__LZO_IN_MINILZO)
COMPILE_TIME_ASSERT(SIZE_T_MAX == LZO_UTYPE_MAX(sizeof(size_t)));
#endif
r &= __lzo_assert(LZO_BYTE(257) == 1);
return r;
}
static lzo_bool basic_ptr_check(void)
{
lzo_bool r = 1;
COMPILE_TIME_ASSERT(sizeof(char *) >= sizeof(int));
COMPILE_TIME_ASSERT(sizeof(lzo_byte *) >= sizeof(char *));
COMPILE_TIME_ASSERT(sizeof(lzo_voidp) == sizeof(lzo_byte *));
COMPILE_TIME_ASSERT(sizeof(lzo_voidp) == sizeof(lzo_voidpp));
COMPILE_TIME_ASSERT(sizeof(lzo_voidp) == sizeof(lzo_bytepp));
COMPILE_TIME_ASSERT(sizeof(lzo_voidp) >= sizeof(lzo_uint));
COMPILE_TIME_ASSERT(sizeof(lzo_ptr_t) == sizeof(lzo_voidp));
COMPILE_TIME_ASSERT(sizeof(lzo_ptr_t) == sizeof(lzo_sptr_t));
COMPILE_TIME_ASSERT(sizeof(lzo_ptr_t) >= sizeof(lzo_uint));
COMPILE_TIME_ASSERT(sizeof(lzo_ptrdiff_t) >= 4);
COMPILE_TIME_ASSERT(sizeof(lzo_ptrdiff_t) >= sizeof(ptrdiff_t));
COMPILE_TIME_ASSERT(sizeof(ptrdiff_t) >= sizeof(size_t));
COMPILE_TIME_ASSERT(sizeof(lzo_ptrdiff_t) >= sizeof(lzo_uint));
#if defined(SIZEOF_CHAR_P)
COMPILE_TIME_ASSERT(SIZEOF_CHAR_P == sizeof(char *));
#endif
#if defined(SIZEOF_PTRDIFF_T)
COMPILE_TIME_ASSERT(SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t));
#endif
COMPILE_TIME_ASSERT(IS_SIGNED(ptrdiff_t));
COMPILE_TIME_ASSERT(IS_UNSIGNED(size_t));
COMPILE_TIME_ASSERT(IS_SIGNED(lzo_ptrdiff_t));
COMPILE_TIME_ASSERT(IS_SIGNED(lzo_sptr_t));
COMPILE_TIME_ASSERT(IS_UNSIGNED(lzo_ptr_t));
COMPILE_TIME_ASSERT(IS_UNSIGNED(lzo_moff_t));
return r;
}
static lzo_bool ptr_check(void)
{
lzo_bool r = 1;
int i;
char _wrkmem[10 * sizeof(lzo_byte *) + sizeof(lzo_full_align_t)];
lzo_bytep wrkmem;
lzo_bytepp dict;
unsigned char x[4 * sizeof(lzo_full_align_t)];
long d;
lzo_full_align_t a;
lzo_full_align_t u;
for (i = 0; i < (int) sizeof(x); i++)
x[i] = LZO_BYTE(i);
wrkmem = LZO_PTR_ALIGN_UP((lzo_byte *)_wrkmem,sizeof(lzo_full_align_t));
#if 0
dict = (lzo_bytepp) wrkmem;
#else
u.a_lzo_bytep = wrkmem; dict = u.a_lzo_bytepp;
#endif
d = (long) ((const lzo_bytep) dict - (const lzo_bytep) _wrkmem);
r &= __lzo_assert(d >= 0);
r &= __lzo_assert(d < (long) sizeof(lzo_full_align_t));
memset(&a,0,sizeof(a));
r &= __lzo_assert(a.a_lzo_voidp == NULL);
memset(&a,0xff,sizeof(a));
r &= __lzo_assert(a.a_ushort == USHRT_MAX);
r &= __lzo_assert(a.a_uint == UINT_MAX);
r &= __lzo_assert(a.a_ulong == ULONG_MAX);
r &= __lzo_assert(a.a_lzo_uint == LZO_UINT_MAX);
r &= __lzo_assert(a.a_lzo_uint32 == LZO_UINT32_MAX);
if (r == 1)
{
for (i = 0; i < 8; i++)
r &= __lzo_assert((const lzo_voidp) (&dict[i]) == (const lzo_voidp) (&wrkmem[i * sizeof(lzo_byte *)]));
}
memset(&a,0,sizeof(a));
r &= __lzo_assert(a.a_char_p == NULL);
r &= __lzo_assert(a.a_lzo_bytep == NULL);
r &= __lzo_assert(NULL == (void *)0);
if (r == 1)
{
for (i = 0; i < 10; i++)
dict[i] = wrkmem;
BZERO8_PTR(dict+1,sizeof(dict[0]),8);
r &= __lzo_assert(dict[0] == wrkmem);
for (i = 1; i < 9; i++)
r &= __lzo_assert(dict[i] == NULL);
r &= __lzo_assert(dict[9] == wrkmem);
}
if (r == 1)
{
unsigned k = 1;
const unsigned n = (unsigned) sizeof(lzo_uint32);
lzo_byte *p0;
lzo_byte *p1;
k += __lzo_align_gap(&x[k],n);
p0 = (lzo_bytep) &x[k];
#if defined(PTR_LINEAR)
r &= __lzo_assert((PTR_LINEAR(p0) & (n-1)) == 0);
#else
r &= __lzo_assert(n == 4);
r &= __lzo_assert(PTR_ALIGNED_4(p0));
#endif
r &= __lzo_assert(k >= 1);
p1 = (lzo_bytep) &x[1];
r &= __lzo_assert(PTR_GE(p0,p1));
r &= __lzo_assert(k < 1+n);
p1 = (lzo_bytep) &x[1+n];
r &= __lzo_assert(PTR_LT(p0,p1));
if (r == 1)
{
lzo_uint32 v0, v1;
#if 0
v0 = * (lzo_uint32 *) &x[k];
v1 = * (lzo_uint32 *) &x[k+n];
#else
u.a_uchar_p = &x[k];
v0 = *u.a_lzo_uint32_p;
u.a_uchar_p = &x[k+n];
v1 = *u.a_lzo_uint32_p;
#endif
r &= __lzo_assert(v0 > 0);
r &= __lzo_assert(v1 > 0);
}
}
return r;
}
LZO_PUBLIC(int)
_lzo_config_check(void)
{
lzo_bool r = 1;
int i;
union {
lzo_uint32 a;
unsigned short b;
lzo_uint32 aa[4];
unsigned char x[4*sizeof(lzo_full_align_t)];
} u;
COMPILE_TIME_ASSERT( (int) ((unsigned char) ((signed char) -1)) == 255);
COMPILE_TIME_ASSERT( (((unsigned char)128) << (int)(8*sizeof(int)-8)) < 0);
#if 0
r &= __lzo_assert((const void *)&u == (const void *)&u.a);
r &= __lzo_assert((const void *)&u == (const void *)&u.b);
r &= __lzo_assert((const void *)&u == (const void *)&u.x[0]);
r &= __lzo_assert((const void *)&u == (const void *)&u.aa[0]);
#endif
r &= basic_integral_check();
r &= basic_ptr_check();
if (r != 1)
return LZO_E_ERROR;
u.a = 0; u.b = 0;
for (i = 0; i < (int) sizeof(u.x); i++)
u.x[i] = LZO_BYTE(i);
#if defined(LZO_BYTE_ORDER)
if (r == 1)
{
# if (LZO_BYTE_ORDER == LZO_LITTLE_ENDIAN)
lzo_uint32 a = (lzo_uint32) (u.a & LZO_0xffffffffL);
unsigned short b = (unsigned short) (u.b & 0xffff);
r &= __lzo_assert(a == 0x03020100L);
r &= __lzo_assert(b == 0x0100);
# elif (LZO_BYTE_ORDER == LZO_BIG_ENDIAN)
lzo_uint32 a = u.a >> (8 * sizeof(u.a) - 32);
unsigned short b = u.b >> (8 * sizeof(u.b) - 16);
r &= __lzo_assert(a == 0x00010203L);
r &= __lzo_assert(b == 0x0001);
# else
# error "invalid LZO_BYTE_ORDER"
# endif
}
#endif
#if defined(LZO_UNALIGNED_OK_2)
COMPILE_TIME_ASSERT(sizeof(short) == 2);
if (r == 1)
{
unsigned short b[4];
for (i = 0; i < 4; i++)
b[i] = * (const unsigned short *) &u.x[i];
# if (LZO_BYTE_ORDER == LZO_LITTLE_ENDIAN)
r &= __lzo_assert(b[0] == 0x0100);
r &= __lzo_assert(b[1] == 0x0201);
r &= __lzo_assert(b[2] == 0x0302);
r &= __lzo_assert(b[3] == 0x0403);
# elif (LZO_BYTE_ORDER == LZO_BIG_ENDIAN)
r &= __lzo_assert(b[0] == 0x0001);
r &= __lzo_assert(b[1] == 0x0102);
r &= __lzo_assert(b[2] == 0x0203);
r &= __lzo_assert(b[3] == 0x0304);
# endif
}
#endif
#if defined(LZO_UNALIGNED_OK_4)
COMPILE_TIME_ASSERT(sizeof(lzo_uint32) == 4);
if (r == 1)
{
lzo_uint32 a[4];
for (i = 0; i < 4; i++)
a[i] = * (const lzo_uint32 *) &u.x[i];
# if (LZO_BYTE_ORDER == LZO_LITTLE_ENDIAN)
r &= __lzo_assert(a[0] == 0x03020100L);
r &= __lzo_assert(a[1] == 0x04030201L);
r &= __lzo_assert(a[2] == 0x05040302L);
r &= __lzo_assert(a[3] == 0x06050403L);
# elif (LZO_BYTE_ORDER == LZO_BIG_ENDIAN)
r &= __lzo_assert(a[0] == 0x00010203L);
r &= __lzo_assert(a[1] == 0x01020304L);
r &= __lzo_assert(a[2] == 0x02030405L);
r &= __lzo_assert(a[3] == 0x03040506L);
# endif
}
#endif
#if defined(LZO_ALIGNED_OK_4)
COMPILE_TIME_ASSERT(sizeof(lzo_uint32) == 4);
#endif
COMPILE_TIME_ASSERT(lzo_sizeof_dict_t == sizeof(lzo_dict_t));
#if defined(__LZO_IN_MINLZO)
if (r == 1)
{
lzo_uint32 adler;
adler = lzo_adler32(0, NULL, 0);
adler = lzo_adler32(adler, lzo_copyright(), 200);
r &= __lzo_assert(adler == 0xc76f1751L);
}
#endif
if (r == 1)
{
r &= __lzo_assert(!schedule_insns_bug());
}
if (r == 1)
{
static int x[3];
static unsigned xn = 3;
register unsigned j;
for (j = 0; j < xn; j++)
x[j] = (int)j - 3;
r &= __lzo_assert(!strength_reduce_bug(x));
}
if (r == 1)
{
r &= ptr_check();
}
return r == 1 ? LZO_E_OK : LZO_E_ERROR;
}
static lzo_bool schedule_insns_bug(void)
{
#if defined(__LZO_CHECKER)
return 0;
#else
const int clone[] = {1, 2, 0};
const int *q;
q = clone;
return (*q) ? 0 : 1;
#endif
}
static lzo_bool strength_reduce_bug(int *x)
{
return x[0] != -3 || x[1] != -2 || x[2] != -1;
}
#undef COMPILE_TIME_ASSERT
int __lzo_init_done = 0;
LZO_PUBLIC(int)
__lzo_init2(unsigned v, int s1, int s2, int s3, int s4, int s5,
int s6, int s7, int s8, int s9)
{
int r;
__lzo_init_done = 1;
if (v == 0)
return LZO_E_ERROR;
r = (s1 == -1 || s1 == (int) sizeof(short)) &&
(s2 == -1 || s2 == (int) sizeof(int)) &&
(s3 == -1 || s3 == (int) sizeof(long)) &&
(s4 == -1 || s4 == (int) sizeof(lzo_uint32)) &&
(s5 == -1 || s5 == (int) sizeof(lzo_uint)) &&
(s6 == -1 || s6 == (int) lzo_sizeof_dict_t) &&
(s7 == -1 || s7 == (int) sizeof(char *)) &&
(s8 == -1 || s8 == (int) sizeof(lzo_voidp)) &&
(s9 == -1 || s9 == (int) sizeof(lzo_compress_t));
if (!r)
return LZO_E_ERROR;
r = _lzo_config_check();
if (r != LZO_E_OK)
return r;
return r;
}
#if !defined(__LZO_IN_MINILZO)
LZO_EXTERN(int)
__lzo_init(unsigned v,int s1,int s2,int s3,int s4,int s5,int s6,int s7);
LZO_PUBLIC(int)
__lzo_init(unsigned v,int s1,int s2,int s3,int s4,int s5,int s6,int s7)
{
if (v == 0 || v > 0x1010)
return LZO_E_ERROR;
return __lzo_init2(v,s1,s2,s3,s4,s5,-1,-1,s6,s7);
}
#endif
#define do_compress _lzo1x_1_do_compress
#define LZO_NEED_DICT_H
#define D_BITS 14
#define D_INDEX1(d,p) d = DM((0x21*DX3(p,5,5,6)) >> 5)
#define D_INDEX2(d,p) d = (d & (D_MASK & 0x7ff)) ^ (D_HIGH | 0x1f)
#ifndef __LZO_CONFIG1X_H
#define __LZO_CONFIG1X_H
#if !defined(LZO1X) && !defined(LZO1Y) && !defined(LZO1Z)
# define LZO1X
#endif
#if !defined(__LZO_IN_MINILZO)
#include <lzo1x.h>
#endif
#define LZO_EOF_CODE
#undef LZO_DETERMINISTIC
#define M1_MAX_OFFSET 0x0400
#ifndef M2_MAX_OFFSET
#define M2_MAX_OFFSET 0x0800
#endif
#define M3_MAX_OFFSET 0x4000
#define M4_MAX_OFFSET 0xbfff
#define MX_MAX_OFFSET (M1_MAX_OFFSET + M2_MAX_OFFSET)
#define M1_MIN_LEN 2
#define M1_MAX_LEN 2
#define M2_MIN_LEN 3
#ifndef M2_MAX_LEN
#define M2_MAX_LEN 8
#endif
#define M3_MIN_LEN 3
#define M3_MAX_LEN 33
#define M4_MIN_LEN 3
#define M4_MAX_LEN 9
#define M1_MARKER 0
#define M2_MARKER 64
#define M3_MARKER 32
#define M4_MARKER 16
#ifndef MIN_LOOKAHEAD
#define MIN_LOOKAHEAD (M2_MAX_LEN + 1)
#endif
#if defined(LZO_NEED_DICT_H)
#ifndef LZO_HASH
#define LZO_HASH LZO_HASH_LZO_INCREMENTAL_B
#endif
#define DL_MIN_LEN M2_MIN_LEN
#ifndef __LZO_DICT_H
#define __LZO_DICT_H
#ifdef __cplusplus
extern "C" {
#endif
#if !defined(D_BITS) && defined(DBITS)
# define D_BITS DBITS
#endif
#if !defined(D_BITS)
# error "D_BITS is not defined"
#endif
#if (D_BITS < 16)
# define D_SIZE LZO_SIZE(D_BITS)
# define D_MASK LZO_MASK(D_BITS)
#else
# define D_SIZE LZO_USIZE(D_BITS)
# define D_MASK LZO_UMASK(D_BITS)
#endif
#define D_HIGH ((D_MASK >> 1) + 1)
#if !defined(DD_BITS)
# define DD_BITS 0
#endif
#define DD_SIZE LZO_SIZE(DD_BITS)
#define DD_MASK LZO_MASK(DD_BITS)
#if !defined(DL_BITS)
# define DL_BITS (D_BITS - DD_BITS)
#endif
#if (DL_BITS < 16)
# define DL_SIZE LZO_SIZE(DL_BITS)
# define DL_MASK LZO_MASK(DL_BITS)
#else
# define DL_SIZE LZO_USIZE(DL_BITS)
# define DL_MASK LZO_UMASK(DL_BITS)
#endif
#if (D_BITS != DL_BITS + DD_BITS)
# error "D_BITS does not match"
#endif
#if (D_BITS < 8 || D_BITS > 18)
# error "invalid D_BITS"
#endif
#if (DL_BITS < 8 || DL_BITS > 20)
# error "invalid DL_BITS"
#endif
#if (DD_BITS < 0 || DD_BITS > 6)
# error "invalid DD_BITS"
#endif
#if !defined(DL_MIN_LEN)
# define DL_MIN_LEN 3
#endif
#if !defined(DL_SHIFT)
# define DL_SHIFT ((DL_BITS + (DL_MIN_LEN - 1)) / DL_MIN_LEN)
#endif
#define LZO_HASH_GZIP 1
#define LZO_HASH_GZIP_INCREMENTAL 2
#define LZO_HASH_LZO_INCREMENTAL_A 3
#define LZO_HASH_LZO_INCREMENTAL_B 4
#if !defined(LZO_HASH)
# error "choose a hashing strategy"
#endif
#if (DL_MIN_LEN == 3)
# define _DV2_A(p,shift1,shift2) \
(((( (lzo_uint32)((p)[0]) << shift1) ^ (p)[1]) << shift2) ^ (p)[2])
# define _DV2_B(p,shift1,shift2) \
(((( (lzo_uint32)((p)[2]) << shift1) ^ (p)[1]) << shift2) ^ (p)[0])
# define _DV3_B(p,shift1,shift2,shift3) \
((_DV2_B((p)+1,shift1,shift2) << (shift3)) ^ (p)[0])
#elif (DL_MIN_LEN == 2)
# define _DV2_A(p,shift1,shift2) \
(( (lzo_uint32)(p[0]) << shift1) ^ p[1])
# define _DV2_B(p,shift1,shift2) \
(( (lzo_uint32)(p[1]) << shift1) ^ p[2])
#else
# error "invalid DL_MIN_LEN"
#endif
#define _DV_A(p,shift) _DV2_A(p,shift,shift)
#define _DV_B(p,shift) _DV2_B(p,shift,shift)
#define DA2(p,s1,s2) \
(((((lzo_uint32)((p)[2]) << (s2)) + (p)[1]) << (s1)) + (p)[0])
#define DS2(p,s1,s2) \
(((((lzo_uint32)((p)[2]) << (s2)) - (p)[1]) << (s1)) - (p)[0])
#define DX2(p,s1,s2) \
(((((lzo_uint32)((p)[2]) << (s2)) ^ (p)[1]) << (s1)) ^ (p)[0])
#define DA3(p,s1,s2,s3) ((DA2((p)+1,s2,s3) << (s1)) + (p)[0])
#define DS3(p,s1,s2,s3) ((DS2((p)+1,s2,s3) << (s1)) - (p)[0])
#define DX3(p,s1,s2,s3) ((DX2((p)+1,s2,s3) << (s1)) ^ (p)[0])
#define DMS(v,s) ((lzo_uint) (((v) & (D_MASK >> (s))) << (s)))
#define DM(v) DMS(v,0)
#if (LZO_HASH == LZO_HASH_GZIP)
# define _DINDEX(dv,p) (_DV_A((p),DL_SHIFT))
#elif (LZO_HASH == LZO_HASH_GZIP_INCREMENTAL)
# define __LZO_HASH_INCREMENTAL
# define DVAL_FIRST(dv,p) dv = _DV_A((p),DL_SHIFT)
# define DVAL_NEXT(dv,p) dv = (((dv) << DL_SHIFT) ^ p[2])
# define _DINDEX(dv,p) (dv)
# define DVAL_LOOKAHEAD DL_MIN_LEN
#elif (LZO_HASH == LZO_HASH_LZO_INCREMENTAL_A)
# define __LZO_HASH_INCREMENTAL
# define DVAL_FIRST(dv,p) dv = _DV_A((p),5)
# define DVAL_NEXT(dv,p) \
dv ^= (lzo_uint32)(p[-1]) << (2*5); dv = (((dv) << 5) ^ p[2])
# define _DINDEX(dv,p) ((0x9f5f * (dv)) >> 5)
# define DVAL_LOOKAHEAD DL_MIN_LEN
#elif (LZO_HASH == LZO_HASH_LZO_INCREMENTAL_B)
# define __LZO_HASH_INCREMENTAL
# define DVAL_FIRST(dv,p) dv = _DV_B((p),5)
# define DVAL_NEXT(dv,p) \
dv ^= p[-1]; dv = (((dv) >> 5) ^ ((lzo_uint32)(p[2]) << (2*5)))
# define _DINDEX(dv,p) ((0x9f5f * (dv)) >> 5)
# define DVAL_LOOKAHEAD DL_MIN_LEN
#else
# error "choose a hashing strategy"
#endif
#ifndef DINDEX
#define DINDEX(dv,p) ((lzo_uint)((_DINDEX(dv,p)) & DL_MASK) << DD_BITS)
#endif
#if !defined(DINDEX1) && defined(D_INDEX1)
#define DINDEX1 D_INDEX1
#endif
#if !defined(DINDEX2) && defined(D_INDEX2)
#define DINDEX2 D_INDEX2
#endif
#if !defined(__LZO_HASH_INCREMENTAL)
# define DVAL_FIRST(dv,p) ((void) 0)
# define DVAL_NEXT(dv,p) ((void) 0)
# define DVAL_LOOKAHEAD 0
#endif
#if !defined(DVAL_ASSERT)
#if defined(__LZO_HASH_INCREMENTAL) && !defined(NDEBUG)
static void DVAL_ASSERT(lzo_uint32 dv, const lzo_byte *p)
{
lzo_uint32 df;
DVAL_FIRST(df,(p));
assert(DINDEX(dv,p) == DINDEX(df,p));
}
#else
# define DVAL_ASSERT(dv,p) ((void) 0)
#endif
#endif
#if defined(LZO_DICT_USE_PTR)
# define DENTRY(p,in) (p)
# define GINDEX(m_pos,m_off,dict,dindex,in) m_pos = dict[dindex]
#else
# define DENTRY(p,in) ((lzo_uint) ((p)-(in)))
# define GINDEX(m_pos,m_off,dict,dindex,in) m_off = dict[dindex]
#endif
#if (DD_BITS == 0)
# define UPDATE_D(dict,drun,dv,p,in) dict[ DINDEX(dv,p) ] = DENTRY(p,in)
# define UPDATE_I(dict,drun,index,p,in) dict[index] = DENTRY(p,in)
# define UPDATE_P(ptr,drun,p,in) (ptr)[0] = DENTRY(p,in)
#else
# define UPDATE_D(dict,drun,dv,p,in) \
dict[ DINDEX(dv,p) + drun++ ] = DENTRY(p,in); drun &= DD_MASK
# define UPDATE_I(dict,drun,index,p,in) \
dict[ (index) + drun++ ] = DENTRY(p,in); drun &= DD_MASK
# define UPDATE_P(ptr,drun,p,in) \
(ptr) [ drun++ ] = DENTRY(p,in); drun &= DD_MASK
#endif
#if defined(LZO_DICT_USE_PTR)
#define LZO_CHECK_MPOS_DET(m_pos,m_off,in,ip,max_offset) \
(m_pos == NULL || (m_off = (lzo_moff_t) (ip - m_pos)) > max_offset)
#define LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,max_offset) \
(BOUNDS_CHECKING_OFF_IN_EXPR( \
(PTR_LT(m_pos,in) || \
(m_off = (lzo_moff_t) PTR_DIFF(ip,m_pos)) <= 0 || \
m_off > max_offset) ))
#else
#define LZO_CHECK_MPOS_DET(m_pos,m_off,in,ip,max_offset) \
(m_off == 0 || \
((m_off = (lzo_moff_t) ((ip)-(in)) - m_off) > max_offset) || \
(m_pos = (ip) - (m_off), 0) )
#define LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,max_offset) \
((lzo_moff_t) ((ip)-(in)) <= m_off || \
((m_off = (lzo_moff_t) ((ip)-(in)) - m_off) > max_offset) || \
(m_pos = (ip) - (m_off), 0) )
#endif
#if defined(LZO_DETERMINISTIC)
# define LZO_CHECK_MPOS LZO_CHECK_MPOS_DET
#else
# define LZO_CHECK_MPOS LZO_CHECK_MPOS_NON_DET
#endif
#ifdef __cplusplus
}
#endif
#endif
#endif
#endif
#define DO_COMPRESS lzo1x_1_compress
static
lzo_uint do_compress ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem )
{
#if 0 && defined(__GNUC__) && defined(__i386__)
register const lzo_byte *ip __asm__("%esi");
#else
register const lzo_byte *ip;
#endif
lzo_byte *op;
const lzo_byte * const in_end = in + in_len;
const lzo_byte * const ip_end = in + in_len - M2_MAX_LEN - 5;
const lzo_byte *ii;
lzo_dict_p const dict = (lzo_dict_p) wrkmem;
op = out;
ip = in;
ii = ip;
ip += 4;
for (;;)
{
#if 0 && defined(__GNUC__) && defined(__i386__)
register const lzo_byte *m_pos __asm__("%edi");
#else
register const lzo_byte *m_pos;
#endif
lzo_moff_t m_off;
lzo_uint m_len;
lzo_uint dindex;
DINDEX1(dindex,ip);
GINDEX(m_pos,m_off,dict,dindex,in);
if (LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,M4_MAX_OFFSET))
goto literal;
#if 1
if (m_off <= M2_MAX_OFFSET || m_pos[3] == ip[3])
goto try_match;
DINDEX2(dindex,ip);
#endif
GINDEX(m_pos,m_off,dict,dindex,in);
if (LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,M4_MAX_OFFSET))
goto literal;
if (m_off <= M2_MAX_OFFSET || m_pos[3] == ip[3])
goto try_match;
goto literal;
try_match:
#if 1 && defined(LZO_UNALIGNED_OK_2)
if (* (const lzo_ushortp) m_pos != * (const lzo_ushortp) ip)
#else
if (m_pos[0] != ip[0] || m_pos[1] != ip[1])
#endif
{
}
else
{
if (m_pos[2] == ip[2])
{
#if 0
if (m_off <= M2_MAX_OFFSET)
goto match;
if (lit <= 3)
goto match;
if (lit == 3)
{
assert(op - 2 > out); op[-2] |= LZO_BYTE(3);
*op++ = *ii++; *op++ = *ii++; *op++ = *ii++;
goto code_match;
}
if (m_pos[3] == ip[3])
#endif
goto match;
}
else
{
#if 0
#if 0
if (m_off <= M1_MAX_OFFSET && lit > 0 && lit <= 3)
#else
if (m_off <= M1_MAX_OFFSET && lit == 3)
#endif
{
register lzo_uint t;
t = lit;
assert(op - 2 > out); op[-2] |= LZO_BYTE(t);
do *op++ = *ii++; while (--t > 0);
assert(ii == ip);
m_off -= 1;
*op++ = LZO_BYTE(M1_MARKER | ((m_off & 3) << 2));
*op++ = LZO_BYTE(m_off >> 2);
ip += 2;
goto match_done;
}
#endif
}
}
literal:
UPDATE_I(dict,0,dindex,ip,in);
++ip;
if (ip >= ip_end)
break;
continue;
match:
UPDATE_I(dict,0,dindex,ip,in);
if (pd(ip,ii) > 0)
{
register lzo_uint t = pd(ip,ii);
if (t <= 3)
{
assert(op - 2 > out);
op[-2] |= LZO_BYTE(t);
}
else if (t <= 18)
*op++ = LZO_BYTE(t - 3);
else
{
register lzo_uint tt = t - 18;
*op++ = 0;
while (tt > 255)
{
tt -= 255;
*op++ = 0;
}
assert(tt > 0);
*op++ = LZO_BYTE(tt);
}
do *op++ = *ii++; while (--t > 0);
}
assert(ii == ip);
ip += 3;
if (m_pos[3] != *ip++ || m_pos[4] != *ip++ || m_pos[5] != *ip++ ||
m_pos[6] != *ip++ || m_pos[7] != *ip++ || m_pos[8] != *ip++
#ifdef LZO1Y
|| m_pos[ 9] != *ip++ || m_pos[10] != *ip++ || m_pos[11] != *ip++
|| m_pos[12] != *ip++ || m_pos[13] != *ip++ || m_pos[14] != *ip++
#endif
)
{
--ip;
m_len = ip - ii;
assert(m_len >= 3); assert(m_len <= M2_MAX_LEN);
if (m_off <= M2_MAX_OFFSET)
{
m_off -= 1;
#if defined(LZO1X)
*op++ = LZO_BYTE(((m_len - 1) << 5) | ((m_off & 7) << 2));
*op++ = LZO_BYTE(m_off >> 3);
#elif defined(LZO1Y)
*op++ = LZO_BYTE(((m_len + 1) << 4) | ((m_off & 3) << 2));
*op++ = LZO_BYTE(m_off >> 2);
#endif
}
else if (m_off <= M3_MAX_OFFSET)
{
m_off -= 1;
*op++ = LZO_BYTE(M3_MARKER | (m_len - 2));
goto m3_m4_offset;
}
else
#if defined(LZO1X)
{
m_off -= 0x4000;
assert(m_off > 0); assert(m_off <= 0x7fff);
*op++ = LZO_BYTE(M4_MARKER |
((m_off & 0x4000) >> 11) | (m_len - 2));
goto m3_m4_offset;
}
#elif defined(LZO1Y)
goto m4_match;
#endif
}
else
{
{
const lzo_byte *end = in_end;
const lzo_byte *m = m_pos + M2_MAX_LEN + 1;
while (ip < end && *m == *ip)
m++, ip++;
m_len = (ip - ii);
}
assert(m_len > M2_MAX_LEN);
if (m_off <= M3_MAX_OFFSET)
{
m_off -= 1;
if (m_len <= 33)
*op++ = LZO_BYTE(M3_MARKER | (m_len - 2));
else
{
m_len -= 33;
*op++ = M3_MARKER | 0;
goto m3_m4_len;
}
}
else
{
#if defined(LZO1Y)
m4_match:
#endif
m_off -= 0x4000;
assert(m_off > 0); assert(m_off <= 0x7fff);
if (m_len <= M4_MAX_LEN)
*op++ = LZO_BYTE(M4_MARKER |
((m_off & 0x4000) >> 11) | (m_len - 2));
else
{
m_len -= M4_MAX_LEN;
*op++ = LZO_BYTE(M4_MARKER | ((m_off & 0x4000) >> 11));
m3_m4_len:
while (m_len > 255)
{
m_len -= 255;
*op++ = 0;
}
assert(m_len > 0);
*op++ = LZO_BYTE(m_len);
}
}
m3_m4_offset:
*op++ = LZO_BYTE((m_off & 63) << 2);
*op++ = LZO_BYTE(m_off >> 6);
}
#if 0
match_done:
#endif
ii = ip;
if (ip >= ip_end)
break;
}
*out_len = op - out;
return pd(in_end,ii);
}
LZO_PUBLIC(int)
DO_COMPRESS ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem )
{
lzo_byte *op = out;
lzo_uint t;
#if defined(__LZO_QUERY_COMPRESS)
if (__LZO_IS_COMPRESS_QUERY(in,in_len,out,out_len,wrkmem))
return __LZO_QUERY_COMPRESS(in,in_len,out,out_len,wrkmem,D_SIZE,lzo_sizeof(lzo_dict_t));
#endif
if (in_len <= M2_MAX_LEN + 5)
t = in_len;
else
{
t = do_compress(in,in_len,op,out_len,wrkmem);
op += *out_len;
}
if (t > 0)
{
const lzo_byte *ii = in + in_len - t;
if (op == out && t <= 238)
*op++ = LZO_BYTE(17 + t);
else if (t <= 3)
op[-2] |= LZO_BYTE(t);
else if (t <= 18)
*op++ = LZO_BYTE(t - 3);
else
{
lzo_uint tt = t - 18;
*op++ = 0;
while (tt > 255)
{
tt -= 255;
*op++ = 0;
}
assert(tt > 0);
*op++ = LZO_BYTE(tt);
}
do *op++ = *ii++; while (--t > 0);
}
*op++ = M4_MARKER | 1;
*op++ = 0;
*op++ = 0;
*out_len = op - out;
return LZO_E_OK;
}
#undef do_compress
#undef DO_COMPRESS
#undef LZO_HASH
#undef LZO_TEST_DECOMPRESS_OVERRUN
#undef LZO_TEST_DECOMPRESS_OVERRUN_INPUT
#undef LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT
#undef LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND
#undef DO_DECOMPRESS
#define DO_DECOMPRESS lzo1x_decompress
#if defined(LZO_TEST_DECOMPRESS_OVERRUN)
# if !defined(LZO_TEST_DECOMPRESS_OVERRUN_INPUT)
# define LZO_TEST_DECOMPRESS_OVERRUN_INPUT 2
# endif
# if !defined(LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT)
# define LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT 2
# endif
# if !defined(LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND)
# define LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND
# endif
#endif
#undef TEST_IP
#undef TEST_OP
#undef TEST_LOOKBEHIND
#undef NEED_IP
#undef NEED_OP
#undef HAVE_TEST_IP
#undef HAVE_TEST_OP
#undef HAVE_NEED_IP
#undef HAVE_NEED_OP
#undef HAVE_ANY_IP
#undef HAVE_ANY_OP
#if defined(LZO_TEST_DECOMPRESS_OVERRUN_INPUT)
# if (LZO_TEST_DECOMPRESS_OVERRUN_INPUT >= 1)
# define TEST_IP (ip < ip_end)
# endif
# if (LZO_TEST_DECOMPRESS_OVERRUN_INPUT >= 2)
# define NEED_IP(x) \
if ((lzo_uint)(ip_end - ip) < (lzo_uint)(x)) goto input_overrun
# endif
#endif
#if defined(LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT)
# if (LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT >= 1)
# define TEST_OP (op <= op_end)
# endif
# if (LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT >= 2)
# undef TEST_OP
# define NEED_OP(x) \
if ((lzo_uint)(op_end - op) < (lzo_uint)(x)) goto output_overrun
# endif
#endif
#if defined(LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND)
# define TEST_LOOKBEHIND(m_pos,out) if (m_pos < out) goto lookbehind_overrun
#else
# define TEST_LOOKBEHIND(m_pos,op) ((void) 0)
#endif
#if !defined(LZO_EOF_CODE) && !defined(TEST_IP)
# define TEST_IP (ip < ip_end)
#endif
#if defined(TEST_IP)
# define HAVE_TEST_IP
#else
# define TEST_IP 1
#endif
#if defined(TEST_OP)
# define HAVE_TEST_OP
#else
# define TEST_OP 1
#endif
#if defined(NEED_IP)
# define HAVE_NEED_IP
#else
# define NEED_IP(x) ((void) 0)
#endif
#if defined(NEED_OP)
# define HAVE_NEED_OP
#else
# define NEED_OP(x) ((void) 0)
#endif
#if defined(HAVE_TEST_IP) || defined(HAVE_NEED_IP)
# define HAVE_ANY_IP
#endif
#if defined(HAVE_TEST_OP) || defined(HAVE_NEED_OP)
# define HAVE_ANY_OP
#endif
#undef __COPY4
#define __COPY4(dst,src) * (lzo_uint32p)(dst) = * (const lzo_uint32p)(src)
#undef COPY4
#if defined(LZO_UNALIGNED_OK_4)
# define COPY4(dst,src) __COPY4(dst,src)
#elif defined(LZO_ALIGNED_OK_4)
# define COPY4(dst,src) __COPY4((lzo_ptr_t)(dst),(lzo_ptr_t)(src))
#endif
#if defined(DO_DECOMPRESS)
LZO_PUBLIC(int)
DO_DECOMPRESS ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem )
#endif
{
register lzo_byte *op;
register const lzo_byte *ip;
register lzo_uint t;
#if defined(COPY_DICT)
lzo_uint m_off;
const lzo_byte *dict_end;
#else
register const lzo_byte *m_pos;
#endif
const lzo_byte * const ip_end = in + in_len;
#if defined(HAVE_ANY_OP)
lzo_byte * const op_end = out + *out_len;
#endif
#if defined(LZO1Z)
lzo_uint last_m_off = 0;
#endif
LZO_UNUSED(wrkmem);
#if defined(__LZO_QUERY_DECOMPRESS)
if (__LZO_IS_DECOMPRESS_QUERY(in,in_len,out,out_len,wrkmem))
return __LZO_QUERY_DECOMPRESS(in,in_len,out,out_len,wrkmem,0,0);
#endif
#if defined(COPY_DICT)
if (dict)
{
if (dict_len > M4_MAX_OFFSET)
{
dict += dict_len - M4_MAX_OFFSET;
dict_len = M4_MAX_OFFSET;
}
dict_end = dict + dict_len;
}
else
{
dict_len = 0;
dict_end = NULL;
}
#endif
*out_len = 0;
op = out;
ip = in;
if (*ip > 17)
{
t = *ip++ - 17;
if (t < 4)
goto match_next;
assert(t > 0); NEED_OP(t); NEED_IP(t+1);
do *op++ = *ip++; while (--t > 0);
goto first_literal_run;
}
while (TEST_IP && TEST_OP)
{
t = *ip++;
if (t >= 16)
goto match;
if (t == 0)
{
NEED_IP(1);
while (*ip == 0)
{
t += 255;
ip++;
NEED_IP(1);
}
t += 15 + *ip++;
}
assert(t > 0); NEED_OP(t+3); NEED_IP(t+4);
#if defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4)
#if !defined(LZO_UNALIGNED_OK_4)
if (PTR_ALIGNED2_4(op,ip))
{
#endif
COPY4(op,ip);
op += 4; ip += 4;
if (--t > 0)
{
if (t >= 4)
{
do {
COPY4(op,ip);
op += 4; ip += 4; t -= 4;
} while (t >= 4);
if (t > 0) do *op++ = *ip++; while (--t > 0);
}
else
do *op++ = *ip++; while (--t > 0);
}
#if !defined(LZO_UNALIGNED_OK_4)
}
else
#endif
#endif
#if !defined(LZO_UNALIGNED_OK_4)
{
*op++ = *ip++; *op++ = *ip++; *op++ = *ip++;
do *op++ = *ip++; while (--t > 0);
}
#endif
first_literal_run:
t = *ip++;
if (t >= 16)
goto match;
#if defined(COPY_DICT)
#if defined(LZO1Z)
m_off = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2);
last_m_off = m_off;
#else
m_off = (1 + M2_MAX_OFFSET) + (t >> 2) + (*ip++ << 2);
#endif
NEED_OP(3);
t = 3; COPY_DICT(t,m_off)
#else
#if defined(LZO1Z)
t = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2);
m_pos = op - t;
last_m_off = t;
#else
m_pos = op - (1 + M2_MAX_OFFSET);
m_pos -= t >> 2;
m_pos -= *ip++ << 2;
#endif
TEST_LOOKBEHIND(m_pos,out); NEED_OP(3);
*op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos;
#endif
goto match_done;
while (TEST_IP && TEST_OP)
{
match:
if (t >= 64)
{
#if defined(COPY_DICT)
#if defined(LZO1X)
m_off = 1 + ((t >> 2) & 7) + (*ip++ << 3);
t = (t >> 5) - 1;
#elif defined(LZO1Y)
m_off = 1 + ((t >> 2) & 3) + (*ip++ << 2);
t = (t >> 4) - 3;
#elif defined(LZO1Z)
m_off = t & 0x1f;
if (m_off >= 0x1c)
m_off = last_m_off;
else
{
m_off = 1 + (m_off << 6) + (*ip++ >> 2);
last_m_off = m_off;
}
t = (t >> 5) - 1;
#endif
#else
#if defined(LZO1X)
m_pos = op - 1;
m_pos -= (t >> 2) & 7;
m_pos -= *ip++ << 3;
t = (t >> 5) - 1;
#elif defined(LZO1Y)
m_pos = op - 1;
m_pos -= (t >> 2) & 3;
m_pos -= *ip++ << 2;
t = (t >> 4) - 3;
#elif defined(LZO1Z)
{
lzo_uint off = t & 0x1f;
m_pos = op;
if (off >= 0x1c)
{
assert(last_m_off > 0);
m_pos -= last_m_off;
}
else
{
off = 1 + (off << 6) + (*ip++ >> 2);
m_pos -= off;
last_m_off = off;
}
}
t = (t >> 5) - 1;
#endif
TEST_LOOKBEHIND(m_pos,out); assert(t > 0); NEED_OP(t+3-1);
goto copy_match;
#endif
}
else if (t >= 32)
{
t &= 31;
if (t == 0)
{
NEED_IP(1);
while (*ip == 0)
{
t += 255;
ip++;
NEED_IP(1);
}
t += 31 + *ip++;
}
#if defined(COPY_DICT)
#if defined(LZO1Z)
m_off = 1 + (ip[0] << 6) + (ip[1] >> 2);
last_m_off = m_off;
#else
m_off = 1 + (ip[0] >> 2) + (ip[1] << 6);
#endif
#else
#if defined(LZO1Z)
{
lzo_uint off = 1 + (ip[0] << 6) + (ip[1] >> 2);
m_pos = op - off;
last_m_off = off;
}
#elif defined(LZO_UNALIGNED_OK_2) && (LZO_BYTE_ORDER == LZO_LITTLE_ENDIAN)
m_pos = op - 1;
m_pos -= (* (const lzo_ushortp) ip) >> 2;
#else
m_pos = op - 1;
m_pos -= (ip[0] >> 2) + (ip[1] << 6);
#endif
#endif
ip += 2;
}
else if (t >= 16)
{
#if defined(COPY_DICT)
m_off = (t & 8) << 11;
#else
m_pos = op;
m_pos -= (t & 8) << 11;
#endif
t &= 7;
if (t == 0)
{
NEED_IP(1);
while (*ip == 0)
{
t += 255;
ip++;
NEED_IP(1);
}
t += 7 + *ip++;
}
#if defined(COPY_DICT)
#if defined(LZO1Z)
m_off += (ip[0] << 6) + (ip[1] >> 2);
#else
m_off += (ip[0] >> 2) + (ip[1] << 6);
#endif
ip += 2;
if (m_off == 0)
goto eof_found;
m_off += 0x4000;
#if defined(LZO1Z)
last_m_off = m_off;
#endif
#else
#if defined(LZO1Z)
m_pos -= (ip[0] << 6) + (ip[1] >> 2);
#elif defined(LZO_UNALIGNED_OK_2) && (LZO_BYTE_ORDER == LZO_LITTLE_ENDIAN)
m_pos -= (* (const lzo_ushortp) ip) >> 2;
#else
m_pos -= (ip[0] >> 2) + (ip[1] << 6);
#endif
ip += 2;
if (m_pos == op)
goto eof_found;
m_pos -= 0x4000;
#if defined(LZO1Z)
last_m_off = op - m_pos;
#endif
#endif
}
else
{
#if defined(COPY_DICT)
#if defined(LZO1Z)
m_off = 1 + (t << 6) + (*ip++ >> 2);
last_m_off = m_off;
#else
m_off = 1 + (t >> 2) + (*ip++ << 2);
#endif
NEED_OP(2);
t = 2; COPY_DICT(t,m_off)
#else
#if defined(LZO1Z)
t = 1 + (t << 6) + (*ip++ >> 2);
m_pos = op - t;
last_m_off = t;
#else
m_pos = op - 1;
m_pos -= t >> 2;
m_pos -= *ip++ << 2;
#endif
TEST_LOOKBEHIND(m_pos,out); NEED_OP(2);
*op++ = *m_pos++; *op++ = *m_pos;
#endif
goto match_done;
}
#if defined(COPY_DICT)
NEED_OP(t+3-1);
t += 3-1; COPY_DICT(t,m_off)
#else
TEST_LOOKBEHIND(m_pos,out); assert(t > 0); NEED_OP(t+3-1);
#if defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4)
#if !defined(LZO_UNALIGNED_OK_4)
if (t >= 2 * 4 - (3 - 1) && PTR_ALIGNED2_4(op,m_pos))
{
assert((op - m_pos) >= 4);
#else
if (t >= 2 * 4 - (3 - 1) && (op - m_pos) >= 4)
{
#endif
COPY4(op,m_pos);
op += 4; m_pos += 4; t -= 4 - (3 - 1);
do {
COPY4(op,m_pos);
op += 4; m_pos += 4; t -= 4;
} while (t >= 4);
if (t > 0) do *op++ = *m_pos++; while (--t > 0);
}
else
#endif
{
copy_match:
*op++ = *m_pos++; *op++ = *m_pos++;
do *op++ = *m_pos++; while (--t > 0);
}
#endif
match_done:
#if defined(LZO1Z)
t = ip[-1] & 3;
#else
t = ip[-2] & 3;
#endif
if (t == 0)
break;
match_next:
assert(t > 0); NEED_OP(t); NEED_IP(t+1);
do *op++ = *ip++; while (--t > 0);
t = *ip++;
}
}
#if defined(HAVE_TEST_IP) || defined(HAVE_TEST_OP)
*out_len = op - out;
return LZO_E_EOF_NOT_FOUND;
#endif
eof_found:
assert(t == 1);
*out_len = op - out;
return (ip == ip_end ? LZO_E_OK :
(ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN));
#if defined(HAVE_NEED_IP)
input_overrun:
*out_len = op - out;
return LZO_E_INPUT_OVERRUN;
#endif
#if defined(HAVE_NEED_OP)
output_overrun:
*out_len = op - out;
return LZO_E_OUTPUT_OVERRUN;
#endif
#if defined(LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND)
lookbehind_overrun:
*out_len = op - out;
return LZO_E_LOOKBEHIND_OVERRUN;
#endif
}
#define LZO_TEST_DECOMPRESS_OVERRUN
#undef DO_DECOMPRESS
#define DO_DECOMPRESS lzo1x_decompress_safe
#if defined(LZO_TEST_DECOMPRESS_OVERRUN)
# if !defined(LZO_TEST_DECOMPRESS_OVERRUN_INPUT)
# define LZO_TEST_DECOMPRESS_OVERRUN_INPUT 2
# endif
# if !defined(LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT)
# define LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT 2
# endif
# if !defined(LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND)
# define LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND
# endif
#endif
#undef TEST_IP
#undef TEST_OP
#undef TEST_LOOKBEHIND
#undef NEED_IP
#undef NEED_OP
#undef HAVE_TEST_IP
#undef HAVE_TEST_OP
#undef HAVE_NEED_IP
#undef HAVE_NEED_OP
#undef HAVE_ANY_IP
#undef HAVE_ANY_OP
#if defined(LZO_TEST_DECOMPRESS_OVERRUN_INPUT)
# if (LZO_TEST_DECOMPRESS_OVERRUN_INPUT >= 1)
# define TEST_IP (ip < ip_end)
# endif
# if (LZO_TEST_DECOMPRESS_OVERRUN_INPUT >= 2)
# define NEED_IP(x) \
if ((lzo_uint)(ip_end - ip) < (lzo_uint)(x)) goto input_overrun
# endif
#endif
#if defined(LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT)
# if (LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT >= 1)
# define TEST_OP (op <= op_end)
# endif
# if (LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT >= 2)
# undef TEST_OP
# define NEED_OP(x) \
if ((lzo_uint)(op_end - op) < (lzo_uint)(x)) goto output_overrun
# endif
#endif
#if defined(LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND)
# define TEST_LOOKBEHIND(m_pos,out) if (m_pos < out) goto lookbehind_overrun
#else
# define TEST_LOOKBEHIND(m_pos,op) ((void) 0)
#endif
#if !defined(LZO_EOF_CODE) && !defined(TEST_IP)
# define TEST_IP (ip < ip_end)
#endif
#if defined(TEST_IP)
# define HAVE_TEST_IP
#else
# define TEST_IP 1
#endif
#if defined(TEST_OP)
# define HAVE_TEST_OP
#else
# define TEST_OP 1
#endif
#if defined(NEED_IP)
# define HAVE_NEED_IP
#else
# define NEED_IP(x) ((void) 0)
#endif
#if defined(NEED_OP)
# define HAVE_NEED_OP
#else
# define NEED_OP(x) ((void) 0)
#endif
#if defined(HAVE_TEST_IP) || defined(HAVE_NEED_IP)
# define HAVE_ANY_IP
#endif
#if defined(HAVE_TEST_OP) || defined(HAVE_NEED_OP)
# define HAVE_ANY_OP
#endif
#undef __COPY4
#define __COPY4(dst,src) * (lzo_uint32p)(dst) = * (const lzo_uint32p)(src)
#undef COPY4
#if defined(LZO_UNALIGNED_OK_4)
# define COPY4(dst,src) __COPY4(dst,src)
#elif defined(LZO_ALIGNED_OK_4)
# define COPY4(dst,src) __COPY4((lzo_ptr_t)(dst),(lzo_ptr_t)(src))
#endif
#if defined(DO_DECOMPRESS)
LZO_PUBLIC(int)
DO_DECOMPRESS ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem )
#endif
{
register lzo_byte *op;
register const lzo_byte *ip;
register lzo_uint t;
#if defined(COPY_DICT)
lzo_uint m_off;
const lzo_byte *dict_end;
#else
register const lzo_byte *m_pos;
#endif
const lzo_byte * const ip_end = in + in_len;
#if defined(HAVE_ANY_OP)
lzo_byte * const op_end = out + *out_len;
#endif
#if defined(LZO1Z)
lzo_uint last_m_off = 0;
#endif
LZO_UNUSED(wrkmem);
#if defined(__LZO_QUERY_DECOMPRESS)
if (__LZO_IS_DECOMPRESS_QUERY(in,in_len,out,out_len,wrkmem))
return __LZO_QUERY_DECOMPRESS(in,in_len,out,out_len,wrkmem,0,0);
#endif
#if defined(COPY_DICT)
if (dict)
{
if (dict_len > M4_MAX_OFFSET)
{
dict += dict_len - M4_MAX_OFFSET;
dict_len = M4_MAX_OFFSET;
}
dict_end = dict + dict_len;
}
else
{
dict_len = 0;
dict_end = NULL;
}
#endif
*out_len = 0;
op = out;
ip = in;
if (*ip > 17)
{
t = *ip++ - 17;
if (t < 4)
goto match_next;
assert(t > 0); NEED_OP(t); NEED_IP(t+1);
do *op++ = *ip++; while (--t > 0);
goto first_literal_run;
}
while (TEST_IP && TEST_OP)
{
t = *ip++;
if (t >= 16)
goto match;
if (t == 0)
{
NEED_IP(1);
while (*ip == 0)
{
t += 255;
ip++;
NEED_IP(1);
}
t += 15 + *ip++;
}
assert(t > 0); NEED_OP(t+3); NEED_IP(t+4);
#if defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4)
#if !defined(LZO_UNALIGNED_OK_4)
if (PTR_ALIGNED2_4(op,ip))
{
#endif
COPY4(op,ip);
op += 4; ip += 4;
if (--t > 0)
{
if (t >= 4)
{
do {
COPY4(op,ip);
op += 4; ip += 4; t -= 4;
} while (t >= 4);
if (t > 0) do *op++ = *ip++; while (--t > 0);
}
else
do *op++ = *ip++; while (--t > 0);
}
#if !defined(LZO_UNALIGNED_OK_4)
}
else
#endif
#endif
#if !defined(LZO_UNALIGNED_OK_4)
{
*op++ = *ip++; *op++ = *ip++; *op++ = *ip++;
do *op++ = *ip++; while (--t > 0);
}
#endif
first_literal_run:
t = *ip++;
if (t >= 16)
goto match;
#if defined(COPY_DICT)
#if defined(LZO1Z)
m_off = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2);
last_m_off = m_off;
#else
m_off = (1 + M2_MAX_OFFSET) + (t >> 2) + (*ip++ << 2);
#endif
NEED_OP(3);
t = 3; COPY_DICT(t,m_off)
#else
#if defined(LZO1Z)
t = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2);
m_pos = op - t;
last_m_off = t;
#else
m_pos = op - (1 + M2_MAX_OFFSET);
m_pos -= t >> 2;
m_pos -= *ip++ << 2;
#endif
TEST_LOOKBEHIND(m_pos,out); NEED_OP(3);
*op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos;
#endif
goto match_done;
while (TEST_IP && TEST_OP)
{
match:
if (t >= 64)
{
#if defined(COPY_DICT)
#if defined(LZO1X)
m_off = 1 + ((t >> 2) & 7) + (*ip++ << 3);
t = (t >> 5) - 1;
#elif defined(LZO1Y)
m_off = 1 + ((t >> 2) & 3) + (*ip++ << 2);
t = (t >> 4) - 3;
#elif defined(LZO1Z)
m_off = t & 0x1f;
if (m_off >= 0x1c)
m_off = last_m_off;
else
{
m_off = 1 + (m_off << 6) + (*ip++ >> 2);
last_m_off = m_off;
}
t = (t >> 5) - 1;
#endif
#else
#if defined(LZO1X)
m_pos = op - 1;
m_pos -= (t >> 2) & 7;
m_pos -= *ip++ << 3;
t = (t >> 5) - 1;
#elif defined(LZO1Y)
m_pos = op - 1;
m_pos -= (t >> 2) & 3;
m_pos -= *ip++ << 2;
t = (t >> 4) - 3;
#elif defined(LZO1Z)
{
lzo_uint off = t & 0x1f;
m_pos = op;
if (off >= 0x1c)
{
assert(last_m_off > 0);
m_pos -= last_m_off;
}
else
{
off = 1 + (off << 6) + (*ip++ >> 2);
m_pos -= off;
last_m_off = off;
}
}
t = (t >> 5) - 1;
#endif
TEST_LOOKBEHIND(m_pos,out); assert(t > 0); NEED_OP(t+3-1);
goto copy_match;
#endif
}
else if (t >= 32)
{
t &= 31;
if (t == 0)
{
NEED_IP(1);
while (*ip == 0)
{
t += 255;
ip++;
NEED_IP(1);
}
t += 31 + *ip++;
}
#if defined(COPY_DICT)
#if defined(LZO1Z)
m_off = 1 + (ip[0] << 6) + (ip[1] >> 2);
last_m_off = m_off;
#else
m_off = 1 + (ip[0] >> 2) + (ip[1] << 6);
#endif
#else
#if defined(LZO1Z)
{
lzo_uint off = 1 + (ip[0] << 6) + (ip[1] >> 2);
m_pos = op - off;
last_m_off = off;
}
#elif defined(LZO_UNALIGNED_OK_2) && (LZO_BYTE_ORDER == LZO_LITTLE_ENDIAN)
m_pos = op - 1;
m_pos -= (* (const lzo_ushortp) ip) >> 2;
#else
m_pos = op - 1;
m_pos -= (ip[0] >> 2) + (ip[1] << 6);
#endif
#endif
ip += 2;
}
else if (t >= 16)
{
#if defined(COPY_DICT)
m_off = (t & 8) << 11;
#else
m_pos = op;
m_pos -= (t & 8) << 11;
#endif
t &= 7;
if (t == 0)
{
NEED_IP(1);
while (*ip == 0)
{
t += 255;
ip++;
NEED_IP(1);
}
t += 7 + *ip++;
}
#if defined(COPY_DICT)
#if defined(LZO1Z)
m_off += (ip[0] << 6) + (ip[1] >> 2);
#else
m_off += (ip[0] >> 2) + (ip[1] << 6);
#endif
ip += 2;
if (m_off == 0)
goto eof_found;
m_off += 0x4000;
#if defined(LZO1Z)
last_m_off = m_off;
#endif
#else
#if defined(LZO1Z)
m_pos -= (ip[0] << 6) + (ip[1] >> 2);
#elif defined(LZO_UNALIGNED_OK_2) && (LZO_BYTE_ORDER == LZO_LITTLE_ENDIAN)
m_pos -= (* (const lzo_ushortp) ip) >> 2;
#else
m_pos -= (ip[0] >> 2) + (ip[1] << 6);
#endif
ip += 2;
if (m_pos == op)
goto eof_found;
m_pos -= 0x4000;
#if defined(LZO1Z)
last_m_off = op - m_pos;
#endif
#endif
}
else
{
#if defined(COPY_DICT)
#if defined(LZO1Z)
m_off = 1 + (t << 6) + (*ip++ >> 2);
last_m_off = m_off;
#else
m_off = 1 + (t >> 2) + (*ip++ << 2);
#endif
NEED_OP(2);
t = 2; COPY_DICT(t,m_off)
#else
#if defined(LZO1Z)
t = 1 + (t << 6) + (*ip++ >> 2);
m_pos = op - t;
last_m_off = t;
#else
m_pos = op - 1;
m_pos -= t >> 2;
m_pos -= *ip++ << 2;
#endif
TEST_LOOKBEHIND(m_pos,out); NEED_OP(2);
*op++ = *m_pos++; *op++ = *m_pos;
#endif
goto match_done;
}
#if defined(COPY_DICT)
NEED_OP(t+3-1);
t += 3-1; COPY_DICT(t,m_off)
#else
TEST_LOOKBEHIND(m_pos,out); assert(t > 0); NEED_OP(t+3-1);
#if defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4)
#if !defined(LZO_UNALIGNED_OK_4)
if (t >= 2 * 4 - (3 - 1) && PTR_ALIGNED2_4(op,m_pos))
{
assert((op - m_pos) >= 4);
#else
if (t >= 2 * 4 - (3 - 1) && (op - m_pos) >= 4)
{
#endif
COPY4(op,m_pos);
op += 4; m_pos += 4; t -= 4 - (3 - 1);
do {
COPY4(op,m_pos);
op += 4; m_pos += 4; t -= 4;
} while (t >= 4);
if (t > 0) do *op++ = *m_pos++; while (--t > 0);
}
else
#endif
{
copy_match:
*op++ = *m_pos++; *op++ = *m_pos++;
do *op++ = *m_pos++; while (--t > 0);
}
#endif
match_done:
#if defined(LZO1Z)
t = ip[-1] & 3;
#else
t = ip[-2] & 3;
#endif
if (t == 0)
break;
match_next:
assert(t > 0); NEED_OP(t); NEED_IP(t+1);
do *op++ = *ip++; while (--t > 0);
t = *ip++;
}
}
#if defined(HAVE_TEST_IP) || defined(HAVE_TEST_OP)
*out_len = op - out;
return LZO_E_EOF_NOT_FOUND;
#endif
eof_found:
assert(t == 1);
*out_len = op - out;
return (ip == ip_end ? LZO_E_OK :
(ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN));
#if defined(HAVE_NEED_IP)
input_overrun:
*out_len = op - out;
return LZO_E_INPUT_OVERRUN;
#endif
#if defined(HAVE_NEED_OP)
output_overrun:
*out_len = op - out;
return LZO_E_OUTPUT_OVERRUN;
#endif
#if defined(LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND)
lookbehind_overrun:
*out_len = op - out;
return LZO_E_LOOKBEHIND_OVERRUN;
#endif
}
/***** End of minilzo.c *****/
|
Added work/contrib/lzo/lzo-1.08/minilzo/minilzo.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
/* minilzo.h -- mini subset of the LZO real-time data compression library
This file is part of the LZO real-time data compression library.
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/opensource/lzo/
*/
/*
* NOTE:
* the full LZO package can be found at
* http://www.oberhumer.com/opensource/lzo/
*/
#ifndef __MINILZO_H
#define __MINILZO_H
#define MINILZO_VERSION 0x1080
#ifdef __LZOCONF_H
# error "you cannot use both LZO and miniLZO"
#endif
#undef LZO_HAVE_CONFIG_H
#include "lzoconf.h"
#if !defined(LZO_VERSION) || (LZO_VERSION != MINILZO_VERSION)
# error "version mismatch in header files"
#endif
#ifdef __cplusplus
extern "C" {
#endif
/***********************************************************************
//
************************************************************************/
/* Memory required for the wrkmem parameter.
* When the required size is 0, you can also pass a NULL pointer.
*/
#define LZO1X_MEM_COMPRESS LZO1X_1_MEM_COMPRESS
#define LZO1X_1_MEM_COMPRESS ((lzo_uint32) (16384L * lzo_sizeof_dict_t))
#define LZO1X_MEM_DECOMPRESS (0)
/* compression */
LZO_EXTERN(int)
lzo1x_1_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
/* decompression */
LZO_EXTERN(int)
lzo1x_decompress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
/* safe decompression with overrun testing */
LZO_EXTERN(int)
lzo1x_decompress_safe ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* already included */
|
Added work/contrib/lzo/lzo-1.08/minilzo/testmini.
cannot compute difference between binary files
Added work/contrib/lzo/lzo-1.08/minilzo/testmini.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
|
/* testmini.c -- very simple test program for the miniLZO library
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include <stdio.h>
#include <stdlib.h>
/*************************************************************************
// This program shows the basic usage of the LZO library.
// We will compress a block of data and decompress again.
//
// For more information, documentation, example programs and other support
// files (like Makefiles and build scripts) please download the full LZO
// package from
// http://www.oberhumer.com/opensource/lzo/
**************************************************************************/
/* First let's include "minizo.h". */
#include "minilzo.h"
/* We want to compress the data block at `in' with length `IN_LEN' to
* the block at `out'. Because the input block may be incompressible,
* we must provide a little more output space in case that compression
* is not possible.
*/
#if defined(__LZO_STRICT_16BIT)
#define IN_LEN (8*1024)
#else
#define IN_LEN (128*1024L)
#endif
#define OUT_LEN (IN_LEN + IN_LEN / 64 + 16 + 3)
static lzo_byte in [ IN_LEN ];
static lzo_byte out [ OUT_LEN ];
/* Work-memory needed for compression. Allocate memory in units
* of `lzo_align_t' (instead of `char') to make sure it is properly aligned.
*/
#define HEAP_ALLOC(var,size) \
lzo_align_t __LZO_MMODEL var [ ((size) + (sizeof(lzo_align_t) - 1)) / sizeof(lzo_align_t) ]
static HEAP_ALLOC(wrkmem,LZO1X_1_MEM_COMPRESS);
/*************************************************************************
//
**************************************************************************/
int main(int argc, char *argv[])
{
int r;
lzo_uint in_len;
lzo_uint out_len;
lzo_uint new_len;
#if defined(__EMX__)
_response(&argc,&argv);
_wildcard(&argc,&argv);
#endif
if (argc < 0 && argv == NULL) /* avoid warning about unused args */
return 0;
printf("\nLZO real-time data compression library (v%s, %s).\n",
lzo_version_string(), lzo_version_date());
printf("Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer\n\n");
/*
* Step 1: initialize the LZO library
*/
if (lzo_init() != LZO_E_OK)
{
printf("lzo_init() failed !!!\n");
return 3;
}
/*
* Step 2: prepare the input block that will get compressed.
* We just fill it with zeros in this example program,
* but you would use your real-world data here.
*/
in_len = IN_LEN;
lzo_memset(in,0,in_len);
/*
* Step 3: compress from `in' to `out' with LZO1X-1
*/
r = lzo1x_1_compress(in,in_len,out,&out_len,wrkmem);
if (r == LZO_E_OK)
printf("compressed %lu bytes into %lu bytes\n",
(long) in_len, (long) out_len);
else
{
/* this should NEVER happen */
printf("internal error - compression failed: %d\n", r);
return 2;
}
/* check for an incompressible block */
if (out_len >= in_len)
{
printf("This block contains incompressible data.\n");
return 0;
}
/*
* Step 4: decompress again, now going from `out' to `in'
*/
r = lzo1x_decompress(out,out_len,in,&new_len,NULL);
if (r == LZO_E_OK && new_len == in_len)
printf("decompressed %lu bytes back into %lu bytes\n",
(long) out_len, (long) in_len);
else
{
/* this should NEVER happen */
printf("internal error - decompression failed: %d\n", r);
return 1;
}
printf("\nminiLZO simple compression test passed.\n");
return 0;
}
/*
vi:ts=4
*/
|
Added work/contrib/lzo/lzo-1.08/src/.deps/alloc.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
alloc.lo : \
alloc.c lzo_conf.h ../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h \
../include/lzoutil.h
alloc.c :
lzo_conf.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
../include/lzoutil.h :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/io.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
io.lo : \
io.c lzo_conf.h ../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h \
../include/lzoutil.h /usr/include/stdio.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h \
/usr/include/libio.h /usr/include/_G_config.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/stdio.h
io.c :
lzo_conf.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
../include/lzoutil.h :
/usr/include/stdio.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h :
/usr/include/libio.h :
/usr/include/_G_config.h :
/usr/include/bits/stdio_lim.h :
/usr/include/bits/stdio.h :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
lzo1.lo : \
lzo1.c ../include/lzo1.h ../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo_dict.h
lzo1.c :
../include/lzo1.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo_dict.h :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1_99.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
lzo1_99.lo : \
lzo1_99.c ../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h config1.h \
../include/lzo1.h config1a.h ../include/lzo1a.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1b_de.h lzo_dict.h stats1b.h lzo1b_cc.h lzo1b_c.ch lzo1b_sm.ch \
lzo1b_tm.ch lzo1b_cr.ch lzo1_cm.ch lzo1a_cm.ch
lzo1_99.c :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
config1.h :
../include/lzo1.h :
config1a.h :
../include/lzo1a.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1b_de.h :
lzo_dict.h :
stats1b.h :
lzo1b_cc.h :
lzo1b_c.ch :
lzo1b_sm.ch :
lzo1b_tm.ch :
lzo1b_cr.ch :
lzo1_cm.ch :
lzo1a_cm.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1a.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
lzo1a.lo : \
lzo1a.c ../include/lzo1a.h ../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo1a_de.h \
lzo_dict.h stats1a.h lzo_util.h lzo1a_cr.ch
lzo1a.c :
../include/lzo1a.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo1a_de.h :
lzo_dict.h :
stats1a.h :
lzo_util.h :
lzo1a_cr.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1a_99.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
lzo1a_99.lo : \
lzo1a_99.c ../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h config1a.h \
../include/lzo1a.h lzo_conf.h /usr/include/sys/types.h \
/usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1b_de.h lzo_dict.h stats1b.h lzo1b_cc.h lzo1b_c.ch lzo1b_sm.ch \
lzo1b_tm.ch lzo1b_cr.ch lzo1a_cm.ch
lzo1a_99.c :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
config1a.h :
../include/lzo1a.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1b_de.h :
lzo_dict.h :
stats1b.h :
lzo1b_cc.h :
lzo1b_c.ch :
lzo1b_sm.ch :
lzo1b_tm.ch :
lzo1b_cr.ch :
lzo1a_cm.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1b_1.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
lzo1b_1.lo : \
lzo1b_1.c compr1b.h config1b.h ../include/lzo1b.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1b_de.h lzo_dict.h stats1b.h lzo1b_cc.h lzo1b_c.ch lzo1b_sm.ch \
lzo1b_tm.ch lzo1b_cr.ch lzo1b_cm.ch
lzo1b_1.c :
compr1b.h :
config1b.h :
../include/lzo1b.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1b_de.h :
lzo_dict.h :
stats1b.h :
lzo1b_cc.h :
lzo1b_c.ch :
lzo1b_sm.ch :
lzo1b_tm.ch :
lzo1b_cr.ch :
lzo1b_cm.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1b_2.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
lzo1b_2.lo : \
lzo1b_2.c compr1b.h config1b.h ../include/lzo1b.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1b_de.h lzo_dict.h stats1b.h lzo1b_cc.h lzo1b_c.ch lzo1b_sm.ch \
lzo1b_tm.ch lzo1b_cr.ch lzo1b_cm.ch
lzo1b_2.c :
compr1b.h :
config1b.h :
../include/lzo1b.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1b_de.h :
lzo_dict.h :
stats1b.h :
lzo1b_cc.h :
lzo1b_c.ch :
lzo1b_sm.ch :
lzo1b_tm.ch :
lzo1b_cr.ch :
lzo1b_cm.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1b_3.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
lzo1b_3.lo : \
lzo1b_3.c compr1b.h config1b.h ../include/lzo1b.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1b_de.h lzo_dict.h stats1b.h lzo1b_cc.h lzo1b_c.ch lzo1b_sm.ch \
lzo1b_tm.ch lzo1b_cr.ch lzo1b_cm.ch
lzo1b_3.c :
compr1b.h :
config1b.h :
../include/lzo1b.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1b_de.h :
lzo_dict.h :
stats1b.h :
lzo1b_cc.h :
lzo1b_c.ch :
lzo1b_sm.ch :
lzo1b_tm.ch :
lzo1b_cr.ch :
lzo1b_cm.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1b_4.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
lzo1b_4.lo : \
lzo1b_4.c compr1b.h config1b.h ../include/lzo1b.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1b_de.h lzo_dict.h stats1b.h lzo1b_cc.h lzo1b_c.ch lzo1b_sm.ch \
lzo1b_tm.ch lzo1b_cr.ch lzo1b_cm.ch
lzo1b_4.c :
compr1b.h :
config1b.h :
../include/lzo1b.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1b_de.h :
lzo_dict.h :
stats1b.h :
lzo1b_cc.h :
lzo1b_c.ch :
lzo1b_sm.ch :
lzo1b_tm.ch :
lzo1b_cr.ch :
lzo1b_cm.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1b_5.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
lzo1b_5.lo : \
lzo1b_5.c compr1b.h config1b.h ../include/lzo1b.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1b_de.h lzo_dict.h stats1b.h lzo1b_cc.h lzo1b_c.ch lzo1b_sm.ch \
lzo1b_tm.ch lzo1b_cr.ch lzo1b_cm.ch
lzo1b_5.c :
compr1b.h :
config1b.h :
../include/lzo1b.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1b_de.h :
lzo_dict.h :
stats1b.h :
lzo1b_cc.h :
lzo1b_c.ch :
lzo1b_sm.ch :
lzo1b_tm.ch :
lzo1b_cr.ch :
lzo1b_cm.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1b_6.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
lzo1b_6.lo : \
lzo1b_6.c compr1b.h config1b.h ../include/lzo1b.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1b_de.h lzo_dict.h stats1b.h lzo1b_cc.h lzo1b_c.ch lzo1b_sm.ch \
lzo1b_tm.ch lzo1b_cr.ch lzo1b_cm.ch
lzo1b_6.c :
compr1b.h :
config1b.h :
../include/lzo1b.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1b_de.h :
lzo_dict.h :
stats1b.h :
lzo1b_cc.h :
lzo1b_c.ch :
lzo1b_sm.ch :
lzo1b_tm.ch :
lzo1b_cr.ch :
lzo1b_cm.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1b_7.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
lzo1b_7.lo : \
lzo1b_7.c compr1b.h config1b.h ../include/lzo1b.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1b_de.h lzo_dict.h stats1b.h lzo1b_cc.h lzo1b_c.ch lzo1b_sm.ch \
lzo1b_tm.ch lzo1b_cr.ch lzo1b_cm.ch
lzo1b_7.c :
compr1b.h :
config1b.h :
../include/lzo1b.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1b_de.h :
lzo_dict.h :
stats1b.h :
lzo1b_cc.h :
lzo1b_c.ch :
lzo1b_sm.ch :
lzo1b_tm.ch :
lzo1b_cr.ch :
lzo1b_cm.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1b_8.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
lzo1b_8.lo : \
lzo1b_8.c compr1b.h config1b.h ../include/lzo1b.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1b_de.h lzo_dict.h stats1b.h lzo1b_cc.h lzo1b_c.ch lzo1b_sm.ch \
lzo1b_tm.ch lzo1b_cr.ch lzo1b_cm.ch
lzo1b_8.c :
compr1b.h :
config1b.h :
../include/lzo1b.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1b_de.h :
lzo_dict.h :
stats1b.h :
lzo1b_cc.h :
lzo1b_c.ch :
lzo1b_sm.ch :
lzo1b_tm.ch :
lzo1b_cr.ch :
lzo1b_cm.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1b_9.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
lzo1b_9.lo : \
lzo1b_9.c compr1b.h config1b.h ../include/lzo1b.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1b_de.h lzo_dict.h stats1b.h lzo1b_cc.h lzo1b_c.ch lzo1b_sm.ch \
lzo1b_tm.ch lzo1b_cr.ch lzo1b_cm.ch
lzo1b_9.c :
compr1b.h :
config1b.h :
../include/lzo1b.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1b_de.h :
lzo_dict.h :
stats1b.h :
lzo1b_cc.h :
lzo1b_c.ch :
lzo1b_sm.ch :
lzo1b_tm.ch :
lzo1b_cr.ch :
lzo1b_cm.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1b_99.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
lzo1b_99.lo : \
lzo1b_99.c ../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h compr1b.h \
config1b.h ../include/lzo1b.h lzo_conf.h /usr/include/sys/types.h \
/usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1b_de.h lzo_dict.h stats1b.h lzo1b_cc.h lzo1b_c.ch lzo1b_sm.ch \
lzo1b_tm.ch lzo1b_cr.ch lzo1b_cm.ch
lzo1b_99.c :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
compr1b.h :
config1b.h :
../include/lzo1b.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1b_de.h :
lzo_dict.h :
stats1b.h :
lzo1b_cc.h :
lzo1b_c.ch :
lzo1b_sm.ch :
lzo1b_tm.ch :
lzo1b_cr.ch :
lzo1b_cm.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1b_9x.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
lzo1b_9x.lo : \
lzo1b_9x.c ../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h \
/usr/include/stdio.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h \
/usr/include/bits/types.h /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
/usr/include/bits/stdio.h config1b.h ../include/lzo1b.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/time.h /usr/include/endian.h \
/usr/include/bits/endian.h /usr/include/sys/select.h \
/usr/include/bits/select.h /usr/include/bits/sigset.h \
/usr/include/sys/sysmacros.h /usr/include/string.h \
/usr/include/bits/string.h /usr/include/bits/string2.h \
/usr/include/stdlib.h /usr/include/alloca.h /usr/include/assert.h \
lzo_ptr.h lzo_util.h lzo1b_de.h stats1b.h lzo1b_cc.h lzo_mchw.ch \
lzo_swd.ch
lzo1b_9x.c :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
/usr/include/stdio.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h :
/usr/include/bits/types.h :
/usr/include/libio.h :
/usr/include/_G_config.h :
/usr/include/bits/stdio_lim.h :
/usr/include/bits/stdio.h :
config1b.h :
../include/lzo1b.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1b_de.h :
stats1b.h :
lzo1b_cc.h :
lzo_mchw.ch :
lzo_swd.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1b_cc.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
lzo1b_cc.lo : \
lzo1b_cc.c config1b.h ../include/lzo1b.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1b_de.h lzo_dict.h stats1b.h lzo1b_cc.h
lzo1b_cc.c :
config1b.h :
../include/lzo1b.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1b_de.h :
lzo_dict.h :
stats1b.h :
lzo1b_cc.h :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1b_d1.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
lzo1b_d1.lo : \
lzo1b_d1.c config1b.h ../include/lzo1b.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1b_de.h stats1b.h lzo1b_cc.h lzo1b_d.ch lzo1_d.ch
lzo1b_d1.c :
config1b.h :
../include/lzo1b.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1b_de.h :
stats1b.h :
lzo1b_cc.h :
lzo1b_d.ch :
lzo1_d.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1b_d2.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
lzo1b_d2.lo : \
lzo1b_d2.c config1b.h ../include/lzo1b.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1b_de.h stats1b.h lzo1b_cc.h lzo1b_d.ch lzo1_d.ch
lzo1b_d2.c :
config1b.h :
../include/lzo1b.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1b_de.h :
stats1b.h :
lzo1b_cc.h :
lzo1b_d.ch :
lzo1_d.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1b_rr.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
lzo1b_rr.lo : \
lzo1b_rr.c config1b.h ../include/lzo1b.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1b_de.h stats1b.h lzo1b_cc.h lzo1b_r.ch
lzo1b_rr.c :
config1b.h :
../include/lzo1b.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1b_de.h :
stats1b.h :
lzo1b_cc.h :
lzo1b_r.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1b_xx.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
lzo1b_xx.lo : \
lzo1b_xx.c config1b.h ../include/lzo1b.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1b_de.h stats1b.h lzo1b_cc.h
lzo1b_xx.c :
config1b.h :
../include/lzo1b.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1b_de.h :
stats1b.h :
lzo1b_cc.h :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1c_1.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
lzo1c_1.lo : \
lzo1c_1.c compr1c.h config1c.h ../include/lzo1c.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1b_de.h lzo_dict.h stats1c.h stats1b.h lzo1c_cc.h lzo1b_c.ch \
lzo1b_sm.ch lzo1b_tm.ch lzo1b_cr.ch lzo1b_cm.ch
lzo1c_1.c :
compr1c.h :
config1c.h :
../include/lzo1c.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1b_de.h :
lzo_dict.h :
stats1c.h :
stats1b.h :
lzo1c_cc.h :
lzo1b_c.ch :
lzo1b_sm.ch :
lzo1b_tm.ch :
lzo1b_cr.ch :
lzo1b_cm.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1c_2.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
lzo1c_2.lo : \
lzo1c_2.c compr1c.h config1c.h ../include/lzo1c.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1b_de.h lzo_dict.h stats1c.h stats1b.h lzo1c_cc.h lzo1b_c.ch \
lzo1b_sm.ch lzo1b_tm.ch lzo1b_cr.ch lzo1b_cm.ch
lzo1c_2.c :
compr1c.h :
config1c.h :
../include/lzo1c.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1b_de.h :
lzo_dict.h :
stats1c.h :
stats1b.h :
lzo1c_cc.h :
lzo1b_c.ch :
lzo1b_sm.ch :
lzo1b_tm.ch :
lzo1b_cr.ch :
lzo1b_cm.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1c_3.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
lzo1c_3.lo : \
lzo1c_3.c compr1c.h config1c.h ../include/lzo1c.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1b_de.h lzo_dict.h stats1c.h stats1b.h lzo1c_cc.h lzo1b_c.ch \
lzo1b_sm.ch lzo1b_tm.ch lzo1b_cr.ch lzo1b_cm.ch
lzo1c_3.c :
compr1c.h :
config1c.h :
../include/lzo1c.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1b_de.h :
lzo_dict.h :
stats1c.h :
stats1b.h :
lzo1c_cc.h :
lzo1b_c.ch :
lzo1b_sm.ch :
lzo1b_tm.ch :
lzo1b_cr.ch :
lzo1b_cm.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1c_4.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
lzo1c_4.lo : \
lzo1c_4.c compr1c.h config1c.h ../include/lzo1c.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1b_de.h lzo_dict.h stats1c.h stats1b.h lzo1c_cc.h lzo1b_c.ch \
lzo1b_sm.ch lzo1b_tm.ch lzo1b_cr.ch lzo1b_cm.ch
lzo1c_4.c :
compr1c.h :
config1c.h :
../include/lzo1c.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1b_de.h :
lzo_dict.h :
stats1c.h :
stats1b.h :
lzo1c_cc.h :
lzo1b_c.ch :
lzo1b_sm.ch :
lzo1b_tm.ch :
lzo1b_cr.ch :
lzo1b_cm.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1c_5.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
lzo1c_5.lo : \
lzo1c_5.c compr1c.h config1c.h ../include/lzo1c.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1b_de.h lzo_dict.h stats1c.h stats1b.h lzo1c_cc.h lzo1b_c.ch \
lzo1b_sm.ch lzo1b_tm.ch lzo1b_cr.ch lzo1b_cm.ch
lzo1c_5.c :
compr1c.h :
config1c.h :
../include/lzo1c.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1b_de.h :
lzo_dict.h :
stats1c.h :
stats1b.h :
lzo1c_cc.h :
lzo1b_c.ch :
lzo1b_sm.ch :
lzo1b_tm.ch :
lzo1b_cr.ch :
lzo1b_cm.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1c_6.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
lzo1c_6.lo : \
lzo1c_6.c compr1c.h config1c.h ../include/lzo1c.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1b_de.h lzo_dict.h stats1c.h stats1b.h lzo1c_cc.h lzo1b_c.ch \
lzo1b_sm.ch lzo1b_tm.ch lzo1b_cr.ch lzo1b_cm.ch
lzo1c_6.c :
compr1c.h :
config1c.h :
../include/lzo1c.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1b_de.h :
lzo_dict.h :
stats1c.h :
stats1b.h :
lzo1c_cc.h :
lzo1b_c.ch :
lzo1b_sm.ch :
lzo1b_tm.ch :
lzo1b_cr.ch :
lzo1b_cm.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1c_7.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
lzo1c_7.lo : \
lzo1c_7.c compr1c.h config1c.h ../include/lzo1c.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1b_de.h lzo_dict.h stats1c.h stats1b.h lzo1c_cc.h lzo1b_c.ch \
lzo1b_sm.ch lzo1b_tm.ch lzo1b_cr.ch lzo1b_cm.ch
lzo1c_7.c :
compr1c.h :
config1c.h :
../include/lzo1c.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1b_de.h :
lzo_dict.h :
stats1c.h :
stats1b.h :
lzo1c_cc.h :
lzo1b_c.ch :
lzo1b_sm.ch :
lzo1b_tm.ch :
lzo1b_cr.ch :
lzo1b_cm.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1c_8.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
lzo1c_8.lo : \
lzo1c_8.c compr1c.h config1c.h ../include/lzo1c.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1b_de.h lzo_dict.h stats1c.h stats1b.h lzo1c_cc.h lzo1b_c.ch \
lzo1b_sm.ch lzo1b_tm.ch lzo1b_cr.ch lzo1b_cm.ch
lzo1c_8.c :
compr1c.h :
config1c.h :
../include/lzo1c.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1b_de.h :
lzo_dict.h :
stats1c.h :
stats1b.h :
lzo1c_cc.h :
lzo1b_c.ch :
lzo1b_sm.ch :
lzo1b_tm.ch :
lzo1b_cr.ch :
lzo1b_cm.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1c_9.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
lzo1c_9.lo : \
lzo1c_9.c compr1c.h config1c.h ../include/lzo1c.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1b_de.h lzo_dict.h stats1c.h stats1b.h lzo1c_cc.h lzo1b_c.ch \
lzo1b_sm.ch lzo1b_tm.ch lzo1b_cr.ch lzo1b_cm.ch
lzo1c_9.c :
compr1c.h :
config1c.h :
../include/lzo1c.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1b_de.h :
lzo_dict.h :
stats1c.h :
stats1b.h :
lzo1c_cc.h :
lzo1b_c.ch :
lzo1b_sm.ch :
lzo1b_tm.ch :
lzo1b_cr.ch :
lzo1b_cm.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1c_99.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
lzo1c_99.lo : \
lzo1c_99.c ../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h compr1c.h \
config1c.h ../include/lzo1c.h lzo_conf.h /usr/include/sys/types.h \
/usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1b_de.h lzo_dict.h stats1c.h stats1b.h lzo1c_cc.h lzo1b_c.ch \
lzo1b_sm.ch lzo1b_tm.ch lzo1b_cr.ch lzo1b_cm.ch
lzo1c_99.c :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
compr1c.h :
config1c.h :
../include/lzo1c.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1b_de.h :
lzo_dict.h :
stats1c.h :
stats1b.h :
lzo1c_cc.h :
lzo1b_c.ch :
lzo1b_sm.ch :
lzo1b_tm.ch :
lzo1b_cr.ch :
lzo1b_cm.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1c_9x.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
lzo1c_9x.lo : \
lzo1c_9x.c ../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h \
/usr/include/stdio.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h \
/usr/include/bits/types.h /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
/usr/include/bits/stdio.h config1c.h ../include/lzo1c.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/time.h /usr/include/endian.h \
/usr/include/bits/endian.h /usr/include/sys/select.h \
/usr/include/bits/select.h /usr/include/bits/sigset.h \
/usr/include/sys/sysmacros.h /usr/include/string.h \
/usr/include/bits/string.h /usr/include/bits/string2.h \
/usr/include/stdlib.h /usr/include/alloca.h /usr/include/assert.h \
lzo_ptr.h lzo_util.h lzo1b_de.h stats1c.h stats1b.h lzo1c_cc.h \
lzo_mchw.ch lzo_swd.ch
lzo1c_9x.c :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
/usr/include/stdio.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h :
/usr/include/bits/types.h :
/usr/include/libio.h :
/usr/include/_G_config.h :
/usr/include/bits/stdio_lim.h :
/usr/include/bits/stdio.h :
config1c.h :
../include/lzo1c.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1b_de.h :
stats1c.h :
stats1b.h :
lzo1c_cc.h :
lzo_mchw.ch :
lzo_swd.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1c_cc.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
lzo1c_cc.lo : \
lzo1c_cc.c config1c.h ../include/lzo1c.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1b_de.h lzo_dict.h stats1c.h stats1b.h lzo1c_cc.h
lzo1c_cc.c :
config1c.h :
../include/lzo1c.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1b_de.h :
lzo_dict.h :
stats1c.h :
stats1b.h :
lzo1c_cc.h :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1c_d1.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
lzo1c_d1.lo : \
lzo1c_d1.c config1c.h ../include/lzo1c.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1b_de.h stats1c.h stats1b.h lzo1c_cc.h lzo1b_d.ch lzo1_d.ch
lzo1c_d1.c :
config1c.h :
../include/lzo1c.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1b_de.h :
stats1c.h :
stats1b.h :
lzo1c_cc.h :
lzo1b_d.ch :
lzo1_d.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1c_d2.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
lzo1c_d2.lo : \
lzo1c_d2.c config1c.h ../include/lzo1c.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1b_de.h stats1c.h stats1b.h lzo1c_cc.h lzo1b_d.ch lzo1_d.ch
lzo1c_d2.c :
config1c.h :
../include/lzo1c.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1b_de.h :
stats1c.h :
stats1b.h :
lzo1c_cc.h :
lzo1b_d.ch :
lzo1_d.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1c_rr.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
lzo1c_rr.lo : \
lzo1c_rr.c config1c.h ../include/lzo1c.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1b_de.h stats1c.h stats1b.h lzo1c_cc.h lzo1b_r.ch
lzo1c_rr.c :
config1c.h :
../include/lzo1c.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1b_de.h :
stats1c.h :
stats1b.h :
lzo1c_cc.h :
lzo1b_r.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1c_xx.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
lzo1c_xx.lo : \
lzo1c_xx.c config1c.h ../include/lzo1c.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1b_de.h stats1c.h stats1b.h lzo1c_cc.h
lzo1c_xx.c :
config1c.h :
../include/lzo1c.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1b_de.h :
stats1c.h :
stats1b.h :
lzo1c_cc.h :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1f_1.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
lzo1f_1.lo : \
lzo1f_1.c ../include/lzo1f.h ../include/lzoconf.h \
../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_dict.h
lzo1f_1.c :
../include/lzo1f.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_dict.h :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1f_9x.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
lzo1f_9x.lo : \
lzo1f_9x.c ../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h \
/usr/include/stdio.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h \
/usr/include/bits/types.h /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
/usr/include/bits/stdio.h config1f.h ../include/lzo1f.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/time.h /usr/include/endian.h \
/usr/include/bits/endian.h /usr/include/sys/select.h \
/usr/include/bits/select.h /usr/include/bits/sigset.h \
/usr/include/sys/sysmacros.h /usr/include/string.h \
/usr/include/bits/string.h /usr/include/bits/string2.h \
/usr/include/stdlib.h /usr/include/alloca.h /usr/include/assert.h \
lzo_ptr.h lzo_util.h lzo_mchw.ch lzo_swd.ch
lzo1f_9x.c :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
/usr/include/stdio.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h :
/usr/include/bits/types.h :
/usr/include/libio.h :
/usr/include/_G_config.h :
/usr/include/bits/stdio_lim.h :
/usr/include/bits/stdio.h :
config1f.h :
../include/lzo1f.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo_mchw.ch :
lzo_swd.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1f_d1.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
lzo1f_d1.lo : \
lzo1f_d1.c config1f.h ../include/lzo1f.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1f_d.ch lzo1_d.ch
lzo1f_d1.c :
config1f.h :
../include/lzo1f.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1f_d.ch :
lzo1_d.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1f_d2.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
lzo1f_d2.lo : \
lzo1f_d2.c config1f.h ../include/lzo1f.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1f_d.ch lzo1_d.ch
lzo1f_d2.c :
config1f.h :
../include/lzo1f.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1f_d.ch :
lzo1_d.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1x_1.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
lzo1x_1.lo : \
lzo1x_1.c config1x.h ../include/lzo1x.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo_dict.h lzo1x_c.ch
lzo1x_1.c :
config1x.h :
../include/lzo1x.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo_dict.h :
lzo1x_c.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1x_1k.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
lzo1x_1k.lo : \
lzo1x_1k.c config1x.h ../include/lzo1x.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo_dict.h lzo1x_c.ch
lzo1x_1k.c :
config1x.h :
../include/lzo1x.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo_dict.h :
lzo1x_c.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1x_1l.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
lzo1x_1l.lo : \
lzo1x_1l.c config1x.h ../include/lzo1x.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo_dict.h lzo1x_c.ch
lzo1x_1l.c :
config1x.h :
../include/lzo1x.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo_dict.h :
lzo1x_c.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1x_1o.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
lzo1x_1o.lo : \
lzo1x_1o.c config1x.h ../include/lzo1x.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo_dict.h lzo1x_c.ch
lzo1x_1o.c :
config1x.h :
../include/lzo1x.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo_dict.h :
lzo1x_c.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1x_9x.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
lzo1x_9x.lo : \
lzo1x_9x.c ../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h \
/usr/include/stdio.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h \
/usr/include/bits/types.h /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
/usr/include/bits/stdio.h config1x.h ../include/lzo1x.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/time.h /usr/include/endian.h \
/usr/include/bits/endian.h /usr/include/sys/select.h \
/usr/include/bits/select.h /usr/include/bits/sigset.h \
/usr/include/sys/sysmacros.h /usr/include/string.h \
/usr/include/bits/string.h /usr/include/bits/string2.h \
/usr/include/stdlib.h /usr/include/alloca.h /usr/include/assert.h \
lzo_ptr.h lzo_util.h lzo_mchw.ch lzo_swd.ch
lzo1x_9x.c :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
/usr/include/stdio.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h :
/usr/include/bits/types.h :
/usr/include/libio.h :
/usr/include/_G_config.h :
/usr/include/bits/stdio_lim.h :
/usr/include/bits/stdio.h :
config1x.h :
../include/lzo1x.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo_mchw.ch :
lzo_swd.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1x_d1.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
lzo1x_d1.lo : \
lzo1x_d1.c config1x.h ../include/lzo1x.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1x_d.ch lzo1_d.ch
lzo1x_d1.c :
config1x.h :
../include/lzo1x.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1x_d.ch :
lzo1_d.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1x_d2.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
lzo1x_d2.lo : \
lzo1x_d2.c config1x.h ../include/lzo1x.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1x_d.ch lzo1_d.ch
lzo1x_d2.c :
config1x.h :
../include/lzo1x.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1x_d.ch :
lzo1_d.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1x_d3.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
lzo1x_d3.lo : \
lzo1x_d3.c config1x.h ../include/lzo1x.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1x_d.ch lzo1_d.ch
lzo1x_d3.c :
config1x.h :
../include/lzo1x.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1x_d.ch :
lzo1_d.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1x_o.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
lzo1x_o.lo : \
lzo1x_o.c config1x.h ../include/lzo1x.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1x_oo.ch /usr/include/stdio.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h \
/usr/include/libio.h /usr/include/_G_config.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/stdio.h
lzo1x_o.c :
config1x.h :
../include/lzo1x.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1x_oo.ch :
/usr/include/stdio.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h :
/usr/include/libio.h :
/usr/include/_G_config.h :
/usr/include/bits/stdio_lim.h :
/usr/include/bits/stdio.h :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1y_1.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
lzo1y_1.lo : \
lzo1y_1.c config1y.h ../include/lzo1y.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h config1x.h \
../include/lzo1x.h lzo_conf.h /usr/include/sys/types.h \
/usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo_dict.h lzo1x_c.ch
lzo1y_1.c :
config1y.h :
../include/lzo1y.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
config1x.h :
../include/lzo1x.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo_dict.h :
lzo1x_c.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1y_9x.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
lzo1y_9x.lo : \
lzo1y_9x.c lzo1x_9x.c ../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h \
/usr/include/stdio.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h \
/usr/include/bits/types.h /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
/usr/include/bits/stdio.h config1y.h ../include/lzo1y.h config1x.h \
../include/lzo1x.h lzo_conf.h /usr/include/sys/types.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo_mchw.ch lzo_swd.ch
lzo1y_9x.c :
lzo1x_9x.c :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
/usr/include/stdio.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h :
/usr/include/bits/types.h :
/usr/include/libio.h :
/usr/include/_G_config.h :
/usr/include/bits/stdio_lim.h :
/usr/include/bits/stdio.h :
config1y.h :
../include/lzo1y.h :
config1x.h :
../include/lzo1x.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo_mchw.ch :
lzo_swd.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1y_d1.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
lzo1y_d1.lo : \
lzo1y_d1.c config1y.h ../include/lzo1y.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h config1x.h \
../include/lzo1x.h lzo_conf.h /usr/include/sys/types.h \
/usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1x_d.ch lzo1_d.ch
lzo1y_d1.c :
config1y.h :
../include/lzo1y.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
config1x.h :
../include/lzo1x.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1x_d.ch :
lzo1_d.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1y_d2.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
lzo1y_d2.lo : \
lzo1y_d2.c config1y.h ../include/lzo1y.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h config1x.h \
../include/lzo1x.h lzo_conf.h /usr/include/sys/types.h \
/usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1x_d.ch lzo1_d.ch
lzo1y_d2.c :
config1y.h :
../include/lzo1y.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
config1x.h :
../include/lzo1x.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1x_d.ch :
lzo1_d.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1y_d3.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
lzo1y_d3.lo : \
lzo1y_d3.c config1y.h ../include/lzo1y.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h config1x.h \
../include/lzo1x.h lzo_conf.h /usr/include/sys/types.h \
/usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1x_d3.c lzo1x_d.ch lzo1_d.ch
lzo1y_d3.c :
config1y.h :
../include/lzo1y.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
config1x.h :
../include/lzo1x.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1x_d3.c :
lzo1x_d.ch :
lzo1_d.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1y_o.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
lzo1y_o.lo : \
lzo1y_o.c config1y.h ../include/lzo1y.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h config1x.h \
../include/lzo1x.h lzo_conf.h /usr/include/sys/types.h \
/usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1x_oo.ch /usr/include/stdio.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h \
/usr/include/libio.h /usr/include/_G_config.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/stdio.h
lzo1y_o.c :
config1y.h :
../include/lzo1y.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
config1x.h :
../include/lzo1x.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1x_oo.ch :
/usr/include/stdio.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h :
/usr/include/libio.h :
/usr/include/_G_config.h :
/usr/include/bits/stdio_lim.h :
/usr/include/bits/stdio.h :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1z_9x.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
lzo1z_9x.lo : \
lzo1z_9x.c lzo1x_9x.c ../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h \
/usr/include/stdio.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h \
/usr/include/bits/types.h /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
/usr/include/bits/stdio.h config1z.h ../include/lzo1z.h config1x.h \
../include/lzo1x.h lzo_conf.h /usr/include/sys/types.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo_mchw.ch lzo_swd.ch
lzo1z_9x.c :
lzo1x_9x.c :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
/usr/include/stdio.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h :
/usr/include/bits/types.h :
/usr/include/libio.h :
/usr/include/_G_config.h :
/usr/include/bits/stdio_lim.h :
/usr/include/bits/stdio.h :
config1z.h :
../include/lzo1z.h :
config1x.h :
../include/lzo1x.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo_mchw.ch :
lzo_swd.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1z_d1.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
lzo1z_d1.lo : \
lzo1z_d1.c config1z.h ../include/lzo1z.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h config1x.h \
../include/lzo1x.h lzo_conf.h /usr/include/sys/types.h \
/usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1x_d.ch lzo1_d.ch
lzo1z_d1.c :
config1z.h :
../include/lzo1z.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
config1x.h :
../include/lzo1x.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1x_d.ch :
lzo1_d.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1z_d2.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
lzo1z_d2.lo : \
lzo1z_d2.c config1z.h ../include/lzo1z.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h config1x.h \
../include/lzo1x.h lzo_conf.h /usr/include/sys/types.h \
/usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1x_d.ch lzo1_d.ch
lzo1z_d2.c :
config1z.h :
../include/lzo1z.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
config1x.h :
../include/lzo1x.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1x_d.ch :
lzo1_d.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo1z_d3.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
lzo1z_d3.lo : \
lzo1z_d3.c config1z.h ../include/lzo1z.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h config1x.h \
../include/lzo1x.h lzo_conf.h /usr/include/sys/types.h \
/usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo1x_d3.c lzo1x_d.ch lzo1_d.ch
lzo1z_d3.c :
config1z.h :
../include/lzo1z.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
config1x.h :
../include/lzo1x.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo1x_d3.c :
lzo1x_d.ch :
lzo1_d.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo2a_9x.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
lzo2a_9x.lo : \
lzo2a_9x.c ../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h \
/usr/include/stdio.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h \
/usr/include/bits/types.h /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
/usr/include/bits/stdio.h config2a.h ../include/lzo2a.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/time.h /usr/include/endian.h \
/usr/include/bits/endian.h /usr/include/sys/select.h \
/usr/include/bits/select.h /usr/include/bits/sigset.h \
/usr/include/sys/sysmacros.h /usr/include/string.h \
/usr/include/bits/string.h /usr/include/bits/string2.h \
/usr/include/stdlib.h /usr/include/alloca.h /usr/include/assert.h \
lzo_ptr.h lzo_util.h lzo_mchw.ch lzo_swd.ch
lzo2a_9x.c :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
/usr/include/stdio.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h :
/usr/include/bits/types.h :
/usr/include/libio.h :
/usr/include/_G_config.h :
/usr/include/bits/stdio_lim.h :
/usr/include/bits/stdio.h :
config2a.h :
../include/lzo2a.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo_mchw.ch :
lzo_swd.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo2a_d1.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
lzo2a_d1.lo : \
lzo2a_d1.c config2a.h ../include/lzo2a.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo2a_d.ch lzo1_d.ch
lzo2a_d1.c :
config2a.h :
../include/lzo2a.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo2a_d.ch :
lzo1_d.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo2a_d2.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
lzo2a_d2.lo : \
lzo2a_d2.c config2a.h ../include/lzo2a.h \
../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h lzo_conf.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h \
lzo2a_d.ch lzo1_d.ch
lzo2a_d2.c :
config2a.h :
../include/lzo2a.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
lzo2a_d.ch :
lzo1_d.ch :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo_crc.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
lzo_crc.lo : \
lzo_crc.c lzo_conf.h ../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h
lzo_crc.c :
lzo_conf.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo_dll.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
lzo_dll.lo : \
lzo_dll.c lzo_conf.h ../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h
lzo_dll.c :
lzo_conf.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo_init.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
lzo_init.lo : \
lzo_init.c lzo_conf.h ../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h
lzo_init.c :
lzo_conf.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo_ptr.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
lzo_ptr.lo : \
lzo_ptr.c lzo_conf.h ../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h
lzo_ptr.c :
lzo_conf.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo_str.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
lzo_str.lo : \
lzo_str.c lzo_conf.h ../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h
lzo_str.c :
lzo_conf.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
|
Added work/contrib/lzo/lzo-1.08/src/.deps/lzo_util.Plo.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
lzo_util.lo : \
lzo_util.c lzo_conf.h ../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h lzo_ptr.h lzo_util.h
lzo_util.c :
lzo_conf.h :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
lzo_ptr.h :
lzo_util.h :
|
Added work/contrib/lzo/lzo-1.08/src/.libs/liblzo.a.
cannot compute difference between binary files
Added work/contrib/lzo/lzo-1.08/src/.libs/liblzo.lai.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# liblzo.la - a libtool library file
# Generated by ltmain.sh - GNU libtool 1.4.2a (1.922.2.93 2002/05/06 15:02:58)
#
# Please DO NOT delete this file!
# It is necessary for linking the library.
# The name that we can dlopen(3).
dlname='liblzo.so.1'
# Names of this library.
library_names='liblzo.so.1.0.0 liblzo.so.1 liblzo.so'
# The name of the static archive.
old_library='liblzo.a'
# Libraries that this one depends upon.
dependency_libs=''
# Version information for liblzo.
current=1
age=0
revision=0
# Is this an already installed library?
installed=yes
# Files to dlopen/dlpreopen
dlopen=''
dlpreopen=''
# Directory that this library needs to be installed in:
libdir='/usr/local/lib'
|
Added work/contrib/lzo/lzo-1.08/src/.libs/liblzo.so.1.0.0.
cannot compute difference between binary files
Added work/contrib/lzo/lzo-1.08/src/Makefile.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
|
# Makefile.in generated by automake 1.6.2 from Makefile.am.
# src/Makefile. Generated from Makefile.in by configure.
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
#
# Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
#
SHELL = /bin/sh
srcdir = .
top_srcdir = ..
prefix = /usr/local
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
sbindir = ${exec_prefix}/sbin
libexecdir = ${exec_prefix}/libexec
datadir = ${prefix}/share
sysconfdir = ${prefix}/etc
sharedstatedir = ${prefix}/com
localstatedir = ${prefix}/var
libdir = ${exec_prefix}/lib
infodir = ${prefix}/info
mandir = ${prefix}/man
includedir = ${prefix}/include
oldincludedir = /usr/include
pkgdatadir = $(datadir)/lzo
pkglibdir = $(libdir)/lzo
pkgincludedir = $(includedir)/lzo
top_builddir = ..
ACLOCAL = ${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run aclocal-1.6
AUTOCONF = ${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run autoconf
AUTOMAKE = ${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run automake-1.6
AUTOHEADER = ${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run autoheader
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = /usr/bin/ginstall -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_SCRIPT = ${INSTALL}
INSTALL_HEADER = $(INSTALL_DATA)
transform = s,x,x,
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
host_alias =
host_triplet = i586-pc-linux-gnu
EXEEXT =
OBJEXT = o
PATH_SEPARATOR = :
VPATH = ./i386/src
AMTAR = ${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run tar
AS = @AS@
ASFLAGS = -x assembler-with-cpp
AWK = gawk
CC = gcc
CFLAGS_GCC_OMIT_FRAME_POINTER = -fomit-frame-pointer
CFLAGS_O =
CFLAGS_W =
CFLAGS_W_PEDANTIC =
CLEANFILES = *.bb *.bbg *.da *.gcov bb.out bbtrace* gmon.out
CPP = gcc -E
DEPDIR = .deps
DLLTOOL = @DLLTOOL@
ECHO = echo
INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
LIBTOOL = $(SHELL) $(top_builddir)/libtool
LN_S = ln -s
LZO_ASM_OBJECTS = $(LZO_ASM_OBJECTS_GCC_i386)
LZO_CFLAGS =
MAINT = #
MFX_ARCH = i386
MFX_CC = GCC
MFX_CPU = i586
MOSTLYCLEANFILES = *.i
NASM =
OBJDUMP = @OBJDUMP@
PACKAGE = lzo
RANLIB = ranlib
SRC_VPATH = /i386/src
STRIP = strip
VERSION = 1.08
am__include = include
am__quote =
install_sh = /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/install-sh
liblzo = $(top_builddir)/src/liblzo.la
ltest_LIBS =
AUTOMAKE_OPTIONS = 1.6
# /***********************************************************************
# // compiler and architecture specific CFLAGS
# ************************************************************************/
LZO_CFLAGS_GCC =
LZO_CFLAGS_GCC_O =
LZO_CFLAGS_GCC_W = \
-Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
-Wno-uninitialized
LZO_CFLAGS_GCC_i386 =
LZO_CFLAGS_GCC_i386_O = $(CFLAGS_GCC_OMIT_FRAME_POINTER) # -fforce-addr
LZO_CFLAGS_GCC_i386_W =
L_CFLAGS = $(LZO_CFLAGS_GCC) $(LZO_CFLAGS_GCC_i386)
L_CFLAGS_O = $(LZO_CFLAGS_GCC_O) $(LZO_CFLAGS_GCC_i386_O)
L_CFLAGS_W = $(LZO_CFLAGS_GCC_W) $(LZO_CFLAGS_GCC_i386_W)
# /***********************************************************************
# //
# ************************************************************************/
### LZO_DEBUG = -DLZO_DEBUG
### LZO_DEBUG = -DLZO_DEBUG -Wno-error
### LZO_DEBUG = -DLZO_DEBUG -g -fno-omit-frame-pointer -Wno-error
### LZO_EXTRA_CFLAGS = -fbranch-probabilities -Wno-error
### LZO_EXTRA_CFLAGS = -fprofile-arcs -ftest-coverage -O0
INCLUDES = -I$(top_srcdir)/include
ALL_CFLAGS = $(L_CFLAGS) $(CFLAGS_O) $(L_CFLAGS_O) $(CFLAGS_W) $(L_CFLAGS_W) $(CFLAGS_W_PEDANTIC) $(LZO_CFLAGS) $(LZO_EXTRA_CFLAGS) $(LZO_DEBUG)
CFLAGS = -O2 -Wall -Wcast-align -Wcast-qual -Wwrite-strings -fno-strength-reduce -fstrict-aliasing -DLZO_BUILD $(ALL_CFLAGS)
CXXFLAGS = @CXXFLAGS@ -DLZO_BUILD $(ALL_CFLAGS)
# /***********************************************************************
# // assembler support
# ************************************************************************/
SUFFIXES = .asm .c .i .s .sh
COMPILE_S = $(CC) $(ASFLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) $(LZO_DEBUG)
COMPILE_ASM = $(NASM) -f elf
# /***********************************************************************
# // library files
# ************************************************************************/
lib_LTLIBRARIES = liblzo.la
liblzo_la_LDFLAGS = -version-info 1:0:0
liblzo_la_SOURCES = \
alloc.c io.c lzo_crc.c lzo_dll.c lzo_init.c lzo_ptr.c lzo_str.c lzo_util.c \
lzo1.c lzo1_99.c \
lzo1a.c lzo1a_99.c \
lzo1b_1.c lzo1b_2.c lzo1b_3.c lzo1b_4.c lzo1b_5.c lzo1b_6.c \
lzo1b_7.c lzo1b_8.c lzo1b_9.c lzo1b_99.c lzo1b_9x.c \
lzo1b_cc.c lzo1b_d1.c lzo1b_d2.c lzo1b_rr.c lzo1b_xx.c \
lzo1c_1.c lzo1c_2.c lzo1c_3.c lzo1c_4.c lzo1c_5.c lzo1c_6.c \
lzo1c_7.c lzo1c_8.c lzo1c_9.c lzo1c_99.c lzo1c_9x.c \
lzo1c_cc.c lzo1c_d1.c lzo1c_d2.c lzo1c_rr.c lzo1c_xx.c \
lzo1f_1.c lzo1f_9x.c lzo1f_d1.c lzo1f_d2.c \
lzo1x_1.c lzo1x_9x.c lzo1x_d1.c lzo1x_d2.c lzo1x_d3.c \
lzo1x_o.c lzo1x_1k.c lzo1x_1l.c lzo1x_1o.c \
lzo1y_1.c lzo1y_9x.c lzo1y_d1.c lzo1y_d2.c lzo1y_d3.c lzo1y_o.c \
lzo1z_9x.c lzo1z_d1.c lzo1z_d2.c lzo1z_d3.c \
lzo2a_9x.c lzo2a_d1.c lzo2a_d2.c \
lzo1_cm.ch lzo1_d.ch lzo1a_cm.ch lzo1a_cr.ch lzo1b_c.ch \
lzo1b_cm.ch lzo1b_cr.ch lzo1b_d.ch lzo1b_r.ch \
lzo1b_sm.ch lzo1b_tm.ch lzo1f_d.ch lzo1x_c.ch \
lzo1x_d.ch lzo1x_oo.ch lzo2a_d.ch lzo_mchw.ch lzo_swd.ch \
compr1b.h compr1c.h config1.h config1a.h config1b.h config1c.h \
config1f.h config1x.h config1y.h config1z.h config2a.h fake16.h \
lzo1a_de.h lzo1b_cc.h lzo1b_de.h lzo1c_cc.h lzo_conf.h lzo_dict.h \
lzo_ptr.h lzo_util.h stats1a.h stats1b.h stats1c.h
LZO_ASM_OBJECTS_GCC_i386 = \
lzo1c_s1.lo lzo1c_s2.lo \
lzo1f_f1.lo lzo1f_f2.lo \
lzo1x_f1.lo lzo1x_f2.lo lzo1x_s1.lo lzo1x_s2.lo \
lzo1y_f1.lo lzo1y_f2.lo lzo1y_s1.lo lzo1y_s2.lo
liblzo_la_LIBADD = $(LZO_ASM_OBJECTS)
liblzo_la_DEPENDENCIES = $(liblzo_la_LIBADD)
subdir = src
mkinstalldirs = $(SHELL) $(top_srcdir)/acconfig/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
LTLIBRARIES = $(lib_LTLIBRARIES)
am_liblzo_la_OBJECTS = alloc.lo io.lo lzo_crc.lo lzo_dll.lo lzo_init.lo \
lzo_ptr.lo lzo_str.lo lzo_util.lo lzo1.lo lzo1_99.lo lzo1a.lo \
lzo1a_99.lo lzo1b_1.lo lzo1b_2.lo lzo1b_3.lo lzo1b_4.lo \
lzo1b_5.lo lzo1b_6.lo lzo1b_7.lo lzo1b_8.lo lzo1b_9.lo \
lzo1b_99.lo lzo1b_9x.lo lzo1b_cc.lo lzo1b_d1.lo lzo1b_d2.lo \
lzo1b_rr.lo lzo1b_xx.lo lzo1c_1.lo lzo1c_2.lo lzo1c_3.lo \
lzo1c_4.lo lzo1c_5.lo lzo1c_6.lo lzo1c_7.lo lzo1c_8.lo \
lzo1c_9.lo lzo1c_99.lo lzo1c_9x.lo lzo1c_cc.lo lzo1c_d1.lo \
lzo1c_d2.lo lzo1c_rr.lo lzo1c_xx.lo lzo1f_1.lo lzo1f_9x.lo \
lzo1f_d1.lo lzo1f_d2.lo lzo1x_1.lo lzo1x_9x.lo lzo1x_d1.lo \
lzo1x_d2.lo lzo1x_d3.lo lzo1x_o.lo lzo1x_1k.lo lzo1x_1l.lo \
lzo1x_1o.lo lzo1y_1.lo lzo1y_9x.lo lzo1y_d1.lo lzo1y_d2.lo \
lzo1y_d3.lo lzo1y_o.lo lzo1z_9x.lo lzo1z_d1.lo lzo1z_d2.lo \
lzo1z_d3.lo lzo2a_9x.lo lzo2a_d1.lo lzo2a_d2.lo
liblzo_la_OBJECTS = $(am_liblzo_la_OBJECTS)
DEFS = -DHAVE_CONFIG_H
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
CPPFLAGS = -DLZO_HAVE_CONFIG_H
LDFLAGS =
LIBS =
depcomp = $(SHELL) $(top_srcdir)/acconfig/depcomp
am__depfiles_maybe = depfiles
DEP_FILES = ./$(DEPDIR)/alloc.Plo ./$(DEPDIR)/io.Plo \
./$(DEPDIR)/lzo1.Plo ./$(DEPDIR)/lzo1_99.Plo \
./$(DEPDIR)/lzo1a.Plo ./$(DEPDIR)/lzo1a_99.Plo \
./$(DEPDIR)/lzo1b_1.Plo ./$(DEPDIR)/lzo1b_2.Plo \
./$(DEPDIR)/lzo1b_3.Plo ./$(DEPDIR)/lzo1b_4.Plo \
./$(DEPDIR)/lzo1b_5.Plo ./$(DEPDIR)/lzo1b_6.Plo \
./$(DEPDIR)/lzo1b_7.Plo ./$(DEPDIR)/lzo1b_8.Plo \
./$(DEPDIR)/lzo1b_9.Plo ./$(DEPDIR)/lzo1b_99.Plo \
./$(DEPDIR)/lzo1b_9x.Plo ./$(DEPDIR)/lzo1b_cc.Plo \
./$(DEPDIR)/lzo1b_d1.Plo ./$(DEPDIR)/lzo1b_d2.Plo \
./$(DEPDIR)/lzo1b_rr.Plo ./$(DEPDIR)/lzo1b_xx.Plo \
./$(DEPDIR)/lzo1c_1.Plo ./$(DEPDIR)/lzo1c_2.Plo \
./$(DEPDIR)/lzo1c_3.Plo ./$(DEPDIR)/lzo1c_4.Plo \
./$(DEPDIR)/lzo1c_5.Plo ./$(DEPDIR)/lzo1c_6.Plo \
./$(DEPDIR)/lzo1c_7.Plo ./$(DEPDIR)/lzo1c_8.Plo \
./$(DEPDIR)/lzo1c_9.Plo ./$(DEPDIR)/lzo1c_99.Plo \
./$(DEPDIR)/lzo1c_9x.Plo ./$(DEPDIR)/lzo1c_cc.Plo \
./$(DEPDIR)/lzo1c_d1.Plo ./$(DEPDIR)/lzo1c_d2.Plo \
./$(DEPDIR)/lzo1c_rr.Plo ./$(DEPDIR)/lzo1c_xx.Plo \
./$(DEPDIR)/lzo1f_1.Plo ./$(DEPDIR)/lzo1f_9x.Plo \
./$(DEPDIR)/lzo1f_d1.Plo ./$(DEPDIR)/lzo1f_d2.Plo \
./$(DEPDIR)/lzo1x_1.Plo ./$(DEPDIR)/lzo1x_1k.Plo \
./$(DEPDIR)/lzo1x_1l.Plo ./$(DEPDIR)/lzo1x_1o.Plo \
./$(DEPDIR)/lzo1x_9x.Plo ./$(DEPDIR)/lzo1x_d1.Plo \
./$(DEPDIR)/lzo1x_d2.Plo ./$(DEPDIR)/lzo1x_d3.Plo \
./$(DEPDIR)/lzo1x_o.Plo ./$(DEPDIR)/lzo1y_1.Plo \
./$(DEPDIR)/lzo1y_9x.Plo ./$(DEPDIR)/lzo1y_d1.Plo \
./$(DEPDIR)/lzo1y_d2.Plo ./$(DEPDIR)/lzo1y_d3.Plo \
./$(DEPDIR)/lzo1y_o.Plo ./$(DEPDIR)/lzo1z_9x.Plo \
./$(DEPDIR)/lzo1z_d1.Plo ./$(DEPDIR)/lzo1z_d2.Plo \
./$(DEPDIR)/lzo1z_d3.Plo ./$(DEPDIR)/lzo2a_9x.Plo \
./$(DEPDIR)/lzo2a_d1.Plo ./$(DEPDIR)/lzo2a_d2.Plo \
./$(DEPDIR)/lzo_crc.Plo ./$(DEPDIR)/lzo_dll.Plo \
./$(DEPDIR)/lzo_init.Plo ./$(DEPDIR)/lzo_ptr.Plo \
./$(DEPDIR)/lzo_str.Plo ./$(DEPDIR)/lzo_util.Plo
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
$(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
DIST_SOURCES = $(liblzo_la_SOURCES)
DIST_COMMON = Makefile.am Makefile.in
SOURCES = $(liblzo_la_SOURCES)
all: all-am
.SUFFIXES:
.SUFFIXES: .asm .c .i .s .sh .lo .o .obj
$(srcdir)/Makefile.in: # Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu src/Makefile
Makefile: # $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
libLTLIBRARIES_INSTALL = $(INSTALL)
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(libdir)
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
f="`echo $$p | sed -e 's|^.*/||'`"; \
echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f"; \
$(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f; \
else :; fi; \
done
uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
p="`echo $$p | sed -e 's|^.*/||'`"; \
echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \
$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
done
clean-libLTLIBRARIES:
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
test -z "$dir" && dir=.; \
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
liblzo.la: $(liblzo_la_OBJECTS) $(liblzo_la_DEPENDENCIES)
$(LINK) -rpath $(libdir) $(liblzo_la_LDFLAGS) $(liblzo_la_OBJECTS) $(liblzo_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT) core *.core
distclean-compile:
-rm -f *.tab.c
include ./$(DEPDIR)/alloc.Plo
include ./$(DEPDIR)/io.Plo
include ./$(DEPDIR)/lzo1.Plo
include ./$(DEPDIR)/lzo1_99.Plo
include ./$(DEPDIR)/lzo1a.Plo
include ./$(DEPDIR)/lzo1a_99.Plo
include ./$(DEPDIR)/lzo1b_1.Plo
include ./$(DEPDIR)/lzo1b_2.Plo
include ./$(DEPDIR)/lzo1b_3.Plo
include ./$(DEPDIR)/lzo1b_4.Plo
include ./$(DEPDIR)/lzo1b_5.Plo
include ./$(DEPDIR)/lzo1b_6.Plo
include ./$(DEPDIR)/lzo1b_7.Plo
include ./$(DEPDIR)/lzo1b_8.Plo
include ./$(DEPDIR)/lzo1b_9.Plo
include ./$(DEPDIR)/lzo1b_99.Plo
include ./$(DEPDIR)/lzo1b_9x.Plo
include ./$(DEPDIR)/lzo1b_cc.Plo
include ./$(DEPDIR)/lzo1b_d1.Plo
include ./$(DEPDIR)/lzo1b_d2.Plo
include ./$(DEPDIR)/lzo1b_rr.Plo
include ./$(DEPDIR)/lzo1b_xx.Plo
include ./$(DEPDIR)/lzo1c_1.Plo
include ./$(DEPDIR)/lzo1c_2.Plo
include ./$(DEPDIR)/lzo1c_3.Plo
include ./$(DEPDIR)/lzo1c_4.Plo
include ./$(DEPDIR)/lzo1c_5.Plo
include ./$(DEPDIR)/lzo1c_6.Plo
include ./$(DEPDIR)/lzo1c_7.Plo
include ./$(DEPDIR)/lzo1c_8.Plo
include ./$(DEPDIR)/lzo1c_9.Plo
include ./$(DEPDIR)/lzo1c_99.Plo
include ./$(DEPDIR)/lzo1c_9x.Plo
include ./$(DEPDIR)/lzo1c_cc.Plo
include ./$(DEPDIR)/lzo1c_d1.Plo
include ./$(DEPDIR)/lzo1c_d2.Plo
include ./$(DEPDIR)/lzo1c_rr.Plo
include ./$(DEPDIR)/lzo1c_xx.Plo
include ./$(DEPDIR)/lzo1f_1.Plo
include ./$(DEPDIR)/lzo1f_9x.Plo
include ./$(DEPDIR)/lzo1f_d1.Plo
include ./$(DEPDIR)/lzo1f_d2.Plo
include ./$(DEPDIR)/lzo1x_1.Plo
include ./$(DEPDIR)/lzo1x_1k.Plo
include ./$(DEPDIR)/lzo1x_1l.Plo
include ./$(DEPDIR)/lzo1x_1o.Plo
include ./$(DEPDIR)/lzo1x_9x.Plo
include ./$(DEPDIR)/lzo1x_d1.Plo
include ./$(DEPDIR)/lzo1x_d2.Plo
include ./$(DEPDIR)/lzo1x_d3.Plo
include ./$(DEPDIR)/lzo1x_o.Plo
include ./$(DEPDIR)/lzo1y_1.Plo
include ./$(DEPDIR)/lzo1y_9x.Plo
include ./$(DEPDIR)/lzo1y_d1.Plo
include ./$(DEPDIR)/lzo1y_d2.Plo
include ./$(DEPDIR)/lzo1y_d3.Plo
include ./$(DEPDIR)/lzo1y_o.Plo
include ./$(DEPDIR)/lzo1z_9x.Plo
include ./$(DEPDIR)/lzo1z_d1.Plo
include ./$(DEPDIR)/lzo1z_d2.Plo
include ./$(DEPDIR)/lzo1z_d3.Plo
include ./$(DEPDIR)/lzo2a_9x.Plo
include ./$(DEPDIR)/lzo2a_d1.Plo
include ./$(DEPDIR)/lzo2a_d2.Plo
include ./$(DEPDIR)/lzo_crc.Plo
include ./$(DEPDIR)/lzo_dll.Plo
include ./$(DEPDIR)/lzo_init.Plo
include ./$(DEPDIR)/lzo_ptr.Plo
include ./$(DEPDIR)/lzo_str.Plo
include ./$(DEPDIR)/lzo_util.Plo
distclean-depend:
-rm -rf ./$(DEPDIR)
.c.o:
source='$<' object='$@' libtool=no \
depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' \
$(CCDEPMODE) $(depcomp) \
$(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
.c.obj:
source='$<' object='$@' libtool=no \
depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' \
$(CCDEPMODE) $(depcomp) \
$(COMPILE) -c `cygpath -w $<`
.c.lo:
source='$<' object='$@' libtool=yes \
depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' \
$(CCDEPMODE) $(depcomp) \
$(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
CCDEPMODE = depmode=gcc
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
ETAGS = etags
ETAGSFLAGS =
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@list='$(DISTFILES)'; for file in $$list; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkinstalldirs) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="${top_distdir}" distdir="$(distdir)" \
dist-hook
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES)
installdirs:
$(mkinstalldirs) $(DESTDIR)$(libdir)
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
mostlyclean-am
distclean: distclean-am
distclean-am: clean-am distclean-compile distclean-depend \
distclean-generic distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
info: info-am
info-am:
install-data-am:
install-exec-am: install-libLTLIBRARIES
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES
.PHONY: GTAGS all all-am check check-am clean clean-generic \
clean-libLTLIBRARIES clean-libtool distclean distclean-compile \
distclean-depend distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am info info-am install \
install-am install-data install-data-am install-exec \
install-exec-am install-info install-info-am \
install-libLTLIBRARIES install-man install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool tags uninstall \
uninstall-am uninstall-info-am uninstall-libLTLIBRARIES
.s.o:
$(COMPILE_S) -c $<
.s.lo:
$(LIBTOOL) --mode=compile $(COMPILE_S) -c $<
.asm.o:
$(COMPILE_ASM) -o $@ $<
.asm.lo:
$(LIBTOOL) --mode=compile $(COMPILE_ASM) -o $@ $<
# /***********************************************************************
# // extra targets and dependencies
# ************************************************************************/
.c.i:
$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) -o $@ $<
.s.i:
$(CPP) $(ASFLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) -o $@ $<
dist-hook:
cp -rpi $(srcdir)/i386 $(distdir)/
#override o=.lo
#-include $(top_srcdir)/maint/make/src.mk
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
|
Added work/contrib/lzo/lzo-1.08/src/Makefile.am.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
|
## Process this file with automake to create Makefile.in
#
# Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
#
AUTOMAKE_OPTIONS = 1.6
# /***********************************************************************
# // compiler and architecture specific CFLAGS
# ************************************************************************/
LZO_CFLAGS_GCC =
LZO_CFLAGS_GCC_O =
LZO_CFLAGS_GCC_W = \
-Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
-Wno-uninitialized
LZO_CFLAGS_GCC_i386 =
LZO_CFLAGS_GCC_i386_O = $(CFLAGS_GCC_OMIT_FRAME_POINTER) # -fforce-addr
LZO_CFLAGS_GCC_i386_W =
L_CFLAGS = $(LZO_CFLAGS_@MFX_CC@) $(LZO_CFLAGS_@MFX_CC@_@MFX_ARCH@)
L_CFLAGS_O = $(LZO_CFLAGS_@MFX_CC@_O) $(LZO_CFLAGS_@MFX_CC@_@MFX_ARCH@_O)
L_CFLAGS_W = $(LZO_CFLAGS_@MFX_CC@_W) $(LZO_CFLAGS_@MFX_CC@_@MFX_ARCH@_W)
# /***********************************************************************
# //
# ************************************************************************/
### LZO_DEBUG = -DLZO_DEBUG
### LZO_DEBUG = -DLZO_DEBUG -Wno-error
### LZO_DEBUG = -DLZO_DEBUG -g -fno-omit-frame-pointer -Wno-error
### LZO_EXTRA_CFLAGS = -fbranch-probabilities -Wno-error
### LZO_EXTRA_CFLAGS = -fprofile-arcs -ftest-coverage -O0
INCLUDES = -I$(top_srcdir)/include
ALL_CFLAGS = $(L_CFLAGS) $(CFLAGS_O) $(L_CFLAGS_O) $(CFLAGS_W) $(L_CFLAGS_W) $(CFLAGS_W_PEDANTIC) $(LZO_CFLAGS) $(LZO_EXTRA_CFLAGS) $(LZO_DEBUG)
CFLAGS = @CFLAGS@ -DLZO_BUILD $(ALL_CFLAGS)
CXXFLAGS = @CXXFLAGS@ -DLZO_BUILD $(ALL_CFLAGS)
VPATH = @srcdir@:@srcdir@@SRC_VPATH@
# /***********************************************************************
# // assembler support
# ************************************************************************/
SUFFIXES = .asm .c .i .s .sh
COMPILE_S = $(CC) $(ASFLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) $(LZO_DEBUG)
COMPILE_ASM = $(NASM) -f elf
.s.o:
$(COMPILE_S) -c $<
.s.lo:
$(LIBTOOL) --mode=compile $(COMPILE_S) -c $<
.asm.o:
$(COMPILE_ASM) -o $@ $<
.asm.lo:
$(LIBTOOL) --mode=compile $(COMPILE_ASM) -o $@ $<
# /***********************************************************************
# // library files
# ************************************************************************/
lib_LTLIBRARIES = liblzo.la
liblzo_la_LDFLAGS = -version-info 1:0:0
liblzo_la_SOURCES = \
alloc.c io.c lzo_crc.c lzo_dll.c lzo_init.c lzo_ptr.c lzo_str.c lzo_util.c \
lzo1.c lzo1_99.c \
lzo1a.c lzo1a_99.c \
lzo1b_1.c lzo1b_2.c lzo1b_3.c lzo1b_4.c lzo1b_5.c lzo1b_6.c \
lzo1b_7.c lzo1b_8.c lzo1b_9.c lzo1b_99.c lzo1b_9x.c \
lzo1b_cc.c lzo1b_d1.c lzo1b_d2.c lzo1b_rr.c lzo1b_xx.c \
lzo1c_1.c lzo1c_2.c lzo1c_3.c lzo1c_4.c lzo1c_5.c lzo1c_6.c \
lzo1c_7.c lzo1c_8.c lzo1c_9.c lzo1c_99.c lzo1c_9x.c \
lzo1c_cc.c lzo1c_d1.c lzo1c_d2.c lzo1c_rr.c lzo1c_xx.c \
lzo1f_1.c lzo1f_9x.c lzo1f_d1.c lzo1f_d2.c \
lzo1x_1.c lzo1x_9x.c lzo1x_d1.c lzo1x_d2.c lzo1x_d3.c \
lzo1x_o.c lzo1x_1k.c lzo1x_1l.c lzo1x_1o.c \
lzo1y_1.c lzo1y_9x.c lzo1y_d1.c lzo1y_d2.c lzo1y_d3.c lzo1y_o.c \
lzo1z_9x.c lzo1z_d1.c lzo1z_d2.c lzo1z_d3.c \
lzo2a_9x.c lzo2a_d1.c lzo2a_d2.c \
lzo1_cm.ch lzo1_d.ch lzo1a_cm.ch lzo1a_cr.ch lzo1b_c.ch \
lzo1b_cm.ch lzo1b_cr.ch lzo1b_d.ch lzo1b_r.ch \
lzo1b_sm.ch lzo1b_tm.ch lzo1f_d.ch lzo1x_c.ch \
lzo1x_d.ch lzo1x_oo.ch lzo2a_d.ch lzo_mchw.ch lzo_swd.ch \
compr1b.h compr1c.h config1.h config1a.h config1b.h config1c.h \
config1f.h config1x.h config1y.h config1z.h config2a.h fake16.h \
lzo1a_de.h lzo1b_cc.h lzo1b_de.h lzo1c_cc.h lzo_conf.h lzo_dict.h \
lzo_ptr.h lzo_util.h stats1a.h stats1b.h stats1c.h
LZO_ASM_OBJECTS_GCC_i386 = \
lzo1c_s1.lo lzo1c_s2.lo \
lzo1f_f1.lo lzo1f_f2.lo \
lzo1x_f1.lo lzo1x_f2.lo lzo1x_s1.lo lzo1x_s2.lo \
lzo1y_f1.lo lzo1y_f2.lo lzo1y_s1.lo lzo1y_s2.lo
LZO_ASM_OBJECTS = @LZO_ASM_OBJECTS@
liblzo_la_LIBADD = $(LZO_ASM_OBJECTS)
liblzo_la_DEPENDENCIES = $(liblzo_la_LIBADD)
# /***********************************************************************
# // extra targets and dependencies
# ************************************************************************/
.c.i:
$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) -o $@ $<
.s.i:
$(CPP) $(ASFLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) -o $@ $<
dist-hook:
cp -rpi $(srcdir)/i386 $(distdir)/
@MAINT@@GMAKE_TRUE@override o=.lo
@MAINT@@GMAKE_TRUE@-include $(top_srcdir)/maint/make/src.mk
|
Added work/contrib/lzo/lzo-1.08/src/Makefile.in.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
|
# Makefile.in generated by automake 1.6.2 from Makefile.am.
# @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
#
# Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
#
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
host_alias = @host_alias@
host_triplet = @host@
EXEEXT = @EXEEXT@
OBJEXT = @OBJEXT@
PATH_SEPARATOR = @PATH_SEPARATOR@
VPATH = @srcdir@:@srcdir@@SRC_VPATH@
AMTAR = @AMTAR@
AS = @AS@
ASFLAGS = @ASFLAGS@
AWK = @AWK@
CC = @CC@
CFLAGS_GCC_OMIT_FRAME_POINTER = @CFLAGS_GCC_OMIT_FRAME_POINTER@
CFLAGS_O = @CFLAGS_O@
CFLAGS_W = @CFLAGS_W@
CFLAGS_W_PEDANTIC = @CFLAGS_W_PEDANTIC@
CLEANFILES = @CLEANFILES@
CPP = @CPP@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
ECHO = @ECHO@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LZO_ASM_OBJECTS = @LZO_ASM_OBJECTS@
LZO_CFLAGS = @LZO_CFLAGS@
MAINT = @MAINT@
MFX_ARCH = @MFX_ARCH@
MFX_CC = @MFX_CC@
MFX_CPU = @MFX_CPU@
MOSTLYCLEANFILES = @MOSTLYCLEANFILES@
NASM = @NASM@
OBJDUMP = @OBJDUMP@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
SRC_VPATH = @SRC_VPATH@
STRIP = @STRIP@
VERSION = @VERSION@
am__include = @am__include@
am__quote = @am__quote@
install_sh = @install_sh@
liblzo = @liblzo@
ltest_LIBS = @ltest_LIBS@
AUTOMAKE_OPTIONS = 1.6
# /***********************************************************************
# // compiler and architecture specific CFLAGS
# ************************************************************************/
LZO_CFLAGS_GCC =
LZO_CFLAGS_GCC_O =
LZO_CFLAGS_GCC_W = \
-Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
-Wno-uninitialized
LZO_CFLAGS_GCC_i386 =
LZO_CFLAGS_GCC_i386_O = $(CFLAGS_GCC_OMIT_FRAME_POINTER) # -fforce-addr
LZO_CFLAGS_GCC_i386_W =
L_CFLAGS = $(LZO_CFLAGS_@MFX_CC@) $(LZO_CFLAGS_@MFX_CC@_@MFX_ARCH@)
L_CFLAGS_O = $(LZO_CFLAGS_@MFX_CC@_O) $(LZO_CFLAGS_@MFX_CC@_@MFX_ARCH@_O)
L_CFLAGS_W = $(LZO_CFLAGS_@MFX_CC@_W) $(LZO_CFLAGS_@MFX_CC@_@MFX_ARCH@_W)
# /***********************************************************************
# //
# ************************************************************************/
### LZO_DEBUG = -DLZO_DEBUG
### LZO_DEBUG = -DLZO_DEBUG -Wno-error
### LZO_DEBUG = -DLZO_DEBUG -g -fno-omit-frame-pointer -Wno-error
### LZO_EXTRA_CFLAGS = -fbranch-probabilities -Wno-error
### LZO_EXTRA_CFLAGS = -fprofile-arcs -ftest-coverage -O0
INCLUDES = -I$(top_srcdir)/include
ALL_CFLAGS = $(L_CFLAGS) $(CFLAGS_O) $(L_CFLAGS_O) $(CFLAGS_W) $(L_CFLAGS_W) $(CFLAGS_W_PEDANTIC) $(LZO_CFLAGS) $(LZO_EXTRA_CFLAGS) $(LZO_DEBUG)
CFLAGS = @CFLAGS@ -DLZO_BUILD $(ALL_CFLAGS)
CXXFLAGS = @CXXFLAGS@ -DLZO_BUILD $(ALL_CFLAGS)
# /***********************************************************************
# // assembler support
# ************************************************************************/
SUFFIXES = .asm .c .i .s .sh
COMPILE_S = $(CC) $(ASFLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) $(LZO_DEBUG)
COMPILE_ASM = $(NASM) -f elf
# /***********************************************************************
# // library files
# ************************************************************************/
lib_LTLIBRARIES = liblzo.la
liblzo_la_LDFLAGS = -version-info 1:0:0
liblzo_la_SOURCES = \
alloc.c io.c lzo_crc.c lzo_dll.c lzo_init.c lzo_ptr.c lzo_str.c lzo_util.c \
lzo1.c lzo1_99.c \
lzo1a.c lzo1a_99.c \
lzo1b_1.c lzo1b_2.c lzo1b_3.c lzo1b_4.c lzo1b_5.c lzo1b_6.c \
lzo1b_7.c lzo1b_8.c lzo1b_9.c lzo1b_99.c lzo1b_9x.c \
lzo1b_cc.c lzo1b_d1.c lzo1b_d2.c lzo1b_rr.c lzo1b_xx.c \
lzo1c_1.c lzo1c_2.c lzo1c_3.c lzo1c_4.c lzo1c_5.c lzo1c_6.c \
lzo1c_7.c lzo1c_8.c lzo1c_9.c lzo1c_99.c lzo1c_9x.c \
lzo1c_cc.c lzo1c_d1.c lzo1c_d2.c lzo1c_rr.c lzo1c_xx.c \
lzo1f_1.c lzo1f_9x.c lzo1f_d1.c lzo1f_d2.c \
lzo1x_1.c lzo1x_9x.c lzo1x_d1.c lzo1x_d2.c lzo1x_d3.c \
lzo1x_o.c lzo1x_1k.c lzo1x_1l.c lzo1x_1o.c \
lzo1y_1.c lzo1y_9x.c lzo1y_d1.c lzo1y_d2.c lzo1y_d3.c lzo1y_o.c \
lzo1z_9x.c lzo1z_d1.c lzo1z_d2.c lzo1z_d3.c \
lzo2a_9x.c lzo2a_d1.c lzo2a_d2.c \
lzo1_cm.ch lzo1_d.ch lzo1a_cm.ch lzo1a_cr.ch lzo1b_c.ch \
lzo1b_cm.ch lzo1b_cr.ch lzo1b_d.ch lzo1b_r.ch \
lzo1b_sm.ch lzo1b_tm.ch lzo1f_d.ch lzo1x_c.ch \
lzo1x_d.ch lzo1x_oo.ch lzo2a_d.ch lzo_mchw.ch lzo_swd.ch \
compr1b.h compr1c.h config1.h config1a.h config1b.h config1c.h \
config1f.h config1x.h config1y.h config1z.h config2a.h fake16.h \
lzo1a_de.h lzo1b_cc.h lzo1b_de.h lzo1c_cc.h lzo_conf.h lzo_dict.h \
lzo_ptr.h lzo_util.h stats1a.h stats1b.h stats1c.h
LZO_ASM_OBJECTS_GCC_i386 = \
lzo1c_s1.lo lzo1c_s2.lo \
lzo1f_f1.lo lzo1f_f2.lo \
lzo1x_f1.lo lzo1x_f2.lo lzo1x_s1.lo lzo1x_s2.lo \
lzo1y_f1.lo lzo1y_f2.lo lzo1y_s1.lo lzo1y_s2.lo
liblzo_la_LIBADD = $(LZO_ASM_OBJECTS)
liblzo_la_DEPENDENCIES = $(liblzo_la_LIBADD)
subdir = src
mkinstalldirs = $(SHELL) $(top_srcdir)/acconfig/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
LTLIBRARIES = $(lib_LTLIBRARIES)
am_liblzo_la_OBJECTS = alloc.lo io.lo lzo_crc.lo lzo_dll.lo lzo_init.lo \
lzo_ptr.lo lzo_str.lo lzo_util.lo lzo1.lo lzo1_99.lo lzo1a.lo \
lzo1a_99.lo lzo1b_1.lo lzo1b_2.lo lzo1b_3.lo lzo1b_4.lo \
lzo1b_5.lo lzo1b_6.lo lzo1b_7.lo lzo1b_8.lo lzo1b_9.lo \
lzo1b_99.lo lzo1b_9x.lo lzo1b_cc.lo lzo1b_d1.lo lzo1b_d2.lo \
lzo1b_rr.lo lzo1b_xx.lo lzo1c_1.lo lzo1c_2.lo lzo1c_3.lo \
lzo1c_4.lo lzo1c_5.lo lzo1c_6.lo lzo1c_7.lo lzo1c_8.lo \
lzo1c_9.lo lzo1c_99.lo lzo1c_9x.lo lzo1c_cc.lo lzo1c_d1.lo \
lzo1c_d2.lo lzo1c_rr.lo lzo1c_xx.lo lzo1f_1.lo lzo1f_9x.lo \
lzo1f_d1.lo lzo1f_d2.lo lzo1x_1.lo lzo1x_9x.lo lzo1x_d1.lo \
lzo1x_d2.lo lzo1x_d3.lo lzo1x_o.lo lzo1x_1k.lo lzo1x_1l.lo \
lzo1x_1o.lo lzo1y_1.lo lzo1y_9x.lo lzo1y_d1.lo lzo1y_d2.lo \
lzo1y_d3.lo lzo1y_o.lo lzo1z_9x.lo lzo1z_d1.lo lzo1z_d2.lo \
lzo1z_d3.lo lzo2a_9x.lo lzo2a_d1.lo lzo2a_d2.lo
liblzo_la_OBJECTS = $(am_liblzo_la_OBJECTS)
DEFS = @DEFS@
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
depcomp = $(SHELL) $(top_srcdir)/acconfig/depcomp
am__depfiles_maybe = depfiles
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/alloc.Plo ./$(DEPDIR)/io.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/lzo1.Plo ./$(DEPDIR)/lzo1_99.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/lzo1a.Plo ./$(DEPDIR)/lzo1a_99.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/lzo1b_1.Plo ./$(DEPDIR)/lzo1b_2.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/lzo1b_3.Plo ./$(DEPDIR)/lzo1b_4.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/lzo1b_5.Plo ./$(DEPDIR)/lzo1b_6.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/lzo1b_7.Plo ./$(DEPDIR)/lzo1b_8.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/lzo1b_9.Plo ./$(DEPDIR)/lzo1b_99.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/lzo1b_9x.Plo ./$(DEPDIR)/lzo1b_cc.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/lzo1b_d1.Plo ./$(DEPDIR)/lzo1b_d2.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/lzo1b_rr.Plo ./$(DEPDIR)/lzo1b_xx.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/lzo1c_1.Plo ./$(DEPDIR)/lzo1c_2.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/lzo1c_3.Plo ./$(DEPDIR)/lzo1c_4.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/lzo1c_5.Plo ./$(DEPDIR)/lzo1c_6.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/lzo1c_7.Plo ./$(DEPDIR)/lzo1c_8.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/lzo1c_9.Plo ./$(DEPDIR)/lzo1c_99.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/lzo1c_9x.Plo ./$(DEPDIR)/lzo1c_cc.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/lzo1c_d1.Plo ./$(DEPDIR)/lzo1c_d2.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/lzo1c_rr.Plo ./$(DEPDIR)/lzo1c_xx.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/lzo1f_1.Plo ./$(DEPDIR)/lzo1f_9x.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/lzo1f_d1.Plo ./$(DEPDIR)/lzo1f_d2.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/lzo1x_1.Plo ./$(DEPDIR)/lzo1x_1k.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/lzo1x_1l.Plo ./$(DEPDIR)/lzo1x_1o.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/lzo1x_9x.Plo ./$(DEPDIR)/lzo1x_d1.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/lzo1x_d2.Plo ./$(DEPDIR)/lzo1x_d3.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/lzo1x_o.Plo ./$(DEPDIR)/lzo1y_1.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/lzo1y_9x.Plo ./$(DEPDIR)/lzo1y_d1.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/lzo1y_d2.Plo ./$(DEPDIR)/lzo1y_d3.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/lzo1y_o.Plo ./$(DEPDIR)/lzo1z_9x.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/lzo1z_d1.Plo ./$(DEPDIR)/lzo1z_d2.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/lzo1z_d3.Plo ./$(DEPDIR)/lzo2a_9x.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/lzo2a_d1.Plo ./$(DEPDIR)/lzo2a_d2.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/lzo_crc.Plo ./$(DEPDIR)/lzo_dll.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/lzo_init.Plo ./$(DEPDIR)/lzo_ptr.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/lzo_str.Plo ./$(DEPDIR)/lzo_util.Plo
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
$(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
DIST_SOURCES = $(liblzo_la_SOURCES)
DIST_COMMON = Makefile.am Makefile.in
SOURCES = $(liblzo_la_SOURCES)
all: all-am
.SUFFIXES:
.SUFFIXES: .asm .c .i .s .sh .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu src/Makefile
Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
libLTLIBRARIES_INSTALL = $(INSTALL)
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(libdir)
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
f="`echo $$p | sed -e 's|^.*/||'`"; \
echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f"; \
$(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f; \
else :; fi; \
done
uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
p="`echo $$p | sed -e 's|^.*/||'`"; \
echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \
$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
done
clean-libLTLIBRARIES:
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
test -z "$dir" && dir=.; \
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
liblzo.la: $(liblzo_la_OBJECTS) $(liblzo_la_DEPENDENCIES)
$(LINK) -rpath $(libdir) $(liblzo_la_LDFLAGS) $(liblzo_la_OBJECTS) $(liblzo_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT) core *.core
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alloc.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/io.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1_99.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1a.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1a_99.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_1.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_2.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_3.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_4.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_5.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_6.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_7.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_8.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_9.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_99.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_9x.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_cc.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_d1.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_d2.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_rr.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_xx.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_1.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_2.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_3.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_4.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_5.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_6.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_7.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_8.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_9.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_99.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_9x.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_cc.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_d1.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_d2.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_rr.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_xx.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1f_1.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1f_9x.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1f_d1.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1f_d2.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1x_1.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1x_1k.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1x_1l.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1x_1o.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1x_9x.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1x_d1.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1x_d2.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1x_d3.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1x_o.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1y_1.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1y_9x.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1y_d1.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1y_d2.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1y_d3.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1y_o.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1z_9x.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1z_d1.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1z_d2.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1z_d3.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo2a_9x.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo2a_d1.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo2a_d2.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo_crc.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo_dll.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo_init.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo_ptr.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo_str.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo_util.Plo@am__quote@
distclean-depend:
-rm -rf ./$(DEPDIR)
.c.o:
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
.c.obj:
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(COMPILE) -c `cygpath -w $<`
.c.lo:
@AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
CCDEPMODE = @CCDEPMODE@
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
ETAGS = etags
ETAGSFLAGS =
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@list='$(DISTFILES)'; for file in $$list; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkinstalldirs) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="${top_distdir}" distdir="$(distdir)" \
dist-hook
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES)
installdirs:
$(mkinstalldirs) $(DESTDIR)$(libdir)
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
mostlyclean-am
distclean: distclean-am
distclean-am: clean-am distclean-compile distclean-depend \
distclean-generic distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
info: info-am
info-am:
install-data-am:
install-exec-am: install-libLTLIBRARIES
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES
.PHONY: GTAGS all all-am check check-am clean clean-generic \
clean-libLTLIBRARIES clean-libtool distclean distclean-compile \
distclean-depend distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am info info-am install \
install-am install-data install-data-am install-exec \
install-exec-am install-info install-info-am \
install-libLTLIBRARIES install-man install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool tags uninstall \
uninstall-am uninstall-info-am uninstall-libLTLIBRARIES
.s.o:
$(COMPILE_S) -c $<
.s.lo:
$(LIBTOOL) --mode=compile $(COMPILE_S) -c $<
.asm.o:
$(COMPILE_ASM) -o $@ $<
.asm.lo:
$(LIBTOOL) --mode=compile $(COMPILE_ASM) -o $@ $<
# /***********************************************************************
# // extra targets and dependencies
# ************************************************************************/
.c.i:
$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) -o $@ $<
.s.i:
$(CPP) $(ASFLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) -o $@ $<
dist-hook:
cp -rpi $(srcdir)/i386 $(distdir)/
@MAINT@@GMAKE_TRUE@override o=.lo
@MAINT@@GMAKE_TRUE@-include $(top_srcdir)/maint/make/src.mk
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
|
Added work/contrib/lzo/lzo-1.08/src/alloc.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
|
/* alloc.c -- memory allocation
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include "lzo_conf.h"
#include <lzoutil.h>
#if defined(HAVE_MALLOC_H)
# include <malloc.h>
#endif
#if defined(__palmos__)
# include <System/MemoryMgr.h>
#endif
#undef lzo_alloc_hook
#undef lzo_free_hook
#undef lzo_alloc
#undef lzo_malloc
#undef lzo_free
/***********************************************************************
// implementation
************************************************************************/
LZO_PRIVATE(lzo_voidp)
lzo_alloc_internal(lzo_uint nelems, lzo_uint size)
{
lzo_voidp p = NULL;
unsigned long s = (unsigned long) nelems * size;
if (nelems <= 0 || size <= 0 || s < nelems || s < size)
return NULL;
#if defined(__palmos__)
p = (lzo_voidp) MemPtrNew(s);
#elif (LZO_UINT_MAX <= SIZE_T_MAX)
if (s < SIZE_T_MAX)
p = (lzo_voidp) malloc((size_t)s);
#elif defined(HAVE_HALLOC) && defined(__DMC__)
if (size < SIZE_T_MAX)
p = (lzo_voidp) _halloc(nelems,(size_t)size);
#elif defined(HAVE_HALLOC)
if (size < SIZE_T_MAX)
p = (lzo_voidp) halloc(nelems,(size_t)size);
#else
if (s < SIZE_T_MAX)
p = (lzo_voidp) malloc((size_t)s);
#endif
return p;
}
LZO_PRIVATE(void)
lzo_free_internal(lzo_voidp p)
{
if (!p)
return;
#if defined(__palmos__)
MemPtrFree(p);
#elif (LZO_UINT_MAX <= SIZE_T_MAX)
free(p);
#elif defined(HAVE_HALLOC) && defined(__DMC__)
_hfree(p);
#elif defined(HAVE_HALLOC)
hfree(p);
#else
free(p);
#endif
}
/***********************************************************************
// public interface using the global hooks
************************************************************************/
/* global allocator hooks */
LZO_PUBLIC_VAR(lzo_alloc_hook_t) lzo_alloc_hook = lzo_alloc_internal;
LZO_PUBLIC_VAR(lzo_free_hook_t) lzo_free_hook = lzo_free_internal;
LZO_PUBLIC(lzo_voidp)
lzo_alloc(lzo_uint nelems, lzo_uint size)
{
if (!lzo_alloc_hook)
return NULL;
return lzo_alloc_hook(nelems,size);
}
LZO_PUBLIC(lzo_voidp)
lzo_malloc(lzo_uint size)
{
if (!lzo_alloc_hook)
return NULL;
#if defined(__palmos__)
return lzo_alloc_hook(size,1);
#elif (LZO_UINT_MAX <= SIZE_T_MAX)
return lzo_alloc_hook(size,1);
#elif defined(HAVE_HALLOC)
/* use segment granularity by default */
if (size + 15 > size) /* avoid overflow */
return lzo_alloc_hook((size+15)/16,16);
return lzo_alloc_hook(size,1);
#else
return lzo_alloc_hook(size,1);
#endif
}
LZO_PUBLIC(void)
lzo_free(lzo_voidp p)
{
if (!lzo_free_hook)
return;
lzo_free_hook(p);
}
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/compr1b.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
#define LZO_NEED_DICT_H
#include "config1b.h"
#if !defined(COMPRESS_ID)
#define COMPRESS_ID _LZO_ECONCAT2(DD_BITS,CLEVEL)
#endif
#include "lzo1b_c.ch"
/***********************************************************************
//
************************************************************************/
#define LZO_COMPRESS \
_LZO_ECONCAT3(lzo1b_,COMPRESS_ID,_compress)
#define LZO_COMPRESS_FUNC \
_LZO_ECONCAT3(_lzo1b_,COMPRESS_ID,_compress_func)
/***********************************************************************
//
************************************************************************/
const lzo_compress_t LZO_COMPRESS_FUNC = do_compress;
LZO_PUBLIC(int)
LZO_COMPRESS ( const lzo_byte *in, lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem )
{
#if defined(__LZO_QUERY_COMPRESS)
if (__LZO_IS_COMPRESS_QUERY(in,in_len,out,out_len,wrkmem))
return __LZO_QUERY_COMPRESS(in,in_len,out,out_len,wrkmem,D_SIZE,lzo_sizeof(lzo_dict_t));
#endif
return _lzo1b_do_compress(in,in_len,out,out_len,wrkmem,do_compress);
}
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/compr1c.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
#define LZO_NEED_DICT_H
#include "config1c.h"
#if !defined(COMPRESS_ID)
#define COMPRESS_ID _LZO_ECONCAT2(DD_BITS,CLEVEL)
#endif
#include "lzo1b_c.ch"
/***********************************************************************
//
************************************************************************/
#define LZO_COMPRESS \
_LZO_ECONCAT3(lzo1c_,COMPRESS_ID,_compress)
#define LZO_COMPRESS_FUNC \
_LZO_ECONCAT3(_lzo1c_,COMPRESS_ID,_compress_func)
/***********************************************************************
//
************************************************************************/
const lzo_compress_t LZO_COMPRESS_FUNC = do_compress;
LZO_PUBLIC(int)
LZO_COMPRESS ( const lzo_byte *in, lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem )
{
#if defined(__LZO_QUERY_COMPRESS)
if (__LZO_IS_COMPRESS_QUERY(in,in_len,out,out_len,wrkmem))
return __LZO_QUERY_COMPRESS(in,in_len,out,out_len,wrkmem,D_SIZE,lzo_sizeof(lzo_dict_t));
#endif
return _lzo1c_do_compress(in,in_len,out,out_len,wrkmem,do_compress);
}
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/config1.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
/* config1.h -- configuration for the LZO1 algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the library and is subject
to change.
*/
#include <lzo1.h>
#define LZO_NO_R1
#include "config1a.h"
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/config1a.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
|
/* config1a.h -- configuration for the LZO1A algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the library and is subject
to change.
*/
#ifndef __LZO_CONFIG1A_H
#define __LZO_CONFIG1A_H
#include <lzo1a.h>
#include "lzo_conf.h"
#undef LZO_COLLECT_STATS /* no support for stats here */
/***********************************************************************
// algorithm configuration
************************************************************************/
/* run bits (4 - 5) - the compressor and the decompressor
* must use the same value. */
#if !defined(RBITS)
# define RBITS 5
#endif
/* dictionary depth (0 - 6) - this only affects the compressor.
* 0 is fastest, 6 is best compression ratio */
#if !defined(DDBITS)
# define DDBITS 0
#endif
/* compression level (1 - 9) - this only affects the compressor.
* 1 is fastest, 9 is best compression ratio */
#if !defined(CLEVEL)
# define CLEVEL 1 /* fastest by default */
#endif
/* check configuration */
#if (RBITS < 4 || RBITS > 5)
# error "invalid RBITS"
#endif
#if (DDBITS < 0 || DDBITS > 6)
# error "invalid DDBITS"
#endif
#if (CLEVEL < 1 || CLEVEL > 9)
# error "invalid CLEVEL"
#endif
/***********************************************************************
// internal configuration
************************************************************************/
/* add a special code so that the decompressor can detect the
* end of the compressed data block (overhead is 3 bytes per block) */
#undef LZO_EOF_CODE
/* return -1 instead of copying if the data cannot be compressed */
#undef LZO_RETURN_IF_NOT_COMPRESSIBLE
/***********************************************************************
// algorithm internal configuration
************************************************************************/
/* choose the hashing strategy */
#ifndef LZO_HASH
#define LZO_HASH LZO_HASH_LZO_INCREMENTAL_A
#endif
/* config */
#define R_BITS RBITS
#define DD_BITS DDBITS
#ifndef D_BITS
#define D_BITS 16
#endif
/***********************************************************************
// optimization and debugging
************************************************************************/
/* Collect statistics */
#if 0 && !defined(LZO_COLLECT_STATS)
# define LZO_COLLECT_STATS
#endif
/***********************************************************************
//
************************************************************************/
#define M3O_BITS M2O_BITS
#define M3L_BITS CHAR_BIT
#define M3_MAX_LEN (M3_MIN_LEN + LZO_SIZE(M3L_BITS) - 1)
#define _MAX_OFFSET _M2_MAX_OFFSET
#define LZO_NO_M3
#include "lzo_util.h"
#include "lzo1b_de.h"
#include "stats1b.h"
#include "lzo1b_cc.h"
/***********************************************************************
// check for total LZO1/LZO1A compatibility
************************************************************************/
#undef M2_MARKER
#define M2_MARKER (1 << M2O_BITS)
#if (R_BITS != 5)
# error
#endif
#if (M2O_BITS != 5)
# error
#endif
#if (M3O_BITS != 5)
# error
#endif
#if (M2_MIN_LEN != 3)
# error
#endif
#if (M2_MAX_LEN != 8)
# error
#endif
#if (M3_MIN_LEN != 9)
# error
#endif
#if (M3_MAX_LEN != 264)
# error
#endif
#if (_M2_MAX_OFFSET != (1u << 13))
# error
#endif
#if (_M2_MAX_OFFSET != _M3_MAX_OFFSET)
# error
#endif
#if (_M2_MAX_OFFSET != _MAX_OFFSET)
# error
#endif
#if (R0MIN != 32)
# error
#endif
#if (R0MAX != 287)
# error
#endif
#if (R0FAST != 280)
# error
#endif
#endif /* already included */
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/config1b.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
|
/* config1b.h -- configuration for the LZO1B algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the library and is subject
to change.
*/
#ifndef __LZO_CONFIG1B_H
#define __LZO_CONFIG1B_H
#include <lzo1b.h>
#include "lzo_conf.h"
/***********************************************************************
// algorithm configuration
************************************************************************/
/* run bits (4 - 5) - the compressor and the decompressor
* must use the same value. */
#if !defined(RBITS)
# define RBITS 5
#endif
/* dictionary depth (0 - 6) - this only affects the compressor.
* 0 is fastest, 6 is best compression ratio */
#if !defined(DDBITS)
# define DDBITS 0
#endif
/* compression level (1 - 9) - this only affects the compressor.
* 1 is fastest, 9 is best compression ratio */
#if !defined(CLEVEL)
# define CLEVEL 1 /* fastest by default */
#endif
/* check configuration */
#if (RBITS < 4 || RBITS > 5)
# error "invalid RBITS"
#endif
#if (DDBITS < 0 || DDBITS > 6)
# error "invalid DDBITS"
#endif
#if (CLEVEL < 1 || CLEVEL > 9)
# error "invalid CLEVEL"
#endif
/***********************************************************************
// internal configuration
************************************************************************/
/* add a special code so that the decompressor can detect the
* end of the compressed data block (overhead is 3 bytes per block) */
#undef LZO_EOF_CODE
#define LZO_EOF_CODE
/* return -1 instead of copying if the data cannot be compressed */
#undef LZO_RETURN_IF_NOT_COMPRESSIBLE
/***********************************************************************
// algorithm internal configuration
************************************************************************/
/* choose the hashing strategy */
#ifndef LZO_HASH
#define LZO_HASH LZO_HASH_LZO_INCREMENTAL_A
#endif
/* config */
#define R_BITS RBITS
#define DD_BITS DDBITS
#ifndef D_BITS
#define D_BITS 14
#endif
/***********************************************************************
// optimization and debugging
************************************************************************/
/* Collect statistics */
#if 0 && !defined(LZO_COLLECT_STATS)
# define LZO_COLLECT_STATS
#endif
/***********************************************************************
//
************************************************************************/
#include "lzo_util.h"
#include "lzo1b_de.h"
#include "stats1b.h"
#include "lzo1b_cc.h"
#endif /* already included */
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/config1c.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
/* config1c.h -- configuration for the LZO1C algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the library and is subject
to change.
*/
#ifndef __LZO_CONFIG1C_H
#define __LZO_CONFIG1C_H
#include <lzo1c.h>
#include "lzo_conf.h"
/***********************************************************************
// algorithm configuration
************************************************************************/
/* run bits (4 - 5) - the compressor and the decompressor
* must use the same value. */
#if !defined(RBITS)
# define RBITS 5
#endif
/* dictionary depth (0 - 6) - this only affects the compressor.
* 0 is fastest, 6 is best compression ratio */
#if !defined(DDBITS)
# define DDBITS 0
#endif
/* compression level (1 - 9) - this only affects the compressor.
* 1 is fastest, 9 is best compression ratio */
#if !defined(CLEVEL)
# define CLEVEL 1 /* fastest by default */
#endif
/* check configuration */
#if (RBITS < 4 || RBITS > 5)
# error "invalid RBITS"
#endif
#if (DDBITS < 0 || DDBITS > 6)
# error "invalid DDBITS"
#endif
#if (CLEVEL < 1 || CLEVEL > 9)
# error "invalid CLEVEL"
#endif
/***********************************************************************
// internal configuration
************************************************************************/
/* add a special code so that the decompressor can detect the
* end of the compressed data block (overhead is 3 bytes per block) */
#undef LZO_EOF_CODE
#define LZO_EOF_CODE
/* return -1 instead of copying if the data cannot be compressed */
#undef LZO_RETURN_IF_NOT_COMPRESSIBLE
/***********************************************************************
// algorithm internal configuration
************************************************************************/
/* choose the hashing strategy */
#ifndef LZO_HASH
#define LZO_HASH LZO_HASH_LZO_INCREMENTAL_A
#endif
/* config */
#define R_BITS RBITS
#define DD_BITS DDBITS
#ifndef D_BITS
#define D_BITS 14
#endif
/***********************************************************************
// optimization and debugging
************************************************************************/
/* Collect statistics */
#if 0 && !defined(LZO_COLLECT_STATS)
# define LZO_COLLECT_STATS
#endif
/***********************************************************************
//
************************************************************************/
/* good parameters when using a blocksize of 8kB */
#define M3O_BITS 6
#undef LZO_DETERMINISTIC
#include "lzo_util.h"
#include "lzo1b_de.h"
#include "stats1c.h"
#include "lzo1c_cc.h"
#endif /* already included */
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/config1f.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
/* config1f.h -- configuration for the LZO1F algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the library and is subject
to change.
*/
#ifndef __LZO_CONFIG1F_H
#define __LZO_CONFIG1F_H
#include <lzo1f.h>
#include "lzo_conf.h"
#include "lzo_util.h"
/***********************************************************************
//
************************************************************************/
#define LZO_EOF_CODE
#undef LZO_DETERMINISTIC
#define M2_MAX_OFFSET 0x0800
#define M3_MAX_OFFSET 0x3fff
#define M2_MIN_LEN 3
#define M2_MAX_LEN 8
#define M3_MIN_LEN 3
#define M3_MAX_LEN 33
#define M3_MARKER 224
/***********************************************************************
//
************************************************************************/
#ifndef MIN_LOOKAHEAD
#define MIN_LOOKAHEAD (M2_MAX_LEN + 1)
#endif
#if defined(LZO_NEED_DICT_H)
#ifndef LZO_HASH
#define LZO_HASH LZO_HASH_LZO_INCREMENTAL_A
#endif
#define DL_MIN_LEN M2_MIN_LEN
#include "lzo_dict.h"
#endif
#endif /* already included */
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/config1x.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
/* config1x.h -- configuration for the LZO1X algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the library and is subject
to change.
*/
#ifndef __LZO_CONFIG1X_H
#define __LZO_CONFIG1X_H
#if !defined(LZO1X) && !defined(LZO1Y) && !defined(LZO1Z)
# define LZO1X
#endif
#if !defined(__LZO_IN_MINILZO)
#include <lzo1x.h>
#endif
#include "lzo_conf.h"
#include "lzo_util.h"
/***********************************************************************
//
************************************************************************/
#define LZO_EOF_CODE
#undef LZO_DETERMINISTIC
#define M1_MAX_OFFSET 0x0400
#ifndef M2_MAX_OFFSET
#define M2_MAX_OFFSET 0x0800
#endif
#define M3_MAX_OFFSET 0x4000
#define M4_MAX_OFFSET 0xbfff
#define MX_MAX_OFFSET (M1_MAX_OFFSET + M2_MAX_OFFSET)
#define M1_MIN_LEN 2
#define M1_MAX_LEN 2
#define M2_MIN_LEN 3
#ifndef M2_MAX_LEN
#define M2_MAX_LEN 8
#endif
#define M3_MIN_LEN 3
#define M3_MAX_LEN 33
#define M4_MIN_LEN 3
#define M4_MAX_LEN 9
#define M1_MARKER 0
#define M2_MARKER 64
#define M3_MARKER 32
#define M4_MARKER 16
/***********************************************************************
//
************************************************************************/
#ifndef MIN_LOOKAHEAD
#define MIN_LOOKAHEAD (M2_MAX_LEN + 1)
#endif
#if defined(LZO_NEED_DICT_H)
#ifndef LZO_HASH
#define LZO_HASH LZO_HASH_LZO_INCREMENTAL_B
#endif
#define DL_MIN_LEN M2_MIN_LEN
#include "lzo_dict.h"
#endif
#endif /* already included */
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/config1y.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
/* config1y.h -- configuration for the LZO1Y algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the library and is subject
to change.
*/
#ifndef __LZO_CONFIG1Y_H
#define __LZO_CONFIG1Y_H
#if !defined(LZO1Y)
# define LZO1Y
#endif
#include <lzo1y.h>
#define M2_MAX_LEN 14
#define M2_MAX_OFFSET 0x0400
#include "config1x.h"
#endif /* already included */
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/config1z.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
/* config1z.h -- configuration for the LZO1Z algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the library and is subject
to change.
*/
#ifndef __LZO_CONFIG1Z_H
#define __LZO_CONFIG1Z_H
#if !defined(LZO1Z)
# define LZO1Z
#endif
#include <lzo1z.h>
#define M2_MAX_OFFSET 0x0700
#include "config1x.h"
#endif /* already included */
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/config2a.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
|
/* config2a.h -- configuration for the LZO2A algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the library and is subject
to change.
*/
#ifndef __LZO_CONFIG2A_H
#define __LZO_CONFIG2A_H
#include <lzo2a.h>
#include "lzo_conf.h"
#include "lzo_util.h"
/***********************************************************************
// algorithm configuration
************************************************************************/
/* dictionary depth (0 - 6) - this only affects the compressor.
* 0 is fastest, 6 is best compression ratio */
#if !defined(DDBITS)
# define DDBITS 0
#endif
/* compression level (1 - 9) - this only affects the compressor.
* 1 is fastest, 9 is best compression ratio */
#if !defined(CLEVEL)
# define CLEVEL 1 /* fastest by default */
#endif
/* check configuration */
#if (DDBITS < 0 || DDBITS > 6)
# error "invalid DDBITS"
#endif
#if (CLEVEL < 1 || CLEVEL > 9)
# error "invalid CLEVEL"
#endif
/***********************************************************************
// internal configuration
************************************************************************/
#if 1
#define N 8191 /* size of ring buffer */
#else
#define N 16383 /* size of ring buffer */
#endif
#define M1_MIN_LEN 2
#define M1_MAX_LEN 5
#define M2_MIN_LEN 3
#define M3_MIN_LEN 3
/* add a special code so that the decompressor can detect the
* end of the compressed data block (overhead is 3 bytes per block) */
#undef LZO_EOF_CODE
#define LZO_EOF_CODE
/* return -1 instead of copying if the data cannot be compressed */
#undef LZO_RETURN_IF_NOT_COMPRESSIBLE
#undef LZO_DETERMINISTIC
/***********************************************************************
// algorithm internal configuration
************************************************************************/
/* choose the hashing strategy */
#ifndef LZO_HASH
#define LZO_HASH LZO_HASH_LZO_INCREMENTAL_A
#endif
/* config */
#define DD_BITS DDBITS
#ifndef D_BITS
#define D_BITS 14
#endif
/***********************************************************************
// optimization and debugging
************************************************************************/
/* Collect statistics */
#if 0 && !defined(LZO_COLLECT_STATS)
# define LZO_COLLECT_STATS
#endif
/***********************************************************************
//
************************************************************************/
/* get bits */
#define _NEEDBITS \
{ _NEEDBYTE; b |= ((lzo_uint32) _NEXTBYTE) << k; k += 8; assert(k <= 32); }
#define NEEDBITS(j) { assert((j) < 8); if (k < (j)) _NEEDBITS }
/* set bits */
#define SETBITS(j,x) { b |= (x) << k; k += (j); assert(k <= 32); }
/* access bits */
#define MASKBITS(j) (b & ((((lzo_uint32)1 << (j)) - 1)))
/* drop bits */
#define DUMPBITS(j) { assert(k >= j); b >>= (j); k -= (j); }
#endif /* already included */
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/fake16.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
/* fake16.h -- fake the strict 16-bit memory model for test purposes
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/*
* NOTE:
* this file is *only* for testing the strict 16-bit memory model
* on a 32-bit machine. Because things like integral promotion,
* size_t and ptrdiff_t cannot be faked this is no real substitute
* for testing under a real 16-bit system.
*
* See also <lzo16bit.h>
*
* Usage: #include "src/fake16.h" at the top of <lzoconf.h>
*/
#ifndef __LZOFAKE16BIT_H
#define __LZOFAKE16BIT_H
#ifdef __LZOCONF_H
# error "include this file before lzoconf.h"
#endif
#include <limits.h>
#if (USHRT_MAX == 0xffff)
#ifdef __cplusplus
extern "C" {
#endif
#define __LZO16BIT_H /* do not use <lzo16bit.h> */
#define __LZO_STRICT_16BIT
#define __LZO_FAKE_STRICT_16BIT
#define LZO_99_UNSUPPORTED
#define LZO_999_UNSUPPORTED
typedef unsigned short lzo_uint;
typedef short lzo_int;
#define LZO_UINT_MAX USHRT_MAX
#define LZO_INT_MAX SHRT_MAX
#define lzo_sizeof_dict_t sizeof(lzo_uint)
#if 1
#define __LZO_NO_UNALIGNED
#define __LZO_NO_ALIGNED
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif
#endif /* already included */
|
Added work/contrib/lzo/lzo-1.08/src/i386/00README.TXT.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
Directory overview:
===================
src assembler sources for gcc/gas
d_asm1 sources converted for masm/tasm/wasm
d_asm2 sources converted for masm/tasm/wasm (in a `db' format)
d_asm3 sources converted for nasm (in a `db' format)
Notes:
======
- The assembler sources are designed for a flat 32 bit memory model
running in protected mode - they should work with most i386
32-bit compilers.
- All functions expect a `cdecl' (C stack based) calling convention.
The function return value will be placed into `eax'.
All other registers are preserved.
- There are no prototypes for the assembler functions - copy them
from ltest/asm.h if you need some.
- For reasons of speed all fast assembler decompressors (having `_fast'
in their name) can access (write to) up to 3 bytes past the end of
the decompressed (output) block. Data past the end of the compressed
(input) block is never accessed (read from).
See also LZO.FAQ
- The assembler functions are not available in a Windows or OS/2 DLL because
I don't know how to generate the necessary DLL export information.
- You should prefer the sources in `d_asm2' over those in `d_asm1' - many
assemblers insert their own alignment instructions or perform some
other kinds of "optimizations".
- Finally you should test if the assembler versions are actually faster
than the C version on your machine - some compilers can do a very good
optimization job, and they also can optimize the code for a specific
processor type.
|
Added work/contrib/lzo/lzo-1.08/src/i386/d_asm1/lzo1c_s1.asm.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
|
; /*** DO NOT EDIT - GENERATED AUTOMATICALLY ***/
; /*** Copyright (C) 1996-2002 Markus F.X.J. Oberhumer ***/
.386p
.model flat
.code
public _lzo1c_decompress_asm
_lzo1c_decompress_asm:
push ebp
push edi
push esi
push ebx
push ecx
push edx
sub esp,0000000cH
cld
mov esi,+28H[esp]
mov edi,+30H[esp]
mov ebp,00000003H
nop
L3: xor eax,eax
mov al,[esi]
inc esi
cmp al,20H
jae L6
or al,al
je L7
mov ecx,eax
L4: repe movsb
L5: mov al,[esi]
inc esi
cmp al,20H
jb L9
L6: cmp al,40H
jb L10
mov ecx,eax
and al,1fH
lea edx,-1H[edi]
shr ecx,05H
sub edx,eax
mov al,[esi]
inc esi
shl eax,05H
sub edx,eax
inc ecx
xchg esi,edx
repe movsb
mov esi,edx
jmp L3
lea esi,+0H[esi]
L7: mov al,[esi]
inc esi
lea ecx,+20H[eax]
cmp al,0f8H
jb L4
mov ecx,00000118H
sub al,0f8H
je L8
xchg eax,ecx
xor al,al
shl eax,cl
xchg eax,ecx
L8: repe movsb
jmp L3
lea esi,+0H[esi]
L9: lea edx,-1H[edi]
sub edx,eax
mov al,[esi]
inc esi
shl eax,05H
sub edx,eax
xchg esi,edx
movsb
movsb
movsb
mov esi,edx
movsb
xor eax,eax
jmp L5
L10: and al,1fH
mov ecx,eax
jne L13
mov cl,1fH
L11: mov al,[esi]
inc esi
or al,al
jne L12
add ecx,000000ffH
jmp L11
L12: add ecx,eax
L13: mov al,[esi]
inc esi
mov ebx,eax
and al,3fH
mov edx,edi
sub edx,eax
mov al,[esi]
inc esi
shl eax,06H
sub edx,eax
cmp edx,edi
je L14
xchg edx,esi
lea ecx,+3H[ecx]
repe movsb
mov esi,edx
xor eax,eax
shr ebx,06H
mov ecx,ebx
jne L4
jmp L3
L14: cmp ecx,00000001H
setne al
mov edx,+28H[esp]
add edx,+2cH[esp]
cmp esi,edx
ja L17
jb L16
L15: sub edi,+30H[esp]
mov edx,+34H[esp]
mov [edx],edi
neg eax
add esp,0000000cH
pop edx
pop ecx
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax,00000001H
jmp L15
L16: mov eax,00000008H
jmp L15
L17: mov eax,00000004H
jmp L15
nop
end
|
Added work/contrib/lzo/lzo-1.08/src/i386/d_asm1/lzo1c_s2.asm.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
|
; /*** DO NOT EDIT - GENERATED AUTOMATICALLY ***/
; /*** Copyright (C) 1996-2002 Markus F.X.J. Oberhumer ***/
.386p
.model flat
.code
public _lzo1c_decompress_asm_safe
_lzo1c_decompress_asm_safe:
push ebp
push edi
push esi
push ebx
push ecx
push edx
sub esp,0000000cH
cld
mov esi,+28H[esp]
mov edi,+30H[esp]
mov ebp,00000003H
lea eax,-3H[esi]
add eax,+2cH[esp]
mov +4H[esp],eax
mov eax,edi
mov edx,+34H[esp]
add eax,[edx]
mov [esp],eax
lea esi,+0H[esi]
L3: xor eax,eax
mov al,[esi]
inc esi
cmp al,20H
jae L6
or al,al
je L7
mov ecx,eax
L4: lea ebx,[edi+ecx]
cmp [esp],ebx
jb L18
lea ebx,[esi+ecx]
cmp +4H[esp],ebx
jb L17
repe movsb
L5: mov al,[esi]
inc esi
cmp al,20H
jb L9
L6: cmp al,40H
jb L10
mov ecx,eax
and al,1fH
lea edx,-1H[edi]
shr ecx,05H
sub edx,eax
mov al,[esi]
inc esi
shl eax,05H
sub edx,eax
inc ecx
xchg esi,edx
cmp esi,+30H[esp]
jb L19
lea ebx,[edi+ecx]
cmp [esp],ebx
jb L18
repe movsb
mov esi,edx
jmp L3
lea esi,+0H[esi]
L7: mov al,[esi]
inc esi
lea ecx,+20H[eax]
cmp al,0f8H
jb L4
mov ecx,00000118H
sub al,0f8H
je L8
xchg eax,ecx
xor al,al
shl eax,cl
xchg eax,ecx
L8: lea ebx,[edi+ecx]
cmp [esp],ebx
jb L18
lea ebx,[esi+ecx]
cmp +4H[esp],ebx
jb L17
repe movsb
jmp L3
lea esi,+0H[esi]
L9: lea edx,-1H[edi]
sub edx,eax
mov al,[esi]
inc esi
shl eax,05H
sub edx,eax
xchg esi,edx
cmp esi,+30H[esp]
jb L19
lea ebx,+4H[edi]
cmp [esp],ebx
jb L18
movsb
movsb
movsb
mov esi,edx
movsb
xor eax,eax
jmp L5
L10: and al,1fH
mov ecx,eax
jne L13
mov cl,1fH
L11: mov al,[esi]
inc esi
or al,al
jne L12
add ecx,000000ffH
jmp L11
lea esi,+0H[esi]
L12: add ecx,eax
L13: mov al,[esi]
inc esi
mov ebx,eax
and al,3fH
mov edx,edi
sub edx,eax
mov al,[esi]
inc esi
shl eax,06H
sub edx,eax
cmp edx,edi
je L14
xchg edx,esi
lea ecx,+3H[ecx]
cmp esi,+30H[esp]
jb L19
lea eax,[edi+ecx]
cmp [esp],eax
jb L18
repe movsb
mov esi,edx
xor eax,eax
shr ebx,06H
mov ecx,ebx
jne L4
jmp L3
L14: cmp ecx,00000001H
setne al
cmp edi,[esp]
ja L18
mov edx,+28H[esp]
add edx,+2cH[esp]
cmp esi,edx
ja L17
jb L16
L15: sub edi,+30H[esp]
mov edx,+34H[esp]
mov [edx],edi
neg eax
add esp,0000000cH
pop edx
pop ecx
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax,00000001H
jmp L15
L16: mov eax,00000008H
jmp L15
L17: mov eax,00000004H
jmp L15
L18: mov eax,00000005H
jmp L15
L19: mov eax,00000006H
jmp L15
end
|
Added work/contrib/lzo/lzo-1.08/src/i386/d_asm1/lzo1f_f1.asm.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
; /*** DO NOT EDIT - GENERATED AUTOMATICALLY ***/
; /*** Copyright (C) 1996-2002 Markus F.X.J. Oberhumer ***/
.386p
.model flat
.code
public _lzo1f_decompress_asm_fast
_lzo1f_decompress_asm_fast:
push ebp
push edi
push esi
push ebx
push ecx
push edx
sub esp,0000000cH
cld
mov esi,+28H[esp]
mov edi,+30H[esp]
mov ebp,00000003H
nop
L3: xor eax,eax
mov al,[esi]
inc esi
cmp al,1fH
ja L9
or al,al
mov ecx,eax
jne L6
L4: mov al,[esi]
inc esi
or al,al
jne L5
add ecx,000000ffH
jmp L4
L5: lea ecx,+1fH[eax+ecx]
L6: mov al,cl
shr ecx,02H
repe movsd
and al,03H
je L7
mov ebx,[esi]
add esi,eax
mov [edi],ebx
add edi,eax
L7: mov al,[esi]
inc esi
L8: cmp al,1fH
jbe L13
L9: cmp al,0dfH
ja L16
mov ecx,eax
shr eax,02H
lea edx,-1H[edi]
and al,07H
shr ecx,05H
mov ebx,eax
mov al,[esi]
lea eax,[ebx+eax*8]
inc esi
L10: sub edx,eax
add ecx,00000002H
xchg edx,esi
cmp ecx,00000006H
jb L11
cmp eax,00000004H
jb L11
mov al,cl
shr ecx,02H
repe movsd
and al,03H
mov cl,al
L11: repe movsb
mov esi,edx
L12: mov cl,-2H[esi]
and ecx,00000003H
je L3
mov eax,[esi]
add esi,ecx
mov [edi],eax
add edi,ecx
xor eax,eax
mov al,[esi]
inc esi
jmp L8
L13: shr eax,02H
lea edx,-801H[edi]
mov ecx,eax
mov al,[esi]
inc esi
lea eax,[ecx+eax*8]
sub edx,eax
mov eax,[edx]
mov [edi],eax
add edi,00000003H
jmp L12
L14: mov al,[esi]
inc esi
or al,al
jne L15
add ecx,000000ffH
jmp L14
L15: lea ecx,+1fH[eax+ecx]
jmp L17
lea esi,+0H[esi]
L16: and al,1fH
mov ecx,eax
je L14
L17: mov edx,edi
mov ax,[esi]
add esi,00000002H
shr eax,02H
jne L10
cmp ecx,00000001H
setne al
mov edx,+28H[esp]
add edx,+2cH[esp]
cmp esi,edx
ja L20
jb L19
L18: sub edi,+30H[esp]
mov edx,+34H[esp]
mov [edx],edi
neg eax
add esp,0000000cH
pop edx
pop ecx
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax,00000001H
jmp L18
L19: mov eax,00000008H
jmp L18
L20: mov eax,00000004H
jmp L18
mov esi,esi
end
|
Added work/contrib/lzo/lzo-1.08/src/i386/d_asm1/lzo1f_f2.asm.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
|
; /*** DO NOT EDIT - GENERATED AUTOMATICALLY ***/
; /*** Copyright (C) 1996-2002 Markus F.X.J. Oberhumer ***/
.386p
.model flat
.code
public _lzo1f_decompress_asm_fast_safe
_lzo1f_decompress_asm_fast_safe:
push ebp
push edi
push esi
push ebx
push ecx
push edx
sub esp,0000000cH
cld
mov esi,+28H[esp]
mov edi,+30H[esp]
mov ebp,00000003H
lea eax,-3H[esi]
add eax,+2cH[esp]
mov +4H[esp],eax
mov eax,edi
mov edx,+34H[esp]
add eax,[edx]
mov [esp],eax
lea esi,+0H[esi]
L3: xor eax,eax
mov al,[esi]
inc esi
cmp al,1fH
ja L9
or al,al
mov ecx,eax
jne L6
L4: mov al,[esi]
inc esi
or al,al
jne L5
add ecx,000000ffH
jmp L4
L5: lea ecx,+1fH[eax+ecx]
L6: lea ebx,[edi+ecx]
cmp [esp],ebx
jb L21
lea ebx,[esi+ecx]
cmp +4H[esp],ebx
jb L20
mov al,cl
shr ecx,02H
repe movsd
and al,03H
je L7
mov ebx,[esi]
add esi,eax
mov [edi],ebx
add edi,eax
L7: mov al,[esi]
inc esi
L8: cmp al,1fH
jbe L13
L9: cmp al,0dfH
ja L16
mov ecx,eax
shr eax,02H
lea edx,-1H[edi]
and al,07H
shr ecx,05H
mov ebx,eax
mov al,[esi]
lea eax,[ebx+eax*8]
inc esi
L10: sub edx,eax
add ecx,00000002H
xchg edx,esi
cmp esi,+30H[esp]
jb L22
lea ebx,[edi+ecx]
cmp [esp],ebx
jb L21
cmp ecx,00000006H
jb L11
cmp eax,00000004H
jb L11
mov al,cl
shr ecx,02H
repe movsd
and al,03H
mov cl,al
L11: repe movsb
mov esi,edx
L12: mov cl,-2H[esi]
and ecx,00000003H
je L3
mov eax,[esi]
add esi,ecx
mov [edi],eax
add edi,ecx
xor eax,eax
mov al,[esi]
inc esi
jmp L8
L13: lea edx,+3H[edi]
cmp [esp],edx
jb L21
shr eax,02H
lea edx,-801H[edi]
mov ecx,eax
mov al,[esi]
inc esi
lea eax,[ecx+eax*8]
sub edx,eax
cmp edx,+30H[esp]
jb L22
mov eax,[edx]
mov [edi],eax
add edi,00000003H
jmp L12
L14: mov al,[esi]
inc esi
or al,al
jne L15
add ecx,000000ffH
jmp L14
L15: lea ecx,+1fH[eax+ecx]
jmp L17
lea esi,+0H[esi]
L16: and al,1fH
mov ecx,eax
je L14
L17: mov edx,edi
mov ax,[esi]
add esi,00000002H
shr eax,02H
jne L10
cmp ecx,00000001H
setne al
cmp edi,[esp]
ja L21
mov edx,+28H[esp]
add edx,+2cH[esp]
cmp esi,edx
ja L20
jb L19
L18: sub edi,+30H[esp]
mov edx,+34H[esp]
mov [edx],edi
neg eax
add esp,0000000cH
pop edx
pop ecx
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax,00000001H
jmp L18
L19: mov eax,00000008H
jmp L18
L20: mov eax,00000004H
jmp L18
L21: mov eax,00000005H
jmp L18
L22: mov eax,00000006H
jmp L18
lea esi,+0H[esi]
end
|
Added work/contrib/lzo/lzo-1.08/src/i386/d_asm1/lzo1x_f1.asm.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
|
; /*** DO NOT EDIT - GENERATED AUTOMATICALLY ***/
; /*** Copyright (C) 1996-2002 Markus F.X.J. Oberhumer ***/
.386p
.model flat
.code
public _lzo1x_decompress_asm_fast
_lzo1x_decompress_asm_fast:
push ebp
push edi
push esi
push ebx
push ecx
push edx
sub esp,0000000cH
cld
mov esi,+28H[esp]
mov edi,+30H[esp]
mov ebp,00000003H
xor eax,eax
xor ebx,ebx
lodsb
cmp al,11H
jbe L6
sub al,0eH
jmp L7
L3: add eax,000000ffH
L4: mov bl,[esi]
inc esi
or bl,bl
je L3
lea eax,+15H[eax+ebx]
jmp L7
mov esi,esi
L5: mov al,[esi]
inc esi
L6: cmp al,10H
jae L9
or al,al
je L4
add eax,00000006H
L7: mov ecx,eax
xor eax,ebp
shr ecx,02H
and eax,ebp
L8: mov edx,[esi]
add esi,00000004H
mov [edi],edx
add edi,00000004H
dec ecx
jne L8
sub esi,eax
sub edi,eax
mov al,[esi]
inc esi
cmp al,10H
jae L9
shr eax,02H
mov bl,[esi]
lea edx,-801H[edi]
lea eax,[eax+ebx*4]
inc esi
sub edx,eax
mov ecx,[edx]
mov [edi],ecx
add edi,ebp
jmp L16
L9: cmp al,40H
jb L12
mov ecx,eax
shr eax,02H
lea edx,-1H[edi]
and eax,00000007H
mov bl,[esi]
shr ecx,05H
lea eax,[eax+ebx*8]
inc esi
sub edx,eax
add ecx,00000004H
cmp eax,ebp
jae L14
jmp L17
L10: add eax,000000ffH
L11: mov bl,[esi]
inc esi
or bl,bl
je L10
lea ecx,+24H[eax+ebx]
xor eax,eax
jmp L13
nop
L12: cmp al,20H
jb L20
and eax,0000001fH
je L11
lea ecx,+5H[eax]
L13: mov ax,[esi]
lea edx,-1H[edi]
shr eax,02H
add esi,00000002H
sub edx,eax
cmp eax,ebp
jb L17
L14: lea eax,-3H[edi+ecx]
shr ecx,02H
L15: mov ebx,[edx]
add edx,00000004H
mov [edi],ebx
add edi,00000004H
dec ecx
jne L15
mov edi,eax
xor ebx,ebx
L16: mov al,-2H[esi]
and eax,ebp
je L5
mov edx,[esi]
add esi,eax
mov [edi],edx
add edi,eax
mov al,[esi]
inc esi
jmp L9
lea esi,+0H[esi]
L17: xchg edx,esi
sub ecx,ebp
repe movsb
mov esi,edx
jmp L16
L18: add ecx,000000ffH
L19: mov bl,[esi]
inc esi
or bl,bl
je L18
lea ecx,+0cH[ebx+ecx]
jmp L21
lea esi,+0H[esi]
L20: cmp al,10H
jb L22
mov ecx,eax
and eax,00000008H
shl eax,0dH
and ecx,00000007H
je L19
add ecx,00000005H
L21: mov ax,[esi]
add esi,00000002H
lea edx,-4000H[edi]
shr eax,02H
je L23
sub edx,eax
jmp L14
lea esi,+0H[esi]
L22: shr eax,02H
mov bl,[esi]
lea edx,-1H[edi]
lea eax,[eax+ebx*4]
inc esi
sub edx,eax
mov al,[edx]
mov [edi],al
mov bl,+1H[edx]
mov +1H[edi],bl
add edi,00000002H
jmp L16
L23: cmp ecx,00000006H
setne al
mov edx,+28H[esp]
add edx,+2cH[esp]
cmp esi,edx
ja L26
jb L25
L24: sub edi,+30H[esp]
mov edx,+34H[esp]
mov [edx],edi
neg eax
add esp,0000000cH
pop edx
pop ecx
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax,00000001H
jmp L24
L25: mov eax,00000008H
jmp L24
L26: mov eax,00000004H
jmp L24
nop
end
|
Added work/contrib/lzo/lzo-1.08/src/i386/d_asm1/lzo1x_f2.asm.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
|
; /*** DO NOT EDIT - GENERATED AUTOMATICALLY ***/
; /*** Copyright (C) 1996-2002 Markus F.X.J. Oberhumer ***/
.386p
.model flat
.code
public _lzo1x_decompress_asm_fast_safe
_lzo1x_decompress_asm_fast_safe:
push ebp
push edi
push esi
push ebx
push ecx
push edx
sub esp,0000000cH
cld
mov esi,+28H[esp]
mov edi,+30H[esp]
mov ebp,00000003H
lea eax,-3H[esi]
add eax,+2cH[esp]
mov +4H[esp],eax
mov eax,edi
mov edx,+34H[esp]
add eax,[edx]
mov [esp],eax
xor eax,eax
xor ebx,ebx
lodsb
cmp al,11H
jbe L6
sub al,0eH
jmp L7
L3: add eax,000000ffH
lea edx,+12H[esi+eax]
cmp +4H[esp],edx
jb L26
L4: mov bl,[esi]
inc esi
or bl,bl
je L3
lea eax,+15H[eax+ebx]
jmp L7
lea esi,+0H[esi]
L5: cmp +4H[esp],esi
jb L26
mov al,[esi]
inc esi
L6: cmp al,10H
jae L9
or al,al
je L4
add eax,00000006H
L7: lea edx,-3H[edi+eax]
cmp [esp],edx
jb L27
lea edx,-3H[esi+eax]
cmp +4H[esp],edx
jb L26
mov ecx,eax
xor eax,ebp
shr ecx,02H
and eax,ebp
L8: mov edx,[esi]
add esi,00000004H
mov [edi],edx
add edi,00000004H
dec ecx
jne L8
sub esi,eax
sub edi,eax
mov al,[esi]
inc esi
cmp al,10H
jae L9
lea edx,+3H[edi]
cmp [esp],edx
jb L27
shr eax,02H
mov bl,[esi]
lea edx,-801H[edi]
lea eax,[eax+ebx*4]
inc esi
sub edx,eax
cmp edx,+30H[esp]
jb L28
mov ecx,[edx]
mov [edi],ecx
add edi,ebp
jmp L16
mov esi,esi
L9: cmp al,40H
jb L12
mov ecx,eax
shr eax,02H
lea edx,-1H[edi]
and eax,00000007H
mov bl,[esi]
shr ecx,05H
lea eax,[eax+ebx*8]
inc esi
sub edx,eax
add ecx,00000004H
cmp eax,ebp
jae L14
jmp L17
L10: add eax,000000ffH
lea edx,+3H[esi]
cmp +4H[esp],edx
jb L26
L11: mov bl,[esi]
inc esi
or bl,bl
je L10
lea ecx,+24H[eax+ebx]
xor eax,eax
jmp L13
nop
L12: cmp al,20H
jb L20
and eax,0000001fH
je L11
lea ecx,+5H[eax]
L13: mov ax,[esi]
lea edx,-1H[edi]
shr eax,02H
add esi,00000002H
sub edx,eax
cmp eax,ebp
jb L17
L14: cmp edx,+30H[esp]
jb L28
lea eax,-3H[edi+ecx]
shr ecx,02H
cmp [esp],eax
jb L27
L15: mov ebx,[edx]
add edx,00000004H
mov [edi],ebx
add edi,00000004H
dec ecx
jne L15
mov edi,eax
xor ebx,ebx
L16: mov al,-2H[esi]
and eax,ebp
je L5
lea edx,[edi+eax]
cmp [esp],edx
jb L27
lea edx,[esi+eax]
cmp +4H[esp],edx
jb L26
mov edx,[esi]
add esi,eax
mov [edi],edx
add edi,eax
mov al,[esi]
inc esi
jmp L9
lea esi,+0H[esi]
L17: cmp edx,+30H[esp]
jb L28
lea eax,-3H[edi+ecx]
cmp [esp],eax
jb L27
xchg edx,esi
sub ecx,ebp
repe movsb
mov esi,edx
jmp L16
L18: add ecx,000000ffH
lea edx,+3H[esi]
cmp +4H[esp],edx
jb L26
L19: mov bl,[esi]
inc esi
or bl,bl
je L18
lea ecx,+0cH[ebx+ecx]
jmp L21
lea esi,+0H[esi]
L20: cmp al,10H
jb L22
mov ecx,eax
and eax,00000008H
shl eax,0dH
and ecx,00000007H
je L19
add ecx,00000005H
L21: mov ax,[esi]
add esi,00000002H
lea edx,-4000H[edi]
shr eax,02H
je L23
sub edx,eax
jmp L14
lea esi,+0H[esi]
L22: lea edx,+2H[edi]
cmp [esp],edx
jb L27
shr eax,02H
mov bl,[esi]
lea edx,-1H[edi]
lea eax,[eax+ebx*4]
inc esi
sub edx,eax
cmp edx,+30H[esp]
jb L28
mov al,[edx]
mov [edi],al
mov bl,+1H[edx]
mov +1H[edi],bl
add edi,00000002H
jmp L16
L23: cmp ecx,00000006H
setne al
cmp edi,[esp]
ja L27
mov edx,+28H[esp]
add edx,+2cH[esp]
cmp esi,edx
ja L26
jb L25
L24: sub edi,+30H[esp]
mov edx,+34H[esp]
mov [edx],edi
neg eax
add esp,0000000cH
pop edx
pop ecx
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax,00000001H
jmp L24
L25: mov eax,00000008H
jmp L24
L26: mov eax,00000004H
jmp L24
L27: mov eax,00000005H
jmp L24
L28: mov eax,00000006H
jmp L24
end
|
Added work/contrib/lzo/lzo-1.08/src/i386/d_asm1/lzo1x_s1.asm.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
|
; /*** DO NOT EDIT - GENERATED AUTOMATICALLY ***/
; /*** Copyright (C) 1996-2002 Markus F.X.J. Oberhumer ***/
.386p
.model flat
.code
public _lzo1x_decompress_asm
_lzo1x_decompress_asm:
push ebp
push edi
push esi
push ebx
push ecx
push edx
sub esp,0000000cH
cld
mov esi,+28H[esp]
mov edi,+30H[esp]
mov ebp,00000003H
xor eax,eax
xor ebx,ebx
lodsb
cmp al,11H
jbe L6
sub al,11H
cmp al,04H
jae L7
mov ecx,eax
jmp L9
L3: add eax,000000ffH
L4: mov bl,[esi]
inc esi
or bl,bl
je L3
lea eax,+12H[eax+ebx]
jmp L7
lea esi,+0H[esi]
L5: mov al,[esi]
inc esi
L6: cmp al,10H
jae L10
or al,al
je L4
add eax,00000003H
L7: mov ecx,eax
shr eax,02H
and ecx,ebp
L8: mov edx,[esi]
add esi,00000004H
mov [edi],edx
add edi,00000004H
dec eax
jne L8
L9: repe movsb
mov al,[esi]
inc esi
cmp al,10H
jae L10
shr eax,02H
mov bl,[esi]
lea edx,-801H[edi]
lea eax,[eax+ebx*4]
inc esi
sub edx,eax
mov al,[edx]
mov [edi],al
mov al,+1H[edx]
mov +1H[edi],al
mov al,+2H[edx]
mov +2H[edi],al
add edi,ebp
jmp L18
L10: cmp al,40H
jb L13
mov ecx,eax
shr eax,02H
lea edx,-1H[edi]
and eax,00000007H
mov bl,[esi]
shr ecx,05H
lea eax,[eax+ebx*8]
inc esi
sub edx,eax
inc ecx
cmp eax,ebp
jae L15
jmp L20
L11: add eax,000000ffH
L12: mov bl,[esi]
inc esi
or bl,bl
je L11
lea ecx,+21H[eax+ebx]
xor eax,eax
jmp L14
lea esi,+0H[esi]
L13: cmp al,20H
jb L23
and eax,0000001fH
je L12
lea ecx,+2H[eax]
L14: mov ax,[esi]
lea edx,-1H[edi]
shr eax,02H
add esi,00000002H
sub edx,eax
cmp eax,ebp
jb L20
L15: mov ebx,ecx
shr ebx,02H
je L17
L16: mov eax,[edx]
add edx,00000004H
mov [edi],eax
add edi,00000004H
dec ebx
jne L16
and ecx,ebp
je L18
L17: mov al,[edx]
inc edx
mov [edi],al
inc edi
dec ecx
jne L17
L18: mov al,-2H[esi]
and eax,ebp
je L5
L19: mov cl,[esi]
inc esi
mov [edi],cl
inc edi
dec eax
jne L19
mov al,[esi]
inc esi
jmp L10
nop
lea esi,+0H[esi]
L20: xchg edx,esi
repe movsb
mov esi,edx
jmp L18
L21: add ecx,000000ffH
L22: mov bl,[esi]
inc esi
or bl,bl
je L21
lea ecx,+9H[ebx+ecx]
jmp L24
nop
lea esi,+0H[esi]
L23: cmp al,10H
jb L25
mov ecx,eax
and eax,00000008H
shl eax,0dH
and ecx,00000007H
je L22
add ecx,00000002H
L24: mov ax,[esi]
add esi,00000002H
lea edx,-4000H[edi]
shr eax,02H
je L26
sub edx,eax
jmp L15
lea esi,+0H[esi]
L25: shr eax,02H
mov bl,[esi]
lea edx,-1H[edi]
lea eax,[eax+ebx*4]
inc esi
sub edx,eax
mov al,[edx]
mov [edi],al
mov bl,+1H[edx]
mov +1H[edi],bl
add edi,00000002H
jmp L18
L26: cmp ecx,00000003H
setne al
mov edx,+28H[esp]
add edx,+2cH[esp]
cmp esi,edx
ja L29
jb L28
L27: sub edi,+30H[esp]
mov edx,+34H[esp]
mov [edx],edi
neg eax
add esp,0000000cH
pop edx
pop ecx
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax,00000001H
jmp L27
L28: mov eax,00000008H
jmp L27
L29: mov eax,00000004H
jmp L27
nop
end
|
Added work/contrib/lzo/lzo-1.08/src/i386/d_asm1/lzo1x_s2.asm.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
|
; /*** DO NOT EDIT - GENERATED AUTOMATICALLY ***/
; /*** Copyright (C) 1996-2002 Markus F.X.J. Oberhumer ***/
.386p
.model flat
.code
public _lzo1x_decompress_asm_safe
_lzo1x_decompress_asm_safe:
push ebp
push edi
push esi
push ebx
push ecx
push edx
sub esp,0000000cH
cld
mov esi,+28H[esp]
mov edi,+30H[esp]
mov ebp,00000003H
lea eax,-3H[esi]
add eax,+2cH[esp]
mov +4H[esp],eax
mov eax,edi
mov edx,+34H[esp]
add eax,[edx]
mov [esp],eax
xor eax,eax
xor ebx,ebx
lodsb
cmp al,11H
jbe L6
sub al,11H
cmp al,04H
jae L7
lea edx,[edi+eax]
cmp [esp],edx
jb L30
lea edx,[esi+eax]
cmp +4H[esp],edx
jb L29
mov ecx,eax
jmp L9
L3: add eax,000000ffH
lea edx,+12H[esi+eax]
cmp +4H[esp],edx
jb L29
L4: mov bl,[esi]
inc esi
or bl,bl
je L3
lea eax,+12H[eax+ebx]
jmp L7
lea esi,+0H[esi]
L5: cmp +4H[esp],esi
jb L29
mov al,[esi]
inc esi
L6: cmp al,10H
jae L10
or al,al
je L4
add eax,00000003H
L7: lea edx,+0H[edi+eax]
cmp [esp],edx
jb L30
lea edx,+0H[esi+eax]
cmp +4H[esp],edx
jb L29
mov ecx,eax
shr eax,02H
and ecx,ebp
L8: mov edx,[esi]
add esi,00000004H
mov [edi],edx
add edi,00000004H
dec eax
jne L8
L9: repe movsb
mov al,[esi]
inc esi
cmp al,10H
jae L10
lea edx,+3H[edi]
cmp [esp],edx
jb L30
shr eax,02H
mov bl,[esi]
lea edx,-801H[edi]
lea eax,[eax+ebx*4]
inc esi
sub edx,eax
cmp edx,+30H[esp]
jb L31
mov al,[edx]
mov [edi],al
mov al,+1H[edx]
mov +1H[edi],al
mov al,+2H[edx]
mov +2H[edi],al
add edi,ebp
jmp L18
mov esi,esi
L10: cmp al,40H
jb L13
mov ecx,eax
shr eax,02H
lea edx,-1H[edi]
and eax,00000007H
mov bl,[esi]
shr ecx,05H
lea eax,[eax+ebx*8]
inc esi
sub edx,eax
inc ecx
cmp eax,ebp
jae L15
jmp L20
L11: add eax,000000ffH
lea edx,+3H[esi]
cmp +4H[esp],edx
jb L29
L12: mov bl,[esi]
inc esi
or bl,bl
je L11
lea ecx,+21H[eax+ebx]
xor eax,eax
jmp L14
lea esi,+0H[esi]
L13: cmp al,20H
jb L23
and eax,0000001fH
je L12
lea ecx,+2H[eax]
L14: mov ax,[esi]
lea edx,-1H[edi]
shr eax,02H
add esi,00000002H
sub edx,eax
cmp eax,ebp
jb L20
L15: cmp edx,+30H[esp]
jb L31
lea eax,[edi+ecx]
cmp [esp],eax
jb L30
mov ebx,ecx
shr ebx,02H
je L17
L16: mov eax,[edx]
add edx,00000004H
mov [edi],eax
add edi,00000004H
dec ebx
jne L16
and ecx,ebp
je L18
L17: mov al,[edx]
inc edx
mov [edi],al
inc edi
dec ecx
jne L17
L18: mov al,-2H[esi]
and eax,ebp
je L5
lea edx,[edi+eax]
cmp [esp],edx
jb L30
lea edx,[esi+eax]
cmp +4H[esp],edx
jb L29
L19: mov cl,[esi]
inc esi
mov [edi],cl
inc edi
dec eax
jne L19
mov al,[esi]
inc esi
jmp L10
mov esi,esi
L20: cmp edx,+30H[esp]
jb L31
lea eax,+0H[edi+ecx]
cmp [esp],eax
jb L30
xchg edx,esi
repe movsb
mov esi,edx
jmp L18
L21: add ecx,000000ffH
lea edx,+3H[esi]
cmp +4H[esp],edx
jb L29
L22: mov bl,[esi]
inc esi
or bl,bl
je L21
lea ecx,+9H[ebx+ecx]
jmp L24
nop
L23: cmp al,10H
jb L25
mov ecx,eax
and eax,00000008H
shl eax,0dH
and ecx,00000007H
je L22
add ecx,00000002H
L24: mov ax,[esi]
add esi,00000002H
lea edx,-4000H[edi]
shr eax,02H
je L26
sub edx,eax
jmp L15
lea esi,+0H[esi]
L25: lea edx,+2H[edi]
cmp [esp],edx
jb L30
shr eax,02H
mov bl,[esi]
lea edx,-1H[edi]
lea eax,[eax+ebx*4]
inc esi
sub edx,eax
cmp edx,+30H[esp]
jb L31
mov al,[edx]
mov [edi],al
mov bl,+1H[edx]
mov +1H[edi],bl
add edi,00000002H
jmp L18
L26: cmp ecx,00000003H
setne al
cmp edi,[esp]
ja L30
mov edx,+28H[esp]
add edx,+2cH[esp]
cmp esi,edx
ja L29
jb L28
L27: sub edi,+30H[esp]
mov edx,+34H[esp]
mov [edx],edi
neg eax
add esp,0000000cH
pop edx
pop ecx
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax,00000001H
jmp L27
L28: mov eax,00000008H
jmp L27
L29: mov eax,00000004H
jmp L27
L30: mov eax,00000005H
jmp L27
L31: mov eax,00000006H
jmp L27
end
|
Added work/contrib/lzo/lzo-1.08/src/i386/d_asm1/lzo1y_f1.asm.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
|
; /*** DO NOT EDIT - GENERATED AUTOMATICALLY ***/
; /*** Copyright (C) 1996-2002 Markus F.X.J. Oberhumer ***/
.386p
.model flat
.code
public _lzo1y_decompress_asm_fast
_lzo1y_decompress_asm_fast:
push ebp
push edi
push esi
push ebx
push ecx
push edx
sub esp,0000000cH
cld
mov esi,+28H[esp]
mov edi,+30H[esp]
mov ebp,00000003H
xor eax,eax
xor ebx,ebx
lodsb
cmp al,11H
jbe L6
sub al,0eH
jmp L7
L3: add eax,000000ffH
L4: mov bl,[esi]
inc esi
or bl,bl
je L3
lea eax,+15H[eax+ebx]
jmp L7
mov esi,esi
L5: mov al,[esi]
inc esi
L6: cmp al,10H
jae L9
or al,al
je L4
add eax,00000006H
L7: mov ecx,eax
xor eax,ebp
shr ecx,02H
and eax,ebp
L8: mov edx,[esi]
add esi,00000004H
mov [edi],edx
add edi,00000004H
dec ecx
jne L8
sub esi,eax
sub edi,eax
mov al,[esi]
inc esi
cmp al,10H
jae L9
shr eax,02H
mov bl,[esi]
lea edx,-401H[edi]
lea eax,[eax+ebx*4]
inc esi
sub edx,eax
mov ecx,[edx]
mov [edi],ecx
add edi,ebp
jmp L16
L9: cmp al,40H
jb L12
mov ecx,eax
shr eax,02H
lea edx,-1H[edi]
and eax,ebp
mov bl,[esi]
shr ecx,04H
lea eax,[eax+ebx*4]
inc esi
sub edx,eax
add ecx,00000002H
cmp eax,ebp
jae L14
jmp L17
L10: add eax,000000ffH
L11: mov bl,[esi]
inc esi
or bl,bl
je L10
lea ecx,+24H[eax+ebx]
xor eax,eax
jmp L13
mov esi,esi
L12: cmp al,20H
jb L20
and eax,0000001fH
je L11
lea ecx,+5H[eax]
L13: mov ax,[esi]
lea edx,-1H[edi]
shr eax,02H
add esi,00000002H
sub edx,eax
cmp eax,ebp
jb L17
L14: lea eax,-3H[edi+ecx]
shr ecx,02H
L15: mov ebx,[edx]
add edx,00000004H
mov [edi],ebx
add edi,00000004H
dec ecx
jne L15
mov edi,eax
xor ebx,ebx
L16: mov al,-2H[esi]
and eax,ebp
je L5
mov edx,[esi]
add esi,eax
mov [edi],edx
add edi,eax
mov al,[esi]
inc esi
jmp L9
lea esi,+0H[esi]
L17: xchg edx,esi
sub ecx,ebp
repe movsb
mov esi,edx
jmp L16
L18: add ecx,000000ffH
L19: mov bl,[esi]
inc esi
or bl,bl
je L18
lea ecx,+0cH[ebx+ecx]
jmp L21
lea esi,+0H[esi]
L20: cmp al,10H
jb L22
mov ecx,eax
and eax,00000008H
shl eax,0dH
and ecx,00000007H
je L19
add ecx,00000005H
L21: mov ax,[esi]
add esi,00000002H
lea edx,-4000H[edi]
shr eax,02H
je L23
sub edx,eax
jmp L14
lea esi,+0H[esi]
L22: shr eax,02H
mov bl,[esi]
lea edx,-1H[edi]
lea eax,[eax+ebx*4]
inc esi
sub edx,eax
mov al,[edx]
mov [edi],al
mov bl,+1H[edx]
mov +1H[edi],bl
add edi,00000002H
jmp L16
L23: cmp ecx,00000006H
setne al
mov edx,+28H[esp]
add edx,+2cH[esp]
cmp esi,edx
ja L26
jb L25
L24: sub edi,+30H[esp]
mov edx,+34H[esp]
mov [edx],edi
neg eax
add esp,0000000cH
pop edx
pop ecx
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax,00000001H
jmp L24
L25: mov eax,00000008H
jmp L24
L26: mov eax,00000004H
jmp L24
nop
end
|
Added work/contrib/lzo/lzo-1.08/src/i386/d_asm1/lzo1y_f2.asm.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
|
; /*** DO NOT EDIT - GENERATED AUTOMATICALLY ***/
; /*** Copyright (C) 1996-2002 Markus F.X.J. Oberhumer ***/
.386p
.model flat
.code
public _lzo1y_decompress_asm_fast_safe
_lzo1y_decompress_asm_fast_safe:
push ebp
push edi
push esi
push ebx
push ecx
push edx
sub esp,0000000cH
cld
mov esi,+28H[esp]
mov edi,+30H[esp]
mov ebp,00000003H
lea eax,-3H[esi]
add eax,+2cH[esp]
mov +4H[esp],eax
mov eax,edi
mov edx,+34H[esp]
add eax,[edx]
mov [esp],eax
xor eax,eax
xor ebx,ebx
lodsb
cmp al,11H
jbe L6
sub al,0eH
jmp L7
L3: add eax,000000ffH
lea edx,+12H[esi+eax]
cmp +4H[esp],edx
jb L26
L4: mov bl,[esi]
inc esi
or bl,bl
je L3
lea eax,+15H[eax+ebx]
jmp L7
lea esi,+0H[esi]
L5: cmp +4H[esp],esi
jb L26
mov al,[esi]
inc esi
L6: cmp al,10H
jae L9
or al,al
je L4
add eax,00000006H
L7: lea edx,-3H[edi+eax]
cmp [esp],edx
jb L27
lea edx,-3H[esi+eax]
cmp +4H[esp],edx
jb L26
mov ecx,eax
xor eax,ebp
shr ecx,02H
and eax,ebp
L8: mov edx,[esi]
add esi,00000004H
mov [edi],edx
add edi,00000004H
dec ecx
jne L8
sub esi,eax
sub edi,eax
mov al,[esi]
inc esi
cmp al,10H
jae L9
lea edx,+3H[edi]
cmp [esp],edx
jb L27
shr eax,02H
mov bl,[esi]
lea edx,-401H[edi]
lea eax,[eax+ebx*4]
inc esi
sub edx,eax
cmp edx,+30H[esp]
jb L28
mov ecx,[edx]
mov [edi],ecx
add edi,ebp
jmp L16
mov esi,esi
L9: cmp al,40H
jb L12
mov ecx,eax
shr eax,02H
lea edx,-1H[edi]
and eax,ebp
mov bl,[esi]
shr ecx,04H
lea eax,[eax+ebx*4]
inc esi
sub edx,eax
add ecx,00000002H
cmp eax,ebp
jae L14
jmp L17
L10: add eax,000000ffH
lea edx,+3H[esi]
cmp +4H[esp],edx
jb L26
L11: mov bl,[esi]
inc esi
or bl,bl
je L10
lea ecx,+24H[eax+ebx]
xor eax,eax
jmp L13
mov esi,esi
L12: cmp al,20H
jb L20
and eax,0000001fH
je L11
lea ecx,+5H[eax]
L13: mov ax,[esi]
lea edx,-1H[edi]
shr eax,02H
add esi,00000002H
sub edx,eax
cmp eax,ebp
jb L17
L14: cmp edx,+30H[esp]
jb L28
lea eax,-3H[edi+ecx]
shr ecx,02H
cmp [esp],eax
jb L27
L15: mov ebx,[edx]
add edx,00000004H
mov [edi],ebx
add edi,00000004H
dec ecx
jne L15
mov edi,eax
xor ebx,ebx
L16: mov al,-2H[esi]
and eax,ebp
je L5
lea edx,[edi+eax]
cmp [esp],edx
jb L27
lea edx,[esi+eax]
cmp +4H[esp],edx
jb L26
mov edx,[esi]
add esi,eax
mov [edi],edx
add edi,eax
mov al,[esi]
inc esi
jmp L9
lea esi,+0H[esi]
L17: cmp edx,+30H[esp]
jb L28
lea eax,-3H[edi+ecx]
cmp [esp],eax
jb L27
xchg edx,esi
sub ecx,ebp
repe movsb
mov esi,edx
jmp L16
L18: add ecx,000000ffH
lea edx,+3H[esi]
cmp +4H[esp],edx
jb L26
L19: mov bl,[esi]
inc esi
or bl,bl
je L18
lea ecx,+0cH[ebx+ecx]
jmp L21
lea esi,+0H[esi]
L20: cmp al,10H
jb L22
mov ecx,eax
and eax,00000008H
shl eax,0dH
and ecx,00000007H
je L19
add ecx,00000005H
L21: mov ax,[esi]
add esi,00000002H
lea edx,-4000H[edi]
shr eax,02H
je L23
sub edx,eax
jmp L14
lea esi,+0H[esi]
L22: lea edx,+2H[edi]
cmp [esp],edx
jb L27
shr eax,02H
mov bl,[esi]
lea edx,-1H[edi]
lea eax,[eax+ebx*4]
inc esi
sub edx,eax
cmp edx,+30H[esp]
jb L28
mov al,[edx]
mov [edi],al
mov bl,+1H[edx]
mov +1H[edi],bl
add edi,00000002H
jmp L16
L23: cmp ecx,00000006H
setne al
cmp edi,[esp]
ja L27
mov edx,+28H[esp]
add edx,+2cH[esp]
cmp esi,edx
ja L26
jb L25
L24: sub edi,+30H[esp]
mov edx,+34H[esp]
mov [edx],edi
neg eax
add esp,0000000cH
pop edx
pop ecx
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax,00000001H
jmp L24
L25: mov eax,00000008H
jmp L24
L26: mov eax,00000004H
jmp L24
L27: mov eax,00000005H
jmp L24
L28: mov eax,00000006H
jmp L24
end
|
Added work/contrib/lzo/lzo-1.08/src/i386/d_asm1/lzo1y_s1.asm.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
|
; /*** DO NOT EDIT - GENERATED AUTOMATICALLY ***/
; /*** Copyright (C) 1996-2002 Markus F.X.J. Oberhumer ***/
.386p
.model flat
.code
public _lzo1y_decompress_asm
_lzo1y_decompress_asm:
push ebp
push edi
push esi
push ebx
push ecx
push edx
sub esp,0000000cH
cld
mov esi,+28H[esp]
mov edi,+30H[esp]
mov ebp,00000003H
xor eax,eax
xor ebx,ebx
lodsb
cmp al,11H
jbe L6
sub al,11H
cmp al,04H
jae L7
mov ecx,eax
jmp L9
L3: add eax,000000ffH
L4: mov bl,[esi]
inc esi
or bl,bl
je L3
lea eax,+12H[eax+ebx]
jmp L7
lea esi,+0H[esi]
L5: mov al,[esi]
inc esi
L6: cmp al,10H
jae L10
or al,al
je L4
add eax,00000003H
L7: mov ecx,eax
shr eax,02H
and ecx,ebp
L8: mov edx,[esi]
add esi,00000004H
mov [edi],edx
add edi,00000004H
dec eax
jne L8
L9: repe movsb
mov al,[esi]
inc esi
cmp al,10H
jae L10
shr eax,02H
mov bl,[esi]
lea edx,-401H[edi]
lea eax,[eax+ebx*4]
inc esi
sub edx,eax
mov al,[edx]
mov [edi],al
mov al,+1H[edx]
mov +1H[edi],al
mov al,+2H[edx]
mov +2H[edi],al
add edi,ebp
jmp L18
L10: cmp al,40H
jb L13
mov ecx,eax
shr eax,02H
lea edx,-1H[edi]
and eax,ebp
mov bl,[esi]
shr ecx,04H
lea eax,[eax+ebx*4]
inc esi
sub edx,eax
dec ecx
cmp eax,ebp
jae L15
jmp L20
L11: add eax,000000ffH
L12: mov bl,[esi]
inc esi
or bl,bl
je L11
lea ecx,+21H[eax+ebx]
xor eax,eax
jmp L14
lea esi,+0H[esi]
L13: cmp al,20H
jb L23
and eax,0000001fH
je L12
lea ecx,+2H[eax]
L14: mov ax,[esi]
lea edx,-1H[edi]
shr eax,02H
add esi,00000002H
sub edx,eax
cmp eax,ebp
jb L20
L15: mov ebx,ecx
shr ebx,02H
je L17
L16: mov eax,[edx]
add edx,00000004H
mov [edi],eax
add edi,00000004H
dec ebx
jne L16
and ecx,ebp
je L18
L17: mov al,[edx]
inc edx
mov [edi],al
inc edi
dec ecx
jne L17
L18: mov al,-2H[esi]
and eax,ebp
je L5
L19: mov cl,[esi]
inc esi
mov [edi],cl
inc edi
dec eax
jne L19
mov al,[esi]
inc esi
jmp L10
nop
lea esi,+0H[esi]
L20: xchg edx,esi
repe movsb
mov esi,edx
jmp L18
L21: add ecx,000000ffH
L22: mov bl,[esi]
inc esi
or bl,bl
je L21
lea ecx,+9H[ebx+ecx]
jmp L24
nop
lea esi,+0H[esi]
L23: cmp al,10H
jb L25
mov ecx,eax
and eax,00000008H
shl eax,0dH
and ecx,00000007H
je L22
add ecx,00000002H
L24: mov ax,[esi]
add esi,00000002H
lea edx,-4000H[edi]
shr eax,02H
je L26
sub edx,eax
jmp L15
lea esi,+0H[esi]
L25: shr eax,02H
mov bl,[esi]
lea edx,-1H[edi]
lea eax,[eax+ebx*4]
inc esi
sub edx,eax
mov al,[edx]
mov [edi],al
mov bl,+1H[edx]
mov +1H[edi],bl
add edi,00000002H
jmp L18
L26: cmp ecx,00000003H
setne al
mov edx,+28H[esp]
add edx,+2cH[esp]
cmp esi,edx
ja L29
jb L28
L27: sub edi,+30H[esp]
mov edx,+34H[esp]
mov [edx],edi
neg eax
add esp,0000000cH
pop edx
pop ecx
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax,00000001H
jmp L27
L28: mov eax,00000008H
jmp L27
L29: mov eax,00000004H
jmp L27
nop
end
|
Added work/contrib/lzo/lzo-1.08/src/i386/d_asm1/lzo1y_s2.asm.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
|
; /*** DO NOT EDIT - GENERATED AUTOMATICALLY ***/
; /*** Copyright (C) 1996-2002 Markus F.X.J. Oberhumer ***/
.386p
.model flat
.code
public _lzo1y_decompress_asm_safe
_lzo1y_decompress_asm_safe:
push ebp
push edi
push esi
push ebx
push ecx
push edx
sub esp,0000000cH
cld
mov esi,+28H[esp]
mov edi,+30H[esp]
mov ebp,00000003H
lea eax,-3H[esi]
add eax,+2cH[esp]
mov +4H[esp],eax
mov eax,edi
mov edx,+34H[esp]
add eax,[edx]
mov [esp],eax
xor eax,eax
xor ebx,ebx
lodsb
cmp al,11H
jbe L6
sub al,11H
cmp al,04H
jae L7
lea edx,[edi+eax]
cmp [esp],edx
jb L30
lea edx,[esi+eax]
cmp +4H[esp],edx
jb L29
mov ecx,eax
jmp L9
L3: add eax,000000ffH
lea edx,+12H[esi+eax]
cmp +4H[esp],edx
jb L29
L4: mov bl,[esi]
inc esi
or bl,bl
je L3
lea eax,+12H[eax+ebx]
jmp L7
lea esi,+0H[esi]
L5: cmp +4H[esp],esi
jb L29
mov al,[esi]
inc esi
L6: cmp al,10H
jae L10
or al,al
je L4
add eax,00000003H
L7: lea edx,+0H[edi+eax]
cmp [esp],edx
jb L30
lea edx,+0H[esi+eax]
cmp +4H[esp],edx
jb L29
mov ecx,eax
shr eax,02H
and ecx,ebp
L8: mov edx,[esi]
add esi,00000004H
mov [edi],edx
add edi,00000004H
dec eax
jne L8
L9: repe movsb
mov al,[esi]
inc esi
cmp al,10H
jae L10
lea edx,+3H[edi]
cmp [esp],edx
jb L30
shr eax,02H
mov bl,[esi]
lea edx,-401H[edi]
lea eax,[eax+ebx*4]
inc esi
sub edx,eax
cmp edx,+30H[esp]
jb L31
mov al,[edx]
mov [edi],al
mov al,+1H[edx]
mov +1H[edi],al
mov al,+2H[edx]
mov +2H[edi],al
add edi,ebp
jmp L18
mov esi,esi
L10: cmp al,40H
jb L13
mov ecx,eax
shr eax,02H
lea edx,-1H[edi]
and eax,ebp
mov bl,[esi]
shr ecx,04H
lea eax,[eax+ebx*4]
inc esi
sub edx,eax
dec ecx
cmp eax,ebp
jae L15
jmp L20
L11: add eax,000000ffH
lea edx,+3H[esi]
cmp +4H[esp],edx
jb L29
L12: mov bl,[esi]
inc esi
or bl,bl
je L11
lea ecx,+21H[eax+ebx]
xor eax,eax
jmp L14
lea esi,+0H[esi]
L13: cmp al,20H
jb L23
and eax,0000001fH
je L12
lea ecx,+2H[eax]
L14: mov ax,[esi]
lea edx,-1H[edi]
shr eax,02H
add esi,00000002H
sub edx,eax
cmp eax,ebp
jb L20
L15: cmp edx,+30H[esp]
jb L31
lea eax,[edi+ecx]
cmp [esp],eax
jb L30
mov ebx,ecx
shr ebx,02H
je L17
L16: mov eax,[edx]
add edx,00000004H
mov [edi],eax
add edi,00000004H
dec ebx
jne L16
and ecx,ebp
je L18
L17: mov al,[edx]
inc edx
mov [edi],al
inc edi
dec ecx
jne L17
L18: mov al,-2H[esi]
and eax,ebp
je L5
lea edx,[edi+eax]
cmp [esp],edx
jb L30
lea edx,[esi+eax]
cmp +4H[esp],edx
jb L29
L19: mov cl,[esi]
inc esi
mov [edi],cl
inc edi
dec eax
jne L19
mov al,[esi]
inc esi
jmp L10
mov esi,esi
L20: cmp edx,+30H[esp]
jb L31
lea eax,+0H[edi+ecx]
cmp [esp],eax
jb L30
xchg edx,esi
repe movsb
mov esi,edx
jmp L18
L21: add ecx,000000ffH
lea edx,+3H[esi]
cmp +4H[esp],edx
jb L29
L22: mov bl,[esi]
inc esi
or bl,bl
je L21
lea ecx,+9H[ebx+ecx]
jmp L24
nop
L23: cmp al,10H
jb L25
mov ecx,eax
and eax,00000008H
shl eax,0dH
and ecx,00000007H
je L22
add ecx,00000002H
L24: mov ax,[esi]
add esi,00000002H
lea edx,-4000H[edi]
shr eax,02H
je L26
sub edx,eax
jmp L15
lea esi,+0H[esi]
L25: lea edx,+2H[edi]
cmp [esp],edx
jb L30
shr eax,02H
mov bl,[esi]
lea edx,-1H[edi]
lea eax,[eax+ebx*4]
inc esi
sub edx,eax
cmp edx,+30H[esp]
jb L31
mov al,[edx]
mov [edi],al
mov bl,+1H[edx]
mov +1H[edi],bl
add edi,00000002H
jmp L18
L26: cmp ecx,00000003H
setne al
cmp edi,[esp]
ja L30
mov edx,+28H[esp]
add edx,+2cH[esp]
cmp esi,edx
ja L29
jb L28
L27: sub edi,+30H[esp]
mov edx,+34H[esp]
mov [edx],edi
neg eax
add esp,0000000cH
pop edx
pop ecx
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax,00000001H
jmp L27
L28: mov eax,00000008H
jmp L27
L29: mov eax,00000004H
jmp L27
L30: mov eax,00000005H
jmp L27
L31: mov eax,00000006H
jmp L27
end
|
Added work/contrib/lzo/lzo-1.08/src/i386/d_asm2/lzo1c_s1.asm.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
; /*** DO NOT EDIT - GENERATED AUTOMATICALLY ***/
; /*** Copyright (C) 1996-2002 Markus F.X.J. Oberhumer ***/
.386p
.model flat
.code
public _lzo1c_decompress_asm
_lzo1c_decompress_asm:
db 85
db 87
db 86
db 83
db 81
db 82
db 131, 236, 12
db 252
db 139, 116, 36, 40
db 139, 124, 36, 48
db 189, 3, 0, 0, 0
db 144
db 49, 192
db 138, 6
db 70
db 60, 32
db 115, 15
db 8, 192
db 116, 51
db 137, 193
db 243, 164
db 138, 6
db 70
db 60, 32
db 114, 72
db 60, 64
db 114, 93
db 137, 193
db 36, 31
db 141, 87, 255
db 193, 233, 5
db 41, 194
db 138, 6
db 70
db 193, 224, 5
db 41, 194
db 65
db 135, 242
db 243, 164
db 137, 214
db 235, 199
db 141, 180, 38, 0, 0, 0, 0
db 138, 6
db 70
db 141, 72, 32
db 60, 248
db 114, 197
db 185, 24, 1, 0, 0
db 44, 248
db 116, 6
db 145
db 48, 192
db 211, 224
db 145
db 243, 164
db 235, 163
db 141, 118, 0
db 141, 87, 255
db 41, 194
db 138, 6
db 70
db 193, 224, 5
db 41, 194
db 135, 242
db 164
db 164
db 164
db 137, 214
db 164
db 49, 192
db 235, 152
db 36, 31
db 137, 193
db 117, 19
db 177, 31
db 138, 6
db 70
db 8, 192
db 117, 8
db 129, 193, 255, 0, 0, 0
db 235, 241
db 1, 193
db 138, 6
db 70
db 137, 195
db 36, 63
db 137, 250
db 41, 194
db 138, 6
db 70
db 193, 224, 6
db 41, 194
db 57, 250
db 116, 27
db 135, 214
db 141, 73, 3
db 243, 164
db 137, 214
db 49, 192
db 193, 235, 6
db 137, 217
db 15, 133, 80, 255, 255, 255
db 233, 60, 255, 255, 255
db 131, 249, 1
db 15, 149, 192
db 139, 84, 36, 40
db 3, 84, 36, 44
db 57, 214
db 119, 38
db 114, 29
db 43, 124, 36, 48
db 139, 84, 36, 52
db 137, 58
db 247, 216
db 131, 196, 12
db 90
db 89
db 91
db 94
db 95
db 93
db 195
db 184, 1, 0, 0, 0
db 235, 227
db 184, 8, 0, 0, 0
db 235, 220
db 184, 4, 0, 0, 0
db 235, 213
end
|
Added work/contrib/lzo/lzo-1.08/src/i386/d_asm2/lzo1c_s2.asm.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
|
; /*** DO NOT EDIT - GENERATED AUTOMATICALLY ***/
; /*** Copyright (C) 1996-2002 Markus F.X.J. Oberhumer ***/
.386p
.model flat
.code
public _lzo1c_decompress_asm_safe
_lzo1c_decompress_asm_safe:
db 85
db 87
db 86
db 83
db 81
db 82
db 131, 236, 12
db 252
db 139, 116, 36, 40
db 139, 124, 36, 48
db 189, 3, 0, 0, 0
db 141, 70, 253
db 3, 68, 36, 44
db 137, 68, 36, 4
db 137, 248
db 139, 84, 36, 52
db 3, 2
db 137, 4, 36
db 141, 118, 0
db 49, 192
db 138, 6
db 70
db 60, 32
db 115, 40
db 8, 192
db 116, 99
db 137, 193
db 141, 28, 15
db 57, 28, 36
db 15, 130, 107, 1, 0, 0
db 141, 28, 14
db 57, 92, 36, 4
db 15, 130, 87, 1, 0, 0
db 243, 164
db 138, 6
db 70
db 60, 32
db 114, 127
db 60, 64
db 15, 130, 169, 0, 0, 0
db 137, 193
db 36, 31
db 141, 87, 255
db 193, 233, 5
db 41, 194
db 138, 6
db 70
db 193, 224, 5
db 41, 194
db 65
db 135, 242
db 59, 116, 36, 48
db 15, 130, 51, 1, 0, 0
db 141, 28, 15
db 57, 28, 36
db 15, 130, 32, 1, 0, 0
db 243, 164
db 137, 214
db 235, 148
db 141, 116, 38, 0
db 138, 6
db 70
db 141, 72, 32
db 60, 248
db 114, 149
db 185, 24, 1, 0, 0
db 44, 248
db 116, 6
db 145
db 48, 192
db 211, 224
db 145
db 141, 28, 15
db 57, 28, 36
db 15, 130, 241, 0, 0, 0
db 141, 28, 14
db 57, 92, 36, 4
db 15, 130, 221, 0, 0, 0
db 243, 164
db 233, 87, 255, 255, 255
db 141, 180, 38, 0, 0, 0, 0
db 141, 87, 255
db 41, 194
db 138, 6
db 70
db 193, 224, 5
db 41, 194
db 135, 242
db 59, 116, 36, 48
db 15, 130, 196, 0, 0, 0
db 141, 95, 4
db 57, 28, 36
db 15, 130, 177, 0, 0, 0
db 164
db 164
db 164
db 137, 214
db 164
db 49, 192
db 233, 72, 255, 255, 255
db 36, 31
db 137, 193
db 117, 26
db 177, 31
db 138, 6
db 70
db 8, 192
db 117, 15
db 129, 193, 255, 0, 0, 0
db 235, 241
db 141, 180, 38, 0, 0, 0, 0
db 1, 193
db 138, 6
db 70
db 137, 195
db 36, 63
db 137, 250
db 41, 194
db 138, 6
db 70
db 193, 224, 6
db 41, 194
db 57, 250
db 116, 41
db 135, 214
db 141, 73, 3
db 59, 116, 36, 48
db 114, 105
db 141, 4, 15
db 57, 4, 36
db 114, 90
db 243, 164
db 137, 214
db 49, 192
db 193, 235, 6
db 137, 217
db 15, 133, 210, 254, 255, 255
db 233, 190, 254, 255, 255
db 131, 249, 1
db 15, 149, 192
db 59, 60, 36
db 119, 57
db 139, 84, 36, 40
db 3, 84, 36, 44
db 57, 214
db 119, 38
db 114, 29
db 43, 124, 36, 48
db 139, 84, 36, 52
db 137, 58
db 247, 216
db 131, 196, 12
db 90
db 89
db 91
db 94
db 95
db 93
db 195
db 184, 1, 0, 0, 0
db 235, 227
db 184, 8, 0, 0, 0
db 235, 220
db 184, 4, 0, 0, 0
db 235, 213
db 184, 5, 0, 0, 0
db 235, 206
db 184, 6, 0, 0, 0
db 235, 199
end
|
Added work/contrib/lzo/lzo-1.08/src/i386/d_asm2/lzo1f_f1.asm.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
|
; /*** DO NOT EDIT - GENERATED AUTOMATICALLY ***/
; /*** Copyright (C) 1996-2002 Markus F.X.J. Oberhumer ***/
.386p
.model flat
.code
public _lzo1f_decompress_asm_fast
_lzo1f_decompress_asm_fast:
db 85
db 87
db 86
db 83
db 81
db 82
db 131, 236, 12
db 252
db 139, 116, 36, 40
db 139, 124, 36, 48
db 189, 3, 0, 0, 0
db 144
db 49, 192
db 138, 6
db 70
db 60, 31
db 119, 51
db 8, 192
db 137, 193
db 117, 19
db 138, 6
db 70
db 8, 192
db 117, 8
db 129, 193, 255, 0, 0, 0
db 235, 241
db 141, 76, 8, 31
db 136, 200
db 193, 233, 2
db 243, 165
db 36, 3
db 116, 8
db 139, 30
db 1, 198
db 137, 31
db 1, 199
db 138, 6
db 70
db 60, 31
db 118, 88
db 60, 223
db 15, 135, 132, 0, 0, 0
db 137, 193
db 193, 232, 2
db 141, 87, 255
db 36, 7
db 193, 233, 5
db 137, 195
db 138, 6
db 141, 4, 195
db 70
db 41, 194
db 131, 193, 2
db 135, 214
db 131, 249, 6
db 114, 16
db 131, 248, 4
db 114, 11
db 136, 200
db 193, 233, 2
db 243, 165
db 36, 3
db 136, 193
db 243, 164
db 137, 214
db 138, 78, 254
db 131, 225, 3
db 15, 132, 123, 255, 255, 255
db 139, 6
db 1, 206
db 137, 7
db 1, 207
db 49, 192
db 138, 6
db 70
db 235, 164
db 193, 232, 2
db 141, 151, 255, 247, 255, 255
db 137, 193
db 138, 6
db 70
db 141, 4, 193
db 41, 194
db 139, 2
db 137, 7
db 131, 199, 3
db 235, 201
db 138, 6
db 70
db 8, 192
db 117, 8
db 129, 193, 255, 0, 0, 0
db 235, 241
db 141, 76, 8, 31
db 235, 9
db 141, 118, 0
db 36, 31
db 137, 193
db 116, 226
db 137, 250
db 102, 139, 6
db 131, 198, 2
db 193, 232, 2
db 15, 133, 122, 255, 255, 255
db 131, 249, 1
db 15, 149, 192
db 139, 84, 36, 40
db 3, 84, 36, 44
db 57, 214
db 119, 38
db 114, 29
db 43, 124, 36, 48
db 139, 84, 36, 52
db 137, 58
db 247, 216
db 131, 196, 12
db 90
db 89
db 91
db 94
db 95
db 93
db 195
db 184, 1, 0, 0, 0
db 235, 227
db 184, 8, 0, 0, 0
db 235, 220
db 184, 4, 0, 0, 0
db 235, 213
end
|
Added work/contrib/lzo/lzo-1.08/src/i386/d_asm2/lzo1f_f2.asm.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
|
; /*** DO NOT EDIT - GENERATED AUTOMATICALLY ***/
; /*** Copyright (C) 1996-2002 Markus F.X.J. Oberhumer ***/
.386p
.model flat
.code
public _lzo1f_decompress_asm_fast_safe
_lzo1f_decompress_asm_fast_safe:
db 85
db 87
db 86
db 83
db 81
db 82
db 131, 236, 12
db 252
db 139, 116, 36, 40
db 139, 124, 36, 48
db 189, 3, 0, 0, 0
db 141, 70, 253
db 3, 68, 36, 44
db 137, 68, 36, 4
db 137, 248
db 139, 84, 36, 52
db 3, 2
db 137, 4, 36
db 141, 118, 0
db 49, 192
db 138, 6
db 70
db 60, 31
db 119, 76
db 8, 192
db 137, 193
db 117, 19
db 138, 6
db 70
db 8, 192
db 117, 8
db 129, 193, 255, 0, 0, 0
db 235, 241
db 141, 76, 8, 31
db 141, 28, 15
db 57, 28, 36
db 15, 130, 61, 1, 0, 0
db 141, 28, 14
db 57, 92, 36, 4
db 15, 130, 41, 1, 0, 0
db 136, 200
db 193, 233, 2
db 243, 165
db 36, 3
db 116, 8
db 139, 30
db 1, 198
db 137, 31
db 1, 199
db 138, 6
db 70
db 60, 31
db 118, 110
db 60, 223
db 15, 135, 179, 0, 0, 0
db 137, 193
db 193, 232, 2
db 141, 87, 255
db 36, 7
db 193, 233, 5
db 137, 195
db 138, 6
db 141, 4, 195
db 70
db 41, 194
db 131, 193, 2
db 135, 214
db 59, 116, 36, 48
db 15, 130, 239, 0, 0, 0
db 141, 28, 15
db 57, 28, 36
db 15, 130, 220, 0, 0, 0
db 131, 249, 6
db 114, 16
db 131, 248, 4
db 114, 11
db 136, 200
db 193, 233, 2
db 243, 165
db 36, 3
db 136, 193
db 243, 164
db 137, 214
db 138, 78, 254
db 131, 225, 3
db 15, 132, 76, 255, 255, 255
db 139, 6
db 1, 206
db 137, 7
db 1, 207
db 49, 192
db 138, 6
db 70
db 235, 142
db 141, 87, 3
db 57, 20, 36
db 15, 130, 156, 0, 0, 0
db 193, 232, 2
db 141, 151, 255, 247, 255, 255
db 137, 193
db 138, 6
db 70
db 141, 4, 193
db 41, 194
db 59, 84, 36, 48
db 15, 130, 134, 0, 0, 0
db 139, 2
db 137, 7
db 131, 199, 3
db 235, 179
db 138, 6
db 70
db 8, 192
db 117, 8
db 129, 193, 255, 0, 0, 0
db 235, 241
db 141, 76, 8, 31
db 235, 12
db 141, 182, 0, 0, 0, 0
db 36, 31
db 137, 193
db 116, 223
db 137, 250
db 102, 139, 6
db 131, 198, 2
db 193, 232, 2
db 15, 133, 75, 255, 255, 255
db 131, 249, 1
db 15, 149, 192
db 59, 60, 36
db 119, 57
db 139, 84, 36, 40
db 3, 84, 36, 44
db 57, 214
db 119, 38
db 114, 29
db 43, 124, 36, 48
db 139, 84, 36, 52
db 137, 58
db 247, 216
db 131, 196, 12
db 90
db 89
db 91
db 94
db 95
db 93
db 195
db 184, 1, 0, 0, 0
db 235, 227
db 184, 8, 0, 0, 0
db 235, 220
db 184, 4, 0, 0, 0
db 235, 213
db 184, 5, 0, 0, 0
db 235, 206
db 184, 6, 0, 0, 0
db 235, 199
end
|
Added work/contrib/lzo/lzo-1.08/src/i386/d_asm2/lzo1x_f1.asm.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
|
; /*** DO NOT EDIT - GENERATED AUTOMATICALLY ***/
; /*** Copyright (C) 1996-2002 Markus F.X.J. Oberhumer ***/
.386p
.model flat
.code
public _lzo1x_decompress_asm_fast
_lzo1x_decompress_asm_fast:
db 85
db 87
db 86
db 83
db 81
db 82
db 131, 236, 12
db 252
db 139, 116, 36, 40
db 139, 124, 36, 48
db 189, 3, 0, 0, 0
db 49, 192
db 49, 219
db 172
db 60, 17
db 118, 27
db 44, 14
db 235, 34
db 5, 255, 0, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 244
db 141, 68, 24, 21
db 235, 16
db 137, 246
db 138, 6
db 70
db 60, 16
db 115, 65
db 8, 192
db 116, 230
db 131, 192, 6
db 137, 193
db 49, 232
db 193, 233, 2
db 33, 232
db 139, 22
db 131, 198, 4
db 137, 23
db 131, 199, 4
db 73
db 117, 243
db 41, 198
db 41, 199
db 138, 6
db 70
db 60, 16
db 115, 25
db 193, 232, 2
db 138, 30
db 141, 151, 255, 247, 255, 255
db 141, 4, 152
db 70
db 41, 194
db 139, 10
db 137, 15
db 1, 239
db 235, 110
db 60, 64
db 114, 52
db 137, 193
db 193, 232, 2
db 141, 87, 255
db 131, 224, 7
db 138, 30
db 193, 233, 5
db 141, 4, 216
db 70
db 41, 194
db 131, 193, 4
db 57, 232
db 115, 53
db 235, 109
db 5, 255, 0, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 244
db 141, 76, 24, 36
db 49, 192
db 235, 13
db 144
db 60, 32
db 114, 116
db 131, 224, 31
db 116, 231
db 141, 72, 5
db 102, 139, 6
db 141, 87, 255
db 193, 232, 2
db 131, 198, 2
db 41, 194
db 57, 232
db 114, 58
db 141, 68, 15, 253
db 193, 233, 2
db 139, 26
db 131, 194, 4
db 137, 31
db 131, 199, 4
db 73
db 117, 243
db 137, 199
db 49, 219
db 138, 70, 254
db 33, 232
db 15, 132, 63, 255, 255, 255
db 139, 22
db 1, 198
db 137, 23
db 1, 199
db 138, 6
db 70
db 233, 119, 255, 255, 255
db 141, 180, 38, 0, 0, 0, 0
db 135, 214
db 41, 233
db 243, 164
db 137, 214
db 235, 212
db 129, 193, 255, 0, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 243
db 141, 76, 11, 12
db 235, 23
db 141, 118, 0
db 60, 16
db 114, 44
db 137, 193
db 131, 224, 8
db 193, 224, 13
db 131, 225, 7
db 116, 223
db 131, 193, 5
db 102, 139, 6
db 131, 198, 2
db 141, 151, 0, 192, 255, 255
db 193, 232, 2
db 116, 43
db 41, 194
db 233, 122, 255, 255, 255
db 141, 116, 38, 0
db 193, 232, 2
db 138, 30
db 141, 87, 255
db 141, 4, 152
db 70
db 41, 194
db 138, 2
db 136, 7
db 138, 90, 1
db 136, 95, 1
db 131, 199, 2
db 233, 110, 255, 255, 255
db 131, 249, 6
db 15, 149, 192
db 139, 84, 36, 40
db 3, 84, 36, 44
db 57, 214
db 119, 38
db 114, 29
db 43, 124, 36, 48
db 139, 84, 36, 52
db 137, 58
db 247, 216
db 131, 196, 12
db 90
db 89
db 91
db 94
db 95
db 93
db 195
db 184, 1, 0, 0, 0
db 235, 227
db 184, 8, 0, 0, 0
db 235, 220
db 184, 4, 0, 0, 0
db 235, 213
end
|
Added work/contrib/lzo/lzo-1.08/src/i386/d_asm2/lzo1x_f2.asm.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
|
; /*** DO NOT EDIT - GENERATED AUTOMATICALLY ***/
; /*** Copyright (C) 1996-2002 Markus F.X.J. Oberhumer ***/
.386p
.model flat
.code
public _lzo1x_decompress_asm_fast_safe
_lzo1x_decompress_asm_fast_safe:
db 85
db 87
db 86
db 83
db 81
db 82
db 131, 236, 12
db 252
db 139, 116, 36, 40
db 139, 124, 36, 48
db 189, 3, 0, 0, 0
db 141, 70, 253
db 3, 68, 36, 44
db 137, 68, 36, 4
db 137, 248
db 139, 84, 36, 52
db 3, 2
db 137, 4, 36
db 49, 192
db 49, 219
db 172
db 60, 17
db 118, 55
db 44, 14
db 235, 62
db 5, 255, 0, 0, 0
db 141, 84, 6, 18
db 57, 84, 36, 4
db 15, 130, 78, 2, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 230
db 141, 68, 24, 21
db 235, 30
db 141, 182, 0, 0, 0, 0
db 57, 116, 36, 4
db 15, 130, 49, 2, 0, 0
db 138, 6
db 70
db 60, 16
db 115, 119
db 8, 192
db 116, 216
db 131, 192, 6
db 141, 84, 7, 253
db 57, 20, 36
db 15, 130, 29, 2, 0, 0
db 141, 84, 6, 253
db 57, 84, 36, 4
db 15, 130, 8, 2, 0, 0
db 137, 193
db 49, 232
db 193, 233, 2
db 33, 232
db 139, 22
db 131, 198, 4
db 137, 23
db 131, 199, 4
db 73
db 117, 243
db 41, 198
db 41, 199
db 138, 6
db 70
db 60, 16
db 115, 52
db 141, 87, 3
db 57, 20, 36
db 15, 130, 226, 1, 0, 0
db 193, 232, 2
db 138, 30
db 141, 151, 255, 247, 255, 255
db 141, 4, 152
db 70
db 41, 194
db 59, 84, 36, 48
db 15, 130, 206, 1, 0, 0
db 139, 10
db 137, 15
db 1, 239
db 233, 151, 0, 0, 0
db 137, 246
db 60, 64
db 114, 68
db 137, 193
db 193, 232, 2
db 141, 87, 255
db 131, 224, 7
db 138, 30
db 193, 233, 5
db 141, 4, 216
db 70
db 41, 194
db 131, 193, 4
db 57, 232
db 115, 73
db 233, 170, 0, 0, 0
db 5, 255, 0, 0, 0
db 141, 86, 3
db 57, 84, 36, 4
db 15, 130, 123, 1, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 231
db 141, 76, 24, 36
db 49, 192
db 235, 17
db 144
db 60, 32
db 15, 130, 200, 0, 0, 0
db 131, 224, 31
db 116, 227
db 141, 72, 5
db 102, 139, 6
db 141, 87, 255
db 193, 232, 2
db 131, 198, 2
db 41, 194
db 57, 232
db 114, 102
db 59, 84, 36, 48
db 15, 130, 77, 1, 0, 0
db 141, 68, 15, 253
db 193, 233, 2
db 57, 4, 36
db 15, 130, 54, 1, 0, 0
db 139, 26
db 131, 194, 4
db 137, 31
db 131, 199, 4
db 73
db 117, 243
db 137, 199
db 49, 219
db 138, 70, 254
db 33, 232
db 15, 132, 216, 254, 255, 255
db 141, 20, 7
db 57, 20, 36
db 15, 130, 14, 1, 0, 0
db 141, 20, 6
db 57, 84, 36, 4
db 15, 130, 250, 0, 0, 0
db 139, 22
db 1, 198
db 137, 23
db 1, 199
db 138, 6
db 70
db 233, 55, 255, 255, 255
db 141, 180, 38, 0, 0, 0, 0
db 59, 84, 36, 48
db 15, 130, 231, 0, 0, 0
db 141, 68, 15, 253
db 57, 4, 36
db 15, 130, 211, 0, 0, 0
db 135, 214
db 41, 233
db 243, 164
db 137, 214
db 235, 164
db 129, 193, 255, 0, 0, 0
db 141, 86, 3
db 57, 84, 36, 4
db 15, 130, 175, 0, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 230
db 141, 76, 11, 12
db 235, 27
db 141, 180, 38, 0, 0, 0, 0
db 60, 16
db 114, 44
db 137, 193
db 131, 224, 8
db 193, 224, 13
db 131, 225, 7
db 116, 219
db 131, 193, 5
db 102, 139, 6
db 131, 198, 2
db 141, 151, 0, 192, 255, 255
db 193, 232, 2
db 116, 57
db 41, 194
db 233, 38, 255, 255, 255
db 141, 116, 38, 0
db 141, 87, 2
db 57, 20, 36
db 114, 106
db 193, 232, 2
db 138, 30
db 141, 87, 255
db 141, 4, 152
db 70
db 41, 194
db 59, 84, 36, 48
db 114, 93
db 138, 2
db 136, 7
db 138, 90, 1
db 136, 95, 1
db 131, 199, 2
db 233, 31, 255, 255, 255
db 131, 249, 6
db 15, 149, 192
db 59, 60, 36
db 119, 57
db 139, 84, 36, 40
db 3, 84, 36, 44
db 57, 214
db 119, 38
db 114, 29
db 43, 124, 36, 48
db 139, 84, 36, 52
db 137, 58
db 247, 216
db 131, 196, 12
db 90
db 89
db 91
db 94
db 95
db 93
db 195
db 184, 1, 0, 0, 0
db 235, 227
db 184, 8, 0, 0, 0
db 235, 220
db 184, 4, 0, 0, 0
db 235, 213
db 184, 5, 0, 0, 0
db 235, 206
db 184, 6, 0, 0, 0
db 235, 199
end
|
Added work/contrib/lzo/lzo-1.08/src/i386/d_asm2/lzo1x_s1.asm.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
|
; /*** DO NOT EDIT - GENERATED AUTOMATICALLY ***/
; /*** Copyright (C) 1996-2002 Markus F.X.J. Oberhumer ***/
.386p
.model flat
.code
public _lzo1x_decompress_asm
_lzo1x_decompress_asm:
db 85
db 87
db 86
db 83
db 81
db 82
db 131, 236, 12
db 252
db 139, 116, 36, 40
db 139, 124, 36, 48
db 189, 3, 0, 0, 0
db 49, 192
db 49, 219
db 172
db 60, 17
db 118, 35
db 44, 17
db 60, 4
db 115, 40
db 137, 193
db 235, 56
db 5, 255, 0, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 244
db 141, 68, 24, 18
db 235, 18
db 141, 116, 38, 0
db 138, 6
db 70
db 60, 16
db 115, 73
db 8, 192
db 116, 228
db 131, 192, 3
db 137, 193
db 193, 232, 2
db 33, 233
db 139, 22
db 131, 198, 4
db 137, 23
db 131, 199, 4
db 72
db 117, 243
db 243, 164
db 138, 6
db 70
db 60, 16
db 115, 37
db 193, 232, 2
db 138, 30
db 141, 151, 255, 247, 255, 255
db 141, 4, 152
db 70
db 41, 194
db 138, 2
db 136, 7
db 138, 66, 1
db 136, 71, 1
db 138, 66, 2
db 136, 71, 2
db 1, 239
db 235, 119
db 60, 64
db 114, 52
db 137, 193
db 193, 232, 2
db 141, 87, 255
db 131, 224, 7
db 138, 30
db 193, 233, 5
db 141, 4, 216
db 70
db 41, 194
db 65
db 57, 232
db 115, 55
db 235, 119
db 5, 255, 0, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 244
db 141, 76, 24, 33
db 49, 192
db 235, 15
db 141, 118, 0
db 60, 32
db 114, 124
db 131, 224, 31
db 116, 229
db 141, 72, 2
db 102, 139, 6
db 141, 87, 255
db 193, 232, 2
db 131, 198, 2
db 41, 194
db 57, 232
db 114, 66
db 137, 203
db 193, 235, 2
db 116, 17
db 139, 2
db 131, 194, 4
db 137, 7
db 131, 199, 4
db 75
db 117, 243
db 33, 233
db 116, 9
db 138, 2
db 66
db 136, 7
db 71
db 73
db 117, 247
db 138, 70, 254
db 33, 232
db 15, 132, 46, 255, 255, 255
db 138, 14
db 70
db 136, 15
db 71
db 72
db 117, 247
db 138, 6
db 70
db 233, 109, 255, 255, 255
db 144
db 141, 116, 38, 0
db 135, 214
db 243, 164
db 137, 214
db 235, 215
db 129, 193, 255, 0, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 243
db 141, 76, 11, 9
db 235, 25
db 144
db 141, 116, 38, 0
db 60, 16
db 114, 44
db 137, 193
db 131, 224, 8
db 193, 224, 13
db 131, 225, 7
db 116, 221
db 131, 193, 2
db 102, 139, 6
db 131, 198, 2
db 141, 151, 0, 192, 255, 255
db 193, 232, 2
db 116, 43
db 41, 194
db 233, 114, 255, 255, 255
db 141, 116, 38, 0
db 193, 232, 2
db 138, 30
db 141, 87, 255
db 141, 4, 152
db 70
db 41, 194
db 138, 2
db 136, 7
db 138, 90, 1
db 136, 95, 1
db 131, 199, 2
db 233, 111, 255, 255, 255
db 131, 249, 3
db 15, 149, 192
db 139, 84, 36, 40
db 3, 84, 36, 44
db 57, 214
db 119, 38
db 114, 29
db 43, 124, 36, 48
db 139, 84, 36, 52
db 137, 58
db 247, 216
db 131, 196, 12
db 90
db 89
db 91
db 94
db 95
db 93
db 195
db 184, 1, 0, 0, 0
db 235, 227
db 184, 8, 0, 0, 0
db 235, 220
db 184, 4, 0, 0, 0
db 235, 213
end
|
Added work/contrib/lzo/lzo-1.08/src/i386/d_asm2/lzo1x_s2.asm.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
|
; /*** DO NOT EDIT - GENERATED AUTOMATICALLY ***/
; /*** Copyright (C) 1996-2002 Markus F.X.J. Oberhumer ***/
.386p
.model flat
.code
public _lzo1x_decompress_asm_safe
_lzo1x_decompress_asm_safe:
db 85
db 87
db 86
db 83
db 81
db 82
db 131, 236, 12
db 252
db 139, 116, 36, 40
db 139, 124, 36, 48
db 189, 3, 0, 0, 0
db 141, 70, 253
db 3, 68, 36, 44
db 137, 68, 36, 4
db 137, 248
db 139, 84, 36, 52
db 3, 2
db 137, 4, 36
db 49, 192
db 49, 219
db 172
db 60, 17
db 118, 87
db 44, 17
db 60, 4
db 115, 92
db 141, 20, 7
db 57, 20, 36
db 15, 130, 130, 2, 0, 0
db 141, 20, 6
db 57, 84, 36, 4
db 15, 130, 110, 2, 0, 0
db 137, 193
db 235, 110
db 5, 255, 0, 0, 0
db 141, 84, 6, 18
db 57, 84, 36, 4
db 15, 130, 87, 2, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 230
db 141, 68, 24, 18
db 235, 31
db 141, 180, 38, 0, 0, 0, 0
db 57, 116, 36, 4
db 15, 130, 57, 2, 0, 0
db 138, 6
db 70
db 60, 16
db 115, 127
db 8, 192
db 116, 215
db 131, 192, 3
db 141, 84, 7, 0
db 57, 20, 36
db 15, 130, 37, 2, 0, 0
db 141, 84, 6, 0
db 57, 84, 36, 4
db 15, 130, 16, 2, 0, 0
db 137, 193
db 193, 232, 2
db 33, 233
db 139, 22
db 131, 198, 4
db 137, 23
db 131, 199, 4
db 72
db 117, 243
db 243, 164
db 138, 6
db 70
db 60, 16
db 115, 64
db 141, 87, 3
db 57, 20, 36
db 15, 130, 238, 1, 0, 0
db 193, 232, 2
db 138, 30
db 141, 151, 255, 247, 255, 255
db 141, 4, 152
db 70
db 41, 194
db 59, 84, 36, 48
db 15, 130, 218, 1, 0, 0
db 138, 2
db 136, 7
db 138, 66, 1
db 136, 71, 1
db 138, 66, 2
db 136, 71, 2
db 1, 239
db 233, 163, 0, 0, 0
db 137, 246
db 60, 64
db 114, 68
db 137, 193
db 193, 232, 2
db 141, 87, 255
db 131, 224, 7
db 138, 30
db 193, 233, 5
db 141, 4, 216
db 70
db 41, 194
db 65
db 57, 232
db 115, 75
db 233, 180, 0, 0, 0
db 5, 255, 0, 0, 0
db 141, 86, 3
db 57, 84, 36, 4
db 15, 130, 125, 1, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 231
db 141, 76, 24, 33
db 49, 192
db 235, 19
db 141, 118, 0
db 60, 32
db 15, 130, 200, 0, 0, 0
db 131, 224, 31
db 116, 225
db 141, 72, 2
db 102, 139, 6
db 141, 87, 255
db 193, 232, 2
db 131, 198, 2
db 41, 194
db 57, 232
db 114, 110
db 59, 84, 36, 48
db 15, 130, 77, 1, 0, 0
db 141, 4, 15
db 57, 4, 36
db 15, 130, 58, 1, 0, 0
db 137, 203
db 193, 235, 2
db 116, 17
db 139, 2
db 131, 194, 4
db 137, 7
db 131, 199, 4
db 75
db 117, 243
db 33, 233
db 116, 9
db 138, 2
db 66
db 136, 7
db 71
db 73
db 117, 247
db 138, 70, 254
db 33, 232
db 15, 132, 196, 254, 255, 255
db 141, 20, 7
db 57, 20, 36
db 15, 130, 2, 1, 0, 0
db 141, 20, 6
db 57, 84, 36, 4
db 15, 130, 238, 0, 0, 0
db 138, 14
db 70
db 136, 15
db 71
db 72
db 117, 247
db 138, 6
db 70
db 233, 42, 255, 255, 255
db 137, 246
db 59, 84, 36, 48
db 15, 130, 223, 0, 0, 0
db 141, 68, 15, 0
db 57, 4, 36
db 15, 130, 203, 0, 0, 0
db 135, 214
db 243, 164
db 137, 214
db 235, 170
db 129, 193, 255, 0, 0, 0
db 141, 86, 3
db 57, 84, 36, 4
db 15, 130, 169, 0, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 230
db 141, 76, 11, 9
db 235, 21
db 144
db 60, 16
db 114, 44
db 137, 193
db 131, 224, 8
db 193, 224, 13
db 131, 225, 7
db 116, 225
db 131, 193, 2
db 102, 139, 6
db 131, 198, 2
db 141, 151, 0, 192, 255, 255
db 193, 232, 2
db 116, 57
db 41, 194
db 233, 38, 255, 255, 255
db 141, 116, 38, 0
db 141, 87, 2
db 57, 20, 36
db 114, 106
db 193, 232, 2
db 138, 30
db 141, 87, 255
db 141, 4, 152
db 70
db 41, 194
db 59, 84, 36, 48
db 114, 93
db 138, 2
db 136, 7
db 138, 90, 1
db 136, 95, 1
db 131, 199, 2
db 233, 43, 255, 255, 255
db 131, 249, 3
db 15, 149, 192
db 59, 60, 36
db 119, 57
db 139, 84, 36, 40
db 3, 84, 36, 44
db 57, 214
db 119, 38
db 114, 29
db 43, 124, 36, 48
db 139, 84, 36, 52
db 137, 58
db 247, 216
db 131, 196, 12
db 90
db 89
db 91
db 94
db 95
db 93
db 195
db 184, 1, 0, 0, 0
db 235, 227
db 184, 8, 0, 0, 0
db 235, 220
db 184, 4, 0, 0, 0
db 235, 213
db 184, 5, 0, 0, 0
db 235, 206
db 184, 6, 0, 0, 0
db 235, 199
end
|
Added work/contrib/lzo/lzo-1.08/src/i386/d_asm2/lzo1y_f1.asm.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
|
; /*** DO NOT EDIT - GENERATED AUTOMATICALLY ***/
; /*** Copyright (C) 1996-2002 Markus F.X.J. Oberhumer ***/
.386p
.model flat
.code
public _lzo1y_decompress_asm_fast
_lzo1y_decompress_asm_fast:
db 85
db 87
db 86
db 83
db 81
db 82
db 131, 236, 12
db 252
db 139, 116, 36, 40
db 139, 124, 36, 48
db 189, 3, 0, 0, 0
db 49, 192
db 49, 219
db 172
db 60, 17
db 118, 27
db 44, 14
db 235, 34
db 5, 255, 0, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 244
db 141, 68, 24, 21
db 235, 16
db 137, 246
db 138, 6
db 70
db 60, 16
db 115, 65
db 8, 192
db 116, 230
db 131, 192, 6
db 137, 193
db 49, 232
db 193, 233, 2
db 33, 232
db 139, 22
db 131, 198, 4
db 137, 23
db 131, 199, 4
db 73
db 117, 243
db 41, 198
db 41, 199
db 138, 6
db 70
db 60, 16
db 115, 25
db 193, 232, 2
db 138, 30
db 141, 151, 255, 251, 255, 255
db 141, 4, 152
db 70
db 41, 194
db 139, 10
db 137, 15
db 1, 239
db 235, 110
db 60, 64
db 114, 52
db 137, 193
db 193, 232, 2
db 141, 87, 255
db 33, 232
db 138, 30
db 193, 233, 4
db 141, 4, 152
db 70
db 41, 194
db 131, 193, 2
db 57, 232
db 115, 54
db 235, 110
db 5, 255, 0, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 244
db 141, 76, 24, 36
db 49, 192
db 235, 14
db 137, 246
db 60, 32
db 114, 116
db 131, 224, 31
db 116, 230
db 141, 72, 5
db 102, 139, 6
db 141, 87, 255
db 193, 232, 2
db 131, 198, 2
db 41, 194
db 57, 232
db 114, 58
db 141, 68, 15, 253
db 193, 233, 2
db 139, 26
db 131, 194, 4
db 137, 31
db 131, 199, 4
db 73
db 117, 243
db 137, 199
db 49, 219
db 138, 70, 254
db 33, 232
db 15, 132, 63, 255, 255, 255
db 139, 22
db 1, 198
db 137, 23
db 1, 199
db 138, 6
db 70
db 233, 119, 255, 255, 255
db 141, 180, 38, 0, 0, 0, 0
db 135, 214
db 41, 233
db 243, 164
db 137, 214
db 235, 212
db 129, 193, 255, 0, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 243
db 141, 76, 11, 12
db 235, 23
db 141, 118, 0
db 60, 16
db 114, 44
db 137, 193
db 131, 224, 8
db 193, 224, 13
db 131, 225, 7
db 116, 223
db 131, 193, 5
db 102, 139, 6
db 131, 198, 2
db 141, 151, 0, 192, 255, 255
db 193, 232, 2
db 116, 43
db 41, 194
db 233, 122, 255, 255, 255
db 141, 116, 38, 0
db 193, 232, 2
db 138, 30
db 141, 87, 255
db 141, 4, 152
db 70
db 41, 194
db 138, 2
db 136, 7
db 138, 90, 1
db 136, 95, 1
db 131, 199, 2
db 233, 110, 255, 255, 255
db 131, 249, 6
db 15, 149, 192
db 139, 84, 36, 40
db 3, 84, 36, 44
db 57, 214
db 119, 38
db 114, 29
db 43, 124, 36, 48
db 139, 84, 36, 52
db 137, 58
db 247, 216
db 131, 196, 12
db 90
db 89
db 91
db 94
db 95
db 93
db 195
db 184, 1, 0, 0, 0
db 235, 227
db 184, 8, 0, 0, 0
db 235, 220
db 184, 4, 0, 0, 0
db 235, 213
end
|
Added work/contrib/lzo/lzo-1.08/src/i386/d_asm2/lzo1y_f2.asm.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
|
; /*** DO NOT EDIT - GENERATED AUTOMATICALLY ***/
; /*** Copyright (C) 1996-2002 Markus F.X.J. Oberhumer ***/
.386p
.model flat
.code
public _lzo1y_decompress_asm_fast_safe
_lzo1y_decompress_asm_fast_safe:
db 85
db 87
db 86
db 83
db 81
db 82
db 131, 236, 12
db 252
db 139, 116, 36, 40
db 139, 124, 36, 48
db 189, 3, 0, 0, 0
db 141, 70, 253
db 3, 68, 36, 44
db 137, 68, 36, 4
db 137, 248
db 139, 84, 36, 52
db 3, 2
db 137, 4, 36
db 49, 192
db 49, 219
db 172
db 60, 17
db 118, 55
db 44, 14
db 235, 62
db 5, 255, 0, 0, 0
db 141, 84, 6, 18
db 57, 84, 36, 4
db 15, 130, 78, 2, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 230
db 141, 68, 24, 21
db 235, 30
db 141, 182, 0, 0, 0, 0
db 57, 116, 36, 4
db 15, 130, 49, 2, 0, 0
db 138, 6
db 70
db 60, 16
db 115, 119
db 8, 192
db 116, 216
db 131, 192, 6
db 141, 84, 7, 253
db 57, 20, 36
db 15, 130, 29, 2, 0, 0
db 141, 84, 6, 253
db 57, 84, 36, 4
db 15, 130, 8, 2, 0, 0
db 137, 193
db 49, 232
db 193, 233, 2
db 33, 232
db 139, 22
db 131, 198, 4
db 137, 23
db 131, 199, 4
db 73
db 117, 243
db 41, 198
db 41, 199
db 138, 6
db 70
db 60, 16
db 115, 52
db 141, 87, 3
db 57, 20, 36
db 15, 130, 226, 1, 0, 0
db 193, 232, 2
db 138, 30
db 141, 151, 255, 251, 255, 255
db 141, 4, 152
db 70
db 41, 194
db 59, 84, 36, 48
db 15, 130, 206, 1, 0, 0
db 139, 10
db 137, 15
db 1, 239
db 233, 151, 0, 0, 0
db 137, 246
db 60, 64
db 114, 68
db 137, 193
db 193, 232, 2
db 141, 87, 255
db 33, 232
db 138, 30
db 193, 233, 4
db 141, 4, 152
db 70
db 41, 194
db 131, 193, 2
db 57, 232
db 115, 74
db 233, 171, 0, 0, 0
db 5, 255, 0, 0, 0
db 141, 86, 3
db 57, 84, 36, 4
db 15, 130, 124, 1, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 231
db 141, 76, 24, 36
db 49, 192
db 235, 18
db 137, 246
db 60, 32
db 15, 130, 200, 0, 0, 0
db 131, 224, 31
db 116, 226
db 141, 72, 5
db 102, 139, 6
db 141, 87, 255
db 193, 232, 2
db 131, 198, 2
db 41, 194
db 57, 232
db 114, 102
db 59, 84, 36, 48
db 15, 130, 77, 1, 0, 0
db 141, 68, 15, 253
db 193, 233, 2
db 57, 4, 36
db 15, 130, 54, 1, 0, 0
db 139, 26
db 131, 194, 4
db 137, 31
db 131, 199, 4
db 73
db 117, 243
db 137, 199
db 49, 219
db 138, 70, 254
db 33, 232
db 15, 132, 216, 254, 255, 255
db 141, 20, 7
db 57, 20, 36
db 15, 130, 14, 1, 0, 0
db 141, 20, 6
db 57, 84, 36, 4
db 15, 130, 250, 0, 0, 0
db 139, 22
db 1, 198
db 137, 23
db 1, 199
db 138, 6
db 70
db 233, 55, 255, 255, 255
db 141, 180, 38, 0, 0, 0, 0
db 59, 84, 36, 48
db 15, 130, 231, 0, 0, 0
db 141, 68, 15, 253
db 57, 4, 36
db 15, 130, 211, 0, 0, 0
db 135, 214
db 41, 233
db 243, 164
db 137, 214
db 235, 164
db 129, 193, 255, 0, 0, 0
db 141, 86, 3
db 57, 84, 36, 4
db 15, 130, 175, 0, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 230
db 141, 76, 11, 12
db 235, 27
db 141, 180, 38, 0, 0, 0, 0
db 60, 16
db 114, 44
db 137, 193
db 131, 224, 8
db 193, 224, 13
db 131, 225, 7
db 116, 219
db 131, 193, 5
db 102, 139, 6
db 131, 198, 2
db 141, 151, 0, 192, 255, 255
db 193, 232, 2
db 116, 57
db 41, 194
db 233, 38, 255, 255, 255
db 141, 116, 38, 0
db 141, 87, 2
db 57, 20, 36
db 114, 106
db 193, 232, 2
db 138, 30
db 141, 87, 255
db 141, 4, 152
db 70
db 41, 194
db 59, 84, 36, 48
db 114, 93
db 138, 2
db 136, 7
db 138, 90, 1
db 136, 95, 1
db 131, 199, 2
db 233, 31, 255, 255, 255
db 131, 249, 6
db 15, 149, 192
db 59, 60, 36
db 119, 57
db 139, 84, 36, 40
db 3, 84, 36, 44
db 57, 214
db 119, 38
db 114, 29
db 43, 124, 36, 48
db 139, 84, 36, 52
db 137, 58
db 247, 216
db 131, 196, 12
db 90
db 89
db 91
db 94
db 95
db 93
db 195
db 184, 1, 0, 0, 0
db 235, 227
db 184, 8, 0, 0, 0
db 235, 220
db 184, 4, 0, 0, 0
db 235, 213
db 184, 5, 0, 0, 0
db 235, 206
db 184, 6, 0, 0, 0
db 235, 199
end
|
Added work/contrib/lzo/lzo-1.08/src/i386/d_asm2/lzo1y_s1.asm.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
|
; /*** DO NOT EDIT - GENERATED AUTOMATICALLY ***/
; /*** Copyright (C) 1996-2002 Markus F.X.J. Oberhumer ***/
.386p
.model flat
.code
public _lzo1y_decompress_asm
_lzo1y_decompress_asm:
db 85
db 87
db 86
db 83
db 81
db 82
db 131, 236, 12
db 252
db 139, 116, 36, 40
db 139, 124, 36, 48
db 189, 3, 0, 0, 0
db 49, 192
db 49, 219
db 172
db 60, 17
db 118, 35
db 44, 17
db 60, 4
db 115, 40
db 137, 193
db 235, 56
db 5, 255, 0, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 244
db 141, 68, 24, 18
db 235, 18
db 141, 116, 38, 0
db 138, 6
db 70
db 60, 16
db 115, 73
db 8, 192
db 116, 228
db 131, 192, 3
db 137, 193
db 193, 232, 2
db 33, 233
db 139, 22
db 131, 198, 4
db 137, 23
db 131, 199, 4
db 72
db 117, 243
db 243, 164
db 138, 6
db 70
db 60, 16
db 115, 37
db 193, 232, 2
db 138, 30
db 141, 151, 255, 251, 255, 255
db 141, 4, 152
db 70
db 41, 194
db 138, 2
db 136, 7
db 138, 66, 1
db 136, 71, 1
db 138, 66, 2
db 136, 71, 2
db 1, 239
db 235, 119
db 60, 64
db 114, 52
db 137, 193
db 193, 232, 2
db 141, 87, 255
db 33, 232
db 138, 30
db 193, 233, 4
db 141, 4, 152
db 70
db 41, 194
db 73
db 57, 232
db 115, 56
db 235, 120
db 5, 255, 0, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 244
db 141, 76, 24, 33
db 49, 192
db 235, 16
db 141, 116, 38, 0
db 60, 32
db 114, 124
db 131, 224, 31
db 116, 228
db 141, 72, 2
db 102, 139, 6
db 141, 87, 255
db 193, 232, 2
db 131, 198, 2
db 41, 194
db 57, 232
db 114, 66
db 137, 203
db 193, 235, 2
db 116, 17
db 139, 2
db 131, 194, 4
db 137, 7
db 131, 199, 4
db 75
db 117, 243
db 33, 233
db 116, 9
db 138, 2
db 66
db 136, 7
db 71
db 73
db 117, 247
db 138, 70, 254
db 33, 232
db 15, 132, 46, 255, 255, 255
db 138, 14
db 70
db 136, 15
db 71
db 72
db 117, 247
db 138, 6
db 70
db 233, 109, 255, 255, 255
db 144
db 141, 116, 38, 0
db 135, 214
db 243, 164
db 137, 214
db 235, 215
db 129, 193, 255, 0, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 243
db 141, 76, 11, 9
db 235, 25
db 144
db 141, 116, 38, 0
db 60, 16
db 114, 44
db 137, 193
db 131, 224, 8
db 193, 224, 13
db 131, 225, 7
db 116, 221
db 131, 193, 2
db 102, 139, 6
db 131, 198, 2
db 141, 151, 0, 192, 255, 255
db 193, 232, 2
db 116, 43
db 41, 194
db 233, 114, 255, 255, 255
db 141, 116, 38, 0
db 193, 232, 2
db 138, 30
db 141, 87, 255
db 141, 4, 152
db 70
db 41, 194
db 138, 2
db 136, 7
db 138, 90, 1
db 136, 95, 1
db 131, 199, 2
db 233, 111, 255, 255, 255
db 131, 249, 3
db 15, 149, 192
db 139, 84, 36, 40
db 3, 84, 36, 44
db 57, 214
db 119, 38
db 114, 29
db 43, 124, 36, 48
db 139, 84, 36, 52
db 137, 58
db 247, 216
db 131, 196, 12
db 90
db 89
db 91
db 94
db 95
db 93
db 195
db 184, 1, 0, 0, 0
db 235, 227
db 184, 8, 0, 0, 0
db 235, 220
db 184, 4, 0, 0, 0
db 235, 213
end
|
Added work/contrib/lzo/lzo-1.08/src/i386/d_asm2/lzo1y_s2.asm.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
|
; /*** DO NOT EDIT - GENERATED AUTOMATICALLY ***/
; /*** Copyright (C) 1996-2002 Markus F.X.J. Oberhumer ***/
.386p
.model flat
.code
public _lzo1y_decompress_asm_safe
_lzo1y_decompress_asm_safe:
db 85
db 87
db 86
db 83
db 81
db 82
db 131, 236, 12
db 252
db 139, 116, 36, 40
db 139, 124, 36, 48
db 189, 3, 0, 0, 0
db 141, 70, 253
db 3, 68, 36, 44
db 137, 68, 36, 4
db 137, 248
db 139, 84, 36, 52
db 3, 2
db 137, 4, 36
db 49, 192
db 49, 219
db 172
db 60, 17
db 118, 87
db 44, 17
db 60, 4
db 115, 92
db 141, 20, 7
db 57, 20, 36
db 15, 130, 130, 2, 0, 0
db 141, 20, 6
db 57, 84, 36, 4
db 15, 130, 110, 2, 0, 0
db 137, 193
db 235, 110
db 5, 255, 0, 0, 0
db 141, 84, 6, 18
db 57, 84, 36, 4
db 15, 130, 87, 2, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 230
db 141, 68, 24, 18
db 235, 31
db 141, 180, 38, 0, 0, 0, 0
db 57, 116, 36, 4
db 15, 130, 57, 2, 0, 0
db 138, 6
db 70
db 60, 16
db 115, 127
db 8, 192
db 116, 215
db 131, 192, 3
db 141, 84, 7, 0
db 57, 20, 36
db 15, 130, 37, 2, 0, 0
db 141, 84, 6, 0
db 57, 84, 36, 4
db 15, 130, 16, 2, 0, 0
db 137, 193
db 193, 232, 2
db 33, 233
db 139, 22
db 131, 198, 4
db 137, 23
db 131, 199, 4
db 72
db 117, 243
db 243, 164
db 138, 6
db 70
db 60, 16
db 115, 64
db 141, 87, 3
db 57, 20, 36
db 15, 130, 238, 1, 0, 0
db 193, 232, 2
db 138, 30
db 141, 151, 255, 251, 255, 255
db 141, 4, 152
db 70
db 41, 194
db 59, 84, 36, 48
db 15, 130, 218, 1, 0, 0
db 138, 2
db 136, 7
db 138, 66, 1
db 136, 71, 1
db 138, 66, 2
db 136, 71, 2
db 1, 239
db 233, 163, 0, 0, 0
db 137, 246
db 60, 64
db 114, 68
db 137, 193
db 193, 232, 2
db 141, 87, 255
db 33, 232
db 138, 30
db 193, 233, 4
db 141, 4, 152
db 70
db 41, 194
db 73
db 57, 232
db 115, 76
db 233, 181, 0, 0, 0
db 5, 255, 0, 0, 0
db 141, 86, 3
db 57, 84, 36, 4
db 15, 130, 126, 1, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 231
db 141, 76, 24, 33
db 49, 192
db 235, 20
db 141, 116, 38, 0
db 60, 32
db 15, 130, 200, 0, 0, 0
db 131, 224, 31
db 116, 224
db 141, 72, 2
db 102, 139, 6
db 141, 87, 255
db 193, 232, 2
db 131, 198, 2
db 41, 194
db 57, 232
db 114, 110
db 59, 84, 36, 48
db 15, 130, 77, 1, 0, 0
db 141, 4, 15
db 57, 4, 36
db 15, 130, 58, 1, 0, 0
db 137, 203
db 193, 235, 2
db 116, 17
db 139, 2
db 131, 194, 4
db 137, 7
db 131, 199, 4
db 75
db 117, 243
db 33, 233
db 116, 9
db 138, 2
db 66
db 136, 7
db 71
db 73
db 117, 247
db 138, 70, 254
db 33, 232
db 15, 132, 196, 254, 255, 255
db 141, 20, 7
db 57, 20, 36
db 15, 130, 2, 1, 0, 0
db 141, 20, 6
db 57, 84, 36, 4
db 15, 130, 238, 0, 0, 0
db 138, 14
db 70
db 136, 15
db 71
db 72
db 117, 247
db 138, 6
db 70
db 233, 42, 255, 255, 255
db 137, 246
db 59, 84, 36, 48
db 15, 130, 223, 0, 0, 0
db 141, 68, 15, 0
db 57, 4, 36
db 15, 130, 203, 0, 0, 0
db 135, 214
db 243, 164
db 137, 214
db 235, 170
db 129, 193, 255, 0, 0, 0
db 141, 86, 3
db 57, 84, 36, 4
db 15, 130, 169, 0, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 230
db 141, 76, 11, 9
db 235, 21
db 144
db 60, 16
db 114, 44
db 137, 193
db 131, 224, 8
db 193, 224, 13
db 131, 225, 7
db 116, 225
db 131, 193, 2
db 102, 139, 6
db 131, 198, 2
db 141, 151, 0, 192, 255, 255
db 193, 232, 2
db 116, 57
db 41, 194
db 233, 38, 255, 255, 255
db 141, 116, 38, 0
db 141, 87, 2
db 57, 20, 36
db 114, 106
db 193, 232, 2
db 138, 30
db 141, 87, 255
db 141, 4, 152
db 70
db 41, 194
db 59, 84, 36, 48
db 114, 93
db 138, 2
db 136, 7
db 138, 90, 1
db 136, 95, 1
db 131, 199, 2
db 233, 43, 255, 255, 255
db 131, 249, 3
db 15, 149, 192
db 59, 60, 36
db 119, 57
db 139, 84, 36, 40
db 3, 84, 36, 44
db 57, 214
db 119, 38
db 114, 29
db 43, 124, 36, 48
db 139, 84, 36, 52
db 137, 58
db 247, 216
db 131, 196, 12
db 90
db 89
db 91
db 94
db 95
db 93
db 195
db 184, 1, 0, 0, 0
db 235, 227
db 184, 8, 0, 0, 0
db 235, 220
db 184, 4, 0, 0, 0
db 235, 213
db 184, 5, 0, 0, 0
db 235, 206
db 184, 6, 0, 0, 0
db 235, 199
end
|
Added work/contrib/lzo/lzo-1.08/src/i386/d_asm3/lzo1c_s1.asm.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
|
; /*** DO NOT EDIT - GENERATED AUTOMATICALLY ***/
; /*** Copyright (C) 1996-2002 Markus F.X.J. Oberhumer ***/
BITS 32
SECTION .text
GLOBAL _lzo1c_decompress_asm
_lzo1c_decompress_asm:
db 85
db 87
db 86
db 83
db 81
db 82
db 131, 236, 12
db 252
db 139, 116, 36, 40
db 139, 124, 36, 48
db 189, 3, 0, 0, 0
db 144
db 49, 192
db 138, 6
db 70
db 60, 32
db 115, 15
db 8, 192
db 116, 51
db 137, 193
db 243, 164
db 138, 6
db 70
db 60, 32
db 114, 72
db 60, 64
db 114, 93
db 137, 193
db 36, 31
db 141, 87, 255
db 193, 233, 5
db 41, 194
db 138, 6
db 70
db 193, 224, 5
db 41, 194
db 65
db 135, 242
db 243, 164
db 137, 214
db 235, 199
db 141, 180, 38, 0, 0, 0, 0
db 138, 6
db 70
db 141, 72, 32
db 60, 248
db 114, 197
db 185, 24, 1, 0, 0
db 44, 248
db 116, 6
db 145
db 48, 192
db 211, 224
db 145
db 243, 164
db 235, 163
db 141, 118, 0
db 141, 87, 255
db 41, 194
db 138, 6
db 70
db 193, 224, 5
db 41, 194
db 135, 242
db 164
db 164
db 164
db 137, 214
db 164
db 49, 192
db 235, 152
db 36, 31
db 137, 193
db 117, 19
db 177, 31
db 138, 6
db 70
db 8, 192
db 117, 8
db 129, 193, 255, 0, 0, 0
db 235, 241
db 1, 193
db 138, 6
db 70
db 137, 195
db 36, 63
db 137, 250
db 41, 194
db 138, 6
db 70
db 193, 224, 6
db 41, 194
db 57, 250
db 116, 27
db 135, 214
db 141, 73, 3
db 243, 164
db 137, 214
db 49, 192
db 193, 235, 6
db 137, 217
db 15, 133, 80, 255, 255, 255
db 233, 60, 255, 255, 255
db 131, 249, 1
db 15, 149, 192
db 139, 84, 36, 40
db 3, 84, 36, 44
db 57, 214
db 119, 38
db 114, 29
db 43, 124, 36, 48
db 139, 84, 36, 52
db 137, 58
db 247, 216
db 131, 196, 12
db 90
db 89
db 91
db 94
db 95
db 93
db 195
db 184, 1, 0, 0, 0
db 235, 227
db 184, 8, 0, 0, 0
db 235, 220
db 184, 4, 0, 0, 0
db 235, 213
end
|
Added work/contrib/lzo/lzo-1.08/src/i386/d_asm3/lzo1c_s2.asm.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
|
; /*** DO NOT EDIT - GENERATED AUTOMATICALLY ***/
; /*** Copyright (C) 1996-2002 Markus F.X.J. Oberhumer ***/
BITS 32
SECTION .text
GLOBAL _lzo1c_decompress_asm_safe
_lzo1c_decompress_asm_safe:
db 85
db 87
db 86
db 83
db 81
db 82
db 131, 236, 12
db 252
db 139, 116, 36, 40
db 139, 124, 36, 48
db 189, 3, 0, 0, 0
db 141, 70, 253
db 3, 68, 36, 44
db 137, 68, 36, 4
db 137, 248
db 139, 84, 36, 52
db 3, 2
db 137, 4, 36
db 141, 118, 0
db 49, 192
db 138, 6
db 70
db 60, 32
db 115, 40
db 8, 192
db 116, 99
db 137, 193
db 141, 28, 15
db 57, 28, 36
db 15, 130, 107, 1, 0, 0
db 141, 28, 14
db 57, 92, 36, 4
db 15, 130, 87, 1, 0, 0
db 243, 164
db 138, 6
db 70
db 60, 32
db 114, 127
db 60, 64
db 15, 130, 169, 0, 0, 0
db 137, 193
db 36, 31
db 141, 87, 255
db 193, 233, 5
db 41, 194
db 138, 6
db 70
db 193, 224, 5
db 41, 194
db 65
db 135, 242
db 59, 116, 36, 48
db 15, 130, 51, 1, 0, 0
db 141, 28, 15
db 57, 28, 36
db 15, 130, 32, 1, 0, 0
db 243, 164
db 137, 214
db 235, 148
db 141, 116, 38, 0
db 138, 6
db 70
db 141, 72, 32
db 60, 248
db 114, 149
db 185, 24, 1, 0, 0
db 44, 248
db 116, 6
db 145
db 48, 192
db 211, 224
db 145
db 141, 28, 15
db 57, 28, 36
db 15, 130, 241, 0, 0, 0
db 141, 28, 14
db 57, 92, 36, 4
db 15, 130, 221, 0, 0, 0
db 243, 164
db 233, 87, 255, 255, 255
db 141, 180, 38, 0, 0, 0, 0
db 141, 87, 255
db 41, 194
db 138, 6
db 70
db 193, 224, 5
db 41, 194
db 135, 242
db 59, 116, 36, 48
db 15, 130, 196, 0, 0, 0
db 141, 95, 4
db 57, 28, 36
db 15, 130, 177, 0, 0, 0
db 164
db 164
db 164
db 137, 214
db 164
db 49, 192
db 233, 72, 255, 255, 255
db 36, 31
db 137, 193
db 117, 26
db 177, 31
db 138, 6
db 70
db 8, 192
db 117, 15
db 129, 193, 255, 0, 0, 0
db 235, 241
db 141, 180, 38, 0, 0, 0, 0
db 1, 193
db 138, 6
db 70
db 137, 195
db 36, 63
db 137, 250
db 41, 194
db 138, 6
db 70
db 193, 224, 6
db 41, 194
db 57, 250
db 116, 41
db 135, 214
db 141, 73, 3
db 59, 116, 36, 48
db 114, 105
db 141, 4, 15
db 57, 4, 36
db 114, 90
db 243, 164
db 137, 214
db 49, 192
db 193, 235, 6
db 137, 217
db 15, 133, 210, 254, 255, 255
db 233, 190, 254, 255, 255
db 131, 249, 1
db 15, 149, 192
db 59, 60, 36
db 119, 57
db 139, 84, 36, 40
db 3, 84, 36, 44
db 57, 214
db 119, 38
db 114, 29
db 43, 124, 36, 48
db 139, 84, 36, 52
db 137, 58
db 247, 216
db 131, 196, 12
db 90
db 89
db 91
db 94
db 95
db 93
db 195
db 184, 1, 0, 0, 0
db 235, 227
db 184, 8, 0, 0, 0
db 235, 220
db 184, 4, 0, 0, 0
db 235, 213
db 184, 5, 0, 0, 0
db 235, 206
db 184, 6, 0, 0, 0
db 235, 199
end
|
Added work/contrib/lzo/lzo-1.08/src/i386/d_asm3/lzo1f_f1.asm.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
; /*** DO NOT EDIT - GENERATED AUTOMATICALLY ***/
; /*** Copyright (C) 1996-2002 Markus F.X.J. Oberhumer ***/
BITS 32
SECTION .text
GLOBAL _lzo1f_decompress_asm_fast
_lzo1f_decompress_asm_fast:
db 85
db 87
db 86
db 83
db 81
db 82
db 131, 236, 12
db 252
db 139, 116, 36, 40
db 139, 124, 36, 48
db 189, 3, 0, 0, 0
db 144
db 49, 192
db 138, 6
db 70
db 60, 31
db 119, 51
db 8, 192
db 137, 193
db 117, 19
db 138, 6
db 70
db 8, 192
db 117, 8
db 129, 193, 255, 0, 0, 0
db 235, 241
db 141, 76, 8, 31
db 136, 200
db 193, 233, 2
db 243, 165
db 36, 3
db 116, 8
db 139, 30
db 1, 198
db 137, 31
db 1, 199
db 138, 6
db 70
db 60, 31
db 118, 88
db 60, 223
db 15, 135, 132, 0, 0, 0
db 137, 193
db 193, 232, 2
db 141, 87, 255
db 36, 7
db 193, 233, 5
db 137, 195
db 138, 6
db 141, 4, 195
db 70
db 41, 194
db 131, 193, 2
db 135, 214
db 131, 249, 6
db 114, 16
db 131, 248, 4
db 114, 11
db 136, 200
db 193, 233, 2
db 243, 165
db 36, 3
db 136, 193
db 243, 164
db 137, 214
db 138, 78, 254
db 131, 225, 3
db 15, 132, 123, 255, 255, 255
db 139, 6
db 1, 206
db 137, 7
db 1, 207
db 49, 192
db 138, 6
db 70
db 235, 164
db 193, 232, 2
db 141, 151, 255, 247, 255, 255
db 137, 193
db 138, 6
db 70
db 141, 4, 193
db 41, 194
db 139, 2
db 137, 7
db 131, 199, 3
db 235, 201
db 138, 6
db 70
db 8, 192
db 117, 8
db 129, 193, 255, 0, 0, 0
db 235, 241
db 141, 76, 8, 31
db 235, 9
db 141, 118, 0
db 36, 31
db 137, 193
db 116, 226
db 137, 250
db 102, 139, 6
db 131, 198, 2
db 193, 232, 2
db 15, 133, 122, 255, 255, 255
db 131, 249, 1
db 15, 149, 192
db 139, 84, 36, 40
db 3, 84, 36, 44
db 57, 214
db 119, 38
db 114, 29
db 43, 124, 36, 48
db 139, 84, 36, 52
db 137, 58
db 247, 216
db 131, 196, 12
db 90
db 89
db 91
db 94
db 95
db 93
db 195
db 184, 1, 0, 0, 0
db 235, 227
db 184, 8, 0, 0, 0
db 235, 220
db 184, 4, 0, 0, 0
db 235, 213
end
|
Added work/contrib/lzo/lzo-1.08/src/i386/d_asm3/lzo1f_f2.asm.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
|
; /*** DO NOT EDIT - GENERATED AUTOMATICALLY ***/
; /*** Copyright (C) 1996-2002 Markus F.X.J. Oberhumer ***/
BITS 32
SECTION .text
GLOBAL _lzo1f_decompress_asm_fast_safe
_lzo1f_decompress_asm_fast_safe:
db 85
db 87
db 86
db 83
db 81
db 82
db 131, 236, 12
db 252
db 139, 116, 36, 40
db 139, 124, 36, 48
db 189, 3, 0, 0, 0
db 141, 70, 253
db 3, 68, 36, 44
db 137, 68, 36, 4
db 137, 248
db 139, 84, 36, 52
db 3, 2
db 137, 4, 36
db 141, 118, 0
db 49, 192
db 138, 6
db 70
db 60, 31
db 119, 76
db 8, 192
db 137, 193
db 117, 19
db 138, 6
db 70
db 8, 192
db 117, 8
db 129, 193, 255, 0, 0, 0
db 235, 241
db 141, 76, 8, 31
db 141, 28, 15
db 57, 28, 36
db 15, 130, 61, 1, 0, 0
db 141, 28, 14
db 57, 92, 36, 4
db 15, 130, 41, 1, 0, 0
db 136, 200
db 193, 233, 2
db 243, 165
db 36, 3
db 116, 8
db 139, 30
db 1, 198
db 137, 31
db 1, 199
db 138, 6
db 70
db 60, 31
db 118, 110
db 60, 223
db 15, 135, 179, 0, 0, 0
db 137, 193
db 193, 232, 2
db 141, 87, 255
db 36, 7
db 193, 233, 5
db 137, 195
db 138, 6
db 141, 4, 195
db 70
db 41, 194
db 131, 193, 2
db 135, 214
db 59, 116, 36, 48
db 15, 130, 239, 0, 0, 0
db 141, 28, 15
db 57, 28, 36
db 15, 130, 220, 0, 0, 0
db 131, 249, 6
db 114, 16
db 131, 248, 4
db 114, 11
db 136, 200
db 193, 233, 2
db 243, 165
db 36, 3
db 136, 193
db 243, 164
db 137, 214
db 138, 78, 254
db 131, 225, 3
db 15, 132, 76, 255, 255, 255
db 139, 6
db 1, 206
db 137, 7
db 1, 207
db 49, 192
db 138, 6
db 70
db 235, 142
db 141, 87, 3
db 57, 20, 36
db 15, 130, 156, 0, 0, 0
db 193, 232, 2
db 141, 151, 255, 247, 255, 255
db 137, 193
db 138, 6
db 70
db 141, 4, 193
db 41, 194
db 59, 84, 36, 48
db 15, 130, 134, 0, 0, 0
db 139, 2
db 137, 7
db 131, 199, 3
db 235, 179
db 138, 6
db 70
db 8, 192
db 117, 8
db 129, 193, 255, 0, 0, 0
db 235, 241
db 141, 76, 8, 31
db 235, 12
db 141, 182, 0, 0, 0, 0
db 36, 31
db 137, 193
db 116, 223
db 137, 250
db 102, 139, 6
db 131, 198, 2
db 193, 232, 2
db 15, 133, 75, 255, 255, 255
db 131, 249, 1
db 15, 149, 192
db 59, 60, 36
db 119, 57
db 139, 84, 36, 40
db 3, 84, 36, 44
db 57, 214
db 119, 38
db 114, 29
db 43, 124, 36, 48
db 139, 84, 36, 52
db 137, 58
db 247, 216
db 131, 196, 12
db 90
db 89
db 91
db 94
db 95
db 93
db 195
db 184, 1, 0, 0, 0
db 235, 227
db 184, 8, 0, 0, 0
db 235, 220
db 184, 4, 0, 0, 0
db 235, 213
db 184, 5, 0, 0, 0
db 235, 206
db 184, 6, 0, 0, 0
db 235, 199
end
|
Added work/contrib/lzo/lzo-1.08/src/i386/d_asm3/lzo1x_f1.asm.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
|
; /*** DO NOT EDIT - GENERATED AUTOMATICALLY ***/
; /*** Copyright (C) 1996-2002 Markus F.X.J. Oberhumer ***/
BITS 32
SECTION .text
GLOBAL _lzo1x_decompress_asm_fast
_lzo1x_decompress_asm_fast:
db 85
db 87
db 86
db 83
db 81
db 82
db 131, 236, 12
db 252
db 139, 116, 36, 40
db 139, 124, 36, 48
db 189, 3, 0, 0, 0
db 49, 192
db 49, 219
db 172
db 60, 17
db 118, 27
db 44, 14
db 235, 34
db 5, 255, 0, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 244
db 141, 68, 24, 21
db 235, 16
db 137, 246
db 138, 6
db 70
db 60, 16
db 115, 65
db 8, 192
db 116, 230
db 131, 192, 6
db 137, 193
db 49, 232
db 193, 233, 2
db 33, 232
db 139, 22
db 131, 198, 4
db 137, 23
db 131, 199, 4
db 73
db 117, 243
db 41, 198
db 41, 199
db 138, 6
db 70
db 60, 16
db 115, 25
db 193, 232, 2
db 138, 30
db 141, 151, 255, 247, 255, 255
db 141, 4, 152
db 70
db 41, 194
db 139, 10
db 137, 15
db 1, 239
db 235, 110
db 60, 64
db 114, 52
db 137, 193
db 193, 232, 2
db 141, 87, 255
db 131, 224, 7
db 138, 30
db 193, 233, 5
db 141, 4, 216
db 70
db 41, 194
db 131, 193, 4
db 57, 232
db 115, 53
db 235, 109
db 5, 255, 0, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 244
db 141, 76, 24, 36
db 49, 192
db 235, 13
db 144
db 60, 32
db 114, 116
db 131, 224, 31
db 116, 231
db 141, 72, 5
db 102, 139, 6
db 141, 87, 255
db 193, 232, 2
db 131, 198, 2
db 41, 194
db 57, 232
db 114, 58
db 141, 68, 15, 253
db 193, 233, 2
db 139, 26
db 131, 194, 4
db 137, 31
db 131, 199, 4
db 73
db 117, 243
db 137, 199
db 49, 219
db 138, 70, 254
db 33, 232
db 15, 132, 63, 255, 255, 255
db 139, 22
db 1, 198
db 137, 23
db 1, 199
db 138, 6
db 70
db 233, 119, 255, 255, 255
db 141, 180, 38, 0, 0, 0, 0
db 135, 214
db 41, 233
db 243, 164
db 137, 214
db 235, 212
db 129, 193, 255, 0, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 243
db 141, 76, 11, 12
db 235, 23
db 141, 118, 0
db 60, 16
db 114, 44
db 137, 193
db 131, 224, 8
db 193, 224, 13
db 131, 225, 7
db 116, 223
db 131, 193, 5
db 102, 139, 6
db 131, 198, 2
db 141, 151, 0, 192, 255, 255
db 193, 232, 2
db 116, 43
db 41, 194
db 233, 122, 255, 255, 255
db 141, 116, 38, 0
db 193, 232, 2
db 138, 30
db 141, 87, 255
db 141, 4, 152
db 70
db 41, 194
db 138, 2
db 136, 7
db 138, 90, 1
db 136, 95, 1
db 131, 199, 2
db 233, 110, 255, 255, 255
db 131, 249, 6
db 15, 149, 192
db 139, 84, 36, 40
db 3, 84, 36, 44
db 57, 214
db 119, 38
db 114, 29
db 43, 124, 36, 48
db 139, 84, 36, 52
db 137, 58
db 247, 216
db 131, 196, 12
db 90
db 89
db 91
db 94
db 95
db 93
db 195
db 184, 1, 0, 0, 0
db 235, 227
db 184, 8, 0, 0, 0
db 235, 220
db 184, 4, 0, 0, 0
db 235, 213
end
|
Added work/contrib/lzo/lzo-1.08/src/i386/d_asm3/lzo1x_f2.asm.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
|
; /*** DO NOT EDIT - GENERATED AUTOMATICALLY ***/
; /*** Copyright (C) 1996-2002 Markus F.X.J. Oberhumer ***/
BITS 32
SECTION .text
GLOBAL _lzo1x_decompress_asm_fast_safe
_lzo1x_decompress_asm_fast_safe:
db 85
db 87
db 86
db 83
db 81
db 82
db 131, 236, 12
db 252
db 139, 116, 36, 40
db 139, 124, 36, 48
db 189, 3, 0, 0, 0
db 141, 70, 253
db 3, 68, 36, 44
db 137, 68, 36, 4
db 137, 248
db 139, 84, 36, 52
db 3, 2
db 137, 4, 36
db 49, 192
db 49, 219
db 172
db 60, 17
db 118, 55
db 44, 14
db 235, 62
db 5, 255, 0, 0, 0
db 141, 84, 6, 18
db 57, 84, 36, 4
db 15, 130, 78, 2, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 230
db 141, 68, 24, 21
db 235, 30
db 141, 182, 0, 0, 0, 0
db 57, 116, 36, 4
db 15, 130, 49, 2, 0, 0
db 138, 6
db 70
db 60, 16
db 115, 119
db 8, 192
db 116, 216
db 131, 192, 6
db 141, 84, 7, 253
db 57, 20, 36
db 15, 130, 29, 2, 0, 0
db 141, 84, 6, 253
db 57, 84, 36, 4
db 15, 130, 8, 2, 0, 0
db 137, 193
db 49, 232
db 193, 233, 2
db 33, 232
db 139, 22
db 131, 198, 4
db 137, 23
db 131, 199, 4
db 73
db 117, 243
db 41, 198
db 41, 199
db 138, 6
db 70
db 60, 16
db 115, 52
db 141, 87, 3
db 57, 20, 36
db 15, 130, 226, 1, 0, 0
db 193, 232, 2
db 138, 30
db 141, 151, 255, 247, 255, 255
db 141, 4, 152
db 70
db 41, 194
db 59, 84, 36, 48
db 15, 130, 206, 1, 0, 0
db 139, 10
db 137, 15
db 1, 239
db 233, 151, 0, 0, 0
db 137, 246
db 60, 64
db 114, 68
db 137, 193
db 193, 232, 2
db 141, 87, 255
db 131, 224, 7
db 138, 30
db 193, 233, 5
db 141, 4, 216
db 70
db 41, 194
db 131, 193, 4
db 57, 232
db 115, 73
db 233, 170, 0, 0, 0
db 5, 255, 0, 0, 0
db 141, 86, 3
db 57, 84, 36, 4
db 15, 130, 123, 1, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 231
db 141, 76, 24, 36
db 49, 192
db 235, 17
db 144
db 60, 32
db 15, 130, 200, 0, 0, 0
db 131, 224, 31
db 116, 227
db 141, 72, 5
db 102, 139, 6
db 141, 87, 255
db 193, 232, 2
db 131, 198, 2
db 41, 194
db 57, 232
db 114, 102
db 59, 84, 36, 48
db 15, 130, 77, 1, 0, 0
db 141, 68, 15, 253
db 193, 233, 2
db 57, 4, 36
db 15, 130, 54, 1, 0, 0
db 139, 26
db 131, 194, 4
db 137, 31
db 131, 199, 4
db 73
db 117, 243
db 137, 199
db 49, 219
db 138, 70, 254
db 33, 232
db 15, 132, 216, 254, 255, 255
db 141, 20, 7
db 57, 20, 36
db 15, 130, 14, 1, 0, 0
db 141, 20, 6
db 57, 84, 36, 4
db 15, 130, 250, 0, 0, 0
db 139, 22
db 1, 198
db 137, 23
db 1, 199
db 138, 6
db 70
db 233, 55, 255, 255, 255
db 141, 180, 38, 0, 0, 0, 0
db 59, 84, 36, 48
db 15, 130, 231, 0, 0, 0
db 141, 68, 15, 253
db 57, 4, 36
db 15, 130, 211, 0, 0, 0
db 135, 214
db 41, 233
db 243, 164
db 137, 214
db 235, 164
db 129, 193, 255, 0, 0, 0
db 141, 86, 3
db 57, 84, 36, 4
db 15, 130, 175, 0, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 230
db 141, 76, 11, 12
db 235, 27
db 141, 180, 38, 0, 0, 0, 0
db 60, 16
db 114, 44
db 137, 193
db 131, 224, 8
db 193, 224, 13
db 131, 225, 7
db 116, 219
db 131, 193, 5
db 102, 139, 6
db 131, 198, 2
db 141, 151, 0, 192, 255, 255
db 193, 232, 2
db 116, 57
db 41, 194
db 233, 38, 255, 255, 255
db 141, 116, 38, 0
db 141, 87, 2
db 57, 20, 36
db 114, 106
db 193, 232, 2
db 138, 30
db 141, 87, 255
db 141, 4, 152
db 70
db 41, 194
db 59, 84, 36, 48
db 114, 93
db 138, 2
db 136, 7
db 138, 90, 1
db 136, 95, 1
db 131, 199, 2
db 233, 31, 255, 255, 255
db 131, 249, 6
db 15, 149, 192
db 59, 60, 36
db 119, 57
db 139, 84, 36, 40
db 3, 84, 36, 44
db 57, 214
db 119, 38
db 114, 29
db 43, 124, 36, 48
db 139, 84, 36, 52
db 137, 58
db 247, 216
db 131, 196, 12
db 90
db 89
db 91
db 94
db 95
db 93
db 195
db 184, 1, 0, 0, 0
db 235, 227
db 184, 8, 0, 0, 0
db 235, 220
db 184, 4, 0, 0, 0
db 235, 213
db 184, 5, 0, 0, 0
db 235, 206
db 184, 6, 0, 0, 0
db 235, 199
end
|
Added work/contrib/lzo/lzo-1.08/src/i386/d_asm3/lzo1x_s1.asm.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
|
; /*** DO NOT EDIT - GENERATED AUTOMATICALLY ***/
; /*** Copyright (C) 1996-2002 Markus F.X.J. Oberhumer ***/
BITS 32
SECTION .text
GLOBAL _lzo1x_decompress_asm
_lzo1x_decompress_asm:
db 85
db 87
db 86
db 83
db 81
db 82
db 131, 236, 12
db 252
db 139, 116, 36, 40
db 139, 124, 36, 48
db 189, 3, 0, 0, 0
db 49, 192
db 49, 219
db 172
db 60, 17
db 118, 35
db 44, 17
db 60, 4
db 115, 40
db 137, 193
db 235, 56
db 5, 255, 0, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 244
db 141, 68, 24, 18
db 235, 18
db 141, 116, 38, 0
db 138, 6
db 70
db 60, 16
db 115, 73
db 8, 192
db 116, 228
db 131, 192, 3
db 137, 193
db 193, 232, 2
db 33, 233
db 139, 22
db 131, 198, 4
db 137, 23
db 131, 199, 4
db 72
db 117, 243
db 243, 164
db 138, 6
db 70
db 60, 16
db 115, 37
db 193, 232, 2
db 138, 30
db 141, 151, 255, 247, 255, 255
db 141, 4, 152
db 70
db 41, 194
db 138, 2
db 136, 7
db 138, 66, 1
db 136, 71, 1
db 138, 66, 2
db 136, 71, 2
db 1, 239
db 235, 119
db 60, 64
db 114, 52
db 137, 193
db 193, 232, 2
db 141, 87, 255
db 131, 224, 7
db 138, 30
db 193, 233, 5
db 141, 4, 216
db 70
db 41, 194
db 65
db 57, 232
db 115, 55
db 235, 119
db 5, 255, 0, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 244
db 141, 76, 24, 33
db 49, 192
db 235, 15
db 141, 118, 0
db 60, 32
db 114, 124
db 131, 224, 31
db 116, 229
db 141, 72, 2
db 102, 139, 6
db 141, 87, 255
db 193, 232, 2
db 131, 198, 2
db 41, 194
db 57, 232
db 114, 66
db 137, 203
db 193, 235, 2
db 116, 17
db 139, 2
db 131, 194, 4
db 137, 7
db 131, 199, 4
db 75
db 117, 243
db 33, 233
db 116, 9
db 138, 2
db 66
db 136, 7
db 71
db 73
db 117, 247
db 138, 70, 254
db 33, 232
db 15, 132, 46, 255, 255, 255
db 138, 14
db 70
db 136, 15
db 71
db 72
db 117, 247
db 138, 6
db 70
db 233, 109, 255, 255, 255
db 144
db 141, 116, 38, 0
db 135, 214
db 243, 164
db 137, 214
db 235, 215
db 129, 193, 255, 0, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 243
db 141, 76, 11, 9
db 235, 25
db 144
db 141, 116, 38, 0
db 60, 16
db 114, 44
db 137, 193
db 131, 224, 8
db 193, 224, 13
db 131, 225, 7
db 116, 221
db 131, 193, 2
db 102, 139, 6
db 131, 198, 2
db 141, 151, 0, 192, 255, 255
db 193, 232, 2
db 116, 43
db 41, 194
db 233, 114, 255, 255, 255
db 141, 116, 38, 0
db 193, 232, 2
db 138, 30
db 141, 87, 255
db 141, 4, 152
db 70
db 41, 194
db 138, 2
db 136, 7
db 138, 90, 1
db 136, 95, 1
db 131, 199, 2
db 233, 111, 255, 255, 255
db 131, 249, 3
db 15, 149, 192
db 139, 84, 36, 40
db 3, 84, 36, 44
db 57, 214
db 119, 38
db 114, 29
db 43, 124, 36, 48
db 139, 84, 36, 52
db 137, 58
db 247, 216
db 131, 196, 12
db 90
db 89
db 91
db 94
db 95
db 93
db 195
db 184, 1, 0, 0, 0
db 235, 227
db 184, 8, 0, 0, 0
db 235, 220
db 184, 4, 0, 0, 0
db 235, 213
end
|
Added work/contrib/lzo/lzo-1.08/src/i386/d_asm3/lzo1x_s2.asm.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
|
; /*** DO NOT EDIT - GENERATED AUTOMATICALLY ***/
; /*** Copyright (C) 1996-2002 Markus F.X.J. Oberhumer ***/
BITS 32
SECTION .text
GLOBAL _lzo1x_decompress_asm_safe
_lzo1x_decompress_asm_safe:
db 85
db 87
db 86
db 83
db 81
db 82
db 131, 236, 12
db 252
db 139, 116, 36, 40
db 139, 124, 36, 48
db 189, 3, 0, 0, 0
db 141, 70, 253
db 3, 68, 36, 44
db 137, 68, 36, 4
db 137, 248
db 139, 84, 36, 52
db 3, 2
db 137, 4, 36
db 49, 192
db 49, 219
db 172
db 60, 17
db 118, 87
db 44, 17
db 60, 4
db 115, 92
db 141, 20, 7
db 57, 20, 36
db 15, 130, 130, 2, 0, 0
db 141, 20, 6
db 57, 84, 36, 4
db 15, 130, 110, 2, 0, 0
db 137, 193
db 235, 110
db 5, 255, 0, 0, 0
db 141, 84, 6, 18
db 57, 84, 36, 4
db 15, 130, 87, 2, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 230
db 141, 68, 24, 18
db 235, 31
db 141, 180, 38, 0, 0, 0, 0
db 57, 116, 36, 4
db 15, 130, 57, 2, 0, 0
db 138, 6
db 70
db 60, 16
db 115, 127
db 8, 192
db 116, 215
db 131, 192, 3
db 141, 84, 7, 0
db 57, 20, 36
db 15, 130, 37, 2, 0, 0
db 141, 84, 6, 0
db 57, 84, 36, 4
db 15, 130, 16, 2, 0, 0
db 137, 193
db 193, 232, 2
db 33, 233
db 139, 22
db 131, 198, 4
db 137, 23
db 131, 199, 4
db 72
db 117, 243
db 243, 164
db 138, 6
db 70
db 60, 16
db 115, 64
db 141, 87, 3
db 57, 20, 36
db 15, 130, 238, 1, 0, 0
db 193, 232, 2
db 138, 30
db 141, 151, 255, 247, 255, 255
db 141, 4, 152
db 70
db 41, 194
db 59, 84, 36, 48
db 15, 130, 218, 1, 0, 0
db 138, 2
db 136, 7
db 138, 66, 1
db 136, 71, 1
db 138, 66, 2
db 136, 71, 2
db 1, 239
db 233, 163, 0, 0, 0
db 137, 246
db 60, 64
db 114, 68
db 137, 193
db 193, 232, 2
db 141, 87, 255
db 131, 224, 7
db 138, 30
db 193, 233, 5
db 141, 4, 216
db 70
db 41, 194
db 65
db 57, 232
db 115, 75
db 233, 180, 0, 0, 0
db 5, 255, 0, 0, 0
db 141, 86, 3
db 57, 84, 36, 4
db 15, 130, 125, 1, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 231
db 141, 76, 24, 33
db 49, 192
db 235, 19
db 141, 118, 0
db 60, 32
db 15, 130, 200, 0, 0, 0
db 131, 224, 31
db 116, 225
db 141, 72, 2
db 102, 139, 6
db 141, 87, 255
db 193, 232, 2
db 131, 198, 2
db 41, 194
db 57, 232
db 114, 110
db 59, 84, 36, 48
db 15, 130, 77, 1, 0, 0
db 141, 4, 15
db 57, 4, 36
db 15, 130, 58, 1, 0, 0
db 137, 203
db 193, 235, 2
db 116, 17
db 139, 2
db 131, 194, 4
db 137, 7
db 131, 199, 4
db 75
db 117, 243
db 33, 233
db 116, 9
db 138, 2
db 66
db 136, 7
db 71
db 73
db 117, 247
db 138, 70, 254
db 33, 232
db 15, 132, 196, 254, 255, 255
db 141, 20, 7
db 57, 20, 36
db 15, 130, 2, 1, 0, 0
db 141, 20, 6
db 57, 84, 36, 4
db 15, 130, 238, 0, 0, 0
db 138, 14
db 70
db 136, 15
db 71
db 72
db 117, 247
db 138, 6
db 70
db 233, 42, 255, 255, 255
db 137, 246
db 59, 84, 36, 48
db 15, 130, 223, 0, 0, 0
db 141, 68, 15, 0
db 57, 4, 36
db 15, 130, 203, 0, 0, 0
db 135, 214
db 243, 164
db 137, 214
db 235, 170
db 129, 193, 255, 0, 0, 0
db 141, 86, 3
db 57, 84, 36, 4
db 15, 130, 169, 0, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 230
db 141, 76, 11, 9
db 235, 21
db 144
db 60, 16
db 114, 44
db 137, 193
db 131, 224, 8
db 193, 224, 13
db 131, 225, 7
db 116, 225
db 131, 193, 2
db 102, 139, 6
db 131, 198, 2
db 141, 151, 0, 192, 255, 255
db 193, 232, 2
db 116, 57
db 41, 194
db 233, 38, 255, 255, 255
db 141, 116, 38, 0
db 141, 87, 2
db 57, 20, 36
db 114, 106
db 193, 232, 2
db 138, 30
db 141, 87, 255
db 141, 4, 152
db 70
db 41, 194
db 59, 84, 36, 48
db 114, 93
db 138, 2
db 136, 7
db 138, 90, 1
db 136, 95, 1
db 131, 199, 2
db 233, 43, 255, 255, 255
db 131, 249, 3
db 15, 149, 192
db 59, 60, 36
db 119, 57
db 139, 84, 36, 40
db 3, 84, 36, 44
db 57, 214
db 119, 38
db 114, 29
db 43, 124, 36, 48
db 139, 84, 36, 52
db 137, 58
db 247, 216
db 131, 196, 12
db 90
db 89
db 91
db 94
db 95
db 93
db 195
db 184, 1, 0, 0, 0
db 235, 227
db 184, 8, 0, 0, 0
db 235, 220
db 184, 4, 0, 0, 0
db 235, 213
db 184, 5, 0, 0, 0
db 235, 206
db 184, 6, 0, 0, 0
db 235, 199
end
|
Added work/contrib/lzo/lzo-1.08/src/i386/d_asm3/lzo1y_f1.asm.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
|
; /*** DO NOT EDIT - GENERATED AUTOMATICALLY ***/
; /*** Copyright (C) 1996-2002 Markus F.X.J. Oberhumer ***/
BITS 32
SECTION .text
GLOBAL _lzo1y_decompress_asm_fast
_lzo1y_decompress_asm_fast:
db 85
db 87
db 86
db 83
db 81
db 82
db 131, 236, 12
db 252
db 139, 116, 36, 40
db 139, 124, 36, 48
db 189, 3, 0, 0, 0
db 49, 192
db 49, 219
db 172
db 60, 17
db 118, 27
db 44, 14
db 235, 34
db 5, 255, 0, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 244
db 141, 68, 24, 21
db 235, 16
db 137, 246
db 138, 6
db 70
db 60, 16
db 115, 65
db 8, 192
db 116, 230
db 131, 192, 6
db 137, 193
db 49, 232
db 193, 233, 2
db 33, 232
db 139, 22
db 131, 198, 4
db 137, 23
db 131, 199, 4
db 73
db 117, 243
db 41, 198
db 41, 199
db 138, 6
db 70
db 60, 16
db 115, 25
db 193, 232, 2
db 138, 30
db 141, 151, 255, 251, 255, 255
db 141, 4, 152
db 70
db 41, 194
db 139, 10
db 137, 15
db 1, 239
db 235, 110
db 60, 64
db 114, 52
db 137, 193
db 193, 232, 2
db 141, 87, 255
db 33, 232
db 138, 30
db 193, 233, 4
db 141, 4, 152
db 70
db 41, 194
db 131, 193, 2
db 57, 232
db 115, 54
db 235, 110
db 5, 255, 0, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 244
db 141, 76, 24, 36
db 49, 192
db 235, 14
db 137, 246
db 60, 32
db 114, 116
db 131, 224, 31
db 116, 230
db 141, 72, 5
db 102, 139, 6
db 141, 87, 255
db 193, 232, 2
db 131, 198, 2
db 41, 194
db 57, 232
db 114, 58
db 141, 68, 15, 253
db 193, 233, 2
db 139, 26
db 131, 194, 4
db 137, 31
db 131, 199, 4
db 73
db 117, 243
db 137, 199
db 49, 219
db 138, 70, 254
db 33, 232
db 15, 132, 63, 255, 255, 255
db 139, 22
db 1, 198
db 137, 23
db 1, 199
db 138, 6
db 70
db 233, 119, 255, 255, 255
db 141, 180, 38, 0, 0, 0, 0
db 135, 214
db 41, 233
db 243, 164
db 137, 214
db 235, 212
db 129, 193, 255, 0, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 243
db 141, 76, 11, 12
db 235, 23
db 141, 118, 0
db 60, 16
db 114, 44
db 137, 193
db 131, 224, 8
db 193, 224, 13
db 131, 225, 7
db 116, 223
db 131, 193, 5
db 102, 139, 6
db 131, 198, 2
db 141, 151, 0, 192, 255, 255
db 193, 232, 2
db 116, 43
db 41, 194
db 233, 122, 255, 255, 255
db 141, 116, 38, 0
db 193, 232, 2
db 138, 30
db 141, 87, 255
db 141, 4, 152
db 70
db 41, 194
db 138, 2
db 136, 7
db 138, 90, 1
db 136, 95, 1
db 131, 199, 2
db 233, 110, 255, 255, 255
db 131, 249, 6
db 15, 149, 192
db 139, 84, 36, 40
db 3, 84, 36, 44
db 57, 214
db 119, 38
db 114, 29
db 43, 124, 36, 48
db 139, 84, 36, 52
db 137, 58
db 247, 216
db 131, 196, 12
db 90
db 89
db 91
db 94
db 95
db 93
db 195
db 184, 1, 0, 0, 0
db 235, 227
db 184, 8, 0, 0, 0
db 235, 220
db 184, 4, 0, 0, 0
db 235, 213
end
|
Added work/contrib/lzo/lzo-1.08/src/i386/d_asm3/lzo1y_f2.asm.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
|
; /*** DO NOT EDIT - GENERATED AUTOMATICALLY ***/
; /*** Copyright (C) 1996-2002 Markus F.X.J. Oberhumer ***/
BITS 32
SECTION .text
GLOBAL _lzo1y_decompress_asm_fast_safe
_lzo1y_decompress_asm_fast_safe:
db 85
db 87
db 86
db 83
db 81
db 82
db 131, 236, 12
db 252
db 139, 116, 36, 40
db 139, 124, 36, 48
db 189, 3, 0, 0, 0
db 141, 70, 253
db 3, 68, 36, 44
db 137, 68, 36, 4
db 137, 248
db 139, 84, 36, 52
db 3, 2
db 137, 4, 36
db 49, 192
db 49, 219
db 172
db 60, 17
db 118, 55
db 44, 14
db 235, 62
db 5, 255, 0, 0, 0
db 141, 84, 6, 18
db 57, 84, 36, 4
db 15, 130, 78, 2, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 230
db 141, 68, 24, 21
db 235, 30
db 141, 182, 0, 0, 0, 0
db 57, 116, 36, 4
db 15, 130, 49, 2, 0, 0
db 138, 6
db 70
db 60, 16
db 115, 119
db 8, 192
db 116, 216
db 131, 192, 6
db 141, 84, 7, 253
db 57, 20, 36
db 15, 130, 29, 2, 0, 0
db 141, 84, 6, 253
db 57, 84, 36, 4
db 15, 130, 8, 2, 0, 0
db 137, 193
db 49, 232
db 193, 233, 2
db 33, 232
db 139, 22
db 131, 198, 4
db 137, 23
db 131, 199, 4
db 73
db 117, 243
db 41, 198
db 41, 199
db 138, 6
db 70
db 60, 16
db 115, 52
db 141, 87, 3
db 57, 20, 36
db 15, 130, 226, 1, 0, 0
db 193, 232, 2
db 138, 30
db 141, 151, 255, 251, 255, 255
db 141, 4, 152
db 70
db 41, 194
db 59, 84, 36, 48
db 15, 130, 206, 1, 0, 0
db 139, 10
db 137, 15
db 1, 239
db 233, 151, 0, 0, 0
db 137, 246
db 60, 64
db 114, 68
db 137, 193
db 193, 232, 2
db 141, 87, 255
db 33, 232
db 138, 30
db 193, 233, 4
db 141, 4, 152
db 70
db 41, 194
db 131, 193, 2
db 57, 232
db 115, 74
db 233, 171, 0, 0, 0
db 5, 255, 0, 0, 0
db 141, 86, 3
db 57, 84, 36, 4
db 15, 130, 124, 1, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 231
db 141, 76, 24, 36
db 49, 192
db 235, 18
db 137, 246
db 60, 32
db 15, 130, 200, 0, 0, 0
db 131, 224, 31
db 116, 226
db 141, 72, 5
db 102, 139, 6
db 141, 87, 255
db 193, 232, 2
db 131, 198, 2
db 41, 194
db 57, 232
db 114, 102
db 59, 84, 36, 48
db 15, 130, 77, 1, 0, 0
db 141, 68, 15, 253
db 193, 233, 2
db 57, 4, 36
db 15, 130, 54, 1, 0, 0
db 139, 26
db 131, 194, 4
db 137, 31
db 131, 199, 4
db 73
db 117, 243
db 137, 199
db 49, 219
db 138, 70, 254
db 33, 232
db 15, 132, 216, 254, 255, 255
db 141, 20, 7
db 57, 20, 36
db 15, 130, 14, 1, 0, 0
db 141, 20, 6
db 57, 84, 36, 4
db 15, 130, 250, 0, 0, 0
db 139, 22
db 1, 198
db 137, 23
db 1, 199
db 138, 6
db 70
db 233, 55, 255, 255, 255
db 141, 180, 38, 0, 0, 0, 0
db 59, 84, 36, 48
db 15, 130, 231, 0, 0, 0
db 141, 68, 15, 253
db 57, 4, 36
db 15, 130, 211, 0, 0, 0
db 135, 214
db 41, 233
db 243, 164
db 137, 214
db 235, 164
db 129, 193, 255, 0, 0, 0
db 141, 86, 3
db 57, 84, 36, 4
db 15, 130, 175, 0, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 230
db 141, 76, 11, 12
db 235, 27
db 141, 180, 38, 0, 0, 0, 0
db 60, 16
db 114, 44
db 137, 193
db 131, 224, 8
db 193, 224, 13
db 131, 225, 7
db 116, 219
db 131, 193, 5
db 102, 139, 6
db 131, 198, 2
db 141, 151, 0, 192, 255, 255
db 193, 232, 2
db 116, 57
db 41, 194
db 233, 38, 255, 255, 255
db 141, 116, 38, 0
db 141, 87, 2
db 57, 20, 36
db 114, 106
db 193, 232, 2
db 138, 30
db 141, 87, 255
db 141, 4, 152
db 70
db 41, 194
db 59, 84, 36, 48
db 114, 93
db 138, 2
db 136, 7
db 138, 90, 1
db 136, 95, 1
db 131, 199, 2
db 233, 31, 255, 255, 255
db 131, 249, 6
db 15, 149, 192
db 59, 60, 36
db 119, 57
db 139, 84, 36, 40
db 3, 84, 36, 44
db 57, 214
db 119, 38
db 114, 29
db 43, 124, 36, 48
db 139, 84, 36, 52
db 137, 58
db 247, 216
db 131, 196, 12
db 90
db 89
db 91
db 94
db 95
db 93
db 195
db 184, 1, 0, 0, 0
db 235, 227
db 184, 8, 0, 0, 0
db 235, 220
db 184, 4, 0, 0, 0
db 235, 213
db 184, 5, 0, 0, 0
db 235, 206
db 184, 6, 0, 0, 0
db 235, 199
end
|
Added work/contrib/lzo/lzo-1.08/src/i386/d_asm3/lzo1y_s1.asm.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
|
; /*** DO NOT EDIT - GENERATED AUTOMATICALLY ***/
; /*** Copyright (C) 1996-2002 Markus F.X.J. Oberhumer ***/
BITS 32
SECTION .text
GLOBAL _lzo1y_decompress_asm
_lzo1y_decompress_asm:
db 85
db 87
db 86
db 83
db 81
db 82
db 131, 236, 12
db 252
db 139, 116, 36, 40
db 139, 124, 36, 48
db 189, 3, 0, 0, 0
db 49, 192
db 49, 219
db 172
db 60, 17
db 118, 35
db 44, 17
db 60, 4
db 115, 40
db 137, 193
db 235, 56
db 5, 255, 0, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 244
db 141, 68, 24, 18
db 235, 18
db 141, 116, 38, 0
db 138, 6
db 70
db 60, 16
db 115, 73
db 8, 192
db 116, 228
db 131, 192, 3
db 137, 193
db 193, 232, 2
db 33, 233
db 139, 22
db 131, 198, 4
db 137, 23
db 131, 199, 4
db 72
db 117, 243
db 243, 164
db 138, 6
db 70
db 60, 16
db 115, 37
db 193, 232, 2
db 138, 30
db 141, 151, 255, 251, 255, 255
db 141, 4, 152
db 70
db 41, 194
db 138, 2
db 136, 7
db 138, 66, 1
db 136, 71, 1
db 138, 66, 2
db 136, 71, 2
db 1, 239
db 235, 119
db 60, 64
db 114, 52
db 137, 193
db 193, 232, 2
db 141, 87, 255
db 33, 232
db 138, 30
db 193, 233, 4
db 141, 4, 152
db 70
db 41, 194
db 73
db 57, 232
db 115, 56
db 235, 120
db 5, 255, 0, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 244
db 141, 76, 24, 33
db 49, 192
db 235, 16
db 141, 116, 38, 0
db 60, 32
db 114, 124
db 131, 224, 31
db 116, 228
db 141, 72, 2
db 102, 139, 6
db 141, 87, 255
db 193, 232, 2
db 131, 198, 2
db 41, 194
db 57, 232
db 114, 66
db 137, 203
db 193, 235, 2
db 116, 17
db 139, 2
db 131, 194, 4
db 137, 7
db 131, 199, 4
db 75
db 117, 243
db 33, 233
db 116, 9
db 138, 2
db 66
db 136, 7
db 71
db 73
db 117, 247
db 138, 70, 254
db 33, 232
db 15, 132, 46, 255, 255, 255
db 138, 14
db 70
db 136, 15
db 71
db 72
db 117, 247
db 138, 6
db 70
db 233, 109, 255, 255, 255
db 144
db 141, 116, 38, 0
db 135, 214
db 243, 164
db 137, 214
db 235, 215
db 129, 193, 255, 0, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 243
db 141, 76, 11, 9
db 235, 25
db 144
db 141, 116, 38, 0
db 60, 16
db 114, 44
db 137, 193
db 131, 224, 8
db 193, 224, 13
db 131, 225, 7
db 116, 221
db 131, 193, 2
db 102, 139, 6
db 131, 198, 2
db 141, 151, 0, 192, 255, 255
db 193, 232, 2
db 116, 43
db 41, 194
db 233, 114, 255, 255, 255
db 141, 116, 38, 0
db 193, 232, 2
db 138, 30
db 141, 87, 255
db 141, 4, 152
db 70
db 41, 194
db 138, 2
db 136, 7
db 138, 90, 1
db 136, 95, 1
db 131, 199, 2
db 233, 111, 255, 255, 255
db 131, 249, 3
db 15, 149, 192
db 139, 84, 36, 40
db 3, 84, 36, 44
db 57, 214
db 119, 38
db 114, 29
db 43, 124, 36, 48
db 139, 84, 36, 52
db 137, 58
db 247, 216
db 131, 196, 12
db 90
db 89
db 91
db 94
db 95
db 93
db 195
db 184, 1, 0, 0, 0
db 235, 227
db 184, 8, 0, 0, 0
db 235, 220
db 184, 4, 0, 0, 0
db 235, 213
end
|
Added work/contrib/lzo/lzo-1.08/src/i386/d_asm3/lzo1y_s2.asm.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
|
; /*** DO NOT EDIT - GENERATED AUTOMATICALLY ***/
; /*** Copyright (C) 1996-2002 Markus F.X.J. Oberhumer ***/
BITS 32
SECTION .text
GLOBAL _lzo1y_decompress_asm_safe
_lzo1y_decompress_asm_safe:
db 85
db 87
db 86
db 83
db 81
db 82
db 131, 236, 12
db 252
db 139, 116, 36, 40
db 139, 124, 36, 48
db 189, 3, 0, 0, 0
db 141, 70, 253
db 3, 68, 36, 44
db 137, 68, 36, 4
db 137, 248
db 139, 84, 36, 52
db 3, 2
db 137, 4, 36
db 49, 192
db 49, 219
db 172
db 60, 17
db 118, 87
db 44, 17
db 60, 4
db 115, 92
db 141, 20, 7
db 57, 20, 36
db 15, 130, 130, 2, 0, 0
db 141, 20, 6
db 57, 84, 36, 4
db 15, 130, 110, 2, 0, 0
db 137, 193
db 235, 110
db 5, 255, 0, 0, 0
db 141, 84, 6, 18
db 57, 84, 36, 4
db 15, 130, 87, 2, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 230
db 141, 68, 24, 18
db 235, 31
db 141, 180, 38, 0, 0, 0, 0
db 57, 116, 36, 4
db 15, 130, 57, 2, 0, 0
db 138, 6
db 70
db 60, 16
db 115, 127
db 8, 192
db 116, 215
db 131, 192, 3
db 141, 84, 7, 0
db 57, 20, 36
db 15, 130, 37, 2, 0, 0
db 141, 84, 6, 0
db 57, 84, 36, 4
db 15, 130, 16, 2, 0, 0
db 137, 193
db 193, 232, 2
db 33, 233
db 139, 22
db 131, 198, 4
db 137, 23
db 131, 199, 4
db 72
db 117, 243
db 243, 164
db 138, 6
db 70
db 60, 16
db 115, 64
db 141, 87, 3
db 57, 20, 36
db 15, 130, 238, 1, 0, 0
db 193, 232, 2
db 138, 30
db 141, 151, 255, 251, 255, 255
db 141, 4, 152
db 70
db 41, 194
db 59, 84, 36, 48
db 15, 130, 218, 1, 0, 0
db 138, 2
db 136, 7
db 138, 66, 1
db 136, 71, 1
db 138, 66, 2
db 136, 71, 2
db 1, 239
db 233, 163, 0, 0, 0
db 137, 246
db 60, 64
db 114, 68
db 137, 193
db 193, 232, 2
db 141, 87, 255
db 33, 232
db 138, 30
db 193, 233, 4
db 141, 4, 152
db 70
db 41, 194
db 73
db 57, 232
db 115, 76
db 233, 181, 0, 0, 0
db 5, 255, 0, 0, 0
db 141, 86, 3
db 57, 84, 36, 4
db 15, 130, 126, 1, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 231
db 141, 76, 24, 33
db 49, 192
db 235, 20
db 141, 116, 38, 0
db 60, 32
db 15, 130, 200, 0, 0, 0
db 131, 224, 31
db 116, 224
db 141, 72, 2
db 102, 139, 6
db 141, 87, 255
db 193, 232, 2
db 131, 198, 2
db 41, 194
db 57, 232
db 114, 110
db 59, 84, 36, 48
db 15, 130, 77, 1, 0, 0
db 141, 4, 15
db 57, 4, 36
db 15, 130, 58, 1, 0, 0
db 137, 203
db 193, 235, 2
db 116, 17
db 139, 2
db 131, 194, 4
db 137, 7
db 131, 199, 4
db 75
db 117, 243
db 33, 233
db 116, 9
db 138, 2
db 66
db 136, 7
db 71
db 73
db 117, 247
db 138, 70, 254
db 33, 232
db 15, 132, 196, 254, 255, 255
db 141, 20, 7
db 57, 20, 36
db 15, 130, 2, 1, 0, 0
db 141, 20, 6
db 57, 84, 36, 4
db 15, 130, 238, 0, 0, 0
db 138, 14
db 70
db 136, 15
db 71
db 72
db 117, 247
db 138, 6
db 70
db 233, 42, 255, 255, 255
db 137, 246
db 59, 84, 36, 48
db 15, 130, 223, 0, 0, 0
db 141, 68, 15, 0
db 57, 4, 36
db 15, 130, 203, 0, 0, 0
db 135, 214
db 243, 164
db 137, 214
db 235, 170
db 129, 193, 255, 0, 0, 0
db 141, 86, 3
db 57, 84, 36, 4
db 15, 130, 169, 0, 0, 0
db 138, 30
db 70
db 8, 219
db 116, 230
db 141, 76, 11, 9
db 235, 21
db 144
db 60, 16
db 114, 44
db 137, 193
db 131, 224, 8
db 193, 224, 13
db 131, 225, 7
db 116, 225
db 131, 193, 2
db 102, 139, 6
db 131, 198, 2
db 141, 151, 0, 192, 255, 255
db 193, 232, 2
db 116, 57
db 41, 194
db 233, 38, 255, 255, 255
db 141, 116, 38, 0
db 141, 87, 2
db 57, 20, 36
db 114, 106
db 193, 232, 2
db 138, 30
db 141, 87, 255
db 141, 4, 152
db 70
db 41, 194
db 59, 84, 36, 48
db 114, 93
db 138, 2
db 136, 7
db 138, 90, 1
db 136, 95, 1
db 131, 199, 2
db 233, 43, 255, 255, 255
db 131, 249, 3
db 15, 149, 192
db 59, 60, 36
db 119, 57
db 139, 84, 36, 40
db 3, 84, 36, 44
db 57, 214
db 119, 38
db 114, 29
db 43, 124, 36, 48
db 139, 84, 36, 52
db 137, 58
db 247, 216
db 131, 196, 12
db 90
db 89
db 91
db 94
db 95
db 93
db 195
db 184, 1, 0, 0, 0
db 235, 227
db 184, 8, 0, 0, 0
db 235, 220
db 184, 4, 0, 0, 0
db 235, 213
db 184, 5, 0, 0, 0
db 235, 206
db 184, 6, 0, 0, 0
db 235, 199
end
|
Added work/contrib/lzo/lzo-1.08/src/i386/src/enter.sh.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
/* enter.sh -- LZO assembler stuff
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/***********************************************************************
//
************************************************************************/
pushl %ebp
pushl %edi
pushl %esi
pushl %ebx
pushl %ecx
pushl %edx
subl $12,%esp
cld
movl INP,%esi
movl OUTP,%edi
#if defined(N_3_EBP)
movl $3,%ebp
#endif
#if defined(N_255_EBP)
movl $255,%ebp
#endif
#if defined(LZO_TEST_DECOMPRESS_OVERRUN_INPUT)
#if defined(INIT_OVERRUN)
INIT_OVERRUN
# undef INIT_OVERRUN
#endif
leal -3(%esi),%eax /* 3 == length of EOF code */
addl INS,%eax
movl %eax,INEND
#endif
#if defined(LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT)
#if defined(INIT_OVERRUN)
INIT_OVERRUN
# undef INIT_OVERRUN
#endif
movl %edi,%eax
movl OUTS,%edx
addl (%edx),%eax
movl %eax,OUTEND
#endif
/*
vi:ts=4
*/
|
Added work/contrib/lzo/lzo-1.08/src/i386/src/leave.sh.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
/* leave.sh -- LZO assembler stuff
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/***********************************************************************
//
************************************************************************/
/* check uncompressed size */
#if defined(LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT)
cmpl OUTEND,%edi
ja .L_output_overrun
#endif
/* check compressed size */
movl INP,%edx
addl INS,%edx
cmpl %edx,%esi /* check compressed size */
ja .L_input_overrun
jb .L_input_not_consumed
.L_leave:
subl OUTP,%edi /* write back the uncompressed size */
movl OUTS,%edx
movl %edi,(%edx)
negl %eax
addl $12,%esp
popl %edx
popl %ecx
popl %ebx
popl %esi
popl %edi
popl %ebp
#if 1
ret
#else
jmp .L_end
#endif
.L_error:
movl $1,%eax /* LZO_E_ERROR */
jmp .L_leave
.L_input_not_consumed:
movl $8,%eax /* LZO_E_INPUT_NOT_CONSUMED */
jmp .L_leave
.L_input_overrun:
movl $4,%eax /* LZO_E_INPUT_OVERRUN */
jmp .L_leave
#if defined(LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT)
.L_output_overrun:
movl $5,%eax /* LZO_E_OUTPUT_OVERRUN */
jmp .L_leave
#endif
#if defined(LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND)
.L_lookbehind_overrun:
movl $6,%eax /* LZO_E_LOOKBEHIND_OVERRUN */
jmp .L_leave
#endif
#if defined(LZO_DEBUG)
.L_assert_fail:
movl $99,%eax
jmp .L_leave
#endif
.L_end:
/*
vi:ts=4
*/
|
Added work/contrib/lzo/lzo-1.08/src/i386/src/lzo1c_d.sh.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
|
/* lzo1c_d.sh -- assembler implementation of the LZO1C decompression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/*
* This file has been adapted from code generously contributed by
* Laszlo Molnar aka ML1050 <ml1050@hotmail.com>
*
* Many thanks, Laszlo !
*/
/***********************************************************************
//
************************************************************************/
ALIGN3
.L1:
xorl %eax,%eax
movb (%esi),%al
incl %esi
cmpb $32,%al
jnb .LMATCH
orb %al,%al
jz .L12
movl %eax,%ecx
.LIT:
TEST_OP((%edi,%ecx),%ebx)
TEST_IP((%esi,%ecx),%ebx)
rep
movsb
.LM1:
movb (%esi),%al
incl %esi
cmpb $32,%al
jb .LM2
.LMATCH:
cmpb $64,%al
jb .LN3
movl %eax,%ecx
andb $31,%al
leal -1(%edi),%edx
shrl $5,%ecx
subl %eax,%edx
movb (%esi),%al
incl %esi
shll $5,%eax
subl %eax,%edx
incl %ecx
xchgl %esi,%edx
TEST_LOOKBEHIND(%esi)
TEST_OP((%edi,%ecx),%ebx)
rep
movsb
movl %edx,%esi
jmp .L1
ALIGN3
.L12:
LODSB
leal 32(%eax),%ecx
cmpb $248,%al
jb .LIT
movl $280,%ecx
subb $248,%al
jz .L11
xchgl %eax,%ecx
xorb %al,%al
shll %cl,%eax
xchgl %eax,%ecx
.L11:
TEST_OP((%edi,%ecx),%ebx)
TEST_IP((%esi,%ecx),%ebx)
rep
movsb
jmp .L1
ALIGN3
.LM2:
leal -1(%edi),%edx
subl %eax,%edx
LODSB
shll $5,%eax
subl %eax,%edx
xchgl %esi,%edx
TEST_LOOKBEHIND(%esi)
TEST_OP(4(%edi),%ebx)
movsb
movsb
movsb
movl %edx,%esi
movsb
xorl %eax,%eax
jmp .LM1
.LN3:
andb $31,%al
movl %eax,%ecx
jnz .LN6
movb $31,%cl
.LN4:
LODSB
orb %al,%al
jnz .LN5
addl N_255,%ecx
jmp .LN4
ALIGN3
.LN5:
addl %eax,%ecx
.LN6:
movb (%esi),%al
incl %esi
movl %eax,%ebx
andb $63,%al
movl %edi,%edx
subl %eax,%edx
movb (%esi),%al
incl %esi
shll $6,%eax
subl %eax,%edx
cmpl %edi,%edx
jz .LEOF
xchgl %edx,%esi
leal 3(%ecx),%ecx
TEST_LOOKBEHIND(%esi)
TEST_OP((%edi,%ecx),%eax)
rep
movsb
movl %edx,%esi
xorl %eax,%eax
shrl $6,%ebx
movl %ebx,%ecx
jnz .LIT
jmp .L1
.LEOF:
/**** xorl %eax,%eax eax=0 from above */
cmpl $1,%ecx /* ecx must be 1 */
setnz %al
/*
vi:ts=4
*/
|
Added work/contrib/lzo/lzo-1.08/src/i386/src/lzo1c_s1.s.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
/* lzo1c_s1.s -- LZO1C decompression in assembler (i386 + gcc)
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/***********************************************************************
//
************************************************************************/
#include "lzo_asm.h"
.text
LZO_PUBLIC(lzo1c_decompress_asm)
#include "enter.sh"
#include "lzo1c_d.sh"
#include "leave.sh"
LZO_PUBLIC_END(lzo1c_decompress_asm)
/*
vi:ts=4
*/
|
Added work/contrib/lzo/lzo-1.08/src/i386/src/lzo1c_s2.s.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
/* lzo1c_s2.s -- LZO1C decompression in assembler (i386 + gcc)
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/***********************************************************************
//
************************************************************************/
#define LZO_TEST_DECOMPRESS_OVERRUN_INPUT
#define LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT
#define LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND
#include "lzo_asm.h"
.text
LZO_PUBLIC(lzo1c_decompress_asm_safe)
#include "enter.sh"
#include "lzo1c_d.sh"
#include "leave.sh"
LZO_PUBLIC_END(lzo1c_decompress_asm_safe)
/*
vi:ts=4
*/
|
Added work/contrib/lzo/lzo-1.08/src/i386/src/lzo1f_d.sh.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
|
/* lzo1f_d.sh -- assembler implementation of the LZO1F decompression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/*
* This file has been adapted from code generously contributed by
* Laszlo Molnar aka ML1050 <ml1050@hotmail.com>
*
* Many thanks, Laszlo !
*/
/***********************************************************************
//
************************************************************************/
ALIGN3
.L0:
xorl %eax,%eax
movb (%esi),%al
incl %esi
cmpb $31,%al
ja .LM2
orb %al,%al
movl %eax,%ecx
jnz .L2
1:
LODSB
orb %al,%al
jnz 2f
addl N_255,%ecx
jmp 1b
2:
lea 31(%eax,%ecx),%ecx
.L2:
TEST_OP((%edi,%ecx),%ebx)
TEST_IP((%esi,%ecx),%ebx)
movb %cl,%al
shrl $2,%ecx
rep
movsl
andb $3,%al
jz 1f
movl (%esi),%ebx
addl %eax,%esi
movl %ebx,(%edi)
addl %eax,%edi
1:
movb (%esi),%al
incl %esi
.LM1:
cmpb $31,%al
jbe .LM21
.LM2:
cmpb $223,%al
ja .LM3
movl %eax,%ecx
shrl $2,%eax
lea -1(%edi),%edx
andb $7,%al
shrl $5,%ecx
movl %eax,%ebx
movb (%esi),%al
leal (%ebx,%eax,8),%eax
incl %esi
.LM5:
subl %eax,%edx
addl $2,%ecx
xchgl %edx,%esi
TEST_LOOKBEHIND(%esi)
TEST_OP((%edi,%ecx),%ebx)
cmpl $6,%ecx
jb 1f
cmpl $4,%eax
jb 1f
movb %cl,%al
shrl $2,%ecx
rep
movsl
andb $3,%al
movb %al,%cl
1:
rep
movsb
movl %edx,%esi
.LN1:
movb -2(%esi),%cl
andl $3,%ecx
jz .L0
movl (%esi),%eax
addl %ecx,%esi
movl %eax,(%edi)
addl %ecx,%edi
xorl %eax,%eax
movb (%esi),%al
incl %esi
jmp .LM1
.LM21:
TEST_OP(3(%edi),%edx)
shrl $2,%eax
leal -0x801(%edi),%edx
movl %eax,%ecx
movb (%esi),%al
incl %esi
leal (%ecx,%eax,8),%eax
subl %eax,%edx
TEST_LOOKBEHIND(%edx)
movl (%edx),%eax
movl %eax,(%edi)
addl $3,%edi
jmp .LN1
1:
LODSB
orb %al,%al
jnz 2f
addl N_255,%ecx
jmp 1b
2:
lea 31(%eax,%ecx),%ecx
jmp .LM4
ALIGN3
.LM3:
andb $31,%al
movl %eax,%ecx
jz 1b
.LM4:
movl %edi,%edx
movw (%esi),%ax
addl $2,%esi
shrl $2,%eax
jnz .LM5
.LEOF:
/**** xorl %eax,%eax eax=0 from above */
cmpl $1,%ecx /* ecx must be 1 */
setnz %al
/*
vi:ts=4
*/
|
Added work/contrib/lzo/lzo-1.08/src/i386/src/lzo1f_f1.s.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
/* lzo1f_f1.s -- fast LZO1F decompression in assembler (i386 + gcc)
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/***********************************************************************
//
************************************************************************/
#include "lzo_asm.h"
.text
LZO_PUBLIC(lzo1f_decompress_asm_fast)
#include "enter.sh"
#include "lzo1f_d.sh"
#include "leave.sh"
LZO_PUBLIC_END(lzo1f_decompress_asm_fast)
/*
vi:ts=4
*/
|
Added work/contrib/lzo/lzo-1.08/src/i386/src/lzo1f_f2.s.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
/* lzo1f_f2.s -- fast LZO1F decompression in assembler (i386 + gcc)
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/***********************************************************************
//
************************************************************************/
#define LZO_TEST_DECOMPRESS_OVERRUN_INPUT
#define LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT
#define LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND
#include "lzo_asm.h"
.text
LZO_PUBLIC(lzo1f_decompress_asm_fast_safe)
#include "enter.sh"
#include "lzo1f_d.sh"
#include "leave.sh"
LZO_PUBLIC_END(lzo1f_decompress_asm_fast_safe)
/*
vi:ts=4
*/
|
Added work/contrib/lzo/lzo-1.08/src/i386/src/lzo1x_d.sh.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
|
/* lzo1x_d.sh -- assembler implementation of the LZO1X decompression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/*
* This file has been adapted from code generously contributed by
* Laszlo Molnar aka ML1050 <ml1050@hotmail.com>
*
* Many thanks, Laszlo !
*
* I (Markus) have optimized the fast version a lot, so enjoy...
*/
#if !defined(LZO1X) && !defined(LZO1Y)
# define LZO1X
#endif
#if defined(LZO_FAST)
# define NN 3
#else
# define NN 0
#endif
/***********************************************************************
// init
************************************************************************/
xorl %eax,%eax
xorl %ebx,%ebx /* high bits 9-32 stay 0 */
lodsb
cmpb $17,%al
jbe .L01
subb $17-NN,%al
#if defined(LZO_FAST)
jmp .LFLR
#else
cmpb $4,%al
jae .LFLR
#if 1
TEST_OP((%edi,%eax),%edx)
TEST_IP((%esi,%eax),%edx)
movl %eax,%ecx
jmp .LFLR2
#else
jmp .LFLR3
#endif
#endif
/***********************************************************************
// literal run
************************************************************************/
0: addl N_255,%eax
TEST_IP(18(%esi,%eax),%edx) /* minimum */
1: movb (%esi),%bl
incl %esi
orb %bl,%bl
jz 0b
leal 18+NN(%eax,%ebx),%eax
jmp 3f
ALIGN3
.L00:
#ifdef LZO_DEBUG
andl $0xffffff00,%eax ; jnz .L_assert_fail
andl $0xffffff00,%ebx ; jnz .L_assert_fail
xorl %eax,%eax ; xorl %ebx,%ebx
xorl %ecx,%ecx ; xorl %edx,%edx
#endif
TEST_IP_R(%esi)
LODSB
.L01:
cmpb $16,%al
jae .LMATCH
/* a literal run */
orb %al,%al
jz 1b
addl $3+NN,%eax
3:
.LFLR:
TEST_OP(-NN(%edi,%eax),%edx)
TEST_IP(-NN(%esi,%eax),%edx)
#if defined(LZO_FAST)
movl %eax,%ecx
NOTL_3(%eax)
shrl $2,%ecx
andl N_3,%eax
COPYL(%esi,%edi,%edx)
subl %eax,%esi
subl %eax,%edi
#else
movl %eax,%ecx
shrl $2,%eax
andl N_3,%ecx
COPYL_C(%esi,%edi,%edx,%eax)
.LFLR2:
rep
movsb
#endif
#ifdef LZO_DEBUG
andl $0xffffff00,%eax ; jnz .L_assert_fail
andl $0xffffff00,%ebx ; jnz .L_assert_fail
xorl %eax,%eax ; xorl %ebx,%ebx
xorl %ecx,%ecx ; xorl %edx,%edx
#endif
LODSB
cmpb $16,%al
jae .LMATCH
/***********************************************************************
// R1
************************************************************************/
TEST_OP(3(%edi),%edx)
shrl $2,%eax
movb (%esi),%bl
#if defined(LZO1X)
leal -0x801(%edi),%edx
#elif defined(LZO1Y)
leal -0x401(%edi),%edx
#endif
leal (%eax,%ebx,4),%eax
incl %esi
subl %eax,%edx
TEST_LOOKBEHIND(%edx)
#if defined(LZO_FAST)
movl (%edx),%ecx
movl %ecx,(%edi)
#else
movb (%edx),%al
movb %al,(%edi)
movb 1(%edx),%al
movb %al,1(%edi)
movb 2(%edx),%al
movb %al,2(%edi)
#endif
addl N_3,%edi
jmp .LMDONE
/***********************************************************************
// M2
************************************************************************/
ALIGN3
.LMATCH:
cmpb $64,%al
jb .LM3MATCH
/* a M2 match */
movl %eax,%ecx
shrl $2,%eax
leal -1(%edi),%edx
#if defined(LZO1X)
andl $7,%eax
movb (%esi),%bl
shrl $5,%ecx
leal (%eax,%ebx,8),%eax
#elif defined(LZO1Y)
andl N_3,%eax
movb (%esi),%bl
shrl $4,%ecx
leal (%eax,%ebx,4),%eax
#endif
incl %esi
subl %eax,%edx
#if defined(LZO_FAST)
#if defined(LZO1X)
addl $1+3,%ecx
#elif defined(LZO1Y)
addl $2,%ecx
#endif
#else
#if defined(LZO1X)
incl %ecx
#elif defined(LZO1Y)
decl %ecx
#endif
#endif
cmpl N_3,%eax
jae .LCOPYLONG
jmp .LCOPYBYTE
/***********************************************************************
// M3
************************************************************************/
0: addl N_255,%eax
TEST_IP(3(%esi),%edx) /* minimum */
1: movb (%esi),%bl
incl %esi
orb %bl,%bl
jz 0b
leal 33+NN(%eax,%ebx),%ecx
xorl %eax,%eax
jmp 3f
ALIGN3
.LM3MATCH:
cmpb $32,%al
jb .LM4MATCH
/* a M3 match */
andl $31,%eax
jz 1b
lea 2+NN(%eax),%ecx
3:
#ifdef LZO_DEBUG
andl $0xffff0000,%eax ; jnz .L_assert_fail
#endif
movw (%esi),%ax
leal -1(%edi),%edx
shrl $2,%eax
addl $2,%esi
subl %eax,%edx
cmpl N_3,%eax
jb .LCOPYBYTE
/***********************************************************************
// copy match
************************************************************************/
ALIGN1
.LCOPYLONG: /* copy match using longwords */
TEST_LOOKBEHIND(%edx)
#if defined(LZO_FAST)
leal -3(%edi,%ecx),%eax
shrl $2,%ecx
TEST_OP_R(%eax)
COPYL(%edx,%edi,%ebx)
movl %eax,%edi
xorl %ebx,%ebx
#else
TEST_OP((%edi,%ecx),%eax)
movl %ecx,%ebx
shrl $2,%ebx
jz 2f
COPYL_C(%edx,%edi,%eax,%ebx)
andl N_3,%ecx
jz 1f
2: COPYB_C(%edx,%edi,%al,%ecx)
1:
#endif
.LMDONE:
movb -2(%esi),%al
andl N_3,%eax
jz .L00
.LFLR3:
TEST_OP((%edi,%eax),%edx)
TEST_IP((%esi,%eax),%edx)
#if defined(LZO_FAST)
movl (%esi),%edx
addl %eax,%esi
movl %edx,(%edi)
addl %eax,%edi
#else
COPYB_C(%esi,%edi,%cl,%eax)
#endif
#ifdef LZO_DEBUG
andl $0xffffff00,%eax ; jnz .L_assert_fail
andl $0xffffff00,%ebx ; jnz .L_assert_fail
xorl %eax,%eax ; xorl %ebx,%ebx
xorl %ecx,%ecx ; xorl %edx,%edx
#endif
LODSB
jmp .LMATCH
ALIGN3
.LCOPYBYTE: /* copy match using bytes */
TEST_LOOKBEHIND(%edx)
TEST_OP(-NN(%edi,%ecx),%eax)
xchgl %edx,%esi
#if defined(LZO_FAST)
subl N_3,%ecx
#endif
rep
movsb
movl %edx,%esi
jmp .LMDONE
/***********************************************************************
// M4
************************************************************************/
0: addl N_255,%ecx
TEST_IP(3(%esi),%edx) /* minimum */
1: movb (%esi),%bl
incl %esi
orb %bl,%bl
jz 0b
leal 9+NN(%ebx,%ecx),%ecx
jmp 3f
ALIGN3
.LM4MATCH:
cmpb $16,%al
jb .LM1MATCH
/* a M4 match */
movl %eax,%ecx
andl $8,%eax
shll $13,%eax /* save in bit 16 */
andl $7,%ecx
jz 1b
addl $2+NN,%ecx
3:
#ifdef LZO_DEBUG
movl %eax,%edx ; andl $0xfffe0000,%edx ; jnz .L_assert_fail
#endif
movw (%esi),%ax
addl $2,%esi
leal -0x4000(%edi),%edx
shrl $2,%eax
jz .LEOF
subl %eax,%edx
jmp .LCOPYLONG
/***********************************************************************
// M1
************************************************************************/
ALIGN3
.LM1MATCH:
/* a M1 match */
TEST_OP(2(%edi),%edx)
shrl $2,%eax
movb (%esi),%bl
leal -1(%edi),%edx
leal (%eax,%ebx,4),%eax
incl %esi
subl %eax,%edx
TEST_LOOKBEHIND(%edx)
movb (%edx),%al /* we must use this because edx can be edi-1 */
movb %al,(%edi)
movb 1(%edx),%bl
movb %bl,1(%edi)
addl $2,%edi
jmp .LMDONE
/***********************************************************************
//
************************************************************************/
.LEOF:
/**** xorl %eax,%eax eax=0 from above */
cmpl $3+NN,%ecx /* ecx must be 3/6 */
setnz %al
/*
vi:ts=4
*/
|
Added work/contrib/lzo/lzo-1.08/src/i386/src/lzo1x_f1.s.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
/* lzo1x_f1.s -- fast LZO1X decompression in assembler (i386 + gcc)
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/***********************************************************************
//
************************************************************************/
#define LZO_FAST
#include "lzo_asm.h"
.text
LZO_PUBLIC(lzo1x_decompress_asm_fast)
#include "enter.sh"
#include "lzo1x_d.sh"
#include "leave.sh"
LZO_PUBLIC_END(lzo1x_decompress_asm_fast)
/*
vi:ts=4
*/
|
Added work/contrib/lzo/lzo-1.08/src/i386/src/lzo1x_f2.s.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
/* lzo1x_f2.s -- fast LZO1X decompression in assembler (i386 + gcc)
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/***********************************************************************
//
************************************************************************/
#define LZO_FAST
#define LZO_TEST_DECOMPRESS_OVERRUN_INPUT
#define LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT
#define LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND
#include "lzo_asm.h"
.text
LZO_PUBLIC(lzo1x_decompress_asm_fast_safe)
#include "enter.sh"
#include "lzo1x_d.sh"
#include "leave.sh"
LZO_PUBLIC_END(lzo1x_decompress_asm_fast_safe)
/*
vi:ts=4
*/
|
Added work/contrib/lzo/lzo-1.08/src/i386/src/lzo1x_s1.s.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
/* lzo1x_s1.s -- LZO1X decompression in assembler (i386 + gcc)
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/***********************************************************************
//
************************************************************************/
#include "lzo_asm.h"
.text
LZO_PUBLIC(lzo1x_decompress_asm)
#include "enter.sh"
#include "lzo1x_d.sh"
#include "leave.sh"
LZO_PUBLIC_END(lzo1x_decompress_asm)
/*
vi:ts=4
*/
|
Added work/contrib/lzo/lzo-1.08/src/i386/src/lzo1x_s2.s.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
/* lzo1x_s2.s -- LZO1X decompression in assembler (i386 + gcc)
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/***********************************************************************
//
************************************************************************/
#define LZO_TEST_DECOMPRESS_OVERRUN_INPUT
#define LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT
#define LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND
#include "lzo_asm.h"
.text
LZO_PUBLIC(lzo1x_decompress_asm_safe)
#include "enter.sh"
#include "lzo1x_d.sh"
#include "leave.sh"
LZO_PUBLIC_END(lzo1x_decompress_asm_safe)
/*
vi:ts=4
*/
|
Added work/contrib/lzo/lzo-1.08/src/i386/src/lzo1y_f1.s.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
/* lzo1y_f1.s -- fast LZO1Y decompression in assembler (i386 + gcc)
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/***********************************************************************
//
************************************************************************/
#define LZO_FAST
#include "lzo_asm.h"
.text
LZO_PUBLIC(lzo1y_decompress_asm_fast)
#define LZO1Y
#include "enter.sh"
#include "lzo1x_d.sh"
#include "leave.sh"
LZO_PUBLIC_END(lzo1y_decompress_asm_fast)
/*
vi:ts=4
*/
|
Added work/contrib/lzo/lzo-1.08/src/i386/src/lzo1y_f2.s.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
/* lzo1y_f2.s -- fast LZO1Y decompression in assembler (i386 + gcc)
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/***********************************************************************
//
************************************************************************/
#define LZO_FAST
#define LZO_TEST_DECOMPRESS_OVERRUN_INPUT
#define LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT
#define LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND
#include "lzo_asm.h"
.text
LZO_PUBLIC(lzo1y_decompress_asm_fast_safe)
#define LZO1Y
#include "enter.sh"
#include "lzo1x_d.sh"
#include "leave.sh"
LZO_PUBLIC_END(lzo1y_decompress_asm_fast_safe)
/*
vi:ts=4
*/
|
Added work/contrib/lzo/lzo-1.08/src/i386/src/lzo1y_s1.s.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
/* lzo1y_s1.s -- LZO1Y decompression in assembler (i386 + gcc)
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/***********************************************************************
//
************************************************************************/
#include "lzo_asm.h"
.text
LZO_PUBLIC(lzo1y_decompress_asm)
#define LZO1Y
#include "enter.sh"
#include "lzo1x_d.sh"
#include "leave.sh"
LZO_PUBLIC_END(lzo1y_decompress_asm)
/*
vi:ts=4
*/
|
Added work/contrib/lzo/lzo-1.08/src/i386/src/lzo1y_s2.s.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
/* lzo1y_s2.s -- LZO1Y decompression in assembler (i386 + gcc)
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/***********************************************************************
//
************************************************************************/
#define LZO_TEST_DECOMPRESS_OVERRUN_INPUT
#define LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT
#define LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND
#include "lzo_asm.h"
.text
LZO_PUBLIC(lzo1y_decompress_asm_safe)
#define LZO1Y
#include "enter.sh"
#include "lzo1x_d.sh"
#include "leave.sh"
LZO_PUBLIC_END(lzo1y_decompress_asm_safe)
/*
vi:ts=4
*/
|
Added work/contrib/lzo/lzo-1.08/src/i386/src/lzo_asm.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
|
/* lzo_asm.h -- LZO assembler stuff
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/***********************************************************************
// <asmconfig.h>
************************************************************************/
#if !defined(__i386__)
# error
#endif
#if !defined(IN_CONFIGURE)
#if defined(LZO_HAVE_CONFIG_H)
# include <config.h>
#else
/* manual configuration - see defaults below */
# if defined(__ELF__)
# define MFX_ASM_HAVE_TYPE
# define MFX_ASM_NAME_NO_UNDERSCORES
# elif defined(__linux__) /* Linux a.out */
# define MFX_ASM_ALIGN_PTWO
# elif defined(__DJGPP__)
# define MFX_ASM_ALIGN_PTWO
# elif defined(__GO32__) /* djgpp v1 */
# define MFX_ASM_CANNOT_USE_EBP
# elif defined(__EMX__)
# define MFX_ASM_ALIGN_PTWO
# define MFX_ASM_CANNOT_USE_EBP
# endif
#endif
#endif
/***********************************************************************
// name always uses underscores
// [ OLD: name (default: with underscores) ]
************************************************************************/
#if !defined(LZO_ASM_NAME)
# define LZO_ASM_NAME(n) _ ## n
#if 0
# if defined(MFX_ASM_NAME_NO_UNDERSCORES)
# define LZO_ASM_NAME(n) n
# else
# define LZO_ASM_NAME(n) _ ## n
# endif
#endif
#endif
/***********************************************************************
// .type (default: do not use)
************************************************************************/
#if defined(MFX_ASM_HAVE_TYPE)
# define LZO_PUBLIC(func) \
ALIGN3 ; .type LZO_ASM_NAME(func),@function ; \
.globl LZO_ASM_NAME(func) ; LZO_ASM_NAME(func):
# define LZO_PUBLIC_END(func) \
.size LZO_ASM_NAME(func),.-LZO_ASM_NAME(func)
#else
# define LZO_PUBLIC(func) \
ALIGN3 ; .globl LZO_ASM_NAME(func) ; LZO_ASM_NAME(func):
# define LZO_PUBLIC_END(func)
#endif
/***********************************************************************
// .align (default: bytes)
************************************************************************/
#if !defined(MFX_ASM_ALIGN_BYTES) && !defined(MFX_ASM_ALIGN_PTWO)
# define MFX_ASM_ALIGN_BYTES
#endif
#if !defined(LZO_ASM_ALIGN)
# if defined(MFX_ASM_ALIGN_PTWO)
# define LZO_ASM_ALIGN(x) .align x
# else
# define LZO_ASM_ALIGN(x) .align (1 << (x))
# endif
#endif
#define ALIGN1 LZO_ASM_ALIGN(1)
#define ALIGN2 LZO_ASM_ALIGN(2)
#define ALIGN3 LZO_ASM_ALIGN(3)
/***********************************************************************
// ebp usage (default: can use)
************************************************************************/
#if !defined(MFX_ASM_CANNOT_USE_EBP)
# if 1 && !defined(N_3_EBP) && !defined(N_255_EBP)
# define N_3_EBP
# endif
# if 0 && !defined(N_3_EBP) && !defined(N_255_EBP)
# define N_255_EBP
# endif
#endif
#if defined(N_3_EBP) && defined(N_255_EBP)
# error
#endif
#if defined(MFX_ASM_CANNOT_USE_EBP)
# if defined(N_3_EBP) || defined(N_255_EBP)
# error
# endif
#endif
#if !defined(N_3)
# if defined(N_3_EBP)
# define N_3 %ebp
# else
# define N_3 $3
# endif
#endif
#if !defined(N_255)
# if defined(N_255_EBP)
# define N_255 %ebp
# define NOTL_3(r) xorl %ebp,r
# else
# define N_255 $255
# endif
#endif
#if !defined(NOTL_3)
# define NOTL_3(r) xorl N_3,r
#endif
/***********************************************************************
//
************************************************************************/
#ifndef INP
#define INP 4+36(%esp)
#define INS 8+36(%esp)
#define OUTP 12+36(%esp)
#define OUTS 16+36(%esp)
#endif
#define INEND 4(%esp)
#define OUTEND (%esp)
#if defined(LZO_TEST_DECOMPRESS_OVERRUN_INPUT)
# define TEST_IP_R(r) cmpl r,INEND ; jb .L_input_overrun
# define TEST_IP(addr,r) leal addr,r ; TEST_IP_R(r)
#else
# define TEST_IP_R(r)
# define TEST_IP(addr,r)
#endif
#if defined(LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT)
# define TEST_OP_R(r) cmpl r,OUTEND ; jb .L_output_overrun
# define TEST_OP(addr,r) leal addr,r ; TEST_OP_R(r)
#else
# define TEST_OP_R(r)
# define TEST_OP(addr,r)
#endif
#if defined(LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND)
# define TEST_LOOKBEHIND(r) cmpl OUTP,r ; jb .L_lookbehind_overrun
#else
# define TEST_LOOKBEHIND(r)
#endif
/***********************************************************************
//
************************************************************************/
#define LODSB movb (%esi),%al ; incl %esi
#define MOVSB(r1,r2,x) movb (r1),x ; incl r1 ; movb x,(r2) ; incl r2
#define MOVSW(r1,r2,x) movb (r1),x ; movb x,(r2) ; \
movb 1(r1),x ; addl $2,r1 ; \
movb x,1(r2) ; addl $2,r2
#define MOVSL(r1,r2,x) movl (r1),x ; addl $4,r1 ; movl x,(r2) ; addl $4,r2
#if defined(LZO_DEBUG)
#define COPYB_C(r1,r2,x,rc) \
cmpl $0,rc ; jz .L_assert_fail; \
9: MOVSB(r1,r2,x) ; decl rc ; jnz 9b
#define COPYL_C(r1,r2,x,rc) \
cmpl $0,rc ; jz .L_assert_fail; \
9: MOVSL(r1,r2,x) ; decl rc ; jnz 9b
#else
#define COPYB_C(r1,r2,x,rc) \
9: MOVSB(r1,r2,x) ; decl rc ; jnz 9b
#define COPYL_C(r1,r2,x,rc) \
9: MOVSL(r1,r2,x) ; decl rc ; jnz 9b
#endif
#define COPYB(r1,r2,x) COPYB_C(r1,r2,x,%ecx)
#define COPYL(r1,r2,x) COPYL_C(r1,r2,x,%ecx)
/***********************************************************************
// not used
************************************************************************/
#if 0
#if 0
#define REP_MOVSB(x) rep ; movsb
#define REP_MOVSL(x) shrl $2,%ecx ; rep ; movsl
#elif 1
#define REP_MOVSB(x) COPYB(%esi,%edi,x)
#define REP_MOVSL(x) shrl $2,%ecx ; COPYL(%esi,%edi,x)
#else
#define REP_MOVSB(x) rep ; movsb
#define REP_MOVSL(x) jmp 9f ; 8: movsb ; decl %ecx ; \
9: testl $3,%edi ; jnz 8b ; \
movl %ecx,x ; shrl $2,%ecx ; andl $3,x ; \
rep ; movsl ; movl x,%ecx ; rep ; movsb
#endif
#if 1
#define NEGL(x) negl x
#else
#define NEGL(x) xorl $-1,x ; incl x
#endif
#endif
/*
vi:ts=4
*/
|
Added work/contrib/lzo/lzo-1.08/src/io.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
/* io.c -- portable io functions
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include "lzo_conf.h"
#include <lzoutil.h>
#if !defined(NO_STDIO_H)
#include <stdio.h>
#undef lzo_fread
#undef lzo_fwrite
/***********************************************************************
//
************************************************************************/
LZO_PUBLIC(lzo_uint)
lzo_fread(LZO_FILEP ff, lzo_voidp s, lzo_uint len)
{
FILE *f = (FILE *) ff;
#if 1 && (LZO_UINT_MAX <= SIZE_T_MAX)
return fread(s,1,len,f);
#else
lzo_byte *p = (lzo_byte *) s;
lzo_uint l = 0;
size_t k;
unsigned char *b;
unsigned char buf[512];
while (l < len)
{
k = len - l > sizeof(buf) ? sizeof(buf) : (size_t) (len - l);
k = fread(buf,1,k,f);
if (k <= 0)
break;
l += k;
b = buf; do *p++ = *b++; while (--k > 0);
}
return l;
#endif
}
/***********************************************************************
//
************************************************************************/
LZO_PUBLIC(lzo_uint)
lzo_fwrite(LZO_FILEP ff, const lzo_voidp s, lzo_uint len)
{
FILE *f = (FILE *) ff;
#if 1 && (LZO_UINT_MAX <= SIZE_T_MAX)
return fwrite(s,1,len,f);
#else
const lzo_byte *p = (const lzo_byte *) s;
lzo_uint l = 0;
size_t k, n;
unsigned char *b;
unsigned char buf[512];
while (l < len)
{
k = len - l > sizeof(buf) ? sizeof(buf) : (size_t) (len - l);
b = buf; n = k; do *b++ = *p++; while (--n > 0);
k = fwrite(buf,1,k,f);
if (k <= 0)
break;
l += k;
}
return l;
#endif
}
#endif /* !NO_STDIO_H */
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo1.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
|
/* lzo1.c -- implementation of the LZO1 algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include <lzo1.h>
#include "lzo_conf.h"
/***********************************************************************
// The next two defines can be changed to customize LZO1.
// The default version is LZO1-5/1.
************************************************************************/
/* run bits (3 - 5) - the compressor and the decompressor
* must use the same value. */
#if !defined(RBITS)
# define RBITS 5
#endif
/* compression level (1 - 9) - this only affects the compressor.
* 1 is fastest, 9 is best compression ratio */
#if !defined(CLEVEL)
# define CLEVEL 1 /* fastest by default */
#endif
/* check configuration */
#if (RBITS < 3 || RBITS > 5)
# error "invalid RBITS"
#endif
#if (CLEVEL < 1 || CLEVEL > 9)
# error "invalid CLEVEL"
#endif
/***********************************************************************
// You should not have to change anything below this line.
************************************************************************/
#include "lzo_util.h"
/***********************************************************************
//
************************************************************************/
/*
Format of the marker byte
76543210
--------
00000000 a long run (a 'R0' run) - there are short and long R0 runs
000rrrrr a short run with len r
mmmooooo a short match (len = 2+m, o = offset low bits)
111ooooo a long match (o = offset low bits)
*/
#define RSIZE (1 << RBITS)
#define RMASK (RSIZE - 1)
#define OBITS RBITS /* offset and run-length use same bits */
#define OSIZE (1 << OBITS)
#define OMASK (OSIZE - 1)
#define MBITS (8 - OBITS)
#define MSIZE (1 << MBITS)
#define MMASK (MSIZE - 1)
/* sanity checks */
#if (OBITS < 3 || OBITS > 5)
# error "invalid OBITS"
#endif
#if (MBITS < 3 || MBITS > 5)
# error "invalid MBITS"
#endif
/***********************************************************************
// some macros to improve readability
************************************************************************/
/* Minimum len of a match */
#define MIN_MATCH 3
#define THRESHOLD (MIN_MATCH - 1)
/* Minimum len of match coded in 2 bytes */
#define MIN_MATCH_SHORT MIN_MATCH
/* Maximum len of match coded in 2 bytes */
#define MAX_MATCH_SHORT (THRESHOLD + (MSIZE - 2))
/* MSIZE - 2: 0 is used to indicate runs,
* MSIZE-1 is used to indicate a long match */
/* Minimum len of match coded in 3 bytes */
#define MIN_MATCH_LONG (MAX_MATCH_SHORT + 1)
/* Maximum len of match coded in 3 bytes */
#define MAX_MATCH_LONG (MIN_MATCH_LONG + 255)
/* Maximum offset of a match */
#define MAX_OFFSET (1 << (8 + OBITS))
/*
RBITS | MBITS MIN THR. MSIZE MAXS MINL MAXL MAXO R0MAX R0FAST
======+===============================================================
3 | 5 3 2 32 32 33 288 2048 263 256
4 | 4 3 2 16 16 17 272 4096 271 264
5 | 3 3 2 8 8 9 264 8192 287 280
*/
/***********************************************************************
// internal configuration
// all of these affect compression only
************************************************************************/
/* return -1 instead of copying if the data cannot be compressed */
#undef LZO_RETURN_IF_NOT_COMPRESSIBLE
/* choose the hashing strategy */
#ifndef LZO_HASH
#define LZO_HASH LZO_HASH_LZO_INCREMENTAL_A
#endif
#define D_INDEX1(d,p) d = DM((0x21*DX2(p,5,5)) >> 5)
#define D_INDEX2(d,p) d = d ^ D_MASK
#define DBITS (8 + RBITS)
#include "lzo_dict.h"
#define DVAL_LEN DVAL_LOOKAHEAD
/***********************************************************************
// get algorithm info, return memory required for compression
************************************************************************/
LZO_EXTERN(lzo_uint) lzo1_info ( int *rbits, int *clevel );
LZO_PUBLIC(lzo_uint)
lzo1_info ( int *rbits, int *clevel )
{
if (rbits)
*rbits = RBITS;
if (clevel)
*clevel = CLEVEL;
return D_SIZE * lzo_sizeof(lzo_byte *);
}
/***********************************************************************
// decode a R0 literal run (a long run)
************************************************************************/
#define R0MIN (RSIZE) /* Minimum len of R0 run of literals */
#define R0MAX (R0MIN + 255) /* Maximum len of R0 run of literals */
#define R0FAST (R0MAX & ~7u) /* R0MAX aligned to 8 byte boundary */
#if (R0MAX - R0FAST != 7) || ((R0FAST & 7) != 0)
# error "something went wrong"
#endif
/* 7 special codes from R0FAST+1 .. R0MAX
* these codes mean long R0 runs with lengths
* 512, 1024, 2048, 4096, 8192, 16384, 32768 */
/***********************************************************************
// LZO1 decompress a block of data.
//
// Could be easily translated into assembly code.
************************************************************************/
LZO_PUBLIC(int)
lzo1_decompress ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem )
{
lzo_byte *op;
const lzo_byte *ip;
const lzo_byte * const ip_end = in + in_len;
lzo_uint t;
LZO_UNUSED(wrkmem);
#if defined(__LZO_QUERY_DECOMPRESS)
if (__LZO_IS_DECOMPRESS_QUERY(in,in_len,out,out_len,wrkmem))
return __LZO_QUERY_DECOMPRESS(in,in_len,out,out_len,wrkmem,0,0);
#endif
op = out;
ip = in;
while (ip < ip_end)
{
t = *ip++; /* get marker */
if (t < R0MIN) /* a literal run */
{
if (t == 0) /* a R0 literal run */
{
t = *ip++;
if (t >= R0FAST - R0MIN) /* a long R0 run */
{
t -= R0FAST - R0MIN;
if (t == 0)
t = R0FAST;
else
{
#if 0
t = 256u << ((unsigned) t);
#else
/* help the optimizer */
lzo_uint tt = 256;
do tt <<= 1; while (--t > 0);
t = tt;
#endif
}
MEMCPY8_DS(op,ip,t);
continue;
}
t += R0MIN;
}
MEMCPY_DS(op,ip,t);
}
else /* a match */
{
lzo_uint tt;
/* get match offset */
const lzo_byte *m_pos = op - 1;
m_pos -= (lzo_uint)(t & OMASK) | (((lzo_uint) *ip++) << OBITS);
/* get match len */
if (t >= ((MSIZE - 1) << OBITS)) /* all m-bits set */
tt = (MIN_MATCH_LONG - THRESHOLD) + *ip++; /* a long match */
else
tt = t >> OBITS; /* a short match */
assert(m_pos >= out);
assert(m_pos < op);
/* a half unrolled loop */
*op++ = *m_pos++;
*op++ = *m_pos++;
MEMMOVE_DS(op,m_pos,tt);
}
}
*out_len = op - out;
/* the next line is the only check in the decompressor ! */
return (ip == ip_end ? LZO_E_OK :
(ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN));
}
/***********************************************************************
// code a literal run
************************************************************************/
static lzo_byte *
store_run(lzo_byte *op, const lzo_byte *ii, lzo_uint r_len)
{
assert(r_len > 0);
/* code a long R0 run */
if (r_len >= 512)
{
unsigned r_bits = 7; /* 256 << 7 == 32768 */
do {
while (r_len >= (256u << r_bits))
{
r_len -= (256u << r_bits);
*op++ = 0; *op++ = LZO_BYTE((R0FAST - R0MIN) + r_bits);
MEMCPY8_DS(op, ii, (256u << r_bits));
}
} while (--r_bits > 0);
}
while (r_len >= R0FAST)
{
r_len -= R0FAST;
*op++ = 0; *op++ = R0FAST - R0MIN;
MEMCPY8_DS(op, ii, R0FAST);
}
if (r_len >= R0MIN)
{
/* code a short R0 run */
*op++ = 0; *op++ = LZO_BYTE(r_len - R0MIN);
MEMCPY_DS(op, ii, r_len);
}
else if (r_len > 0)
{
/* code a 'normal' run */
*op++ = LZO_BYTE(r_len);
MEMCPY_DS(op, ii, r_len);
}
assert(r_len == 0);
return op;
}
/***********************************************************************
// LZO1 compress a block of data.
//
// Could be translated into assembly code without too much effort.
//
// I apologize for the spaghetti code, but it really helps the optimizer.
************************************************************************/
static int
do_compress ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem )
{
const lzo_byte *ip;
#if defined(__LZO_HASH_INCREMENTAL)
lzo_uint32 dv;
#endif
lzo_byte *op;
const lzo_byte *m_pos;
const lzo_byte * const ip_end = in+in_len - DVAL_LEN - MIN_MATCH_LONG;
const lzo_byte * const in_end = in+in_len - DVAL_LEN;
const lzo_byte *ii;
lzo_dict_p const dict = (lzo_dict_p) wrkmem;
#if !defined(NDEBUG)
const lzo_byte *m_pos_sav;
#endif
op = out;
ip = in;
ii = ip; /* point to start of literal run */
if (in_len <= MIN_MATCH_LONG + DVAL_LEN + 1)
goto the_end;
/* init dictionary */
#if defined(LZO_DETERMINISTIC)
BZERO8_PTR(wrkmem,sizeof(lzo_dict_t),D_SIZE);
#endif
DVAL_FIRST(dv,ip);
UPDATE_D(dict,0,dv,ip,in);
ip++;
DVAL_NEXT(dv,ip);
do {
lzo_moff_t m_off;
lzo_uint dindex;
DINDEX1(dindex,ip);
GINDEX(m_pos,m_off,dict,dindex,in);
if (LZO_CHECK_MPOS(m_pos,m_off,in,ip,MAX_OFFSET))
goto literal;
if (m_pos[0] == ip[0] && m_pos[1] == ip[1] && m_pos[2] == ip[2])
goto match;
DINDEX2(dindex,ip);
GINDEX(m_pos,m_off,dict,dindex,in);
if (LZO_CHECK_MPOS(m_pos,m_off,in,ip,MAX_OFFSET))
goto literal;
if (m_pos[0] == ip[0] && m_pos[1] == ip[1] && m_pos[2] == ip[2])
goto match;
goto literal;
literal:
UPDATE_I(dict,0,dindex,ip,in);
if (++ip >= ip_end)
break;
continue;
match:
UPDATE_I(dict,0,dindex,ip,in);
#if !defined(NDEBUG) && defined(LZO_DICT_USE_PTR)
m_pos_sav = m_pos;
#endif
m_pos += 3;
{
/* we have found a match (of at least length 3) */
#if !defined(NDEBUG) && !defined(LZO_DICT_USE_PTR)
assert((m_pos_sav = ip - m_off) == (m_pos - 3));
#endif
/* 1) store the current literal run */
if (pd(ip,ii) > 0)
{
lzo_uint t = pd(ip,ii);
#if 1
/* OPTIMIZED: inline the copying of a short run */
if (t < R0MIN)
{
*op++ = LZO_BYTE(t);
MEMCPY_DS(op, ii, t);
}
else
#endif
op = store_run(op,ii,t);
}
/* 2a) compute match len */
ii = ip; /* point to start of current match */
/* we already matched MIN_MATCH bytes,
* m_pos also already advanced MIN_MATCH bytes */
ip += MIN_MATCH;
assert(m_pos < ip);
/* try to match another MIN_MATCH_LONG - MIN_MATCH bytes
* to see if we get a long match */
#define PS *m_pos++ != *ip++
#if (MIN_MATCH_LONG - MIN_MATCH == 2) /* MBITS == 2 */
if (PS || PS)
#elif (MIN_MATCH_LONG - MIN_MATCH == 6) /* MBITS == 3 */
if (PS || PS || PS || PS || PS || PS)
#elif (MIN_MATCH_LONG - MIN_MATCH == 14) /* MBITS == 4 */
if (PS || PS || PS || PS || PS || PS || PS ||
PS || PS || PS || PS || PS || PS || PS)
#elif (MIN_MATCH_LONG - MIN_MATCH == 30) /* MBITS == 5 */
if (PS || PS || PS || PS || PS || PS || PS || PS ||
PS || PS || PS || PS || PS || PS || PS || PS ||
PS || PS || PS || PS || PS || PS || PS || PS ||
PS || PS || PS || PS || PS || PS)
#else
# error "MBITS not yet implemented"
#endif
{
lzo_uint m_len;
/* 2b) code a short match */
assert((lzo_moff_t)(ip-m_pos) == m_off);
--ip; /* ran one too far, point back to non-match */
m_len = ip - ii;
assert(m_len >= MIN_MATCH_SHORT);
assert(m_len <= MAX_MATCH_SHORT);
assert(m_off > 0);
assert(m_off <= MAX_OFFSET);
assert(ii-m_off == m_pos_sav);
assert(lzo_memcmp(m_pos_sav,ii,m_len) == 0);
--m_off;
/* code short match len + low offset bits */
*op++ = LZO_BYTE(((m_len - THRESHOLD) << OBITS) |
(m_off & OMASK));
/* code high offset bits */
*op++ = LZO_BYTE(m_off >> OBITS);
/* 2c) Insert phrases (beginning with ii+1) into the dictionary. */
#define SI /* nothing */
#define DI ++ii; DVAL_NEXT(dv,ii); UPDATE_D(dict,0,dv,ii,in);
#define XI assert(ii < ip); ii = ip; DVAL_FIRST(dv,(ip));
#if (CLEVEL == 9) || (CLEVEL >= 7 && MBITS <= 4) || (CLEVEL >= 5 && MBITS <= 3)
/* Insert the whole match (ii+1)..(ip-1) into dictionary. */
++ii;
do {
DVAL_NEXT(dv,ii);
UPDATE_D(dict,0,dv,ii,in);
} while (++ii < ip);
DVAL_NEXT(dv,ii);
assert(ii == ip);
DVAL_ASSERT(dv,ip);
#elif (CLEVEL >= 3)
SI DI DI XI
#elif (CLEVEL >= 2)
SI DI XI
#else
XI
#endif
}
else
{
/* we've found a long match - see how far we can still go */
const lzo_byte *end;
lzo_uint m_len;
assert(ip <= in_end);
assert(ii == ip - MIN_MATCH_LONG);
#if defined(__LZO_CHECKER)
if (in_end - ip <= (MAX_MATCH_LONG - MIN_MATCH_LONG))
#else
if (in_end <= ip + (MAX_MATCH_LONG - MIN_MATCH_LONG))
#endif
end = in_end;
else
{
end = ip + (MAX_MATCH_LONG - MIN_MATCH_LONG);
assert(end < in_end);
}
while (ip < end && *m_pos == *ip)
m_pos++, ip++;
assert(ip <= in_end);
/* 2b) code the long match */
m_len = ip - ii;
assert(m_len >= MIN_MATCH_LONG);
assert(m_len <= MAX_MATCH_LONG);
assert(m_off > 0);
assert(m_off <= MAX_OFFSET);
assert(ii-m_off == m_pos_sav);
assert(lzo_memcmp(m_pos_sav,ii,m_len) == 0);
assert((lzo_moff_t)(ip-m_pos) == m_off);
--m_off;
/* code long match flag + low offset bits */
*op++ = LZO_BYTE(((MSIZE - 1) << OBITS) | (m_off & OMASK));
/* code high offset bits */
*op++ = LZO_BYTE(m_off >> OBITS);
/* code match len */
*op++ = LZO_BYTE(m_len - MIN_MATCH_LONG);
/* 2c) Insert phrases (beginning with ii+1) into the dictionary. */
#if (CLEVEL == 9)
/* Insert the whole match (ii+1)..(ip-1) into dictionary. */
/* This is not recommended because it is slow. */
++ii;
do {
DVAL_NEXT(dv,ii);
UPDATE_D(dict,0,dv,ii,in);
} while (++ii < ip);
DVAL_NEXT(dv,ii);
assert(ii == ip);
DVAL_ASSERT(dv,ip);
#elif (CLEVEL >= 8)
SI DI DI DI DI DI DI DI DI XI
#elif (CLEVEL >= 7)
SI DI DI DI DI DI DI DI XI
#elif (CLEVEL >= 6)
SI DI DI DI DI DI DI XI
#elif (CLEVEL >= 5)
SI DI DI DI DI XI
#elif (CLEVEL >= 4)
SI DI DI DI XI
#elif (CLEVEL >= 3)
SI DI DI XI
#elif (CLEVEL >= 2)
SI DI XI
#else
XI
#endif
}
/* ii now points to the start of next literal run */
assert(ii == ip);
}
} while (ip < ip_end);
the_end:
assert(ip <= in_end);
#if defined(LZO_RETURN_IF_NOT_COMPRESSIBLE)
/* return -1 if op == out to indicate that we
* couldn't compress and didn't copy anything.
*/
if (op == out)
{
*out_len = 0;
return LZO_E_NOT_COMPRESSIBLE;
}
#endif
/* store the final literal run */
if (pd(in_end+DVAL_LEN,ii) > 0)
op = store_run(op,ii,pd(in_end+DVAL_LEN,ii));
*out_len = op - out;
return 0; /* compression went ok */
}
/***********************************************************************
// compress public entry point.
************************************************************************/
LZO_PUBLIC(int)
lzo1_compress ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem )
{
int r = LZO_E_OK;
#if defined(__LZO_QUERY_COMPRESS)
if (__LZO_IS_COMPRESS_QUERY(in,in_len,out,out_len,wrkmem))
return __LZO_QUERY_COMPRESS(in,in_len,out,out_len,wrkmem,D_SIZE,lzo_sizeof(lzo_dict_t));
#endif
/* don't try to compress a block that's too short */
if (in_len <= 0)
*out_len = 0;
else if (in_len <= MIN_MATCH_LONG + DVAL_LEN + 1)
{
#if defined(LZO_RETURN_IF_NOT_COMPRESSIBLE)
r = LZO_E_NOT_COMPRESSIBLE;
#else
*out_len = store_run(out,in,in_len) - out;
#endif
}
else
r = do_compress(in,in_len,out,out_len,wrkmem);
return r;
}
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo1_99.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
/* lzo1_99.c -- implementation of the LZO1-99 algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include <lzoconf.h>
#if !defined(LZO_99_UNSUPPORTED)
#define COMPRESS_ID 99
#define DDBITS 3
#define CLEVEL 9
/***********************************************************************
//
************************************************************************/
#define LZO_NEED_DICT_H
#include "config1.h"
/***********************************************************************
// compression internal entry point.
************************************************************************/
static int
_lzo1_do_compress ( const lzo_byte *in, lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem,
lzo_compress_t func )
{
int r;
/* don't try to compress a block that's too short */
if (in_len <= 0)
{
*out_len = 0;
r = LZO_E_OK;
}
else if (in_len <= MIN_LOOKAHEAD + 1)
{
#if defined(LZO_RETURN_IF_NOT_COMPRESSIBLE)
*out_len = 0;
r = LZO_E_NOT_COMPRESSIBLE;
#else
*out_len = STORE_RUN(out,in,in_len) - out;
r = (*out_len > in_len) ? LZO_E_OK : LZO_E_ERROR;
#endif
}
else
r = func(in,in_len,out,out_len,wrkmem);
return r;
}
/***********************************************************************
//
************************************************************************/
#if !defined(COMPRESS_ID)
#define COMPRESS_ID _LZO_ECONCAT2(DD_BITS,CLEVEL)
#endif
#define LZO_CODE_MATCH_INCLUDE_FILE "lzo1_cm.ch"
#include "lzo1b_c.ch"
/***********************************************************************
//
************************************************************************/
#define LZO_COMPRESS \
_LZO_ECONCAT3(lzo1_,COMPRESS_ID,_compress)
#define LZO_COMPRESS_FUNC \
_LZO_ECONCAT3(_lzo1_,COMPRESS_ID,_compress_func)
/***********************************************************************
//
************************************************************************/
LZO_PUBLIC(int)
LZO_COMPRESS ( const lzo_byte *in, lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem )
{
#if defined(__LZO_QUERY_COMPRESS)
if (__LZO_IS_COMPRESS_QUERY(in,in_len,out,out_len,wrkmem))
return __LZO_QUERY_COMPRESS(in,in_len,out,out_len,wrkmem,D_SIZE,lzo_sizeof(lzo_dict_t));
#endif
return _lzo1_do_compress(in,in_len,out,out_len,wrkmem,do_compress);
}
#endif
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo1_cm.ch.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
/* lzo1_cm.ch -- implementation of the LZO1 compression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the library and is subject
to change.
*/
#include "lzo1a_cm.ch"
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo1_d.ch.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
|
/* lzo1_d.ch -- common decompression stuff
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#if defined(LZO_TEST_DECOMPRESS_OVERRUN)
# if !defined(LZO_TEST_DECOMPRESS_OVERRUN_INPUT)
# define LZO_TEST_DECOMPRESS_OVERRUN_INPUT 2
# endif
# if !defined(LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT)
# define LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT 2
# endif
# if !defined(LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND)
# define LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND
# endif
#endif
/***********************************************************************
// Overrun detection is internally handled by these macros:
//
// TEST_IP test input overrun at loop begin
// NEED_IP test input overrun at every input byte
//
// TEST_OP test output overrun at loop begin
// NEED_OP test output overrun at every output byte
//
// TEST_LOOKBEHIND test match postion
//
// The fastest decompressor results when testing for no overruns
// and using LZO_EOF_CODE.
************************************************************************/
#undef TEST_IP
#undef TEST_OP
#undef TEST_LOOKBEHIND
#undef NEED_IP
#undef NEED_OP
#undef HAVE_TEST_IP
#undef HAVE_TEST_OP
#undef HAVE_NEED_IP
#undef HAVE_NEED_OP
#undef HAVE_ANY_IP
#undef HAVE_ANY_OP
#if defined(LZO_TEST_DECOMPRESS_OVERRUN_INPUT)
# if (LZO_TEST_DECOMPRESS_OVERRUN_INPUT >= 1)
# define TEST_IP (ip < ip_end)
# endif
# if (LZO_TEST_DECOMPRESS_OVERRUN_INPUT >= 2)
# define NEED_IP(x) \
if ((lzo_uint)(ip_end - ip) < (lzo_uint)(x)) goto input_overrun
# endif
#endif
#if defined(LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT)
# if (LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT >= 1)
# define TEST_OP (op <= op_end)
# endif
# if (LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT >= 2)
# undef TEST_OP /* don't need both of the tests here */
# define NEED_OP(x) \
if ((lzo_uint)(op_end - op) < (lzo_uint)(x)) goto output_overrun
# endif
#endif
#if defined(LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND)
# define TEST_LOOKBEHIND(m_pos,out) if (m_pos < out) goto lookbehind_overrun
#else
# define TEST_LOOKBEHIND(m_pos,op) ((void) 0)
#endif
#if !defined(LZO_EOF_CODE) && !defined(TEST_IP)
/* if we have no EOF code, we have to test for the end of the input */
# define TEST_IP (ip < ip_end)
#endif
#if defined(TEST_IP)
# define HAVE_TEST_IP
#else
# define TEST_IP 1
#endif
#if defined(TEST_OP)
# define HAVE_TEST_OP
#else
# define TEST_OP 1
#endif
#if defined(NEED_IP)
# define HAVE_NEED_IP
#else
# define NEED_IP(x) ((void) 0)
#endif
#if defined(NEED_OP)
# define HAVE_NEED_OP
#else
# define NEED_OP(x) ((void) 0)
#endif
#if defined(HAVE_TEST_IP) || defined(HAVE_NEED_IP)
# define HAVE_ANY_IP
#endif
#if defined(HAVE_TEST_OP) || defined(HAVE_NEED_OP)
# define HAVE_ANY_OP
#endif
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo1a.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
|
/* lzo1a.c -- implementation of the LZO1A algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include <lzo1a.h>
#include "lzo_conf.h"
/***********************************************************************
// The next two defines can be changed to customize LZO1A.
// The default version is LZO1A-5/1.
************************************************************************/
/* run bits (3 - 5) - the compressor and the decompressor
* must use the same value. */
#if !defined(RBITS)
# define RBITS 5
#endif
/* compression level (1 - 9) - this only affects the compressor.
* 1 is fastest, 9 is best compression ratio
*/
#if !defined(CLEVEL)
# define CLEVEL 1 /* fastest by default */
#endif
/* Collect statistics */
#if 0 && !defined(LZO_COLLECT_STATS)
# define LZO_COLLECT_STATS
#endif
/***********************************************************************
// You should not have to change anything below this line.
************************************************************************/
/* check configuration */
#if (RBITS < 3 || RBITS > 5)
# error "invalid RBITS"
#endif
#if (CLEVEL < 1 || CLEVEL > 9)
# error "invalid CLEVEL"
#endif
/***********************************************************************
// internal configuration
// all of these affect compression only
************************************************************************/
/* return -1 instead of copying if the data cannot be compressed */
#undef LZO_RETURN_IF_NOT_COMPRESSIBLE
/* choose the hashing strategy */
#ifndef LZO_HASH
#define LZO_HASH LZO_HASH_LZO_INCREMENTAL_A
#endif
#define D_INDEX1(d,p) d = DM((0x21*DX2(p,5,5)) >> 5)
#define D_INDEX2(d,p) d = d ^ D_MASK
#include "lzo1a_de.h"
#include "stats1a.h"
#include "lzo_util.h"
/* check other constants */
#if (LBITS < 5 || LBITS > 8)
# error "invalid LBITS"
#endif
#if defined(LZO_COLLECT_STATS)
static lzo1a_stats_t lzo_statistics;
lzo1a_stats_t *lzo1a_stats = &lzo_statistics;
# define lzo_stats lzo1a_stats
#endif
/***********************************************************************
// get algorithm info, return memory required for compression
************************************************************************/
LZO_EXTERN(lzo_uint) lzo1a_info ( int *rbits, int *clevel );
LZO_PUBLIC(lzo_uint)
lzo1a_info ( int *rbits, int *clevel )
{
if (rbits)
*rbits = RBITS;
if (clevel)
*clevel = CLEVEL;
return D_SIZE * lzo_sizeof(lzo_byte *);
}
/***********************************************************************
// LZO1A decompress a block of data.
//
// Could be easily translated into assembly code.
************************************************************************/
LZO_PUBLIC(int)
lzo1a_decompress ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem )
{
#if defined(LZO_OPTIMIZE_GNUC_i386)
register lzo_byte *op __asm__("%edi");
register const lzo_byte *ip __asm__("%esi");
register lzo_uint t __asm__("%ecx");
register const lzo_byte *m_pos __asm__("%ebx");
#else
register lzo_byte *op;
register const lzo_byte *ip;
register lzo_uint t;
register const lzo_byte *m_pos;
#endif
const lzo_byte * const ip_end = in + in_len;
LZO_UNUSED(wrkmem);
#if defined(__LZO_QUERY_DECOMPRESS)
if (__LZO_IS_DECOMPRESS_QUERY(in,in_len,out,out_len,wrkmem))
return __LZO_QUERY_DECOMPRESS(in,in_len,out,out_len,wrkmem,0,0);
#endif
op = out;
ip = in;
while (ip < ip_end)
{
t = *ip++; /* get marker */
LZO_STATS(lzo_stats->marker[t]++);
if (t == 0) /* a R0 literal run */
{
t = *ip++;
if (t >= R0FAST - R0MIN) /* a long R0 run */
{
t -= R0FAST - R0MIN;
if (t == 0)
t = R0FAST;
else
{
#if 0
t = 256u << ((unsigned) t);
#else
/* help the optimizer */
lzo_uint tt = 256;
do tt <<= 1; while (--t > 0);
t = tt;
#endif
}
MEMCPY8_DS(op,ip,t);
continue;
}
t += R0MIN;
goto literal;
}
else if (t < R0MIN) /* a short literal run */
{
literal:
MEMCPY_DS(op,ip,t);
/* after a literal a match must follow */
while (ip < ip_end)
{
t = *ip++; /* get R1 marker */
if (t >= R0MIN)
goto match;
/* R1 match - a context sensitive 3 byte match + 1 byte literal */
assert((t & OMASK) == t);
m_pos = op - MIN_OFFSET;
m_pos -= t | (((lzo_uint) *ip++) << OBITS);
assert(m_pos >= out); assert(m_pos < op);
*op++ = *m_pos++;
*op++ = *m_pos++;
*op++ = *m_pos++;
*op++ = *ip++;
}
}
else /* a match */
{
match:
/* get match offset */
m_pos = op - MIN_OFFSET;
m_pos -= (t & OMASK) | (((lzo_uint) *ip++) << OBITS);
assert(m_pos >= out); assert(m_pos < op);
/* get match len */
if (t < ((MSIZE - 1) << OBITS)) /* a short match */
{
t >>= OBITS;
*op++ = *m_pos++;
*op++ = *m_pos++;
MEMMOVE_DS(op,m_pos,t);
}
else /* a long match */
{
#if (LBITS < 8)
t = (MIN_MATCH_LONG - THRESHOLD) + ((lzo_uint)(*ip++) & LMASK);
#else
t = (MIN_MATCH_LONG - THRESHOLD) + (lzo_uint)(*ip++);
#endif
*op++ = *m_pos++;
*op++ = *m_pos++;
MEMMOVE_DS(op,m_pos,t);
#if (LBITS < 8)
/* a very short literal following a long match */
t = ip[-1] >> LBITS;
if (t) do
*op++ = *ip++;
while (--t);
#endif
}
}
}
*out_len = op - out;
/* the next line is the only check in the decompressor */
return (ip == ip_end ? LZO_E_OK :
(ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN));
}
/***********************************************************************
// LZO1A compress a block of data.
//
// I apologize for the spaghetti code, but it really helps the optimizer.
************************************************************************/
#include "lzo1a_cr.ch"
static int
do_compress ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem )
{
#if defined(LZO_OPTIMIZE_GNUC_i386)
register const lzo_byte *ip __asm__("%esi");
#else
register const lzo_byte *ip;
#endif
#if defined(__LZO_HASH_INCREMENTAL)
lzo_uint32 dv;
#endif
const lzo_byte *m_pos;
lzo_byte *op;
const lzo_byte * const ip_end = in+in_len - DVAL_LEN - MIN_MATCH_LONG;
const lzo_byte * const in_end = in+in_len - DVAL_LEN;
const lzo_byte *ii;
lzo_dict_p const dict = (lzo_dict_p) wrkmem;
const lzo_byte *r1 = ip_end; /* pointer for R1 match (none yet) */
#if (LBITS < 8)
const lzo_byte *im = ip_end; /* pointer to last match start */
#endif
#if !defined(NDEBUG)
const lzo_byte *m_pos_sav;
#endif
op = out;
ip = in;
ii = ip; /* point to start of current literal run */
/* init dictionary */
#if defined(LZO_DETERMINISTIC)
BZERO8_PTR(wrkmem,sizeof(lzo_dict_t),D_SIZE);
#endif
DVAL_FIRST(dv,ip); UPDATE_D(dict,0,dv,ip,in); ip++;
DVAL_NEXT(dv,ip);
do {
lzo_moff_t m_off;
lzo_uint dindex;
DINDEX1(dindex,ip);
GINDEX(m_pos,m_off,dict,dindex,in);
if (LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,MAX_OFFSET))
goto literal;
if (m_pos[0] == ip[0] && m_pos[1] == ip[1] && m_pos[2] == ip[2])
goto match;
DINDEX2(dindex,ip);
GINDEX(m_pos,m_off,dict,dindex,in);
if (LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,MAX_OFFSET))
goto literal;
if (m_pos[0] == ip[0] && m_pos[1] == ip[1] && m_pos[2] == ip[2])
goto match;
goto literal;
literal:
UPDATE_I(dict,0,dindex,ip,in);
if (++ip >= ip_end)
break;
continue;
match:
UPDATE_I(dict,0,dindex,ip,in);
#if !defined(NDEBUG) && defined(LZO_DICT_USE_PTR)
assert(m_pos == NULL || m_pos >= in);
m_pos_sav = m_pos;
#endif
m_pos += 3;
{
/* we have found a match (of at least length 3) */
#if !defined(NDEBUG) && !defined(LZO_DICT_USE_PTR)
assert((m_pos_sav = ip - m_off) == (m_pos - 3));
#endif
assert(m_pos >= in);
assert(ip < ip_end);
/* 1) store the current literal run */
if (pd(ip,ii) > 0)
{
lzo_uint t = pd(ip,ii);
if (ip - r1 == MIN_MATCH + 1)
{
/* Code a context sensitive R1 match.
* This is tricky and somewhat difficult to explain:
* multiplex a literal run of length 1 into the previous
* short match of length MIN_MATCH.
* The key idea is:
* - after a short run a match MUST follow
* - therefore the value m = 000 in the mmmooooo marker is free
* - use 000ooooo to indicate a MIN_MATCH match (this
* is already coded) plus a 1 byte literal
*/
assert(t == 1);
/* modify marker byte */
assert((op[-2] >> OBITS) == (MIN_MATCH - THRESHOLD));
op[-2] &= OMASK;
assert((op[-2] >> OBITS) == 0);
/* copy 1 literal */
*op++ = *ii;
LZO_STATS(lzo_stats->r1_matches++);
r1 = ip; /* set new R1 pointer */
}
else if (t < R0MIN)
{
/* inline the copying of a short run */
#if (LBITS < 8)
if (t < (1 << (8-LBITS)) && ii - im >= MIN_MATCH_LONG)
{
/* Code a very short literal run into the
* previous long match length byte.
*/
LZO_STATS(lzo_stats->lit_runs_after_long_match++);
LZO_STATS(lzo_stats->lit_run_after_long_match[t]++);
assert(ii - im <= MAX_MATCH_LONG);
assert((op[-1] >> LBITS) == 0);
op[-1] |= t << LBITS;
MEMCPY_DS(op, ii, t);
}
else
#endif
{
LZO_STATS(lzo_stats->lit_runs++);
LZO_STATS(lzo_stats->lit_run[t]++);
*op++ = LZO_BYTE(t);
MEMCPY_DS(op, ii, t);
r1 = ip; /* set new R1 pointer */
}
}
else if (t < R0FAST)
{
/* inline the copying of a short R0 run */
LZO_STATS(lzo_stats->r0short_runs++);
*op++ = 0; *op++ = LZO_BYTE(t - R0MIN);
MEMCPY_DS(op, ii, t);
r1 = ip; /* set new R1 pointer */
}
else
op = store_run(op,ii,t);
}
#if (LBITS < 8)
im = ip;
#endif
/* 2) compute match len */
ii = ip; /* point to start of current match */
/* we already matched MIN_MATCH bytes,
* m_pos also already advanced MIN_MATCH bytes */
ip += MIN_MATCH;
assert(m_pos < ip);
/* try to match another MIN_MATCH_LONG - MIN_MATCH bytes
* to see if we get a long match */
#define PS *m_pos++ != *ip++
#if (MIN_MATCH_LONG - MIN_MATCH == 2) /* MBITS == 2 */
if (PS || PS)
#elif (MIN_MATCH_LONG - MIN_MATCH == 6) /* MBITS == 3 */
if (PS || PS || PS || PS || PS || PS)
#elif (MIN_MATCH_LONG - MIN_MATCH == 14) /* MBITS == 4 */
if (PS || PS || PS || PS || PS || PS || PS ||
PS || PS || PS || PS || PS || PS || PS)
#elif (MIN_MATCH_LONG - MIN_MATCH == 30) /* MBITS == 5 */
if (PS || PS || PS || PS || PS || PS || PS || PS ||
PS || PS || PS || PS || PS || PS || PS || PS ||
PS || PS || PS || PS || PS || PS || PS || PS ||
PS || PS || PS || PS || PS || PS)
#else
# error "MBITS not yet implemented"
#endif
{
/* we've found a short match */
lzo_uint m_len;
/* 2a) compute match parameters */
assert(ip-m_pos == (int)m_off);
--ip; /* ran one too far, point back to non-match */
m_len = ip - ii;
assert(m_len >= MIN_MATCH_SHORT);
assert(m_len <= MAX_MATCH_SHORT);
assert(m_off >= MIN_OFFSET);
assert(m_off <= MAX_OFFSET);
assert(ii-m_off == m_pos_sav);
assert(lzo_memcmp(m_pos_sav,ii,m_len) == 0);
m_off -= MIN_OFFSET;
/* 2b) code a short match */
/* code short match len + low offset bits */
*op++ = LZO_BYTE(((m_len - THRESHOLD) << OBITS) |
(m_off & OMASK));
/* code high offset bits */
*op++ = LZO_BYTE(m_off >> OBITS);
#if defined(LZO_COLLECT_STATS)
lzo_stats->short_matches++;
lzo_stats->short_match[m_len]++;
if (m_off < OSIZE)
lzo_stats->short_match_offset_osize[m_len]++;
if (m_off < 256)
lzo_stats->short_match_offset_256[m_len]++;
if (m_off < 1024)
lzo_stats->short_match_offset_1024[m_len]++;
#endif
/* 2c) Insert phrases (beginning with ii+1) into the dictionary. */
#define SI /* nothing */
#define DI ++ii; DVAL_NEXT(dv,ii); UPDATE_D(dict,0,dv,ii,in);
#define XI assert(ii < ip); ii = ip; DVAL_FIRST(dv,(ip));
#if (CLEVEL == 9) || (CLEVEL >= 7 && MBITS <= 4) || (CLEVEL >= 5 && MBITS <= 3)
/* Insert the whole match (ii+1)..(ip-1) into dictionary. */
++ii;
do {
DVAL_NEXT(dv,ii);
UPDATE_D(dict,0,dv,ii,in);
} while (++ii < ip);
DVAL_NEXT(dv,ii);
assert(ii == ip);
DVAL_ASSERT(dv,ip);
#elif (CLEVEL >= 3)
SI DI DI XI
#elif (CLEVEL >= 2)
SI DI XI
#else
XI
#endif
}
else
{
/* we've found a long match - see how far we can still go */
const lzo_byte *end;
lzo_uint m_len;
assert(ip <= in_end);
assert(ii == ip - MIN_MATCH_LONG);
#if defined(__LZO_CHECKER)
if (in_end - ip <= (MAX_MATCH_LONG - MIN_MATCH_LONG))
#else
if (in_end <= ip + (MAX_MATCH_LONG - MIN_MATCH_LONG))
#endif
end = in_end;
else
{
end = ip + (MAX_MATCH_LONG - MIN_MATCH_LONG);
assert(end < in_end);
}
while (ip < end && *m_pos == *ip)
m_pos++, ip++;
assert(ip <= in_end);
/* 2a) compute match parameters */
m_len = (ip - ii);
assert(m_len >= MIN_MATCH_LONG);
assert(m_len <= MAX_MATCH_LONG);
assert(m_off >= MIN_OFFSET);
assert(m_off <= MAX_OFFSET);
assert(ii-m_off == m_pos_sav);
assert(lzo_memcmp(m_pos_sav,ii,m_len) == 0);
assert(ip-m_pos == (int)m_off);
m_off -= MIN_OFFSET;
/* 2b) code the long match */
/* code long match flag + low offset bits */
*op++ = LZO_BYTE(((MSIZE - 1) << OBITS) | (m_off & OMASK));
/* code high offset bits */
*op++ = LZO_BYTE(m_off >> OBITS);
/* code match len */
*op++ = LZO_BYTE(m_len - MIN_MATCH_LONG);
#if defined(LZO_COLLECT_STATS)
lzo_stats->long_matches++;
lzo_stats->long_match[m_len]++;
#endif
/* 2c) Insert phrases (beginning with ii+1) into the dictionary. */
#if (CLEVEL == 9)
/* Insert the whole match (ii+1)..(ip-1) into dictionary. */
/* This is not recommended because it is slow. */
++ii;
do {
DVAL_NEXT(dv,ii);
UPDATE_D(dict,0,dv,ii,in);
} while (++ii < ip);
DVAL_NEXT(dv,ii);
assert(ii == ip);
DVAL_ASSERT(dv,ip);
#elif (CLEVEL >= 8)
SI DI DI DI DI DI DI DI DI XI
#elif (CLEVEL >= 7)
SI DI DI DI DI DI DI DI XI
#elif (CLEVEL >= 6)
SI DI DI DI DI DI DI XI
#elif (CLEVEL >= 5)
SI DI DI DI DI XI
#elif (CLEVEL >= 4)
SI DI DI DI XI
#elif (CLEVEL >= 3)
SI DI DI XI
#elif (CLEVEL >= 2)
SI DI XI
#else
XI
#endif
}
/* ii now points to the start of the next literal run */
assert(ii == ip);
}
} while (ip < ip_end);
assert(ip <= in_end);
#if defined(LZO_RETURN_IF_NOT_COMPRESSIBLE)
/* return -1 if op == out to indicate that we
* couldn't compress and didn't copy anything.
*/
if (op == out)
{
*out_len = 0;
return LZO_E_NOT_COMPRESSIBLE;
}
#endif
/* store the final literal run */
if (pd(in_end+DVAL_LEN,ii) > 0)
op = store_run(op,ii,pd(in_end+DVAL_LEN,ii));
*out_len = op - out;
return 0; /* compression went ok */
}
/***********************************************************************
// LZO1A compress public entry point.
************************************************************************/
LZO_PUBLIC(int)
lzo1a_compress ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem )
{
int r = LZO_E_OK;
#if defined(__LZO_QUERY_COMPRESS)
if (__LZO_IS_COMPRESS_QUERY(in,in_len,out,out_len,wrkmem))
return __LZO_QUERY_COMPRESS(in,in_len,out,out_len,wrkmem,D_SIZE,lzo_sizeof(lzo_dict_t));
#endif
#if defined(LZO_COLLECT_STATS)
memset(lzo_stats,0,sizeof(*lzo_stats));
lzo_stats->rbits = RBITS;
lzo_stats->clevel = CLEVEL;
lzo_stats->dbits = DBITS;
lzo_stats->lbits = LBITS;
lzo_stats->min_match_short = MIN_MATCH_SHORT;
lzo_stats->max_match_short = MAX_MATCH_SHORT;
lzo_stats->min_match_long = MIN_MATCH_LONG;
lzo_stats->max_match_long = MAX_MATCH_LONG;
lzo_stats->min_offset = MIN_OFFSET;
lzo_stats->max_offset = MAX_OFFSET;
lzo_stats->r0min = R0MIN;
lzo_stats->r0fast = R0FAST;
lzo_stats->r0max = R0MAX;
lzo_stats->in_len = in_len;
#endif
/* don't try to compress a block that's too short */
if (in_len <= 0)
*out_len = 0;
else if (in_len <= MIN_MATCH_LONG + DVAL_LEN + 1)
{
#if defined(LZO_RETURN_IF_NOT_COMPRESSIBLE)
r = LZO_E_NOT_COMPRESSIBLE;
#else
*out_len = store_run(out,in,in_len) - out;
#endif
}
else
r = do_compress(in,in_len,out,out_len,wrkmem);
#if defined(LZO_COLLECT_STATS)
lzo_stats->short_matches -= lzo_stats->r1_matches;
lzo_stats->short_match[MIN_MATCH] -= lzo_stats->r1_matches;
lzo_stats->out_len = *out_len;
#endif
return r;
}
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo1a_99.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
/* lzo1a_99.c -- implementation of the LZO1A-99 algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include <lzoconf.h>
#if !defined(LZO_99_UNSUPPORTED)
#define COMPRESS_ID 99
#define DDBITS 3
#define CLEVEL 9
/***********************************************************************
//
************************************************************************/
#define LZO_NEED_DICT_H
#include "config1a.h"
/***********************************************************************
// compression internal entry point.
************************************************************************/
static int
_lzo1a_do_compress ( const lzo_byte *in, lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem,
lzo_compress_t func )
{
int r;
/* don't try to compress a block that's too short */
if (in_len <= 0)
{
*out_len = 0;
r = LZO_E_OK;
}
else if (in_len <= MIN_LOOKAHEAD + 1)
{
#if defined(LZO_RETURN_IF_NOT_COMPRESSIBLE)
*out_len = 0;
r = LZO_E_NOT_COMPRESSIBLE;
#else
*out_len = STORE_RUN(out,in,in_len) - out;
r = (*out_len > in_len) ? LZO_E_OK : LZO_E_ERROR;
#endif
}
else
r = func(in,in_len,out,out_len,wrkmem);
return r;
}
/***********************************************************************
//
************************************************************************/
#if !defined(COMPRESS_ID)
#define COMPRESS_ID _LZO_ECONCAT2(DD_BITS,CLEVEL)
#endif
#define LZO_CODE_MATCH_INCLUDE_FILE "lzo1a_cm.ch"
#include "lzo1b_c.ch"
/***********************************************************************
//
************************************************************************/
#define LZO_COMPRESS \
_LZO_ECONCAT3(lzo1a_,COMPRESS_ID,_compress)
#define LZO_COMPRESS_FUNC \
_LZO_ECONCAT3(_lzo1a_,COMPRESS_ID,_compress_func)
/***********************************************************************
//
************************************************************************/
LZO_PUBLIC(int)
LZO_COMPRESS ( const lzo_byte *in, lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem )
{
#if defined(__LZO_QUERY_COMPRESS)
if (__LZO_IS_COMPRESS_QUERY(in,in_len,out,out_len,wrkmem))
return __LZO_QUERY_COMPRESS(in,in_len,out,out_len,wrkmem,D_SIZE,lzo_sizeof(lzo_dict_t));
#endif
return _lzo1a_do_compress(in,in_len,out,out_len,wrkmem,do_compress);
}
#endif
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo1a_cm.ch.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
|
/* lzo1a_cm.ch -- implementation of the LZO1A compression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the library and is subject
to change.
*/
/***********************************************************************
// code the match in LZO1 compatible format
************************************************************************/
#define THRESHOLD (M2_MIN_LEN - 1)
#define MSIZE LZO_SIZE(M2L_BITS)
/***********************************************************************
//
************************************************************************/
#if (DD_BITS == 0)
/* we already matched M2_MIN_LEN bytes,
* m_pos also already advanced M2_MIN_LEN bytes */
ip += M2_MIN_LEN;
assert(m_pos < ip);
/* try to match another M2_MAX_LEN + 1 - M2_MIN_LEN bytes
* to see if we get more than a M2 match */
#define M2_OR_M3 (MATCH_M2)
#else /* (DD_BITS == 0) */
/* we already matched m_len bytes */
assert(m_len >= M2_MIN_LEN);
ip += m_len;
assert(ip <= in_end);
#define M2_OR_M3 (m_len <= M2_MAX_LEN)
#endif /* (DD_BITS == 0) */
if (M2_OR_M3)
{
/* we've found a short match */
assert(ip <= in_end);
/* 2a) compute match parameters */
#if (DD_BITS == 0)
assert((lzo_moff_t)(ip-m_pos) == m_off);
--ip; /* ran one too far, point back to non-match */
m_len = ip - ii;
#endif
assert(m_len >= M2_MIN_LEN);
assert(m_len <= M2_MAX_LEN);
assert(m_off >= M2_MIN_OFFSET);
assert(m_off <= M2_MAX_OFFSET);
assert(ii-m_off == m_pos_sav);
assert(lzo_memcmp(m_pos_sav,ii,m_len) == 0);
/* 2b) code the match */
m_off -= M2_MIN_OFFSET;
/* code short match len + low offset bits */
*op++ = LZO_BYTE(((m_len - THRESHOLD) << M2O_BITS) |
(m_off & M2O_MASK));
/* code high offset bits */
*op++ = LZO_BYTE(m_off >> M2O_BITS);
if (ip >= ip_end)
{
ii = ip;
break;
}
/* 2c) Insert phrases (beginning with ii+1) into the dictionary. */
#if (CLEVEL == 9) || (CLEVEL >= 7 && M2L_BITS <= 4) || (CLEVEL >= 5 && M2L_BITS <= 3)
/* Insert the whole match (ii+1)..(ip-1) into dictionary. */
++ii;
do {
DVAL_NEXT(dv,ii);
#if 0
UPDATE_D(dict,drun,dv,ii,in);
#else
dict[ DINDEX(dv,ii) ] = DENTRY(ii,in);
#endif
MI
} while (++ii < ip);
DVAL_NEXT(dv,ii);
assert(ii == ip);
DVAL_ASSERT(dv,ip);
#elif (CLEVEL >= 3)
SI DI DI XI
#elif (CLEVEL >= 2)
SI DI XI
#else
XI
#endif
}
else
{
/* we've found a long match - see how far we can still go */
const lzo_byte *end;
assert(ip <= in_end);
assert(ii == ip - (M2_MAX_LEN + 1));
assert(lzo_memcmp(m_pos_sav,ii,(lzo_uint)(ip-ii)) == 0);
#if (DD_BITS > 0)
assert(m_len == (lzo_uint)(ip-ii));
m_pos = ip - m_off;
assert(m_pos == m_pos_sav + m_len);
#endif
#if defined(__LZO_CHECKER)
if (in_end - ip <= (lzo_ptrdiff_t) (M3_MAX_LEN - M3_MIN_LEN))
#else
if (in_end <= ip + (M3_MAX_LEN - M3_MIN_LEN))
#endif
end = in_end;
else
{
end = ip + (M3_MAX_LEN - M3_MIN_LEN);
assert(end < in_end);
}
while (ip < end && *m_pos == *ip)
m_pos++, ip++;
assert(ip <= in_end);
/* 2a) compute match parameters */
m_len = (ip - ii);
assert(m_len >= M3_MIN_LEN);
assert(m_len <= M3_MAX_LEN);
assert(m_off >= M3_MIN_OFFSET);
assert(m_off <= M3_MAX_OFFSET);
assert(ii-m_off == m_pos_sav);
assert(lzo_memcmp(m_pos_sav,ii,m_len) == 0);
assert((lzo_moff_t)(ip-m_pos) == m_off);
/* 2b) code the match */
m_off -= M3_MIN_OFFSET - M3_EOF_OFFSET;
/* code long match flag + low offset bits */
*op++ = LZO_BYTE(((MSIZE - 1) << M3O_BITS) | (m_off & M3O_MASK));
/* code high offset bits */
*op++ = LZO_BYTE(m_off >> M3O_BITS);
/* code match len */
*op++ = LZO_BYTE(m_len - M3_MIN_LEN);
if (ip >= ip_end)
{
ii = ip;
break;
}
/* 2c) Insert phrases (beginning with ii+1) into the dictionary. */
#if (CLEVEL == 9)
/* Insert the whole match (ii+1)..(ip-1) into dictionary. */
/* This is not recommended because it can be slow. */
++ii;
do {
DVAL_NEXT(dv,ii);
#if 0
UPDATE_D(dict,drun,dv,ii,in);
#else
dict[ DINDEX(dv,ii) ] = DENTRY(ii,in);
#endif
MI
} while (++ii < ip);
DVAL_NEXT(dv,ii);
assert(ii == ip);
DVAL_ASSERT(dv,ip);
#elif (CLEVEL >= 8)
SI DI DI DI DI DI DI DI DI XI
#elif (CLEVEL >= 7)
SI DI DI DI DI DI DI DI XI
#elif (CLEVEL >= 6)
SI DI DI DI DI DI DI XI
#elif (CLEVEL >= 5)
SI DI DI DI DI XI
#elif (CLEVEL >= 4)
SI DI DI DI XI
#elif (CLEVEL >= 3)
SI DI DI XI
#elif (CLEVEL >= 2)
SI DI XI
#else
XI
#endif
}
/* ii now points to the start of the next literal run */
assert(ii == ip);
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo1a_cr.ch.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
/* lzo1a_cr.ch -- literal run handling for the the LZO1A algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the LZO package and is subject
to change.
*/
#ifndef __LZO1A_CR_H
#define __LZO1A_CR_H
/***********************************************************************
// code a literal run
************************************************************************/
static lzo_byte *
store_run(lzo_byte * const oo, const lzo_byte * const ii, lzo_uint r_len)
{
#if defined(LZO_OPTIMIZE_GNUC_i386)
register lzo_byte *op __asm__("%edi");
register const lzo_byte *ip __asm__("%esi");
register lzo_uint t __asm__("%ecx");
#else
register lzo_byte *op;
register const lzo_byte *ip;
register lzo_uint t;
#endif
op = oo;
ip = ii;
assert(r_len > 0);
/* code a long R0 run */
if (r_len >= 512)
{
unsigned r_bits = 6; /* 256 << 6 == 16384 */
lzo_uint tt = 32768u;
while (r_len >= (t = tt))
{
r_len -= t;
*op++ = 0; *op++ = (R0MAX - R0MIN);
MEMCPY8_DS(op, ip, t);
LZO_STATS(lzo_stats->r0long_runs++);
}
tt >>= 1;
do {
if (r_len >= (t = tt))
{
r_len -= t;
*op++ = 0; *op++ = LZO_BYTE((R0FAST - R0MIN) + r_bits);
MEMCPY8_DS(op, ip, t);
LZO_STATS(lzo_stats->r0long_runs++);
}
tt >>= 1;
} while (--r_bits > 0);
}
assert(r_len < 512);
while (r_len >= (t = R0FAST))
{
r_len -= t;
*op++ = 0; *op++ = (R0FAST - R0MIN);
MEMCPY8_DS(op, ip, t);
LZO_STATS(lzo_stats->r0fast_runs++);
}
t = r_len;
if (t >= R0MIN)
{
/* code a short R0 run */
*op++ = 0; *op++ = LZO_BYTE(t - R0MIN);
MEMCPY_DS(op, ip, t);
LZO_STATS(lzo_stats->r0short_runs++);
}
else if (t > 0)
{
/* code a short literal run */
LZO_STATS(lzo_stats->lit_runs++);
LZO_STATS(lzo_stats->lit_run[t]++);
*op++ = LZO_BYTE(t);
MEMCPY_DS(op, ip, t);
}
return op;
}
#endif /* already included */
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo1a_de.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
|
/* lzo1a_de.h -- definitions for the the LZO1A algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the LZO package and is subject
to change.
*/
#ifndef __LZO_DEFS_H
#define __LZO_DEFS_H
#ifdef __cplusplus
extern "C" {
#endif
/***********************************************************************
//
************************************************************************/
/*
Format of the marker byte
76543210
--------
00000000 a long literal run ('R0' run) - there are short and long R0 runs
000rrrrr a short literal run with len r
mmmooooo a short match (len = 2+m, o = offset low bits)
111ooooo a long match (o = offset low bits)
*/
#define RSIZE (1 << RBITS)
#define RMASK (RSIZE - 1)
#define MBITS (8 - OBITS)
#define MSIZE (1 << MBITS)
#define MMASK (MSIZE - 1)
#define OBITS RBITS /* offset and run-length use same bits */
#define OSIZE (1 << OBITS)
#define OMASK (OSIZE - 1)
/* additional bits for coding the length in a long match */
#define LBITS 8
#define LSIZE (1 << LBITS)
#define LMASK (LSIZE - 1)
/***********************************************************************
// some macros to improve readability
************************************************************************/
/* Minimum len of a match */
#define MIN_MATCH 3
#define THRESHOLD (MIN_MATCH - 1)
/* Min-/Maximum len of a match coded in 2 bytes */
#define MIN_MATCH_SHORT (MIN_MATCH)
#define MAX_MATCH_SHORT (MIN_MATCH_SHORT + (MSIZE - 2) - 1)
/* why (MSIZE - 2) ? because 0 is used to mark runs,
* and MSIZE-1 is used to mark a long match */
/* Min-/Maximum len of a match coded in 3 bytes */
#define MIN_MATCH_LONG (MAX_MATCH_SHORT + 1)
#define MAX_MATCH_LONG (MIN_MATCH_LONG + LSIZE - 1)
/* Min-/Maximum offset of a match */
#define MIN_OFFSET 1
#define MAX_OFFSET (1 << (CHAR_BIT + OBITS))
/* R0 literal run (a long run) */
#define R0MIN (RSIZE) /* Minimum len of R0 run of literals */
#define R0MAX (R0MIN + 255) /* Maximum len of R0 run of literals */
#define R0FAST (R0MAX & ~7) /* R0MAX aligned to 8 byte boundary */
#if (R0MAX - R0FAST != 7) || ((R0FAST & 7) != 0)
# error "something went wrong"
#endif
/* 7 special codes from R0FAST+1 .. R0MAX
* these codes mean long R0 runs with lengths
* 512, 1024, 2048, 4096, 8192, 16384, 32768 */
/*
RBITS | MBITS MIN THR. MSIZE MAXS MINL MAXL MAXO R0MAX R0FAST
======+===============================================================
3 | 5 3 2 32 32 33 288 2048 263 256
4 | 4 3 2 16 16 17 272 4096 271 264
5 | 3 3 2 8 8 9 264 8192 287 280
*/
/***********************************************************************
//
************************************************************************/
#define DBITS 13
#include "lzo_dict.h"
#define DVAL_LEN DVAL_LOOKAHEAD
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* already included */
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo1b_1.c.
|
|
>
>
>
>
>
>
|
1
2
3
4
5
6
|
#define COMPRESS_ID 1
#define DDBITS 0
#define CLEVEL 1
#include "compr1b.h"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1b_2.c.
|
|
>
>
>
>
>
>
|
1
2
3
4
5
6
|
#define COMPRESS_ID 2
#define DDBITS 0
#define CLEVEL 2
#include "compr1b.h"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1b_3.c.
|
|
>
>
>
>
>
>
|
1
2
3
4
5
6
|
#define COMPRESS_ID 3
#define DDBITS 0
#define CLEVEL 3
#include "compr1b.h"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1b_4.c.
|
|
>
>
>
>
>
>
|
1
2
3
4
5
6
|
#define COMPRESS_ID 4
#define DDBITS 1
#define CLEVEL 2
#include "compr1b.h"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1b_5.c.
|
|
>
>
>
>
>
>
|
1
2
3
4
5
6
|
#define COMPRESS_ID 5
#define DDBITS 1
#define CLEVEL 3
#include "compr1b.h"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1b_6.c.
|
|
>
>
>
>
>
>
|
1
2
3
4
5
6
|
#define COMPRESS_ID 6
#define DDBITS 1
#define CLEVEL 5
#include "compr1b.h"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1b_7.c.
|
|
>
>
>
>
>
>
|
1
2
3
4
5
6
|
#define COMPRESS_ID 7
#define DDBITS 2
#define CLEVEL 3
#include "compr1b.h"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1b_8.c.
|
|
>
>
>
>
>
>
|
1
2
3
4
5
6
|
#define COMPRESS_ID 8
#define DDBITS 2
#define CLEVEL 8
#include "compr1b.h"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1b_9.c.
|
|
>
>
>
>
>
>
|
1
2
3
4
5
6
|
#define COMPRESS_ID 9
#define DDBITS 2
#define CLEVEL 9
#include "compr1b.h"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1b_99.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
#include <lzoconf.h>
#if !defined(LZO_99_UNSUPPORTED)
#define COMPRESS_ID 99
#define DDBITS 3
#define CLEVEL 9
#define D_BITS 16
#define MATCH_IP_END in_end
#include "compr1b.h"
#endif
|
Added work/contrib/lzo/lzo-1.08/src/lzo1b_9x.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
|
/* lzo1b_9x.c -- implementation of the LZO1B-999 compression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include <lzoconf.h>
#if !defined(LZO_999_UNSUPPORTED)
#include <stdio.h>
#include "config1b.h"
#if 0
#undef NDEBUG
#include <assert.h>
#endif
/***********************************************************************
//
************************************************************************/
#define N 0xffffL /* size of ring buffer */
#define THRESHOLD 2 /* lower limit for match length */
#define F 2048 /* upper limit for match length */
#define LZO1B
#define LZO_COMPRESS_T lzo1b_999_t
#define lzo_swd_t lzo1b_999_swd_t
#include "lzo_mchw.ch"
/***********************************************************************
//
************************************************************************/
static lzo_byte *
code_match ( LZO_COMPRESS_T *c, lzo_byte *op, lzo_uint m_len, lzo_uint m_off )
{
if (m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET)
{
assert(m_len >= M2_MIN_LEN);
assert(m_off >= M2_MIN_OFFSET);
m_off -= M2_MIN_OFFSET;
/* code match len + low offset bits */
*op++ = LZO_BYTE(((m_len - (M2_MIN_LEN - 2)) << M2O_BITS) |
(m_off & M2O_MASK));
/* code high offset bits */
*op++ = LZO_BYTE(m_off >> M2O_BITS);
c->m2_m++;
}
else
{
assert(m_len >= M3_MIN_LEN);
assert(m_off <= M3_MAX_OFFSET);
m_off -= M3_MIN_OFFSET - M3_EOF_OFFSET;
/* code match len */
if (m_len <= M3_MAX_LEN)
*op++ = LZO_BYTE(M3_MARKER | (m_len - (M3_MIN_LEN - 1)));
else
{
assert(m_len >= M4_MIN_LEN);
/* code M4 match len flag */
*op++ = M4_MARKER;
/* code match len */
m_len -= M4_MIN_LEN - 1;
while (m_len > 255)
{
m_len -= 255;
*op++ = 0;
}
assert(m_len > 0);
*op++ = LZO_BYTE(m_len);
}
/* code low offset bits */
*op++ = LZO_BYTE(m_off & M3O_MASK);
/* code high offset bits */
*op++ = LZO_BYTE(m_off >> M3O_BITS);
c->r1_m_len = 0;
c->m3_m++;
}
return op;
}
/***********************************************************************
// this is a public function, but there is no prototype in a header file
************************************************************************/
LZO_EXTERN(int)
lzo1b_999_compress_callback ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem,
lzo_progress_callback_t cb,
lzo_uint max_chain );
LZO_PUBLIC(int)
lzo1b_999_compress_callback ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem,
lzo_progress_callback_t cb,
lzo_uint max_chain )
{
lzo_byte *op;
const lzo_byte *ii;
lzo_uint lit;
lzo_uint m_len, m_off;
LZO_COMPRESS_T cc;
LZO_COMPRESS_T * const c = &cc;
lzo_swd_t * const swd = (lzo_swd_t *) wrkmem;
int r;
#if defined(__LZO_QUERY_COMPRESS)
if (__LZO_IS_COMPRESS_QUERY(in,in_len,out,out_len,wrkmem))
return __LZO_QUERY_COMPRESS(in,in_len,out,out_len,wrkmem,1,lzo_sizeof(lzo_swd_t));
#endif
/* sanity check */
if (!lzo_assert(LZO1B_999_MEM_COMPRESS >= lzo_sizeof(lzo_swd_t)))
return LZO_E_ERROR;
c->init = 0;
c->ip = c->in = in;
c->in_end = in + in_len;
c->cb = cb;
c->r1_r = c->m3_r = c->m2_m = c->m3_m = 0;
op = out;
ii = c->ip; /* point to start of literal run */
lit = 0;
c->r1_m_len = 0;
r = init_match(c,swd,NULL,0,0);
if (r != 0)
return r;
if (max_chain > 0)
swd->max_chain = max_chain;
r = find_match(c,swd,0,0);
if (r != 0)
return r;
while (c->look > 0)
{
int lazy_match_min_gain = -1;
lzo_uint ahead = 0;
m_len = c->m_len;
m_off = c->m_off;
#if 0
printf("%5ld: %5d len:%3d off:%5d\n", (c->ip-c->look)-in, c->look,
m_len, m_off);
#endif
assert(c->ip - c->look >= in);
if (lit == 0)
ii = c->ip - c->look;
assert(ii + lit == c->ip - c->look);
assert(swd->b_char == *(c->ip - c->look));
if ((m_len < M2_MIN_LEN) ||
(m_len < M3_MIN_LEN && m_off > M2_MAX_OFFSET))
{
m_len = 0;
}
else
{
assert(c->ip - c->look - m_off >= in);
assert(c->ip - c->look - m_off + m_len < c->ip);
assert(lzo_memcmp(c->ip - c->look, c->ip - c->look - m_off,
m_len) == 0);
if (lit > 0)
{
/* we have a current literal run: do not try a lazy match,
if the literal could be coded into a r1 match */
if (lit == 1 && c->r1_m_len == M2_MIN_LEN)
lazy_match_min_gain = -1;
else
lazy_match_min_gain = 1;
#if (M2_MIN_LEN == 2)
if (m_len == 2)
{
/* don't code a match of len 2 if we have to
code a literal run. Code a literal instead. */
m_len = 0;
}
#endif
#if (M2_MIN_LEN == M3_MIN_LEN)
if (m_len == M2_MIN_LEN && m_off > M2_MAX_OFFSET)
{
/* don't code a M3 match of len 3 if we have to
code a literal run. Code a literal instead. */
m_len = 0;
}
#endif
}
else
{
/* no current literal run: only try a lazy match,
if the literal could be coded into a r1 match */
if (c->r1_m_len == M2_MIN_LEN)
lazy_match_min_gain = 0;
else
lazy_match_min_gain = -1;
}
}
/* try a lazy match */
if (m_len == 0)
lazy_match_min_gain = -1;
if (lazy_match_min_gain >= 0 && c->look > m_len)
{
assert(m_len > 0);
r = find_match(c,swd,1,0);
assert(r == 0);
assert(c->look > 0);
if (m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET &&
c->m_off > M2_MAX_OFFSET)
lazy_match_min_gain += 1;
if (c->m_len >= m_len + lazy_match_min_gain)
{
c->lazy++;
#if !defined(NDEBUG)
m_len = c->m_len;
m_off = c->m_off;
assert(lzo_memcmp(c->ip - c->look, c->ip - c->look - m_off,
m_len) == 0);
#endif
lit++;
assert(ii + lit == c->ip - c->look);
continue;
}
else
{
ahead = 1;
assert(ii + lit + 1 == c->ip - c->look);
}
assert(m_len > 0);
}
assert(ii + lit + ahead == c->ip - c->look);
if (m_len == 0)
{
/* a literal */
lit++;
r = find_match(c,swd,1,0);
assert(r == 0);
}
else
{
/* 1 - store run */
if (lit > 0)
{
/* code current literal run */
if (lit == 1 && c->r1_m_len == M2_MIN_LEN)
{
/* Code a context sensitive R1 match. */
assert((op[-2] >> M2O_BITS) == (M2_MARKER >> M2O_BITS));
op[-2] &= M2O_MASK;
assert((op[-2] >> M2O_BITS) == 0);
/* copy 1 literal */
*op++ = *ii++;
assert(ii + ahead == c->ip - c->look);
c->r1_r++;
}
else
{
op = STORE_RUN(op,ii,lit);
}
if (lit < R0FAST)
c->r1_m_len = m_len;
else
c->r1_m_len = 0;
lit = 0;
}
else
c->r1_m_len = 0;
/* 2 - code match */
op = code_match(c,op,m_len,m_off);
r = find_match(c,swd,m_len,1+ahead);
assert(r == 0);
}
c->codesize = op - out;
}
/* store final run */
if (lit > 0)
op = STORE_RUN(op,ii,lit);
#if defined(LZO_EOF_CODE)
*op++ = M3_MARKER | 1;
*op++ = 0;
*op++ = 0;
#endif
c->codesize = op - out;
assert(c->textsize == in_len);
*out_len = op - out;
if (c->cb)
(*c->cb)(c->textsize,c->codesize);
#if 0
printf("%ld %ld -> %ld: %ld %ld %ld %ld %ld\n",
(long) c->textsize, (long)in_len, (long) c->codesize,
c->r1_r, c->m3_r, c->m2_m, c->m3_m, c->lazy);
#endif
return LZO_E_OK;
}
/***********************************************************************
//
************************************************************************/
LZO_PUBLIC(int)
lzo1b_999_compress ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem )
{
return lzo1b_999_compress_callback(in,in_len,out,out_len,wrkmem,
(lzo_progress_callback_t) 0, 0);
}
#endif /* !defined(LZO_999_UNSUPPORTED) */
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo1b_c.ch.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
|
/* lzo1b_c.ch -- implementation of the LZO1B compression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/***********************************************************************
//
************************************************************************/
#if !defined(LZO_HAVE_R1) && !defined(LZO_NO_R1)
# define LZO_HAVE_R1
#endif
#if !defined(LZO_HAVE_M3) && !defined(LZO_NO_M3)
# if (M3O_BITS < 8)
# define LZO_HAVE_M3
# endif
#endif
#define MI
#define SI MI
#if (DD_BITS > 0)
#define DI ++ii; DVAL_NEXT(dv,ii); UPDATE_D(dict,drun,dv,ii,in); MI
#define XI assert(ii < ip); ii = ip; DVAL_FIRST(dv,(ip));
#else
#define DI ++ii; DINDEX1(dindex,ii); UPDATE_I(dict,0,dindex,ii,in); MI
#define XI assert(ii < ip); ii = ip;
#endif
/***********************************************************************
// compress a block of data.
//
// I really apologize for this spaghetti code.
************************************************************************/
LZO_PRIVATE(int)
do_compress ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem )
{
/* this seems to work with buggy gcc */
/* #if defined(LZO_OPTIMIZE_GNUC_i386) */
#if 0 && defined(__GNUC__) && defined(__i386__)
register const lzo_byte *ip __asm__("%esi");
#else
register const lzo_byte *ip;
#endif
#if (DD_BITS > 0)
#if defined(__LZO_HASH_INCREMENTAL)
lzo_uint32 dv;
#endif
unsigned drun = 0;
#endif
lzo_byte *op;
const lzo_byte * const in_end = in + in_len;
const lzo_byte * const ip_end = in + in_len - MIN_LOOKAHEAD;
const lzo_byte *ii;
#if defined(LZO_HAVE_R1)
const lzo_byte *r1 = ip_end; /* pointer for R1 match (none yet) */
#endif
#if defined(LZO_HAVE_M3)
lzo_byte *m3 = out + 1; /* pointer after last m3/m4 match */
#endif
lzo_dict_p const dict = (lzo_dict_p) wrkmem;
#if defined(LZO_COLLECT_STATS)
lzo_stats->r_bits = R_BITS;
lzo_stats->m3o_bits = M3O_BITS;
lzo_stats->dd_bits = DD_BITS;
lzo_stats->clevel = CLEVEL;
lzo_stats->d_bits = D_BITS;
lzo_stats->min_lookahead = MIN_LOOKAHEAD;
lzo_stats->max_lookbehind = MAX_LOOKBEHIND;
lzo_stats->compress_id = _LZO_MEXPAND(COMPRESS_ID);
#endif
/* init dictionary */
#if defined(LZO_DETERMINISTIC)
BZERO8_PTR(wrkmem,sizeof(lzo_dict_t),D_SIZE);
#endif
op = out;
ip = in;
ii = ip; /* point to start of current literal run */
#if (DD_BITS > 0)
DVAL_FIRST(dv,ip);
UPDATE_D(dict,drun,dv,ip,in);
ip++;
DVAL_NEXT(dv,ip);
#else
ip++;
#endif
assert(ip < ip_end);
for (;;)
{
const lzo_byte *m_pos;
#if !defined(NDEBUG)
const lzo_byte *m_pos_sav = NULL;
#endif
lzo_moff_t m_off;
#if (DD_BITS == 0)
lzo_uint dindex;
#endif
lzo_uint m_len;
/***********************************************************************
// search for a match
************************************************************************/
#if !defined(LZO_SEARCH_MATCH_INCLUDE_FILE)
# define LZO_SEARCH_MATCH_INCLUDE_FILE "lzo1b_sm.ch"
#endif
#include LZO_SEARCH_MATCH_INCLUDE_FILE
#if !defined(LZO_TEST_MATCH_INCLUDE_FILE)
# define LZO_TEST_MATCH_INCLUDE_FILE "lzo1b_tm.ch"
#endif
#include LZO_TEST_MATCH_INCLUDE_FILE
/***********************************************************************
// found a literal
************************************************************************/
/* a literal */
literal:
#if (DD_BITS == 0)
UPDATE_I(dict,0,dindex,ip,in);
#endif
if (++ip >= ip_end)
break;
#if (DD_BITS > 0)
DVAL_NEXT(dv,ip);
#endif
continue;
/***********************************************************************
// found a match
************************************************************************/
match:
#if (DD_BITS == 0)
UPDATE_I(dict,0,dindex,ip,in);
#endif
/* we have found a match of at least M2_MIN_LEN */
#if !defined(LZO_CODE_RUN_INCLUDE_FILE)
# define LZO_CODE_RUN_INCLUDE_FILE "lzo1b_cr.ch"
#endif
#include LZO_CODE_RUN_INCLUDE_FILE
/* ii now points to the start of the current match */
assert(ii == ip);
/***********************************************************************
// code the match
************************************************************************/
#if !defined(LZO_CODE_MATCH_INCLUDE_FILE)
# define LZO_CODE_MATCH_INCLUDE_FILE "lzo1b_cm.ch"
#endif
#include LZO_CODE_MATCH_INCLUDE_FILE
/* ii now points to the start of the next literal run */
assert(ii == ip);
}
/***********************************************************************
// end of block
************************************************************************/
assert(ip <= in_end);
#if defined(LZO_COLLECT_STATS)
{
lzo_uint i;
const lzo_byte *p;
for (i = 0; i < D_SIZE; i++)
{
p = dict[i];
if (BOUNDS_CHECKING_OFF_IN_EXPR(p == NULL || p < in || p > in_end))
lzo_stats->unused_dict_entries++;
}
lzo_stats->unused_dict_entries_percent =
100.0 * lzo_stats->unused_dict_entries / D_SIZE;
}
#endif
#if defined(LZO_RETURN_IF_NOT_COMPRESSIBLE)
/* return if op == out to indicate that we
* couldn't compress and didn't copy anything.
*/
if (op == out)
{
*out_len = 0;
return LZO_E_NOT_COMPRESSIBLE;
}
#endif
/* store the final literal run */
if (pd(in_end,ii) > 0)
{
lzo_uint t = pd(in_end,ii);
op = STORE_RUN(op,ii,t);
}
*out_len = op - out;
return LZO_E_OK; /* compression went ok */
}
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo1b_cc.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
|
/* lzo1b_cc.c -- LZO1B compression internal entry point
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#define LZO_NEED_DICT_H
#include "config1b.h"
/***********************************************************************
// compression internal entry point.
************************************************************************/
int _lzo1b_do_compress ( const lzo_byte *in, lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem,
lzo_compress_t func )
{
int r;
#if defined(LZO_TEST_COMPRESS_OVERRUN)
lzo_uint avail_out = *out_len;
#endif
#if defined(LZO_COLLECT_STATS)
_lzo1b_stats_init(lzo_stats);
lzo_stats->in_len = in_len;
#endif
/* don't try to compress a block that's too short */
if (in_len <= 0)
{
*out_len = 0;
r = LZO_E_OK;
}
else if (in_len <= MIN_LOOKAHEAD + 1)
{
#if defined(LZO_RETURN_IF_NOT_COMPRESSIBLE)
*out_len = 0;
r = LZO_E_NOT_COMPRESSIBLE;
#else
*out_len = STORE_RUN(out,in,in_len) - out;
r = (*out_len > in_len) ? LZO_E_OK : LZO_E_ERROR;
#endif
}
else
r = func(in,in_len,out,out_len,wrkmem);
#if defined(LZO_EOF_CODE)
#if defined(LZO_TEST_COMPRESS_OVERRUN)
if (r == LZO_E_OK && avail_out - *out_len < 3)
r = LZO_E_COMPRESS_OVERRUN;
#endif
if (r == LZO_E_OK)
{
lzo_byte *op = out + *out_len;
*op++ = M3_MARKER | 1;
*op++ = 0;
*op++ = 0;
*out_len += 3;
}
#endif
#if defined(LZO_COLLECT_STATS)
lzo_stats->out_len = *out_len;
lzo_stats->match_bytes =
1 * lzo_stats->m1_matches + 2 * lzo_stats->m2_matches +
3 * lzo_stats->m3_matches + 4 * lzo_stats->m4_matches;
_lzo1b_stats_calc(lzo_stats);
#endif
return r;
}
/***********************************************************************
// note: this is not thread safe, but as it is used for finetuning only
// we don't care
************************************************************************/
#undef lzo_stats
/* lzo_stats_t is still defined */
#if defined(LZO_COLLECT_STATS)
static lzo_stats_t lzo_statistics;
lzo_stats_t * const lzo1b_stats = &lzo_statistics;
void _lzo1b_stats_init(lzo_stats_t *lzo_stats)
{
memset(lzo_stats,0,sizeof(*lzo_stats));
}
void _lzo1b_stats_calc(lzo_stats_t *lzo_stats)
{
lzo_stats->matches =
lzo_stats->m1_matches + lzo_stats->m2_matches +
lzo_stats->m3_matches + lzo_stats->m4_matches;
lzo_stats->literal_overhead = lzo_stats->lit_runs +
2 * (lzo_stats->r0short_runs + lzo_stats->r0fast_runs +
lzo_stats->r0long_runs);
lzo_stats->literal_bytes = lzo_stats->literals +
lzo_stats->literal_overhead;
#if 0
assert(lzo_stats->match_bytes + lzo_stats->literal_bytes ==
lzo_stats->out_len);
#endif
lzo_stats->m2_matches -= lzo_stats->r1_matches;
lzo_stats->m2_match[M2_MIN_LEN] -= lzo_stats->r1_matches;
if (lzo_stats->literals > 0)
lzo_stats->literal_overhead_percent =
100.0 * lzo_stats->literal_overhead / lzo_stats->literals;
}
#endif
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo1b_cc.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
/* lzo1b_cc.h -- definitions for the the LZO1B compression driver
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the library and is subject
to change.
*/
#ifndef __LZO1B_CC_H
#define __LZO1B_CC_H
/***********************************************************************
//
************************************************************************/
extern const lzo_compress_t _lzo1b_1_compress_func;
extern const lzo_compress_t _lzo1b_2_compress_func;
extern const lzo_compress_t _lzo1b_3_compress_func;
extern const lzo_compress_t _lzo1b_4_compress_func;
extern const lzo_compress_t _lzo1b_5_compress_func;
extern const lzo_compress_t _lzo1b_6_compress_func;
extern const lzo_compress_t _lzo1b_7_compress_func;
extern const lzo_compress_t _lzo1b_8_compress_func;
extern const lzo_compress_t _lzo1b_9_compress_func;
extern const lzo_compress_t _lzo1b_99_compress_func;
/***********************************************************************
//
************************************************************************/
LZO_EXTERN(lzo_byte *)
_lzo1b_store_run ( lzo_byte * const oo, const lzo_byte * const ii,
lzo_uint r_len);
#define STORE_RUN _lzo1b_store_run
lzo_compress_t _lzo1b_get_compress_func(int clevel);
int _lzo1b_do_compress ( const lzo_byte *in, lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem,
lzo_compress_t func );
#endif /* already included */
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo1b_cm.ch.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
|
/* lzo1b_cm.ch -- implementation of the LZO1B compression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the library and is subject
to change.
*/
/***********************************************************************
// code the match
************************************************************************/
#if (DD_BITS == 0)
/* we already matched M2_MIN_LEN bytes,
* m_pos also already advanced M2_MIN_LEN bytes */
ip += M2_MIN_LEN;
assert(m_pos < ip);
/* try to match another M2_MAX_LEN + 1 - M2_MIN_LEN bytes
* to see if we get more than a M2 match */
#define M2_OR_M3 (MATCH_M2)
#else /* (DD_BITS == 0) */
/* we already matched m_len bytes */
assert(m_len >= M2_MIN_LEN);
ip += m_len;
assert(ip <= in_end);
#define M2_OR_M3 (m_len <= M2_MAX_LEN)
#endif /* (DD_BITS == 0) */
if (M2_OR_M3)
{
/* we've found a M2 or M3 match */
assert(ip <= in_end);
/* 2a) compute match parameters */
#if (DD_BITS == 0)
assert((lzo_moff_t)(ip-m_pos) == m_off);
--ip; /* ran one too far, point back to non-match */
m_len = ip - ii;
#endif
/* 2a2) verify match parameters */
assert(m_len >= M2_MIN_LEN);
assert(m_len <= M2_MAX_LEN);
assert(m_len <= M3_MAX_LEN);
assert(m_off >= M2_MIN_OFFSET);
assert(m_off >= M3_MIN_OFFSET);
assert(m_off <= M3_MAX_OFFSET);
assert(ii-m_off == m_pos_sav);
assert(lzo_memcmp(m_pos_sav,ii,m_len) == 0);
/* 2b) code the match */
#if (_M2_MAX_OFFSET != _M3_MAX_OFFSET)
if (m_off <= M2_MAX_OFFSET)
{
#else
assert(m_off <= M2_MAX_OFFSET);
#endif
m_off -= M2_MIN_OFFSET;
/* code match len + low offset bits */
*op++ = LZO_BYTE(((m_len - (M2_MIN_LEN - 2)) << M2O_BITS) |
(m_off & M2O_MASK));
/* code high offset bits */
*op++ = LZO_BYTE(m_off >> M2O_BITS);
LZO_STATS(lzo_stats->m2_matches++);
LZO_STATS(lzo_stats->m2_match[m_len]++);
#if (_M2_MAX_OFFSET != _M3_MAX_OFFSET)
}
else
{
#if defined(LZO_HAVE_R1)
#if (M3_MIN_LEN == M2_MIN_LEN)
r1 = ip_end; /* invalidate R1 pointer */
#endif
#endif
assert(m_len >= M3_MIN_LEN);
m_off -= M3_MIN_OFFSET - M3_EOF_OFFSET;
/* code match len */
*op++ = LZO_BYTE(M3_MARKER | (m_len - (M3_MIN_LEN - 1)));
/* code low offset bits */
*op++ = LZO_BYTE(m_off & M3O_MASK);
/* code high offset bits */
*op++ = LZO_BYTE(m_off >> M3O_BITS);
LZO_STATS(lzo_stats->m3_matches++);
LZO_STATS(lzo_stats->m3_match[m_len]++);
#if defined(LZO_HAVE_M3)
m3 = op; /* set M3 pointer */
#endif
}
#endif /* (_M2_MAX_OFFSET != _M3_MAX_OFFSET) */
if (ip >= ip_end)
{
ii = ip;
break;
}
/* 2c) Insert phrases (beginning with ii+1) into the dictionary. */
#if (CLEVEL == 9) || (CLEVEL >= 7 && M2L_BITS <= 4) || (CLEVEL >= 5 && M2L_BITS <= 3)
/* Insert the whole match (ii+1)..(ip-1) into dictionary. */
++ii;
do {
DVAL_NEXT(dv,ii);
#if 0
UPDATE_D(dict,drun,dv,ii,in);
#else
dict[ DINDEX(dv,ii) ] = DENTRY(ii,in);
#endif
MI
} while (++ii < ip);
DVAL_NEXT(dv,ii);
assert(ii == ip);
DVAL_ASSERT(dv,ip);
#elif (CLEVEL >= 3)
SI DI DI XI
#elif (CLEVEL >= 2)
SI DI XI
#else
XI
#endif
}
else
{
/* we've found a M3 or M4 match - see how far we can still go */
assert(ip <= in_end);
assert(lzo_memcmp(m_pos_sav,ii,(lzo_uint)(ip-ii)) == 0);
/* 2a) compute match parameters */
#if !defined(MATCH_IP_END)
assert(ii == ip - (M2_MAX_LEN + 1));
#if (DD_BITS > 0)
assert(m_len == (lzo_uint)(ip-ii));
m_pos = ip - m_off;
assert(m_pos == m_pos_sav + m_len);
#endif
{
const lzo_byte *end;
end = in_end;
while (ip < end && *m_pos == *ip)
m_pos++, ip++;
assert(ip <= in_end);
m_len = (ip - ii);
}
assert((lzo_moff_t)(ip-m_pos) == m_off);
#endif
/* 2a2) verify match parameters */
assert(m_len >= M3_MIN_LEN);
assert(m_off >= M3_MIN_OFFSET);
assert(m_off >= M4_MIN_OFFSET);
assert(m_off <= M3_MAX_OFFSET);
assert(m_off <= M4_MAX_OFFSET);
assert(ii-m_off == m_pos_sav);
assert(lzo_memcmp(m_pos_sav,ii,m_len) == 0);
/* 2b) code the match */
if (m_len <= M3_MAX_LEN)
{
/* code match len */
*op++ = LZO_BYTE(M3_MARKER | (m_len - (M3_MIN_LEN - 1)));
LZO_STATS(lzo_stats->m3_matches++);
LZO_STATS(lzo_stats->m3_match[m_len]++);
}
else
{
assert(m_len >= M4_MIN_LEN);
/* code M4 match len flag */
*op++ = M4_MARKER;
/* code match len */
m_len -= M4_MIN_LEN - 1;
while (m_len > 255)
{
m_len -= 255;
*op++ = 0;
}
assert(m_len > 0);
*op++ = LZO_BYTE(m_len);
LZO_STATS(lzo_stats->m4_matches++);
}
m_off -= M3_MIN_OFFSET - M3_EOF_OFFSET;
/* code low offset bits */
*op++ = LZO_BYTE(m_off & M3O_MASK);
/* code high offset bits */
*op++ = LZO_BYTE(m_off >> M3O_BITS);
#if defined(LZO_HAVE_M3)
m3 = op; /* set M3 pointer */
#endif
if (ip >= ip_end)
{
ii = ip;
break;
}
/* 2c) Insert phrases (beginning with ii+1) into the dictionary. */
#if (CLEVEL == 9)
/* Insert the whole match (ii+1)..(ip-1) into dictionary. */
/* This is not recommended because it can be slow. */
++ii;
do {
DVAL_NEXT(dv,ii);
#if 0
UPDATE_D(dict,drun,dv,ii,in);
#else
dict[ DINDEX(dv,ii) ] = DENTRY(ii,in);
#endif
MI
} while (++ii < ip);
DVAL_NEXT(dv,ii);
assert(ii == ip);
DVAL_ASSERT(dv,ip);
#elif (CLEVEL >= 8)
SI DI DI DI DI DI DI DI DI XI
#elif (CLEVEL >= 7)
SI DI DI DI DI DI DI DI XI
#elif (CLEVEL >= 6)
SI DI DI DI DI DI DI XI
#elif (CLEVEL >= 5)
SI DI DI DI DI XI
#elif (CLEVEL >= 4)
SI DI DI DI XI
#elif (CLEVEL >= 3)
SI DI DI XI
#elif (CLEVEL >= 2)
SI DI XI
#else
XI
#endif
}
/* ii now points to the start of the next literal run */
assert(ii == ip);
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo1b_cr.ch.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
/* lzo1b_cr.ch -- implementation of the LZO1B compression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the library and is subject
to change.
*/
/***********************************************************************
// store the current literal run
************************************************************************/
assert(ip < ip_end);
if (pd(ip,ii) > 0)
{
lzo_uint t = pd(ip,ii);
#if defined(LZO_HAVE_R1)
if (ip == r1)
{
/* Code a context sensitive R1 match. */
LZO_STATS(lzo_stats->literals += t);
LZO_STATS(lzo_stats->r1_matches++);
assert(t == 1);
/* modify marker byte */
assert((op[-2] >> M2O_BITS) == (M2_MARKER >> M2O_BITS));
op[-2] &= M2O_MASK;
assert((op[-2] >> M2O_BITS) == 0);
/* copy 1 literal */
*op++ = *ii++;
r1 = ip + (M2_MIN_LEN + 1); /* set new R1 pointer */
}
else
#endif
if (t < R0MIN)
{
/* inline the copying of a short run */
LZO_STATS(lzo_stats->literals += t);
LZO_STATS(lzo_stats->lit_runs++);
LZO_STATS(lzo_stats->lit_run[t]++);
#if defined(LZO_HAVE_M3)
if (t < LZO_SIZE(8-M3O_BITS) && op == m3)
{
/* Code a very short literal run into the low offset bits
* of the previous M3/M4 match.
*/
LZO_STATS(lzo_stats->lit_runs_after_m3_match++);
LZO_STATS(lzo_stats->lit_run_after_m3_match[t]++);
assert((m3[-2] >> M3O_BITS) == 0);
m3[-2] |= LZO_BYTE(t << M3O_BITS);
}
else
#endif
{
*op++ = LZO_BYTE(t);
}
MEMCPY_DS(op, ii, t);
#if defined(LZO_HAVE_R1)
r1 = ip + (M2_MIN_LEN + 1); /* set new R1 pointer */
#endif
}
else if (t < R0FAST)
{
/* inline the copying of a short R0 run */
LZO_STATS(lzo_stats->literals += t);
LZO_STATS(lzo_stats->r0short_runs++);
*op++ = 0; *op++ = LZO_BYTE(t - R0MIN);
MEMCPY_DS(op, ii, t);
#if defined(LZO_HAVE_R1)
r1 = ip + (M2_MIN_LEN + 1); /* set new R1 pointer */
#endif
}
else
{
op = STORE_RUN(op,ii,t);
ii = ip;
}
}
/* ii now points to the start of the current match */
assert(ii == ip);
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo1b_d.ch.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
|
/* lzo1b_d.ch -- implementation of the LZO1B decompression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include "lzo1_d.ch"
#if defined(HAVE_ANY_IP) && defined(HAVE_ANY_OP)
/* too many local variables, cannot allocate registers */
# undef LZO_OPTIMIZE_GNUC_i386
#endif
/***********************************************************************
// decompress a block of data.
************************************************************************/
LZO_PUBLIC(int)
DO_DECOMPRESS ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem )
{
#if defined(LZO_OPTIMIZE_GNUC_i386)
register lzo_byte *op __asm__("%edi");
register const lzo_byte *ip __asm__("%esi");
register lzo_uint t __asm__("%ecx");
register const lzo_byte *m_pos __asm__("%ebx");
#else
register lzo_byte *op;
register const lzo_byte *ip;
register lzo_uint t;
register const lzo_byte *m_pos;
#endif
const lzo_byte * const ip_end = in + in_len;
#if defined(HAVE_ANY_OP)
lzo_byte * const op_end = out + *out_len;
#endif
LZO_UNUSED(wrkmem);
#if defined(__LZO_QUERY_DECOMPRESS)
if (__LZO_IS_DECOMPRESS_QUERY(in,in_len,out,out_len,wrkmem))
return __LZO_QUERY_DECOMPRESS(in,in_len,out,out_len,wrkmem,0,0);
#endif
op = out;
ip = in;
while (TEST_IP && TEST_OP)
{
t = *ip++; /* get marker */
if (t < R0MIN) /* a literal run */
{
if (t == 0) /* a R0 literal run */
{
NEED_IP(1);
t = *ip++;
if (t >= R0FAST - R0MIN) /* a long R0 run */
{
t -= R0FAST - R0MIN;
if (t == 0)
t = R0FAST;
else
{
#if 0
t = 256u << ((unsigned) t);
#else
/* help the optimizer */
lzo_uint tt = 256;
do tt <<= 1; while (--t > 0);
t = tt;
#endif
}
NEED_IP(t); NEED_OP(t);
#if 1 && defined(LZO_UNALIGNED_OK_4)
do {
* (lzo_uint32p) (op+0) = * (const lzo_uint32p) (ip+0);
* (lzo_uint32p) (op+4) = * (const lzo_uint32p) (ip+4);
op += 8; ip += 8;
t -= 8;
} while (t > 0);
#else
MEMCPY8_DS(op,ip,t);
#endif
continue;
}
t += R0MIN; /* a short R0 run */
}
NEED_IP(t); NEED_OP(t);
/* copy literal run */
#if 1 && defined(LZO_UNALIGNED_OK_4)
if (t >= 4)
{
do {
* (lzo_uint32p) op = * (const lzo_uint32p) ip;
op += 4; ip += 4; t -= 4;
} while (t >= 4);
if (t > 0) do *op++ = *ip++; while (--t > 0);
}
else
#endif
{
#if (M3O_BITS < 7)
literal1:
#endif
do *op++ = *ip++; while (--t > 0);
}
#if (M3O_BITS == 7)
literal2:
#endif
/* after a literal a match must follow */
while (TEST_IP && TEST_OP)
{
t = *ip++; /* get R1 marker */
if (t >= R0MIN)
goto match;
NEED_IP(2); NEED_OP(M2_MIN_LEN + 1);
/* R1 match - a M2_MIN_LEN match + 1 byte literal */
assert((t & M2O_MASK) == t);
m_pos = op - M2_MIN_OFFSET;
m_pos -= t | (((lzo_uint) *ip++) << M2O_BITS);
assert(m_pos >= out); assert(m_pos < op);
TEST_LOOKBEHIND(m_pos,out);
COPY_M2;
*op++ = *ip++;
}
#if defined(HAVE_TEST_IP) || defined(HAVE_TEST_OP)
break;
#endif
}
match:
if (t >= M2_MARKER) /* a M2 match */
{
/* get match offset */
NEED_IP(1);
m_pos = op - M2_MIN_OFFSET;
m_pos -= (t & M2O_MASK) | (((lzo_uint) *ip++) << M2O_BITS);
assert(m_pos >= out); assert(m_pos < op);
TEST_LOOKBEHIND(m_pos,out);
/* get match len */
t = (t >> M2O_BITS) - 1;
NEED_OP(t + M2_MIN_LEN - 1);
COPY_M2X;
MEMMOVE_DS(op,m_pos,t);
}
else /* a M3 or M4 match */
{
/* get match len */
t &= M3L_MASK;
if (t == 0) /* a M4 match */
{
NEED_IP(1);
while (*ip == 0)
{
t += 255;
ip++;
NEED_IP(1);
}
t += (M4_MIN_LEN - M3_MIN_LEN) + *ip++;
}
/* get match offset */
NEED_IP(2);
m_pos = op - (M3_MIN_OFFSET - M3_EOF_OFFSET);
m_pos -= *ip++ & M3O_MASK;
m_pos -= (lzo_uint)(*ip++) << M3O_BITS;
#if defined(LZO_EOF_CODE)
if (m_pos == op)
goto eof_found;
#endif
/* copy match */
assert(m_pos >= out); assert(m_pos < op);
TEST_LOOKBEHIND(m_pos,out); NEED_OP(t + M3_MIN_LEN - 1);
#if defined(LZO_UNALIGNED_OK_4)
if (t >= 2 * 4 - (M3_MIN_LEN - 1) && (op - m_pos) >= 4)
{
* (lzo_uint32p) op = * (const lzo_uint32p) m_pos;
op += 4; m_pos += 4; t -= 4 - (M3_MIN_LEN - 1);
do {
* (lzo_uint32p) op = * (const lzo_uint32p) m_pos;
op += 4; m_pos += 4; t -= 4;
} while (t >= 4);
if (t > 0) do *op++ = *m_pos++; while (--t > 0);
}
else
#endif
{
COPY_M3X;
MEMMOVE_DS(op,m_pos,t);
}
#if (M3O_BITS < 7)
t = ip[-2] >> M3O_BITS;
if (t)
{
NEED_IP(t); NEED_OP(t);
goto literal1;
}
#elif (M3O_BITS == 7)
/* optimized version */
if (ip[-2] & (1 << M3O_BITS))
{
NEED_IP(1); NEED_OP(1);
*op++ = *ip++;
goto literal2;
}
#endif
}
}
#if defined(LZO_EOF_CODE)
#if defined(HAVE_TEST_IP) || defined(HAVE_TEST_OP)
/* no EOF code was found */
*out_len = op - out;
return LZO_E_EOF_NOT_FOUND;
#endif
eof_found:
assert(t == 1);
#endif
*out_len = op - out;
return (ip == ip_end ? LZO_E_OK :
(ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN));
#if defined(HAVE_NEED_IP)
input_overrun:
*out_len = op - out;
return LZO_E_INPUT_OVERRUN;
#endif
#if defined(HAVE_NEED_OP)
output_overrun:
*out_len = op - out;
return LZO_E_OUTPUT_OVERRUN;
#endif
#if defined(LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND)
lookbehind_overrun:
*out_len = op - out;
return LZO_E_LOOKBEHIND_OVERRUN;
#endif
}
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo1b_d1.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/* lzo1b_d1.c -- LZO1B decompression
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include "config1b.h"
#undef LZO_TEST_DECOMPRESS_OVERRUN
#define DO_DECOMPRESS lzo1b_decompress
#include "lzo1b_d.ch"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1b_d2.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/* lzo1b_d2.c -- LZO1B decompression with overrun testing
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include "config1b.h"
#define LZO_TEST_DECOMPRESS_OVERRUN
#define DO_DECOMPRESS lzo1b_decompress_safe
#include "lzo1b_d.ch"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1b_de.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
|
/* lzo1b_de.h -- definitions for the the LZO1B/LZO1C algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the library and is subject
to change.
*/
#ifndef __LZO_DEFS_H
#define __LZO_DEFS_H
#ifdef __cplusplus
extern "C" {
#endif
/***********************************************************************
//
************************************************************************/
/*
Format of the marker byte
76543210
--------
00000000 R0 - a long literal run ('R0' run)
000rrrrr R - a short literal run with len r
00100000 M4 - a very long match
001mmmmm M3 - a long match (len = m+M3_MIN_LEN)
mmmooooo M2 - a short match (len = m+M2_MIN_LEN, o = offset low bits)
M1 is not used !
*/
#ifndef R_BITS
#define R_BITS (5)
#endif
#ifndef M1L_BITS
#define M1L_BITS (0)
#endif
#ifndef M2L_BITS
#define M2L_BITS (CHAR_BIT - M2O_BITS)
#endif
#ifndef M3L_BITS
#define M3L_BITS (R_BITS)
#endif
#ifndef M4L_BITS
#define M4L_BITS (CHAR_BIT)
#endif
#ifndef M1O_BITS
#define M1O_BITS (6)
#endif
#ifndef M2O_BITS
#define M2O_BITS (R_BITS)
#endif
#ifndef M3O_BITS
#define M3O_BITS (CHAR_BIT)
#endif
#ifndef M4O_BITS
#define M4O_BITS (M3O_BITS) /* must be the same */
#endif
#ifndef M1X_BITS
#define M1X_BITS (M1O_BITS)
#endif
#ifndef M2X_BITS
#define M2X_BITS (M2O_BITS + CHAR_BIT)
#endif
#ifndef M3X_BITS
#define M3X_BITS (M3O_BITS + CHAR_BIT)
#endif
#ifndef M4X_BITS
#define M4X_BITS M3X_BITS
#endif
#define __MIN_OFFSET(bits) 1
#define __MAX_OFFSET(bits) (LZO_LSIZE(bits) - __MIN_OFFSET(bits) + 1)
#define M1_MIN_OFFSET __MIN_OFFSET(M1X_BITS)
#define M2_MIN_OFFSET __MIN_OFFSET(M2X_BITS)
#define M3_MIN_OFFSET __MIN_OFFSET(M3X_BITS)
#define M4_MIN_OFFSET M3_MIN_OFFSET
#if defined(LZO_EOF_CODE) && !defined(M3_EOF_OFFSET)
#define M3_EOF_OFFSET 1
#else
#define M3_EOF_OFFSET 0
#endif
#ifndef _M1_MAX_OFFSET
#define _M1_MAX_OFFSET __MAX_OFFSET(M1X_BITS)
#endif
#ifndef _M2_MAX_OFFSET
#define _M2_MAX_OFFSET __MAX_OFFSET(M2X_BITS)
#endif
#ifndef _M3_MAX_OFFSET
#define _M3_MAX_OFFSET (__MAX_OFFSET(M3X_BITS) - M3_EOF_OFFSET)
#endif
#ifndef _M4_MAX_OFFSET
#define _M4_MAX_OFFSET _M3_MAX_OFFSET
#endif
#ifndef _MAX_OFFSET
#define _MAX_OFFSET _M4_MAX_OFFSET
#endif
#if (M3_EOF_OFFSET > 0) && (_M2_MAX_OFFSET == _M3_MAX_OFFSET + M3_EOF_OFFSET)
# undef _M2_MAX_OFFSET
# define _M2_MAX_OFFSET _M3_MAX_OFFSET
#endif
#if (_M2_MAX_OFFSET > _M3_MAX_OFFSET)
# error
#endif
#define M1_MAX_OFFSET ((lzo_ptrdiff_t) _M1_MAX_OFFSET)
#define M2_MAX_OFFSET ((lzo_ptrdiff_t) _M2_MAX_OFFSET)
#define M3_MAX_OFFSET ((lzo_ptrdiff_t) _M3_MAX_OFFSET)
#define M4_MAX_OFFSET ((lzo_ptrdiff_t) _M4_MAX_OFFSET)
#define MAX_OFFSET ((lzo_ptrdiff_t) _MAX_OFFSET)
#ifndef M1_MIN_LEN
#define M1_MIN_LEN (2)
#endif
#ifndef M2_MIN_LEN
#define M2_MIN_LEN (3)
#endif
#ifndef M3_MIN_LEN
#if (M3X_BITS == M2X_BITS)
#define M3_MIN_LEN (M2_MAX_LEN + 1)
#else
#define M3_MIN_LEN (4)
#endif
#endif
#ifndef M4_MIN_LEN
#define M4_MIN_LEN (M3_MAX_LEN + 1)
#endif
#ifndef M1_MAX_LEN
#define M1_MAX_LEN (M1_MIN_LEN + LZO_SIZE(M1L_BITS) - 1)
#endif
#ifndef M2_MAX_LEN
#define M2_MAX_LEN (M2_MIN_LEN + LZO_SIZE(M2L_BITS) - 1 - 2)
#endif
#ifndef M3_MAX_LEN
#define M3_MAX_LEN (M3_MIN_LEN + LZO_SIZE(M3L_BITS) - 1 - 1)
#endif
#ifndef M4_MAX_LEN
#define M4_MAX_LEN (ULONG_MAX)
#endif
#define M1O_MASK LZO_MASK(M1O_BITS)
#define M1L_MASK LZO_MASK(M1L_BITS)
#define M2O_MASK LZO_MASK(M2O_BITS)
#define M2L_MASK LZO_MASK(M2L_BITS)
#define M3O_MASK LZO_MASK(M3O_BITS)
#define M3L_MASK LZO_MASK(M3L_BITS)
#define M4O_MASK LZO_MASK(M4O_BITS)
#define M4L_MASK LZO_MASK(M4L_BITS)
#define M1_MARKER (1 << M1O_BITS)
#define M2_MARKER (2 << M2O_BITS)
#define M3_MARKER (1 << M3L_BITS)
#define M4_MARKER M3_MARKER
/***********************************************************************
// R0 literal run (a long run)
************************************************************************/
#ifndef R0MIN
#define R0MIN (LZO_SIZE(R_BITS)) /* Minimum len of R0 run of literals */
#endif
#define R0MAX (R0MIN + 256 - 1) /* Maximum len of R0 run of literals */
#if (R0MAX - (R0MAX & ~7u) >= 7)
#define R0FAST (R0MAX & ~7u) /* R0MAX aligned to 8 byte boundary */
#else
#define R0FAST (R0MAX & ~15u) /* R0MAX aligned to 8 byte boundary */
#endif
#if (R0MAX - R0FAST < 7) || ((R0FAST & 7) != 0)
# error "something went wrong"
#endif
#if (R0FAST * 2 < 512)
# error "R0FAST is not big enough"
#endif
/* 7 special codes from R0FAST+1 .. R0MAX
* these codes mean long R0 runs with lengths
* 512, 1024, 2048, 4096, 8192, 16384, 32768
*/
/***********************************************************************
// matching
************************************************************************/
#define PS *m_pos++ != *ip++
/* We already matched M2_MIN_LEN bytes.
* Try to match another M2_MAX_LEN - M2_MIN_LEN bytes. */
#if (M2_MAX_LEN - M2_MIN_LEN == 4)
# define MATCH_M2X (PS || PS || PS || PS)
#elif (M2_MAX_LEN - M2_MIN_LEN == 5)
# define MATCH_M2X (PS || PS || PS || PS || PS)
#elif (M2_MAX_LEN - M2_MIN_LEN == 6)
# define MATCH_M2X (PS || PS || PS || PS || PS || PS)
#elif (M2_MAX_LEN - M2_MIN_LEN == 7)
# define MATCH_M2X (PS || PS || PS || PS || PS || PS || PS)
#elif (M2_MAX_LEN - M2_MIN_LEN == 13)
# define MATCH_M2X (PS || PS || PS || PS || PS || PS || PS || PS || \
PS || PS || PS || PS || PS)
#elif (M2_MAX_LEN - M2_MIN_LEN == 14)
# define MATCH_M2X (PS || PS || PS || PS || PS || PS || PS || PS || \
PS || PS || PS || PS || PS || PS)
#elif (M2_MAX_LEN - M2_MIN_LEN == 16)
# define MATCH_M2X (PS || PS || PS || PS || PS || PS || PS || PS || \
PS || PS || PS || PS || PS || PS || PS || PS)
#elif (M2_MAX_LEN - M2_MIN_LEN == 29)
# define MATCH_M2X (PS || PS || PS || PS || PS || PS || PS || PS || \
PS || PS || PS || PS || PS || PS || PS || PS || \
PS || PS || PS || PS || PS || PS || PS || PS || \
PS || PS || PS || PS || PS)
#else
# error "MATCH_M2X not yet implemented"
#endif
/* We already matched M2_MIN_LEN bytes.
* Try to match another M2_MAX_LEN + 1 - M2_MIN_LEN bytes
* to see if we get more than a M2 match */
#define MATCH_M2 (MATCH_M2X || PS)
/***********************************************************************
// copying
************************************************************************/
#define _CP *op++ = *m_pos++
#if (M2_MIN_LEN == 2)
# define COPY_M2X _CP
#elif (M2_MIN_LEN == 3)
# define COPY_M2X _CP; _CP
#elif (M2_MIN_LEN == 4)
# define COPY_M2X _CP; _CP; _CP
#else
# error "COPY_M2X not yet implemented"
#endif
#if (M3_MIN_LEN == 3)
# define COPY_M3X _CP; _CP
#elif (M3_MIN_LEN == 4)
# define COPY_M3X _CP; _CP; _CP
#elif (M3_MIN_LEN == 9)
# define COPY_M3X _CP; _CP; _CP; _CP; _CP; _CP; _CP; _CP
#else
# error "COPY_M3X not yet implemented"
#endif
#define COPY_M2 COPY_M2X; *op++ = *m_pos++
#define COPY_M3 COPY_M3X; *op++ = *m_pos++
/***********************************************************************
//
************************************************************************/
#if defined(LZO_NEED_DICT_H)
#define DL_MIN_LEN M2_MIN_LEN
#define D_INDEX1(d,p) d = DM((0x21*DX3(p,5,5,6)) >> 5)
#define D_INDEX2(d,p) d = (d & (D_MASK & 0x7ff)) ^ (D_HIGH | 0x1f)
#include "lzo_dict.h"
#ifndef MIN_LOOKAHEAD
#define MIN_LOOKAHEAD (M2_MAX_LEN + 1)
#endif
#ifndef MAX_LOOKBEHIND
#define MAX_LOOKBEHIND (MAX_OFFSET)
#endif
#endif /* defined(LZO_NEED_DICT_H) */
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* already included */
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo1b_r.ch.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
/* lzo1b_r.ch -- literal run handling for the the LZO1B/LZO1C algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/***********************************************************************
// store a literal run (internal)
************************************************************************/
LZO_PUBLIC(lzo_byte *)
STORE_RUN ( lzo_byte * const oo, const lzo_byte * const ii, lzo_uint r_len)
{
#if defined(LZO_OPTIMIZE_GNUC_i386)
register lzo_byte *op __asm__("%edi");
register const lzo_byte *ip __asm__("%esi");
register lzo_uint t __asm__("%ecx");
#else
register lzo_byte *op;
register const lzo_byte *ip;
register lzo_uint t;
#endif
LZO_STATS(lzo_stats->literals += r_len);
op = oo;
ip = ii;
assert(r_len > 0);
/* code a long R0 run */
if (r_len >= 512)
{
unsigned r_bits = 6; /* 256 << 6 == 16384 */
lzo_uint tt = 32768u;
while (r_len >= (t = tt))
{
r_len -= t;
*op++ = 0; *op++ = (R0FAST - R0MIN) + 7;
MEMCPY8_DS(op, ip, t);
LZO_STATS(lzo_stats->r0long_runs++);
}
tt >>= 1;
do {
if (r_len >= (t = tt))
{
r_len -= t;
*op++ = 0; *op++ = LZO_BYTE((R0FAST - R0MIN) + r_bits);
MEMCPY8_DS(op, ip, t);
LZO_STATS(lzo_stats->r0long_runs++);
}
tt >>= 1;
} while (--r_bits > 0);
}
assert(r_len < 512);
while (r_len >= (t = R0FAST))
{
r_len -= t;
*op++ = 0; *op++ = (R0FAST - R0MIN);
MEMCPY8_DS(op, ip, t);
LZO_STATS(lzo_stats->r0fast_runs++);
}
t = r_len;
if (t >= R0MIN)
{
/* code a short R0 run */
*op++ = 0; *op++ = LZO_BYTE(t - R0MIN);
MEMCPY_DS(op, ip, t);
LZO_STATS(lzo_stats->r0short_runs++);
}
else if (t > 0)
{
/* code a short literal run */
LZO_STATS(lzo_stats->lit_runs++);
LZO_STATS(lzo_stats->lit_run[t]++);
*op++ = LZO_BYTE(t);
MEMCPY_DS(op, ip, t);
}
return op;
}
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo1b_rr.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
/* lzo1b_rr.c -- literal run handling
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include "config1b.h"
#include "lzo1b_r.ch"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1b_sm.ch.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
|
/* lzo1b_sm.ch -- implementation of the LZO1B compression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the library and is subject
to change.
*/
/***********************************************************************
// search for a match
************************************************************************/
#if (DD_BITS == 0)
/* search ip in the dictionary */
DINDEX1(dindex,ip);
GINDEX(m_pos,m_off,dict,dindex,in);
if (LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,M3_MAX_OFFSET))
goto literal;
#if 1
if (m_off <= M2_MAX_OFFSET || m_pos[3] == ip[3])
goto try_match;
DINDEX2(dindex,ip);
#endif
GINDEX(m_pos,m_off,dict,dindex,in);
if (LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,M3_MAX_OFFSET))
goto literal;
if (m_off <= M2_MAX_OFFSET || m_pos[3] == ip[3])
goto try_match;
goto literal;
#else /* (DD_BITS == 0) */
/* search ip in the deepened dictionary */
{
lzo_dict_p d = &dict [ DINDEX(dv,ip) ];
const lzo_byte *ip_sav;
unsigned j = DD_SIZE;
lzo_uint x_len;
lzo_moff_t x_off;
DVAL_ASSERT(dv,ip);
ip_sav = ip;
m_len = 0;
do {
#if !defined(NDEBUG)
const lzo_byte *z_pos = NULL;
#endif
#if defined(LZO_DICT_USE_PTR)
m_pos = *d;
assert((z_pos = m_pos) == *d);
#if defined(LZO_DETERMINISTIC)
assert(m_pos == NULL || m_pos >= in);
assert(m_pos == NULL || m_pos < ip);
#endif
#else
x_off = *d;
#endif
assert(ip == ip_sav);
if (LZO_CHECK_MPOS(m_pos,x_off,in,ip,MAX_OFFSET))
#if (CLEVEL == 9)
*d = DENTRY(ip,in);
#else
((void)(0));
#endif
else if (m_pos[m_len] != ip[m_len])
((void)(0));
else if (*m_pos++ == *ip++ && *m_pos++ == *ip++ && *m_pos++ == *ip++)
{
#if !defined(LZO_DICT_USE_PTR)
assert((z_pos = ip - 3 - x_off) == (m_pos - 3));
#endif
/* a match */
if (MATCH_M2)
{
x_len = (ip - 1) - ip_sav;
if (x_len > m_len)
{
m_len = x_len;
m_off = x_off;
assert((m_pos_sav = z_pos) != NULL);
}
#if (CLEVEL == 9)
/* try to find a closer match */
else if (x_len == m_len && x_off < m_off)
{
m_off = x_off;
assert((m_pos_sav = z_pos) != NULL);
}
#endif
}
else
{
assert((ip - ip_sav) == M2_MAX_LEN + 1);
#if (CLEVEL == 9)
#if defined(MATCH_IP_END)
{
const lzo_byte *end;
end = MATCH_IP_END;
while (ip < end && *m_pos == *ip)
m_pos++, ip++;
assert(ip <= in_end);
x_len = ip - ip_sav;
}
if (x_len > m_len)
{
m_len = x_len;
m_off = x_off;
assert((m_pos_sav = z_pos) != NULL);
if (ip >= MATCH_IP_END)
{
ip = ip_sav;
#if 0
/* not needed - we are at the end */
d -= DD_SIZE - j;
assert(d == &dict [ DINDEX(dv,ip) ]);
UPDATE_P(d,drun,ip,in);
#endif
goto match;
}
}
else if (x_len == m_len && x_off < m_off)
{
m_off = x_off;
assert((m_pos_sav = z_pos) != NULL);
}
#else
/* try to find a closer match */
if (m_len < M2_MAX_LEN + 1 || x_off < m_off)
{
m_len = M2_MAX_LEN + 1;
m_off = x_off;
assert((m_pos_sav = z_pos) != NULL);
}
#endif
#else
/* don't search for a longer/closer match */
m_len = M2_MAX_LEN + 1;
m_off = x_off;
assert((m_pos_sav = z_pos) != NULL);
ip = ip_sav;
d -= DD_SIZE - j;
assert(d == &dict [ DINDEX(dv,ip) ]);
UPDATE_P(d,drun,ip,in);
goto match;
#endif
}
ip = ip_sav;
}
else
ip = ip_sav;
d++;
} while (--j > 0);
assert(ip == ip_sav);
d -= DD_SIZE;
assert(d == &dict [ DINDEX(dv,ip) ]);
UPDATE_P(d,drun,ip,in);
}
#endif /* (DD_BITS == 0) */
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo1b_tm.ch.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
/* lzo1b_tm.ch -- implementation of the LZO1B compression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the library and is subject
to change.
*/
/***********************************************************************
// test for a potential match
************************************************************************/
#if (DD_BITS == 0)
try_match:
#if !defined(NDEBUG) && defined(LZO_DICT_USE_PTR)
#if defined(LZO_DETERMINISTIC)
assert(m_pos == NULL || m_pos >= in);
assert(m_pos == NULL || m_pos < ip);
#endif
m_pos_sav = m_pos;
#endif
if (m_pos[0] == ip[0] && m_pos[1] == ip[1] && m_pos[2] == ip[2])
{
m_pos += 3;
goto match;
}
#else /* (DD_BITS == 0) */
/* test potential match */
if (m_len > M2_MIN_LEN)
goto match;
if (m_len == M2_MIN_LEN)
{
#if (_MAX_OFFSET == _M2_MAX_OFFSET)
goto match;
#else
if (m_off <= M2_MAX_OFFSET)
goto match;
#if 0 && (M3_MIN_LEN == M2_MIN_LEN)
if (ip == ii)
goto match;
#endif
#endif
}
goto literal;
#endif /* (DD_BITS == 0) */
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo1b_xx.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
/* lzo1b_xx.c -- LZO1B compression public entry point
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include "config1b.h"
/***********************************************************************
//
************************************************************************/
static const lzo_compress_t * const c_funcs [9] =
{
&_lzo1b_1_compress_func,
&_lzo1b_2_compress_func,
&_lzo1b_3_compress_func,
&_lzo1b_4_compress_func,
&_lzo1b_5_compress_func,
&_lzo1b_6_compress_func,
&_lzo1b_7_compress_func,
&_lzo1b_8_compress_func,
&_lzo1b_9_compress_func
};
lzo_compress_t _lzo1b_get_compress_func(int clevel)
{
const lzo_compress_t *f;
if (clevel < LZO1B_BEST_SPEED || clevel > LZO1B_BEST_COMPRESSION)
{
if (clevel == LZO1B_DEFAULT_COMPRESSION)
clevel = LZO1B_BEST_SPEED;
else
return 0;
}
f = c_funcs[clevel-1];
assert(f && *f);
return *f;
}
LZO_PUBLIC(int)
lzo1b_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem,
int clevel )
{
lzo_compress_t f;
f = _lzo1b_get_compress_func(clevel);
if (!f)
return LZO_E_ERROR;
return _lzo1b_do_compress(src,src_len,dst,dst_len,wrkmem,f);
}
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo1c_1.c.
|
|
>
>
>
>
>
>
|
1
2
3
4
5
6
|
#define COMPRESS_ID 1
#define DDBITS 0
#define CLEVEL 1
#include "compr1c.h"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1c_2.c.
|
|
>
>
>
>
>
>
|
1
2
3
4
5
6
|
#define COMPRESS_ID 2
#define DDBITS 0
#define CLEVEL 2
#include "compr1c.h"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1c_3.c.
|
|
>
>
>
>
>
>
|
1
2
3
4
5
6
|
#define COMPRESS_ID 3
#define DDBITS 0
#define CLEVEL 3
#include "compr1c.h"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1c_4.c.
|
|
>
>
>
>
>
>
|
1
2
3
4
5
6
|
#define COMPRESS_ID 4
#define DDBITS 1
#define CLEVEL 2
#include "compr1c.h"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1c_5.c.
|
|
>
>
>
>
>
>
|
1
2
3
4
5
6
|
#define COMPRESS_ID 5
#define DDBITS 1
#define CLEVEL 3
#include "compr1c.h"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1c_6.c.
|
|
>
>
>
>
>
>
|
1
2
3
4
5
6
|
#define COMPRESS_ID 6
#define DDBITS 1
#define CLEVEL 5
#include "compr1c.h"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1c_7.c.
|
|
>
>
>
>
>
>
|
1
2
3
4
5
6
|
#define COMPRESS_ID 7
#define DDBITS 2
#define CLEVEL 3
#include "compr1c.h"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1c_8.c.
|
|
>
>
>
>
>
>
|
1
2
3
4
5
6
|
#define COMPRESS_ID 8
#define DDBITS 2
#define CLEVEL 8
#include "compr1c.h"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1c_9.c.
|
|
>
>
>
>
>
>
|
1
2
3
4
5
6
|
#define COMPRESS_ID 9
#define DDBITS 2
#define CLEVEL 9
#include "compr1c.h"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1c_99.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
#include <lzoconf.h>
#if !defined(LZO_99_UNSUPPORTED)
#define COMPRESS_ID 99
#define DDBITS 3
#define CLEVEL 9
#define D_BITS 16
#define MATCH_IP_END in_end
#include "compr1c.h"
#endif
|
Added work/contrib/lzo/lzo-1.08/src/lzo1c_9x.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
|
/* lzo1c_9x.c -- implementation of the LZO1C-999 compression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include <lzoconf.h>
#if !defined(LZO_999_UNSUPPORTED)
#include <stdio.h>
#include "config1c.h"
#if 0
#undef NDEBUG
#include <assert.h>
#endif
/***********************************************************************
//
************************************************************************/
#define N 16383 /* size of ring buffer */
#define THRESHOLD 2 /* lower limit for match length */
#define F 2048 /* upper limit for match length */
#define LZO1C
#define LZO_COMPRESS_T lzo1c_999_t
#define lzo_swd_t lzo1c_999_swd_t
#include "lzo_mchw.ch"
/***********************************************************************
//
************************************************************************/
static lzo_byte *
code_match ( LZO_COMPRESS_T *c, lzo_byte *op, lzo_uint m_len, lzo_uint m_off )
{
if (m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET)
{
assert(m_len >= M2_MIN_LEN);
assert(m_off >= M2_MIN_OFFSET);
m_off -= M2_MIN_OFFSET;
/* code match len + low offset bits */
*op++ = LZO_BYTE(((m_len - (M2_MIN_LEN - 2)) << M2O_BITS) |
(m_off & M2O_MASK));
/* code high offset bits */
*op++ = LZO_BYTE(m_off >> M2O_BITS);
c->m2_m++;
}
else
{
assert(m_len >= M3_MIN_LEN);
assert(m_off <= M3_MAX_OFFSET);
m_off -= M3_MIN_OFFSET - M3_EOF_OFFSET;
/* code match len */
if (m_len <= M3_MAX_LEN)
*op++ = LZO_BYTE(M3_MARKER | (m_len - (M3_MIN_LEN - 1)));
else
{
assert(m_len >= M4_MIN_LEN);
/* code M4 match len flag */
*op++ = M4_MARKER;
/* code match len */
m_len -= M4_MIN_LEN - 1;
while (m_len > 255)
{
m_len -= 255;
*op++ = 0;
}
assert(m_len > 0);
*op++ = LZO_BYTE(m_len);
}
/* code low offset bits */
*op++ = LZO_BYTE(m_off & M3O_MASK);
/* code high offset bits */
*op++ = LZO_BYTE(m_off >> M3O_BITS);
c->r1_m_len = 0;
c->m3 = op;
c->m3_m++;
}
return op;
}
/***********************************************************************
// this is a public function, but there is no prototype in a header file
************************************************************************/
LZO_EXTERN(int)
lzo1c_999_compress_callback ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem,
lzo_progress_callback_t cb,
lzo_uint max_chain );
LZO_PUBLIC(int)
lzo1c_999_compress_callback ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem,
lzo_progress_callback_t cb,
lzo_uint max_chain )
{
lzo_byte *op;
const lzo_byte *ii;
lzo_uint lit;
lzo_uint m_len, m_off;
LZO_COMPRESS_T cc;
LZO_COMPRESS_T * const c = &cc;
lzo_swd_t * const swd = (lzo_swd_t *) wrkmem;
int r;
#if defined(__LZO_QUERY_COMPRESS)
if (__LZO_IS_COMPRESS_QUERY(in,in_len,out,out_len,wrkmem))
return __LZO_QUERY_COMPRESS(in,in_len,out,out_len,wrkmem,1,lzo_sizeof(lzo_swd_t));
#endif
/* sanity check */
if (!lzo_assert(LZO1C_999_MEM_COMPRESS >= lzo_sizeof(lzo_swd_t)))
return LZO_E_ERROR;
c->init = 0;
c->ip = c->in = in;
c->in_end = in + in_len;
c->cb = cb;
c->r1_r = c->m3_r = c->m2_m = c->m3_m = 0;
op = out;
ii = c->ip; /* point to start of literal run */
lit = 0;
c->r1_m_len = 0;
c->m3 = out + 1; /* pointer after last m3/m4 match */
r = init_match(c,swd,NULL,0,0);
if (r != 0)
return r;
if (max_chain > 0)
swd->max_chain = max_chain;
r = find_match(c,swd,0,0);
if (r != 0)
return r;
while (c->look > 0)
{
int lazy_match_min_gain = -1;
lzo_uint ahead = 0;
m_len = c->m_len;
m_off = c->m_off;
#if 0
printf("%5ld: %5d len:%3d off:%5d\n", (c->ip-c->look)-in, c->look,
m_len, m_off);
#endif
assert(c->ip - c->look >= in);
if (lit == 0)
ii = c->ip - c->look;
assert(ii + lit == c->ip - c->look);
assert(swd->b_char == *(c->ip - c->look));
if ((m_len < M2_MIN_LEN) ||
(m_len < M3_MIN_LEN && m_off > M2_MAX_OFFSET))
{
m_len = 0;
}
else
{
assert(c->ip - c->look - m_off >= in);
assert(c->ip - c->look - m_off + m_len < c->ip);
assert(lzo_memcmp(c->ip - c->look, c->ip - c->look - m_off,
m_len) == 0);
if (lit > 0)
{
/* we have a current literal run: do not try a lazy match,
if the literal could be coded into a r1 or m3 match */
if (lit == 1 && c->r1_m_len == M2_MIN_LEN)
lazy_match_min_gain = -1;
else if (lit == 3 && op == c->m3)
lazy_match_min_gain = -1;
else if (lit < 3 && op == c->m3)
lazy_match_min_gain = 0;
else
lazy_match_min_gain = 1;
#if (M2_MIN_LEN == 2)
if (m_len == 2)
{
/* don't code a match of len 2 if we have to
code a literal run. Code a literal instead. */
m_len = 0;
}
#endif
#if (M2_MIN_LEN == M3_MIN_LEN)
if (m_len == M2_MIN_LEN && m_off > M2_MAX_OFFSET)
{
/* don't code a M3 match of len 3 if we have to
code a literal run. Code a literal instead. */
m_len = 0;
}
#endif
}
else
{
/* no current literal run: only try a lazy match,
if the literal could be coded into a r1 or m3 match */
if (c->r1_m_len == M2_MIN_LEN || op == c->m3)
lazy_match_min_gain = 0;
else
lazy_match_min_gain = -1;
}
}
/* try a lazy match */
if (m_len == 0)
lazy_match_min_gain = -1;
if (lazy_match_min_gain >= 0 && c->look > m_len)
{
assert(m_len > 0);
r = find_match(c,swd,1,0);
assert(r == 0);
assert(c->look > 0);
if (m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET &&
c->m_off > M2_MAX_OFFSET)
lazy_match_min_gain += 1;
if (c->m_len >= m_len + lazy_match_min_gain)
{
c->lazy++;
#if !defined(NDEBUG)
m_len = c->m_len;
m_off = c->m_off;
assert(lzo_memcmp(c->ip - c->look, c->ip - c->look - m_off,
m_len) == 0);
#endif
lit++;
assert(ii + lit == c->ip - c->look);
continue;
}
else
{
ahead = 1;
assert(ii + lit + 1 == c->ip - c->look);
}
assert(m_len > 0);
}
assert(ii + lit + ahead == c->ip - c->look);
if (m_len == 0)
{
/* a literal */
lit++;
r = find_match(c,swd,1,0);
assert(r == 0);
}
else
{
/* 1 - store run */
if (lit > 0)
{
/* code current literal run */
if (lit == 1 && c->r1_m_len == M2_MIN_LEN)
{
/* Code a context sensitive R1 match. */
assert((op[-2] >> M2O_BITS) == (M2_MARKER >> M2O_BITS));
op[-2] &= M2O_MASK;
assert((op[-2] >> M2O_BITS) == 0);
/* copy 1 literal */
*op++ = *ii++;
assert(ii + ahead == c->ip - c->look);
c->r1_r++;
}
else if (lit < 4 && op == c->m3)
{
assert((c->m3[-2] >> M3O_BITS) == 0);
c->m3[-2] |= LZO_BYTE(lit << M3O_BITS);
MEMCPY_DS(op, ii, lit);
assert(ii + ahead == c->ip - c->look);
c->m3_r++;
}
else
{
op = STORE_RUN(op,ii,lit);
}
if (lit < R0FAST)
c->r1_m_len = m_len;
else
c->r1_m_len = 0;
lit = 0;
}
else
c->r1_m_len = 0;
/* 2 - code match */
op = code_match(c,op,m_len,m_off);
r = find_match(c,swd,m_len,1+ahead);
assert(r == 0);
}
c->codesize = op - out;
}
/* store final run */
if (lit > 0)
op = STORE_RUN(op,ii,lit);
#if defined(LZO_EOF_CODE)
*op++ = M3_MARKER | 1;
*op++ = 0;
*op++ = 0;
#endif
c->codesize = op - out;
assert(c->textsize == in_len);
*out_len = op - out;
if (c->cb)
(*c->cb)(c->textsize,c->codesize);
#if 0
printf("%ld %ld -> %ld: %ld %ld %ld %ld %ld\n",
(long) c->textsize, (long)in_len, (long) c->codesize,
c->r1_r, c->m3_r, c->m2_m, c->m3_m, c->lazy);
#endif
return LZO_E_OK;
}
/***********************************************************************
//
************************************************************************/
LZO_PUBLIC(int)
lzo1c_999_compress ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem )
{
return lzo1c_999_compress_callback(in,in_len,out,out_len,wrkmem,
(lzo_progress_callback_t) 0, 0);
}
#endif /* !defined(LZO_999_UNSUPPORTED) */
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo1c_cc.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
|
/* lzo1c_cc.c -- LZO1C compression internal entry point
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#define LZO_NEED_DICT_H
#include "config1c.h"
/***********************************************************************
// compression internal entry point.
************************************************************************/
int _lzo1c_do_compress ( const lzo_byte *in, lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem,
lzo_compress_t func )
{
int r;
#if defined(LZO_TEST_COMPRESS_OVERRUN)
lzo_uint avail_out = *out_len;
#endif
#if defined(LZO_COLLECT_STATS)
_lzo1c_stats_init(lzo_stats);
lzo_stats->in_len = in_len;
#endif
/* don't try to compress a block that's too short */
if (in_len <= 0)
{
*out_len = 0;
r = LZO_E_OK;
}
else if (in_len <= MIN_LOOKAHEAD + 1)
{
#if defined(LZO_RETURN_IF_NOT_COMPRESSIBLE)
*out_len = 0;
r = LZO_E_NOT_COMPRESSIBLE;
#else
*out_len = STORE_RUN(out,in,in_len) - out;
r = (*out_len > in_len) ? LZO_E_OK : LZO_E_ERROR;
#endif
}
else
r = func(in,in_len,out,out_len,wrkmem);
#if defined(LZO_EOF_CODE)
#if defined(LZO_TEST_COMPRESS_OVERRUN)
if (r == LZO_E_OK && avail_out - *out_len < 3)
r = LZO_E_COMPRESS_OVERRUN;
#endif
if (r == LZO_E_OK)
{
lzo_byte *op = out + *out_len;
*op++ = M3_MARKER | 1;
*op++ = 0;
*op++ = 0;
*out_len += 3;
}
#endif
#if defined(LZO_COLLECT_STATS)
lzo_stats->out_len = *out_len;
lzo_stats->match_bytes =
1 * lzo_stats->m1_matches + 2 * lzo_stats->m2_matches +
3 * lzo_stats->m3_matches + 4 * lzo_stats->m4_matches;
_lzo1c_stats_calc(lzo_stats);
#endif
return r;
}
/***********************************************************************
// note: this is not thread safe, but as it is used for finetuning only
// we don't care
************************************************************************/
#undef lzo_stats
/* lzo_stats_t is still defined */
#if defined(LZO_COLLECT_STATS)
static lzo_stats_t lzo_statistics;
lzo_stats_t * const lzo1c_stats = &lzo_statistics;
void _lzo1c_stats_init(lzo_stats_t *lzo_stats)
{
memset(lzo_stats,0,sizeof(*lzo_stats));
}
void _lzo1c_stats_calc(lzo_stats_t *lzo_stats)
{
lzo_stats->matches =
lzo_stats->m1_matches + lzo_stats->m2_matches +
lzo_stats->m3_matches + lzo_stats->m4_matches;
lzo_stats->literal_overhead = lzo_stats->lit_runs +
2 * (lzo_stats->r0short_runs + lzo_stats->r0fast_runs +
lzo_stats->r0long_runs);
lzo_stats->literal_bytes = lzo_stats->literals +
lzo_stats->literal_overhead;
#if 0
assert(lzo_stats->match_bytes + lzo_stats->literal_bytes ==
lzo_stats->out_len);
#endif
lzo_stats->m2_matches -= lzo_stats->r1_matches;
lzo_stats->m2_match[M2_MIN_LEN] -= lzo_stats->r1_matches;
if (lzo_stats->literals > 0)
lzo_stats->literal_overhead_percent =
100.0 * lzo_stats->literal_overhead / lzo_stats->literals;
}
#endif
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo1c_cc.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
/* lzo1c_cc.h -- definitions for the the LZO1C compression driver
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the library and is subject
to change.
*/
#ifndef __LZO1C_CC_H
#define __LZO1C_CC_H
/***********************************************************************
//
************************************************************************/
extern const lzo_compress_t _lzo1c_1_compress_func;
extern const lzo_compress_t _lzo1c_2_compress_func;
extern const lzo_compress_t _lzo1c_3_compress_func;
extern const lzo_compress_t _lzo1c_4_compress_func;
extern const lzo_compress_t _lzo1c_5_compress_func;
extern const lzo_compress_t _lzo1c_6_compress_func;
extern const lzo_compress_t _lzo1c_7_compress_func;
extern const lzo_compress_t _lzo1c_8_compress_func;
extern const lzo_compress_t _lzo1c_9_compress_func;
extern const lzo_compress_t _lzo1c_99_compress_func;
/***********************************************************************
//
************************************************************************/
LZO_EXTERN(lzo_byte *)
_lzo1c_store_run ( lzo_byte * const oo, const lzo_byte * const ii,
lzo_uint r_len);
#define STORE_RUN _lzo1c_store_run
lzo_compress_t _lzo1c_get_compress_func(int clevel);
int _lzo1c_do_compress ( const lzo_byte *in, lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem,
lzo_compress_t func );
#endif /* already included */
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo1c_d1.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/* lzo1c_d1.c -- LZO1C decompression
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include "config1c.h"
#undef LZO_TEST_DECOMPRESS_OVERRUN
#define DO_DECOMPRESS lzo1c_decompress
#include "lzo1b_d.ch"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1c_d2.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/* lzo1c_d2.c -- LZO1C decompression with overrun testing
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include "config1c.h"
#define LZO_TEST_DECOMPRESS_OVERRUN
#define DO_DECOMPRESS lzo1c_decompress_safe
#include "lzo1b_d.ch"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1c_rr.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
/* lzo1c_rr.c -- literal run handling
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include "config1c.h"
#include "lzo1b_r.ch"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1c_xx.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
/* lzo1c_xx.c -- LZO1C compression public entry point
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include "config1c.h"
/***********************************************************************
//
************************************************************************/
static const lzo_compress_t * const c_funcs [9] =
{
&_lzo1c_1_compress_func,
&_lzo1c_2_compress_func,
&_lzo1c_3_compress_func,
&_lzo1c_4_compress_func,
&_lzo1c_5_compress_func,
&_lzo1c_6_compress_func,
&_lzo1c_7_compress_func,
&_lzo1c_8_compress_func,
&_lzo1c_9_compress_func
};
lzo_compress_t _lzo1c_get_compress_func(int clevel)
{
const lzo_compress_t *f;
if (clevel < LZO1C_BEST_SPEED || clevel > LZO1C_BEST_COMPRESSION)
{
if (clevel == LZO1C_DEFAULT_COMPRESSION)
clevel = LZO1C_BEST_SPEED;
else
return 0;
}
f = c_funcs[clevel-1];
assert(f && *f);
return *f;
}
LZO_PUBLIC(int)
lzo1c_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem,
int clevel )
{
lzo_compress_t f;
f = _lzo1c_get_compress_func(clevel);
if (!f)
return LZO_E_ERROR;
return _lzo1c_do_compress(src,src_len,dst,dst_len,wrkmem,f);
}
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo1f_1.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
|
/* lzo1f_1.c -- implementation of the LZO1F-1 compression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include <lzo1f.h>
#include "lzo_conf.h"
/***********************************************************************
//
************************************************************************/
#define M2_MAX_OFFSET 0x0800
#define M3_MAX_OFFSET 0x3fff
#define M3_MARKER 224
#ifndef LZO_HASH
#define LZO_HASH LZO_HASH_LZO_INCREMENTAL_A
#endif
#define D_BITS 14
#define D_INDEX1(d,p) d = DM((0x21*DX3(p,5,5,6)) >> 5)
#define D_INDEX2(d,p) d = (d & (D_MASK & 0x7ff)) ^ (D_HIGH | 0x1f)
#include "lzo_dict.h"
/***********************************************************************
// compress a block of data.
************************************************************************/
static
int do_compress ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem )
{
#if 0 && defined(__GNUC__) && defined(__i386__)
register const lzo_byte *ip __asm__("%esi");
#else
register const lzo_byte *ip;
#endif
lzo_byte *op;
const lzo_byte * const in_end = in + in_len;
const lzo_byte * const ip_end = in + in_len - 9;
const lzo_byte *ii;
lzo_dict_p const dict = (lzo_dict_p) wrkmem;
op = out;
ip = in;
ii = ip;
ip++;
for (;;)
{
#if 0 && defined(__GNUC__) && defined(__i386__)
register const lzo_byte *m_pos __asm__("%edi");
#else
register const lzo_byte *m_pos;
#endif
lzo_moff_t m_off;
lzo_uint m_len;
lzo_uint dindex;
lzo_uint lit;
DINDEX1(dindex,ip);
GINDEX(m_pos,m_off,dict,dindex,in);
if (LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,M3_MAX_OFFSET))
goto literal;
#if 1
if (m_off <= M2_MAX_OFFSET || m_pos[3] == ip[3])
goto try_match;
DINDEX2(dindex,ip);
#endif
GINDEX(m_pos,m_off,dict,dindex,in);
if (LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,M3_MAX_OFFSET))
goto literal;
if (m_off <= M2_MAX_OFFSET || m_pos[3] == ip[3])
goto try_match;
goto literal;
try_match:
#if 0 && defined(LZO_UNALIGNED_OK_2)
if (* (const lzo_ushortp) m_pos != * (const lzo_ushortp) ip)
#else
if (m_pos[0] != ip[0] || m_pos[1] != ip[1])
#endif
{
}
else
{
if (m_pos[2] == ip[2])
{
m_pos += 3;
#if 0
if (m_off <= M2_MAX_OFFSET)
goto match;
if (lit <= 3)
goto match;
if (lit == 3) /* better compression, but slower */
{
assert(op - 2 > out); op[-2] |= LZO_BYTE(3);
*op++ = *ii++; *op++ = *ii++; *op++ = *ii++;
goto code_match;
}
if (*m_pos == ip[3])
#endif
goto match;
}
}
/* a literal */
literal:
UPDATE_I(dict,0,dindex,ip,in);
if (++ip >= ip_end)
break;
continue;
/* a match */
match:
UPDATE_I(dict,0,dindex,ip,in);
/* store current literal run */
lit = pd(ip,ii);
if (lit > 0)
{
register lzo_uint t = lit;
if (t < 4 && op > out)
op[-2] |= LZO_BYTE(t);
else if (t <= 31)
*op++ = LZO_BYTE(t);
else
{
register lzo_uint tt = t - 31;
*op++ = 0;
while (tt > 255)
{
tt -= 255;
*op++ = 0;
}
assert(tt > 0);
*op++ = LZO_BYTE(tt);
}
do *op++ = *ii++; while (--t > 0);
}
assert(ii == ip);
/* code the match */
ip += 3;
if (*m_pos++ != *ip++ || *m_pos++ != *ip++ || *m_pos++ != *ip++ ||
*m_pos++ != *ip++ || *m_pos++ != *ip++ || *m_pos++ != *ip++)
{
--ip;
m_len = ip - ii;
assert(m_len >= 3); assert(m_len <= 8);
if (m_off <= M2_MAX_OFFSET)
{
m_off -= 1;
*op++ = LZO_BYTE(((m_len - 2) << 5) | ((m_off & 7) << 2));
*op++ = LZO_BYTE(m_off >> 3);
}
else if (m_len == 3 && m_off <= 2*M2_MAX_OFFSET && lit > 0)
{
m_off -= 1;
/* m_off -= M2_MAX_OFFSET; */
*op++ = LZO_BYTE(((m_off & 7) << 2));
*op++ = LZO_BYTE(m_off >> 3);
}
else
{
*op++ = LZO_BYTE(M3_MARKER | (m_len - 2));
*op++ = LZO_BYTE((m_off & 63) << 2);
*op++ = LZO_BYTE(m_off >> 6);
}
}
else
{
{
const lzo_byte *end;
end = in_end;
while (ip < end && *m_pos == *ip)
m_pos++, ip++;
m_len = (ip - ii);
}
assert(m_len >= 3);
if (m_len <= 33)
*op++ = LZO_BYTE(M3_MARKER | (m_len - 2));
else
{
m_len -= 33;
*op++ = M3_MARKER | 0;
while (m_len > 255)
{
m_len -= 255;
*op++ = 0;
}
assert(m_len > 0);
*op++ = LZO_BYTE(m_len);
}
*op++ = LZO_BYTE((m_off & 63) << 2);
*op++ = LZO_BYTE(m_off >> 6);
}
ii = ip;
if (ip >= ip_end)
break;
}
/* store final literal run */
if (pd(in_end,ii) > 0)
{
register lzo_uint t = pd(in_end,ii);
if (t < 4 && op > out)
op[-2] |= LZO_BYTE(t);
else if (t <= 31)
*op++ = LZO_BYTE(t);
else
{
register lzo_uint tt = t - 31;
*op++ = 0;
while (tt > 255)
{
tt -= 255;
*op++ = 0;
}
assert(tt > 0);
*op++ = LZO_BYTE(tt);
}
do *op++ = *ii++; while (--t > 0);
}
*out_len = op - out;
return LZO_E_OK;
}
/***********************************************************************
// public entry point
************************************************************************/
LZO_PUBLIC(int)
lzo1f_1_compress ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem )
{
lzo_byte *op = out;
int r = LZO_E_OK;
#if defined(__LZO_QUERY_COMPRESS)
if (__LZO_IS_COMPRESS_QUERY(in,in_len,out,out_len,wrkmem))
return __LZO_QUERY_COMPRESS(in,in_len,out,out_len,wrkmem,D_SIZE,lzo_sizeof(lzo_dict_t));
#endif
if (in_len <= 0)
*out_len = 0;
else if (in_len <= 10)
{
*op++ = LZO_BYTE(in_len);
do *op++ = *in++; while (--in_len > 0);
*out_len = op - out;
}
else
r = do_compress(in,in_len,out,out_len,wrkmem);
if (r == LZO_E_OK)
{
op = out + *out_len;
*op++ = M3_MARKER | 1;
*op++ = 0;
*op++ = 0;
*out_len += 3;
}
return r;
}
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo1f_9x.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
|
/* lzo1f_9x.c -- implementation of the LZO1F-999 compression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include <lzoconf.h>
#if !defined(LZO_999_UNSUPPORTED)
#include <stdio.h>
#include "config1f.h"
#if 0
#undef NDEBUG
#include <assert.h>
#endif
/***********************************************************************
//
************************************************************************/
#define N 16383 /* size of ring buffer */
#define THRESHOLD 2 /* lower limit for match length */
#define F 2048 /* upper limit for match length */
#define LZO1F
#define LZO_COMPRESS_T lzo1f_999_t
#define lzo_swd_t lzo1f_999_swd_t
#include "lzo_mchw.ch"
/***********************************************************************
//
************************************************************************/
static lzo_byte *
code_match ( LZO_COMPRESS_T *c, lzo_byte *op, lzo_uint m_len, lzo_uint m_off )
{
if (m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET)
{
m_off -= 1;
*op++ = LZO_BYTE(((m_len - 2) << 5) | ((m_off & 7) << 2));
*op++ = LZO_BYTE(m_off >> 3);
c->m2_m++;
}
else if (m_len == M2_MIN_LEN && m_off <= 2 * M2_MAX_OFFSET &&
c->r1_lit > 0)
{
assert(m_off > M2_MAX_OFFSET);
m_off -= 1 + M2_MAX_OFFSET;
*op++ = LZO_BYTE(((m_off & 7) << 2));
*op++ = LZO_BYTE(m_off >> 3);
c->r1_r++;
}
else
{
if (m_len <= M3_MAX_LEN)
*op++ = LZO_BYTE(M3_MARKER | (m_len - 2));
else
{
m_len -= M3_MAX_LEN;
*op++ = M3_MARKER | 0;
while (m_len > 255)
{
m_len -= 255;
*op++ = 0;
}
assert(m_len > 0);
*op++ = LZO_BYTE(m_len);
}
*op++ = LZO_BYTE((m_off & 63) << 2);
*op++ = LZO_BYTE(m_off >> 6);
c->m3_m++;
}
return op;
}
static lzo_byte *
STORE_RUN ( lzo_byte *op, const lzo_byte *ii, lzo_uint t, lzo_byte *out )
{
if (t < 4 && op > out)
op[-2] |= LZO_BYTE(t);
else if (t <= 31)
*op++ = LZO_BYTE(t);
else
{
lzo_uint tt = t - 31;
*op++ = 0;
while (tt > 255)
{
tt -= 255;
*op++ = 0;
}
assert(tt > 0);
*op++ = LZO_BYTE(tt);
}
do *op++ = *ii++; while (--t > 0);
return op;
}
/***********************************************************************
// this is a public function, but there is no prototype in a header file
************************************************************************/
LZO_EXTERN(int)
lzo1f_999_compress_callback ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem,
lzo_progress_callback_t cb,
lzo_uint max_chain );
LZO_PUBLIC(int)
lzo1f_999_compress_callback ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem,
lzo_progress_callback_t cb,
lzo_uint max_chain )
{
lzo_byte *op;
const lzo_byte *ii;
lzo_uint lit;
lzo_uint m_len, m_off;
LZO_COMPRESS_T cc;
LZO_COMPRESS_T * const c = &cc;
lzo_swd_t * const swd = (lzo_swd_t *) wrkmem;
int r;
#if defined(__LZO_QUERY_COMPRESS)
if (__LZO_IS_COMPRESS_QUERY(in,in_len,out,out_len,wrkmem))
return __LZO_QUERY_COMPRESS(in,in_len,out,out_len,wrkmem,1,lzo_sizeof(lzo_swd_t));
#endif
/* sanity check */
if (!lzo_assert(LZO1F_999_MEM_COMPRESS >= lzo_sizeof(lzo_swd_t)))
return LZO_E_ERROR;
c->init = 0;
c->ip = c->in = in;
c->in_end = in + in_len;
c->cb = cb;
c->r1_r = c->m2_m = c->m3_m = 0;
op = out;
ii = c->ip; /* point to start of literal run */
lit = 0;
c->r1_lit = c->r1_m_len = 0;
r = init_match(c,swd,NULL,0,0);
if (r != 0)
return r;
if (max_chain > 0)
swd->max_chain = max_chain;
r = find_match(c,swd,0,0);
if (r != 0)
return r;
while (c->look > 0)
{
int lazy_match_min_gain = -1;
lzo_uint ahead = 0;
m_len = c->m_len;
m_off = c->m_off;
assert(c->ip - c->look >= in);
if (lit == 0)
ii = c->ip - c->look;
assert(ii + lit == c->ip - c->look);
assert(swd->b_char == *(c->ip - c->look));
if ((m_len < M2_MIN_LEN) ||
(m_len < M3_MIN_LEN && m_off > M2_MAX_OFFSET))
{
m_len = 0;
}
else
{
assert(c->ip - c->look - m_off >= in);
assert(c->ip - c->look - m_off + m_len < c->ip);
assert(lzo_memcmp(c->ip - c->look, c->ip - c->look - m_off,
m_len) == 0);
if (lit < 3)
lazy_match_min_gain = 1;
else if (lit == 3)
lazy_match_min_gain = 3;
else if (lit == 31)
lazy_match_min_gain = 3;
else
lazy_match_min_gain = 1;
}
/* try a lazy match */
if (m_len > 0 && lazy_match_min_gain >= 0 && c->look > m_len)
{
r = find_match(c,swd,1,0);
assert(r == 0);
assert(c->look > 0);
if (m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET &&
c->m_off > M2_MAX_OFFSET)
{
lazy_match_min_gain += 1;
}
else if (c->m_len <= M2_MAX_LEN &&
c->m_off <= M2_MAX_OFFSET &&
m_off > M2_MAX_OFFSET)
{
if (lazy_match_min_gain > 0)
lazy_match_min_gain -= 1;
}
else if (m_len == M2_MIN_LEN && c->m_len == M2_MIN_LEN &&
c->m_off <= 2 * M2_MAX_OFFSET &&
m_off > M2_MAX_OFFSET)
{
if (lazy_match_min_gain > 0)
lazy_match_min_gain -= 1;
}
if (c->m_len >= m_len + lazy_match_min_gain)
{
c->lazy++;
#if !defined(NDEBUG)
m_len = c->m_len;
m_off = c->m_off;
assert(lzo_memcmp(c->ip - c->look, c->ip - c->look - m_off,
m_len) == 0);
#endif
lit++;
assert(ii + lit == c->ip - c->look);
continue;
}
else
{
ahead = 1;
assert(ii + lit + 1 == c->ip - c->look);
}
assert(m_len > 0);
}
assert(ii + lit + ahead == c->ip - c->look);
if (m_len == 0)
{
/* a literal */
lit++;
r = find_match(c,swd,1,0);
assert(r == 0);
}
else
{
/* 1 - store run */
if (lit > 0)
{
op = STORE_RUN(op,ii,lit,out);
c->r1_m_len = m_len;
c->r1_lit = lit;
lit = 0;
}
else
c->r1_lit = c->r1_m_len = 0;
/* 2 - code match */
op = code_match(c,op,m_len,m_off);
r = find_match(c,swd,m_len,1+ahead);
assert(r == 0);
}
c->codesize = op - out;
}
/* store final run */
if (lit > 0)
op = STORE_RUN(op,ii,lit,out);
#if defined(LZO_EOF_CODE)
*op++ = M3_MARKER | 1;
*op++ = 0;
*op++ = 0;
#endif
c->codesize = op - out;
assert(c->textsize == in_len);
*out_len = op - out;
if (c->cb)
(*c->cb)(c->textsize,c->codesize);
#if 0
printf("%ld %ld -> %ld: %ld %ld %ld %ld\n",
(long) c->textsize, (long)in_len, (long) c->codesize,
c->r1_r, c->m2_m, c->m3_m, c->lazy);
#endif
return LZO_E_OK;
}
/***********************************************************************
//
************************************************************************/
LZO_PUBLIC(int)
lzo1f_999_compress ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem )
{
return lzo1f_999_compress_callback(in,in_len,out,out_len,wrkmem,
(lzo_progress_callback_t) 0, 0);
}
#endif /* !defined(LZO_999_UNSUPPORTED) */
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo1f_d.ch.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
|
/* lzo1f_d.ch -- implementation of the LZO1F decompression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include "lzo1_d.ch"
/***********************************************************************
// decompress a block of data.
************************************************************************/
LZO_PUBLIC(int)
DO_DECOMPRESS ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem )
{
register lzo_byte *op;
register const lzo_byte *ip;
register lzo_uint t;
register const lzo_byte *m_pos;
const lzo_byte * const ip_end = in + in_len;
#if defined(HAVE_ANY_OP)
lzo_byte * const op_end = out + *out_len;
#endif
LZO_UNUSED(wrkmem);
#if defined(__LZO_QUERY_DECOMPRESS)
if (__LZO_IS_DECOMPRESS_QUERY(in,in_len,out,out_len,wrkmem))
return __LZO_QUERY_DECOMPRESS(in,in_len,out,out_len,wrkmem,0,0);
#endif
*out_len = 0;
op = out;
ip = in;
while (TEST_IP && TEST_OP)
{
t = *ip++;
if (t > 31)
goto match;
/* a literal run */
if (t == 0)
{
NEED_IP(1);
while (*ip == 0)
{
t += 255;
ip++;
NEED_IP(1);
}
t += 31 + *ip++;
}
/* copy literals */
assert(t > 0); NEED_OP(t); NEED_IP(t+1);
#if defined(LZO_UNALIGNED_OK_4)
if (t >= 4)
{
do {
* (lzo_uint32p) op = * (const lzo_uint32p) ip;
op += 4; ip += 4; t -= 4;
} while (t >= 4);
if (t > 0) do *op++ = *ip++; while (--t > 0);
}
else
#endif
do *op++ = *ip++; while (--t > 0);
t = *ip++;
while (TEST_IP && TEST_OP)
{
/* handle matches */
if (t < 32)
{
m_pos = op - 1 - 0x800;
m_pos -= (t >> 2) & 7;
m_pos -= *ip++ << 3;
TEST_LOOKBEHIND(m_pos,out); NEED_OP(3);
*op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos++;
}
else
{
match:
if (t < M3_MARKER)
{
m_pos = op - 1;
m_pos -= (t >> 2) & 7;
m_pos -= *ip++ << 3;
t >>= 5;
TEST_LOOKBEHIND(m_pos,out); assert(t > 0); NEED_OP(t+3-1);
goto copy_match;
}
else
{
t &= 31;
if (t == 0)
{
NEED_IP(1);
while (*ip == 0)
{
t += 255;
ip++;
NEED_IP(1);
}
t += 31 + *ip++;
}
NEED_IP(2);
m_pos = op;
#if defined(LZO_UNALIGNED_OK_2) && (LZO_BYTE_ORDER == LZO_LITTLE_ENDIAN)
m_pos -= (* (const lzo_ushortp) ip) >> 2;
ip += 2;
#else
m_pos -= *ip++ >> 2;
m_pos -= *ip++ << 6;
#endif
if (m_pos == op)
goto eof_found;
}
/* copy match */
TEST_LOOKBEHIND(m_pos,out); assert(t > 0); NEED_OP(t+3-1);
#if defined(LZO_UNALIGNED_OK_4)
if (t >= 2 * 4 - (3 - 1) && (op - m_pos) >= 4)
{
* (lzo_uint32p) op = * (const lzo_uint32p) m_pos;
op += 4; m_pos += 4; t -= 4 - (3 - 1);
do {
* (lzo_uint32p) op = * (const lzo_uint32p) m_pos;
op += 4; m_pos += 4; t -= 4;
} while (t >= 4);
if (t > 0) do *op++ = *m_pos++; while (--t > 0);
}
else
#endif
{
copy_match:
*op++ = *m_pos++; *op++ = *m_pos++;
do *op++ = *m_pos++; while (--t > 0);
}
}
t = ip[-2] & 3;
if (t == 0)
break;
/* copy literals */
assert(t > 0); NEED_OP(t); NEED_IP(t+1);
do *op++ = *ip++; while (--t > 0);
t = *ip++;
}
}
#if defined(HAVE_TEST_IP) || defined(HAVE_TEST_OP)
/* no EOF code was found */
*out_len = op - out;
return LZO_E_EOF_NOT_FOUND;
#endif
eof_found:
assert(t == 1);
*out_len = op - out;
return (ip == ip_end ? LZO_E_OK :
(ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN));
#if defined(HAVE_NEED_IP)
input_overrun:
*out_len = op - out;
return LZO_E_INPUT_OVERRUN;
#endif
#if defined(HAVE_NEED_OP)
output_overrun:
*out_len = op - out;
return LZO_E_OUTPUT_OVERRUN;
#endif
#if defined(LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND)
lookbehind_overrun:
*out_len = op - out;
return LZO_E_LOOKBEHIND_OVERRUN;
#endif
}
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo1f_d1.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/* lzo1f_d1.c -- LZO1F decompression
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include "config1f.h"
#undef LZO_TEST_DECOMPRESS_OVERRUN
#define DO_DECOMPRESS lzo1f_decompress
#include "lzo1f_d.ch"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1f_d2.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/* lzo1f_d2.c -- LZO1F decompression with overrun testing
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include "config1f.h"
#define LZO_TEST_DECOMPRESS_OVERRUN
#define DO_DECOMPRESS lzo1f_decompress_safe
#include "lzo1f_d.ch"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1x_1.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
/* lzo1x_1.c -- LZO1X-1 compression
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#define LZO_NEED_DICT_H
#define D_BITS 14
#define D_INDEX1(d,p) d = DM((0x21*DX3(p,5,5,6)) >> 5)
#define D_INDEX2(d,p) d = (d & (D_MASK & 0x7ff)) ^ (D_HIGH | 0x1f)
#include "config1x.h"
#define DO_COMPRESS lzo1x_1_compress
#include "lzo1x_c.ch"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1x_1k.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
/* lzo1x_1k.c -- LZO1X-1(11) compression (needs only 8kB work memory)
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#define LZO_NEED_DICT_H
#define D_BITS 11
#define D_INDEX1(d,p) d = DM((0x21*DX2(p,3,5)) >> 5)
#define D_INDEX2(d,p) d = d ^ D_MASK
#include "config1x.h"
#define DO_COMPRESS lzo1x_1_11_compress
#include "lzo1x_c.ch"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1x_1l.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
/* lzo1x_1l.c -- LZO1X-1(12) compression
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#define LZO_NEED_DICT_H
#define D_BITS 12
#define D_INDEX1(d,p) d = DM((0x21*DX2(p,4,5)) >> 5)
#define D_INDEX2(d,p) d = d ^ D_MASK
#include "config1x.h"
#define DO_COMPRESS lzo1x_1_12_compress
#include "lzo1x_c.ch"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1x_1o.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
/* lzo1x_1o.c -- LZO1X-1(15) compression
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#define LZO_NEED_DICT_H
#define D_BITS 15
#define D_INDEX1(d,p) d = DM((0x21*DX3(p,5,5,6)) >> 5)
#define D_INDEX2(d,p) d = (d & (D_MASK & 0x7ff)) ^ (D_HIGH | 0x1f)
#include "config1x.h"
#define DO_COMPRESS lzo1x_1_15_compress
#include "lzo1x_c.ch"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1x_9x.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
|
/* lzo1x_9x.c -- implementation of the LZO1X-999 compression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include <lzoconf.h>
#if !defined(LZO_999_UNSUPPORTED)
#if !defined(LZO1X) && !defined(LZO1Y) && !defined(LZO1Z)
# define LZO1X
#endif
#if 0
#undef LZO_DEBUG
#define LZO_DEBUG
#endif
#include <stdio.h>
#if defined(LZO1X)
# include "config1x.h"
#elif defined(LZO1Y)
# include "config1y.h"
#elif defined(LZO1Z)
# include "config1z.h"
#endif
#if 0 && !defined(LZO_DEBUG)
#undef NDEBUG
#include <assert.h>
#endif
/***********************************************************************
//
************************************************************************/
#define N M4_MAX_OFFSET /* size of ring buffer */
#define THRESHOLD 1 /* lower limit for match length */
#define F 2048 /* upper limit for match length */
#define SWD_BEST_OFF (LZO_MAX3( M2_MAX_LEN, M3_MAX_LEN, M4_MAX_LEN ) + 1)
#if defined(LZO1X)
# define LZO_COMPRESS_T lzo1x_999_t
# define lzo_swd_t lzo1x_999_swd_t
#elif defined(LZO1Y)
# define LZO_COMPRESS_T lzo1y_999_t
# define lzo_swd_t lzo1y_999_swd_t
# define lzo1x_999_compress_internal lzo1y_999_compress_internal
# define lzo1x_999_compress_dict lzo1y_999_compress_dict
# define lzo1x_999_compress_level lzo1y_999_compress_level
# define lzo1x_999_compress lzo1y_999_compress
#elif defined(LZO1Z)
# define LZO_COMPRESS_T lzo1z_999_t
# define lzo_swd_t lzo1z_999_swd_t
# define lzo1x_999_compress_internal lzo1z_999_compress_internal
# define lzo1x_999_compress_dict lzo1z_999_compress_dict
# define lzo1x_999_compress_level lzo1z_999_compress_level
# define lzo1x_999_compress lzo1z_999_compress
#endif
#if 0
# define HEAD3(b,p) \
((((((lzo_uint32)b[p]<<3)^b[p+1])<<3)^b[p+2]) & (SWD_HSIZE-1))
#endif
#if 0 && defined(LZO_UNALIGNED_OK_4) && (LZO_BYTE_ORDER == LZO_LITTLE_ENDIAN)
# define HEAD3(b,p) \
(((* (lzo_uint32p) &b[p]) ^ ((* (lzo_uint32p) &b[p])>>10)) & (SWD_HSIZE-1))
#endif
#include "lzo_mchw.ch"
/* this is a public functions, but there is no prototype in a header file */
LZO_EXTERN(int)
lzo1x_999_compress_internal ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem,
const lzo_byte *dict, lzo_uint dict_len,
lzo_progress_callback_t cb,
int try_lazy,
lzo_uint good_length,
lzo_uint max_lazy,
lzo_uint nice_length,
lzo_uint max_chain,
lzo_uint32 flags );
/***********************************************************************
//
************************************************************************/
static lzo_byte *
code_match ( LZO_COMPRESS_T *c, lzo_byte *op, lzo_uint m_len, lzo_uint m_off )
{
lzo_uint x_len = m_len;
lzo_uint x_off = m_off;
c->match_bytes += m_len;
#if 0
/*
static lzo_uint last_m_len = 0, last_m_off = 0;
static lzo_uint prev_m_off[4];
static int prev_m_off_ptr = 0;
int i;
//if (m_len >= 3 && m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET)
if (m_len >= 3 && m_len <= M2_MAX_LEN)
{
//if (m_len == last_m_len && m_off == last_m_off)
//printf("last_m_len + last_m_off\n");
//else
if (m_off == last_m_off)
printf("last_m_off\n");
else
{
for (i = 0; i < 4; i++)
if (m_off == prev_m_off[i])
printf("prev_m_off %d: %5ld\n",i,(long)m_off);
}
}
last_m_len = m_len;
last_m_off = prev_m_off[prev_m_off_ptr] = m_off;
prev_m_off_ptr = (prev_m_off_ptr + 1) & 3;
*/
#endif
assert(op > c->out);
if (m_len == 2)
{
assert(m_off <= M1_MAX_OFFSET);
assert(c->r1_lit > 0); assert(c->r1_lit < 4);
m_off -= 1;
#if defined(LZO1Z)
*op++ = LZO_BYTE(M1_MARKER | (m_off >> 6));
*op++ = LZO_BYTE(m_off << 2);
#else
*op++ = LZO_BYTE(M1_MARKER | ((m_off & 3) << 2));
*op++ = LZO_BYTE(m_off >> 2);
#endif
c->m1a_m++;
}
#if defined(LZO1Z)
else if (m_len <= M2_MAX_LEN && (m_off <= M2_MAX_OFFSET || m_off == c->last_m_off))
#else
else if (m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET)
#endif
{
assert(m_len >= 3);
#if defined(LZO1X)
m_off -= 1;
*op++ = LZO_BYTE(((m_len - 1) << 5) | ((m_off & 7) << 2));
*op++ = LZO_BYTE(m_off >> 3);
assert(op[-2] >= M2_MARKER);
#elif defined(LZO1Y)
m_off -= 1;
*op++ = LZO_BYTE(((m_len + 1) << 4) | ((m_off & 3) << 2));
*op++ = LZO_BYTE(m_off >> 2);
assert(op[-2] >= M2_MARKER);
#elif defined(LZO1Z)
if (m_off == c->last_m_off)
*op++ = LZO_BYTE(((m_len - 1) << 5) | (0x700 >> 6));
else
{
m_off -= 1;
*op++ = LZO_BYTE(((m_len - 1) << 5) | (m_off >> 6));
*op++ = LZO_BYTE(m_off << 2);
}
#endif
c->m2_m++;
}
else if (m_len == M2_MIN_LEN && m_off <= MX_MAX_OFFSET && c->r1_lit >= 4)
{
assert(m_len == 3);
assert(m_off > M2_MAX_OFFSET);
m_off -= 1 + M2_MAX_OFFSET;
#if defined(LZO1Z)
*op++ = LZO_BYTE(M1_MARKER | (m_off >> 6));
*op++ = LZO_BYTE(m_off << 2);
#else
*op++ = LZO_BYTE(M1_MARKER | ((m_off & 3) << 2));
*op++ = LZO_BYTE(m_off >> 2);
#endif
c->m1b_m++;
}
else if (m_off <= M3_MAX_OFFSET)
{
assert(m_len >= 3);
m_off -= 1;
if (m_len <= M3_MAX_LEN)
*op++ = LZO_BYTE(M3_MARKER | (m_len - 2));
else
{
m_len -= M3_MAX_LEN;
*op++ = M3_MARKER | 0;
while (m_len > 255)
{
m_len -= 255;
*op++ = 0;
}
assert(m_len > 0);
*op++ = LZO_BYTE(m_len);
}
#if defined(LZO1Z)
*op++ = LZO_BYTE(m_off >> 6);
*op++ = LZO_BYTE(m_off << 2);
#else
*op++ = LZO_BYTE(m_off << 2);
*op++ = LZO_BYTE(m_off >> 6);
#endif
c->m3_m++;
}
else
{
lzo_uint k;
assert(m_len >= 3);
assert(m_off > 0x4000); assert(m_off <= 0xbfff);
m_off -= 0x4000;
k = (m_off & 0x4000) >> 11;
if (m_len <= M4_MAX_LEN)
*op++ = LZO_BYTE(M4_MARKER | k | (m_len - 2));
else
{
m_len -= M4_MAX_LEN;
*op++ = LZO_BYTE(M4_MARKER | k | 0);
while (m_len > 255)
{
m_len -= 255;
*op++ = 0;
}
assert(m_len > 0);
*op++ = LZO_BYTE(m_len);
}
#if defined(LZO1Z)
*op++ = LZO_BYTE(m_off >> 6);
*op++ = LZO_BYTE(m_off << 2);
#else
*op++ = LZO_BYTE(m_off << 2);
*op++ = LZO_BYTE(m_off >> 6);
#endif
c->m4_m++;
}
c->last_m_len = x_len;
c->last_m_off = x_off;
return op;
}
static lzo_byte *
STORE_RUN ( LZO_COMPRESS_T *c, lzo_byte *op, const lzo_byte *ii, lzo_uint t )
{
c->lit_bytes += t;
if (op == c->out && t <= 238)
{
*op++ = LZO_BYTE(17 + t);
}
else if (t <= 3)
{
#if defined(LZO1Z)
op[-1] |= LZO_BYTE(t);
#else
op[-2] |= LZO_BYTE(t);
#endif
c->lit1_r++;
}
else if (t <= 18)
{
*op++ = LZO_BYTE(t - 3);
c->lit2_r++;
}
else
{
lzo_uint tt = t - 18;
*op++ = 0;
while (tt > 255)
{
tt -= 255;
*op++ = 0;
}
assert(tt > 0);
*op++ = LZO_BYTE(tt);
c->lit3_r++;
}
do *op++ = *ii++; while (--t > 0);
return op;
}
static lzo_byte *
code_run ( LZO_COMPRESS_T *c, lzo_byte *op, const lzo_byte *ii,
lzo_uint lit, lzo_uint m_len )
{
if (lit > 0)
{
assert(m_len >= 2);
op = STORE_RUN(c,op,ii,lit);
c->r1_m_len = m_len;
c->r1_lit = lit;
}
else
{
assert(m_len >= 3);
c->r1_m_len = 0;
c->r1_lit = 0;
}
return op;
}
/***********************************************************************
//
************************************************************************/
static int
len_of_coded_match ( lzo_uint m_len, lzo_uint m_off, lzo_uint lit )
{
int n = 4;
if (m_len < 2)
return -1;
if (m_len == 2)
return (m_off <= M1_MAX_OFFSET && lit > 0 && lit < 4) ? 2 : -1;
if (m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET)
return 2;
if (m_len == M2_MIN_LEN && m_off <= MX_MAX_OFFSET && lit >= 4)
return 2;
if (m_off <= M3_MAX_OFFSET)
{
if (m_len <= M3_MAX_LEN)
return 3;
m_len -= M3_MAX_LEN;
while (m_len > 255)
{
m_len -= 255;
n++;
}
return n;
}
if (m_off <= M4_MAX_OFFSET)
{
if (m_len <= M4_MAX_LEN)
return 3;
m_len -= M4_MAX_LEN;
while (m_len > 255)
{
m_len -= 255;
n++;
}
return n;
}
return -1;
}
static lzo_int
min_gain(lzo_uint ahead, lzo_uint lit1, lzo_uint lit2, int l1, int l2, int l3)
{
lzo_int lazy_match_min_gain = 0;
assert (ahead >= 1);
lazy_match_min_gain += ahead;
#if 0
if (l3 > 0)
lit2 -= ahead;
#endif
if (lit1 <= 3)
lazy_match_min_gain += (lit2 <= 3) ? 0 : 2;
else if (lit1 <= 18)
lazy_match_min_gain += (lit2 <= 18) ? 0 : 1;
lazy_match_min_gain += (l2 - l1) * 2;
if (l3 > 0)
lazy_match_min_gain -= (ahead - l3) * 2;
if (lazy_match_min_gain < 0)
lazy_match_min_gain = 0;
#if 0
if (l1 == 2)
if (lazy_match_min_gain == 0)
lazy_match_min_gain = 1;
#endif
return lazy_match_min_gain;
}
/***********************************************************************
//
************************************************************************/
#if !defined(NDEBUG)
static
void assert_match( const lzo_swd_t *swd, lzo_uint m_len, lzo_uint m_off )
{
const LZO_COMPRESS_T *c = swd->c;
lzo_uint d_off;
assert(m_len >= 2);
if (m_off <= (lzo_uint) (c->bp - c->in))
{
assert(c->bp - m_off + m_len < c->ip);
assert(lzo_memcmp(c->bp, c->bp - m_off, m_len) == 0);
}
else
{
assert(swd->dict != NULL);
d_off = m_off - (lzo_uint) (c->bp - c->in);
assert(d_off <= swd->dict_len);
if (m_len > d_off)
{
assert(lzo_memcmp(c->bp, swd->dict_end - d_off, d_off) == 0);
assert(c->in + m_len - d_off < c->ip);
assert(lzo_memcmp(c->bp + d_off, c->in, m_len - d_off) == 0);
}
else
{
assert(lzo_memcmp(c->bp, swd->dict_end - d_off, m_len) == 0);
}
}
}
#else
# define assert_match(a,b,c) ((void)0)
#endif
#if defined(SWD_BEST_OFF)
static void
better_match ( const lzo_swd_t *swd, lzo_uint *m_len, lzo_uint *m_off )
{
#if defined(LZO1Z)
const LZO_COMPRESS_T *c = swd->c;
#endif
if (*m_len <= M2_MIN_LEN)
return;
#if defined(LZO1Z)
if (*m_off == c->last_m_off && *m_len <= M2_MAX_LEN)
return;
#if 1
if (*m_len >= M2_MIN_LEN + 1 && *m_len <= M2_MAX_LEN + 1 &&
c->last_m_off && swd->best_off[*m_len-1] == c->last_m_off)
{
*m_len = *m_len - 1;
*m_off = swd->best_off[*m_len];
return;
}
#endif
#endif
if (*m_off <= M2_MAX_OFFSET)
return;
#if 1
/* M3/M4 -> M2 */
if (*m_off > M2_MAX_OFFSET &&
*m_len >= M2_MIN_LEN + 1 && *m_len <= M2_MAX_LEN + 1 &&
swd->best_off[*m_len-1] && swd->best_off[*m_len-1] <= M2_MAX_OFFSET)
{
*m_len = *m_len - 1;
*m_off = swd->best_off[*m_len];
return;
}
#endif
#if 1
/* M4 -> M2 */
if (*m_off > M3_MAX_OFFSET &&
*m_len >= M4_MAX_LEN + 1 && *m_len <= M2_MAX_LEN + 2 &&
swd->best_off[*m_len-2] && swd->best_off[*m_len-2] <= M2_MAX_OFFSET)
{
*m_len = *m_len - 2;
*m_off = swd->best_off[*m_len];
return;
}
#endif
#if 1
/* M4 -> M3 */
if (*m_off > M3_MAX_OFFSET &&
*m_len >= M4_MAX_LEN + 1 && *m_len <= M3_MAX_LEN + 1 &&
swd->best_off[*m_len-1] && swd->best_off[*m_len-1] <= M3_MAX_OFFSET)
{
*m_len = *m_len - 1;
*m_off = swd->best_off[*m_len];
}
#endif
}
#endif
/***********************************************************************
//
************************************************************************/
LZO_PUBLIC(int)
lzo1x_999_compress_internal ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem,
const lzo_byte *dict, lzo_uint dict_len,
lzo_progress_callback_t cb,
int try_lazy,
lzo_uint good_length,
lzo_uint max_lazy,
lzo_uint nice_length,
lzo_uint max_chain,
lzo_uint32 flags )
{
lzo_byte *op;
const lzo_byte *ii;
lzo_uint lit;
lzo_uint m_len, m_off;
LZO_COMPRESS_T cc;
LZO_COMPRESS_T * const c = &cc;
lzo_swd_t * const swd = (lzo_swd_t *) wrkmem;
int r;
#if defined(__LZO_QUERY_COMPRESS)
if (__LZO_IS_COMPRESS_QUERY(in,in_len,out,out_len,wrkmem))
return __LZO_QUERY_COMPRESS(in,in_len,out,out_len,wrkmem,1,lzo_sizeof(lzo_swd_t));
#endif
/* sanity check */
if (!lzo_assert(LZO1X_999_MEM_COMPRESS >= lzo_sizeof(lzo_swd_t)))
return LZO_E_ERROR;
/* setup parameter defaults */
/* number of lazy match tries */
if (try_lazy < 0)
try_lazy = 1;
/* reduce lazy match search if we already have a match with this length */
if (good_length <= 0)
good_length = 32;
/* do not try a lazy match if we already have a match with this length */
if (max_lazy <= 0)
max_lazy = 32;
/* stop searching for longer matches than this one */
if (nice_length <= 0)
nice_length = 0;
/* don't search more positions than this */
if (max_chain <= 0)
max_chain = SWD_MAX_CHAIN;
c->init = 0;
c->ip = c->in = in;
c->in_end = in + in_len;
c->out = out;
c->cb = cb;
c->m1a_m = c->m1b_m = c->m2_m = c->m3_m = c->m4_m = 0;
c->lit1_r = c->lit2_r = c->lit3_r = 0;
op = out;
ii = c->ip; /* point to start of literal run */
lit = 0;
c->r1_lit = c->r1_m_len = 0;
r = init_match(c,swd,dict,dict_len,flags);
if (r != 0)
return r;
if (max_chain > 0)
swd->max_chain = max_chain;
if (nice_length > 0)
swd->nice_length = nice_length;
r = find_match(c,swd,0,0);
if (r != 0)
return r;
while (c->look > 0)
{
lzo_uint ahead;
lzo_uint max_ahead;
int l1, l2, l3;
c->codesize = op - out;
m_len = c->m_len;
m_off = c->m_off;
assert(c->bp == c->ip - c->look);
assert(c->bp >= in);
if (lit == 0)
ii = c->bp;
assert(ii + lit == c->bp);
assert(swd->b_char == *(c->bp));
if ( m_len < 2 ||
(m_len == 2 && (m_off > M1_MAX_OFFSET || lit == 0 || lit >= 4)) ||
#if 1
/* Do not accept this match for compressed-data compatibility
* with LZO v1.01 and before
* [ might be a problem for decompress() and optimize() ]
*/
(m_len == 2 && op == out) ||
#endif
(op == out && lit == 0))
{
/* a literal */
m_len = 0;
}
else if (m_len == M2_MIN_LEN)
{
/* compression ratio improves if we code a literal in some cases */
if (m_off > MX_MAX_OFFSET && lit >= 4)
m_len = 0;
}
if (m_len == 0)
{
/* a literal */
lit++;
swd->max_chain = max_chain;
r = find_match(c,swd,1,0);
assert(r == 0);
continue;
}
/* a match */
#if defined(SWD_BEST_OFF)
if (swd->use_best_off)
better_match(swd,&m_len,&m_off);
#endif
assert_match(swd,m_len,m_off);
/* shall we try a lazy match ? */
ahead = 0;
if (try_lazy <= 0 || m_len >= max_lazy)
{
/* no */
l1 = 0;
max_ahead = 0;
}
else
{
/* yes, try a lazy match */
l1 = len_of_coded_match(m_len,m_off,lit);
assert(l1 > 0);
#if 1
max_ahead = LZO_MIN(try_lazy, l1 - 1);
#else
max_ahead = LZO_MIN3(try_lazy, l1, m_len - 1);
#endif
}
while (ahead < max_ahead && c->look > m_len)
{
lzo_int lazy_match_min_gain;
if (m_len >= good_length)
swd->max_chain = max_chain >> 2;
else
swd->max_chain = max_chain;
r = find_match(c,swd,1,0);
ahead++;
assert(r == 0);
assert(c->look > 0);
assert(ii + lit + ahead == c->bp);
#if defined(LZO1Z)
if (m_off == c->last_m_off && c->m_off != c->last_m_off)
if (m_len >= M2_MIN_LEN && m_len <= M2_MAX_LEN)
c->m_len = 0;
#endif
if (c->m_len < m_len)
continue;
#if 1
if (c->m_len == m_len && c->m_off >= m_off)
continue;
#endif
#if defined(SWD_BEST_OFF)
if (swd->use_best_off)
better_match(swd,&c->m_len,&c->m_off);
#endif
l2 = len_of_coded_match(c->m_len,c->m_off,lit+ahead);
if (l2 < 0)
continue;
#if 0
if (c->m_len == m_len && l2 >= l1)
continue;
#endif
#if 1
/* compressed-data compatibility [see above] */
l3 = (op == out) ? -1 : len_of_coded_match(ahead,m_off,lit);
#else
l3 = len_of_coded_match(ahead,m_off,lit);
#endif
lazy_match_min_gain = min_gain(ahead,lit,lit+ahead,l1,l2,l3);
if (c->m_len >= m_len + lazy_match_min_gain)
{
c->lazy++;
assert_match(swd,c->m_len,c->m_off);
if (l3 > 0)
{
/* code previous run */
op = code_run(c,op,ii,lit,ahead);
lit = 0;
/* code shortened match */
op = code_match(c,op,ahead,m_off);
}
else
{
lit += ahead;
assert(ii + lit == c->bp);
}
goto lazy_match_done;
}
}
assert(ii + lit + ahead == c->bp);
/* 1 - code run */
op = code_run(c,op,ii,lit,m_len);
lit = 0;
/* 2 - code match */
op = code_match(c,op,m_len,m_off);
swd->max_chain = max_chain;
r = find_match(c,swd,m_len,1+ahead);
assert(r == 0);
lazy_match_done: ;
}
/* store final run */
if (lit > 0)
op = STORE_RUN(c,op,ii,lit);
#if defined(LZO_EOF_CODE)
*op++ = M4_MARKER | 1;
*op++ = 0;
*op++ = 0;
#endif
c->codesize = op - out;
assert(c->textsize == in_len);
*out_len = op - out;
if (c->cb)
(*c->cb)(c->textsize,c->codesize);
#if 0
printf("%ld %ld -> %ld %ld: %ld %ld %ld %ld %ld %ld: %ld %ld %ld %ld\n",
(long) c->textsize, (long) in_len, (long) c->codesize,
c->match_bytes, c->m1a_m, c->m1b_m, c->m2_m, c->m3_m, c->m4_m,
c->lit_bytes, c->lit1_r, c->lit2_r, c->lit3_r, c->lazy);
#endif
assert(c->lit_bytes + c->match_bytes == in_len);
return LZO_E_OK;
}
/***********************************************************************
//
************************************************************************/
LZO_PUBLIC(int)
lzo1x_999_compress_level ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem,
const lzo_byte *dict, lzo_uint dict_len,
lzo_progress_callback_t cb,
int compression_level )
{
static const struct
{
int try_lazy;
lzo_uint good_length;
lzo_uint max_lazy;
lzo_uint nice_length;
lzo_uint max_chain;
lzo_uint32 flags;
} c[9] = {
{ 0, 0, 0, 8, 4, 0 }, /* faster compression */
{ 0, 0, 0, 16, 8, 0 },
{ 0, 0, 0, 32, 16, 0 },
{ 1, 4, 4, 16, 16, 0 },
{ 1, 8, 16, 32, 32, 0 },
{ 1, 8, 16, 128, 128, 0 },
{ 2, 8, 32, 128, 256, 0 },
{ 2, 32, 128, F, 2048, 1 },
{ 2, F, F, F, 4096, 1 } /* max. compression */
};
if (compression_level < 1 || compression_level > 9)
return LZO_E_ERROR;
compression_level -= 1;
return lzo1x_999_compress_internal(in, in_len, out, out_len, wrkmem,
dict, dict_len, cb,
c[compression_level].try_lazy,
c[compression_level].good_length,
c[compression_level].max_lazy,
#if 0
c[compression_level].nice_length,
#else
0,
#endif
c[compression_level].max_chain,
c[compression_level].flags);
}
/***********************************************************************
//
************************************************************************/
LZO_PUBLIC(int)
lzo1x_999_compress_dict ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem,
const lzo_byte *dict, lzo_uint dict_len )
{
return lzo1x_999_compress_level(in, in_len, out, out_len, wrkmem,
dict, dict_len, 0, 8);
}
LZO_PUBLIC(int)
lzo1x_999_compress ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem )
{
return lzo1x_999_compress_level(in, in_len, out, out_len, wrkmem,
NULL, 0, 0, 8);
}
#endif /* !defined(LZO_999_UNSUPPORTED) */
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo1x_c.ch.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
|
/* lzo1x_c.ch -- implementation of the LZO1[XY]-1 compression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/***********************************************************************
// compress a block of data.
************************************************************************/
static
lzo_uint do_compress ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem )
{
#if 0 && defined(__GNUC__) && defined(__i386__)
register const lzo_byte *ip __asm__("%esi");
#else
register const lzo_byte *ip;
#endif
lzo_byte *op;
const lzo_byte * const in_end = in + in_len;
const lzo_byte * const ip_end = in + in_len - M2_MAX_LEN - 5;
const lzo_byte *ii;
lzo_dict_p const dict = (lzo_dict_p) wrkmem;
op = out;
ip = in;
ii = ip;
ip += 4;
for (;;)
{
#if 0 && defined(__GNUC__) && defined(__i386__)
register const lzo_byte *m_pos __asm__("%edi");
#else
register const lzo_byte *m_pos;
#endif
lzo_moff_t m_off;
lzo_uint m_len;
lzo_uint dindex;
DINDEX1(dindex,ip);
GINDEX(m_pos,m_off,dict,dindex,in);
if (LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,M4_MAX_OFFSET))
goto literal;
#if 1
if (m_off <= M2_MAX_OFFSET || m_pos[3] == ip[3])
goto try_match;
DINDEX2(dindex,ip);
#endif
GINDEX(m_pos,m_off,dict,dindex,in);
if (LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,M4_MAX_OFFSET))
goto literal;
if (m_off <= M2_MAX_OFFSET || m_pos[3] == ip[3])
goto try_match;
goto literal;
try_match:
#if 1 && defined(LZO_UNALIGNED_OK_2)
if (* (const lzo_ushortp) m_pos != * (const lzo_ushortp) ip)
#else
if (m_pos[0] != ip[0] || m_pos[1] != ip[1])
#endif
{
}
else
{
if (m_pos[2] == ip[2])
{
#if 0
if (m_off <= M2_MAX_OFFSET)
goto match;
if (lit <= 3)
goto match;
if (lit == 3) /* better compression, but slower */
{
assert(op - 2 > out); op[-2] |= LZO_BYTE(3);
*op++ = *ii++; *op++ = *ii++; *op++ = *ii++;
goto code_match;
}
if (m_pos[3] == ip[3])
#endif
goto match;
}
else
{
/* still need a better way for finding M1 matches */
#if 0
/* a M1 match */
#if 0
if (m_off <= M1_MAX_OFFSET && lit > 0 && lit <= 3)
#else
if (m_off <= M1_MAX_OFFSET && lit == 3)
#endif
{
register lzo_uint t;
t = lit;
assert(op - 2 > out); op[-2] |= LZO_BYTE(t);
do *op++ = *ii++; while (--t > 0);
assert(ii == ip);
m_off -= 1;
*op++ = LZO_BYTE(M1_MARKER | ((m_off & 3) << 2));
*op++ = LZO_BYTE(m_off >> 2);
ip += 2;
goto match_done;
}
#endif
}
}
/* a literal */
literal:
UPDATE_I(dict,0,dindex,ip,in);
++ip;
if (ip >= ip_end)
break;
continue;
/* a match */
match:
UPDATE_I(dict,0,dindex,ip,in);
/* store current literal run */
if (pd(ip,ii) > 0)
{
register lzo_uint t = pd(ip,ii);
if (t <= 3)
{
assert(op - 2 > out);
op[-2] |= LZO_BYTE(t);
}
else if (t <= 18)
*op++ = LZO_BYTE(t - 3);
else
{
register lzo_uint tt = t - 18;
*op++ = 0;
while (tt > 255)
{
tt -= 255;
*op++ = 0;
}
assert(tt > 0);
*op++ = LZO_BYTE(tt);
}
do *op++ = *ii++; while (--t > 0);
}
/* code the match */
assert(ii == ip);
ip += 3;
if (m_pos[3] != *ip++ || m_pos[4] != *ip++ || m_pos[5] != *ip++ ||
m_pos[6] != *ip++ || m_pos[7] != *ip++ || m_pos[8] != *ip++
#ifdef LZO1Y
|| m_pos[ 9] != *ip++ || m_pos[10] != *ip++ || m_pos[11] != *ip++
|| m_pos[12] != *ip++ || m_pos[13] != *ip++ || m_pos[14] != *ip++
#endif
)
{
--ip;
m_len = ip - ii;
assert(m_len >= 3); assert(m_len <= M2_MAX_LEN);
if (m_off <= M2_MAX_OFFSET)
{
m_off -= 1;
#if defined(LZO1X)
*op++ = LZO_BYTE(((m_len - 1) << 5) | ((m_off & 7) << 2));
*op++ = LZO_BYTE(m_off >> 3);
#elif defined(LZO1Y)
*op++ = LZO_BYTE(((m_len + 1) << 4) | ((m_off & 3) << 2));
*op++ = LZO_BYTE(m_off >> 2);
#endif
}
else if (m_off <= M3_MAX_OFFSET)
{
m_off -= 1;
*op++ = LZO_BYTE(M3_MARKER | (m_len - 2));
goto m3_m4_offset;
}
else
#if defined(LZO1X)
{
m_off -= 0x4000;
assert(m_off > 0); assert(m_off <= 0x7fff);
*op++ = LZO_BYTE(M4_MARKER |
((m_off & 0x4000) >> 11) | (m_len - 2));
goto m3_m4_offset;
}
#elif defined(LZO1Y)
goto m4_match;
#endif
}
else
{
{
const lzo_byte *end = in_end;
const lzo_byte *m = m_pos + M2_MAX_LEN + 1;
while (ip < end && *m == *ip)
m++, ip++;
m_len = (ip - ii);
}
assert(m_len > M2_MAX_LEN);
if (m_off <= M3_MAX_OFFSET)
{
m_off -= 1;
if (m_len <= 33)
*op++ = LZO_BYTE(M3_MARKER | (m_len - 2));
else
{
m_len -= 33;
*op++ = M3_MARKER | 0;
goto m3_m4_len;
}
}
else
{
#if defined(LZO1Y)
m4_match:
#endif
m_off -= 0x4000;
assert(m_off > 0); assert(m_off <= 0x7fff);
if (m_len <= M4_MAX_LEN)
*op++ = LZO_BYTE(M4_MARKER |
((m_off & 0x4000) >> 11) | (m_len - 2));
else
{
m_len -= M4_MAX_LEN;
*op++ = LZO_BYTE(M4_MARKER | ((m_off & 0x4000) >> 11));
m3_m4_len:
while (m_len > 255)
{
m_len -= 255;
*op++ = 0;
}
assert(m_len > 0);
*op++ = LZO_BYTE(m_len);
}
}
m3_m4_offset:
*op++ = LZO_BYTE((m_off & 63) << 2);
*op++ = LZO_BYTE(m_off >> 6);
}
#if 0
match_done:
#endif
ii = ip;
if (ip >= ip_end)
break;
}
*out_len = op - out;
return pd(in_end,ii);
}
/***********************************************************************
// public entry point
************************************************************************/
LZO_PUBLIC(int)
DO_COMPRESS ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem )
{
lzo_byte *op = out;
lzo_uint t;
#if defined(__LZO_QUERY_COMPRESS)
if (__LZO_IS_COMPRESS_QUERY(in,in_len,out,out_len,wrkmem))
return __LZO_QUERY_COMPRESS(in,in_len,out,out_len,wrkmem,D_SIZE,lzo_sizeof(lzo_dict_t));
#endif
if (in_len <= M2_MAX_LEN + 5)
t = in_len;
else
{
t = do_compress(in,in_len,op,out_len,wrkmem);
op += *out_len;
}
if (t > 0)
{
const lzo_byte *ii = in + in_len - t;
if (op == out && t <= 238)
*op++ = LZO_BYTE(17 + t);
else if (t <= 3)
op[-2] |= LZO_BYTE(t);
else if (t <= 18)
*op++ = LZO_BYTE(t - 3);
else
{
lzo_uint tt = t - 18;
*op++ = 0;
while (tt > 255)
{
tt -= 255;
*op++ = 0;
}
assert(tt > 0);
*op++ = LZO_BYTE(tt);
}
do *op++ = *ii++; while (--t > 0);
}
*op++ = M4_MARKER | 1;
*op++ = 0;
*op++ = 0;
*out_len = op - out;
return LZO_E_OK;
}
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo1x_d.ch.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
|
/* lzo1x_d.ch -- implementation of the LZO1X decompression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include "lzo1_d.ch"
#undef __COPY4
#define __COPY4(dst,src) * (lzo_uint32p)(dst) = * (const lzo_uint32p)(src)
#undef COPY4
#if defined(LZO_UNALIGNED_OK_4)
# define COPY4(dst,src) __COPY4(dst,src)
#elif defined(LZO_ALIGNED_OK_4)
# define COPY4(dst,src) __COPY4((lzo_ptr_t)(dst),(lzo_ptr_t)(src))
#endif
/***********************************************************************
// decompress a block of data.
************************************************************************/
#if defined(DO_DECOMPRESS)
LZO_PUBLIC(int)
DO_DECOMPRESS ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem )
#endif
{
register lzo_byte *op;
register const lzo_byte *ip;
register lzo_uint t;
#if defined(COPY_DICT)
lzo_uint m_off;
const lzo_byte *dict_end;
#else
register const lzo_byte *m_pos;
#endif
const lzo_byte * const ip_end = in + in_len;
#if defined(HAVE_ANY_OP)
lzo_byte * const op_end = out + *out_len;
#endif
#if defined(LZO1Z)
lzo_uint last_m_off = 0;
#endif
LZO_UNUSED(wrkmem);
#if defined(__LZO_QUERY_DECOMPRESS)
if (__LZO_IS_DECOMPRESS_QUERY(in,in_len,out,out_len,wrkmem))
return __LZO_QUERY_DECOMPRESS(in,in_len,out,out_len,wrkmem,0,0);
#endif
#if defined(COPY_DICT)
if (dict)
{
if (dict_len > M4_MAX_OFFSET)
{
dict += dict_len - M4_MAX_OFFSET;
dict_len = M4_MAX_OFFSET;
}
dict_end = dict + dict_len;
}
else
{
dict_len = 0;
dict_end = NULL;
}
#endif /* COPY_DICT */
*out_len = 0;
op = out;
ip = in;
if (*ip > 17)
{
t = *ip++ - 17;
if (t < 4)
goto match_next;
assert(t > 0); NEED_OP(t); NEED_IP(t+1);
do *op++ = *ip++; while (--t > 0);
goto first_literal_run;
}
while (TEST_IP && TEST_OP)
{
t = *ip++;
if (t >= 16)
goto match;
/* a literal run */
if (t == 0)
{
NEED_IP(1);
while (*ip == 0)
{
t += 255;
ip++;
NEED_IP(1);
}
t += 15 + *ip++;
}
/* copy literals */
assert(t > 0); NEED_OP(t+3); NEED_IP(t+4);
#if defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4)
#if !defined(LZO_UNALIGNED_OK_4)
if (PTR_ALIGNED2_4(op,ip))
{
#endif
COPY4(op,ip);
op += 4; ip += 4;
if (--t > 0)
{
if (t >= 4)
{
do {
COPY4(op,ip);
op += 4; ip += 4; t -= 4;
} while (t >= 4);
if (t > 0) do *op++ = *ip++; while (--t > 0);
}
else
do *op++ = *ip++; while (--t > 0);
}
#if !defined(LZO_UNALIGNED_OK_4)
}
else
#endif
#endif
#if !defined(LZO_UNALIGNED_OK_4)
{
*op++ = *ip++; *op++ = *ip++; *op++ = *ip++;
do *op++ = *ip++; while (--t > 0);
}
#endif
first_literal_run:
t = *ip++;
if (t >= 16)
goto match;
#if defined(COPY_DICT)
#if defined(LZO1Z)
m_off = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2);
last_m_off = m_off;
#else
m_off = (1 + M2_MAX_OFFSET) + (t >> 2) + (*ip++ << 2);
#endif
NEED_OP(3);
t = 3; COPY_DICT(t,m_off)
#else /* !COPY_DICT */
#if defined(LZO1Z)
t = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2);
m_pos = op - t;
last_m_off = t;
#else
m_pos = op - (1 + M2_MAX_OFFSET);
m_pos -= t >> 2;
m_pos -= *ip++ << 2;
#endif
TEST_LOOKBEHIND(m_pos,out); NEED_OP(3);
*op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos;
#endif /* COPY_DICT */
goto match_done;
/* handle matches */
while (TEST_IP && TEST_OP)
{
match:
if (t >= 64) /* a M2 match */
{
#if defined(COPY_DICT)
#if defined(LZO1X)
m_off = 1 + ((t >> 2) & 7) + (*ip++ << 3);
t = (t >> 5) - 1;
#elif defined(LZO1Y)
m_off = 1 + ((t >> 2) & 3) + (*ip++ << 2);
t = (t >> 4) - 3;
#elif defined(LZO1Z)
m_off = t & 0x1f;
if (m_off >= 0x1c)
m_off = last_m_off;
else
{
m_off = 1 + (m_off << 6) + (*ip++ >> 2);
last_m_off = m_off;
}
t = (t >> 5) - 1;
#endif
#else /* !COPY_DICT */
#if defined(LZO1X)
m_pos = op - 1;
m_pos -= (t >> 2) & 7;
m_pos -= *ip++ << 3;
t = (t >> 5) - 1;
#elif defined(LZO1Y)
m_pos = op - 1;
m_pos -= (t >> 2) & 3;
m_pos -= *ip++ << 2;
t = (t >> 4) - 3;
#elif defined(LZO1Z)
{
lzo_uint off = t & 0x1f;
m_pos = op;
if (off >= 0x1c)
{
assert(last_m_off > 0);
m_pos -= last_m_off;
}
else
{
off = 1 + (off << 6) + (*ip++ >> 2);
m_pos -= off;
last_m_off = off;
}
}
t = (t >> 5) - 1;
#endif
TEST_LOOKBEHIND(m_pos,out); assert(t > 0); NEED_OP(t+3-1);
goto copy_match;
#endif /* COPY_DICT */
}
else if (t >= 32) /* a M3 match */
{
t &= 31;
if (t == 0)
{
NEED_IP(1);
while (*ip == 0)
{
t += 255;
ip++;
NEED_IP(1);
}
t += 31 + *ip++;
}
#if defined(COPY_DICT)
#if defined(LZO1Z)
m_off = 1 + (ip[0] << 6) + (ip[1] >> 2);
last_m_off = m_off;
#else
m_off = 1 + (ip[0] >> 2) + (ip[1] << 6);
#endif
#else /* !COPY_DICT */
#if defined(LZO1Z)
{
lzo_uint off = 1 + (ip[0] << 6) + (ip[1] >> 2);
m_pos = op - off;
last_m_off = off;
}
#elif defined(LZO_UNALIGNED_OK_2) && (LZO_BYTE_ORDER == LZO_LITTLE_ENDIAN)
m_pos = op - 1;
m_pos -= (* (const lzo_ushortp) ip) >> 2;
#else
m_pos = op - 1;
m_pos -= (ip[0] >> 2) + (ip[1] << 6);
#endif
#endif /* COPY_DICT */
ip += 2;
}
else if (t >= 16) /* a M4 match */
{
#if defined(COPY_DICT)
m_off = (t & 8) << 11;
#else /* !COPY_DICT */
m_pos = op;
m_pos -= (t & 8) << 11;
#endif /* COPY_DICT */
t &= 7;
if (t == 0)
{
NEED_IP(1);
while (*ip == 0)
{
t += 255;
ip++;
NEED_IP(1);
}
t += 7 + *ip++;
}
#if defined(COPY_DICT)
#if defined(LZO1Z)
m_off += (ip[0] << 6) + (ip[1] >> 2);
#else
m_off += (ip[0] >> 2) + (ip[1] << 6);
#endif
ip += 2;
if (m_off == 0)
goto eof_found;
m_off += 0x4000;
#if defined(LZO1Z)
last_m_off = m_off;
#endif
#else /* !COPY_DICT */
#if defined(LZO1Z)
m_pos -= (ip[0] << 6) + (ip[1] >> 2);
#elif defined(LZO_UNALIGNED_OK_2) && (LZO_BYTE_ORDER == LZO_LITTLE_ENDIAN)
m_pos -= (* (const lzo_ushortp) ip) >> 2;
#else
m_pos -= (ip[0] >> 2) + (ip[1] << 6);
#endif
ip += 2;
if (m_pos == op)
goto eof_found;
m_pos -= 0x4000;
#if defined(LZO1Z)
last_m_off = op - m_pos;
#endif
#endif /* COPY_DICT */
}
else /* a M1 match */
{
#if defined(COPY_DICT)
#if defined(LZO1Z)
m_off = 1 + (t << 6) + (*ip++ >> 2);
last_m_off = m_off;
#else
m_off = 1 + (t >> 2) + (*ip++ << 2);
#endif
NEED_OP(2);
t = 2; COPY_DICT(t,m_off)
#else /* !COPY_DICT */
#if defined(LZO1Z)
t = 1 + (t << 6) + (*ip++ >> 2);
m_pos = op - t;
last_m_off = t;
#else
m_pos = op - 1;
m_pos -= t >> 2;
m_pos -= *ip++ << 2;
#endif
TEST_LOOKBEHIND(m_pos,out); NEED_OP(2);
*op++ = *m_pos++; *op++ = *m_pos;
#endif /* COPY_DICT */
goto match_done;
}
/* copy match */
#if defined(COPY_DICT)
NEED_OP(t+3-1);
t += 3-1; COPY_DICT(t,m_off)
#else /* !COPY_DICT */
TEST_LOOKBEHIND(m_pos,out); assert(t > 0); NEED_OP(t+3-1);
#if defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4)
#if !defined(LZO_UNALIGNED_OK_4)
if (t >= 2 * 4 - (3 - 1) && PTR_ALIGNED2_4(op,m_pos))
{
assert((op - m_pos) >= 4); /* both pointers are aligned */
#else
if (t >= 2 * 4 - (3 - 1) && (op - m_pos) >= 4)
{
#endif
COPY4(op,m_pos);
op += 4; m_pos += 4; t -= 4 - (3 - 1);
do {
COPY4(op,m_pos);
op += 4; m_pos += 4; t -= 4;
} while (t >= 4);
if (t > 0) do *op++ = *m_pos++; while (--t > 0);
}
else
#endif
{
copy_match:
*op++ = *m_pos++; *op++ = *m_pos++;
do *op++ = *m_pos++; while (--t > 0);
}
#endif /* COPY_DICT */
match_done:
#if defined(LZO1Z)
t = ip[-1] & 3;
#else
t = ip[-2] & 3;
#endif
if (t == 0)
break;
/* copy literals */
match_next:
assert(t > 0); NEED_OP(t); NEED_IP(t+1);
do *op++ = *ip++; while (--t > 0);
t = *ip++;
}
}
#if defined(HAVE_TEST_IP) || defined(HAVE_TEST_OP)
/* no EOF code was found */
*out_len = op - out;
return LZO_E_EOF_NOT_FOUND;
#endif
eof_found:
assert(t == 1);
*out_len = op - out;
return (ip == ip_end ? LZO_E_OK :
(ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN));
#if defined(HAVE_NEED_IP)
input_overrun:
*out_len = op - out;
return LZO_E_INPUT_OVERRUN;
#endif
#if defined(HAVE_NEED_OP)
output_overrun:
*out_len = op - out;
return LZO_E_OUTPUT_OVERRUN;
#endif
#if defined(LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND)
lookbehind_overrun:
*out_len = op - out;
return LZO_E_LOOKBEHIND_OVERRUN;
#endif
}
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo1x_d1.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/* lzo1x_d1.c -- LZO1X decompression
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include "config1x.h"
#undef LZO_TEST_DECOMPRESS_OVERRUN
#define DO_DECOMPRESS lzo1x_decompress
#include "lzo1x_d.ch"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1x_d2.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/* lzo1x_d2.c -- LZO1X decompression with overrun testing
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include "config1x.h"
#define LZO_TEST_DECOMPRESS_OVERRUN
#define DO_DECOMPRESS lzo1x_decompress_safe
#include "lzo1x_d.ch"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1x_d3.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
|
/* lzo1x_d3.c -- LZO1X decompression with preset dictionary
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include "config1x.h"
#if 0
#undef NDEBUG
#include <assert.h>
#endif
#define LZO_TEST_DECOMPRESS_OVERRUN
#if 0 && defined(__linux__)
# include <linux/string.h>
#endif
#define SLOW_MEMCPY(a,b,l) { do *a++ = *b++; while (--l > 0); }
#if 1 && defined(HAVE_MEMCPY)
# if !defined(__LZO_DOS16) && !defined(__LZO_WIN16)
# define FAST_MEMCPY(a,b,l) { memcpy(a,b,l); a += l; }
# endif
#endif
#if 1 && defined(FAST_MEMCPY)
# define DICT_MEMMOVE(op,m_pos,m_len,m_off) \
if (m_off >= (m_len)) \
FAST_MEMCPY(op,m_pos,m_len) \
else \
SLOW_MEMCPY(op,m_pos,m_len)
#else
# define DICT_MEMMOVE(op,m_pos,m_len,m_off) \
SLOW_MEMCPY(op,m_pos,m_len)
#endif
#if !defined(FAST_MEMCPY)
# define FAST_MEMCPY SLOW_MEMCPY
#endif
#define COPY_DICT_DICT(m_len,m_off) \
{ \
register const lzo_byte *m_pos; \
m_off -= (lzo_moff_t) (op - out); assert(m_off > 0); \
if (m_off > dict_len) goto lookbehind_overrun; \
m_pos = dict_end - m_off; \
if (m_len > m_off) \
{ \
m_len -= m_off; \
FAST_MEMCPY(op,m_pos,m_off) \
m_pos = out; \
SLOW_MEMCPY(op,m_pos,m_len) \
} \
else \
FAST_MEMCPY(op,m_pos,m_len) \
}
#define COPY_DICT(m_len,m_off) \
assert(m_len >= 2); assert(m_off > 0); assert(op > out); \
if (m_off <= (lzo_moff_t) (op - out)) \
{ \
register const lzo_byte *m_pos = op - m_off; \
DICT_MEMMOVE(op,m_pos,m_len,m_off) \
} \
else \
COPY_DICT_DICT(m_len,m_off)
LZO_PUBLIC(int)
lzo1x_decompress_dict_safe ( const lzo_byte *in, lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem /* NOT USED */,
const lzo_byte *dict, lzo_uint dict_len)
#include "lzo1x_d.ch"
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo1x_o.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
/* lzo1x_o.c -- LZO1X compressed data optimizer
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include "config1x.h"
#define DO_OPTIMIZE lzo1x_optimize
#include "lzo1x_oo.ch"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1x_oo.ch.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
|
/* lzo1x_oo.ch -- LZO1X compressed data optimizer
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include <stdio.h>
#if 0
#undef NDEBUG
#include <assert.h>
#endif
#define TEST_IP (ip < ip_end)
#define TEST_OP (op <= op_end)
#define NO_LIT LZO_UINT_MAX
/***********************************************************************
//
************************************************************************/
static void copy2(lzo_byte *ip, const lzo_byte *m_pos, lzo_ptrdiff_t off)
{
assert(off > 0);
ip[0] = m_pos[0];
if (off == 1)
ip[1] = m_pos[0];
else
ip[1] = m_pos[1];
}
static void copy3(lzo_byte *ip, const lzo_byte *m_pos, lzo_ptrdiff_t off)
{
assert(off > 0);
ip[0] = m_pos[0];
if (off == 1)
{
ip[2] = ip[1] = m_pos[0];
}
else if (off == 2)
{
ip[1] = m_pos[1];
ip[2] = m_pos[0];
}
else
{
ip[1] = m_pos[1];
ip[2] = m_pos[2];
}
}
/***********************************************************************
// optimize a block of data.
************************************************************************/
LZO_PUBLIC(int)
DO_OPTIMIZE ( lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem )
{
lzo_byte *op;
lzo_byte *ip;
lzo_uint t;
lzo_byte *m_pos;
lzo_byte * const ip_end = in + in_len;
lzo_byte * const op_end = out + *out_len;
lzo_byte *litp = NULL;
lzo_uint lit = 0;
lzo_uint next_lit = NO_LIT;
lzo_uint nl;
long o_m1_a = 0, o_m1_b = 0, o_m2 = 0, o_m3_a = 0, o_m3_b = 0;
LZO_UNUSED(wrkmem);
#if defined(__LZO_QUERY_OPTIMIZE)
if (__LZO_IS_OPTIMIZE_QUERY(in,in_len,out,out_len,wrkmem))
return __LZO_QUERY_OPTIMIZE(in,in_len,out,out_len,wrkmem,0,0);
#endif
*out_len = 0;
op = out;
ip = in;
assert(in_len >= 3);
if (*ip > 17)
{
t = *ip++ - 17;
if (t < 4)
goto match_next;
goto first_literal_run;
}
assert(*ip < 16 || (*ip == 17 && in_len == 3));
while (TEST_IP && TEST_OP)
{
t = *ip++;
if (t >= 16)
goto match;
/* a literal run */
litp = ip - 1;
if (t == 0)
{
t = 15;
while (*ip == 0)
t += 255, ip++;
t += *ip++;
}
lit = t + 3;
/* copy literals */
copy_literal_run:
*op++ = *ip++; *op++ = *ip++; *op++ = *ip++;
first_literal_run:
do *op++ = *ip++; while (--t > 0);
t = *ip++;
if (t >= 16)
goto match;
#if defined(LZO1X)
m_pos = op - 1 - 0x800;
#elif defined(LZO1Y)
m_pos = op - 1 - 0x400;
#endif
m_pos -= t >> 2;
m_pos -= *ip++ << 2;
*op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos++;
lit = 0;
goto match_done;
/* handle matches */
while (TEST_IP && TEST_OP)
{
if (t < 16) /* a M1 match */
{
m_pos = op - 1;
m_pos -= t >> 2;
m_pos -= *ip++ << 2;
if (litp == NULL)
goto copy_m1;
/* assert that there was a match just before */
assert(lit >= 1 && lit <= 3);
assert(litp == ip - 2 - lit - 2);
assert((lzo_uint)(*litp & 3) == lit);
nl = ip[-2] & 3;
/* test if a match follows */
if (nl == 0 && lit == 1 && ip[0] >= 16)
{
next_lit = nl;
/* adjust length of previous short run */
lit += 2;
*litp = LZO_BYTE((*litp & ~3) | lit);
/* copy over the 2 literals that replace the match */
copy2(ip-2,m_pos,op-m_pos);
o_m1_a++;
}
/* test if a literal run follows */
else if (nl == 0 && ip[0] < 16 && ip[0] != 0 &&
(lit + 2 + ip[0] < 16))
{
t = *ip++;
/* remove short run */
*litp &= ~3;
/* copy over the 2 literals that replace the match */
copy2(ip-3+1,m_pos,op-m_pos);
/* move literals 1 byte ahead */
litp += 2;
if (lit > 0)
lzo_memmove(litp+1,litp,lit);
/* insert new length of long literal run */
lit += 2 + t + 3; assert(lit <= 18);
*litp = LZO_BYTE(lit - 3);
o_m1_b++;
*op++ = *m_pos++; *op++ = *m_pos++;
goto copy_literal_run;
}
copy_m1:
*op++ = *m_pos++; *op++ = *m_pos++;
}
else
{
match:
if (t >= 64) /* a M2 match */
{
m_pos = op - 1;
#if defined(LZO1X)
m_pos -= (t >> 2) & 7;
m_pos -= *ip++ << 3;
t = (t >> 5) - 1;
#elif defined(LZO1Y)
m_pos -= (t >> 2) & 3;
m_pos -= *ip++ << 2;
t = (t >> 4) - 3;
#endif
if (litp == NULL)
goto copy_m;
nl = ip[-2] & 3;
/* test if in beetween two long literal runs */
if (t == 1 && lit > 3 && nl == 0 &&
ip[0] < 16 && ip[0] != 0 && (lit + 3 + ip[0] < 16))
{
assert(*litp == lit - 3);
t = *ip++;
/* copy over the 3 literals that replace the match */
copy3(ip-1-2,m_pos,op-m_pos);
/* set new length of previous literal run */
lit += 3 + t + 3; assert(lit <= 18);
*litp = LZO_BYTE(lit - 3);
o_m2++;
*op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos++;
goto copy_literal_run;
}
}
else
{
if (t >= 32) /* a M3 match */
{
t &= 31;
if (t == 0)
{
t = 31;
while (*ip == 0)
t += 255, ip++;
t += *ip++;
}
m_pos = op - 1;
m_pos -= *ip++ >> 2;
m_pos -= *ip++ << 6;
}
else /* a M4 match */
{
m_pos = op;
m_pos -= (t & 8) << 11;
t &= 7;
if (t == 0)
{
t = 7;
while (*ip == 0)
t += 255, ip++;
t += *ip++;
}
m_pos -= *ip++ >> 2;
m_pos -= *ip++ << 6;
if (m_pos == op)
goto eof_found;
m_pos -= 0x4000;
}
if (litp == NULL)
goto copy_m;
nl = ip[-2] & 3;
/* test if in beetween two matches */
if (t == 1 && lit == 0 && nl == 0 && ip[0] >= 16)
{
assert(litp == ip - 3 - lit - 2);
assert((lzo_uint)(*litp & 3) == lit);
next_lit = nl;
/* make a previous short run */
lit += 3;
*litp = LZO_BYTE((*litp & ~3) | lit);
/* copy over the 3 literals that replace the match */
copy3(ip-3,m_pos,op-m_pos);
o_m3_a++;
}
/* test if a literal run follows */
else if (t == 1 && lit <= 3 && nl == 0 &&
ip[0] < 16 && ip[0] != 0 && (lit + 3 + ip[0] < 16))
{
assert(litp == ip - 3 - lit - 2);
assert((lzo_uint)(*litp & 3) == lit);
t = *ip++;
/* remove short run */
*litp &= ~3;
/* copy over the 3 literals that replace the match */
copy3(ip-4+1,m_pos,op-m_pos);
/* move literals 1 byte ahead */
litp += 2;
if (lit > 0)
lzo_memmove(litp+1,litp,lit);
/* insert new length of long literal run */
lit += 3 + t + 3; assert(lit <= 18);
*litp = LZO_BYTE(lit - 3);
o_m3_b++;
*op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos++;
goto copy_literal_run;
}
}
copy_m:
*op++ = *m_pos++; *op++ = *m_pos++;
do *op++ = *m_pos++; while (--t > 0);
}
match_done:
if (next_lit == NO_LIT)
{
t = ip[-2] & 3;
lit = t;
litp = ip - 2;
}
else
t = next_lit;
assert(t <= 3);
next_lit = NO_LIT;
if (t == 0)
break;
/* copy literals */
match_next:
do *op++ = *ip++; while (--t > 0);
t = *ip++;
}
}
/* no EOF code was found */
*out_len = op - out;
return LZO_E_EOF_NOT_FOUND;
eof_found:
assert(t == 1);
#if 0
printf("optimize: %lu %lu %lu %lu %lu\n",
o_m1_a, o_m1_b, o_m2, o_m3_a, o_m3_b);
#endif
*out_len = op - out;
return (ip == ip_end ? LZO_E_OK :
(ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN));
}
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo1y_1.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
/* lzo1y_1.c -- LZO1Y-1 compression
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#define LZO_NEED_DICT_H
#define D_BITS 14
#define D_INDEX1(d,p) d = DX3(p,5,5,6); d += d >> 5; d = DM(d)
#define D_INDEX2(d,p) d = (d & (D_MASK & 0x7ff)) ^ (D_HIGH | 0x1f)
#include "config1y.h"
#define DO_COMPRESS lzo1y_1_compress
#include "lzo1x_c.ch"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1y_9x.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
/* lzo1y_9x.c -- implementation of the LZO1Y-999 compression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#define LZO1Y
#include "lzo1x_9x.c"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1y_d1.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/* lzo1y_d1.c -- LZO1Y decompression
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include "config1y.h"
#undef LZO_TEST_DECOMPRESS_OVERRUN
#define DO_DECOMPRESS lzo1y_decompress
#include "lzo1x_d.ch"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1y_d2.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/* lzo1y_d2.c -- LZO1Y decompression with overrun testing
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include "config1y.h"
#define LZO_TEST_DECOMPRESS_OVERRUN
#define DO_DECOMPRESS lzo1y_decompress_safe
#include "lzo1x_d.ch"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1y_d3.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
/* lzo1y_d3.c -- LZO1Y decompression with preset dictionary
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include "config1y.h"
#define lzo1x_decompress_dict_safe lzo1y_decompress_dict_safe
#include "lzo1x_d3.c"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1y_o.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
/* lzo1y_o.c -- LZO1Y compressed data optimizer
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include "config1y.h"
#define DO_OPTIMIZE lzo1y_optimize
#include "lzo1x_oo.ch"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1z_9x.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
/* lzo1z_9x.c -- implementation of the LZO1Z-999 compression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#define LZO1Z
#include "lzo1x_9x.c"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1z_d1.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/* lzo1z_d1.c -- LZO1Z decompression
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include "config1z.h"
#undef LZO_TEST_DECOMPRESS_OVERRUN
#define DO_DECOMPRESS lzo1z_decompress
#include "lzo1x_d.ch"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1z_d2.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/* lzo1z_d2.c -- LZO1Z decompression with overrun testing
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include "config1z.h"
#define LZO_TEST_DECOMPRESS_OVERRUN
#define DO_DECOMPRESS lzo1z_decompress_safe
#include "lzo1x_d.ch"
|
Added work/contrib/lzo/lzo-1.08/src/lzo1z_d3.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
/* lzo1z_d3.c -- LZO1Z decompression with preset dictionary
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include "config1z.h"
#define lzo1x_decompress_dict_safe lzo1z_decompress_dict_safe
#include "lzo1x_d3.c"
|
Added work/contrib/lzo/lzo-1.08/src/lzo2a_9x.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
|
/* lzo2a_9x.c -- implementation of the LZO2A-999 compression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include <lzoconf.h>
#if !defined(LZO_999_UNSUPPORTED)
#include <stdio.h>
#include "config2a.h"
#if 0
#undef NDEBUG
#include <assert.h>
#endif
/***********************************************************************
//
************************************************************************/
#define THRESHOLD 1 /* lower limit for match length */
#define F 2048 /* upper limit for match length */
#define LZO2A
#define LZO_COMPRESS_T lzo2a_999_t
#define lzo_swd_t lzo2a_999_swd_t
#include "lzo_mchw.ch"
/***********************************************************************
//
************************************************************************/
#define putbyte(x) *op++ = LZO_BYTE(x)
#define putbits(j,x) \
if (k == 0) bitp = op++; \
SETBITS(j,x); \
if (k >= 8) { *bitp = LZO_BYTE(MASKBITS(8)); DUMPBITS(8); \
if (k > 0) bitp = op++; }
#define putbit(x) putbits(1,x)
/***********************************************************************
// this is a public function, but there is no prototype in a header file
************************************************************************/
LZO_EXTERN(int)
lzo2a_999_compress_callback ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem,
lzo_progress_callback_t cb,
lzo_uint max_chain );
LZO_PUBLIC(int)
lzo2a_999_compress_callback ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem,
lzo_progress_callback_t cb,
lzo_uint max_chain )
{
lzo_byte *op;
lzo_byte *bitp = 0;
lzo_uint m_len, m_off;
LZO_COMPRESS_T cc;
LZO_COMPRESS_T * const c = &cc;
lzo_swd_t * const swd = (lzo_swd_t *) wrkmem;
int r;
lzo_uint32 b = 0; /* bit buffer */
unsigned k = 0; /* bits in bit buffer */
#if defined(__LZO_QUERY_COMPRESS)
if (__LZO_IS_COMPRESS_QUERY(in,in_len,out,out_len,wrkmem))
return __LZO_QUERY_COMPRESS(in,in_len,out,out_len,wrkmem,1,lzo_sizeof(lzo_swd_t));
#endif
/* sanity check */
if (!lzo_assert(LZO2A_999_MEM_COMPRESS >= lzo_sizeof(lzo_swd_t)))
return LZO_E_ERROR;
c->init = 0;
c->ip = c->in = in;
c->in_end = in + in_len;
c->cb = cb;
c->m1 = c->m2 = c->m3 = c->m4 = 0;
op = out;
r = init_match(c,swd,NULL,0,0);
if (r != 0)
return r;
if (max_chain > 0)
swd->max_chain = max_chain;
r = find_match(c,swd,0,0);
if (r != 0)
return r;
while (c->look > 0)
{
int lazy_match_min_gain = 0;
int extra1 = 0;
int extra2 = 0;
lzo_uint ahead = 0;
LZO_UNUSED(extra1);
m_len = c->m_len;
m_off = c->m_off;
#if (N >= 8192)
if (m_off >= 8192)
{
if (m_len < M3_MIN_LEN)
m_len = 0;
else
lazy_match_min_gain = 1;
}
else
#endif
if (m_len >= M1_MIN_LEN && m_len <= M1_MAX_LEN && m_off <= 256)
{
lazy_match_min_gain = 2;
extra1 = 3;
extra2 = 2;
}
else if (m_len >= 10)
lazy_match_min_gain = 1;
else if (m_len >= 3)
{
lazy_match_min_gain = 1;
extra1 = 1;
}
else
m_len = 0;
/* try a lazy match */
if (lazy_match_min_gain > 0 && c->look > m_len)
{
int lit = swd->b_char;
r = find_match(c,swd,1,0);
assert(r == 0);
assert(c->look > 0);
#if (N >= 8192)
if (m_off < 8192 && c->m_off >= 8192)
lazy_match_min_gain += extra1;
else
#endif
if (m_len >= M1_MIN_LEN && m_len <= M1_MAX_LEN && m_off <= 256)
{
if (!(c->m_len >= M1_MIN_LEN &&
c->m_len <= M1_MAX_LEN && c->m_off <= 256))
lazy_match_min_gain += extra2;
}
if (c->m_len >= M1_MIN_LEN &&
c->m_len <= M1_MAX_LEN && c->m_off <= 256)
{
lazy_match_min_gain -= 1;
}
if (lazy_match_min_gain < 1)
lazy_match_min_gain = 1;
if (c->m_len >= m_len + lazy_match_min_gain)
{
c->lazy++;
#if !defined(NDEBUG)
m_len = c->m_len;
m_off = c->m_off;
assert(lzo_memcmp(c->ip - c->look, c->ip - c->look - m_off,
m_len) == 0);
assert(m_len >= 3 || (m_len >= 2 && m_off <= 256));
#endif
/* code literal */
putbit(0);
putbyte(lit);
c->lit_bytes++;
continue;
}
else
ahead = 1;
assert(m_len > 0);
}
if (m_len == 0)
{
/* a literal */
putbit(0);
putbyte(swd->b_char);
c->lit_bytes++;
r = find_match(c,swd,1,0);
assert(r == 0);
}
else
{
assert(m_len >= M1_MIN_LEN);
assert(m_off > 0);
assert(m_off <= N);
/* 2 - code match */
if (m_len >= M1_MIN_LEN && m_len <= M1_MAX_LEN && m_off <= 256)
{
putbit(1);
putbit(0);
putbits(2,m_len - M1_MIN_LEN);
putbyte(m_off - 1);
c->m1++;
}
#if (N >= 8192)
else if (m_off >= 8192)
{
unsigned len = m_len;
assert(m_len >= M3_MIN_LEN);
putbit(1);
putbit(1);
putbyte(m_off & 31);
putbyte(m_off >> 5);
putbit(1);
len -= M3_MIN_LEN - 1;
while (len > 255)
{
len -= 255;
putbyte(0);
}
putbyte(len);
c->m4++;
}
#endif
else
{
assert(m_len >= 3);
putbit(1);
putbit(1);
if (m_len <= 9)
{
putbyte(((m_len - 2) << 5) | (m_off & 31));
putbyte(m_off >> 5);
c->m2++;
}
else
{
lzo_uint len = m_len;
putbyte(m_off & 31);
putbyte(m_off >> 5);
#if (N >= 8192)
putbit(0);
#endif
len -= 10 - 1;
while (len > 255)
{
len -= 255;
putbyte(0);
}
putbyte(len);
c->m3++;
}
}
r = find_match(c,swd,m_len,1+ahead);
assert(r == 0);
}
c->codesize = op - out;
}
#if defined(LZO_EOF_CODE)
/* code EOF code */
putbit(1);
putbit(1);
putbyte(1 << 5);
putbyte(0);
#endif
/* flush remaining bits */
assert(k < CHAR_BIT);
if (k > 0)
{
assert(b == MASKBITS(k));
assert(op - bitp > 1);
*bitp = LZO_BYTE(MASKBITS(k));
DUMPBITS(k);
assert(b == 0);
assert(k == 0);
}
assert(c->textsize == in_len);
c->codesize = op - out;
*out_len = op - out;
if (c->cb)
(*c->cb)(c->textsize,c->codesize);
#if 0
printf("%ld -> %ld: %ld %ld %ld %ld %ld %ld\n",
(long) c->textsize, (long) c->codesize,
c->lit_bytes, c->m1, c->m2, c->m3, c->m4, c->lazy);
#endif
return LZO_E_OK;
}
/***********************************************************************
//
************************************************************************/
LZO_PUBLIC(int)
lzo2a_999_compress ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem )
{
return lzo2a_999_compress_callback(in,in_len,out,out_len,wrkmem,
(lzo_progress_callback_t) 0, 0);
}
#endif /* !defined(LZO_999_UNSUPPORTED) */
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo2a_d.ch.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
|
/* lzo2a_d.ch -- implementation of the LZO2A decompression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include "lzo1_d.ch"
#if defined(HAVE_ANY_IP) && defined(HAVE_ANY_OP)
/* too many local variables, cannot allocate registers */
# undef LZO_OPTIMIZE_GNUC_i386
#endif
/***********************************************************************
// decompress a block of data.
************************************************************************/
#define _NEEDBYTE NEED_IP(1)
#define _NEXTBYTE (*ip++)
LZO_PUBLIC(int)
DO_DECOMPRESS ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem )
{
#if defined(LZO_OPTIMIZE_GNUC_i386)
register lzo_byte *op __asm__("%edi");
register const lzo_byte *ip __asm__("%esi");
register const lzo_byte *m_pos __asm__("%ebx");
#else
register lzo_byte *op;
register const lzo_byte *ip;
register const lzo_byte *m_pos;
#endif
lzo_uint t;
const lzo_byte * const ip_end = in + in_len;
#if defined(HAVE_ANY_OP)
lzo_byte * const op_end = out + *out_len;
#endif
lzo_uint32 b = 0; /* bit buffer */
unsigned k = 0; /* bits in bit buffer */
LZO_UNUSED(wrkmem);
#if defined(__LZO_QUERY_DECOMPRESS)
if (__LZO_IS_DECOMPRESS_QUERY(in,in_len,out,out_len,wrkmem))
return __LZO_QUERY_DECOMPRESS(in,in_len,out,out_len,wrkmem,0,0);
#endif
op = out;
ip = in;
while (TEST_IP && TEST_OP)
{
NEEDBITS(1);
if (MASKBITS(1) == 0)
{
DUMPBITS(1);
/* a literal */
NEED_IP(1); NEED_OP(1);
*op++ = *ip++;
continue;
}
DUMPBITS(1);
NEEDBITS(1);
if (MASKBITS(1) == 0)
{
DUMPBITS(1);
/* a M1 match */
NEEDBITS(2);
t = M1_MIN_LEN + (lzo_uint) MASKBITS(2);
DUMPBITS(2);
NEED_IP(1); NEED_OP(t);
m_pos = op - 1 - *ip++;
assert(m_pos >= out); assert(m_pos < op);
TEST_LOOKBEHIND(m_pos,out);
MEMMOVE_DS(op,m_pos,t);
continue;
}
DUMPBITS(1);
NEED_IP(2);
t = *ip++;
m_pos = op;
m_pos -= (t & 31) | (((lzo_uint) *ip++) << 5);
t >>= 5;
if (t == 0)
{
#if (N >= 8192)
NEEDBITS(1);
t = MASKBITS(1);
DUMPBITS(1);
if (t == 0)
t = 10 - 1;
else
{
/* a M3 match */
m_pos -= 8192; /* t << 13 */
t = M3_MIN_LEN - 1;
}
#else
t = 10 - 1;
#endif
NEED_IP(1);
while (*ip == 0)
{
t += 255;
ip++;
NEED_IP(1);
}
t += *ip++;
}
else
{
#if defined(LZO_EOF_CODE)
if (m_pos == op)
goto eof_found;
#endif
t += 2;
}
assert(m_pos >= out); assert(m_pos < op);
TEST_LOOKBEHIND(m_pos,out);
NEED_OP(t);
MEMMOVE_DS(op,m_pos,t);
}
#if defined(LZO_EOF_CODE)
#if defined(HAVE_TEST_IP) || defined(HAVE_TEST_OP)
/* no EOF code was found */
*out_len = op - out;
return LZO_E_EOF_NOT_FOUND;
#endif
eof_found:
assert(t == 1);
#endif
*out_len = op - out;
return (ip == ip_end ? LZO_E_OK :
(ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN));
#if defined(HAVE_NEED_IP)
input_overrun:
*out_len = op - out;
return LZO_E_INPUT_OVERRUN;
#endif
#if defined(HAVE_NEED_OP)
output_overrun:
*out_len = op - out;
return LZO_E_OUTPUT_OVERRUN;
#endif
#if defined(LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND)
lookbehind_overrun:
*out_len = op - out;
return LZO_E_LOOKBEHIND_OVERRUN;
#endif
}
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo2a_d1.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/* lzo2a_d2.c -- LZO2A decompression with overrun testing
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include "config2a.h"
#undef LZO_TEST_DECOMPRESS_OVERRUN
#define DO_DECOMPRESS lzo2a_decompress
#include "lzo2a_d.ch"
|
Added work/contrib/lzo/lzo-1.08/src/lzo2a_d2.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/* lzo2a_d2.c -- LZO2A decompression with overrun testing
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include "config2a.h"
#define LZO_TEST_DECOMPRESS_OVERRUN
#define DO_DECOMPRESS lzo2a_decompress_safe
#include "lzo2a_d.ch"
|
Added work/contrib/lzo/lzo-1.08/src/lzo_conf.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
|
/* lzo_conf.h -- main internal configuration file for the the LZO library
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the library and is subject
to change.
*/
#ifndef __LZO_CONF_H
#define __LZO_CONF_H
#if !defined(__LZO_IN_MINILZO)
# ifndef __LZOCONF_H
# include <lzoconf.h>
# endif
#endif
/***********************************************************************
// memory checkers
************************************************************************/
#if defined(__BOUNDS_CHECKING_ON)
# include <unchecked.h>
#else
# define BOUNDS_CHECKING_OFF_DURING(stmt) stmt
# define BOUNDS_CHECKING_OFF_IN_EXPR(expr) (expr)
#endif
/***********************************************************************
// autoconf section
************************************************************************/
#if !defined(LZO_HAVE_CONFIG_H)
# include <stddef.h> /* ptrdiff_t, size_t */
# include <string.h> /* memcpy, memmove, memcmp, memset */
# if !defined(NO_STDLIB_H)
# include <stdlib.h>
# endif
# define HAVE_MEMCMP
# define HAVE_MEMCPY
# define HAVE_MEMMOVE
# define HAVE_MEMSET
#else
# include <sys/types.h>
# if defined(HAVE_STDDEF_H)
# include <stddef.h>
# endif
# if defined(STDC_HEADERS)
# include <string.h>
# include <stdlib.h>
# endif
#endif
#if defined(__LZO_DOS16) || defined(__LZO_WIN16)
# define HAVE_MALLOC_H
# define HAVE_HALLOC
#endif
#undef NDEBUG
#if !defined(LZO_DEBUG)
# define NDEBUG
#endif
#if defined(LZO_DEBUG) || !defined(NDEBUG)
# if !defined(NO_STDIO_H)
# include <stdio.h>
# endif
#endif
#include <assert.h>
#if !defined(LZO_COMPILE_TIME_ASSERT)
# define LZO_COMPILE_TIME_ASSERT(expr) \
{ typedef int __lzo_compile_time_assert_fail[1 - 2 * !(expr)]; }
#endif
#if !defined(LZO_UNUSED)
# if 1
# define LZO_UNUSED(var) ((void)&var)
# elif 0
# define LZO_UNUSED(var) { typedef int __lzo_unused[sizeof(var) ? 2 : 1]; }
# else
# define LZO_UNUSED(parm) (parm = parm)
# endif
#endif
#if !defined(__inline__) && !defined(__GNUC__)
# if defined(__cplusplus)
# define __inline__ inline
# else
# define __inline__ /* nothing */
# endif
#endif
#if defined(NO_MEMCMP)
# undef HAVE_MEMCMP
#endif
#if !defined(HAVE_MEMCMP)
# undef memcmp
# define memcmp lzo_memcmp
#endif
#if !defined(HAVE_MEMCPY)
# undef memcpy
# define memcpy lzo_memcpy
#endif
#if !defined(HAVE_MEMMOVE)
# undef memmove
# define memmove lzo_memmove
#endif
#if !defined(HAVE_MEMSET)
# undef memset
# define memset lzo_memset
#endif
/***********************************************************************
//
************************************************************************/
#if 0
# define LZO_BYTE(x) ((unsigned char) (x))
#else
# define LZO_BYTE(x) ((unsigned char) ((x) & 0xff))
#endif
#define LZO_MAX(a,b) ((a) >= (b) ? (a) : (b))
#define LZO_MIN(a,b) ((a) <= (b) ? (a) : (b))
#define LZO_MAX3(a,b,c) ((a) >= (b) ? LZO_MAX(a,c) : LZO_MAX(b,c))
#define LZO_MIN3(a,b,c) ((a) <= (b) ? LZO_MIN(a,c) : LZO_MIN(b,c))
#define lzo_sizeof(type) ((lzo_uint) (sizeof(type)))
#define LZO_HIGH(array) ((lzo_uint) (sizeof(array)/sizeof(*(array))))
/* this always fits into 16 bits */
#define LZO_SIZE(bits) (1u << (bits))
#define LZO_MASK(bits) (LZO_SIZE(bits) - 1)
#define LZO_LSIZE(bits) (1ul << (bits))
#define LZO_LMASK(bits) (LZO_LSIZE(bits) - 1)
#define LZO_USIZE(bits) ((lzo_uint) 1 << (bits))
#define LZO_UMASK(bits) (LZO_USIZE(bits) - 1)
/* Maximum value of a signed/unsigned type.
Do not use casts, avoid overflows ! */
#define LZO_STYPE_MAX(b) (((1l << (8*(b)-2)) - 1l) + (1l << (8*(b)-2)))
#define LZO_UTYPE_MAX(b) (((1ul << (8*(b)-1)) - 1ul) + (1ul << (8*(b)-1)))
/***********************************************************************
//
************************************************************************/
#if !defined(SIZEOF_UNSIGNED)
# if (UINT_MAX == 0xffff)
# define SIZEOF_UNSIGNED 2
# elif (UINT_MAX == LZO_0xffffffffL)
# define SIZEOF_UNSIGNED 4
# elif (UINT_MAX >= LZO_0xffffffffL)
# define SIZEOF_UNSIGNED 8
# else
# error "SIZEOF_UNSIGNED"
# endif
#endif
#if !defined(SIZEOF_UNSIGNED_LONG)
# if (ULONG_MAX == LZO_0xffffffffL)
# define SIZEOF_UNSIGNED_LONG 4
# elif (ULONG_MAX >= LZO_0xffffffffL)
# define SIZEOF_UNSIGNED_LONG 8
# else
# error "SIZEOF_UNSIGNED_LONG"
# endif
#endif
#if !defined(SIZEOF_SIZE_T)
# define SIZEOF_SIZE_T SIZEOF_UNSIGNED
#endif
#if !defined(SIZE_T_MAX)
# define SIZE_T_MAX LZO_UTYPE_MAX(SIZEOF_SIZE_T)
#endif
/***********************************************************************
// compiler and architecture specific stuff
************************************************************************/
/* Some defines that indicate if memory can be accessed at unaligned
* memory addresses. You should also test that this is actually faster
* even if it is allowed by your system.
*/
#if 1 && defined(__LZO_i386) && (UINT_MAX == LZO_0xffffffffL)
# if !defined(LZO_UNALIGNED_OK_2) && (USHRT_MAX == 0xffff)
# define LZO_UNALIGNED_OK_2
# endif
# if !defined(LZO_UNALIGNED_OK_4) && (LZO_UINT32_MAX == LZO_0xffffffffL)
# define LZO_UNALIGNED_OK_4
# endif
#endif
#if defined(LZO_UNALIGNED_OK_2) || defined(LZO_UNALIGNED_OK_4)
# if !defined(LZO_UNALIGNED_OK)
# define LZO_UNALIGNED_OK
# endif
#endif
#if defined(__LZO_NO_UNALIGNED)
# undef LZO_UNALIGNED_OK
# undef LZO_UNALIGNED_OK_2
# undef LZO_UNALIGNED_OK_4
#endif
#if defined(LZO_UNALIGNED_OK_2) && (USHRT_MAX != 0xffff)
# error "LZO_UNALIGNED_OK_2 must not be defined on this system"
#endif
#if defined(LZO_UNALIGNED_OK_4) && (LZO_UINT32_MAX != LZO_0xffffffffL)
# error "LZO_UNALIGNED_OK_4 must not be defined on this system"
#endif
/* Many modern processors can transfer 32bit words much faster than
* bytes - this can significantly speed decompression.
*/
#if defined(__LZO_NO_ALIGNED)
# undef LZO_ALIGNED_OK_4
#endif
#if defined(LZO_ALIGNED_OK_4) && (LZO_UINT32_MAX != LZO_0xffffffffL)
# error "LZO_ALIGNED_OK_4 must not be defined on this system"
#endif
/* Definitions for byte order, according to significance of bytes, from low
* addresses to high addresses. The value is what you get by putting '4'
* in the most significant byte, '3' in the second most significant byte,
* '2' in the second least significant byte, and '1' in the least
* significant byte.
* The byte order is only needed if we use LZO_UNALIGNED_OK.
*/
#define LZO_LITTLE_ENDIAN 1234
#define LZO_BIG_ENDIAN 4321
#define LZO_PDP_ENDIAN 3412
#if !defined(LZO_BYTE_ORDER)
# if defined(MFX_BYTE_ORDER)
# define LZO_BYTE_ORDER MFX_BYTE_ORDER
# elif defined(__LZO_i386)
# define LZO_BYTE_ORDER LZO_LITTLE_ENDIAN
# elif defined(BYTE_ORDER)
# define LZO_BYTE_ORDER BYTE_ORDER
# elif defined(__BYTE_ORDER)
# define LZO_BYTE_ORDER __BYTE_ORDER
# endif
#endif
#if defined(LZO_BYTE_ORDER)
# if (LZO_BYTE_ORDER != LZO_LITTLE_ENDIAN) && \
(LZO_BYTE_ORDER != LZO_BIG_ENDIAN)
# error "invalid LZO_BYTE_ORDER"
# endif
#endif
#if defined(LZO_UNALIGNED_OK) && !defined(LZO_BYTE_ORDER)
# error "LZO_BYTE_ORDER is not defined"
#endif
/***********************************************************************
// optimization
************************************************************************/
/* gcc 2.6.3 and gcc 2.7.2 have a bug with 'register xxx __asm__("%yyy")' */
#define LZO_OPTIMIZE_GNUC_i386_IS_BUGGY
/* Help the gcc optimizer with register allocation. */
#if defined(NDEBUG) && !defined(LZO_DEBUG) && !defined(__LZO_CHECKER)
# if defined(__GNUC__) && defined(__i386__)
# if !defined(LZO_OPTIMIZE_GNUC_i386_IS_BUGGY)
# define LZO_OPTIMIZE_GNUC_i386
# endif
# endif
#endif
/***********************************************************************
// some globals
************************************************************************/
__LZO_EXTERN_C int __lzo_init_done;
__LZO_EXTERN_C const lzo_byte __lzo_copyright[];
LZO_EXTERN(const lzo_byte *) lzo_copyright(void);
__LZO_EXTERN_C const lzo_uint32 _lzo_crc32_table[256];
/***********************************************************************
// ANSI C preprocessor macros
************************************************************************/
#define _LZO_STRINGIZE(x) #x
#define _LZO_MEXPAND(x) _LZO_STRINGIZE(x)
/* concatenate */
#define _LZO_CONCAT2(a,b) a ## b
#define _LZO_CONCAT3(a,b,c) a ## b ## c
#define _LZO_CONCAT4(a,b,c,d) a ## b ## c ## d
#define _LZO_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e
/* expand and concatenate (by using one level of indirection) */
#define _LZO_ECONCAT2(a,b) _LZO_CONCAT2(a,b)
#define _LZO_ECONCAT3(a,b,c) _LZO_CONCAT3(a,b,c)
#define _LZO_ECONCAT4(a,b,c,d) _LZO_CONCAT4(a,b,c,d)
#define _LZO_ECONCAT5(a,b,c,d,e) _LZO_CONCAT5(a,b,c,d,e)
/***********************************************************************
// Query-interface to the algorithms
************************************************************************/
#if 0
#define __LZO_IS_COMPRESS_QUERY(i,il,o,ol,w) ((lzo_voidp)(o) == (w))
#define __LZO_QUERY_COMPRESS(i,il,o,ol,w,n,s) \
(*ol = (n)*(s), LZO_E_OK)
#define __LZO_IS_DECOMPRESS_QUERY(i,il,o,ol,w) ((lzo_voidp)(o) == (w))
#define __LZO_QUERY_DECOMPRESS(i,il,o,ol,w,n,s) \
(*ol = (n)*(s), LZO_E_OK)
#define __LZO_IS_OPTIMIZE_QUERY(i,il,o,ol,w) ((lzo_voidp)(o) == (w))
#define __LZO_QUERY_OPTIMIZE(i,il,o,ol,w,n,s) \
(*ol = (n)*(s), LZO_E_OK)
#endif
/***********************************************************************
//
************************************************************************/
#include "lzo_ptr.h"
/* Generate compressed data in a deterministic way.
* This is fully portable, and compression can be faster as well.
* A reason NOT to be deterministic is when the block size is
* very small (e.g. 8kB) or the dictionary is big, because
* then the initialization of the dictionary becomes a relevant
* magnitude for compression speed.
*/
#define LZO_DETERMINISTIC
#define LZO_DICT_USE_PTR
#if defined(__LZO_DOS16) || defined(__LZO_WIN16) || defined(__LZO_STRICT_16BIT)
# undef LZO_DICT_USE_PTR
#endif
#if defined(LZO_DICT_USE_PTR)
# define lzo_dict_t const lzo_bytep
# define lzo_dict_p lzo_dict_t __LZO_MMODEL *
#else
# define lzo_dict_t lzo_uint
# define lzo_dict_p lzo_dict_t __LZO_MMODEL *
#endif
#if !defined(lzo_moff_t)
/* must be unsigned */
#define lzo_moff_t lzo_uint
#endif
#endif /* already included */
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo_crc.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
|
/* lzo_crc.c -- crc checksum for the the LZO library
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include "lzo_conf.h"
#include "lzo_util.h"
/***********************************************************************
// crc32 checksum
// adapted from free code by Mark Adler <madler@alumni.caltech.edu>
// see http://www.cdrom.com/pub/infozip/zlib/
************************************************************************/
const lzo_uint32 _lzo_crc32_table[256] = {
0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L,
0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L,
0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L,
0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL,
0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L,
0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L,
0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L,
0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL,
0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L,
0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL,
0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L,
0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L,
0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L,
0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL,
0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL,
0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L,
0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL,
0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L,
0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L,
0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L,
0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL,
0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L,
0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L,
0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL,
0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L,
0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L,
0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L,
0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L,
0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L,
0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL,
0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL,
0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L,
0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L,
0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL,
0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL,
0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L,
0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL,
0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L,
0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL,
0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L,
0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL,
0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L,
0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L,
0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL,
0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L,
0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L,
0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L,
0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L,
0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L,
0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L,
0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL,
0x2d02ef8dL
};
#if 1
#define LZO_DO1(buf,i) \
crc = _lzo_crc32_table[((int)crc ^ buf[i]) & 0xff] ^ (crc >> 8)
#else
#define LZO_DO1(buf,i) \
crc = _lzo_crc32_table[(unsigned char)((unsigned char)crc ^ buf[i])] ^ (crc >> 8)
#endif
#define LZO_DO2(buf,i) LZO_DO1(buf,i); LZO_DO1(buf,i+1);
#define LZO_DO4(buf,i) LZO_DO2(buf,i); LZO_DO2(buf,i+2);
#define LZO_DO8(buf,i) LZO_DO4(buf,i); LZO_DO4(buf,i+4);
#define LZO_DO16(buf,i) LZO_DO8(buf,i); LZO_DO8(buf,i+8);
LZO_PUBLIC(lzo_uint32)
lzo_crc32(lzo_uint32 c, const lzo_byte *buf, lzo_uint len)
{
lzo_uint32 crc = (c & LZO_0xffffffffL) ^ LZO_0xffffffffL;
if (buf == NULL)
return 0;
if (len >= 16) do
{
LZO_DO16(buf,0);
buf += 16;
len -= 16;
} while (len >= 16);
if (len != 0) do
{
LZO_DO1(buf,0);
buf += 1;
len -= 1;
} while (len > 0);
return crc ^ LZO_0xffffffffL;
}
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo_dict.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
|
/* lzo_dict.h -- dictionary definitions for the the LZO library
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the library and is subject
to change.
*/
#ifndef __LZO_DICT_H
#define __LZO_DICT_H
#ifdef __cplusplus
extern "C" {
#endif
/***********************************************************************
// dictionary size
************************************************************************/
/* dictionary needed for compression */
#if !defined(D_BITS) && defined(DBITS)
# define D_BITS DBITS
#endif
#if !defined(D_BITS)
# error "D_BITS is not defined"
#endif
#if (D_BITS < 16)
# define D_SIZE LZO_SIZE(D_BITS)
# define D_MASK LZO_MASK(D_BITS)
#else
# define D_SIZE LZO_USIZE(D_BITS)
# define D_MASK LZO_UMASK(D_BITS)
#endif
#define D_HIGH ((D_MASK >> 1) + 1)
/* dictionary depth */
#if !defined(DD_BITS)
# define DD_BITS 0
#endif
#define DD_SIZE LZO_SIZE(DD_BITS)
#define DD_MASK LZO_MASK(DD_BITS)
/* dictionary length */
#if !defined(DL_BITS)
# define DL_BITS (D_BITS - DD_BITS)
#endif
#if (DL_BITS < 16)
# define DL_SIZE LZO_SIZE(DL_BITS)
# define DL_MASK LZO_MASK(DL_BITS)
#else
# define DL_SIZE LZO_USIZE(DL_BITS)
# define DL_MASK LZO_UMASK(DL_BITS)
#endif
#if (D_BITS != DL_BITS + DD_BITS)
# error "D_BITS does not match"
#endif
#if (D_BITS < 8 || D_BITS > 18)
# error "invalid D_BITS"
#endif
#if (DL_BITS < 8 || DL_BITS > 20)
# error "invalid DL_BITS"
#endif
#if (DD_BITS < 0 || DD_BITS > 6)
# error "invalid DD_BITS"
#endif
#if !defined(DL_MIN_LEN)
# define DL_MIN_LEN 3
#endif
#if !defined(DL_SHIFT)
# define DL_SHIFT ((DL_BITS + (DL_MIN_LEN - 1)) / DL_MIN_LEN)
#endif
/***********************************************************************
// dictionary access
************************************************************************/
#define LZO_HASH_GZIP 1
#define LZO_HASH_GZIP_INCREMENTAL 2
#define LZO_HASH_LZO_INCREMENTAL_A 3
#define LZO_HASH_LZO_INCREMENTAL_B 4
#if !defined(LZO_HASH)
# error "choose a hashing strategy"
#endif
#if (DL_MIN_LEN == 3)
# define _DV2_A(p,shift1,shift2) \
(((( (lzo_uint32)((p)[0]) << shift1) ^ (p)[1]) << shift2) ^ (p)[2])
# define _DV2_B(p,shift1,shift2) \
(((( (lzo_uint32)((p)[2]) << shift1) ^ (p)[1]) << shift2) ^ (p)[0])
# define _DV3_B(p,shift1,shift2,shift3) \
((_DV2_B((p)+1,shift1,shift2) << (shift3)) ^ (p)[0])
#elif (DL_MIN_LEN == 2)
# define _DV2_A(p,shift1,shift2) \
(( (lzo_uint32)(p[0]) << shift1) ^ p[1])
# define _DV2_B(p,shift1,shift2) \
(( (lzo_uint32)(p[1]) << shift1) ^ p[2])
#else
# error "invalid DL_MIN_LEN"
#endif
#define _DV_A(p,shift) _DV2_A(p,shift,shift)
#define _DV_B(p,shift) _DV2_B(p,shift,shift)
#define DA2(p,s1,s2) \
(((((lzo_uint32)((p)[2]) << (s2)) + (p)[1]) << (s1)) + (p)[0])
#define DS2(p,s1,s2) \
(((((lzo_uint32)((p)[2]) << (s2)) - (p)[1]) << (s1)) - (p)[0])
#define DX2(p,s1,s2) \
(((((lzo_uint32)((p)[2]) << (s2)) ^ (p)[1]) << (s1)) ^ (p)[0])
#define DA3(p,s1,s2,s3) ((DA2((p)+1,s2,s3) << (s1)) + (p)[0])
#define DS3(p,s1,s2,s3) ((DS2((p)+1,s2,s3) << (s1)) - (p)[0])
#define DX3(p,s1,s2,s3) ((DX2((p)+1,s2,s3) << (s1)) ^ (p)[0])
#define DMS(v,s) ((lzo_uint) (((v) & (D_MASK >> (s))) << (s)))
#define DM(v) DMS(v,0)
#if (LZO_HASH == LZO_HASH_GZIP)
/* hash function like in gzip/zlib (deflate) */
# define _DINDEX(dv,p) (_DV_A((p),DL_SHIFT))
#elif (LZO_HASH == LZO_HASH_GZIP_INCREMENTAL)
/* incremental hash like in gzip/zlib (deflate) */
# define __LZO_HASH_INCREMENTAL
# define DVAL_FIRST(dv,p) dv = _DV_A((p),DL_SHIFT)
# define DVAL_NEXT(dv,p) dv = (((dv) << DL_SHIFT) ^ p[2])
# define _DINDEX(dv,p) (dv)
# define DVAL_LOOKAHEAD DL_MIN_LEN
#elif (LZO_HASH == LZO_HASH_LZO_INCREMENTAL_A)
/* incremental LZO hash version A */
# define __LZO_HASH_INCREMENTAL
# define DVAL_FIRST(dv,p) dv = _DV_A((p),5)
# define DVAL_NEXT(dv,p) \
dv ^= (lzo_uint32)(p[-1]) << (2*5); dv = (((dv) << 5) ^ p[2])
# define _DINDEX(dv,p) ((0x9f5f * (dv)) >> 5)
# define DVAL_LOOKAHEAD DL_MIN_LEN
#elif (LZO_HASH == LZO_HASH_LZO_INCREMENTAL_B)
/* incremental LZO hash version B */
# define __LZO_HASH_INCREMENTAL
# define DVAL_FIRST(dv,p) dv = _DV_B((p),5)
# define DVAL_NEXT(dv,p) \
dv ^= p[-1]; dv = (((dv) >> 5) ^ ((lzo_uint32)(p[2]) << (2*5)))
# define _DINDEX(dv,p) ((0x9f5f * (dv)) >> 5)
# define DVAL_LOOKAHEAD DL_MIN_LEN
#else
# error "choose a hashing strategy"
#endif
#ifndef DINDEX
#define DINDEX(dv,p) ((lzo_uint)((_DINDEX(dv,p)) & DL_MASK) << DD_BITS)
#endif
#if !defined(DINDEX1) && defined(D_INDEX1)
#define DINDEX1 D_INDEX1
#endif
#if !defined(DINDEX2) && defined(D_INDEX2)
#define DINDEX2 D_INDEX2
#endif
#if !defined(__LZO_HASH_INCREMENTAL)
# define DVAL_FIRST(dv,p) ((void) 0)
# define DVAL_NEXT(dv,p) ((void) 0)
# define DVAL_LOOKAHEAD 0
#endif
#if !defined(DVAL_ASSERT)
#if defined(__LZO_HASH_INCREMENTAL) && !defined(NDEBUG)
static void DVAL_ASSERT(lzo_uint32 dv, const lzo_byte *p)
{
lzo_uint32 df;
DVAL_FIRST(df,(p));
assert(DINDEX(dv,p) == DINDEX(df,p));
}
#else
# define DVAL_ASSERT(dv,p) ((void) 0)
#endif
#endif
/***********************************************************************
// dictionary updating
************************************************************************/
#if defined(LZO_DICT_USE_PTR)
# define DENTRY(p,in) (p)
# define GINDEX(m_pos,m_off,dict,dindex,in) m_pos = dict[dindex]
#else
# define DENTRY(p,in) ((lzo_uint) ((p)-(in)))
# define GINDEX(m_pos,m_off,dict,dindex,in) m_off = dict[dindex]
#endif
#if (DD_BITS == 0)
# define UPDATE_D(dict,drun,dv,p,in) dict[ DINDEX(dv,p) ] = DENTRY(p,in)
# define UPDATE_I(dict,drun,index,p,in) dict[index] = DENTRY(p,in)
# define UPDATE_P(ptr,drun,p,in) (ptr)[0] = DENTRY(p,in)
#else
# define UPDATE_D(dict,drun,dv,p,in) \
dict[ DINDEX(dv,p) + drun++ ] = DENTRY(p,in); drun &= DD_MASK
# define UPDATE_I(dict,drun,index,p,in) \
dict[ (index) + drun++ ] = DENTRY(p,in); drun &= DD_MASK
# define UPDATE_P(ptr,drun,p,in) \
(ptr) [ drun++ ] = DENTRY(p,in); drun &= DD_MASK
#endif
/***********************************************************************
// test for a match
************************************************************************/
#if defined(LZO_DICT_USE_PTR)
/* m_pos is either NULL or a valid pointer */
#define LZO_CHECK_MPOS_DET(m_pos,m_off,in,ip,max_offset) \
(m_pos == NULL || (m_off = (lzo_moff_t) (ip - m_pos)) > max_offset)
/* m_pos may point anywhere... */
#define LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,max_offset) \
(BOUNDS_CHECKING_OFF_IN_EXPR( \
(PTR_LT(m_pos,in) || \
(m_off = (lzo_moff_t) PTR_DIFF(ip,m_pos)) <= 0 || \
m_off > max_offset) ))
#else
#define LZO_CHECK_MPOS_DET(m_pos,m_off,in,ip,max_offset) \
(m_off == 0 || \
((m_off = (lzo_moff_t) ((ip)-(in)) - m_off) > max_offset) || \
(m_pos = (ip) - (m_off), 0) )
#define LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,max_offset) \
((lzo_moff_t) ((ip)-(in)) <= m_off || \
((m_off = (lzo_moff_t) ((ip)-(in)) - m_off) > max_offset) || \
(m_pos = (ip) - (m_off), 0) )
#endif
#if defined(LZO_DETERMINISTIC)
# define LZO_CHECK_MPOS LZO_CHECK_MPOS_DET
#else
# define LZO_CHECK_MPOS LZO_CHECK_MPOS_NON_DET
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* already included */
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo_dll.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
/* lzo_dll.c -- DLL initialization of the LZO library
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include "lzo_conf.h"
#if defined(LZO_BUILD_DLL)
/***********************************************************************
// Windows 16 bit + Watcom C + DLL
************************************************************************/
#if defined(__LZO_WIN16) && defined(__WATCOMC__) && defined(__SW_BD)
/* don't pull in <windows.h> - we don't need it */
#if 0
#include <windows.h>
#endif
#pragma off (unreferenced);
#if 0 && defined(WINVER)
BOOL FAR PASCAL LibMain ( HANDLE hInstance, WORD wDataSegment,
WORD wHeapSize, LPSTR lpszCmdLine )
#else
int __far __pascal LibMain ( int a, short b, short c, long d )
#endif
#pragma on (unreferenced);
{
return 1;
}
#endif
#endif /* defined(LZO_BUILD_DLL) */
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo_init.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
|
/* lzo_init.c -- initialization of the LZO library
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include "lzo_conf.h"
#include "lzo_util.h"
#if 0
# define IS_SIGNED(type) (((type) (1ul << (8 * sizeof(type) - 1))) < 0)
# define IS_UNSIGNED(type) (((type) (1ul << (8 * sizeof(type) - 1))) > 0)
#else
# define IS_SIGNED(type) (((type) (-1)) < ((type) 0))
# define IS_UNSIGNED(type) (((type) (-1)) > ((type) 0))
#endif
#define IS_POWER_OF_2(x) (((x) & ((x) - 1)) == 0)
/***********************************************************************
// Runtime check of the assumptions about the size of builtin types,
// memory model, byte order and other low-level constructs.
//
// We are really paranoid here - LZO should either fail (or crash)
// at startup or not at all.
//
// Because of inlining much of these functions evaluates to nothing.
************************************************************************/
static lzo_bool schedule_insns_bug(void); /* avoid inlining */
static lzo_bool strength_reduce_bug(int *); /* avoid inlining */
#if 0 || defined(LZO_DEBUG)
#include <stdio.h>
static lzo_bool __lzo_assert_fail(const char *s, unsigned line)
{
#if defined(__palmos__)
printf("LZO assertion failed in line %u: '%s'\n",line,s);
#else
fprintf(stderr,"LZO assertion failed in line %u: '%s'\n",line,s);
#endif
return 0;
}
# define __lzo_assert(x) ((x) ? 1 : __lzo_assert_fail(#x,__LINE__))
#else
# define __lzo_assert(x) ((x) ? 1 : 0)
#endif
#undef COMPILE_TIME_ASSERT
#if 0
# define COMPILE_TIME_ASSERT(expr) r &= __lzo_assert(expr)
#else
# define COMPILE_TIME_ASSERT(expr) LZO_COMPILE_TIME_ASSERT(expr)
#endif
/***********************************************************************
// The next two functions should get completely optimized out of existance.
// Some assertions are redundant - but included for clarity.
************************************************************************/
static lzo_bool basic_integral_check(void)
{
lzo_bool r = 1;
/* paranoia */
COMPILE_TIME_ASSERT(CHAR_BIT == 8);
COMPILE_TIME_ASSERT(sizeof(char) == 1);
COMPILE_TIME_ASSERT(sizeof(short) >= 2);
COMPILE_TIME_ASSERT(sizeof(long) >= 4);
COMPILE_TIME_ASSERT(sizeof(int) >= sizeof(short));
COMPILE_TIME_ASSERT(sizeof(long) >= sizeof(int));
COMPILE_TIME_ASSERT(sizeof(lzo_uint) == sizeof(lzo_int));
COMPILE_TIME_ASSERT(sizeof(lzo_uint32) == sizeof(lzo_int32));
COMPILE_TIME_ASSERT(sizeof(lzo_uint32) >= 4);
COMPILE_TIME_ASSERT(sizeof(lzo_uint32) >= sizeof(unsigned));
#if defined(__LZO_STRICT_16BIT)
COMPILE_TIME_ASSERT(sizeof(lzo_uint) == 2);
#else
COMPILE_TIME_ASSERT(sizeof(lzo_uint) >= 4);
COMPILE_TIME_ASSERT(sizeof(lzo_uint) >= sizeof(unsigned));
#endif
/* paranoia - check <limits.h> header */
#if (USHRT_MAX == 65535u)
COMPILE_TIME_ASSERT(sizeof(short) == 2);
#elif (USHRT_MAX == LZO_0xffffffffL)
COMPILE_TIME_ASSERT(sizeof(short) == 4);
#elif (USHRT_MAX >= LZO_0xffffffffL)
COMPILE_TIME_ASSERT(sizeof(short) > 4);
#endif
#if (UINT_MAX == 65535u)
COMPILE_TIME_ASSERT(sizeof(int) == 2);
#elif (UINT_MAX == LZO_0xffffffffL)
COMPILE_TIME_ASSERT(sizeof(int) == 4);
#elif (UINT_MAX >= LZO_0xffffffffL)
COMPILE_TIME_ASSERT(sizeof(int) > 4);
#endif
#if (ULONG_MAX == 65535ul)
COMPILE_TIME_ASSERT(sizeof(long) == 2);
#elif (ULONG_MAX == LZO_0xffffffffL)
COMPILE_TIME_ASSERT(sizeof(long) == 4);
#elif (ULONG_MAX >= LZO_0xffffffffL)
COMPILE_TIME_ASSERT(sizeof(long) > 4);
#endif
#if defined(SIZEOF_UNSIGNED)
COMPILE_TIME_ASSERT(SIZEOF_UNSIGNED == sizeof(unsigned));
#endif
#if defined(SIZEOF_UNSIGNED_LONG)
COMPILE_TIME_ASSERT(SIZEOF_UNSIGNED_LONG == sizeof(unsigned long));
#endif
#if defined(SIZEOF_UNSIGNED_SHORT)
COMPILE_TIME_ASSERT(SIZEOF_UNSIGNED_SHORT == sizeof(unsigned short));
#endif
#if !defined(__LZO_IN_MINILZO)
#if defined(SIZEOF_SIZE_T)
COMPILE_TIME_ASSERT(SIZEOF_SIZE_T == sizeof(size_t));
#endif
#endif
/* assert the signedness of our integral types */
COMPILE_TIME_ASSERT(IS_UNSIGNED(unsigned char));
COMPILE_TIME_ASSERT(IS_UNSIGNED(unsigned short));
COMPILE_TIME_ASSERT(IS_UNSIGNED(unsigned));
COMPILE_TIME_ASSERT(IS_UNSIGNED(unsigned long));
COMPILE_TIME_ASSERT(IS_SIGNED(short));
COMPILE_TIME_ASSERT(IS_SIGNED(int));
COMPILE_TIME_ASSERT(IS_SIGNED(long));
COMPILE_TIME_ASSERT(IS_UNSIGNED(lzo_uint32));
COMPILE_TIME_ASSERT(IS_UNSIGNED(lzo_uint));
COMPILE_TIME_ASSERT(IS_SIGNED(lzo_int32));
COMPILE_TIME_ASSERT(IS_SIGNED(lzo_int));
COMPILE_TIME_ASSERT(INT_MAX == LZO_STYPE_MAX(sizeof(int)));
COMPILE_TIME_ASSERT(UINT_MAX == LZO_UTYPE_MAX(sizeof(unsigned)));
COMPILE_TIME_ASSERT(LONG_MAX == LZO_STYPE_MAX(sizeof(long)));
COMPILE_TIME_ASSERT(ULONG_MAX == LZO_UTYPE_MAX(sizeof(unsigned long)));
COMPILE_TIME_ASSERT(SHRT_MAX == LZO_STYPE_MAX(sizeof(short)));
COMPILE_TIME_ASSERT(USHRT_MAX == LZO_UTYPE_MAX(sizeof(unsigned short)));
COMPILE_TIME_ASSERT(LZO_UINT32_MAX == LZO_UTYPE_MAX(sizeof(lzo_uint32)));
COMPILE_TIME_ASSERT(LZO_UINT_MAX == LZO_UTYPE_MAX(sizeof(lzo_uint)));
#if !defined(__LZO_IN_MINILZO)
COMPILE_TIME_ASSERT(SIZE_T_MAX == LZO_UTYPE_MAX(sizeof(size_t)));
#endif
r &= __lzo_assert(LZO_BYTE(257) == 1);
return r;
}
static lzo_bool basic_ptr_check(void)
{
lzo_bool r = 1;
COMPILE_TIME_ASSERT(sizeof(char *) >= sizeof(int));
COMPILE_TIME_ASSERT(sizeof(lzo_byte *) >= sizeof(char *));
COMPILE_TIME_ASSERT(sizeof(lzo_voidp) == sizeof(lzo_byte *));
COMPILE_TIME_ASSERT(sizeof(lzo_voidp) == sizeof(lzo_voidpp));
COMPILE_TIME_ASSERT(sizeof(lzo_voidp) == sizeof(lzo_bytepp));
COMPILE_TIME_ASSERT(sizeof(lzo_voidp) >= sizeof(lzo_uint));
COMPILE_TIME_ASSERT(sizeof(lzo_ptr_t) == sizeof(lzo_voidp));
COMPILE_TIME_ASSERT(sizeof(lzo_ptr_t) == sizeof(lzo_sptr_t));
COMPILE_TIME_ASSERT(sizeof(lzo_ptr_t) >= sizeof(lzo_uint));
COMPILE_TIME_ASSERT(sizeof(lzo_ptrdiff_t) >= 4);
COMPILE_TIME_ASSERT(sizeof(lzo_ptrdiff_t) >= sizeof(ptrdiff_t));
COMPILE_TIME_ASSERT(sizeof(ptrdiff_t) >= sizeof(size_t));
COMPILE_TIME_ASSERT(sizeof(lzo_ptrdiff_t) >= sizeof(lzo_uint));
#if defined(SIZEOF_CHAR_P)
COMPILE_TIME_ASSERT(SIZEOF_CHAR_P == sizeof(char *));
#endif
#if defined(SIZEOF_PTRDIFF_T)
COMPILE_TIME_ASSERT(SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t));
#endif
/* assert the signedness of our integral types */
COMPILE_TIME_ASSERT(IS_SIGNED(ptrdiff_t));
COMPILE_TIME_ASSERT(IS_UNSIGNED(size_t));
COMPILE_TIME_ASSERT(IS_SIGNED(lzo_ptrdiff_t));
COMPILE_TIME_ASSERT(IS_SIGNED(lzo_sptr_t));
COMPILE_TIME_ASSERT(IS_UNSIGNED(lzo_ptr_t));
COMPILE_TIME_ASSERT(IS_UNSIGNED(lzo_moff_t));
return r;
}
/***********************************************************************
//
************************************************************************/
static lzo_bool ptr_check(void)
{
lzo_bool r = 1;
int i;
char _wrkmem[10 * sizeof(lzo_byte *) + sizeof(lzo_full_align_t)];
lzo_bytep wrkmem;
lzo_bytepp dict;
unsigned char x[4 * sizeof(lzo_full_align_t)];
long d;
lzo_full_align_t a;
lzo_full_align_t u;
for (i = 0; i < (int) sizeof(x); i++)
x[i] = LZO_BYTE(i);
wrkmem = LZO_PTR_ALIGN_UP((lzo_byte *)_wrkmem,sizeof(lzo_full_align_t));
#if 0
dict = (lzo_bytepp) wrkmem;
#else
/* Avoid a compiler warning on architectures that
* do not allow unaligned access. */
u.a_lzo_bytep = wrkmem; dict = u.a_lzo_bytepp;
#endif
d = (long) ((const lzo_bytep) dict - (const lzo_bytep) _wrkmem);
r &= __lzo_assert(d >= 0);
r &= __lzo_assert(d < (long) sizeof(lzo_full_align_t));
memset(&a,0,sizeof(a));
r &= __lzo_assert(a.a_lzo_voidp == NULL);
memset(&a,0xff,sizeof(a));
r &= __lzo_assert(a.a_ushort == USHRT_MAX);
r &= __lzo_assert(a.a_uint == UINT_MAX);
r &= __lzo_assert(a.a_ulong == ULONG_MAX);
r &= __lzo_assert(a.a_lzo_uint == LZO_UINT_MAX);
r &= __lzo_assert(a.a_lzo_uint32 == LZO_UINT32_MAX);
/* sanity check of the memory model */
if (r == 1)
{
for (i = 0; i < 8; i++)
r &= __lzo_assert((const lzo_voidp) (&dict[i]) == (const lzo_voidp) (&wrkmem[i * sizeof(lzo_byte *)]));
}
/* check BZERO8_PTR and that NULL == 0 */
memset(&a,0,sizeof(a));
r &= __lzo_assert(a.a_char_p == NULL);
r &= __lzo_assert(a.a_lzo_bytep == NULL);
r &= __lzo_assert(NULL == (void *)0);
if (r == 1)
{
for (i = 0; i < 10; i++)
dict[i] = wrkmem;
BZERO8_PTR(dict+1,sizeof(dict[0]),8);
r &= __lzo_assert(dict[0] == wrkmem);
for (i = 1; i < 9; i++)
r &= __lzo_assert(dict[i] == NULL);
r &= __lzo_assert(dict[9] == wrkmem);
}
/* check that the pointer constructs work as expected */
if (r == 1)
{
unsigned k = 1;
const unsigned n = (unsigned) sizeof(lzo_uint32);
lzo_byte *p0;
lzo_byte *p1;
k += __lzo_align_gap(&x[k],n);
p0 = (lzo_bytep) &x[k];
#if defined(PTR_LINEAR)
r &= __lzo_assert((PTR_LINEAR(p0) & (n-1)) == 0);
#else
r &= __lzo_assert(n == 4);
r &= __lzo_assert(PTR_ALIGNED_4(p0));
#endif
r &= __lzo_assert(k >= 1);
p1 = (lzo_bytep) &x[1];
r &= __lzo_assert(PTR_GE(p0,p1));
r &= __lzo_assert(k < 1+n);
p1 = (lzo_bytep) &x[1+n];
r &= __lzo_assert(PTR_LT(p0,p1));
/* now check that aligned memory access doesn't core dump */
if (r == 1)
{
lzo_uint32 v0, v1;
#if 0
v0 = * (lzo_uint32 *) &x[k];
v1 = * (lzo_uint32 *) &x[k+n];
#else
/* Avoid compiler warnings on architectures that
* do not allow unaligned access. */
u.a_uchar_p = &x[k];
v0 = *u.a_lzo_uint32_p;
u.a_uchar_p = &x[k+n];
v1 = *u.a_lzo_uint32_p;
#endif
r &= __lzo_assert(v0 > 0);
r &= __lzo_assert(v1 > 0);
}
}
return r;
}
/***********************************************************************
//
************************************************************************/
LZO_PUBLIC(int)
_lzo_config_check(void)
{
lzo_bool r = 1;
int i;
union {
lzo_uint32 a;
unsigned short b;
lzo_uint32 aa[4];
unsigned char x[4*sizeof(lzo_full_align_t)];
} u;
/* check that the compiler correctly casts signed to unsigned */
COMPILE_TIME_ASSERT( (int) ((unsigned char) ((signed char) -1)) == 255);
/* check that the compiler correctly promotes integrals */
COMPILE_TIME_ASSERT( (((unsigned char)128) << (int)(8*sizeof(int)-8)) < 0);
#if 0
/* paranoia - the following is guaranteed by definition anyway */
r &= __lzo_assert((const void *)&u == (const void *)&u.a);
r &= __lzo_assert((const void *)&u == (const void *)&u.b);
r &= __lzo_assert((const void *)&u == (const void *)&u.x[0]);
r &= __lzo_assert((const void *)&u == (const void *)&u.aa[0]);
#endif
r &= basic_integral_check();
r &= basic_ptr_check();
if (r != 1)
return LZO_E_ERROR;
u.a = 0; u.b = 0;
for (i = 0; i < (int) sizeof(u.x); i++)
u.x[i] = LZO_BYTE(i);
/* check LZO_BYTE_ORDER */
#if defined(LZO_BYTE_ORDER)
if (r == 1)
{
# if (LZO_BYTE_ORDER == LZO_LITTLE_ENDIAN)
lzo_uint32 a = (lzo_uint32) (u.a & LZO_0xffffffffL);
unsigned short b = (unsigned short) (u.b & 0xffff);
r &= __lzo_assert(a == 0x03020100L);
r &= __lzo_assert(b == 0x0100);
# elif (LZO_BYTE_ORDER == LZO_BIG_ENDIAN)
lzo_uint32 a = u.a >> (8 * sizeof(u.a) - 32);
unsigned short b = u.b >> (8 * sizeof(u.b) - 16);
r &= __lzo_assert(a == 0x00010203L);
r &= __lzo_assert(b == 0x0001);
# else
# error "invalid LZO_BYTE_ORDER"
# endif
}
#endif
/* check that unaligned memory access works as expected */
#if defined(LZO_UNALIGNED_OK_2)
COMPILE_TIME_ASSERT(sizeof(short) == 2);
if (r == 1)
{
unsigned short b[4];
for (i = 0; i < 4; i++)
b[i] = * (const unsigned short *) &u.x[i];
# if (LZO_BYTE_ORDER == LZO_LITTLE_ENDIAN)
r &= __lzo_assert(b[0] == 0x0100);
r &= __lzo_assert(b[1] == 0x0201);
r &= __lzo_assert(b[2] == 0x0302);
r &= __lzo_assert(b[3] == 0x0403);
# elif (LZO_BYTE_ORDER == LZO_BIG_ENDIAN)
r &= __lzo_assert(b[0] == 0x0001);
r &= __lzo_assert(b[1] == 0x0102);
r &= __lzo_assert(b[2] == 0x0203);
r &= __lzo_assert(b[3] == 0x0304);
# endif
}
#endif
#if defined(LZO_UNALIGNED_OK_4)
COMPILE_TIME_ASSERT(sizeof(lzo_uint32) == 4);
if (r == 1)
{
lzo_uint32 a[4];
for (i = 0; i < 4; i++)
a[i] = * (const lzo_uint32 *) &u.x[i];
# if (LZO_BYTE_ORDER == LZO_LITTLE_ENDIAN)
r &= __lzo_assert(a[0] == 0x03020100L);
r &= __lzo_assert(a[1] == 0x04030201L);
r &= __lzo_assert(a[2] == 0x05040302L);
r &= __lzo_assert(a[3] == 0x06050403L);
# elif (LZO_BYTE_ORDER == LZO_BIG_ENDIAN)
r &= __lzo_assert(a[0] == 0x00010203L);
r &= __lzo_assert(a[1] == 0x01020304L);
r &= __lzo_assert(a[2] == 0x02030405L);
r &= __lzo_assert(a[3] == 0x03040506L);
# endif
}
#endif
#if defined(LZO_ALIGNED_OK_4)
COMPILE_TIME_ASSERT(sizeof(lzo_uint32) == 4);
#endif
COMPILE_TIME_ASSERT(lzo_sizeof_dict_t == sizeof(lzo_dict_t));
/* save space and don't require linking in the lzo_adler32() function */
#if defined(__LZO_IN_MINLZO)
/* check the lzo_adler32() function */
if (r == 1)
{
lzo_uint32 adler;
adler = lzo_adler32(0, NULL, 0);
adler = lzo_adler32(adler, lzo_copyright(), 200);
r &= __lzo_assert(adler == 0xc76f1751L);
}
#endif
/* check for the gcc schedule-insns optimization bug */
if (r == 1)
{
r &= __lzo_assert(!schedule_insns_bug());
}
/* check for the gcc strength-reduce optimization bug */
if (r == 1)
{
static int x[3];
static unsigned xn = 3;
register unsigned j;
for (j = 0; j < xn; j++)
x[j] = (int)j - 3;
r &= __lzo_assert(!strength_reduce_bug(x));
}
/* now for the low-level pointer checks */
if (r == 1)
{
r &= ptr_check();
}
return r == 1 ? LZO_E_OK : LZO_E_ERROR;
}
static lzo_bool schedule_insns_bug(void)
{
#if defined(__LZO_CHECKER)
/* for some reason checker complains about uninitialized memory access */
return 0;
#else
const int clone[] = {1, 2, 0};
const int *q;
q = clone;
return (*q) ? 0 : 1;
#endif
}
static lzo_bool strength_reduce_bug(int *x)
{
return x[0] != -3 || x[1] != -2 || x[2] != -1;
}
#undef COMPILE_TIME_ASSERT
/***********************************************************************
//
************************************************************************/
int __lzo_init_done = 0;
LZO_PUBLIC(int)
__lzo_init2(unsigned v, int s1, int s2, int s3, int s4, int s5,
int s6, int s7, int s8, int s9)
{
int r;
__lzo_init_done = 1;
if (v == 0)
return LZO_E_ERROR;
r = (s1 == -1 || s1 == (int) sizeof(short)) &&
(s2 == -1 || s2 == (int) sizeof(int)) &&
(s3 == -1 || s3 == (int) sizeof(long)) &&
(s4 == -1 || s4 == (int) sizeof(lzo_uint32)) &&
(s5 == -1 || s5 == (int) sizeof(lzo_uint)) &&
(s6 == -1 || s6 == (int) lzo_sizeof_dict_t) &&
(s7 == -1 || s7 == (int) sizeof(char *)) &&
(s8 == -1 || s8 == (int) sizeof(lzo_voidp)) &&
(s9 == -1 || s9 == (int) sizeof(lzo_compress_t));
if (!r)
return LZO_E_ERROR;
r = _lzo_config_check();
if (r != LZO_E_OK)
return r;
return r;
}
/***********************************************************************
// backward compatibility with v1.01
************************************************************************/
#if !defined(__LZO_IN_MINILZO)
LZO_EXTERN(int)
__lzo_init(unsigned v,int s1,int s2,int s3,int s4,int s5,int s6,int s7);
LZO_PUBLIC(int)
__lzo_init(unsigned v,int s1,int s2,int s3,int s4,int s5,int s6,int s7)
{
if (v == 0 || v > 0x1010)
return LZO_E_ERROR;
return __lzo_init2(v,s1,s2,s3,s4,s5,-1,-1,s6,s7);
}
#endif
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo_mchw.ch.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
|
/* lzo_mchw.ch -- matching functions using a window
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/***********************************************************************
//
************************************************************************/
typedef struct
{
int init;
lzo_uint look; /* bytes in lookahead buffer */
lzo_uint m_len;
lzo_uint m_off;
lzo_uint last_m_len;
lzo_uint last_m_off;
const lzo_byte *bp;
const lzo_byte *ip;
const lzo_byte *in;
const lzo_byte *in_end;
lzo_byte *out;
lzo_progress_callback_t cb;
lzo_uint textsize; /* text size counter */
lzo_uint codesize; /* code size counter */
lzo_uint printcount; /* counter for reporting progress every 1K bytes */
/* some stats */
unsigned long lit_bytes;
unsigned long match_bytes;
unsigned long rep_bytes;
unsigned long lazy;
#if defined(LZO1B)
lzo_uint r1_m_len;
/* some stats */
unsigned long r1_r, m3_r, m2_m, m3_m;
#endif
#if defined(LZO1C)
lzo_uint r1_m_len;
lzo_byte *m3;
/* some stats */
unsigned long r1_r, m3_r, m2_m, m3_m;
#endif
#if defined(LZO1F)
lzo_uint r1_lit;
lzo_uint r1_m_len;
/* some stats */
unsigned long r1_r, m2_m, m3_m;
#endif
#if defined(LZO1X) || defined(LZO1Y) || defined(LZO1Z)
lzo_uint r1_lit;
lzo_uint r1_m_len;
/* some stats */
unsigned long m1a_m, m1b_m, m2_m, m3_m, m4_m;
unsigned long lit1_r, lit2_r, lit3_r;
#endif
#if defined(LZO2A)
/* some stats */
unsigned long m1, m2, m3, m4;
#endif
}
LZO_COMPRESS_T;
#if defined(__PUREC__)
/* the cast is needed to work around a bug in Pure C (Atari ST) */
#define getbyte(c) ((c).ip < (c).in_end ? (unsigned) *((c).ip)++ : (-1))
#else
#define getbyte(c) ((c).ip < (c).in_end ? *((c).ip)++ : (-1))
#endif
#include "lzo_swd.ch"
/***********************************************************************
//
************************************************************************/
static int
init_match ( LZO_COMPRESS_T *c, lzo_swd_t *s,
const lzo_byte *dict, lzo_uint dict_len,
lzo_uint32 flags )
{
int r;
assert(!c->init);
c->init = 1;
s->c = c;
c->last_m_len = c->last_m_off = 0;
c->textsize = c->codesize = c->printcount = 0;
c->lit_bytes = c->match_bytes = c->rep_bytes = 0;
c->lazy = 0;
r = swd_init(s,dict,dict_len);
if (r != 0)
return r;
s->use_best_off = (flags & 1) ? 1 : 0;
return r;
}
/***********************************************************************
//
************************************************************************/
static int
find_match ( LZO_COMPRESS_T *c, lzo_swd_t *s,
lzo_uint this_len, lzo_uint skip )
{
assert(c->init);
if (skip > 0)
{
assert(this_len >= skip);
swd_accept(s, this_len - skip);
c->textsize += this_len - skip + 1;
}
else
{
assert(this_len <= 1);
c->textsize += this_len - skip;
}
s->m_len = 1;
s->m_len = THRESHOLD;
#ifdef SWD_BEST_OFF
if (s->use_best_off)
memset(s->best_pos,0,sizeof(s->best_pos));
#endif
swd_findbest(s);
c->m_len = s->m_len;
c->m_off = s->m_off;
swd_getbyte(s);
if (s->b_char < 0)
{
c->look = 0;
c->m_len = 0;
swd_exit(s);
}
else
{
c->look = s->look + 1;
}
c->bp = c->ip - c->look;
#if 0
/* brute force match search */
if (c->m_len > THRESHOLD && c->m_len + 1 <= c->look)
{
const lzo_byte *ip = c->bp;
const lzo_byte *m = c->bp - c->m_off;
const lzo_byte *in = c->in;
if (ip - in > N)
in = ip - N;
for (;;)
{
while (*in != *ip)
in++;
if (in == ip)
break;
if (in != m)
if (memcmp(in,ip,c->m_len+1) == 0)
printf("%p %p %p %5d\n",in,ip,m,c->m_len);
in++;
}
}
#endif
if (c->cb && c->textsize > c->printcount)
{
(*c->cb)(c->textsize,c->codesize);
c->printcount += 1024;
}
return LZO_E_OK;
}
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo_ptr.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
/* lzo_ptr.c -- low-level pointer constructs
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include "lzo_conf.h"
/***********************************************************************
//
************************************************************************/
LZO_PUBLIC(lzo_ptr_t)
__lzo_ptr_linear(const lzo_voidp ptr)
{
lzo_ptr_t p;
#if defined(__LZO_DOS16) || defined(__LZO_WIN16)
p = (((lzo_ptr_t)(_FP_SEG(ptr))) << (16 - __LZO_HShift)) + (_FP_OFF(ptr));
#else
p = PTR_LINEAR(ptr);
#endif
return p;
}
/***********************************************************************
//
************************************************************************/
LZO_PUBLIC(unsigned)
__lzo_align_gap(const lzo_voidp ptr, lzo_uint size)
{
lzo_ptr_t p, s, n;
assert(size > 0);
p = __lzo_ptr_linear(ptr);
s = (lzo_ptr_t) (size - 1);
#if 0
assert((size & (size - 1)) == 0);
n = ((p + s) & ~s) - p;
#else
n = (((p + s) / size) * size) - p;
#endif
assert((long)n >= 0);
assert(n <= s);
return (unsigned)n;
}
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo_ptr.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
|
/* lzo_ptr.h -- low-level pointer constructs
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the library and is subject
to change.
*/
#ifndef __LZO_PTR_H
#define __LZO_PTR_H
#ifdef __cplusplus
extern "C" {
#endif
/* This is the lowest part of the LZO library.
* It deals with pointer representations at bit level.
*/
/***********************************************************************
// Includes
************************************************************************/
#if defined(__LZO_DOS16) || defined(__LZO_WIN16)
# include <dos.h>
# if 1 && defined(__WATCOMC__)
# include <i86.h>
__LZO_EXTERN_C unsigned char _HShift;
# define __LZO_HShift _HShift
# elif 1 && defined(_MSC_VER)
__LZO_EXTERN_C unsigned short __near _AHSHIFT;
# define __LZO_HShift ((unsigned) &_AHSHIFT)
# elif defined(__LZO_WIN16)
# define __LZO_HShift 3
# else
# define __LZO_HShift 12
# endif
# if !defined(_FP_SEG) && defined(FP_SEG)
# define _FP_SEG FP_SEG
# endif
# if !defined(_FP_OFF) && defined(FP_OFF)
# define _FP_OFF FP_OFF
# endif
#endif
/***********************************************************************
// Integral types
************************************************************************/
/* ptrdiff_t */
#if !defined(lzo_ptrdiff_t)
# if (UINT_MAX >= LZO_0xffffffffL)
typedef ptrdiff_t lzo_ptrdiff_t;
# else
typedef long lzo_ptrdiff_t;
# endif
#endif
/* Integral types that have *exactly* the same number of bits as a lzo_voidp */
#if !defined(__LZO_HAVE_PTR_T)
# if defined(lzo_ptr_t)
# define __LZO_HAVE_PTR_T
# endif
#endif
#if !defined(__LZO_HAVE_PTR_T)
# if defined(SIZEOF_CHAR_P) && defined(SIZEOF_UNSIGNED_LONG)
# if (SIZEOF_CHAR_P == SIZEOF_UNSIGNED_LONG)
typedef unsigned long lzo_ptr_t;
typedef long lzo_sptr_t;
# define __LZO_HAVE_PTR_T
# endif
# endif
#endif
#if !defined(__LZO_HAVE_PTR_T)
# if defined(SIZEOF_CHAR_P) && defined(SIZEOF_UNSIGNED)
# if (SIZEOF_CHAR_P == SIZEOF_UNSIGNED)
typedef unsigned int lzo_ptr_t;
typedef int lzo_sptr_t;
# define __LZO_HAVE_PTR_T
# endif
# endif
#endif
#if !defined(__LZO_HAVE_PTR_T)
# if defined(SIZEOF_CHAR_P) && defined(SIZEOF_UNSIGNED_SHORT)
# if (SIZEOF_CHAR_P == SIZEOF_UNSIGNED_SHORT)
typedef unsigned short lzo_ptr_t;
typedef short lzo_sptr_t;
# define __LZO_HAVE_PTR_T
# endif
# endif
#endif
#if !defined(__LZO_HAVE_PTR_T)
# if defined(LZO_HAVE_CONFIG_H) || defined(SIZEOF_CHAR_P)
# error "no suitable type for lzo_ptr_t"
# else
typedef unsigned long lzo_ptr_t;
typedef long lzo_sptr_t;
# define __LZO_HAVE_PTR_T
# endif
#endif
/***********************************************************************
//
************************************************************************/
/* Always use the integral version for pointer comparisions.
*
* Note that this only works if the representation and ordering
* of the pointer and the integral is the same (at bit level).
*/
#if defined(__LZO_DOS16) || defined(__LZO_WIN16)
#define PTR(a) ((lzo_bytep) (a))
/* only need the low bits of the pointer -> offset is ok */
#define PTR_ALIGNED_4(a) ((_FP_OFF(a) & 3) == 0)
#define PTR_ALIGNED2_4(a,b) (((_FP_OFF(a) | _FP_OFF(b)) & 3) == 0)
#else
#define PTR(a) ((lzo_ptr_t) (a))
#define PTR_LINEAR(a) PTR(a)
#define PTR_ALIGNED_4(a) ((PTR_LINEAR(a) & 3) == 0)
#define PTR_ALIGNED_8(a) ((PTR_LINEAR(a) & 7) == 0)
#define PTR_ALIGNED2_4(a,b) (((PTR_LINEAR(a) | PTR_LINEAR(b)) & 3) == 0)
#define PTR_ALIGNED2_8(a,b) (((PTR_LINEAR(a) | PTR_LINEAR(b)) & 7) == 0)
#endif
#define PTR_LT(a,b) (PTR(a) < PTR(b))
#define PTR_GE(a,b) (PTR(a) >= PTR(b))
#define PTR_DIFF(a,b) ((lzo_ptrdiff_t) (PTR(a) - PTR(b)))
#define pd(a,b) ((lzo_uint) ((a)-(b)))
LZO_EXTERN(lzo_ptr_t)
__lzo_ptr_linear(const lzo_voidp ptr);
typedef union
{
char a_char;
unsigned char a_uchar;
short a_short;
unsigned short a_ushort;
int a_int;
unsigned int a_uint;
long a_long;
unsigned long a_ulong;
lzo_int a_lzo_int;
lzo_uint a_lzo_uint;
lzo_int32 a_lzo_int32;
lzo_uint32 a_lzo_uint32;
ptrdiff_t a_ptrdiff_t;
lzo_ptrdiff_t a_lzo_ptrdiff_t;
lzo_ptr_t a_lzo_ptr_t;
lzo_voidp a_lzo_voidp;
void * a_void_p;
lzo_bytep a_lzo_bytep;
lzo_bytepp a_lzo_bytepp;
lzo_uintp a_lzo_uintp;
lzo_uint * a_lzo_uint_p;
lzo_uint32p a_lzo_uint32p;
lzo_uint32 * a_lzo_uint32_p;
unsigned char * a_uchar_p;
char * a_char_p;
}
lzo_full_align_t;
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* already included */
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo_str.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
/* lzo_str.c -- string functions for the the LZO library
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include "lzo_conf.h"
/***********************************************************************
// slow but portable <string.h> stuff, only used in assertions
************************************************************************/
LZO_PUBLIC(int)
lzo_memcmp(const lzo_voidp s1, const lzo_voidp s2, lzo_uint len)
{
#if (LZO_UINT_MAX <= SIZE_T_MAX) && defined(HAVE_MEMCMP)
return memcmp(s1,s2,len);
#else
const lzo_byte *p1 = (const lzo_byte *) s1;
const lzo_byte *p2 = (const lzo_byte *) s2;
int d;
if (len > 0) do
{
d = *p1 - *p2;
if (d != 0)
return d;
p1++;
p2++;
}
while (--len > 0);
return 0;
#endif
}
LZO_PUBLIC(lzo_voidp)
lzo_memcpy(lzo_voidp dest, const lzo_voidp src, lzo_uint len)
{
#if (LZO_UINT_MAX <= SIZE_T_MAX) && defined(HAVE_MEMCPY)
return memcpy(dest,src,len);
#else
lzo_byte *p1 = (lzo_byte *) dest;
const lzo_byte *p2 = (const lzo_byte *) src;
if (len <= 0 || p1 == p2)
return dest;
do
*p1++ = *p2++;
while (--len > 0);
return dest;
#endif
}
LZO_PUBLIC(lzo_voidp)
lzo_memmove(lzo_voidp dest, const lzo_voidp src, lzo_uint len)
{
#if (LZO_UINT_MAX <= SIZE_T_MAX) && defined(HAVE_MEMMOVE)
return memmove(dest,src,len);
#else
lzo_byte *p1 = (lzo_byte *) dest;
const lzo_byte *p2 = (const lzo_byte *) src;
if (len <= 0 || p1 == p2)
return dest;
if (p1 < p2)
{
do
*p1++ = *p2++;
while (--len > 0);
}
else
{
p1 += len;
p2 += len;
do
*--p1 = *--p2;
while (--len > 0);
}
return dest;
#endif
}
LZO_PUBLIC(lzo_voidp)
lzo_memset(lzo_voidp s, int c, lzo_uint len)
{
#if (LZO_UINT_MAX <= SIZE_T_MAX) && defined(HAVE_MEMSET)
return memset(s,c,len);
#else
lzo_byte *p = (lzo_byte *) s;
if (len > 0) do
*p++ = LZO_BYTE(c);
while (--len > 0);
return s;
#endif
}
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo_swd.ch.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
|
/* lzo_swd.ch -- sliding window dictionary
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#if (LZO_UINT_MAX < LZO_0xffffffffL)
# error "LZO_UINT_MAX"
#endif
/***********************************************************************
//
************************************************************************/
#ifndef SWD_N
# define SWD_N N
#endif
#ifndef SWD_F
# define SWD_F F
#endif
#ifndef SWD_THRESHOLD
# define SWD_THRESHOLD THRESHOLD
#endif
/* unsigned type for dictionary access - don't waste memory here */
#if (SWD_N + SWD_F + SWD_F < USHRT_MAX)
typedef unsigned short swd_uint;
# define SWD_UINT_MAX USHRT_MAX
#else
typedef lzo_uint swd_uint;
# define SWD_UINT_MAX LZO_UINT_MAX
#endif
#define SWD_UINT(x) ((swd_uint)(x))
#ifndef SWD_HSIZE
# define SWD_HSIZE 16384
#endif
#ifndef SWD_MAX_CHAIN
# define SWD_MAX_CHAIN 2048
#endif
#if !defined(HEAD3)
#if 1
# define HEAD3(b,p) \
(((0x9f5f*(((((lzo_uint32)b[p]<<5)^b[p+1])<<5)^b[p+2]))>>5) & (SWD_HSIZE-1))
#else
# define HEAD3(b,p) \
(((0x9f5f*(((((lzo_uint32)b[p+2]<<5)^b[p+1])<<5)^b[p]))>>5) & (SWD_HSIZE-1))
#endif
#endif
#if (SWD_THRESHOLD == 1) && !defined(HEAD2)
# if 1 && defined(LZO_UNALIGNED_OK_2)
# define HEAD2(b,p) (* (lzo_ushortp) &(b[p]))
# else
# define HEAD2(b,p) (b[p] ^ ((unsigned)b[p+1]<<8))
# endif
# define NIL2 SWD_UINT_MAX
#endif
typedef struct
{
/* public - "built-in" */
lzo_uint n;
lzo_uint f;
lzo_uint threshold;
/* public - configuration */
lzo_uint max_chain;
lzo_uint nice_length;
lzo_bool use_best_off;
lzo_uint lazy_insert;
/* public - output */
lzo_uint m_len;
lzo_uint m_off;
lzo_uint look;
int b_char;
#if defined(SWD_BEST_OFF)
lzo_uint best_off[ SWD_BEST_OFF ];
#endif
/* semi public */
LZO_COMPRESS_T *c;
lzo_uint m_pos;
#if defined(SWD_BEST_OFF)
lzo_uint best_pos[ SWD_BEST_OFF ];
#endif
/* private */
const lzo_byte *dict;
const lzo_byte *dict_end;
lzo_uint dict_len;
/* private */
lzo_uint ip; /* input pointer (lookahead) */
lzo_uint bp; /* buffer pointer */
lzo_uint rp; /* remove pointer */
lzo_uint b_size;
unsigned char *b_wrap;
lzo_uint node_count;
lzo_uint first_rp;
#if defined(__LZO_CHECKER)
/* malloc arrays of the exact size to detect any overrun */
unsigned char *b;
swd_uint *head3;
swd_uint *succ3;
swd_uint *best3;
swd_uint *llen3;
#ifdef HEAD2
swd_uint *head2;
#endif
#else
unsigned char b [ SWD_N + SWD_F + SWD_F ];
swd_uint head3 [ SWD_HSIZE ];
swd_uint succ3 [ SWD_N + SWD_F ];
swd_uint best3 [ SWD_N + SWD_F ];
swd_uint llen3 [ SWD_HSIZE ];
#ifdef HEAD2
swd_uint head2 [ 65536L ];
#endif
#endif
}
lzo_swd_t;
/* Access macro for head3.
* head3[key] may be uninitialized, but then its value will never be used.
*/
#if defined(__LZO_CHECKER)
# define s_head3(s,key) \
((s->llen3[key] == 0) ? SWD_UINT_MAX : s->head3[key])
#else
# define s_head3(s,key) s->head3[key]
#endif
/***********************************************************************
//
************************************************************************/
static
void swd_initdict(lzo_swd_t *s, const lzo_byte *dict, lzo_uint dict_len)
{
s->dict = s->dict_end = NULL;
s->dict_len = 0;
if (!dict || dict_len <= 0)
return;
if (dict_len > s->n)
{
dict += dict_len - s->n;
dict_len = s->n;
}
s->dict = dict;
s->dict_len = dict_len;
s->dict_end = dict + dict_len;
memcpy(s->b,dict,dict_len);
s->ip = dict_len;
}
static
void swd_insertdict(lzo_swd_t *s, lzo_uint node, lzo_uint len)
{
lzo_uint key;
s->node_count = s->n - len;
s->first_rp = node;
while (len-- > 0)
{
key = HEAD3(s->b,node);
s->succ3[node] = s_head3(s,key);
s->head3[key] = SWD_UINT(node);
s->best3[node] = SWD_UINT(s->f + 1);
s->llen3[key]++;
assert(s->llen3[key] <= SWD_N);
#ifdef HEAD2
key = HEAD2(s->b,node);
s->head2[key] = SWD_UINT(node);
#endif
node++;
}
}
/***********************************************************************
//
************************************************************************/
static
int swd_init(lzo_swd_t *s, const lzo_byte *dict, lzo_uint dict_len)
{
lzo_uint i = 0;
int c = 0;
#if defined(__LZO_CHECKER)
s->b = malloc(SWD_N + SWD_F + SWD_F);
s->head3 = malloc(sizeof(swd_uint) * SWD_HSIZE);
s->succ3 = malloc(sizeof(swd_uint) * (SWD_N + SWD_F));
s->best3 = malloc(sizeof(swd_uint) * (SWD_N + SWD_F));
s->llen3 = malloc(sizeof(swd_uint) * SWD_HSIZE);
#ifdef HEAD2
s->head2 = malloc(sizeof(swd_uint) * 65536L);
#endif
#endif
s->n = SWD_N;
s->f = SWD_F;
s->threshold = SWD_THRESHOLD;
/* defaults */
s->max_chain = SWD_MAX_CHAIN;
s->nice_length = SWD_F;
s->use_best_off = 0;
s->lazy_insert = 0;
s->b_size = s->n + s->f;
if (2 * s->f >= s->n || s->b_size + s->f >= SWD_UINT_MAX)
return LZO_E_ERROR;
s->b_wrap = s->b + s->b_size;
s->node_count = s->n;
memset(s->llen3, 0, sizeof(s->llen3[0]) * SWD_HSIZE);
#ifdef HEAD2
#if 1
memset(s->head2, 0xff, sizeof(s->head2[0]) * 65536L);
assert(s->head2[0] == NIL2);
#else
for (i = 0; i < 65536L; i++)
s->head2[i] = NIL2;
#endif
#endif
s->ip = 0;
swd_initdict(s,dict,dict_len);
s->bp = s->ip;
s->first_rp = s->ip;
assert(s->ip + s->f <= s->b_size);
#if 1
s->look = (lzo_uint) (s->c->in_end - s->c->ip);
if (s->look > 0)
{
if (s->look > s->f)
s->look = s->f;
memcpy(&s->b[s->ip],s->c->ip,s->look);
s->c->ip += s->look;
s->ip += s->look;
}
#else
s->look = 0;
while (s->look < s->f)
{
if ((c = getbyte(*(s->c))) < 0)
break;
s->b[s->ip] = LZO_BYTE(c);
s->ip++;
s->look++;
}
#endif
if (s->ip == s->b_size)
s->ip = 0;
if (s->look >= 2 && s->dict_len > 0)
swd_insertdict(s,0,s->dict_len);
s->rp = s->first_rp;
if (s->rp >= s->node_count)
s->rp -= s->node_count;
else
s->rp += s->b_size - s->node_count;
#if defined(__LZO_CHECKER)
/* initialize memory for the first few HEAD3 (if s->ip is not far
* enough ahead to do this job for us). The value doesn't matter. */
if (s->look < 3)
memset(&s->b[s->bp+s->look],0,3);
#endif
LZO_UNUSED(i);
LZO_UNUSED(c);
return LZO_E_OK;
}
static
void swd_exit(lzo_swd_t *s)
{
#if defined(__LZO_CHECKER)
/* free in reverse order of allocations */
#ifdef HEAD2
free(s->head2); s->head2 = NULL;
#endif
free(s->llen3); s->llen3 = NULL;
free(s->best3); s->best3 = NULL;
free(s->succ3); s->succ3 = NULL;
free(s->head3); s->head3 = NULL;
free(s->b); s->b = NULL;
#else
LZO_UNUSED(s);
#endif
}
#define swd_pos2off(s,pos) \
(s->bp > (pos) ? s->bp - (pos) : s->b_size - ((pos) - s->bp))
/***********************************************************************
//
************************************************************************/
static __inline__
void swd_getbyte(lzo_swd_t *s)
{
int c;
if ((c = getbyte(*(s->c))) < 0)
{
if (s->look > 0)
--s->look;
#if defined(__LZO_CHECKER)
/* initialize memory - value doesn't matter */
s->b[s->ip] = 0;
if (s->ip < s->f)
s->b_wrap[s->ip] = 0;
#endif
}
else
{
s->b[s->ip] = LZO_BYTE(c);
if (s->ip < s->f)
s->b_wrap[s->ip] = LZO_BYTE(c);
}
if (++s->ip == s->b_size)
s->ip = 0;
if (++s->bp == s->b_size)
s->bp = 0;
if (++s->rp == s->b_size)
s->rp = 0;
}
/***********************************************************************
// remove node from lists
************************************************************************/
static __inline__
void swd_remove_node(lzo_swd_t *s, lzo_uint node)
{
if (s->node_count == 0)
{
lzo_uint key;
#ifdef LZO_DEBUG
if (s->first_rp != LZO_UINT_MAX)
{
if (node != s->first_rp)
printf("Remove %5d: %5d %5d %5d %5d %6d %6d\n",
node, s->rp, s->ip, s->bp, s->first_rp,
s->ip - node, s->ip - s->bp);
assert(node == s->first_rp);
s->first_rp = LZO_UINT_MAX;
}
#endif
key = HEAD3(s->b,node);
assert(s->llen3[key] > 0);
--s->llen3[key];
#ifdef HEAD2
key = HEAD2(s->b,node);
assert(s->head2[key] != NIL2);
if ((lzo_uint) s->head2[key] == node)
s->head2[key] = NIL2;
#endif
}
else
--s->node_count;
}
/***********************************************************************
//
************************************************************************/
static
void swd_accept(lzo_swd_t *s, lzo_uint n)
{
assert(n <= s->look);
while (n--)
{
lzo_uint key;
swd_remove_node(s,s->rp);
/* add bp into HEAD3 */
key = HEAD3(s->b,s->bp);
s->succ3[s->bp] = s_head3(s,key);
s->head3[key] = SWD_UINT(s->bp);
s->best3[s->bp] = SWD_UINT(s->f + 1);
s->llen3[key]++;
assert(s->llen3[key] <= SWD_N);
#ifdef HEAD2
/* add bp into HEAD2 */
key = HEAD2(s->b,s->bp);
s->head2[key] = SWD_UINT(s->bp);
#endif
swd_getbyte(s);
}
}
/***********************************************************************
//
************************************************************************/
static
void swd_search(lzo_swd_t *s, lzo_uint node, lzo_uint cnt)
{
#if 0 && defined(__GNUC__) && defined(__i386__)
register const unsigned char *p1 __asm__("%edi");
register const unsigned char *p2 __asm__("%esi");
register const unsigned char *px __asm__("%edx");
#else
const unsigned char *p1;
const unsigned char *p2;
const unsigned char *px;
#endif
lzo_uint m_len = s->m_len;
const unsigned char * b = s->b;
const unsigned char * bp = s->b + s->bp;
const unsigned char * bx = s->b + s->bp + s->look;
unsigned char scan_end1;
assert(s->m_len > 0);
scan_end1 = bp[m_len - 1];
for ( ; cnt-- > 0; node = s->succ3[node])
{
p1 = bp;
p2 = b + node;
px = bx;
assert(m_len < s->look);
if (
#if 1
p2[m_len - 1] == scan_end1 &&
p2[m_len] == p1[m_len] &&
#endif
p2[0] == p1[0] &&
p2[1] == p1[1])
{
lzo_uint i;
assert(memcmp(bp,&b[node],3) == 0);
#if 0 && defined(LZO_UNALIGNED_OK_4)
p1 += 3; p2 += 3;
while (p1 < px && * (const lzo_uint32p) p1 == * (const lzo_uint32p) p2)
p1 += 4, p2 += 4;
while (p1 < px && *p1 == *p2)
p1 += 1, p2 += 1;
#else
p1 += 2; p2 += 2;
do {} while (++p1 < px && *p1 == *++p2);
#endif
i = p1 - bp;
#ifdef LZO_DEBUG
if (memcmp(bp,&b[node],i) != 0)
printf("%5ld %5ld %02x%02x %02x%02x\n",
(long)s->bp, (long) node,
bp[0], bp[1], b[node], b[node+1]);
#endif
assert(memcmp(bp,&b[node],i) == 0);
#if defined(SWD_BEST_OFF)
if (i < SWD_BEST_OFF)
{
if (s->best_pos[i] == 0)
s->best_pos[i] = node + 1;
}
#endif
if (i > m_len)
{
s->m_len = m_len = i;
s->m_pos = node;
if (m_len == s->look)
return;
if (m_len >= s->nice_length)
return;
if (m_len > (lzo_uint) s->best3[node])
return;
scan_end1 = bp[m_len - 1];
}
}
}
}
/***********************************************************************
//
************************************************************************/
#ifdef HEAD2
static
lzo_bool swd_search2(lzo_swd_t *s)
{
lzo_uint key;
assert(s->look >= 2);
assert(s->m_len > 0);
key = s->head2[ HEAD2(s->b,s->bp) ];
if (key == NIL2)
return 0;
#ifdef LZO_DEBUG
if (memcmp(&s->b[s->bp],&s->b[key],2) != 0)
printf("%5ld %5ld %02x%02x %02x%02x\n", (long)s->bp, (long)key,
s->b[s->bp], s->b[s->bp+1], s->b[key], s->b[key+1]);
#endif
assert(memcmp(&s->b[s->bp],&s->b[key],2) == 0);
#if defined(SWD_BEST_OFF)
if (s->best_pos[2] == 0)
s->best_pos[2] = key + 1;
#endif
if (s->m_len < 2)
{
s->m_len = 2;
s->m_pos = key;
}
return 1;
}
#endif
/***********************************************************************
//
************************************************************************/
static
void swd_findbest(lzo_swd_t *s)
{
lzo_uint key;
lzo_uint cnt, node;
lzo_uint len;
assert(s->m_len > 0);
/* get current head, add bp into HEAD3 */
key = HEAD3(s->b,s->bp);
node = s->succ3[s->bp] = s_head3(s,key);
cnt = s->llen3[key]++;
assert(s->llen3[key] <= SWD_N + SWD_F);
if (cnt > s->max_chain && s->max_chain > 0)
cnt = s->max_chain;
s->head3[key] = SWD_UINT(s->bp);
s->b_char = s->b[s->bp];
len = s->m_len;
if (s->m_len >= s->look)
{
if (s->look == 0)
s->b_char = -1;
s->m_off = 0;
s->best3[s->bp] = SWD_UINT(s->f + 1);
}
else
{
#ifdef HEAD2
if (swd_search2(s))
#endif
if (s->look >= 3)
swd_search(s,node,cnt);
if (s->m_len > len)
s->m_off = swd_pos2off(s,s->m_pos);
s->best3[s->bp] = SWD_UINT(s->m_len);
#if defined(SWD_BEST_OFF)
if (s->use_best_off)
{
int i;
for (i = 2; i < SWD_BEST_OFF; i++)
if (s->best_pos[i] > 0)
s->best_off[i] = swd_pos2off(s,s->best_pos[i]-1);
else
s->best_off[i] = 0;
}
#endif
}
swd_remove_node(s,s->rp);
#ifdef HEAD2
/* add bp into HEAD2 */
key = HEAD2(s->b,s->bp);
s->head2[key] = SWD_UINT(s->bp);
#endif
}
#undef HEAD3
#undef HEAD2
#undef s_head3
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo_util.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
|
/* lzo_util.c -- utilities for the LZO library
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include "lzo_conf.h"
#include "lzo_util.h"
/***********************************************************************
//
************************************************************************/
LZO_PUBLIC(lzo_bool)
lzo_assert(int expr)
{
return (expr) ? 1 : 0;
}
/***********************************************************************
//
************************************************************************/
/* If you use the LZO library in a product, you *must* keep this
* copyright string in the executable of your product.
.*/
const lzo_byte __lzo_copyright[] =
#if !defined(__LZO_IN_MINLZO)
/* save space as some people want a really small decompressor */
LZO_VERSION_STRING;
#else
"\n\n\n"
"LZO real-time data compression library.\n"
"Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 Markus Franz Xaver Johannes Oberhumer\n"
"<markus.oberhumer@jk.uni-linz.ac.at>\n"
"http://www.oberhumer.com/opensource/lzo/\n"
"\n"
"LZO version: v" LZO_VERSION_STRING ", " LZO_VERSION_DATE "\n"
"LZO build date: " __DATE__ " " __TIME__ "\n\n"
"LZO special compilation options:\n"
#ifdef __cplusplus
" __cplusplus\n"
#endif
#if defined(__PIC__)
" __PIC__\n"
#elif defined(__pic__)
" __pic__\n"
#endif
#if (UINT_MAX < LZO_0xffffffffL)
" 16BIT\n"
#endif
#if defined(__LZO_STRICT_16BIT)
" __LZO_STRICT_16BIT\n"
#endif
#if (UINT_MAX > LZO_0xffffffffL)
" UINT_MAX=" _LZO_MEXPAND(UINT_MAX) "\n"
#endif
#if (ULONG_MAX > LZO_0xffffffffL)
" ULONG_MAX=" _LZO_MEXPAND(ULONG_MAX) "\n"
#endif
#if defined(LZO_BYTE_ORDER)
" LZO_BYTE_ORDER=" _LZO_MEXPAND(LZO_BYTE_ORDER) "\n"
#endif
#if defined(LZO_UNALIGNED_OK_2)
" LZO_UNALIGNED_OK_2\n"
#endif
#if defined(LZO_UNALIGNED_OK_4)
" LZO_UNALIGNED_OK_4\n"
#endif
#if defined(LZO_ALIGNED_OK_4)
" LZO_ALIGNED_OK_4\n"
#endif
#if defined(LZO_DICT_USE_PTR)
" LZO_DICT_USE_PTR\n"
#endif
#if defined(__LZO_QUERY_COMPRESS)
" __LZO_QUERY_COMPRESS\n"
#endif
#if defined(__LZO_QUERY_DECOMPRESS)
" __LZO_QUERY_DECOMPRESS\n"
#endif
#if defined(__LZO_IN_MINILZO)
" __LZO_IN_MINILZO\n"
#endif
"\n\n"
/* RCS information */
"$Id: LZO " LZO_VERSION_STRING " built " __DATE__ " " __TIME__
#if defined(__GNUC__) && defined(__VERSION__)
" by gcc " __VERSION__
#elif defined(__BORLANDC__)
" by Borland C " _LZO_MEXPAND(__BORLANDC__)
#elif defined(_MSC_VER)
" by Microsoft C " _LZO_MEXPAND(_MSC_VER)
#elif defined(__PUREC__)
" by Pure C " _LZO_MEXPAND(__PUREC__)
#elif defined(__SC__)
" by Symantec C " _LZO_MEXPAND(__SC__)
#elif defined(__TURBOC__)
" by Turbo C " _LZO_MEXPAND(__TURBOC__)
#elif defined(__WATCOMC__)
" by Watcom C " _LZO_MEXPAND(__WATCOMC__)
#endif
" $\n"
"$Copyright: LZO (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 Markus Franz Xaver Johannes Oberhumer $\n";
#endif
LZO_PUBLIC(const lzo_byte *)
lzo_copyright(void)
{
return __lzo_copyright;
}
LZO_PUBLIC(unsigned)
lzo_version(void)
{
return LZO_VERSION;
}
LZO_PUBLIC(const char *)
lzo_version_string(void)
{
return LZO_VERSION_STRING;
}
LZO_PUBLIC(const char *)
lzo_version_date(void)
{
return LZO_VERSION_DATE;
}
LZO_PUBLIC(const lzo_charp)
_lzo_version_string(void)
{
return LZO_VERSION_STRING;
}
LZO_PUBLIC(const lzo_charp)
_lzo_version_date(void)
{
return LZO_VERSION_DATE;
}
/***********************************************************************
// adler32 checksum
// adapted from free code by Mark Adler <madler@alumni.caltech.edu>
// see http://www.cdrom.com/pub/infozip/zlib/
************************************************************************/
#define LZO_BASE 65521u /* largest prime smaller than 65536 */
#define LZO_NMAX 5552
/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
#define LZO_DO1(buf,i) {s1 += buf[i]; s2 += s1;}
#define LZO_DO2(buf,i) LZO_DO1(buf,i); LZO_DO1(buf,i+1);
#define LZO_DO4(buf,i) LZO_DO2(buf,i); LZO_DO2(buf,i+2);
#define LZO_DO8(buf,i) LZO_DO4(buf,i); LZO_DO4(buf,i+4);
#define LZO_DO16(buf,i) LZO_DO8(buf,i); LZO_DO8(buf,i+8);
LZO_PUBLIC(lzo_uint32)
lzo_adler32(lzo_uint32 adler, const lzo_byte *buf, lzo_uint len)
{
lzo_uint32 s1 = adler & 0xffff;
lzo_uint32 s2 = (adler >> 16) & 0xffff;
int k;
if (buf == NULL)
return 1;
while (len > 0)
{
k = len < LZO_NMAX ? (int) len : LZO_NMAX;
len -= k;
if (k >= 16) do
{
LZO_DO16(buf,0);
buf += 16;
k -= 16;
} while (k >= 16);
if (k != 0) do
{
s1 += *buf++;
s2 += s1;
} while (--k > 0);
s1 %= LZO_BASE;
s2 %= LZO_BASE;
}
return (s2 << 16) | s1;
}
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/lzo_util.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
|
/* lzo_util.h -- utilities for the LZO library
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the library and is subject
to change.
*/
#ifndef __LZO_UTIL_H
#define __LZO_UTIL_H
#ifndef __LZO_CONF_H
# include "lzo_conf.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
/***********************************************************************
// fast memcpy that copies multiples of 8 byte chunks.
// len is the number of bytes.
// note: all parameters must be lvalues, len >= 8
// dest and src advance, len is undefined afterwards
************************************************************************/
#if 1 && defined(HAVE_MEMCPY)
#if !defined(__LZO_DOS16) && !defined(__LZO_WIN16)
#define MEMCPY8_DS(dest,src,len) \
memcpy(dest,src,len); \
dest += len; \
src += len
#endif
#endif
#if 0 && !defined(MEMCPY8_DS)
#define MEMCPY8_DS(dest,src,len) \
{ do { \
*dest++ = *src++; \
*dest++ = *src++; \
*dest++ = *src++; \
*dest++ = *src++; \
*dest++ = *src++; \
*dest++ = *src++; \
*dest++ = *src++; \
*dest++ = *src++; \
len -= 8; \
} while (len > 0); }
#endif
#if !defined(MEMCPY8_DS)
#define MEMCPY8_DS(dest,src,len) \
{ register lzo_uint __l = (len) / 8; \
do { \
*dest++ = *src++; \
*dest++ = *src++; \
*dest++ = *src++; \
*dest++ = *src++; \
*dest++ = *src++; \
*dest++ = *src++; \
*dest++ = *src++; \
*dest++ = *src++; \
} while (--__l > 0); }
#endif
/***********************************************************************
// memcpy and pseudo-memmove
// len is the number of bytes.
// note: all parameters must be lvalues, len > 0
// dest and src advance, len is undefined afterwards
************************************************************************/
#define MEMCPY_DS(dest,src,len) \
do *dest++ = *src++; \
while (--len > 0)
#define MEMMOVE_DS(dest,src,len) \
do *dest++ = *src++; \
while (--len > 0)
/***********************************************************************
// fast bzero that clears multiples of 8 pointers
// n is the number of pointers.
// note: n > 0
// s and n are undefined afterwards
************************************************************************/
#if 0 && defined(LZO_OPTIMIZE_GNUC_i386)
#define BZERO8_PTR(s,l,n) \
__asm__ __volatile__( \
"movl %0,%%eax \n" \
"movl %1,%%edi \n" \
"movl %2,%%ecx \n" \
"cld \n" \
"rep \n" \
"stosl %%eax,(%%edi) \n" \
: /* no outputs */ \
:"g" (0),"g" (s),"g" (n) \
:"eax","edi","ecx", "memory", "cc" \
)
#elif (LZO_UINT_MAX <= SIZE_T_MAX) && defined(HAVE_MEMSET)
#if 1
#define BZERO8_PTR(s,l,n) memset((s),0,(lzo_uint)(l)*(n))
#else
#define BZERO8_PTR(s,l,n) memset((lzo_voidp)(s),0,(lzo_uint)(l)*(n))
#endif
#else
#define BZERO8_PTR(s,l,n) \
lzo_memset((lzo_voidp)(s),0,(lzo_uint)(l)*(n))
#endif
/***********************************************************************
// rotate (currently not used)
************************************************************************/
#if 0
#if defined(__GNUC__) && defined(__i386__)
unsigned char lzo_rotr8(unsigned char value, int shift);
extern __inline__ unsigned char lzo_rotr8(unsigned char value, int shift)
{
unsigned char result;
__asm__ __volatile__ ("movb %b1, %b0; rorb %b2, %b0"
: "=a"(result) : "g"(value), "c"(shift));
return result;
}
unsigned short lzo_rotr16(unsigned short value, int shift);
extern __inline__ unsigned short lzo_rotr16(unsigned short value, int shift)
{
unsigned short result;
__asm__ __volatile__ ("movw %b1, %b0; rorw %b2, %b0"
: "=a"(result) : "g"(value), "c"(shift));
return result;
}
#endif
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* already included */
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/stats1a.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
|
/* stats1a.h -- statistics for the the LZO1A algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the LZO package and is subject
to change.
*/
#ifndef __LZO_STATS1A_H
#define __LZO_STATS1A_H
#ifdef __cplusplus
extern "C" {
#endif
/***********************************************************************
// collect statistical information when compressing
// used for finetuning, view with a debugger
************************************************************************/
#if defined(LZO_COLLECT_STATS)
# define LZO_STATS(expr) expr
#else
# define LZO_STATS(expr) ((void) 0)
#endif
/***********************************************************************
//
************************************************************************/
typedef struct {
/* configuration */
unsigned rbits;
unsigned clevel;
/* internal configuration */
unsigned dbits;
unsigned lbits;
/* constants */
unsigned min_match_short;
unsigned max_match_short;
unsigned min_match_long;
unsigned max_match_long;
unsigned min_offset;
unsigned max_offset;
unsigned r0min;
unsigned r0fast;
unsigned r0max;
/* counts */
long short_matches;
long long_matches;
long r1_matches;
long lit_runs;
long lit_runs_after_long_match;
long r0short_runs;
long r0fast_runs;
long r0long_runs;
/* */
long lit_run[RSIZE];
long lit_run_after_long_match[RSIZE];
long short_match[MAX_MATCH_SHORT + 1];
long long_match[MAX_MATCH_LONG + 1];
long marker[256];
/* these could prove useful for further optimizations */
long short_match_offset_osize[MAX_MATCH_SHORT + 1];
long short_match_offset_256[MAX_MATCH_SHORT + 1];
long short_match_offset_1024[MAX_MATCH_SHORT + 1];
long matches_out_of_range;
long matches_out_of_range_2;
long matches_out_of_range_4;
long match_out_of_range[MAX_MATCH_SHORT + 1];
/* */
long in_len;
long out_len;
}
lzo1a_stats_t;
extern lzo1a_stats_t *lzo1a_stats;
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* already included */
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/stats1b.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
/* stats1b.h -- statistics for the the LZO library
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the library and is subject
to change.
*/
#ifndef __LZO_STATS1B_H
#define __LZO_STATS1B_H
#ifdef __cplusplus
extern "C" {
#endif
/***********************************************************************
// Collect statistical information when compressing.
// Useful for finetuning the compression algorithm.
// Examine the symbol 'lzo1b_stats' with a debugger.
************************************************************************/
#if defined(LZO_COLLECT_STATS)
# define LZO_STATS(expr) expr
#else
# define LZO_STATS(expr) ((void) 0)
#endif
#if defined(LZO_COLLECT_STATS)
typedef struct
{
/* algorithm configuration */
unsigned r_bits;
unsigned m3o_bits;
unsigned dd_bits;
unsigned clevel;
/* internal configuration */
unsigned d_bits;
long min_lookahead;
long max_lookbehind;
const char *compress_id;
/* counts */
long lit_runs;
long r0short_runs;
long r0fast_runs;
long r0long_runs;
long m1_matches;
long m2_matches;
long m3_matches;
long m4_matches;
long r1_matches;
/* */
long lit_run[R0MIN];
long m2_match[M2_MAX_LEN + 1];
long m3_match[M3_MAX_LEN + 1];
#if (M3O_BITS < 8)
long lit_runs_after_m3_match;
long lit_run_after_m3_match[LZO_SIZE(8-M3O_BITS)];
#endif
/* */
long matches;
long match_bytes;
long literals;
long literal_overhead;
long literal_bytes;
float literal_overhead_percent;
/* */
long unused_dict_entries;
float unused_dict_entries_percent;
/* */
long in_len;
long out_len;
}
lzo1b_stats_t;
void _lzo1b_stats_init(lzo1b_stats_t *lzo_stats);
void _lzo1b_stats_calc(lzo1b_stats_t *lzo_stats);
extern lzo1b_stats_t * const lzo1b_stats;
#define lzo_stats_t lzo1b_stats_t
#define lzo_stats lzo1b_stats
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* already included */
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/src/stats1c.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
/* stats1c.h -- statistics for the the LZO library
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the library and is subject
to change.
*/
#ifndef __LZO_STATS1C_H
#define __LZO_STATS1C_H
#define lzo1b_stats_t lzo1c_stats_t
#define lzo1b_stats lzo1c_stats
#define _lzo1b_stats_init _lzo1c_stats_init
#define _lzo1b_stats_calc _lzo1c_stats_calc
#include "stats1b.h"
#endif /* already included */
/*
vi:ts=4:et
*/
|
Added work/contrib/lzo/lzo-1.08/stamp-h1.
|
|
>
|
1
|
timestamp for config.h:config.hin
|
Added work/contrib/lzo/lzo-1.08/tests/.deps/align.Po.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
align.o : \
align.c ../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h \
../include/lzoutil.h ../src/lzo_conf.h /usr/include/sys/types.h \
/usr/include/bits/types.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/stdlib.h \
/usr/include/alloca.h /usr/include/assert.h ../src/lzo_ptr.h \
/usr/include/stdio.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h \
/usr/include/libio.h /usr/include/_G_config.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/stdio.h
align.c :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
../include/lzoutil.h :
../src/lzo_conf.h :
/usr/include/sys/types.h :
/usr/include/bits/types.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/stdlib.h :
/usr/include/alloca.h :
/usr/include/assert.h :
../src/lzo_ptr.h :
/usr/include/stdio.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h :
/usr/include/libio.h :
/usr/include/_G_config.h :
/usr/include/bits/stdio_lim.h :
/usr/include/bits/stdio.h :
|
Added work/contrib/lzo/lzo-1.08/tests/.deps/chksum.Po.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
chksum.o : \
chksum.c ../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h \
/usr/include/stdio.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h \
/usr/include/bits/types.h /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
/usr/include/bits/stdio.h /usr/include/stdlib.h \
/usr/include/sys/types.h /usr/include/time.h /usr/include/endian.h \
/usr/include/bits/endian.h /usr/include/sys/select.h \
/usr/include/bits/select.h /usr/include/bits/sigset.h \
/usr/include/sys/sysmacros.h /usr/include/alloca.h
chksum.c :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
/usr/include/stdio.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h :
/usr/include/bits/types.h :
/usr/include/libio.h :
/usr/include/_G_config.h :
/usr/include/bits/stdio_lim.h :
/usr/include/bits/stdio.h :
/usr/include/stdlib.h :
/usr/include/sys/types.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/alloca.h :
|
Added work/contrib/lzo/lzo-1.08/tests/.deps/promote.Po.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
promote.o : \
promote.c /usr/include/stdio.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h \
/usr/include/bits/types.h /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
/usr/include/bits/stdio.h
promote.c :
/usr/include/stdio.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h :
/usr/include/bits/types.h :
/usr/include/libio.h :
/usr/include/_G_config.h :
/usr/include/bits/stdio_lim.h :
/usr/include/bits/stdio.h :
|
Added work/contrib/lzo/lzo-1.08/tests/.deps/sizes.Po.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
sizes.o : \
sizes.c ../include/lzoconf.h ../config.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \
/usr/include/linux/limits.h /usr/include/bits/posix2_lim.h \
/usr/include/stdio.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h \
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h \
/usr/include/bits/types.h /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
/usr/include/bits/stdio.h
sizes.c :
../include/lzoconf.h :
../config.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/limits.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/syslimits.h :
/usr/include/limits.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
/usr/include/stdio.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stddef.h :
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/pgcc-2.95.2/include/stdarg.h :
/usr/include/bits/types.h :
/usr/include/libio.h :
/usr/include/_G_config.h :
/usr/include/bits/stdio_lim.h :
/usr/include/bits/stdio.h :
|
Added work/contrib/lzo/lzo-1.08/tests/.libs/align.
cannot compute difference between binary files
Added work/contrib/lzo/lzo-1.08/tests/.libs/chksum.
cannot compute difference between binary files
Added work/contrib/lzo/lzo-1.08/tests/Makefile.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
|
# Makefile.in generated by automake 1.6.2 from Makefile.am.
# tests/Makefile. Generated from Makefile.in by configure.
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
#
# Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
#
SHELL = /bin/sh
srcdir = .
top_srcdir = ..
prefix = /usr/local
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
sbindir = ${exec_prefix}/sbin
libexecdir = ${exec_prefix}/libexec
datadir = ${prefix}/share
sysconfdir = ${prefix}/etc
sharedstatedir = ${prefix}/com
localstatedir = ${prefix}/var
libdir = ${exec_prefix}/lib
infodir = ${prefix}/info
mandir = ${prefix}/man
includedir = ${prefix}/include
oldincludedir = /usr/include
pkgdatadir = $(datadir)/lzo
pkglibdir = $(libdir)/lzo
pkgincludedir = $(includedir)/lzo
top_builddir = ..
ACLOCAL = ${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run aclocal-1.6
AUTOCONF = ${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run autoconf
AUTOMAKE = ${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run automake-1.6
AUTOHEADER = ${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run autoheader
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = /usr/bin/ginstall -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_SCRIPT = ${INSTALL}
INSTALL_HEADER = $(INSTALL_DATA)
transform = s,x,x,
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
host_alias =
host_triplet = i586-pc-linux-gnu
EXEEXT =
OBJEXT = o
PATH_SEPARATOR = :
AMTAR = ${SHELL} /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/missing --run tar
AS = @AS@
ASFLAGS = -x assembler-with-cpp
AWK = gawk
CC = gcc
CFLAGS_GCC_OMIT_FRAME_POINTER = -fomit-frame-pointer
CFLAGS_O =
CFLAGS_W =
CFLAGS_W_PEDANTIC =
CLEANFILES = *.bb *.bbg *.da *.gcov bb.out bbtrace* gmon.out
CPP = gcc -E
DEPDIR = .deps
DLLTOOL = @DLLTOOL@
ECHO = echo
INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
LIBTOOL = $(SHELL) $(top_builddir)/libtool
LN_S = ln -s
LZO_ASM_OBJECTS = $(LZO_ASM_OBJECTS_GCC_i386)
LZO_CFLAGS =
MAINT = #
MFX_ARCH = i386
MFX_CC = GCC
MFX_CPU = i586
MOSTLYCLEANFILES = *.i
NASM =
OBJDUMP = @OBJDUMP@
PACKAGE = lzo
RANLIB = ranlib
SRC_VPATH = /i386/src
STRIP = strip
VERSION = 1.08
am__include = include
am__quote =
install_sh = /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/acconfig/install-sh
liblzo = $(top_builddir)/src/liblzo.la
ltest_LIBS =
AUTOMAKE_OPTIONS = 1.6
INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/src
CFLAGS = -O2 -Wall -Wcast-align -Wcast-qual -Wwrite-strings -fno-strength-reduce -fstrict-aliasing $(CFLAGS_O) $(CFLAGS_W) $(LZO_CFLAGS)
noinst_PROGRAMS = align chksum promote sizes
align_LDADD = $(top_builddir)/src/liblzo.la
chksum_LDADD = $(top_builddir)/src/liblzo.la
subdir = tests
mkinstalldirs = $(SHELL) $(top_srcdir)/acconfig/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
noinst_PROGRAMS = align$(EXEEXT) chksum$(EXEEXT) promote$(EXEEXT) \
sizes$(EXEEXT)
PROGRAMS = $(noinst_PROGRAMS)
align_SOURCES = align.c
align_OBJECTS = align.$(OBJEXT)
align_DEPENDENCIES =
align_LDFLAGS =
chksum_SOURCES = chksum.c
chksum_OBJECTS = chksum.$(OBJEXT)
chksum_DEPENDENCIES =
chksum_LDFLAGS =
promote_SOURCES = promote.c
promote_OBJECTS = promote.$(OBJEXT)
promote_LDADD = $(LDADD)
promote_DEPENDENCIES =
promote_LDFLAGS =
sizes_SOURCES = sizes.c
sizes_OBJECTS = sizes.$(OBJEXT)
sizes_LDADD = $(LDADD)
sizes_DEPENDENCIES =
sizes_LDFLAGS =
DEFS = -DHAVE_CONFIG_H
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
CPPFLAGS = -DLZO_HAVE_CONFIG_H
LDFLAGS =
LIBS =
depcomp = $(SHELL) $(top_srcdir)/acconfig/depcomp
am__depfiles_maybe = depfiles
DEP_FILES = ./$(DEPDIR)/align.Po ./$(DEPDIR)/chksum.Po \
./$(DEPDIR)/promote.Po ./$(DEPDIR)/sizes.Po
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
$(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
DIST_SOURCES = align.c chksum.c promote.c sizes.c
DIST_COMMON = Makefile.am Makefile.in
SOURCES = align.c chksum.c promote.c sizes.c
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: # Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu tests/Makefile
Makefile: # $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
clean-noinstPROGRAMS:
@list='$(noinst_PROGRAMS)'; for p in $$list; do \
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
echo " rm -f $$p $$f"; \
rm -f $$p $$f ; \
done
align$(EXEEXT): $(align_OBJECTS) $(align_DEPENDENCIES)
@rm -f align$(EXEEXT)
$(LINK) $(align_LDFLAGS) $(align_OBJECTS) $(align_LDADD) $(LIBS)
chksum$(EXEEXT): $(chksum_OBJECTS) $(chksum_DEPENDENCIES)
@rm -f chksum$(EXEEXT)
$(LINK) $(chksum_LDFLAGS) $(chksum_OBJECTS) $(chksum_LDADD) $(LIBS)
promote$(EXEEXT): $(promote_OBJECTS) $(promote_DEPENDENCIES)
@rm -f promote$(EXEEXT)
$(LINK) $(promote_LDFLAGS) $(promote_OBJECTS) $(promote_LDADD) $(LIBS)
sizes$(EXEEXT): $(sizes_OBJECTS) $(sizes_DEPENDENCIES)
@rm -f sizes$(EXEEXT)
$(LINK) $(sizes_LDFLAGS) $(sizes_OBJECTS) $(sizes_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT) core *.core
distclean-compile:
-rm -f *.tab.c
include ./$(DEPDIR)/align.Po
include ./$(DEPDIR)/chksum.Po
include ./$(DEPDIR)/promote.Po
include ./$(DEPDIR)/sizes.Po
distclean-depend:
-rm -rf ./$(DEPDIR)
.c.o:
source='$<' object='$@' libtool=no \
depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' \
$(CCDEPMODE) $(depcomp) \
$(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
.c.obj:
source='$<' object='$@' libtool=no \
depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' \
$(CCDEPMODE) $(depcomp) \
$(COMPILE) -c `cygpath -w $<`
.c.lo:
source='$<' object='$@' libtool=yes \
depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' \
$(CCDEPMODE) $(depcomp) \
$(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
CCDEPMODE = depmode=gcc
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
ETAGS = etags
ETAGSFLAGS =
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@list='$(DISTFILES)'; for file in $$list; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkinstalldirs) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS)
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
mostlyclean-am
distclean: distclean-am
distclean-am: clean-am distclean-compile distclean-depend \
distclean-generic distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
info: info-am
info-am:
install-data-am:
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
uninstall-am: uninstall-info-am
.PHONY: GTAGS all all-am check check-am clean clean-generic \
clean-libtool clean-noinstPROGRAMS distclean distclean-compile \
distclean-depend distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am info info-am install \
install-am install-data install-data-am install-exec \
install-exec-am install-info install-info-am install-man \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
tags uninstall uninstall-am uninstall-info-am
$(top_builddir)/src/liblzo.la:
cd $(top_builddir)/src && $(MAKE) all
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
|
Added work/contrib/lzo/lzo-1.08/tests/Makefile.am.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
## Process this file with automake to create Makefile.in
#
# Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
#
AUTOMAKE_OPTIONS = 1.6
INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/src
CFLAGS = @CFLAGS@ $(CFLAGS_O) $(CFLAGS_W) $(LZO_CFLAGS)
noinst_PROGRAMS = align chksum promote sizes
align_LDADD = @liblzo@
chksum_LDADD = @liblzo@
@liblzo@:
cd $(top_builddir)/src && $(MAKE) all
|
Added work/contrib/lzo/lzo-1.08/tests/Makefile.in.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
|
# Makefile.in generated by automake 1.6.2 from Makefile.am.
# @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
#
# Copyright (C) 1996-2002 Markus F.X.J. Oberhumer
#
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
host_alias = @host_alias@
host_triplet = @host@
EXEEXT = @EXEEXT@
OBJEXT = @OBJEXT@
PATH_SEPARATOR = @PATH_SEPARATOR@
AMTAR = @AMTAR@
AS = @AS@
ASFLAGS = @ASFLAGS@
AWK = @AWK@
CC = @CC@
CFLAGS_GCC_OMIT_FRAME_POINTER = @CFLAGS_GCC_OMIT_FRAME_POINTER@
CFLAGS_O = @CFLAGS_O@
CFLAGS_W = @CFLAGS_W@
CFLAGS_W_PEDANTIC = @CFLAGS_W_PEDANTIC@
CLEANFILES = @CLEANFILES@
CPP = @CPP@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
ECHO = @ECHO@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LZO_ASM_OBJECTS = @LZO_ASM_OBJECTS@
LZO_CFLAGS = @LZO_CFLAGS@
MAINT = @MAINT@
MFX_ARCH = @MFX_ARCH@
MFX_CC = @MFX_CC@
MFX_CPU = @MFX_CPU@
MOSTLYCLEANFILES = @MOSTLYCLEANFILES@
NASM = @NASM@
OBJDUMP = @OBJDUMP@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
SRC_VPATH = @SRC_VPATH@
STRIP = @STRIP@
VERSION = @VERSION@
am__include = @am__include@
am__quote = @am__quote@
install_sh = @install_sh@
liblzo = @liblzo@
ltest_LIBS = @ltest_LIBS@
AUTOMAKE_OPTIONS = 1.6
INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/src
CFLAGS = @CFLAGS@ $(CFLAGS_O) $(CFLAGS_W) $(LZO_CFLAGS)
noinst_PROGRAMS = align chksum promote sizes
align_LDADD = @liblzo@
chksum_LDADD = @liblzo@
subdir = tests
mkinstalldirs = $(SHELL) $(top_srcdir)/acconfig/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
noinst_PROGRAMS = align$(EXEEXT) chksum$(EXEEXT) promote$(EXEEXT) \
sizes$(EXEEXT)
PROGRAMS = $(noinst_PROGRAMS)
align_SOURCES = align.c
align_OBJECTS = align.$(OBJEXT)
align_DEPENDENCIES =
align_LDFLAGS =
chksum_SOURCES = chksum.c
chksum_OBJECTS = chksum.$(OBJEXT)
chksum_DEPENDENCIES =
chksum_LDFLAGS =
promote_SOURCES = promote.c
promote_OBJECTS = promote.$(OBJEXT)
promote_LDADD = $(LDADD)
promote_DEPENDENCIES =
promote_LDFLAGS =
sizes_SOURCES = sizes.c
sizes_OBJECTS = sizes.$(OBJEXT)
sizes_LDADD = $(LDADD)
sizes_DEPENDENCIES =
sizes_LDFLAGS =
DEFS = @DEFS@
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
depcomp = $(SHELL) $(top_srcdir)/acconfig/depcomp
am__depfiles_maybe = depfiles
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/align.Po ./$(DEPDIR)/chksum.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/promote.Po ./$(DEPDIR)/sizes.Po
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
$(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
DIST_SOURCES = align.c chksum.c promote.c sizes.c
DIST_COMMON = Makefile.am Makefile.in
SOURCES = align.c chksum.c promote.c sizes.c
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu tests/Makefile
Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
clean-noinstPROGRAMS:
@list='$(noinst_PROGRAMS)'; for p in $$list; do \
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
echo " rm -f $$p $$f"; \
rm -f $$p $$f ; \
done
align$(EXEEXT): $(align_OBJECTS) $(align_DEPENDENCIES)
@rm -f align$(EXEEXT)
$(LINK) $(align_LDFLAGS) $(align_OBJECTS) $(align_LDADD) $(LIBS)
chksum$(EXEEXT): $(chksum_OBJECTS) $(chksum_DEPENDENCIES)
@rm -f chksum$(EXEEXT)
$(LINK) $(chksum_LDFLAGS) $(chksum_OBJECTS) $(chksum_LDADD) $(LIBS)
promote$(EXEEXT): $(promote_OBJECTS) $(promote_DEPENDENCIES)
@rm -f promote$(EXEEXT)
$(LINK) $(promote_LDFLAGS) $(promote_OBJECTS) $(promote_LDADD) $(LIBS)
sizes$(EXEEXT): $(sizes_OBJECTS) $(sizes_DEPENDENCIES)
@rm -f sizes$(EXEEXT)
$(LINK) $(sizes_LDFLAGS) $(sizes_OBJECTS) $(sizes_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT) core *.core
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/align.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chksum.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/promote.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sizes.Po@am__quote@
distclean-depend:
-rm -rf ./$(DEPDIR)
.c.o:
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
.c.obj:
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(COMPILE) -c `cygpath -w $<`
.c.lo:
@AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
CCDEPMODE = @CCDEPMODE@
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
ETAGS = etags
ETAGSFLAGS =
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@list='$(DISTFILES)'; for file in $$list; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkinstalldirs) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS)
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
mostlyclean-am
distclean: distclean-am
distclean-am: clean-am distclean-compile distclean-depend \
distclean-generic distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
info: info-am
info-am:
install-data-am:
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
uninstall-am: uninstall-info-am
.PHONY: GTAGS all all-am check check-am clean clean-generic \
clean-libtool clean-noinstPROGRAMS distclean distclean-compile \
distclean-depend distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am info info-am install \
install-am install-data install-data-am install-exec \
install-exec-am install-info install-info-am install-man \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
tags uninstall uninstall-am uninstall-info-am
@liblzo@:
cd $(top_builddir)/src && $(MAKE) all
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
|
Added work/contrib/lzo/lzo-1.08/tests/align.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
#! /bin/sh
# align - temporary wrapper script for .libs/align
# Generated by ltmain.sh - GNU libtool 1.4.2a (1.922.2.93 2002/05/06 15:02:58)
#
# The align program cannot be directly executed until all the libtool
# libraries that it depends on are installed.
#
# This wrapper script should never be moved out of the build directory.
# If it is, it will not operate correctly.
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
Xsed=/usr/bin/sed' -e 1s/^X//'
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
if test "${CDPATH+set}" = set; then CDPATH=:; export CDPATH; fi
relink_command="(cd /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/tests; { test -z \"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { LIBRARY_PATH=; export LIBRARY_PATH; }; }; { test -z \"\${COMPILER_PATH+set}\" || unset COMPILER_PATH || { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z \"\${GCC_EXEC_PREFIX+set}\" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=; export GCC_EXEC_PREFIX; }; }; { test -z \"\${LD_RUN_PATH+set}\" || unset LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; { test -z \"\${LD_LIBRARY_PATH+set}\" || unset LD_LIBRARY_PATH || { LD_LIBRARY_PATH=; export LD_LIBRARY_PATH; }; }; PATH=\"/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/openwin/bin:/usr/games:/usr/local/jdk1.3.1_01/bin:/usr/local/mysql/bin:.\"; export PATH; gcc -O2 -Wall -Wcast-align -Wcast-qual -Wwrite-strings -fno-strength-reduce -fstrict-aliasing -o \$progdir/\$file align.o ../src/.libs/liblzo.so -Wl,--rpath -Wl,/home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/src/.libs -Wl,--rpath -Wl,/usr/local/lib)"
# This environment variable determines our operation mode.
if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
# install mode needs the following variable:
notinst_deplibs=' ../src/liblzo.la'
else
# When we are sourced in execute mode, $file and $echo are already set.
if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
echo="echo"
file="$0"
# Make sure echo works.
if test "X$1" = X--no-reexec; then
# Discard the --no-reexec flag, and continue.
shift
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
# Yippee, $echo works!
:
else
# Restart under the correct shell, and then maybe $echo will work.
exec /bin/sh "$0" --no-reexec ${1+"$@"}
fi
fi
# Find the directory that this script lives in.
thisdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
test "x$thisdir" = "x$file" && thisdir=.
# Follow symbolic links until we get to the real thisdir.
file=`ls -ld "$file" | /usr/bin/sed -n 's/.*-> //p'`
while test -n "$file"; do
destdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
# If there was a directory component, then change thisdir.
if test "x$destdir" != "x$file"; then
case "$destdir" in
[\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;;
*) thisdir="$thisdir/$destdir" ;;
esac
fi
file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
file=`ls -ld "$thisdir/$file" | /usr/bin/sed -n 's/.*-> //p'`
done
# Try to get the absolute directory name.
absdir=`cd "$thisdir" && pwd`
test -n "$absdir" && thisdir="$absdir"
program=lt-'align'
progdir="$thisdir/.libs"
if test ! -f "$progdir/$program" || \
{ file=`ls -1dt "$progdir/$program" "$progdir/../$program" 2>/dev/null | /usr/bin/sed 1q`; \
test "X$file" != "X$progdir/$program"; }; then
file="$$-$program"
if test ! -d "$progdir"; then
mkdir "$progdir"
else
rm -f "$progdir/$file"
fi
# relink executable if necessary
if test -n "$relink_command"; then
if relink_command_output=`eval $relink_command 2>&1`; then :
else
echo "$relink_command_output" >&2
rm -f "$progdir/$file"
exit 1
fi
fi
mv -f "$progdir/$file" "$progdir/$program" 2>/dev/null ||
{ rm -f "$progdir/$program";
mv -f "$progdir/$file" "$progdir/$program"; }
rm -f "$progdir/$file"
fi
if test -f "$progdir/$program"; then
if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
# Run the actual program with our arguments.
# Export the path to the program.
PATH="$progdir:$PATH"
export PATH
exec $program ${1+"$@"}
$echo "$0: cannot exec $program ${1+"$@"}"
exit 1
fi
else
# The program doesn't exist.
$echo "$0: error: $progdir/$program does not exist" 1>&2
$echo "This script is just a wrapper for $program." 1>&2
echo "See the libtool documentation for more information." 1>&2
exit 1
fi
fi
|
Added work/contrib/lzo/lzo-1.08/tests/align.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
|
/* align.c -- test alignment (important for 16-bit systems)
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include <lzoconf.h>
#include <lzoutil.h>
#if 1
#include "lzo_conf.h"
#include "lzo_ptr.h"
#endif
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#define NDEBUG
#undef NDEBUG
#include <assert.h>
int opt_verbose = 0;
/*************************************************************************
//
**************************************************************************/
long align_test(lzo_byte *block, lzo_uint len, lzo_uint step)
{
lzo_byte *b1 = block;
lzo_byte *b2 = block;
lzo_byte *k1 = NULL;
lzo_byte *k2 = NULL;
lzo_byte *k;
lzo_byte *x;
lzo_uint offset = 0;
long i = 0;
assert(step > 0);
assert(step <= 65536L);
assert((step & (step - 1)) == 0);
for (offset = step; offset < len; offset += step)
{
k1 = LZO_PTR_ALIGN_UP(b1+1,step);
k2 = b2 + offset;
if (k1 != k2)
{
printf("error 1: i %ld step %ld offset %ld: "
"%p (%ld) %p (%ld)\n",
i, (long) step, (long) offset,
k1, (long) (k1 - block),
k2, (long) (k2 - block));
return 0;
}
if (k1 - step != b1)
{
printf("error 2: i %ld step %ld offset %ld: "
"%p (%ld) %p (%ld)\n",
i, (long) step, (long) offset,
b1, (long) (b1 - block),
k1, (long) (k1 - block));
return 0;
}
assert(k1 > b1);
assert(k2 > b2);
assert((lzo_uint)(k2 - b2) == offset);
assert(k1 - offset == b2);
#if defined(PTR_ALIGNED_4)
if (step == 4)
{
assert(PTR_ALIGNED_4(k1));
assert(PTR_ALIGNED_4(k2));
assert(PTR_ALIGNED2_4(k1,k2));
}
#endif
#if defined(PTR_ALIGNED_8)
if (step == 8)
{
assert(PTR_ALIGNED_8(k1));
assert(PTR_ALIGNED_8(k2));
assert(PTR_ALIGNED2_8(k1,k2));
}
#endif
#if defined(PTR_LINEAR)
assert((PTR_LINEAR(k1) & (step-1)) == 0);
assert((PTR_LINEAR(k2) & (step-1)) == 0);
#endif
for (k = b1 + 1; k <= k1; k++)
{
x = LZO_PTR_ALIGN_UP(k,step);
if (x != k1)
{
printf("error 3: base: %p %p %p i %ld step %ld offset %ld: "
"%p (%ld) %p (%ld) %p (%ld)\n",
block, b1, b2,
i, (long) step, (long) offset,
k1, (long) (k1 - block),
k, (long) (k - block),
x, (long) (x - block));
return 0;
}
}
b1 = k1;
i++;
}
return i;
}
/*************************************************************************
//
**************************************************************************/
#define BLOCK_LEN (128*1024L)
static lzo_byte _block[ 2*BLOCK_LEN + 256 ];
int main(int argc, char *argv[])
{
lzo_uint step;
if (argc >= 2 && strcmp(argv[1],"-v") == 0)
opt_verbose = 1;
if (lzo_init() != LZO_E_OK)
{
printf("lzo_init() failed !!!\n");
return 2;
}
printf("Align init: %p ( 0x%lx )\n", _block, (unsigned long) _block);
for (step = 1; step <= 65536L; step *= 2)
{
lzo_byte *block = _block;
long n;
unsigned gap;
block = LZO_PTR_ALIGN_UP(block,step);
gap = __lzo_align_gap(block,step);
if (opt_verbose >= 1)
printf("STEP %5ld: GAP: %5lu %p %p %5ld\n",
(long) step, (long) gap, _block, block,
(long) (block - _block));
n = align_test(block,BLOCK_LEN,step);
if (n == 0)
return 1;
if ((n + 1) * step != BLOCK_LEN)
{
printf("error 4: %ld %ld\n",(long)step,n);
return 1;
}
}
printf("Alignment test passed.\n");
return 0;
}
/*
vi:ts=4
*/
|
Added work/contrib/lzo/lzo-1.08/tests/chksum.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
#! /bin/sh
# chksum - temporary wrapper script for .libs/chksum
# Generated by ltmain.sh - GNU libtool 1.4.2a (1.922.2.93 2002/05/06 15:02:58)
#
# The chksum program cannot be directly executed until all the libtool
# libraries that it depends on are installed.
#
# This wrapper script should never be moved out of the build directory.
# If it is, it will not operate correctly.
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
Xsed=/usr/bin/sed' -e 1s/^X//'
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
if test "${CDPATH+set}" = set; then CDPATH=:; export CDPATH; fi
relink_command="(cd /home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/tests; { test -z \"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { LIBRARY_PATH=; export LIBRARY_PATH; }; }; { test -z \"\${COMPILER_PATH+set}\" || unset COMPILER_PATH || { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z \"\${GCC_EXEC_PREFIX+set}\" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=; export GCC_EXEC_PREFIX; }; }; { test -z \"\${LD_RUN_PATH+set}\" || unset LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; { test -z \"\${LD_LIBRARY_PATH+set}\" || unset LD_LIBRARY_PATH || { LD_LIBRARY_PATH=; export LD_LIBRARY_PATH; }; }; PATH=\"/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/openwin/bin:/usr/games:/usr/local/jdk1.3.1_01/bin:/usr/local/mysql/bin:.\"; export PATH; gcc -O2 -Wall -Wcast-align -Wcast-qual -Wwrite-strings -fno-strength-reduce -fstrict-aliasing -o \$progdir/\$file chksum.o ../src/.libs/liblzo.so -Wl,--rpath -Wl,/home/rkeene/devel/compression/work/contrib/lzo/lzo-1.08/src/.libs -Wl,--rpath -Wl,/usr/local/lib)"
# This environment variable determines our operation mode.
if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
# install mode needs the following variable:
notinst_deplibs=' ../src/liblzo.la'
else
# When we are sourced in execute mode, $file and $echo are already set.
if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
echo="echo"
file="$0"
# Make sure echo works.
if test "X$1" = X--no-reexec; then
# Discard the --no-reexec flag, and continue.
shift
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
# Yippee, $echo works!
:
else
# Restart under the correct shell, and then maybe $echo will work.
exec /bin/sh "$0" --no-reexec ${1+"$@"}
fi
fi
# Find the directory that this script lives in.
thisdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
test "x$thisdir" = "x$file" && thisdir=.
# Follow symbolic links until we get to the real thisdir.
file=`ls -ld "$file" | /usr/bin/sed -n 's/.*-> //p'`
while test -n "$file"; do
destdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
# If there was a directory component, then change thisdir.
if test "x$destdir" != "x$file"; then
case "$destdir" in
[\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;;
*) thisdir="$thisdir/$destdir" ;;
esac
fi
file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
file=`ls -ld "$thisdir/$file" | /usr/bin/sed -n 's/.*-> //p'`
done
# Try to get the absolute directory name.
absdir=`cd "$thisdir" && pwd`
test -n "$absdir" && thisdir="$absdir"
program=lt-'chksum'
progdir="$thisdir/.libs"
if test ! -f "$progdir/$program" || \
{ file=`ls -1dt "$progdir/$program" "$progdir/../$program" 2>/dev/null | /usr/bin/sed 1q`; \
test "X$file" != "X$progdir/$program"; }; then
file="$$-$program"
if test ! -d "$progdir"; then
mkdir "$progdir"
else
rm -f "$progdir/$file"
fi
# relink executable if necessary
if test -n "$relink_command"; then
if relink_command_output=`eval $relink_command 2>&1`; then :
else
echo "$relink_command_output" >&2
rm -f "$progdir/$file"
exit 1
fi
fi
mv -f "$progdir/$file" "$progdir/$program" 2>/dev/null ||
{ rm -f "$progdir/$program";
mv -f "$progdir/$file" "$progdir/$program"; }
rm -f "$progdir/$file"
fi
if test -f "$progdir/$program"; then
if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
# Run the actual program with our arguments.
# Export the path to the program.
PATH="$progdir:$PATH"
export PATH
exec $program ${1+"$@"}
$echo "$0: cannot exec $program ${1+"$@"}"
exit 1
fi
else
# The program doesn't exist.
$echo "$0: error: $progdir/$program does not exist" 1>&2
$echo "This script is just a wrapper for $program." 1>&2
echo "See the libtool documentation for more information." 1>&2
exit 1
fi
fi
|
Added work/contrib/lzo/lzo-1.08/tests/chksum.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
/* chksum.c -- compute a checksum
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include <lzoconf.h>
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
/*************************************************************************
//
**************************************************************************/
static lzo_byte block[128*1024L];
int main(int argc, char *argv[])
{
lzo_uint block_len;
lzo_uint32 adler, crc;
if (argc < 0 && argv == NULL) /* avoid warning about unused args */
return 0;
if (lzo_init() != LZO_E_OK)
{
printf("lzo_init() failed !!!\n");
return 3;
}
/* prepare the block */
block_len = sizeof(block);
lzo_memset(block, 0, block_len);
/* adler32 checksum */
adler = lzo_adler32(0, NULL, 0);
adler = lzo_adler32(adler, block, block_len);
if (adler != 0x001e0001UL)
{
printf("adler32 checksum error !!! (0x%08lx)\n", (long) adler);
return 2;
}
/* crc32 checksum */
crc = lzo_crc32(0, NULL, 0);
crc = lzo_crc32(crc, block, block_len);
if (crc != 0x7ee8cdcdUL)
{
printf("crc32 checksum error !!! (0x%08lx)\n", (long) crc);
return 1;
}
printf("Checksum test passed.\n");
return 0;
}
/*
vi:ts=4
*/
|
Added work/contrib/lzo/lzo-1.08/tests/promote.
cannot compute difference between binary files
Added work/contrib/lzo/lzo-1.08/tests/promote.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
/* promote.c -- test intergral promotion
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include <stdio.h>
int main()
{
unsigned char c;
int s;
c = (unsigned char) (1 << (8 * sizeof(char) - 1));
s = 8 * (int) (sizeof(int) - sizeof(char));
printf("Integral promotion: ");
if ((c << s) > 0)
{
printf("Classic C (unsigned-preserving)\n");
printf("%d %d %u\n", c, s, c << s);
return 1;
}
else
{
printf("ANSI C (value-preserving)\n");
printf("%d %d %d\n", c, s, c << s);
return 0;
}
}
|
Added work/contrib/lzo/lzo-1.08/tests/sizes.
cannot compute difference between binary files
Added work/contrib/lzo/lzo-1.08/tests/sizes.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
|
/* sizes.c -- print sizes of various types
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
*/
#include <lzoconf.h>
#include <stdio.h>
union _lzo_align1_t
{
char a_char;
};
struct _lzo_align2_t
{
char a_char;
};
struct _lzo_align3_t
{
char a_char;
long a_long;
};
struct _lzo_align4_t
{
char a_char;
char * a_char_p;
};
struct _lzo_align5_t
{
char a_char1;
long a_long;
char a_char2;
char * a_char_p;
};
union _lzo_align6_t
{
char a_char;
long a_long;
char * a_char_p;
lzo_bytep a_lzobytep;
};
#define print_size(type) \
sprintf(s,"sizeof(%s)",#type); \
printf("%-30s %2d\n", s, (int)sizeof(type));
#define print_ssize(type,m) \
sprintf(s,"sizeof(%s)",#type); \
printf("%-30s %2d %20ld\n", s, (int)sizeof(type), (long)(m));
#define print_usize(type,m) \
sprintf(s,"sizeof(%s)",#type); \
printf("%-30s %2d %20lu\n", s, (int)sizeof(type), (unsigned long)(m));
int main()
{
char s[80];
print_ssize(char,CHAR_MAX);
print_usize(unsigned char,UCHAR_MAX);
print_ssize(short,SHRT_MAX);
print_usize(unsigned short,USHRT_MAX);
print_ssize(int,INT_MAX);
print_usize(unsigned int,UINT_MAX);
print_ssize(long,LONG_MAX);
print_usize(unsigned long,ULONG_MAX);
printf("\n");
print_size(char *);
print_size(void (*)(void));
printf("\n");
print_ssize(lzo_int,LZO_INT_MAX);
print_usize(lzo_uint,LZO_UINT_MAX);
print_usize(lzo_uint32,LZO_UINT32_MAX);
print_size(lzo_bytep);
printf("\n");
print_size(union _lzo_align1_t);
print_size(struct _lzo_align2_t);
print_size(struct _lzo_align3_t);
print_size(struct _lzo_align4_t);
print_size(struct _lzo_align5_t);
print_size(union _lzo_align6_t);
return 0;
}
/*
vi:ts=4
*/
|
Added work/contrib/lzo/lzo-1.08/util/check.sh.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
#! /bin/sh
set -e
#
# usage: util/check.sh [directory]
#
# This script runs ltest with all algorithms on a complete directory tree.
# It is not suitable for accurate timings.
#
# Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
#
LTEST="ltest"
test -x ./ltest/ltest && LTEST="./ltest/ltest"
test -x ./ltest.exe && LTEST="./ltest.exe"
LFLAGS="-q -n2"
dir="${*-.}"
TMPFILE="/tmp/lzo_$$.tmp"
rm -f $TMPFILE
(find $dir/ -type f -print > $TMPFILE) || true
## methods=`$LTEST -m | sed -n 's/^ *-m\([0-9]*\).*/\1/p'`
## methods="9721 9722 9723 9724 9725 9726 9727 9728 9729"
methods="21 31 1 2 3 4 5 6 7 8 9 11 12 13 14 15 16 17 18 19 61 71 81"
methods="$methods 111 112 115"
methods="$methods 921 931 901 911"
methods="$methods 902 912 942 962 972 982 992"
for i in $methods; do
cat $TMPFILE | $LTEST -m${i} -@ $LFLAGS
done
rm -f $TMPFILE
echo "Done."
exit 0
|
Added work/contrib/lzo/lzo-1.08/util/checkasm.sh.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
#! /bin/sh
set -e
#
# usage: util/checkasm.sh [directory]
#
# This script runs ltest with all assembler decompressors
# on a complete directory tree.
# It is not suitable for accurate timings.
#
# Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
#
LTEST="ltest"
test -x ./ltest/ltest && LTEST="./ltest/ltest"
test -x ./ltest.exe && LTEST="./ltest.exe"
LFLAGS="-q"
dir="${*-.}"
TMPFILE="/tmp/lzo_$$.tmp"
rm -f $TMPFILE
(find $dir/ -type f -print > $TMPFILE) || true
for i in 11; do
cat $TMPFILE | $LTEST -m${i} -@ $LFLAGS -A
cat $TMPFILE | $LTEST -m${i} -@ $LFLAGS -A -S
done
for i in 61; do
cat $TMPFILE | $LTEST -m${i} -@ $LFLAGS -F
cat $TMPFILE | $LTEST -m${i} -@ $LFLAGS -F -S
done
for i in 71 81; do
cat $TMPFILE | $LTEST -m${i} -@ $LFLAGS -A
cat $TMPFILE | $LTEST -m${i} -@ $LFLAGS -A -S
cat $TMPFILE | $LTEST -m${i} -@ $LFLAGS -F
cat $TMPFILE | $LTEST -m${i} -@ $LFLAGS -F -S
done
rm -f $TMPFILE
echo "Done."
exit 0
|
Added work/contrib/lzo/lzo-1.08/util/notime.pl.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#! /usr/bin/perl
##
## vi:ts=4
##
##---------------------------------------------------------------------------##
##
## Author:
## Markus F.X.J. Oberhumer <markus@oberhumer.com>
##
## Description:
## Remove timing values from a table created by table.pl
##
## Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
##
##---------------------------------------------------------------------------##
while (<>) {
if (substr($_,52) =~ /^\s+[\d\.]+\s+[\d\.]+\s+\|\s*\n$/i) {
substr($_,52) = " 0.00 0.00 |\n";
}
print;
}
exit(0);
|
Added work/contrib/lzo/lzo-1.08/util/overlap.sh.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#! /bin/sh
set -e
#
# usage: util/overlap.sh [directory]
#
# This script runs the overlap example program on a complete directory tree.
#
# Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
#
OVERLAP="overlap"
test -x ./examples/overlap && OVERLAP="./examples/overlap"
test -x ./overlap.exe && OVERLAP="./overlap.exe"
dir="${*-.}"
TMPFILE="/tmp/lzo_$$.tmp"
rm -f $TMPFILE
(find $dir/ -type f -print0 > $TMPFILE) || true
cat $TMPFILE | xargs -0 -r $OVERLAP
rm -f $TMPFILE
echo "Done."
exit 0
|
Added work/contrib/lzo/lzo-1.08/util/shortf.pl.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#! /usr/bin/perl
##
## vi:ts=4
##
##---------------------------------------------------------------------------##
##
## Author:
## Markus F.X.J. Oberhumer <markus@oberhumer.com>
##
## Description:
## Create short files for compression test
##
## Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
##
##---------------------------------------------------------------------------##
$c = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
$c = "\x00\x01\x02";
$c = "\x00";
$x = $c x 1024;
for $i (0 .. 50) {
$name = sprintf("f%04d.fil",$i);
open(OUTFILE,">$name") || die "$0: cannot open '$name': $!";
binmode(OUTFILE);
print OUTFILE substr($x,0,$i);
close(OUTFILE);
}
exit(0);
|
Added work/contrib/lzo/lzo-1.08/util/table.pl.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
|
#! /usr/bin/perl
##
## vi:ts=4
##
##---------------------------------------------------------------------------##
##
## Author:
## Markus F.X.J. Oberhumer <markus@oberhumer.com>
##
## Description:
## Convert the output of the LZO test program into a nice table.
## Option '-b' will print the 'official' LZO benchmark.
##
## Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
##
##---------------------------------------------------------------------------##
$VERSION = '1.01.5';
$PROG = $0;
require 'ctime.pl';
#
# get options
#
while ($_ = $ARGV[ $[ ], /^-/) {
shift(@ARGV);
/^--$/ && ($opt_last = 1, last);
/^-b/ && ($opt_bench++, next);
/^-f/ && ($opt_force++, next);
/^-n/ && ($opt_sort_summary_by_name++, next);
/^-r/ && ($opt_sort_summary_by_ratio++, next);
/^-s/ && ($opt_summary_only++, next);
/^-t/ && ($opt_clear_time++, next);
/^-D(.*)/ && ($opt_debug = $1 ? $1 : 1);
}
$alg = '';
$sep = "+" . ("-" x 72) . "+\n";
$block_size = -1;
$n = 0;
@algs = ();
%average = ();
%total = ();
$bv_n = 0;
@bv = (0, 0, 0.0, 0.0, 0.0);
%bench = ();
$bench_total = -1;
$lzo_version_string = '';
$lzo_version_date = '';
# benchmark reference values for 100.00
%bench_c = ('LZO1B-1', 1577.00,
'LZO1B-9', 590.50,
'LZO1C-1', 1532.50,
'LZO1C-9', 588.50,
'LZO1F-1', 1654.50,
'LZO1X-1', 1598.00 );
%bench_d = ('LZO1B-1', 4381.50,
'LZO1B-9', 4395.00,
'LZO1C-1', 4403.00,
'LZO1C-9', 4408.50,
'LZO1F-1', 4769.50,
'LZO1X-1', 4907.00 );
# /***********************************************************************
# //
# ************************************************************************/
while (<>) {
if (/(^|\s)(\d+)\s+block\-size/i) {
if ($block_size < 0) {
$block_size = $2;
&start($block_size);
} elsif ($block_size != $2) {
die "$PROG: block-size: $block_size != $2\n";
}
next;
}
if (/execution\s+time.*\s+(\d+)\s/i) {
if ($bench_total < 0) {
$bench_total = $1;
} elsif ($bench_total != $1) {
die "$PROG: execution time: $bench_total != $1\n";
}
next;
}
if (/^\s*LZO\s.*library\s+\(v\s*([\w\.\s]+)\s*\,\s*([^\)]+)\)/) {
$lzo_version_string = $1;
$lzo_version_date = $2;
next;
}
if (/^\s*(\S+(\s+\[\S+\])?)\s*(\|.*\|)\s*$/i) {
if ($1 ne $alg) {
&footer($1);
&header($1);
}
$line = $3;
&stats(*line);
print "$line\n" if (!$opt_bench && !$opt_summary_only);
}
}
&footer($1);
&bench() if $opt_bench;
&summary() unless $opt_bench;
exit(0);
# /***********************************************************************
# //
# ************************************************************************/
sub stats {
local (*l) = @_;
local ($x1, $x2, $x3, $x4, $x5, $x6, $x7, $x8);
if ($l !~ /^\|\s*(.*)\s+(\d+)\s+(\d+)\s+(\d+)\s+([\d\.]+\s+)?([\d\.]+\s+)?([\d\.]+)\s+([\d\.]+)\s*\|/) {
die $_;
}
$n++;
$x1 = $1; $x2 = $2; $x3 = $3; $x4 = $4;
$x5 = ($x2 > 0) ? $x4 * 100.0 / $x2 : 0.0;
$x6 = ($x2 > 0) ? $x4 * 8.0 / $x2 : 0.0;
$x7 = $7; $x8 = $8;
if ($opt_clear_time && !$opt_bench) {
$x7 = $x8 = 0.0;
}
$s[0] += $x2;
$s[1] += $x3;
$s[2] += $x4;
$s[3] += $x5;
$s[4] += $x6;
$s[5] += $x7;
$s[6] += $x8;
$x1 =~ s/\s+$//;
$l = sprintf("| %-14s %8d %4d %8d %6.1f %5.2f %9.2f %9.2f |",
$x1, $x2, $x3, $x4, $x5, $x6, $x7, $x8);
}
# /***********************************************************************
# //
# ************************************************************************/
sub header {
local ($t) = @_;
$alg = $t;
# reset stats
$n = 0;
@s = (0, 0, 0, 0.0, 0.0, 0.0, 0.0);
return if $opt_bench;
print "\n$alg\n\n";
print $sep;
print <<Header;
| File Name Length CxB ComLen %Remn Bits Com K/s Dec K/s |
| --------- ------ --- ------ ----- ---- ------- ------- |
Header
}
# /***********************************************************************
# //
# ************************************************************************/
sub footer {
local ($t) = @_;
local ($bv);
local ($c, $d);
return unless $alg;
die if $n <= 0;
die if $s[0] <= 0;
push(@algs,$alg);
$average{$alg} =
sprintf("| %-14s %8d %4d %8d %6.1f %5.2f %9.2f %9.2f |\n",
"Average", $s[0]/$n, $s[1]/$n, $s[2]/$n,
$s[3]/$n, $s[4]/$n,
$s[5]/$n, $s[6]/$n );
$total{$alg} =
sprintf("| %-14s %8d %4d %8d %6.1f %5.2f %9.2f %9.2f |\n",
"Total", $s[0], $s[1], $s[2],
$s[2]/$s[0]*100, $s[2]/$s[0]*8,
$s[5]/$n, $s[6]/$n );
if ($opt_bench) {
$c = $bench_c{$alg};
$d = $bench_d{$alg};
($c > 0 && $d > 0) || die "$PROG: invalid benchmark algorithm $alg\n";
$n == 14 || die "$PROG: invalid benchmark suite\n";
$s[0] == 3141622 || die "$PROG: invalid benchmark length $s[0]\n";
$bv = ((($s[5]/$c + $s[6]/$d) / $n) / 2.0) * 100.0;
$bench{$alg} =
sprintf("| %-14s %10d %10d %10.2f %10.2f %11.2f |\n",
"Benchmark", $s[0], $s[2],
$s[5]/$n, $s[6]/$n , $bv);
$bv_n++;
$bv[0] += $s[0];
$bv[1] += $s[2];
$bv[2] += $s[5]/$n;
$bv[3] += $s[6]/$n;
$bv[4] += $bv;
} else {
print $sep;
print $average{$alg};
print $total{$alg};
print $sep, "\n";
}
}
# /***********************************************************************
# //
# ************************************************************************/
$sort_mode = 0;
sub cmp_by_ratio {
local ($aa, $bb);
if ($sort_mode == 0) {
$aa = $average{$a};
$bb = $average{$b};
} elsif ($sort_mode == 1) {
$aa = $total{$a};
$bb = $total{$b};
} else {
die;
}
($aa =~ m%^\s*\|\s+\S+\s+\d+\s+\d+\s+\d+\s+(\S+)%) || die;
$aa = $1;
($bb =~ m%^\s*\|\s+\S+\s+\d+\s+\d+\s+\d+\s+(\S+)%) || die;
$bb = $1;
# $aa < $bb;
$aa cmp $bb;
}
# /***********************************************************************
# //
# ************************************************************************/
sub bench {
local ($l);
local (@k);
die if $bv_n <= 0;
die if $bv[0] <= 0;
if (!$opt_force) {
$bench_total >= 1200 || die "$PROG: benchmark execution time $bench_total is too short\n";
}
@k = @algs;
print $sep;
print <<Bench;
| Algorithm Length ComLen Com K/s Dec K/s LZO bench |
| --------- ------ ------ ------- ------- --------- |
Bench
for (@k) {
$l = $bench{$_};
$l =~ s/Benchmark[\s]{5}/sprintf("%-14s",$_)/e;
print $l;
}
print $sep;
printf("| %-14s %10d %10d %-10s %-10s %11.2f |\n",
"OVERALL", $bv[0], $bv[1], "", "", $bv[4]/$bv_n);
print $sep;
}
# /***********************************************************************
# //
# ************************************************************************/
sub summary {
local ($l);
local (@k);
$sort_mode = 0;
if ($opt_sort_summary_by_name) {
@k = sort(@algs);
} elsif ($opt_sort_summary_by_ratio) {
@k = sort(cmp_by_ratio @algs);
} else {
@k = @algs;
}
print "\n\n";
print "Summary of average values\n\n";
print $sep;
print <<Summary;
| Algorithm Length CxB ComLen %Remn Bits Com K/s Dec K/s |
| --------- ------ --- ------ ----- ---- ------- ------- |
Summary
for (@k) {
$l = $average{$_};
$l =~ s/Average[\s]{7}/sprintf("%-14s",$_)/e;
print $l;
}
print $sep;
$sort_mode = 1;
if ($opt_sort_summary_by_name) {
@k = sort(@algs);
} elsif ($opt_sort_summary_by_ratio) {
@k = sort(cmp_by_ratio @algs);
} else {
@k = @algs;
}
print "\n\n";
print "Summary of total values\n\n";
print $sep;
print <<Summary;
| Algorithm Length CxB ComLen %Remn Bits Com K/s Dec K/s |
| --------- ------ --- ------ ----- ---- ------- ------- |
Summary
for (@k) {
$l = $total{$_};
$l =~ s/Total[\s]{9}/sprintf("%-14s",$_)/e;
print $l;
}
print $sep;
print <<Summary;
Notes:
- CxB is the number of blocks
- K/s is the speed measured in 1000 uncompressed bytes per second
- all averages are calculated from the un-rounded values
Summary
}
# /***********************************************************************
# //
# ************************************************************************/
sub start {
local ($bs) = @_;
local ($v, $t, $x);
local ($u, $uname_m, $uname_s, $uname_r);
$t = &ctime(time); chop($t);
$t = sprintf("%-51s |", $t);
$v='';
if ($lzo_version_string) {
$v = $lzo_version_string;
$v .= ', ' . $lzo_version_date if $lzo_version_date;
$v = sprintf("%-51s |", $v);
$v = sprintf("| LZO version : %s\n", $v);
}
if ($bs % 1024 == 0) {
$x = sprintf("%d (= %d kB)", $bs, $bs / 1024);
} else {
$x = sprintf("%d (= %.3f kB)", $bs, $bs / 1024.0);
}
$x = sprintf("%-51s |", $x);
$u='';
if (1 == 1) {
$uname_s = `uname -s`; $uname_s =~ s/^\s+//; $uname_s =~ s/\s+$//;
$uname_r = `uname -r`; $uname_r =~ s/^\s+//; $uname_r =~ s/\s+$//;
$uname_m = `uname -m`; $uname_m =~ s/^\s+//; $uname_m =~ s/\s+$//;
if ($uname_s && $uname_m) {
$u = $uname_s;
$u .= ' ' . $uname_r if $uname_r;
$u .= ' ' . $uname_m;
$u = sprintf("%-51s |", $u);
$u = sprintf("| Operating system : %s\n", $u);
}
}
if ($opt_bench) {
print <<Start;
+------------------------------------------------------------------------+
| LZO 'OFFICIAL' BENCHMARK |
| ======================== |
| Time of run : $t
$v$u| Test suite : Calgary Corpus Suite |
| Files in suite : 14 |
| Context length : $x
+------------------------------------------------------------------------+
Start
} else {
print <<Start;
+------------------------------------------------------------------------+
| DATA COMPRESSION TEST |
| ===================== |
| Time of run : $t
$v$u| Context length : $x
| Timing accuracy : One part in 100 |
+------------------------------------------------------------------------+
Start
}
}
__END__
### insert something like this after 'Time of run':
| Hardware : Intel Pentium 133, 64 MB RAM, 256 kB Cache |
| Operating system : MS-DOS 7.10, HIMEM.SYS 3.95, DOS/4GW 1.97 |
| Compiler : Watcom C32 10.5 |
| Compiler flags : -mf -5r -oneatx |
| Test suite : Calgary Corpus Suite |
| Files in suite : 14 |
|
Added work/contrib/lzo/lzo-1.08/util/uncompr.pl.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#! /usr/bin/perl
##
## vi:ts=4
##
##---------------------------------------------------------------------------##
##
## Author:
## Markus F.X.J. Oberhumer <markus@oberhumer.com>
##
## Description:
## Create uncompressible files for compression test
##
## Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
##
##---------------------------------------------------------------------------##
$x = ' ' x 65536;
$i = 0;
while ($i < 65536) {
substr($x,$i,1) = pack('C',rand(256));
$i++;
}
for $i (1,2,4,8,16,32,64) {
$name = sprintf("u%04d.fil",$i);
open(OUTFILE,">$name") || die "$0: cannot open '$name': $!";
binmode(OUTFILE);
print OUTFILE substr($x,0,$i*1024);
close(OUTFILE);
}
exit(0);
|
Added work/contrib/lzo/lzop-1.00.tar.gz.
cannot compute difference between binary files
Added work/contrib/tic/tic98-1.01.tar.gz.
cannot compute difference between binary files
Added work/contrib/tic/tic98/COPYING.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
|
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
|
Added work/contrib/tic/tic98/Makefile.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
|
BIN=/home/singlis/linux/bin
IMAGES=/home/ml/singlis
LIBTIC=
LIBS= -lm #-L/home/singlis/linux/lib -lccmalloc -ldl
CC= gcc -pipe
CPP= gcc -pipe
#CFLAGS=-O -g -Wall
CFLAGS= -O -Wall -Wno-unused
EXES=tic98 tic98l b_gamma_enc b_gamma_dec q_gamma_enc q_gamma_dec \
rotate_image random_image pbmtohough ppmd_enc ppmd_dec\
pbm_to_node pbm_to_coords pbmclean page_features rls zone_highlight \
char_features pbmtomarks labelmarks
all: tic98 ppmd_enc ppmd_dec b_gamma_enc b_gamma_dec
all2: $(EXES)
.SUFFIXES: .cc .c
.cc.o:
$(CPP) $(CFLAGS) -c $*.cc
.c.o:
$(CC) $(CFLAGS) -c $*.c
exp:
(cd results; make -f Makefile)
install: all
install $(EXES) $(BIN)
clean:
rm -f *~ core *.o *.bak images/*.cmp $(EXES) #main_tic_test
ppmd_enc: ppmd_enc.o ppmd_model.o ppmd_hash.o arithcode.o getopt.o
$(CC) -o $@ $^ $(LIBS)
ppmd_dec: ppmd_dec.o ppmd_model.o ppmd_hash.o arithcode.o getopt.o
$(CC) -o $@ $^ $(LIBS)
b_gamma_enc: b_gamma_enc.o arithcode.o getopt.o b_gamma.o globals.o
$(CC) -o $@ $^ $(LIBS)
convert: convert.o arithcode.o getopt.o b_gamma.o globals.o
$(CC) -o $@ $^
deconvert: deconvert.o arithcode.o getopt.o b_gamma.o globals.o
$(CC) -o $@ $^
b_gamma_dec: b_gamma_dec.o arithcode.o getopt.o b_gamma.o globals.o
$(CC) -o $@ $^ $(LIBS)
q_gamma_enc: b_gamma.o b_gamma_enc.o arithcode.o globals.o
$(CC) $(CFLAGS) -o $@ $^
q_gamma_dec: b_gamma.o b_gamma_dec.o arithcode.o globals.o
$(CC) $(CFLAGS) -o $@ $^
rls: rls.o marklist.o pbmtools.o math-utils.o utils.o boundary.o
$(CC) -o $@ $^ $(LIBS)
zone_highlight: zone_highlight.o marklist.o pbmtools.o math-utils.o utils.o boundary.o
$(CC) -o $@ $^ $(LIBS)
tic98: main_tic.o tic98.o codebook.o context.o b_gamma.o sort_lines.o \
boundary.o marklist.o pbmtools.o template_match.o \
arithcode.o utils.o getopt.o vector.o windowing.o globals.o \
timer.o rotate.o docstrum.o line.o ppmd_model.o ppmd_hash.o \
codebilevel.o
$(CC) -o $@ $^ $(LIBS)
page_features: page_features.o marklist.o pbmtools.o boundary.o\
utils.o getopt.o globals.o rotate.o
$(CC) -o $@ $^ $(LIBS)
char_features: char_features.o marklist.o pbmtools.o boundary.o\
utils.o getopt.o globals.o rotate.o template_match.o context.o arithcode.o
$(CC) -o $@ $^ $(LIBS)
pbmclean: pbmclean.o boundary.o marklist.o pbmtools.o utils.o
$(CC) -o $@ $^ $(LIBS)
pbmtomarks: pbmtomarks.o boundary.o marklist.o pbmtools.o utils.o
$(CC) -o $@ $^ $(LIBS)
labelmarks: labelmarks.o boundary.o marklist.o pbmtools.o utils.o
$(CC) -o $@ $^ $(LIBS)
tic98l: main_tic.o tic98l.o codebook.o context.o b_gamma.o sort_lines.o \
boundary.o marklist.o pbmtools.o template_match.o \
arithcode.o utils.o getopt.o vector.o windowing.o globals.o \
timer.o rotate.o docstrum.o line.o ppmd_model.o ppmd_hash.o \
codebilevel.o
$(CC) -o $@ $^ $(LIBS)
pbmtohough: pbmtohough.o hough.o marklist.o math-utils.o windowing.o double_array.o pbmtools.o utils.o boundary.o
$(CC) -o $@ $^ $(LIBS)
random_image: random_image.o hough.o marklist.o math-utils.o windowing.o double_array.o pbmtools.o utils.o boundary.o
$(CC) -o $@ $^ $(LIBS)
regress: main_tic
./main_tic -c -i ${IMAGES}/uw_fifty_300/A006.pbm -o cmp -8N -R Howard; cmp cmp regression/A006.regress
./main_tic -c -i $(IMAGES)/uw_fifty_300/S048.pbm -o cmp -8N -R Howard; cmp cmp regression/S048.regress
\rm cmp
check: main_tic
./main_tic -c -i ${IMAGES}/uw_fifty_300/A006.pbm -o cmp -f images/A006
./main_tic -d -i cmp -o cmp
cmp cmp.001 ${IMAGES}/uw_fifty_300/A006.pbm
test: test_1 test_2 test_3 test_4 test_5
test_1: main_tic random_image
cp ./main_tic ./main_tic_test
test=0;failed=0;while [ 1 ]; do (./random_image >/tmp/random.1.pbm; \
date;\
./main_tic_test -c -i /tmp/random.1.pbm -o /tmp/cmp.1 -m B_AVG;\
./main_tic_test -d -i /tmp/cmp.1 -o /tmp/random.1.decmp -m B_AVG;\
cmp /tmp/random.1.pbm /tmp/random.1.decmp.001;); if [ $$? -eq 1 ]; then failed=`expr $$failed + 1`;fi; test=`expr $$test + 1`; echo passed: $$test, failed: $$failed; done
test_2: main_tic random_image
sleep 2;
test=0;failed=0;while [ 1 ]; do (./random_image >/tmp/random.2.pbm; \
date;\
./main_tic_test -c -i /tmp/random.2.pbm -o /tmp/cmp.2 -m F_AVG ;\
./main_tic_test -d -i /tmp/cmp.2 -o /tmp/random.2.decmp -m F_AVG;\
cmp /tmp/random.2.pbm /tmp/random.2.decmp.001;); if [ $$? -eq 1 ]; then failed=`expr $$failed + 1`;fi; test=`expr $$test + 1`; echo passed: $$test, failed: $$failed; done
test_3: main_tic random_image
sleep 2;
test=0;failed=0;while [ 1 ]; do (./random_image >/tmp/random.3.pbm; \
date;\
./main_tic_test -c -i /tmp/random.3.pbm -o /tmp/cmp.3 -m B_SINGLE;\
./main_tic_test -d -i /tmp/cmp.3 -o /tmp/random.3.decmp -m B_SINGLE;\
cmp /tmp/random.3.pbm /tmp/random.3.decmp.001;); if [ $$? -eq 1 ]; then failed=`expr $$failed + 1`;fi; test=`expr $$test + 1`; echo passed: $$test, failed: $$failed; done
test_4: main_tic random_image
sleep 2;
test=0;failed=0;while [ 1 ]; do (./random_image >/tmp/random.4.pbm; \
date;\
./main_tic_test -c -i /tmp/random.4.pbm -o /tmp/cmp.4 -m F_SINGLE;\
./main_tic_test -d -i /tmp/cmp.4 -o /tmp/random.4.decmp -m F_SINGLE;\
cmp /tmp/random.4.pbm /tmp/random.4.decmp.001;); if [ $$? -eq 1 ]; then failed=`expr $$failed + 1`;fi; test=`expr $$test + 1`; echo passed: $$test, failed: $$failed; done
test_5: main_tic random_image
sleep 2;
test=0;failed=0;while [ 1 ]; do (./random_image >/tmp/random.5.pbm; \
date;\
./main_tic_test -c -i /tmp/random.5.pbm -o /tmp/cmp.5 -m HYBRID;\
./main_tic_test -d -i /tmp/cmp.5 -o /tmp/random.5.decmp -m HYBRID;\
cmp /tmp/random.5.pbm /tmp/random.5.decmp.001;); if [ $$? -eq 1 ]; then failed=`expr $$failed + 1`;fi; test=`expr $$test + 1`; echo passed: $$test, failed: $$failed; done
main_skew: main_skew.o docstrum.o marklist.o pbmtools.o utils.o \
boundary.o getopt.o windowing.o
$(CC) -o $@ $^ $(LIBS)
rotate_image: rotate_image.o rotate.o marklist.o pbmtools.o utils.o
$(CC) -o $@ $^ $(LIBS)
pbm_to_coords: pbm_to_coords.o marklist.o pbmtools.o utils.o \
boundary.o getopt.o windowing.o
$(CC) -o $@ $^ $(LIBS)
pbm_to_node: pbm_to_node.o marklist.o pbmtools.o utils.o \
boundary.o getopt.o windowing.o
$(CC) -o $@ $^ $(LIBS)
coords_profile: coords_profile.o marklist.o pbmtools.o utils.o \
boundary.o getopt.o windowing.o
$(CC) -o $@ $^ $(LIBS)
coords_baird: coords_baird.o marklist.o pbmtools.o utils.o \
boundary.o getopt.o windowing.o
$(CC) -o $@ $^ $(LIBS)
coords_docstrum: coords_docstrum.o docstrum.o marklist.o pbmtools.o utils.o \
boundary.o getopt.o windowing.o
$(CC) -o $@ $^ $(LIBS)
|
Added work/contrib/tic/tic98/README.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
|
TIC98: Textual Image Compression
================================
(c) 1994-1999
Stuart Inglis,
Internz Ltd.
Hamilton
New Zealand
Version 1.01
email: singlis@internz.co.nz
http://www.cs.waikato.ac.nz/~singlis
Information
-----------
These routines complement the analysis presented in my
Ph.D. thesis. The source is C, but should compile cleanly
using a C++ compiler.
For more information about the system, visit my homepage above
and download my Ph.D. thesis (4.4 MB).
On a Unix machine use "make"
tic98
-----
The form of TIC implemented uses adaptive library encoding and
averaging. The marks are encoding using the familiar adaptive
Mohiuddin/SPM style. I have extended the model to handle
equivalence classes and example lists, with optional pruning.
./tic98 -c -i images/A006.pbm -o images/cmp
./tic98 -d -i images/cmp -o images/decmp
The decompression stage will create a decmp.001 file as we
have only compressed a single file. If multiple -i options
were given during the compression stage, they would decompress
to 001,002,003...
To give the highest compression (Table 9.1 in my thesis) use:
./tic98 -c -i file.pbm -o file.tic -Z -m B_SINGLE
This sets the pruning values to those determined by machine
learning and matches with the best single match.
**NOTE**: To save space in the output stream the compression
options are not stored in the compressed file. This means
that you must specify the -Z -m B_SINGLE options when
decompressing as well.
cheers
Stuart Inglis
1 July 1999
--------------------------------------------------
Changes from 1.0
* Checked *fp != NULL before printing (Stuart)
* Fixed a bug in calc_docstrum_list() (Marvin Brunner)
* Fixed a memory leak in marklist_removeat() (Tim Theobald)
--------------------------------------------------
Here is Table 9.1 from my Ph.D. thesis.
Image TIC98 DjVu
---------------------
A006 57156 59176
A034 51614 53770
A03J 42198 44254
A04D 62097 65491
A05E 46065 47390
C03I 42781 45221
C048 31522 31831
D03D 33002 37037
D03M 11691 12139
D048 23295 22746
D04G 45197 48104
D05N 19339 19804
D06C 30791 30121
D06N 45127 46485
E009 22972 24012
E00H 32765 32570
E00M 34297 33835
E01J 61677 64263
E037 70858 74824
E04I 29896 32539
H00C 14886 14920
H019 29914 28346
H041 33289 39436
H04D 23107 22980
H04F 48788 48608
I00J 59277 61992
I00L 60040 62631
I037 29087 30597
J03M 44547 45009
J04A 41222 44217
J04K 52054 55949
K009 33466 34613
N01A 18424 16838
N027 17093 15963
N02A 6796 6224
N02K 50891 53172
N03K 23805 23465
N048 34073 33048
N05I 39325 38310
S021 43289 43492
S03G 51185 51210
S03R 31227 30288
S044 38137 36873
S047 57478 57976
S048 53619 53554
S04H 50990 51895
V004 59305 53186
V00C 33764 33102
V00G 47042 46165
V00N 47630 48279
|
Added work/contrib/tic/tic98/arithcode.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
|
/******************************************************************************
File: coder.c
Authors: John Carpinelli (johnfc@ecr.mu.oz.au)
Wayne Salamonsen (wbs@mundil.cs.mu.oz.au)
Purpose: Data compression using a word-based model and revised
arithmetic coding method.
Based on: A. Moffat, R. Neal, I.H. Witten, "Arithmetic Coding Revisted",
Proc. IEEE Data Compression Conference, Snowbird, Utah,
March 1995.
Low-Precision Arithmetic Coding Implementation by
Radford M. Neal
Copyright 1995 John Carpinelli and Wayne Salamonsen, All Rights Reserved.
These programs are supplied free of charge for research purposes only,
and may not sold or incorporated into any commercial product. There is
ABSOLUTELY NO WARRANTY of any sort, nor any undertaking that they are
fit for ANY PURPOSE WHATSOEVER. Use them at your own risk. If you do
happen to find a bug, or have modifications to suggest, please report
the same to Alistair Moffat, alistair@cs.mu.oz.au. The copyright
notice above and this statement of conditions must remain an integral
part of each and every copy made of these files.
******************************************************************************/
#include <stdio.h>
#include <assert.h>
#include "arithcode.h"
long CountOfBitsOut;
unsigned long L; /* lower bound */
unsigned long R; /* code range */
unsigned long V; /* current code value */
unsigned long r; /* normalized range */
int bits_outstanding; /* follow bit count */
int buffer; /* I/O buffer */
int bits_to_go; /* bits left in buffer */
unsigned int bytes_input, bytes_output; /* I/O counters */
/*
*
* responsible for outputing the bit passed to it and an opposite number of
* bit equal to the value stored in bits_outstanding
*
*/
#define BIT_PLUS_FOLLOW(b) \
do \
{ \
OUTPUT_BIT((b)); \
while (bits_outstanding > 0) \
{ \
OUTPUT_BIT(!(b)); \
bits_outstanding -= 1; \
} \
} while (0)
/*
*
* responsible for outputting one bit. adds the bit to a buffer
* and once the buffer has 8 bits, it outputs a character
*
*/
#define OUTPUT_BIT(b) \
do { \
buffer >>= 1; \
if (b) \
buffer |= 1 << (BYTE_SIZE-1); \
bits_to_go -= 1; \
if (bits_to_go == 0) \
{ \
putc(buffer, stdout); \
bytes_output += 1; \
bits_to_go = BYTE_SIZE; \
} \
CountOfBitsOut++; \
} while (0)
/*
*
* reads in bits from encoded file
* reads in a char at a time into a buffer i.e 8 bits
*
*/
#define ADD_NEXT_INPUT_BIT(v) \
do { \
bits_to_go -= 1; \
if (bits_to_go < 0) \
{ \
buffer = getc(stdin); \
bits_to_go = BYTE_SIZE - 1; \
} \
v += v + (buffer & 1); \
buffer >>= 1; \
} while (0)
/*
* output code bits until the range as been expanded
* to above QUARTER
*/
#define ENCODE_RENORMALISE \
do { \
while (R < QUARTER) \
{ \
if (L >= HALF) \
{ \
BIT_PLUS_FOLLOW(1); \
L -= HALF; \
} \
else if (L+R <= HALF) \
{ \
BIT_PLUS_FOLLOW(0); \
} \
else \
{ \
bits_outstanding++; \
L -= QUARTER; \
} \
L += L; \
R += R; \
} \
} while (0)
/*
* input code bits until range has been expanded to
* more than QUARTER. Mimics encoder.
*/
#define DECODE_RENORMALISE \
do { \
while (R < QUARTER) \
{ \
if (L >= HALF) \
{ \
V -= HALF; \
L -= HALF; \
bits_outstanding = 0; \
} \
else if (L+R <= HALF) \
{ \
bits_outstanding = 0; \
} \
else \
{ \
V -= QUARTER; \
L -= QUARTER; \
bits_outstanding++; \
} \
L += L; \
R += R; \
ADD_NEXT_INPUT_BIT(V); \
} \
} while (0)
/*
*
* encode a symbol given its low, high and total frequencies
*
*/
void
arithmetic_encode(unsigned int low, unsigned int high, unsigned int total)
{
unsigned long temp;
#ifndef SHIFT_ADD
r = R/total;
temp = r*low;
L += temp;
if (high < total)
R = r*(high-low);
else
R -= temp;
#else
{
int i, nShifts;
unsigned long numerator, denominator;
unsigned long temp2;
/*
* calculate r = R/total, temp = r*low and temp2 = r*high
* using shifts and adds
*/
numerator = R;
nShifts = CODE_BITS - f_bits - 1;
denominator = total << nShifts;
r = 0;
temp = 0;
temp2 = 0;
for (i = nShifts;; i--)
{
if (numerator >= denominator)
{
numerator -= denominator;
r++;
temp += low;
temp2 += high;
}
if (i == 0) break;
numerator <<= 1; r <<= 1; temp <<= 1; temp2 <<= 1;
}
L += temp;
if (high < total)
R = temp2 - temp;
else
R -= temp;
}
#endif
ENCODE_RENORMALISE;
if (bits_outstanding >= MAX_BITS_OUTSTANDING)
{
finish_encode();
start_encode();
}
}
/*
*
* decode the target value using the current total frequency
* and the coder's state variables
*
*/
unsigned
int arithmetic_decode_target(unsigned int total)
{
unsigned long target;
#ifndef SHIFT_ADD
r = R/total;
target = (V-L)/r;
#else
{
int i, nShifts;
unsigned long numerator, denominator;
/* divide r = R/total using shifts and adds */
numerator = R;
nShifts = CODE_BITS - f_bits - 1;
denominator = total << nShifts;
r = 0;
for (i = nShifts;; i--)
{
if (numerator >= denominator)
{
numerator -= denominator;
r++;
}
if (i == 0) break;
numerator <<= 1; r <<= 1;
}
/* divide V-L by r using shifts and adds */
if (r < (1 << (CODE_BITS - f_bits - 1)))
nShifts = f_bits;
else
nShifts = f_bits - 1;
numerator = V - L;
denominator = r << nShifts;
target = 0;
for (i = nShifts;; i--)
{
if (numerator >= denominator)
{
numerator -= denominator;
target++;
}
if (i == 0) break;
numerator <<= 1; target <<= 1;
}
}
#endif
return (target >= total? total-1 : target);
}
/*
*
* decode the next input symbol
*
*/
void
arithmetic_decode(unsigned int low, unsigned int high, unsigned int total)
{
unsigned int temp;
#ifndef SHIFT_ADD
/* assume r has been set by decode_target */
temp = r*low;
L += temp;
if (high < total)
R = r*(high-low);
else
R -= temp;
#else
{
int i, nShifts;
unsigned long temp2;
/* calculate r*low and r*high using shifts and adds */
r <<= f_bits;
temp = 0;
nShifts = CODE_BITS - f_bits - 1;
temp2 = 0;
for (i = nShifts;; i--)
{
if (r >= HALF)
{
temp += low;
temp2 += high;
}
if (i == 0) break;
r <<= 1; temp <<= 1; temp2 <<= 1;
}
L += temp;
if (high < total)
R = temp2 - temp;
else
R -= temp;
}
#endif
DECODE_RENORMALISE;
if (bits_outstanding >= MAX_BITS_OUTSTANDING)
{
finish_decode();
start_decode();
}
}
/*
*
* encode a binary symbol using specialised binary encoding
* algorithm
*
*/
void
binary_arithmetic_encode(int c0, int c1, int bit)
{
int LPS, cLPS, rLPS;
if (c0 < c1)
{
LPS = 0;
cLPS = c0;
} else {
LPS = 1;
cLPS = c1;
}
#ifndef SHIFT_ADD
r = R / (c0+c1);
rLPS = r * cLPS;
#else
{
int i, nShifts;
unsigned long int numerator, denominator;
numerator = R;
nShifts = CODE_BITS - f_bits - 1;
denominator = (c0 + c1) << nShifts;
r = 0;
rLPS = 0;
for (i = nShifts;; i--)
{
if (numerator >= denominator)
{
numerator -= denominator;
r++;
rLPS += cLPS;
}
if (i == 0) break;
numerator <<= 1; r <<= 1; rLPS <<= 1;
}
}
#endif
if (bit == LPS)
{
L += R - rLPS;
R = rLPS;
} else {
R -= rLPS;
}
/* renormalise, as for arith_encode */
ENCODE_RENORMALISE;
if (bits_outstanding > MAX_BITS_OUTSTANDING)
{
finish_encode();
start_encode();
}
}
/*
*
* decode a binary symbol given the frequencies of 1 and 0 for
* the context
*
*/
int
binary_arithmetic_decode(int c0, int c1)
{
int LPS, cLPS, rLPS, bit;
if (c0 < c1)
{
LPS = 0;
cLPS = c0;
} else {
LPS = 1;
cLPS = c1;
}
#ifndef SHIFT_ADD
r = R / (c0+c1);
rLPS = r * cLPS;
#else
{
int i, nShifts;
unsigned long int numerator, denominator;
numerator = R;
nShifts = CODE_BITS - f_bits - 1;
denominator = (c0 + c1) << nShifts;
r = 0;
rLPS = 0;
for (i = nShifts;; i--)
{
if (numerator >= denominator)
{
numerator -= denominator;
r++;
rLPS += cLPS;
}
if (i == 0) break;
numerator <<= 1; r <<= 1; rLPS <<= 1;
}
}
#endif
if ((V-L) >= (R-rLPS))
{
bit = LPS;
L += R - rLPS;
R = rLPS;
} else {
bit = (1-LPS);
R -= rLPS;
}
/* renormalise, as for arith_decode */
DECODE_RENORMALISE;
if (bits_outstanding > MAX_BITS_OUTSTANDING)
{
finish_decode();
start_decode();
}
return(bit);
}
/*
*
* start the encoder
*
*/
void
start_encode(void)
{
L = 0;
R = HALF-1;
bits_outstanding = 0;
}
/*
*
* finish encoding by outputting follow bits and three further
* bits to make the last symbol unambiguous
* could tighten this to two extra bits in some cases,
* but does anybody care?
*
*/
void
finish_encode(void)
{
int bits, i;
const int nbits = 3;
bits = (L+(R>>1)) >> (CODE_BITS-nbits);
for (i = 1; i <= nbits; i++) /* output the nbits integer bits */
BIT_PLUS_FOLLOW(((bits >> (nbits-i)) & 1));
}
/*
*
* start the decoder
*
*/
void
start_decode(void)
{
int i;
static fill_V = 1;
if (fill_V)
{
V = 0;
for (i = 0; i<CODE_BITS; i++)
ADD_NEXT_INPUT_BIT(V);
fill_V = 0;
}
L = 0;
R = HALF - 1;
bits_outstanding = 0;
}
/*
*
* finish decoding by consuming the disambiguating bits generated
* by finish_encode
*
*/
void
finish_decode(void)
{
int i;
const int nbits = 3;
for (i = 1; i <= nbits; i++)
ADD_NEXT_INPUT_BIT(V);
bits_outstanding = 0;
}
/*
*
* initialize the bit output function
*
*/
void
startoutputtingbits(void)
{
buffer = 0;
bits_to_go = BYTE_SIZE;
}
/*
*
* start the bit input function
*
*/
void
startinputtingbits(void)
{
bits_to_go = 0;
}
/*
*
* complete outputting bits
*
*/
void
doneoutputtingbits(void)
{
putc(buffer >> bits_to_go, stdout);
bytes_output += 1;
}
/*
*
* complete inputting bits
*
*/
void
doneinputtingbits(void)
{
bits_to_go = 0;
}
#ifdef 0
void
arith_encode( unsigned int lbnd, unsigned int hbnd, unsigned int totl )
/* Arithmetically encode the range. */
{
if ((lbnd < 0) || (hbnd < 0) || (totl < 0))
fprintf( stderr, "Fatal error - invalid range : lbnd %d hbnd %d totl %d\n", lbnd, hbnd, totl );
assert( (lbnd >= 0) && (hbnd >= 0) && (totl >= 0) );
if ((totl < hbnd) || (hbnd < lbnd) || ((hbnd == lbnd) && (hbnd != 0)))
fprintf( stderr, "Fatal error - invalid range : lbnd %d hbnd %d totl %d\n", lbnd, hbnd, totl );
assert ((totl >= hbnd) && (hbnd >= lbnd) && ((hbnd != lbnd) || (hbnd == 0)));
if ((lbnd == 0) && (hbnd == totl)) {
/* probability = 1 - no need to encode it */
}
else
arithmetic_encode( lbnd, hbnd, totl );
}
#endif
int
arith_decode_target( unsigned int totl )
/* Arithmetically decodes the target. */
{
int target;
if (totl == 0) /* only occurs at start of decoding */
return (0);
target = arithmetic_decode_target( totl );
return( arithmetic_decode_target( totl ));
}
#ifdef 0
void arith_decode( unsigned int lbnd, unsigned int hbnd, unsigned int totl )
/* Arithmetically decode the range. */
{
if ((lbnd < 0) || (hbnd < 0) || (totl < 0))
fprintf( stderr, "Fatal error - invalid range : lbnd %d hbnd %d totl %d\n", lbnd, hbnd, totl );
assert( (lbnd >= 0) && (hbnd >= 0) && (totl >= 0) );
if ((lbnd == 0) && (hbnd == totl)) {
/* probility = 1 - no need to decode it */
}
else {
arithmetic_decode( lbnd, hbnd, totl );
}
}
#endif
void
EncodeGammaDist (int Off)
/* Encode Off with probability distribution derived from the Elias gamma distribution. */
{
int Len, i;
Off++;
for (Len = 31; Len >= 0 && !(Off & (1 << Len)); Len--);
for (i = Len; i >= 0; i--)
arithmetic_encode (0, 1, 2);
arithmetic_encode (1, 2, 2);
for (i = Len - 1; i >= 0; i--)
if (Off & (1 << i))
arithmetic_encode (1, 2, 2);
else
arithmetic_encode (0, 1, 2);
}
int
DecodeGammaDist (void)
/* Decode next Off using probability distribution derived from the Elias gamma distribution. Inverse of EncodeGammaDist. */
{
int i = 1, Len = 0, bit;
do {
bit = arithmetic_decode_target (2) < 1 ? 0 : 1;
if (bit)
arithmetic_decode (1, 2, 2);
else {
arithmetic_decode (0, 1, 2);
Len++;
}
}
while (!bit);
Len--;
while (Len-- > 0) {
bit = arithmetic_decode_target (2) < 1 ? 0 : 1;
if (bit)
arithmetic_decode (1, 2, 2);
else
arithmetic_decode (0, 1, 2);
i = (i << 1) | bit;
}
return (i - 1);
}
#ifdef 0
void
EncodeGammaSigned (int snum, int *pos, int *neg)
{
if (snum >= 0)
arithmetic_encode (0, *pos, *pos + (*neg)), (*pos)++;
else
arithmetic_encode (*pos, *pos + (*neg), *pos + (*neg)), (*neg)++;
if (*pos + (*neg) >= HALF) {
*pos = (*pos + 1) / 2;
*neg = (*neg + 1) / 2;
}
EncodeGammaDist (abs (snum));
}
int
DecodeGammaSigned (int *pos, int *neg)
{
int signedpos = 1;
if (arithmetic_decode_target (*pos + (*neg)) < *pos)
arithmetic_decode (0, *pos, *pos + (*neg)), (*pos)++;
else
arithmetic_decode (*pos, *pos + (*neg), *pos + (*neg)), (*neg)++, signedpos = 0;
if (*pos + (*neg) >= HALF) {
*pos = (*pos + 1) / 2;
*neg = (*neg + 1) / 2;
}
if (signedpos)
return DecodeGammaDist ();
else
return (-DecodeGammaDist ());
}
#endif
void
InitArithEncoding (void)
{
start_encode();
startoutputtingbits();
}
void
InitArithDecoding (void)
{
start_decode();
startinputtingbits();
}
void
CloseDownArithEncoding (void)
{
finish_encode();
doneoutputtingbits();
}
void
CloseDownArithDecoding (void)
{
finish_decode();
doneinputtingbits();
}
/* encode that famous number, 42 uses 12 bits */
void
EncodeChecksum (char str[])
{
/* if(V) fprintf(stderr,"encoding '%s' checksum...\n",str); */
EncodeGammaDist (42);
}
void
DecodeChecksum (char str[])
{
if (DecodeGammaDist () != 42) {
fprintf (stderr, "'%s' checksum error, file corrupt.\n", str);
/* exit(1); */
} else {
/* if(V) fprintf(stderr,"'%s' checksum correct...\n",str); */
}
}
|
Added work/contrib/tic/tic98/arithcode.dcc95.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
|
/******************************************************************************
File: coder.c
Authors: John Carpinelli (johnfc@ecr.mu.oz.au)
Wayne Salamonsen (wbs@mundil.cs.mu.oz.au)
Purpose: Data compression using a word-based model and revised
arithmetic coding method.
Based on: A. Moffat, R. Neal, I.H. Witten, "Arithmetic Coding Revisted",
Proc. IEEE Data Compression Conference, Snowbird, Utah,
March 1995.
Low-Precision Arithmetic Coding Implementation by
Radford M. Neal
Copyright 1995 John Carpinelli and Wayne Salamonsen, All Rights Reserved.
These programs are supplied free of charge for research purposes only,
and may not sold or incorporated into any commercial product. There is
ABSOLUTELY NO WARRANTY of any sort, nor any undertaking that they are
fit for ANY PURPOSE WHATSOEVER. Use them at your own risk. If you do
happen to find a bug, or have modifications to suggest, please report
the same to Alistair Moffat, alistair@cs.mu.oz.au. The copyright
notice above and this statement of conditions must remain an integral
part of each and every copy made of these files.
******************************************************************************/
#include <stdio.h>
#include <assert.h>
#include "arithcode.h"
long CountOfBitsOut;
unsigned long L; /* lower bound */
unsigned long R; /* code range */
unsigned long V; /* current code value */
unsigned long r; /* normalized range */
int bits_outstanding; /* follow bit count */
int buffer; /* I/O buffer */
int bits_to_go; /* bits left in buffer */
unsigned int bytes_input, bytes_output; /* I/O counters */
/*
*
* responsible for outputing the bit passed to it and an opposite number of
* bit equal to the value stored in bits_outstanding
*
*/
#define BIT_PLUS_FOLLOW(b) \
do \
{ \
OUTPUT_BIT((b)); \
while (bits_outstanding > 0) \
{ \
OUTPUT_BIT(!(b)); \
bits_outstanding -= 1; \
} \
} while (0)
/*
*
* responsible for outputting one bit. adds the bit to a buffer
* and once the buffer has 8 bits, it outputs a character
*
*/
#define OUTPUT_BIT(b) \
do { \
buffer >>= 1; \
if (b) \
buffer |= 1 << (BYTE_SIZE-1); \
bits_to_go -= 1; \
if (bits_to_go == 0) \
{ \
putc(buffer, stdout); \
bytes_output += 1; \
bits_to_go = BYTE_SIZE; \
} \
CountOfBitsOut++; \
} while (0)
/*
*
* reads in bits from encoded file
* reads in a char at a time into a buffer i.e 8 bits
*
*/
#define ADD_NEXT_INPUT_BIT(v) \
do { \
bits_to_go -= 1; \
if (bits_to_go < 0) \
{ \
buffer = getc(stdin); \
bits_to_go = BYTE_SIZE - 1; \
} \
v += v + (buffer & 1); \
buffer >>= 1; \
} while (0)
/*
* output code bits until the range as been expanded
* to above QUARTER
*/
#define ENCODE_RENORMALISE \
do { \
while (R < QUARTER) \
{ \
if (L >= HALF) \
{ \
BIT_PLUS_FOLLOW(1); \
L -= HALF; \
} \
else if (L+R <= HALF) \
{ \
BIT_PLUS_FOLLOW(0); \
} \
else \
{ \
bits_outstanding++; \
L -= QUARTER; \
} \
L += L; \
R += R; \
} \
} while (0)
/*
* input code bits until range has been expanded to
* more than QUARTER. Mimics encoder.
*/
#define DECODE_RENORMALISE \
do { \
while (R < QUARTER) \
{ \
if (L >= HALF) \
{ \
V -= HALF; \
L -= HALF; \
bits_outstanding = 0; \
} \
else if (L+R <= HALF) \
{ \
bits_outstanding = 0; \
} \
else \
{ \
V -= QUARTER; \
L -= QUARTER; \
bits_outstanding++; \
} \
L += L; \
R += R; \
ADD_NEXT_INPUT_BIT(V); \
} \
} while (0)
/*
*
* encode a symbol given its low, high and total frequencies
*
*/
void
arithmetic_encode(unsigned int low, unsigned int high, unsigned int total)
{
unsigned long temp;
#ifndef SHIFT_ADD
r = R/total;
temp = r*low;
L += temp;
if (high < total)
R = r*(high-low);
else
R -= temp;
#else
{
int i, nShifts;
unsigned long numerator, denominator;
unsigned long temp2;
/*
* calculate r = R/total, temp = r*low and temp2 = r*high
* using shifts and adds
*/
numerator = R;
nShifts = CODE_BITS - f_bits - 1;
denominator = total << nShifts;
r = 0;
temp = 0;
temp2 = 0;
for (i = nShifts;; i--)
{
if (numerator >= denominator)
{
numerator -= denominator;
r++;
temp += low;
temp2 += high;
}
if (i == 0) break;
numerator <<= 1; r <<= 1; temp <<= 1; temp2 <<= 1;
}
L += temp;
if (high < total)
R = temp2 - temp;
else
R -= temp;
}
#endif
ENCODE_RENORMALISE;
if (bits_outstanding >= MAX_BITS_OUTSTANDING)
{
finish_encode();
start_encode();
}
}
/*
*
* decode the target value using the current total frequency
* and the coder's state variables
*
*/
unsigned
int arithmetic_decode_target(unsigned int total)
{
unsigned long target;
#ifndef SHIFT_ADD
r = R/total;
target = (V-L)/r;
#else
{
int i, nShifts;
unsigned long numerator, denominator;
/* divide r = R/total using shifts and adds */
numerator = R;
nShifts = CODE_BITS - f_bits - 1;
denominator = total << nShifts;
r = 0;
for (i = nShifts;; i--)
{
if (numerator >= denominator)
{
numerator -= denominator;
r++;
}
if (i == 0) break;
numerator <<= 1; r <<= 1;
}
/* divide V-L by r using shifts and adds */
if (r < (1 << (CODE_BITS - f_bits - 1)))
nShifts = f_bits;
else
nShifts = f_bits - 1;
numerator = V - L;
denominator = r << nShifts;
target = 0;
for (i = nShifts;; i--)
{
if (numerator >= denominator)
{
numerator -= denominator;
target++;
}
if (i == 0) break;
numerator <<= 1; target <<= 1;
}
}
#endif
return (target >= total? total-1 : target);
}
/*
*
* decode the next input symbol
*
*/
void
arithmetic_decode(unsigned int low, unsigned int high, unsigned int total)
{
unsigned int temp;
#ifndef SHIFT_ADD
/* assume r has been set by decode_target */
temp = r*low;
L += temp;
if (high < total)
R = r*(high-low);
else
R -= temp;
#else
{
int i, nShifts;
unsigned long temp2;
/* calculate r*low and r*high using shifts and adds */
r <<= f_bits;
temp = 0;
nShifts = CODE_BITS - f_bits - 1;
temp2 = 0;
for (i = nShifts;; i--)
{
if (r >= HALF)
{
temp += low;
temp2 += high;
}
if (i == 0) break;
r <<= 1; temp <<= 1; temp2 <<= 1;
}
L += temp;
if (high < total)
R = temp2 - temp;
else
R -= temp;
}
#endif
DECODE_RENORMALISE;
if (bits_outstanding >= MAX_BITS_OUTSTANDING)
{
finish_decode();
start_decode();
}
}
/*
*
* encode a binary symbol using specialised binary encoding
* algorithm
*
*/
void
binary_arithmetic_encode(int c0, int c1, int bit)
{
int LPS, cLPS, rLPS;
if (c0 < c1)
{
LPS = 0;
cLPS = c0;
} else {
LPS = 1;
cLPS = c1;
}
#ifndef SHIFT_ADD
r = R / (c0+c1);
rLPS = r * cLPS;
#else
{
int i, nShifts;
unsigned long int numerator, denominator;
numerator = R;
nShifts = CODE_BITS - f_bits - 1;
denominator = (c0 + c1) << nShifts;
r = 0;
rLPS = 0;
for (i = nShifts;; i--)
{
if (numerator >= denominator)
{
numerator -= denominator;
r++;
rLPS += cLPS;
}
if (i == 0) break;
numerator <<= 1; r <<= 1; rLPS <<= 1;
}
}
#endif
if (bit == LPS)
{
L += R - rLPS;
R = rLPS;
} else {
R -= rLPS;
}
/* renormalise, as for arith_encode */
ENCODE_RENORMALISE;
if (bits_outstanding > MAX_BITS_OUTSTANDING)
{
finish_encode();
start_encode();
}
}
/*
*
* decode a binary symbol given the frequencies of 1 and 0 for
* the context
*
*/
int
binary_arithmetic_decode(int c0, int c1)
{
int LPS, cLPS, rLPS, bit;
if (c0 < c1)
{
LPS = 0;
cLPS = c0;
} else {
LPS = 1;
cLPS = c1;
}
#ifndef SHIFT_ADD
r = R / (c0+c1);
rLPS = r * cLPS;
#else
{
int i, nShifts;
unsigned long int numerator, denominator;
numerator = R;
nShifts = CODE_BITS - f_bits - 1;
denominator = (c0 + c1) << nShifts;
r = 0;
rLPS = 0;
for (i = nShifts;; i--)
{
if (numerator >= denominator)
{
numerator -= denominator;
r++;
rLPS += cLPS;
}
if (i == 0) break;
numerator <<= 1; r <<= 1; rLPS <<= 1;
}
}
#endif
if ((V-L) >= (R-rLPS))
{
bit = LPS;
L += R - rLPS;
R = rLPS;
} else {
bit = (1-LPS);
R -= rLPS;
}
/* renormalise, as for arith_decode */
DECODE_RENORMALISE;
if (bits_outstanding > MAX_BITS_OUTSTANDING)
{
finish_decode();
start_decode();
}
return(bit);
}
/*
*
* start the encoder
*
*/
void
start_encode(void)
{
L = 0;
R = HALF-1;
bits_outstanding = 0;
}
/*
*
* finish encoding by outputting follow bits and three further
* bits to make the last symbol unambiguous
* could tighten this to two extra bits in some cases,
* but does anybody care?
*
*/
void
finish_encode(void)
{
int bits, i;
const int nbits = 3;
bits = (L+(R>>1)) >> (CODE_BITS-nbits);
for (i = 1; i <= nbits; i++) /* output the nbits integer bits */
BIT_PLUS_FOLLOW(((bits >> (nbits-i)) & 1));
}
/*
*
* start the decoder
*
*/
void
start_decode(void)
{
int i;
static fill_V = 1;
if (fill_V)
{
V = 0;
for (i = 0; i<CODE_BITS; i++)
ADD_NEXT_INPUT_BIT(V);
fill_V = 0;
}
L = 0;
R = HALF - 1;
bits_outstanding = 0;
}
/*
*
* finish decoding by consuming the disambiguating bits generated
* by finish_encode
*
*/
void
finish_decode(void)
{
int i;
const int nbits = 3;
for (i = 1; i <= nbits; i++)
ADD_NEXT_INPUT_BIT(V);
bits_outstanding = 0;
}
/*
*
* initialize the bit output function
*
*/
void
startoutputtingbits(void)
{
buffer = 0;
bits_to_go = BYTE_SIZE;
}
/*
*
* start the bit input function
*
*/
void
startinputtingbits(void)
{
bits_to_go = 0;
}
/*
*
* complete outputting bits
*
*/
void
doneoutputtingbits(void)
{
putc(buffer >> bits_to_go, stdout);
bytes_output += 1;
}
/*
*
* complete inputting bits
*
*/
void
doneinputtingbits(void)
{
bits_to_go = 0;
}
#ifdef 0
void
arith_encode( unsigned int lbnd, unsigned int hbnd, unsigned int totl )
/* Arithmetically encode the range. */
{
if ((lbnd < 0) || (hbnd < 0) || (totl < 0))
fprintf( stderr, "Fatal error - invalid range : lbnd %d hbnd %d totl %d\n", lbnd, hbnd, totl );
assert( (lbnd >= 0) && (hbnd >= 0) && (totl >= 0) );
if ((totl < hbnd) || (hbnd < lbnd) || ((hbnd == lbnd) && (hbnd != 0)))
fprintf( stderr, "Fatal error - invalid range : lbnd %d hbnd %d totl %d\n", lbnd, hbnd, totl );
assert ((totl >= hbnd) && (hbnd >= lbnd) && ((hbnd != lbnd) || (hbnd == 0)));
if ((lbnd == 0) && (hbnd == totl)) {
/* probability = 1 - no need to encode it */
}
else
arithmetic_encode( lbnd, hbnd, totl );
}
#endif
int
arith_decode_target( unsigned int totl )
/* Arithmetically decodes the target. */
{
int target;
if (totl == 0) /* only occurs at start of decoding */
return (0);
target = arithmetic_decode_target( totl );
return( arithmetic_decode_target( totl ));
}
#ifdef 0
void arith_decode( unsigned int lbnd, unsigned int hbnd, unsigned int totl )
/* Arithmetically decode the range. */
{
if ((lbnd < 0) || (hbnd < 0) || (totl < 0))
fprintf( stderr, "Fatal error - invalid range : lbnd %d hbnd %d totl %d\n", lbnd, hbnd, totl );
assert( (lbnd >= 0) && (hbnd >= 0) && (totl >= 0) );
if ((lbnd == 0) && (hbnd == totl)) {
/* probility = 1 - no need to decode it */
}
else {
arithmetic_decode( lbnd, hbnd, totl );
}
}
#endif
void
EncodeGammaDist (int Off)
/* Encode Off with probability distribution derived from the Elias gamma distribution. */
{
int Len, i;
Off++;
for (Len = 31; Len >= 0 && !(Off & (1 << Len)); Len--);
for (i = Len; i >= 0; i--)
arithmetic_encode (0, 1, 2);
arithmetic_encode (1, 2, 2);
for (i = Len - 1; i >= 0; i--)
if (Off & (1 << i))
arithmetic_encode (1, 2, 2);
else
arithmetic_encode (0, 1, 2);
}
int
DecodeGammaDist (void)
/* Decode next Off using probability distribution derived from the Elias gamma distribution. Inverse of EncodeGammaDist. */
{
int i = 1, Len = 0, bit;
do {
bit = arithmetic_decode_target (2) < 1 ? 0 : 1;
if (bit)
arithmetic_decode (1, 2, 2);
else {
arithmetic_decode (0, 1, 2);
Len++;
}
}
while (!bit);
Len--;
while (Len-- > 0) {
bit = arithmetic_decode_target (2) < 1 ? 0 : 1;
if (bit)
arithmetic_decode (1, 2, 2);
else
arithmetic_decode (0, 1, 2);
i = (i << 1) | bit;
}
return (i - 1);
}
#ifdef 0
void
EncodeGammaSigned (int snum, int *pos, int *neg)
{
if (snum >= 0)
arithmetic_encode (0, *pos, *pos + (*neg)), (*pos)++;
else
arithmetic_encode (*pos, *pos + (*neg), *pos + (*neg)), (*neg)++;
if (*pos + (*neg) >= HALF) {
*pos = (*pos + 1) / 2;
*neg = (*neg + 1) / 2;
}
EncodeGammaDist (abs (snum));
}
int
DecodeGammaSigned (int *pos, int *neg)
{
int signedpos = 1;
if (arithmetic_decode_target (*pos + (*neg)) < *pos)
arithmetic_decode (0, *pos, *pos + (*neg)), (*pos)++;
else
arithmetic_decode (*pos, *pos + (*neg), *pos + (*neg)), (*neg)++, signedpos = 0;
if (*pos + (*neg) >= HALF) {
*pos = (*pos + 1) / 2;
*neg = (*neg + 1) / 2;
}
if (signedpos)
return DecodeGammaDist ();
else
return (-DecodeGammaDist ());
}
#endif
void
InitArithEncoding (void)
{
start_encode();
startoutputtingbits();
}
void
InitArithDecoding (void)
{
start_decode();
startinputtingbits();
}
void
CloseDownArithEncoding (void)
{
finish_encode();
doneoutputtingbits();
}
void
CloseDownArithDecoding (void)
{
finish_decode();
doneinputtingbits();
}
/* encode that famous number, 42 uses 12 bits */
void
EncodeChecksum (char str[])
{
/* if(V) fprintf(stderr,"encoding '%s' checksum...\n",str); */
EncodeGammaDist (42);
}
void
DecodeChecksum (char str[])
{
if (DecodeGammaDist () != 42) {
fprintf (stderr, "'%s' checksum error, file corrupt.\n", str);
/* exit(1); */
} else {
/* if(V) fprintf(stderr,"'%s' checksum correct...\n",str); */
}
}
|
Added work/contrib/tic/tic98/arithcode.dcc95.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
/******************************************************************************
File: coder.h
Authors: John Carpinelli (johnfc@ecr.mu.oz.au)
Wayne Salamonsen (wbs@mundil.cs.mu.oz.au)
Purpose: Data compression using a word-based model and revised
arithmetic coding method.
Based on: A. Moffat, R. Neal, I.H. Witten, "Arithmetic Coding Revisted",
Proc. IEEE Data Compression Conference, Snowbird, Utah,
March 1995.
Copyright 1995 John Carpinelli and Wayne Salamonsen, All Rights Reserved.
These programs are supplied free of charge for research purposes only,
and may not sold or incorporated into any commercial product. There is
ABSOLUTELY NO WARRANTY of any sort, nor any undertaking that they are
fit for ANY PURPOSE WHATSOEVER. Use them at your own risk. If you do
happen to find a bug, or have modifications to suggest, please report
the same to Alistair Moffat, alistair@cs.mu.oz.au. The copyright
notice above and this statement of conditions must remain an integral
part of each and every copy made of these files.
******************************************************************************/
#ifndef CODER_H
#define CODER_H
#define CODE_BITS 32
#define BYTE_SIZE 8
#define MAX_BITS_OUTSTANDING 256
#define HALF ((unsigned) 1 << (CODE_BITS-1))
#define QUARTER (1 << (CODE_BITS-2))
/* provide external linkage to variables */
extern int f_bits; /* link to f_bits in stats.c */
extern unsigned int bytes_input; /* make available to other modules */
extern unsigned int bytes_output;
extern long CountOfBitsOut;
/* function prototypes */
void arithmetic_encode(unsigned int l, unsigned int h, unsigned int t);
unsigned int arithmetic_decode_target(unsigned int t);
void arithmetic_decode(unsigned int l, unsigned int h, unsigned int t);
void binary_arithmetic_encode(int c0, int c1, int bit);
int binary_arithmetic_decode(int c0, int c1);
void start_encode(void);
void finish_encode(void);
void start_decode(void);
void finish_decode(void);
void startoutputtingbits(void);
void doneoutputtingbits(void);
void startinputtingbits(void);
void doneinputtingbits(void);
void arith_encode( unsigned int lbnd, unsigned int hbnd, unsigned int totl );
int arith_decode_target( unsigned int totl );
void arith_decode( unsigned int lbnd, unsigned int hbnd, unsigned int totl );
void EncodeGammaDist(int Off);
int DecodeGammaDist(void);
void EncodeGammaSigned(int snum, int *pos, int *neg);
int DecodeGammaSigned(int *pos, int *neg);
void InitArithEncoding(void);
void CloseDownArithEncoding(void);
void InitArithDecoding(void);
void CloseDownArithDecoding(void);
void EncodeChecksum(char str[]);
void DecodeChecksum(char str[]);
#endif
|
Added work/contrib/tic/tic98/arithcode.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
/******************************************************************************
File: coder.h
Authors: John Carpinelli (johnfc@ecr.mu.oz.au)
Wayne Salamonsen (wbs@mundil.cs.mu.oz.au)
Purpose: Data compression using a word-based model and revised
arithmetic coding method.
Based on: A. Moffat, R. Neal, I.H. Witten, "Arithmetic Coding Revisted",
Proc. IEEE Data Compression Conference, Snowbird, Utah,
March 1995.
Copyright 1995 John Carpinelli and Wayne Salamonsen, All Rights Reserved.
These programs are supplied free of charge for research purposes only,
and may not sold or incorporated into any commercial product. There is
ABSOLUTELY NO WARRANTY of any sort, nor any undertaking that they are
fit for ANY PURPOSE WHATSOEVER. Use them at your own risk. If you do
happen to find a bug, or have modifications to suggest, please report
the same to Alistair Moffat, alistair@cs.mu.oz.au. The copyright
notice above and this statement of conditions must remain an integral
part of each and every copy made of these files.
******************************************************************************/
#ifndef CODER_H
#define CODER_H
#define CODE_BITS 32
#define BYTE_SIZE 8
#define MAX_BITS_OUTSTANDING 256
#define HALF ((unsigned) 1 << (CODE_BITS-1))
#define QUARTER (1 << (CODE_BITS-2))
/* provide external linkage to variables */
extern int f_bits; /* link to f_bits in stats.c */
extern unsigned int bytes_input; /* make available to other modules */
extern unsigned int bytes_output;
extern long CountOfBitsOut;
/* function prototypes */
void arithmetic_encode(unsigned int l, unsigned int h, unsigned int t);
unsigned int arithmetic_decode_target(unsigned int t);
void arithmetic_decode(unsigned int l, unsigned int h, unsigned int t);
void binary_arithmetic_encode(int c0, int c1, int bit);
int binary_arithmetic_decode(int c0, int c1);
void start_encode(void);
void finish_encode(void);
void start_decode(void);
void finish_decode(void);
void startoutputtingbits(void);
void doneoutputtingbits(void);
void startinputtingbits(void);
void doneinputtingbits(void);
void arith_encode( unsigned int lbnd, unsigned int hbnd, unsigned int totl );
int arith_decode_target( unsigned int totl );
void arith_decode( unsigned int lbnd, unsigned int hbnd, unsigned int totl );
void EncodeGammaDist(int Off);
int DecodeGammaDist(void);
void EncodeGammaSigned(int snum, int *pos, int *neg);
int DecodeGammaSigned(int *pos, int *neg);
void InitArithEncoding(void);
void CloseDownArithEncoding(void);
void InitArithDecoding(void);
void CloseDownArithDecoding(void);
void EncodeChecksum(char str[]);
void DecodeChecksum(char str[]);
#endif
|
Added work/contrib/tic/tic98/arithcode.old.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
|
/*
* Arithmetic encoding. Taken largely from Witten, Neal, Cleary,
* CACM, 1987, p520.
* Includes bitfiddling routines.
* Alistair Moffat, alistair@cs.mu.oz.au, January 1987.
*
* Adding opening/closing routines to setup global variables,
* and binary_coding functions. Update to ANSI C++
* Stuart Inglis, singlis@internz.co.nz, January 1998.
*
*/
#include <stdio.h>
#include <assert.h>
#include "arithcode.h"
#include "utils.h"
FILE *arith_in = stdin, *arith_out = stdout;
#undef BECAREFUL
#define INTEGRATED
/*#undef INTEGRATED*/
codevalue S_low = 0, S_high = 0, S_value = 0;
long S_bitstofollow = 0;
int S_buffer = 0, S_bitstogo = 0;
long cmpbytes = 0, rawbytes = 0;
#ifdef INTEGRATED
long CountOfBitsOut;
#endif
/*==================================*/
#define BITPLUSFOLLOW(b) \
{ OUTPUTBIT((b)); \
while (bitstofollow) \
{ OUTPUTBIT(!(b)); \
bitstofollow -= 1; \
} \
}
/*
* { if(putc(buffer, arith_out)==EOF) /
* error("OUTPUTBIT","file write error",""); \
*/
#ifdef INTEGRATED
#define OUTPUTBIT(b) \
{ buffer >>= 1; \
if (b) buffer |= 0x80; \
bitstogo -= 1; \
if (bitstogo==0) \
{ putc(buffer, arith_out); \
bitstogo = 8; \
cmpbytes += 1; \
} \
CountOfBitsOut++; \
}
#else
#define OUTPUTBIT(b) \
{ buffer >>= 1; \
if (b) buffer |= 0x80; \
bitstogo -= 1; \
if (bitstogo==0) \
{ putc(buffer, arith_out);\
bitstogo = 8; \
cmpbytes += 1; \
} \
}
#endif
#define ADDNEXTINPUTBIT(v) \
{ if (bitstogo==0) \
{ buffer = getc(arith_in); \
bitstogo = 8; \
} \
v = (v<<1)+(buffer&1); \
buffer >>= 1; \
bitstogo -=1; \
}
/*==================================*/
void
arithmetic_encode (int lbnd, int hbnd, int totl)
{
register codevalue low, high;
#ifdef BECAREFUL
if (!(0 <= lbnd && lbnd < hbnd && hbnd <= totl && totl < maxfrequency)) {
fprintf (stderr, "(corrupt file) coding error: %d %d %d\n", lbnd, hbnd, totl);
abort ();
}
#endif
{
register codevalue range;
range = S_high - S_low + 1;
high = S_low + range * hbnd / totl - 1;
low = S_low + range * lbnd / totl;
}
{
register codevalue H;
register long bitstofollow;
register int buffer, bitstogo;
bitstofollow = S_bitstofollow;
buffer = S_buffer;
bitstogo = S_bitstogo;
H = half;
for (;;) {
if (high < H) {
BITPLUSFOLLOW (0);
} else if (low >= H) {
BITPLUSFOLLOW (1);
low -= H;
high -= H;
} else if (low >= firstqtr && high < thirdqtr) {
bitstofollow++;
low -= firstqtr;
high -= firstqtr;
} else
break;
low += low;
high += high;
high++;
}
S_bitstofollow = bitstofollow;
S_buffer = buffer;
S_bitstogo = bitstogo;
S_low = low;
S_high = high;
}
}
/*==================================*/
/* Made into a macro
*
* codevalue
* arithmetic_decode_target(totl)
* register int totl;
* { return (((S_value-S_low+1)*totl-1) / (S_high -S_low+1));
* }
*/
/*==================================*/
void
arithmetic_decode (int lbnd, int hbnd, int totl)
{
register codevalue low, high;
#ifdef BECAREFUL
if (!(0 <= lbnd && lbnd < hbnd && hbnd <= totl && totl < maxfrequency)) {
fprintf (stderr, "(corrupt file) coding error: %d %d %d\n", lbnd, hbnd, totl);
abort ();
}
#endif
{
register codevalue range;
range = S_high - S_low + 1;
high = S_low + range * hbnd / totl - 1;
low = S_low + range * lbnd / totl;
}
{
register codevalue value, H;
register int buffer, bitstogo;
buffer = S_buffer;
bitstogo = S_bitstogo;
H = half;
value = S_value;
for (;;) {
if (high < H) { /* nothing */
} else if (low >= H) {
value -= H;
low -= H;
high -= H;
} else if (low >= firstqtr && high < thirdqtr) {
value -= firstqtr;
low -= firstqtr;
high -= firstqtr;
} else
break;
low += low;
high += high;
high += 1;
ADDNEXTINPUTBIT (value);
}
S_buffer = buffer;
S_bitstogo = bitstogo;
S_low = low;
S_high = high;
S_value = value;
}
}
/*==================================*/
static void
startoutputingbits (void)
{
S_buffer = 0;
S_bitstogo = 8;
}
static void
startinputingbits (void)
{
S_buffer = 0;
S_bitstogo = 0;
}
static void
doneoutputingbits (void)
{ /* write another byte if necessary */
if (S_bitstogo < 8) {
putc (S_buffer >> S_bitstogo, arith_out);
cmpbytes += 1;
}
}
/*==================================*/
static void
startencoding (void)
{
S_low = 0;
S_high = topvalue;
S_bitstofollow = 0;
}
static void
startdecoding (void)
{
register int i;
register int buffer, bitstogo;
S_low = 0;
S_high = topvalue;
S_value = 0;
bitstogo = S_bitstogo;
buffer = S_buffer;
for (i = 0; i < codevaluebits; i++)
ADDNEXTINPUTBIT (S_value);
S_bitstogo = bitstogo;
S_buffer = buffer;
}
static void
doneencoding (void)
{
register long bitstofollow;
register int buffer, bitstogo;
bitstofollow = S_bitstofollow;
buffer = S_buffer;
bitstogo = S_bitstogo;
bitstofollow += 1;
if (S_low < firstqtr) {
BITPLUSFOLLOW (0);
} else {
BITPLUSFOLLOW (1);
}
S_bitstofollow = bitstofollow;
S_buffer = buffer;
S_bitstogo = bitstogo;
}
void
InitArithEncoding (void)
{
S_low = 0, S_high = 0, S_value = 0;
S_bitstofollow = 0;
S_buffer = 0, S_bitstogo = 0;
cmpbytes = 0, rawbytes = 0;
startoutputingbits ();
startencoding ();
}
void
InitArithDecoding (void)
{
S_low = 0, S_high = 0, S_value = 0;
S_bitstofollow = 0;
S_buffer = 0, S_bitstogo = 0;
cmpbytes = 0, rawbytes = 0;
startinputingbits ();
startdecoding ();
}
void
CloseDownArithEncoding (void)
{
doneencoding ();
doneoutputingbits ();
}
void
CloseDownArithDecoding (void)
{
}
void
binary_arithmetic_encode(int c0, int c1, int p)
{
assert(c0>0);
assert(c1>0);
if(p==0){
arithmetic_encode(0, c0, c0+c1);
} else {
arithmetic_encode(c0, c0+c1, c0+c1);
}
}
int
binary_arithmetic_decode(int c0, int c1)
{
int p,t;
assert(c0>0);
assert(c1>0);
if((t=arithmetic_decode_target(c0+c1))<c0){
p=0;
arithmetic_decode(0, c0, c0+c1);
} else {
p=1;
arithmetic_decode(c0, c0+c1, c0+c1);
}
return p;
}
|
Added work/contrib/tic/tic98/arithcode.old.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
#ifndef _arithcode_h
#define _arithcode_h
/*
Declarations for arithmetic coding.
Alistair Moffat, alistair@cs.mu.oz.au, July 1987.
Added opening/closing and binary coding prototypes
Stuart Inglis, singlis@internz.co.nz, January 1998.
*/
#include <stdlib.h>
#define codevaluebits 16
#if (codevaluebits<16)
typedef unsigned short codevalue;
#else
typedef unsigned long codevalue;
#endif
extern FILE *arith_in,*arith_out;
extern codevalue S_low, S_high, S_value;
extern long S_bitstofollow;
extern int S_buffer, S_bitstogo;
extern long cmpbytes, rawbytes;
extern long CountOfBitsOut;
#define topvalue ((codevalue)((1<<codevaluebits)-1))
#define maxfrequency ((topvalue+1)/4 + 1)
#define firstqtr (topvalue/4+1)
#define half (2*firstqtr)
#define thirdqtr (3*firstqtr)
#define escape_event U->totalcnt-U->notfound, U->totalcnt, U->totalcnt
#define arithmetic_decode_target(totl) \
( ((S_value-S_low+1)*(totl)-1) / (S_high-S_low+1) )
void arithmetic_encode(int,int,int);
/*int arithmetic_decode_target(void); */
void arithmetic_decode(int,int,int);
void InitArithEncoding(void);
void CloseDownArithEncoding(void);
void InitArithDecoding(void);
void CloseDownArithDecoding(void);
void binary_arithmetic_encode(int c0, int c1, int p);
int binary_arithmetic_decode(int c0, int c1);
#endif
|
Added work/contrib/tic/tic98/b_gamma.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
|
/*
* Module: b_gamma
*
* This module implements a gamma-type encoding using a
* binary arithmetic coder. The encoder() and decoder()
* modules correspond to the standard qm-coder routines,
* but here they are stubs to a normal arithmetic coder.
*
* The counts are updated using the Dirichlet estimator
* and are normalised into 8 bits.
*
* Author:
* Stuart Inglis (singlis@internz.co.nz)
* (c) 1998
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include "arithcode.h"
#include "globals.h"
#include "b_gamma.h"
#ifndef Q_CODER
static void
encoder(int p, int *c0, int *c1)
{
binary_arithmetic_encode(*c0,*c1,p);
if(p){
(*c1)+=globals.g_gamma_increment;
} else {
(*c0)+=globals.g_gamma_increment;
}
if((*c0)+(*c1)>=globals.g_gamma_norm){
(*c0)=((*c0)+1)/2;
(*c1)=((*c1)+1)/2;
}
}
static int
decoder(int *c0, int *c1)
{
int p;
p=binary_arithmetic_decode(*c0,*c1);
if(p){
(*c1)+=globals.g_gamma_increment;
} else {
(*c0)+=globals.g_gamma_increment;
}
if((*c0)+(*c1)>=globals.g_gamma_norm){
(*c0)=((*c0)+1)/2;
(*c1)=((*c1)+1)/2;
}
return p;
}
#endif
b_gammaptr
b_gamma_init(void )
{
b_gammaptr q;
q=(b_gammaptr)malloc(sizeof(b_gammatype));
assert(q);
#ifndef Q_CODER
q->st=q->mps=globals.g_gamma_init;
#else
q->st=q->mps=0;
#endif
q->left=q->right=NULL;
return q;
}
void
b_gamma_free(b_gammaptr q)
{
if(q->left){
b_gamma_free(q->left);
}
if(q->right){
b_gamma_free(q->right);
}
free(q);
}
#define Q_GOLEFT(q) {if(q->left==NULL) q->left=b_gamma_init();q=q->left;}
#define Q_GORIGHT(q) {if(q->right==NULL) q->right=b_gamma_init(); q=q->right;}
void
b_gamma_encode(b_gammaptr q, int num)
{
int t,len,start,enc;
/* first encode the sign */
if(num>=0){
encoder(0,&(q->st),&(q->mps)); Q_GORIGHT(q);
} else {
num++;
num=-num;
encoder(1,&(q->st),&(q->mps)); Q_GOLEFT(q);
}
/* now encode the length */
t=num+1;
len=-1;
while(t>0){
t/=2;
len++;
}
for(t=0;t<len;t++){
encoder(0,&(q->st),&(q->mps)); Q_GORIGHT(q);
}
encoder(1,&(q->st),&(q->mps)); Q_GOLEFT(q);
start=(1<<len)-1;
enc=num-start;
for(t=0;t<len;t++){
if(enc & (1<<(len-t-1))){
encoder(1,&(q->st),&(q->mps)); Q_GOLEFT(q);
} else {
encoder(0,&(q->st),&(q->mps)); Q_GORIGHT(q);
}
}
}
int
b_gamma_decode(b_gammaptr q)
{
int t,len;
int neg,d,dec,start;
/* first dec the sign */
neg=decoder(&(q->st),&(q->mps));
if(neg==0){
Q_GORIGHT(q);
} else {
Q_GOLEFT(q);
}
/* now encode the length */
len=0;
while((d=decoder(&(q->st),&(q->mps)))==0){
Q_GORIGHT(q);
len++;
}
Q_GOLEFT(q);
start=(1<<len)-1;
dec=0;
for(t=0;t<len;t++){
d=decoder(&(q->st),&(q->mps));
if(d==0){
Q_GORIGHT(q);
} else {
Q_GOLEFT(q);
}
dec=dec*2 + d;
}
if(neg==0){
return start + dec;
} else {
return -(start+dec+1);
}
}
#ifdef 0
void
b_gamma_encode_64(unsigned long num)
{
int i;
for(i=63;i>=0;i--){
binary_arithmetic_encode(1,1,num&((unsigned long)1<<i));
}
}
unsigned long
b_gamma_decode_64()
{
unsigned long num=0;
int i;
for(i=0;i<64;i++){
num=num*2 + binary_arithmetic_decode(1,1);
}
return num;
}
void
b_gamma_encode_32(unsigned long num)
{
int i;
for(i=31;i>=0;i--){
binary_arithmetic_encode(1,1,num&((unsigned int)1<<i));
}
}
unsigned long
b_gamma_decode_32()
{
unsigned long num=0;
int i;
for(i=0;i<32;i++){
num=num*2 + binary_arithmetic_decode(1,1);
}
return num;
}
#endif
void
b_gamma_encode_ll(b_gammaptr q, long long num)
{
long long t,len,start,enc;
/* first encode the sign */
if(num>=0){
encoder(0,&(q->st),&(q->mps)); Q_GORIGHT(q);
} else {
num++;
num=-num;
encoder(1,&(q->st),&(q->mps)); Q_GOLEFT(q);
}
/* now encode the length */
t=num+1;
len=-1;
while(t>0){
t/=2;
len++;
}
for(t=0;t<len;t++){
encoder(0,&(q->st),&(q->mps)); Q_GORIGHT(q);
}
encoder(1,&(q->st),&(q->mps)); Q_GOLEFT(q);
start=((long long)1<<len)-1;
enc=num-start;
for(t=0;t<len;t++){
if(enc & ((long long)1<<(len-t-1))){
encoder(1,&(q->st),&(q->mps)); Q_GOLEFT(q);
} else {
encoder(0,&(q->st),&(q->mps)); Q_GORIGHT(q);
}
}
}
long long
b_gamma_decode_ll(b_gammaptr q)
{
long long t,len;
long long neg,d,dec,start;
/* first dec the sign */
neg=decoder(&(q->st),&(q->mps));
if(neg==0){
Q_GORIGHT(q);
} else {
Q_GOLEFT(q);
}
/* now encode the length */
len=0;
while((d=decoder(&(q->st),&(q->mps)))==0){
Q_GORIGHT(q);
len++;
}
Q_GOLEFT(q);
start=((long long)1<<len)-1;
dec=0;
for(t=0;t<len;t++){
d=decoder(&(q->st),&(q->mps));
if(d==0){
Q_GORIGHT(q);
} else {
Q_GOLEFT(q);
}
dec=dec*2 + d;
}
if(neg==0){
return start + dec;
} else {
return -(start+dec+1);
}
}
#undef Q_GOLEFT
#undef Q_GORIGHT
|
Added work/contrib/tic/tic98/b_gamma.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#ifndef _B_GAMMA_H
#define _B_GAMMA_H
#define BUFFER_SIZE 128
typedef struct b_gammatype *b_gammaptr;
typedef struct b_gammatype {
int st, mps;
b_gammaptr left,right;
}b_gammatype;
b_gammaptr b_gamma_init(void);
void b_gamma_free(b_gammaptr q);
void b_gamma_encode(b_gammaptr q, int num);
int b_gamma_decode(b_gammaptr q);
void b_gamma_encode_ll(b_gammaptr q, long long num);
long long b_gamma_decode_ll(b_gammaptr q);
void b_gamma_encode_64(unsigned long num);
unsigned long b_gamma_decode_64();
void b_gamma_encode_32(unsigned long num);
unsigned long b_gamma_decode_32();
#endif
|
Added work/contrib/tic/tic98/b_gamma_dec.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <assert.h>
#include "arithcode.h"
#include "globals.h"
#include "tic98.h"
#include "b_gamma.h"
int
main()
{
int pos,num;
INTCODETYPE enc,size;
assert(BUFFER_SIZE>=1);
#ifndef Q_CODER
globals_init();
#endif
START_DEC();
enc=INTCODE_INIT();
size=INTCODE_INIT();
while(1){
num=BUFFER_SIZE-INTCODE_DECODE_LL(size);
for(pos=0;pos<num;pos++){
fprintf(stdout,"%lld\n",INTCODE_DECODE_LL(enc));
}
if(num!=BUFFER_SIZE)
break;
}
INTCODE_FREE(enc);
INTCODE_FREE(size);
FINISH_DEC();
return 0;
}
|
Added work/contrib/tic/tic98/b_gamma_enc.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <assert.h>
#include "arithcode.h"
#include "globals.h"
#include "tic98.h"
#include "b_gamma.h"
int
main()
{
long long buf[BUFFER_SIZE];
int pos=0,j,eof=0;
INTCODETYPE enc,size;
assert(BUFFER_SIZE>=1);
#ifndef Q_CODER
globals_init();
#endif
START_ENC();
enc=INTCODE_INIT();
size=INTCODE_INIT();
while(1){
if(scanf("%lld\n",&buf[pos])!=1)
eof=1;
else
pos++;
if((pos==BUFFER_SIZE) || (eof)){
INTCODE_ENCODE_LL(size,BUFFER_SIZE-pos);
for(j=0;j<pos;j++){
INTCODE_ENCODE_LL(enc,buf[j]);
}
pos=0;
}
if(eof) break;
}
INTCODE_FREE(enc);
INTCODE_FREE(size);
FINISH_ENC();
return 0;
}
|
Added work/contrib/tic/tic98/boundary.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
|
/*
* Module: boundary
*
* This module implements a collection of boundary following and
* mark extraction routines. The marks can be extracted from a
* bitmap, either as 4 or 8 connected and either nested or
* non-nested.
*
* Author:
* Stuart Inglis (singlis@internz.co.nz)
* (c) 1998
*
*/
#include "utils.h"
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <assert.h>
#include "marklist.h"
#include "pbmtools.h"
#include "boundary.h"
#define boundary4_x(x) ((x)==0?1:((x)==2?-1 : 0))
#define boundary4_y(x) ((x)==1?1:((x)==3?-1 : 0))
#define boundary8_x(x) ((((x)==7)||((x)==0)||((x)==1))?1:((((x)==3)||((x)==4)||((x)==5))?-1 : 0))
#define boundary8_y(x) ((((x)==1)||((x)==2)||((x)==3))?1:((((x)==5)||((x)==6)||((x)==7))?-1 : 0))
int g_x1=0;
int g_y1=0;
int g_x2=0;
int g_y2=0;
#define REALLOCINC 128
/*
*
*
* lrboundary()
*
*
*/
void
lrboundary_init(lrboundarytype *b)
{
if(b){
b->len=0;
b->l=NULL;
b->r=NULL;
b->y=NULL;
}
}
void
lrboundary_free(lrboundarytype *b)
{
if(b){
if(b->l) free(b->l);
if(b->r) free(b->r);
if(b->y) free(b->y);
lrboundary_init(b);
}
}
void
lrboundary_add(lrboundarytype *b, const int y, const int l, const int r)
{
assert(b);
if((b->len%REALLOCINC)==0){
b->l=(int*)realloc(b->l,sizeof(int)*(b->len+REALLOCINC));
assert(b->l);
b->r=(int*)realloc(b->r,sizeof(int)*(b->len+REALLOCINC));
assert(b->r);
b->y=(int*)realloc(b->y,sizeof(int)*(b->len+REALLOCINC));
assert(b->y);
}
b->l[b->len]=l;
b->r[b->len]=r;
b->y[b->len]=y;
b->len++;
}
void
lrboundary_dump(lrboundarytype *b, FILE *fp)
{
int i;
assert(b);
assert(fp);
for(i=0;i<b->len;i++)
fprintf(fp,"%d: %d-%d\n",b->y[i],b->l[i],b->r[i]);
}
/*
*
*
* boundary()
*
*
*/
void
boundary_init(boundarytype *b)
{
if(b){
b->len=0;
b->x=NULL;
b->y=NULL;
}
}
void
boundary_free(boundarytype *b)
{
if(b){
if(b->x) free(b->x);
if(b->y) free(b->y);
boundary_init(b);
}
}
void
boundary_dump(boundarytype *b, FILE *fp)
{
int i;
assert(b);
assert(fp);
for(i=0;i<b->len;i++)
fprintf(fp,"%d: %d %d\n",i,b->x[i],b->y[i]);
}
void
boundary_bounds(boundarytype *b, int *xl, int *xr, int *yt, int *yb)
{
int i;
assert(b);
assert(xl);
assert(xr);
assert(yt);
assert(yb);
for(i=0;i<b->len;i++){
if(i==0){
*xl=*xr= b->x[i];
*yt=*yb= b->y[i];
} else {
if(b->x[i] < *xl)
*xl=b->x[i];
else if(b->x[i] > *xr)
*xr=b->x[i];
if(b->y[i] < *yt)
*yt=b->y[i];
else if(b->y[i] > *yb)
*yb=b->y[i];
}
}
}
void
boundary_start(boundarytype *b, int *startx, int *starty)
{
assert(b);
assert(startx);
assert(starty);
if(b->len>0){
*startx=b->x[0];
*starty=b->y[0];
} else {
*startx=*starty=0;
}
}
void
boundary_add(boundarytype *b, const int x, const int y)
{
assert(b);
if((b->len%REALLOCINC)==0){
b->x=(int*)realloc(b->x,sizeof(int)*(b->len+REALLOCINC));
assert(b->x);
b->y=(int*)realloc(b->y,sizeof(int)*(b->len+REALLOCINC));
assert(b->y);
}
b->x[b->len]=x;
b->y[b->len]=y;
b->len++;
}
void boundary_trace_inside8(const marktype *image,
boundarytype *b,
int i,
int j)
{
int startx, starty,startdir;
int dir;
int found,t,tempdir;
unsigned int pix,pix2;
int first=1;
int tx,ty;
assert(image);
assert(b);
assert((i>=0) && (i<image->w));
assert((j>=0) && (j<image->h));
boundary_init(b);
do{
pix=gpix((*image),i,j);
pix2=gpix((*image),i-1,j);
if(pix2==1)
i--;
} while(pix2==1);
dir = 4;
for (tempdir = dir , t = 0; t < 8; tempdir = (tempdir + 1) % 8, t++) {
tx=i+boundary8_x(tempdir);
ty=j+boundary8_y(tempdir);
if (gpix ((*image), tx,ty) == pix) {
dir=tempdir;
break;
}
}
startdir=dir;
startx = i;
starty = j;
if((gpix((*image),i,j-1)) && (gpix((*image),i-1,j-1))){
dir=7;
fprintf(stderr,"dir=7\n");
}
/* start direction 0, +ve increments are clockwise adjustments*/
pix=gpix((*image),startx,starty);
while(1) {
/*
* if we were outside the component:
* tempdir=(dir+2)%8, and tempdir=(tempdir+7)%8
*/
found = 0;
for (tempdir = (dir + 6) % 8, t = 0; t < 8; tempdir = (tempdir + 1) % 8, t++) {
tx=i+boundary8_x(tempdir);
ty=j+boundary8_y(tempdir);
if (gpix ((*image), tx,ty) == pix) {
dir = tempdir;
found = 1;
break;
}
}
if(first==1){
startdir=dir;
}
boundary_add(b,i,j);
if((found==0) ||
((first==0) && (i==startx) && (j==starty) && (dir==startdir))
) {
break;
}
first=0;
i += boundary8_x (dir);
j += boundary8_y (dir);
}
}
void boundary_trace_inside4(const marktype *image,
boundarytype *b,
int i,
int j)
{
int startx, starty,startdir;
int dir;
int found,t,tempdir;
unsigned int pix,pix2;
int first=1;
int tx,ty;
assert(image);
assert(b);
assert((i>=0) && (i<image->w));
assert((j>=0) && (j<image->h));
boundary_init(b);
do{
pix=gpix((*image),i,j);
pix2=gpix((*image),i-1,j);
if(pix2==1)
i--;
} while(pix2==1);
dir = 0;
startdir=dir;
startx = i;
starty = j;
/* start direction 0, +ve increments are clockwise adjustments*/
pix=gpix((*image),startx,starty);
while(1) {
/*
* if we were outside the component:
* tempdir=(dir+2)%8, and tempdir=(tempdir+7)%8
*/
found = 0;
for (tempdir = (dir + 3) % 4, t = 0; t < 4; tempdir = (tempdir + 1) % 4, t++) {
tx=i+boundary4_x(tempdir);
ty=j+boundary4_y(tempdir);
if (gpix ((*image), tx,ty) == pix) {
dir = tempdir;
found = 1;
break;
}
}
if(first==1){
startdir=dir;
}
boundary_add(b,i,j);
if((found==0) ||
((first==0) && (i==startx) && (j==starty) && (dir==startdir))
) {
break;
}
first=0;
i += boundary4_x (dir);
j += boundary4_y (dir);
}
}
void
boundary_max_lr(const boundarytype *b, lrboundarytype *lrb)
{
int i,j,miny=0,maxy=0,l,r;
lrboundary_init(lrb);
for(i=0;i<b->len;i++){
if((i==0)||(b->y[i]<miny))
miny=b->y[i];
if((i==0)||(b->y[i]>maxy))
maxy=b->y[i];
}
for(j=miny;j<=maxy;j++){
l=r=-1;
for(i=0;i<b->len;i++)
if(b->y[i]==j){
if((l<0)||(b->x[i]<l))
l=b->x[i];
if((r<0)||(b->x[i]>r))
r=b->x[i];
}
lrboundary_add(lrb,j,l,r);
}
}
int
next_pixel(const marktype *image, int *x, int *y)
{
if((image==NULL)||(image->w<=0)||(image->h<=0))
return 1;
assert(x && y);
assert((*x>=0) && (*y>=0) && (*x<image->w) && (*y<image->h));
/*
* find the next pixel
*/
while (gpix ((*image), *x, *y) == 0) {
(*x)++;
if (*x >= image->w) {
*x = 0;
(*y)++;
if (*y >= image->h) {
/*
* reset the counters to 0 at the end of the image
*/
*x = *y = 0;
return 1;
}
}
}
return 0;
}
int
next_pixel_bound(const marktype *image, int *x, int *y, int x1, int y1, int x2, int y2)
{
if((image==NULL)||(image->w<=0)||(image->h<=0))
return 1;
assert(x && y);
assert((*x>=x1) && (*y>=y1) && (*x<=x2) && (*y<=y2));
/* assert((x1<image->w) && (x2<image->w));
assert((y1<image->h) && (y2<image->h));*/
/*
* find the next pixel
*/
while (gpix ((*image), *x, *y) == 0) {
(*x)++;
if (*x > x2) {
*x = x1;
(*y)++;
if (*y > y2) {
/*
* reset the counters to the origin at the end of the image
*/
*x = x1;
*y = y1;
return 1;
}
}
}
return 0;
}
marktype
boundary_extract_nested(marktype *image, int x, int y, int conn)
{
marktype d;
int xl,xr,yt,yb;
int startx,starty;
boundarytype b;
assert(image);
assert((x>=0) && (y>=0));
assert((conn==4) || (conn==8));
if(conn==8){
boundary_trace_inside8(image,&b,x,y);
} else {
boundary_trace_inside4(image,&b,x,y);
}
boundary_bounds(&b,&xl,&xr,&yt,&yb);
marktype_alloc (&d, xr - xl + 1, yb - yt + 1);
d.imagew=image->imagew;
d.imageh=image->imageh;
d.xpos = xl;
d.ypos = yt;
boundary_start(&b,&startx,&starty);
if(conn==8){
marktype_fillextract8 (*image, &d, startx, starty, xl, yt, 1, 0);
} else {
marktype_fillextract4 (*image, &d, startx, starty, xl, yt, 1, 0);
}
marktype_calc_centroid (&d);
marktype_area (&d);
boundary_free(&b);
return d;
}
marktype
boundary_extract_non_nested(marktype *image, int x, int y, int conn)
{
marktype d;
int xl,xr,yt,yb,i,l;
lrboundarytype lrb;
boundarytype b;
int p;
assert(image);
assert((x>=0) && (y>=0));
assert((conn==4) || (conn==8));
if(conn==8){
boundary_trace_inside8(image,&b,x,y);
} else {
boundary_trace_inside4(image,&b,x,y);
}
boundary_bounds(&b,&xl,&xr,&yt,&yb);
boundary_max_lr(&b,&lrb);
marktype_alloc (&d, xr-xl+1, yb - yt + 1);
d.imagew=image->imagew;
d.imageh=image->imageh;
d.xpos = xl;
d.ypos = yt;
for(i=0;i<lrb.len;i++){
for(l=lrb.l[i] ; l<=lrb.r[i] ; l++){
p=pbm_getpixel (image->bitmap, l,lrb.y[i]);
pbm_putpixel(d.bitmap, l-xl,lrb.y[i]-yt, p);
if(p)
pbm_putpixel(image->bitmap,l,lrb.y[i],0);
}
}
marktype_calc_centroid (&d);
marktype_area (&d);
lrboundary_free(&lrb);
boundary_free(&b);
return d;
}
marklistptr
extract_all_marks(marklistptr list, marktype image, int nested, int conn)
{
int x,y,sym;
marklistptr step = list;
assert((nested==0) || (nested==1));
assert((conn==4) || (conn==8));
g_x2=image.w-1;
g_y2=image.h-1;
x=y=0;
sym=0;
while((next_pixel(&image,&x,&y)==0)){
marktype d;
if(nested==1)
d=boundary_extract_nested(&image, x, y, conn);
else
d=boundary_extract_non_nested(&image, x, y, conn);
d.symnum=sym++;
if (list == NULL)
step = marklist_addcopy (&list, d);
else
step = marklist_addcopy (&step, d);
marktype_free(&d);
}
marktype_fill_cleanup();
return list;
}
marklistptr
extract_all_marks_bound(marklistptr list, marktype image, int nested, int conn,
int x1, int y1, int x2, int y2)
{
int x,y,sym;
marklistptr step = list;
static int qq=0;
assert((nested==0) || (nested==1));
assert((conn==4) || (conn==8));
g_x1=x1;
g_y1=y1;
g_x2=x2;
g_y2=y2;
x=x1;
y=y1;
sym=0;
while((next_pixel_bound(&image,&x,&y,x1,y1,x2,y2)==0)){
marktype d;
if(nested==1)
d=boundary_extract_nested(&image, x, y, conn);
else
d=boundary_extract_non_nested(&image, x, y, conn);
d.symnum=sym++;
if (list == NULL)
step = marklist_addcopy (&list, d);
else
step = marklist_addcopy (&step, d);
marktype_free(&d);
}
marktype_fill_cleanup();
return list;
}
/*
void
usage(void)
{
fprintf(stderr,"usage: \n"
"\tboundary infile.pbm >out.lib\n");
exit(1);
}
int
main(int argc, char *args[])
{
int ch;
marklistptr list=NULL;
marktype image;
char *infile=NULL;
int conn=8;
int nested=1;
extern char *optarg;
extern int optind;
if(argc<2) usage();
while((ch = getopt(argc, args, "48Nnh")) != -1)
switch(ch)
{
case '4': conn=4;break;
case '8': conn=8;break;
case 'N': nested=1;break;
case 'n': nested=0;break;
case 'h':
case '?':
usage();
}
for(; optind <argc; optind++){
if(!infile) infile=args[optind];
else error(args[0],"too many filenames","");
}
list=NULL;
fprintf(stderr,"connectivity: %d\n",conn);
fprintf(stderr,"nested components: %s\n",(nested==1)?"yes":"no");
if(infile==NULL)
exit(1);
if(marktype_readnamed(infile,&image)!=0)
exit(1);
marktype_area(&image);
fprintf(stderr,"Area in pbm: %d\n",image.set);
list=extract_all_marks(image,nested,conn);
marklist_writeascii("stdout",list);
return 0;
}
*/
|
Added work/contrib/tic/tic98/boundary.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#ifndef _BOUNDARY_H
#define _BOUNDARY_H
#include "marklist.h"
typedef struct {
int len;
int *x;
int *y;
} boundarytype;
typedef struct {
int len;
int *y;
int *l;
int *r;
} lrboundarytype;
marklistptr extract_all_marks(marklistptr list, marktype image, int nested, int conn);
marklistptr extract_all_marks_bound(marklistptr list, marktype image, int nested, int conn, int x1, int y1, int x2, int y2);
#endif
|
Added work/contrib/tic/tic98/char_features.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
|
#include "globals.h"
#include "template_match.h"
#include "marklist.h"
int
main(int argc, char *argv[])
{
marklistptr list=NULL,step=NULL;
marklistptr *ar;
int i,len,r,j,k,k2,k3,k4,k5,k6,k7,rr;
float r1,r2;
char *a,*b;
int iter=0;
srand(1);
globals_init();
if(marklist_readascii(argv[1],&list)==0){
exit(1);
}
len=marklist_length(list);
fprintf(stderr,"len: %d\n",len);
ar=malloc(sizeof(marklistptr)*len);
for(i=0,step=list;step;i++,step=step->next){
ar[i]=step;
}
fprintf(stdout,"@relation chars\n"
"@attribute xor real\n"
"@attribute wxor real\n"
"@attribute wan real\n"
"@attribute csis real\n"
"@attribute ctm_bits real\n"
"@attribute ctm_bpp real\n"
"@attribute abs_w real\n"
"@attribute abs_h real\n"
"@attribute abs_area real\n"
"@attribute class {match,differ}\n"
"@data\n");
for(i=0;i<len;i++){
if((i%100)==0){
fprintf(stderr,"%d \r",i);fflush(stderr);
}
a=ar[i]->data.name;
for(r=0;r<5;r++){
iter=0;
do{
j=rand()%len;
b=ar[j]->data.name;
iter++;
} while(((strcmp(a,b)!=0) || (i==j)) && (iter<1000));
if(ar[i]->data.name[0]=='?')
iter=10000;
if(iter<1000){
k=XOR_match(&(ar[i]->data),&(ar[j]->data));
k2=WXOR_match(&(ar[i]->data),&(ar[j]->data));
k3=WAN_match(&(ar[i]->data),&(ar[j]->data));
k4=CSIS_match(&(ar[i]->data),&(ar[j]->data));
CTM_match_proper(&(ar[i]->data),&(ar[j]->data),&r1,&r2);
fprintf(stdout,"%% %s %s\n",ar[i]->data.name,ar[j]->data.name);
fprintf(stdout,"%d,%d,%d,%d,%g,%g, %d,%d, %g, match\n",k,k2,k3,k4,r1,r2,
abs(ar[i]->data.w-ar[j]->data.w),abs(ar[i]->data.h-ar[j]->data.h),fabs(ar[i]->data.set*1.0/(ar[i]->data.w*ar[i]->data.h)-ar[j]->data.set*1.0/(ar[j]->data.w*ar[j]->data.h)));
}
}
for(rr=0;rr<20;rr++){
a=ar[i]->data.name;
iter=0;
do{
j=rand()%len;
b=ar[j]->data.name;
iter++;
} while(((strcmp(a,b)==0) || (i==j)) && (iter<1000));
if(iter<1000){
k=XOR_match(&(ar[i]->data),&(ar[j]->data));
k2=WXOR_match(&(ar[i]->data),&(ar[j]->data));
k3=WAN_match(&(ar[i]->data),&(ar[j]->data));
k4=CSIS_match(&(ar[i]->data),&(ar[j]->data));
CTM_match_proper(&(ar[i]->data),&(ar[j]->data),&r1,&r2);
fprintf(stdout,"%d,%d,%d,%d,%g,%g, %d,%d, %g, differ\n",k,k2,k3,k4,r1,r2,
abs(ar[i]->data.w-ar[j]->data.w),abs(ar[i]->data.h-ar[j]->data.h),fabs(ar[i]->data.set*1.0/(ar[i]->data.w*ar[i]->data.h)-ar[j]->data.set*1.0/(ar[j]->data.w*ar[j]->data.h)));
}
}
}
marklist_free(&list);
free(ar);
return 0;
}
|
Added work/contrib/tic/tic98/codebilevel.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
|
/*****************************************************************************
Author: Stuart Inglis <singlis@waikato.ac.nz>
bilevel
-=-=-=-
This is the code used to compress a bitmap. The template is given in
the following format.
'.' = pixel not used
'p' = pixel used in 1st order context (the superset)
'2' = pixel used in 2nd order context (the subset)
';' = marker used to denote the end of a row in the template
'*' = the current context pixel.
for instance, the common 22/10 template would be shown as:
".ppppp.;"
"pp222pp;"
"p22222p;"
"p22*...;"
*****************************************************************************/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "codebilevel.h"
#include "pbmtools.h"
#include "marklist.h"
#include "arithcode.h"
#include "utils.h"
#include "b_gamma.h"
static char default_template[]={
".ppppp.;"
"pp222pp;"
"p22222p;"
"p22*...;"
};
#define INITVALUE 2
#define INCREMENT 4
#define MAX_T_W 32
/* note memory usage is 2*TEMPLATESIZE*sizeof(prob), which is currently 4.9 Mb */
#define TEMPLATESIZE 612317
#define HASH(x) ((x)%TEMPLATESIZE)
typedef struct {unsigned short s,n;} prob; /* set and notset */
#define MAXTOTAL 16384
typedef struct {short int x,y;} coordinate;
coordinate MM[MAX_T_W][MAX_T_W]; /* the actual (x,y) positions */
unsigned int MMcount[MAX_T_W]; /* number of bits in this row of the template */
unsigned int MMmask[MAX_T_W]; /* the "current" mask value */
unsigned int MMbits[MAX_T_W]; /* the bitmask to mask out higher bits */
unsigned int MMrows; /* total number of rows */
unsigned int MM2level[MAX_T_W]; /* bitmask to calculate the 2nd level mask */
int twolevel,curr_row,surr;
int setup_template=0;
prob *P=NULL; /* probability array, up to N bits */
prob *P2=NULL;
prob *P_second=NULL; /* probability array, up to N bits */
prob *P2_second=NULL;
void bl_clearmodel()
{
int i;
CALLOC(P,TEMPLATESIZE,prob);
CALLOC(P2,TEMPLATESIZE,prob);
for(i=0;i<TEMPLATESIZE;i++){
P[i].s = P[i].n = INITVALUE;
P2[i].s = P2[i].n = INITVALUE;
}
}
void bl_clearmodel_second()
{
int i;
CALLOC(P_second,TEMPLATESIZE,prob);
CALLOC(P2_second,TEMPLATESIZE,prob);
for(i=0;i<TEMPLATESIZE;i++){
P_second[i].s = P_second[i].n = INITVALUE;
P2_second[i].s = P2_second[i].n = INITVALUE;
}
}
void bl_freemodel()
{
free(P);
free(P2);
}
#define update_counts(p, pixel) \
pixel ? (p->s+=INCREMENT) : (p->n+=INCREMENT); \
\
if((p->s+p->n) >= (MAXTOTAL)) { \
p->s=(p->s+1)/2; \
p->n=(p->n+1)/2; \
}
#ifndef Q_CODER
/* mask is the bigger one, mask2l is smaller one */
static void bl_encode_in_context(unsigned long mask, unsigned long mask2l, unsigned long pixel)
{
register unsigned short twol,t;
prob *p=&P[mask];
prob *p2=&P2[mask2l];
twol=twolevel && ((p->s+p->n)<(2*INITVALUE+5*INCREMENT)); /* twol==1 if small, else twol==0 if big */
t=twol ? (p2->s+p2->n) : (p->s+p->n);
if(twol==0){ /* if can code in big mask then do that */
if(pixel)
arithmetic_encode(0,p->s,t);
else
arithmetic_encode(p->s,t,t);
update_counts(p,pixel);
}
else { /* else use the little one and update the big one */
if(pixel)
arithmetic_encode(0,p2->s,t);
else
arithmetic_encode(p2->s,t,t);
update_counts(p2,pixel);
update_counts(p,pixel);
}
}
static void bl_encode_in_context_update_only(unsigned long mask, unsigned long mask2l, unsigned long pixel)
{
register unsigned short twol,t;
prob *p=&P[mask];
prob *p2=&P2[mask2l];
twol=twolevel && ((p->s+p->n)<(2*INITVALUE+5*INCREMENT)); /* twol==1 if small, else twol==0 if big */
t=twol ? (p2->s+p2->n) : (p->s+p->n);
if(twol==0){ /* if can code in big mask then do that */
if(pixel)
{/* arithmetic_encode(0,p->s,t);*/}
else
{/* arithmetic_encode(p->s,t,t); */}
update_counts(p,pixel);
}
else { /* else use the little one and update the big one */
if(pixel)
{/* arithmetic_encode(0,p2->s,t);*/}
else
{/* arithmetic_encode(p2->s,t,t);*/}
update_counts(p2,pixel);
update_counts(p,pixel);
}
}
#endif
static float bl_encode_in_context_return_bits(unsigned long mask, unsigned long mask2l, unsigned long pixel)
{
register unsigned short twol,t;
prob *p=&P[mask];
prob *p2=&P2[mask2l];
float b=0.0;
twol=twolevel && ((p->s+p->n)<(2*INITVALUE+5*INCREMENT)); /* twol==1 if small, else twol==0 if big */
t=twol ? (p2->s+p2->n) : (p->s+p->n);
if(twol==0){ /* if can code in big mask then do that */
if(pixel)
{/* arithmetic_encode(0,p->s,t);*/
b+=(log(p->s)-log(t));
}
else
{/* arithmetic_encode(p->s,t,t); */
b+=(log(p->n)-log(t));
}
update_counts(p,pixel);
}
else { /* else use the little one and update the big one */
if(pixel)
{/* arithmetic_encode(0,p2->s,t);*/
b+=(log(p2->s)-log(t));
}
else
{/* arithmetic_encode(p2->s,t,t);*/
b+=(log(p2->n)-log(t));
}
update_counts(p2,pixel);
update_counts(p,pixel);
}
return b;
}
#ifndef Q_CODER
static void bl_encode_in_context_second(unsigned long mask, unsigned long mask2l, unsigned long pixel)
{
register unsigned short twol,t;
prob *p=&P_second[mask];
prob *p2=&P2_second[mask2l];
twol=twolevel && ((p->s+p->n)<(2*INITVALUE+5*INCREMENT)); /* twol==1 if small, else twol==0 if big */
t=twol ? (p2->s+p2->n) : (p->s+p->n);
if(twol==0){ /* if can code in big mask then do that */
if(pixel)
arithmetic_encode(0,p->s,t);
else
arithmetic_encode(p->s,t,t);
update_counts(p,pixel);
}
else { /* else use the little one and update the big one */
if(pixel)
arithmetic_encode(0,p2->s,t);
else
arithmetic_encode(p2->s,t,t);
update_counts(p2,pixel);
update_counts(p,pixel);
}
}
static void bl_decode_in_context(unsigned long mask, unsigned long mask2l, unsigned long *val)
{
register int twol,pixel,t;
prob *p=&P[mask];
prob *p2=&P2[mask2l];
if(twolevel && ((unsigned short)(p->s+p->n)<(unsigned short)(2*INITVALUE+5*INCREMENT))) {
pixel=arithmetic_decode_target(p2->s+p2->n)<p2->s,twol=1;}
else {
pixel=arithmetic_decode_target(p->s+p->n)<p->s,twol=0;}
t=twol ? (p2->s+p2->n) : (p->s+p->n);
if(twol==0){
if(pixel)
arithmetic_decode(0,p->s,t);
else
arithmetic_decode(p->s,t,t);
update_counts(p,pixel);
}
else {
if(pixel)
arithmetic_decode(0,p2->s,t);
else
arithmetic_decode(p2->s,t,t);
update_counts(p2,pixel);
update_counts(p,pixel);
}
*val=pixel;
}
#endif
static void bl_string_to_array(char inputstr[], char parsestr[],int *w, int *h)
{
int r,c;
int i,j,lastc,p,l;
int xc,yc;
int foundstatus;
surr=twolevel=0;
for(i=0;i<MAX_T_W;i++)
MMcount[i]=MM2level[i]=0;
MMrows=0;
for(i=0;i<(int)strlen(inputstr);i++){
p=inputstr[i];
if((p!='.')&&(p!='2')&&(p!='*')&&(p!='p')&&(p!=';')){
fprintf(stderr,"Template string can only contain [.p2*;], not \"%c\".\n",inputstr[i]);exit(1);}
}
/* get the width and height, test rectangularity... */
parsestr[l=0]=0;
for(c=0,r=0,lastc=-1,p=0;p<(int)strlen(inputstr);p++){
if((inputstr[p]==';')){
r++;
if(lastc!=-1){ /* this is the 2nd row at least */
if(lastc!=c) {fprintf(stderr,"The rows have to be the same width. "
"Row %d has width %d (previous row has width %d)\n",r,c,lastc);exit(1);}
}
lastc=c;c=0;
}
else {
c++;
parsestr[l]=inputstr[p];parsestr[++l]=0;
}
}
if(c!=0) lastc=c;
*w=lastc;
*h=r;
if((*w)<=0) {fprintf(stderr,"Must have at least one column!\n");exit(1);}
if((*h)<=0) {fprintf(stderr,"Must have at least one row! Terminate each row with a ';'\n");exit(1);}
if((*w>MAX_T_W)||(*h>MAX_T_W)){
fprintf(stderr,"template size bigger than internal threshold of %d\n",MAX_T_W);exit(1);}
/* get the (x,y) position of the current (*) pixel */
for(xc=-1,yc=0,i=0;i<*w;i++)
for(j=0;j<*h;j++)
if(parsestr[j*(*w)+i]=='*') {
if(xc>=0) {fprintf(stderr,"There can only be ONE current ('*') pixel.\n");exit(1);}
xc=i;yc=j;
curr_row=j+1;
}
if(xc<0)error("bl_string_to_array","Error in mask, no current ('*') pixel.","");
/* found the position (xc,yc) */
/* convert parsestr[] into a MM[][] structure */
for(j=0;j<*h;j++){
foundstatus=0;
for(i=0;i<*w;i++){
p=j*(*w)+i;
if((parsestr[p]=='p')||(parsestr[p]=='2')){
if(!foundstatus) foundstatus=1;
MM2level[j]=MM2level[j]*2 | (parsestr[p]=='2');
if(parsestr[p]=='2') twolevel=1;
MM[j][MMcount[j]].x=i-xc;
MM[j][MMcount[j]++].y=j-yc;
if(((i-xc)>=0)&&((j-yc)>=0)) surr=1;
}
else {
if(foundstatus==1) foundstatus=2;
}
}
if(foundstatus) MMrows++;
MMbits[j]=(1<<MMcount[j])-1;
}
/* reverse matrix, so [][0] is the closest to the right */
{
coordinate temp;
for(i=0;i<MMrows;i++)
for(j=0;j<MMcount[i]/(unsigned)2;j++){
temp=MM[i][MMcount[i]-1-j];
MM[i][MMcount[i]-1-j]=MM[i][j];
MM[i][j]=temp;
}
}
}
void bl_writetemplate(char inputstr[])
{
register int i,j;
int w,h;
char ind[255];
char *str;
b_gammaptr qq;
qq=b_gamma_init();
CALLOC(str,strlen(inputstr)+2,char);
bl_string_to_array(inputstr,str,&w,&h);
b_gamma_encode(qq,surr);
b_gamma_encode(qq,w);
b_gamma_encode(qq,h);
ind['.']=0;
ind['p']=1;
ind['2']=2;
ind['*']=3;
for(j=0;j<h;j++)
for(i=0;i<w;i++)
b_gamma_encode(qq,ind[(int)str[j*w+i]]);
setup_template=1;
b_gamma_free(qq);
free(str);
}
void bl_setuptemplate(char inputstr[])
{
register int i,j;
int w,h;
char ind[255];
char *str;
CALLOC(str,strlen(inputstr)+2,char);
bl_string_to_array(inputstr,str,&w,&h);
ind['.']=0;
ind['p']=1;
ind['2']=2;
ind['*']=3;
setup_template=1;
free(str);
}
void bl_readtemplate()
{
register int i,j;
int w,h,p;
char ind[4];
char *inputstr,*str;
b_gammaptr qq;
qq=b_gamma_init();
surr=b_gamma_decode(qq);
if(surr){fprintf(stderr,"It's fine compressing an image using a 'surrounding' template, but I can't "
"decompress it!\n");exit(1);}
w=b_gamma_decode(qq);
h=b_gamma_decode(qq);
CALLOC(inputstr,(w+2)*h+2,char);
ind[0]='.';
ind[1]='p';
ind[2]='2';
ind[3]='*';
for(p=0,j=0;j<h;j++){
for(i=0;i<w;i++){
inputstr[p++]=ind[b_gamma_decode(qq)];
}
inputstr[p++]=';';
inputstr[p]=0;
}
b_gamma_free(qq);
CALLOC(str,strlen(inputstr)+2,char);
bl_string_to_array(inputstr,str,&w,&h);
setup_template=1;
}
void bl_defaulttemplate(void)
{
char *str;
int w,h;
CALLOC(str,strlen(default_template)+2,char);
bl_string_to_array(default_template,str,&w,&h);
FREE(str);
setup_template=1;
}
/* Currently if there are more than 32 bits, the topmost 32 will be discarded, if the
topbits are to be used in compression, define _MORETHAN32 */
#undef _MORETHAN32
void bl_compress_mark(marktype d)
{
register int r,c;
register int i,j;
register unsigned long mask,mask2level;
char *array[MAX_T_W];
for(i=0;i<MAX_T_W;i++){
CALLOC(array[i],d.w+2*MAX_T_W+1,char);
array[i]=array[i]+MAX_T_W;
}
if(setup_template==0)
bl_defaulttemplate();
/* EncodeGammaDist(d.w);
EncodeGammaDist(d.h); */
for(r=0;r<MIN(curr_row,d.h);r++)
for(c=0;c<d.w;c++)
array[r%MAX_T_W][c]=pbm_getpixel(d.bitmap,c,r);
for(r=0;r<d.h;r++){
if(r+curr_row<d.h)
for(c=0;c<d.w;c++)
array[(r+curr_row)%MAX_T_W][c]=pbm_getpixel(d.bitmap,c,r+curr_row);
else
for(c=0;c<d.w;c++)
array[(r+curr_row)%MAX_T_W][c]=0;
for(c=0;c<d.w;c++){
for(mask=0,mask2level=0,i=0;i<MMrows;i++){
if(c!=0){
MMmask[i]=(MMmask[i]*2);
MMmask[i]|= array[(r+MM[i][0].y+MAX_T_W)%MAX_T_W][c+MM[i][0].x];
}
else{
for(MMmask[i]=0,j=MMcount[i]-1;j>=0;j--)
MMmask[i]=2*MMmask[i] | array[(r+MM[i][j].y+MAX_T_W)%MAX_T_W][c+MM[i][j].x];
}
MMmask[i]&=MMbits[i];
#ifdef _MORETHAN32
mask=((mask*8191)<<MMcount[i]) | MMmask[i];
mask2level=((mask2level*499)<<MMcount[i]) | (MMmask[i] & MM2level[i]);
#else
mask=(mask<<MMcount[i]) | MMmask[i];
mask2level=(mask2level<<MMcount[i]) | (MMmask[i] & MM2level[i]);
#endif
}
mask=HASH(mask);
mask2level=HASH(mask2level);
bl_encode_in_context(mask,mask2level,pbm_getpixel(d.bitmap,c,r));
}
}
for(i=0;i<MAX_T_W;i++)
free(array[i]-MAX_T_W);
}
void bl_compress_mark_update_only(marktype d)
{
register int r,c;
register int i,j;
register unsigned long mask,mask2level;
char *array[MAX_T_W];
for(i=0;i<MAX_T_W;i++){
CALLOC(array[i],d.w+2*MAX_T_W+1,char);
array[i]=array[i]+MAX_T_W;
}
if(setup_template==0)
bl_defaulttemplate();
/* EncodeGammaDist(d.w);
EncodeGammaDist(d.h);
*/
for(r=0;r<MIN(curr_row,d.h);r++)
for(c=0;c<d.w;c++)
array[r%MAX_T_W][c]=pbm_getpixel(d.bitmap,c,r);
for(r=0;r<d.h;r++){
if(r+curr_row<d.h)
for(c=0;c<d.w;c++)
array[(r+curr_row)%MAX_T_W][c]=pbm_getpixel(d.bitmap,c,r+curr_row);
else
for(c=0;c<d.w;c++)
array[(r+curr_row)%MAX_T_W][c]=0;
for(c=0;c<d.w;c++){
for(mask=0,mask2level=0,i=0;i<MMrows;i++){
if(c!=0){
MMmask[i]=(MMmask[i]*2);
MMmask[i]|= array[(r+MM[i][0].y+MAX_T_W)%MAX_T_W][c+MM[i][0].x];
}
else{
for(MMmask[i]=0,j=MMcount[i]-1;j>=0;j--)
MMmask[i]=2*MMmask[i] | array[(r+MM[i][j].y+MAX_T_W)%MAX_T_W][c+MM[i][j].x];
}
MMmask[i]&=MMbits[i];
#ifdef _MORETHAN32
mask=((mask*8191)<<MMcount[i]) | MMmask[i];
mask2level=((mask2level*499)<<MMcount[i]) | (MMmask[i] & MM2level[i]);
#else
mask=(mask<<MMcount[i]) | MMmask[i];
mask2level=(mask2level<<MMcount[i]) | (MMmask[i] & MM2level[i]);
#endif
}
mask=HASH(mask);
mask2level=HASH(mask2level);
bl_encode_in_context_update_only(mask,mask2level,pbm_getpixel(d.bitmap,c,r));
}
}
for(i=0;i<MAX_T_W;i++)
free(array[i]-MAX_T_W);
}
float bl_compress_mark_return_bits(marktype d)
{
register int r,c;
register int i,j;
register unsigned long mask,mask2level;
char *array[MAX_T_W];
float bits=0;
for(i=0;i<MAX_T_W;i++){
CALLOC(array[i],d.w+2*MAX_T_W+1,char);
array[i]=array[i]+MAX_T_W;
}
if(setup_template==0)
bl_defaulttemplate();
/* EncodeGammaDist(d.w);
EncodeGammaDist(d.h);
*/
for(r=0;r<MIN(curr_row,d.h);r++)
for(c=0;c<d.w;c++)
array[r%MAX_T_W][c]=pbm_getpixel(d.bitmap,c,r);
for(r=0;r<d.h;r++){
if(r+curr_row<d.h)
for(c=0;c<d.w;c++)
array[(r+curr_row)%MAX_T_W][c]=pbm_getpixel(d.bitmap,c,r+curr_row);
else
for(c=0;c<d.w;c++)
array[(r+curr_row)%MAX_T_W][c]=0;
for(c=0;c<d.w;c++){
for(mask=0,mask2level=0,i=0;i<MMrows;i++){
if(c!=0){
MMmask[i]=(MMmask[i]*2);
MMmask[i]|= array[(r+MM[i][0].y+MAX_T_W)%MAX_T_W][c+MM[i][0].x];
}
else{
for(MMmask[i]=0,j=MMcount[i]-1;j>=0;j--)
MMmask[i]=2*MMmask[i] | array[(r+MM[i][j].y+MAX_T_W)%MAX_T_W][c+MM[i][j].x];
}
MMmask[i]&=MMbits[i];
#ifdef _MORETHAN32
mask=((mask*8191)<<MMcount[i]) | MMmask[i];
mask2level=((mask2level*499)<<MMcount[i]) | (MMmask[i] & MM2level[i]);
#else
mask=(mask<<MMcount[i]) | MMmask[i];
mask2level=(mask2level<<MMcount[i]) | (MMmask[i] & MM2level[i]);
#endif
}
mask=HASH(mask);
mask2level=HASH(mask2level);
bits+=bl_encode_in_context_return_bits(mask,mask2level,pbm_getpixel(d.bitmap,c,r));
}
}
for(i=0;i<MAX_T_W;i++)
free(array[i]-MAX_T_W);
return bits;
}
coordinate CSPM1[4]={{-1,-1},{0,-1},{1,-1},{-1,0}};
coordinate CSPM2[7]={{0,-1},{-1,0},{0,0},{1,0},{-1,1},{0,1},{1,1}};
prob *CSPM_prob=NULL;
void bl_CSPM_init(void)
{
int i;
CALLOC(CSPM_prob,2048,prob);
for(i=0;i<2048;i++)
CSPM_prob[i].s= CSPM_prob[i].n = 1;
}
void bl_CSPM_free(void)
{
FREE(CSPM_prob);
}
float bl_CSPM_return_bits(marktype d, marktype clair)
{
register int r,c;
register int i,j;
register unsigned long mask,mask2level;
float bits=0;
int xo;
int yo;
xo=clair.xcen - d.xcen;
yo=clair.ycen - d.ycen;
for(r=0;r<d.h;r++){
for(c=0;c<d.w;c++){
mask=0;
for(i=0;i<4;i++)
mask=(2*mask) | gpix(d,c+CSPM1[i].x,r+CSPM1[i].y);
for(i=0;i<7;i++)
mask=(2*mask) | gpix(clair,c+xo+CSPM2[i].x,r+yo+CSPM2[i].y);
if(gpix(d,c,r)){
bits+=(log(CSPM_prob[mask].s)-
log(CSPM_prob[mask].s+CSPM_prob[mask].n));
/* CSPM_prob[mask].s++;*/
}
else {
bits+=(log(CSPM_prob[mask].n)-
log(CSPM_prob[mask].s+CSPM_prob[mask].n));
/* CSPM_prob[mask].n++;*/
}
}
}
return bits;
}
void bl_CSPM_update_bits(marktype d, marktype clair)
{
register int r,c;
register int i,j;
register unsigned long mask,mask2level;
float bits=0;
int xo;
int yo;
xo=clair.xcen - d.xcen;
yo=clair.ycen - d.ycen;
for(r=0;r<d.h;r++){
for(c=0;c<d.w;c++){
mask=0;
for(i=0;i<4;i++)
mask=(2*mask) | gpix(d,c+CSPM1[i].x,r+CSPM1[i].y);
for(i=0;i<7;i++)
mask=(2*mask) | gpix(clair,c+xo+CSPM2[i].x,r+yo+CSPM2[i].y);
if(gpix(d,c,r)){
CSPM_prob[mask].s++;
}
else {
CSPM_prob[mask].n++;
}
}
}
}
#define EP(x,y) (pbm_getpixel_trunc(d.bitmap,c+x,r+y,d.w,d.h))
void progressive_compress(marktype d)
{
register int r,c;
register int i,j,k;
int t;
register unsigned long mask;
coordinate test[6]={{-1,-1},{0,-1},{1,-1},{-3,0},{-2,0},{-1,0}};
EncodeGammaDist(d.w);
EncodeGammaDist(d.h);
for(r=0;r<d.h;r++){
fprintf(stderr,"%d\r",r);
for(c=0;c<d.w;c++){
mask=0;
t=EP(1,-1)+EP(1,-2);
t/=2;
mask=mask*2 | t;
t=EP(0,-1)+EP(0,-2);
t/=2;
mask=mask*2 | t;
t=EP(-1,-1)+EP(-1,-2);
t/=2;
mask=mask*2 | t;
t=EP(-1,0)+EP(-2,0);
t/=2;
mask=mask*2 | t;
t=EP(-1,0)+EP(-1,-1);
t/=2;
mask=mask*2 | t;
t=EP(-2,0)+EP(-2,-1);
t/=2;
mask=mask*2 | t;
/*
for(k=0;k<6;k++)
mask=mask<<1 | pbm_getpixel_trunc(d.bitmap,c+test[k].x,r+test[k].y,d.w,d.h);
*/
bl_encode_in_context(mask,0,pbm_getpixel(d.bitmap,c,r));
}
}
}
void progressive_decompress(marktype *d)
{
register int r,c;
register int i,j,k;
int t;
register unsigned long mask;
unsigned long pix;
coordinate test[6]={{-1,-1},{0,-1},{1,-1},{-3,0},{-2,0},{-1,0}};
d->w=DecodeGammaDist();
d->h=DecodeGammaDist();
marktype_alloc(d,d->w,d->h);
for(r=0;r<d->h;r++){
fprintf(stderr,"%d\r",r);
for(c=0;c<d->w;c++){
mask=0;
for(k=0;k<6;k++)
mask=mask<<1 | pbm_getpixel_trunc(d->bitmap,c+test[k].x,r+test[k].y,d->w,d->h);
bl_decode_in_context(mask,0,&pix);
if(pix)
pbm_putpixel(d->bitmap,c,r,pix);
}
}
}
void bl_decompress_mark(marktype *d, int w, int h)
{
register int r,c;
register int i,j;
unsigned long pix;
register unsigned long mask,mask2level;
char *array[MAX_T_W];
/* d->w=DecodeGammaDist();
d->h=DecodeGammaDist();*/
d->w=w;
d->h=h;
if(setup_template==0)
bl_defaulttemplate();
marktype_alloc(d,d->w,d->h);
for(i=0;i<MAX_T_W;i++){
CALLOC(array[i],d->w+2*MAX_T_W+1,char);
array[i]=array[i]+MAX_T_W;
}
for(r=0;r<d->h;r++){
for(c=0;c<d->w;c++)
array[r%MAX_T_W][c]=pbm_getpixel(d->bitmap,c,r);
for(c=0;c<d->w;c++){
for(mask=0,mask2level=0,i=0;i<MMrows;i++){
if(c!=0){
MMmask[i]=(MMmask[i]*2);
MMmask[i]|= array[(r+MM[i][0].y+MAX_T_W)%MAX_T_W][c+MM[i][0].x];
}
else
{
for(MMmask[i]=0,j=MMcount[i]-1;j>=0;j--) /* get all pixels */
MMmask[i]=2*MMmask[i] | array[(r+MM[i][j].y+MAX_T_W)%MAX_T_W][c+MM[i][j].x];
}
MMmask[i]&=MMbits[i];
#ifdef _MORETHAN32
mask=((mask*8191)<<MMcount[i]) | MMmask[i];
mask2level=((mask2level*499)<<MMcount[i]) | (MMmask[i] & MM2level[i]);
#else
mask=(mask<<MMcount[i]) | MMmask[i];
mask2level=(mask2level<<MMcount[i]) | (MMmask[i] & MM2level[i]);
#endif
}
mask=HASH(mask);
mask2level=HASH(mask2level);
bl_decode_in_context(mask,mask2level,&pix);
if(pix){
pbm_putpixel(d->bitmap,c,r,pix);
array[r%MAX_T_W][c]=pix;
}
}
}
for(i=0;i<MAX_T_W;i++)
free(array[i]-MAX_T_W);
}
void bl_compress(marktype d, char inputstr[])
{
bl_clearmodel();
/* bl_writetemplate(inputstr);
EncodeGammaDist(d.w);
EncodeGammaDist(d.h);*/
bl_compress_mark(d);
bl_freemodel();
}
void bl_progressive_compress(marktype d, char inputstr[])
{
bl_clearmodel();
bl_writetemplate(inputstr);
progressive_compress(d);
bl_freemodel();
}
void bl_progressive_decompress(marktype *d)
{
bl_clearmodel();
bl_readtemplate();
progressive_decompress(d);
bl_freemodel();
}
void bl_decompress(marktype *d)
{
int w,h;
bl_clearmodel();
/* bl_readtemplate();
w=DecodeGammaDist();
h=DecodeGammaDist();*/
bl_decompress_mark(d,d->w,d->h);
bl_freemodel();
}
/*
The bitmap in d2, can be examined clairvoyantly. The ordering of the
params is therefore non-clairvoyant, and clairvoyant in that order.
*/
/*
coordinate M1[6]={ { 0,-2},
{-1,-1},{ 0,-1}, {1,-1},
{-2,0}, {-1, 0}};
};
coordinate M2[13]={ { 0,-2},
{-1,-1}, { 0,-1}, {1, -1},
{-2,0}, {-1, 0}, { 0, 0}, { 1, 0}, {2,0},
{-1, 1}, { 0, 1}, { 1, 1},
{ 0, 2}
*/
const coordinate M1[6]={ { 0,-2},
{-2,0}, {1,-1}, {-1,-1}, {0,-1}, {-1,0}};
const coordinate M2[13]={ { 0,-2},
{1, -1},
{-2,0}, {2,0}, {-1, 1}, { 1, 1}, { 0, 2},
{-1,-1}, {0,-1}, {1,0}, {-1,0}, {0,1}, {0,0}
};
#define M1S 6
#define M1S_2level 3
#define M2S 13
#define M2S_2level 6
void bl_clair_compress(marktype d1, marktype d2)
{
register int r,c;
register unsigned int i,j,n;
register unsigned long mask,mask2level=0;
int cols,rows;
int gap;
Pixel **b1,**b2;
if(setup_template==0)
bl_defaulttemplate();
bl_clearmodel();
twolevel=1;
b1=d1.bitmap;
b2=d2.bitmap;
cols=d1.w;
rows=d1.h;
i=j=0;
gap=MAX(50,rows/9);
EncodeGammaDist(cols);
EncodeGammaDist(rows);
for(r=0;r<rows;r++){
for(c=0;c<cols;c++){
mask=0;
for(n=0;n<M1S;n++){
i=c+M1[n].x;
j=r+M1[n].y;
if((i<cols)&&(j<rows))
mask=(2*mask)| pbm_getpixel(b1,i,j) ;
else
mask=2*mask;
}
mask2level=mask&((1<<M1S_2level) -1);
for(n=0;n<M2S;n++){
i=c+M2[n].x;
j=r+M2[n].y;
if((i<cols)&&(j<rows))
mask=(2*mask) | pbm_getpixel(b2,i,j) ;
else
mask=2*mask;
}
mask2level=(mask2level<<M2S_2level) | (mask & ((1<<M2S_2level) -1));
mask=HASH(mask);
mask2level=HASH(mask2level);
bl_encode_in_context(mask,mask2level,(pbm_getpixel(b1,c,r)));
/*
if(pbm_getpixel(b1,c,r))
arithmetic_encode(0,1,2);
else
arithmetic_encode(1,2,2);
*/
}
}
bl_freemodel();
}
void bl_clair_compress_second(marktype d1, marktype d2)
{
register int r,c;
register unsigned int i,j,n;
register unsigned long mask,mask2level=0;
int cols,rows;
Pixel **b1,**b2;
twolevel=1;
b1=d1.bitmap;
b2=d2.bitmap;
cols=d1.w;
rows=d1.h;
i=j=0;
/*
EncodeGammaDist(cols);
EncodeGammaDist(rows);
*/
for(r=0;r<rows;r++){
for(c=0;c<cols;c++){
mask=0;
for(n=0;n<M1S;n++){
i=c+M1[n].x;
j=r+M1[n].y;
if((i<cols)&&(j<rows)&&(i>=0)&&(j>=0))
mask=(2*mask)| pbm_getpixel(b1,i,j) ;
else
mask=2*mask;
}
mask2level=mask&((1<<M1S_2level) -1);
for(n=0;n<M2S;n++){
i=c+M2[n].x;
j=r+M2[n].y;
if((i<d2.w)&&(j<d2.h)&&(i>=0)&&(j>=0))
mask=(2*mask) | pbm_getpixel(b2,i,j) ;
else
mask=2*mask;
}
mask2level=(mask2level<<M2S_2level) | (mask & ((1<<M2S_2level) -1));
mask=HASH(mask);
mask2level=HASH(mask2level);
bl_encode_in_context_second(mask,mask2level,(pbm_getpixel(b1,c,r)));
}
}
}
void bl_clair_decompress(marktype d1, marktype d2)
{
register int r,c;
register int i,j,n;
register unsigned long mask,mask2level=0;
unsigned long p;
int cols,rows;
int gap;
Pixel **b1,**b2;
if(setup_template==0)
bl_defaulttemplate();
bl_clearmodel();
twolevel=1;
b1=d1.bitmap;
b2=d2.bitmap;
cols=d1.w;
rows=d1.h;
gap=MAX(50,rows/9);
i=DecodeGammaDist();
j=DecodeGammaDist();
if((i!=cols)||(j!=rows)) error("bl_clair_decompress","incorrect size of residue image","");
for(r=0;r<rows;r++){
for(c=0;c<cols;c++){
mask=0;
for(n=0;n<M1S;n++){
i=c+M1[n].x;
j=r+M1[n].y;
mask=(2*mask) | pbm_getpixel_trunc(b1,i,j,cols,rows);
}
mask2level=mask&((1<<M1S_2level) -1);
for(n=0;n<M2S;n++){
i=c+M2[n].x;
j=r+M2[n].y;
mask=(2*mask) | pbm_getpixel_trunc(b2,i,j,cols,rows);
}
mask2level=(mask2level<<M2S_2level) | (mask & ((1<<M2S_2level) -1));
mask=HASH(mask);
mask2level=HASH(mask2level);
bl_decode_in_context(mask,mask2level,&p);
if(p) pbm_putpixel(b1,c,r,1);
}
}
bl_freemodel();
}
|
Added work/contrib/tic/tic98/codebilevel.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
/*****************************************************************************
*
* Author: Stuart Inglis <singlis@waikato.ac.nz>
*
*
* This file contains the headers relating to bi-level de/compression
*
*****************************************************************************/
#ifndef __BILEVEL_H
#define __BILEVEL_H
#include "marklist.h"
/* must be called before the start of de/compression */
void bl_clearmodel(void);
void bl_freemodel(void);
/* writes the template to the stream, and sets up the de/compression params */
void bl_writetemplate(char inputstr[]);
void bl_setuptemplate(char inputstr[]);
void bl_defaulttemplate(void);
void bl_readtemplate(void);
/* actually performs the de/compression */
void bl_compress(marktype d,char str[]);
void bl_progressive_compress(marktype d,char str[]);
void bl_compress_mark(marktype d);
void progressive_compress(marktype d);
void bl_decompress(marktype *d);
void bl_progressive_decompress(marktype *d);
void bl_decompress_mark(marktype *d, int w, int h);
void progressive_decompress(marktype *d);
/* clairvoyantly de/compress d1 with respect to clairvoyantly viewable d2 */
void bl_clair_compress(marktype d1, marktype d2);
void bl_clair_compress_2(marktype d1, marktype d2);
void bl_clair_decompress(marktype d1, marktype d2);
void bl_clearmodel_second();
void bl_clair_compress_second(marktype d1, marktype d2);
float bl_compress_mark_return_bits(marktype d);
void bl_compress_mark_update_only(marktype d);
void bl_CSPM_init(void);
void bl_CSPM_free(void);
float bl_CSPM_return_bits(marktype d, marktype clair);
void bl_CSPM_update_bits(marktype d, marktype clair);
#endif
|
Added work/contrib/tic/tic98/codebook.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
|
/*
* Module: codebook
*
* Implements the routines for handling equivalance classes
* and adding/averaging the codebook.
*
* The codebook module matches against the average mark example.
* We use a 21% XOR template matcher. This works well for lossless
* compression, but not very well for lossy compression.
*
* For lossless compression, the template is close enough to give
* the contexts some reliability. For lossy compression, a CSIS
* style template matcher should be employed.
*
* The codebook_configure() routine can be used to change the
* default behaviour of the codebook. The default values
* are an unlimited number of equivalence classes, and at most
* 10 examples in each class.
*
* Author:
* Stuart Inglis (singlis@internz.co.nz)
* (c) 1998
*
*/
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <assert.h>
#include "marklist.h"
#include "pbmtools.h"
#include "template_match.h"
#include "globals.h"
#include "codebook.h"
int SCALE=256;
/* the matching function uses globals.g_match_threshold */
/******************************************************************
* Equivalence class
* Routines
*
*
******************************************************************/
static void
equiv_classes_init(equiv_classes *e, int max_examples)
{
assert(e);
if((globals.g_match_mode==MATCH_B_SINGLE)||
(globals.g_match_mode==MATCH_F_SINGLE)||
(globals.g_match_mode==MATCH_HYBRID)){
e->max_examples=SCALE-1;
} else {
e->max_examples=max_examples;
}
e->num=0;
e->set=NULL;
marktype_init(&(e->avg));
e->avg.bitmap=NULL;
e->avg_uptodate=1;
e->time=0;
}
static void
equiv_classes_free(equiv_classes *e)
{
int i;
assert(e);
for(i=0;i<e->num;i++){
marktype_free(&(e->set[i]));
}
marktype_free(&(e->avg));
free(e->set);
}
static int
equiv_classes_add(equiv_classes *e, marktype *d)
{
int num,i;
assert(e);
assert(d);
num=e->num;
if((e->max_examples<1) || (num<e->max_examples)){
e->set=(marktype*)realloc(e->set,sizeof(marktype)*(num+1));
assert(e->set);
e->set[num]=marktype_copy(*d);
e->avg_uptodate=0;
e->num++;
} else {
/* get rid of the oldest example */
marktype_free(&(e->set[0]));
for(i=1;i<num;i++)
e->set[i-1]=e->set[i];
e->set[num-1]=marktype_copy(*d);
e->avg_uptodate=0;
num=num-1;
}
return num;
}
/*
static void
equiv_classes_dump(equiv_classes *e, FILE *fp)
{
int i;
assert(e);
assert(fp);
for(i=0;i<e->num;i++){
marktype_writeascii(fp,e->set[i]);
fprintf(fp,"crc: %d\n",marktype_crc(&(e->set[i])));
}
}
*/
/*
static int
equiv_classes_match(equiv_classes *e, marktype *mark, int *bestscore)
{
int i;
int score,found=-2;
assert(e);
assert(mark);
assert(bestscore);
*bestscore=-1;
for(i=0;i<e->num;i++){
if(NOT_SCREENED(*mark,e->set[i])){
score=TEMP_FUNC(mark,&(e->set[i]));
if(score<XORTHRESHOLD){
if((*bestscore<0) || (score<*bestscore)){
*bestscore=score;
found=i;
}
}
}
}
return found;
}
*/
static int
equiv_classes_avg_match(equiv_classes *e, marktype *mark, int *bestscore)
{
int i;
int score,found=-2,score2;
int total=0,matched=0;
assert(e);
assert(mark);
assert(bestscore);
*bestscore=-1;
for(i=0;i<e->num;i++){
if(NOT_SCREENED(*mark,e->set[i])){
score=TEMP_FUNC(mark,&(e->set[i]));
if(score<=globals.g_match_threshold){
total+=score;
matched+=1;
found=1;
/*break;*/
}
}
}
if(found>=0)
*bestscore=(total/matched);
return found;
}
/******************************************************************
* Codebook
* Routines
*
*
******************************************************************/
void
codebook_configure(codebook *c, int max_classes, int max_examples)
{
assert(c);
c->max_classes=max_classes;
c->max_examples=max_examples;
}
void
codebook_init(codebook *c, int max_classes, int max_examples)
{
assert(c);
c->num_eqv=0;
c->eqv=NULL;
c->time=0;
codebook_configure(c,max_classes, max_examples);
}
void
codebook_updatetime(codebook *c)
{
c->time++;
}
void
codebook_free(codebook *c)
{
int i;
assert(c);
if(c->eqv){
for(i=0;i<c->num_eqv;i++)
equiv_classes_free(&(c->eqv[i]));
free(c->eqv);
}
}
int
codebook_add_equiv(codebook *c)
{
int num,i;
assert(c);
num=c->num_eqv;
if((c->max_classes<1) || (num<c->max_classes)){
c->eqv=(equiv_classes*)realloc(c->eqv,sizeof(equiv_classes)*(num+1));
assert(c->eqv);
equiv_classes_init(&(c->eqv[num]),c->max_examples);
c->num_eqv++;
} else {
int min,max;
int minpos=0;
min=max=c->eqv[0].time;
/* getting rid of the oldest isn't very good */
/* getting rid of the smallest is much better...*/
/* now we get rid of the marks using LRU */
for(i=0;i<num;i++){
if(c->eqv[i].time<min){
min=c->eqv[i].time;
minpos=i;
}
if(c->eqv[i].time>max)
max=c->eqv[i].time;
}
/* fprintf(stderr,"deleting class %d min=%d,max=%d\n",minpos,min,max);*/
equiv_classes_free(&(c->eqv[minpos]));
for(i=minpos+1;i<num;i++)
c->eqv[i-1]=c->eqv[i];
equiv_classes_init(&(c->eqv[num-1]),c->max_examples);
num=num-1;
}
c->eqv[num].time=c->time;
return num;
}
int
codebook_add_equiv2(codebook *c)
{
int num,i;
assert(c);
num=c->num_eqv;
if((c->max_classes<1) || (num<c->max_classes)){
c->eqv=(equiv_classes*)realloc(c->eqv,sizeof(equiv_classes)*(num+1));
assert(c->eqv);
equiv_classes_init(&(c->eqv[num]),c->max_examples);
c->num_eqv++;
} else {
int min,max;
int minpos=0;
min=max=c->eqv[0].time;
/* getting rid of the oldest isn't very good */
/* getting rid of the smallest is much better...*/
/* now we get rid of the marks using LRU */
for(i=0;i<num;i++){
if(c->eqv[i].time<min){
min=c->eqv[i].time;
minpos=i;
}
if(c->eqv[i].time>max)
max=c->eqv[i].time;
}
/* fprintf(stderr,"deleting class %d min=%d,max=%d\n",minpos,min,max);*/
equiv_classes_free(&(c->eqv[minpos]));
for(i=minpos+1;i<num;i++)
c->eqv[i-1]=c->eqv[i];
equiv_classes_init(&(c->eqv[num-1]),c->max_examples);
num=num-1;
}
c->eqv[num].time=c->time;
return num*SCALE;
}
marktype *
codebook_get_avg_mark(codebook *c, int eq, int updatetimeaccess)
{
assert(c);
assert((eq>=0) && (eq<c->num_eqv));
if(c->eqv[eq].avg_uptodate==0){
if(c->eqv[eq].avg.bitmap!=NULL)
marktype_free(&(c->eqv[eq].avg));
equiv_classes_average_mark(&(c->eqv[eq]),&(c->eqv[eq].avg));
c->eqv[eq].avg_uptodate=1;
}
if(updatetimeaccess==UPDATETIME){
c->eqv[eq].time=c->time;
}
return &(c->eqv[eq].avg);
}
/* the "2" series of functions don't match with respect to the average, but
with respect to the best fitting component over all. To keep compatible
with the other functions we map the equivalence class along with it's
number in the class to an integer using n=class*SCALE + pos; */
marktype *
codebook_get_avg_mark2(codebook *c, int eq, int updatetimeaccess)
{
int i,j;
assert(c);
i=eq/SCALE;
j=eq%SCALE;
if(updatetimeaccess==UPDATETIME){
c->eqv[i].time=c->time;
}
return &(c->eqv[i].set[j]);
}
int
codebook_add_mark(codebook *c,int eq,marktype *mark)
{
int n;
assert(c);
assert((eq>=0) && (eq<c->num_eqv));
assert(mark);
n=equiv_classes_add(&(c->eqv[eq]), mark);
return n;
}
int
codebook_add_mark2(codebook *c,int eq,marktype *mark)
{
int n;
assert(c);
assert(mark);
/* find out the class */
eq=eq/SCALE;
/*assert(c->eqv[eq].num<SCALE);*/
n=equiv_classes_add(&(c->eqv[eq]), mark);
return n;
}
int
codebook_match(codebook *c,marktype *mark)
{
int i;
int found=-1,ret;
int score;
int bestscore=-1;
assert(c);
assert(mark);
for(i=0;i<c->num_eqv;i++){
/* ret=equiv_classes_match(&(c->eqv[i]),mark, &score);*/
ret=equiv_classes_avg_match(&(c->eqv[i]),mark, &score);
if(ret>=0){
if((bestscore<0)||(score<bestscore)){
bestscore=score;
found=i;
}
}
}
return found;
}
int
codebook_match_against_average(codebook *c,marktype *mark)
{
int i;
int found=-1;
int score,score2;
int bestscore=-1;
marktype *avg=NULL;
assert(c);
assert(mark);
for(i=0;i<c->num_eqv;i++){
avg=codebook_get_avg_mark(c,i, NO_UPDATE);
if(NOT_SCREENED(*avg,*mark)){
score=TEMP_FUNC(avg,mark);
if(score<=globals.g_match_threshold){
if((bestscore<0)||(score<bestscore)){
bestscore=score;
found=i;
c->eqv[i].time=c->time;
/* if we've already found the best possible */
if(bestscore==0)
break;
if((globals.g_match_mode==MATCH_F_SINGLE)||
(globals.g_match_mode==MATCH_F_AVG))
break;
}
}
}
}
return found;
}
int
codebook_match_against_average2(codebook *c,marktype *mark)
{
int i,j;
int found=-1;
int score,score2;
int bestscore=-1;
marktype *avg=NULL;
assert(c);
assert(mark);
for(i=0;i<c->num_eqv;i++){
for(j=0;j<c->eqv[i].num;j++){
avg=&(c->eqv[i].set[j]);
if(NOT_SCREENED(*avg,*mark)){
score=TEMP_FUNC(avg,mark);
if(score<=globals.g_match_threshold){
if((bestscore<0)||(score<bestscore)){
bestscore=score;
found=i*SCALE + j;
c->eqv[i].time=c->time;
/* if we've already found the best possible */
if(bestscore==0)
break;
if((globals.g_match_mode==MATCH_F_SINGLE)||
(globals.g_match_mode==MATCH_F_AVG))
break;
}
}
}
}
}
return found;
}
void
codebook_dump(codebook *c, int all)
{
int i,j;
assert(c);
for(i=0;i<c->num_eqv;i++){
fprintf(stderr,"********** %d: %d ******************\n",i,c->eqv[i].num);
if(all){
for(j=0;j<c->eqv[i].num;j++)
marktype_writeascii(stderr,c->eqv[i].set[j]);
}
}
}
void
codebook_dump_pbm(codebook *c, char *fn)
{
int i,j;
int MM=3000;
int gapx=1,gapy=1;
int MAXh,h;
int MAXw,w;
marktype image;
marktype *avg=NULL;
assert(c);
assert(fn);
MAXw=0;
MAXh=0;
for(i=0;i<c->num_eqv;i++){
w=0;
h=0;
avg=codebook_get_avg_mark(c,i, NO_UPDATE);
w+=avg->w+gapx;
for(j=0;j<c->eqv[i].num;j++){
if(c->eqv[i].set[j].h>h)
h=c->eqv[i].set[j].h;
w+=c->eqv[i].set[j].w;
w+=gapx;
if(w>MAXw)
MAXw=w;
if((w>=MM) && (j<c->eqv[i].num-1)){
w=0;
MAXh+=h;
}
}
MAXh+=h;
MAXh+=gapy;
}
marktype_alloc(&image,MAXw,MAXh);
MAXw=0;
MAXh=0;
for(i=0;i<c->num_eqv;i++){
w=0;
h=0;
avg=codebook_get_avg_mark(c,i, NO_UPDATE);
marktype_placeat(image,*avg,w,MAXh);
w+=avg->w+gapx;
for(j=0;j<c->eqv[i].num;j++){
marktype_placeat(image,c->eqv[i].set[j],w,MAXh);
if(c->eqv[i].set[j].h>h)
h=c->eqv[i].set[j].h;
w+=c->eqv[i].set[j].w;
w+=gapx;
if(w>MAXw)
MAXw=w;
if((w>=MM) && (j<c->eqv[i].num-1)){
w=0;
MAXh+=h;
}
}
MAXh+=h;
MAXh+=gapy;
}
marktype_writenamed(fn,image);
marktype_free(&image);
}
void
equiv_classes_average_mark(equiv_classes *e, marktype *mark)
{
int w = 0, h = 0;
int t = INT_MAX, b = 0, l = INT_MAX, r = 0, matched = 0;
marktype d, *temp=NULL;
int **a=NULL;
int x, y,i;
int set;
assert(e);
assert(mark);
for(i=0;i<e->num;i++){
matched++;
temp = &(e->set[i]);
w = MAX (w, temp->w);
h = MAX (h, temp->h);
r = MAX (r, temp->xcen);
l = MIN (l, temp->xcen);
b = MAX (b, temp->ycen);
t = MIN (t, temp->ycen);
}
w = w + (r - l);
h = h + (b - t);
if (matched > 1) {
int x_off, y_off;
CALLOC_2D(a,w,h,int);
assert(a);
for (x = 0; x < w; x++)
for (y = 0; y < h; y++)
a[x][y] = 0;
for(i=0;i<e->num;i++){
temp=&(e->set[i]);
x_off = r - temp->xcen;
y_off = b - temp->ycen;
for (x = 0; x < temp->w; x++)
for (y = 0; y < temp->h; y++)
if (pbm_getpixel (temp->bitmap, x, y)){
assert(x+x_off>=0);
assert(x+x_off<w);
assert(y+y_off>=0);
assert(y+y_off<h);
a[x + x_off][y + y_off]++;
}
}
set = 0;
d.w = w;
d.h = h;
marktype_alloc (&d, w, h);
for (x = 0; x < w; x++)
for (y = 0; y < h; y++){
/* > gives better CR than >= */
if (a[x][y] > MAX (1, (matched / 2))) {
pbm_putpixel (d.bitmap, x, y, 1);
set++;
}
}
FREE_2D(a,w);
marktype_area (&d);
assert(d.set!=0);
marktype_adj_bound (&d);
d.set = set;
d.name = (char *) realloc (d.name, sizeof (char) * (strlen ("?") + 1));
assert(d.name);
strcpy (d.name, "?");
marktype_calc_centroid (&d);
} else
d = marktype_copy (e->set[0]);
*mark = d;
}
|
Added work/contrib/tic/tic98/codebook.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
#ifndef _CODEBOOK_H
#define _CODEBOOK_H
#include "marklist.h"
extern int SCALE;
#define NO_UPDATE 0
#define UPDATETIME 1
/* XOR 17
WXOR 58
WAN 76
CSIS 400
CTM 9999
ALL 9999
*/
#define TEMP_FUNC CSIS_match
#define TEMP_FUNC_STRING "CSIS"
typedef struct {
int num;
marktype avg;
int avg_uptodate;
marktype *set;
int max_examples;
int time;
} equiv_classes;
typedef struct {
int num_eqv;
equiv_classes *eqv;
int max_classes;
int max_examples;
int time;
} codebook;
void codebook_init(codebook *c, int max_classes, int max_examples);
void codebook_free(codebook *c);
void codebook_updatetime(codebook *c);
int codebook_add_equiv(codebook *c);
int codebook_add_equiv2(codebook *c);
int codebook_add_mark(codebook *c,int eq,marktype *mark);
int codebook_add_mark2(codebook *c,int eq,marktype *mark);
int codebook_match(codebook *c,marktype *mark);
void codebook_dump(codebook *c, int all);
void codebook_dump_pbm(codebook *c, char *fn);
void equiv_classes_average_mark(equiv_classes *e, marktype *mark);
int codebook_match_against_average(codebook *c,marktype *mark);
int codebook_match_against_average2(codebook *c,marktype *mark);
marktype *codebook_get_avg_mark(codebook *c, int eq, int updatetimeaccess);
marktype *codebook_get_avg_mark2(codebook *c, int eq, int updatetimeaccess);
void codebook_configure(codebook *c, int max_classes, int max_examples);
#endif
|
Added work/contrib/tic/tic98/context.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
|
/*
* Module: context
*
* Implements the routines for finding image contexts for image
* compression.
*
* This module calculates the normal and clairvoyant JBIG templates.
* As well as the ten standard pixels, we introduce a "missing" bit
* which is set when the template is not entirely within the page.
* This single bit gives between 1% and 5% compression improvement.
*
*
* Author:
* Stuart Inglis (singlis@internz.co.nz)
* (c) 1998
*
*/
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <assert.h>
#include "globals.h"
#include "arithcode.h"
#include "marklist.h"
#include "pbmtools.h"
#include "template_match.h"
#include "context.h"
coordinate jbig[JBIG_SIZE]={{-1,-2},{0,-2},{1,-2},
{-2,-1},{-1,-1},{0,-1},{1,-1},{2,-1},
{-2,0},{-1,0}};
coordinate jbig_cl1[MAX_CONTEXT_SIZE],jbig_cl2[MAX_CONTEXT_SIZE];
int JBIG_CLAIR_1,JBIG_CLAIR_2,JBIG_CLAIR_SIZE;
void jbig_setup(int num1, int num2)
{
JBIG_CLAIR_1=0;
JBIG_CLAIR_2=0;
if((num1>MAX_CONTEXT_SIZE)||(num2>MAX_CONTEXT_SIZE)){
fprintf(stderr,"error: specified context size is larger than the compile time constant.\nThe values '%d' and '%d' should both be <= %d.\n",num1,num2,MAX_CONTEXT_SIZE);
exit(1);
}
if(num1==2){
JBIG_CLAIR_1=2;
jbig_cl1[0].x=-1; jbig_cl1[0].y=0;
jbig_cl1[1].x=0; jbig_cl1[1].y=-1;
} else if(num1==4){
JBIG_CLAIR_1=4;
jbig_cl1[0].x=-1; jbig_cl1[0].y=0;
jbig_cl1[1].x=-1; jbig_cl1[1].y=-1;
jbig_cl1[2].x=0; jbig_cl1[2].y=-1;
jbig_cl1[3].x=1; jbig_cl1[3].y=-1;
} else if(num1==5){
JBIG_CLAIR_1=5;
jbig_cl1[0].x=-2; jbig_cl1[0].y=0;
jbig_cl1[1].x=-1; jbig_cl1[1].y=0;
jbig_cl1[2].x=-1; jbig_cl1[2].y=-1;
jbig_cl1[3].x=0; jbig_cl1[3].y=-1;
jbig_cl1[4].x=1; jbig_cl1[4].y=-1;
} else if(num1==6){
JBIG_CLAIR_1=6;
jbig_cl1[0].x=-2; jbig_cl1[0].y=0;
jbig_cl1[1].x=-1; jbig_cl1[1].y=0;
jbig_cl1[2].x=-1; jbig_cl1[2].y=-1;
jbig_cl1[3].x=0; jbig_cl1[3].y=-1;
jbig_cl1[4].x=1; jbig_cl1[4].y=-1;
jbig_cl1[5].x=0; jbig_cl1[5].y=-2;
} else if(num1==8){
JBIG_CLAIR_1=8;
jbig_cl1[0].x=-3; jbig_cl1[0].y=0;
jbig_cl1[1].x=-2; jbig_cl1[1].y=0;
jbig_cl1[2].x=-1; jbig_cl1[2].y=0;
jbig_cl1[3].x=-2; jbig_cl1[3].y=-1;
jbig_cl1[4].x=-1; jbig_cl1[4].y=-1;
jbig_cl1[5].x=0; jbig_cl1[5].y=-1;
jbig_cl1[6].x=1; jbig_cl1[6].y=-1;
jbig_cl1[7].x=0; jbig_cl1[7].y=-2;
} else {
fprintf(stderr,"error: unknown context size '%d'. Should be 2,4,5,6 or 8.\n",num1);
exit(1);
}
if(num2==5){
JBIG_CLAIR_2=5;
jbig_cl2[1].x=0; jbig_cl2[1].y=-1;
jbig_cl2[0].x=-1; jbig_cl2[0].y=0;
jbig_cl2[4].x=0; jbig_cl2[4].y=0;
jbig_cl2[2].x=1; jbig_cl2[2].y=0;
jbig_cl2[3].x=0; jbig_cl2[3].y=1;
} else if(num2==7) {
JBIG_CLAIR_2=7;
jbig_cl2[0].x=0; jbig_cl2[0].y=-1;
jbig_cl2[1].x=-1; jbig_cl2[1].y=0;
jbig_cl2[2].x=0; jbig_cl2[2].y=0;
jbig_cl2[3].x=1; jbig_cl2[3].y=0;
jbig_cl2[4].x=-1; jbig_cl2[4].y=1;
jbig_cl2[5].x=0; jbig_cl2[5].y=1;
jbig_cl2[6].x=1; jbig_cl2[6].y=1;
} else if(num2==9){
JBIG_CLAIR_2=9;
jbig_cl2[0].x=-1; jbig_cl2[0].y=-1;
jbig_cl2[1].x=0; jbig_cl2[1].y=-1;
jbig_cl2[2].x=1; jbig_cl2[2].y=-1;
jbig_cl2[3].x=-1; jbig_cl2[3].y=0;
jbig_cl2[4].x=0; jbig_cl2[4].y=0;
jbig_cl2[5].x=1; jbig_cl2[5].y=0;
jbig_cl2[6].x=-1; jbig_cl2[6].y=1;
jbig_cl2[7].x=0; jbig_cl2[7].y=1;
jbig_cl2[8].x=1; jbig_cl2[8].y=1;
} else if(num2==13){
JBIG_CLAIR_2=13;
jbig_cl2[0].x=0; jbig_cl2[0].y=-2;
jbig_cl2[1].x=-1; jbig_cl2[1].y=-1;
jbig_cl2[2].x=0; jbig_cl2[2].y=-1;
jbig_cl2[3].x=1; jbig_cl2[3].y=-1;
jbig_cl2[4].x=-2; jbig_cl2[4].y=0;
jbig_cl2[5].x=-1; jbig_cl2[5].y=0;
jbig_cl2[6].x=0; jbig_cl2[6].y=0;
jbig_cl2[7].x=1; jbig_cl2[7].y=0;
jbig_cl2[8].x=2; jbig_cl2[8].y=0;
jbig_cl2[9].x=-1; jbig_cl2[9].y=1;
jbig_cl2[10].x=0; jbig_cl2[10].y=1;
jbig_cl2[11].x=1; jbig_cl2[11].y=1;
jbig_cl2[12].x=0; jbig_cl2[12].y=2;
} else if(num2==15){
JBIG_CLAIR_2=15;
jbig_cl2[0].x=0; jbig_cl2[0].y=-2;
jbig_cl2[1].x=-1; jbig_cl2[1].y=-1;
jbig_cl2[2].x=0; jbig_cl2[2].y=-1;
jbig_cl2[3].x=1; jbig_cl2[3].y=-1;
jbig_cl2[4].x=-2; jbig_cl2[4].y=0;
jbig_cl2[5].x=-1; jbig_cl2[5].y=0;
jbig_cl2[6].x=0; jbig_cl2[6].y=0;
jbig_cl2[7].x=1; jbig_cl2[7].y=0;
jbig_cl2[8].x=2; jbig_cl2[8].y=0;
jbig_cl2[9].x=-2; jbig_cl2[9].y=1;
jbig_cl2[10].x=-1; jbig_cl2[10].y=1;
jbig_cl2[11].x=0; jbig_cl2[11].y=1;
jbig_cl2[12].x=1; jbig_cl2[12].y=1;
jbig_cl2[13].x=2; jbig_cl2[13].y=1;
jbig_cl2[14].x=0; jbig_cl2[14].y=2;
} else if(num2==25){
JBIG_CLAIR_2=25;
jbig_cl2[0].x=0; jbig_cl2[0].y=-3;
jbig_cl2[1].x=-1; jbig_cl2[1].y=-2;
jbig_cl2[2].x=0; jbig_cl2[2].y=-2;
jbig_cl2[3].x=1; jbig_cl2[3].y=-2;
jbig_cl2[4].x=-2; jbig_cl2[4].y=-1;
jbig_cl2[5].x=-1; jbig_cl2[5].y=-1;
jbig_cl2[6].x=0; jbig_cl2[6].y=-1;
jbig_cl2[7].x=1; jbig_cl2[7].y=-1;
jbig_cl2[8].x=2; jbig_cl2[8].y=-1;
jbig_cl2[9].x=-3; jbig_cl2[9].y=0;
jbig_cl2[10].x=-2; jbig_cl2[10].y=0;
jbig_cl2[11].x=-1; jbig_cl2[11].y=0;
jbig_cl2[12].x=0; jbig_cl2[12].y=0;
jbig_cl2[13].x=1; jbig_cl2[13].y=0;
jbig_cl2[14].x=2; jbig_cl2[14].y=0;
jbig_cl2[15].x=3; jbig_cl2[15].y=0;
jbig_cl2[16].x=-2; jbig_cl2[16].y=1;
jbig_cl2[17].x=-1; jbig_cl2[17].y=1;
jbig_cl2[18].x=0; jbig_cl2[18].y=1;
jbig_cl2[19].x=1; jbig_cl2[19].y=1;
jbig_cl2[20].x=2; jbig_cl2[20].y=1;
jbig_cl2[21].x=-1; jbig_cl2[21].y=2;
jbig_cl2[22].x=0; jbig_cl2[22].y=2;
jbig_cl2[23].x=1; jbig_cl2[23].y=2;
jbig_cl2[24].x=0; jbig_cl2[24].y=3;
} else {
fprintf(stderr,"error: unknown context size '%d'. Should be 5,7,9,13,15 or 25.\n",num2);
exit(1);
}
JBIG_CLAIR_SIZE=JBIG_CLAIR_1+JBIG_CLAIR_2;
assert(JBIG_CLAIR_1>0);
assert(JBIG_CLAIR_2>0);
assert(JBIG_CLAIR_SIZE>2);
}
#define DO_HASH
#ifdef DO_HASH
#define HASH(x) (((x^(((x+(x&7))*713))))%1047551)
#define MAXVALUE (1047551)
#else
#define HASH(x) (x)
#endif
void
context_init(contexttype *c, int size)
{
assert(c);
assert(size>=1);
jbig_setup(globals.g_num1, globals.g_num2);
c->size=size;
#ifdef DO_HASH
c->max_value=MAXVALUE;
#else
c->max_value=ROUND(pow((double)CONTEXT_BITS,(double)size));
#endif
c->p=(probtype*)calloc(c->max_value,sizeof(probtype));
assert(c->p);
context_clear(c);
}
void
context_free(contexttype *c)
{
assert(c);
if(c->p)
free(c->p);
c->p=NULL;
}
void
context_clear(contexttype *c)
{
int i;
assert(c);
for(i=0;i<c->max_value;i++)
c->p[i].w = c->p[i].b=globals.g_context_init;
}
void
context_update(contexttype *c, int mask, int pixel)
{
assert(c);
assert(mask>=0);
assert(mask<c->max_value);
assert((pixel==0)||(pixel==1));
if(pixel){
c->p[mask].b+=globals.g_context_increment;
} else {
c->p[mask].w+=globals.g_context_increment;
}
if((c->p[mask].b + c->p[mask].w) > globals.g_context_norm){
c->p[mask].b=(c->p[mask].b+1)/2;
c->p[mask].w=(c->p[mask].w+1)/2;
}
}
void
context_encode(contexttype *c, int mask, int p)
{
assert(c);
assert((mask>=0) && (mask<c->max_value));
assert((p==0)||(p==1));
binary_arithmetic_encode(c->p[mask].w, c->p[mask].b, p);
}
float
context_prob(contexttype *c, int mask, int p)
{
float f;
assert(c);
assert((mask>=0) && (mask<c->max_value));
assert((p==0) || (p==1));
if(p){
f=(c->p[mask].b)/(1.0*(c->p[mask].b+c->p[mask].w));
} else {
f=(c->p[mask].w)/(1.0*(c->p[mask].b+c->p[mask].w));
}
return f;
}
int
context_decode(contexttype *c, int mask)
{
int p;
assert(c);
assert((mask>=0) && (mask<c->max_value));
p=binary_arithmetic_decode(c->p[mask].w, c->p[mask].b);
return p;
}
int
jbig_mask(marktype *m,int x, int y)
{
static int i,p, ti,tj;
static long long mask;
assert(m);
mask=0;
for(i=0;i<JBIG_SIZE;i++){
ti=x+jbig[i].x;
tj=y+jbig[i].y;
if((tj<0)||(ti<0)||(ti>=m->w)||(tj>=m->h))
#ifdef BINARY
p=0;
#else
p=CONTEXT_BITS-1;
#endif
else
p=pbm_getpixel((m->bitmap),ti,tj);
mask=CONTEXT_BITS*mask + p;
}
return HASH(mask);
}
int
jbig_mask_clair(marktype *m,marktype *clair,
int xc_off,int yc_off,
int x, int y)
{
static int i,ti,tj, p;
static long long mask;
assert(m);
assert(clair);
mask=0;
for(i=0;i<JBIG_CLAIR_1;i++){
ti=x+jbig_cl1[i].x;
tj=y+jbig_cl1[i].y;
if((tj<0)||(ti<0)||(ti>=m->w)||(tj>=m->h))
#ifdef BINARY
p=0;
#else
p=CONTEXT_BITS-1;
#endif
else
p=pbm_getpixel((m->bitmap),ti,tj);
mask=CONTEXT_BITS*mask + p;
}
for(i=0;i<JBIG_CLAIR_2;i++){
ti=x+jbig_cl2[i].x-xc_off;
tj=y+jbig_cl2[i].y-yc_off;
if((tj<0)||(ti<0)||(ti>=clair->w)||(tj>=clair->h))
#ifdef BINARY
p=0;
#else
p=CONTEXT_BITS-1;
#endif
else
p=pbm_getpixel((clair->bitmap),ti,tj);
mask=CONTEXT_BITS*mask + p;
}
return HASH(mask);
}
void
compress_mark(contexttype *con, marktype *m, int st)
{
int i,j;
int mask,p;
assert(con);
assert(m);
for(j=0;j<m->h;j++){
for(i=0;i<m->w;i++){
mask=jbig_mask(m,i,j);
p=pbm_getpixel((m->bitmap),i,j);
if(st==COMPRESS)
context_encode(con,mask,p);
#ifndef Q_CODER
context_update(con,mask,p);
#endif
}
}
}
void
compress_mark_clair(contexttype *con, marktype *m, marktype *cl,
int xco, int yco,
int st)
{
int i,j;
int mask,p;
assert(con);
assert(m);
assert(cl);
for(j=0;j<m->h;j++){
for(i=0;i<m->w;i++){
mask=jbig_mask_clair(m,cl,xco,yco,i,j);
p=pbm_getpixel((m->bitmap),i,j);
if(st==COMPRESS)
context_encode(con,mask,p);
#ifndef Q_CODER
context_update(con,mask,p);
#endif
}
}
}
void
decompress_mark(contexttype *con, marktype *m, int w,int h)
{
int i,j;
int mask,p;
assert(con);
assert(m);
marktype_alloc(m,w,h);
for(j=0;j<m->h;j++){
for(i=0;i<m->w;i++){
mask=jbig_mask(m,i,j);
p=context_decode(con,mask);
pbm_putpixel((m->bitmap),i,j,p);
#ifndef Q_CODER
context_update(con,mask,p);
#endif
}
}
}
void
decompress_mark_clair(contexttype *con, marktype *m, marktype *cl,
int w,int h,
int xco, int yco)
{
int i,j;
int mask,p;
assert(con);
assert(m);
assert(cl);
marktype_alloc(m,w,h);
for(j=0;j<m->h;j++){
for(i=0;i<m->w;i++){
mask=jbig_mask_clair(m,cl,xco,yco,i,j);
p=context_decode(con,mask);
pbm_putpixel((m->bitmap),i,j,p);
#ifndef Q_CODER
context_update(con,mask,p);
#endif
}
}
}
|
Added work/contrib/tic/tic98/context.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
#ifndef _CONTEXT_H
#define _CONTEXT_H
#define UPDATE 1
#define COMPRESS 0
#define DECOMPRESS 0
/* the number of choices available for each position in the context. For a
black and white context CONTEXT_BITS would be 2, but if we wanted to
represent a value of "MISSING" as well, CONTEXT_BITS would be 3. */
/*#define BINARY*/
#undef BINARY
#ifdef BINARY
#define CONTEXT_BITS 2
#else
#define CONTEXT_BITS 3
#endif
/* the number of bits for the standard JBIG template */
#define JBIG_SIZE 10
#define MAX_CONTEXT_SIZE 30
extern int JBIG_CLAIR_1;
extern int JBIG_CLAIR_2;
extern int JBIG_CLAIR_SIZE;
typedef struct {
int w,b;
} probtype;
typedef struct {
int size;
int max_value;
probtype *p;
} contexttype;
typedef struct {
int x,y;
} coordinate;
void context_init(contexttype *c, int size);
void context_free(contexttype *c);
void context_update(contexttype *c, int mask, int w);
void context_encode(contexttype *c, int mask, int p);
float context_prob(contexttype *c, int mask, int p);
int context_decode(contexttype *c, int mask);
void context_clear(contexttype *c);
int jbig_mask(marktype *m,int x, int y);
int jbig_mask_clair(marktype *m,marktype *clair,int xo,int yo,int x, int y);
void compress_mark(contexttype *con, marktype *m, int st);
void compress_mark_clair(contexttype *con, marktype *m, marktype *cl,
int xco, int yco, int st) ;
void decompress_mark(contexttype *con, marktype *m, int w,int h);
void decompress_mark_clair(contexttype *con, marktype *m, marktype *cl,
int w,int h,int xco, int yco);
#endif
|
Added work/contrib/tic/tic98/coords_baird.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
/*****************************************************************************
*
* Author: Stuart Inglis <singlis@waikato.ac.nz>
*
*
*****************************************************************************/
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include "getopt.h"
#include "marklist.h"
#include "pbmtools.h"
#include "boundary.h"
#include "utils.h"
#ifndef PI
#define PI 3.14159265
#endif
void rot(double *x, double *y, const double theta,
const double cx, const double cy)
{
double xx,yy;
*x-=cx;
*y-=cy;
xx=(*x)*cos(theta) + (*y)*sin(theta);
yy=-(*x)*sin(theta) + (*y)*cos(theta);
*x=xx+cx;
*y=yy+cy;
}
void
usage()
{
fprintf(stderr,
"usage:\n"
"\tcoords_profile x y < coords > profile \n"
"\n"
"\tThe coordinates are stored in two columns. The first\n"
"\tline of the file contains the width/height of the image\n"
"\tand the number of components. ie. <w> <h> <n>\n"
);
exit(1);
}
int width=0,height=0,num=0;
float *x_ary=NULL;
float *y_ary=NULL;
int
read_coord_file(int x_col, int y_col)
{
int i,err;
float a[8];
char line[100];
x_col--;
y_col--;
assert(x_col>=0 && x_col<=7);
assert(y_col>=0 && y_col<=7);
fgets(line,100,stdin);
sscanf(line,"%d %d %d\n",&width,&height,&num);
if(num){
x_ary=(float*)calloc(num,sizeof(float));
assert(x_ary);
y_ary=(float*)calloc(num,sizeof(float));
assert(y_ary);
}
for(i=0;i<num;i++){
err=scanf("%f %f %f %f %f %f %f %f\n",&a[0],&a[1],&a[2],&a[3],&a[4],&a[5],&a[6],&a[7]);
assert(err==8);
x_ary[i]=a[x_col];
y_ary[i]=a[y_col];
}
}
int
main(int argc, char *argv[])
{
int ch;
marklistptr list=NULL,step=NULL;
marktype image;
char *infile=NULL;
int conn=8;
int nested=1;
double a,x,y;
double tot;
int i,p;
int hist[10000];
if(argc<3) usage();
read_coord_file(atoi(argv[1]), atoi(argv[2]));
for(a=-10 ; a<=10 ; a+=0.1){
for(i=0;i<10000;i++)
hist[i]=0;
for(i=0;i<num;i++){
x=x_ary[i];
/* the origin is at the top */
y=height-1-y_ary[i];
rot(&x,&y,DEG2RAD(a),width/2.0,height/2.0);
p=height+(int)(y);
assert(p>=0 && p<10000);
hist[p]++;
}
tot=0;
for(i=0;i<10000;i++){
tot += (hist[i]*1.0 * hist[i]);
}
fprintf(stdout,"%f %f\n",a,tot);
}
exit(0);
}
|
Added work/contrib/tic/tic98/coords_docstrum.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
/*****************************************************************************
*
* Author: Stuart Inglis <singlis@waikato.ac.nz>
*
*
*****************************************************************************/
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include "getopt.h"
#include "marklist.h"
#include "pbmtools.h"
#include "boundary.h"
#include "utils.h"
#include "docstrum.h"
#ifndef PI
#define PI 3.14159265
#endif
void rot(double *x, double *y, const double theta,
const double cx, const double cy)
{
double xx,yy;
*x-=cx;
*y-=cy;
xx=(*x)*cos(theta) + (*y)*sin(theta);
yy=-(*x)*sin(theta) + (*y)*cos(theta);
*x=xx+cx;
*y=yy+cy;
}
void
usage()
{
fprintf(stderr,
"usage:\n"
"\tcoords_profile x y < coords > profile \n"
"\n"
"\tThe coordinates are stored in two columns. The first\n"
"\tline of the file contains the width/height of the image\n"
"\tand the number of components. ie. <w> <h> <n>\n"
);
exit(1);
}
int width=0,height=0,num=0;
float *x_ary=NULL;
float *y_ary=NULL;
marklistptr
read_coord_file(int x_col, int y_col)
{
int i,err;
float a[8];
marklistptr list=NULL;
marktype d;
char line[100];
marktype_init(&d);
x_col--;
y_col--;
assert(x_col>=0 && x_col<=6);
assert(y_col>=0 && y_col<=6);
fgets(line,100,stdin);
sscanf(line,"%d %d %d\n",&width,&height,&num);
if(num){
x_ary=(float*)calloc(num,sizeof(float));
assert(x_ary);
y_ary=(float*)calloc(num,sizeof(float));
assert(y_ary);
}
for(i=0;i<num;i++){
err=scanf("%f %f %f %f %f %f %f %f\n",&a[0],&a[1],&a[2],&a[3],&a[4],&a[5],&a[6],&a[7]);
d.symnum=i;
d.xpos=a[2];
d.w=a[3]-a[2]+1;
d.xcen=a[2]-a[1];
d.ypos=a[5];
d.h=a[6]-a[5]+1;
d.ycen=a[5]-a[4];
d.set=a[7];
marklist_add(&list,d);
assert(err==8);
x_ary[i]=a[x_col];
y_ary[i]=a[y_col];
}
return list;
}
int
main(int argc, char *argv[])
{
int ch;
marklistptr list=NULL,step=NULL;
marktype image;
char *infile=NULL;
int conn=8;
int nested=1;
double a,x,y;
double tot;
int i,p;
int hist[10000];
double skew;
neighbourtype * neighs;
int ret;
if(argc<3) usage();
list=read_coord_file(atoi(argv[1]), atoi(argv[2]));
calc_docstrum_list(list,&skew,300);
fprintf(stdout,"%f\n",skew);
exit(0);
}
|
Added work/contrib/tic/tic98/coords_profile.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
/*****************************************************************************
*
* Author: Stuart Inglis <singlis@waikato.ac.nz>
*
*
*****************************************************************************/
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include "getopt.h"
#include "marklist.h"
#include "pbmtools.h"
#include "boundary.h"
#include "utils.h"
void
usage()
{
fprintf(stderr,
"usage:\n"
"\tcoords_profile x y < coords > profile \n"
"\n"
"\tThe coordinates are stored in two columns. The first\n"
"\tline of the file contains the width/height of the image\n"
"\tand the number of components. ie. <w> <h> <n>\n"
);
exit(1);
}
int width=0,height=0,num=0;
float *x_ary=NULL;
float *y_ary=NULL;
int
read_coord_file(int x_col, int y_col)
{
int i,err;
float a[7];
x_col--;
y_col--;
assert(x_col>=0 && x_col<=6);
assert(y_col>=0 && y_col<=6);
scanf("%d %d %d\n",&width,&height,&num);
if(num){
x_ary=(float*)calloc(num,sizeof(float));
assert(x_ary);
y_ary=(float*)calloc(num,sizeof(float));
assert(y_ary);
}
for(i=0;i<num;i++){
err=scanf("%f %f %f %f %f %f %f\n",&a[0],&a[1],&a[2],&a[3],&a[4],&a[5],&a[6]);
assert(err==7);
x_ary[i]=a[x_col];
y_ary[i]=a[y_col];
printf("%f %f\n",x_ary[i],y_ary[i]);
}
}
int
main(int argc, char *argv[])
{
int ch;
marklistptr list=NULL,step=NULL;
marktype image;
char *infile=NULL;
int conn=8;
int nested=1;
if(argc<3) usage();
read_coord_file(atoi(argv[1]), atoi(argv[2]));
exit(0);
}
|
Added work/contrib/tic/tic98/docstrum.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
|
/*
* Module: docstrum
*
* Implements a k-nearest neighbour method for calculating
* skew. Usually we use k=5, and perform a polar integration
* apply a wide smoothing filter.
*
*
* Author:
* Stuart Inglis (singlis@internz.co.nz)
* (c) 1998
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <assert.h>
#include <string.h>
#include "boundary.h"
#include "marklist.h"
#include "windowing.h"
#include "docstrum.h"
#include "sort_lines.h"
#include "globals.h"
typedef struct {
int marknum;
double x,y;
} pairtype;
#ifndef DBL_MAX
#define DBL_MAX 9e9
#endif
/*
returns between -pi and +pi, ie. [-180 to +180)
| +pi/2 (90)
|
|
|
-180 -----------+------------- 0
(-pi) |
|
|
| -pi/2 (-90)
to normalise between [-90, 90),
if(ang>90) ang=ang-180;
else if (ang<-90) ang=ang+180;
*/
static double
atan_xy(double yd, double xd)
{
double angle;
angle=atan2(yd,xd); /* returns a result between (-PI, PI] */
while(angle>=PI)
angle=angle-2*PI;/* now returns a result between [-PI, PI) */
/* assert((angle>=-PI) && (angle<PI));*/
return angle;
}
static int
compare(const void *e1, const void *e2)
{
if ( ((pairtype*)e1)->x < ((pairtype*)e2)->x )
return -1;
else if ( ((pairtype*)e1)->x > ((pairtype*)e2)->x )
return 1;
else return 0;
}
static void
neighbours_free(neighbourtype *ary, int number_marks)
{
if(ary){
int i;
for(i=0;i<number_marks;i++)
FREE(ary[i].neighs);
FREE(ary);
}
}
/*
**
**
**
**
**
*/
static neighbourtype *
calc_k_neighbours(marklistptr list, int k)
{
marklistptr step;
int number_marks,marknum,i;
double *NNx,*NNy,*NNdist;
int *NNnum;
double xd,yd;
int idx;
pairtype *biglist;
neighbourtype *ary;
marktype temp;
marklistptr *fastaccess;
number_marks=marklist_length(list);
if(number_marks==0){
return NULL;
}
CALLOC(fastaccess,number_marks,marklistptr);
for(idx=0,step=list;step;step=step->next,idx++){
fastaccess[idx]=step;
}
/* allocate the array that we will return */
CALLOC(ary,number_marks,neighbourtype);
for(i=0;i<number_marks;i++)
CALLOC(ary[i].neighs,k,neighbourlisttype);
/* then alloc temp arrays */
CALLOC(NNx,k,double);
CALLOC(NNy,k,double);
CALLOC(NNdist,k,double);
CALLOC(NNnum,k,int);
CALLOC(biglist,number_marks,pairtype);
for(step=list,idx=0; step; step=step->next,idx++){
biglist[idx].marknum=idx;
biglist[idx].x=step->data.xpos+step->data.d_xcen;
biglist[idx].y=step->data.ypos+step->data.d_ycen;
}
qsort((void*)biglist,(unsigned int)number_marks,sizeof(pairtype),compare);
for(marknum=0;marknum<number_marks;marknum++) {
int up,down,xpos,ypos,j;
double dist;
/*if((marknum%100)==0)fprintf(stderr,"%d\r",marknum);*/
xpos=(int)biglist[marknum].x;
ypos=(int)biglist[marknum].y;
/* NNdist[0] is the closest, NNdist[k-1] is far away */
for(i=0;i<k;i++){
NNdist[i]=NNx[i]=NNy[i]=DBL_MAX;
NNnum[i]=-1;
}
down=marknum-1;
up=marknum+1;
while((down>=0) || (up<number_marks)){
if(down>=0){
xd=(biglist[down].x-xpos);
yd=(biglist[down].y-ypos);
dist=sqrt(xd*xd+yd*yd);
if(fabs(xd)>NNdist[k-1]) down=0;
else if(dist<NNdist[k-1]) {
i=0;
while((dist>NNdist[i])&&(i<(k-1))) i++;
/* add at i'th position */
for(j=k-2;j>=i;j--){
NNdist[j+1]=NNdist[j];
NNx[j+1]=NNx[j];
NNy[j+1]=NNy[j];
NNnum[j+1]=NNnum[j];
}
NNdist[i]=(dist); /* actually store here */
NNx[i]=xd;
NNy[i]=yd;
NNnum[i]=down;
}
down--;
}
if(up<number_marks){
xd=(biglist[up].x-xpos);
yd=(biglist[up].y-ypos);
dist=sqrt(xd*xd+yd*yd);
if(fabs(xd)>NNdist[k-1]) up=number_marks;
else if(dist<NNdist[k-1]) {
i=0;
while((dist>NNdist[i])&&(i<(k-1))) i++;
/* add at i'th position */
for(j=k-2;j>=i;j--){
NNdist[j+1]=NNdist[j];
NNx[j+1]=NNx[j];
NNy[j+1]=NNy[j];
NNnum[j+1]=NNnum[j];
}
NNdist[i]=(dist); /* actually store here */
NNx[i]=xd;
NNy[i]=yd;
NNnum[i]=up;
}
up++;
}
}
ary[marknum].num=biglist[marknum].marknum;
temp=fastaccess[ary[marknum].num]->data;
ary[marknum].x=temp.xpos+temp.d_xcen;
ary[marknum].y=temp.ypos+temp.d_ycen;
ary[marknum].num_neighs=0;
for(i=0;i<k;i++) if (NNnum[i]>=0) {
ary[marknum].num_neighs++;
ary[marknum].neighs[i].xd=NNx[i];
ary[marknum].neighs[i].yd=NNy[i];
ary[marknum].neighs[i].num=NNnum[i];
}
}
FREE(NNnum);
FREE(NNx);
FREE(NNy);
FREE(NNdist);
FREE(biglist);
FREE(fastaccess);
/* finished with all the marks */
return ary;
}
/*
* calc_docstrum_using_neighs()
*
* Returns 0 if successful, otherwise 1.
*
*/
static int
calc_docstrum_using_neighs(marklistptr list,
neighbourtype *neighs,
double *skew)
{
double *hist=NULL;
int number_marks,i,j;
double xd,yd;
double ang;
int idx,ret;
double maxp,dist;
double maxval;
int marknum;
double SCALE=0.1;
double lowrange=-90;
double highrange=90;
double SM_SIZE=10; /* size of the smoothing filter in degrees */
FILE *fp=NULL;
/*fp=fopen("docstrum.data","wb");
if(!fp) {
fprintf(stderr,"Failing to open: 'docstrum'\n");fp=NULL;
}*/
if(neighs==NULL){
*skew=0;
return 1;
}
CALLOC(hist,ROUND(180/SCALE)+1,double);
number_marks=marklist_length(list);
/* found the k nearest neighbours */
for(marknum=0;marknum<number_marks;marknum++){
for(i=0;i<neighs[marknum].num_neighs;i++){
xd=neighs[marknum].neighs[i].xd;
yd=neighs[marknum].neighs[i].yd;
dist=sqrt(xd*xd+yd*yd);
if(fp)fprintf(fp,"%g %g\n",xd,-yd);
ang=atan_xy(-yd,xd); /* -yd as the original is at the top */
ang=RAD2DEG(ang);
if(ang>=90) ang=ang-180;
else if (ang<-90) ang=ang+180; /* normalise between [-90,90) */
{
idx=ROUND((ang/SCALE) +90/SCALE);
idx=idx%(ROUND(180/SCALE));
assert(idx>=0);
assert(idx<(ROUND(180/SCALE)));
hist[idx]+=1.0;
}
}
}
if(fp)fclose(fp);
/* smooth the NN angle histogram */
if(SM_SIZE>0) {
double *newhist=NULL;
double *filt=NULL;
int filtsize;
/* write_window_labelled("hist.orig",hist,0,ROUND(180/SCALE)-1,-90.0,90.0,SCALE);*/
CALLOC(newhist,ROUND(180/SCALE)+1,double);
filtsize=ROUND(SM_SIZE/SCALE);
if((filtsize%2)==0) filtsize++; /* so it's odd */
CALLOC(filt,filtsize,double);
create_window(filt,filtsize,HAMMING);
convolve(hist,0,ROUND(180/SCALE)-1, filt, filtsize, filtsize/2, newhist, CYCLIC);
FREE(filt);
for(i=0;i<ROUND(180/SCALE);i++)
hist[i]=newhist[i]/filtsize;
FREE(newhist);
/*write_window_labelled("histogram.data",hist,0,ROUND(180/SCALE)-1,-90.0,90.0,SCALE);*/
}
maxp=maxval=-1;
for(i=ROUND(lowrange/SCALE);i<ROUND(highrange/SCALE);i++){
j=i+ROUND(90/SCALE);
if(hist[j]>maxval) {maxval=hist[j]; maxp=i;}
}
/* found maxval, now average all points with this value */
maxp=0;j=0;
for(i=ROUND(lowrange/SCALE);i<ROUND(highrange/SCALE);i++){
if(hist[i+ROUND(90/SCALE)]==maxval) {maxp+=i;j++;}
}
maxp/=j;
maxp=maxp*SCALE;
FREE(hist);
/* was the peak high enough?, values around 1 are for
* very small bitmaps. */
if(maxval<0.7){
*skew=0;
ret=1;
} else {
*skew=maxp;
ret=0;
}
return ret;
}
double
calc_docstrum_spacing(marklistptr list,
neighbourtype *neighs,
double orientation,
double *spacing_within,
double *spacing_between
)
{
double *hist_between=NULL;
double *hist_within=NULL;
int marknum,number_marks;
double xd,yd;
double ang;
int i;
double orientation_perp;
double dist;
if(0)fprintf(stderr,"calc_docstrum_spacing\n");
orientation_perp=orientation;
if(orientation_perp>=0) orientation_perp-=90;
else orientation_perp+=90;
CALLOC(hist_between,200,double);
CALLOC(hist_within,200,double);
number_marks=marklist_length(list);
/* found the k nearest neighbours */
for(marknum=0;marknum<number_marks;marknum++){
for(i=0;i<neighs[marknum].num_neighs;i++){
xd=neighs[marknum].neighs[i].xd;
yd=neighs[marknum].neighs[i].yd;
dist=sqrt(xd*xd+yd*yd);
ang=atan_xy(-yd,xd); /* bitmaps have 0 at top */
ang=RAD2DEG(ang);
if(ang>=90) ang-=180;
else if (ang<-90) ang+=180; /* normalise between [-90,90) */
if( (fabs(ang-orientation)<=30) ) {
if(ROUND(dist)<200)
hist_within[ROUND(dist)]+=1.0;
}
/* perpendicular */
if(fabs(ang-orientation_perp)<=30) {
if(ROUND(dist)<200)
hist_between[ROUND(dist)]+=1.0;
}
}
}
/* smooth the hist_between */
{ double *newhist=NULL;
double *filt;
int filtsize;
if(0)fprintf(stderr,"windowing histogram_between\n");
CALLOC(newhist,200,double);
filtsize=11;
CALLOC(filt,filtsize,double);
create_window(filt,filtsize,RECTANGULAR);
convolve(hist_between,0,199, filt, filtsize, filtsize/2, newhist, 0);
FREE(filt);
for(i=0;i<200;i++)
hist_between[i]=newhist[i];
FREE(newhist);
}
/* smooth the hist_within */
{ double *newhist=NULL;
double *filt;
int filtsize;
if(0)fprintf(stderr,"windowing histogram_within\n");
CALLOC(newhist,200,double);
filtsize=11;
CALLOC(filt,filtsize,double);
create_window(filt,filtsize,RECTANGULAR);
convolve(hist_within,0,199, filt, filtsize, filtsize/2, newhist, 0);
FREE(filt);
for(i=0;i<200;i++)
hist_within[i]=newhist[i];
/* write_window_labelled("hist_within",hist_within,0,199,0,199,1);*/
FREE(newhist);
}
{ double maxval,maxp;
int j;
maxp=0;
maxval=hist_within[0];
for(i=0;i<200;i++)
if(hist_within[i]>maxval) {maxval=hist_within[i]; maxp=i;}
/* found maxval, now average all points with this value */
maxp=0;j=0;
for(i=0;i<200;i++)
if(hist_within[i]==maxval) {maxp+=i;j++;}
maxp/=j;
*spacing_within=maxp;
maxp=0;
maxval=hist_between[0];
for(i=0;i<200;i++)
if(hist_between[i]>maxval) {maxval=hist_between[i]; maxp=i;}
/* found maxval, now average all points with this value */
maxp=0;j=0;
for(i=0;i<200;i++)
if(hist_between[i]==maxval) {maxp+=i;j++;}
maxp/=j;
*spacing_between=maxp;
}
FREE(hist_between);
FREE(hist_within);
return 0;
}
void
prune_neighbours_angle_distance(neighbourtype *neighs,
int number_marks,
double orientation,
double orient_threshold,
double lesser)
{
int i;
double xd,yd,dist,ang;
int marknum;
for(marknum=0;marknum<number_marks;marknum++)
for(i=0;i<neighs[marknum].num_neighs;i++){
xd=neighs[marknum].neighs[i].xd;
yd=neighs[marknum].neighs[i].yd;
dist=sqrt(xd*xd+yd*yd);
ang=atan_xy(-yd,xd); /* bitmaps have 0 at top */
ang=RAD2DEG(ang);
if(ang>=90) ang-=180;
else if (ang<-90) ang+=180; /* normalise between [-90,90) */
if(!( (fabs(ang-orientation)<=orient_threshold) && (dist<=lesser))) {
neighs[marknum].neighs[i].xd=
neighs[marknum].neighs[i].yd=0.0;
neighs[marknum].neighs[i].num=-1;
}
}
/* pack the links we've removed */
for(marknum=0;marknum<number_marks;marknum++){
int cc,num_n;
cc=0;
for(i=0;i<neighs[marknum].num_neighs;i++)
if(neighs[marknum].neighs[i].num>=0)
cc++;
if(cc!=neighs[marknum].num_neighs){
num_n=neighs[marknum].num_neighs;
neighs[marknum].num_neighs=0;
for(i=0;i<num_n;i++)
if(neighs[marknum].neighs[i].num>=0){
neighs[marknum].neighs[ neighs[marknum].num_neighs]=neighs[marknum].neighs[i];
neighs[marknum].num_neighs++;
}
}
}
}
void
prune_neighbours_distance(neighbourtype *neighs,
int number_marks,
double distance)
{
int i;
double xd,yd,dist,ang;
int marknum;
for(marknum=0;marknum<number_marks;marknum++)
for(i=0;i<neighs[marknum].num_neighs;i++){
xd=neighs[marknum].neighs[i].xd;
yd=neighs[marknum].neighs[i].yd;
dist=sqrt(xd*xd+yd*yd);
ang=atan_xy(-yd,xd); /* bitmaps have 0 at top */
ang=RAD2DEG(ang);
if(ang>=90) ang-=180;
else if (ang<-90) ang+=180; /* normalise between [-90,90) */
if(dist>distance){
neighs[marknum].neighs[i].xd=
neighs[marknum].neighs[i].yd=0.0;
neighs[marknum].neighs[i].num=-1;
}
}
/* pack the links we've removed */
for(marknum=0;marknum<number_marks;marknum++){
int cc,num_n;
cc=0;
for(i=0;i<neighs[marknum].num_neighs;i++)
if(neighs[marknum].neighs[i].num>=0)
cc++;
if(cc!=neighs[marknum].num_neighs){
num_n=neighs[marknum].num_neighs;
neighs[marknum].num_neighs=0;
for(i=0;i<num_n;i++)
if(neighs[marknum].neighs[i].num>=0){
neighs[marknum].neighs[ neighs[marknum].num_neighs]=neighs[marknum].neighs[i];
neighs[marknum].num_neighs++;
}
}
}
}
static void
view_connections(marktype image,
neighbourtype *neighs,
int num)
{
int i,j;
assert(neighs);
for(i=0;i<num;i++){
for(j=0;j<neighs[i].num_neighs;j++){
marktype_line(image,
ROUND(neighs[i].x),
ROUND(neighs[i].y),
ROUND(neighs[i].x+ neighs[i].neighs[j].xd),
ROUND(neighs[i].y+ neighs[i].neighs[j].yd));
}
}
}
int
calc_docstrum_list(marklistptr list, double *skew, int resolution)
{
neighbourtype * neighs;
int ret;
int len;
/* prune under 0.5 mm^2 */
marklist_prune_under_area (&list,DEFAULT_MIN_AREA,resolution);
len=marklist_length(list);
neighs=calc_k_neighbours(list,DEFAULT_K);
{
marktype im;
double an,within,between;
int numgroups;
calc_docstrum_spacing(list,neighs,0,&within,&between);
prune_neighbours_distance(neighs,len, 3*between);
#ifdef 0
prune_neighbours_angle_distance(neighs,len, 0,30, 6*within/*MIN(6*within,sqrt(2.0)*between)*/);
#endif
/*
marklist_reconstruct(list,&im);
view_connections(im,neighs,len);
marktype_writenamed("b.pbm",im);
fprintf(stderr,"written\n");
marktype_free(&im);
*/
cluster_into_groups(neighs,len,&numgroups);
/*
marklist_reconstruct(list,&im);
view_connections_groups(im,neighs,len,numgroups);
marktype_writenamed("c.pbm",im);
fprintf(stderr,"written\n");
marktype_free(&im);
*/
}
ret=calc_docstrum_using_neighs(list,neighs,skew);
neighbours_free(neighs,len);
return ret;
}
marklistptr
docstrum_order(marklistptr list)
{
neighbourtype * neighs;
int len;
marktype im;
double an,within,between;
int numgroups;
marklistptr ret=NULL;
double skew;
len=marklist_length(list);
neighs=calc_k_neighbours(list,DEFAULT_K);
calc_docstrum_using_neighs(list,neighs,&skew);
/*fprintf(stderr,"skew: %.2f\n",skew);*/
skew=RAD2DEG(globals.g_skew);
calc_docstrum_spacing(list,neighs,skew,&within,&between);
/* prune_neighbours_angle_distance(neighs,len, 0,45, MIN(3*within,sqrt(2.0)*between));*/
/* this was ~around 3.0*within for docstrum experiment... damn I forgot..*/
/* if((globals.g_dump_zones==0)){*/
prune_neighbours_distance(neighs,len, 5*within);
/* }*/
/*
marklist_reconstruct(list,&im);
view_connections(im,neighs,len);
marktype_writenamed("b.pbm",im);
fprintf(stderr,"written\n");
marktype_free(&im);
*/
cluster_into_groups(neighs,len,&numgroups);
/*
marklist_reconstruct(list,&im);
view_connections_groups(im,neighs,len,numgroups);
marktype_writenamed("c.pbm",im);
fprintf(stderr,"written\n");
marktype_free(&im);
*/
ret=groups_to_marklist(list,neighs,len,numgroups, skew, within);
neighbours_free(neighs,len);
return ret;
}
int
calc_docstrum(marktype *image, double *skew)
{
marklistptr list=NULL;
marktype copy;
int ret;
copy=marktype_copy(*image);
list=extract_all_marks(list,copy,1,8);
marktype_free(©);
if(image->resolution==0)
image->resolution=300; /* defaults to 300 dpi */
ret=calc_docstrum_list(list,skew,image->resolution);
marklist_free(&list);
return ret;
}
void
cluster_into_groups(neighbourtype *neighs,
const int number_marks,
int *numgroups)
{
int marknum;
/* set all the group numbers to -1 */
for(marknum=0;marknum<number_marks;marknum++)
neighs[marknum].group=-1;
/* transitively label all the groups, starting from 0 */
*numgroups=0;
for(marknum=0;marknum<number_marks;marknum++){
/* if(neighs[marknum].group<0)*/{
if(label_group(neighs,marknum,(*numgroups),number_marks))
(*numgroups)++;
}
}
/* pack the groups */
pack_groups(neighs,numgroups,number_marks);
for(marknum=0;marknum<number_marks;marknum++)
assert(neighs[marknum].group>=0);
}
int
label_group(neighbourtype *neighs,
const int marknum,
const int currentgroup,
const int total)
{
int i,j;
int linknum,linkgroup;
int ret=0;
if(neighs[marknum].num_neighs<=0) {
neighs[marknum].group=currentgroup;
ret=1;
return ret;
}
if(neighs[marknum].group<0){
neighs[marknum].group=(currentgroup);
ret=1;
for(i=0;i<neighs[marknum].num_neighs;i++){
linknum=neighs[marknum].neighs[i].num;
linkgroup=neighs[linknum].group;
if(linkgroup==currentgroup)
continue; /* don't need to worry */
if(linkgroup>=0){
/* if link was already set, but they are different */
/* setting all previous values of 'linkgroup' to 'currentgroup' */
for(j=0;j<total;j++)
if(neighs[j].group==linkgroup)
neighs[j].group=currentgroup;
}
else
label_group(neighs,linknum, currentgroup, total);
}
}
return ret;
}
void
pack_groups(neighbourtype *neighs,
int *num_groups,
const int total
)
{
int *counts;
int new_num=0,new_count=0;
int i,k;
if((num_groups==NULL) || (*num_groups<1)){
return;
}
CALLOC(counts,(*num_groups),int);
for(i=0;i<*num_groups;i++){
counts[i]=dump_group(neighs,i,total);
if(counts[i]!=0) new_num++;
}
for(i=0;i<*num_groups;i++) if((counts[i]!=0)){
if(i!=new_count)
for(k=0;k<total;k++)
if(neighs[k].group==i)
neighs[k].group=new_count;
new_count++;
}
FREE(counts);
*num_groups=new_num;
}
int
dump_group(const neighbourtype *neighs,
const int currentgroup,
const int total)
{
int i,count=0;
for(i=0;i<total;i++)
if(neighs[i].group==currentgroup) count++;
return count;
}
void
group_reset_classifications(marklistptr list)
{
marklistptr step;
for(step=list; step; step=step->next)
step->data.grp=-1;
}
/* does NOT allocate any memory */
void
group_bounds(const neighbourtype *neighs,
const marklistptr *fastarray,
const int number_marks,
const int group_number,
int *x1,int *y1, int *x2, int *y2
)
{
int i,count;
marktype *temp;
*x1=*y1=INT_MAX;
*x2=*y2=-INT_MAX;
count=0;
for(i=0;i<number_marks;i++)
if(neighs[i].group==group_number){
count++;
temp=&(fastarray[neighs[i].num]->data);
if(temp->xpos<*x1) *x1=temp->xpos;
if(temp->ypos<*y1) *y1=temp->ypos;
if(temp->xpos+temp->w-1 > *x2) *x2=temp->xpos+temp->w-1;
if(temp->ypos+temp->h-1 > *y2) *y2=temp->ypos+temp->h-1;
}
if(count==0)
fprintf(stderr,"WARNING! -- group %d has no members!\n",group_number);
}
void
group_bounds_centroids(const neighbourtype *neighs,
const marklistptr *fastarray,
const int number_marks,
const int group_number,
int *x1,int *y1, int *x2, int *y2
)
{
int i,count;
marktype *temp;
int xc,yc,_x1,_y1,_x2,_y2;
*x1=*y1=INT_MAX;
*x2=*y2=-INT_MAX;
count=0;
for(i=0;i<number_marks;i++)
if(neighs[i].group==group_number){
count++;
temp=&(fastarray[neighs[i].num]->data);
xc=temp->xpos+temp->xcen;
yc=temp->ypos+temp->ycen;
_x1=temp->xpos;
_y1=temp->ypos;
_x2=temp->xpos+temp->w-1;
_y2=temp->ypos+temp->h-1;
if(_x1< *x1) *x1=_x1;
if(_y1< *y1) *y1=_y1;
if(_x2> *x2) *x2=_x2;
if(_y2> *y2) *y2=_y2;
if(*x1<0) *x1=0;
if(*y1<0) *y1=0;
if(*x2>=temp->imagew) *x2=temp->imagew-1;
if(*y2>=temp->imageh) *y2=temp->imageh-1;
}
if(count==0)
fprintf(stderr,"WARNING! -- group %d has no members!\n",group_number);
}
void
view_connections_groups(marktype image,
neighbourtype *neighs,
int number_marks,
int number_groups)
{
int i,j,g;
if(0)fprintf(stderr,"overlaying connections on bitmap...\n");
for(g=0;g<number_groups;g++)
for(i=0;i<number_marks;i++) if(neighs[i].group==g){
/*fprintf(stderr,"group %d, mark %d\n",g,neighs[i].num);*/
for(j=0;j<neighs[i].num_neighs;j++){
/*fprintf(stderr,"->%d\n",neighs[i].neighs[j].num);*/
marktype_line(image,
ROUND(neighs[i].x),
ROUND(neighs[i].y),
ROUND(neighs[i].x+ neighs[i].neighs[j].xd),
ROUND(neighs[i].y+ neighs[i].neighs[j].yd));
}
}
}
typedef struct {
int x1,y1,x2,y2,xcen,ycen;
int group;
} coord2d;
static int
compareycoords(const void *e1, const void *e2)
{
if ( ((coord2d*)e1)->ycen < ((coord2d*)e2)->ycen )
return -1;
else if ( ((coord2d*)e1)->ycen > ((coord2d*)e2)->ycen )
return 1;
else return 0;
}
void
dump_groups_with_class(neighbourtype *neighs,
marklistptr *array,
int len,
int number_groups)
{
int g;
int num_tags=0;
int _x1[1000],_y1[1000],_x2[1000],_y2[1000],_tags[1000];
char s[100],tag[100];
FILE *fp=NULL;
int thisarea=0;
if(globals.g_layout_filename){
fp=fopen(globals.g_layout_filename,"rt");
if(fp){
while(fgets(s,100,fp)){
sscanf(s,"%*s %s %d %d %d %d\n",tag,
&_x1[num_tags],
&_y1[num_tags],
&_x2[num_tags],
&_y2[num_tags]);
if(strncmp(tag,"text",4)==0)
_tags[num_tags]=0;
else
_tags[num_tags]=1;
num_tags++;
assert(num_tags<1000);
}
}
}
for(g=0;g<number_groups;g++){
int ww,thislen;
marktype *temp;
int x1,y1,x2,y2,tt;
int istext, isnot;
group_bounds_centroids(neighs,array,len,g,&x1,&y1,&x2,&y2);
thislen=0;
istext=0;
isnot=0;
thisarea=0;
for(ww=0;ww<len;ww++)
if(neighs[ww].group==g){
temp=&(array[neighs[ww].num]->data);
thisarea+=temp->set;
for(tt=0;tt<num_tags;tt++){
if((temp->xpos>=_x1[tt]) &&
(temp->xpos+temp->w<_x2[tt]) &&
(temp->ypos>=_y1[tt]) &&
(temp->ypos+temp->h<_y2[tt])){
if(_tags[tt]==0){
istext++;
} else {
isnot++;
}
}
}
}
if(fp==NULL){
sprintf(tag,"?");
} else if((istext>isnot) ){
sprintf(tag,"text");
} else if((isnot>istext) ){
sprintf(tag,"drawing");
} else {
sprintf(tag,"?");
}
if(thisarea*1.0/((x2-x1+1)*(y2-y1+1))>0.10){
if((globals.g_dump_zones)){
fprintf(stdout,"%03d %s %d %d %d %d\n",g,tag,x1,y1,x2,y2);
}
}
}
}
marklistptr
groups_to_marklist(marklistptr list,
neighbourtype *neighs,
int len,
int number_groups,
double skew,
double within)
{
int i,j,g,gi;
marklistptr ret=NULL,step,temp,temp2;
marklistptr *array;
marktype copy;
marktype im,im2;
coord2d *p;
if(len==0)
return NULL;
marklist_reconstruct_only_wh(list,&im);
marktype_alloc(&im2,im.w,im.h);
CALLOC(p,number_groups,coord2d);
CALLOC(array,len,marklistptr);
for(i=0,step=list;step;i++,step=step->next){
array[i]=step;
}
for(g=0;g<number_groups;g++){
int ww,thislen;
p[g].group=g;
if(globals.g_dump_zones){
group_bounds_centroids(neighs,array,len,g,&p[g].x1,&p[g].y1,&p[g].x2,&p[g].y2);
}
else
group_bounds(neighs,array,len,g,&p[g].x1,&p[g].y1,&p[g].x2,&p[g].y2);
p[g].xcen=(p[g].x1+p[g].x2)/2;
p[g].ycen=(p[g].y1+p[g].y2)/2;
}
if(globals.g_dump_zones){
dump_groups_with_class(neighs,array,len,number_groups);
}
/* marktype_writenamed("a.pbm",im2);*/
marktype_free(&im2);
/*fprintf(stderr,"written a.pbm\n");*/
if(globals.g_dump_zones){
exit(0);
}
qsort((void*)p,(unsigned int)number_groups,sizeof(coord2d),compareycoords);
for(gi=0;gi<number_groups;gi++) {
g=p[gi].group;
temp=NULL;
for(i=0;i<len;i++) {
if(neighs[i].group==g){
copy=array[neighs[i].num]->data;
assert(copy.xpos>=p[gi].x1);
assert(copy.ypos>=p[gi].y1);
assert(copy.xpos<=p[gi].x2);
assert(copy.ypos<=p[gi].y2);
copy.grp=g;
if(temp==NULL){
step=marklist_addcopy(&temp,copy);
} else {
step=marklist_addcopy(&step,copy);
}
}
}
/* fprintf(stderr,"group: %d (%d %d %d %d) == %d\n",p[gi].group,p[gi].x1,p[gi].y1,p[gi].x2,p[gi].y2,marklist_length(temp));*/
globals.g_reading_parameter=within;
/* fprintf(stderr,"within: %g\n",within);*/
temp2=sortmarks_howard(temp,im.imagew,im.imageh,DEG2RAD(skew),300);
/* for(step=temp2;step;step=step->next){
fprintf(stderr,"group: %d\n",step->data.grp);
marktype_writeascii(stderr,step->data);
}*/
marklist_free(&temp);
marklist_append(&ret,temp2);
marklist_free(&temp2);
}
FREE(array);
return ret;
}
|
Added work/contrib/tic/tic98/docstrum.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
#ifndef __DOCSTRUM_H
#define __DOCSTRUM_H
#include "marklist.h"
#define DEFAULT_K 5
#define DEFAULT_MIN_AREA 0.5 /* mm^2 */
typedef struct {
int num;
double xd,yd;
} neighbourlisttype;
typedef struct {
int num;
double x,y;
short num_neighs;
int group;
neighbourlisttype *neighs;
} neighbourtype;
int calc_docstrum(marktype *image, double *skew);
int calc_docstrum_list(marklistptr list, double *skew, int area);
double calc_docstrum_spacing(marklistptr list,
neighbourtype *neighs,
double orientation,
double *spacing_within,
double *spacing_between);
void prune_neighbours_angle_distance(neighbourtype *neighs,
int number_marks,
double orientation,
double orient_threshold,
double lesser);
void prune_neighbours_distance(neighbourtype *neighs,
int number_marks,
double distance);
void cluster_into_groups(neighbourtype *neighs,const int number_marks,
int *numgroups);
int label_group(neighbourtype *neighs,
const int marknum,
const int currentgroup,
const int total);
void pack_groups(neighbourtype *neighs, int *num_groups, const int total);
int dump_group(const neighbourtype *neighs,const int currentgroup,
const int total);
void group_reset_classifications(marklistptr list);
void view_connections_groups(marktype image,
neighbourtype *neighs,
int number_marks,
int number_groups);
marklistptr groups_to_marklist(marklistptr list,
neighbourtype *neighs,
int number_marks,
int number_groups,
double skew,
double within);
marklistptr docstrum_order(marklistptr list);
#endif
|
Added work/contrib/tic/tic98/double_array.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
#include <stdio.h>
#include "utils.h"
#include "double_array.h"
/*
** da_init() initialises a real valued array between [low,high] inclusive
*/
void da_init(doublearraytype *da,double low, double high, double binsize)
{
int NUM;
da->low=low;
da->high=high;
da->binsize=binsize;
if(high<=low) {
fprintf(stderr,"eek! high must be > low!\n");
exit(1);
}
if((binsize<=0)){
fprintf(stderr,"eek! binsize > 0 !\n");
exit(1);
}
NUM=ROUND((high-low)/binsize);
if(NUM==0){
fprintf(stderr,"low %g, high %g, binsize %g, NUM=%d, exiting...\n",low,high,binsize,NUM);
exit(1);
}
CALLOC(da->ary,NUM,double);
da->size=NUM;
}
void da_free(doublearraytype *da)
{
if(da->size>0){
FREE(da->ary);
da->size=0;
} else {
fprintf(stderr,"already empty!\n");
}
}
void da_copy(doublearraytype *copy, doublearraytype *orig)
{
int i;
copy->low=orig->low;
copy->high=orig->high;
copy->binsize=orig->binsize;
copy->size=orig->size;
for(i=0;i<copy->size;i++)
copy->ary[i]=orig->ary[i];
}
int da_idx(doublearraytype *da,double val)
{
int NUM;
if(val==da->high)
NUM=da->size;
else
NUM=ROUND((val-da->low)/da->binsize);
if((NUM<0) || (NUM>da->size)) {
fprintf(stderr,"eeek out of range. %g in [%g,%g] [%d %d]\n",val,da->low,da->high,NUM,da->size);
}
return NUM;
}
void da_write(doublearraytype *da, const char filename[])
{
FILE *fp;
int i;
if(!(fp=fopen(filename,"wb"))){
fprintf(stderr,"can't create file: %s\n",filename);
exit(1);
}
for(i=0;i<da->size;i++)
fprintf(fp,"%g %g\n",(i*da->binsize)+da->low,da->ary[i]);
fclose(fp);
}
double da_val(doublearraytype *da,int p)
{
if((p<0) || (p>da->size)){
fprintf(stderr,"accessing %d, out of the range [%d,%d]\n",p,0,da->size);
exit(1);
}
return (p*da->binsize)+da->low;
}
|
Added work/contrib/tic/tic98/double_array.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
typedef struct {
double *ary;
double low;
double high;
double binsize;
int size;
} doublearraytype;
void da_init(doublearraytype *da,double low, double high, double binsize);
void da_free(doublearraytype *da);
void da_write(doublearraytype *da, const char filename[]);
void da_copy(doublearraytype *copy, doublearraytype *orig);
int da_idx(doublearraytype *da,double val);
double da_val(doublearraytype *da,int p);
#define da_avg(ddd,p) ((da_val(ddd,p)+da_val(ddd,(p)+1))/2.0)
/*#define da_avg(ddd,p) da_val(ddd,p)*/
|
Added work/contrib/tic/tic98/getopt.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
|
/* Getopt for GNU.
Copyright (C) 1987, 1989 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* This version of `getopt' appears to the caller like standard Unix `getopt'
but it behaves differently for the user, since it allows the user
to intersperse the options with the other arguments.
As `getopt' works, it permutes the elements of `argv' so that,
when it is done, all the options precede everything else. Thus
all application programs are extended to handle flexible argument order.
Setting the environment variable _POSIX_OPTION_ORDER disables permutation.
Then the behavior is completely standard.
GNU application programs can use a third alternative mode in which
they can distinguish the relative order of options and other arguments. */
#include <stdio.h>
#include <stdlib.h>
/* If compiled with GNU C, use the built-in alloca */
#ifdef __GNUC__
#include <string.h>
#define bcopy(src, dst, num) memcpy((dst), (src), (num))
#define index strchr
/*#define alloca __builtin_alloca*/
#else /* not __GNUC__ */
#ifdef sparc
#include <alloca.h>
#endif
#endif /* not __GNUC__ */
#ifdef USG
#define bcopy(s, d, l) memcpy((d), (s), (l))
#define index strchr
#endif
#ifdef _WIN32
#include <string.h>
#define bcopy(src, dst, num) memcpy((dst), (src), (num))
#define alloca malloc
#define index strchr
#endif
/* For communication from `getopt' to the caller.
When `getopt' finds an option that takes an argument,
the argument value is returned here.
Also, when `ordering' is RETURN_IN_ORDER,
each non-option ARGV-element is returned here. */
char *optarg = 0;
/* Index in ARGV of the next element to be scanned.
This is used for communication to and from the caller
and for communication between successive calls to `getopt'.
On entry to `getopt', zero means this is the first call; initialize.
When `getopt' returns EOF, this is the index of the first of the
non-option elements that the caller should itself scan.
Otherwise, `optind' communicates from one call to the next
how much of ARGV has been scanned so far. */
int optind = 0;
/* The next char to be scanned in the option-element
in which the last option character we returned was found.
This allows us to pick up the scan where we left off.
If this is zero, or a null string, it means resume the scan
by advancing to the next ARGV-element. */
static char *nextchar;
/* Callers store zero here to inhibit the error message
for unrecognized options. */
int opterr = 1;
/* Describe how to deal with options that follow non-option ARGV-elements.
UNSPECIFIED means the caller did not specify anything;
the default is then REQUIRE_ORDER if the environment variable
_OPTIONS_FIRST is defined, PERMUTE otherwise.
REQUIRE_ORDER means don't recognize them as options.
Stop option processing when the first non-option is seen.
This is what Unix does.
PERMUTE is the default. We permute the contents of `argv' as we scan,
so that eventually all the options are at the end. This allows options
to be given in any order, even with programs that were not written to
expect this.
RETURN_IN_ORDER is an option available to programs that were written
to expect options and other ARGV-elements in any order and that care about
the ordering of the two. We describe each non-option ARGV-element
as if it were the argument of an option with character code zero.
Using `-' as the first character of the list of option characters
requests this mode of operation.
The special argument `--' forces an end of option-scanning regardless
of the value of `ordering'. In the case of RETURN_IN_ORDER, only
`--' can cause `getopt' to return EOF with `optind' != ARGC. */
static enum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER } ordering;
/* Handle permutation of arguments. */
/* Describe the part of ARGV that contains non-options that have
been skipped. `first_nonopt' is the index in ARGV of the first of them;
`last_nonopt' is the index after the last of them. */
static int first_nonopt;
static int last_nonopt;
/* Exchange two adjacent subsequences of ARGV.
One subsequence is elements [first_nonopt,last_nonopt)
which contains all the non-options that have been skipped so far.
The other is elements [last_nonopt,optind), which contains all
the options processed since those non-options were skipped.
`first_nonopt' and `last_nonopt' are relocated so that they describe
the new indices of the non-options in ARGV after they are moved. */
static void
exchange (char **argv)
{
int nonopts_size
= (last_nonopt - first_nonopt) * sizeof (char *);
char **temp = (char **) alloca (nonopts_size);
/* Interchange the two blocks of data in argv. */
bcopy (&argv[first_nonopt], temp, nonopts_size);
bcopy (&argv[last_nonopt], &argv[first_nonopt],
(optind - last_nonopt) * sizeof (char *));
bcopy (temp, &argv[first_nonopt + optind - last_nonopt],
nonopts_size);
/* Update records for the slots the non-options now occupy. */
first_nonopt += (optind - last_nonopt);
last_nonopt = optind;
}
/* Scan elements of ARGV (whose length is ARGC) for option characters
given in OPTSTRING.
If an element of ARGV starts with '-', and is not exactly "-" or "--",
then it is an option element. The characters of this element
(aside from the initial '-') are option characters. If `getopt'
is called repeatedly, it returns successively each of theoption characters
from each of the option elements.
If `getopt' finds another option character, it returns that character,
updating `optind' and `nextchar' so that the next call to `getopt' can
resume the scan with the following option character or ARGV-element.
If there are no more option characters, `getopt' returns `EOF'.
Then `optind' is the index in ARGV of the first ARGV-element
that is not an option. (The ARGV-elements have been permuted
so that those that are not options now come last.)
OPTSTRING is a string containing the legitimate option characters.
A colon in OPTSTRING means that the previous character is an option
that wants an argument. The argument is taken from the rest of the
current ARGV-element, or from the following ARGV-element,
and returned in `optarg'.
If an option character is seen that is not listed in OPTSTRING,
return '?' after printing an error message. If you set `opterr' to
zero, the error message is suppressed but we still return '?'.
If a char in OPTSTRING is followed by a colon, that means it wants an arg,
so the following text in the same ARGV-element, or the text of the following
ARGV-element, is returned in `optarg. Two colons mean an option that
wants an optional arg; if there is text in the current ARGV-element,
it is returned in `optarg'.
If OPTSTRING starts with `-', it requests a different method of handling the
non-option ARGV-elements. See the comments about RETURN_IN_ORDER, above. */
int
getopt (int argc,
char **argv,
char *optstring)
{
/* Initialize the internal data when the first call is made.
Start processing options with ARGV-element 1 (since ARGV-element 0
is the program name); the sequence of previously skipped
non-option ARGV-elements is empty. */
if (optind == 0)
{
first_nonopt = last_nonopt = optind = 1;
nextchar = 0;
/* Determine how to handle the ordering of options and nonoptions. */
if (optstring[0] == '-')
ordering = RETURN_IN_ORDER;
else if (getenv ("_POSIX_OPTION_ORDER") != 0)
ordering = REQUIRE_ORDER;
else
ordering = PERMUTE;
}
if (nextchar == 0 || *nextchar == 0)
{
if (ordering == PERMUTE)
{
/* If we have just processed some options following some non-options,
exchange them so that the options come first. */
if (first_nonopt != last_nonopt && last_nonopt != optind)
exchange (argv);
else if (last_nonopt != optind)
first_nonopt = optind;
/* Now skip any additional non-options
and extend the range of non-options previously skipped. */
while (optind < argc
&& (argv[optind][0] != '-'
|| argv[optind][1] == 0))
optind++;
last_nonopt = optind;
}
/* Special ARGV-element `--' means premature end of options.
Skip it like a null option,
then exchange with previous non-options as if it were an option,
then skip everything else like a non-option. */
if (optind != argc && !strcmp (argv[optind], "--"))
{
optind++;
if (first_nonopt != last_nonopt && last_nonopt != optind)
exchange (argv);
else if (first_nonopt == last_nonopt)
first_nonopt = optind;
last_nonopt = argc;
optind = argc;
}
/* If we have done all the ARGV-elements, stop the scan
and back over any non-options that we skipped and permuted. */
if (optind == argc)
{
/* Set the next-arg-index to point at the non-options
that we previously skipped, so the caller will digest them. */
if (first_nonopt != last_nonopt)
optind = first_nonopt;
return EOF;
}
/* If we have come to a non-option and did not permute it,
either stop the scan or describe it to the caller and pass it by. */
if (argv[optind][0] != '-' || argv[optind][1] == 0)
{
if (ordering == REQUIRE_ORDER)
return EOF;
optarg = argv[optind++];
return 0;
}
/* We have found another option-ARGV-element.
Start decoding its characters. */
nextchar = argv[optind] + 1;
}
/* Look at and handle the next option-character. */
{
char c = *nextchar++;
char *temp = (char *) index (optstring, c);
/* Increment `optind' when we start to process its last character. */
if (*nextchar == 0)
optind++;
if (temp == 0 || c == ':')
{
if (opterr != 0)
{
if (c < 040 || c >= 0177)
fprintf (stderr, "%s: unrecognized option, character code 0%o\n",
argv[0], c);
else
fprintf (stderr, "%s: unrecognized option `-%c'\n",
argv[0], c);
}
return '?';
}
if (temp[1] == ':')
{
if (temp[2] == ':')
{
/* This is an option that accepts an argument optionally. */
if (*nextchar != 0)
{
optarg = nextchar;
optind++;
}
else
optarg = 0;
nextchar = 0;
}
else
{
/* This is an option that requires an argument. */
if (*nextchar != 0)
{
optarg = nextchar;
/* If we end this ARGV-element by taking the rest as an arg,
we must advance to the next element now. */
optind++;
}
else if (optind == argc)
{
if (opterr != 0)
fprintf (stderr, "%s: no argument for `-%c' option\n",
argv[0], c);
c = '?';
}
else
/* We already incremented `optind' once;
increment it again when taking next ARGV-elt as argument. */
optarg = argv[optind++];
nextchar = 0;
}
}
return c;
}
}
#ifdef TEST
/* Compile with -DTEST to make an executable for use in testing
the above definition of `getopt'. */
int
main (argc, argv)
int argc;
char **argv;
{
char c;
int digit_optind = 0;
while (1)
{
int this_option_optind = optind;
if ((c = getopt (argc, argv, "abc:d:0123456789")) == EOF)
break;
switch (c)
{
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
if (digit_optind != 0 && digit_optind != this_option_optind)
printf ("digits occur in two different argv-elements.\n");
digit_optind = this_option_optind;
printf ("option %c\n", c);
break;
case 'a':
printf ("option a\n");
break;
case 'b':
printf ("option b\n");
break;
case 'c':
printf ("option c with value `%s'\n", optarg);
break;
case '?':
break;
default:
printf ("?? getopt returned character code 0%o ??\n", c);
}
}
if (optind < argc)
{
printf ("non-option ARGV-elements: ");
while (optind < argc)
printf ("%s ", argv[optind++]);
printf ("\n");
}
return 0;
}
#endif /* TEST */
|
Added work/contrib/tic/tic98/getopt.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
/* For communication from `getopt' to the caller.
When `getopt' finds an option that takes an argument,
the argument value is returned here.
Also, when `ordering' is RETURN_IN_ORDER,
each non-option ARGV-element is returned here. */
extern char *optarg;
/* Index in ARGV of the next element to be scanned.
This is used for communication to and from the caller
and for communication between successive calls to `getopt'.
On entry to `getopt', zero means this is the first call; initialize.
When `getopt' returns EOF, this is the index of the first of the
non-option elements that the caller should itself scan.
Otherwise, `optind' communicates from one call to the next
how much of ARGV has been scanned so far. */
extern int optind;
/* Callers store zero here to inhibit the error message
for unrecognized options. */
extern int opterr;
/* Scan elements of ARGV (whose length is ARGC) for option characters
given in OPTSTRING.
If an element of ARGV starts with '-', and is not exactly "-" or "--",
then it is an option element. The characters of this element
(aside from the initial '-') are option characters. If `getopt'
is called repeatedly, it returns successively each of theoption characters
from each of the option elements.
If `getopt' finds another option character, it returns that character,
updating `optind' and `nextchar' so that the next call to `getopt' can
resume the scan with the following option character or ARGV-element.
If there are no more option characters, `getopt' returns `EOF'.
Then `optind' is the index in ARGV of the first ARGV-element
that is not an option. (The ARGV-elements have been permuted
so that those that are not options now come last.)
OPTSTRING is a string containing the legitimate option characters.
A colon in OPTSTRING means that the previous character is an option
that wants an argument. The argument is taken from the rest of the
current ARGV-element, or from the following ARGV-element,
and returned in `optarg'.
If an option character is seen that is not listed in OPTSTRING,
return '?' after printing an error message. If you set `opterr' to
zero, the error message is suppressed but we still return '?'.
If a char in OPTSTRING is followed by a colon, that means it wants an arg,
so the following text in the same ARGV-element, or the text of the following
ARGV-element, is returned in `optarg. Two colons mean an option that
wants an optional arg; if there is text in the current ARGV-element,
it is returned in `optarg'.
If OPTSTRING starts with `-', it requests a different method of handling the
non-option ARGV-elements. See the comments about RETURN_IN_ORDER, above. */
int getopt (int argc, char **argv, char *optstring);
|
Added work/contrib/tic/tic98/globals.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
#include "globals.h"
globaltype globals;
void
globals_init(void)
{
globals.g_reading_order=EXTRACTION_DOCSTRUM;
globals.g_reading_parameter=1; /* mm */
globals.g_default_resolution=300; /* 300 */
globals.g_extraction_nested=1; /* nested */
globals.g_extraction_connectivity=8; /* 8 */
globals.g_gamma_init=1;
globals.g_gamma_increment=1;
globals.g_gamma_norm=256;
globals.g_max_classes=UNLIMITED;
globals.g_max_examples=UNLIMITED;
globals.g_match_threshold=400; /* 21 % */
globals.g_context_init=1;
globals.g_context_increment=1;
globals.g_context_norm=256;
globals.g_marks_on_page=0;
globals.g_num_matched=0;
globals.g_use_missing_bit=0; /* 0 */
globals.g_logfile=NULL;
globals.g_bound_w=0;
globals.g_bound_h=0;
globals.g_skew=0;
globals.g_rotate_degs_before_processing=0;
globals.g_prune_under_area=0;
globals.g_prune_over_area=0;
globals.g_use_ppm=0;
globals.g_update_probs_after_encoding=1; /* 1*/
globals.g_dump_indices=0;
globals.g_insert_spaces=0;
globals.g_rotate_offsets=0;
globals.g_layout_filename=NULL;
globals.g_dump_zones=0;
globals.g_codebook_filename=NULL;
globals.g_num1=4;
globals.g_num2=9;
globals.g_align_using_centres=0;
globals.g_match_mode=MATCH_B_AVG;
globals.g_prune_as_pixels=0;
}
|
Added work/contrib/tic/tic98/globals.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
#ifndef _GLOBALS_H
#define _GLOBALS_H
#include <stdio.h>
#define UNLIMITED -1
#define EXTRACTION_ORDER 1
#define EXTRACTION_PROFILE 2
#define EXTRACTION_RANDOM 3
#define EXTRACTION_ZHANG 4
#define EXTRACTION_HOWARD 5
#define EXTRACTION_DOCSTRUM 6
#define MATCH_B_AVG 1
#define MATCH_F_AVG 2
#define MATCH_B_SINGLE 4
#define MATCH_F_SINGLE 8
#define MATCH_HYBRID 16
typedef struct {
int g_reading_order;
float g_reading_parameter;
int g_default_resolution;
int g_extraction_nested;
int g_extraction_connectivity;
int g_gamma_init;
int g_gamma_norm;
int g_gamma_increment;
int g_max_classes;
int g_max_examples;
int g_match_threshold;
int g_context_init;
int g_context_norm;
int g_context_increment;
int g_marks_on_page;
int g_num_matched;
int g_use_missing_bit;
FILE* g_logfile;
int g_bound_w;
int g_bound_h;
float g_skew;
float g_rotate_degs_before_processing;
float g_prune_under_area;
float g_prune_over_area;
int g_use_ppm;
int g_update_probs_after_encoding;
int g_dump_indices;
int g_insert_spaces;
int g_rotate_offsets;
char *g_layout_filename;
int g_dump_zones;
char *g_codebook_filename;
int g_num1;
int g_num2;
int g_align_using_centres;
int g_match_mode;
int g_prune_as_pixels;
} globaltype;
extern globaltype globals;
void globals_init(void);
#endif
|
Added work/contrib/tic/tic98/hough.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
|
/*****************************************************************************
*
* Author: Stuart Inglis <singlis@waikato.ac.nz>
*
*****************************************************************************/
#include "utils.h"
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "marklist.h"
#include "math-utils.h"
#include "windowing.h"
#include "hough.h"
#include "double_array.h"
#define BOTTOM_CENTRE
#if defined(CENTROID)
char method[]="centroid position";
#elif defined(BOTTOM_CENTRE)
char method[]="bottom centre";
#else
#error
#endif
#define TYPE float
#define MAX_DIVS (18003)
double sin_values[MAX_DIVS],cos_values[MAX_DIVS];
/* Calculate the Hough transform in the range HS..HF in NUM_BINS steps */
void
hough_calc_range(
marklistptr list,
int image_w,
int image_h,
double HS,
double HF,
double NUM_BINS,
int div_amount,
char raw_filename[],
int uselog)
{
int omega,r, rmax;
double rr;
TYPE **accum=NULL;
TYPE maxaccum=0;
double **save_pgm=NULL;
marklistptr step;
int hs,hf;
double xd,yd,centre_x,centre_y;
doublearraytype ddd;
HS=HS+90;
HF=HF+90;
if(HF-HS==0.0) {
fprintf(stderr,"skew_hough: gap too small.\n");
exit(1);
}
da_init(&ddd,HS,HF,(HF-HS)/NUM_BINS);
hs=0;
hf=da_idx(&ddd,HF);
if((hf-hs)>=(MAX_DIVS-1)) {
fprintf(stderr,"wanting %d, max you can have is %d!\n",hf-hs,MAX_DIVS);
exit(1);
}
if(((8*sizeof(TYPE)))>=(marklist_length(list))){
fprintf(stderr,"WARNING -- possible accumulator array overflow -- %d points!!!\n",marklist_length(list));
}
centre_x = image_w/2.0;
centre_y = image_h/2.0;
rmax = (int)(sqrt((double)(image_w * image_w + image_h * image_h))/2.0 /div_amount);
/* allocate the Hough accumulator */
CALLOC_2D(accum,2*rmax+1, hf-hs+1,TYPE);
/* setup the sine/cosine table */
for (omega = hs; omega<hf; omega++){
rr=da_avg(&ddd,omega);
sin_values[omega-hs] = sin((double)DEG2RAD(rr));
cos_values[omega-hs] = cos((double)DEG2RAD(rr));
}
/* map each component into the Hough accumulator space */
for(step=list; step; step=step->next){
float increment=1;
TYPE *pos;
#ifdef CENTROID
xd=ROUND(step->data.xpos+step->data.d_xcen);
yd=ROUND(step->data.ypos+step->data.d_ycen);
#elif defined(BOTTOM_CENTRE)
xd=step->data.xpos+step->data.d_xcen;
yd=step->data.ypos+step->data.h-1;
#endif
/* for each component, draw the sinusoid in Hough space */
for (omega = hs; omega < hf; omega++){
/* centre_y-yd because +ve skew is anticlockwise from east */
rr = (centre_y-yd)*sin_values[omega-hs] + (xd-centre_x)*cos_values[omega-hs];
/* div_amount is the scale of r */
rr=rr/div_amount;
/* clamp into the Hough space */
r=rmax+ROUND(rr);
if(r<0) {
r=0;
} else {
if(r>=2*rmax+1) {
r=2*rmax+1-1;
}
}
pos=&accum[r][omega-hs];
/* update the accumulator with log(number of pixels) */
if(uselog){
increment=log(step->data.set);
}
(*pos)+=increment;
if((*pos)>maxaccum){
maxaccum=(*pos);
}
}
}
/* Write out original accumulator array */
CALLOC_2D(save_pgm,2*rmax+1, hf-hs+1,double);
for(r=0;r<2*rmax+1;r++)
for(omega=hs; omega<hf;omega++)
save_pgm[r][omega-hs]=accum[r][omega-hs];
/* store as a P2 with proper maximum so we know the original range */
{
char commentstring[1000];
sprintf(commentstring,"Components: HS %g, HF %g, NUM_BINS %g, r_div %d, uselog %d\n",HS,HF,NUM_BINS,div_amount,uselog);
write_window_2D_pgm_P2(raw_filename,save_pgm,0,2*rmax,0,hf-hs-1,ROUND(maxaccum),commentstring);
}
FREE_2D(save_pgm,2*rmax+1);
da_free(&ddd);
FREE_2D(accum,2*rmax+1);
}
/* Calculate the Hough transform in the range HS..HF in NUM_BINS steps */
void
hough_image_calc_range(
marktype *image,
double HS,
double HF,
double NUM_BINS,
int div_amount,
char raw_filename[])
{
int omega,r, rmax;
double rr;
TYPE **accum=NULL;
TYPE maxaccum=0;
double **save_pgm=NULL;
int hs,hf;
int x,y;
double centre_x,centre_y;
doublearraytype ddd;
float increment=1;
TYPE *pos;
HS=HS+90;
HF=HF+90;
if(HF-HS==0.0) {
fprintf(stderr,"skew_hough: gap too small.\n");
exit(1);
}
da_init(&ddd,HS,HF,(HF-HS)/NUM_BINS);
hs=0;
hf=da_idx(&ddd,HF);
if((hf-hs)>=(MAX_DIVS-1)) {
fprintf(stderr,"wanting %d, max you can have is %d!\n",hf-hs,MAX_DIVS);
exit(1);
}
centre_x = image->w/2.0;
centre_y = image->h/2.0;
rmax = (int)(sqrt((double)(image->w * image->w + image->h * image->h))/2.0 /div_amount);
/* allocate the Hough accumulator */
CALLOC_2D(accum,2*rmax+1, hf-hs+1,TYPE);
/* setup the sine/cosine table */
for (omega = hs; omega<hf; omega++){
rr=da_avg(&ddd,omega);
sin_values[omega-hs] = sin((double)DEG2RAD(rr));
cos_values[omega-hs] = cos((double)DEG2RAD(rr));
}
/* map each component into the Hough accumulator space */
for(y=0;y<image->h;y++)
for(x=0;x<image->w;x++)
if(pbm_getpixel(image->bitmap,x,y)){
/* for each component, draw the sinusoid in Hough space */
for (omega = hs; omega < hf; omega++){
/* centre_y-yd because +ve skew is anticlockwise from east */
rr = (centre_y-y)*sin_values[omega-hs] + (x-centre_x)*cos_values[omega-hs];
/* div_amount is the scale of r */
rr=rr/div_amount;
/* clamp into the Hough space */
r=rmax+ROUND(rr);
if(r<0) {
r=0;
} else {
if(r>=2*rmax+1) {
r=2*rmax+1-1;
}
}
pos=&accum[r][omega-hs];
/* update the accumulator with log(number of pixels) */
(*pos)+=increment;
if((*pos)>maxaccum){
maxaccum=(*pos);
}
}
}
/* Write out original accumulator array */
CALLOC_2D(save_pgm,2*rmax+1, hf-hs+1,double);
for(r=0;r<2*rmax+1;r++)
for(omega=hs; omega<hf;omega++)
save_pgm[r][omega-hs]=accum[r][omega-hs];
/* store as a P2 with proper maximum so we know the original range */
{
char commentstring[1000];
sprintf(commentstring,"Pixels: HS %g, HF %g, NUM_BINS %g, r_div %d\n",HS,HF,NUM_BINS,div_amount);
write_window_2D_pgm_P2(raw_filename,save_pgm,0,2*rmax,0,hf-hs-1,ROUND(maxaccum),commentstring);
}
FREE_2D(save_pgm,2*rmax+1);
da_free(&ddd);
FREE_2D(accum,2*rmax+1);
}
/* calls hough_calc_range with binsize instead of number of bins */
void
hough_calc(marklistptr list,
int w,
int h,
double low,
double high,
double binsize,
int rdiv,
char accum_name[],
int uselog)
{
double numbins;
numbins=ROUND((high-low+1)/binsize); /* number of bins */
if(numbins<=1) numbins=1;
hough_calc_range(list,w,h,low,high,numbins,rdiv,accum_name,uselog);
}
/* calls hough_calc_range with binsize instead of number of bins */
void
hough_image_calc(marktype *image,
double low,
double high,
double binsize,
int rdiv,
char accum_name[])
{
double numbins;
numbins=ROUND((high-low+1)/binsize); /* number of bins */
if(numbins<=1) numbins=1;
hough_image_calc_range(image,low,high,numbins,rdiv,accum_name);
}
|
Added work/contrib/tic/tic98/hough.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#ifndef __HOUGH_H
#define __HOUGH_H
#include "marklist.h"
void
hough_calc(marklistptr list,
int image_w,
int image_h,
double low,
double high,
double binsize,
int rdiv,
char accum_name[],
int uselog);
void
hough_image_calc(marktype *image,
double low,
double high,
double binsize,
int rdiv,
char accum_name[]);
#endif
|
Added work/contrib/tic/tic98/labelmarks.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
#include <stdio.h>
#include <string.h>
#include "globals.h"
#include "template_match.h"
#include "marklist.h"
int
main(int argc, char *argv[])
{
marklistptr list=NULL,step=NULL;
int i,len,r,j,k,k2,k3,k4,k5,k6,k7;
float r1,r2;
char *a,*b;
char label[1000],temp[1000];
int q,pos;
srand(1);
if(marklist_readascii(argv[1],&list)==0){
exit(1);
}
len=marklist_length(list);
fprintf(stderr,"len: %d\n",len);
step=list;
pos=0;
while(1){
marktype_writeascii(stderr,step->data);
fprintf(stderr,"%d/%d label: ",pos,len-1);
fflush(stderr);
strcpy(temp,"");
if(fgets(temp,100,stdin)==NULL)
break;
sscanf(temp,"%s",label);
if(strlen(label)>0){
if(step->data.name){
free(step->data.name);
}
step->data.name=strdup(label);
}
fprintf(stderr,"label: %s\n",step->data.name?step->data.name:"?");
if(step && step->next){
step=step->next;
pos++;
}
} ;
for(step=list;step;step=step->next){
marktype_writeascii(stdout,step->data);
}
marklist_free(&list);
return 0;
}
|
Added work/contrib/tic/tic98/line.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
|
#include "line.h"
#include "boundary.h"
#include "globals.h"
void
line_init(linetype *z)
{
z->num_marks=0;
z->mark=NULL;
}
void
line_add(linetype *z, marklistptr list)
{
int i=0;
marklistptr step;
z->num_marks=marklist_length(list);
z->mark=(marktype*)realloc(z->mark,z->num_marks*sizeof(marktype));
for(i=0,step=list;step; i++,step=step->next){
z->mark[i]=(step->data);
}
}
int
line_stats(linetype *z)
{
float xi=0,yi=0,xiyi=0,xi2=0,tx,ty,a,b;
int n=0,j;
if(z->num_marks<0)
return 0;
assert(z->num_marks!=0);
for(j=0;j<z->num_marks;j++){
n++;
xi+=(tx=(z->mark[j].xpos));
yi+=(ty=(z->mark[j].ypos+z->mark[j].h-1));
xi2+=(tx*tx);
xiyi+=(tx*ty);
}
b=xiyi - (xi*yi/n);
b=b/(xi2 - (xi*xi/n));
a=yi/n - b*(xi/n);
/* fprintf(stderr,"%.2f %.2f\n",a,b);*/
if(n>10)
return (int)(yi/n);
else
return z->mark[0].ypos+z->mark[0].h-1;
}
void
line_stats_two(linetype *z, int *a, float *b)
{
float xi=0,yi=0,xiyi=0,xi2=0,tx,ty;
int n=0,j;
if(z->num_marks<0){
*a=0;
*b=0;
}
for(j=0;j<z->num_marks;j++){
n++;
xi+=(tx=(z->mark[j].xpos));
yi+=(ty=(z->mark[j].ypos+z->mark[j].h-1));
xi2+=(tx*tx);
xiyi+=(tx*ty);
}
*b=xiyi - (xi*yi/n);
*b=(*b)/(xi2 - (xi*xi/n));
*a=(int)(yi/n - (*b)*(xi/n) + 0.5);
}
int
line_stats_indirect(linetype *z, linetype *indirect)
{
float xi=0,yi=0,xiyi=0,xi2=0,tx,ty,a,b;
int n=0,j;
int pos;
if(z->num_marks<0)
return 0;
assert(z->num_marks!=0);
for(j=0;j<z->num_marks;j++){
pos=z->mark[j].symnum;
n++;
xi+=(tx=(indirect->mark[pos].xpos));
yi+=(ty=(indirect->mark[pos].ypos+indirect->mark[pos].h-1));
xi2+=(tx*tx);
xiyi+=(tx*ty);
}
b=xiyi - (xi*yi/n);
b=b/(xi2 - (xi*xi/n));
/* y increases downwards */
b=-b;
a=yi/n - b*(xi/n);
/* fprintf(stderr,"%d: %.2f %.2f %.2f\n",n,a,b,RAD2DEG(atan(b)));*/
if(n>10)
return (int)(yi/n);
else
return z->mark[0].ypos+z->mark[0].h-1;
}
static int CmpOnXpos(const void *e1, const void *e2)
{
return ( (((marktype*)e1)->xpos) - (((marktype*)e2)->xpos) );
}
static int CmpOnXcen(const void *e1, const void *e2)
{
return ( (((marktype*)e1)->xpos+((marktype*)e1)->xcen)
- (((marktype*)e2)->xpos+((marktype*)e2)->xcen));
}
void
line_sort_xpos(linetype *z)
{
qsort((void*)z->mark,(unsigned int)z->num_marks,sizeof(marktype),CmpOnXpos);
}
void
line_sort_xcen(linetype *z)
{
qsort((void*)z->mark,(unsigned int)z->num_marks,sizeof(marktype),CmpOnXcen);
}
void
line_addmark(linetype *z, marktype *m)
{
int n;
n=z->num_marks;
z->mark=(marktype*)realloc(z->mark,(z->num_marks+1)*sizeof(marktype));
z->mark[z->num_marks]=(*m);
z->num_marks++;
}
void
line_free(linetype *z)
{
int i;
for(i=0;i<z->num_marks;i++){
/*marktype_free(&z->mark[i]);*/
}
free(z->mark);
}
marklistptr
lines_to_listcopy(linetype **lines, int num_lines)
{
marklistptr list=NULL,step;
int j,i;
marktype copy;
for(j=0;j<num_lines;j++){
for(i=0;i< (*lines)[j].num_marks;i++){
copy=(*lines)[j].mark[i];
if((i==0) && ((*lines)[j].num_marks>=2)){
copy.start_of_line=START_OF_LINE;
copy.ypos_of_line=line_stats(&(*lines)[j]);
} else if (i==(*lines)[j].num_marks-1){
copy.start_of_line=END_OF_LINE;
} else {
copy.start_of_line=0;
}
if(list==NULL){
step=marklist_addcopy(&list,copy);
} else {
step=marklist_addcopy(&step,copy);
}
}
}
return list;
}
marklistptr
lines_to_listcopy_indirect(linetype **lines, linetype *indirect,int num_lines)
{
marklistptr list=NULL,step;
int j,i;
int li=0,lj=0;
marktype copy;
marktype space;
marktype_init(&space);
space.start_of_line=SPACE;
for(j=0;j<num_lines;j++){
for(i=0;i< (*lines)[j].num_marks;i++){
copy=indirect->mark[ (*lines)[j].mark[i].symnum ];
copy.start_of_line=0;
if((i==0) && ((*lines)[j].num_marks>=2)){
copy.start_of_line=START_OF_LINE;
line_stats_two(&(*lines)[j], ©.ypos_of_line,©.skew_of_line);
} else if (i==(*lines)[j].num_marks-1) {
copy.start_of_line=END_OF_LINE;
}
if((copy.start_of_line==END_OF_LINE) || (copy.start_of_line==0)){
if(globals.g_insert_spaces){
if ( ((copy.xpos+copy.xcen-li)>1.3*globals.g_reading_parameter)
){
space.xpos=li;
space.ypos=lj;
space.w=((copy.xpos+copy.xcen)-li);
/*(int)(globals.g_reading_parameter);*/
if(list==NULL){
step=marklist_addcopy(&list,space);
} else {
step=marklist_addcopy(&step,space);
}
}
}
}
if(list==NULL){
step=marklist_addcopy(&list,copy);
} else {
step=marklist_addcopy(&step,copy);
}
li=copy.xpos+copy.xcen;
lj=copy.ypos+copy.h-1;
}
}
return list;
}
void
line_test()
{
marktype im;
marklistptr list=NULL;
linetype z;
marktype_readnamed("b.pbm",&im);
list=extract_all_marks(list,im,1,8);
line_init(&z);
line_add(&z,list);
line_free(&z);
fprintf(stderr,"line_test() finished\n");
}
|
Added work/contrib/tic/tic98/line.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#ifndef __LINE_H
#define __LINE_H
#include "marklist.h"
#define START_OF_LINE 1
#define END_OF_LINE 2
#define START_PRUNED 10
#define SPACE 20
typedef struct {
int num_marks;
marktype *mark;
} linetype;
void line_init(linetype *z);
void line_add(linetype *z, marklistptr list);
void line_addmark(linetype *z, marktype *m);
void line_remove(linetype *z, int line);
void line_free(linetype *z);
void line_dump(linetype *z);
void line_sort_xpos(linetype *z);
marklistptr lines_to_listcopy(linetype **lines, int num_lines);
marklistptr lines_to_listcopy_indirect(linetype **lines, linetype *indirect,int num_lines);
int line_stats(linetype *z);
int line_stats_indirect(linetype *z, linetype *indirect);
void line_test();
#endif
|
Added work/contrib/tic/tic98/main_skew.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
/*
* Author:
* Stuart Inglis (singlis@internz.co.nz)
* (c) 1998
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "getopt.h"
#include "docstrum.h"
#include "marklist.h"
#include "boundary.h"
void usage(void)
{
fprintf(stderr,
"usage: \n"
"\tmain_skew -i filename\n"
"\n"
"information:\n"
"\tCalculates the skew by a k-nearest neighbour Docstrum\n"
"\twith Bartlett smoothing.\n"
"\tA positive skew moves east anti-clockwise.\n"
"\n"
"\tIf the histogram peak is too small a ? is displayed.\n"
"\n"
"visualization:\n"
" |\n"
" |\n"
" | __--\n"
" | ___---\n"
" |__--- +15 degrees\n"
" ----+------------------\n"
" |(centre)\n"
" |\n"
"version:\n"
"\t20 Jan 1998\n");
exit(0);
}
int main(int argc, char *args[])
{
int ch;
extern char *optarg;
char *filename=NULL;
marktype image;
double skew;
while((ch = getopt(argc, args, "hcdi:")) != -1)
switch(ch)
{
case 'i':
filename=optarg;
break;
case 'h':
default:
usage();
}
if(filename==NULL)
usage();
if(marktype_readnamed(filename, &image)!=0)
return 1;
if(calc_docstrum(&image,&skew)==0)
fprintf(stdout,"%.1f\n",skew);
else
fprintf(stdout,"?\n");
marktype_free(&image);
exit(0);
}
|
Added work/contrib/tic/tic98/main_tic.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
|
/*
* Author:
* Stuart Inglis (singlis@internz.co.nz)
* (c) 1994-1999
*
* Implementation of lossless textual image compression, using
* adaptive library encoding and averaging.
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "arithcode.h"
#include "globals.h"
#include "tic98.h"
#include "getopt.h"
#include "boundary.h"
#include "sort_lines.h"
#include "timer.h"
#include "rotate.h"
#include "line.h"
#include "docstrum.h"
#include "codebilevel.h"
static char default_template[]={
".ppppp.;"
"pp222pp;"
"p22222p;"
"p22*...;"
};
marklistptr
extract_marks_from_zones(marktype image)
{
marklistptr list=NULL;
FILE *fp;
marktype copy;
copy=marktype_copy(image);
fp=fopen(globals.g_layout_filename,"rt");
if(fp && (globals.g_dump_zones==0)){
char s[100],tag[100];
while(fgets(s,100,fp)){
int x1,y1,x2,y2;
sscanf(s,"%*s %s %d %d %d %d\n",tag,&x1,&y1,&x2,&y2);
if((strncmp(tag,"text",4)==0)){
int i,j;
list=extract_all_marks_bound(list,
copy,
globals.g_extraction_nested,
globals.g_extraction_connectivity,
x1,y1,x2,y2);
}
}
fclose(fp);
} else {
list=extract_all_marks_bound(list,
copy,
globals.g_extraction_nested,
globals.g_extraction_connectivity,
0,0,image.w-1,image.h-1);
}
marktype_free(©);
{
int i,j;
marktype recon;
marklist_reconstruct(list,&recon);
for(j=0; j<image.h ;j++)
for(i=0; i<image.w; i++)
if(gpix(recon,i,j))
ppix(image,i,j,0);
marktype_free(&recon);
}
return list;
}
marklistptr
imagefn_to_list(marktype *image, char *fn, int *w, int *h)
{
marklistptr list=NULL,list2=NULL;
marktype copy;
if(marktype_readnamed(fn, image)!=0)
return NULL;
*w=image->w;
*h=image->h;
if(image->resolution==0){
image->resolution=globals.g_default_resolution;
}
copy=marktype_copy(*image);
/* rotate the image, keeping original size */
rotate_image(image, globals.g_rotate_degs_before_processing, 1);
list=extract_marks_from_zones(*image);
/*
list=extract_all_marks(list,
image,
globals.g_extraction_nested,
globals.g_extraction_connectivity);
*/
list=list_bound_size(list,globals.g_bound_w,globals.g_bound_h);
switch (globals.g_reading_order){
case EXTRACTION_ORDER:
break;
case EXTRACTION_PROFILE:
list2=sortmarks_profile(list,image->w, image->h,0,image->resolution);
marklist_free(&list);
list=list2;
break;
case EXTRACTION_RANDOM:
list2=sortmarks_random(list,image->w, image->h,0,image->resolution);
marklist_free(&list);
list=list2;
break;
case EXTRACTION_ZHANG:
list2=sortmarks_zhang(list,image->w, image->h,0,image->resolution);
marklist_free(&list);
list=list2;
break;
case EXTRACTION_HOWARD:{
marklistptr pruned=NULL;
if(globals.g_prune_under_area){
pruned=marklist_prune_under_area(&list,globals.g_prune_under_area,image->resolution);
/*fprintf(stderr,"pruned: %d\n",marklist_length(pruned));*/
}
list2=sortmarks_howard(list,image->w, image->h,0,image->resolution);
marklist_free(&list);
list=list2;
if(pruned)
pruned->data.start_of_line=START_PRUNED;
marklist_append(&list,pruned);
marklist_free(&pruned);
}
break;
case EXTRACTION_DOCSTRUM:{
marklistptr pruned=NULL;
if(globals.g_prune_under_area||globals.g_prune_as_pixels){
pruned=marklist_prune_under_area(&list,globals.g_prune_under_area,image->resolution);
marklist_prune_over_area(&list,globals.g_prune_over_area,image->resolution);
/*fprintf(stderr,"pruned: %d\n",marklist_length(pruned));*/
}
list2=docstrum_order(list);
marklist_free(&list);
list=list2;
if(globals.g_prune_as_pixels){
int i,j;
marktype recon;
marklist_reconstruct(list,&recon);
for(j=0; j<copy.h ;j++)
for(i=0; i<copy.w; i++)
if(gpix(recon,i,j)!=gpix(copy,i,j))
ppix((*image),i,j,gpix(copy,i,j));
marktype_free(&recon);
} else {
if(pruned)
pruned->data.start_of_line=START_PRUNED;
marklist_append(&list,pruned);
marklist_free(&pruned);
}
marktype_free(©);
/**/
}
break;
default:
{
fprintf(stderr,"Unknown reading order mode.\n");
exit(1);
}
}
/*
{
marktype im;
marklist_reconstruct_show_lines (list, &im);
marktype_writenamed("a.pbm",im);
fprintf(stderr,"wow\n");
marktype_free(&im);
}
*/
return list;
}
void
list_to_imagefn(marklistptr list, marktype recon, char *fn, int w, int h)
{
marktype image;
int j,i;
marklist_reconstruct_using_wh(list, &image,w,h);
for(j=0;j<recon.h;j++)
for(i=0;i<recon.w;i++)
if(gpix(recon,i,j)){
ppix(image,i,j,1);
}
marktype_writenamed(fn, image);
fprintf(stderr,"main_tic: wrote '%s'\n",fn);
marktype_free(&image);
}
void
dump_log()
{
}
void
usage(void)
{
fprintf(stderr,
"usage: \n"
"\ttic98 [-c -d] -i infile -o outfile\n"
"\n"
"options:\n"
" -c/d\tcompress or decompress an image\n"
" -i n\tSpecify an infile <n>(or series of files...)\n"
" -o n\tSpecify the outfile prefix <n>\n"
" -r n\trotate n degrees before processing\n"
" -s n\tset the known skew to be n degrees\n"
" -w n\tset the component width bound\n"
" -h n\tset the component height bound\n"
" -R m\tsets the reading order (Docstrum*)\n"
" -l f\tlog to file <f>\n"
" -t t\tset matching threshold to <t>\n"
" -Nn \t(N)ested extraction or (n)on-(n)ested extraction\n"
" -48 \t4 or 8 connectivity\n"
" -P \tuse PPM to encode indices\n"
" -u \tturn off probabilities update after clairvoyant encoding\n"
" -D d\tset default resolution to d DPI\n"
" -C f\tdump codebook to <f> in .pbm format\n"
" -M n\tsets the maximum number of classes to <n>\n"
" -E n\tsets the maximum examples in each class to <n>\n"
" -1 n\tSets the normal component of the clairvoyant context\n"
" -2 n\tSets the clair component of the clairvoyant context\n"
" -z \tdumps the zones\n"
" -f n\tfile layout filename <n>\n"
" -U:6\tUpdate params: cinit,inc,norm gammainit,inc,norm\n"
" -C n\tCodebook filename <n>\n"
" -I \tdump component indices\n"
" -O \trotate offsets\n"
" -P \tprime against average component before compressing it\n"
" -G \talign using centres (instead of centroids)\n"
" -m n\tMatch mode B_AVG (default), F_AVG, B_SINGLE, F_SINGLE, HYBRID\n"
" -Z \tPruning values determined by machine learning\n"
"\n"
"information:\n"
"\tMultiple pages may be compressed using several\n"
"\t-i options. When the file is decompressed the\n"
"\t<outfile> name is used as a prefix, and the decompressed\n"
"\timages are named <outfile>.001, <outfile>.002, ...\n"
"\n"
"\tFor example:\n"
"\t tic98 -c -i page1.pbm -i page2.pbm -o compressed\n"
"\t tic98 -d -i compressed -o decompressed\n"
"\t xv decompressed.001 decompressed.002\n"
"\n"
"\nAuthor information:\n"
"\tStuart Inglis, http://www.cs.waikato.ac.nz/~singlis\n"
"\n"
"\tThesis results (Table 9.1):\n"
"\t tic98 -c -i A006.pbm -o A006.cmp -Z -m B_SINGLE\n"
"\n"
"version:\n"
"\t1 July 1999 (version 1.01)\n"
);
exit(0);
}
int
main(int argc, char *args[])
{
int ch;
extern char *optarg;
int compress=1;
int num_in=0;
int num_out=0;
char **infilename=NULL;
char **outfilename=NULL;
globals_init();
TimerInit();
while((ch = getopt(argc, args, "cD:di:o:U:uPnN48l:R:w:h:s:r:p:I:SOf:zC:t:m:FE:M:b1:2:AGZ")) != -1)
switch(ch)
{
case 'Z':
globals.g_prune_as_pixels=1;
globals.g_prune_under_area=0.5;
globals.g_prune_over_area=5;
break;
case 'G':
globals.g_align_using_centres=1;
break;
case 'm':
if(strcasecmp(optarg,"B_AVG")==0) globals.g_match_mode=MATCH_B_AVG;
else if(strcasecmp(optarg,"F_AVG")==0) globals.g_match_mode=MATCH_F_AVG;
else if(strcasecmp(optarg,"B_SINGLE")==0) globals.g_match_mode=MATCH_B_SINGLE;
else if(strcasecmp(optarg,"F_SINGLE")==0) globals.g_match_mode=MATCH_F_SINGLE;
else if(strcasecmp(optarg,"HYBRID")==0) globals.g_match_mode=MATCH_HYBRID;
else {
fprintf(stderr,"error: unknown matching mode option. Use B_AVG,F_AVG,B_SINGLE,F_SINGLE or HYBRID.\n");
exit(1);
}
break;
case '1':
globals.g_num1=atoi(optarg);
break;
case '2':
globals.g_num2=atoi(optarg);
break;
case 'b':
globals.g_use_missing_bit=1;
break;
case 'M':
globals.g_max_classes=atoi(optarg);
break;
case 'E':
globals.g_max_examples=atoi(optarg);
break;
case 'z':
globals.g_dump_zones=1;
break;
case 'f':
globals.g_layout_filename=(char*)strdup(optarg);
break;
case 'r':
globals.g_rotate_degs_before_processing=DEG2RAD(atof(optarg));break;
case 's':
globals.g_skew=DEG2RAD(atof(optarg));break;
case 'w':
globals.g_bound_w=atoi(optarg);break;
case 'h':
globals.g_bound_h=atoi(optarg);break;
case 'R':
if(strcasecmp(optarg,"howard")==0) globals.g_reading_order=EXTRACTION_HOWARD;
else if(strcasecmp(optarg,"zhang")==0) globals.g_reading_order=EXTRACTION_ZHANG;
else if(strcasecmp(optarg,"extraction")==0) globals.g_reading_order=EXTRACTION_ORDER;
else if(strcasecmp(optarg,"profile")==0) globals.g_reading_order=EXTRACTION_PROFILE;
else if(strcasecmp(optarg,"random")==0) globals.g_reading_order=EXTRACTION_RANDOM;
else if(strcasecmp(optarg,"docstrum")==0) globals.g_reading_order=EXTRACTION_DOCSTRUM;
else {
fprintf(stderr,"error: unknown Reading order mode. Use one of:\n");
fprintf(stderr,"\tHoward, Zhang, Extraction, Profile, Random or Docstrum\n");
exit(1);
}
break;
case 'l':
if(strcmp(optarg,"-")==0)
globals.g_logfile=stderr;
else
globals.g_logfile=fopen(optarg,"wt");
break;
case 'n':
globals.g_extraction_nested=0; break;
case 'N':
globals.g_extraction_nested=1; break;
case '4':
globals.g_extraction_connectivity=4; break;
case '8':
globals.g_extraction_connectivity=8; break;
case 'p':
globals.g_prune_under_area=atof(optarg);
break;
case 'P':
globals.g_use_ppm=!globals.g_use_ppm;
break;
case 'D':
globals.g_default_resolution=atoi(optarg);
break;
case 'u':
globals.g_update_probs_after_encoding=0;
break;
case 'U': {
int i;
char *ss=(char*)strdup(optarg);
for(i=0;i<(int)strlen(ss);i++){
if(ss[i]==',') ss[i]=' ';
}
sscanf(ss,"%d %d %d %d %d %d",
&globals.g_context_init,
&globals.g_context_increment,
&globals.g_context_norm,
&globals.g_gamma_init,
&globals.g_gamma_increment,
&globals.g_gamma_norm
);
}
break;
case 'C':
globals.g_codebook_filename=strdup(optarg);
break;
case 't':
globals.g_match_threshold=atoi(optarg);
break;
case 'c':
compress=1;
break;
case 'd':
compress=0;
break;
case 'S':
globals.g_insert_spaces=1;
break;
case 'I':
globals.g_dump_indices=atoi(optarg);
if((globals.g_dump_indices<0) || (globals.g_dump_indices>2))
globals.g_dump_indices=0;
break;
case 'i':
infilename=(char**)realloc(infilename,sizeof(char*)*(num_in+1));
assert(infilename);
infilename[num_in++]=(char*)strdup(optarg);
break;
case 'o':
outfilename=(char**)realloc(outfilename,sizeof(char*)*(num_out+1));
assert(outfilename);
outfilename[num_out++]=(char*)strdup(optarg);
break;
case 'O':
globals.g_rotate_offsets=1;
break;
default:
usage();
}
for(;optind<argc;optind++){
usage();
}
if((infilename==NULL)||(outfilename==NULL))
usage();
if((compress==1) && (num_out!=1))
usage();
if((compress==0) && (num_in!=1) && (num_out!=1))
usage();
/*
* Arithmetic coders usually read/write to stdin/stdout, but here
* we'll reassign them to files with "b" mode for compatibility
* on non-unix machines
*/
if(compress){
marklistptr list=NULL;
tic98type t;
int i;
TimerStart(1);
freopen(outfilename[0],"wb",stdout);
tic98_init(&t);
tic98_start_encoding();
for(i=0;i<num_in;i++){
int w,h,xx,yy,ok=0;
marktype image;
list=imagefn_to_list(&image,infilename[i], &w, &h);
tic98_num_encode(&t,NEW_PAGE);
for(xx=0;xx<image.w;xx++)
for(yy=0;yy<image.h;yy++)
if(gpix(image,xx,yy))
ok++;
/*fprintf(stderr,"%d\n",ok);*/
tic98_compress_marks(&t,list, w,h);
/*fprintf(stderr,"bl_compress\n");*/
if(ok)ok=1;
tic98_num_encode(&t,ok);
if(ok){
/*marktype_writenamed("bl.pbm",image);*/
#ifndef Q_CODER
bl_compress(image,default_template);
#endif
}
marktype_free(&image);
/* usually here... tic98_status(&t,globals.g_logfile);*/
if(i<(num_in-1)){
tic98_status(&t,globals.g_logfile);
}
marklist_stats(list,globals.g_logfile);
marklist_free(&list);
}
tic98_num_encode(&t,END_OF_DOCUMENT);
tic98_finish_encoding();
tic98_status(&t,globals.g_logfile);
tic98_free(&t);
TimerStop(1);
TimerPrint(1,globals.g_logfile);
fclose(stdout);
marklist_free(&list);
} else {
marklistptr list=NULL;
tic98type t;
char *newoutname=NULL;
int page=0;
newoutname=(char*)malloc(sizeof(char)*(strlen(outfilename[0])+10));
assert(newoutname);
freopen(infilename[0],"rb",stdin);
tic98_init(&t);
tic98_start_decoding();
while(tic98_num_decode(&t)!=END_OF_DOCUMENT){
int w,h,ok;
marktype recon;
page++;
list=tic98_decompress_marks(&t,&w,&h);
ok=tic98_num_decode(&t);
if(ok==1){
recon.w=w;
recon.h=h;
#ifndef Q_CODER
bl_decompress(&recon);
#endif
}
sprintf(newoutname,"%s.%03d",outfilename[0],page);
list_to_imagefn(list,recon,newoutname,w,h);
marktype_free(&recon);
marklist_free(&list);
}
free(newoutname);
tic98_finish_decoding();
tic98_free(&t);
fclose(stdin);
}
free(infilename);
free(outfilename);
TimerFree();
exit(0);
}
|
Added work/contrib/tic/tic98/marklist.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
|
/*
* Module: marklist
*
* The marklist module implements the routines dealing with
* the marktype structure, or a list of the structures called
* a marklist.
*
* Functions include reading/writing, features, and list
* management.
*
* Author:
* Stuart Inglis (singlis@internz.co.nz)
* (c) 1998
*
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "marklist.h"
#include "pbmtools.h"
#include "utils.h"
#include "line.h"
/*
* marktype_read, simply reads the bitmap, does not set *any* of the fields
* in marktype, ie. area (.set) is not assigned
*/
void
marktype_read (FILE * fp, marktype * im)
{
if (pbm_isapbmfile (fp)) {
Pixel **p;
p = pbm_readfile (fp, &(im->w), &(im->h),&(im->resolution));
im->bitmap = p;
} else
error ("Can only read PBM files at the moment", "", "");
}
/*
* marktype_write writes the bitmap
*/
void
marktype_write (FILE * fp, const marktype im)
{
pbm_writefile (fp, im.bitmap, im.w, im.h, im.resolution);
}
/*
* marktype_writenamed, uses a filename instead of a FILE pointer.
*/
void
marktype_writenamed (char *fn, marktype im)
{
FILE *tempfp;
if (strcmp (fn, "-") == 0)
tempfp = stdout;
else {
tempfp = fopen (fn, "wb");
if (tempfp == NULL) {
fprintf (stderr, "marktype_writenamed(), can't write file: %s\n", fn);
return;
}
}
pbm_writefile (tempfp, im.bitmap, im.w, im.h, im.resolution);
fclose (tempfp);
}
int
marktype_readnamed (char *fn, marktype * im)
{
FILE *tempfp;
Pixel **temp;
unsigned long magic;
int err;
char *lookfn;
char *fn2 = NULL;
char *msg = "temporary file";
if (strcmp (fn, "-") == 0) {
fprintf (stderr, "error - can't read from named file \"-\"!!!!\n");
return 1;
}
magic = magic_popnamed (fn, &err) >> 16; /* only interested in first 2 bytes */
if (err != 0) {
return 1; /* failure */
fprintf (stderr, "error - can't open file '%s'\n", fn);
return 1;
}
if (!((magic == MAGIC_P1) || (magic == MAGIC_P4))) {
return 1;
}
if (fn2) {
tempfp = fopen (fn2, "rb");
lookfn = msg;
} else {
tempfp = fopen (fn, "rb");
lookfn = fn;
}
if (tempfp == NULL) {
fprintf (stderr, "readnamed: can't open file: %s\n", lookfn);
return 1;
}
if (pbm_isapbmfile (tempfp)) {
if (tempfp == NULL) {
fprintf (stderr, "marktype_readname: can't open file: %s\n", lookfn);
return 1;
}
marktype_init(im);
temp = pbm_readfile (tempfp, &(im->w), &(im->h),&(im->resolution));
im->bitmap = temp;
im->imagew=im->w;
im->imageh=im->h;
fclose (tempfp);
} else {
if (fn2)
remove (fn2);
fprintf (stderr, "marktype_readnamed(): file is not bilevel pbm format\n");
return 1;
}
if (fn2)
remove (fn2);
return 0; /* success */
}
/*
* marktype_dump, writes out (some) of the fields to a FILE pointer.
* (Mainly used for debugging)
*/
void
marktype_dump (FILE * fp, marktype d)
{
fprintf (fp, "symnum: %d\n", d.symnum);
fprintf (fp, "w: %d, h: %d\n", d.w, d.h);
fprintf (fp, "xpos: %d, ypos: %d\n", d.xpos, d.ypos);
fprintf (fp, "xcen: %d, ycen: %d\n", d.xcen, d.ycen);
fprintf (fp, "xoffset: %d, yoffset: %d\n", d.xoffset, d.yoffset);
fprintf (fp, "area: %d, h_runs: %d, v_runs: %d\n", d.set, d.h_runs, d.v_runs);
marktype_writeascii (fp, d);
}
/*
* marktype_copy, make a completely new copy, creates a
* new bitmap as well.
*/
marktype
marktype_copy (marktype d)
{
marktype d2;
d2 = d;
d2.bitmap = pbm_copy (d.bitmap, d2.w, d2.h);
if (d.name)
d2.name = (char *) strdup (d.name);
return d2;
}
void
marktype_init (marktype * d)
{
d->symnum = 0;
d->xpos = d->ypos = 0;
d->w = d->h = 0;
d->xcen = d->ycen = 0;
d->d_xcen = d->d_ycen = 0;
d->xoffset = d->yoffset = 0;
d->baseline = 0;
d->topline = 0;
d->name = NULL;
d->bitmap = NULL;
d->resolution = 0;
d->imagew = d->imageh = 0;
d->h_runs = d->v_runs = 0;
d->start_of_line=0;
d->grp=-1;
d->skew_of_line=0;
d->ypos_of_line=0;
d->set = 0;
}
/*
* marktype_alloc, initialises all values in the structure,
* and creates a bitmap of size w by h.
*
* the w and h values are set.
*/
void
marktype_alloc (marktype * d, int w, int h)
{
marktype_init (d);
d->bitmap = pbm_alloc (w, h);
d->w = w;
d->imagew = w;
d->h = h;
d->imageh = h;
}
void
marktype_free (marktype * d)
{
if(d->bitmap)
pbm_free (&(d->bitmap), d->h);
if(d->name)
free(d->name);
marktype_init(d);
}
/*
* marktype_calc_centroid, uses integers and keeps scaling to fix down,
* (meaning the result is not always correct!)
*
* If there are no set pixels the centroid values are set to -1.
*/
void
marktype_calc_centroid (marktype * b)
{
int r, c;
int count = 0;
int xtot = 0, ytot = 0;
for (r = 0; r < b->h; r++) {
for (c = 0; c < b->w; c++)
if (pbm_getpixel (b->bitmap, c, r)) {
count++;
xtot += c;
ytot += r;
}
if (xtot + ytot >= (INT_MAX/2)) {
count = (count + 1) / 2;
xtot = (xtot + 1) / 2;
ytot = (ytot + 1) / 2;
}
}
b->xcen = ROUND(xtot / (double) count);
b->ycen = ROUND(ytot / (double) count);
b->d_xcen = (xtot / (double) count);
b->d_ycen = (ytot / (double) count);
}
/*
* marktype_area, calculates the number of set pixels, as with all these
* functions we assume the the number can fix in an integer.
*/
void
marktype_area (marktype * d)
{
int x, y;
int set = 0;
for (y = 0; y < d->h; y++)
for (x = 0; x < d->w; x++)
if (pbm_getpixel (d->bitmap, x, y))
set++;
d->set = set;
}
void
marklist_reconstruct (marklistptr list, marktype * im)
{
marklistptr step;
int imagew = 0, imageh = 0;
int min_w=0,min_h=0,max_w=0,max_h=0;
for(step=list;step;step=step->next){
if(step->data.imagew>max_w) max_w=step->data.imagew;
if(step->data.imagew<min_w) min_w=step->data.imagew;
if(step->data.imageh>max_h) max_h=step->data.imageh;
if(step->data.imageh<min_h) min_h=step->data.imageh;
}
/*fprintf(stderr,"%d %d %d %d\n",min_w,max_w,min_h,max_h);*/
imagew=max_w;
imageh=max_h;
/*
if (list != NULL) {
imagew = list->data.imagew;
imageh = list->data.imageh;
} else {
imagew = imageh = 0;
}
*/
marktype_alloc (im, imagew, imageh);
for (step = list; step; step = step->next) {
marktype_placeat (*im, step->data, step->data.xpos, step->data.ypos);
}
}
void
marklist_reconstruct_using_wh (marklistptr list, marktype * im, int w, int h)
{
marklistptr step;
int imagew = 0, imageh = 0;
imagew=w;
imageh=h;
marktype_alloc (im, imagew, imageh);
for (step = list; step; step = step->next) {
marktype_placeat (*im, step->data, step->data.xpos, step->data.ypos);
}
}
void
marklist_reconstruct_show_lines (marklistptr listret, marktype * im)
{
marklistptr step;
int i;
marklist_reconstruct(listret,im);
for(step=listret; step ;step=step->next){
if(step->data.start_of_line){
if(step->data.start_of_line==START_OF_LINE){
for(i=-20;i<=0;i++){
ppix((*im),step->data.xpos+i,step->data.ypos+step->data.h,1);
ppix((*im),step->data.xpos+i,step->data.ypos+step->data.h+1,1);
}
for(i=-20;i<=0;i++){
ppix((*im),step->data.xpos-20,step->data.ypos+step->data.h+i,1);
ppix((*im),step->data.xpos-20+1,step->data.ypos+step->data.h+i,1);
}
} else if(step->data.start_of_line==END_OF_LINE){
for(i=0;i<=20;i++){
ppix((*im),step->data.xpos+step->data.w+20-i,step->data.ypos+step->data.h,1);
ppix((*im),step->data.xpos+step->data.w+20-i,step->data.ypos+step->data.h+1,1);
}
for(i=-20;i<=0;i++){
ppix((*im),step->data.xpos+step->data.w+20,step->data.ypos+step->data.h+i,1);
ppix((*im),step->data.xpos+step->data.w+20+1,step->data.ypos+step->data.h+i,1);
}
} else if(step->data.start_of_line==SPACE){
for(i=0;i<step->data.w;i++){
ppix((*im),step->data.xpos+i,step->data.ypos+3,1);
ppix((*im),step->data.xpos+i,step->data.ypos+4,1);
}
} /* endif */
}
}
}
void
marklist_reconstruct_only_wh (const marklistptr list, marktype * im)
{
int imagew = 0, imageh = 0;
if (list != NULL) {
imagew = list->data.imagew;
imageh = list->data.imageh;
} else {
imagew = imageh = 0;
}
im->w=imagew;
im->imagew=imagew;
im->h=imageh;
im->imageh=imageh;
}
/* places 'mark' at position (x,y) in 'image' bitmap. Crops if the image doesn't fit */
void
marktype_placeat (marktype image, marktype mark, int x, int y)
{
int i, j, g;
for (j = 0; j < mark.h; j++)
for (i = 0; i < mark.w; i++) {
g = gpix (mark, i, j);
if (g)
ppix (image, x + i, y + j, g);
}
}
void
marktype_adj_bound (marktype * m)
{
int x, y, w, h;
int xpos, ypos, baseline,topline;
int top = 0, left = 0, right = 0, bot = 0;
marktype temp;
w = m->w;
h = m->h;
xpos = m->xpos;
ypos = m->ypos;
baseline = m->baseline;
topline = m->topline;
for (y = 0; y < h; y++)
for (x = 0; x < w; x++)
if (pbm_getpixel (m->bitmap, x, y)) {
top = y;
x = w;
y = h;
}
for (y = h - 1; y >= 0; y--)
for (x = 0; x < w; x++)
if (pbm_getpixel (m->bitmap, x, y)) {
bot = y;
x = w;
y = -1;
}
for (x = 0; x < w; x++)
for (y = 0; y < h; y++)
if (pbm_getpixel (m->bitmap, x, y)) {
left = x;
x = w;
y = h;
}
for (x = w - 1; x >= 0; x--)
for (y = 0; y < h; y++)
if (pbm_getpixel (m->bitmap, x, y)) {
right = x;
x = -1;
y = h;
} {
Pixel **bitmap;
temp = *m;
temp.w = right - left + 1;
temp.h = bot - top + 1;
/* allocate the bitmap field */
marktype_alloc (&temp, temp.w, temp.h);
/* save the pointer */
bitmap = temp.bitmap;
/* copy all fields */
temp = *m;
/* reset the three fields we wanted to save */
temp.bitmap = bitmap;
temp.w = right - left + 1;
temp.h = bot - top + 1;
}
temp.xpos = xpos + left;
temp.ypos = ypos + top;
temp.baseline = baseline - (top);
temp.topline = topline - (top);
for (x = 0; x < temp.w; x++)
for (y = 0; y < temp.h; y++)
pbm_putpixel (temp.bitmap, x, y, pbm_getpixel (m->bitmap, x + left, y + top));
marktype_free (m);
if (m->name) {
temp.name = (char *) realloc (temp.name, sizeof (char) * (strlen (m->name) + 1));
strcpy (temp.name, m->name);
}
marktype_calc_centroid (&temp);
*m = temp;
}
void
marklist_append(marklistptr *list, marklistptr append)
{
marklistptr step=*list, step_append;
for(step_append=append; step_append; step_append=step_append->next){
if((*list)==NULL){
step=marklist_addcopy(list,step_append->data);
} else {
step=marklist_addcopy(&step,step_append->data);
}
}
}
/*
* marklist_average, returns a newly created mark reprenting the average of
* the marklist.
*
* The name of the mark is set to "?".
*
* (Perhaps it would be a good idea to see if all the marks had the same
* name, and if they didn't set to "?" else copy the old name...)
*/
void
marklist_average (marklistptr list, marktype * avgmark)
{
int w = 0, h = 0;
int t = INT_MAX, b = 0, l = INT_MAX, r = 0, matched = 0;
marktype d, temp;
marklistptr step;
int **a=NULL;
int x, y;
int set;
if (list == NULL)
error ("marklist_average", "Can't average 'nothing'!", "");
for (step = list; step; step = step->next) {
matched++;
temp = step->data;
w = MAX (w, temp.w);
h = MAX (h, temp.h);
r = MAX (r, temp.xcen);
l = MIN (l, temp.xcen);
b = MAX (b, temp.ycen);
t = MIN (t, temp.ycen);
}
w = w + (r - l);
h = h + (b - t);
if (matched > 1) {
int x_off, y_off;
CALLOC_2D(a,w,h,int);
for (x = 0; x < w; x++)
for (y = 0; y < h; y++)
a[x][y] = 0;
for (step = list; step; step = step->next) {
x_off = r - step->data.xcen;
y_off = b - step->data.ycen;
for (x = 0; x < step->data.w; x++)
for (y = 0; y < step->data.h; y++)
if (pbm_getpixel (step->data.bitmap, x, y)){
assert(x+x_off>=0);
assert(x+x_off<w);
assert(y+y_off>=0);
assert(y+y_off<h);
a[x + x_off][y + y_off]++;
}
}
set = 0;
d.w = w;
d.h = h;
marktype_alloc (&d, w, h);
for (x = 0; x < w; x++)
for (y = 0; y < h; y++){
/* > gives better CR than >= */
if (a[x][y] > MAX (1, (matched / 2))) {
pbm_putpixel (d.bitmap, x, y, 1);
set++;
}
}
FREE_2D(a,w);
assert(set!=0);
marktype_adj_bound (&d);
d.set = set;
d.name = (char *) realloc (d.name, sizeof (char) * (strlen ("?") + 1));
strcpy (d.name, "?");
marktype_calc_centroid (&d);
/*marktype_area (&d);*/
} else
d = marktype_copy (list->data);
/* k_fill(&d,3);*/
*avgmark = d;
}
/*
* marklist_add, adds the mark to the list, note that the bitmap is not
* duplicated, it is just linked in. NB: Watch for pointer aliasing--use
* marklist_addcopy, if you don't want aliasing.
*/
marklistptr
marklist_add (marklistptr * list, marktype m)
{
marklistptr p;
if (*list == NULL) {
*list = (marklistptr) malloc (sizeof (marklisttype));
if ((*list) == NULL)
error ("marklist_add", "OUT of Memory in marklist_add", "");
p = *list;
} else {
p = *list;
while (p->next != NULL)
p = p->next;
p->next = (marklistptr) malloc (sizeof (marklisttype));
if (p->next == NULL)
error ("marklist_add", "OUT of Memory in marklist_add", "");
p = p->next;
}
p->data = m;
p->next = NULL;
return p;
}
/*
* marklist_addcopy, creates a copy of the mark (creates a new bitmap),
* and adds to the list.
*/
marklistptr
marklist_addcopy (marklistptr * list, marktype m)
{
marktype d;
d = marktype_copy (m);
return marklist_add (list, d);
}
int
marklist_length (marklistptr list)
{
int count = 0;
while (list) {
count++;
list = list->next;
}
return count;
}
void
marklist_dump (FILE * fp, marklistptr list)
{
int count = 0;
while (list) {
marktype_dump (fp, list->data);
count++;
list = list->next;
}
}
void
marklist_stats (const marklistptr list, FILE *fp)
{
float area=0;
float w_area=0;
float width=0;
float height=0;
int num=0;
marklistptr step;
marktype im2;
if(fp==NULL)
return;
marklist_reconstruct_only_wh (list, &im2);
step=list;
while (step) {
area+=step->data.set;
w_area+=((step->data.w*step->data.h)-step->data.set);
width+=step->data.w;
height+=step->data.h;
num++;
step = step->next;
}
fprintf(fp,"Num_in_list: %d\n",num);
fprintf(fp,"Image_width: %d\n",im2.w);
fprintf(fp,"Image_height: %d\n",im2.h);
fprintf(fp,"lib_black_pixels: %.0f\n",area);
fprintf(fp,"lib_white_pixels: %.0f\n",w_area);
fprintf(fp,"Percent_area_in_lib: %.1f\n",(w_area+area)*100.0/(im2.w*im2.h));
fprintf(fp,"Mark_avg_black_area: %.1f\n",area/num);
fprintf(fp,"Mark_avg_white_area: %.1f\n",w_area/num);
fprintf(fp,"Mark_avg_width: %.1f\n",width/num);
fprintf(fp,"Mark_avg_height: %.1f\n",height/num);
}
/*
* marklist_getat, gets the mark from position [0, marklist_length-1]
*/
marklistptr
marklist_getat (marklistptr list, int pos, marktype * d)
{
int count = 0;
while (list) {
if (count == pos) {
*d = list->data;
return list;
}
count++;
list = list->next;
}
fprintf (stderr, "marklist_getat(): access off ends of list: pos %d\n", pos);
/*abort ();*/
return NULL;
}
void
marklist_free (marklistptr * list)
{
marklistptr n;
while ((*list) != NULL) {
n = (*list)->next;
marktype_free (&((*list)->data));
/* pbm_free(&((*list)->data.bitmap),(*list)->data.h); */
free ((*list));
(*list) = n;
}
}
int
marklist_removeat (marklistptr * list, int pos)
{
marklistptr c, n, p = NULL;
int count = 0;
if ((pos == 0) && (*list)) { /* if removing the 1st element */
/* change courtesy of Tim Theobald (Pegasus software) */
p = *list;
*list = (*list)->next;
marktype_free(&(p->data));
free(p);
return 1;
} else {
c = *list;
while (c) {
if (count == pos) { /* two cases, no previous, >=1 previous */
if (p == NULL) { /* no previous */
n = c->next;
marktype_free (&(c->data));
free (c);
c = n;
return 1;
} else {
/* >=1 previous */
n = c->next;
marktype_free (&(c->data));
free (c);
p->next = n;
return 1;
}
}
count++;
p = c;
c = c->next;
}
}
fprintf (stderr, "marklist_removeat(): access off ends of list: pos %d\n", pos);
/*abort ();*/
return 0; /* nothing was removed */
}
marklistptr
marklist_next (marklistptr list)
{
return list->next;
}
/* only writes out ascii form */
void
marktype_writeascii (FILE * fp, marktype d)
{
int r, c, rows, cols;
int xtot = d.xcen, ytot = d.ycen;
rows = d.h;
cols = d.w;
/*
* calls calc_centroid, so the C is placed in the correct location
*/
marktype_calc_centroid (&d);
marktype_area (&d);
fprintf (fp, "Mark: %d\n", d.symnum);
fprintf (fp, "Char: %s\n", (d.name == NULL) ? "?" : d.name);
fprintf (fp, "Baseline: %d\n", d.baseline);
fprintf (fp, "Topline: %d\n", d.topline);
fprintf (fp, "Xpos: %d\n", d.xpos);
fprintf (fp, "Ypos: %d\n", d.ypos);
fprintf (fp, "ImageW: %d\n", d.imagew);
fprintf (fp, "ImageH: %d\n", d.imageh);
fprintf (fp, "Cols: %d Rows: %d\n", d.w, d.h);
for (r = 0; r < d.h; r++) {
for (c = 0; c < d.w; c++)
if ((r == ytot) && (c == xtot))
putc (pbm_getpixel (d.bitmap, c, r) ? 'C' : '!', fp);
else
putc (pbm_getpixel (d.bitmap, c, r) ? 'X' : '.', fp);
putc ('\n', fp);
}
}
marklistptr
marklist_prune_under_pixels (marklistptr * list, int pixels, int _temp)
{
int count, i, deleted=0, num=0;
marktype d;
marklistptr ret=NULL,step;
if (pixels > 0) {
count = marklist_length (*list);
i = 0;
if (count)
do {
marklist_getat (*list, i, &d);
if (d.set <= pixels) {
if(ret==NULL)
step=marklist_addcopy(&ret,d);
else
step=marklist_addcopy(&step,d);
marklist_removeat (list, i);
i--;
count--;
deleted+=d.set;
num++;
}
i++;
}
while (i < count);
}
return ret;
}
marklistptr
marklist_prune_under_area (marklistptr * list, float area_mm, int DPI)
{
int count, i,deleted=0,num=0;
marktype d;
int pixels;
marklistptr ret=NULL,step;
pixels = ROUND ((area_mm / 25.4 / 25.4) * (DPI * DPI));
/*fprintf(stderr,"under %d\n",pixels);*/
if (pixels > 0) {
count = marklist_length (*list);
i = 0;
if (count)
do {
marklist_getat (*list, i, &d);
if (d.set <= pixels) {
if(ret==NULL)
step=marklist_addcopy(&ret,d);
else
step=marklist_addcopy(&step,d);
marklist_removeat (list, i);
i--;
count--;
deleted+=d.set;
num++;
}
i++;
}
while (i < count);
}
/*fprintf(stderr,"%d (%d pixels)\n",num,deleted);*/
return ret;
}
void
marklist_prune_over_area (marklistptr * list, float area_mm, int DPI)
{
int count, i;
marktype d;
int pixels;
pixels = ROUND ((area_mm / 25.4 / 25.4) * (DPI * DPI));
/*fprintf(stderr,"over %d\n",pixels);*/
if (pixels > 0) {
count = marklist_length (*list);
i = 0;
if (count)
do {
marklist_getat (*list, i, &d);
if (d.set >= pixels) {
marklist_removeat (list, i);
i--;
count--;
}
i++;
}
while (i < count);
}
}
void
marklist_prune_under_size (marklistptr * list, float size_mm, int DPI)
{
int count, i;
marktype d;
int pixels;
pixels = mm2pixels (size_mm, DPI);
if (pixels) {
count = marklist_length (*list);
i = 0;
if (count)
do {
marklist_getat (*list, i, &d);
if ((d.w <= pixels) || (d.h <= pixels)) {
marklist_removeat (list, i);
i--;
count--;
}
i++;
}
while (i < count);
}
}
void
marklist_prune_over_size (marklistptr * list, float size_mm, int DPI)
{
int count, i;
marktype d;
int pixels;
pixels = mm2pixels (size_mm, DPI);
if (pixels) {
count = marklist_length (*list);
i = 0;
if (count)
do {
marklist_getat (*list, i, &d);
if ((d.w > pixels) || (d.h > pixels)) {
marklist_removeat (list, i);
i--;
count--;
}
i++;
}
while (i < count);
}
}
static int MAX_FS = 8192;
static int bottom = 0, top = 0;
typedef struct {
unsigned short x, y;
} fillpostype;
fillpostype *filla = NULL;
#define push(i,j) \
if(top==MAX_FS){\
MAX_FS+=8192;\
REALLOC(filla,MAX_FS,fillpostype);}\
filla[top].x=i;\
filla[top].y=j;\
top=(top+1);
#define pop(i,j) \
top=(top-1);\
i=filla[top].x;\
j=filla[top].y
void
marktype_fill_cleanup(void)
{
if(filla)
free(filla);
filla=NULL;
MAX_FS = 8192;
}
void
marktype_fillextract8 (marktype image,
marktype * mark,
int i, int j, int xl, int yt,
unsigned int lookfor, unsigned int fillcol)
{
static int l, r, t, start_up, start_down;
static int m_in, m_ax;
bottom = top = 0;
if (filla == NULL)
CALLOC (filla, MAX_FS, fillpostype);
if (pbm_getpixel (image.bitmap, i, j) == fillcol)
return;
push (i, j);
while (top != bottom) {
pop (l, j);
r = l;
while ((l - 1 >= 0) && (pbm_getpixel (image.bitmap, l - 1, j) == lookfor))
l--;
while ((r + 1 < image.w) && (pbm_getpixel (image.bitmap, r + 1, j) == lookfor))
r++;
start_up = start_down = 1;
m_in = MIN (r + 1, image.w - 1);
m_ax = MAX (l - 1, 0);
for (t = m_in; t >= m_ax; t--) {
if ((t >= l) && (t <= r)) {
/*pbm_putpixel (image.bitmap, t, j, fillcol);*/
ppix(image,t,j,fillcol);
if (mark)
/*pbm_putpixel (mark->bitmap, t - xl, j - yt, 1);*/
ppix((*mark), t-xl, j-yt, 1);
}
if ((j - 1 >= 0) && (pbm_getpixel (image.bitmap, t, j - 1) == lookfor)) {
if (start_up) {
push (t, j - 1);
start_up = 0;
}
} else
start_up = 1;
if ((j + 1 < image.h) && (pbm_getpixel (image.bitmap, t, j + 1) == lookfor)) {
if (start_down) {
push (t, j + 1);
start_down = 0;
}
} else
start_down = 1;
}
}
}
void
marktype_fillextract4 (marktype image,
marktype * mark,
int i, int j, int xl, int yt,
unsigned int lookfor, unsigned int fillcol)
{
int l, r, t, start_up, start_down;
top = bottom = 0;
if (filla == NULL)
CALLOC (filla, MAX_FS, fillpostype);
if (pbm_getpixel (image.bitmap, i, j) == fillcol)
return;
push (i, j);
while (top != bottom) {
pop (l, j);
r = l;
while ((l - 1 >= 0) && (pbm_getpixel (image.bitmap, l - 1, j) == lookfor))
l--;
while ((r + 1 < image.w) && (pbm_getpixel (image.bitmap, r + 1, j) == lookfor))
r++;
start_up = start_down = 1;
for (t = MIN (r, image.w - 1); t >= MAX (l, 0); t--) {
if ((t >= l) && (t <= r)) {
/*pbm_putpixel (image.bitmap, t, j, fillcol);*/
ppix(image,t,j,fillcol);
if (mark)
/*pbm_putpixel (mark->bitmap, t - xl, j - yt, 1);*/
ppix((*mark), t-xl, j-yt, 1);
}
if ((j - 1 >= 0) && (pbm_getpixel (image.bitmap, t, j - 1) == lookfor)) {
if (start_up) {
push (t, j - 1);
start_up = 0;
}
} else
start_up = 1;
if ((j + 1 < image.h) && (pbm_getpixel (image.bitmap, t, j + 1) == lookfor)) {
if (start_down) {
push (t, j + 1);
start_down = 0;
}
} else
start_down = 1;
}
}
}
void
marktype_line (marktype im, int x1, int y1, int x2, int y2)
{
int x, y, sigx, sigy;
int absx, absy, d, dx, dy;
dx = x2 - x1;
if (dx < 0) {
absx = -dx;
sigx = -1;
} else {
absx = dx;
sigx = 1;
}
absx = absx << 1;
dy = y2 - y1;
if (dy < 0) {
absy = -dy;
sigy = -1;
} else {
absy = dy;
sigy = 1;
}
absy = absy << 1;
x = x1;
y = y1;
if (absx > absy) {
d = absy - (absx > 1);
while (1) {
ppix (im, x, y, 1);
/* pbm_putpixel(im.bitmap,x,y,1); */
if (x == x2)
return;
if (d >= 0) {
y += sigy;
d -= absx;
}
x += sigx;
d += absy;
}
} else {
d = absx - (absy > 1);
while (1) {
ppix (im, x, y, 1);
/* pbm_putpixel(im.bitmap,x,y,1); */
if (y == y2)
return;
if (d >= 0) {
x += sigx;
d -= absy;
}
y += sigy;
d += absx;
}
}
}
/* range inclusive */
marktype
marktype_getfrom(marktype image,
int x1,int y1,
int x2,int y2)
{
int w,h,i,j,p;
int set=0;
marktype m;
w=x2-x1+1;
h=y2-y1+1;
/* copy over all the fields */
m=image;
{
marktype m2;
marktype_alloc(&m2,w,h);
m.w=m2.w;
m.h=m2.h;
m.bitmap=m2.bitmap;
m.name=NULL;
}
for(j=0;j<h;j++)
for(i=0;i<w;i++){
p=gpix(image,x1+i,y1+j);
if(p){
set++;
ppix(m,i,j,p);
}
}
m.set=set;
m.xpos+=x1;
m.ypos+=y1;
marktype_calc_centroid(&m);
return m;
}
int marktype_crc(marktype *m)
{
int i,j;
int crc=13;
int p;
assert(m);
for(j=0;j<m->h;j++){
for(i=0;i<m->w;i++){
p=gpix((*m),i,j);
crc=3+(p+7)*i*j+crc+i+j*2;
}
}
return crc;
}
/*
* list_bound_size
*
* Split large marks into a set of smaller marks. A
* mark is split if the width **and** the height are
* too large.
*/
marklistptr
list_bound_size(marklistptr list,
int bound_w,
int bound_h)
{
marklistptr step=NULL,step2=NULL,list2=NULL;
int pos;
/* shortcut */
if((bound_w==0) && (bound_h==0)){
return list;
}
for(pos=0,step=list ; step ; pos++,step=step->next){
int s_w=1,s_h=1;
if(bound_w)
s_w=(int)ceil(step->data.w*1.0/bound_w);
if(bound_h)
s_h=(int)ceil(step->data.h*1.0/bound_h);
/* if we need to split it */
if( (s_w>1) || (s_h>1) ){
int i,j;
for(j=0;j<s_h;j++){
for(i=0;i<s_w;i++){
int x1,x2,y1,y2;
marktype get;
if(bound_w){
x1=i*bound_w;
x2=((i+1)*bound_w)-1; if(x2>=step->data.w) x2=step->data.w-1;
} else {
x1=0;x2=step->data.w-1;
}
if(bound_h){
y1=j*bound_h;
y2=((j+1)*bound_h)-1; if(y2>=step->data.h) y2=step->data.h-1;
} else {
y1=0;y2=step->data.h-1;
}
get=marktype_getfrom(step->data,x1,y1,x2,y2);
if(get.set){
/* fprintf(stderr,"pos: %d (%d %d, into %dx%d) -- %d %d %d %d\n",pos,
step->data.w,step->data.h,s_w,s_h,
x1,y1,x2,y2);*/
/* add each of the marks in the sub-regions */
if(step2==NULL){
step2=marklist_addcopy(&list2,get);
} else {
step2=marklist_addcopy(&step2,get);
}
}
}
}
} else {
/* didn't need to split it, so we'll just copy it */
if(step2==NULL){
step2=marklist_addcopy(&list2,step->data);
} else {
step2=marklist_addcopy(&step2,step->data);
}
}
}
marklist_free(&list);
return list2;
}
/*
* only reads in ascii library
*/
int
marktype_readascii (FILE * fp, marktype * d)
{
int r, c, rows,cols,numread, ch1 = 'C';
char *str1=NULL, *line=NULL, *str2=NULL;
int symnum, xpos, ypos, baseline,topline, imagew, imageh;
int atleast=0;
rows=cols=-1;
symnum=xpos=ypos=baseline=topline=imagew=imageh=0;
atleast=0; /* Mark:, Char: and Cols: must appear for each mark */
while (1) {
if((line=fgoodgets(fp))==NULL)
return 1;
str1=(char*)strdup(line);
numread = sscanf (line, "%s", str1);
if (numread != 1) {
fprintf (stderr, "%s: -> %s, %d\n", line, str1, numread);
free(str1);
free(line);
return 0;
}
if (strcmp (str1, "Mark:") == 0) {
sscanf (line, "%*s %d", &symnum);
atleast++;
} else if (strcmp (str1, "Char:") == 0) {
if(str2)free(str2);
str2=(char*)strdup(line);
sscanf (line, "%*s %s", str2);
atleast++;
} else if (strcmp (str1, "Baseline:") == 0) {
sscanf (line, "%*s %d", &baseline);
} else if (strcmp (str1, "Topline:") == 0) {
sscanf (line, "%*s %d", &topline);
} else if (strcmp (str1, "Xpos:") == 0) {
sscanf (line, "%*s %d", &xpos);
} else if (strcmp (str1, "Ypos:") == 0) {
sscanf (line, "%*s %d", &ypos);
} else if (strcmp (str1, "ImageW:") == 0) {
sscanf (line, "%*s %d", &imagew);
} else if (strcmp (str1, "ImageH:") == 0) {
sscanf (line, "%*s %d", &imageh);
} else if (strcmp (str1, "Cols:") == 0) {
atleast++;
sscanf (line, "%*s %d %*s %d\n", &cols, &rows);
/* Cols: %d Rows: %d, is the last set of options, so we break */
free(str1);str1=NULL;
free(line);line=NULL;
break;
}
free(str1);str1=NULL;
free(line);line=NULL;
}
if ((cols < 0) || (rows < 0) || (atleast<3))
return 0;
marktype_alloc (d, cols, rows);
d->symnum = symnum;
d->xpos = (short) xpos;
d->ypos = (short) ypos;
d->baseline = baseline;
d->topline = topline;
{
int alloclen=2;
if(str2)
alloclen=strlen(str2)+1;
d->name = (char *) realloc (d->name, sizeof (char) * alloclen);
}
d->imagew = imagew;
d->imageh = imageh;
if(str2==NULL)
strcpy(d->name, "?");
else{
strcpy(d->name,str2);
free(str2);
}
for (r = 0; r < rows; r++) {
for (c = 0; c < cols; c++) {
ch1 = getc (fp);
if ((ch1 == 'X') || (ch1 == 'C'))
pbm_putpixel (d->bitmap, c, r, 1);
else
pbm_putpixel (d->bitmap, c, r, 0);
}
ch1 = getc (fp);
}
marktype_calc_centroid (d);
marktype_area (d);
return 1;
}
/* reads a library, ignore the mark num in the file, simply overwrites */
int
marklist_readascii (char libraryname[], marklistptr * library)
{
int err, count;
FILE *lib;
marktype d;
marklistptr step;
marktype_init (&d);
if (strcmp (libraryname, "stdin") == 0)
lib = stdin;
else if (strcmp (libraryname, "-") == 0)
lib = stdin;
else
lib = fopen (libraryname, "rb");
if (lib == NULL) {
fprintf (stderr, "marklist_readascii(): Trouble opening library file '%s'.\n", libraryname);
exit (1);
}
*library = NULL;
count = 0;
while (!isEOF (lib)) {
err = marktype_readascii (lib, &d);
if (!err)
error ("marklist_readascii()", "unknown format of the library file.", "");
d.symnum = count;
count++;
if ((*library) == NULL)
step = marklist_add (library, d);
else
step = marklist_add (&step, d);
}
count = marklist_length (*library);
if ((strcmp (libraryname, "stdin") != 0) &&
(strcmp (libraryname, "-") != 0)){
fclose(lib);
}
return count;
}
void
marklist_writeascii (char libraryname[], marklistptr library)
{
FILE *lib;
marklistptr step;
if (strcmp (libraryname, "stderr") == 0)
lib = stderr;
else if (strcmp (libraryname, "stdout") == 0)
lib = stdout;
else if (strcmp (libraryname, "-") == 0)
lib = stdout;
else
lib = fopen (libraryname, "wb");
if (lib == NULL) {
fprintf (stderr, "marklist_writeascii(): can't create file '%s'.\n", libraryname);
return;
}
for (step = library; step; step = step->next) {
marktype_writeascii (lib, step->data);
}
fclose (lib);
}
|
Added work/contrib/tic/tic98/marklist.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
|
#ifndef __MARKLIST_H
#define __MARKLIST_H
#include <stdlib.h>
#include <stdio.h>
#include "pbmtools.h"
#define ppix(image,c,r,v)\
pbm_putpixel_trunc(image.bitmap,c,r,v,image.w,image.h)
#define gpix(image,c,r)\
(pbm_getpixel_trunc(image.bitmap,c,r,image.w,image.h))
typedef struct {
int symnum; /* component number during processing */
short xpos,ypos; /* the top left position in the document */
int w,h; /* the width/height of the component */
short xcen,ycen; /* the centroid positions */
float d_xcen,d_ycen; /* the centroid positions */
short xoffset,yoffset;
short baseline;
short topline;
char *name;
Pixel **bitmap;
short resolution; /* in dpi */
int imagew,imageh;
short h_runs,v_runs;
unsigned char start_of_line;
short grp;
float skew_of_line;
int ypos_of_line;
int set;
} marktype;
typedef struct marklisttype *marklistptr;
typedef struct marklisttype {
marktype data;
marklistptr next;
}marklisttype;
/* The following functions operate on the 'marktype' */
void marktype_read(FILE *fp, marktype *im);
void marktype_write(FILE *fp, const marktype im);
int marktype_readnamed(char *fn, marktype *im);
void marktype_writenamed(char *fn, marktype im);
void marktype_dump(FILE *fp,marktype d);
marktype marktype_copy(marktype d);
void marktype_alloc(marktype *d,int w, int h);
void marktype_init(marktype *d);
void marktype_free(marktype *d);
void marktype_fill_cleanup(void);
void marktype_calc_centroid(marktype *b);
void marktype_adj_bound(marktype *m);
void marktype_area(marktype *m);
void marktype_placeat(marktype image, marktype mark,int x, int y);
marktype marktype_getfrom(marktype image, int x1,int y1,int x2,int y2);
int marktype_wh_runs(marktype d);
int marktype_wv_runs(marktype d);
int marktype_bh_runs(marktype d);
int marktype_bv_runs(marktype d);
void marktype_fill8(marktype image, int i, int j, unsigned int lookfor, unsigned int fillcol);
void marktype_fill4(marktype image, int i, int j, unsigned int lookfor, unsigned int fillcol);
void marktype_fillextract8(marktype image,marktype *mark,int i,int j,int xl,int yt,unsigned int lookfor, unsigned int fillcol);
void marktype_fillextract4(marktype image,marktype *mark,int i,int j,int xl,int yt,unsigned int lookfor, unsigned int fillcol);
void marktype_line(marktype im,int x1,int y11,int x2, int y2);
int marktype_readascii(FILE *fp, marktype *d);
void marktype_writeascii(FILE *fp, marktype d);
/* whereas the following functions operate on a list of marktype's, named a 'marklist' */
void marklist_append(marklistptr *list, marklistptr append);
void marklist_average(marklistptr list, marktype *avgmark);
marklistptr marklist_add(marklistptr *list, marktype m);
marklistptr marklist_addcopy(marklistptr *list, marktype m);
int marklist_length(marklistptr list);
void marklist_dump(FILE *fp, marklistptr list);
marklistptr marklist_getat(marklistptr list, int pos, marktype *d);
void marklist_free(marklistptr *list);
int marklist_removeat(marklistptr *list, int pos);
marklistptr marklist_next(marklistptr list);
marklistptr marklist_prune_under_pixels (marklistptr * list, int pixels, int DPI);
marklistptr marklist_prune_under_area(marklistptr *list, float area_mm, int DPI);
void marklist_prune_over_area(marklistptr *list, float area_mm, int DPI);
void marklist_prune_under_size(marklistptr *list, float size_mm, int DPI);
void marklist_prune_over_size(marklistptr *list, float size_mm, int DPI);
int marklist_readascii(char libraryname[], marklistptr *library);
void marklist_writeascii(char libraryname[], marklistptr library);
void marklist_reconstruct(marklistptr list, marktype *im);
void marklist_reconstruct_using_wh (marklistptr list, marktype * im, int w, int h);
void marklist_reconstruct_show_lines(marklistptr list, marktype *im);
float rms_pbm_diff(marktype bm1, marktype bm2);
void marklist_reconstruct_only_wh (const marklistptr list, marktype * im);
int marktype_crc(marktype *m);
void marklist_stats (const marklistptr list, FILE *fp);
marklistptr list_bound_size(marklistptr list,int bound_w,int bound_h);
#endif
|
Added work/contrib/tic/tic98/math-utils.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
/*****************************************************************************
*
* Author: Stuart Inglis <singlis@waikato.ac.nz>
*
*
* This file contains functions which are common utilities
*
*****************************************************************************/
#include <stdio.h>
#include <math.h>
#include "marklist.h"
#include "pbmtools.h"
#include "utils.h"
#include "math-utils.h"
double pow_0(double p, double q)
{
if((p==0.0)&&(q==0.0))
return 0;
else return pow(p,q);
}
void setdp(float *f, int dp)
{
int l,i;
double scale;
scale=1.0;
for(i=0;i<dp;i++)
scale*=10;
/* scale=exp10((double)dp);*/
l=(int)((*f)*scale+0.5);
*f=(float)(l/scale);
}
/*
returns between -pi and +pi, ie. [-180 to +180)
| +pi/2 (90)
|
|
|
-180 -----------+------------- 0
(-pi) |
|
|
| -pi/2 (-90)
to normalise between [-90, 90),
if(ang>90) ang=ang-180;
else if (ang<-90) ang=ang+180;
*/
double atan_xy(double yd, double xd)
{
double angle;
angle=atan2(yd,xd); /* returns a result between (-PI, PI] */
while(angle>=PI)
angle=angle-2*PI;/* now returns a result between [-PI, PI) */
/* assert((angle>=-PI) && (angle<PI));*/
return angle;
}
|
Added work/contrib/tic/tic98/math-utils.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
/*****************************************************************************
*
* Author: Stuart Inglis <singlis@waikato.ac.nz>
*
*
* This file contains functions which are common utilities
*
*****************************************************************************/
#ifndef __MATH_UTILS_H
#define __MATH_UTILS_H
double pow_0(double p, double q);
void setdp(float *f, int dp);
double atan_xy(double yd, double xd);
#endif
|
Added work/contrib/tic/tic98/page_features.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
|
/*
* Author:
* Stuart Inglis (singlis@internz.co.nz)
* (c) 1994-1998
*
* Implementation of lossless textual image compression, using
* adaptive library encoding and averaging.
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "globals.h"
#include "tic98.h"
#include "getopt.h"
#include "boundary.h"
#include "sort_lines.h"
#include "timer.h"
#include "rotate.h"
#include "line.h"
#include "docstrum.h"
#include "codebilevel.h"
static char default_template[]={
".ppppp.;"
"pp222pp;"
"p22222p;"
"p22*...;"
};
void
dump_header()
{
fprintf(stdout,"@arff 3
@relation features
@attribute 'Number' real
@attribute 'Area' real
@attribute 'Avg_area' real
@attribute 'Density' real
@attribute 'Aspect' real
@attribute 'Holes' real
@attribute 'Edges' real
@attribute 'class' string range ( {?} )
@data
");
}
void
calc_features(marklistptr *list)
{
int len=0;
float area=0;
float avg=0,avg_t=0;
float avg_area=0;
float density=0,density_t=0;
float aspect=0,aspect_t=0;
float holes=0,holes_t=0;
float edge=0,edge_t=0;
marklistptr step=NULL;
len=marklist_length(*list);
for(step=*list; step; step=step->next){
area+=step->data.set;
}
if(len)
avg_area=area/len;
for(step=*list; step; step=step->next){
density=(step->data.set*1.0/(step->data.w*step->data.h));
density_t+=density;
}
if(len)
density=density_t/len;
for(step=*list; step; step=step->next){
aspect=(step->data.w*1.0/step->data.h);
aspect_t+=aspect;
}
if(len)
aspect=aspect_t/len;
for(step=*list; step; step=step->next){
marktype copy;
marklistptr list2;
int i,j;
int w,h;
w=step->data.w+2;
h=step->data.h+2;
marktype_alloc(©,w,h);
marktype_placeat(copy,step->data,1,1);
for(j=0;j<copy.h;j++)
for(i=0;i<copy.w;i++){
int p=gpix(copy,i,j);
ppix(copy,i,j,!p);
}
list2=extract_all_marks(NULL,copy,1,8);
holes=marklist_length(list2)-1; if(holes<0) holes=0;
holes_t+=holes;
marklist_free(&list2);
marktype_free(©);
}
if(len)
holes=holes_t/len;
for(step=*list; step; step=step->next){
int i,j,p;
edge=0;
for(j=0;j<step->data.h;j++)
for(i=0;i<step->data.w;i++){
p=gpix(step->data,i,j);
if((gpix(step->data,i-1,j)!=p) || (gpix(step->data,i,j-1)!=p))
edge++;
}
edge_t+=edge*1.0/(step->data.w*step->data.h);
}
if(len)
edge=edge_t/len;
fprintf(stdout,"%d, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f",len,area,avg_area,density,aspect,holes,edge);
}
void
extract_marks_from_zones(marktype image)
{
FILE *fp;
fp=fopen(globals.g_layout_filename,"rt");
if(fp){
char s[100],tag[100];
while(fgets(s,100,fp)){
int x1,y1,x2,y2;
int i,j;
marklistptr list=NULL;
sscanf(s,"%*s %s %d %d %d %d\n",tag,&x1,&y1,&x2,&y2);
fprintf(stderr,"%s %d %d %d %d\n",tag,x1,y1,x2,y2);
list=extract_all_marks_bound(NULL,
image,
globals.g_extraction_nested,
globals.g_extraction_connectivity,
x1,y1,x2,y2);
calc_features(&list);
fprintf(stdout,",%s\n",tag);
marklist_free(&list);
}
fclose(fp);
} else {
marklistptr list=NULL;
list=extract_all_marks_bound(list,
image,
globals.g_extraction_nested,
globals.g_extraction_connectivity,
0,0,image.w-1,image.h-1);
marklist_free(&list);
}
}
void
usage(void)
{
fprintf(stderr,
"usage: \n"
"\ttic98 [-c -d] -i infile -o outfile\n"
"\n"
"options:\n"
" -c/d\tcompress or decompress an image\n"
" -i n\tSpecify an infile <n>(or series of files...)\n"
" -o n\tSpecify the outfile prefix <n>\n"
" -r n\trotate n degrees before processing\n"
" -s n\tset the known skew to be n degrees\n"
" -w n\tset the component width bound\n"
" -h n\tset the component height bound\n"
" -R m\tset the reading order mode to be m\n"
" -l l\tlog to file <l>\n"
" -Nn\t(N)ested extraction or (n)on-(n)ested extraction\n"
" -48\t4 or 8 connectivity\n"
" -P\tuse PPM to encode indices\n"
" -u\tupdate probabilities after encoding component\n"
" -D d\tset default resolution to d DPI\n"
"\n"
"information:\n"
"\tMultiple pages may be compressed using several\n"
"\t-i options. When the file is decompressed the\n"
"\t<outfile> name is used as a prefix, and the decompressed\n"
"\timages are named <outfile>.001, <outfile>.002, ...\n"
"\n"
"\tFor example:\n"
"\t tic98 -c -i page1.pbm -i page2.pbm -o compressed\n"
"\t tic98 -d -i compressed -o decompressed\n"
"\t xv decompressed.001 decompressed.002\n"
"\n"
"version:\n"
"\t20 Jan 1998\n"
);
exit(0);
}
int
main(int argc, char *args[])
{
int ch;
extern char *optarg;
int compress=1;
int i;
int num_in=0;
int num_out=0;
char **infilename=NULL;
char **outfilename=NULL;
globals_init();
while((ch = getopt(argc, args, "cD:di:o:U:uPnN48l:R:w:h:s:r:p:I:SOf:")) != -1)
switch(ch)
{
case 'f':
globals.g_layout_filename=(char*)strdup(optarg);
break;
case 'r':
globals.g_rotate_degs_before_processing=DEG2RAD(atof(optarg));break;
case 's':
globals.g_skew=DEG2RAD(atof(optarg));break;
case 'w':
globals.g_bound_w=atoi(optarg);break;
case 'h':
globals.g_bound_h=atoi(optarg);break;
case 'R':
if(strcasecmp(optarg,"howard")==0) globals.g_reading_order=EXTRACTION_HOWARD;
else if(strcasecmp(optarg,"zhang")==0) globals.g_reading_order=EXTRACTION_ZHANG;
else if(strcasecmp(optarg,"extraction")==0) globals.g_reading_order=EXTRACTION_ORDER;
else if(strcasecmp(optarg,"profile")==0) globals.g_reading_order=EXTRACTION_PROFILE;
else if(strcasecmp(optarg,"random")==0) globals.g_reading_order=EXTRACTION_RANDOM;
else if(strcasecmp(optarg,"docstrum")==0) globals.g_reading_order=EXTRACTION_DOCSTRUM;
else {
fprintf(stderr,"error: unknown Reading order mode\n");
exit(1);
}
break;
case 'l':
if(strcmp(optarg,"-")==0)
globals.g_logfile=stderr;
else
globals.g_logfile=fopen(optarg,"wt");
break;
case 'n':
globals.g_extraction_nested=0; break;
case 'N':
globals.g_extraction_nested=1; break;
case '4':
globals.g_extraction_connectivity=4; break;
case '8':
globals.g_extraction_connectivity=8; break;
case 'p':
globals.g_prune_under_area=atof(optarg);
break;
case 'P':
globals.g_use_ppm=!globals.g_use_ppm;
fprintf(stderr,"use_ppm: %d\n",globals.g_use_ppm);
break;
case 'D':
globals.g_default_resolution=atoi(optarg);
break;
case 'u':
globals.g_update_probs_after_encoding=1;
break;
case 'U': {
int i;
char *ss=(char*)strdup(optarg);
for(i=0;i<(int)strlen(ss);i++){
if(ss[i]==',') ss[i]=' ';
}
sscanf(ss,"%d %d %d %d %d %d",
&globals.g_context_init,
&globals.g_context_increment,
&globals.g_context_norm,
&globals.g_gamma_init,
&globals.g_gamma_increment,
&globals.g_gamma_norm
);
}
break;
case 'c':
compress=1;
break;
case 'd':
compress=0;
break;
case 'S':
globals.g_insert_spaces=1;
break;
case 'I':
globals.g_dump_indices=atoi(optarg);
if((globals.g_dump_indices<0) || (globals.g_dump_indices>2))
globals.g_dump_indices=0;
break;
case 'i':
infilename=(char**)realloc(infilename,sizeof(char*)*(num_in+1));
assert(infilename);
infilename[num_in++]=(char*)strdup(optarg);
break;
case 'o':
outfilename=(char**)realloc(outfilename,sizeof(char*)*(num_out+1));
assert(outfilename);
outfilename[num_out++]=(char*)strdup(optarg);
break;
case 'O':
globals.g_rotate_offsets=1;
break;
default:
usage();
}
for(;optind<argc;optind++){
usage();
}
if((infilename==NULL))
usage();
/*
* Arithmetic coders usually read/write to stdin/stdout, but here
* we'll reassign them to files with "b" mode for compatibility
* on non-unix machines
*/
for(i=0;i<num_in;i++){
int w,h;
marktype image;
if(marktype_readnamed(infilename[i],&image)!=0)
return 1;
extract_marks_from_zones(image);
marktype_free(&image);
}
free(infilename);
exit(0);
}
|
Added work/contrib/tic/tic98/pbm_to_coords.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
/*****************************************************************************
*
* Author: Stuart Inglis <singlis@waikato.ac.nz>
*
*
* Extracts the coordinates of components from an image. The origin
* is the lower left corner.
*
*****************************************************************************/
#include <stdlib.h>
#include <stdio.h>
#include "marklist.h"
#include "pbmtools.h"
#include "boundary.h"
#include "utils.h"
void
usage()
{
fprintf(stderr,"usage:\n"
"\tpbm_to_coords pbm > coords \n");
exit(1);
}
int
main(int argc, char *argv[])
{
int ch;
marklistptr list=NULL,step=NULL;
marktype image;
char *infile=NULL;
int conn=8;
int nested=1;
extern char *optarg;
extern int optind;
if(argc<2) usage();
list=NULL;
infile=argv[1];
if(infile==NULL)
exit(1);
if(marktype_readnamed(infile,&image)!=0)
exit(1);
marktype_area(&image);
list=extract_all_marks(list,image,nested,conn);
/*fprintf(stdout,"%d %d %d # num xcen l r ycen t b area\n",image.w,image.h,marklist_length(list));*/
for(step=list ; step ; step=step->next) {
fprintf(stdout,"%d %d %d %d %d %d %d %d\n",
step->data.symnum,
step->data.xpos+step->data.xcen,
step->data.xpos,
step->data.xpos+step->data.w-1,
step->data.ypos+step->data.ycen,
step->data.ypos,
step->data.ypos+step->data.h-1,
step->data.set
);
}
marklist_free(&list);
marktype_free(&image);
exit(0);
}
|
Added work/contrib/tic/tic98/pbm_to_node.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
/*****************************************************************************
*
* Author: Stuart Inglis <singlis@waikato.ac.nz>
*
*
* Extracts the coordinates of components from an image. The origin
* is the lower left corner.
*
*****************************************************************************/
#include <stdlib.h>
#include <stdio.h>
#include "marklist.h"
#include "pbmtools.h"
#include "boundary.h"
#include "utils.h"
void
usage()
{
fprintf(stderr,"usage:\n"
"\tpbm_to_node pbm > nodes \n");
exit(1);
}
int
main(int argc, char *argv[])
{
int ch;
marklistptr list=NULL,step=NULL;
marktype image;
char *infile=NULL;
int conn=8;
int nested=1;
extern char *optarg;
extern int optind;
int len,i,j;
int *xx,*yy;
if(argc<2) usage();
list=NULL;
infile=argv[1];
if(infile==NULL)
exit(1);
if(marktype_readnamed(infile,&image)!=0)
exit(1);
marktype_area(&image);
list=extract_all_marks(list,image,nested,conn);
len=marklist_length(list);
CALLOC(xx,len,int);
CALLOC(yy,len,int);
fprintf(stdout,"%d %d\n",len,len*(len-1));
for(i=0,step=list;step;i++,step=step->next){
xx[i]=step->data.xpos+step->data.xcen;
yy[i]=step->data.ypos+step->data.ycen;
}
for(i=0;i<len;i++){
if(!(i%10)){fprintf(stderr,"%d/%d\r",i,len-1);fflush(stderr);}
for(j=0;j<len;j++)if(i!=j){
float xd,yd,d;
xd=xx[i] - xx[j];
yd=yy[i] - yy[j];
d=xd*xd + yd*yd;
/*if(d<0)d=0;
d=sqrt(d);*/
printf("%d %d %d\n",i,j,(int)d);
}
}
marklist_free(&list);
marktype_free(&image);
exit(0);
}
|
Added work/contrib/tic/tic98/pbmclean.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
|
/*
* Author:
* Stuart Inglis (singlis@internz.co.nz)
* (c) 1994-1998
*
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "getopt.h"
#include "boundary.h"
void
calc_features(marklistptr *list)
{
int len=0;
float area=0;
float avg=0,avg_t=0;
float density=0,density_t=0;
float aspect=0,aspect_t=0;
float holes=0,holes_t=0;
marklistptr step=NULL;
len=marklist_length(*list);
for(step=*list; step; step=step->next){
area+=step->data.set;
}
for(step=*list; step; step=step->next){
density=(step->data.set*1.0/(step->data.w*step->data.h));
density_t+=density;
}
density=density_t/len;
for(step=*list; step; step=step->next){
aspect=(step->data.w*1.0/step->data.h);
aspect_t+=aspect;
}
aspect=aspect_t/len;
for(step=*list; step; step=step->next){
marktype copy;
marklistptr list2=NULL;
int i,j;
int w,h;
w=step->data.w+2;
h=step->data.h+2;
marktype_alloc(©,w,h);
marktype_placeat(copy,step->data,1,1);
for(j=0;j<copy.h;j++)
for(i=0;i<copy.w;i++){
int p=gpix(copy,i,j);
ppix(copy,i,j,!p);
}
list2=extract_all_marks(list2,copy,1,8);
holes=marklist_length(list2)-1; if(holes<0) holes=0;
holes_t+=holes;
marklist_free(&list2);
marktype_free(©);
}
holes=holes_t/len;
fprintf(stderr,"%d %.1f %.1f %.2f %.2f %.2f\n",len,area,area/len,density,aspect,holes);
}
marklistptr
imagefn_to_list(char *fn, int *w, int *h)
{
marktype image;
marklistptr list=NULL,list2=NULL;
if(marktype_readnamed(fn, &image)!=0)
return NULL;
*w=image.w;
*h=image.h;
if(image.resolution==0){
image.resolution=300;
}
/* rotate the image, keeping original size */
list=extract_all_marks(list,image, 1,4);
marklist_prune_under_area(&list,0.2,image.resolution);
marklist_prune_over_area(&list,4,image.resolution);
if(0){
marktype im;
marklist_reconstruct_show_lines (list, &im);
marktype_writenamed("-",im);
marktype_free(&im);
}
marktype_free(&image);
return list;
}
int
main(int argc, char *argv[])
{
int ch;
extern char *optarg;
int compress=1;
int num_in=0;
int num_out=0;
char **infilename=NULL;
char **outfilename=NULL;
int w,h;
marklistptr list=NULL;
int i,j;
char s[100];
if(argc<2)
exit(1);
for(i=1;i<argc;i++){
list=imagefn_to_list(argv[i],&w,&h);
strcpy(s,argv[i]);
for(j=0;j<strlen(s);j++)
if(s[j]=='.') s[j]=0;
fprintf(stderr,"%s ",s);
calc_features(&list);
marklist_free(&list);
}
exit(0);
}
|
Added work/contrib/tic/tic98/pbmtohough.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
// %Z% %Y% %M% version %I%, %G%
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "utils.h"
#include "marklist.h"
#include "pbmtools.h"
#include "boundary.h"
#include "timer.h"
#include "hough.h"
#include <math.h>
marktype image;
int VV=0;
void
calc_skew(double low,
double high,
double binsize,
int rdiv,
char *rawfilename,
int pixels,
int uselog)
{
if(pixels==0){
marktype bitmapcopy;
marklistptr list=NULL;
bitmapcopy=marktype_copy(image);
list=extract_all_marks(list,image,1,8);
hough_calc(list,image.w,image.h,low,high,binsize, rdiv,rawfilename,uselog);
} else {
hough_image_calc(&image,low,high,binsize, rdiv,rawfilename);
}
}
void usage()
{
fprintf(stderr,"usage: \n\tcalc_hough [options] <image>\n"
"options:\n"
" -p\tUse pixels instead of components\n"
" -L\tUse the log(component area) as the accumulator increment\n"
" -l n\tSets the low bound of the Hough transform to <n> (-90)\n"
" -h n\tSets the high bound of the Hough transform to <n> (90)\n"
" -b n\tSets the bin size to <n> (1)\n"
" -r n\tSets the r divisor to <n> (1)\n"
"\n"
);
exit(1);
}
int main(int argc, char *argv[])
{
int ch;
char *imagefilename=NULL;
int rdiv=1;
double low=-90,high=90;
double binsize=1;
int pixels=0;
char *rawfilename=NULL;
int uselog=0;
if(argc<2) usage();
while((ch = getopt(argc, argv, "pvb:r:f:l:h:L")) != -1)
switch(ch){
case 'p': pixels=1;break;
case 'b': binsize=atof(optarg); break;
case 'r': rdiv=atoi(optarg); break;
case 'f': rawfilename=optarg; break;
case 'L': uselog=1; break;
case 'l': low=atof(optarg); break;
case 'h': high=atof(optarg); break;
case '?':
usage();
}
for(; optind <argc; optind++){
if(imagefilename==NULL) imagefilename=strdup(argv[optind]);
else error(argv[0],"too many filenames","");
}
if(imagefilename==NULL){
usage();
}
if(marktype_readnamed(imagefilename,&image)){
fprintf(stderr,"error - can't open file %s\n",imagefilename);
exit(1);
}
calc_skew(low,high,binsize,rdiv,rawfilename,pixels,uselog);
return 0;
}
|
Added work/contrib/tic/tic98/pbmtomarks.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#include "boundary.h"
#include "template_match.h"
#include "marklist.h"
int
main(int argc, char *argv[])
{
marklistptr list=NULL,step=NULL;
marktype image;
int i,len,r,j,k,k2,k3,k4,k5,k6,k7;
float r1,r2;
char *a,*b;
srand(1);
marktype_readnamed(argv[1],&image);
list=extract_all_marks(list,image,1,8);
for(step=list;step;step=step->next){
marktype_writeascii(stdout,step->data);
}
marklist_free(&list);
marktype_free(&image);
return 0;
}
|
Added work/contrib/tic/tic98/pbmtools.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
|
/*
* Module: pbmtools
*
* Functions for reading/writing .pbm files and pixel
* manipulation.
*
* Author:
* Stuart Inglis (singlis@internz.co.nz)
* (c) 1998
*
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "marklist.h"
#include "pbmtools.h"
#include "utils.h"
void pbm_putpixel_range(Pixel **bitmap,int c,int r,int val, int cols, int rows)
{
if(((c)>=0)&&((c)<cols)&&((r)>=0)&&((r)<rows))
pbm_putpixel(bitmap,c,r,val);
else
fprintf(stderr,"putpitxel (%d %d) outside (%d %d)\n",c,r,cols,rows);
}
int pbm_getpixel_range(Pixel **bitmap,int c, int r, int cols, int rows)
{
if(((c)>=0)&&((c)<cols)&&((r)>=0)&&((r)<rows))
return pbm_getpixel(bitmap,c,r);
else {
fprintf(stderr,"getpixel (%d %d) outside (%d %d)\n",c,r,cols,rows);
return 0;
}
}
/*
Returns 1 if *fp points to a PBM (magic is P1 or P4) file.
leaves the fp in it's original position.
usage: if(pbm_isapbmfile(fp)) process(fp);
*/
int pbm_isapbmfile(FILE *fp)
{
unsigned short magic;
magic=magic_getshort(fp);
return ((magic==MAGIC_P4)||(magic==MAGIC_P1));
}
/*
Frees the memory used in the bitmap structure.
usage: pbm_free(&bitmap);
Sets bitmap to be NULL on return.
*/
void pbm_free(Pixel ***bitmap,int rows)
{
/* int r;*/
if(rows==0) rows++;
FREE_2D(*bitmap,rows);
/* for(r=0;r<rows;r++)
free((*bitmap)[r]);
free(*bitmap);*/
(*bitmap)=NULL;
}
/*
This function allocates the bitmap.
usage: bitmap=pbm_alloc(cols,rows);
*/
Pixel **pbm_alloc(int cols, int rows)
{
Pixel **p;
int newc=(cols+PBITS)/PBITS;
if(newc==0) newc++;
if(rows==0) rows++;
if(rows<0){fprintf(stderr,"error: rows=%d\n",rows);}
CALLOC_2D(p,rows,newc,Pixel);
return p;
}
Pixel **pbm_copy(Pixel **bitmap, int cols, int rows)
{
Pixel ** p;
int newc=(cols+PBITS)/PBITS;
int x,y;
if((cols==0)||(rows==0)) return NULL;
p=pbm_alloc(cols,rows);
for(x=0;x<newc;x++)
for(y=0;y<rows;y++)
p[y][x]=bitmap[y][x];
return p;
}
void pbm_clear(Pixel **bitmap, int cols, int rows)
{
int newc=(cols+PBITS)/PBITS;
int x,y;
for(x=0;x<newc;x++)
for(y=0;y<rows;y++)
bitmap[y][x]=0;
}
/*
Reads in a pbm file and returns a pointer to the allocated bitmap,
in the P4 format.
Assumes fp was opened and keeps it that way.
usage: bitmap=pbm_readfile(fp,&cols,&rows);
*/
Pixel **pbm_readfile(FILE *fp,int *cols, int *rows, short *resolution)
{
Pixel **p=NULL;
char *s=NULL;
unsigned char *buf;
int r,c,ii=0;
int p1=0,k;
int arg;
*resolution=0;
do {
if(s!=NULL)
free(s);
s=fgoodgets(fp);
} while(s[0]=='#');
if(strcmp(s,"P1")==0) p1=1;
else if(strcmp(s,"P4")==0) p1=0;
else error("pbm_readfile","only pbm files are supported","");
free(s);s=NULL;
do {
if(s!=NULL){
free(s);s=NULL;
}
s=fgoodgets(fp);
if(s){
if(strncmp(s,"# resolution: ",14)==0){
ii=sscanf(s,"%*s %*s %hd",resolution);
if(ii!=1) *resolution=0;
}
}
} while(s[0]=='#');
arg=sscanf(s,"%d %d",cols,rows);
free(s);s=NULL;
if(arg==1){
s=fgoodgets(fp);
arg=sscanf(s,"%d",rows);
if(arg!=1) error("pbm_readfile","bizzare pbm format","");
free(s);s=NULL;
}
p=pbm_alloc(*cols,*rows);
buf=(unsigned char*)malloc((*cols+2)*sizeof(unsigned char));
if(!buf) error("pbm_readfile","out of memory","");
if(p1){
for(r=0;r<*rows;r++)
for(c=0;c<*cols;c++){
fscanf(fp,"%d",&ii);
pbm_putpixel(p,c,r,ii);
}
}
else {
for(r=0;r<*rows;r++){
c=0;
k=fread(buf,1,(*cols+7)/8,fp);
if(k!=(*cols+7)/8){
fprintf(stderr,"*warning* file too short!\n");
}
for(c=0;c<*cols;c++){
if(!(c%8)) ii=buf[c/8];
if(ii<0) error("pbm_readfile","file reading error","");
if(ii&128) pbm_putpixel(p,c,r,1);
ii<<=1;
}
}
} /* p4 type */
free(buf);
return p;
}
/*
Writes a pbm file given a file pointer and bitmap. Assumes that
fp is already open, and keeps in that way.
usage: pbm_writefile(fp,bitmap,cols,rows);
*/
void pbm_writefile(FILE *fp,Pixel **bitmap,int cols, int rows, int resolution)
{
int r,c,ii=0,j;
unsigned char *buf;
buf=(unsigned char*)malloc(((cols+14)/8)*sizeof(unsigned char));
fprintf(fp,"%s\n","P4");
if(resolution)
fprintf(fp,"# resolution: %d\n",resolution);
fprintf(fp,"%d %d\n",cols,rows);
if((cols>0) && (rows>=0))
for(r=0;r<rows;r++){
for(c=0;c<cols;c+=8){
ii=0;
for(j=0;j<8;j++)
if(c+j<cols){
if(pbm_getpixel(bitmap,c+j,r)) ii|=(128>>j);
}
buf[c/8]=ii;
}
fwrite(buf,1,(cols+7)/8,fp);
}
free(buf);
if(ferror(fp)){
fprintf(stderr,"pbm_writefile: error occured while writing file.\n");
return ;
}
}
/*
Writes a pbm file given a file pointer and bitmap. Assumes that
fp is already open, and keeps in that way.
usage: pbm_writefile(fp,bitmap,cols,rows);
*/
void pbm_writefile_xy(FILE *fp,Pixel **bitmap, int x, int y,int cols, int rows, int resolution)
{
int r,c,ii=0,j;
unsigned char *buf;
buf=(unsigned char*)malloc(((cols+14)/8)*sizeof(unsigned char));
fprintf(fp,"%s\n","P4");
if(resolution)
fprintf(fp,"# resolution: %d\n",resolution);
fprintf(fp,"%d %d\n",cols,rows);
if((cols>0) && (rows>=0))
for(r=0;r<rows;r++){
for(c=0;c<cols;c+=8){
ii=0;
for(j=0;j<8;j++)
if(c+j<cols){
if(pbm_getpixel(bitmap,c+j,r)) ii|=(128>>j);
}
buf[c/8]=ii;
}
fwrite(buf,1,(cols+7)/8,fp);
}
free(buf);
if(ferror(fp)){
fprintf(stderr,"pbm_writefile: error occured while writing file.\n");
return ;
}
}
/* works best is cols is >= rows, and iterate x faster than y */
int **pgm_alloc(int cols, int rows)
{
int **p;
/* int i;*/
CALLOC_2D(p,rows,cols,int);
return p;
}
void pgm_free(int ***image,int rows)
{
/* int r;*/
FREE_2D(*image,rows);
/*
for(r=0;r<rows;r++)
free((*image)[r]);
free(*image);
*/
(*image)=NULL;
}
int ** pgm_read(FILE *fp, int *nc, int *nr, int *maxval)
{
int i,j;
char *s=NULL;
int ii=0;
int arg;
int **pp;
int p2=0;
do {
if(s) free(s);
s=fgoodgets(fp);
} while(s[0]=='#');
if((strcmp(s,"P5")!=0) && (strcmp(s,"P2")!=0))
error("pgm_read","only pgm P5/P2 files are supported","");
if(strcmp(s,"P2")==0)
p2=1;
free(s);s=NULL;
do {
if(s) free(s);
s=fgoodgets(fp);
} while(s[0]=='#');
arg=sscanf(s,"%d %d",nc,nr);
free(s);s=NULL;
do {
if(s) free(s);
s=fgoodgets(fp);
} while(s[0]=='#');
arg=sscanf(s,"%d",maxval);
free(s);s=NULL;
pp=pgm_alloc(*nc,*nr);
for(j=0;j<*nr;j++)
for(i=0;i<*nc;i++){
if(p2==0)
ii=fgetc(fp);
else
fscanf(fp,"%d",&ii);
pp[j][i]=ii;
}
return pp;
}
void pgm_write(FILE *fp, int **image, int nc, int nr, int maxval)
{
int x, y, c;
int p2;
if(maxval<=255) { /* go into P5 mode */
p2=0;
fprintf(fp, "P5\n");
fprintf(fp, "%d %d\n%d\n", nc, nr, maxval);
} else {
p2=1;
fprintf(fp, "P2\n");
fprintf(fp, "%d %d\n%d\n", nc, nr, maxval);
}
c = 0;
for (y = 0; y < nr; y++){
for (x = 0; x <nc; x++){
if(p2==1)
fprintf(fp, "%d ", pgm_getpixel(image,x,y));
else
fputc(pgm_getpixel(image,x,y),fp);
}
if(p2==1)
fprintf(fp,"\n");
}
fclose(fp);
}
|
Added work/contrib/tic/tic98/pbmtools.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
#ifndef __PBMTOOLS_H
#define __PBMTOOLS_H
#include "utils.h"
#include <stdio.h>
#include <sys/types.h>
typedef unsigned long Pixel;
typedef Pixel Gray;
/* 2^PSH = PBITS, ie. 2^5 = 32 */
#define PBITS 32
#define PSH 5
/* The next two are ordered pixels col0=left, cols31=right */
/*
#define pbm_getpixel(bitmap,c,r) \
((bitmap[r][(c)>>PSH] >> ((PBITS-1)-((c)&(PBITS-1))))&1)
#define pbm_putpixel(bitmap,c,r,val) \
if((val)) \
bitmap[r][(c)>>PSH] |= (((unsigned)1<<(PBITS-1)) >> ((c)&(PBITS-1))); \
else \
bitmap[r][(c)>>PSH] &= ~(((unsigned)1<<(PBITS-1)) >> ((c)&(PBITS-1)))
*/
/* The next two defines are ordered pixel cols0=right, cols31=left */
#define pbm_getpixel(bitmap,c,r) \
((bitmap[r][(c)>>PSH] >> ((c)&(PBITS-1)))&1)
#define pbm_putpixel(bitmap,c,r,val) \
if((val)) \
bitmap[r][(c)>>PSH] |= (1<<((c)&(PBITS-1))); \
else \
bitmap[r][(c)>>PSH] &= ~(1<<((c)&(PBITS-1)))
#define pbm_putpixel_trunc(bitmap,c,r,val,cols,rows) \
if(((c)>=0)&&((c)<cols)&&((r)>=0)&&((r)<rows)) \
pbm_putpixel(bitmap,c,r,val)
#define pbm_getpixel_trunc(bitmap,c,r,cols,rows) \
((((c)>=0)&&((c)<cols)&&((r)>=0)&&((r)<rows)) ? \
pbm_getpixel(bitmap,c,r) : 0)
int pbm_isapbmfile(FILE *fp);
void pbm_free(Pixel ***bitmap,int rows);
Pixel **pbm_copy(Pixel **bitmap, int cols, int rows);
Pixel **pbm_alloc(int cols, int rows);
Pixel **pbm_readfile(FILE *fp,int *cols, int *rows, short *resolution);
/*Pixel **pbm_readfile(FILE *fp,int *cols, int *rows);*/
void pbm_writefile(FILE *fp,Pixel **bitmap,int cols, int rows, int resolution);
void pbm_putpixel_range(Pixel **bitmap,int c,int r,int val, int cols, int rows);
int pbm_getpixel_range(Pixel **bitmap,int c, int r, int cols, int rows);
void pbm_clear(Pixel **bitmap, int cols, int rows);
#define pgm_getpixel(image,x,y) image[y][x]
#define pgm_putpixel(image,x,y,val) image[y][x]=val
int **pgm_alloc(int rows, int cols);
void pgm_free(int ***image,int rows);
void pgm_write(FILE *fp, int **image, int nc, int nr, int maxval);
int **pgm_read(FILE *fp, int *nc, int *nr, int *maxval);
#endif
|
Added work/contrib/tic/tic98/ppmd_dec.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
/* Decodes the encoded input file. */
#include <stdio.h>
#include <stdlib.h>
#include <getopt.h>
#include "ppmd_model.h"
#include "arithcode.h"
extern int debugLevel; /* for debugging purposes */
extern unsigned int max_order; /* maximum order of model */
int debugProgress = 0;
int max_symbol = 1000;
void
usage (void)
{
fprintf (stderr,
"Usage: encode [options] <input-text\n"
"\n"
"options:\n"
" -d n\tdebug level=n\n"
" -m n\tsymbol maximum=n\n"
" -o n\tmax order=n\n"
" -p n\tdebug progress=n\n"
);
exit (2);
}
void
init_arguments (int argc, char *argv[])
{
extern char *optarg;
/*extern int optind; */
int opt;
/* set defaults */
debugLevel = 0;
/* get the argument options */
while ((opt = getopt (argc, argv, "d:o:p:m:")) != -1)
switch (opt)
{
case 'm':
max_symbol = atoi (optarg);
break;
case 'd':
debugLevel = atoi (optarg);
break;
case 'o':
max_order = atoi (optarg);
break;
case 'p':
debugProgress = atoi (optarg);
break;
default:
usage();
break;
}
for (; optind < argc; optind++)
usage ();
}
void
report()
{
void report_model(); /* Report back on stats collected from the model */
/*fprintf( stderr, "\n");
report_model();*/
}
void
decode_file (FILE *fp)
{
unsigned int symbol, eof_sym, count;
count = 0;
InitArithDecoding();
init_ppmd_globals();
eof_sym = ppm_start_decoding (max_order, max_symbol);
while ((symbol = ppm_decode_symbol()) < eof_sym)
{
count++;
if ((debugProgress) && ((count % debugProgress) == 0))
fprintf (stderr, "decoded %d bytes...\n", count);
fprintf (fp, "%u\n", symbol);
}
CloseDownArithDecoding();
report();
}
int
main(int argc,char *argv[])
{
init_arguments (argc, argv);
decode_file (stdout);
return 0;
}
|
Added work/contrib/tic/tic98/ppmd_enc.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
/* Encodes the input file of integers. */
#include <stdio.h>
#include <stdlib.h>
#include <getopt.h>
#include "ppmd_model.h"
#include "arithcode.h"
#define MAX_LINE 128
extern int debugLevel; /* for debugging purposes */
extern int max_order; /* maximum order of model */
int max_symbol=1000;
int debugProgress = 0;
void
usage (void)
{
fprintf (stderr,
"Usage: encode [options] <input-text\n"
"\n"
"options:\n"
" -d n\tdebug level=n\n"
" -o n\tmax order=n\n"
" -m n\tmax symbol value=n\n"
" -p n\tdebug progress=n\n"
);
exit (2);
}
void
init_arguments (int argc, char *argv[])
{
extern char *optarg;
/*extern int optind; */
int opt;
/* set defaults */
debugLevel = 0;
/* get the argument options */
while ((opt = getopt (argc, argv, "d:o:p:m:")) != -1)
switch (opt)
{
case 'd':
debugLevel = atoi (optarg);
break;
case 'o':
max_order = atoi (optarg);
break;
case 'm':
max_symbol = atoi (optarg);
break;
case 'p':
debugProgress = atoi (optarg);
break;
default:
usage ();
break;
}
for (; optind < argc; optind++)
usage ();
}
int
getline (FILE *fp, char *s, int max)
/* Read line from FP into S; return its length (maximum length = MAX). */
{
int i;
char cc=0;
i = 0;
while ((--max > 0) && ((cc = getc(fp)) != EOF) && (cc != '\n'))
s [i++] = cc;
s [i] = '\0';
if (cc == EOF)
return (EOF);
else
return (i);
}
void
report (unsigned int model, int count)
{
void report_model(); /* Report back on stats collected from the model */
/* fprintf( stderr, "PPM* : %d bytes", bytes_output );*/
/*
if (bytes_input != 0) {
CR = (double) bytes_output / (double) bytes_input;
fprintf( stderr, ", %.6f bpi, CF=%4.2f, integers %d", CR*8,
1/CR, count);
}
fprintf( stderr, "\n");
*/
/*printFree( stderr );*/
if (model)
report_model();
}
void
encode_file(FILE *fp)
{
unsigned int n, count;
int len;
char line [MAX_LINE];
count = 0;
InitArithEncoding();
ppm_start_encoding (max_order, max_symbol);
/* Read in the integers */
while ((len = getline (fp, line, MAX_LINE)) != EOF)
{
count++;
if ((debugProgress) && ((count % debugProgress) == 0))
report (0, count);
sscanf (line, "%d", &n);
if(n>max_symbol){
fprintf(stderr,"error: %d must be in the range [0..%d]\n",n,max_symbol);
} else {
ppm_encode_symbol (n);
}
/* bytes_input++;*/
}
ppm_encode_symbol( eof_symbol());
CloseDownArithEncoding();
report( 0, count );
}
int
main (int argc,char *argv [])
{
init_arguments (argc, argv);
encode_file( stdin );
return 0;
}
|
Added work/contrib/tic/tic98/ppmd_hash.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
|
/* Hash table module. */
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <malloc.h>
#include "ppmd_hash.h"
#define HASH_NULL 0
unsigned int
hash(unsigned int n)
/* Returns a hash number for n. */
{
return (n % HASH_SIZE);
/* real simple hash function; this ensures that
the hash entries are uniformly distributed */
}
hashTable *
createHash (hashTable *H)
/* Creates and initializes the hash table. */
{
unsigned int h;
if (H == NULL)
{
H = (hashTable *) malloc (sizeof(hashTable));
H->hashLists = (hashList *) malloc (HASH_SIZE *
sizeof(hashList));
H->hashSize = HASH_SIZE;
H->hashVersion = 0;
for (h=0; h<HASH_SIZE; h++)
{
H->hashIndex [h] = HASH_NULL;
H->hashVerno [h] = 1;
}
}
H->hashFree = 0;
H->hashVersion++;
return (H);
}
unsigned int
freeHash (hashTable *H, unsigned int n)
/* Return a pointer to the next free hashList record. */
{
unsigned int h;
h = ++H->hashFree;
if (H->hashFree >= H->hashSize)
{ /* extend array */
H->hashSize += HASH_SIZE;
H->hashLists = (hashList *) realloc (H->hashLists,
H->hashSize * sizeof(hashList));
if (H->hashLists == NULL)
{
fprintf (stderr, "Fatal error: out of hash list space\n");
exit (1);
}
}
assert (h < H->hashSize);
H->hashLists [h].Hnumber = n;
H->hashLists [h].Hnext = HASH_NULL;
return (h);
}
void
addHash (hashTable *H, unsigned int n)
/* Adds number n into the hash table. */
{
unsigned int h;
unsigned int head, here;
assert (H != NULL);
h = hash (n);
/* find if the number already exists */
head = H->hashIndex [h];
/* check whether current version is in use */
if (H->hashVerno [h] < H->hashVersion)
head = HASH_NULL; /* reset old list to be NULL */
H->hashVerno [h] = H->hashVersion;
here = head;
while ((here != HASH_NULL) && (n != H->hashLists [here].Hnumber))
here = H->hashLists [here].Hnext;
if (here == HASH_NULL)
{ /* not found - add at head of list */
here = freeHash (H, n);
H->hashLists [here].Hnext = head;
H->hashIndex [h] = here;
}
}
int
foundHash (hashTable *H, unsigned int n)
/* Returns non-zero if number n is found in the hash table. */
{
unsigned int h;
unsigned int head, here;
assert (H != NULL);
h = hash (n);
/* find if the number already exists */
head = H->hashIndex [h];
/* check whether current version is in use */
if (H->hashVerno [h] < H->hashVersion)
return (0);
here = head;
while ((here != HASH_NULL) && (n != H->hashLists [here].Hnumber))
here = H->hashLists [here].Hnext;
if (here == HASH_NULL)
return (0);
else
return (1);
}
void
dumpHash (FILE *fp, hashTable *H)
/* Dumps the hash table H. */
{
unsigned int here;
unsigned int h;
assert (H != NULL);
for (h=0; h<HASH_SIZE; h++)
if ((H->hashIndex [h] != HASH_NULL) &&
(H->hashVerno [h] == H->hashVersion))
{
fprintf( fp, "%6d", h );
here = H->hashIndex [h];
while (here != HASH_NULL) {
fprintf( fp, " %u", H->hashLists [here].Hnumber );
here = H->hashLists [here].Hnext;
}
fprintf( fp, "\n" );
}
}
/* Scaffolding for hash module
int
main()
{
unsigned int n;
hashTable *H;
int i;
H = createHash(NULL);
for (i=0; i<16; i++)
addHash( H, i );
dumpHash( stdout, H );
for (i=0; i <= 20; i++)
{
printf ("%3d ", i);
if (foundHash (H, i))
printf ("found\n");
else
printf ("not found\n");
}
H = createHash(H);
for (i=0; i<32; i++)
addHash( H, i );
dumpHash( stdout, H );
for (;;)
{
printf( "n? " );
scanf( "%u", &n );
if (foundHash (H, n))
printf ("found\n");
else
printf ("not found\n");
if (n == 999)
break;
}
H = createHash(H);
for (;;)
{
printf( "n? " );
scanf( "%u", &n );
addHash (H, n);
if (n == 999)
break;
}
dumpHash( stdout, H );
for (;;)
{
printf( "n? " );
scanf( "%u", &n );
if (foundHash (H, n))
printf ("found\n");
else
printf ("not found\n");
}
}
*/
|
Added work/contrib/tic/tic98/ppmd_hash.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
/* Hash module definitions used by both the encoder and the decoder. */
#define HASH_SIZE 1024 /* Size of hash table; */
typedef struct
{ /* hash list record */
unsigned int Hnumber; /* The hashed number */
unsigned int Hnext; /* The next number in this list */
} hashList;
typedef struct
{ /* the hash table */
unsigned int hashFree; /* Next unused hashList record */
unsigned int hashSize; /* Current size of hashLists array */
unsigned int hashVersion; /* Version number for this table */
unsigned int hashIndex [HASH_SIZE]; /* The hash entries. */
unsigned int hashVerno [HASH_SIZE]; /* The hash version numbers. */
hashList *hashLists; /* For storing lists of hash records */
} hashTable;
hashTable *
createHash(hashTable *H);
void
addHash (hashTable *H, unsigned int n);
int
foundHash (hashTable *H, unsigned int n);
void
dumpHash (FILE *fp, hashTable *H);
|
Added work/contrib/tic/tic98/ppmd_model.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
|
/* PPM* model for arithmetic encoder. */
#include <stdio.h>
#include <assert.h>
#include <malloc.h>
#include "arithcode.h"
#include "ppmd_hash.h"
#define INPUT_SIZE 100000 /* Size of input file buffer. */
#define TRIE_SIZE 30000 /* Maximum number of trie records. */
#define SYMBOLS_SIZE 100000 /* Maximum number of symbols records. */
#define CLIST_SIZE 100 /* Maximum size of the context list */
#define SYMBOL_SIZE 257 /* Number of symbols + 1 for eof */
#define ESCAPE (SYMBOL_SIZE) /* for encoding escape symbols */
#define CONTEXT_SIZE 8 /* Number of context lengths to store for statistics */
#define MAX_TOTAL_COUNT (1<<30) /* Max. total count used for scaling the counts */
#define MIN_ORDER -1 /* Minimum fixed order */
#define MAX_ORDER 5 /* Default maximum fixed order */
#define TCOUNT_INIT 1 /* Initial count for new node */
#define TESCAPE_INIT 1 /* Initial escape count for new node */
#define TCOUNT_INCR 2 /* Increment count for node */
#define TESCAPE_INCR 1 /* Increment escape count for node */
#define NIL 0 /* Indicates ptr is nil */
#define ROOT 1 /* root of Trie */
/* the following global variables are set from the command line arguments */
/* debugging output is redirected to stderr */
/* Levels of debugging output :
* level 1 : trace of arithmetic coding values
* level 2 : level 1 plus prediction output
* level 3 : level 2 plus dump of tries and context list
* level 4 : comprehensive trace information
*/
int debugLevel = 0; /* for various levels of debugging output */
int debugContextlengths = 0; /* for dumping out the context lengths */
unsigned int max_total_count = MAX_TOTAL_COUNT;
unsigned int max_order = MAX_ORDER;
unsigned int escape_value = ESCAPE;
unsigned int symbol_size = SYMBOL_SIZE;
unsigned int tcount_init = TCOUNT_INIT;
unsigned int tescape_init = TESCAPE_INIT;
unsigned int tcount_incr = TCOUNT_INCR;
unsigned int tescape_incr = TESCAPE_INCR;
float determ_factor = 3.0;
unsigned int *Input; /* the input file */
unsigned int inputSize = 0; /* Current size of the input array */
unsigned int inputPos = 0; /* Current position in the input */
unsigned int inputLen = 0; /* length of input */
hashTable *Exclusions; /* For computing exclusions for each char */
typedef struct { /* context list record */
unsigned int Cptr; /* pointer to node in the trie */
unsigned int Cnext; /* next in the context list */
} contextType;
contextType Context [CLIST_SIZE];
/* linked list of the current active contexts, longest first */
unsigned int contextLength; /* length of the context list */
unsigned int contextUsed; /* list of deleted context list records */
unsigned int contextFree; /* next unused context list record */
unsigned int contextHead; /* Head of the context list = longest context */
unsigned int contextTail; /* Tail of the context list = shortest context */
typedef struct { /* symbol list record */
int Sptr; /* pointer to node in the trie (positive) or input (negative) */
unsigned int Snext; /* next symbol in the list */
unsigned int Symbol; /* the symbol */
} symbolsType;
symbolsType *Symbols;
/* for storing lists of symbols associated with each node in the Trie */
unsigned int symbolsFree = 0; /* Next unused symbol record */
unsigned int symbolsSize = 0; /* Current size of the symbols array */
typedef struct { /* trie record */
unsigned int Tsymbols; /* linked list of symbols & ptrs to lower levels in the trie */
unsigned int Tcount; /* count associated with the node; sum of counts of all lower levels */
unsigned int Tescape; /* escape count associated with the node */
} trieType;
trieType *Trie; /* the trie */
unsigned int trieSize = 0; /* Current size of the trie array */
unsigned int trieFree; /* next unused trie record */
void
init_ppmd_globals()
{
max_total_count = MAX_TOTAL_COUNT;
max_order = MAX_ORDER;
symbol_size = SYMBOL_SIZE;
escape_value = ESCAPE;
tcount_init = TCOUNT_INIT;
tescape_init = TESCAPE_INIT;
tcount_incr = TCOUNT_INCR;
tescape_incr = TESCAPE_INCR;
determ_factor = 3.0;
/* the input file */
inputSize = 0; /* Current size of the input array */
inputPos = 0; /* Current position in the input */
inputLen = 0; /* length of input */
symbolsFree = 0; /* Next unused symbol record */
symbolsSize = 0; /* Current size of the symbols array */
trieSize = 0; /* Current size of the trie array */
}
void
printFree (FILE *fp)
{
fprintf( fp, "Tries used: %d Tries unused %d, Symbols used: %d Symbols unused: %d Lists used: %d Lists unused: %d\n",
trieFree-1, (TRIE_SIZE-trieFree), symbolsFree-1, (SYMBOLS_SIZE-symbolsFree),
contextFree-1, (CLIST_SIZE-contextFree) );
} /* printFree */
void
initInput (void)
/* Initialize the input array */
{
Input = NULL;
Input = (unsigned int *) malloc (INPUT_SIZE * sizeof(unsigned int));
inputSize = INPUT_SIZE;
}
unsigned int
freeInput (unsigned int pos)
/* Free space up in Input array. */
{
if (pos >= inputSize)
{ /* extend array */
inputSize += INPUT_SIZE;
Input = (unsigned int *) realloc (Input, inputSize *
sizeof(unsigned int));
if (Input == NULL)
{
fprintf (stderr, "Fatal error: out of input space at position %d\n",
pos);
exit (1);
}
}
pos++;
return (pos);
}
void
startInput (void)
{
inputPos = 0;
}
void
putInput (int symbol)
/* Insert new symbol into Input. */
{
freeInput (inputPos);
Input [inputPos++] = symbol;
}
void
initContext()
/* Initialize the context list for the linked list of context pointers */
{
contextUsed = 0;
contextFree = 0;
contextHead = 0;
contextTail = 0;
}
unsigned int
freeContext()
/* Return a new pointer to a list record */
{
unsigned int c;
if (contextUsed == NIL) {
if (contextFree < CLIST_SIZE) {
contextFree += 1;
c = contextFree;
}
else {
fprintf( stderr, "Fatal error: out of context list space at position %d\n",
inputPos );
exit(1);
}
}
else { /* use the first record on the free list */
c = contextUsed;
contextUsed = Context [c].Cnext;
}
if (c != NIL) {
Context [c].Cptr = NIL;
Context [c].Cnext = NIL;
}
return( c );
}
void
releaseList (unsigned int c)
/* Release the context list C to the free list */
{
Context [c].Cnext = contextUsed;
contextUsed = c;
contextLength--;
}
void
dumpList (FILE *fp, unsigned int c)
/* Dump the context list C */
{
fprintf( fp, "Dump of context list : " );
while (c) {
fprintf( fp, "%d ", Context [c].Cptr );
c = Context [c].Cnext;
}
fprintf( fp, "\n" );
}
void
dumpSymbol (FILE *fp, unsigned int symbol)
/* Dump the symbol */
{
if ((symbol <= 32) || (symbol >= 127))
fprintf( fp, "<%d>", symbol );
else
fprintf( fp, "%c", symbol );
}
void
dumpString (FILE *fp, char *str, unsigned int pos, unsigned int len)
/* Dump the string STR starting at position POS. */
{
char cc;
unsigned int p;
for (p = pos; p<pos+len; p++) {
cc = str [p];
if ((cc <= 31) || (cc >= 127))
fprintf( fp, "<%d>", cc );
else
fprintf( fp, "%c", cc );
}
}
char dumpTrieStr [CLIST_SIZE];
void
dumpTrie(FILE *fp, int t, unsigned int d)
/* Dump the trie T; d is 0 when at the top level. */
{
unsigned int sym, s;
int sptr;
fprintf( fp, "%5d %5d ", d, t );
if (t < 0) /* pointer to input */
fprintf( fp, " <" );
else {
fprintf( fp, " %5d %5d <", Trie [t].Tescape, Trie [t].Tcount );
}
dumpString( fp, dumpTrieStr, 0, d );
fprintf( fp, ">\n" );
if (t > 0) {
s = Trie [t].Tsymbols;
while (s != NIL) {
sym = Symbols [s].Symbol;
sptr = Symbols [s].Sptr;
dumpTrieStr [d] = sym;
dumpTrie( fp, sptr, d+1 );
s = Symbols [s].Snext;
}
}
}
void
dumpRoot (FILE *fp)
/* Dump the root trie. */
{
fprintf( fp, "Dump of Trie : \n" );
fprintf( fp, "---------------\n" );
fprintf( fp, "depth node esc count context\n" );
dumpTrie( fp, ROOT, 0 );
fprintf( fp, "---------------\n" );
fprintf( fp, "\n" );
}
void
junk()
{
fprintf( stderr, "Got here\n" );
/*dumpRoot( stderr );*/
}
unsigned int
getCount (unsigned int s)
/* Gets the count for the symbol at node s in the symbol list. */
{
unsigned int freq;
int sptr;
if (s == NIL)
return( 0 );
freq = 0; /* frequency count for the symbol */
sptr = Symbols [s].Sptr;
assert( sptr != 0 );
if (sptr < 0) /* points to input stream */
freq = 1;
else if (sptr == 0)
freq = 0;
else
freq = Trie [sptr].Tcount;
if ((debugLevel > 3) && (freq > 0)) {
fprintf( stderr, "getCount for symbol " );
dumpSymbol( stderr, Symbols [s].Symbol );
fprintf( stderr, " at node %d = %d\n", sptr, freq );
}
return( freq );
}
unsigned int
freeTrie()
/* Return a pointer to the next free trie record. */
{
unsigned int t;
if (trieFree >= trieSize)
{ /* extend array */
trieSize += TRIE_SIZE;
Trie = ( trieType *) realloc (Trie, trieSize *
sizeof ( trieType));
if (Trie == NULL)
{
fprintf (stderr, "Fatal error: out of trie space at position %d\n",
inputPos);
exit (1);
}
}
t = trieFree;
assert (t < trieSize);
Trie [t].Tsymbols = NIL;
Trie [t].Tcount = 0;
Trie [t].Tescape = 0;
trieFree++;
return (t);
}
void
initTrie()
/* Initialize the trie. */
{
Trie = NULL;
Trie = ( trieType *) malloc (TRIE_SIZE * sizeof (trieType));
trieSize = TRIE_SIZE;
trieFree = ROOT + 1;
Trie[ROOT].Tsymbols = NIL;
Trie[ROOT].Tcount = 0;
Trie[ROOT].Tescape = 0;
}
void
initSymbols()
/* Initialize the symbols array. */
{
Symbols = NULL;
Symbols = (symbolsType *) malloc (SYMBOLS_SIZE * sizeof(symbolsType));
symbolsSize = SYMBOLS_SIZE;
symbolsFree = 1;
}
unsigned int
freeSymbol (unsigned int symbol)
/* Return a pointer to the next free symbols record. */
{
unsigned int s;
if (symbolsFree >= symbolsSize)
{ /* extend array */
symbolsSize += SYMBOLS_SIZE;
Symbols = (symbolsType *) realloc (Symbols, symbolsSize
* sizeof(symbolsType));
if (Symbols == NULL)
{
fprintf (stderr, "Fatal error: out of symbols space at position %d\n",
inputPos);
exit (1);
}
}
s = symbolsFree;
assert (s < symbolsSize);
Symbols [s].Sptr = NIL;
Symbols [s].Snext = NIL;
Symbols [s].Symbol = symbol;
symbolsFree++;
return( s );
}
unsigned int
findSymbol (unsigned int t, unsigned int symbol)
/* Return a pointer to the trie node that contains the symbol. */
{
unsigned int s, sym;
s = Trie [t].Tsymbols;
while (s != NIL) {
sym = Symbols [s].Symbol;
if (sym == symbol)
return( s );
s = Symbols [s].Snext;
}
return( NIL );
}
unsigned int
addSymbol (unsigned int t, unsigned int symbol)
/* Add a new symbol if required and return a pointer to it. */
{
unsigned int s;
s = findSymbol( t, symbol ); /* does the symbol already exist? */
if (!s) { /* symbol not found */
/* create new node for symbol */
s = freeSymbol( symbol );
if (Trie [t].Tsymbols == 0) /* empty list */
Trie [t].Tsymbols = s;
else { /* add the new symbol at the head of the list */
Symbols [s].Snext = Trie [t].Tsymbols;
Trie [t].Tsymbols = s;
}
}
return( s );
}
void
startContext()
{
unsigned int c;
assert (contextLength <= max_order+1);
/* create new context pointing to root of trie for the new symbol */
c = freeContext();
Context [c].Cptr = ROOT;
Context [c].Cnext = NIL;
/* now add new context at tail of the contexts list */
if (contextTail == NIL)
contextHead = c;
else
Context [contextTail].Cnext = c;
contextTail = c;
contextLength++;
if (debugLevel > 2) {
fprintf( stderr, "\n" );
dumpList( stderr, contextHead );
}
}
unsigned int
predict()
/* Make a prediction of the next symbol. Return a pounsigned inter to the
predicted context node. */
{
unsigned int context;
context = contextHead; /* start at the longest context */
if ((context != NIL) && (contextLength-1 > max_order))
context = Context [context].Cnext; /* go to next context */
return( context );
}
void
arith_encode (unsigned int lbnd, unsigned int hbnd, unsigned int totl)
/* Arithmetically encode the range. */
{
if (totl > max_total_count ) {
fprintf( stderr, "Fatal error - totl too big : lbnd = %d, hbnd = %d, totl = %d at position %d\n",
lbnd, hbnd, totl, inputPos );
/*dumpRoot( stderr );*/
}
assert( totl <= max_total_count );
if ((lbnd == 0) && (hbnd == totl)) {
/* probility = 1 - no need to encode it */
if (debugLevel > 0)
fprintf( stderr, "probability = 1\n" );
}
else
arithmetic_encode( lbnd, hbnd, totl );
}
#ifdef 0
unsigned int
arith_decode_target (unsigned int totl)
/* Arithmetically decodes the target. */
{
unsigned int target;
target = arithmetic_decode_target( totl );
if (debugLevel > 1)
fprintf( stderr, "target = %d, totl = %d\n", target, totl );
return( arithmetic_decode_target( totl ));
}
void
arith_decode(unsigned int lbnd, unsigned int hbnd, unsigned int totl)
/* Arithmetically decode the range. */
{
if ((lbnd == 0) && (hbnd == totl)) {
/* probility = 1 - no need to decode it */
if (debugLevel > 0)
fprintf( stderr, "probability = 1\n" );
}
else {
if (debugLevel > 0)
fprintf( stderr, "lbnd = %d, hbnd = %d, totl = %d\n",
lbnd, hbnd, totl );
arithmetic_decode( lbnd, hbnd, totl );
}
}
#endif
void
encode_counts (unsigned int t, unsigned int symbol,
hashTable *exclusions)
/* Encode the symbol using the counts at node t in the trie. Do not include any
of the exclusions. (If t is NIL, then encode using order-1 frequencies). */
{
unsigned int s, sym, freq;
unsigned int lbnd, hbnd, totl, determ;
if (debugLevel > 1) {
if (symbol == escape_value)
fprintf( stderr, "Encoding escape symbol\n" );
else {
fprintf( stderr, "Encoding symbol (%d) ", symbol );
dumpSymbol( stderr, symbol );
fprintf( stderr, "\n" );
}
}
lbnd = 0; hbnd = 0; totl = 0;
if (t == NIL) { /* order-1 */
for (sym = 0; sym<symbol_size; sym++) {
if (!foundHash (exclusions, sym)) {
freq = 1; /* set order-1 frequency to 1 */
if (sym == symbol) {
lbnd = totl;
hbnd = lbnd + freq;
}
totl += freq;
}
}
}
else {
lbnd = 0;
totl = Trie [t].Tescape; /* add in escape count */
if (!totl) { /* escape count must be non-zero, except at pos 0 */
assert( inputPos == 0 );
return;
}
determ = (totl == 1);
hbnd = totl;
s = Trie [t].Tsymbols;
while (s != NIL) {
sym = Symbols [s].Symbol;
if (!foundHash (exclusions, sym)) {
freq = getCount( s );
if ((determ) && (freq > 1))
freq = (int) (freq * determ_factor);
if (sym == symbol) {
lbnd = totl;
hbnd = lbnd + freq;
}
totl += freq;
}
s = Symbols [s].Snext;
}
}
if ((hbnd <= lbnd) || (totl < hbnd)) {
fprintf( stderr, "Fatal error - invalid range : lbnd %d hbnd %d totl %d at position %d\n",
lbnd, hbnd, totl, inputPos );
fprintf( stderr, "Dumping node %d\n", t );
dumpTrie( stderr, t, 0 );
}
assert( hbnd > lbnd );
assert( totl >= hbnd );
arith_encode( lbnd, hbnd, totl );
if (totl > max_total_count) {
fprintf( stderr, "Check range : lbnd %d hbnd %d totl %d at position %d\n",
lbnd, hbnd, totl, inputPos );
fprintf( stderr, "Dumping node %d\n", t );
dumpTrie( stderr, t, 0 );
exit(1);
}
if (debugLevel > 0)
fprintf( stderr, "lbnd = %d hbnd = %d totl = %d\n", lbnd, hbnd, totl );
}
unsigned int
decode_counts (unsigned int t, hashTable *exclusions)
/* Decode the symbol at node t in the trie. Do not include any of the exclusions. */
{
unsigned int s, sym, freq, target, determ;
unsigned int lbnd, hbnd, totl;
/* Find the total count first */
if (t == NIL) { /* order-1 */
totl = 0;
for (sym = 0; sym<symbol_size; sym++) {
if (!foundHash (exclusions, sym))
totl += 1; /* order-1 frequency = 1 */
}
}
else {
totl = Trie [t].Tescape;
if (!totl) { /* escape count must be non-zero, except at pos 0 */
assert( inputPos == 0 );
return( escape_value );
}
determ = (totl == 1);
s = Trie [t].Tsymbols;
while (s != NIL) {
sym = Symbols [s].Symbol;
if (!foundHash (exclusions, sym)) {
freq = getCount( s );
if ((determ) && (freq > 1))
freq = (unsigned int) (freq * determ_factor);
totl += freq;
}
s = Symbols [s].Snext;
}
}
target = arithmetic_decode_target( totl );
/* Find the symbol and arithmetic range which target falls into */
if (t == NIL) { /* order-1 */
hbnd = 0;
for (sym = 0; (sym<symbol_size) && (hbnd <= target); sym++) {
if (!foundHash (exclusions, sym))
hbnd += 1; /* order-1 frequency = 1 */
}
lbnd = hbnd - 1;
sym--;
}
else {
sym = escape_value; /* first symbol is an escape */
hbnd = Trie [t].Tescape;
determ = (hbnd == 1);
freq = hbnd;
s = Trie [t].Tsymbols;
while ((s != NIL) && (hbnd <= target)) {
sym = Symbols [s].Symbol;
if (!foundHash (exclusions, sym)) {
freq = getCount( s );
if ((determ) && (freq > 1))
freq = (unsigned int) (freq * determ_factor);
hbnd += freq;
}
s = Symbols [s].Snext;
}
lbnd = hbnd - freq;
}
if (hbnd <= lbnd)
fprintf( stderr, "Fatal error - invalid range : lbnd %d hbnd %d totl %d at position %d\n",
lbnd, hbnd, totl, inputPos );
assert( hbnd > lbnd );
arithmetic_decode( lbnd, hbnd, totl );
if (debugLevel > 0) {
if (sym == escape_value)
fprintf( stderr, "Decoded escape symbol\n" );
else {
fprintf( stderr, "Decoded symbol (%d) ", sym );
dumpSymbol( stderr, sym );
fprintf( stderr, "\n" );
}
}
return( sym );
}
void
encode_context (unsigned int context, unsigned int symbol)
/* Encode the symbol at the context in the trie. */
{
unsigned int s, sym, cptr, freq;
/* set up the exclusions hash table */
Exclusions = createHash (Exclusions);
while (context > NIL) { /* encode escapes until we find a context that has the symbol */
cptr = Context [context].Cptr;
s = findSymbol( cptr, symbol ); /* get the symbol's node for the context */
freq = getCount( s );
if (freq != 0)
break;
/* Symbol not found in current context; escape to shorter contexts */
encode_counts( cptr, escape_value, Exclusions );
Trie [cptr].Tescape += tescape_incr;
/* exclude all symbols in current context from being counted in shorter contexts */
s = Trie [cptr].Tsymbols;
while (s != NIL) {
sym = Symbols [s].Symbol;
addHash (Exclusions, sym); /* add sym to list of exclusions */
s = Symbols [s].Snext;
}
context = Context [context].Cnext; /* Go to next longest context */
}
if (context == NIL)
cptr = NIL;
else
cptr = Context [context].Cptr; /* get the node associated with the context */
encode_counts (cptr, symbol, Exclusions);
}
unsigned int
decode_context (unsigned int context)
/* Decode the symbol based on the context at node t. */
{
unsigned int s, sym, cptr, symbol;
/* set up the exclusions hash table */
Exclusions = createHash (Exclusions);
for (;;) { /* keep decoding until no more escapes */
cptr = Context [context].Cptr; /* get the node associated with the context */
symbol = decode_counts (cptr, Exclusions);
if (symbol != escape_value)
return( symbol );
Trie [cptr].Tescape += tescape_incr;
/* exclude all symbols in current context from being counted in shorter contexts */
s = Trie [cptr].Tsymbols;
while (s != NIL) {
sym = Symbols [s].Symbol;
addHash (Exclusions, sym); /* add sym to list of exclusions */
s = Symbols [s].Snext;
}
context = Context [context].Cnext; /* Go to next longest context */
}
}
unsigned int
nextContext (unsigned int context)
/* Return a pointer to the next context. */
{
return( Context [context].Cnext );
}
unsigned int
dropContext(unsigned int context)
/* Drop the context from the context list, and return a pointer to the next
in the list. */
{
if (context != contextHead) {
printFree( stderr );
fprintf( stderr, "Fatal error at position %d\n", inputPos );
}
assert (context == contextHead); /* must be at head of context list */
/* remove this context from the context list */
contextHead = Context [context].Cnext;
if (contextHead == NIL)
contextTail = NIL;
releaseList( context );
context = contextHead;
return( context );
}
unsigned int
upd (unsigned int context, unsigned int symbol, unsigned int contextLen,
unsigned int updatecnt)
/* Update the symbol in the context. Return the next context. */
{
unsigned int s, cptr, snew;
int p, tnew;
cptr = Context [context].Cptr;
assert( cptr > NIL );
if (updatecnt) /* this test performs update exclusions */{
Trie [cptr].Tcount += tcount_incr; /* Only add the count for the longest context */
}
if (contextLen-1 > max_order)
return( dropContext( context ));
s = addSymbol( cptr, symbol );
p = Symbols [s].Sptr;
if (p > 0) { /* in middle of trie */
Context [context].Cptr = p; /* replace context with next level down */
return( nextContext(context) ); /* move to next context */
}
else if (p == 0) { /* context has not occurred before */
Symbols [s].Sptr = - (inputPos);
return( dropContext(context) ); /* new context, so drop from context list */
}
else { /* p < 0; previous context points to input stream; add it one level down */
tnew = freeTrie();
Trie [tnew].Tcount = tcount_init; /* set count to 1 */
Trie [tnew].Tescape = tescape_init; /* set escape count to 1 */
Symbols [s].Sptr = tnew;
if (contextLen-1 < max_order) {
snew = addSymbol( tnew, Input [-p] ); /* next one in input */
Symbols [snew].Sptr = p-1; /* point to next one back in input */
}
Context [context].Cptr = tnew; /* replace context with new ptr */
return( nextContext(context) ); /* move to next context */
}
} /* upd */
void
update (unsigned int symbol)
/* Update the Trie ure using the incoming symbol at the current input position. */
{
unsigned int context, contextLen, updatecnt;
/*inputPos = putInput (inputPos, symbol);*/
/*if (inputPos >= INPUT_SIZE) {
printFree( stderr );
fprintf( stderr, "Fatal error: out of file space at position %d\n",
inputPos );
exit(1);
}
Input [inputPos++] = symbol;
*/
putInput (symbol); /* store the input symbol */
/* Update all the current contexts */
context = contextHead;
contextLen = contextLength;
updatecnt = 1;
while (context != NIL) {
context = upd( context, symbol, contextLen, updatecnt );
contextLen--;
updatecnt = 0;
}
} /* update */
void
init_symbols()
/* Initialize the model. */
{
initInput ();
initContext();
initSymbols();
initTrie();
Exclusions = NULL;
}
unsigned int
eof_symbol()
/* Return the end of file symbol */
{
return( symbol_size-1 );
}
void
ppm_encode_symbol (unsigned int symbol)
/* Encode the symbol. */
{
unsigned int pContext; /* node in trie predicted to have "best" context */
assert (symbol <= symbol_size);
/*if ((inputPos % 10000) == 0)
fprintf( stderr, "pos %d context %d symbols %d trie %d\n",
inputPos, contextFree, symbolsFree, trieFree );*/
if (debugLevel > 1) {
fprintf( stderr, "Input " );
dumpSymbol( stderr, symbol );
fprintf( stderr, " at %d\n", inputPos );
}
startContext();
pContext = predict(); /* Choose the context */
/* Encode the symbol based on the predicted context */
encode_context( pContext, symbol );
update (symbol);
if (debugLevel > 2)
dumpRoot( stderr );
}
unsigned int
ppm_decode_symbol()
/* Return the decoded symbol. */
{
unsigned int pContext; /* node in trie with the predict "best" context */
unsigned int symbol;
startContext();
pContext = predict(); /* Choose the context */
/* Find the symbol based on the predicted context */
symbol = decode_context( pContext );
assert (symbol <= symbol_size);
update( symbol );
if (debugLevel > 2)
dumpRoot( stderr );
return( symbol );
}
void
report_model()
/* Report back on statistics collected during encoding */
{
printFree( stderr );
}
void
ppm_start_encoding (unsigned int max_order1, unsigned int symbol_size1)
{
assert (symbol_size1 > 1);
max_order = max_order1;
symbol_size = symbol_size1 + 2; /* add 1 for EOF symbol+esc */
escape_value = symbol_size1 +2;
init_symbols();
/* start_encode();
startoutputtingbits();*/
startInput ();
}
void
ppm_finish_encoding ()
{
/* ppm_encode_symbol( eof_symbol());*/
/*finish_encode();
doneoutputtingbits();*/
}
unsigned int
ppm_start_decoding (unsigned int max_order1, unsigned int symbol_size1)
/* Returns the EOF symbol. */
{
assert (symbol_size1 > 1);
max_order = max_order1;
symbol_size = symbol_size1 + 2; /* add 1 for EOF symbol */
escape_value = symbol_size1 +2;
init_symbols();
/*start_decode();
startinputtingbits();*/
return (eof_symbol());
}
void
ppm_finish_decoding ()
{
/* finish_decode();
doneinputtingbits();*/
}
|
Added work/contrib/tic/tic98/ppmd_model.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
/* Model module definitions used by both the encoder and the decoder. */
void
init_arguments (int argc, char *argv[]);
void
init_symbols();
void
printFree (FILE *fp);
void
ppm_start_encoding (unsigned int max_order, unsigned int symbol_size);
void
ppm_finish_encoding ();
void
ppm_encode_symbol (unsigned int symbol);
unsigned int
ppm_start_decoding (unsigned int max_order, unsigned int symbol_size);
void
ppm_finish_decoding ();
unsigned int
ppm_decode_symbol();
void
init_ppmd_globals();
unsigned int eof_symbol();
|
Added work/contrib/tic/tic98/q-coder.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
|
/*
* (c) Copyright AT&T 1991.
*
* License granted for use only in connection with ISO and CCITT evaluations.
* AT&T offers no warranties of any kind, expressed or implied.
* Contact D. L. Duttweiler (d.l.duttweiler@att.com) for email copies.
*/
/*
* Version S1R4.1
*/
/*
* Encoder Usage:
* einit()
* while("symbols to encode") encoder(symbol,&st[cx],&mps[cx])
* where symbol = 1 or 0
* st[NCX] and mps[NCX] are arrays of integers
* that are allocated and initialized in
* the calling routine. The dimension NCX must at
* least equal the number of contexts.
* eflush()
*
* Decoder Usage:
* dinit()
* while(symbols to decode) symbol = decoder(&st[cx],mps[cx])
*
* External routines:
* ewrite(byte)
* byte = dread()
*/
#define NCX (1<<12) /* number of contexts */
static int lsz[128] = {
0x5a1d,0x2586,0x1114,0x080b,0x03d8,0x01da,0x00e5,0x006f,0x0036,
0x001a,0x000d,0x0006,0x0003,0x0001,0x5a7f,0x3f25,0x2cf2,0x207c,
0x17b9,0x1182,0x0cef,0x09a1,0x072f,0x055c,0x0406,0x0303,0x0240,
0x01b1,0x0144,0x00f5,0x00b7,0x008a,0x0068,0x004e,0x003b,0x002c,
0x5ae1,0x484c,0x3a0d,0x2ef1,0x261f,0x1f33,0x19a8,0x1518,0x1177,
0x0e74,0x0bfb,0x09f8,0x0861,0x0706,0x05cd,0x04de,0x040f,0x0363,
0x02d4,0x025c,0x01f8,0x01a4,0x0160,0x0125,0x00f6,0x00cb,0x00ab,
0x008f,0x5b12,0x4d04,0x412c,0x37d8,0x2fe8,0x293c,0x2379,0x1edf,
0x1aa9,0x174e,0x1424,0x119c,0x0f6b,0x0d51,0x0bb6,0x0a40,0x5832,
0x4d1c,0x438e,0x3bdd,0x34ee,0x2eae,0x299a,0x2516,0x5570,0x4ca9,
0x44d9,0x3e22,0x3824,0x32b4,0x2e17,0x56a8,0x4f46,0x47e5,0x41cf,
0x3c3d,0x375e,0x5231,0x4c0f,0x4639,0x415e,0x5627,0x50e7,0x4b85,
0x5597,0x504f,0x5a10,0x5522,0x59eb,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000};
static int swtch[128] = {
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0,
0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0};
static int nmps[128] = {
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 13, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
31, 32, 33, 34, 35, 9, 37, 38, 39, 40, 41, 42, 43, 44, 45,
46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
61, 62, 63, 32, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
76, 77, 78, 79, 48, 81, 82, 83, 84, 85, 86, 87, 71, 89, 90,
91, 92, 93, 94, 86, 96, 97, 98, 99, 100, 93, 102, 103, 104, 99,
106, 107, 103, 109, 107, 111, 109, 111, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0};
static int nlps[128] = {
1, 14, 16, 18, 20, 23, 25, 28, 30, 33, 35, 9, 10, 12, 15,
36, 38, 39, 40, 42, 43, 45, 46, 48, 49, 51, 52, 54, 56, 57,
59, 60, 62, 63, 32, 33, 37, 64, 65, 67, 68, 69, 70, 72, 73,
74, 75, 77, 78, 79, 48, 50, 50, 51, 52, 53, 54, 55, 56, 57,
58, 59, 61, 61, 65, 80, 81, 82, 83, 84, 86, 87, 87, 72, 72,
74, 74, 75, 77, 77, 80, 88, 89, 90, 91, 92, 93, 86, 88, 95,
96, 97, 99, 99, 93, 95, 101, 102, 103, 104, 99, 105, 106, 107, 103,
105, 108, 109, 110, 111, 110, 112, 112, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0};
long CountOfBitsOut;
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "arithcode.h"
static int byteout();
#define FPC (void)putc
#define FPF (void)fprintf
#define E0(A) { FPF(stderr,"%s: A\n",prgname); exit(1); }
#define E1(A,B) { FPF(stderr,"%s: A\n",prgname,B); exit(1); }
#define E2(A,B,C) { FPF(stderr,"%s: A\n",prgname,B,C); exit(1); }
#define E3(A,B,C,D) { FPF(stderr,"%s: A\n",prgname,B,C,D);exit(1); }
#define E4(A,B,C,D,E) { FPF(stderr,"%s: A\n",prgname,B,C,D,E); exit(1); }
#define EUP { *pst = nmps[*pst]; }
#define SUP { *pmps = swtch[*pst]? 1-*pmps: *pmps; \
*pst = nlps[*pst]; }
#define BYTEIN { c += (unsigned)dread()<<8; ct = 8; }
#define RENORME while(a<0x8000) { \
a <<= 1; c <<= 1; ct--; \
if(ct==0) (void)byteout(); }
#define RENORMD do { \
if(ct==0) BYTEIN; \
a <<= 1; c <<= 1; ct--; } while(a<0x8000);
#define OUT(A) if(stflag) stflag = 0; else { \
if((A)==0) nzero++; \
else { \
while(nzero>0) {nzero--; (void)ewrite(0x00);} \
(void)ewrite(A); } }
#define OUT00 if(stflag) stflag = 0; else nzero++;
#define OUTFF if(stflag) stflag = 0; else { \
while(nzero>0) {nzero--; (void)ewrite(0x00);} \
(void)ewrite(0xFF); }
static unsigned c; /* Coding register */
static int a; /* Size of coding interval*/
static int stflag; /* Flag to inhibit first write */
static int nzero; /* Potential trailing zeros */
static int sc; /* Number of FF bytes */
static int buffer; /* Bits buffered for output or input */
static int ct; /* Shift counter */
#define ATALL 2048 /* minimum AT count */
#define ATMOVE 0x06 /* AT movement */
#define DPMISS 2 /* array value when DP can't predict */
#define ESC 0xff /* escape */
#define IMMATERIAL 0 /* useful in keeping lint happy */
#define LCLCD 2 /* latency, coloring to coding */
#define ND 6 /* maximum number of delta layers */
#define NM 16 /* maximum AT lag allowed */
#define NP 32 /* maximum number of planes */
#define NPH 4 /* number of phases */
#define NPREFIX 200 /* maximum length of prefix */
#define NS 100 /* maximum number of stripes */
#define NSDE 512 /* SDE transfer size */
#define NWL 4 /* lines in low resolution window */
#define SDNORM 0x02 /* normal stripe data end */
#define SDRST 0x03 /* reset at stripe data end */
#define STUFF 0x00 /* escape escape */
#define TPB2CTX 0x159 /* pseudo context for bottom TP
erroneously given as 0x169 in
earlier version */
#define TPB3CTX 0x1c9 /* pseudo context for bottom TP */
#define TPDCTX 0xfc3 /* pseudo context for diff TP */
/********************** Derived symbolic constants ****************************/
#define NML ((NM+1)/2)
#define NMH (2*NML)
#define NWH (2*NWL)
#define NATC (NM-1)
/********************** Strings ***********************************************/
#define IRLOOP for(ir=ndl;ir<=nd;ir++)
#define IPLOOP for(ip=0;ip<np;ip++)
#define ISLOOP for(is=0;is<ns;is++)
/********************** Level 0 macros ****************************************/
#define ATCOUNT(A,B) { if(atcheck && ixh>=nm && (id!=0 || ixh<nxh-2)) { \
if(*php0) { \
atc[0] += *(phm1+(A)-2); \
for(i=1;i<natc;i++) atc[i] += *(php0-i-B); } \
else { \
atc[0] += 1-(*(phm1+(A)-2)); \
for(i=1;i<natc;i++) atc[i] += 1-(*(php0-i-B)); } \
atall++; } }
#define ATSWOK { if(atcheck && atall>ATALL) { \
atcheck = 0; \
cold = atc[iat]; \
tmax = 1; lmax = atc[1]; lmin = atc[1]; \
for(i=2;i<natc;i++) { \
if(atc[i] > lmax) { lmax = atc[i]; tmax = i; } \
if(atc[i] < lmin) lmin = atc[i]; } \
if(atc[0] >= lmax) { cmax = atc[0]; tmax = 0; } \
else cmax = lmax; \
cmin = atc[0]<lmin? atc[0]: lmin; \
if((8*cmax>7*atall) && \
(cmax-cold > atall-cmax) && \
(cmax-cold > atall>>4) && \
(cmax-(atall-cold) > atall-cmax) && \
(cmax-(atall-cold) > atall>>4) && \
(cmax-cmin > atall>>2) && \
(iat!=0 || (lmax-lmin)>atall>>3)) { \
FPF(paf,"id,iyh,new,old = %2d %5d %2d %2d\n", \
id,iyh,tmax,iat); \
FPF(paf,"atall = %4d\natc =",atall); \
for(i=0;i<natc;i++) FPF(paf," %4d",atc[i]); \
FPF(paf,"\n"); \
iatnext = tmax; \
yat = 0; } } }
#define FOPEN(A,B,C) { STRCPY(file,prefix); STRCAT(file,A); \
if((B=fopen(file,C))==NULL) \
E1(could not open %s, file); }
#define IOPEN(A,B,C) { SPRINTF(file,"%sr%dp%d",prefix,C,ip); \
if((A=fopen(file,B))==NULL) \
E1(could not open %s,file); }
#define IREAD(A,B) { if(rbit==8) { rchar = getc(B); rbit = 0; } \
A = (rchar>>(7-rbit++))&1; }
#define IWRITE(A,B) { wchar += A<<((7-wbit++)); \
if(wbit==8) {FPC(wchar,B); wchar=0; wbit=0;} }
#define MODHGH(A) imghgh + ((iyh+NWH+(A))%NWH)*nrh + NMH;
#define MODLOW(A) imglow + ((iyl+NWL+(A))%NWL)*nrl + NML;
#define SDEPARSE { id = hitolo? nd+ndl-ir: ir; \
sdestrt[ip][id][is] = (int)ftell(pbf); \
sdelgth[ip][id][is] = partition(pbf); }
#define SDEWRITE { id = hitolo? nd+ndl-ir: ir; \
if(fseek(pxf,(long)sdestrt[ip][id][is],0)) \
E0(bad seek); \
i = sdelgth[ip][id][is]; \
while(i>0) { \
j = i>NSDE? NSDE: i; \
if( fread(sde,1,j,pxf) != j) E0(sde read error); \
if(fwrite(sde,1,j,pbf) != j) E0(sde write error); \
i -= j; } }
#define XPUT(A) { FPC((int)(A),pxf); }
/********************** Level 1 macros ****************************************/
#define ATMV { if(ivh==yat && iat!=iatnext) { \
iat = iatnext; nat++; \
if(encode) { \
XPUT(ESC); XPUT(ATMOVE); \
XPUT(0); XPUT(0); \
XPUT(ivh>>8); XPUT(ivh&0xff); \
XPUT(iatnext>0? iatnext+2: 0); XPUT(0); } } }
FILE *paf,*pbf=stdin,*psf,*pxf=stdout;
int decode,dpon,encode,iatnext,id,ip,lps0,lrltwo,nbyte,nd,nm,nstuff,
nxtop,nytop,pacfeed,tpbon,tpdon,yat;
char *prefix,*prgname,*strcat(),*strcpy();
void exit();
int ewrite(int c)
{
nbyte++;
XPUT(c);
if(c==ESC) { XPUT(STUFF); nstuff++; }
return 0;
}
int dread()
{
int i;
if(pacfeed) return 0;
else {
loop: if((i=getc(pbf))!=ESC) { nbyte++; return i; }
else switch(getc(pbf)) {
case STUFF: nstuff++; nbyte++; return(ESC);
case ATMOVE: {
if(getc(pbf)!=0) E0(impossibly large yat);
if(getc(pbf)!=0) E0(impossibly large yat);
yat = getc(pbf); yat = (yat<<8) + getc(pbf);
iatnext = getc(pbf); if(iatnext>0) iatnext -= 2;
if(getc(pbf)!=0) E0(no support for MY != 0);
goto loop; }
case SDNORM: pacfeed = 1; return 0;
case SDRST: E0(no support for SDRST);
case EOF: E0(EOF in dread);
default: E0(DBID problem in switch); } }
return 0; /* keeps lint happy */
}
int decoder(int *pst,int *pmps)
{
int pix;
a -= lsz[*pst];
if((c>>16) < a) {
if(a<0x8000) {
if(a < lsz[*pst]) { pix = 1-*pmps; SUP; } else { pix = *pmps; EUP; }
RENORMD }
else pix = *pmps; }
else {
if(a<lsz[*pst]) { pix= *pmps;
c -= (unsigned)a<<16; a=lsz[*pst]; EUP; RENORMD }
else { pix = 1-*pmps;
c -= (unsigned)a<<16; a=lsz[*pst]; SUP; RENORMD } }
return pix;
}
int dinit()
{
c = 0; BYTEIN; c <<= 8; BYTEIN; c <<= 8; BYTEIN;
a = 0x10000;
return 0;
}
int einit()
{
c = 0; a = 0x10000;
buffer = 0x00; nzero = 0; stflag = 1; sc = 0; ct = 11;
return 0;
}
int encoder(int pix,int *pst,int *pmps)
{
a -= lsz[*pst];
if(pix==*pmps) { if(a<0x8000) {
if(a<lsz[*pst]) { c += a; a = lsz[*pst]; }
EUP; RENORME } }
else {
if(a>=lsz[*pst]) { c += a; a = lsz[*pst]; }
SUP; RENORME }
return 0;
}
int eflush()
{
int temp;
temp = (c+a-1)&0xffff0000;
if(temp<c) c = temp+0x8000; else c = temp;
c <<= ct;
if(c>0x7ffffff) { OUT(buffer+1) while(sc>0) { sc--; OUT00 } }
else { OUT(buffer) while(sc>0) { sc--; OUTFF } }
OUT((int)((c>>19)&0xff))
OUT((int)((c>>11)&0xff))
return 0;
}
static int byteout()
{
int temp;
temp = (c>>19)&0x1ff;
if(temp>0xff) {
OUT(buffer+1) while(sc>0) { sc--; OUT00 } buffer = temp&0xff; }
else {
if(temp==0xff) sc++;
else {
OUT(buffer) while(sc>0) { sc--; OUTFF } buffer = temp; } }
c &= 0x7ffff; ct = 8;
return 0;
}
/*
int st[NCX],mps[NCX];
void main(int argc, char *args[])
{
int i;
for(i=0;i<NCX;i++)
st[i]=mps[i]=0;
if(argc<2){
fprintf(stderr,"nope, don't know that option, 'e' or 'd' only.\n");
exit(1);
}
if(args[1][0]=='e'){
putw(100,stdout);
einit();
for(i=0;i<100;i++)
encoder(i%2,&st[0],&mps[0]);
eflush();
}
else if(args[1][0]=='d'){
int symbol;
int len;
len=getw(stdin);
dinit();
fprintf(stderr,"len=%d\n",len);
for(i=0;i<len;i++){
symbol = decoder(&st[0],&mps[0]);
fprintf(stderr,"%d\n",symbol);
};
}
else
fprintf(stderr,"nope, don't know that option, 'e' or 'd' only.\n");
}
*/
|
Added work/contrib/tic/tic98/q-coder.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#ifndef __Q_CODER_H_
#define __Q_CODER_H_
#ifndef Q_CODER
#define Q_CODER
#endif
#define InitArithEncoding() einit()
#define CloseDownArithEncoding() eflush()
#define InitArithDecoding() dinit()
#define CloseDownArithDecoding() {}
#define binary_arithmetic_encode(c0,c1,p) encoder(p,&(c0),&(c1))
#define binary_arithmetic_decode(c0,c1) decoder(&(c0),&(c1))
int decoder(int *st,int *mps);
int dinit(void);
int einit(void);
int encoder(int pix,int *st,int *mps);
int eflush(void);
extern long CountOfBitsOut;
#endif
|
Added work/contrib/tic/tic98/random_image.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
// %Z% %Y% %M% version %I%, %G%
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
#include "marklist.h"
#include "pbmtools.h"
#include <math.h>
void usage()
{
fprintf(stderr,"usage: \n\tcalc_hough [options] <image>\n"
"options:\n"
" -f n\tsets the raw filename\n"
"\n"
"note:\n"
"tThe raw_data and filtered files are only written after the 1st iteration.\n"
);
exit(1);
}
int main(int argc, char *argv[])
{
int i,ch;
int w,h;
int pixels;
marktype image;
struct timeval tv;
int test=0;
gettimeofday(&tv, NULL);
srandom(tv.tv_usec);
while((ch = getopt(argc, argv, "pvb:r:f:l:h:")) != -1)
switch(ch){
}
w=(random()%400);
h=(random()%300);
test=random()%10;
if(test==0){
w=0;
} else if(test==1){
h=0;
} else if(test==2){
w=h=0;
} else {
}
test=random()%10;
if(test==0){
pixels=0;
} else if(test==1){
pixels=w*h;
} else {
pixels=(int)( ((random()%(w*h+1))));
}
marktype_alloc(&image,w,h);
fprintf(stderr,"random: %dx%d, %d pixels\n",w,h,pixels);
for(i=0;i<pixels;i++){
int xx=random()%w,yy=random()%h;
ppix(image,xx,yy,1);
}
marktype_write(stdout,image);
marktype_free(&image);
return 0;
}
|
Added work/contrib/tic/tic98/rls.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
|
#include <string.h>
#include <stdio.h>
#include "boundary.h"
#include "rls.h"
#include "marklist.h"
#include <assert.h>
marktype rls_smoothed_x(const marktype image, int tx)
{
marktype smoothed;
int x, y, t;
int next;
smoothed=marktype_copy(image);
for (y = 0 ; y < image.h; y++){
for (x = 0 ; x < image.w; x++){
if(gpix(smoothed,x,y)){
for(t=x+1;t<image.w;t++)
if(gpix(smoothed,t,y)==1)
break;
if((t-x<=tx) && (t<image.w)){
for(next=x+1;next<t;next++)
ppix(smoothed,next,y,1);
}
x=t-1;
}
}
}
return smoothed;
}
marktype rls_smoothed_y(const marktype image, int ty)
{
marktype smoothed;
int x, y, t;
int next;
smoothed=marktype_copy(image);
for (x = 0 ; x < image.w; x++){
for (y = 0 ; y < image.h; y++){
if(gpix(smoothed,x,y)){
for(t=y+1;t<image.h;t++)
if(gpix(smoothed,x,t)==1)
break;
if((t-y<=ty) && (t<image.h)){
for(next=y+1;next<t;next++)
ppix(smoothed,x,next,1);
}
y=t-1;
}
}
}
return smoothed;
}
marktype rls(const marktype image, int tx, int ty)
{
marktype smoothed,image_x,image_y;
int x, y, t,p1=1,p2=1;
int next;
image_x=rls_smoothed_x(image,tx);
image_y=rls_smoothed_y(image,ty);
marktype_alloc(&smoothed,image_x.w,image_x.h);
for (x = 0 ; x < image_x.w; x++){
for (y = 0 ; y < image_x.h; y++){
p1=gpix(image_x,x,y);
p2=gpix(image_y,x,y);
if((p1==1) || (p2==1))
ppix(smoothed,x,y,1);
}
}
marktype_free(&image_x);
marktype_free(&image_y);
return smoothed;
}
void usage()
{
fprintf(stderr,"usage: rls image.pbm zonefile\n");
exit(1);
}
int main(int argc, char *argv[])
{
marktype image,image_rls;
marklistptr list=NULL,step;
double bestaccum,accum;
double angle;
int len,i,r;
int _x1[1000],_y1[1000],_x2[1000],_y2[1000],_tags[1000];
char s[100],tag[100];
FILE *fp=NULL;
int num_tags=0;
int x1,y1,x2,y2,tt;
int istext=0, isnot=0;
if(argc<3) {
usage();
}
fp=fopen(argv[2],"rt");
if(fp){
while(fgets(s,100,fp)){
sscanf(s,"%*s %s %d %d %d %d\n",tag,
&_x1[num_tags],
&_y1[num_tags],
&_x2[num_tags],
&_y2[num_tags]);
if(strncmp(tag,"text",4)==0)
_tags[num_tags]=0;
else
_tags[num_tags]=1;
num_tags++;
assert(num_tags<1000);
}
} else {
fprintf(stderr,"error: can't open file: %s\n",argv[2]);
exit(1);
}
if(marktype_readnamed(argv[1],&image)!=0){
fprintf(stderr,"error loading: %s\n",argv[1]);
return 0.0;
}
if(argc>=2)
r=atoi(argv[1]);
else
r=0;
image_rls=rls(image,40,40);
marktype_writenamed("out.pbm",image_rls);
list=extract_all_marks(list,image_rls,0,4);
for(i=0,step=list;step;step=step->next){
marktype *temp=&(step->data);
istext=0;
isnot=0;
for(tt=0;tt<num_tags;tt++){
if((temp->xpos+temp->xcen>=_x1[tt]) &&
(temp->xpos+temp->xcen<_x2[tt]) &&
(temp->ypos+temp->ycen>=_y1[tt]) &&
(temp->ypos+temp->ycen<_y2[tt])){
if(_tags[tt]==0){
istext++;
} else {
isnot++;
}
}
}
if((istext>isnot) && (istext>=1)){
sprintf(tag,"text");
} else if((isnot>istext) && (isnot>=1)){
sprintf(tag,"drawing");
} else {
sprintf(tag,"?");
}
if(temp->set*1.0/(temp->w*temp->h) > 0.25){
fprintf(stdout,"%03d %s %d %d %d %d\n",i,tag,temp->xpos,temp->ypos,temp->xpos+temp->w,temp->ypos+temp->h);
i++;
}
}
marktype_free(&image);
marktype_free(&image_rls);
return 0;
}
|
Added work/contrib/tic/tic98/rls.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
|
#ifndef _RLS_H
#define _RLS_H
#include "marklist.h"
marktype rls(const marktype image, int tx, int ty);
marktype rls_smoothed_x(const marktype image, int tx);
marktype rls_smoothed_y(const marktype image, int ty);
#endif
|
Added work/contrib/tic/tic98/rotate.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
|
/*****************************************************************************
*
* Author: Stuart Inglis <singlis@waikato.ac.nz>
*
*
* This file contains routines dealing with portable bitmap files (PBM)
*
*****************************************************************************/
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "marklist.h"
#include "utils.h"
#include "rotate.h"
/* a positive rotation angle is anti-clockwise */
void rotate_image(marktype *image,double angle, int keep_orig_size)
{
marktype rotimage;
int nx,ny,newheight,newwidth,oldheight,oldwidth,i,j,halfnewheight,halfnewwidth;
int halfoldheight,halfoldwidth;
double radians;
double cosval,sinval;
int pix;
if(angle == 0)
return;
angle=-angle;
radians = angle;
cosval = cos(radians);
sinval = sin(radians);
oldheight = image->h;
oldwidth = image->w;
if(keep_orig_size){
newwidth=oldwidth;
newheight=oldheight;
} else {
newwidth = abs((int)(oldwidth*cosval)) + (int)abs((int)(oldheight*sinval));
newheight = abs((int)(-oldwidth*sinval)) + (int)abs((int)(oldheight*cosval));
}
halfnewheight = newheight / 2;
halfnewwidth = newwidth / 2;
halfoldwidth = oldwidth /2;
halfoldheight = oldheight /2 ;
marktype_alloc(&rotimage,newwidth,newheight);
rotimage.resolution=image->resolution;
for(i=0;i < newheight;i++){
for(j=0;j < newwidth;j++){
/* pbm_putpixel(rotimage.bitmap,j,i,0);*/
nx = (int)( (j - halfnewwidth)*cosval + (i-halfnewheight)*sinval+0.5);
ny = (int)( (0-(j - halfnewwidth))*sinval + (i - halfnewheight)*cosval+0.5);
nx = nx + halfoldwidth;
ny = ny + halfoldheight;
pix=gpix((*image),nx,ny);
ppix(rotimage,j,i,pix);
/* if ((nx < oldwidth) && (ny < oldheight) && (nx >= 0) && (ny >= 0))
pbm_putpixel(rotimage.bitmap,j,i,pbm_getpixel(image->bitmap, nx, ny));*/
}
}
marktype_free(image);
*image=rotimage;
}
static int **newimage(int cols, int rows)
{
int **p;
int i;
p=(int**)malloc(rows*sizeof(int*));
if(p==NULL) error("newimage","out of memory","");
for(i=0;i<rows;i++){
p[i]=(int*)calloc(cols,sizeof(int));
if(p[i]==NULL) error("newimage","out of memory","");
}
return p;
}
static void freeimage(int ***image,int rows)
{
int r;
for(r=0;r<rows;r++)
free((*image)[r]);
free(*image);
(*image)=NULL;
}
#define SCALE 10
void r_hough(marktype image, int threshold)
{
int **z;
int center_x, center_y, r, omega, i, j, rmax;
double rr;
double sarr[180*SCALE], carr[180*SCALE];
center_x = image.w/2; center_y = image.h/2;
rmax = (int)(sqrt((double)(image.w * image.w + image.h * image.h))/2.0);
z = newimage(180*SCALE, 2*rmax + 1);
for (omega = 0; omega < 180*SCALE; omega++){
rr = ((double)omega)/(double)SCALE;
sarr[omega] = sin((double)DEG2RAD(rr));
carr[omega] = cos((double)DEG2RAD(rr));
}
/* initialise z */
for (r = 0; r < 2 * rmax + 1; r++)
for (omega = 0; omega < 180*SCALE; omega++)
z[omega][r] = 0;
for (i = 0; i < image.w; i++)
for (j = 0; j < image.h; j++){
if (pbm_getpixel(image.bitmap,i,j))
for (omega = 0; omega < 180*SCALE; ++omega){
rr = (j - center_y) * sarr[omega]
- (i - center_x) * carr[omega];
if (rr < 0.0) r = (int)rr;
else r = (int)rr + 1;
z[omega][rmax + r] += 1;
}
}
freeimage(&z,2*rmax+1);
}
|
Added work/contrib/tic/tic98/rotate.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
/*****************************************************************************
*
* Author: Stuart Inglis <singlis@waikato.ac.nz>
*
*
* This file contains functions which are common utilities
*
*****************************************************************************/
#ifndef __ROTATE_H
#define __ROTATE_
#include "marklist.h"
void rotate_image(marktype *image,double angle, int keep_orig_size);
void r_hough(marktype image, int threshold);
#endif
|
Added work/contrib/tic/tic98/rotate_image.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
#include <stdio.h>
#include <math.h>
#include "marklist.h"
#include "rotate.h"
void usage(void)
{
fprintf(stderr,
"usage: rotate_image [options] <filename> <skew>\n"
"\n"
"options:\n"
" -a\tthe angle is specified in radians\n"
" -k\tkeep original file size\n"
"\n"
"notes:\n"
"\ta positive skew, is a clockwise rotation from\n"
"\tdue east. ie. 4.75 degrees\n"
);
exit(1);
}
int main(int argc, char *argv[])
{
marktype image;
double angl=-999;
char *infile=NULL;
extern char *optarg;
extern int optind;
int keep_orig_size=0;
int ch;
int radians=0;
while((ch = getopt(argc, argv, "kr")) != -1)
switch(ch){
case 'k': keep_orig_size=1;break;
case 'r': radians=1; break;
default:
usage();
break;
}
for(; optind <argc; optind++){
if(!infile) infile=argv[optind];
else if(angl==-999) angl=atof(argv[optind]);
else usage();
}
if((infile==NULL) || (angl==-999))
usage();
marktype_readnamed(infile,&image);
if(radians==0){
angl=DEG2RAD(angl);
}
rotate_image(&image,angl,keep_orig_size);
marktype_writenamed("-",image);
return 0;
}
|
Added work/contrib/tic/tic98/sort_lines.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
|
/*
* Module: sort_lines
*
* This file contains functions which sort the marks into a
* "readable sequence" Sorts the marks by their y baseline then
* by their x centroid.
*
* Author:
* Stuart Inglis (singlis@internz.co.nz)
* (c) 1998
*/
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include "globals.h"
#include "marklist.h"
#include "sort_lines.h"
#include "vector.h"
#include "line.h"
static int cmpint(const void *e1, const void *e2)
{
return ( ((int*)e1) - ((int*)e2) );
}
static int CmpOnY(const void *e1, const void *e2)
{
return ( (((marktype*)e1)->ypos+((marktype*)e1)->h-1)
- (((marktype*)e2)->ypos+((marktype*)e2)->h-1));
}
/* a +ve rotation rotates anti-clockwise from east */
/*
* (100,0) rotated 90 degrees is (100,0)
*
* (0,100)
* |
* |
* |
* |
* |
* --+---------- (100,0)
*
*/
void rot(double *x, double *y, const double theta,
const double cx, const double cy)
{
double xx,yy;
*x-=cx;
*y-=cy;
xx=(*x)*cos(theta) - (*y)*sin(theta);
yy=(*x)*sin(theta) + (*y)*cos(theta);
*x=xx+cx;
*y=yy+cy;
}
void rot_check()
{
double xx,yy;
xx=100; yy=0;
rot(&xx,&yy,DEG2RAD(90),0,0);
if(!(fabs(xx-0)<1e-8) && (fabs(yy-100)<1e-8)){
fprintf(stderr,"rot() violated! %g %g\n",xx,yy);
}
xx=100; yy=0;
rot(&xx,&yy,-DEG2RAD(90),0,0);
if(!(fabs(xx-0)<1e-8) && (fabs(yy+100)<1e-8)){
fprintf(stderr,"rot() violated! %g %g\n",xx,yy);
}
}
marklistptr sortmarks_random(const marklistptr listofmarks,
const int imagew,
const int imageh,
const double rotated_angle,
const int DPI)
{
marklistptr step,listret=NULL;
marktype *row_of_marks=NULL;
marktype *random_rows=NULL;
int i,len,left;
if(listofmarks==NULL)
return NULL;
if((imagew==0) || (imageh==0))
return listofmarks;
assert((rotated_angle>=-180) &&(rotated_angle<=180));
assert(DPI);
len=marklist_length(listofmarks);
CALLOC(row_of_marks,len,marktype);
CALLOC(random_rows,len,marktype);
for(i=0,step=listofmarks; step ;i++,step=step->next){
row_of_marks[i]=marktype_copy(step->data);
}
listret=NULL;
srandom(len);
left=len;
for(i=0;i<len;i++){
int k;
k=random()%left;
random_rows[i]=row_of_marks[k];
row_of_marks[k]=row_of_marks[left-1];
left--;
}
for(i=0; i<len ;i++){
if(listret==NULL)
step=marklist_add(&listret,random_rows[i]);
else
step=marklist_add(&step,random_rows[i]);
}
FREE(row_of_marks);
FREE(random_rows);
return listret;
}
#define NEW_LINE {\
num_lines++;\
REALLOC(lines,num_lines,linetype);\
line_init(&lines[num_lines-1]);\
}
marklistptr sortmarks_profile(const marklistptr listofmarks,
const int imagew,
const int imageh,
const double rotated_angle,
const int DPI)
{
marklistptr step,listret=NULL;
int i,pixels;
int start,end,len;
vectortype profile;
double x,y;
int num_lines=0;
linetype *lines=NULL;
if(listofmarks==NULL)
return NULL;
if((imagew==0) || (imageh==0))
return listofmarks;
assert((rotated_angle>=-180) &&(rotated_angle<=180));
assert(DPI);
len=marklist_length(listofmarks);
pixels=mm2pixels(globals.g_reading_parameter,DPI);
assert(pixels<=10000);
vector_alloc(&profile, imageh*3);
for(step=listofmarks;step;step=step->next){
x=step->data.xpos;
y=step->data.ypos+step->data.h-1;
rot(&x,&y,DEG2RAD(-5),imagew/2.0,imageh/2.0);
assert(imageh+(int)y >=0);
assert(imageh+(int)y < profile.size);
profile.v[imageh+(int)y]++;
}
for(i=0;i<profile.size;i++){
profile.v[i]=(profile.v[i]*profile.v[i]);
}
if(pixels){
vector_convolve(&profile,pixels,RECTANGULAR);
}
vector_norm(&profile);
vector_threshold(&profile,0.3,0,1);
vector_invert(&profile);
vector_mean(&profile);
start=end=0;
while((start<profile.size) && (end<profile.size)){
NEW_LINE;
start=end;
end++;
while((end<profile.size) && (profile.v[end]<0.99)){
end++;
}
for(step=listofmarks;step;step=step->next){
double x,y;
x=step->data.xpos;
y=step->data.ypos+step->data.h-1;
rot(&x,&y,DEG2RAD(-5),imagew/2.0,imageh/2.0);
if((y>=start) && (y<end)){
line_addmark(&lines[num_lines-1],&step->data);
}
}
}
for(i=0;i<num_lines;i++){
line_sort_xpos(&lines[i]);
}
listret=lines_to_listcopy(&lines,num_lines);
for(i=0;i<num_lines;i++)
line_free(&lines[i]);
FREE(lines);
vector_free(&profile);
return listret;
}
marklistptr sortmarks_zhang(const marklistptr listofmarks,
const int imagew,
const int imageh,
const double rotated_angle,
const int DPI)
{
marklistptr step,listret=NULL;
marktype *all_marks=NULL;
int num_lines=0;
linetype *lines=NULL;
int baseline;
int i,len;
if(listofmarks==NULL)
return NULL;
if((imagew==0) || (imageh==0))
return listofmarks;
assert((rotated_angle>=-180) &&(rotated_angle<=180));
assert(DPI);
len=marklist_length(listofmarks);
CALLOC(all_marks,len,marktype);
for(i=0,step=listofmarks; step ;i++,step=step->next){
all_marks[i]=step->data;
}
qsort((void*)all_marks,(unsigned int)len,sizeof(marktype),CmpOnY);
baseline=-1;
for(i=0;i<len;i++){
int t;
t=all_marks[i].ypos;
assert(t>=0);
/* if t is higher than the baseline */
if(t<=baseline){
/* on line */
line_addmark(&lines[num_lines-1],&all_marks[i]);
} else {
/* start of a new line */
NEW_LINE;
baseline=all_marks[i].ypos+all_marks[i].h-1;
line_addmark(&lines[num_lines-1],&all_marks[i]);
}
}
for(i=0;i<num_lines;i++){
line_sort_xpos(&lines[i]);
}
listret=lines_to_listcopy(&lines,num_lines);
for(i=0;i<num_lines;i++)
line_free(&lines[i]);
FREE(lines);
FREE(all_marks);
return listret;
}
#define TENTATIVE 25
marklistptr sortmarks_howard(const marklistptr listofmarks,
const int imagew,
const int imageh,
const double skew_of_page, /* in rads */
const int DPI)
{
marklistptr step,listret=NULL;
marktype *all_marks_rot=NULL;
int baseline;
int i,j;
int num_lines=0;
int len;
int act;
int bots[TENTATIVE];
linetype *lines=NULL;
linetype line_indirect;
rot_check();
if(listofmarks==NULL)
return NULL;
if((imagew==0) || (imageh==0))
return listofmarks;
assert(DPI);
line_init(&line_indirect);
line_add(&line_indirect,listofmarks);
len=marklist_length(listofmarks);
CALLOC(all_marks_rot,len,marktype);
/* assume the input arrives in order of extraction */
for(i=0,step=listofmarks; step ;i++,step=step->next){
double x,y,w,h,oldh;
step->data.symnum=i;
all_marks_rot[i]=step->data;
x=step->data.xpos;
y=step->data.ypos;
/* it's -ve because you want to rotate it the opposite way */
/* but it's -ve that again, because y increases downwards */
rot(&x,&y,skew_of_page,imagew/2.0,imageh/2.0);
all_marks_rot[i].xpos=ROUND(x);
all_marks_rot[i].ypos=ROUND(y);
w=step->data.w;
h=step->data.h;
assert(w && h);
rot(&w,&h,skew_of_page,0,0);
all_marks_rot[i].w=ROUND(w);
if(all_marks_rot[i].w==0){
all_marks_rot[i].w++;
}
if(all_marks_rot[i].h==0){
all_marks_rot[i].h++;
}
all_marks_rot[i].start_of_line=0;
}
qsort((void*)all_marks_rot,(unsigned int)len,sizeof(marktype),CmpOnY);
while(len>0){
act=MIN(TENTATIVE,len);
for(i=0;i<act;i++){
bots[i]=all_marks_rot[i].ypos + all_marks_rot[i].h-1;
}
qsort((void*)bots,(unsigned int)act,sizeof(int),cmpint);
/* find the median */
baseline=bots[act/2];
/* copy the right marks, and remove them from the list */
NEW_LINE;
for(i=0,j=0;j<len;i++,j++){
if(i!=j){
all_marks_rot[i]=all_marks_rot[j];
}
if((all_marks_rot[i].ypos<=baseline) ){
line_addmark(&lines[num_lines-1],&all_marks_rot[i]);
i--;
}
}
len=i;
line_sort_xpos(&lines[num_lines-1]);
line_stats_indirect(&lines[num_lines-1],&line_indirect);
}
/*listret=lines_to_listcopy(&lines,num_lines);*/
listret=lines_to_listcopy_indirect(&lines,&line_indirect,num_lines);
for(i=0;i<num_lines;i++)
line_free(&lines[i]);
FREE(lines);
line_free(&line_indirect);
FREE(all_marks_rot);
return listret;
}
|
Added work/contrib/tic/tic98/sort_lines.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#ifndef _SORT_LINES_H
#define _SORT_LINES_H
#include "marklist.h"
marklistptr sortmarks_profile(marklistptr listofmarks,
const int w,
const int h,
const double rotated_angle,
const int DPI);
marklistptr sortmarks_random(const marklistptr listofmarks,
const int imagew,
const int imageh,
const double rotated_angle,
const int DPI);
marklistptr sortmarks_zhang(const marklistptr listofmarks,
const int imagew,
const int imageh,
const double rotated_angle,
const int DPI);
marklistptr sortmarks_howard(const marklistptr listofmarks,
const int imagew,
const int imageh,
const double rotated_angle,
const int DPI);
void rot(double *x, double *y, const double theta,
const double cx, const double cy);
#endif
|
Added work/contrib/tic/tic98/sort_lines.old.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
|
/*
* Module: sort_lines
*
* This file contains functions which sort the marks into a
* "readable sequence" Sorts the marks by their y baseline then
* by their x centroid.
*
* Author:
* Stuart Inglis (singlis@internz.co.nz)
* (c) 1998
*/
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include "marklist.h"
#include "sort_lines.h"
static int CmpOnY(const void *e1, const void *e2)
{
return ( ((marktype*)e1)->baseline - ((marktype*)e2)->baseline);
}
static int CmpOnX(const void *e1, const void *e2)
{
return ( (((marktype*)e1)->xpos+((marktype*)e1)->xcen)
- (((marktype*)e2)->xpos+((marktype*)e2)->xcen));
}
#define LINE_THRESHOLD_mm 1 /* 1mm */
marklistptr sortmarks(marklistptr listofmarks,
const int imagew,
const int imageh,
const double rotated_angle,
const int DPI)
{
marktype *table;
int count=0,i,s,e,j,k,l,cc;
marktype *distary;
int dist_p,dist;
int maxxx,maxxxp;
int yy;
int pixels=0;
int N_NEAREST=7; /* replace the base line with the mode of the N neighbours */
int nx,ny,len;
double radians,cosval,sinval;
if(listofmarks==NULL)
return listofmarks;
if((imagew==0) || (imageh==0))
return listofmarks;
assert((rotated_angle>=-180) &&(rotated_angle<=180));
assert(DPI);
len=marklist_length(listofmarks);
pixels=mm2pixels(LINE_THRESHOLD_mm,DPI);
assert((pixels>=1) && (pixels<=10000));
CALLOC(table,len,marktype);
CALLOC(distary,len,marktype);
/*fprintf(stderr,"sorting: rotating marks by %g degrees...\n",-rotated_angle);*/
/* put all the marks into a table, rotate the points, the opposite way */
radians = -(rotated_angle) / ((180.0 / PI));
cosval = cos(radians);
sinval = sin(radians);
count=0;
while(listofmarks){
table[count]=listofmarks->data;
/*
* hide the original x and y positions in the h_runs and v_runs
* variables
*/
table[count].h_runs=table[count].xpos;
table[count].v_runs=table[count].ypos;
if(rotated_angle){
/* rotate the points around the centre of the image */
nx = (int)( (table[count].xpos-imagew/2)*cosval +
(table[count].ypos-imageh/2)*sinval+0.5)+imagew/2;
ny = (int)( (0-(table[count].xpos-imagew/2))*sinval +
(table[count].ypos-imageh/2)*cosval+0.5)+imageh/2;
table[count].xpos=nx;
table[count].ypos=ny;
if(nx<0){/*if(V)fprintf(stderr,"setting nx=%d to 0\n",nx);*/nx=0;}
if(ny<0){/*if(V)fprintf(stderr,"setting ny=%d to 0\n",ny);*/ny=0;}
if(nx>=imagew-1){/*if(V)fprintf(stderr,"setting nx=%d to %d\n",nx,imagew-1);*/nx=imagew-1;}
if(ny>=imageh-1){/*if(V)fprintf(stderr,"setting ny=%d to %d\n",ny,imageh-1);*/ny=imageh-1;}
assert((nx>=0) && (ny>=0));
assert((nx<imagew) && (ny<imageh));
}
marklist_removeat(&listofmarks,0);
count++;
}
assert(count==len);
/* set the baseline line to be the lower bounding box position */
for(i=0;i<count;i++)
table[i].baseline=table[i].ypos+table[i].h-1;
/* foreach mark, find it's neighbours that the ycentroid is within the y limits... */
for(i=0;i<count;i++){
yy=table[i].ypos+table[i].ycen;
dist_p=0;
/* exhaustive! eek! */
for(j=0;j<count;j++){
if(
((yy >= table[j].ypos- (2*pixels)) &&
(yy <= table[j].ypos+table[j].h-1+ (2*pixels) ))
) {
/* found a mark */
dist=abs((table[i].xpos+table[i].xcen)-(table[j].xpos+table[j].xcen));
distary[dist_p]=table[j];
distary[dist_p].xpos=dist;
distary[dist_p].xcen=0;
distary[dist_p].baseline=table[j].baseline;
dist_p++;
}
}
/* found a list of marks on the "same line" */
qsort((void*)distary,(unsigned int)dist_p,sizeof(*distary),CmpOnX);
maxxx=-1;maxxxp=-1;
for(k=0;k<MIN(N_NEAREST,dist_p);k++){
cc=0;
for(l=0;l<MIN(N_NEAREST,dist_p);l++)
if(distary[k].baseline==distary[l].baseline)
cc++;
if(cc>maxxx) {maxxx=cc; maxxxp=k;}
}
assert((maxxx>=0) && (maxxxp>=0));
/* mode y position is 'distary[maxxxp]', replace table[i] with this value */
table[i].baseline=distary[maxxxp].baseline;
}
/* sort on the baseline positions */
qsort((void*)table, (unsigned int)(count), sizeof(*table), CmpOnY);
/* group the lines if the baselines are with LINE_THRESHOLD_mm of each other */
for(s=0;s<count;){
int c;
for(e=s+1,c=0; (e<count) &&
((table[e].baseline)-(table[e-1].baseline) <= pixels); c++,e++);
if(e<=count && c>=1){
qsort(&table[s], (unsigned int)(e-s), sizeof(*table), CmpOnX);
}
s=e;
}
/* update the symbol numbers */
for(i=0;i<count;i++){
table[i].symnum=i;
table[i].xpos=table[i].h_runs; /* use the h_runs for now! */
table[i].ypos=table[i].v_runs;
marklist_addcopy(&listofmarks,table[i]);
}
FREE(distary);
FREE(table);
return listofmarks;
}
|
Added work/contrib/tic/tic98/sort_lines_old.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
|
/*
* Module: sort_lines
*
* This file contains functions which sort the marks into a
* "readable sequence" Sorts the marks by their y baseline then
* by their x centroid.
*
* Author:
* Stuart Inglis (singlis@internz.co.nz)
* (c) 1998
*/
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include "globals.h"
#include "marklist.h"
#include "sort_lines.h"
#include "vector.h"
static int cmpint(const void *e1, const void *e2)
{
return ( ((int*)e1) - ((int*)e2) );
}
static int CmpOnY(const void *e1, const void *e2)
{
return ( (((marktype*)e1)->ypos+((marktype*)e1)->h-1)
- (((marktype*)e2)->ypos+((marktype*)e2)->h-1));
}
static int CmpOnX(const void *e1, const void *e2)
{
return ( (((marktype*)e1)->xpos+((marktype*)e1)->xcen)
- (((marktype*)e2)->xpos+((marktype*)e2)->xcen));
}
static int CmpOnXpos(const void *e1, const void *e2)
{
return ( (((marktype*)e1)->xpos)
- (((marktype*)e2)->xpos) );
}
/* a +ve rotation rotates anti-clockwise from east */
/*
* (100,0) rotated 90 degrees is (100,0)
*
* (0,100)
* |
* |
* |
* |
* |
* --+---------- (100,0)
*
*/
void rot(double *x, double *y, const double theta,
const double cx, const double cy)
{
double xx,yy;
*x-=cx;
*y-=cy;
xx=(*x)*cos(theta) - (*y)*sin(theta);
yy=(*x)*sin(theta) + (*y)*cos(theta);
*x=xx+cx;
*y=yy+cy;
}
void rot_check()
{
double xx,yy;
xx=100; yy=0;
rot(&xx,&yy,DEG2RAD(90),0,0);
if(!(fabs(xx-0)<1e-8) && (fabs(yy-100)<1e-8)){
fprintf(stderr,"rot() violated! %g %g\n",xx,yy);
}
xx=100; yy=0;
rot(&xx,&yy,-DEG2RAD(90),0,0);
if(!(fabs(xx-0)<1e-8) && (fabs(yy+100)<1e-8)){
fprintf(stderr,"rot() violated! %g %g\n",xx,yy);
}
}
marklistptr sortmarks_random(const marklistptr listofmarks,
const int imagew,
const int imageh,
const double rotated_angle,
const int DPI)
{
marklistptr step,listret=NULL;
marktype *row_of_marks=NULL;
marktype *random_rows=NULL;
int i,len,left;
if(listofmarks==NULL)
return NULL;
if((imagew==0) || (imageh==0))
return listofmarks;
assert((rotated_angle>=-180) &&(rotated_angle<=180));
assert(DPI);
len=marklist_length(listofmarks);
CALLOC(row_of_marks,len,marktype);
CALLOC(random_rows,len,marktype);
for(i=0,step=listofmarks; step ;i++,step=step->next){
row_of_marks[i]=marktype_copy(step->data);
}
listret=NULL;
srandom(len);
left=len;
for(i=0;i<len;i++){
int k;
k=random()%left;
random_rows[i]=row_of_marks[k];
row_of_marks[k]=row_of_marks[left-1];
left--;
}
for(i=0; i<len ;i++){
if(listret==NULL)
step=marklist_add(&listret,random_rows[i]);
else
step=marklist_add(&step,random_rows[i]);
}
FREE(row_of_marks);
FREE(random_rows);
return listret;
}
typedef struct {
marktype *marks;
int num;
} rowtype;
void
rowtype_init(rowtype *r)
{
r->marks=NULL;
r->num=0;
}
void
rowtype_free(rowtype *r)
{
if(r->marks)
FREE(r->marks);
rowtype_init(r);
}
void
rowtype_add(rowtype *r, marktype *m)
{
r->num++;
REALLOC(r->marks,r->num,marktype);
r->marks[r->num-1]=*m;
}
void
rowtype_print(rowtype *r)
{
int i;
for(i=0;i<r->num;i++){
fprintf(stderr,"%d ",r->marks[i].ypos);
}
fprintf(stderr,"\n");
}
marklistptr
rowtype_to_list(marktype *all_marks, rowtype *rows, int num_rows)
{
int i;
marklistptr step,listret=NULL;
/* sort based on the x centroid */
for(i=0;i<num_rows;i++){
qsort((void*)rows[i].marks,(unsigned int)rows[i].num,
sizeof(marktype),CmpOnXpos);
}
/* put them back into the list in order */
for(i=0;i<num_rows;i++){
float xi=0,yi=0,xiyi=0,xi2=0,tx,ty,a,b;
int n=0,j;
for(j=0;j<rows[i].num;j++){
n++;
xi+=(tx=(rows[i].marks[j].xpos));
yi+=(ty=(rows[i].marks[j].ypos+rows[i].marks[j].h-1));
xi2+=(tx*tx);
xiyi+=(tx*ty);
}
b=xiyi - (xi*yi/n);
b=b/(xi2 - (xi*xi/n));
a=yi/n - b*(xi/n);
/* if(n>10)
rows[i].marks[0].skew_of_line=-atan(b); // original at top
else*/
rows[i].marks[0].skew_of_line=0;
// fprintf(stderr,"skew of line: %d = %f\n",i,rows[i].marks[0].skew_of_line);
for(j=0;j<rows[i].num;j++){
marktype copy;
copy=all_marks[rows[i].marks[j].symnum];
if(j==0){
copy.start_of_line=1;
copy.ypos_of_line=ROUND(a);
} else if(j==rows[i].num-1){
copy.start_of_line=2;
} else {
copy.start_of_line=0;
}
if(listret==NULL){
step=marklist_addcopy(&listret,copy);
} else {
step=marklist_addcopy(&step,copy);
}
}
}
return listret;
}
marklistptr
rowtype_to_list_old(rowtype *rows, int num_rows)
{
int i;
marklistptr step,listret=NULL;
/* sort based on the x centroid */
for(i=0;i<num_rows;i++){
qsort((void*)rows[i].marks,(unsigned int)rows[i].num,
sizeof(marktype),CmpOnXpos);
}
/* put them back into the list in order */
for(i=0;i<num_rows;i++){
float xi=0,yi=0,xiyi=0,xi2=0,tx,ty,a,b;
int n=0,j;
for(j=0;j<rows[i].num;j++){
n++;
xi+=(tx=(rows[i].marks[j].xpos));
yi+=(ty=(rows[i].marks[j].ypos+rows[i].marks[j].h-1));
xi2+=(tx*tx);
xiyi+=(tx*ty);
}
b=xiyi - (xi*yi/n);
b=b/(xi2 - (xi*xi/n));
a=yi/n - b*(xi/n);
/* if(n>10)
rows[i].marks[0].skew_of_line=-atan(b); // original at top
else*/
rows[i].marks[0].skew_of_line=0;
// fprintf(stderr,"skew of line: %d = %f\n",i,rows[i].marks[0].skew_of_line);
for(j=0;j<rows[i].num;j++){
if(j==0){
rows[i].marks[j].start_of_line=1;
rows[i].marks[j].ypos_of_line=ROUND(a);
}
else
rows[i].marks[j].start_of_line=0;
if(listret==NULL)
step=marklist_addcopy(&listret,rows[i].marks[j]);
else
step=marklist_addcopy(&step,rows[i].marks[j]);
}
}
return listret;
}
#define NEW_ROW {\
num_rows++;\
REALLOC(rows,num_rows,rowtype);\
rowtype_init(&rows[num_rows-1]);\
}
marklistptr sortmarks_profile(const marklistptr listofmarks,
const int imagew,
const int imageh,
const double rotated_angle,
const int DPI)
{
marklistptr step,listret=NULL;
int i,pixels;
int start,end,len;
vectortype profile;
double x,y;
int num_rows=0;
rowtype *rows=NULL;
if(listofmarks==NULL)
return NULL;
if((imagew==0) || (imageh==0))
return listofmarks;
assert((rotated_angle>=-180) &&(rotated_angle<=180));
assert(DPI);
len=marklist_length(listofmarks);
pixels=mm2pixels(globals.g_reading_parameter,DPI);
assert(pixels<=10000);
vector_alloc(&profile, imageh*3);
for(step=listofmarks;step;step=step->next){
x=step->data.xpos;
y=step->data.ypos+step->data.h-1;
rot(&x,&y,DEG2RAD(-5),imagew/2.0,imageh/2.0);
assert(imageh+(int)y >=0);
assert(imageh+(int)y < profile.size);
profile.v[imageh+(int)y]++;
}
for(i=0;i<profile.size;i++){
profile.v[i]=(profile.v[i]*profile.v[i]);
}
if(pixels){
vector_convolve(&profile,pixels,RECTANGULAR);
}
vector_norm(&profile);
vector_threshold(&profile,0.3,0,1);
vector_invert(&profile);
vector_mean(&profile);
{
int rows=1;
for(i=0;i<profile.size;i++){
if(profile.v[i]>0.99)
rows++;
}
fprintf(stderr,"rows: %d\n",rows);
}
start=end=0;
while((start<profile.size) && (end<profile.size)){
NEW_ROW;
start=end;
end++;
while((end<profile.size) && (profile.v[end]<0.99)){
end++;
}
for(step=listofmarks;step;step=step->next){
double x,y;
x=step->data.xpos;
y=step->data.ypos+step->data.h-1;
rot(&x,&y,DEG2RAD(-5),imagew/2.0,imageh/2.0);
if((y>=start) && (y<end)){
rowtype_add(&rows[num_rows-1],&step->data);
}
}
}
fprintf(stderr,"rows: %d\n",num_rows);
listret=rowtype_to_list_old(rows,num_rows);
for(i=0;i<num_rows;i++){
rowtype_free(&rows[i]);
}
FREE(rows);
vector_free(&profile);
return listret;
}
marklistptr sortmarks_zhang(const marklistptr listofmarks,
const int imagew,
const int imageh,
const double rotated_angle,
const int DPI)
{
marklistptr step,listret=NULL;
marktype *all_marks=NULL;
int num_rows=0;
rowtype *rows=NULL;
int baseline;
int i,len;
if(listofmarks==NULL)
return NULL;
if((imagew==0) || (imageh==0))
return listofmarks;
assert((rotated_angle>=-180) &&(rotated_angle<=180));
assert(DPI);
len=marklist_length(listofmarks);
CALLOC(all_marks,len,marktype);
for(i=0,step=listofmarks; step ;i++,step=step->next){
all_marks[i]=step->data;
}
qsort((void*)all_marks,(unsigned int)len,sizeof(marktype),CmpOnY);
baseline=-1;
for(i=0;i<len;i++){
int t;
t=all_marks[i].ypos;
assert(t>=0);
/* if t is higher than the baseline */
if(t<=baseline){
/* on line */
rowtype_add(&rows[num_rows-1],&all_marks[i]);
} else {
/* start of a new line */
NEW_ROW;
baseline=all_marks[i].ypos+all_marks[i].h-1;
rowtype_add(&rows[num_rows-1],&all_marks[i]);
}
};
listret=rowtype_to_list(all_marks,rows,num_rows);
for(i=0;i<num_rows;i++){
rowtype_free(&rows[i]);
}
FREE(rows);
for(i=0;i<len;i++)
marktype_free(&all_marks[i]);
FREE(all_marks);
return listret;
}
#define TENTATIVE 25
marklistptr sortmarks_howard(const marklistptr listofmarks,
const int imagew,
const int imageh,
const double rotated_angle,
const int DPI)
{
marklistptr step,listret=NULL;
marktype *all_marks=NULL;
marktype *all_marks_rot=NULL;
int baseline;
int i,j;
int num_rows=0;
rowtype *rows=NULL;
int len;
int act;
int bots[TENTATIVE];
marktype im;
rot_check();
if(listofmarks==NULL)
return NULL;
if((imagew==0) || (imageh==0))
return listofmarks;
assert((rotated_angle>=-180) &&(rotated_angle<=180));
assert(DPI);
len=marklist_length(listofmarks);
marklist_reconstruct(listofmarks,&im);
CALLOC(all_marks,len,marktype);
CALLOC(all_marks_rot,len,marktype);
/* assume the input arrives in order of extraction */
for(i=0,step=listofmarks; step ;i++,step=step->next){
double x,y,w,h;
step->data.symnum=i;
all_marks[i]=step->data;
all_marks_rot[i]=step->data;
x=step->data.xpos;
y=step->data.ypos;
/* it's -ve because you want to rotate it the opposite way */
/* but it's -ve that again, because y increases downwards */
rot(&x,&y,globals.g_skew,imagew/2.0,imageh/2.0);
all_marks_rot[i].xpos=ROUND(x);
all_marks_rot[i].ypos=ROUND(y);
w=step->data.w;
h=step->data.h;
rot(&w,&h,globals.g_skew,0,0);
all_marks_rot[i].w=ROUND(w);
all_marks_rot[i].w=ROUND(h);
}
qsort((void*)all_marks_rot,(unsigned int)len,sizeof(marktype),CmpOnY);
while(len>0){
act=MIN(TENTATIVE,len);
for(i=0;i<act;i++){
bots[i]=all_marks_rot[i].ypos+all_marks_rot[i].h-1;
}
qsort((void*)bots,(unsigned int)act,sizeof(int),cmpint);
/* find the median */
baseline=bots[act/2];
/* fprintf(stderr,"row %d: %d (%d)\n",num_rows, baseline,len);*/
NEW_ROW;
for(i=0;i<len;i++){
if(all_marks_rot[i].ypos<=baseline){
rowtype_add(&rows[num_rows-1],&all_marks_rot[i]);
}
}
/* remove them */
/*
for(i=0;i<len;i++){
int k,p;
if(all_marks[i].ypos<=baseline){
k=i;p=0;
while((k<len) && (all_marks[k].ypos<=baseline)){
k++;
p++;
}
for(j=k+1;j<len;j++)
all_marks[j-k+i]=all_marks[j];
len--;
i--;
}
}
*/
for(i=0;i<len;i++){
if(all_marks_rot[i].ypos<=baseline){
for(j=i+1;j<len;j++)
all_marks_rot[j-1]=all_marks_rot[j];
len--;
i--;
}
}
}
/* fprintf(stderr,"num_rows %d\n",num_rows);*/
listret=rowtype_to_list(all_marks,rows,num_rows);
for(step=listret; step ;step=step->next){
if(step->data.start_of_line){
if(step->data.start_of_line==1){
for(i=0;i<=20;i++){
ppix(im,step->data.xpos+i,step->data.ypos+step->data.h,1);
ppix(im,step->data.xpos+i,step->data.ypos+step->data.h+1,1);
}
for(i=-20;i<=10;i++){
ppix(im,step->data.xpos,step->data.ypos+step->data.h+i,1);
ppix(im,step->data.xpos+1,step->data.ypos+step->data.h+i,1);
}
}
else if(step->data.start_of_line==2){
for(i=-20;i<=0;i++){
ppix(im,step->data.xpos+step->data.w+i,step->data.ypos+step->data.h,1);
ppix(im,step->data.xpos+step->data.w+i,step->data.ypos+step->data.h+1,1);
}
for(i=-20;i<=10;i++){
ppix(im,step->data.xpos+step->data.w,step->data.ypos+step->data.h+i,1);
ppix(im,step->data.xpos+step->data.w+1,step->data.ypos+step->data.h+i,1);
}
}
}
}
marktype_writenamed("a.pbm",im);
marktype_free(&im);
for(i=0;i<num_rows;i++){
rowtype_free(&rows[i]);
}
FREE(rows);
FREE(all_marks);
FREE(all_marks_rot);
return listret;
}
|
Added work/contrib/tic/tic98/template_match.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
|
/*
* Module: template_match
*
*
* Author:
* Stuart Inglis (singlis@internz.co.nz)
* (c) 1998
*/
#include "template_match.h"
#include "marklist.h"
#include "pbmtools.h"
#include "utils.h"
#include "globals.h"
#include <math.h>
int XOR_match(marktype *b1, marktype *b2)
{
static int r,c;
static int offx,offy;
static int p1,p2;
static int count;
static int tr,tc;
static int totalbox,totalbox2;
static int x1m,y1m,x2M,y2M;
offx=b1->xcen-b2->xcen;
offy=b1->ycen-b2->ycen;
x1m=offx;
y1m=offx;
x2M=b2->w+offx;
y2M=b2->h+offy;
x1m=MIN(x1m,0);
y1m=MIN(y1m,0);
x2M=MAX(x2M,b1->w);
y2M=MAX(y2M,b1->h);
/*
x1m=0;
y1m=0;
x2M=b1->w;
y2M=b1->h;
*/
count=0;
for(r=y1m;r<y2M;r++)
for(c=x1m;c<x2M;c++){
p1=gpix((*b1),c,r);
tc=c-offx;
tr=r-offy;
p2=gpix((*b2),tc,tr);
if(p1!=p2) {
count++;
}
}
totalbox=(x2M-x1m)*(y2M-y1m);
return 100*count/totalbox;
}
/* error mask goes from 0..8, single pixel errors are worth nothing */
int WXOR_match(marktype *b1, marktype *b2)
{
int r,c,i,j;
int minr,minc;
int maxr,maxc;
int offx,offy;
int p1,p2;
int count=0;
marktype d;
int totalbox;
offx=b1->xcen-b2->xcen;
offy=b1->ycen-b2->ycen;
minc=MIN(0,offx);
minr=MIN(0,offy);
maxc=MAX(b1->w,b2->w+offx);
maxr=MAX(b1->h,b2->h+offy);
d.w=maxc-minc+1;
d.h=maxr-minr+1;
marktype_alloc(&d,d.w,d.h);
for(r=minr;r<maxr;r++)
for(c=minc;c<maxc;c++){
p1=gpix((*b1),c,r);
p2=gpix((*b2),c-offx,r-offy);
pbm_putpixel(d.bitmap,c-minc,r-minr,p1!=p2);
}
for(r=minr;r<maxr;r++)
for(c=minc;c<maxc;c++)if(pbm_getpixel(d.bitmap,c-minc,r-minr))
for(i=-1;i<=1;i++)
for(j=-1;j<=1;j++)if((r+j>=0) && (c+i>=0) && (r+j<d.h) && (c+i<d.w) &&((i!=0)||(j!=0))&&(pbm_getpixel(d.bitmap,c+i-minc,r+j-minr)))
count++;
marktype_free(&d);
totalbox=(maxc-minc)*(maxr-minr);
return 100*count/totalbox;
}
/* define an array for most matches, if it is a massive mark, then WXOR is called */
#define S_SIZE 500
static unsigned char scratch[S_SIZE][S_SIZE],sc2[S_SIZE][S_SIZE];
/* Weighted AND-NOT */
int WAN_match(marktype *b1, marktype *b2)
{
int r,c,i,j;
int minr,minc;
int maxr,maxc;
int offx,offy;
int p1,p2;
int count=0;
int totalbox;
offx=b1->xcen-b2->xcen;
offy=b1->ycen-b2->ycen;
minc=MIN(0,offx);
minr=MIN(0,offy);
maxc=MAX(b1->w,b2->w+offx);
maxr=MAX(b1->h,b2->h+offy);
if(((maxc-minc)>=S_SIZE)||((maxr-minr)>=S_SIZE))
return WXOR_match(b1,b2);
for(r=minr;r<maxr;r++)
for(c=minc;c<maxc;c++){
p1=gpix((*b1),c,r);
p2=gpix((*b2),c-offx,r-offy);
if((p1==0)&&(p2==1)) /* p1 not set, p2 = set */
scratch[r-minr][c-minc]=1;
else
scratch[r-minr][c-minc]=0;
if((p1==1)&&(p2==0)) /* p1 set, p2 not set */
sc2[r-minr][c-minc]=1;
else
sc2[r-minr][c-minc]=0;
}
count=0;
for(r=minr;r<maxr;r++)
for(c=minc;c<maxc;c++)if(scratch[r-minr][c-minc])
for(i=-1;i<=1;i++)
for(j=-1;j<=1;j++)if((r+j>=minr) && (c+i>=minc) && (r+j<maxr) && (c+i<maxc) &&((i!=0)||(j!=0))&&scratch[r-minr+j][c-minc+i])
count++;
for(r=minr;r<maxr;r++)
for(c=minc;c<maxc;c++)if(sc2[r-minr][c-minc])
for(i=-1;i<=1;i++)
for(j=-1;j<=1;j++)if((r+j>=minr) && (c+i>=minc) && (r+j<maxr) && (c+i<maxc) &&((i!=0)||(j!=0))&&sc2[r-minr+j][c-minc+i])
count++;
totalbox=(maxc-minc)*(maxr-minr);
return 100*count/totalbox;
}
/* oc 8 must be in a clock wise order, with oc[0] a corner */
struct {int x,y;} oc[8]={{-1,-1},{0,-1},{1,-1},{1,0},{1,1},{0,1},{-1,1},{-1,0}};
static void xormatchscratch(marktype *b1, marktype *b2, int minr, int maxr, int minc, int maxc, int offx, int offy)
{
int r,c,rmm,roo,coo;
int p1,p2;
int w1=b1->w,h1=b1->h,w2=b2->w,h2=b2->h;
for(r=minr; r<maxr;r++){
rmm=r-minr; roo=r-offy;
p1=0;
for(c=minc;c<0;c++){
coo=c-offx;
scratch[rmm][c-minc]=sc2[rmm][c-minc]=0;
if((coo>=0)&&(roo>=0)&&(coo<w2)&&(roo<h2))p2=pbm_getpixel(b2->bitmap,coo,roo);
else p2=0; /* background */
scratch[rmm][c-minc]=p1!=p2;
}
for(c=0;c<maxc;c++){
coo=c-offx;
scratch[rmm][c-minc]=sc2[rmm][c-minc]=0;
if((r>=0)&&(c<w1)&&(r<h1))p1=pbm_getpixel(b1->bitmap,c,r);
else p1=0; /* background */
if((coo>=0)&&(roo>=0)&&(coo<w2)&&(roo<h2))p2=pbm_getpixel(b2->bitmap,coo,roo);
else p2=0; /* background */
scratch[rmm][c-minc]=p1!=p2;
}
}
}
int CSIS_match(marktype *b1, marktype *b2)
{
int r,c,i1;
int minr,minc;
int maxr,maxc;
int offx,offy,fepcount;
int totscratch=0;
offx=b1->xcen-b2->xcen;
offy=b1->ycen-b2->ycen;
minc=MIN(0,offx);
minr=MIN(0,offy);
maxc=MAX(b1->w,b2->w+offx);
maxr=MAX(b1->h,b2->h+offy);
if(((maxc-minc)>=S_SIZE)||((maxr-minr)>=S_SIZE))
return WXOR_match(b1,b2);
/* set the scratch array to 1 if there is an XOR match */
xormatchscratch(b1,b2,minr,maxr,minc,maxc,offx,offy);
/* We how have the XOR map. Scratch contains the number of neighbours,
1=1 neighbour set...etc */
/* CSIS rule 1, if FEP (four error pels) then exit */
fepcount=0;
for(r=minr;r<maxr-1;r++)
for(c=minc;c<maxc-1;c++)
if( (scratch[r-minr][c-minc])&& (scratch[r-minr+1][c-minc])&&
(scratch[r-minr][c-minc+1])&& (scratch[r-minr+1][c-minc+1])) {
fepcount++;
if(fepcount==1) {
/* fprintf(stderr,"position (%d %d)\n",c-minc,r-minr);*/
return 10001;
}
}
/* foreach set pixel, update scratch with the number of pels around in five dir's.
FPN (five-pel neighbour hood) */
for(r=minr;r<maxr;r++)
for(c=minc;c<maxc;c++) if(scratch[r-minr][c-minc]){
sc2[r-minr][c-minc]=1; /* itself */
for(i1=1;i1<8;i1+=3)
if(((r+oc[i1].y)>=minr)&&((c+oc[i1].x)>=minc)&&((r+oc[i1].y)<maxr)&&((c+oc[i1].x)<maxc))
if(scratch[r+oc[i1].y-minr][c+oc[i1].x-minc]) sc2[r-minr][c-minc]++;
}
/* now scratch has the value of the FPN - 1=single error, 5=4 neighbouring errors etc... */
/* set scratch and sc2 to be the same */
for(r=minr;r<maxr;r++)
for(c=minc;c<maxc;c++)
totscratch+=scratch[r-minr][c-minc]=sc2[r-minr][c-minc];
for(r=minr;r<maxr;r++)
for(c=minc;c<maxc;c++){
/* CSIS rule 2i: an error pel has 2 or more neighbours---this num is the same as PMS */
if(scratch[r-minr][c-minc]>=3)
if((r-minr>=1) && (c-minc>=1) && (r-minr<(maxr-1)) && (c-minc<(maxc-1))){
/**/ int i2,numsep=0;
/* find how many neighbours a set pixel has, only check the 4 edges-FPN */
for(i2=1;i2<8;i2+=2)
if(scratch[r+oc[i2].y-minr][c+oc[i2].x-minc]) { /* if a scratch pixel is set */
if((scratch[r+oc[(i2+2)%8].y-minr][c+oc[(i2+2)%8].x-minc]==0)&&
(scratch[r+oc[(i2+6)%8].y-minr][c+oc[(i2+6)%8].x-minc]==0)
) numsep++;
}
if((b1->w>=12)||(b2->w>=12)||(b1->h>=12)||(b2->h>=12)){
/* PMS rule 2ii: at least two of its neigh. error p's aren't connected */
if(numsep>=2){
int i,j,p,p2,same;
/* PMS rule 2(iii), look for regions in the original images of 3x3 the same */
if((c>=0)&&(r>=0)&&(c<b1->w)&&(r<b1->h)){
p=pbm_getpixel(b1->bitmap,c,r);
same=0;
for(i=-1;i<=1;i++)
for(j=-1;j<=1;j++){
if((c+i>=0)&&(r+j>=0)&&(c+i<b1->w)&&(r+j<b1->h))
p2=pbm_getpixel(b1->bitmap,c+i,r+j);
else
p2=0;
if(p2==p) same++;
} /* i,j loop */
/* PMS rule 2(iii) */
if(same==9) {return 10002;}
} /* (*b1) in range */
if((c-offx>=0) && (r-offy>=0) &&(c-offx<b2->w) && (r-offy<b2->h)){
p=pbm_getpixel(b2->bitmap,c-offx,r-offy);
same=0;
for(i=-1;i<=1;i++)
for(j=-1;j<=1;j++){
if((c+i-offx>=0)&&(r+j-offy>=0)&&(c+i-offx<b2->w)&&(r+j-offy<b2->h))
p2=pbm_getpixel(b2->bitmap,c+i-offx,r+j-offy);
else
p2=0;
if(p2==p) same++;
} /* i,j loop */
/* PMS rule 2(iii) */
if(same==9) {return 10003;}
}
}
}
else
{ /* do the CSIS rule */
/* CSIS rule 2ii: at least two of its neigh. error p's aren't connected */
if(numsep>=2){
int i,p,p2,same;
/* PMS rule 2(iii), look for regions in the original images of 3x3 the same */
if((c>=0)&&(r>=0)&&(c<b1->w)&&(r<b1->h)){
p=pbm_getpixel(b1->bitmap,c,r);
same=1;
for(i=1;i<8;i+=2)
if((c+oc[i].x>=0)&&(r+oc[i].y>=0)&&(c+oc[i].x<b1->w)&&(r+oc[i].y<b1->h))
p2=pbm_getpixel(b1->bitmap,c+oc[i].x,r+oc[i].y);
else
p2=0;
if(p2==p) same++;
/* CSIS rule 2(iii) */
if(same==5) {return 10002;}
}
if((c-offx>=0) && (r-offy>=0) &&(c-offx<b2->w) && (r-offy<b2->h)){
p=pbm_getpixel(b2->bitmap,c-offx,r-offy);
same=1;
for(i=1;i<8;i+=2)
if((c+oc[i].x-offx>=0)&&(r+oc[i].y-offy>=0)&&(c+oc[i].x-offx<b2->w)&&(r+oc[i].y-offy<b2->h))
p2=pbm_getpixel(b2->bitmap,c+oc[i].x-offx,r+oc[i].y-offy);
else
p2=0;
if(p2==p) same++;
/* CSIS rule 2(iii) */
if(same==5) {return 10003;}
}
}
}
}
}
return totscratch;
}
#include "context.h"
typedef struct {
int x,y;
} coord;
coord ctm[5]={{0,0},{-1,0},{0,1},{1,0},{0,-1}};
int
ctm_mask(marktype *m,int x, int y)
{
int mask=0;
int i,p;
int ti,tj;
assert(m);
/*-1 because of the last 'allin' attribute */
for(i=0;i<5;i++){
ti=x+ctm[i].x;
tj=y+ctm[i].y;
p=gpix((*m),ti,tj);
mask=2*mask | p;
}
return mask;
}
void
CTM_match1(marktype *b1, marktype *b2, float *bits, float *bpp)
{
static int r,c;
static int offx,offy;
static int p1,p2;
static int count;
static int tr,tc;
static int totalbox,totalbox2;
static int x1m,y1m,x2M,y2M;
int mask;
static contexttype ct;
static int first=1;
if(first){
context_init(&ct,5);
first=0;
} else {
context_clear(&ct);
}
offx=b1->xcen-b2->xcen;
offy=b1->ycen-b2->ycen;
x1m=offx;
y1m=offx;
x2M=b2->w+offx;
y2M=b2->h+offy;
x1m=MIN(x1m,0);
y1m=MIN(y1m,0);
x2M=MAX(x2M,b1->w);
y2M=MAX(y2M,b1->h);
globals.g_context_increment=4;
count=0;
for(r=y1m;r<y2M;r++)
for(c=x1m;c<x2M;c++){
mask=ctm_mask(b1,c,r);
tc=c-offx;
tr=r-offy;
p2=gpix((*b2),tc,tr);
context_update(&ct,mask,p2);
/*
p2=gpix((*b2),tc-1,tr);
context_update(&ct,mask,p2);
p2=gpix((*b2),tc,tr-1);
context_update(&ct,mask,p2);
*/
}
*bits=0;
for(r=y1m;r<y2M;r++)
for(c=x1m;c<x2M;c++){
mask=ctm_mask(b1,c,r);
tc=c-offx;
tr=r-offy;
p2=gpix((*b2),tc,tr);
*bits=*bits-LOG2(context_prob(&ct,mask,p2));
}
totalbox=(x2M-x1m)*(y2M-y1m);
*bpp=*bits/totalbox;
}
void
CTM_match_proper(marktype *b1, marktype *b2, float *bits, float *bpp)
{
float bits1,bpp1;
float bits2,bpp2;
CTM_match1(b1,b2,&bits1,&bpp1);
CTM_match1(b2,b1,&bits2,&bpp2);
if(bits1>bits2)
*bits=bits1;
else
*bits=bits2;
if(bpp1>bpp2)
*bpp=bpp1;
else
*bpp=bpp2;
}
int
CTM_match(marktype *b1, marktype *b2)
{
float ctm_bits,ctm_bpp;
int xor,wan,wxor,csis;
CTM_match_proper(b1,b2,&ctm_bits,&ctm_bpp);
wxor=WXOR_match(b1,b2);
xor=XOR_match(b1,b2);
wan=WAN_match(b1,b2);
/*csis=CSIS_match(b1,b2);*/
/* the following gives 66808 for A006 */
/*
if(ctm_bpp <= 0.656863){
if(ctm_bits <= 1027.96) return (int)(ctm_bits);
else return 10000;
} else {
if(ctm_bits <= 68.7502) return (int)(ctm_bits);
else return 10000;
}
*/
/* the following gives 68139 for A006 */
/*
if(ctm_bpp > 0.720843) return 10000;
else {
if(ctm_bits <= 352.922) return (int)(ctm_bits);
else {
if(ctm_bits > 1072.59) return 100;
else {
if(ctm_bpp <= 0.601148) return (int)(ctm_bits);
else return 10000;
}
}
}
*/
/* the following gives 65774 for A006 */
/*
if(ctm_bpp > 0.568514) return 10000;
else {
if(ctm_bits <= 929.215) return (int)(ctm_bits);
else return 10000;
}
*/
/* the following gives 65315/(65296 using ctm_bits) for A006 */
if(ctm_bpp > 0.598722) return 10000;
else {
if(ctm_bpp <= 0.440472) return (int)(ctm_bits);
else {
if(ctm_bits <= 325.267){
if(ctm_bpp <= 0.524121) return (int)(ctm_bits);
else {
if(ctm_bits > 146.298) return 10000;
else {
if(ctm_bpp <= 0.573467) return (int)(ctm_bits);
else return 10000 ;
}
}
} else {
if(ctm_bpp > 0.546217) return 10000;
else {
if(ctm_bits <= 568.337) return 10000;
else {
if(ctm_bits <= 757.753) return (int)(ctm_bits);
else return 10000;
}
}
}
}
}
/*hand classified labels */
/*
if(ctm_bpp > 0.683592) return 10000;
else {
if(ctm_bpp <= 0.543907){
if(ctm_bits > 81.8062) return (int)(ctm_bits);
else {
if(ctm_bpp <= 0.42415) return (int)(ctm_bits);
else return 10000;
}
} else {
if(ctm_bits > 250.39){
if(ctm_bits <= 660.765) return (int)(ctm_bits);
else return 10000;
} else {
if(ctm_bpp > 0.604062) return 10000;
else {
if(ctm_bits <= 181.421) return 10000;
else return (int)(ctm_bits);
}
}
}
}
*/
/** all **/
/*
if (wan <= 92 ){
if(wan <= 58){
if(xor > 11){
if(wan <= 49.5) return (int)(ctm_bits);
else if(wan > 49.5 ){
if(xor <= 13.5) return 10000;
else if(xor > 13.5) return (int)(ctm_bits) ;
}
} else if(xor <= 11){
if(wan > 29.5){
if(wan > 35.5) return 10000;
else {
if(xor <= 9.5) return 10000 ;
else return (int)(ctm_bits) ;
}
} else {
if(ctm_bpp <= 0.300983) return (int)(ctm_bits) ;
else {
if(xor > 8.5) return (int)(ctm_bits) ;
else {
if( wan <= 20.5) return (int)(ctm_bits);
else return 10000;
}
}
}
}
} else {
if(ctm_bpp > 0.695644) return 10000 ;
else {
if(xor <= 15) return 10000 ;
else {
if(wan <= 75 ){
if(xor > 19) return (int)(ctm_bits) ;
else {
if(xor <= 19){
if(ctm_bpp <= 0.588463) return (int)(ctm_bits) ;
else return 10000;
}
}
} else {
if(xor <= 20 ){
if(xor <= 18) return 10000 ;
else {
if(wan > 84) return 10000 ;
else {
if(ctm_bits <= 422.966) return 10000 ;
else return (int)(ctm_bits) ;
}
}
} else {
if(xor > 23) return (int)(ctm_bits) ;
else {
if(wan <= 82) return (int)(ctm_bits) ;
else {
if(ctm_bits <= 298.337) return 10000;
else return (int)(ctm_bits) ;
}
}
}
}
}
}
}
} else {
if(ctm_bpp > 0.746178) return 10000 ;
else {
if(wan > 123){
if(ctm_bits > 158.702) return 10000 ;
else {
if(xor <= 30) return 10000;
else {
if(wan <= 157) return (int)(ctm_bits);
else return 10000;
}
}
} else {
if(xor <= 23) return 10000 ;
else {
if(wan > 107) return 10000 ;
else {
if(ctm_bpp <= 0.617752) return (int)(ctm_bits) ;
else {
if(wxor <= 91) return 10000 ;
else {
if(wan > 103) return 10000;
else {
if(ctm_bits <= 314.157) return 10000;
else return (int)(ctm_bits) ;
}
}
}
}
}
}
}
}
*/
abort();
return -1;
}
int
ALL_match(marktype *b1, marktype *b2)
{
float ctm_bits,ctm_bpp;
int xor,wan,wxor,csis;
CTM_match_proper(b1,b2,&ctm_bits,&ctm_bpp);
wxor=WXOR_match(b1,b2);
xor=XOR_match(b1,b2);
wan=WAN_match(b1,b2);
/*csis=CSIS_match(b1,b2);*/
/** all **/
if (wan <= 92 ){
if(wan <= 58){
if(xor > 11){
if(wan <= 49.5) return (int)(ctm_bits);
else if(wan > 49.5 ){
if(xor <= 13.5) return 10000;
else if(xor > 13.5) return (int)(ctm_bits) ;
}
} else if(xor <= 11){
if(wan > 29.5){
if(wan > 35.5) return 10000;
else {
if(xor <= 9.5) return 10000 ;
else return (int)(ctm_bits) ;
}
} else {
if(ctm_bpp <= 0.300983) return (int)(ctm_bits) ;
else {
if(xor > 8.5) return (int)(ctm_bits) ;
else {
if( wan <= 20.5) return (int)(ctm_bits);
else return 10000;
}
}
}
}
} else {
if(ctm_bpp > 0.695644) return 10000 ;
else {
if(xor <= 15) return 10000 ;
else {
if(wan <= 75 ){
if(xor > 19) return (int)(ctm_bits) ;
else {
if(xor <= 19){
if(ctm_bpp <= 0.588463) return (int)(ctm_bits) ;
else return 10000;
}
}
} else {
if(xor <= 20 ){
if(xor <= 18) return 10000 ;
else {
if(wan > 84) return 10000 ;
else {
if(ctm_bits <= 422.966) return 10000 ;
else return (int)(ctm_bits) ;
}
}
} else {
if(xor > 23) return (int)(ctm_bits) ;
else {
if(wan <= 82) return (int)(ctm_bits) ;
else {
if(ctm_bits <= 298.337) return 10000;
else return (int)(ctm_bits) ;
}
}
}
}
}
}
}
} else {
if(ctm_bpp > 0.746178) return 10000 ;
else {
if(wan > 123){
if(ctm_bits > 158.702) return 10000 ;
else {
if(xor <= 30) return 10000;
else {
if(wan <= 157) return (int)(ctm_bits);
else return 10000;
}
}
} else {
if(xor <= 23) return 10000 ;
else {
if(wan > 107) return 10000 ;
else {
if(ctm_bpp <= 0.617752) return (int)(ctm_bits) ;
else {
if(wxor <= 91) return 10000 ;
else {
if(wan > 103) return 10000;
else {
if(ctm_bits <= 314.157) return 10000;
else return (int)(ctm_bits) ;
}
}
}
}
}
}
}
}
abort();
return -1;
}
|
Added work/contrib/tic/tic98/template_match.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#ifndef __MATCH_H
#define __MATCH_H
#include <math.h>
#include "marklist.h"
#define NOT_SCREENED(b1,b2) ((abs((b1).w-(b2).w)<=2) && (abs((b1).h-(b2).h)<=2))
int XOR_match(marktype *b1, marktype *b2);
int WXOR_match(marktype *b1, marktype *b2);
int WAN_match(marktype *b1, marktype *b2);
int PMS_match(marktype b1, marktype b2);
int CSIS_match(marktype *b1, marktype *b2);
int CTM_match(marktype *b1, marktype *b2);
int ALL_match(marktype *b1, marktype *b2);
void CTM_match_proper(marktype *b1, marktype *b2, float *bits, float *bpp);
/*void CTM_match(marktype *b1, marktype *b2, float *bits, float *bpp);
int CTM_match_c5(marktype *b1, marktype *b2);*/
#endif
|
Added work/contrib/tic/tic98/tic98.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
|
/*
* Module: tic98
*
*
* This module implements lossless textual image compression, using
* adaptive library encoding and averaging.
*
* These routines take a marklist, and encoding the marks using an
* adaptive Mohiuddin/SPM style coding. I have extended the model to
* handle equivalence classes and example lists, with optional pruning.
*
* The codebook is initialized in tic98_init, with the maximum number
* of classes set to DEFAULT_MAX_CLASSES, and the maximum number of
* examples in each class set to DEFAULT_MAX_EXAMPLES. Typical values
* of these two parameters would be UNLIMITED(-1) and 10. The classes
* are pruning in a LRU ordering, while the examples are pruned in
* FIFO order.
*
* Integers are coding using the b_gamma() routines which form a
* three-stage binary tree. The path from the root to the leaves forms
* a gamma encoding.
*
* Marks that are matched are coding clairvoyantly with respect to the
* average mark in the class.
*
* The offsets are calculated using the Witten, Inglis, et. al, method
* from Proc. IEEE in 1994. This needs to be brought up to date. (An
* offset is in fact coding twice, the sequence 2,0,2,0 is coded
* 2,-2,2,-2 while knowing the values should be around two requires
* less coding... 0,-2,0,-2)
*
*
* Author:
* Stuart Inglis (singlis@internz.co.nz)
* (c) 1998
*
*/
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <assert.h>
#include "globals.h"
#include "tic98.h"
#include "arithcode.h"
#include "marklist.h"
#include "line.h"
#include "codebook.h"
#include "context.h"
#include "b_gamma.h"
#ifndef Q_CODER
#include "ppmd_model.h"
#endif
#include "sort_lines.h"
void
tic98_init(tic98type *t)
{
t->misc=INTCODE_INIT();
t->cx=INTCODE_INIT();
t->cy=INTCODE_INIT();
t->z_w=INTCODE_INIT();
t->z_h=INTCODE_INIT();
t->z_rw=INTCODE_INIT();
t->z_rh=INTCODE_INIT();
t->p_cl=INTCODE_INIT();
t->xpos=INTCODE_INIT();
t->ypos=INTCODE_INIT();
codebook_init(&(t->c),
globals.g_max_classes,
globals.g_max_examples);
context_init(&(t->global),JBIG_SIZE);
context_init(&(t->clairall),JBIG_CLAIR_SIZE);
}
void
tic98_free(tic98type *t)
{
assert(t);
INTCODE_FREE(t->misc);
INTCODE_FREE(t->cx);
INTCODE_FREE(t->cy);
INTCODE_FREE(t->z_w);
INTCODE_FREE(t->z_h);
INTCODE_FREE(t->z_rw);
INTCODE_FREE(t->z_rh);
INTCODE_FREE(t->p_cl);
INTCODE_FREE(t->xpos);
INTCODE_FREE(t->ypos);
codebook_free(&(t->c));
context_free(&(t->global));
context_free(&(t->clairall));
}
void
tic98_num_encode(tic98type *t, int num)
{
INTCODE_ENCODE(t->misc,num);
}
int
tic98_num_decode(tic98type *t)
{
return INTCODE_DECODE(t->misc);
}
void
tic98_start_encoding(void)
{
START_ENC();
}
void
tic98_finish_encoding(void)
{
FINISH_ENC();
}
void
tic98_start_decoding(void)
{
START_DEC();
}
void
tic98_finish_decoding(void)
{
FINISH_DEC();
}
void
tic98_status(tic98type *t, FILE *fp)
{
int tot,i,min,max,n,sing;
if(fp==NULL)
return;
n=t->c.num_eqv;
if(n)
min=max=t->c.eqv[0].num;
else
min=max=0;
for(tot=0,i=0; i<t->c.num_eqv ;i++){
tot+=t->c.eqv[i].num;
if(t->c.eqv[i].num>max) max=t->c.eqv[i].num;
if(t->c.eqv[i].num<min) min=t->c.eqv[i].num;
}
for(sing=0,i=0; i<t->c.num_eqv ;i++){
if(t->c.eqv[i].num==1)
sing++;
}
fprintf(fp,
"Compiled_date: "__DATE__"\n"
"bits: %ld\n"
"bytes: %ld\n"
"Context_arity: %d\n"
"JBIG_size: %d\n"
"JBIG_clair_1: %d\n"
"JBIG_clair_2: %d\n"
"Update_probs: %s\n"
"Match_mode: %s\n"
"Phi: %d\n"
"Use_PPM: %s\n"
"Align_using_centres: %s\n"
"Template_method: %s\n"
"Template_thres: %d\n"
"Marks_in_codebook: %d\n"
"Num_marks: %d\n"
"Num_matched: %d\n"
"Percent_matched: %.1f\n"
"Singletons: %d\n"
"Percent_singletons: %.1f %%\n"
"Num_classes: %d\n"
"Min_marks_in_class: %d\n"
"Avg_marks_in_class: %.1f\n"
"Max_marks_in_class: %d\n",
CountOfBitsOut,
(long)(ceil(CountOfBitsOut/8.0)),
CONTEXT_BITS,
JBIG_SIZE,
JBIG_CLAIR_1,
JBIG_CLAIR_2,
globals.g_update_probs_after_encoding?"True":"False",
(globals.g_match_mode==MATCH_B_AVG)?"B_AVG":
((globals.g_match_mode==MATCH_F_AVG)?"F_AVG":
((globals.g_match_mode==MATCH_B_SINGLE)?"B_SINGLE":
((globals.g_match_mode==MATCH_F_SINGLE)?"F_SINGLE":
((globals.g_match_mode==MATCH_HYBRID)?"HYBRID":"!!ERROR!!")))),
SCALE,
globals.g_use_ppm?"True":"False",
globals.g_align_using_centres?"True":"False",
TEMP_FUNC_STRING,
globals.g_match_threshold,
tot,
globals.g_marks_on_page,
globals.g_num_matched,
globals.g_num_matched*100.0/globals.g_marks_on_page,
sing,
sing*100.0/t->c.num_eqv,
t->c.num_eqv,
min,(n==0)?0:tot*1.0/n,max
);
fprintf(fp,"Reading_order: ");
switch (globals.g_reading_order){
case EXTRACTION_ORDER: fprintf(fp,"Extraction");break;
case EXTRACTION_PROFILE: fprintf(fp,"Profile");break;
case EXTRACTION_RANDOM: fprintf(fp,"Random");break;
case EXTRACTION_HOWARD: fprintf(fp,"Howard");break;
case EXTRACTION_ZHANG: fprintf(fp,"Zhang");break;
case EXTRACTION_DOCSTRUM: fprintf(fp,"Docstrum");break;
default:
fprintf(fp,"!!ERROR!!\n");
}
fprintf(fp," %g\n",globals.g_reading_parameter);
fflush(fp);
}
static int CmpInt(const void *e1, const void *e2)
{
return ( (((int*)e1)) - (((int*)e2)) );
}
void
tic98_compress_marks(tic98type *t, marklistptr list, int _width, int _height)
{
marklistptr step=NULL;
int rh,rw;
int i;
int len,index;
int lastx=0,lasty=0,xoff=0,yoff=0;
int carryx=0,carryy=0;
marktype image;
int currentypos=0;
float lineskew=0;
int numpixels=0;
assert(t);
if((globals.g_match_mode==MATCH_B_AVG) ||
(globals.g_match_mode==MATCH_F_AVG)){
SCALE=1;
}
len=marklist_length(list);
globals.g_marks_on_page=len;
i=0;
for(i=0,step=list;step;i++,step=step->next){
if(step->data.start_of_line==START_PRUNED)
break;
}
INTCODE_ENCODE (t->z_w,i);
INTCODE_ENCODE (t->z_w,_width);
INTCODE_ENCODE (t->z_w,_height);
/* +1 because we add one later on */
#ifndef Q_CODER
if(globals.g_use_ppm){
init_ppmd_globals();
ppm_start_encoding (2, len+2);
}
#endif
i=0;
for(step=list;step;step=step->next){
if(step->data.start_of_line==START_PRUNED)
break;
/*if((i%50)==0){
fprintf(stderr,"%d/%d %d (%d %d) \r",i,len-1,step->data.grp,step->data.xpos,step->data.ypos+step->data.h-1);
}
*/
if(step->data.start_of_line==SPACE){
abort();
index=len-2;
} else {
codebook_updatetime(&(t->c));
if((globals.g_match_mode==MATCH_B_SINGLE) ||
(globals.g_match_mode==MATCH_F_SINGLE) ||
(globals.g_match_mode==MATCH_HYBRID)){
index=codebook_match_against_average2(&(t->c),&(step->data));
} else {
index=codebook_match_against_average(&(t->c),&(step->data));
assert(index<t->c.num_eqv);
}
}
if(step->data.start_of_line==START_OF_LINE){
currentypos=step->data.ypos_of_line;
lineskew=step->data.skew_of_line;
}
#ifndef Q_CODER
if(globals.g_use_ppm){
ppm_encode_symbol(index+1);
} else {
#endif
INTCODE_ENCODE (t->p_cl,index);
#ifndef Q_CODER
}
#endif
if(globals.g_dump_indices){
if(index==-1){
if(globals.g_dump_indices==1)
fprintf(stderr,"%d\n",index+1);
else
fprintf(stderr,"%d\n",t->c.num_eqv+1);
} else {
fprintf(stderr,"%d\n",index+1);
}
}
if(step->data.start_of_line==SPACE){
lastx+=10;
continue;
}
xoff=step->data.xpos -lastx;
/* it's - because origin at top left */
/* lasty = lasty - ROUND(sin(globals.g_skew)*xoff);*/
yoff=(step->data.ypos+step->data.h-1) -lasty;
lastx=step->data.xpos+step->data.w;
lasty=step->data.ypos+step->data.h-1;
INTCODE_ENCODE (t->xpos,xoff);
INTCODE_ENCODE (t->ypos,yoff);
if(index>=0){
marktype *avg;
int carryx1,carryy1;
if((globals.g_match_mode==MATCH_B_SINGLE)||
(globals.g_match_mode==MATCH_F_SINGLE)||
(globals.g_match_mode==MATCH_HYBRID)){
avg=codebook_get_avg_mark2(&(t->c),index, UPDATETIME);
} else {
avg=codebook_get_avg_mark(&(t->c),index, UPDATETIME);
}
globals.g_num_matched++;
rw=step->data.w - avg->w;
rh=step->data.h - avg->h;
INTCODE_ENCODE (t->z_rw,rw);
INTCODE_ENCODE (t->z_rh,rh);
if(globals.g_align_using_centres){
carryx=step->data.w/2 - avg->w/2;
carryy=step->data.h/2 - avg->h/2;
} else {
carryx=step->data.xcen - avg->xcen;
carryy=step->data.ycen - avg->ycen;
INTCODE_ENCODE (t->cx,carryx);
INTCODE_ENCODE (t->cy,carryy);
}
if(globals.g_match_mode==MATCH_HYBRID){
int q;
for(q=0;q<t->c.eqv[index/SCALE].num;q++){
compress_mark_clair(&(t->clairall),
&(t->c.eqv[index/SCALE].set[q]), avg,
(t->c.eqv[index/SCALE].set[q].xcen)-avg->xcen,
(t->c.eqv[index/SCALE].set[q].ycen)-avg->ycen,
UPDATE);
}
}
compress_mark_clair(&(t->clairall),&(step->data),avg,
carryx,carryy,
COMPRESS);
if((globals.g_match_mode==MATCH_B_SINGLE) ||
(globals.g_match_mode==MATCH_F_SINGLE) ||
(globals.g_match_mode==MATCH_HYBRID)){
codebook_add_mark2(&(t->c),index,&(step->data));
} else {
codebook_add_mark(&(t->c),index,&(step->data));
}
if(globals.g_update_probs_after_encoding){
compress_mark(&(t->global),&(step->data),UPDATE);
}
} else {
INTCODE_ENCODE (t->z_w,step->data.w);
INTCODE_ENCODE (t->z_h,step->data.h);
compress_mark(&(t->global),&(step->data), COMPRESS);
if((globals.g_match_mode==MATCH_B_SINGLE) ||
(globals.g_match_mode==MATCH_F_SINGLE) ||
(globals.g_match_mode==MATCH_HYBRID)){
index=codebook_add_equiv2(&(t->c));
codebook_add_mark2(&(t->c),index,&(step->data));
} else {
index=codebook_add_equiv(&(t->c));
codebook_add_mark(&(t->c),index,&(step->data));
}
}
i++;
}
#ifndef Q_CODER
if(globals.g_use_ppm){
ppm_finish_encoding ();
}
#endif
{
marklistptr step2=step;
numpixels=0;
for(;step2;step2=step2->next){
numpixels+=step2->data.set;
}
}
INTCODE_ENCODE (t->z_w,numpixels);
{
int li=0,lj=0;
for(;step;step=step->next){
int i,j;
if(globals.g_dump_indices)
fprintf(stderr,"%d\n",t->c.num_eqv+1);
for(j=0;j<step->data.h;j++)
for(i=0;i<step->data.w;i++){
if(gpix(step->data,i,j)){
INTCODE_ENCODE (t->xpos,step->data.xpos+i -li);
INTCODE_ENCODE (t->ypos,step->data.ypos+j -lj);
/* fprintf(stderr,"%d %d p\n",step->data.xpos+i,step->data.ypos+j);*/
li=step->data.xpos+i;
lj=step->data.ypos+j;
}
}
}
}
if(globals.g_codebook_filename){
codebook_dump_pbm(&t->c, globals.g_codebook_filename);
}
}
marklistptr tic98_decompress_marks(tic98type *t, int *_w, int *_h)
{
int w,h;
marktype mark;
marklistptr list=NULL,step=NULL;
int rh,rw;
int i;
int len,index;
int lastx=0,lasty=0,xoff=0,yoff=0;
int carryx=0,carryy=0;
marktype image;
unsigned int eof_sym;
int numpixels;
len=INTCODE_DECODE(t->z_w);
*_w=image.w=INTCODE_DECODE(t->z_w);
*_h=image.h=INTCODE_DECODE(t->z_w);
if((globals.g_match_mode==MATCH_B_AVG) ||
(globals.g_match_mode==MATCH_F_AVG) ||
(globals.g_match_mode==MATCH_HYBRID)){
SCALE=1;
}
#ifndef Q_CODER
if(globals.g_use_ppm){
init_ppmd_globals();
eof_sym = ppm_start_decoding (2, len+2);
}
#endif
for(i=0;i<len;i++){
marktype *avg;
codebook_updatetime(&(t->c));
#ifndef Q_CODER
if(globals.g_use_ppm){
index=(int)ppm_decode_symbol() - 1;
} else {
#endif
index=INTCODE_DECODE(t->p_cl);
#ifndef Q_CODER
}
#endif
xoff=INTCODE_DECODE(t->xpos);
yoff=INTCODE_DECODE(t->ypos);
lastx+=xoff;
/* lasty = lasty - ROUND(sin(globals.g_skew)*xoff);*/
lasty+=yoff;
avg=NULL;
if(index>=0){
if((globals.g_match_mode==MATCH_F_SINGLE) ||
(globals.g_match_mode==MATCH_B_SINGLE)){
avg=codebook_get_avg_mark2(&(t->c),index, UPDATETIME);
} else {
avg=codebook_get_avg_mark(&(t->c),index, UPDATETIME);
}
rw=INTCODE_DECODE (t->z_rw);
rh=INTCODE_DECODE (t->z_rh);
rw+=avg->w;
rh+=avg->h;
if(globals.g_align_using_centres){
carryx=rw/2 - avg->w/2;
carryy=rh/2 - avg->h/2;
} else {
carryx=INTCODE_DECODE(t->cx);
carryy=INTCODE_DECODE(t->cy);
}
if(globals.g_match_mode==MATCH_HYBRID){
int q;
marktype *avg_actual=codebook_get_avg_mark(&(t->c),index/SCALE, UPDATETIME);
for(q=0;q<t->c.eqv[index/SCALE].num;q++){
compress_mark_clair(&(t->clairall),
&(t->c.eqv[index/SCALE].set[q]),avg_actual,
(t->c.eqv[index/SCALE].set[q].xcen)-avg_actual->xcen,
(t->c.eqv[index/SCALE].set[q].ycen)-avg_actual->ycen,
UPDATE);
}
}
decompress_mark_clair(&(t->clairall),&mark,avg,
rw,rh,
carryx,carryy);
marktype_calc_centroid(&mark);
if((globals.g_match_mode==MATCH_F_SINGLE) ||
(globals.g_match_mode==MATCH_B_SINGLE)){
codebook_add_mark2(&(t->c),index,&mark);
} else {
codebook_add_mark(&(t->c),index,&mark);
}
if(globals.g_update_probs_after_encoding){
compress_mark(&(t->global),&mark,UPDATE);
}
} else {
w=INTCODE_DECODE (t->z_w);
h=INTCODE_DECODE (t->z_h);
decompress_mark(&(t->global),&mark,w,h);
marktype_calc_centroid(&mark);
if((globals.g_match_mode==MATCH_F_SINGLE) ||
(globals.g_match_mode==MATCH_B_SINGLE)){
index=codebook_add_equiv2(&(t->c));
codebook_add_mark2(&(t->c),index,&mark);
} else {
index=codebook_add_equiv(&(t->c));
codebook_add_mark(&(t->c),index,&mark);
}
}
mark.imagew=image.w;
mark.imageh=image.h;
mark.xpos=lastx;
mark.ypos=lasty-(mark.h-1);
if(list==NULL) step=marklist_add(&list,mark);
else step=marklist_add(&step,mark);
/*marktype_writeascii(stderr,mark);*/
lastx+=mark.w;
}
#ifndef Q_CODER
if(globals.g_use_ppm){
ppm_finish_decoding();
}
#endif
numpixels=INTCODE_DECODE(t->z_w);
{
marktype pixel;
int li=0,lj=0;
marktype_alloc(&pixel,1,1);
ppix(pixel,0,0,1);
pixel.imagew=image.w;
pixel.imageh=image.h;
for(i=0;i<numpixels;i++){
li=(pixel.xpos=INTCODE_DECODE(t->xpos)+li);
lj=(pixel.ypos=INTCODE_DECODE(t->ypos)+lj);
if(list==NULL) step=marklist_addcopy(&list,pixel);
else step=marklist_addcopy(&step,pixel);
}
}
return list;
}
|
Added work/contrib/tic/tic98/tic98.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
#ifndef _TIC98_H
#define _TIC98_H
#include "marklist.h"
#include "codebook.h"
#include "context.h"
#include "b_gamma.h"
#define NEW_PAGE 0
#define END_OF_DOCUMENT 1
#define INTCODETYPE b_gammaptr
#define INTCODE_INIT() b_gamma_init()
#define INTCODE_FREE(p) b_gamma_free(p)
#define INTCODE_ENCODE(p,q) b_gamma_encode(p,q)
#define INTCODE_DECODE(p) b_gamma_decode(p)
#define INTCODE_ENCODE_LL(p,q) b_gamma_encode_ll(p,q)
#define INTCODE_DECODE_LL(p) b_gamma_decode_ll(p)
#define START_ENC() InitArithEncoding()
#define FINISH_ENC() CloseDownArithEncoding()
#define START_DEC() InitArithDecoding()
#define FINISH_DEC() {}
typedef struct {
INTCODETYPE misc,z_w,z_h,z_rw,z_rh,p_cl,xpos,ypos,cx,cy;
codebook c;
contexttype global,clairall;
} tic98type;
void tic98_compress_marks(tic98type *t, marklistptr list, int w, int h);
marklistptr tic98_decompress_marks(tic98type *t, int *w, int *h);
void tic98_init(tic98type *t);
void tic98_free(tic98type *t);
void tic98_start_encoding(void);
void tic98_finish_encoding(void);
void tic98_start_decoding(void);
void tic98_finish_decoding(void);
void tic98_status(tic98type *t, FILE *fp);
void tic98_num_encode(tic98type *t, int num);
int tic98_num_decode(tic98type *t);
#endif
|
Added work/contrib/tic/tic98/tic98l.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
|
/*
* Module: tic98
*
*
* This module implements lossless textual image compression, using
* adaptive library encoding and averaging.
*
* These routines take a marklist, and encoding the marks using an
* adaptive Mohiuddin/SPM style coding. I have extended the model to
* handle equivalence classes and example lists, with optional pruning.
*
* The codebook is initialized in tic98_init, with the maximum number
* of classes set to DEFAULT_MAX_CLASSES, and the maximum number of
* examples in each class set to DEFAULT_MAX_EXAMPLES. Typical values
* of these two parameters would be UNLIMITED(-1) and 10. The classes
* are pruning in a LRU ordering, while the examples are pruned in
* FIFO order.
*
* Integers are coding using the b_gamma() routines which form a
* three-stage binary tree. The path from the root to the leaves forms
* a gamma encoding.
*
* Marks that are matched are coding clairvoyantly with respect to the
* average mark in the class.
*
* The offsets are calculated using the Witten, Inglis, et. al, method
* from Proc. IEEE in 1994. This needs to be brought up to date. (An
* offset is in fact coding twice, the sequence 2,0,2,0 is coded
* 2,-2,2,-2 while knowing the values should be around two requires
* less coding... 0,-2,0,-2)
*
*
* Author:
* Stuart Inglis (singlis@internz.co.nz)
* (c) 1998
*
*/
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <assert.h>
#include "globals.h"
#include "tic98.h"
#include "arithcode.h"
#include "marklist.h"
#include "line.h"
#include "codebook.h"
#include "context.h"
#include "b_gamma.h"
#include "ppmd_model.h"
void
tic98_init(tic98type *t)
{
t->misc=INTCODE_INIT();
t->cx=INTCODE_INIT();
t->cy=INTCODE_INIT();
t->z_w=INTCODE_INIT();
t->z_h=INTCODE_INIT();
t->z_rw=INTCODE_INIT();
t->z_rh=INTCODE_INIT();
t->p_cl=INTCODE_INIT();
t->xpos=INTCODE_INIT();
t->ypos=INTCODE_INIT();
codebook_init(&(t->c),
globals.g_max_classes,
globals.g_max_examples);
context_init(&(t->global),JBIG_SIZE);
context_init(&(t->clairall),JBIG_CLAIR_SIZE);
}
void
tic98_free(tic98type *t)
{
assert(t);
INTCODE_FREE(t->misc);
INTCODE_FREE(t->cx);
INTCODE_FREE(t->cy);
INTCODE_FREE(t->z_w);
INTCODE_FREE(t->z_h);
INTCODE_FREE(t->z_rw);
INTCODE_FREE(t->z_rh);
INTCODE_FREE(t->p_cl);
INTCODE_FREE(t->xpos);
INTCODE_FREE(t->ypos);
codebook_free(&(t->c));
context_free(&(t->global));
context_free(&(t->clairall));
}
void
tic98_num_encode(tic98type *t, int num)
{
INTCODE_ENCODE(t->misc,num);
}
int
tic98_num_decode(tic98type *t)
{
return INTCODE_DECODE(t->misc);
}
void
tic98_start_encoding(void)
{
START_ENC();
}
void
tic98_finish_encoding(void)
{
FINISH_ENC();
}
void
tic98_start_decoding(void)
{
START_DEC();
}
void
tic98_finish_decoding(void)
{
FINISH_DEC();
}
void
tic98_status(tic98type *t, FILE *fp)
{
int tot,i,min,max,n;
if(fp==NULL)
return;
tot=0;
n=t->c.num_eqv;
if(n)
min=max=t->c.eqv[0].num;
else
min=max=0;
for(tot=0,i=0; i<t->c.num_eqv ;i++){
tot+=t->c.eqv[i].num;
if(t->c.eqv[i].num>max) max=t->c.eqv[i].num;
if(t->c.eqv[i].num<min) min=t->c.eqv[i].num;
}
fprintf(fp,
"bits: %ld\n"
"bytes: %ld\n"
"Num_marks: %d\n"
"Num_matched: %d\n"
"Percentage_matched: %.1f\n"
"Singletons: %d\n"
"Percentage_singletons: %.1f\n"
"Min_marks_in_class: %d\n"
"Avg_marks_in_class: %.1f\n"
"Max_marks_in_class: %d\n",
CountOfBitsOut,
(long)(ceil(CountOfBitsOut/8.0)),
tot,
globals.g_num_matched,
globals.g_num_matched*100.0/tot,
tot-globals.g_num_matched,
(tot-globals.g_num_matched)*100.0/tot,
min,(n==0)?0:tot*1.0/n,max
);
fprintf(fp,"Reading_order: ");
switch (globals.g_reading_order){
case EXTRACTION_ORDER: fprintf(fp,"Extraction");break;
case EXTRACTION_PROFILE: fprintf(fp,"Profile");break;
case EXTRACTION_RANDOM: fprintf(fp,"Random");break;
case EXTRACTION_HOWARD: fprintf(fp,"Howard");break;
case EXTRACTION_ZHANG: fprintf(fp,"Zhang");break;
case EXTRACTION_DOCSTRUM: fprintf(fp,"Docstrum");break;
default:
fprintf(stderr,"reading order not defined\n");
abort();
}
fprintf(fp," %g\n",globals.g_reading_parameter);
fprintf(fp,"Num_classes: %d\n",t->c.num_eqv);
fflush(fp);
}
void
tic98_compress_marks(tic98type *t, marklistptr list, int _w, int _h)
{
marklistptr step=NULL;
int rh,rw;
int i;
int len,index;
int lastx=0,lasty=0,xoff=0,yoff=0;
int carryx=0,carryy=0;
int currentypos=0, predicty;
float lineskew=0;
marklistptr recon=NULL;
marktype temp;
assert(t);
len=marklist_length(list);
INTCODE_ENCODE (t->z_w,len);
INTCODE_ENCODE (t->z_w,_w);
INTCODE_ENCODE (t->z_w,_h);
/* +1 because we add one later on */
/*
init_ppmd_globals();
ppm_start_encoding (3, 2*len);*/
i=0;
for(step=list;step;step=step->next){
/* fprintf(stderr,"%d/%d %d (%d %d)\n",i,len-1,step->data.grp,step->data.xpos,step->data.ypos+step->data.h-1);*/
/* marktype_writeascii(stderr,step->data);*/
codebook_updatetime(&(t->c));
index=codebook_match_against_average(&(t->c),&(step->data));
assert(index<t->c.num_eqv);
if(step->data.start_of_line==START_OF_LINE){
currentypos=step->data.ypos_of_line;
lineskew=step->data.skew_of_line;
}
INTCODE_ENCODE (t->p_cl,index);
/* ppm_encode_symbol(index+1); */
if(index>=0){
marktype *avg;
int dx,dy;
avg=codebook_get_avg_mark(&(t->c),index, UPDATETIME);
marktype_calc_centroid(avg);
dx=step->data.xcen - avg->xcen;
dy=step->data.ycen - avg->ycen;
INTCODE_ENCODE (t->xpos,dx+step->data.xpos - lastx);
INTCODE_ENCODE (t->ypos,dy+step->data.ypos - lasty);
globals.g_num_matched++;
lastx=dx + step->data.xpos;
lasty=dy + step->data.ypos;
/**/
temp=*avg;
temp.xpos=lastx;
temp.ypos=lasty;
marklist_addcopy(&recon,temp);
} else {
INTCODE_ENCODE (t->z_w,step->data.w);
INTCODE_ENCODE (t->z_h,step->data.h);
INTCODE_ENCODE (t->xpos,step->data.xpos - lastx);
INTCODE_ENCODE (t->ypos,step->data.ypos - lasty);
compress_mark(&(t->global),&(step->data), COMPRESS);
index=codebook_add_equiv(&(t->c));
codebook_add_mark(&(t->c),index,&(step->data));
lastx=step->data.xpos;
lasty=step->data.ypos;
/**/
temp=step->data;
temp.xpos=lastx;
temp.ypos=lasty;
marklist_addcopy(&recon,temp);
}
i++;
}
{
marktype im_r,im;
int i,j;
marklist_reconstruct(recon,&im_r);
marktype_writenamed("recon.pbm",im_r);
marklist_reconstruct(list,&im);
marktype_writenamed("image.pbm",im);
{
int num=0;
int li=0,lj=0;
int p1,p2;
for(j=0;j<im.h;j++){
for(i=0;i<im.w;i++){
p1=gpix(im,i,j);
p2=gpix(im_r,i,j);
if(p1!=p2)
num++;
}
}
/* fprintf(stderr,"%d\n",num);*/
for(j=0;j<im.h;j++){
for(i=0;i<im.w;i++){
p1=gpix(im,i,j);
p2=gpix(im_r,i,j);
if(p1!=p2){
/*INTCODE_ENCODE (t->xpos,i -li);
INTCODE_ENCODE (t->ypos,j -lj);*/
/*fprintf(stderr,"%d %d p\n",i,j);*/
li=i;
lj=j;
}
}
}
}
marktype_free(&im_r);
marktype_free(&im);
}
}
marklistptr tic98_decompress_marks(tic98type *t, int *_w, int *_h)
{
int w,h;
marktype mark;
marklistptr list=NULL,step=NULL;
int rh,rw;
int i;
int len,index;
int lastx=0,lasty=0,xoff=0,yoff=0;
int carryx=0,carryy=0;
marktype image;
unsigned int eof_sym;
len=INTCODE_DECODE(t->z_w);
*_w=image.w=INTCODE_DECODE(t->z_w);
*_h=image.h=INTCODE_DECODE(t->z_w);
/* init_ppmd_globals();
eof_sym = ppm_start_decoding (3, 2*len);*/
for(i=0;i<len;i++){
codebook_updatetime(&(t->c));
index=INTCODE_DECODE(t->p_cl);
if(index>=0){
marktype *avg;
avg=codebook_get_avg_mark(&(t->c),index, UPDATETIME);
xoff=INTCODE_DECODE(t->xpos);
yoff=INTCODE_DECODE(t->ypos);
mark=marktype_copy(*avg);
mark.xpos=lastx+xoff;
mark.ypos=lasty+yoff;
} else {
w=INTCODE_DECODE (t->z_w);
h=INTCODE_DECODE (t->z_h);
xoff=INTCODE_DECODE(t->xpos);
yoff=INTCODE_DECODE(t->ypos);
decompress_mark(&(t->global),&mark,w,h);
mark.xpos=lastx+xoff;
mark.ypos=lasty+yoff;
index=codebook_add_equiv(&(t->c));
marktype_calc_centroid(&mark);
codebook_add_mark(&(t->c),index,&mark);
}
mark.imagew=image.w;
mark.imageh=image.h;
if(list==NULL) step=marklist_add(&list,mark);
else step=marklist_add(&step,mark);
/* marktype_writeascii(stderr,mark);*/
lastx=step->data.xpos;
lasty=step->data.ypos;
}
/* ppm_finish_decoding();*/
return list;
}
|
Added work/contrib/tic/tic98/timer.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
|
/*
timer.c module, written by Stuart Inglis
This has MAX_TIMERS-2 timers, as timer 0 contains the timing
stats for the entire program, and cannot be either started nor
stopped. Note that the real time for timer 0 will not be accuate
unless TimerInit is called at the start of the program.
*/
#define __EXTENSIONS__
#include <stdlib.h>
#include <sys/times.h>
#include <limits.h>
#ifndef CLK_TCK
#define CLK_TCK 1
#endif
#include "timer.h"
#include "utils.h"
static struct tms *timebuffer=NULL;
static struct {
clock_t real;
clock_t user;
clock_t sys;
int running;
} timers[MAX_TIMERS];
void TimerStart(int tn)
{
if(timebuffer==NULL)
error("TimerStart","using TimerInit() before calling this routine","");
if((tn<0) || (tn>=(MAX_TIMERS)))
error("TimerStart","timer number out of range","");
if(timers[tn].running){
fprintf(stderr,"TimerStart: timer %d already running. exiting...\n",tn);
exit(1);
}
if(tn==0)
error("TimerStart","cannot 'start' timer 0, this is the main program timer! use another...","");
timers[tn].real=times(timebuffer);
timers[tn].user=timebuffer->tms_utime;
timers[tn].sys=timebuffer->tms_stime;
timers[tn].running=1;
}
void TimerGet(int tn,float *real, float *sys, float *user)
{
clock_t tempreal;
if(timebuffer==NULL)
error("TimerGet","using TimerInit() before calling this routine","");
if((tn<0) || (tn>=(MAX_TIMERS)))
error("TimerGet","timer number out of range","");
tempreal=times(timebuffer);
if(timers[tn].running==1){
*real=(float)(tempreal-timers[tn].real)/(CLK_TCK);
*user=(timebuffer->tms_utime-timers[tn].user)/(float)CLK_TCK;
*sys=(timebuffer->tms_stime-timers[tn].sys)/(float)CLK_TCK;
}
else {
*real=(timers[tn].real)/(float)CLK_TCK;
*user=(timers[tn].user)/(float)CLK_TCK;
*sys=(timers[tn].sys)/(float)CLK_TCK;
}
}
void TimerPrint(int tn, FILE *fp)
{
float real,sys,user;
if(fp==NULL)
return;
if(timebuffer==NULL)
error("TimerPrint","using TimerInit() before calling this routine","");
if((tn<0) || (tn>=(MAX_TIMERS)))
error("TimerPrint","timer number out of range","");
TimerGet(tn,&real,&sys,&user);
fprintf(fp,"Time_user: %.2f\nTime_sys: %.2f\nTime_real: %.2f\n",user,sys,real);
}
void TimerStop(int tn)
{
clock_t tempreal;
if(timebuffer==NULL)
error("TimerStop","using TimerInit() before calling this routine","");
if((tn<0) || (tn>=(MAX_TIMERS)))
error("TimerStop","timer number out of range","");
if(tn==0)
error("TimerStop","cannot 'stop' timer 0, this is the main program timer! use another...","");
tempreal=times(timebuffer);
timers[tn].real=tempreal-timers[tn].real;
timers[tn].user=timebuffer->tms_utime-timers[tn].user;
timers[tn].sys=timebuffer->tms_stime-timers[tn].sys;
timers[tn].running=0;
}
void TimerInit(void)
{
int i;
timebuffer=(struct tms*)malloc(sizeof(struct tms));
if(timebuffer==NULL)
error("TimerInits","cannot allocate timebuffer","");
for(i = 0; i < MAX_TIMERS; i++){
timers[i].real=0;
timers[i].user=0;
timers[i].sys=0;
timers[i].running=0;
}
/* setup the main program timer, timers[0] */
timers[0].real=times(timebuffer);
timers[0].running=1;
}
void TimerString(int tn, char *s)
{
float real,sys,user;
int sec_left;
if(timebuffer==NULL)
error("TimerFree","using TimerInit() before calling this routine","");
TimerGet(tn,&real,&sys,&user);
sec_left=(int)real;
if(sec_left>86400){
int days;
days=sec_left/86400;
if(days>999) days=999;
sprintf(s,"%dD:%02dH",days,(sec_left%86400)/3600);
}
else
sprintf(s,"%d:%02d:%02d",(sec_left%86400)/3600, (sec_left%3600)/60, (sec_left%60));
}
void TimerFree(void)
{
if(timebuffer==NULL)
error("TimerFree","using TimerInit() before calling this routine","");
free(timebuffer);
}
|
Added work/contrib/tic/tic98/timer.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
/*****************************************************************************
*
* Author: Stuart Inglis <singlis@waikato.ac.nz>
*
*
* timing routines
*
*****************************************************************************/
#ifndef __TIMER_H
#define __TIMER_H
#include <stdio.h>
#define MAX_TIMERS 5
void TimerInit(void);
void TimerFree(void);
void TimerStart(int tn);
void TimerStop(int tn);
void TimerGet(int tn,float *real, float *user, float *cpu);
void TimerPrint(int tn, FILE *fp);
void TimerString(int tn, char *s);
#endif
|
Added work/contrib/tic/tic98/utils.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
|
/*
*
* Author: Stuart Inglis <singlis@internz.co.nz>
*
*
* This file contains functions which are common utilities
*
*/
#include <stdio.h>
#include "utils.h"
#include <ctype.h>
#include <math.h>
int isEOF(FILE *fp)
{
int ch;
ch=getc(fp);ungetc(ch,fp);
if(ch==EOF) return 1;
return 0;
}
unsigned short magic_getshort(FILE *fp)
{
int ch1, ch2;
ch1 = getc(fp);if (ch1 == EOF) {ungetc(ch1,fp);return 0;}
ch2 = getc(fp);if (ch2 == EOF) {ungetc(ch2,fp);return 0;}
ungetc(ch2,fp);
ungetc(ch1,fp);
return ((unsigned short)ch1 << 8) | (unsigned short)ch2;
}
unsigned short magic_popshort(FILE *fp)
{
int ch1, ch2;
ch1 = getc(fp);if (ch1 == EOF) return 0;
ch2 = getc(fp);if (ch2 == EOF) return 0;
return (ch1 << 8) | ch2;
}
unsigned char magic_getbyte(FILE *fp)
{
int ch1;
ch1 = getc(fp);if (ch1 == EOF) {ungetc(ch1,fp);return 0;}
ungetc(ch1,fp);
return ((unsigned char)ch1);
}
unsigned char magic_popbyte(FILE *fp)
{
int ch1;
ch1 = getc(fp);if (ch1 == EOF) {return 0;}
return ((unsigned char)ch1);
}
/* 4 bytes of of pushback must be guaranteed */
unsigned long magic_getlong(FILE *fp)
{
int ch1, ch2,ch3,ch4;
ch1 = getc(fp);if (ch1 == EOF) {ungetc(ch1,fp); return 0;}
ch2 = getc(fp);if (ch2 == EOF) {ungetc(ch2,fp); return 0;}
ch3 = getc(fp);if (ch3 == EOF) {ungetc(ch3,fp); return 0;}
ch4 = getc(fp);if (ch4 == EOF) {ungetc(ch4,fp); return 0;}
ungetc(ch4,fp);
ungetc(ch3,fp);
ungetc(ch2,fp);
ungetc(ch1,fp);
return ((unsigned long)ch1 << 24) | ((unsigned long)ch2<<16) | ((unsigned long)ch3<<8) | ((unsigned long)ch4);
}
unsigned long magic_poplong(FILE *fp)
{
int ch1, ch2,ch3,ch4;
ch1 = getc(fp);if (ch1 == EOF) {return 0;}
ch2 = getc(fp);if (ch2 == EOF) {return 0;}
ch3 = getc(fp);if (ch3 == EOF) {return 0;}
ch4 = getc(fp);if (ch4 == EOF) {return 0;}
return ((unsigned long)ch1 << 24) | ((unsigned long)ch2<<16) | ((unsigned long)ch3<<8) | ((unsigned long)ch4);
}
void magic_write(FILE *fp, unsigned long magic_num)
{
if (fwrite(&magic_num, sizeof(magic_num), 1, fp) != 1)
error("magic num","Couldn't write magic number.","");
}
void magic_check(FILE *fp, unsigned long magic_num)
{
unsigned long magic;
if (fread(&magic, sizeof(magic), 1, fp) != 1 || magic != magic_num)
error("magic num","Incorrect magic number.","");
}
unsigned long magic_popnamed(char fn[], int *err)
{
FILE *fp;
unsigned long magic;
if((fp=fopen(fn,"rb"))!=NULL){
magic=magic_poplong(fp);
fclose(fp);
*err=0;
return magic;
}
else{
*err=1;
/* error("magic_popnamed","can't open file",fn);*/
return 0;
}
}
void error(char *prog, char *message, char *extra)
{
fprintf(stderr, "%s: %s %s\n", prog, message, extra);
exit(1);
}
void warn(char *prog, char *message, char *extra)
{
fprintf(stderr, "%s: %s %s\n", prog, message, extra);
}
/*void readline(char str[], FILE *fp)
{
int i=0,ch;
while(((ch=fgetc(fp))!='\n') && (!feof(fp)))
str[i++]=ch;
str[i]='\0';
}*/
#define GOOD_GAP 1024
/*
* fgoodgets(FILE *fp) and sgoodgets(char *&str)
*
* Both of these functions consume the input parameter.
* *fp is modified with a normal fgetc(), while *&str is
* incremented each time a character is read.
*
* Input Output
* 'a' 'a'
* 'b\n' 'b'
* 'c\r\n' 'c'
* '' ''
* '\n' ''
* '\r\n' ''
* '\n\r' '' '' (two lines)
*
* Both functions return a pointer to newly allocated memory.
* On EOF or EOS, NULL is returned.
* You must free the space when you are finished with it.
*
*/
char *fgoodgets(FILE *fp)
{
static int fgoodgets_len = GOOD_GAP;
static char *fgoodgets_space= NULL;
char *p = NULL;
int i=0,empty,ch=EOF;
if(fgoodgets_space==NULL)
fgoodgets_space=(char*)malloc(sizeof(char)*fgoodgets_len);
if((fgoodgets_space==NULL) || (fp==NULL)) return NULL;
empty=1;
do{
ch=(int)fgetc(fp);
if(ch==EOF) {
break;
} else if (ch=='\n') {
empty=0;
break;
} else {
if(i>=fgoodgets_len){
fgoodgets_len+=GOOD_GAP;
fgoodgets_space=(char*)realloc(fgoodgets_space,
sizeof(char)*fgoodgets_len);
}
empty=0;
fgoodgets_space[i++]=(char)ch;
}
} while(1);
while((i>=1) && (fgoodgets_space[i-1]==13))
i--;
if((i>=0) && (!empty)){
fgoodgets_space[i]=0;
p=(char*)malloc(sizeof(char)*(i+1));
strcpy(p,fgoodgets_space);
}
free(fgoodgets_space);
fgoodgets_space=NULL;
return p;
}
int getint(FILE *fp)
{
register char ch;
register unsigned int i = 0;
do
{
ch = getc(fp);
if (feof(fp)) return EOF;
}
while (ch < '0' || ch > '9');
do
{
i = i * 10 + ch - '0';
ch = getc(fp);
if (feof(fp)) return EOF;
}
while ( ch >= '0' && ch <= '9' );
return i;
}
/* get_header_int i.e. get an integer from a PNM header ; basically
the same as
above except for comment checking ; above kept because of lower
overhead */
int isinteger(char s[])
{
int i=0;
for(i=0; s[i]!='\0'; i++)
if(!isdigit(s[i])) return 0;
return 1;
}
int isfloat(char s[])
{
int i=0;
for(i=0; s[i]!='\0'; i++)
if((s[i]!='.')&&(!isdigit(s[i]))) return 0;
return 1;
}
|
Added work/contrib/tic/tic98/utils.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
|
#ifndef __UTILS_H
#define __UTILS_H
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h>
#ifndef PI
#define PI 3.14159265358979323846
#endif
#define LOG2(x) (log(x)/0.69314718055994530941)
/* absolute value of a */
#define ABS(a) (((a)<0) ? -(a) : (a))
/* round a to nearest integer towards 0 */
#define FLOOR(a) ((a)>0 ? (int)(a) : -(int)(-(a)))
/* round a to nearest integer away from 0 */
#define CEIL(a) \
((a)==(int)(a) ? (a) : (a)>0 ? 1+(int)(a) : -(1+(int)(-(a))))
/* round a to nearest int */
#define ROUND(a) ((a)>0 ? (int)((a)+0.5) : -(int)(0.5-(a)))
/* take sign of a, either -1, 0, or 1 */
#define ZSGN(a) (((a)<0) ? -1 : (a)>0 ? 1 : 0)
/* take binary sign of a, either -1, or 1 if >= 0 */
#define SGN(a) (((a)<0) ? -1 : 0)
/* find minimum of a and b */
#define MIN(a,b) (((a)<(b))?(a):(b))
/* find maximum of a and b */
#define MAX(a,b) (((a)>(b))?(a):(b))
/* swap a and b (see Gem by Wyvill) */
#define SWAP(a,b) { a^=b; b^=a; a^=b; }
/* linear interpolation from l (when a=0) to h (when a=1)*/
/* (equal to (a*h)+((1-a)*l) */
#define LERP(a,l,h) ((l)+(((h)-(l))*(a)))
/* clamp the input to the specified range */
#define CLAMP(v,l,h) ((v)<(l) ? (l) : (v) > (h) ? (h) : v)
/*
#define FLOOR(x) (int)(x)
#define CEIL(x) (int)((x)+0.99999)
#define ROUND(x) ((x)>=0 ? (int)((x)+0.5) : (-(int)((-(x))+0.5)))
*/
#define mm2pixels(mm,DPI) ROUND((DPI*(mm))/25.4)
#define inches2pixels(in,DPI) ROUND(DPI*(in))
#define pixels2inches(pixels,DPI) ((pixels)/DPI)
#define pixels2mm(pixels,DPI) inches2mm(pixels2inches(pixels,DPI))
#define mm2inches(mm) ((mm)/25.4)
#define inches2mm(inches) ((inches)*25.4)
#define RAD2DEG(rad) ((rad)*180.0/PI)
#define DEG2RAD(deg) ((deg)*PI/180.0)
#define MAGIC_P1 0x5031 /* P1 - pbm */
#define MAGIC_P2 0x5032 /* P2 - pgm */
#define MAGIC_P3 0x5033 /* P3 - ppm */
#define MAGIC_P4 0x5034 /* P4 - rawbits pbm */
#define MAGIC_P5 0x5035 /* P5 - rawbits pgm */
#define MAGIC_P6 0x5036 /* P6 - rawbits ppm */
#define MAGIC_TIFF 0x4d4d /* TIFF header -- big endian */
#define MAGIC_TIFF_sml 0x4949 /* TIFF header -- small endian */
#define TIMEOUT 5
#define CALLOC(var,cols_x,type) {assert(cols_x>=1);\
var=(type *)calloc(cols_x,sizeof(type));\
assert(var);}
#define REALLOC(var,cols_x,type) {assert(cols_x>=1);\
var=(type *)realloc(var,(cols_x)*sizeof(type));\
assert(var);}
#define FREE(var) {if(var)free(var);}
#define CALLOC_2D(var,rows_y,cols_x,type) {int _temp2;\
assert(rows_y>=1);\
CALLOC(var,rows_y,type *)\
for(_temp2=0;_temp2<rows_y;_temp2++)\
CALLOC(var[_temp2],cols_x,type)}
#define CALLOC_3D(var,third_z,rows_y,cols_x,type) {int _temp3;\
assert(third_z>=0);\
CALLOC(var,third_z, type **)\
for(_temp3=0;_temp3<third_z;_temp3++)\
CALLOC_2D(var[_temp3],rows_y,cols_x,type)}
#define CALLOC_4D(var,fourth_f,third_z,rows_y,cols_x,type) {int _temp4;\
CALLOC(var,fourth_f, type ***)\
for(_temp4=0;_temp4<fourth_f;_temp4++)\
CALLOC_3D(var[_temp4],third_z,rows_y,cols_x,type)}
#define FREE_2D(var,rows_y) {int _temp2;\
for(_temp2=0;_temp2<rows_y;_temp2++)\
FREE((var)[_temp2]);\
FREE(var);}
#define FREE_3D(var,third_z,rows_y) {int _temp3;\
for(_temp3=0;_temp3<third_z;_temp3++)\
FREE_2D((var)[_temp3],rows_y);\
FREE(var);}
#define FREE_4D(var,fourth_f,third_z,rows_y) {int _temp4;\
for(_temp4=0;_temp4<fourth_f;_temp4++)\
FREE_3D((var)[_temp4],third_z,rows_y);\
FREE(var);}
char *fgoodgets(FILE *fp);
/*void readline(char str[], FILE *fp);*/
int isEOF(FILE *fp);
unsigned char magic_getbyte(FILE *fp);
unsigned char magic_popbyte(FILE *fp);
unsigned short magic_getshort(FILE *fp);
unsigned short magic_popshort(FILE *fp);
unsigned long magic_getlong(FILE *fp);
unsigned long magic_poplong(FILE *fp);
void magic_write(FILE *fp, unsigned long magic_num);
void magic_check(FILE *fp, unsigned long magic_num);
unsigned long magic_popnamed(char fn[], int *err);
void error(char *prog, char *message, char *extra);
void warn(char *prog, char *message, char *extra);
int getint(FILE *fp);
int isinteger(char s[]);
int isfloat(char s[]);
#endif
|
Added work/contrib/tic/tic98/vector.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
|
/*****************************************************************************
*
* Author: Stuart Inglis <singlis@waikato.ac.nz>
*
*
*
*****************************************************************************/
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <assert.h>
#include "marklist.h"
#include "vector.h"
#include "windowing.h"
#include "utils.h"
#include <assert.h>
void
vector_init(vectortype *v)
{
v->size=0;
v->v=NULL;
}
void
vector_alloc(vectortype *v, int size)
{
vector_init(v);
CALLOC(v->v,size,double);
v->size=size;
}
void
vector_free(vectortype *v)
{
if(v->v)
FREE(v->v);
}
void
vector_fprintf(FILE* fp, vectortype *hist)
{
if(hist->v){
int i;
for(i=0;i<hist->size;i++)
fprintf(fp,"%f\n",hist->v[i]);
}
}
void
vector_fprint_named(char *fn, vectortype *hist)
{
FILE *fp;
fp=fopen(fn,"wt");
if(fp==NULL){
fprintf(stderr,"error: vector_fprint_named() can't write to %s\n",fn);
} else {
vector_fprintf(fp,hist);
fclose(fp);
}
}
void
vector_image_vertical_rles(vectortype *hist, marktype image)
{
int rl,p,p2;
int max=0;
int y,x;
int count;
assert(hist->size>=image.w);
for(x=0;x<image.w;x++){
count=0;
rl=0;
y=0;
p=gpix(image,x,y);
while(y<image.h){
p2=gpix(image,x,y);
if((p2==0) && (p2==p))
rl++;
else{
if(rl)
count+=(rl*rl);
rl=0;
}
p=p2;
y++;
}
if(rl) count+=(rl*rl);
hist->v[x]=count;
if(count>max){
max=(int)count;
}
}
for(x=0;x<hist->size;x++){
hist->v[x]/=max;
}
}
void
vector_image_vertical(vectortype *hist, marktype image)
{
int y,x,count,p;
assert(hist->size>=image.w);
for(x=0;x<image.w;x++){
count=0;
for(y=0;y<image.h;y++){
p=gpix(image,x,y);
count+=p;
}
hist->v[x]=count;
}
}
void
vector_image_horizontal(vectortype *hist, marktype image)
{
int y,x,count,p;
assert(hist->size>=image.h);
for(y=0;y<image.h;y++){
count=0;
for(x=0;x<image.w;x++){
p=gpix(image,x,y);
count+=p;
}
hist->v[y]=count;
}
}
void
vector_image_horizontal_rles(vectortype *hist, marktype image)
{
int rl,p,p2;
int max=0;
int y;
int count;
assert(hist->size>=image.h);
for(y=0;y<image.h;y++){
int x=0;
count=0;
rl=0;
y=0;
p=gpix(image,x,y);
while(x<image.w){
p2=gpix(image,x,y);
if((p2==0) && (p2==p))
rl++;
else{
if(rl)
count+=(rl*rl);
rl=0;
}
p=p2;
x++;
}
if(rl) count+=(rl*rl);
hist->v[y]=count;
if(count>max){
max=(int)count;
}
}
for(y=0;y<hist->size;y++){
hist->v[y]/=max;
}
}
void
vector_norm(vectortype *hist)
{
double max=0;
int x;
if(hist->size){
max=hist->v[0];
for(x=0;x<hist->size;x++){
if(hist->v[x]>max)
max=hist->v[x];
}
if(max){
for(x=0;x<hist->size;x++)
hist->v[x]/=max;
}
}
}
void
vector_invert(vectortype *hist)
{
double max=0;
int x;
if(hist->size){
max=hist->v[0];
for(x=0;x<hist->size;x++){
if(hist->v[x]>max)
max=hist->v[x];
}
for(x=0;x<hist->size;x++)
hist->v[x]=max-hist->v[x];
}
}
void
vector_quantise(vectortype *hist, int levels)
{
int x;
if(hist->size && levels>0){
vector_norm(hist);
for(x=0;x<hist->size;x++){
hist->v[x]*=(levels);
hist->v[x]=ROUND(hist->v[x]);
}
}
vector_norm(hist);
}
void
vector_threshold(vectortype *hist, double thres, double below, double above)
{
int x;
if(hist->size){
vector_norm(hist);
for(x=0;x<hist->size;x++){
if(hist->v[x]<=thres)
hist->v[x]=below;
else
hist->v[x]=above;
}
}
}
void
vector_convolve(vectortype *hist, int size, int TYPE)
{
vectortype result;
double *window;
int x;
if(size>0){
vector_alloc(&result,hist->size);
if((size%2)==0) size++;
CALLOC(window,size,double);
create_window(window, size,TYPE);
convolve(hist->v,0,hist->size-1, window, size,size/2,result.v,0);
for(x=0;x<hist->size;x++)
hist->v[x]=result.v[x];
FREE(window);
vector_free(&result);
}
vector_norm(hist);
}
void
vector_image_highlight_vertical(vectortype *hist, marktype image)
{
int x;
if(hist->size){
for(x=0;x<image.w;x++){
int p;
int y;
double r;
for(y=0;y<image.h;y++){
r=(rand()%10001)/10000.0;
if(hist->v[x]>=r){
p=gpix(image,x,y);
ppix(image,x,y,!p);
}
}
}
}
}
void
vector_image_highlight_horizontal(vectortype *hist, marktype image)
{
int y;
if(hist->size){
for(y=0;y<image.h;y++){
int p;
int x;
double r;
for(x=0;x<image.w;x++){
r=(rand()%10001)/10000.0;
if(hist->v[y]>=r){
p=gpix(image,x,y);
ppix(image,x,y,!p);
}
}
}
}
}
void
vector_image_plot(vectortype *hist, marktype image)
{
if(hist->size){
int y;
int x;
vector_norm(hist);
for(x=0;x<image.w;x++){
int p;
p=ROUND( ( 1-hist->v[x]) * (image.h-1));
for(y=image.h-1;y>=p;y--)
ppix(image,x,y,1);
for(;y>=0;y--)
ppix(image,x,y,0);
}
}
}
void
vector_and(vectortype *res, vectortype *anded)
{
int i;
assert(res->size==anded->size);
for(i=0;i<res->size;i++)
res->v[i]=res->v[i] * anded->v[i];
vector_norm(res);
}
void
vector_or(vectortype *res, vectortype *ored)
{
int i;
assert(res->size==ored->size);
for(i=0;i<res->size;i++)
res->v[i]=res->v[i] + ored->v[i];
vector_norm(res);
}
void
vector_mean(vectortype *hist1)
{
vectortype result;
int i,j;
int mean;
vector_alloc(&result,hist1->size);
for(i=0;i<hist1->size;i++){
if((hist1->v[i]>=0.99)){
for(j=i+1;j<hist1->size;j++)
if(hist1->v[j]<0.99)
break;
mean=ROUND((j-1+i)/2.0);
result.v[mean]=1.0;
i=j;
}
}
vector_norm(&result);
for(i=0;i<hist1->size;i++){
hist1->v[i]=result.v[i];
}
vector_free(&result);
}
void
vector_edge(vectortype *hist1)
{
vectortype result;
int i;
vector_alloc(&result,hist1->size);
for(i=1;i<hist1->size;i++){
if(fabs(hist1->v[i]-hist1->v[i-1])>=0.99)
result.v[i]=1.0;
else
result.v[i]=0.0;
}
for(i=0;i<hist1->size;i++){
hist1->v[i]=result.v[i];
}
vector_free(&result);
}
void
vector_stats(vectortype *hist, double *mean, double *sd)
{
double sumx=0,sumxx=0;
int n=0,x;
assert(mean);
assert(sd);
for(x=0;x<hist->size;x++){
sumx+=hist->v[x];
sumxx+=(hist->v[x]*hist->v[x]);
n++;
}
*mean=sumx/n;
*sd=(sumxx-((sumx*sumx)/n)) / n;
}
|
Added work/contrib/tic/tic98/vector.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
/*****************************************************************************
*
* Author: Stuart Inglis <singlis@waikato.ac.nz>
*
*
*****************************************************************************/
#ifndef __VECTOR_H
#define __VECTOR_H
#include "marklist.h"
#include "windowing.h"
typedef struct {
int size;
double *v;
} vectortype;
void vector_init(vectortype *v);
void vector_alloc(vectortype *v, int size);
void vector_free(vectortype *v);
void vector_fprintf(FILE* fp, vectortype *hist);
void vector_fprint_named(char *fn, vectortype *hist);
void vector_image_vertical(vectortype *hist, marktype image);
void vector_image_vertical_rles(vectortype *hist, marktype image);
void vector_image_horizontal(vectortype *hist, marktype image);
void vector_image_horizontal_rles(vectortype *hist, marktype image);
void vector_norm(vectortype *hist);
void vector_invert(vectortype *hist);
void vector_quantise(vectortype *hist, int levels);
void vector_threshold(vectortype *hist, double thres, double below, double above);
void vector_convolve(vectortype *hist, int size, int TYPE);
void vector_image_highlight_vertical(vectortype *hist, marktype image);
void vector_image_highlight_horizontal(vectortype *hist, marktype image);
void vector_image_plot(vectortype *hist, marktype image);
void vector_and(vectortype *res, vectortype *anded);
void vector_or(vectortype *res, vectortype *ored);
void vector_mean(vectortype *hist1);
void vector_edge(vectortype *hist1);
void vector_stats(vectortype *hist, double *mean, double *sd);
#endif
|
Added work/contrib/tic/tic98/windowing.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
|
/*
* Module: windowing
*
* Routines for reading/writing and convolving.
*
*
* Author:
* Stuart Inglis (singlis@internz.co.nz)
* (c) 1998
*
*/
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "windowing.h"
#include "utils.h"
#include <assert.h>
double window_rectangular_1D(int i, int N)
{
i=i; /* to quieten compilers */
N=N;
return 1.0;
}
double window_circular_1D(int i, int N)
{
if((i>=0) && (i<=N))
return 1.0;
else
return 0.0;
}
double window_bartlett_1D(int i, int N)
{
if((i>=0) && (i<=N)){
if(N==0)
return 1.0;
else
return 1.0-i/(double)N;
}
else
return 0.0;
}
double window_hanning_1D(int i, int N)
{
if((i>=0) && (i<=N)){
if(N==0)
return 1.0;
else
return (1.0-cos(PI*(1.0+i/(double)(N))))/2.0;
}
else
return 0.0;
}
double window_hamming_1D(int i, int N)
{
if((i>=0) && (i<=N)){
if(N==0)
return 1.0;
else
return (0.54-0.46*cos(PI*(1.0+i/(double)(N))));
}
else
return 0.08;
}
double window_blackman_1D(int i, int N)
{
if((i>=0) && (i<N)){
if(N==0)
return 1.0;
else
return (0.42-0.5*cos(PI*(1.0+i/(double)(N)))+0.08*
cos(2.0*PI*(1.0+i/(double)(N))));
}
else
return 0.0;
}
/* sd is a percentage of N/2, ie. 0.5 = 50% of N/2 */
double window_gaussian_1D(int i, int N, double sd)
{
sd=N*sd;
if(N==0)
return 1.0;
else
return exp(-( (double)i*i)/(2.0*sd*sd));
}
void create_window(
double *window,
int width,
int TYPE
)
{
int r,i;
assert(window);
assert(width>0);
if((width%2)==0)
fprintf(stderr,"comment: usually recommended to have an 'odd' size window width\n");
for(r=0;r<width;r++){
i=abs(r-width/2);
switch (TYPE) {
case RECTANGULAR: window[r]=window_rectangular_1D(i,width/2);
break;
case BARTLETT: window[r]=window_bartlett_1D(i,width/2);
break;
case HANNING: window[r]=window_hanning_1D(i,width/2);
break;
case HAMMING: window[r]=window_hamming_1D(i,width/2);
break;
case BLACKMAN: window[r]=window_blackman_1D(i,width/2);
break;
case GAUSSIAN: window[r]=window_gaussian_1D(i,width/2,0.4);
break;
default:{
fprintf(stderr,"create_window: don't know this window type!\n");
exit(1);
}
}
}
}
void create_window_2D(
double **window,
int width,
int TYPE
)
{
int i,j;
int r;
int width_r;
if((width%2)==0)
fprintf(stderr,"comment: usually recommended to have an "
"odd size window width\n");
/* circumscribe */
width_r=ROUND(sqrt((width/2*width/2)));
/* at corners */
/* width_r=ROUND(sqrt((width/2*width/2) * 2));*/
for(j=0;j<width;j++)
for(i=0;i<width;i++){
r=ROUND(sqrt((double)(j-width/2)*(j-width/2)+
(double)(i-width/2)*(i-width/2)));
switch (TYPE) {
case RECTANGULAR: window[j][i]=window_rectangular_1D(r,width_r);
break;
case BARTLETT: window[j][i]=window_bartlett_1D(r,width_r);
break;
case HANNING: window[j][i]=window_hanning_1D(r,width_r);
break;
case HAMMING: window[j][i]=window_hamming_1D(r,width_r);
break;
case BLACKMAN: window[j][i]=window_blackman_1D(r,width_r);
break;
case GAUSSIAN: window[j][i]=window_gaussian_1D(r,width_r,0.4);
break;
default:{
fprintf(stderr,"create_window: don't know this window type!\n");
exit(1);
}
}
}
}
void write_window(
char *filename,
double *window,
int L,
int H
)
{
int i;
FILE *fp;
int open=0;
assert(window);
assert(H>=L);
if((!filename) || (strcmp(filename,"-")==0)){
fp=(stdout);
} else{
fp=fopen(filename,"wb");
if(!fp) {
fprintf(stderr,"write_window: can't create file '%s'\n",filename);
return ;
}
open=1;
}
for(i=L;i<=H;i++)
fprintf(fp,"%d %g\n",i,window[i]);
fflush(fp);
if(open)
fclose(fp);
}
void write_window_labelled(
char *filename,
double *window,
int L,
int H,
double lowrange,
double highrange,
double bin
)
{
int i;
double r;
FILE *fp;
int open=0;
assert(window);
assert(H>=L);
highrange=highrange; /* to quieten compilers */
if(bin<=0){
fprintf(stderr,"write_window_labelled: warning, binsize<=0\n");
}
if((!filename) || (strcmp(filename,"-")==0))
fp=(stdout);
else{
fp=fopen(filename,"wb");
if(!fp) {
fprintf(stderr,"write_window: can't create file '%s'\n",filename);
return;
}
open=1;
}
r=lowrange;
for(i=L ;i<=H; i++, r+=bin){
/*
r=lowrange+(i-L)*(highrange-lowrange)/(H-L);
*/
if(bin<0.01)
fprintf(fp,"%.3f %g\n",r,window[i]);
else if(bin<0.1)
fprintf(fp,"%.2f %g\n",r,window[i]);
else if(bin<1)
fprintf(fp,"%.1f %g\n",r,window[i]);
else
fprintf(fp,"%g %g\n",r,window[i]);
}
fflush(fp);
if(open)
fclose(fp);
}
void write_window_2D(
char *filename,
double **window,
int Ly,
int Hy,
int Lx,
int Hx
)
{
int i,j;
FILE *fp;
int open=0;
if((!filename) || (strcmp(filename,"-")==0))
fp=(stdout);
else{
fp=fopen(filename,"wb");
if(!fp) {
fprintf(stderr,"write_window: can't create file '%s'\n",filename);
return;
}
open=1;
}
for(j=Ly;j<=Hy;j++)
for(i=Lx;i<=Hx;i++)
fprintf(fp,"%d\t%d\t%f\n",i,j,window[j][i]);
fflush(fp);
if(open)
fclose(fp);
}
void write_window_2D_pgm_P2(
char *filename,
double **window,
int Ly,
int Hy,
int Lx,
int Hx,
int maxval,
char *commentstring
)
{
double **copy;
int j,i;
int open=0;
FILE *fp;
CALLOC_2D(copy,Hy-Ly+1,Hx-Lx+1,double);
for(j=Ly;j<=Hy;j++)
for(i=Lx;i<=Hx;i++)
copy[j-Ly][i-Lx]=window[j][i];
normalise_window_2D(copy,Ly,Hy,Lx,Hx);
if((!filename) || (strcmp(filename,"-")==0)){
fp=(stdout);
} else{
fp=fopen(filename,"wb");
if(!fp) {
fprintf(stderr,"write_window_2D_pgm: can't create file '%s'\n",filename);
return;
}
open=1;
}
if(commentstring){
if(commentstring[strlen(commentstring)-1]=='\n')
commentstring[strlen(commentstring)-1]=0;
}
if(maxval<=255){
fprintf(fp,"P5\n");
if(commentstring){
fprintf(fp,"# %s\n",commentstring);
}
fprintf(fp,"%d %d\n",Hx-Lx+1,Hy-Ly+1);
fprintf(fp,"%d\n",maxval);
} else {
fprintf(fp,"P2\n");
if(commentstring){
fprintf(fp,"# %s\n",commentstring);
}
fprintf(fp,"%d %d\n",Hx-Lx+1,Hy-Ly+1);
fprintf(fp,"%d\n",maxval);
}
for(j=Ly;j<=Hy;j++){
for(i=Lx;i<=Hx;i++){
if((int)(copy[j-Ly][i-Lx]*maxval)<0)
fprintf(stderr,"warning - file '%s' has negative values!!!\n",filename);
if(maxval<=255){
fputc((int)(copy[j-Ly][i-Lx]*maxval),fp);
} else {
fprintf(fp,"%d ",(int)(copy[j-Ly][i-Lx]*maxval));
}
}
if(maxval>255){
fprintf(fp,"\n");
}
}
fflush(fp);
if(open)
fclose(fp);
FREE_2D(copy,Hy-Ly+1);
}
void write_window_2D_pgm_P2_float(
char *filename,
float **window,
int Ly,
int Hy,
int Lx,
int Hx,
int maxval
)
{
double **copy;
int j,i;
int open=0;
FILE *fp;
CALLOC_2D(copy,Hy-Ly+1,Hx-Lx+1,double);
for(j=Ly;j<=Hy;j++)
for(i=Lx;i<=Hx;i++)
copy[j-Ly][i-Lx]=window[j][i];
normalise_window_2D(copy,Ly,Hy,Lx,Hx);
if((!filename) || (strcmp(filename,"-")==0))
fp=(stdout);
else{
fp=fopen(filename,"wb");
if(!fp) {
fprintf(stderr,"write_window_2D_pgm: can't create file '%s'\n",filename);
return;
}
open=1;
}
fprintf(fp,"P2\n");
fprintf(fp,"%d %d\n",Hx-Lx+1,Hy-Ly+1);
fprintf(fp,"%d\n",maxval);
for(j=Ly;j<=Hy;j++){
for(i=Lx;i<=Hx;i++){
if((int)(copy[j-Ly][i-Lx]*maxval)<0)
fprintf(stderr,"warning - file '%s' has negative values!!!\n",filename);
fprintf(fp,"%d ",(int)(copy[j-Ly][i-Lx]*maxval));
}
fprintf(fp,"\n");
}
fflush(fp);
if(open)
fclose(fp);
FREE_2D(copy,Hy-Ly+1);
}
void write_window_2D_pgm_P5_float(
char *filename,
float **window,
int Ly,
int Hy,
int Lx,
int Hx,
int maxval
)
{
double **copy;
int j,i;
int open=0;
FILE *fp;
CALLOC_2D(copy,Hy-Ly+1,Hx-Lx+1,double);
for(j=Ly;j<=Hy;j++)
for(i=Lx;i<=Hx;i++)
copy[j-Ly][i-Lx]=window[j][i];
normalise_window_2D(copy,Ly,Hy,Lx,Hx);
if((!filename) || (strcmp(filename,"-")==0))
fp=(stdout);
else{
fp=fopen(filename,"wb");
if(!fp) {
fprintf(stderr,"write_window_2D_pgm: can't create file '%s'\n",filename);
return;
}
open=1;
}
fprintf(fp,"P5\n");
fprintf(fp,"%d %d\n",Hx-Lx+1,Hy-Ly+1);
fprintf(fp,"%d\n",maxval);
for(j=Ly;j<=Hy;j++){
for(i=Lx;i<=Hx;i++){
if((int)(copy[j-Ly][i-Lx]*maxval)<0)
fprintf(stderr,"warning - file '%s' has negative values!!!\n",filename);
fputc((char)(copy[j-Ly][i-Lx]*maxval),fp);
}
}
fflush(fp);
if(open)
fclose(fp);
FREE_2D(copy,Hy-Ly+1);
}
void normalise_window(
double *window,
int L,
int H
)
{
int i;
double maxval,minval;
double gap;
minval=maxval=window[L];
for(i=L; i<=H; i++){
if(window[i]>maxval)
maxval=window[i];
if(window[i]<minval)
minval=window[i];
}
gap=maxval-minval;
if(gap!=0){
for(i=L; i<=H; i++)
window[i]=(window[i]-minval)/gap;
}
}
void normalise_window_2D(
double **window,
int Ly,
int Hy,
int Lx,
int Hx
)
{
int i,j;
double maxval,minval;
double gap;
minval=maxval=window[Ly][Lx];
for(j=Ly; j<=Hy;j++)
for(i=Lx; i<=Hx; i++){
if(window[j][i]>maxval)
maxval=window[j][i];
if(window[j][i]<minval)
minval=window[j][i];
}
gap=maxval-minval;
if(gap!=0){
for(j=Ly; j<=Hy;j++)
for(i=Lx; i<=Hx; i++){
window[j][i]=(window[j][i]-minval)/gap;
}
}
for(j=Ly; j<=Hy;j++)
for(i=Lx; i<=Hx; i++)
if(window[j][i]<0){
fprintf(stderr,"warning - there are negative values in this window\n");return;}
}
void convolve(
double *data,
int L,
int H,
double *window,
int width,
int origin,
double *result,
int OPTIONS
)
{
int n,k;
double x,h;
double sum;
int b;
for(n=L; n<=H ;n++){
sum=0;
for(k=-origin; k<width-origin; k++){
if(OPTIONS&CYCLIC){
b=n+k;
while(b<L) b+=(H-L+1);
while(b>H) b-=(H-L+1);
x=data[b];
}
else {
if((n+k<L) || (n+k>H))
x=0.0;
else
x=data[n+k];
}
h=window[k+origin];
sum+=x*h;
}
result[n]=sum;
}
}
void convolve_2D(
double **data,
int Ly,
int Hy,
int Lx,
int Hx,
double **window,
int width,
int originy,
int originx,
double **result,
int OPTIONS
)
{
int i,j;
int lx,ly;
double x;
double sum;
int bx,by;
for(j=Ly;j<=Hy;j++)
for(i=Lx; i<=Hx ;i++){
sum=0;
for(ly=-originy;ly<width-originy;ly++){
for(lx=-originx;lx<width-originx;lx++){
if(OPTIONS&CYCLIC){
bx=i+lx;
while(bx<Lx) bx+=(Hx-Lx+1);
while(bx>Hx) bx-=(Hx-Lx+1);
by=j+ly;
while(by<Ly) by+=(Hy-Ly+1);
while(by>Hy) by-=(Hy-Ly+1);
x=data[by][bx]*
window[ly+originy][lx+originx];
}
else {
if((j+ly<Ly) || (j+ly>Hy) || (i+lx<Lx) || (i+lx>Hx))
x=0;
else
x=data[j+ly][i+lx] *
window[ly+originy][lx+originx];
}
sum+=x;
}
}
result[j][i]=sum;
}
}
|
Added work/contrib/tic/tic98/windowing.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
#ifndef __WINDOWING_H
#define __WINDOWING_H
#define CENTRED 1
#define CYCLIC 2
#define GAUSSIAN 0
#define BLACKMAN 1
#define HAMMING 2
#define HANNING 3
#define BARTLETT 4
#define CIRCULAR 5
#define RECTANGULAR 6
void create_window(double *window, int width, int TYPE );
void create_window_2D(double **window, int width, int TYPE );
void write_window( char *filename, double *window, int L, int H );
void write_window_labelled( char *filename, double *window, int L, int H,double low, double high, double bin );
void write_window_2D( char *filename, double **window, int Lx, int Hx,
int Ly, int Hy);
void write_window_2D_pgm_P2( char *filename, double **window, int Lx, int
Hx, int Ly, int Hy, int maxval , char *commentstring);
void write_window_2D_pgm_P2_float( char *filename, float **window, int Lx, int
Hx, int Ly, int Hy, int maxval );
void write_window_2D_pgm_P5_float( char *filename, float **window, int Lx, int
Hx, int Ly, int Hy, int maxval );
void normalise_window( double *window, int L, int H );
void normalise_window_2D( double **window, int Lx, int Hx, int Ly, int Hy );
void convolve( double *data, int L, int H, double *window, int width,
int origin, double *result, int OPTIONS );
void convolve_2D( double **data, int Lx, int Hx, int Ly, int Hy,
double **window, int width, int originx, int originy,
double **result, int OPTIONS );
double window_rectangular_1D(int i, int N);
double window_circular_1D(int i, int N);
double window_bartlett_1D(int i, int N);
double window_hanning_1D(int i, int N);
double window_hamming_1D(int i, int N);
double window_blackman_1D(int i, int N);
double window_gaussian_1D(int i, int N, double sd);
#endif
|
Added work/contrib/tic/tic98/zone.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
#include "line.h"
#include "boundary.h"
void
line_init(linetype *z)
{
z->num_lines=0;
z->line=NULL;
}
void
line_addline(linetype *z, marklistptr list)
{
int n=z->num_lines;
marklistptr step,end;
z->line=(marklistptr*)realloc(z->line,sizeof(marklistptr)*(n+1));
z->line[n]=NULL;
for(step=list;step; step=step->next){
if(z->line[n]==NULL){
end=marklist_addcopy(&z->line[n],step->data);
} else {
end=marklist_addcopy(&end,step->data);
}
}
z->num_lines++;
}
void
line_addmark(linetype *z, int n, marktype m)
{
marklist_addcopy(&z->line[n],m);
}
void
line_dump(linetype *z)
{
int i;
fprintf(stderr,"z->num_lines: %d\n",z->num_lines);
for(i=0;i<z->num_lines;i++){
fprintf(stderr,"line %d: %d\n",i,marklist_length(z->line[i]));
}
}
void
line_free(linetype *z)
{
int i;
for(i=0;i<z->num_lines;i++){
marklist_free(&z->line[i]);
}
free(z->line);
z->line=NULL;
z->num_lines=0;
}
void
line_test()
{
marktype im;
marklistptr list=NULL;
linetype z;
marktype_readnamed("b.pbm",&im);
list=extract_all_marks(list,im,1,8);
line_init(&z);
line_addline(&z,list);
line_dump(&z);
marklist_prune_under_area(&list,5,200);
line_addline(&z,list);
line_dump(&z);
line_free(&z);
fprintf(stderr,"line_test() finished\n");
}
|
Added work/contrib/tic/tic98/zone.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#ifndef __ZONE_H
#define __ZONE_H
#include "marklist.h"
typedef struct {
int num_zones;
marklistptr *zone;
} zonetype;
void zone_init(zonetype *z);
void zone_addzone(zonetype *z, marklistptr list);
void zone_addmark(zonetype *z, int zone, marktype m);
void zone_remove(zonetype *z, int zone);
void zone_free(zonetype *z);
void zone_dump(zonetype *z);
void zone_test();
#endif
|
Added work/contrib/tic/tic98/zone_highlight.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
#include <string.h>
#include <stdio.h>
#include "boundary.h"
#include "rls.h"
#include "marklist.h"
#include <assert.h>
void
marktype_box(marktype image, int x1, int y1, int x2, int y2)
{
marktype_line(image,x1,y1,x2,y1);
marktype_line(image,x1,y2,x2,y2);
marktype_line(image,x1,y1,x1,y2);
marktype_line(image,x2,y1,x2,y2);
}
void usage()
{
fprintf(stderr,"usage: zone_highlight image.pbm zonefile\n");
exit(1);
}
int main(int argc, char *argv[])
{
marktype image;
marklistptr list=NULL,step;
double bestaccum,accum;
double angle;
int len,i,r;
int _x1[1000],_y1[1000],_x2[1000],_y2[1000],_tags[1000];
char s[100],tag[100];
FILE *fp=NULL;
int num_tags=0;
int x1,y1,x2,y2,tt;
int istext=0, isnot=0;
if(argc<3) {
usage();
}
fp=fopen(argv[2],"rt");
if(fp){
while(fgets(s,100,fp)){
sscanf(s,"%*s %s %d %d %d %d\n",tag,
&_x1[num_tags],
&_y1[num_tags],
&_x2[num_tags],
&_y2[num_tags]);
if(strncmp(tag,"text",4)==0)
_tags[num_tags]=0;
else
_tags[num_tags]=1;
num_tags++;
assert(num_tags<1000);
}
} else {
fprintf(stderr,"error: can't open file: %s\n",argv[2]);
exit(1);
}
if(marktype_readnamed(argv[1],&image)!=0){
fprintf(stderr,"error loading: %s\n",argv[1]);
return 0.0;
}
if(argc>=2)
r=atoi(argv[1]);
else
r=0;
for(tt=0;tt<num_tags;tt++){
marktype_box(image,_x1[tt],_y1[tt],_x2[tt],_y2[tt]);
marktype_box(image,_x1[tt]-1,_y1[tt]-1,_x2[tt]+1,_y2[tt]+1);
marktype_box(image,_x1[tt]-2,_y1[tt]-2,_x2[tt]+2,_y2[tt]+2);
marktype_box(image,_x1[tt]-3,_y1[tt]-3,_x2[tt]+3,_y2[tt]+3);
marktype_box(image,_x1[tt]-4,_y1[tt]-4,_x2[tt]+4,_y2[tt]+4);
marktype_box(image,_x1[tt]-5,_y1[tt]-5,_x2[tt]+5,_y2[tt]+5);
}
marktype_write(stdout,image);
marktype_free(&image);
return 0;
}
|
Added work/contrib/zzip-zzlib-src.zip.
cannot compute difference between binary files
Added work/crack-me/file001.html.block-1.
cannot compute difference between binary files
Added work/crack-me/file001.html.dct.
cannot compute difference between binary files
Added work/crack-me/file001.info.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
File : file001.html.dct
Magic : 0x444354c3
Dact Version : 0.8.4
Block Size : 604160
Block Header Size : 4
Compressed Size : 12845
Uncompressed Size : 40449
Ratio : 3.149 to 1.0
Ciphered using : subst
Original Name : file001.html
CRC 0 : 0x0a5fe63b
CRC 1 : 0x06a07270
|
Added work/crack-me/file001.log.
|
|
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
|
[rkeene@laptop crack-me]$ dact -E subst file001.html
Key file: file001.key
[rkeene@laptop crack-me]$ cp file001.html.dct file001.html.out.dct
[rkeene@laptop crack-me]$ dact -d file001.html.out.dct
Key file: file001.key
[rkeene@laptop crack-me]$ diff file001.html file001.html.out
[rkeene@laptop crack-me]$ rm file001.html.out.dct
[rkeene@laptop crack-me]$ dact -s file001.html.dct > file001.info
[rkeene@laptop crack-me]$ ls
file001.html file001.html.dct file001.html.out file001.info file001.key
[rkeene@laptop crack-me]$
|
Added work/crack-me/index.ttml.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<TITLE>
<+
# Copyright (C) 2001 Roy Keene
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# email: index@rkeene.org
hgetvars
set path [file dirname $ENVS(DOCUMENT_URI)]
if {$path=="/"} { set path "" }
set path "$path/"
hputs "http://$ENVS(HTTP_HOST)$path"
proc convtoext {data} {
set output ""
for {set i 0} {$i<[string length $data]} {incr i} {
set curr [string index $data $i]
if {![string match "\[a-z,A-Z,0-9,.\]" $curr]} {
set curr [format "%%%x" [ctype ord $curr]]
}
set output "$output$curr"
}
return $output
}
+>
</TITLE>
</HEAD>
<+
set color(tarball) #D00000
set color(directory) #0000FF
set color(html) "#FF00FF"
set color(jpeg) "#FF00FF"
set color(text) "#000000"
set color(cgi) "#00FF00"
set color(tcl) "#00E000"
set color(header) "#000000"
set color(c) "#000000"
set color(makefile) "#000000"
set color(readme) "#000000"
set color(exe) "#00FF00"
set color(mp3) "#FFFF00"
set color(default) "#000000"
set color(bc) "#808080"
set color(zip) "#D00000"
set color(gif) "#FF00FF"
set types(tarball) *.tar.gz
set types(html) *.html
set types(text) *.txt
set types(cgi) *.cgi
set types(jpeg) *.jpg
set types(header) *.h
set types(c) *.c
set types(makefile) \[Mm\]akefile
set types(readme) "*\[Rr\]\[Ee\]\[Aa\]\[Dd\]\[Mm\]\[Ee\]*"
set types(exe) *.exe
set types(tcl) *.tcl
set types(mp3) *.mp3
set types(zip) *.zip
set types(bc) *.bc
set types(gif) *.gif
+>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF">
<TT>
<+
catch {
set fileId [open /web/rkeene/.counter r+]
gets $fileId cnt
seek $fileId 0 start
puts $fileId [expr $cnt+1]
close $fileId
}
if {[info exists cnt]} { hputs $cnt }
+>
[rkeene@unleaded
<+
if {[string index $path 1]=="~"} {
set path [string range $path [expr [string first / [string range $path 1 end]]+1] end]
}
set path [string range $path 0 [expr [string length $path]-2]]
hputs "/home/rkeene$path\]\$ ls -am<BR>"
set files ""
hputs "<A HREF=\"./\"><FONT COLOR=\"$color(directory)\">.</FONT>/</A>, <A HREF=\"../\"><FONT COLOR=\"$color(directory)\">..</FONT>/</A>"
foreach file [lsort [glob *]] {
if {[file type $file]!="link" || [file exists $file\.desc]} {
if {[file isdir $file]} {
hputs ", <A HREF=\"[convtoext $file]/\"><FONT COLOR=\"$color(directory)\">$file</FONT>/</A>"
lappend files "$file directory"
} else {
set DSTcolor default
if {[file executable $file]} { set DSTcolor exe }
foreach item [lsort [array names types]] {
if {[string match $types($item) $file]} {
set DSTcolor $item
break
}
}
if {![string match "*.\[dt\]\[et\]\[sm\]\[cl\]" $file]} {
hputs ", <A HREF=\"[convtoext $file]\"><FONT COLOR=\"$color($DSTcolor)\">$file</FONT></A>"
lappend files "$file $DSTcolor"
}
}
}
}
hputs "<BR>"
if {[info exists cnt]} { hputs "[expr $cnt+1] " }
hputs "\[rkeene@unleaded /home/rkeene$path\]\$ "
+>
</TT><HR WIDTH="75%" SIZE=1>
<+
foreach file $files {
set tof [lindex $file 1]
set file [lindex $file 0]
if {[file exists $file\.desc]} {
set fileId [open $file\.desc r]
set desc ""
while {![eof $fileId]} {
gets $fileId ln
set desc "$desc\n$ln"
}
set desc [string range $desc 1 end]
close $fileId
set slash [lindex {{} {/}} [file isdir $file]]
hputs "<A HREF=\"$file$slash\"><FONT COLOR=\"$color($tof)\">$file</FONT>$slash</A> $desc<BR>"
}
}
+>
<+
if {[string tolower $ENVS(SERVER_NAME)]!="www.rkeene.org"} {
set directory "~rkeene/"
} else {
set directory ""
}
hputs " -- <A HREF=\"/$directory\work/resume-rk.html\">Roy Keene</A> \[<A HREF=\"http://shammack.n-f-d.com/date.html\">0290120002010</A>\] <A HREF=\"mailto:rkeene@rkeene.org\">rkeene@rkeene.org</A>"
+>
<+
if {![info exists ENVS(HTTP_REFERER)]} { set ENVS(HTTP_REFERER) "-" }
if {[string match "*shammack*" $ENVS(HTTP_REFERER)]} {
+>
<HR WIDTH="75%">
<PRE><A HREF="http://morgus.ddns.org/">morgus</A>:/home/deadduck# ls -l
...
l---rwsr-- 1 112 11312 18446744073441116198 Dec 31 1969 #63746
pr-sr-xr-t 1 13403 27757 0 Mar 28 1996 #63809|
b---r-S--- 1 29289 29812 111, 103 Mar 5 2028 #63811
c--xrw--w- 1 512 26991 108, 32 Jan 24 2026 #63872
<A HREF="http://morgus.ddns.org/">morgus</A>:/home/deadduck# du -s
165423528591 .</PRE>
morgus is <A HREF="http://shammack.n-f-d.com/">Scott</A>'s new machine (It's /home fs has since been repaired.)<BR>
<+
}
hputs "<BR><A HREF=\"/$directory\">Home</A><BR>"
+>
<BR>
<+
hputs "<SMALL>date=[clock format [clock seconds] -format 0%d%m%Y%H%M]</SMALL>"
+>
<BR>
<CENTER><A HREF=http://www.n-f-d.com/><IMG BORDER=0 SRC=http://www.n-f-d.com/random-image/*/<+hputs [clock seconds]+>/ ALT="Netfuel Design"></A>
<+
hputs "<IMG ALT=\"\[ Support Freedom \]\" SRC=\"/$directory\projects/support-freedom/ribbon_small.gif\">"
+>
</CENTER>
<BR>
Hey, you. Tell me what you think of this site -- <A HREF="mailto:rkeene@rkeene.org">rkeene@rkeene.org</A>
<BR>
<FONT SIZE=-7>Documentation is <B>NOT</B> a last resort. It's <B>FIRST</B> choice.<BR>
*Click* at the sound of the tone it will be exactly Mon Jan 18 21:14:07 CST 2038.<BR>
*Click* at the sound of the tone it will be exactly Fri Dec 13 14:45:52 CST 1901. (Maybe time_t should be unsigned?)<BR>
Support International Code Cleanup Year !<BR>
Saturday, 08 September 2001 20:46:40 2001, a second that will live in infamy<BR>
</FONT>
</BODY>
</HTML>
|
Added work/dact-upgrade.sh.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
#! /bin/sh
MACHINE=`uname -m | sed s/"i.86"/"i386"/ | dd conv=lcase 2>/dev/null`
OS=`uname -s | dd conv=lcase 2>/dev/null`
FILE="http://www.rkeene.org/devel/dact/precompiled/dact-$MACHINE-$OS.bin"
LFILE="dact-$MACHINE-$OS.bin"
VERSION=http://www.rkeene.org/devel/dact/VERSION
if [ "$1" = "detcomp" ]; then
echo $LFILE
exit
fi
if [ "$1" = "define" ]; then
MCRO=_`echo $2 | tr [a-z]\. [A-Z]_ | sed s/"_C$"/"_H"/`
echo "#ifndef $MCRO"
echo "#define $MCRO"
echo "#include \"dact.h\""
echo ""
egrep '^ *(char|int|void|uint32_t|uint16_t|unsigned|signed).* .*(.*).* {$' $2 | sed s/" {$"/';'/
echo "#endif"
exit
fi
CURRDIR=`pwd`
DIR=/tmp
while [ -d $DIR ]; do
DIR=/tmp/dact-$RANDOM
done
mkdir $DIR
if [ ! -d $DIR ]; then
echo "Could not make directory for temporary storage."
exit 1
fi
cd $DIR
if which lynx 2>/dev/null >/dev/null; then
lynx -nostatus -dump $VERSION > VERSION 2>/dev/null
CMD="lynx -nostatus -dump $FILE > $LFILE"
elif which wget 2>/dev/null >/dev/null; then
wget -q $VERSION 2>/dev/null >/dev/null
CMD="wget -q $FILE"
else
echo "No appropriate way to download."
echo "The file is at:"
echo "$FILE"
cd $CURRDIR
rmdir $DIR
exit 1
fi
CURR_VER=`dact -h 2>&1 | head -1 | sed s/\ version// | cut -f 2 -d \ | cut -f 1 -d -`
VER_MAJ=`cut VERSION -c 1-3|sed s/"^00\?"//`
VER_MIN=`cut VERSION -c 4-6|sed s/"^00\?"//`
VER_REV=`cut VERSION -c 7-9|sed s/"^00\?"//`
NEW_VER=`echo "$VER_MAJ.$VER_MIN.$VER_REV"`
if [ "$NEW_VER" = "$CURR_VER" ]; then
echo "Would download same version."
rm VERSION
cd $CURRDIR
rmdir $DIR
exit 1
fi
echo "Do you really want to upgrade from DACT $CURR_VER to DACT $NEW_VER ?"
read YN
YN=`echo $YN | dd conv=ucase bs=1 count=1 2>/dev/null`
if [ ! "$YN" = "Y" ]; then
rm VERSION
cd $CURRDIR
rmdir $DIR
exit
fi
eval $CMD
if [ -f $LFILE ]; then
if head -2 $LFILE | grep "Not Found" 2>/dev/null >/dev/null; then
rm $LFILE
fi
fi
if [ ! -f $LFILE ]; then
echo "Unable to find an appropriate precompiled binary for a $MACHINE running $OS"
echo "Contact Roy Keene <rkeene@rkeene.org> if you need further assistance."
echo "The latest dact source can be found at:"
echo "http://www.rkeene.org/devel/dact.tar.gz"
rmdir $DIR
cd $CURRDIR
exit 1
fi
chmod 0755 $LFILE
ID=`id | cut -f 2 -d = | cut -f 1 -d "("`
if [ $ID = 0 ]; then
cp $LFILE /usr/local/bin
cat /usr/local/bin/dact > /usr/local/bin/dact.old 2>/dev/null
rm -f /usr/local/bin/dact
ln -s /usr/local/bin/$LFILE /usr/local/bin/dact
chown root /usr/local/bin/dact.old /usr/local/bin/$LFILE
chgrp root /usr/local/bin/dact.old /usr/local/bin/$LFILE
chmod 0755 /usr/local/bin/dact.old /usr/local/bin/$LFILE
else
mkdir $HOME/.dact/ 2>/dev/null >/dev/null
cp $LFILE $HOME/.dact/dact.bin
fi
rm $LFILE
rm VERSION
cd $CURRDIR
rmdir $DIR
|
Added work/dact.c.orig.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
|
/*
* Copyright (C) 2000 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: rkeene@rkeene.org
*/
/*
Dynamic Compression Routines
*/
#define __DACT_C
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdarg.h>
#include <math.h>
#include "dact.h"
#include "algorithms.h"
#include "endian.h"
#include "parse.h"
#if defined(CHECK_VERSION)
#include "net.h"
#endif
#include "math.h"
#ifdef HAVE_LIBDL
#include "module.h"
#endif
#ifdef HAVE_GETOPT
extern char *optarg;
extern int optind, opterr, optopt;
#endif
int dact_check_ver=0;
int dact_check_bin=1;
uint32_t DACT_BLK_SIZE=4088;
int print_help(int argc, char **argv) {
fprintf(stderr, "DACT version %i.%i.%i by Roy Keene at Netfuel Design (rkeene@rkeene.org).\n\n",DACT_VER_MAJOR,DACT_VER_MINOR,DACT_VER_REVISION);
fprintf(stderr, "Usage:\n dact [-sdfv[v[v]]Clc] [-e id] [-b size] [-m file] [--] <filename> [outfile]\n\n");
fprintf(stderr, " -s\tDisplay statistics about file (Don't compress or decompress.)\n");
fprintf(stderr, " -d\tDecompress instead of compressing.\n");
fprintf(stderr, " -f\tForce overwriting existing files.\n");
fprintf(stderr, " -v\tIncrease verbosity.\n");
fprintf(stderr, " -C\tComplain when compression verification fails.\n");
fprintf(stderr, " -l\tList compression algorithms availble.\n");
fprintf(stderr, " -c\tOutput to stdout forcefully.\n");
fprintf(stderr, " -e\tExclude algorithm XX.\n");
fprintf(stderr, " -b\tUse block size XX.\n");
fprintf(stderr, " -m\tUse specified configuration file.\n");
return(0);
}
int process_config(char *filename) {
char *read_buf, *line_buf, *item_buf[4];
int fd;
int m,i;
if ((fd=open(filename, O_RDONLY))<0) {
if (strcmp(DACT_CONFIG_FILE,filename)) {
PRINT_LINE;
fprintf(stderr, "open(\"%s\"",filename);
perror(")");
}
return(-1);
}
read_buf=malloc(1024);
while (read(fd, read_buf, 1024)>0) {
while ( (line_buf=strsep(&read_buf,"\n")) != NULL ) {
if (line_buf[0]=='#') line_buf[0]=0;
m=0;
for (i=0;i<(sizeof(item_buf)/sizeof(char *));i++) {
item_buf[i]=NULL;
}
while ((item_buf[m]=strsep(&line_buf,"\t "))!=NULL) {
if (item_buf[m][0]!=0) {
if (m<(( sizeof(item_buf)/sizeof(char *) )-1)) m++;
}
}
if (item_buf[0]==NULL || item_buf[1]==NULL) continue;
/* TODO: make this work differently. */
#ifdef HAVE_LIBDL
if (!strcmp("load_module",item_buf[0])) {
init_modules();
if (load_module(item_buf[1])!=DACT_MOD_OK) {
fprintf(stderr, "Failed to load module %s\n",item_buf[1]);
}
}
if (!strcmp("module_dir",item_buf[0])) {
strncpy(moduledirectory,item_buf[1],sizeof(moduledirectory)-1);
}
#endif
if (!strcmp("version_check",item_buf[0])) {
dact_check_ver=!strcasecmp(item_buf[1],"on");
}
if (!strcmp("binary_check",item_buf[0])) {
dact_check_bin=!strcasecmp(item_buf[1],"on");
}
}
}
free(read_buf);
close(fd);
return(0);
}
void process_algorithms (void) {
int i;
for (i=0;i<256;i++) {
if (algorithms[i]==DACT_FAILED_ALGO) {
algorithm_names[i]="Unsupported algorithm.";
}
}
return;
}
uint32_t is_latest (void) {
#if defined(CHECK_VERSION)
int fd;
char ver_maj[4]={0,0,0,0}, ver_min[4]={0,0,0,0}, ver_rev[4]={0,0,0,0};
char bigbuf[1024], *smallbuf;
int vers[3];
int past=0;
if (dact_check_ver==0) return(0);
if (getuid()==0) return(0);
if ((fd=createconnection_tcp("www.rkeene.org", 80))<0) return(0);
write(fd, "GET /devel/dact/VERSION HTTP/1.1\n", 33);
write(fd, "Host: www.rkeene.org\n\n", 31);
read(fd, &bigbuf,1024);
strtok(bigbuf, "\n");
while ((smallbuf=strtok(NULL, "\n"))!=NULL) {
if (strlen(smallbuf)==1) past=1;
if (strlen(smallbuf)==9 && past==1) {
memcpy(ver_maj,smallbuf,3);
memcpy(ver_min,smallbuf+3,3);
memcpy(ver_rev,smallbuf+6,3);
past=2;
}
}
closeconnection(fd);
if (past!=2) return(0);
vers[0]=atoi(ver_maj);
vers[1]=atoi(ver_min);
vers[2]=atoi(ver_rev);
if ( ((vers[0]<<16)|(vers[1]<<8)|vers[2]) > ((DACT_VER_MAJOR<<16)|(DACT_VER_MINOR<<8)|DACT_VER_REVISION) ) {
return((vers[0]<<16)|(vers[1]<<8)|vers[2]);
} else {
return(0);
}
#else
return(0);
#endif
}
int dact_shutdown(int nice_retval, int numargs, ...) {
va_list args;
#ifdef DEBUG
void *free_buf;
#endif
int i;
#ifdef HAVE_LIBDL
unload_modules();
#endif
#ifdef DEBUG
va_start(args, numargs);
for (i=0;i<numargs;i++) {
free_buf=va_arg(args, void*);
if (free_buf!=NULL) free(free_buf);
}
va_end(args);
#endif
return(nice_retval);
}
int main(int argc, char **argv) {
unsigned char cmp_options=0;
char in_filename[128], out_filename[128], cfg_filename[128];
#ifdef DEBUG
char *in_buffer=NULL, *prev_buffer=NULL;
char *out_buffer=NULL, *store_buffer=NULL, *verify_buffer=NULL;
#else
char in_buffer[MAX_DACT_BLK_SIZE], prev_buffer[MAX_DACT_BLK_SIZE];
char out_buffer[MAX_DACT_BLK_SIZE*2];
char store_buffer[MAX_DACT_BLK_SIZE*2];
char verify_buffer[MAX_DACT_BLK_SIZE*2];
#endif
char file_version[3]={DACT_VER_MAJOR, DACT_VER_MINOR, DACT_VER_REVISION};
char option_verbose=0;
char option_complain=0;
char option_old=0;
char ch;
uint32_t file_size_real=0, file_size, out_file_size, in_magic;
#if defined(CHECK_VERSION)
uint32_t version_latest;
#endif
uint32_t stat_cnt[256];
int in_fd, out_fd=-1;
int i,x=0;
int32_t out_size=-1, out_lowest, out_algo=-1;
uint32_t bread;
int mode=DACT_MODE_COMPR;
int mode_force=0;
int number_algorithm=0;
uint32_t verify_size;
int verified_data;
int dact_blk_bitsize=0;
struct stat statinfo;
struct dact_header header;
#ifdef DEBUG
option_verbose=1;
#endif
strcpy(cfg_filename,DACT_CONFIG_FILE);
process_algorithms();
while ((ch = getopt(argc,argv,"dfvClshce:b:m:")) != -1) {
switch (ch) {
case 'd':
mode=DACT_MODE_DECMP;
break;
case 'f':
mode_force++;
break;
case 'v':
option_verbose++;
break;
case 'C':
option_complain=1;
break;
case 'b':
if (optarg!=NULL) {
DACT_BLK_SIZE=dact_val(optarg);
}
break;
case 'l':
process_config(cfg_filename);
fprintf(stderr, " Number | Algorithm Name\n");
fprintf(stderr, "--------+----------------------------------------------------------------------\n");
for (i=0;i<256;i++) {
if (algorithms[i]==NULL) break;
fprintf(stderr, " %03i | %s\n",i,algorithm_names[i]);
}
return(dact_shutdown(0, 5,in_buffer, out_buffer, store_buffer, verify_buffer, prev_buffer));
case 'e':
if (optarg!=NULL) {
i=atoi(optarg);
algorithms[i]=comp_fail_algo;
}
break;
case 's':
mode=DACT_MODE_STAT;
break;
case 'c':
out_fd=STDOUT_FILENO;
break;
case 'h':
print_help(argc,argv);
return(dact_shutdown(0, 5,in_buffer, out_buffer, store_buffer, verify_buffer, prev_buffer));
case 'm':
strncpy(cfg_filename,optarg,sizeof(cfg_filename)-1);
break;
case ':':
case '?':
fprintf(stderr, "%s: Try %s -h for help.\n",argv[0], argv[0]);
break;
}
}
process_config(cfg_filename);
#ifdef DEBUG
in_buffer=malloc(DACT_BLK_SIZE);
prev_buffer=malloc(DACT_BLK_SIZE);
verify_buffer=malloc(DACT_BLK_SIZE*2);
out_buffer=malloc(DACT_BLK_SIZE*2);
store_buffer=malloc(DACT_BLK_SIZE*2);
#endif
/*
This checks for ~/.dact/dact.bin, and executes it
*/
#ifndef GO32
if (dact_check_bin) {
strcpy(in_filename,getenv("HOME"));
strcat(in_filename,"/.dact/dact.bin");
if (strcmp(argv[0],in_filename)) {
if (access(in_filename,X_OK)==0) {
argv[0]=in_filename;
execv(in_filename,argv);
}
}
}
#endif
#if defined(CHECK_VERSION)
if ((version_latest=is_latest())!=0) {
fprintf(stderr, "\033[1mNOTE:\n");
fprintf(stderr, " There is a newer version of DACT: %i.%i.%i\n", (int) (version_latest>>16), (int) ((version_latest>>8)&0xff), (int) (version_latest&0xff));
fprintf(stderr, " http://www.rkeene.org/devel/dact.tar.gz is the latest version.\033[0m\n\n");
}
#endif
for (i=0;i<sizeof(prev_buffer);i++) prev_buffer[i]=0;
for (i=0;i<256;i++) stat_cnt[i]=0;
if (argv[optind]==NULL) {
in_filename[0]=0;
} else {
strncpy(in_filename,argv[optind],sizeof(in_filename)-1);
}
if (!strcmp(in_filename,"-") || in_filename[0]==0) {
in_fd=STDIN_FILENO;
} else {
if ((in_fd=open(in_filename,O_RDONLY))==-1) {
fprintf(stderr, "%s: Unable to open %s for reading.\n",argv[0],in_filename);
return(dact_shutdown(-1, 5, in_buffer, out_buffer, store_buffer, verify_buffer, prev_buffer));
}
}
if (mode!=DACT_MODE_STAT) {
if (argc==(2+optind)) {
strncpy(out_filename,argv[1+optind],sizeof(out_filename)-1);
} else {
if (isatty(STDOUT_FILENO)) {
if (isatty(in_fd)) {
return(dact_shutdown(print_help(argc, argv), 5, in_buffer, out_buffer, store_buffer, verify_buffer, prev_buffer));
}
if (mode==DACT_MODE_COMPR) {
strncpy(out_filename,in_filename,sizeof(out_filename)-4);
strcat(out_filename,".dct");
} else {
/* TODO: Fix this, it will break in paths with dots in them, heh. */
/* strncpy(out_filename,strtok(in_filename,"."),sizeof(out_filename)-1); */
/* TODO: FIX THIS, it's just stupid... FIX IT NOW! */
strncpy(out_filename,in_filename,strlen(in_filename)-4);
}
} else {
out_fd=STDOUT_FILENO;
}
}
if (out_fd==-1) {
if (!access(out_filename, F_OK)) {
if (mode_force) {
unlink(out_filename);
} else {
fprintf(stderr, "%s: %s exists, exiting.\n",argv[0],out_filename);
close(in_fd);
return(dact_shutdown(-1, 5, in_buffer, out_buffer, store_buffer, verify_buffer, prev_buffer));
}
}
if ((out_fd=open(out_filename,O_WRONLY|O_CREAT,0644))==-1) {
fprintf(stderr, "%s: Unable to open %s for writing.\n",argv[0],out_filename);
return(dact_shutdown(-1, 5, in_buffer, out_buffer, store_buffer, verify_buffer, prev_buffer));
}
}
}
for (i=0;i<256;i++) { if (algorithms[i]==NULL) break; }
number_algorithm=i;
/* This should be phased out as much as possible (though still required
to determine how much of BLOCK is required when decompressing.
*/
fstat(in_fd, &statinfo);
file_size=statinfo.st_size;
switch (mode) {
case DACT_MODE_COMPR:
dact_blk_bitsize=((int) ((float) (log(DACT_BLK_SIZE)/M_LN2l) +8))/8;
cmp_options=(cmp_options&0xfc)|(dact_blk_bitsize-1);
fprintf(stderr, "i=%i;%i|%i\n",dact_blk_bitsize-1,(cmp_options>>1)&0x1,cmp_options&0x1);
write(out_fd,&file_version[0],sizeof(file_version[0]));
write(out_fd,&file_version[1],sizeof(file_version[1]));
write(out_fd,&file_version[2],sizeof(file_version[2]));
i=WRITE_4BYTE_DE(out_fd,DACT_MAGIC_NUMBER);
write(out_fd,&cmp_options,sizeof(cmp_options));
/* Note: THIS IS JUST A PLACE HOLDER, IT DOESN'T REALLY MATTER */
i=WRITE_4BYTE_DE(out_fd,file_size);
i=WRITE_NBYTE_DE(out_fd,DACT_BLK_SIZE,dact_blk_bitsize);
/* write(out_fd,&file_size,sizeof(file_size)); */
/* write(out_fd,&DACT_BLK_SIZE,sizeof(DACT_BLK_SIZE)); */
while (1) {
x++;
out_lowest=DACT_BLK_SIZE*2;
if ((bread = read(in_fd,in_buffer,DACT_BLK_SIZE))==0) break;
file_size_real+=bread;
for (i=0;i<255;i++) {
if (algorithms[i]==NULL) break;
out_size=algorithms[i](DACT_MODE_COMPR, prev_buffer, in_buffer, out_buffer, DACT_BLK_SIZE);
if (option_verbose>2)
fprintf(stderr, " -- algo #%i: size=%i\n",i,out_size);
PRINT_LINE; fprintf(stderr, "\n");
fprintf(stderr, "out_size=%i\n",out_size);
if (out_size>0) {
PRINT_LINE; fprintf(stderr, "\n");
verify_size=algorithms[i](DACT_MODE_DECMP, prev_buffer, out_buffer, verify_buffer, out_size);
} else {
verify_size=-1;
}
PRINT_LINE; fprintf(stderr, "\n");
verified_data=0;
if (verify_size==DACT_BLK_SIZE) {
if (!memcmp(verify_buffer, in_buffer, DACT_BLK_SIZE)) {
verified_data=1;
}
}
PRINT_LINE; fprintf(stderr, "\n");
if (!verified_data && verify_size>0 && option_complain) {
fprintf(stderr, "Block #%05i: algo=%03i: Verification failed! %34s\n",x,i,algorithm_names[i]);
}
PRINT_LINE; fprintf(stderr, "\n");
if (out_size<out_lowest && (out_size > 0) && verified_data) {
memcpy(store_buffer,out_buffer,out_size);
out_algo=i;
out_lowest=out_size;
}
memcpy(prev_buffer,in_buffer,DACT_BLK_SIZE);
}
PRINT_LINE; fprintf(stderr, "\n");
if (out_lowest==(DACT_BLK_SIZE*2)) {
PRINT_LINE;
fprintf(stderr, "Compression resulted in DACT_BLK_SIZE*2 ! Aborting.\n");
return(dact_shutdown(-1, 5, in_buffer, out_buffer, store_buffer, verify_buffer, prev_buffer));
}
PRINT_LINE; fprintf(stderr, "\n");
if (option_verbose>1) {
fprintf(stderr, "Block #%05i: algo=%03i (size=%05i, %05i) %35s\n", x,out_algo,out_lowest,(int) (out_lowest+sizeof(header.algo)+sizeof(header.size)),algorithm_names[out_algo]);
}
if (option_verbose==1) {
fprintf(stderr, "Block %5i/%5i\r",x,(int) (((float) (((float) file_size)/DACT_BLK_SIZE))+0.99));
fflush(stderr);
}
header.size=(uint32_t) (out_lowest);
header.algo=out_algo;
i=WRITE_NBYTE_DE(out_fd,header.size,dact_blk_bitsize);
/* write(out_fd,&header.size,sizeof(header.size)); */
write(out_fd,&header.algo,sizeof(header.algo));
write(out_fd,store_buffer,out_lowest);
}
lseek(out_fd, sizeof(file_version)+DACT_MAGIC_SIZE+sizeof(cmp_options), SEEK_SET);
i=WRITE_4BYTE_DE(out_fd, file_size_real);
/* write(out_fd, &file_size_real, sizeof(file_size_real)); */
break;
case DACT_MODE_DECMP:
i=x=0;
x+=read(in_fd,&file_version[0],sizeof(file_version[0]));
x+=read(in_fd,&file_version[1],sizeof(file_version[1]));
x+=read(in_fd,&file_version[2],sizeof(file_version[2]));
if ( ((file_version[0]<<16)|(file_version[1]<<8)|file_version[2]) <= 0x000402) {
fprintf(stderr, "Warning: Old Format\n");
option_old=1;
if (file_version[2]==2) option_old=2;
in_magic=DACT_MAGIC_NUMBER;
} else {
x+=READ_4BYTE_DE(in_fd,in_magic);
}
if (in_magic!=DACT_MAGIC_NUMBER && mode_force<2) {
printf("%s: Bad magic.\n", argv[0]);
return(dact_shutdown(-1, 5, in_buffer, out_buffer, store_buffer, verify_buffer, prev_buffer));
}
x+=read(in_fd,&cmp_options,sizeof(cmp_options));
printf("i=%i\n",cmp_options&0x3);
dact_blk_bitsize=(cmp_options&0x3)+1;
if (option_old) {
x+=read(in_fd,&out_file_size,sizeof(out_file_size));
if (option_old==2) { x+=read(in_fd,&DACT_BLK_SIZE,sizeof(int)); } else { DACT_BLK_SIZE=1024; }
} else {
x+=READ_4BYTE_DE(in_fd,out_file_size);
x+=READ_NBYTE_DE(in_fd,DACT_BLK_SIZE,dact_blk_bitsize);
}
/* x=sizeof(out_file_size)+sizeof(cmp_options); */
if (file_version[0]!=DACT_VER_MAJOR && mode_force<2) {
fprintf(stderr, "Major version numbers do not match! (%i!=%i)\n",file_version[0],DACT_VER_MAJOR);
fprintf(stderr, "File is not usable, exiting...\n");
close(in_fd);
close(out_fd);
return(dact_shutdown(-1, 5, in_buffer, out_buffer, store_buffer, verify_buffer, prev_buffer));
}
if (file_version[1]!=DACT_VER_MINOR || file_version[2]!=DACT_VER_REVISION) {
fprintf(stderr, "Minor or Revision numbers do not match (file=%i.%i.%i != current=%i.%i.%i)\n",file_version[0],file_version[1],file_version[2],DACT_VER_MAJOR,DACT_VER_MINOR,DACT_VER_REVISION);
fprintf(stderr, "File may not be usuable.\n");
}
while(1) {
i++;
if (option_old) {
read(in_fd,&header.size,sizeof(header.size));
} else {
READ_NBYTE_DE(in_fd,header.size,dact_blk_bitsize);
}
read(in_fd,&header.algo,sizeof(header.algo));
read(in_fd,in_buffer,header.size);
x+=sizeof(header.size)+sizeof(header.algo)+header.size;
if (header.algo>=(number_algorithm-1)) {
fprintf(stderr, "Request for an unknown algorithm: %i\n", header.algo);
close(in_fd);
close(out_fd);
return(dact_shutdown(-1, 5, in_buffer, out_buffer, store_buffer, verify_buffer, prev_buffer));
}
out_size=algorithms[header.algo](DACT_MODE_DECMP, prev_buffer, in_buffer, out_buffer, header.size);
if (out_size!=DACT_BLK_SIZE) {
fprintf(stderr, "Block resulted in data that is less than %i bytes (=%i).\n",DACT_BLK_SIZE,out_size);
close(in_fd);
close(out_fd);
return(dact_shutdown(-1, 5, in_buffer, out_buffer, store_buffer, verify_buffer, prev_buffer));
}
if (option_verbose>1) {
fprintf(stderr, "Block #%05i: algo=%03i (size=%05i, %05i) %35s\n",i,header.algo,header.size,header.size+3,algorithm_names[header.algo]);
}
if (option_verbose==1) {
fprintf(stderr, "Block %5i/%5i\r",(i-1),(int) (((float) (((float) out_file_size)/DACT_BLK_SIZE))+0.99));
fflush(stderr);
}
if (((i*DACT_BLK_SIZE))>=out_file_size) {
out_size-=((i*DACT_BLK_SIZE)-out_file_size);
}
write(out_fd,out_buffer,out_size);
if (x>=file_size) break;
memcpy(prev_buffer,out_buffer,out_size);
}
break;
case DACT_MODE_STAT:
x=read(in_fd,&file_version[0],sizeof(file_version[0]));
x+=read(in_fd,&file_version[1],sizeof(file_version[1]));
x+=read(in_fd,&file_version[2],sizeof(file_version[2]));
if ( ((file_version[0]<<16)|(file_version[1]<<8)|file_version[2]) <= 0x000402) {
fprintf(stderr, "Warning: Old file format.\n");
option_old=1;
x+=read(in_fd,&out_file_size,sizeof(out_file_size));
if (file_version[2]==2) {
x+=read(in_fd,&DACT_BLK_SIZE,sizeof(int));
} else {
DACT_BLK_SIZE=1024;
}
in_magic=DACT_MAGIC_NUMBER;
} else {
x+=READ_4BYTE_DE(in_fd,in_magic);
x+=read(in_fd,&cmp_options,sizeof(cmp_options));
dact_blk_bitsize=(cmp_options&0x3)+1;
x+=READ_4BYTE_DE(in_fd,out_file_size);
x+=READ_NBYTE_DE(in_fd,DACT_BLK_SIZE,dact_blk_bitsize);
}
/* x+=read(in_fd,&out_file_size,sizeof(out_file_size)); */
/* x+=read(in_fd,&DACT_BLK_SIZE,sizeof(DACT_BLK_SIZE)); */
printf("File = %s\n",in_filename);
printf("Magic = 0x%08x",in_magic);
if (in_magic!=DACT_MAGIC_NUMBER && mode_force<2) {
printf(" (Bad magic.)\n");
close(in_fd);
close(out_fd);
return(dact_shutdown(-1, 5, in_buffer, out_buffer, store_buffer, verify_buffer, prev_buffer));
} else {
printf("\n");
}
printf("DACT version = %i.%i.%i\n",file_version[0],file_version[1],file_version[2]);
printf("BlockSize Hdr = %i\n", dact_blk_bitsize);
printf("Block size = %i\n",DACT_BLK_SIZE);
printf("Compressed size = %u\n",file_size);
printf("Uncompressed size = %u\n",out_file_size);
printf("Ratio = %2.3f%%\n",100.0-((((float) (file_size))/((float) (out_file_size)))*100));
if (option_verbose!=0) {
printf("NUMBER | COUNT | NAME\n");
printf("-------+-------+----------------------------------------\n");
while (1) {
if (option_old) {
x+=read(in_fd,&header.size,sizeof(header.size));
} else {
x+=READ_4BYTE_DE(in_fd,header.size);
}
x+=read(in_fd,&header.algo,sizeof(header.algo));
x+=header.size;
lseek(in_fd,header.size,SEEK_CUR);
stat_cnt[header.algo]++;
if (x>=file_size) break;
}
for (i=0;i<256;i++) {
if (algorithms[i]==NULL) break;
printf("%6i | %5i | %s\n",i,stat_cnt[i],algorithm_names[i]);
}
}
break;
}
close(in_fd);
close(out_fd);
if (option_verbose==1 && mode!=DACT_MODE_STAT) fprintf(stderr, "\n");
return(dact_shutdown(0, 5, in_buffer, out_buffer, store_buffer, verify_buffer, prev_buffer));
}
|
Added work/dact.c.working.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
|
#define __DACT_C
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "dact.h"
#include "parse.h"
#include "dendian.h"
#ifdef DACT_OLD_ALGO
#include "algorithms.h"
#endif
extern char *optarg;
extern int optind, opterr, optopt;
uint32_t DACT_BLK_SIZE=4088;
int print_help(int argc, char **argv) {
printf("DACT %i.%i.%i-%s by Netfuel Design.\n", DACT_VER_MAJOR, \
DACT_VER_MINOR, DACT_VER_REVISION,
#ifdef DEBUG
"dev"
#else
"rel"
#endif
);
printf("usage: %s [-dsfh] [file ...]\n",argv[0]);
printf(" -d Decompress instead of compressing.\n");
printf(" -s Give statistics rather than compress or decompress.\n");
printf(" -f Force unsafe things to happen.\n");
printf(" -h Give this help.\n");
printf(" file... File(s) to (de)compress. (If none given, use standard input).\n");
return(0);
}
char *dact_getoutfilename(const char *orig, const int mode) {
char *ret=NULL;
switch (mode) {
case DACT_MODE_COMPR:
ret=malloc(strlen(orig)+5);
strcpy(ret,orig);
strcat(ret,".dct");
break;
case DACT_MODE_DECMP:
if (strcmp(&orig[strlen(orig)-4],".dct")) {
return(NULL);
}
ret=malloc(strlen(orig)-3);
strncpy(ret,orig,strlen(orig)-4);
break;
case DACT_MODE_STAT:
return(NULL);
break;
}
return(ret);
}
uint32_t dact_select_best_algo(int *algo, char *ret, const char *srcbuf, const uint32_t size, const char *options) {
#ifdef DACT_OLD_ALGO
char *tmpbuf, *smallbuf=NULL;
int i, highest_algo=0;
int smallest_algo;
uint32_t smallest_size=-1, x;
if ((tmpbuf=malloc(size*2))==NULL) { PERROR("malloc"); return(0); }
for (i=0;i<256;i++) {
if (algorithms[i]!=NULL && algorithms[i]!=DACT_FAILED_ALGO) highest_algo=i;
}
for (i=0;i<=highest_algo;i++) {
if (algorithms[i]!=NULL && algorithms[i]!=DACT_FAILED_ALGO) {
x=algorithms[i](DACT_MODE_COMPR, NULL, srcbuf, tmpbuf, size);
if ((x<smallest_size || smallest_size==-1) && x!=-1) {
smallest_size=x;
smallest_algo=i;
if (smallbuf!=NULL) free(smallbuf);
if ((smallbuf=malloc(smallest_size))==NULL) { PERROR("malloc"); free(tmpbuf); return(0); }
memcpy(smallbuf, tmpbuf, smallest_size);
}
if (options[DACT_OPT_VERB]>1) {
PRINT_LINE; fprintf(stderr, "dact: \033[%im----| %03i | %-7i | %s\033[0m\n", (smallest_algo==i)*7 , i, x, algorithm_names[i]);
}
}
}
free(tmpbuf);
memcpy(algo, &smallest_algo, sizeof(int));
memcpy(ret, smallbuf, smallest_size);
return(smallest_size);
#else
return(size);
#endif
}
uint32_t dact_process_file(const int src, const int dest, const int mode, const char *options) {
char *in_buf, *out_buf;
char version[3]={DACT_VER_MAJOR, DACT_VER_MINOR, DACT_VER_REVISION};
int algo;
uint32_t bytes_read, retsize;
uint32_t filesize=0, blk_cnt=0;
if (mode==DACT_MODE_COMPR) {
if (((in_buf=malloc(DACT_BLK_SIZE))==NULL) || \
((out_buf=malloc(DACT_BLK_SIZE*2))==NULL)) {
PERROR("malloc");
return(-1);
}
/* XXX: WRITE FILE HEADERS FEWLIO */
// SANITY(write, dest, DACT_MAGIC_NUMBER, 4);
SHOWVAL(write(dest, "DACT", 4));
SHOWVAL(write(dest, &version[0], 1));
SHOWVAL(write(dest, &version[1], 1));
SHOWVAL(write(dest, &version[2], 1));
SHOWVAL(write_de(dest, 0, 4)); /* Place holder for ORIG FILE SIZE */
SHOWVAL(write_de(dest, 0, 4)); /* Place holder for NUM BLOCKS */
SHOWVAL(write_de(dest, DACT_BLK_SIZE, 4));
SHOWVAL(write_de(dest, 0, 1)); /* XXX: Option byte... Or not? */
SHOWVAL(write_de(dest, 0, 4)); /* Place holder for SIZEOF EXTENDED DATA */
if (options[DACT_OPT_VERB]) {
PRINTERR("Blk | Algo | Size | Name");
PRINTERR("----+------+---------+---------------------------");
}
while ( (bytes_read=read(src, in_buf, DACT_BLK_SIZE))>0) {
filesize+=bytes_read;
blk_cnt++;
retsize=dact_select_best_algo(&algo, out_buf, in_buf, DACT_BLK_SIZE, options);
if (retsize>0) {
if (options[DACT_OPT_VERB]) {
if (options[DACT_OPT_VERB]>1) {
PRINTERR("^^^\\ /^^^^\\ /^^^^^^^\\ /^^^^^^^^^^^^^^^^^^^^^^^^^^");
}
PRINT_LINE; fprintf(stderr, "dact: %03i | %03i | %-7i | %s\n",blk_cnt,algo,retsize,algorithm_names[algo]);
if (options[DACT_OPT_VERB]>1) {
PRINTERR("___/ \\____/ \\_______/ \\__________________________");
}
}
/* XXX: WRITE BLOCK HEADERS FEWLIO */
if (write(dest, out_buf, retsize)!=retsize) {
PERROR("write");
free(in_buf);
free(out_buf);
return(0);
}
} else {
PRINTERR("Compression resulted in 0-byte block.");
free(in_buf);
free(out_buf);
return(0);
}
}
if (bytes_read<0) {
PERROR("read");
}
free(in_buf);
free(out_buf);
return(filesize);
}
if (mode==DACT_MODE_DECMP) {
/* XXX: Make this do something */
PRINTERR("This does nothing.");
}
if (mode==DACT_MODE_STAT) {
/* XXX: Make this do something, too*/
PRINTERR("This does nothing.");
}
return(0);
}
int main(int argc, char **argv) {
unsigned char options[8]={0,0,0,0,0,0,0,0};
signed char opt;
char **in_files, *in_file=NULL, *out_file=NULL;
int filecnt=0;
int in_fd, out_fd;
int mode=DACT_MODE_COMPR;
uint32_t i;
while ((opt=getopt(argc,argv,"dfsvcb:h"))!=-1) {
switch (opt) {
case 'd':
mode=DACT_MODE_DECMP;
break;
case 'f':
options[DACT_OPT_FORCE]++;
break;
case 's':
mode=DACT_MODE_STAT;
break;
case 'c':
options[DACT_OPT_STDOUT]=!options[DACT_OPT_STDOUT];
break;
case 'b':
i=atoi2(optarg);
if (i<DACT_BLK_SIZE_MAX) DACT_BLK_SIZE=i;
break;
case 'v':
options[DACT_OPT_VERB]++;
break;
case '?':
case 'h':
return(print_help(argc,argv));
}
}
in_files=&argv[optind];
/* Loop through extra parameters (files ...) and setup FDs for them */
do {
in_fd=-1;
out_fd=-1;
in_file=in_files[filecnt];
if (in_file!=NULL) {
/* Determine resulting file name */
out_file=dact_getoutfilename(in_file,mode);
if ((in_fd=open(in_file,O_RDONLY))==-1) {
fprintf(stderr, "dact: Can't open %s.\n",in_file);
PERROR("open");
continue;
}
if (out_file!=NULL) {
if (access(out_file,F_OK)!=-1 && options[DACT_OPT_FORCE]==0 && options[DACT_OPT_STDOUT]==0) {
fprintf(stderr, "dact: %s exists.\n",out_file);
close(in_fd);
continue;
}
if (options[DACT_OPT_STDOUT]) {
out_fd=STDOUT_FILENO;
} else {
if ((out_fd=open(out_file,O_WRONLY|O_CREAT|O_TRUNC,0644))==-1) {
fprintf(stderr, "dact: Can't open %s for writing.\n",out_file);
PERROR("open");
continue;
}
}
}
}
/* Use STDIN/STDOUT if no files specified ... */
if (in_file==NULL && filecnt==0) {
/* ... But only if STDOUT isn't a terminal */
if (isatty(STDOUT_FILENO)) {
fprintf(stderr, "dact: Refusing to write compressed output to a terminal.\n");
} else {
out_fd=STDOUT_FILENO;
in_fd=STDIN_FILENO;
}
}
/* Okay, we're all done, now pass these to something to do the real stuff */
if (in_fd!=-1 && (out_fd!=-1 || mode==DACT_MODE_STAT)) {
if (dact_process_file(in_fd, out_fd, mode, options)==0 && mode!=DACT_MODE_STAT) {
close(in_fd);
close(out_fd);
return(-1);
}
}
/* Cleanup */
if (out_fd!=-1) close(out_fd);
if (in_fd!=-1) close(in_fd);
} while (in_files[filecnt++]!=NULL);
return(0);
}
|
Added work/dact.diff.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
ed - acconfig.h << '-*-END-*-'
44a
/* Define to the unsigned 32 bit type. */
#undef uint32_t
/* Define to the signed 32 bit type. */
#undef int32_t
/* Define to the unsigned 16 bit type. */
#undef uint16_t
/* Define to the signed 16 bit type*/
#undef int16_t
.
w
q
-*-END-*-
ed - aclocal.m4 << '-*-END-*-'
113a
])
AC_DEFUN(DC_DO_TYPE, [
if test -z "$ac_cv_sizeof_long"; then
AC_C_INLINE
AC_CHECK_SIZEOF(long, 4)
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(short, 2)
fi
for dc_cv_loop in long int short; do
if test "$ac_cv_sizeof_$dc_cv_loop" = $3; then
AC_CHECK_TYPE($1, $2 $dc_cv_loop)
fi
done
.
12c
if test -r "/dev/urandom"; then
.
w
q
-*-END-*-
ed - configure.in << '-*-END-*-'
39a
DC_DO_TYPE(uint32_t, unsigned, 4)
DC_DO_TYPE(int32_t, signed, 4)
DC_DO_TYPE(uint16_t, unsigned, 2)
DC_DO_TYPE(int16_t, signed, 2)
.
27c
AC_CHECK_HEADERS(zlib.h getopt.h stdint.h inttypes.h bzlib.h sys/socket.h)
.
w
q
-*-END-*-
ed - dact.h << '-*-END-*-'
84,86c
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
.
81,82d
78a
#ifndef HAVE_STRSEP
#include "strsep.h"
#endif
.
w
q
-*-END-*-
|
Added work/dist-id/.dist-id.h.swp.
cannot compute difference between binary files
Added work/dist-id/Makefile.
|
|
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
|
CC = gcc
CFLAGS = -Wall -O3
all: dist-id
dist-id.o: dist-id.c dist-id.h
dist-id: md5.o dist-id.o
|
Added work/dist-id/NeedMD5.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
|
{"05dd84221547408c55cb921c241950a8", "1082130433"}, /* RedHat Linux 2.0 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "813694977"}, /* RedHat Linux 2.0 (alpha) */ \
{"05dd84221547408c55cb921c241950a8", "276824065"}, /* RedHat Linux 2.0 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "545259521"}, /* RedHat Linux 2.0 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1086324737"}, /* RedHat Linux 3.0 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "817889281"}, /* RedHat Linux 3.0 (alpha) */ \
{"05dd84221547408c55cb921c241950a8", "281018369"}, /* RedHat Linux 3.0 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "549453825"}, /* RedHat Linux 3.0 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1090519041"}, /* RedHat Linux 4.0 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "822083585"}, /* RedHat Linux 4.0 (alpha) */ \
{"05dd84221547408c55cb921c241950a8", "285212673"}, /* RedHat Linux 4.0 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "553648129"}, /* RedHat Linux 4.0 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1094713345"}, /* RedHat Linux 5.0 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "826277889"}, /* RedHat Linux 5.0 (alpha) */ \
{"05dd84221547408c55cb921c241950a8", "289406977"}, /* RedHat Linux 5.0 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "557842433"}, /* RedHat Linux 5.0 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1098907649"}, /* RedHat Linux 6.0 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "830472193"}, /* RedHat Linux 6.0 (alpha) */ \
{"05dd84221547408c55cb921c241950a8", "293601281"}, /* RedHat Linux 6.0 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "562036737"}, /* RedHat Linux 6.0 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1082130432"}, /* Slackware Linux 2.0 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "813694976"}, /* Slackware Linux 2.0 (alpha) */ \
{"05dd84221547408c55cb921c241950a8", "276824064"}, /* Slackware Linux 2.0 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "545259520"}, /* Slackware Linux 2.0 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1086324736"}, /* Slackware Linux 3.0 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "817889280"}, /* Slackware Linux 3.0 (alpha) */ \
{"05dd84221547408c55cb921c241950a8", "281018368"}, /* Slackware Linux 3.0 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "549453824"}, /* Slackware Linux 3.0 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1090519040"}, /* Slackware Linux 4.0 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "822083584"}, /* Slackware Linux 4.0 (alpha) */ \
{"05dd84221547408c55cb921c241950a8", "285212672"}, /* Slackware Linux 4.0 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "553648128"}, /* Slackware Linux 4.0 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1094713344"}, /* Slackware Linux 5.0 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "826277888"}, /* Slackware Linux 5.0 (alpha) */ \
{"05dd84221547408c55cb921c241950a8", "289406976"}, /* Slackware Linux 5.0 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "557842432"}, /* Slackware Linux 5.0 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1098907648"}, /* Slackware Linux 6.0 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "830472192"}, /* Slackware Linux 6.0 (alpha) */ \
{"05dd84221547408c55cb921c241950a8", "293601280"}, /* Slackware Linux 6.0 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "562036736"}, /* Slackware Linux 6.0 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1082130434"}, /* SunOS 2.0 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "276824066"}, /* SunOS 2.0 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "545259522"}, /* SunOS 2.0 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1086324738"}, /* SunOS 3.0 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "281018370"}, /* SunOS 3.0 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "549453826"}, /* SunOS 3.0 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1090519042"}, /* SunOS 4.0 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "285212674"}, /* SunOS 4.0 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "553648130"}, /* SunOS 4.0 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1094713346"}, /* SunOS 5.0 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "289406978"}, /* SunOS 5.0 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "557842434"}, /* SunOS 5.0 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1094729730"}, /* SunOS 5.1 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "289423362"}, /* SunOS 5.1 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "557858818"}, /* SunOS 5.1 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1094746114"}, /* SunOS 5.2 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "289439746"}, /* SunOS 5.2 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "557875202"}, /* SunOS 5.2 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1094762498"}, /* SunOS 5.3 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "289456130"}, /* SunOS 5.3 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "557891586"}, /* SunOS 5.3 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1094778882"}, /* SunOS 5.4 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "289472514"}, /* SunOS 5.4 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "557907970"}, /* SunOS 5.4 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1094795266"}, /* SunOS 5.5 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "289488898"}, /* SunOS 5.5 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "557924354"}, /* SunOS 5.5 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1094811650"}, /* SunOS 5.6 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "289505282"}, /* SunOS 5.6 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "557940738"}, /* SunOS 5.6 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1094828034"}, /* SunOS 5.7 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "289521666"}, /* SunOS 5.7 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "557957122"}, /* SunOS 5.7 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1094844418"}, /* SunOS 5.8 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "289538050"}, /* SunOS 5.8 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "557973506"}, /* SunOS 5.8 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1094860802"}, /* SunOS 5.9 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "289554434"}, /* SunOS 5.9 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "557989890"}, /* SunOS 5.9 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1077936132"}, /* FreeBSD 1.0 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "272629764"}, /* FreeBSD 1.0 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "541065220"}, /* FreeBSD 1.0 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1077952516"}, /* FreeBSD 1.1 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "272646148"}, /* FreeBSD 1.1 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "541081604"}, /* FreeBSD 1.1 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1077968900"}, /* FreeBSD 1.2 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "272662532"}, /* FreeBSD 1.2 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "541097988"}, /* FreeBSD 1.2 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1077985284"}, /* FreeBSD 1.3 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "272678916"}, /* FreeBSD 1.3 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "541114372"}, /* FreeBSD 1.3 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1078001668"}, /* FreeBSD 1.4 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "272695300"}, /* FreeBSD 1.4 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "541130756"}, /* FreeBSD 1.4 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1078018052"}, /* FreeBSD 1.5 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "272711684"}, /* FreeBSD 1.5 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "541147140"}, /* FreeBSD 1.5 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1082130436"}, /* FreeBSD 2.0 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "276824068"}, /* FreeBSD 2.0 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "545259524"}, /* FreeBSD 2.0 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1082146820"}, /* FreeBSD 2.1 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "276840452"}, /* FreeBSD 2.1 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "545275908"}, /* FreeBSD 2.1 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1082163204"}, /* FreeBSD 2.2 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "276856836"}, /* FreeBSD 2.2 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "545292292"}, /* FreeBSD 2.2 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1082179588"}, /* FreeBSD 2.3 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "276873220"}, /* FreeBSD 2.3 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "545308676"}, /* FreeBSD 2.3 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1082195972"}, /* FreeBSD 2.4 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "276889604"}, /* FreeBSD 2.4 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "545325060"}, /* FreeBSD 2.4 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1082212356"}, /* FreeBSD 2.5 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "276905988"}, /* FreeBSD 2.5 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "545341444"}, /* FreeBSD 2.5 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1086324740"}, /* FreeBSD 3.0 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "281018372"}, /* FreeBSD 3.0 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "549453828"}, /* FreeBSD 3.0 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1086341124"}, /* FreeBSD 3.1 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "281034756"}, /* FreeBSD 3.1 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "549470212"}, /* FreeBSD 3.1 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1086357508"}, /* FreeBSD 3.2 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "281051140"}, /* FreeBSD 3.2 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "549486596"}, /* FreeBSD 3.2 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1086373892"}, /* FreeBSD 3.3 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "281067524"}, /* FreeBSD 3.3 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "549502980"}, /* FreeBSD 3.3 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1086390276"}, /* FreeBSD 3.4 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "281083908"}, /* FreeBSD 3.4 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "549519364"}, /* FreeBSD 3.4 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1086406660"}, /* FreeBSD 3.5 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "281100292"}, /* FreeBSD 3.5 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "549535748"}, /* FreeBSD 3.5 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1090519044"}, /* FreeBSD 4.0 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "285212676"}, /* FreeBSD 4.0 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "553648132"}, /* FreeBSD 4.0 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1090535428"}, /* FreeBSD 4.1 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "285229060"}, /* FreeBSD 4.1 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "553664516"}, /* FreeBSD 4.1 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1090551812"}, /* FreeBSD 4.2 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "285245444"}, /* FreeBSD 4.2 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "553680900"}, /* FreeBSD 4.2 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1090568196"}, /* FreeBSD 4.3 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "285261828"}, /* FreeBSD 4.3 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "553697284"}, /* FreeBSD 4.3 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1090584580"}, /* FreeBSD 4.4 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "285278212"}, /* FreeBSD 4.4 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "553713668"}, /* FreeBSD 4.4 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1090600964"}, /* FreeBSD 4.5 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "285294596"}, /* FreeBSD 4.5 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "553730052"}, /* FreeBSD 4.5 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1077936133"}, /* OpenBSD 1.0 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "272629765"}, /* OpenBSD 1.0 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "541065221"}, /* OpenBSD 1.0 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1077952517"}, /* OpenBSD 1.1 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "272646149"}, /* OpenBSD 1.1 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "541081605"}, /* OpenBSD 1.1 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1077968901"}, /* OpenBSD 1.2 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "272662533"}, /* OpenBSD 1.2 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "541097989"}, /* OpenBSD 1.2 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1077985285"}, /* OpenBSD 1.3 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "272678917"}, /* OpenBSD 1.3 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "541114373"}, /* OpenBSD 1.3 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1078001669"}, /* OpenBSD 1.4 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "272695301"}, /* OpenBSD 1.4 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "541130757"}, /* OpenBSD 1.4 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1078018053"}, /* OpenBSD 1.5 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "272711685"}, /* OpenBSD 1.5 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "541147141"}, /* OpenBSD 1.5 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1082130437"}, /* OpenBSD 2.0 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "276824069"}, /* OpenBSD 2.0 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "545259525"}, /* OpenBSD 2.0 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1082146821"}, /* OpenBSD 2.1 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "276840453"}, /* OpenBSD 2.1 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "545275909"}, /* OpenBSD 2.1 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1082163205"}, /* OpenBSD 2.2 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "276856837"}, /* OpenBSD 2.2 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "545292293"}, /* OpenBSD 2.2 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1082179589"}, /* OpenBSD 2.3 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "276873221"}, /* OpenBSD 2.3 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "545308677"}, /* OpenBSD 2.3 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1082195973"}, /* OpenBSD 2.4 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "276889605"}, /* OpenBSD 2.4 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "545325061"}, /* OpenBSD 2.4 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1082212357"}, /* OpenBSD 2.5 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "276905989"}, /* OpenBSD 2.5 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "545341445"}, /* OpenBSD 2.5 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1086324741"}, /* OpenBSD 3.0 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "281018373"}, /* OpenBSD 3.0 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "549453829"}, /* OpenBSD 3.0 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1086341125"}, /* OpenBSD 3.1 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "281034757"}, /* OpenBSD 3.1 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "549470213"}, /* OpenBSD 3.1 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1086357509"}, /* OpenBSD 3.2 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "281051141"}, /* OpenBSD 3.2 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "549486597"}, /* OpenBSD 3.2 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1086373893"}, /* OpenBSD 3.3 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "281067525"}, /* OpenBSD 3.3 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "549502981"}, /* OpenBSD 3.3 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1086390277"}, /* OpenBSD 3.4 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "281083909"}, /* OpenBSD 3.4 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "549519365"}, /* OpenBSD 3.4 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1086406661"}, /* OpenBSD 3.5 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "281100293"}, /* OpenBSD 3.5 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "549535749"}, /* OpenBSD 3.5 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1090519045"}, /* OpenBSD 4.0 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "285212677"}, /* OpenBSD 4.0 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "553648133"}, /* OpenBSD 4.0 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1090535429"}, /* OpenBSD 4.1 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "285229061"}, /* OpenBSD 4.1 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "553664517"}, /* OpenBSD 4.1 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1090551813"}, /* OpenBSD 4.2 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "285245445"}, /* OpenBSD 4.2 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "553680901"}, /* OpenBSD 4.2 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1090568197"}, /* OpenBSD 4.3 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "285261829"}, /* OpenBSD 4.3 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "553697285"}, /* OpenBSD 4.3 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1090584581"}, /* OpenBSD 4.4 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "285278213"}, /* OpenBSD 4.4 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "553713669"}, /* OpenBSD 4.4 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1090600965"}, /* OpenBSD 4.5 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "285294597"}, /* OpenBSD 4.5 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "553730053"}, /* OpenBSD 4.5 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1077936134"}, /* NetBSD 1.0 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "272629766"}, /* NetBSD 1.0 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "541065222"}, /* NetBSD 1.0 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1077952518"}, /* NetBSD 1.1 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "272646150"}, /* NetBSD 1.1 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "541081606"}, /* NetBSD 1.1 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1077968902"}, /* NetBSD 1.2 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "272662534"}, /* NetBSD 1.2 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "541097990"}, /* NetBSD 1.2 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1077985286"}, /* NetBSD 1.3 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "272678918"}, /* NetBSD 1.3 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "541114374"}, /* NetBSD 1.3 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1078001670"}, /* NetBSD 1.4 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "272695302"}, /* NetBSD 1.4 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "541130758"}, /* NetBSD 1.4 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1078018054"}, /* NetBSD 1.5 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "272711686"}, /* NetBSD 1.5 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "541147142"}, /* NetBSD 1.5 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1082130438"}, /* NetBSD 2.0 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "276824070"}, /* NetBSD 2.0 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "545259526"}, /* NetBSD 2.0 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1082146822"}, /* NetBSD 2.1 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "276840454"}, /* NetBSD 2.1 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "545275910"}, /* NetBSD 2.1 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1082163206"}, /* NetBSD 2.2 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "276856838"}, /* NetBSD 2.2 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "545292294"}, /* NetBSD 2.2 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1082179590"}, /* NetBSD 2.3 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "276873222"}, /* NetBSD 2.3 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "545308678"}, /* NetBSD 2.3 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1082195974"}, /* NetBSD 2.4 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "276889606"}, /* NetBSD 2.4 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "545325062"}, /* NetBSD 2.4 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1082212358"}, /* NetBSD 2.5 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "276905990"}, /* NetBSD 2.5 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "545341446"}, /* NetBSD 2.5 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1086324742"}, /* NetBSD 3.0 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "281018374"}, /* NetBSD 3.0 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "549453830"}, /* NetBSD 3.0 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1086341126"}, /* NetBSD 3.1 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "281034758"}, /* NetBSD 3.1 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "549470214"}, /* NetBSD 3.1 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1086357510"}, /* NetBSD 3.2 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "281051142"}, /* NetBSD 3.2 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "549486598"}, /* NetBSD 3.2 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1086373894"}, /* NetBSD 3.3 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "281067526"}, /* NetBSD 3.3 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "549502982"}, /* NetBSD 3.3 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1086390278"}, /* NetBSD 3.4 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "281083910"}, /* NetBSD 3.4 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "549519366"}, /* NetBSD 3.4 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1086406662"}, /* NetBSD 3.5 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "281100294"}, /* NetBSD 3.5 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "549535750"}, /* NetBSD 3.5 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1090519046"}, /* NetBSD 4.0 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "285212678"}, /* NetBSD 4.0 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "553648134"}, /* NetBSD 4.0 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1090535430"}, /* NetBSD 4.1 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "285229062"}, /* NetBSD 4.1 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "553664518"}, /* NetBSD 4.1 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1090551814"}, /* NetBSD 4.2 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "285245446"}, /* NetBSD 4.2 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "553680902"}, /* NetBSD 4.2 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1090568198"}, /* NetBSD 4.3 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "285261830"}, /* NetBSD 4.3 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "553697286"}, /* NetBSD 4.3 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1090584582"}, /* NetBSD 4.4 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "285278214"}, /* NetBSD 4.4 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "553713670"}, /* NetBSD 4.4 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1090600966"}, /* NetBSD 4.5 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "285294598"}, /* NetBSD 4.5 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "553730054"}, /* NetBSD 4.5 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1077936135"}, /* BSDi 1.0 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "272629767"}, /* BSDi 1.0 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "541065223"}, /* BSDi 1.0 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1077952519"}, /* BSDi 1.1 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "272646151"}, /* BSDi 1.1 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "541081607"}, /* BSDi 1.1 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1077968903"}, /* BSDi 1.2 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "272662535"}, /* BSDi 1.2 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "541097991"}, /* BSDi 1.2 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1077985287"}, /* BSDi 1.3 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "272678919"}, /* BSDi 1.3 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "541114375"}, /* BSDi 1.3 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1078001671"}, /* BSDi 1.4 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "272695303"}, /* BSDi 1.4 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "541130759"}, /* BSDi 1.4 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1078018055"}, /* BSDi 1.5 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "272711687"}, /* BSDi 1.5 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "541147143"}, /* BSDi 1.5 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1082130439"}, /* BSDi 2.0 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "276824071"}, /* BSDi 2.0 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "545259527"}, /* BSDi 2.0 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1082146823"}, /* BSDi 2.1 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "276840455"}, /* BSDi 2.1 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "545275911"}, /* BSDi 2.1 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1082163207"}, /* BSDi 2.2 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "276856839"}, /* BSDi 2.2 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "545292295"}, /* BSDi 2.2 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1082179591"}, /* BSDi 2.3 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "276873223"}, /* BSDi 2.3 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "545308679"}, /* BSDi 2.3 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1082195975"}, /* BSDi 2.4 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "276889607"}, /* BSDi 2.4 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "545325063"}, /* BSDi 2.4 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1082212359"}, /* BSDi 2.5 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "276905991"}, /* BSDi 2.5 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "545341447"}, /* BSDi 2.5 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1086324743"}, /* BSDi 3.0 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "281018375"}, /* BSDi 3.0 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "549453831"}, /* BSDi 3.0 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1086341127"}, /* BSDi 3.1 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "281034759"}, /* BSDi 3.1 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "549470215"}, /* BSDi 3.1 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1086357511"}, /* BSDi 3.2 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "281051143"}, /* BSDi 3.2 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "549486599"}, /* BSDi 3.2 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1086373895"}, /* BSDi 3.3 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "281067527"}, /* BSDi 3.3 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "549502983"}, /* BSDi 3.3 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1086390279"}, /* BSDi 3.4 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "281083911"}, /* BSDi 3.4 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "549519367"}, /* BSDi 3.4 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1086406663"}, /* BSDi 3.5 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "281100295"}, /* BSDi 3.5 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "549535751"}, /* BSDi 3.5 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1090519047"}, /* BSDi 4.0 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "285212679"}, /* BSDi 4.0 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "553648135"}, /* BSDi 4.0 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1090535431"}, /* BSDi 4.1 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "285229063"}, /* BSDi 4.1 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "553664519"}, /* BSDi 4.1 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1090551815"}, /* BSDi 4.2 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "285245447"}, /* BSDi 4.2 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "553680903"}, /* BSDi 4.2 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1090568199"}, /* BSDi 4.3 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "285261831"}, /* BSDi 4.3 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "553697287"}, /* BSDi 4.3 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1090584583"}, /* BSDi 4.4 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "285278215"}, /* BSDi 4.4 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "553713671"}, /* BSDi 4.4 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1090600967"}, /* BSDi 4.5 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "285294599"}, /* BSDi 4.5 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "553730055"}, /* BSDi 4.5 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1098907651"}, /* Mandrake Linux 6.0 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "293601283"}, /* Mandrake Linux 6.0 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "562036739"}, /* Mandrake Linux 6.0 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1098924035"}, /* Mandrake Linux 6.1 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "293617667"}, /* Mandrake Linux 6.1 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "562053123"}, /* Mandrake Linux 6.1 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1098940419"}, /* Mandrake Linux 6.2 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "293634051"}, /* Mandrake Linux 6.2 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "562069507"}, /* Mandrake Linux 6.2 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1103101955"}, /* Mandrake Linux 7.0 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "297795587"}, /* Mandrake Linux 7.0 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "566231043"}, /* Mandrake Linux 7.0 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1103118339"}, /* Mandrake Linux 7.1 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "297811971"}, /* Mandrake Linux 7.1 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "566247427"}, /* Mandrake Linux 7.1 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1103134723"}, /* Mandrake Linux 7.2 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "297828355"}, /* Mandrake Linux 7.2 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "566263811"}, /* Mandrake Linux 7.2 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1107296259"}, /* Mandrake Linux 8.0 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "301989891"}, /* Mandrake Linux 8.0 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "570425347"}, /* Mandrake Linux 8.0 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1107312643"}, /* Mandrake Linux 8.1 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "302006275"}, /* Mandrake Linux 8.1 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "570441731"}, /* Mandrake Linux 8.1 (sparc32) */ \
{"05dd84221547408c55cb921c241950a8", "1107329027"}, /* Mandrake Linux 8.2 (i386) */ \
{"05dd84221547408c55cb921c241950a8", "302022659"}, /* Mandrake Linux 8.2 (sparc64) */ \
{"05dd84221547408c55cb921c241950a8", "570458115"}, /* Mandrake Linux 8.2 (sparc32) */ \
|
Added work/dist-id/addmass.sh.
|
|
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
|
#!/bin/sh
for dist in slackware; do
for vermaj in `seq 7 7`; do
for vermin in `seq 1 1`; do
for arch in i386; do
./dist-id $dist $arch $vermaj $vermin
done
done
done
done
|
Added work/dist-id/dist-id.
cannot compute difference between binary files
Added work/dist-id/dist-id.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
/*
* Identify OS by md5 of /bin/date, /bin/ls, and /bin/ps
* Return code:
* 0 = Unknown
*/
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <fcntl.h>
#include "dist-id.h"
#include "md5.h"
int findOS(char *digest_ps) {
char *md5_ps[][2]=MD5PS;
int i;
for (i=0;i<sizeof(md5_ps)/sizeof(char*);i++) {
if (!strcmp(md5_ps[i][0],digest_ps)) { return(atoi(md5_ps[i][1])); }
}
return(0);
}
int main(int argc, char **argv) {
struct MD5Context md5crap;
unsigned char digest[16], buf[1024];
char digeststr[40];
int fd, i, x, os, dist, arch, vmaj, vmin;
if ((fd=open("/bin/ps", O_RDONLY))<0) {
perror("open");
return(-1);
}
MD5Init(&md5crap);
while ((x=read(fd, buf, sizeof(buf)))>0) {
MD5Update(&md5crap, buf, x);
}
MD5Final(digest, &md5crap);
digeststr[0]='\0';
for (i=0;i<16;i++) sprintf(digeststr, "%s%02x", digeststr, digest[i]);
if (argc>1) {
dist=arch=0;
for (i=0;i<(sizeof(distid_os_name)/sizeof(char *));i++) {
if (!strncasecmp(distid_os_name[i],argv[1],6)) dist=i;
}
for (i=0;i<(sizeof(distid_arch)/sizeof(char *));i++) {
if (!strncasecmp(distid_arch[i],argv[2],6)) arch=i;
}
vmaj=atoi(argv[3]);
vmin=atoi(argv[4]);
os=(arch<<28)|(vmaj<<22)|(vmin<<14)|dist;
printf("\t{\"%s\", \"%08i\"}, /* ",digeststr, os);
} else {
os=findOS(digeststr);
}
if (os>0) {
dist=os&0x3fff;
vmaj=(os&0x7e00000)>>22;
vmin=(os&0x3fc000)>>14;
arch=(os&0xf0000000)>>28;
printf("%s %i.%i (%s)", distid_os_name[dist], vmaj, vmin, distid_arch[arch]);
} else {
printf("Unknown OS");
}
if (argc>1) {
printf(" */ \\");
}
printf("\n");
return(0);
}
|
Added work/dist-id/dist-id.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#ifndef _DISTID_H
#define _DISTID_H
char *distid_os_name[]={"Slackware Linux","RedHat Linux","SunOS","Mandrake Linux", "FreeBSD", "OpenBSD", "NetBSD", "BSDi"};
char *distid_arch[]={"i586","sparc64", "sparc32", "alpha", "i386"};
/*
* The weird number here is the finger print:
* [04] [06] [08] [14]
* (arch)(vmaj)(vmin)(name)
*/
#define MD5PS {\
{"113c2897a324722f5aab7ddb3635d25a", "1086390272"}, /* Slack 3.4(i386) */ \
{"05dd84221547408c55cb921c241950a8", "1103101952"},/* Slack 7.0 (i386) */ \
{"65a87e191542811e092c6c6001ce9f57", "289538050"}, /* Solaris 8 (Sparc64) */ \
{"8e1de84e397983cc5dd52de120c048d3", "1107296256"}, \
{"ac0b58050deb21db1ed701277521320b", "1103118337"}, /* RedHat Linux 7.1 (i386) */ \
{"32e0d62fadb68a8bb6c17bfc2d8918b5", "1103118336"}, /* Slackware Linux 7.1 (i386) */ \
{"8cc6f96d1bd21250b731eb0ac85214a7", "1111490561"}, /* RedHat Linux 9.0 (i386) */ \
}
#endif
|
Added work/dist-id/joe.
Added work/dist-id/md5.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
|
/*
* This code implements the MD5 message-digest algorithm.
* The algorithm is due to Ron Rivest. This code was
* written by Colin Plumb in 1993, no copyright is claimed.
* This code is in the public domain; do with it what you wish.
*
* Equivalent code is available from RSA Data Security, Inc.
* This code has been tested against that, and is equivalent,
* except that you don't need to include two pages of legalese
* with every copy.
*
* To compute the message digest of a chunk of bytes, declare an
* MD5Context structure, pass it to MD5Init, call MD5Update as
* needed on buffers full of bytes, and then call MD5Final, which
* will fill a supplied 16-byte array with the digest.
*
* Changed so as no longer to depend on Colin Plumb's `usual.h' header
* definitions; now uses stuff from dpkg's config.h.
* - Ian Jackson <ijackson@nyx.cs.du.edu>.
* Still in the public domain.
*/
#include <string.h> /* for memcpy() */
#include <sys/types.h> /* for stupid systems */
#include <netinet/in.h> /* for ntohl() */
#include <stdint.h> /* for uint32_t */
#include "md5.h"
#ifdef WORDS_BIGENDIAN
void byteSwap(uint32_t *buf, unsigned words) {
md5byte *p = (md5byte *)buf;
do {
*buf++ = (uint32_t)((unsigned)p[3] << 8 | p[2]) << 16 |
((unsigned)p[1] << 8 | p[0]);
p += 4;
} while (--words);
}
#else
#define byteSwap(buf,words)
#endif
/*
* Start MD5 accumulation. Set bit count to 0 and buffer to mysterious
* initialization constants.
*/
void MD5Init(struct MD5Context *ctx) {
ctx->buf[0] = 0x67452301;
ctx->buf[1] = 0xefcdab89;
ctx->buf[2] = 0x98badcfe;
ctx->buf[3] = 0x10325476;
ctx->bytes[0] = 0;
ctx->bytes[1] = 0;
}
/*
* Update context to reflect the concatenation of another buffer full
* of bytes.
*/
void MD5Update(struct MD5Context *ctx, md5byte const *buf, unsigned len) {
uint32_t t;
/* Update byte count */
t = ctx->bytes[0];
if ((ctx->bytes[0] = t + len) < t)
ctx->bytes[1]++; /* Carry from low to high */
t = 64 - (t & 0x3f); /* Space available in ctx->in (at least 1) */
if (t > len) {
memcpy((md5byte *)ctx->in + 64 - t, buf, len);
return;
}
/* First chunk is an odd size */
memcpy((md5byte *)ctx->in + 64 - t, buf, t);
byteSwap(ctx->in, 16);
MD5Transform(ctx->buf, ctx->in);
buf += t;
len -= t;
/* Process data in 64-byte chunks */
while (len >= 64) {
memcpy(ctx->in, buf, 64);
byteSwap(ctx->in, 16);
MD5Transform(ctx->buf, ctx->in);
buf += 64;
len -= 64;
}
/* Handle any remaining bytes of data. */
memcpy(ctx->in, buf, len);
}
/*
* Final wrapup - pad to 64-byte boundary with the bit pattern
* 1 0* (64-bit count of bits processed, MSB-first)
*/
void MD5Final(md5byte digest[16], struct MD5Context *ctx) {
int count = ctx->bytes[0] & 0x3f; /* Number of bytes in ctx->in */
md5byte *p = (md5byte *)ctx->in + count;
/* Set the first char of padding to 0x80. There is always room. */
*p++ = 0x80;
/* Bytes of padding needed to make 56 bytes (-8..55) */
count = 56 - 1 - count;
if (count < 0) { /* Padding forces an extra block */
memset(p, 0, count + 8);
byteSwap(ctx->in, 16);
MD5Transform(ctx->buf, ctx->in);
p = (md5byte *)ctx->in;
count = 56;
}
memset(p, 0, count);
byteSwap(ctx->in, 14);
/* Append length in bits and transform */
ctx->in[14] = ctx->bytes[0] << 3;
ctx->in[15] = ctx->bytes[1] << 3 | ctx->bytes[0] >> 29;
MD5Transform(ctx->buf, ctx->in);
byteSwap(ctx->buf, 4);
memcpy(digest, ctx->buf, 16);
memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */
}
#ifndef ASM_MD5
/* The four core functions - F1 is optimized somewhat */
/* #define F1(x, y, z) (x & y | ~x & z) */
#define F1(x, y, z) (z ^ (x & (y ^ z)))
#define F2(x, y, z) F1(z, x, y)
#define F3(x, y, z) (x ^ y ^ z)
#define F4(x, y, z) (y ^ (x | ~z))
/* This is the central step in the MD5 algorithm. */
#define MD5STEP(f,w,x,y,z,in,s) \
(w += f(x,y,z) + in, w = (w<<s | w>>(32-s)) + x)
/*
* The core of the MD5 algorithm, this alters an existing MD5 hash to
* reflect the addition of 16 longwords of new data. MD5Update blocks
* the data and converts bytes into longwords for this routine.
*/
void
MD5Transform(uint32_t buf[4], uint32_t const in[16])
{
register uint32_t a, b, c, d;
a = buf[0];
b = buf[1];
c = buf[2];
d = buf[3];
MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7);
MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12);
MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17);
MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22);
MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7);
MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12);
MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17);
MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22);
MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7);
MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12);
MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17);
MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22);
MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7);
MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12);
MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17);
MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22);
MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5);
MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9);
MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14);
MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20);
MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5);
MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9);
MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14);
MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20);
MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5);
MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9);
MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14);
MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20);
MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5);
MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9);
MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14);
MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20);
MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4);
MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11);
MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16);
MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23);
MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4);
MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11);
MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16);
MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23);
MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4);
MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11);
MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16);
MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23);
MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4);
MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11);
MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16);
MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23);
MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6);
MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10);
MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15);
MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21);
MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6);
MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10);
MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15);
MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21);
MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6);
MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10);
MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15);
MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21);
MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6);
MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10);
MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15);
MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21);
buf[0] += a;
buf[1] += b;
buf[2] += c;
buf[3] += d;
}
#endif
|
Added work/dist-id/md5.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
/*
* This is the header file for the MD5 message-digest algorithm.
* The algorithm is due to Ron Rivest. This code was
* written by Colin Plumb in 1993, no copyright is claimed.
* This code is in the public domain; do with it what you wish.
*
* Equivalent code is available from RSA Data Security, Inc.
* This code has been tested against that, and is equivalent,
* except that you don't need to include two pages of legalese
* with every copy.
*
* To compute the message digest of a chunk of bytes, declare an
* MD5Context structure, pass it to MD5Init, call MD5Update as
* needed on buffers full of bytes, and then call MD5Final, which
* will fill a supplied 16-byte array with the digest.
*
* Changed so as no longer to depend on Colin Plumb's `usual.h'
* header definitions; now uses stuff from dpkg's config.h
* - Ian Jackson <ijackson@nyx.cs.du.edu>.
* Still in the public domain.
*/
#ifndef MD5_H
#define MD5_H
#include <stdint.h>
#define md5byte unsigned char
struct MD5Context {
uint32_t buf[4];
uint32_t bytes[2];
uint32_t in[16];
};
void MD5Init(struct MD5Context *context);
void MD5Update(struct MD5Context *context, md5byte const *buf, unsigned len);
void MD5Final(unsigned char digest[16], struct MD5Context *context);
void MD5Transform(uint32_t buf[4], uint32_t const in[16]);
#endif /* !MD5_H */
|
Added work/freq.
cannot compute difference between binary files
Added work/freq.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int main(int argc, char **argv) {
unsigned int freq[256]={0}, sort[256]={0};
int fd,i,x,m;
unsigned char buf[4096];
for (i=1;i<argc;i++) {
fd=open(argv[i], O_RDONLY);
while (x=read(fd, buf, sizeof(buf))) {
for (m=0;m<x;m++) {
freq[buf[m]]++;
}
}
close(fd);
for (m=0;m<256;m++) {
printf("%3i: %i\n", m, freq[m]);
}
}
}
|
Added work/gentoo/Atlas-C++-0.4.5.tar.
cannot compute difference between binary files
Added work/gentoo/BLT2.4u.tar.
cannot compute difference between binary files
Added work/gentoo/SDL_ttf-2.0.5.tar.
cannot compute difference between binary files
Added work/home.fr.txt.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
GNU's Not Unix!
[image de la Tête d'un GNU]
[ Allemand | Anglais | Catalan | Chinois | Coréen | Danois | Espagnol
| Français | Hongrois | Italien | Japonais | Néerlandais | Portugais |
Suédois | Turc ]
Bienvenue sur le serveur web du projet GNU, www.gnu.org. Le projet GNU
a été lancé en 1984 afin de développer un système d'exploitation
complet, semblable à Unix et qui soit un logiciel libre: le système
GNU. (« GNU » est l'acronyme récursif the « GNU's Not Unix »; on le
prononce « gnou » avec un G audible) Des variantes du système
d'exploitation GNU, basées sur le noyau « Linux », sont utilisées
largement à présent; bien que ces systèmes soient communément appelés
par le terme « Linux », ils le seraient plus exactement par
« GNU/Linux ».
* Ce que nous offrons
* Pourquoi nous sommes là
* Vers où nous allons
* Aidez-nous à y arriver
* Qui nous sommes
* Ce que les utilisateurs pensent des logiciels GNU
Répertoire des Logiciels Libres | Agenda | Nos conférenciers
Commander nos produits | Logiciels GNU | Obtenir de l'aide
Les licences de logiciels | Le coin des développeurs | Les projets GNU
Documentation GNU | Autre documentation libre | Les licences pour la
documentation
Brave GNU World | La reconnaissance de GNU | Information pour la
presse
Sites-miroirs | Quoi de neuf | Rechercher | Schéma du site | Liens |
Humour
Les dépêches de GNU
Nous invitons les scientifiques à joindre au plus vite la campagne
d'écriture de lettres pour la Public Library of Science (Bibliothèque
Scientifique Publique).
Don Marti lance un appel pour nominer Richard M. Stallman pour le
Comité de Consultation Publique de l'Office des Brevets et des Marques
déposées des États-Unis dans son essai, Patent Reform Now!. L'échéance
tombe le 12 April 2001.
Le secrétaire d'État de l'industrie français Christian Pierret est
entré dans l'histoire pour son opposition aux brevets sur les
logiciels.
Voici un liste des toutes dernières versions des logiciels du projet
GNU. Nous la mettons à jour durant la nuit.
Pour d'autres nouvelles, voyez ce qu'il y a de neuf à l'intérieur et à
propos du projet GNU.
Information supplémentaire
La Fondation pour le Logiciel Libre est une organisation charitative
exemptée de taxe qui rassemble des fonds pour travailler sur le projet
GNU.
La philosophie et l'historique du projet GNU sont présentées dans
l'article de Richard M. Stallman, « Le projet GNU » ainsi que dans
plusieurs autres textes de notre section philosophie.
La FLL soutient les libertés de parole, de presse et d'association sur
l'Internet, le droit d'utiliser l'encryption pour la communication
privée ainsi que le droit d'écrire des logiciels sans l'entrave
imposée par les monopoles de logiciels.
Information de contact
Veuillez envoyez vos questions et commentaires à propos de GNU et de
la FLL à
Free Software Foundation Téléphone: +1-617-542-5942
59 Temple Place - Suite 330 Télécopieur: +1-617-542-2652
Boston, MA 02111-1307, USA gnu@gnu.org
Merci de votre visite!
Les webmestres GNU
webmasters@www.gnu.org
[ Allemand | Anglais | Catalan | Chinois | Coréen | Danois | Espagnol
| Français | Hongrois | Italien | Japonais | Néerlandais | Portugais |
Suédois | Turc ]
_________________________________________________________________
Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA
Verbatim copying and distribution of this entire article is permitted
in any medium, provided this notice is preserved.
La reproduction exacte et la distribution intégrale de cet article est
permise sur n'importe quel support d'archivage, pourvu que cette
notice est préservée.
Dernière mise-à-jour : $Date: 2002/04/30 09:10:06 $ $Author: mohit $
_________________________________________________________________
|
Added work/include/bzlib.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
|
/*-------------------------------------------------------------*/
/*--- Public header file for the library. ---*/
/*--- bzlib.h ---*/
/*-------------------------------------------------------------*/
/*--
This file is a part of bzip2 and/or libbzip2, a program and
library for lossless, block-sorting data compression.
Copyright (C) 1996-2002 Julian R Seward. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.
3. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
4. The name of the author may not be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Julian Seward, Cambridge, UK.
jseward@acm.org
bzip2/libbzip2 version 1.0 of 21 March 2000
This program is based on (at least) the work of:
Mike Burrows
David Wheeler
Peter Fenwick
Alistair Moffat
Radford Neal
Ian H. Witten
Robert Sedgewick
Jon L. Bentley
For more information on these sources, see the manual.
--*/
#ifndef _BZLIB_H
#define _BZLIB_H
#ifdef __cplusplus
extern "C" {
#endif
#define BZ_RUN 0
#define BZ_FLUSH 1
#define BZ_FINISH 2
#define BZ_OK 0
#define BZ_RUN_OK 1
#define BZ_FLUSH_OK 2
#define BZ_FINISH_OK 3
#define BZ_STREAM_END 4
#define BZ_SEQUENCE_ERROR (-1)
#define BZ_PARAM_ERROR (-2)
#define BZ_MEM_ERROR (-3)
#define BZ_DATA_ERROR (-4)
#define BZ_DATA_ERROR_MAGIC (-5)
#define BZ_IO_ERROR (-6)
#define BZ_UNEXPECTED_EOF (-7)
#define BZ_OUTBUFF_FULL (-8)
#define BZ_CONFIG_ERROR (-9)
typedef
struct {
char *next_in;
unsigned int avail_in;
unsigned int total_in_lo32;
unsigned int total_in_hi32;
char *next_out;
unsigned int avail_out;
unsigned int total_out_lo32;
unsigned int total_out_hi32;
void *state;
void *(*bzalloc)(void *,int,int);
void (*bzfree)(void *,void *);
void *opaque;
}
bz_stream;
#ifndef BZ_IMPORT
#define BZ_EXPORT
#endif
/* Need a definitition for FILE */
#include <stdio.h>
#ifdef _WIN32
# include <windows.h>
# ifdef small
/* windows.h define small to char */
# undef small
# endif
# ifdef BZ_EXPORT
# define BZ_API(func) WINAPI func
# define BZ_EXTERN extern
# else
/* import windows dll dynamically */
# define BZ_API(func) (WINAPI * func)
# define BZ_EXTERN
# endif
#else
# define BZ_API(func) func
# define BZ_EXTERN extern
#endif
/*-- Core (low-level) library functions --*/
BZ_EXTERN int BZ_API(BZ2_bzCompressInit) (
bz_stream* strm,
int blockSize100k,
int verbosity,
int workFactor
);
BZ_EXTERN int BZ_API(BZ2_bzCompress) (
bz_stream* strm,
int action
);
BZ_EXTERN int BZ_API(BZ2_bzCompressEnd) (
bz_stream* strm
);
BZ_EXTERN int BZ_API(BZ2_bzDecompressInit) (
bz_stream *strm,
int verbosity,
int small
);
BZ_EXTERN int BZ_API(BZ2_bzDecompress) (
bz_stream* strm
);
BZ_EXTERN int BZ_API(BZ2_bzDecompressEnd) (
bz_stream *strm
);
/*-- High(er) level library functions --*/
#ifndef BZ_NO_STDIO
#define BZ_MAX_UNUSED 5000
typedef void BZFILE;
BZ_EXTERN BZFILE* BZ_API(BZ2_bzReadOpen) (
int* bzerror,
FILE* f,
int verbosity,
int small,
void* unused,
int nUnused
);
BZ_EXTERN void BZ_API(BZ2_bzReadClose) (
int* bzerror,
BZFILE* b
);
BZ_EXTERN void BZ_API(BZ2_bzReadGetUnused) (
int* bzerror,
BZFILE* b,
void** unused,
int* nUnused
);
BZ_EXTERN int BZ_API(BZ2_bzRead) (
int* bzerror,
BZFILE* b,
void* buf,
int len
);
BZ_EXTERN BZFILE* BZ_API(BZ2_bzWriteOpen) (
int* bzerror,
FILE* f,
int blockSize100k,
int verbosity,
int workFactor
);
BZ_EXTERN void BZ_API(BZ2_bzWrite) (
int* bzerror,
BZFILE* b,
void* buf,
int len
);
BZ_EXTERN void BZ_API(BZ2_bzWriteClose) (
int* bzerror,
BZFILE* b,
int abandon,
unsigned int* nbytes_in,
unsigned int* nbytes_out
);
BZ_EXTERN void BZ_API(BZ2_bzWriteClose64) (
int* bzerror,
BZFILE* b,
int abandon,
unsigned int* nbytes_in_lo32,
unsigned int* nbytes_in_hi32,
unsigned int* nbytes_out_lo32,
unsigned int* nbytes_out_hi32
);
#endif
/*-- Utility functions --*/
BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffCompress) (
char* dest,
unsigned int* destLen,
char* source,
unsigned int sourceLen,
int blockSize100k,
int verbosity,
int workFactor
);
BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffDecompress) (
char* dest,
unsigned int* destLen,
char* source,
unsigned int sourceLen,
int small,
int verbosity
);
/*--
Code contributed by Yoshioka Tsuneo
(QWF00133@niftyserve.or.jp/tsuneo-y@is.aist-nara.ac.jp),
to support better zlib compatibility.
This code is not _officially_ part of libbzip2 (yet);
I haven't tested it, documented it, or considered the
threading-safeness of it.
If this code breaks, please contact both Yoshioka and me.
--*/
BZ_EXTERN const char * BZ_API(BZ2_bzlibVersion) (
void
);
#ifndef BZ_NO_STDIO
BZ_EXTERN BZFILE * BZ_API(BZ2_bzopen) (
const char *path,
const char *mode
);
BZ_EXTERN BZFILE * BZ_API(BZ2_bzdopen) (
int fd,
const char *mode
);
BZ_EXTERN int BZ_API(BZ2_bzread) (
BZFILE* b,
void* buf,
int len
);
BZ_EXTERN int BZ_API(BZ2_bzwrite) (
BZFILE* b,
void* buf,
int len
);
BZ_EXTERN int BZ_API(BZ2_bzflush) (
BZFILE* b
);
BZ_EXTERN void BZ_API(BZ2_bzclose) (
BZFILE* b
);
BZ_EXTERN const char * BZ_API(BZ2_bzerror) (
BZFILE *b,
int *errnum
);
#endif
#ifdef __cplusplus
}
#endif
#endif
/*-------------------------------------------------------------*/
/*--- end bzlib.h ---*/
/*-------------------------------------------------------------*/
|
Added work/include/lzo1.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
/* lzo1.h -- public interface of the LZO1 compression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/opensource/lzo/
*/
#ifndef __LZO1_H
#define __LZO1_H
#ifndef __LZOCONF_H
#include <lzoconf.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/***********************************************************************
//
************************************************************************/
/* Memory required for the wrkmem parameter.
* When the required size is 0, you can also pass a NULL pointer.
*/
#define LZO1_MEM_COMPRESS ((lzo_uint32) (8192L * lzo_sizeof_dict_t))
#define LZO1_MEM_DECOMPRESS (0)
LZO_EXTERN(int)
lzo1_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
LZO_EXTERN(int)
lzo1_decompress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
/***********************************************************************
// better compression ratio at the cost of more memory and time
************************************************************************/
#define LZO1_99_MEM_COMPRESS ((lzo_uint32) (65536L * lzo_sizeof_dict_t))
#if !defined(LZO_99_UNSUPPORTED)
LZO_EXTERN(int)
lzo1_99_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* already included */
|
Added work/include/lzo16bit.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
/* lzo16bit.h -- configuration for the strict 16-bit memory model
This file is part of the LZO real-time data compression library.
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/opensource/lzo/
*/
/*
* NOTE:
* the strict 16-bit memory model is *not* officially supported.
* This file is only included for the sake of completeness.
*/
#ifndef __LZOCONF_H
# include <lzoconf.h>
#endif
#ifndef __LZO16BIT_H
#define __LZO16BIT_H
#if defined(__LZO_STRICT_16BIT)
#if (UINT_MAX < LZO_0xffffffffL)
#ifdef __cplusplus
extern "C" {
#endif
/***********************************************************************
//
************************************************************************/
#ifndef LZO_99_UNSUPPORTED
#define LZO_99_UNSUPPORTED
#endif
#ifndef LZO_999_UNSUPPORTED
#define LZO_999_UNSUPPORTED
#endif
typedef unsigned int lzo_uint;
typedef int lzo_int;
#define LZO_UINT_MAX UINT_MAX
#define LZO_INT_MAX INT_MAX
#define lzo_sizeof_dict_t sizeof(lzo_uint)
/***********************************************************************
//
************************************************************************/
#if defined(__LZO_DOS16) || defined(__LZO_WIN16)
#if 0
#define __LZO_MMODEL __far
#else
#define __LZO_MMODEL
#endif
#endif /* defined(__LZO_DOS16) || defined(__LZO_WIN16) */
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* (UINT_MAX < LZO_0xffffffffL) */
#endif /* defined(__LZO_STRICT_16BIT) */
#endif /* already included */
|
Added work/include/lzo1a.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
/* lzo1a.h -- public interface of the LZO1A compression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/opensource/lzo/
*/
#ifndef __LZO1A_H
#define __LZO1A_H
#ifndef __LZOCONF_H
#include <lzoconf.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/***********************************************************************
//
************************************************************************/
/* Memory required for the wrkmem parameter.
* When the required size is 0, you can also pass a NULL pointer.
*/
#define LZO1A_MEM_COMPRESS ((lzo_uint32) (8192L * lzo_sizeof_dict_t))
#define LZO1A_MEM_DECOMPRESS (0)
LZO_EXTERN(int)
lzo1a_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
LZO_EXTERN(int)
lzo1a_decompress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
/***********************************************************************
// better compression ratio at the cost of more memory and time
************************************************************************/
#define LZO1A_99_MEM_COMPRESS ((lzo_uint32) (65536L * lzo_sizeof_dict_t))
#if !defined(LZO_99_UNSUPPORTED)
LZO_EXTERN(int)
lzo1a_99_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* already included */
|
Added work/include/lzo1b.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
|
/* lzo1b.h -- public interface of the LZO1B compression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/opensource/lzo/
*/
#ifndef __LZO1B_H
#define __LZO1B_H
#ifndef __LZOCONF_H
#include <lzoconf.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/***********************************************************************
//
************************************************************************/
/* Memory required for the wrkmem parameter.
* When the required size is 0, you can also pass a NULL pointer.
*/
#define LZO1B_MEM_COMPRESS ((lzo_uint32) (16384L * lzo_sizeof_dict_t))
#define LZO1B_MEM_DECOMPRESS (0)
/* compression levels */
#define LZO1B_BEST_SPEED 1
#define LZO1B_BEST_COMPRESSION 9
#define LZO1B_DEFAULT_COMPRESSION (-1) /* fastest by default */
LZO_EXTERN(int)
lzo1b_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem,
int compression_level );
/* decompression */
LZO_EXTERN(int)
lzo1b_decompress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
/* safe decompression with overrun testing */
LZO_EXTERN(int)
lzo1b_decompress_safe ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
/***********************************************************************
//
************************************************************************/
LZO_EXTERN(int)
lzo1b_1_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
LZO_EXTERN(int)
lzo1b_2_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
LZO_EXTERN(int)
lzo1b_3_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
LZO_EXTERN(int)
lzo1b_4_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
LZO_EXTERN(int)
lzo1b_5_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
LZO_EXTERN(int)
lzo1b_6_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
LZO_EXTERN(int)
lzo1b_7_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
LZO_EXTERN(int)
lzo1b_8_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
LZO_EXTERN(int)
lzo1b_9_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
/***********************************************************************
// better compression ratio at the cost of more memory and time
************************************************************************/
#define LZO1B_99_MEM_COMPRESS ((lzo_uint32) (65536L * lzo_sizeof_dict_t))
#if !defined(LZO_99_UNSUPPORTED)
LZO_EXTERN(int)
lzo1b_99_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
#endif
#define LZO1B_999_MEM_COMPRESS ((lzo_uint32) (3 * 65536L * sizeof(lzo_uint32)))
#if !defined(LZO_999_UNSUPPORTED)
LZO_EXTERN(int)
lzo1b_999_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* already included */
|
Added work/include/lzo1c.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
|
/* lzo1c.h -- public interface of the LZO1C compression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/opensource/lzo/
*/
#ifndef __LZO1C_H
#define __LZO1C_H
#ifndef __LZOCONF_H
#include <lzoconf.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/***********************************************************************
//
************************************************************************/
/* Memory required for the wrkmem parameter.
* When the required size is 0, you can also pass a NULL pointer.
*/
#define LZO1C_MEM_COMPRESS ((lzo_uint32) (16384L * lzo_sizeof_dict_t))
#define LZO1C_MEM_DECOMPRESS (0)
/* compression levels */
#define LZO1C_BEST_SPEED 1
#define LZO1C_BEST_COMPRESSION 9
#define LZO1C_DEFAULT_COMPRESSION (-1) /* fastest by default */
LZO_EXTERN(int)
lzo1c_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem,
int compression_level );
/* decompression */
LZO_EXTERN(int)
lzo1c_decompress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
/* safe decompression with overrun testing */
LZO_EXTERN(int)
lzo1c_decompress_safe ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
/***********************************************************************
//
************************************************************************/
LZO_EXTERN(int)
lzo1c_1_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
LZO_EXTERN(int)
lzo1c_2_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
LZO_EXTERN(int)
lzo1c_3_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
LZO_EXTERN(int)
lzo1c_4_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
LZO_EXTERN(int)
lzo1c_5_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
LZO_EXTERN(int)
lzo1c_6_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
LZO_EXTERN(int)
lzo1c_7_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
LZO_EXTERN(int)
lzo1c_8_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
LZO_EXTERN(int)
lzo1c_9_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
/***********************************************************************
// better compression ratio at the cost of more memory and time
************************************************************************/
#define LZO1C_99_MEM_COMPRESS ((lzo_uint32) (65536L * lzo_sizeof_dict_t))
#if !defined(LZO_99_UNSUPPORTED)
LZO_EXTERN(int)
lzo1c_99_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
#endif
#define LZO1C_999_MEM_COMPRESS ((lzo_uint32) (5 * 16384L * sizeof(short)))
#if !defined(LZO_999_UNSUPPORTED)
LZO_EXTERN(int)
lzo1c_999_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* already included */
|
Added work/include/lzo1f.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
/* lzo1f.h -- public interface of the LZO1F compression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/opensource/lzo/
*/
#ifndef __LZO1F_H
#define __LZO1F_H
#ifndef __LZOCONF_H
#include <lzoconf.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/***********************************************************************
//
************************************************************************/
/* Memory required for the wrkmem parameter.
* When the required size is 0, you can also pass a NULL pointer.
*/
#define LZO1F_MEM_COMPRESS ((lzo_uint32) (16384L * lzo_sizeof_dict_t))
#define LZO1F_MEM_DECOMPRESS (0)
/* decompression */
LZO_EXTERN(int)
lzo1f_decompress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
/* safe decompression with overrun testing */
LZO_EXTERN(int)
lzo1f_decompress_safe ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
/***********************************************************************
//
************************************************************************/
LZO_EXTERN(int)
lzo1f_1_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
/***********************************************************************
// better compression ratio at the cost of more memory and time
************************************************************************/
#define LZO1F_999_MEM_COMPRESS ((lzo_uint32) (5 * 16384L * sizeof(short)))
#if !defined(LZO_999_UNSUPPORTED)
LZO_EXTERN(int)
lzo1f_999_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* already included */
|
Added work/include/lzo1x.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
|
/* lzo1x.h -- public interface of the LZO1X compression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/opensource/lzo/
*/
#ifndef __LZO1X_H
#define __LZO1X_H
#ifndef __LZOCONF_H
#include <lzoconf.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/***********************************************************************
//
************************************************************************/
/* Memory required for the wrkmem parameter.
* When the required size is 0, you can also pass a NULL pointer.
*/
#define LZO1X_MEM_COMPRESS LZO1X_1_MEM_COMPRESS
#define LZO1X_MEM_DECOMPRESS (0)
#define LZO1X_MEM_OPTIMIZE (0)
/* decompression */
LZO_EXTERN(int)
lzo1x_decompress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
/* safe decompression with overrun testing */
LZO_EXTERN(int)
lzo1x_decompress_safe ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
/***********************************************************************
//
************************************************************************/
#define LZO1X_1_MEM_COMPRESS ((lzo_uint32) (16384L * lzo_sizeof_dict_t))
LZO_EXTERN(int)
lzo1x_1_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
/***********************************************************************
// special compressor versions
************************************************************************/
/* this version needs only 8 kB work memory */
#define LZO1X_1_11_MEM_COMPRESS ((lzo_uint32) (2048L * lzo_sizeof_dict_t))
LZO_EXTERN(int)
lzo1x_1_11_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
/* this version needs 16 kB work memory */
#define LZO1X_1_12_MEM_COMPRESS ((lzo_uint32) (4096L * lzo_sizeof_dict_t))
LZO_EXTERN(int)
lzo1x_1_12_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
/* use this version if you need a little more compression speed */
#define LZO1X_1_15_MEM_COMPRESS ((lzo_uint32) (32768L * lzo_sizeof_dict_t))
LZO_EXTERN(int)
lzo1x_1_15_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
/***********************************************************************
// better compression ratio at the cost of more memory and time
************************************************************************/
#define LZO1X_999_MEM_COMPRESS ((lzo_uint32) (14 * 16384L * sizeof(short)))
#if !defined(LZO_999_UNSUPPORTED)
LZO_EXTERN(int)
lzo1x_999_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
#endif
/***********************************************************************
//
************************************************************************/
#if !defined(LZO_999_UNSUPPORTED)
LZO_EXTERN(int)
lzo1x_999_compress_dict ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem,
const lzo_byte *dict, lzo_uint dict_len );
LZO_EXTERN(int)
lzo1x_999_compress_level ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem,
const lzo_byte *dict, lzo_uint dict_len,
lzo_progress_callback_t cb,
int compression_level );
#endif
LZO_EXTERN(int)
lzo1x_decompress_dict_safe ( const lzo_byte *in, lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem /* NOT USED */,
const lzo_byte *dict, lzo_uint dict_len );
/***********************************************************************
// optimize a compressed data block
************************************************************************/
LZO_EXTERN(int)
lzo1x_optimize ( lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem );
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* already included */
|
Added work/include/lzo1y.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
|
/* lzo1y.h -- public interface of the LZO1Y compression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/opensource/lzo/
*/
#ifndef __LZO1Y_H
#define __LZO1Y_H
#ifndef __LZOCONF_H
#include <lzoconf.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/***********************************************************************
//
************************************************************************/
/* Memory required for the wrkmem parameter.
* When the required size is 0, you can also pass a NULL pointer.
*/
#define LZO1Y_MEM_COMPRESS ((lzo_uint32) (16384L * lzo_sizeof_dict_t))
#define LZO1Y_MEM_DECOMPRESS (0)
#define LZO1Y_MEM_OPTIMIZE (0)
/* decompression */
LZO_EXTERN(int)
lzo1y_decompress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
/* safe decompression with overrun testing */
LZO_EXTERN(int)
lzo1y_decompress_safe ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
/***********************************************************************
//
************************************************************************/
LZO_EXTERN(int)
lzo1y_1_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
/***********************************************************************
// better compression ratio at the cost of more memory and time
************************************************************************/
#define LZO1Y_999_MEM_COMPRESS ((lzo_uint32) (14 * 16384L * sizeof(short)))
#if !defined(LZO_999_UNSUPPORTED)
LZO_EXTERN(int)
lzo1y_999_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
#endif
/***********************************************************************
//
************************************************************************/
#if !defined(LZO_999_UNSUPPORTED)
LZO_EXTERN(int)
lzo1y_999_compress_dict ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem,
const lzo_byte *dict, lzo_uint dict_len );
LZO_EXTERN(int)
lzo1y_999_compress_level ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem,
const lzo_byte *dict, lzo_uint dict_len,
lzo_progress_callback_t cb,
int compression_level );
#endif
LZO_EXTERN(int)
lzo1y_decompress_dict_safe ( const lzo_byte *in, lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem /* NOT USED */,
const lzo_byte *dict, lzo_uint dict_len );
/***********************************************************************
// optimize a compressed data block
************************************************************************/
LZO_EXTERN(int)
lzo1y_optimize ( lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem );
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* already included */
|
Added work/include/lzo1z.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
|
/* lzo1z.h -- public interface of the LZO1Z compression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/opensource/lzo/
*/
#ifndef __LZO1Z_H
#define __LZO1Z_H
#ifndef __LZOCONF_H
#include <lzoconf.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/***********************************************************************
//
************************************************************************/
/* Memory required for the wrkmem parameter.
* When the required size is 0, you can also pass a NULL pointer.
*/
#define LZO1Z_MEM_COMPRESS ((lzo_uint32) (16384L * lzo_sizeof_dict_t))
#define LZO1Z_MEM_DECOMPRESS (0)
#define LZO1Z_MEM_OPTIMIZE (0)
/* decompression */
LZO_EXTERN(int)
lzo1z_decompress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
/* safe decompression with overrun testing */
LZO_EXTERN(int)
lzo1z_decompress_safe ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
/***********************************************************************
//
************************************************************************/
#if 0
/* not yet implemented */
LZO_EXTERN(int)
lzo1z_1_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
#endif
/***********************************************************************
// better compression ratio at the cost of more memory and time
************************************************************************/
#define LZO1Z_999_MEM_COMPRESS ((lzo_uint32) (14 * 16384L * sizeof(short)))
#if !defined(LZO_999_UNSUPPORTED)
LZO_EXTERN(int)
lzo1z_999_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
#endif
/***********************************************************************
//
************************************************************************/
#if !defined(LZO_999_UNSUPPORTED)
LZO_EXTERN(int)
lzo1z_999_compress_dict ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem,
const lzo_byte *dict, lzo_uint dict_len );
LZO_EXTERN(int)
lzo1z_999_compress_level ( const lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem,
const lzo_byte *dict, lzo_uint dict_len,
lzo_progress_callback_t cb,
int compression_level );
#endif
LZO_EXTERN(int)
lzo1z_decompress_dict_safe ( const lzo_byte *in, lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem /* NOT USED */,
const lzo_byte *dict, lzo_uint dict_len );
/***********************************************************************
// optimize a compressed data block
************************************************************************/
#if 0
/* not yet implemented */
LZO_EXTERN(int)
lzo1z_optimize ( lzo_byte *in , lzo_uint in_len,
lzo_byte *out, lzo_uintp out_len,
lzo_voidp wrkmem );
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* already included */
|
Added work/include/lzo2a.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
/* lzo2a.h -- public interface of the LZO2A compression algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/opensource/lzo/
*/
#ifndef __LZO2A_H
#define __LZO2A_H
#ifndef __LZOCONF_H
#include <lzoconf.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/***********************************************************************
//
************************************************************************/
#define LZO2A_MEM_DECOMPRESS (0)
/* decompression */
LZO_EXTERN(int)
lzo2a_decompress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
/* safe decompression with overrun testing */
LZO_EXTERN(int)
lzo2a_decompress_safe ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
/***********************************************************************
// better compression ratio at the cost of more memory and time
************************************************************************/
#define LZO2A_999_MEM_COMPRESS ((lzo_uint32) (8 * 16384L * sizeof(short)))
#if !defined(LZO_999_UNSUPPORTED)
LZO_EXTERN(int)
lzo2a_999_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* already included */
|
Added work/include/lzoconf.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
|
/* lzoconf.h -- configuration for the LZO real-time data compression library
This file is part of the LZO real-time data compression library.
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/opensource/lzo/
*/
#ifndef __LZOCONF_H
#define __LZOCONF_H
#define LZO_VERSION 0x1080
#define LZO_VERSION_STRING "1.08"
#define LZO_VERSION_DATE "Jul 12 2002"
/* internal Autoconf configuration file - only used when building LZO */
#if defined(LZO_HAVE_CONFIG_H)
# include <config.h>
#endif
#include <limits.h>
#ifdef __cplusplus
extern "C" {
#endif
/***********************************************************************
// LZO requires a conforming <limits.h>
************************************************************************/
#if !defined(CHAR_BIT) || (CHAR_BIT != 8)
# error "invalid CHAR_BIT"
#endif
#if !defined(UCHAR_MAX) || !defined(UINT_MAX) || !defined(ULONG_MAX)
# error "check your compiler installation"
#endif
#if (USHRT_MAX < 1) || (UINT_MAX < 1) || (ULONG_MAX < 1)
# error "your limits.h macros are broken"
#endif
/* workaround a cpp bug under hpux 10.20 */
#define LZO_0xffffffffL 4294967295ul
#if !defined(LZO_UINT32_C)
# if (UINT_MAX < LZO_0xffffffffL)
# define LZO_UINT32_C(c) c ## UL
# else
# define LZO_UINT32_C(c) c ## U
# endif
#endif
/***********************************************************************
// architecture defines
************************************************************************/
#if !defined(__LZO_WIN) && !defined(__LZO_DOS) && !defined(__LZO_OS2)
# if defined(__WINDOWS__) || defined(_WINDOWS) || defined(_Windows)
# define __LZO_WIN
# elif defined(__WIN32__) || defined(_WIN32) || defined(WIN32)
# define __LZO_WIN
# elif defined(__NT__) || defined(__NT_DLL__) || defined(__WINDOWS_386__)
# define __LZO_WIN
# elif defined(__DOS__) || defined(__MSDOS__) || defined(MSDOS)
# define __LZO_DOS
# elif defined(__OS2__) || defined(__OS2V2__) || defined(OS2)
# define __LZO_OS2
# elif defined(__palmos__)
# define __LZO_PALMOS
# elif defined(__TOS__) || defined(__atarist__)
# define __LZO_TOS
# endif
#endif
#if (UINT_MAX < LZO_0xffffffffL)
# if defined(__LZO_WIN)
# define __LZO_WIN16
# elif defined(__LZO_DOS)
# define __LZO_DOS16
# elif defined(__LZO_PALMOS)
# define __LZO_PALMOS16
# elif defined(__LZO_TOS)
# define __LZO_TOS16
# elif defined(__C166__)
# else
/* porting hint: for pure 16-bit architectures try compiling
* everything with -D__LZO_STRICT_16BIT */
# error "16-bit target not supported - contact me for porting hints"
# endif
#endif
#if !defined(__LZO_i386)
# if defined(__LZO_DOS) || defined(__LZO_WIN16)
# define __LZO_i386
# elif defined(__i386__) || defined(__386__) || defined(_M_IX86)
# define __LZO_i386
# endif
#endif
#if defined(__LZO_STRICT_16BIT)
# if (UINT_MAX < LZO_0xffffffffL)
# include <lzo16bit.h>
# endif
#endif
/* memory checkers */
#if !defined(__LZO_CHECKER)
# if defined(__BOUNDS_CHECKING_ON)
# define __LZO_CHECKER
# elif defined(__CHECKER__)
# define __LZO_CHECKER
# elif defined(__INSURE__)
# define __LZO_CHECKER
# elif defined(__PURIFY__)
# define __LZO_CHECKER
# endif
#endif
/***********************************************************************
// integral and pointer types
************************************************************************/
/* Integral types with 32 bits or more */
#if !defined(LZO_UINT32_MAX)
# if (UINT_MAX >= LZO_0xffffffffL)
typedef unsigned int lzo_uint32;
typedef int lzo_int32;
# define LZO_UINT32_MAX UINT_MAX
# define LZO_INT32_MAX INT_MAX
# define LZO_INT32_MIN INT_MIN
# elif (ULONG_MAX >= LZO_0xffffffffL)
typedef unsigned long lzo_uint32;
typedef long lzo_int32;
# define LZO_UINT32_MAX ULONG_MAX
# define LZO_INT32_MAX LONG_MAX
# define LZO_INT32_MIN LONG_MIN
# else
# error "lzo_uint32"
# endif
#endif
/* lzo_uint is used like size_t */
#if !defined(LZO_UINT_MAX)
# if (UINT_MAX >= LZO_0xffffffffL)
typedef unsigned int lzo_uint;
typedef int lzo_int;
# define LZO_UINT_MAX UINT_MAX
# define LZO_INT_MAX INT_MAX
# define LZO_INT_MIN INT_MIN
# elif (ULONG_MAX >= LZO_0xffffffffL)
typedef unsigned long lzo_uint;
typedef long lzo_int;
# define LZO_UINT_MAX ULONG_MAX
# define LZO_INT_MAX LONG_MAX
# define LZO_INT_MIN LONG_MIN
# else
# error "lzo_uint"
# endif
#endif
typedef int lzo_bool;
/***********************************************************************
// memory models
************************************************************************/
/* Memory model for the public code segment. */
#if !defined(__LZO_CMODEL)
# if defined(__LZO_DOS16) || defined(__LZO_WIN16)
# define __LZO_CMODEL __far
# elif defined(__LZO_i386) && defined(__WATCOMC__)
# define __LZO_CMODEL __near
# else
# define __LZO_CMODEL
# endif
#endif
/* Memory model for the public data segment. */
#if !defined(__LZO_DMODEL)
# if defined(__LZO_DOS16) || defined(__LZO_WIN16)
# define __LZO_DMODEL __far
# elif defined(__LZO_i386) && defined(__WATCOMC__)
# define __LZO_DMODEL __near
# else
# define __LZO_DMODEL
# endif
#endif
/* Memory model that allows to access memory at offsets of lzo_uint. */
#if !defined(__LZO_MMODEL)
# if (LZO_UINT_MAX <= UINT_MAX)
# define __LZO_MMODEL
# elif defined(__LZO_DOS16) || defined(__LZO_WIN16)
# define __LZO_MMODEL __huge
# define LZO_999_UNSUPPORTED
# elif defined(__LZO_PALMOS16) || defined(__LZO_TOS16)
# define __LZO_MMODEL
# else
# error "__LZO_MMODEL"
# endif
#endif
/* no typedef here because of const-pointer issues */
#define lzo_byte unsigned char __LZO_MMODEL
#define lzo_bytep unsigned char __LZO_MMODEL *
#define lzo_charp char __LZO_MMODEL *
#define lzo_voidp void __LZO_MMODEL *
#define lzo_shortp short __LZO_MMODEL *
#define lzo_ushortp unsigned short __LZO_MMODEL *
#define lzo_uint32p lzo_uint32 __LZO_MMODEL *
#define lzo_int32p lzo_int32 __LZO_MMODEL *
#define lzo_uintp lzo_uint __LZO_MMODEL *
#define lzo_intp lzo_int __LZO_MMODEL *
#define lzo_voidpp lzo_voidp __LZO_MMODEL *
#define lzo_bytepp lzo_bytep __LZO_MMODEL *
#ifndef lzo_sizeof_dict_t
# define lzo_sizeof_dict_t sizeof(lzo_bytep)
#endif
/***********************************************************************
// calling conventions and function types
************************************************************************/
/* linkage */
#if !defined(__LZO_EXTERN_C)
# ifdef __cplusplus
# define __LZO_EXTERN_C extern "C"
# else
# define __LZO_EXTERN_C extern
# endif
#endif
/* calling convention */
#if !defined(__LZO_CDECL)
# if defined(__LZO_DOS16) || defined(__LZO_WIN16)
# define __LZO_CDECL __LZO_CMODEL __cdecl
# elif defined(__LZO_i386) && defined(_MSC_VER)
# define __LZO_CDECL __LZO_CMODEL __cdecl
# elif defined(__LZO_i386) && defined(__WATCOMC__)
# define __LZO_CDECL __LZO_CMODEL __cdecl
# else
# define __LZO_CDECL __LZO_CMODEL
# endif
#endif
#if !defined(__LZO_ENTRY)
# define __LZO_ENTRY __LZO_CDECL
#endif
/* C++ exception specification for extern "C" function types */
#if !defined(__cplusplus)
# undef LZO_NOTHROW
# define LZO_NOTHROW
#elif !defined(LZO_NOTHROW)
# define LZO_NOTHROW
#endif
typedef int
(__LZO_ENTRY *lzo_compress_t) ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
typedef int
(__LZO_ENTRY *lzo_decompress_t) ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
typedef int
(__LZO_ENTRY *lzo_optimize_t) ( lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
typedef int
(__LZO_ENTRY *lzo_compress_dict_t)(const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem,
const lzo_byte *dict, lzo_uint dict_len );
typedef int
(__LZO_ENTRY *lzo_decompress_dict_t)(const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem,
const lzo_byte *dict, lzo_uint dict_len );
/* assembler versions always use __cdecl */
typedef int
(__LZO_CDECL *lzo_compress_asm_t)( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
typedef int
(__LZO_CDECL *lzo_decompress_asm_t)( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
/* a progress indicator callback function */
typedef void (__LZO_ENTRY *lzo_progress_callback_t) (lzo_uint, lzo_uint);
/***********************************************************************
// export information
************************************************************************/
/* DLL export information */
#if !defined(__LZO_EXPORT1)
# define __LZO_EXPORT1
#endif
#if !defined(__LZO_EXPORT2)
# define __LZO_EXPORT2
#endif
/* exported calling convention for C functions */
#if !defined(LZO_PUBLIC)
# define LZO_PUBLIC(_rettype) \
__LZO_EXPORT1 _rettype __LZO_EXPORT2 __LZO_ENTRY
#endif
#if !defined(LZO_EXTERN)
# define LZO_EXTERN(_rettype) __LZO_EXTERN_C LZO_PUBLIC(_rettype)
#endif
#if !defined(LZO_PRIVATE)
# define LZO_PRIVATE(_rettype) static _rettype __LZO_ENTRY
#endif
/* exported __cdecl calling convention for assembler functions */
#if !defined(LZO_PUBLIC_CDECL)
# define LZO_PUBLIC_CDECL(_rettype) \
__LZO_EXPORT1 _rettype __LZO_EXPORT2 __LZO_CDECL
#endif
#if !defined(LZO_EXTERN_CDECL)
# define LZO_EXTERN_CDECL(_rettype) __LZO_EXTERN_C LZO_PUBLIC_CDECL(_rettype)
#endif
/* exported global variables (LZO currently uses no static variables and
* is fully thread safe) */
#if !defined(LZO_PUBLIC_VAR)
# define LZO_PUBLIC_VAR(_type) \
__LZO_EXPORT1 _type __LZO_EXPORT2 __LZO_DMODEL
#endif
#if !defined(LZO_EXTERN_VAR)
# define LZO_EXTERN_VAR(_type) extern LZO_PUBLIC_VAR(_type)
#endif
/***********************************************************************
// error codes and prototypes
************************************************************************/
/* Error codes for the compression/decompression functions. Negative
* values are errors, positive values will be used for special but
* normal events.
*/
#define LZO_E_OK 0
#define LZO_E_ERROR (-1)
#define LZO_E_OUT_OF_MEMORY (-2) /* not used right now */
#define LZO_E_NOT_COMPRESSIBLE (-3) /* not used right now */
#define LZO_E_INPUT_OVERRUN (-4)
#define LZO_E_OUTPUT_OVERRUN (-5)
#define LZO_E_LOOKBEHIND_OVERRUN (-6)
#define LZO_E_EOF_NOT_FOUND (-7)
#define LZO_E_INPUT_NOT_CONSUMED (-8)
/* lzo_init() should be the first function you call.
* Check the return code !
*
* lzo_init() is a macro to allow checking that the library and the
* compiler's view of various types are consistent.
*/
#define lzo_init() __lzo_init2(LZO_VERSION,(int)sizeof(short),(int)sizeof(int),\
(int)sizeof(long),(int)sizeof(lzo_uint32),(int)sizeof(lzo_uint),\
(int)lzo_sizeof_dict_t,(int)sizeof(char *),(int)sizeof(lzo_voidp),\
(int)sizeof(lzo_compress_t))
LZO_EXTERN(int) __lzo_init2(unsigned,int,int,int,int,int,int,int,int,int);
/* version functions (useful for shared libraries) */
LZO_EXTERN(unsigned) lzo_version(void);
LZO_EXTERN(const char *) lzo_version_string(void);
LZO_EXTERN(const char *) lzo_version_date(void);
LZO_EXTERN(const lzo_charp) _lzo_version_string(void);
LZO_EXTERN(const lzo_charp) _lzo_version_date(void);
/* string functions */
LZO_EXTERN(int)
lzo_memcmp(const lzo_voidp _s1, const lzo_voidp _s2, lzo_uint _len);
LZO_EXTERN(lzo_voidp)
lzo_memcpy(lzo_voidp _dest, const lzo_voidp _src, lzo_uint _len);
LZO_EXTERN(lzo_voidp)
lzo_memmove(lzo_voidp _dest, const lzo_voidp _src, lzo_uint _len);
LZO_EXTERN(lzo_voidp)
lzo_memset(lzo_voidp _s, int _c, lzo_uint _len);
/* checksum functions */
LZO_EXTERN(lzo_uint32)
lzo_adler32(lzo_uint32 _adler, const lzo_byte *_buf, lzo_uint _len);
LZO_EXTERN(lzo_uint32)
lzo_crc32(lzo_uint32 _c, const lzo_byte *_buf, lzo_uint _len);
/* misc. */
LZO_EXTERN(lzo_bool) lzo_assert(int _expr);
LZO_EXTERN(int) _lzo_config_check(void);
typedef union { lzo_bytep p; lzo_uint u; } __lzo_pu_u;
typedef union { lzo_bytep p; lzo_uint32 u32; } __lzo_pu32_u;
typedef union { void *vp; lzo_bytep bp; lzo_uint32 u32; long l; } lzo_align_t;
/* align a char pointer on a boundary that is a multiple of `size' */
LZO_EXTERN(unsigned) __lzo_align_gap(const lzo_voidp _ptr, lzo_uint _size);
#define LZO_PTR_ALIGN_UP(_ptr,_size) \
((_ptr) + (lzo_uint) __lzo_align_gap((const lzo_voidp)(_ptr),(lzo_uint)(_size)))
/* deprecated - only for backward compatibility */
#define LZO_ALIGN(_ptr,_size) LZO_PTR_ALIGN_UP(_ptr,_size)
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* already included */
|
Added work/include/lzoutil.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
/* lzoutil.h -- utilitiy functions for use by applications
This file is part of the LZO real-time data compression library.
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/opensource/lzo/
*/
#ifndef __LZOUTIL_H
#define __LZOUTIL_H
#ifndef __LZOCONF_H
#include <lzoconf.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/***********************************************************************
// portable memory allocation
//
// The LZO library does not allocate any memory (you always pass a
// pre-allocated pointer via the `wrkmem' parameter), but these
// functions are handy for application programs.
************************************************************************/
LZO_EXTERN(lzo_voidp) lzo_alloc(lzo_uint _nelems, lzo_uint _size);
LZO_EXTERN(lzo_voidp) lzo_malloc(lzo_uint _size);
LZO_EXTERN(void) lzo_free(lzo_voidp _ptr);
typedef lzo_voidp (__LZO_ENTRY *lzo_alloc_hook_t) (lzo_uint, lzo_uint);
typedef void (__LZO_ENTRY *lzo_free_hook_t) (lzo_voidp);
LZO_EXTERN_VAR(lzo_alloc_hook_t) lzo_alloc_hook;
LZO_EXTERN_VAR(lzo_free_hook_t) lzo_free_hook;
/***********************************************************************
// portable file io
************************************************************************/
#if !defined(LZO_FILEP)
# define LZO_FILEP void *
#endif
LZO_EXTERN(lzo_uint)
lzo_fread(LZO_FILEP f, lzo_voidp buf, lzo_uint size);
LZO_EXTERN(lzo_uint)
lzo_fwrite(LZO_FILEP f, const lzo_voidp buf, lzo_uint size);
#if (LZO_UINT_MAX <= UINT_MAX)
# define lzo_fread(f,b,s) (fread(b,1,s,f))
# define lzo_fwrite(f,b,s) (fwrite(b,1,s,f))
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* already included */
|
Added work/include/zconf.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
|
/* zconf.h -- configuration of the zlib compression library
* Copyright (C) 1995-2003 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* @(#) $Id$ */
#ifndef ZCONF_H
#define ZCONF_H
/*
* If you *really* need a unique prefix for all types and library functions,
* compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
*/
#ifdef Z_PREFIX
# define deflateInit_ z_deflateInit_
# define deflate z_deflate
# define deflateEnd z_deflateEnd
# define inflateInit_ z_inflateInit_
# define inflate z_inflate
# define inflateEnd z_inflateEnd
# define deflateInit2_ z_deflateInit2_
# define deflateSetDictionary z_deflateSetDictionary
# define deflateCopy z_deflateCopy
# define deflateReset z_deflateReset
# define deflatePrime z_deflatePrime
# define deflateParams z_deflateParams
# define deflateBound z_deflateBound
# define inflateInit2_ z_inflateInit2_
# define inflateSetDictionary z_inflateSetDictionary
# define inflateSync z_inflateSync
# define inflateSyncPoint z_inflateSyncPoint
# define inflateCopy z_inflateCopy
# define inflateReset z_inflateReset
# define compress z_compress
# define compress2 z_compress2
# define compressBound z_compressBound
# define uncompress z_uncompress
# define adler32 z_adler32
# define crc32 z_crc32
# define get_crc_table z_get_crc_table
# define Byte z_Byte
# define uInt z_uInt
# define uLong z_uLong
# define Bytef z_Bytef
# define charf z_charf
# define intf z_intf
# define uIntf z_uIntf
# define uLongf z_uLongf
# define voidpf z_voidpf
# define voidp z_voidp
#endif
#if defined(__MSDOS__) && !defined(MSDOS)
# define MSDOS
#endif
#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
# define OS2
#endif
#if defined(_WINDOWS) && !defined(WINDOWS)
# define WINDOWS
#endif
#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
# define WIN32
#endif
#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
# ifndef SYS16BIT
# define SYS16BIT
# endif
# endif
#endif
/*
* Compile with -DMAXSEG_64K if the alloc function cannot allocate more
* than 64k bytes at a time (needed on systems with 16-bit int).
*/
#ifdef SYS16BIT
# define MAXSEG_64K
#endif
#ifdef MSDOS
# define UNALIGNED_OK
#endif
#ifdef __STDC_VERSION__
# ifndef STDC
# define STDC
# endif
# if __STDC_VERSION__ >= 199901L
# ifndef STDC99
# define STDC99
# endif
# endif
#endif
#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
# define STDC
#endif
#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
# define STDC
#endif
#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
# define STDC
#endif
#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
# define STDC
#endif
#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
# define STDC
#endif
#ifndef STDC
# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
# define const /* note: need a more gentle solution here */
# endif
#endif
/* Some Mac compilers merge all .h files incorrectly: */
#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
# define NO_DUMMY_DECL
#endif
/* Maximum value for memLevel in deflateInit2 */
#ifndef MAX_MEM_LEVEL
# ifdef MAXSEG_64K
# define MAX_MEM_LEVEL 8
# else
# define MAX_MEM_LEVEL 9
# endif
#endif
/* Maximum value for windowBits in deflateInit2 and inflateInit2.
* WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
* created by gzip. (Files created by minigzip can still be extracted by
* gzip.)
*/
#ifndef MAX_WBITS
# define MAX_WBITS 15 /* 32K LZ77 window */
#endif
/* The memory requirements for deflate are (in bytes):
(1 << (windowBits+2)) + (1 << (memLevel+9))
that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
plus a few kilobytes for small objects. For example, if you want to reduce
the default memory requirements from 256K to 128K, compile with
make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
Of course this will generally degrade compression (there's no free lunch).
The memory requirements for inflate are (in bytes) 1 << windowBits
that is, 32K for windowBits=15 (default value) plus a few kilobytes
for small objects.
*/
/* Type declarations */
#ifndef OF /* function prototypes */
# ifdef STDC
# define OF(args) args
# else
# define OF(args) ()
# endif
#endif
/* The following definitions for FAR are needed only for MSDOS mixed
* model programming (small or medium model with some far allocations).
* This was tested only with MSC; for other MSDOS compilers you may have
* to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
* just define FAR to be empty.
*/
#ifdef SYS16BIT
# if defined(M_I86SM) || defined(M_I86MM)
/* MSC small or medium model */
# define SMALL_MEDIUM
# ifdef _MSC_VER
# define FAR _far
# else
# define FAR far
# endif
# endif
# if (defined(__SMALL__) || defined(__MEDIUM__))
/* Turbo C small or medium model */
# define SMALL_MEDIUM
# ifdef __BORLANDC__
# define FAR _far
# else
# define FAR far
# endif
# endif
#endif
#if defined(WINDOWS) || defined(WIN32)
/* If building or using zlib as a DLL, define ZLIB_DLL.
* This is not mandatory, but it offers a little performance increase.
*/
# ifdef ZLIB_DLL
# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
# ifdef ZLIB_INTERNAL
# define ZEXTERN extern __declspec(dllexport)
# else
# define ZEXTERN extern __declspec(dllimport)
# endif
# endif
# endif /* ZLIB_DLL */
/* If building or using zlib with the WINAPI/WINAPIV calling convention,
* define ZLIB_WINAPI.
* Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
*/
# ifdef ZLIB_WINAPI
# ifdef FAR
# undef FAR
# endif
# include <windows.h>
/* No need for _export, use ZLIB.DEF instead. */
/* For complete Windows compatibility, use WINAPI, not __stdcall. */
# define ZEXPORT WINAPI
# ifdef WIN32
# define ZEXPORTVA WINAPIV
# else
# define ZEXPORTVA FAR CDECL
# endif
# endif
#endif
#if defined (__BEOS__)
# ifdef ZLIB_DLL
# ifdef ZLIB_INTERNAL
# define ZEXPORT __declspec(dllexport)
# define ZEXPORTVA __declspec(dllexport)
# else
# define ZEXPORT __declspec(dllimport)
# define ZEXPORTVA __declspec(dllimport)
# endif
# endif
#endif
#ifndef ZEXTERN
# define ZEXTERN extern
#endif
#ifndef ZEXPORT
# define ZEXPORT
#endif
#ifndef ZEXPORTVA
# define ZEXPORTVA
#endif
#ifndef FAR
# define FAR
#endif
#if !defined(__MACTYPES__)
typedef unsigned char Byte; /* 8 bits */
#endif
typedef unsigned int uInt; /* 16 bits or more */
typedef unsigned long uLong; /* 32 bits or more */
#ifdef SMALL_MEDIUM
/* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
# define Bytef Byte FAR
#else
typedef Byte FAR Bytef;
#endif
typedef char FAR charf;
typedef int FAR intf;
typedef uInt FAR uIntf;
typedef uLong FAR uLongf;
#ifdef STDC
typedef void const *voidpc;
typedef void FAR *voidpf;
typedef void *voidp;
#else
typedef Byte const *voidpc;
typedef Byte FAR *voidpf;
typedef Byte *voidp;
#endif
#if 1 /* HAVE_UNISTD_H -- this line is updated by ./configure */
# include <sys/types.h> /* for off_t */
# include <unistd.h> /* for SEEK_* and off_t */
# ifdef VMS
# include <unixio.h> /* for off_t */
# endif
# define z_off_t off_t
#endif
#ifndef SEEK_SET
# define SEEK_SET 0 /* Seek from beginning of file. */
# define SEEK_CUR 1 /* Seek from current position. */
# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
#endif
#ifndef z_off_t
# define z_off_t long
#endif
#if defined(__OS400__)
#define NO_vsnprintf
#endif
#if defined(__MVS__)
# define NO_vsnprintf
# ifdef FAR
# undef FAR
# endif
#endif
/* MVS linker does not support external names larger than 8 bytes */
#if defined(__MVS__)
# pragma map(deflateInit_,"DEIN")
# pragma map(deflateInit2_,"DEIN2")
# pragma map(deflateEnd,"DEEND")
# pragma map(deflateBound,"DEBND")
# pragma map(inflateInit_,"ININ")
# pragma map(inflateInit2_,"ININ2")
# pragma map(inflateEnd,"INEND")
# pragma map(inflateSync,"INSY")
# pragma map(inflateSetDictionary,"INSEDI")
# pragma map(compressBound,"CMBND")
# pragma map(inflate_table,"INTABL")
# pragma map(inflate_fast,"INFA")
# pragma map(inflate_copyright,"INCOPY")
#endif
#endif /* ZCONF_H */
|
Added work/include/zlib.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
|
/* zlib.h -- interface of the 'zlib' general purpose compression library
version 1.2.1, November 17th, 2003
Copyright (C) 1995-2003 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Jean-loup Gailly Mark Adler
jloup@gzip.org madler@alumni.caltech.edu
The data format used by the zlib library is described by RFCs (Request for
Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt
(zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
*/
#ifndef ZLIB_H
#define ZLIB_H
#include "zconf.h"
#ifdef __cplusplus
extern "C" {
#endif
#define ZLIB_VERSION "1.2.1"
#define ZLIB_VERNUM 0x1210
/*
The 'zlib' compression library provides in-memory compression and
decompression functions, including integrity checks of the uncompressed
data. This version of the library supports only one compression method
(deflation) but other algorithms will be added later and will have the same
stream interface.
Compression can be done in a single step if the buffers are large
enough (for example if an input file is mmap'ed), or can be done by
repeated calls of the compression function. In the latter case, the
application must provide more input and/or consume the output
(providing more output space) before each call.
The compressed data format used by the in-memory functions is the zlib
format, which is a zlib wrapper documented in RFC 1950, wrapped around a
deflate stream, which is itself documented in RFC 1951.
The library also supports reading and writing files in gzip (.gz) format
with an interface similar to that of stdio using the functions that start
with "gz". The gzip format is different from the zlib format. gzip is a
gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.
The zlib format was designed to be compact and fast for use in memory
and on communications channels. The gzip format was designed for single-
file compression on file systems, has a larger header than zlib to maintain
directory information, and uses a different, slower check method than zlib.
This library does not provide any functions to write gzip files in memory.
However such functions could be easily written using zlib's deflate function,
the documentation in the gzip RFC, and the examples in gzio.c.
The library does not install any signal handler. The decoder checks
the consistency of the compressed data, so the library should never
crash even in case of corrupted input.
*/
typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
typedef void (*free_func) OF((voidpf opaque, voidpf address));
struct internal_state;
typedef struct z_stream_s {
Bytef *next_in; /* next input byte */
uInt avail_in; /* number of bytes available at next_in */
uLong total_in; /* total nb of input bytes read so far */
Bytef *next_out; /* next output byte should be put there */
uInt avail_out; /* remaining free space at next_out */
uLong total_out; /* total nb of bytes output so far */
char *msg; /* last error message, NULL if no error */
struct internal_state FAR *state; /* not visible by applications */
alloc_func zalloc; /* used to allocate the internal state */
free_func zfree; /* used to free the internal state */
voidpf opaque; /* private data object passed to zalloc and zfree */
int data_type; /* best guess about the data type: ascii or binary */
uLong adler; /* adler32 value of the uncompressed data */
uLong reserved; /* reserved for future use */
} z_stream;
typedef z_stream FAR *z_streamp;
/*
The application must update next_in and avail_in when avail_in has
dropped to zero. It must update next_out and avail_out when avail_out
has dropped to zero. The application must initialize zalloc, zfree and
opaque before calling the init function. All other fields are set by the
compression library and must not be updated by the application.
The opaque value provided by the application will be passed as the first
parameter for calls of zalloc and zfree. This can be useful for custom
memory management. The compression library attaches no meaning to the
opaque value.
zalloc must return Z_NULL if there is not enough memory for the object.
If zlib is used in a multi-threaded application, zalloc and zfree must be
thread safe.
On 16-bit systems, the functions zalloc and zfree must be able to allocate
exactly 65536 bytes, but will not be required to allocate more than this
if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS,
pointers returned by zalloc for objects of exactly 65536 bytes *must*
have their offset normalized to zero. The default allocation function
provided by this library ensures this (see zutil.c). To reduce memory
requirements and avoid any allocation of 64K objects, at the expense of
compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h).
The fields total_in and total_out can be used for statistics or
progress reports. After compression, total_in holds the total size of
the uncompressed data and may be saved for use in the decompressor
(particularly if the decompressor wants to decompress everything in
a single step).
*/
/* constants */
#define Z_NO_FLUSH 0
#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */
#define Z_SYNC_FLUSH 2
#define Z_FULL_FLUSH 3
#define Z_FINISH 4
#define Z_BLOCK 5
/* Allowed flush values; see deflate() and inflate() below for details */
#define Z_OK 0
#define Z_STREAM_END 1
#define Z_NEED_DICT 2
#define Z_ERRNO (-1)
#define Z_STREAM_ERROR (-2)
#define Z_DATA_ERROR (-3)
#define Z_MEM_ERROR (-4)
#define Z_BUF_ERROR (-5)
#define Z_VERSION_ERROR (-6)
/* Return codes for the compression/decompression functions. Negative
* values are errors, positive values are used for special but normal events.
*/
#define Z_NO_COMPRESSION 0
#define Z_BEST_SPEED 1
#define Z_BEST_COMPRESSION 9
#define Z_DEFAULT_COMPRESSION (-1)
/* compression levels */
#define Z_FILTERED 1
#define Z_HUFFMAN_ONLY 2
#define Z_RLE 3
#define Z_DEFAULT_STRATEGY 0
/* compression strategy; see deflateInit2() below for details */
#define Z_BINARY 0
#define Z_ASCII 1
#define Z_UNKNOWN 2
/* Possible values of the data_type field (though see inflate()) */
#define Z_DEFLATED 8
/* The deflate compression method (the only one supported in this version) */
#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */
#define zlib_version zlibVersion()
/* for compatibility with versions < 1.0.2 */
/* basic functions */
ZEXTERN const char * ZEXPORT zlibVersion OF((void));
/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
If the first character differs, the library code actually used is
not compatible with the zlib.h header file used by the application.
This check is automatically made by deflateInit and inflateInit.
*/
/*
ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
Initializes the internal stream state for compression. The fields
zalloc, zfree and opaque must be initialized before by the caller.
If zalloc and zfree are set to Z_NULL, deflateInit updates them to
use default allocation functions.
The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
1 gives best speed, 9 gives best compression, 0 gives no compression at
all (the input data is simply copied a block at a time).
Z_DEFAULT_COMPRESSION requests a default compromise between speed and
compression (currently equivalent to level 6).
deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not
enough memory, Z_STREAM_ERROR if level is not a valid compression level,
Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
with the version assumed by the caller (ZLIB_VERSION).
msg is set to null if there is no error message. deflateInit does not
perform any compression: this will be done by deflate().
*/
ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
/*
deflate compresses as much data as possible, and stops when the input
buffer becomes empty or the output buffer becomes full. It may introduce some
output latency (reading input without producing any output) except when
forced to flush.
The detailed semantics are as follows. deflate performs one or both of the
following actions:
- Compress more input starting at next_in and update next_in and avail_in
accordingly. If not all input can be processed (because there is not
enough room in the output buffer), next_in and avail_in are updated and
processing will resume at this point for the next call of deflate().
- Provide more output starting at next_out and update next_out and avail_out
accordingly. This action is forced if the parameter flush is non zero.
Forcing flush frequently degrades the compression ratio, so this parameter
should be set only when necessary (in interactive applications).
Some output may be provided even if flush is not set.
Before the call of deflate(), the application should ensure that at least
one of the actions is possible, by providing more input and/or consuming
more output, and updating avail_in or avail_out accordingly; avail_out
should never be zero before the call. The application can consume the
compressed output when it wants, for example when the output buffer is full
(avail_out == 0), or after each call of deflate(). If deflate returns Z_OK
and with zero avail_out, it must be called again after making room in the
output buffer because there might be more output pending.
If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
flushed to the output buffer and the output is aligned on a byte boundary, so
that the decompressor can get all input data available so far. (In particular
avail_in is zero after the call if enough output space has been provided
before the call.) Flushing may degrade compression for some compression
algorithms and so it should be used only when necessary.
If flush is set to Z_FULL_FLUSH, all output is flushed as with
Z_SYNC_FLUSH, and the compression state is reset so that decompression can
restart from this point if previous compressed data has been damaged or if
random access is desired. Using Z_FULL_FLUSH too often can seriously degrade
the compression.
If deflate returns with avail_out == 0, this function must be called again
with the same value of the flush parameter and more output space (updated
avail_out), until the flush is complete (deflate returns with non-zero
avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that
avail_out is greater than six to avoid repeated flush markers due to
avail_out == 0 on return.
If the parameter flush is set to Z_FINISH, pending input is processed,
pending output is flushed and deflate returns with Z_STREAM_END if there
was enough output space; if deflate returns with Z_OK, this function must be
called again with Z_FINISH and more output space (updated avail_out) but no
more input data, until it returns with Z_STREAM_END or an error. After
deflate has returned Z_STREAM_END, the only possible operations on the
stream are deflateReset or deflateEnd.
Z_FINISH can be used immediately after deflateInit if all the compression
is to be done in a single step. In this case, avail_out must be at least
the value returned by deflateBound (see below). If deflate does not return
Z_STREAM_END, then it must be called again as described above.
deflate() sets strm->adler to the adler32 checksum of all input read
so far (that is, total_in bytes).
deflate() may update data_type if it can make a good guess about
the input data type (Z_ASCII or Z_BINARY). In doubt, the data is considered
binary. This field is only for information purposes and does not affect
the compression algorithm in any manner.
deflate() returns Z_OK if some progress has been made (more input
processed or more output produced), Z_STREAM_END if all input has been
consumed and all output has been produced (only when flush is set to
Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible
(for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not
fatal, and deflate() can be called again with more input and more output
space to continue compressing.
*/
ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
/*
All dynamically allocated data structures for this stream are freed.
This function discards any unprocessed input and does not flush any
pending output.
deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
stream state was inconsistent, Z_DATA_ERROR if the stream was freed
prematurely (some input or output was discarded). In the error case,
msg may be set but then points to a static string (which must not be
deallocated).
*/
/*
ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
Initializes the internal stream state for decompression. The fields
next_in, avail_in, zalloc, zfree and opaque must be initialized before by
the caller. If next_in is not Z_NULL and avail_in is large enough (the exact
value depends on the compression method), inflateInit determines the
compression method from the zlib header and allocates all data structures
accordingly; otherwise the allocation will be deferred to the first call of
inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to
use default allocation functions.
inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
version assumed by the caller. msg is set to null if there is no error
message. inflateInit does not perform any decompression apart from reading
the zlib header if present: this will be done by inflate(). (So next_in and
avail_in may be modified, but next_out and avail_out are unchanged.)
*/
ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
/*
inflate decompresses as much data as possible, and stops when the input
buffer becomes empty or the output buffer becomes full. It may introduce
some output latency (reading input without producing any output) except when
forced to flush.
The detailed semantics are as follows. inflate performs one or both of the
following actions:
- Decompress more input starting at next_in and update next_in and avail_in
accordingly. If not all input can be processed (because there is not
enough room in the output buffer), next_in is updated and processing
will resume at this point for the next call of inflate().
- Provide more output starting at next_out and update next_out and avail_out
accordingly. inflate() provides as much output as possible, until there
is no more input data or no more space in the output buffer (see below
about the flush parameter).
Before the call of inflate(), the application should ensure that at least
one of the actions is possible, by providing more input and/or consuming
more output, and updating the next_* and avail_* values accordingly.
The application can consume the uncompressed output when it wants, for
example when the output buffer is full (avail_out == 0), or after each
call of inflate(). If inflate returns Z_OK and with zero avail_out, it
must be called again after making room in the output buffer because there
might be more output pending.
The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH,
Z_FINISH, or Z_BLOCK. Z_SYNC_FLUSH requests that inflate() flush as much
output as possible to the output buffer. Z_BLOCK requests that inflate() stop
if and when it get to the next deflate block boundary. When decoding the zlib
or gzip format, this will cause inflate() to return immediately after the
header and before the first block. When doing a raw inflate, inflate() will
go ahead and process the first block, and will return when it gets to the end
of that block, or when it runs out of data.
The Z_BLOCK option assists in appending to or combining deflate streams.
Also to assist in this, on return inflate() will set strm->data_type to the
number of unused bits in the last byte taken from strm->next_in, plus 64
if inflate() is currently decoding the last block in the deflate stream,
plus 128 if inflate() returned immediately after decoding an end-of-block
code or decoding the complete header up to just before the first byte of the
deflate stream. The end-of-block will not be indicated until all of the
uncompressed data from that block has been written to strm->next_out. The
number of unused bits may in general be greater than seven, except when
bit 7 of data_type is set, in which case the number of unused bits will be
less than eight.
inflate() should normally be called until it returns Z_STREAM_END or an
error. However if all decompression is to be performed in a single step
(a single call of inflate), the parameter flush should be set to
Z_FINISH. In this case all pending input is processed and all pending
output is flushed; avail_out must be large enough to hold all the
uncompressed data. (The size of the uncompressed data may have been saved
by the compressor for this purpose.) The next operation on this stream must
be inflateEnd to deallocate the decompression state. The use of Z_FINISH
is never required, but can be used to inform inflate that a faster approach
may be used for the single inflate() call.
In this implementation, inflate() always flushes as much output as
possible to the output buffer, and always uses the faster approach on the
first call. So the only effect of the flush parameter in this implementation
is on the return value of inflate(), as noted below, or when it returns early
because Z_BLOCK is used.
If a preset dictionary is needed after this call (see inflateSetDictionary
below), inflate sets strm-adler to the adler32 checksum of the dictionary
chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
strm->adler to the adler32 checksum of all output produced so far (that is,
total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
below. At the end of the stream, inflate() checks that its computed adler32
checksum is equal to that saved by the compressor and returns Z_STREAM_END
only if the checksum is correct.
inflate() will decompress and check either zlib-wrapped or gzip-wrapped
deflate data. The header type is detected automatically. Any information
contained in the gzip header is not retained, so applications that need that
information should instead use raw inflate, see inflateInit2() below, or
inflateBack() and perform their own processing of the gzip header and
trailer.
inflate() returns Z_OK if some progress has been made (more input processed
or more output produced), Z_STREAM_END if the end of the compressed data has
been reached and all uncompressed output has been produced, Z_NEED_DICT if a
preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
corrupted (input stream not conforming to the zlib format or incorrect check
value), Z_STREAM_ERROR if the stream structure was inconsistent (for example
if next_in or next_out was NULL), Z_MEM_ERROR if there was not enough memory,
Z_BUF_ERROR if no progress is possible or if there was not enough room in the
output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and
inflate() can be called again with more input and more output space to
continue decompressing. If Z_DATA_ERROR is returned, the application may then
call inflateSync() to look for a good compression block if a partial recovery
of the data is desired.
*/
ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
/*
All dynamically allocated data structures for this stream are freed.
This function discards any unprocessed input and does not flush any
pending output.
inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
was inconsistent. In the error case, msg may be set but then points to a
static string (which must not be deallocated).
*/
/* Advanced functions */
/*
The following functions are needed only in some special applications.
*/
/*
ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
int level,
int method,
int windowBits,
int memLevel,
int strategy));
This is another version of deflateInit with more compression options. The
fields next_in, zalloc, zfree and opaque must be initialized before by
the caller.
The method parameter is the compression method. It must be Z_DEFLATED in
this version of the library.
The windowBits parameter is the base two logarithm of the window size
(the size of the history buffer). It should be in the range 8..15 for this
version of the library. Larger values of this parameter result in better
compression at the expense of memory usage. The default value is 15 if
deflateInit is used instead.
windowBits can also be -8..-15 for raw deflate. In this case, -windowBits
determines the window size. deflate() will then generate raw deflate data
with no zlib header or trailer, and will not compute an adler32 check value.
windowBits can also be greater than 15 for optional gzip encoding. Add
16 to windowBits to write a simple gzip header and trailer around the
compressed data instead of a zlib wrapper. The gzip header will have no
file name, no extra data, no comment, no modification time (set to zero),
no header crc, and the operating system will be set to 255 (unknown).
The memLevel parameter specifies how much memory should be allocated
for the internal compression state. memLevel=1 uses minimum memory but
is slow and reduces compression ratio; memLevel=9 uses maximum memory
for optimal speed. The default value is 8. See zconf.h for total memory
usage as a function of windowBits and memLevel.
The strategy parameter is used to tune the compression algorithm. Use the
value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no
string match), or Z_RLE to limit match distances to one (run-length
encoding). Filtered data consists mostly of small values with a somewhat
random distribution. In this case, the compression algorithm is tuned to
compress them better. The effect of Z_FILTERED is to force more Huffman
coding and less string matching; it is somewhat intermediate between
Z_DEFAULT and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as fast as
Z_HUFFMAN_ONLY, but give better compression for PNG image data. The strategy
parameter only affects the compression ratio but not the correctness of the
compressed output even if it is not set appropriately.
deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid
method). msg is set to null if there is no error message. deflateInit2 does
not perform any compression: this will be done by deflate().
*/
ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
const Bytef *dictionary,
uInt dictLength));
/*
Initializes the compression dictionary from the given byte sequence
without producing any compressed output. This function must be called
immediately after deflateInit, deflateInit2 or deflateReset, before any
call of deflate. The compressor and decompressor must use exactly the same
dictionary (see inflateSetDictionary).
The dictionary should consist of strings (byte sequences) that are likely
to be encountered later in the data to be compressed, with the most commonly
used strings preferably put towards the end of the dictionary. Using a
dictionary is most useful when the data to be compressed is short and can be
predicted with good accuracy; the data can then be compressed better than
with the default empty dictionary.
Depending on the size of the compression data structures selected by
deflateInit or deflateInit2, a part of the dictionary may in effect be
discarded, for example if the dictionary is larger than the window size in
deflate or deflate2. Thus the strings most likely to be useful should be
put at the end of the dictionary, not at the front.
Upon return of this function, strm->adler is set to the adler32 value
of the dictionary; the decompressor may later use this value to determine
which dictionary has been used by the compressor. (The adler32 value
applies to the whole dictionary even if only a subset of the dictionary is
actually used by the compressor.) If a raw deflate was requested, then the
adler32 value is not computed and strm->adler is not set.
deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
parameter is invalid (such as NULL dictionary) or the stream state is
inconsistent (for example if deflate has already been called for this stream
or if the compression method is bsort). deflateSetDictionary does not
perform any compression: this will be done by deflate().
*/
ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
z_streamp source));
/*
Sets the destination stream as a complete copy of the source stream.
This function can be useful when several compression strategies will be
tried, for example when there are several ways of pre-processing the input
data with a filter. The streams that will be discarded should then be freed
by calling deflateEnd. Note that deflateCopy duplicates the internal
compression state which can be quite large, so this strategy is slow and
can consume lots of memory.
deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
(such as zalloc being NULL). msg is left unchanged in both source and
destination.
*/
ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
/*
This function is equivalent to deflateEnd followed by deflateInit,
but does not free and reallocate all the internal compression state.
The stream will keep the same compression level and any other attributes
that may have been set by deflateInit2.
deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
stream state was inconsistent (such as zalloc or state being NULL).
*/
ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
int level,
int strategy));
/*
Dynamically update the compression level and compression strategy. The
interpretation of level and strategy is as in deflateInit2. This can be
used to switch between compression and straight copy of the input data, or
to switch to a different kind of input data requiring a different
strategy. If the compression level is changed, the input available so far
is compressed with the old level (and may be flushed); the new level will
take effect only at the next call of deflate().
Before the call of deflateParams, the stream state must be set as for
a call of deflate(), since the currently available input may have to
be compressed and flushed. In particular, strm->avail_out must be non-zero.
deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR
if strm->avail_out was zero.
*/
ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
uLong sourceLen));
/*
deflateBound() returns an upper bound on the compressed size after
deflation of sourceLen bytes. It must be called after deflateInit()
or deflateInit2(). This would be used to allocate an output buffer
for deflation in a single pass, and so would be called before deflate().
*/
ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
int bits,
int value));
/*
deflatePrime() inserts bits in the deflate output stream. The intent
is that this function is used to start off the deflate output with the
bits leftover from a previous deflate stream when appending to it. As such,
this function can only be used for raw deflate, and must be used before the
first deflate() call after a deflateInit2() or deflateReset(). bits must be
less than or equal to 16, and that many of the least significant bits of
value will be inserted in the output.
deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
stream state was inconsistent.
*/
/*
ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
int windowBits));
This is another version of inflateInit with an extra parameter. The
fields next_in, avail_in, zalloc, zfree and opaque must be initialized
before by the caller.
The windowBits parameter is the base two logarithm of the maximum window
size (the size of the history buffer). It should be in the range 8..15 for
this version of the library. The default value is 15 if inflateInit is used
instead. windowBits must be greater than or equal to the windowBits value
provided to deflateInit2() while compressing, or it must be equal to 15 if
deflateInit2() was not used. If a compressed stream with a larger window
size is given as input, inflate() will return with the error code
Z_DATA_ERROR instead of trying to allocate a larger window.
windowBits can also be -8..-15 for raw inflate. In this case, -windowBits
determines the window size. inflate() will then process raw deflate data,
not looking for a zlib or gzip header, not generating a check value, and not
looking for any check values for comparison at the end of the stream. This
is for use with other formats that use the deflate compressed data format
such as zip. Those formats provide their own check values. If a custom
format is developed using the raw deflate format for compressed data, it is
recommended that a check value such as an adler32 or a crc32 be applied to
the uncompressed data as is done in the zlib, gzip, and zip formats. For
most applications, the zlib format should be used as is. Note that comments
above on the use in deflateInit2() applies to the magnitude of windowBits.
windowBits can also be greater than 15 for optional gzip decoding. Add
32 to windowBits to enable zlib and gzip decoding with automatic header
detection, or add 16 to decode only the gzip format (the zlib format will
return a Z_DATA_ERROR).
inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative
memLevel). msg is set to null if there is no error message. inflateInit2
does not perform any decompression apart from reading the zlib header if
present: this will be done by inflate(). (So next_in and avail_in may be
modified, but next_out and avail_out are unchanged.)
*/
ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
const Bytef *dictionary,
uInt dictLength));
/*
Initializes the decompression dictionary from the given uncompressed byte
sequence. This function must be called immediately after a call of inflate
if this call returned Z_NEED_DICT. The dictionary chosen by the compressor
can be determined from the adler32 value returned by this call of
inflate. The compressor and decompressor must use exactly the same
dictionary (see deflateSetDictionary).
inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
parameter is invalid (such as NULL dictionary) or the stream state is
inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
expected one (incorrect adler32 value). inflateSetDictionary does not
perform any decompression: this will be done by subsequent calls of
inflate().
*/
ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
/*
Skips invalid compressed data until a full flush point (see above the
description of deflate with Z_FULL_FLUSH) can be found, or until all
available input is skipped. No output is provided.
inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR
if no more input was provided, Z_DATA_ERROR if no flush point has been found,
or Z_STREAM_ERROR if the stream structure was inconsistent. In the success
case, the application may save the current current value of total_in which
indicates where valid compressed data was found. In the error case, the
application may repeatedly call inflateSync, providing more input each time,
until success or end of the input data.
*/
ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
z_streamp source));
/*
Sets the destination stream as a complete copy of the source stream.
This function can be useful when randomly accessing a large stream. The
first pass through the stream can periodically record the inflate state,
allowing restarting inflate at those points when randomly accessing the
stream.
inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
(such as zalloc being NULL). msg is left unchanged in both source and
destination.
*/
ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
/*
This function is equivalent to inflateEnd followed by inflateInit,
but does not free and reallocate all the internal decompression state.
The stream will keep attributes that may have been set by inflateInit2.
inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
stream state was inconsistent (such as zalloc or state being NULL).
*/
/*
ZEXTERN int ZEXPORT inflateBackInit OF((z_stream FAR *strm, int windowBits,
unsigned char FAR *window));
Initialize the internal stream state for decompression using inflateBack()
calls. The fields zalloc, zfree and opaque in strm must be initialized
before the call. If zalloc and zfree are Z_NULL, then the default library-
derived memory allocation routines are used. windowBits is the base two
logarithm of the window size, in the range 8..15. window is a caller
supplied buffer of that size. Except for special applications where it is
assured that deflate was used with small window sizes, windowBits must be 15
and a 32K byte window must be supplied to be able to decompress general
deflate streams.
See inflateBack() for the usage of these routines.
inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
the paramaters are invalid, Z_MEM_ERROR if the internal state could not
be allocated, or Z_VERSION_ERROR if the version of the library does not
match the version of the header file.
*/
typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *));
typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
ZEXTERN int ZEXPORT inflateBack OF((z_stream FAR *strm,
in_func in, void FAR *in_desc,
out_func out, void FAR *out_desc));
/*
inflateBack() does a raw inflate with a single call using a call-back
interface for input and output. This is more efficient than inflate() for
file i/o applications in that it avoids copying between the output and the
sliding window by simply making the window itself the output buffer. This
function trusts the application to not change the output buffer passed by
the output function, at least until inflateBack() returns.
inflateBackInit() must be called first to allocate the internal state
and to initialize the state with the user-provided window buffer.
inflateBack() may then be used multiple times to inflate a complete, raw
deflate stream with each call. inflateBackEnd() is then called to free
the allocated state.
A raw deflate stream is one with no zlib or gzip header or trailer.
This routine would normally be used in a utility that reads zip or gzip
files and writes out uncompressed files. The utility would decode the
header and process the trailer on its own, hence this routine expects
only the raw deflate stream to decompress. This is different from the
normal behavior of inflate(), which expects either a zlib or gzip header and
trailer around the deflate stream.
inflateBack() uses two subroutines supplied by the caller that are then
called by inflateBack() for input and output. inflateBack() calls those
routines until it reads a complete deflate stream and writes out all of the
uncompressed data, or until it encounters an error. The function's
parameters and return types are defined above in the in_func and out_func
typedefs. inflateBack() will call in(in_desc, &buf) which should return the
number of bytes of provided input, and a pointer to that input in buf. If
there is no input available, in() must return zero--buf is ignored in that
case--and inflateBack() will return a buffer error. inflateBack() will call
out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out()
should return zero on success, or non-zero on failure. If out() returns
non-zero, inflateBack() will return with an error. Neither in() nor out()
are permitted to change the contents of the window provided to
inflateBackInit(), which is also the buffer that out() uses to write from.
The length written by out() will be at most the window size. Any non-zero
amount of input may be provided by in().
For convenience, inflateBack() can be provided input on the first call by
setting strm->next_in and strm->avail_in. If that input is exhausted, then
in() will be called. Therefore strm->next_in must be initialized before
calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called
immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in
must also be initialized, and then if strm->avail_in is not zero, input will
initially be taken from strm->next_in[0 .. strm->avail_in - 1].
The in_desc and out_desc parameters of inflateBack() is passed as the
first parameter of in() and out() respectively when they are called. These
descriptors can be optionally used to pass any information that the caller-
supplied in() and out() functions need to do their job.
On return, inflateBack() will set strm->next_in and strm->avail_in to
pass back any unused input that was provided by the last in() call. The
return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR
if in() or out() returned an error, Z_DATA_ERROR if there was a format
error in the deflate stream (in which case strm->msg is set to indicate the
nature of the error), or Z_STREAM_ERROR if the stream was not properly
initialized. In the case of Z_BUF_ERROR, an input or output error can be
distinguished using strm->next_in which will be Z_NULL only if in() returned
an error. If strm->next is not Z_NULL, then the Z_BUF_ERROR was due to
out() returning non-zero. (in() will always be called before out(), so
strm->next_in is assured to be defined if out() returns non-zero.) Note
that inflateBack() cannot return Z_OK.
*/
ZEXTERN int ZEXPORT inflateBackEnd OF((z_stream FAR *strm));
/*
All memory allocated by inflateBackInit() is freed.
inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream
state was inconsistent.
*/
ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
/* Return flags indicating compile-time options.
Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other:
1.0: size of uInt
3.2: size of uLong
5.4: size of voidpf (pointer)
7.6: size of z_off_t
Compiler, assembler, and debug options:
8: DEBUG
9: ASMV or ASMINF -- use ASM code
10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention
11: 0 (reserved)
One-time table building (smaller code, but not thread-safe if true):
12: BUILDFIXED -- build static block decoding tables when needed
13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed
14,15: 0 (reserved)
Library content (indicates missing functionality):
16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking
deflate code when not needed)
17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect
and decode gzip streams (to avoid linking crc code)
18-19: 0 (reserved)
Operation variations (changes in library functionality):
20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate
21: FASTEST -- deflate algorithm with only one, lowest compression level
22,23: 0 (reserved)
The sprintf variant used by gzprintf (zero is best):
24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format
25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure!
26: 0 = returns value, 1 = void -- 1 means inferred string length returned
Remainder:
27-31: 0 (reserved)
*/
/* utility functions */
/*
The following utility functions are implemented on top of the
basic stream-oriented functions. To simplify the interface, some
default options are assumed (compression level and memory usage,
standard memory allocation functions). The source code of these
utility functions can easily be modified if you need special options.
*/
ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
const Bytef *source, uLong sourceLen));
/*
Compresses the source buffer into the destination buffer. sourceLen is
the byte length of the source buffer. Upon entry, destLen is the total
size of the destination buffer, which must be at least the value returned
by compressBound(sourceLen). Upon exit, destLen is the actual size of the
compressed buffer.
This function can be used to compress a whole file at once if the
input file is mmap'ed.
compress returns Z_OK if success, Z_MEM_ERROR if there was not
enough memory, Z_BUF_ERROR if there was not enough room in the output
buffer.
*/
ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen,
const Bytef *source, uLong sourceLen,
int level));
/*
Compresses the source buffer into the destination buffer. The level
parameter has the same meaning as in deflateInit. sourceLen is the byte
length of the source buffer. Upon entry, destLen is the total size of the
destination buffer, which must be at least the value returned by
compressBound(sourceLen). Upon exit, destLen is the actual size of the
compressed buffer.
compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
memory, Z_BUF_ERROR if there was not enough room in the output buffer,
Z_STREAM_ERROR if the level parameter is invalid.
*/
ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen));
/*
compressBound() returns an upper bound on the compressed size after
compress() or compress2() on sourceLen bytes. It would be used before
a compress() or compress2() call to allocate the destination buffer.
*/
ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
const Bytef *source, uLong sourceLen));
/*
Decompresses the source buffer into the destination buffer. sourceLen is
the byte length of the source buffer. Upon entry, destLen is the total
size of the destination buffer, which must be large enough to hold the
entire uncompressed data. (The size of the uncompressed data must have
been saved previously by the compressor and transmitted to the decompressor
by some mechanism outside the scope of this compression library.)
Upon exit, destLen is the actual size of the compressed buffer.
This function can be used to decompress a whole file at once if the
input file is mmap'ed.
uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
enough memory, Z_BUF_ERROR if there was not enough room in the output
buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete.
*/
typedef voidp gzFile;
ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
/*
Opens a gzip (.gz) file for reading or writing. The mode parameter
is as in fopen ("rb" or "wb") but can also include a compression level
("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for
Huffman only compression as in "wb1h", or 'R' for run-length encoding
as in "wb1R". (See the description of deflateInit2 for more information
about the strategy parameter.)
gzopen can be used to read a file which is not in gzip format; in this
case gzread will directly read from the file without decompression.
gzopen returns NULL if the file could not be opened or if there was
insufficient memory to allocate the (de)compression state; errno
can be checked to distinguish the two cases (if errno is zero, the
zlib error is Z_MEM_ERROR). */
ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
/*
gzdopen() associates a gzFile with the file descriptor fd. File
descriptors are obtained from calls like open, dup, creat, pipe or
fileno (in the file has been previously opened with fopen).
The mode parameter is as in gzopen.
The next call of gzclose on the returned gzFile will also close the
file descriptor fd, just like fclose(fdopen(fd), mode) closes the file
descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode).
gzdopen returns NULL if there was insufficient memory to allocate
the (de)compression state.
*/
ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
/*
Dynamically update the compression level or strategy. See the description
of deflateInit2 for the meaning of these parameters.
gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
opened for writing.
*/
ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
/*
Reads the given number of uncompressed bytes from the compressed file.
If the input file was not in gzip format, gzread copies the given number
of bytes into the buffer.
gzread returns the number of uncompressed bytes actually read (0 for
end of file, -1 for error). */
ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
voidpc buf, unsigned len));
/*
Writes the given number of uncompressed bytes into the compressed file.
gzwrite returns the number of uncompressed bytes actually written
(0 in case of error).
*/
ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));
/*
Converts, formats, and writes the args to the compressed file under
control of the format string, as in fprintf. gzprintf returns the number of
uncompressed bytes actually written (0 in case of error). The number of
uncompressed bytes written is limited to 4095. The caller should assure that
this limit is not exceeded. If it is exceeded, then gzprintf() will return
return an error (0) with nothing written. In this case, there may also be a
buffer overflow with unpredictable consequences, which is possible only if
zlib was compiled with the insecure functions sprintf() or vsprintf()
because the secure snprintf() or vsnprintf() functions were not available.
*/
ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
/*
Writes the given null-terminated string to the compressed file, excluding
the terminating null character.
gzputs returns the number of characters written, or -1 in case of error.
*/
ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
/*
Reads bytes from the compressed file until len-1 characters are read, or
a newline character is read and transferred to buf, or an end-of-file
condition is encountered. The string is then terminated with a null
character.
gzgets returns buf, or Z_NULL in case of error.
*/
ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
/*
Writes c, converted to an unsigned char, into the compressed file.
gzputc returns the value that was written, or -1 in case of error.
*/
ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
/*
Reads one byte from the compressed file. gzgetc returns this byte
or -1 in case of end of file or error.
*/
ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
/*
Push one character back onto the stream to be read again later.
Only one character of push-back is allowed. gzungetc() returns the
character pushed, or -1 on failure. gzungetc() will fail if a
character has been pushed but not read yet, or if c is -1. The pushed
character will be discarded if the stream is repositioned with gzseek()
or gzrewind().
*/
ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
/*
Flushes all pending output into the compressed file. The parameter
flush is as in the deflate() function. The return value is the zlib
error number (see function gzerror below). gzflush returns Z_OK if
the flush parameter is Z_FINISH and all output could be flushed.
gzflush should be called only when strictly necessary because it can
degrade compression.
*/
ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
z_off_t offset, int whence));
/*
Sets the starting position for the next gzread or gzwrite on the
given compressed file. The offset represents a number of bytes in the
uncompressed data stream. The whence parameter is defined as in lseek(2);
the value SEEK_END is not supported.
If the file is opened for reading, this function is emulated but can be
extremely slow. If the file is opened for writing, only forward seeks are
supported; gzseek then compresses a sequence of zeroes up to the new
starting position.
gzseek returns the resulting offset location as measured in bytes from
the beginning of the uncompressed stream, or -1 in case of error, in
particular if the file is opened for writing and the new starting position
would be before the current position.
*/
ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
/*
Rewinds the given file. This function is supported only for reading.
gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
*/
ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
/*
Returns the starting position for the next gzread or gzwrite on the
given compressed file. This position represents a number of bytes in the
uncompressed data stream.
gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
*/
ZEXTERN int ZEXPORT gzeof OF((gzFile file));
/*
Returns 1 when EOF has previously been detected reading the given
input stream, otherwise zero.
*/
ZEXTERN int ZEXPORT gzclose OF((gzFile file));
/*
Flushes all pending output if necessary, closes the compressed file
and deallocates all the (de)compression state. The return value is the zlib
error number (see function gzerror below).
*/
ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
/*
Returns the error message for the last error which occurred on the
given compressed file. errnum is set to zlib error number. If an
error occurred in the file system and not in the compression library,
errnum is set to Z_ERRNO and the application may consult errno
to get the exact error code.
*/
ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
/*
Clears the error and end-of-file flags for file. This is analogous to the
clearerr() function in stdio. This is useful for continuing to read a gzip
file that is being written concurrently.
*/
/* checksum functions */
/*
These functions are not related to compression but are exported
anyway because they might be useful in applications using the
compression library.
*/
ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
/*
Update a running Adler-32 checksum with the bytes buf[0..len-1] and
return the updated checksum. If buf is NULL, this function returns
the required initial value for the checksum.
An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
much faster. Usage example:
uLong adler = adler32(0L, Z_NULL, 0);
while (read_buffer(buffer, length) != EOF) {
adler = adler32(adler, buffer, length);
}
if (adler != original_adler) error();
*/
ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
/*
Update a running crc with the bytes buf[0..len-1] and return the updated
crc. If buf is NULL, this function returns the required initial value
for the crc. Pre- and post-conditioning (one's complement) is performed
within this function so it shouldn't be done by the application.
Usage example:
uLong crc = crc32(0L, Z_NULL, 0);
while (read_buffer(buffer, length) != EOF) {
crc = crc32(crc, buffer, length);
}
if (crc != original_crc) error();
*/
/* various hacks, don't look :) */
/* deflateInit and inflateInit are macros to allow checking the zlib version
* and the compiler's view of z_stream:
*/
ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
const char *version, int stream_size));
ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
const char *version, int stream_size));
ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method,
int windowBits, int memLevel,
int strategy, const char *version,
int stream_size));
ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
const char *version, int stream_size));
ZEXTERN int ZEXPORT inflateBackInit_ OF((z_stream FAR *strm, int windowBits,
unsigned char FAR *window,
const char *version,
int stream_size));
#define deflateInit(strm, level) \
deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream))
#define inflateInit(strm) \
inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream))
#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
(strategy), ZLIB_VERSION, sizeof(z_stream))
#define inflateInit2(strm, windowBits) \
inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
#define inflateBackInit(strm, windowBits, window) \
inflateBackInit_((strm), (windowBits), (window), \
ZLIB_VERSION, sizeof(z_stream))
#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL)
struct internal_state {int dummy;}; /* hack for buggy compilers */
#endif
ZEXTERN const char * ZEXPORT zError OF((int err));
ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z));
ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void));
#ifdef __cplusplus
}
#endif
#endif /* ZLIB_H */
|
Added work/index.ttml.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<TITLE>
<+
# Copyright (C) 2001 Roy Keene
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# email: index@rkeene.org
hgetvars
set path [file dirname $ENVS(DOCUMENT_URI)]
if {$path=="/"} { set path "" }
set path "$path/"
hputs "http://$ENVS(HTTP_HOST)$path"
proc convtoext {data} {
set output ""
for {set i 0} {$i<[string length $data]} {incr i} {
set curr [string index $data $i]
if {![string match "\[a-z,A-Z,0-9,.\]" $curr]} {
set curr [format "%%%x" [ctype ord $curr]]
}
set output "$output$curr"
}
return $output
}
+>
</TITLE>
</HEAD>
<+
set color(tarball) #D00000
set color(directory) #0000FF
set color(html) "#FF00FF"
set color(jpeg) "#FF00FF"
set color(text) "#000000"
set color(cgi) "#00FF00"
set color(tcl) "#00E000"
set color(header) "#000000"
set color(c) "#000000"
set color(makefile) "#000000"
set color(readme) "#000000"
set color(exe) "#00FF00"
set color(mp3) "#FFFF00"
set color(default) "#000000"
set color(bc) "#808080"
set color(zip) "#D00000"
set color(gif) "#FF00FF"
set types(tarball) *.tar.gz
set types(html) *.html
set types(text) *.txt
set types(cgi) *.cgi
set types(jpeg) *.jpg
set types(header) *.h
set types(c) *.c
set types(makefile) \[Mm\]akefile
set types(readme) "*\[Rr\]\[Ee\]\[Aa\]\[Dd\]\[Mm\]\[Ee\]*"
set types(exe) *.exe
set types(tcl) *.tcl
set types(mp3) *.mp3
set types(zip) *.zip
set types(bc) *.bc
set types(gif) *.gif
+>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF">
<TT>
<+
catch {
set fileId [open /web/rkeene/.counter r+]
gets $fileId cnt
seek $fileId 0 start
puts $fileId [expr $cnt+1]
close $fileId
}
if {[info exists cnt]} { hputs $cnt }
+>
[rkeene@unleaded
<+
if {[string index $path 1]=="~"} {
set path [string range $path [expr [string first / [string range $path 1 end]]+1] end]
}
set path [string range $path 0 [expr [string length $path]-2]]
hputs "/home/rkeene$path\]\$ ls -am<BR>"
set files ""
hputs "<A HREF=\"./\"><FONT COLOR=\"$color(directory)\">.</FONT>/</A>, <A HREF=\"../\"><FONT COLOR=\"$color(directory)\">..</FONT>/</A>"
foreach file [lsort [glob *]] {
if {[file type $file]!="link" || [file exists $file\.desc]} {
if {[file isdir $file]} {
hputs ", <A HREF=\"[convtoext $file]/\"><FONT COLOR=\"$color(directory)\">$file</FONT>/</A>"
lappend files "$file directory"
} else {
set DSTcolor default
if {[file executable $file]} { set DSTcolor exe }
foreach item [lsort [array names types]] {
if {[string match $types($item) $file]} {
set DSTcolor $item
break
}
}
if {![string match "*.\[dt\]\[et\]\[sm\]\[cl\]" $file]} {
hputs ", <A HREF=\"[convtoext $file]\"><FONT COLOR=\"$color($DSTcolor)\">$file</FONT></A>"
lappend files "$file $DSTcolor"
}
}
}
}
hputs "<BR>"
if {[info exists cnt]} { hputs "[expr $cnt+1] " }
hputs "\[rkeene@unleaded /home/rkeene$path\]\$ "
+>
</TT><HR WIDTH="75%" SIZE=1>
<+
foreach file $files {
set tof [lindex $file 1]
set file [lindex $file 0]
if {[file exists $file\.desc]} {
set fileId [open $file\.desc r]
set desc ""
while {![eof $fileId]} {
gets $fileId ln
set desc "$desc\n$ln"
}
set desc [string range $desc 1 end]
close $fileId
set slash [lindex {{} {/}} [file isdir $file]]
hputs "<A HREF=\"$file$slash\"><FONT COLOR=\"$color($tof)\">$file</FONT>$slash</A> $desc<BR>"
}
}
+>
<+
if {[string tolower $ENVS(SERVER_NAME)]!="www.rkeene.org"} {
set directory "~rkeene/"
} else {
set directory ""
}
hputs " -- <A HREF=\"/$directory\work/resume-rk.html\">Roy Keene</A> \[<A HREF=\"http://shammack.n-f-d.com/date.html\">0290120002010</A>\] <A HREF=\"mailto:rkeene@rkeene.org\">rkeene@rkeene.org</A>"
+>
<+
if {![info exists ENVS(HTTP_REFERER)]} { set ENVS(HTTP_REFERER) "-" }
if {[string match "*shammack*" $ENVS(HTTP_REFERER)]} {
+>
<HR WIDTH="75%">
<PRE><A HREF="http://morgus.ddns.org/">morgus</A>:/home/deadduck# ls -l
...
l---rwsr-- 1 112 11312 18446744073441116198 Dec 31 1969 #63746
pr-sr-xr-t 1 13403 27757 0 Mar 28 1996 #63809|
b---r-S--- 1 29289 29812 111, 103 Mar 5 2028 #63811
c--xrw--w- 1 512 26991 108, 32 Jan 24 2026 #63872
<A HREF="http://morgus.ddns.org/">morgus</A>:/home/deadduck# du -s
165423528591 .</PRE>
morgus is <A HREF="http://shammack.n-f-d.com/">Scott</A>'s new machine (It's /home fs has since been repaired.)<BR>
<+
}
hputs "<BR><A HREF=\"/$directory\">Home</A><BR>"
+>
<BR>
<+
hputs "<SMALL>date=[clock format [clock seconds] -format 0%d%m%Y%H%M]</SMALL>"
+>
<BR>
<CENTER><A HREF=http://www.n-f-d.com/><IMG BORDER=0 SRC=http://www.n-f-d.com/random-image/*/<+hputs [clock seconds]+>/ ALT="Netfuel Design"></A>
<+
hputs "<IMG ALT=\"\[ Support Freedom \]\" SRC=\"/$directory\projects/support-freedom/ribbon_small.gif\">"
+>
</CENTER>
<BR>
Hey, you. Tell me what you think of this site -- <A HREF="mailto:rkeene@rkeene.org">rkeene@rkeene.org</A>
<BR>
<FONT SIZE=-7>Documentation is <B>NOT</B> a last resort. It's <B>FIRST</B> choice.<BR>
*Click* at the sound of the tone it will be exactly Mon Jan 18 21:14:07 CST 2038.<BR>
*Click* at the sound of the tone it will be exactly Fri Dec 13 14:45:52 CST 1901. (Maybe time_t should be unsigned?)<BR>
Support International Code Cleanup Year !<BR>
Saturday, 08 September 2001 20:46:40 2001, a second that will live in infamy<BR>
</FONT>
</BODY>
</HTML>
|
Added work/lib/libbz2.a.
cannot compute difference between binary files
Added work/lib/liblzo.a.
cannot compute difference between binary files
Added work/lib/libz.a.
cannot compute difference between binary files
Added work/libopennet/Makefile.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
# Generated automatically from Makefile.in by configure.
CC = gcc
CFLAGS = -g -O2 -DHAVE_CONFIG_H
CPPFLAGS =
LD = gcc
LOADLIBES =
LDLIBS += -lm
LDFLAGS +=
VER = 0.8.1
prefix = /usr/local
mandir = ${prefix}/man
sysconfdir = ${prefix}/etc
datadir = ${prefix}/share
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
LIBS = libopennet.so
OBJS = buffer.o crc.o opennet.o parse.o
all: $(LIBS)
libopennet.so: $(OBJS)
$(CC) -o libopennet.so -shared $(LDFLAGS) $(OBJS)
install: $(LIBS)
cp libopennet.so $(prefix)/lib/libopennet.so.$(VER)
ln -fs $(prefix)/lib/libopennet.so.$(VER) $(prefix)/lib/libopennet.so
cp opennet.h $(prefix)/include/
clean:
rm -f $(OBJS) core
distclean: clean
rm -f $(LIBS) config.h config.cache config.log config.status Makefile
parse.o: parse.c parse.h
crc.o: crc.c crc.h
opennet.o: opennet.c opennet.h
buffer.o: buffer.c buffer.h
strsep.o: strsep.c strsep.h
|
Added work/libopennet/Makefile.in.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
CC = @CC@
CFLAGS = @CFLAGS@ @DEFS@
CPPFLAGS = @CPPFLAGS@
LD = @CC@
LOADLIBES =
LDLIBS += @LIBS@
LDFLAGS += @LDFLAGS@
VER = 0.8.1
prefix = @prefix@
mandir = @mandir@
sysconfdir = @sysconfdir@
datadir = @datadir@
exec_prefix = @exec_prefix@
bindir = @bindir@
LIBS = libopennet.so
OBJS = buffer.o crc.o opennet.o parse.o @LIBOBJS@
all: $(LIBS)
libopennet.so: $(OBJS)
$(CC) -o libopennet.so -shared $(LDFLAGS) $(OBJS)
install: $(LIBS)
cp libopennet.so $(prefix)/lib/libopennet.so.$(VER)
ln -fs $(prefix)/lib/libopennet.so.$(VER) $(prefix)/lib/libopennet.so
cp opennet.h $(prefix)/include/
clean:
rm -f $(OBJS) core
distclean: clean
rm -f $(LIBS) config.h config.cache config.log config.status Makefile
parse.o: parse.c parse.h
crc.o: crc.c crc.h
opennet.o: opennet.c opennet.h
buffer.o: buffer.c buffer.h
strsep.o: strsep.c strsep.h
|
Added work/libopennet/README.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
This is Libopennet version __VERSION__.
It can be downloaded at:
http://www.rkeene.org/devel/libopennet-__VERSION__.tar.gz (__VERSION__)
http://www.rkeene.org/devel/libopennet.tar.gz (current)
Libopennet allows you to open_net() urls (or files, for that matter) the same
way you would normally open() just files.
Example:
#include <opennet.h>
int fd;
char buf[512];
fd=open_net("http://www.rkeene.org/", O_RDONLY);
read_net(fd, &buf, 512); /* You could just read() it, but read_net
tries harder to get all 512 bytes. */
lseek_net(fd, 0, SEEK_SET);
close(fd);
open_net() even parses URLs for certain things:
@@OSNM@@ = OS Name (linux, freebsd, sunos, etc)
@@OSVR@@ = OS version (2.2.x, 4.2, 5.8, etc)
@@OSVS@@ = OS version (short) (2.2, 4.2, 5.8, etc)
@@ARCH@@ = Arch (i386, sparc64, sun4u, sun4m, etc)
@@DIST@@ = If OSNM=Linux, distribution of Linux.
@@ATSN@@ = Put an `@'
So you could open_net("http://www.@@OSNM@@.com/", O_RDONLY);
LIMITATIONS:
open_net() only does READ-ONLY with HTTP, and READ or WRITE with FTP (not both)
libopennet doesn't do mailto:, or anything besides http and ftp for that matter.
CONTACT:
Roy Keene <rkeene_opennet@rkeene.org>
|
Added work/libopennet/acconfig.h.
|
|
>
>
|
1
2
|
/* Define if you have inet_aton(), used in preference to inet_addr() */
#undef HAVE_INET_ATON
|
Added work/libopennet/aclocal.m4.
|
|
>
>
>
>
>
|
1
2
3
4
5
|
AC_DEFUN(DC_DO_NETSET, [
AC_SEARCH_LIBS(socket, socket nsl)
AC_SEARCH_LIBS(gethostbyname, nsl)
AC_SEARCH_LIBS(inet_aton, xnet, AC_DEFINE(HAVE_INET_ATON), AC_SEARCH_LIBS(inet_addr, nsl))
])
|
Added work/libopennet/buffer.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
|
/*
* Copyright (C) 2000 Roy Keene
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* email: rkeene@rkeene.org
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "conf.h"
#include "buffer.h"
uint32_t bit_buffer_data=0;
int bit_buffer_location=0;
char *byte_buffer_data=NULL;
int byte_buffer_location=-1;
/*
Func: bit_buffer_read
Args:
bits - (int) Number of bits to read from the buffer.
Rets: Int, value from buffer.
Meth: Bread high BITS bits from BUFFER_DATA and shift to the left.
Stat: Complete
*/
int bit_buffer_read(int bits) {
int retval;
if (bits>bit_buffer_location) {
fprintf(stderr, __FILE__ ": bit_buffer_read: Request for %i bits, buffer contains %i bits\n",bits,bit_buffer_location);
bits=bit_buffer_location;
}
retval=(bit_buffer_data>>((sizeof(bit_buffer_data)*8)-bits));
bit_buffer_data=(bit_buffer_data<<bits);
bit_buffer_location-=bits;
#ifdef BUFFER_VERBOSE
fprintf(stderr, __FILE__ ": bit_buffer_read(%i)=%i\n",bits,retval);
#endif
return(retval);
}
/*
Func: bit_buffer_write
Args:
val - (uint) Value to write
bits - (uint) Number of bits to allocate
Rets: Nothing
Meth: Add to right of current BUFFER_DATA[BUFFER_LOCATION], incremint
BUFFER_LOCATION
Stat: Complete
*/
void bit_buffer_write(unsigned int val, unsigned int bits) {
while ((val>>bits)!=0) {
fprintf(stderr, __FILE__ ": bit_buffer_write: Value (%i) is bigger than %i bits.\n",val,bits);
bits++;
}
if ((bits+bit_buffer_location)>(sizeof(bit_buffer_data)*8)) {
fprintf(stderr, __FILE__ ": bit_buffer_write: Buffer overflow\n");
return;
}
bit_buffer_location+=bits;
bit_buffer_data+=(val<<((sizeof(bit_buffer_data)*8)-bit_buffer_location));
#ifdef BUFFER_VERBOSE
fprintf(stderr, __FILE__ ": bit_buffer_write(%i, %i)\n",val,bits);
#endif
return;
}
/*
Func: bit_buffer_size
Args: None
Rets: Int, number of bits in buffer
Meth: buffer_location
Stat: Complete
*/
int bit_buffer_size(void) {
#ifdef BUFFER_VERBOSE
fprintf(stderr, __FILE__ ": bit_buffer_size()=%i\n",bit_buffer_location);
#endif
return(bit_buffer_location);
}
/*
Func: bit_buffer_purge
Args: None
Rets: Nothing
Meth: Clear BUFFER_DATA and set BUFFER_LOCATION to 0
*/
void bit_buffer_purge(void) {
bit_buffer_location=0;
bit_buffer_data=0;
#ifdef BUFFER_VERBOSE
fprintf(stderr, __FILE__ ": bit_buffer_purge()\n");
#endif
return;
}
char *byte_buffer_read(int bytes) {
char *retval;
if (byte_buffer_location==-1) return(NULL);
if (bytes>byte_buffer_location) {
fprintf(stderr, __FILE__ ": byte_buffer_read: Request for %i bytes, buffer contains %i bytes.\n",bytes,byte_buffer_location);
bytes=byte_buffer_location;
}
retval=malloc(bytes);
memcpy(retval,byte_buffer_data,bytes);
memmove(byte_buffer_data,byte_buffer_data+bytes,(byte_buffer_location-=bytes));
return(retval);
}
void byte_buffer_write(char *val, unsigned int size) {
if (byte_buffer_location==-1) {
byte_buffer_purge();
}
if ((byte_buffer_location+size)>(BYTE_BUFF_SIZE)) {
fprintf(stderr, __FILE__ ": byte_buffer_write: Buffer overflow.\n");
return;
}
memcpy(byte_buffer_data+byte_buffer_location,val,size);
byte_buffer_location+=size;
}
char byte_buffer_read_1(void) {
char *buffread;
char retval;
buffread=byte_buffer_read(1);
retval=buffread[0];
free(buffread);
return(retval);
}
int byte_buffer_size(void) {
return(byte_buffer_location);
}
void byte_buffer_purge(void) {
int i;
#if 0
if (byte_buffer_data!=NULL) free(byte_buffer_data);
byte_buffer_data=calloc(BYTE_BUFF_SIZE, 1);
#endif
if (byte_buffer_data==NULL) byte_buffer_data=malloc(BYTE_BUFF_SIZE);
if (byte_buffer_location==-1) {
for (i=0;i<(BYTE_BUFF_SIZE);i++) byte_buffer_data[i]=0;
} else {
for (i=0;i<(byte_buffer_location+1);i++) byte_buffer_data[i]=0;
}
byte_buffer_location=0;
}
|
Added work/libopennet/buffer.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#ifndef _BUFFER_H
#define _BUFFER_H
#include "conf.h"
int bit_buffer_read(int bits);
void bit_buffer_write(unsigned int val, unsigned int bits);
int bit_buffer_size(void);
void bit_buffer_purge(void);
char *byte_buffer_read(int bytes);
char byte_buffer_read_1(void);
void byte_buffer_write(char *val, unsigned int size);
int byte_buffer_size(void);
void byte_buffer_purge(void);
#ifndef BYTE_BUFF_SIZE
#define BYTE_BUFF_SIZE 65535
#endif
#endif
|
Added work/libopennet/conf.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#ifndef _OPENNET_CFG_H
#define _OPNNEET_CFG_H
#define VERSION "0.8.1"
#include "config.h"
#ifdef HAVE_STRSEP
#include <string.h>
#else
#include "strsep.h"
#endif
#ifdef HAVE_STDINT_H
#include <stdint.h>
#else
#include "stdint.h"
#endif
#endif
|
Added work/libopennet/config.cache.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
# scripts and configure runs. It is not useful on other systems.
# If it contains results you don't want to keep, you may remove or edit it.
#
# By default, configure uses ./config.cache as the cache file,
# creating it if it does not exist already. You can give configure
# the --cache-file=FILE option to use a different cache file; that is
# what configure does when it calls configure scripts in
# subdirectories, so they share the cache.
# Giving --cache-file=/dev/null disables caching, for debugging configure.
# config.status only pays attention to the cache file if you give it the
# --recheck option to rerun configure.
#
ac_cv_c_const=${ac_cv_c_const=yes}
ac_cv_func_socket=${ac_cv_func_socket=yes}
ac_cv_func_strcspn=${ac_cv_func_strcspn=yes}
ac_cv_func_strdup=${ac_cv_func_strdup=yes}
ac_cv_func_strsep=${ac_cv_func_strsep=yes}
ac_cv_func_strstr=${ac_cv_func_strstr=yes}
ac_cv_func_uname=${ac_cv_func_uname=yes}
ac_cv_header_dirent_dirent_h=${ac_cv_header_dirent_dirent_h=yes}
ac_cv_header_fcntl_h=${ac_cv_header_fcntl_h=yes}
ac_cv_header_stdc=${ac_cv_header_stdc=yes}
ac_cv_header_stdint_h=${ac_cv_header_stdint_h=yes}
ac_cv_header_sys_socket_h=${ac_cv_header_sys_socket_h=yes}
ac_cv_header_unistd_h=${ac_cv_header_unistd_h=yes}
ac_cv_lib_dir_opendir=${ac_cv_lib_dir_opendir=no}
ac_cv_lib_m_pow=${ac_cv_lib_m_pow=yes}
ac_cv_prog_CC=${ac_cv_prog_CC=gcc}
ac_cv_prog_CPP=${ac_cv_prog_CPP='gcc -E'}
ac_cv_prog_LN_S=${ac_cv_prog_LN_S='ln -s'}
ac_cv_prog_cc_cross=${ac_cv_prog_cc_cross=no}
ac_cv_prog_cc_g=${ac_cv_prog_cc_g=yes}
ac_cv_prog_cc_works=${ac_cv_prog_cc_works=yes}
ac_cv_prog_gcc=${ac_cv_prog_gcc=yes}
ac_cv_search_gethostbyname=${ac_cv_search_gethostbyname='none required'}
ac_cv_search_inet_aton=${ac_cv_search_inet_aton='none required'}
ac_cv_search_socket=${ac_cv_search_socket='none required'}
ac_cv_type_mode_t=${ac_cv_type_mode_t=yes}
ac_cv_type_off_t=${ac_cv_type_off_t=yes}
ac_cv_type_size_t=${ac_cv_type_size_t=yes}
|
Added work/libopennet/config.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
/* config.h. Generated automatically by configure. */
/* config.h.in. Generated automatically from configure.in by autoheader. */
/* Define to empty if the keyword does not work. */
/* #undef const */
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef mode_t */
/* Define to `long' if <sys/types.h> doesn't define. */
/* #undef off_t */
/* Define to `unsigned' if <sys/types.h> doesn't define. */
/* #undef size_t */
/* Define if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define if you have inet_aton(), used in preference to inet_addr() */
#define HAVE_INET_ATON 1
/* Define if you have the socket function. */
#define HAVE_SOCKET 1
/* Define if you have the strcspn function. */
#define HAVE_STRCSPN 1
/* Define if you have the strdup function. */
#define HAVE_STRDUP 1
/* Define if you have the strsep function. */
#define HAVE_STRSEP 1
/* Define if you have the strstr function. */
#define HAVE_STRSTR 1
/* Define if you have the uname function. */
#define HAVE_UNAME 1
/* Define if you have the <dirent.h> header file. */
#define HAVE_DIRENT_H 1
/* Define if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define if you have the <ndir.h> header file. */
/* #undef HAVE_NDIR_H */
/* Define if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define if you have the <sys/dir.h> header file. */
/* #undef HAVE_SYS_DIR_H */
/* Define if you have the <sys/ndir.h> header file. */
/* #undef HAVE_SYS_NDIR_H */
/* Define if you have the <sys/socket.h> header file. */
#define HAVE_SYS_SOCKET_H 1
/* Define if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define if you have the m library (-lm). */
#define HAVE_LIBM 1
|
Added work/libopennet/config.h.in.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
/* config.h.in. Generated automatically from configure.in by autoheader. */
/* Define to empty if the keyword does not work. */
#undef const
/* Define to `int' if <sys/types.h> doesn't define. */
#undef mode_t
/* Define to `long' if <sys/types.h> doesn't define. */
#undef off_t
/* Define to `unsigned' if <sys/types.h> doesn't define. */
#undef size_t
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define if you have inet_aton(), used in preference to inet_addr() */
#undef HAVE_INET_ATON
/* Define if you have the socket function. */
#undef HAVE_SOCKET
/* Define if you have the strcspn function. */
#undef HAVE_STRCSPN
/* Define if you have the strdup function. */
#undef HAVE_STRDUP
/* Define if you have the strsep function. */
#undef HAVE_STRSEP
/* Define if you have the strstr function. */
#undef HAVE_STRSTR
/* Define if you have the uname function. */
#undef HAVE_UNAME
/* Define if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H
/* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define if you have the <ndir.h> header file. */
#undef HAVE_NDIR_H
/* Define if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define if you have the <sys/dir.h> header file. */
#undef HAVE_SYS_DIR_H
/* Define if you have the <sys/ndir.h> header file. */
#undef HAVE_SYS_NDIR_H
/* Define if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define if you have the m library (-lm). */
#undef HAVE_LIBM
|
Added work/libopennet/config.log.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
configure:530: checking for gcc
configure:643: checking whether the C compiler (gcc ) works
configure:659: gcc -o conftest conftest.c 1>&5
configure:685: checking whether the C compiler (gcc ) is a cross-compiler
configure:690: checking whether we are using GNU C
configure:699: gcc -E conftest.c
configure:718: checking whether gcc accepts -g
configure:750: checking whether ln -s works
configure:772: checking for pow in -lm
configure:791: gcc -o conftest -g -O2 conftest.c -lm 1>&5
configure:821: checking for library containing socket
configure:839: gcc -o conftest -g -O2 conftest.c -lm 1>&5
configure:883: checking for library containing gethostbyname
configure:901: gcc -o conftest -g -O2 conftest.c -lm 1>&5
configure:945: checking for library containing inet_aton
configure:963: gcc -o conftest -g -O2 conftest.c -lm 1>&5
configure:1076: checking for dirent.h that defines DIR
configure:1089: gcc -c -g -O2 conftest.c 1>&5
configure:1114: checking for opendir in -ldir
configure:1133: gcc -o conftest -g -O2 conftest.c -ldir -lm 1>&5
/usr/bin/ld: cannot open -ldir: No such file or directory
collect2: ld returned 1 exit status
configure: failed program was:
#line 1122 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char opendir();
int main() {
opendir()
; return 0; }
configure:1197: checking how to run the C preprocessor
configure:1218: gcc -E conftest.c >/dev/null 2>conftest.out
configure:1277: checking for ANSI C header files
configure:1290: gcc -E conftest.c >/dev/null 2>conftest.out
configure:1357: gcc -o conftest -g -O2 conftest.c -lm 1>&5
configure:1384: checking for fcntl.h
configure:1394: gcc -E conftest.c >/dev/null 2>conftest.out
configure:1384: checking for unistd.h
configure:1394: gcc -E conftest.c >/dev/null 2>conftest.out
configure:1384: checking for stdint.h
configure:1394: gcc -E conftest.c >/dev/null 2>conftest.out
configure:1384: checking for sys/socket.h
configure:1394: gcc -E conftest.c >/dev/null 2>conftest.out
configure:1422: checking for working const
configure:1476: gcc -c -g -O2 conftest.c 1>&5
configure:1497: checking for mode_t
configure:1530: checking for off_t
configure:1563: checking for size_t
configure:1599: checking for socket
configure:1627: gcc -o conftest -g -O2 conftest.c -lm 1>&5
configure:1599: checking for strcspn
configure:1627: gcc -o conftest -g -O2 conftest.c -lm 1>&5
configure:1599: checking for strdup
configure:1627: gcc -o conftest -g -O2 conftest.c -lm 1>&5
configure:1599: checking for strstr
configure:1627: gcc -o conftest -g -O2 conftest.c -lm 1>&5
configure:1599: checking for uname
configure:1627: gcc -o conftest -g -O2 conftest.c -lm 1>&5
configure:1654: checking for strsep
configure:1682: gcc -o conftest -g -O2 conftest.c -lm 1>&5
|
Added work/libopennet/config.status.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
|
#! /bin/sh
# Generated automatically by configure.
# Run this file to recreate the current configuration.
# This directory was configured as follows,
# on host unleaded:
#
# ./configure
#
# Compiler output produced by configure, useful for debugging
# configure, is in ./config.log if it exists.
ac_cs_usage="Usage: ./config.status [--recheck] [--version] [--help]"
for ac_option
do
case "$ac_option" in
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
echo "running ${CONFIG_SHELL-/bin/sh} ./configure --no-create --no-recursion"
exec ${CONFIG_SHELL-/bin/sh} ./configure --no-create --no-recursion ;;
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
echo "./config.status generated by autoconf version 2.13"
exit 0 ;;
-help | --help | --hel | --he | --h)
echo "$ac_cs_usage"; exit 0 ;;
*) echo "$ac_cs_usage"; exit 1 ;;
esac
done
ac_given_srcdir=.
trap 'rm -fr Makefile config.h conftest*; exit 1' 1 2 15
# Protect against being on the right side of a sed subst in config.status.
sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\&%]/\\&/g;
s/@@/%@/; s/@@/@%/; s/@g$/%g/' > conftest.subs <<\CEOF
/^[ ]*VPATH[ ]*=[^:]*$/d
s%@SHELL@%/bin/sh%g
s%@CFLAGS@%-g -O2%g
s%@CPPFLAGS@%%g
s%@CXXFLAGS@%%g
s%@FFLAGS@%%g
s%@DEFS@%-DHAVE_CONFIG_H%g
s%@LDFLAGS@%%g
s%@LIBS@%-lm %g
s%@exec_prefix@%${prefix}%g
s%@prefix@%/usr/local%g
s%@program_transform_name@%s,x,x,%g
s%@bindir@%${exec_prefix}/bin%g
s%@sbindir@%${exec_prefix}/sbin%g
s%@libexecdir@%${exec_prefix}/libexec%g
s%@datadir@%${prefix}/share%g
s%@sysconfdir@%${prefix}/etc%g
s%@sharedstatedir@%${prefix}/com%g
s%@localstatedir@%${prefix}/var%g
s%@libdir@%${exec_prefix}/lib%g
s%@includedir@%${prefix}/include%g
s%@oldincludedir@%/usr/include%g
s%@infodir@%${prefix}/info%g
s%@mandir@%${prefix}/man%g
s%@CC@%gcc%g
s%@LN_S@%ln -s%g
s%@CPP@%gcc -E%g
s%@LIBOBJS@%%g
CEOF
# Split the substitutions into bite-sized pieces for seds with
# small command number limits, like on Digital OSF/1 and HP-UX.
ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
ac_file=1 # Number of current file.
ac_beg=1 # First line for current file.
ac_end=$ac_max_sed_cmds # Line after last line for current file.
ac_more_lines=:
ac_sed_cmds=""
while $ac_more_lines; do
if test $ac_beg -gt 1; then
sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
else
sed "${ac_end}q" conftest.subs > conftest.s$ac_file
fi
if test ! -s conftest.s$ac_file; then
ac_more_lines=false
rm -f conftest.s$ac_file
else
if test -z "$ac_sed_cmds"; then
ac_sed_cmds="sed -f conftest.s$ac_file"
else
ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
fi
ac_file=`expr $ac_file + 1`
ac_beg=$ac_end
ac_end=`expr $ac_end + $ac_max_sed_cmds`
fi
done
if test -z "$ac_sed_cmds"; then
ac_sed_cmds=cat
fi
CONFIG_FILES=${CONFIG_FILES-"Makefile"}
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
case "$ac_file" in
*:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
*) ac_file_in="${ac_file}.in" ;;
esac
# Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
# Remove last slash and all that follows it. Not all systems have dirname.
ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
# The file is in a subdirectory.
test ! -d "$ac_dir" && mkdir "$ac_dir"
ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
# A "../" for each directory in $ac_dir_suffix.
ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
else
ac_dir_suffix= ac_dots=
fi
case "$ac_given_srcdir" in
.) srcdir=.
if test -z "$ac_dots"; then top_srcdir=.
else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
/*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
*) # Relative path.
srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
top_srcdir="$ac_dots$ac_given_srcdir" ;;
esac
echo creating "$ac_file"
rm -f "$ac_file"
configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
case "$ac_file" in
*Makefile*) ac_comsub="1i\\
# $configure_input" ;;
*) ac_comsub= ;;
esac
ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
sed -e "$ac_comsub
s%@configure_input@%$configure_input%g
s%@srcdir@%$srcdir%g
s%@top_srcdir@%$top_srcdir%g
" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
fi; done
rm -f conftest.s*
# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
# NAME is the cpp macro being defined and VALUE is the value it is being given.
#
# ac_d sets the value in "#define NAME VALUE" lines.
ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
ac_dC='\3'
ac_dD='%g'
# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
ac_uB='\([ ]\)%\1#\2define\3'
ac_uC=' '
ac_uD='\4%g'
# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
ac_eB='$%\1#\2define\3'
ac_eC=' '
ac_eD='%g'
if test "${CONFIG_HEADERS+set}" != set; then
CONFIG_HEADERS="config.h"
fi
for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
case "$ac_file" in
*:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
*) ac_file_in="${ac_file}.in" ;;
esac
echo creating $ac_file
rm -f conftest.frag conftest.in conftest.out
ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
cat $ac_file_inputs > conftest.in
cat > conftest.frag <<CEOF
${ac_dA}HAVE_LIBM${ac_dB}HAVE_LIBM${ac_dC}1${ac_dD}
${ac_uA}HAVE_LIBM${ac_uB}HAVE_LIBM${ac_uC}1${ac_uD}
${ac_eA}HAVE_LIBM${ac_eB}HAVE_LIBM${ac_eC}1${ac_eD}
${ac_dA}HAVE_INET_ATON${ac_dB}HAVE_INET_ATON${ac_dC}1${ac_dD}
${ac_uA}HAVE_INET_ATON${ac_uB}HAVE_INET_ATON${ac_uC}1${ac_uD}
${ac_eA}HAVE_INET_ATON${ac_eB}HAVE_INET_ATON${ac_eC}1${ac_eD}
${ac_dA}HAVE_DIRENT_H${ac_dB}HAVE_DIRENT_H${ac_dC}1${ac_dD}
${ac_uA}HAVE_DIRENT_H${ac_uB}HAVE_DIRENT_H${ac_uC}1${ac_uD}
${ac_eA}HAVE_DIRENT_H${ac_eB}HAVE_DIRENT_H${ac_eC}1${ac_eD}
${ac_dA}STDC_HEADERS${ac_dB}STDC_HEADERS${ac_dC}1${ac_dD}
${ac_uA}STDC_HEADERS${ac_uB}STDC_HEADERS${ac_uC}1${ac_uD}
${ac_eA}STDC_HEADERS${ac_eB}STDC_HEADERS${ac_eC}1${ac_eD}
CEOF
sed -f conftest.frag conftest.in > conftest.out
rm -f conftest.in
mv conftest.out conftest.in
cat > conftest.frag <<CEOF
${ac_dA}HAVE_FCNTL_H${ac_dB}HAVE_FCNTL_H${ac_dC}1${ac_dD}
${ac_uA}HAVE_FCNTL_H${ac_uB}HAVE_FCNTL_H${ac_uC}1${ac_uD}
${ac_eA}HAVE_FCNTL_H${ac_eB}HAVE_FCNTL_H${ac_eC}1${ac_eD}
${ac_dA}HAVE_UNISTD_H${ac_dB}HAVE_UNISTD_H${ac_dC}1${ac_dD}
${ac_uA}HAVE_UNISTD_H${ac_uB}HAVE_UNISTD_H${ac_uC}1${ac_uD}
${ac_eA}HAVE_UNISTD_H${ac_eB}HAVE_UNISTD_H${ac_eC}1${ac_eD}
${ac_dA}HAVE_STDINT_H${ac_dB}HAVE_STDINT_H${ac_dC}1${ac_dD}
${ac_uA}HAVE_STDINT_H${ac_uB}HAVE_STDINT_H${ac_uC}1${ac_uD}
${ac_eA}HAVE_STDINT_H${ac_eB}HAVE_STDINT_H${ac_eC}1${ac_eD}
${ac_dA}HAVE_SYS_SOCKET_H${ac_dB}HAVE_SYS_SOCKET_H${ac_dC}1${ac_dD}
${ac_uA}HAVE_SYS_SOCKET_H${ac_uB}HAVE_SYS_SOCKET_H${ac_uC}1${ac_uD}
${ac_eA}HAVE_SYS_SOCKET_H${ac_eB}HAVE_SYS_SOCKET_H${ac_eC}1${ac_eD}
CEOF
sed -f conftest.frag conftest.in > conftest.out
rm -f conftest.in
mv conftest.out conftest.in
cat > conftest.frag <<CEOF
${ac_dA}HAVE_SOCKET${ac_dB}HAVE_SOCKET${ac_dC}1${ac_dD}
${ac_uA}HAVE_SOCKET${ac_uB}HAVE_SOCKET${ac_uC}1${ac_uD}
${ac_eA}HAVE_SOCKET${ac_eB}HAVE_SOCKET${ac_eC}1${ac_eD}
${ac_dA}HAVE_STRCSPN${ac_dB}HAVE_STRCSPN${ac_dC}1${ac_dD}
${ac_uA}HAVE_STRCSPN${ac_uB}HAVE_STRCSPN${ac_uC}1${ac_uD}
${ac_eA}HAVE_STRCSPN${ac_eB}HAVE_STRCSPN${ac_eC}1${ac_eD}
${ac_dA}HAVE_STRDUP${ac_dB}HAVE_STRDUP${ac_dC}1${ac_dD}
${ac_uA}HAVE_STRDUP${ac_uB}HAVE_STRDUP${ac_uC}1${ac_uD}
${ac_eA}HAVE_STRDUP${ac_eB}HAVE_STRDUP${ac_eC}1${ac_eD}
${ac_dA}HAVE_STRSTR${ac_dB}HAVE_STRSTR${ac_dC}1${ac_dD}
${ac_uA}HAVE_STRSTR${ac_uB}HAVE_STRSTR${ac_uC}1${ac_uD}
${ac_eA}HAVE_STRSTR${ac_eB}HAVE_STRSTR${ac_eC}1${ac_eD}
CEOF
sed -f conftest.frag conftest.in > conftest.out
rm -f conftest.in
mv conftest.out conftest.in
cat > conftest.frag <<CEOF
${ac_dA}HAVE_UNAME${ac_dB}HAVE_UNAME${ac_dC}1${ac_dD}
${ac_uA}HAVE_UNAME${ac_uB}HAVE_UNAME${ac_uC}1${ac_uD}
${ac_eA}HAVE_UNAME${ac_eB}HAVE_UNAME${ac_eC}1${ac_eD}
${ac_dA}HAVE_STRSEP${ac_dB}HAVE_STRSEP${ac_dC}1${ac_dD}
${ac_uA}HAVE_STRSEP${ac_uB}HAVE_STRSEP${ac_uC}1${ac_uD}
${ac_eA}HAVE_STRSEP${ac_eB}HAVE_STRSEP${ac_eC}1${ac_eD}
s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
CEOF
sed -f conftest.frag conftest.in > conftest.out
rm -f conftest.in
mv conftest.out conftest.in
rm -f conftest.frag conftest.h
echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
cat conftest.in >> conftest.h
rm -f conftest.in
if cmp -s $ac_file conftest.h 2>/dev/null; then
echo "$ac_file is unchanged"
rm -f conftest.h
else
# Remove last slash and all that follows it. Not all systems have dirname.
ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
# The file is in a subdirectory.
test ! -d "$ac_dir" && mkdir "$ac_dir"
fi
rm -f $ac_file
mv conftest.h $ac_file
fi
fi; done
exit 0
|
Added work/libopennet/configure.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
|
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf version 2.13
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
# Defaults:
ac_help=
ac_default_prefix=/usr/local
# Any additions from configure.in:
# Initialize some variables set by options.
# The variables have the same names as the options, with
# dashes changed to underlines.
build=NONE
cache_file=./config.cache
exec_prefix=NONE
host=NONE
no_create=
nonopt=NONE
no_recursion=
prefix=NONE
program_prefix=NONE
program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
srcdir=
target=NONE
verbose=
x_includes=NONE
x_libraries=NONE
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
datadir='${prefix}/share'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
libdir='${exec_prefix}/lib'
includedir='${prefix}/include'
oldincludedir='/usr/include'
infodir='${prefix}/info'
mandir='${prefix}/man'
# Initialize some other variables.
subdirs=
MFLAGS= MAKEFLAGS=
SHELL=${CONFIG_SHELL-/bin/sh}
# Maximum number of lines to put in a shell here document.
ac_max_here_lines=12
ac_prev=
for ac_option
do
# If the previous option needs an argument, assign it.
if test -n "$ac_prev"; then
eval "$ac_prev=\$ac_option"
ac_prev=
continue
fi
case "$ac_option" in
-*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) ac_optarg= ;;
esac
# Accept the important Cygnus configure options, so we can diagnose typos.
case "$ac_option" in
-bindir | --bindir | --bindi | --bind | --bin | --bi)
ac_prev=bindir ;;
-bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
bindir="$ac_optarg" ;;
-build | --build | --buil | --bui | --bu)
ac_prev=build ;;
-build=* | --build=* | --buil=* | --bui=* | --bu=*)
build="$ac_optarg" ;;
-cache-file | --cache-file | --cache-fil | --cache-fi \
| --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
ac_prev=cache_file ;;
-cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
| --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
cache_file="$ac_optarg" ;;
-datadir | --datadir | --datadi | --datad | --data | --dat | --da)
ac_prev=datadir ;;
-datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
| --da=*)
datadir="$ac_optarg" ;;
-disable-* | --disable-*)
ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
# Reject names that are not valid shell variable names.
if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
{ echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
fi
ac_feature=`echo $ac_feature| sed 's/-/_/g'`
eval "enable_${ac_feature}=no" ;;
-enable-* | --enable-*)
ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
# Reject names that are not valid shell variable names.
if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
{ echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
fi
ac_feature=`echo $ac_feature| sed 's/-/_/g'`
case "$ac_option" in
*=*) ;;
*) ac_optarg=yes ;;
esac
eval "enable_${ac_feature}='$ac_optarg'" ;;
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
| --exec | --exe | --ex)
ac_prev=exec_prefix ;;
-exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
| --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
| --exec=* | --exe=* | --ex=*)
exec_prefix="$ac_optarg" ;;
-gas | --gas | --ga | --g)
# Obsolete; use --with-gas.
with_gas=yes ;;
-help | --help | --hel | --he)
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat << EOF
Usage: configure [options] [host]
Options: [defaults in brackets after descriptions]
Configuration:
--cache-file=FILE cache test results in FILE
--help print this message
--no-create do not create output files
--quiet, --silent do not print \`checking...' messages
--version print the version of autoconf that created configure
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
[$ac_default_prefix]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[same as prefix]
--bindir=DIR user executables in DIR [EPREFIX/bin]
--sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
--libexecdir=DIR program executables in DIR [EPREFIX/libexec]
--datadir=DIR read-only architecture-independent data in DIR
[PREFIX/share]
--sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data in DIR
[PREFIX/com]
--localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
--libdir=DIR object code libraries in DIR [EPREFIX/lib]
--includedir=DIR C header files in DIR [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
--infodir=DIR info documentation in DIR [PREFIX/info]
--mandir=DIR man documentation in DIR [PREFIX/man]
--srcdir=DIR find the sources in DIR [configure dir or ..]
--program-prefix=PREFIX prepend PREFIX to installed program names
--program-suffix=SUFFIX append SUFFIX to installed program names
--program-transform-name=PROGRAM
run sed PROGRAM on installed program names
EOF
cat << EOF
Host type:
--build=BUILD configure for building on BUILD [BUILD=HOST]
--host=HOST configure for HOST [guessed]
--target=TARGET configure for TARGET [TARGET=HOST]
Features and packages:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--x-includes=DIR X include files are in DIR
--x-libraries=DIR X library files are in DIR
EOF
if test -n "$ac_help"; then
echo "--enable and --with options recognized:$ac_help"
fi
exit 0 ;;
-host | --host | --hos | --ho)
ac_prev=host ;;
-host=* | --host=* | --hos=* | --ho=*)
host="$ac_optarg" ;;
-includedir | --includedir | --includedi | --included | --include \
| --includ | --inclu | --incl | --inc)
ac_prev=includedir ;;
-includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
| --includ=* | --inclu=* | --incl=* | --inc=*)
includedir="$ac_optarg" ;;
-infodir | --infodir | --infodi | --infod | --info | --inf)
ac_prev=infodir ;;
-infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
infodir="$ac_optarg" ;;
-libdir | --libdir | --libdi | --libd)
ac_prev=libdir ;;
-libdir=* | --libdir=* | --libdi=* | --libd=*)
libdir="$ac_optarg" ;;
-libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
| --libexe | --libex | --libe)
ac_prev=libexecdir ;;
-libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
| --libexe=* | --libex=* | --libe=*)
libexecdir="$ac_optarg" ;;
-localstatedir | --localstatedir | --localstatedi | --localstated \
| --localstate | --localstat | --localsta | --localst \
| --locals | --local | --loca | --loc | --lo)
ac_prev=localstatedir ;;
-localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
| --localstate=* | --localstat=* | --localsta=* | --localst=* \
| --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
localstatedir="$ac_optarg" ;;
-mandir | --mandir | --mandi | --mand | --man | --ma | --m)
ac_prev=mandir ;;
-mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
mandir="$ac_optarg" ;;
-nfp | --nfp | --nf)
# Obsolete; use --without-fp.
with_fp=no ;;
-no-create | --no-create | --no-creat | --no-crea | --no-cre \
| --no-cr | --no-c)
no_create=yes ;;
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
| --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
no_recursion=yes ;;
-oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
| --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
| --oldin | --oldi | --old | --ol | --o)
ac_prev=oldincludedir ;;
-oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
| --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
| --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
oldincludedir="$ac_optarg" ;;
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
ac_prev=prefix ;;
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
prefix="$ac_optarg" ;;
-program-prefix | --program-prefix | --program-prefi | --program-pref \
| --program-pre | --program-pr | --program-p)
ac_prev=program_prefix ;;
-program-prefix=* | --program-prefix=* | --program-prefi=* \
| --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
program_prefix="$ac_optarg" ;;
-program-suffix | --program-suffix | --program-suffi | --program-suff \
| --program-suf | --program-su | --program-s)
ac_prev=program_suffix ;;
-program-suffix=* | --program-suffix=* | --program-suffi=* \
| --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
program_suffix="$ac_optarg" ;;
-program-transform-name | --program-transform-name \
| --program-transform-nam | --program-transform-na \
| --program-transform-n | --program-transform- \
| --program-transform | --program-transfor \
| --program-transfo | --program-transf \
| --program-trans | --program-tran \
| --progr-tra | --program-tr | --program-t)
ac_prev=program_transform_name ;;
-program-transform-name=* | --program-transform-name=* \
| --program-transform-nam=* | --program-transform-na=* \
| --program-transform-n=* | --program-transform-=* \
| --program-transform=* | --program-transfor=* \
| --program-transfo=* | --program-transf=* \
| --program-trans=* | --program-tran=* \
| --progr-tra=* | --program-tr=* | --program-t=*)
program_transform_name="$ac_optarg" ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
| --sbi=* | --sb=*)
sbindir="$ac_optarg" ;;
-sharedstatedir | --sharedstatedir | --sharedstatedi \
| --sharedstated | --sharedstate | --sharedstat | --sharedsta \
| --sharedst | --shareds | --shared | --share | --shar \
| --sha | --sh)
ac_prev=sharedstatedir ;;
-sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
| --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
| --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
| --sha=* | --sh=*)
sharedstatedir="$ac_optarg" ;;
-site | --site | --sit)
ac_prev=site ;;
-site=* | --site=* | --sit=*)
site="$ac_optarg" ;;
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
srcdir="$ac_optarg" ;;
-sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
| --syscon | --sysco | --sysc | --sys | --sy)
ac_prev=sysconfdir ;;
-sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
| --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
sysconfdir="$ac_optarg" ;;
-target | --target | --targe | --targ | --tar | --ta | --t)
ac_prev=target ;;
-target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
target="$ac_optarg" ;;
-v | -verbose | --verbose | --verbos | --verbo | --verb)
verbose=yes ;;
-version | --version | --versio | --versi | --vers)
echo "configure generated by autoconf version 2.13"
exit 0 ;;
-with-* | --with-*)
ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
# Reject names that are not valid shell variable names.
if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
{ echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
fi
ac_package=`echo $ac_package| sed 's/-/_/g'`
case "$ac_option" in
*=*) ;;
*) ac_optarg=yes ;;
esac
eval "with_${ac_package}='$ac_optarg'" ;;
-without-* | --without-*)
ac_package=`echo $ac_option|sed -e 's/-*without-//'`
# Reject names that are not valid shell variable names.
if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
{ echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
fi
ac_package=`echo $ac_package| sed 's/-/_/g'`
eval "with_${ac_package}=no" ;;
--x)
# Obsolete; use --with-x.
with_x=yes ;;
-x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
| --x-incl | --x-inc | --x-in | --x-i)
ac_prev=x_includes ;;
-x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
| --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
x_includes="$ac_optarg" ;;
-x-libraries | --x-libraries | --x-librarie | --x-librari \
| --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
ac_prev=x_libraries ;;
-x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
x_libraries="$ac_optarg" ;;
-*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
;;
*)
if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
echo "configure: warning: $ac_option: invalid host type" 1>&2
fi
if test "x$nonopt" != xNONE; then
{ echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
fi
nonopt="$ac_option"
;;
esac
done
if test -n "$ac_prev"; then
{ echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
fi
trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
# File descriptor usage:
# 0 standard input
# 1 file creation
# 2 errors and warnings
# 3 some systems may open it to /dev/tty
# 4 used on the Kubota Titan
# 6 checking for... messages and results
# 5 compiler messages saved in config.log
if test "$silent" = yes; then
exec 6>/dev/null
else
exec 6>&1
fi
exec 5>./config.log
echo "\
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
" 1>&5
# Strip out --no-create and --no-recursion so they do not pile up.
# Also quote any args containing shell metacharacters.
ac_configure_args=
for ac_arg
do
case "$ac_arg" in
-no-create | --no-create | --no-creat | --no-crea | --no-cre \
| --no-cr | --no-c) ;;
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
| --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
*" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
ac_configure_args="$ac_configure_args '$ac_arg'" ;;
*) ac_configure_args="$ac_configure_args $ac_arg" ;;
esac
done
# NLS nuisances.
# Only set these to C if already set. These must not be set unconditionally
# because not all systems understand e.g. LANG=C (notably SCO).
# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
# Non-C LC_CTYPE values break the ctype check.
if test "${LANG+set}" = set; then LANG=C; export LANG; fi
if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
# confdefs.h avoids OS command line length limits that DEFS can exceed.
rm -rf conftest* confdefs.h
# AIX cpp loses on an empty file, so make sure it contains at least a newline.
echo > confdefs.h
# A filename unique to this package, relative to the directory that
# configure is in, which we can look for to find out if srcdir is correct.
ac_unique_file=buffer.c
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
ac_srcdir_defaulted=yes
# Try the directory containing this script, then its parent.
ac_prog=$0
ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
srcdir=$ac_confdir
if test ! -r $srcdir/$ac_unique_file; then
srcdir=..
fi
else
ac_srcdir_defaulted=no
fi
if test ! -r $srcdir/$ac_unique_file; then
if test "$ac_srcdir_defaulted" = yes; then
{ echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
else
{ echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
fi
fi
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
# Prefer explicitly selected file to automatically selected ones.
if test -z "$CONFIG_SITE"; then
if test "x$prefix" != xNONE; then
CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
else
CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
fi
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
echo "loading site script $ac_site_file"
. "$ac_site_file"
fi
done
if test -r "$cache_file"; then
echo "loading cache $cache_file"
. $cache_file
else
echo "creating cache $cache_file"
> $cache_file
fi
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
ac_exeext=
ac_objext=o
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
# Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
ac_n= ac_c='
' ac_t=' '
else
ac_n=-n ac_c= ac_t=
fi
else
ac_n= ac_c='\c' ac_t=
fi
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:530: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_CC="gcc"
break
fi
done
IFS="$ac_save_ifs"
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
echo "$ac_t""$CC" 1>&6
else
echo "$ac_t""no" 1>&6
fi
if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:560: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_prog_rejected=no
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
ac_prog_rejected=yes
continue
fi
ac_cv_prog_CC="cc"
break
fi
done
IFS="$ac_save_ifs"
if test $ac_prog_rejected = yes; then
# We found a bogon in the path, so make sure we never use it.
set dummy $ac_cv_prog_CC
shift
if test $# -gt 0; then
# We chose a different compiler from the bogus one.
# However, it has the same basename, so the bogon will be chosen
# first if we set CC to just the basename; use the full file name.
shift
set dummy "$ac_dir/$ac_word" "$@"
shift
ac_cv_prog_CC="$@"
fi
fi
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
echo "$ac_t""$CC" 1>&6
else
echo "$ac_t""no" 1>&6
fi
if test -z "$CC"; then
case "`uname -s`" in
*win32* | *WIN32*)
# Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:611: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_CC="cl"
break
fi
done
IFS="$ac_save_ifs"
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
echo "$ac_t""$CC" 1>&6
else
echo "$ac_t""no" 1>&6
fi
;;
esac
fi
test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:643: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
#line 654 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
if { (eval echo configure:659: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
ac_cv_prog_cc_cross=no
else
ac_cv_prog_cc_cross=yes
fi
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
ac_cv_prog_cc_works=no
fi
rm -fr conftest*
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
echo "configure:685: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
echo "configure:690: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.c <<EOF
#ifdef __GNUC__
yes;
#endif
EOF
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:699: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
fi
fi
echo "$ac_t""$ac_cv_prog_gcc" 1>&6
if test $ac_cv_prog_gcc = yes; then
GCC=yes
else
GCC=
fi
ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
echo "configure:718: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo 'void f(){}' > conftest.c
if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
ac_cv_prog_cc_g=yes
else
ac_cv_prog_cc_g=no
fi
rm -f conftest*
fi
echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
if test "$ac_test_CFLAGS" = set; then
CFLAGS="$ac_save_CFLAGS"
elif test $ac_cv_prog_cc_g = yes; then
if test "$GCC" = yes; then
CFLAGS="-g -O2"
else
CFLAGS="-g"
fi
else
if test "$GCC" = yes; then
CFLAGS="-O2"
else
CFLAGS=
fi
fi
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
echo "configure:750: checking whether ln -s works" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
rm -f conftestdata
if ln -s X conftestdata 2>/dev/null
then
rm -f conftestdata
ac_cv_prog_LN_S="ln -s"
else
ac_cv_prog_LN_S=ln
fi
fi
LN_S="$ac_cv_prog_LN_S"
if test "$ac_cv_prog_LN_S" = "ln -s"; then
echo "$ac_t""yes" 1>&6
else
echo "$ac_t""no" 1>&6
fi
echo $ac_n "checking for pow in -lm""... $ac_c" 1>&6
echo "configure:772: checking for pow in -lm" >&5
ac_lib_var=`echo m'_'pow | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lm $LIBS"
cat > conftest.$ac_ext <<EOF
#line 780 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char pow();
int main() {
pow()
; return 0; }
EOF
if { (eval echo configure:791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF
LIBS="-lm $LIBS"
else
echo "$ac_t""no" 1>&6
fi
echo $ac_n "checking for library containing socket""... $ac_c" 1>&6
echo "configure:821: checking for library containing socket" >&5
if eval "test \"`echo '$''{'ac_cv_search_socket'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_func_search_save_LIBS="$LIBS"
ac_cv_search_socket="no"
cat > conftest.$ac_ext <<EOF
#line 828 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char socket();
int main() {
socket()
; return 0; }
EOF
if { (eval echo configure:839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_socket="none required"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
fi
rm -f conftest*
test "$ac_cv_search_socket" = "no" && for i in socket nsl; do
LIBS="-l$i $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
#line 850 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char socket();
int main() {
socket()
; return 0; }
EOF
if { (eval echo configure:861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_socket="-l$i"
break
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
fi
rm -f conftest*
done
LIBS="$ac_func_search_save_LIBS"
fi
echo "$ac_t""$ac_cv_search_socket" 1>&6
if test "$ac_cv_search_socket" != "no"; then
test "$ac_cv_search_socket" = "none required" || LIBS="$ac_cv_search_socket $LIBS"
else :
fi
echo $ac_n "checking for library containing gethostbyname""... $ac_c" 1>&6
echo "configure:883: checking for library containing gethostbyname" >&5
if eval "test \"`echo '$''{'ac_cv_search_gethostbyname'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_func_search_save_LIBS="$LIBS"
ac_cv_search_gethostbyname="no"
cat > conftest.$ac_ext <<EOF
#line 890 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char gethostbyname();
int main() {
gethostbyname()
; return 0; }
EOF
if { (eval echo configure:901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_gethostbyname="none required"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
fi
rm -f conftest*
test "$ac_cv_search_gethostbyname" = "no" && for i in nsl; do
LIBS="-l$i $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
#line 912 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char gethostbyname();
int main() {
gethostbyname()
; return 0; }
EOF
if { (eval echo configure:923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_gethostbyname="-l$i"
break
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
fi
rm -f conftest*
done
LIBS="$ac_func_search_save_LIBS"
fi
echo "$ac_t""$ac_cv_search_gethostbyname" 1>&6
if test "$ac_cv_search_gethostbyname" != "no"; then
test "$ac_cv_search_gethostbyname" = "none required" || LIBS="$ac_cv_search_gethostbyname $LIBS"
else :
fi
echo $ac_n "checking for library containing inet_aton""... $ac_c" 1>&6
echo "configure:945: checking for library containing inet_aton" >&5
if eval "test \"`echo '$''{'ac_cv_search_inet_aton'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_func_search_save_LIBS="$LIBS"
ac_cv_search_inet_aton="no"
cat > conftest.$ac_ext <<EOF
#line 952 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char inet_aton();
int main() {
inet_aton()
; return 0; }
EOF
if { (eval echo configure:963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_inet_aton="none required"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
fi
rm -f conftest*
test "$ac_cv_search_inet_aton" = "no" && for i in xnet; do
LIBS="-l$i $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
#line 974 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char inet_aton();
int main() {
inet_aton()
; return 0; }
EOF
if { (eval echo configure:985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_inet_aton="-l$i"
break
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
fi
rm -f conftest*
done
LIBS="$ac_func_search_save_LIBS"
fi
echo "$ac_t""$ac_cv_search_inet_aton" 1>&6
if test "$ac_cv_search_inet_aton" != "no"; then
test "$ac_cv_search_inet_aton" = "none required" || LIBS="$ac_cv_search_inet_aton $LIBS"
cat >> confdefs.h <<\EOF
#define HAVE_INET_ATON 1
EOF
else :
echo $ac_n "checking for library containing inet_addr""... $ac_c" 1>&6
echo "configure:1008: checking for library containing inet_addr" >&5
if eval "test \"`echo '$''{'ac_cv_search_inet_addr'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_func_search_save_LIBS="$LIBS"
ac_cv_search_inet_addr="no"
cat > conftest.$ac_ext <<EOF
#line 1015 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char inet_addr();
int main() {
inet_addr()
; return 0; }
EOF
if { (eval echo configure:1026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_inet_addr="none required"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
fi
rm -f conftest*
test "$ac_cv_search_inet_addr" = "no" && for i in nsl; do
LIBS="-l$i $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
#line 1037 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char inet_addr();
int main() {
inet_addr()
; return 0; }
EOF
if { (eval echo configure:1048: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_inet_addr="-l$i"
break
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
fi
rm -f conftest*
done
LIBS="$ac_func_search_save_LIBS"
fi
echo "$ac_t""$ac_cv_search_inet_addr" 1>&6
if test "$ac_cv_search_inet_addr" != "no"; then
test "$ac_cv_search_inet_addr" = "none required" || LIBS="$ac_cv_search_inet_addr $LIBS"
else :
fi
fi
ac_header_dirent=no
for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
echo "configure:1076: checking for $ac_hdr that defines DIR" >&5
if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1081 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_hdr>
int main() {
DIR *dirp = 0;
; return 0; }
EOF
if { (eval echo configure:1089: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_header_dirent_$ac_safe=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_header_dirent_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
ac_header_dirent=$ac_hdr; break
else
echo "$ac_t""no" 1>&6
fi
done
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
if test $ac_header_dirent = dirent.h; then
echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
echo "configure:1114: checking for opendir in -ldir" >&5
ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-ldir $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1122 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char opendir();
int main() {
opendir()
; return 0; }
EOF
if { (eval echo configure:1133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
LIBS="$LIBS -ldir"
else
echo "$ac_t""no" 1>&6
fi
else
echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
echo "configure:1155: checking for opendir in -lx" >&5
ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lx $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1163 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char opendir();
int main() {
opendir()
; return 0; }
EOF
if { (eval echo configure:1174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
LIBS="$LIBS -lx"
else
echo "$ac_t""no" 1>&6
fi
fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:1197: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
fi
if test -z "$CPP"; then
if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# This must be in double quotes, not single quotes, because CPP may get
# substituted into the Makefile and "${CC-cc}" will confuse make.
CPP="${CC-cc} -E"
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
#line 1212 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1218: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
#line 1229 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1235: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
#line 1246 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1252: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
CPP=/lib/cpp
fi
rm -f conftest*
fi
rm -f conftest*
fi
rm -f conftest*
ac_cv_prog_CPP="$CPP"
fi
CPP="$ac_cv_prog_CPP"
else
ac_cv_prog_CPP="$CPP"
fi
echo "$ac_t""$CPP" 1>&6
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
echo "configure:1277: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1282 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1290: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
ac_cv_header_stdc=yes
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
ac_cv_header_stdc=no
fi
rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 1307 "configure"
#include "confdefs.h"
#include <string.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "memchr" >/dev/null 2>&1; then
:
else
rm -rf conftest*
ac_cv_header_stdc=no
fi
rm -f conftest*
fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 1325 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "free" >/dev/null 2>&1; then
:
else
rm -rf conftest*
ac_cv_header_stdc=no
fi
rm -f conftest*
fi
if test $ac_cv_header_stdc = yes; then
# /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
#line 1346 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
int main () { int i; for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
if { (eval echo configure:1357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -fr conftest*
ac_cv_header_stdc=no
fi
rm -fr conftest*
fi
fi
fi
echo "$ac_t""$ac_cv_header_stdc" 1>&6
if test $ac_cv_header_stdc = yes; then
cat >> confdefs.h <<\EOF
#define STDC_HEADERS 1
EOF
fi
for ac_hdr in fcntl.h unistd.h stdint.h sys/socket.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:1384: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1389 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1394: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
else
echo "$ac_t""no" 1>&6
fi
done
echo $ac_n "checking for working const""... $ac_c" 1>&6
echo "configure:1422: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1427 "configure"
#include "confdefs.h"
int main() {
/* Ultrix mips cc rejects this. */
typedef int charset[2]; const charset x;
/* SunOS 4.1.1 cc rejects this. */
char const *const *ccp;
char **p;
/* NEC SVR4.0.2 mips cc rejects this. */
struct point {int x, y;};
static struct point const zero = {0,0};
/* AIX XL C 1.02.0.0 rejects this.
It does not let you subtract one const X* pointer from another in an arm
of an if-expression whose if-part is not a constant expression */
const char *g = "string";
ccp = &g + (g ? g-g : 0);
/* HPUX 7.0 cc rejects these. */
++ccp;
p = (char**) ccp;
ccp = (char const *const *) p;
{ /* SCO 3.2v4 cc rejects this. */
char *t;
char const *s = 0 ? (char *) 0 : (char const *) 0;
*t++ = 0;
}
{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
int x[] = {25, 17};
const int *foo = &x[0];
++foo;
}
{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
typedef const int *iptr;
iptr p = 0;
++p;
}
{ /* AIX XL C 1.02.0.0 rejects this saying
"k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
struct s { int j; const int *ap[3]; };
struct s *b; b->j = 5;
}
{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
const int foo = 10;
}
; return 0; }
EOF
if { (eval echo configure:1476: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
ac_cv_c_const=no
fi
rm -f conftest*
fi
echo "$ac_t""$ac_cv_c_const" 1>&6
if test $ac_cv_c_const = no; then
cat >> confdefs.h <<\EOF
#define const
EOF
fi
echo $ac_n "checking for mode_t""... $ac_c" 1>&6
echo "configure:1497: checking for mode_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1502 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
rm -rf conftest*
ac_cv_type_mode_t=yes
else
rm -rf conftest*
ac_cv_type_mode_t=no
fi
rm -f conftest*
fi
echo "$ac_t""$ac_cv_type_mode_t" 1>&6
if test $ac_cv_type_mode_t = no; then
cat >> confdefs.h <<\EOF
#define mode_t int
EOF
fi
echo $ac_n "checking for off_t""... $ac_c" 1>&6
echo "configure:1530: checking for off_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1535 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
rm -rf conftest*
ac_cv_type_off_t=yes
else
rm -rf conftest*
ac_cv_type_off_t=no
fi
rm -f conftest*
fi
echo "$ac_t""$ac_cv_type_off_t" 1>&6
if test $ac_cv_type_off_t = no; then
cat >> confdefs.h <<\EOF
#define off_t long
EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
echo "configure:1563: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1568 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
rm -rf conftest*
ac_cv_type_size_t=yes
else
rm -rf conftest*
ac_cv_type_size_t=no
fi
rm -f conftest*
fi
echo "$ac_t""$ac_cv_type_size_t" 1>&6
if test $ac_cv_type_size_t = no; then
cat >> confdefs.h <<\EOF
#define size_t unsigned
EOF
fi
for ac_func in socket strcspn strdup strstr uname
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:1599: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1604 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
int main() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif
; return 0; }
EOF
if { (eval echo configure:1627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
else
echo "$ac_t""no" 1>&6
fi
done
for ac_func in strsep
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:1654: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1659 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
int main() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif
; return 0; }
EOF
if { (eval echo configure:1682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
else
echo "$ac_t""no" 1>&6
LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
fi
done
trap '' 1 2 15
cat > confcache <<\EOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
# scripts and configure runs. It is not useful on other systems.
# If it contains results you don't want to keep, you may remove or edit it.
#
# By default, configure uses ./config.cache as the cache file,
# creating it if it does not exist already. You can give configure
# the --cache-file=FILE option to use a different cache file; that is
# what configure does when it calls configure scripts in
# subdirectories, so they share the cache.
# Giving --cache-file=/dev/null disables caching, for debugging configure.
# config.status only pays attention to the cache file if you give it the
# --recheck option to rerun configure.
#
EOF
# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
# So, don't put newlines in cache variables' values.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(set) 2>&1 |
case `(ac_space=' '; set | grep ac_space) 2>&1` in
*ac_space=\ *)
# `set' does not quote correctly, so add quotes (double-quote substitution
# turns \\\\ into \\, and sed turns \\ into \).
sed -n \
-e "s/'/'\\\\''/g" \
-e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
;;
*)
# `set' quotes correctly as required by POSIX, so do not add quotes.
sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
;;
esac >> confcache
if cmp -s $cache_file confcache; then
:
else
if test -w $cache_file; then
echo "updating cache $cache_file"
cat confcache > $cache_file
else
echo "not updating unwritable cache $cache_file"
fi
fi
rm -f confcache
trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
# Any assignment to VPATH causes Sun make to only execute
# the first set of double-colon rules, so remove it if not needed.
# If there is a colon in the path, we need to keep it.
if test "x$srcdir" = x.; then
ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
fi
trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
DEFS=-DHAVE_CONFIG_H
# Without the "./", some shells look in PATH for config.status.
: ${CONFIG_STATUS=./config.status}
echo creating $CONFIG_STATUS
rm -f $CONFIG_STATUS
cat > $CONFIG_STATUS <<EOF
#! /bin/sh
# Generated automatically by configure.
# Run this file to recreate the current configuration.
# This directory was configured as follows,
# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
#
# $0 $ac_configure_args
#
# Compiler output produced by configure, useful for debugging
# configure, is in ./config.log if it exists.
ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
for ac_option
do
case "\$ac_option" in
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
echo "$CONFIG_STATUS generated by autoconf version 2.13"
exit 0 ;;
-help | --help | --hel | --he | --h)
echo "\$ac_cs_usage"; exit 0 ;;
*) echo "\$ac_cs_usage"; exit 1 ;;
esac
done
ac_given_srcdir=$srcdir
trap 'rm -fr `echo "Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF
# Protect against being on the right side of a sed subst in config.status.
sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
$ac_vpsub
$extrasub
s%@SHELL@%$SHELL%g
s%@CFLAGS@%$CFLAGS%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%g
s%@FFLAGS@%$FFLAGS%g
s%@DEFS@%$DEFS%g
s%@LDFLAGS@%$LDFLAGS%g
s%@LIBS@%$LIBS%g
s%@exec_prefix@%$exec_prefix%g
s%@prefix@%$prefix%g
s%@program_transform_name@%$program_transform_name%g
s%@bindir@%$bindir%g
s%@sbindir@%$sbindir%g
s%@libexecdir@%$libexecdir%g
s%@datadir@%$datadir%g
s%@sysconfdir@%$sysconfdir%g
s%@sharedstatedir@%$sharedstatedir%g
s%@localstatedir@%$localstatedir%g
s%@libdir@%$libdir%g
s%@includedir@%$includedir%g
s%@oldincludedir@%$oldincludedir%g
s%@infodir@%$infodir%g
s%@mandir@%$mandir%g
s%@CC@%$CC%g
s%@LN_S@%$LN_S%g
s%@CPP@%$CPP%g
s%@LIBOBJS@%$LIBOBJS%g
CEOF
EOF
cat >> $CONFIG_STATUS <<\EOF
# Split the substitutions into bite-sized pieces for seds with
# small command number limits, like on Digital OSF/1 and HP-UX.
ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
ac_file=1 # Number of current file.
ac_beg=1 # First line for current file.
ac_end=$ac_max_sed_cmds # Line after last line for current file.
ac_more_lines=:
ac_sed_cmds=""
while $ac_more_lines; do
if test $ac_beg -gt 1; then
sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
else
sed "${ac_end}q" conftest.subs > conftest.s$ac_file
fi
if test ! -s conftest.s$ac_file; then
ac_more_lines=false
rm -f conftest.s$ac_file
else
if test -z "$ac_sed_cmds"; then
ac_sed_cmds="sed -f conftest.s$ac_file"
else
ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
fi
ac_file=`expr $ac_file + 1`
ac_beg=$ac_end
ac_end=`expr $ac_end + $ac_max_sed_cmds`
fi
done
if test -z "$ac_sed_cmds"; then
ac_sed_cmds=cat
fi
EOF
cat >> $CONFIG_STATUS <<EOF
CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
case "$ac_file" in
*:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
*) ac_file_in="${ac_file}.in" ;;
esac
# Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
# Remove last slash and all that follows it. Not all systems have dirname.
ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
# The file is in a subdirectory.
test ! -d "$ac_dir" && mkdir "$ac_dir"
ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
# A "../" for each directory in $ac_dir_suffix.
ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
else
ac_dir_suffix= ac_dots=
fi
case "$ac_given_srcdir" in
.) srcdir=.
if test -z "$ac_dots"; then top_srcdir=.
else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
/*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
*) # Relative path.
srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
top_srcdir="$ac_dots$ac_given_srcdir" ;;
esac
echo creating "$ac_file"
rm -f "$ac_file"
configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
case "$ac_file" in
*Makefile*) ac_comsub="1i\\
# $configure_input" ;;
*) ac_comsub= ;;
esac
ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
sed -e "$ac_comsub
s%@configure_input@%$configure_input%g
s%@srcdir@%$srcdir%g
s%@top_srcdir@%$top_srcdir%g
" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
fi; done
rm -f conftest.s*
# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
# NAME is the cpp macro being defined and VALUE is the value it is being given.
#
# ac_d sets the value in "#define NAME VALUE" lines.
ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
ac_dC='\3'
ac_dD='%g'
# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
ac_uB='\([ ]\)%\1#\2define\3'
ac_uC=' '
ac_uD='\4%g'
# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
ac_eB='$%\1#\2define\3'
ac_eC=' '
ac_eD='%g'
if test "${CONFIG_HEADERS+set}" != set; then
EOF
cat >> $CONFIG_STATUS <<EOF
CONFIG_HEADERS="config.h"
EOF
cat >> $CONFIG_STATUS <<\EOF
fi
for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
case "$ac_file" in
*:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
*) ac_file_in="${ac_file}.in" ;;
esac
echo creating $ac_file
rm -f conftest.frag conftest.in conftest.out
ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
cat $ac_file_inputs > conftest.in
EOF
# Transform confdefs.h into a sed script conftest.vals that substitutes
# the proper values into config.h.in to produce config.h. And first:
# Protect against being on the right side of a sed subst in config.status.
# Protect against being in an unquoted here document in config.status.
rm -f conftest.vals
cat > conftest.hdr <<\EOF
s/[\\&%]/\\&/g
s%[\\$`]%\\&%g
s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
s%ac_d%ac_u%gp
s%ac_u%ac_e%gp
EOF
sed -n -f conftest.hdr confdefs.h > conftest.vals
rm -f conftest.hdr
# This sed command replaces #undef with comments. This is necessary, for
# example, in the case of _POSIX_SOURCE, which is predefined and required
# on some systems where configure will not decide to define it.
cat >> conftest.vals <<\EOF
s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
EOF
# Break up conftest.vals because some shells have a limit on
# the size of here documents, and old seds have small limits too.
rm -f conftest.tail
while :
do
ac_lines=`grep -c . conftest.vals`
# grep -c gives empty output for an empty file on some AIX systems.
if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
# Write a limited-size here document to conftest.frag.
echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
echo 'CEOF
sed -f conftest.frag conftest.in > conftest.out
rm -f conftest.in
mv conftest.out conftest.in
' >> $CONFIG_STATUS
sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
rm -f conftest.vals
mv conftest.tail conftest.vals
done
rm -f conftest.vals
cat >> $CONFIG_STATUS <<\EOF
rm -f conftest.frag conftest.h
echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
cat conftest.in >> conftest.h
rm -f conftest.in
if cmp -s $ac_file conftest.h 2>/dev/null; then
echo "$ac_file is unchanged"
rm -f conftest.h
else
# Remove last slash and all that follows it. Not all systems have dirname.
ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
# The file is in a subdirectory.
test ! -d "$ac_dir" && mkdir "$ac_dir"
fi
rm -f $ac_file
mv conftest.h $ac_file
fi
fi; done
EOF
cat >> $CONFIG_STATUS <<EOF
EOF
cat >> $CONFIG_STATUS <<\EOF
exit 0
EOF
chmod +x $CONFIG_STATUS
rm -fr confdefs* $ac_clean_files
test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
|
Added work/libopennet/configure.in.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
dnl Process this file with autoconf to produce a configure script.
AC_INIT(buffer.c)
AC_CONFIG_HEADER(config.h)
dnl Checks for programs.
AC_PROG_CC
AC_PROG_LN_S
dnl Checks for libraries.
dnl Replace `main' with a function in -lm:
AC_CHECK_LIB(m, pow)
DC_DO_NETSET
dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h unistd.h stdint.h sys/socket.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
dnl Checks for library functions.
AC_CHECK_FUNCS(socket strcspn strdup strstr uname)
AC_REPLACE_FUNCS(strsep)
AC_OUTPUT(Makefile)
|
Added work/libopennet/crc.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#include "conf.h"
#include "crc.h"
uint32_t ELFCRC(const uint32_t start, const unsigned char *name, const uint32_t n) {
uint32_t i,h,g;
h=start;
for (i=0;i<n;i++) {
h = (h << 4) + (*name++);
if ((g = (h & 0xf0000000)))
h ^= (g >> 24);
h &= ~g;
}
return(h);
}
|
Added work/libopennet/crc.h.
|
|
>
>
>
>
>
>
|
1
2
3
4
5
6
|
#ifndef _CRC_H
#define _CRC_H
#include "conf.h"
uint32_t ELFCRC(const uint32_t start, const unsigned char *name, const uint32_t n);
#endif
|
Added work/libopennet/libopennet.so.
cannot compute difference between binary files
Added work/libopennet/makearch.sh.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#!/bin/sh
APPL=libopennet
VER=`/usr/bin/grep "^\#define VERSION" conf.h | /bin/cut -f 3 -d " " | /usr/bin/tr "\n" . | /bin/cut -f 1-3 -d "." | sed s/"\""/""/g`
DIRECT=`pwd`
cd ../
echo "Making archive `pwd`/$APPL-$VER.tar.gz"
/bin/mkdir $APPL-$VER
cd $DIRECT
/bin/cp * ../$APPL-$VER/ 2> /dev/null
cd ../$APPL-$VER/
/usr/bin/sed s/"__VERSION__"/$VER/g README > f
/bin/mv f README
/bin/rm makearch.sh
make distclean >/dev/null
cd ..
/bin/tar -zhcf $APPL-$VER.tar.gz $APPL-$VER/*
/bin/rm -rf $APPL-$VER
cd $DIRECT
|
Added work/libopennet/opennet.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
|
/*
* Network related functions
*/
#include <sys/types.h>
#include <sys/stat.h>
#include <stdarg.h>
#include <unistd.h>
#include <fcntl.h>
#include "conf.h"
#include "opennet.h"
#ifndef NO_NETWORK
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdlib.h>
#include <string.h>
#include <netdb.h>
#include <errno.h>
#include <stdio.h>
#include "parse.h"
#include "crc.h"
extern int errno;
char *opennet_urls[256];
/*
* Create a listening port on tcp port PORT
*/
int createlisten(int port)
{
struct sockaddr_in localname;
int sockFd;
sockFd=socket(AF_INET,SOCK_STREAM,IPPROTO_IP);
localname.sin_family=AF_INET;
localname.sin_port=htons(port);
localname.sin_addr.s_addr=INADDR_ANY;
if (bind(sockFd,(struct sockaddr *) & localname,sizeof(localname))==-1) { perror("bind");return(-1); }
if (listen(sockFd,1024)==-1) { perror("listen"); return(-1); }
return(sockFd);
}
/*
* Close that socket, yeah.
*/
void closeconnection(int sockfd) {
shutdown(sockfd, 1);
close(sockfd);
}
int createconnection_tcp(char *host, int port) {
int sockid;
struct hostent *hostinfo;
struct sockaddr_in sock;
if ((hostinfo=gethostbyname(host))==NULL) {
#ifdef HAVE_INET_ATON
if (!inet_aton(host,&sock.sin_addr))
#else
if ( (sock.sin_addr.s_addr=inet_addr(host) )==-1)
#endif
return(-1);
} else {
memcpy(&sock.sin_addr.s_addr,hostinfo->h_addr_list[0],hostinfo->h_length);
}
sock.sin_family=AF_INET;
sock.sin_port=htons(port);
if ((sockid=socket(AF_INET, SOCK_STREAM, 0))<0)
return(-1);
if (connect(sockid, (struct sockaddr *) &sock, sizeof(sock))<0) {
close(sockid);
return(-1);
}
return(sockid);
}
int open_net(const char *pathname, int flags, ...) {
char scheme[5], host[512], file[1024];
char username[128], password[128];
char *read_buf, *read_buf_s=NULL;
char *smallbuf, *tmpbuf;
int port, fd, x, ftpfd=-1, retrmode=0;
va_list args;
mode_t mode;
va_start(args, flags);
mode = va_arg(args, mode_t);
va_end(args);
if (!parse_url(pathname,scheme,username,password,host,&port,file)) {
if ((fd=createconnection_tcp(host,port))<0) return(-1);
switch (ELFCRC(0, scheme, strlen(scheme))) {
case 457648: /* http */
if ((flags&3)==O_WRONLY || (flags&3)==O_RDWR) {
close(fd);
return(-1);
}
read_buf_s=read_buf=malloc(50);
write(fd, "GET ", 4);
write(fd, file, strlen(file));
write(fd, " HTTP/1.0\nHost: ",16);
write(fd, host, strlen(host));
write(fd, "\n", 1);
if (strcmp(username, "")) {
smallbuf=malloc(strlen(password)+strlen(username)+3);
smallbuf[0]=0;
strcat(smallbuf,username);
strcat(smallbuf,":");
strcat(smallbuf,password);
tmpbuf=mime64(smallbuf);
write(fd, "Authorization: Basic ", 21);
write(fd, tmpbuf, strlen(tmpbuf));
free(tmpbuf);
free(smallbuf);
write(fd, "\n", 1);
}
write(fd, "\n", 1);
x=read(fd, read_buf, 50);
strsep(&read_buf," ");
if (strncmp("200 ",read_buf,4) && strncmp("302 ",read_buf,4)) {
free(read_buf_s);
close(fd);
errno=ENOENT;
return(-1);
}
retrmode=read_buf[0];
read_buf=read_buf_s;
read_buf[4]=0;
while (1) {
read(fd, read_buf, 1);
if (read_buf[0]==read_buf[2]&&read_buf[0]=='\n') break;
if (!strncmp(":noi", read_buf, 4) && retrmode=='3') {
tmpbuf=smallbuf=malloc(512);
read(fd, read_buf, 1);
read(fd, smallbuf, 510);
close(fd);
return(open_net(strsep(&smallbuf,"\r\n"),flags,mode));
free(tmpbuf);
}
read_buf[3]=read_buf[2];
read_buf[2]=read_buf[1];
read_buf[1]=read_buf[0];
}
free(read_buf_s);
if (opennet_urls[fd]!=NULL) free(opennet_urls[fd]);
opennet_urls[fd]=strdup(pathname);
return(fd);
break;
case 28080: /* ftp */
if ((flags&3)==O_RDWR) {
close(fd);
return(-1);
}
read_buf_s=read_buf=malloc(1024);
read_buf[0]=0;
while (1) {
if ((x=read(fd, read_buf, 1024))<1024) {
if (x<0) {
free(read_buf_s);
errno=EIO;
return(-1);
}
/* It's waiting for input... */
}
read_buf[x]=0;
while ((smallbuf=strsep(&read_buf,"\n"))!=NULL) {
switch (ELFCRC(0, smallbuf, 4)) {
case 231456: /* 550 */
if (ftpfd!=-1) close(ftpfd);
close(fd);
free(read_buf_s);
errno=ENOENT;
return(-1);
break;
case 230944: /* 530 */
if (ftpfd!=-1) close(ftpfd);
close(fd);
free(read_buf_s);
errno=EIO;
return(-1);
break;
case 231504: /* 553 */
if (ftpfd!=-1) close(ftpfd);
close(fd);
free(read_buf_s);
errno=EPERM;
return(-1);
break;
case 218400: /* 220 */
write(fd, "USER ", 5);
if (strcmp(username,"")) {
write(fd, username, strlen(username));
} else {
write(fd, "anonymous", 9);
}
write(fd, "\n", 1);
break;
case 222768: /* 331 */
write(fd, "PASS ", 5);
if (strcmp(password,"")) {
write(fd, password, strlen(password));
} else {
write(fd, "user@host.com", 13);
}
write(fd, "\n", 1);
break;
case 218512: /* 227 */
strsep(&smallbuf,"(");
host[0]=0;
for (x=0;x<4;x++) {
strncat(host,strsep(&smallbuf,","),5);
strcat(host,".");
}
host[strlen(host)-1]=0;
port=(atoi(strsep(&smallbuf,","))<<8)+atoi(strsep(&smallbuf,")\n\r "));
write(fd, "TYPE I\n", 7);
break;
case 217888:
if ((flags&3)==O_RDONLY) write(fd,"RETR ",5);
if ((flags&3)==O_WRONLY) write(fd,"STOR ",5);
write(fd, file, strlen(file));
write(fd, "\n", 1);
if ((ftpfd=createconnection_tcp(host,port))<0) {
close(fd);
errno=ENOENT;
return(-1);
}
break;
case 215072: /* 150 */
if (opennet_urls[ftpfd]!=NULL) free(opennet_urls[ftpfd]);
opennet_urls[ftpfd]=strdup(pathname);
return(ftpfd);
break;
case 218656: /* 230 */
write(fd, "PASV\n", 5);
break;
default:
break;
}
}
read_buf=read_buf_s;
}
break;
}
free(read_buf_s);
close(fd);
} else {
fd=open(pathname,flags,mode);
if (opennet_urls[fd]!=NULL) free(opennet_urls[fd]);
opennet_urls[fd]=strdup(pathname);
return(fd);
}
return(-1);
}
off_t lseek_net(int filedes, off_t offset, int whence) {
struct stat file_status;
int newfd;
fstat(filedes, &file_status);
if (S_ISSOCK(file_status.st_mode)) {
if (whence==SEEK_END) return(-1);
if (offset!=0 || whence!=SEEK_SET) return(-1); /* For now ... */
if ((newfd=open_net(opennet_urls[filedes],O_RDONLY))<0) return(-1);
close(filedes);
dup2(newfd,filedes);
return(0);
}
return(lseek(filedes,offset,whence));
}
#else
int createlisten(int port) { return(-1); }
void closeconnection(int sockfd) { return; }
int createconnection_tcp(char *host, int port) { return(-1); }
int open_net(const char *pathname, int flags,...) {
va_list args;
mode_t mode;
va_start(args, flags);
mode = va_arg(args, mode_t);
va_end(args);
return(open(pathname,flags,mode));
}
off_t lseek_net(int filedes, off_t offset, int whence) {
return(lseek(filedes,offset,whence));
}
#endif
|
Added work/libopennet/opennet.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
#ifndef _OPENNET_H
#define _OPENNET_H
#include <sys/types.h>
#include <unistd.h>
int createlisten(int port);
void closeconnection(int sockfd);
int createconnection_tcp(char *host, int port);
int open_net(const char *pathname, int flags, ...);
off_t lseek_net(int filedes, off_t offset, int whence);
ssize_t read_net(int fd, void *buf, size_t count);
#endif
|
Added work/libopennet/parse.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
|
/*
Help, my atoi() is broken.
*/
#include <sys/utsname.h>
#include <sys/types.h>
#include <dirent.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <math.h>
#include "conf.h"
#include "buffer.h"
#include "parse.h"
#include "crc.h"
uint32_t atoi2(const char *n) {
uint32_t retval=0;
int i,m;
if (n==NULL) return(0);
m=strcspn(n,".");
for (i=0;i<m;i++) retval+=(n[i]-48)*pow(10,m-i-1);
return(retval);
}
/* Parse those stupid netscape-style URLs, icky.
* And I know this REALLY crummy looking, but it works
* (albeit, probably not perfectly) suffciently well.
* -- Roy Keene <rkeene@Rkeene.org>
* `scheme' will never exceed 5 bytes
* `username' will never exceed 128 bytes
* `password' will never exceed 128 bytes
* `host' will never exceed 512 bytes
* `file' will never exceed 1024 bytes
*/
int parse_url(const char *url, char *scheme, char *username, char *password, char *host, int *port, char *file) {
char *local_url=NULL, *local_url_s;
if (strstr(url,"://")==NULL) { /* Make sure we have an URL */
strncpy(file,url,1023);
return(1);
};
local_url_s=local_url=parse_url_subst(url);
*port=0;
file[1]=0;
strncpy(scheme,strsep(&local_url,":"),5);
local_url+=2;
strncpy(host,strsep(&local_url,"/"),512);
if (local_url!=NULL) strncpy(file+1,local_url,1022);
file[0]='/';
password[0]=0;
if (strchr(host,'@')!=NULL) {
local_url=local_url_s; /* Doh! This was missing. */
strcpy(local_url,host);
strncpy(username,strsep(&local_url,"@:"),128);
if (strchr(local_url,'@')!=NULL)
strncpy(password,strsep(&local_url,"@"),128);
strcpy(host,local_url);
} else {
strcpy(username,"");
}
if (strchr(host,':')!=NULL) {
local_url=local_url_s;
strcpy(local_url,host);
strcpy(host,strsep(&local_url,":"));
*port=atoi(local_url);
} else {
if (!strcasecmp(scheme,"http")) *port=80;
if (!strcasecmp(scheme,"ftp")) *port=21;
}
free(local_url_s);
strtolower(scheme);
return(0);
}
/*
Replace
@@OSNM@@ OS Name (linux, freebsd, sunos, etc)
@@OSVR@@ OS version (2.2.x, 4.2, 5.8, etc)
@@OSVS@@ OS version (short) (2.2, 4.2, 5.8, etc)
@@ARCH@@ Arch (i386, sparc64, sun4u, sun4m, etc)
@@DIST@@ If OSNM=Linux, distribution of Linux.
@@ATSN@@ Put an `@'
*/
char *parse_url_subst(const char *src) {
struct utsname system_info;
uint32_t cmd=0, x, strsz;
const char *loc=src, *ploc=loc;
char *ret, *ret_s, found=0, *smbuf;
if (!strstr((char *) src,"@@")) return(strdup(src));
ret_s=ret=calloc(1024,1);
uname(&system_info);
strtolower(system_info.sysname);
strtolower(system_info.machine);
while (strstr(loc,"@@")) {
cmd=ELFCRC(0, loc=strstr(loc, "@@")+2, 4);
loc+=6;
strsz=(loc-ploc-8);
memcpy(ret, ploc, strsz);
ret+=strsz;
if ((ret-ret_s)>(1024-128)) break;
switch (cmd) {
case 288376: /* ARCH-done */
x=strlen(system_info.machine);
if (x>127) break;
memcpy(ret,system_info.machine,x);
ret+=x;
break;
case 346157: /* OSNM-done */
x=strlen(system_info.sysname);
if (x>127) break;
memcpy(ret,system_info.sysname,x);
ret+=x;
break;
case 346290: /* OSVR-done */
if (strlen(system_info.release)>127) break;
for (x=0;x<strlen(system_info.release);x++) {
if (isdigit(system_info.release[x]) || system_info.release[x]=='.') {
ret[0]=system_info.release[x];
ret++;
} else {
break;
}
}
break;
case 346291: /* OSVS-done */
if (strlen(system_info.release)>127) break;
for (x=0;x<strlen(system_info.release);x++) {
if (system_info.release[x]=='.' && found) break;
if (system_info.release[x]=='.') found=1;
if (isdigit(system_info.release[x]) || found) {
ret[0]=system_info.release[x];
ret++;
}
}
break;
case 298628: /* DIST-done */
if (!strcmp("linux",system_info.sysname)) {
smbuf=parse_url_subst_dist();
if (smbuf==NULL) break;
x=strlen(smbuf);
if (x>127) break;
memcpy(ret, smbuf, x);
ret+=x;
}
break;
case 289150: /* ATSN-done */
ret[0]='@';
ret+=1;
break;
default:
break;
}
ploc=loc;
}
memcpy(ret, loc, strlen(loc));
return(ret_s);
}
char *parse_url_subst_dist(void) {
DIR *dirfd=NULL;
struct dirent *info=NULL;
static char retbuf[128]="unknown";
char *buf;
/*
Round 1: check for /etc/DISTRIBUTION-version or /etc/DISTRIBUTION-release
*/
dirfd=opendir("/etc/.");
while ((info=readdir(dirfd)) != NULL) {
if ((buf=strstr(info->d_name,"-version"))!=NULL) {
buf[0]=0;
strncpy(retbuf, info->d_name, sizeof(retbuf));
return(retbuf);
}
if ((buf=strstr(info->d_name,"_version"))!=NULL) {
buf[0]=0;
strncpy(retbuf, info->d_name, sizeof(retbuf));
return(retbuf);
}
if ((buf=strstr(info->d_name,"-release"))!=NULL) {
buf[0]=0;
strncpy(retbuf, info->d_name, sizeof(retbuf));
return(retbuf);
}
}
/*
Round 2: ??? (distinguish between older versions of Slackware
and Unknown distributions..)
*/
return(retbuf);
}
void strtolower(char *str) {
uint32_t x=0;
while (str[x]) { str[x]=tolower(str[x]); x++; }
}
char *mime64(char *str) {
char *ret;
char mimeabet[64]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
int i=0, x=0, m, bit_buf_sze;
uint32_t bit_buf_sto;
bit_buf_sze=bit_buffer_size(); /* Save the bit buffer, in case in use */
bit_buf_sto=bit_buffer_read(bit_buf_sze);
if ((ret=malloc((int) ((((float)strlen(str))*1.5)+6)))==NULL) return(NULL);
while (i<strlen(str)) {
while (bit_buffer_size()>=6) ret[x++]=mimeabet[bit_buffer_read(6)];
if ((bit_buffer_size()+8)<=32) bit_buffer_write(str[i++],8);
}
while (bit_buffer_size()>=6) ret[x++]=mimeabet[bit_buffer_read(6)];
if ((m=bit_buffer_size())) ret[x++]=mimeabet[bit_buffer_read(m)<<(6-m)];
while (x&3) ret[x++]='=';
bit_buffer_write(bit_buf_sto, bit_buf_sze); /* Restore it */
return(ret);
}
ssize_t read_net(int fd, void *buf, size_t count) {
ssize_t i=0,x;
while (i!=count) {
x=read(fd,(void *) ((buf)+i),count-i);
if (x==0) break;
if (x==-1) return(-1);
i+=x;
}
return(i);
}
|
Added work/libopennet/parse.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
|
#ifndef _PARSE_C
#define _PARSE_C
#include "conf.h"
uint32_t atoi2(const char *n);
int parse_url(const char *url, char *scheme, char *username, char *password, char *host, int *port, char *file);
void strtolower(char *str);
char *parse_url_subst(const char *src);
char *parse_url_subst_dist(void);
char *mime64(char *str);
uint32_t hash_fourbyte(unsigned char *str, const char term);
#endif
|
Added work/libopennet/strsep.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
/* Compliments of Jay Freeman <saurik@saurik.com> */
#include <string.h>
char *strsep(char **stringp, const char *delim) {
char *ret = *stringp;
if (ret == NULL) return(NULL); /* grrr */
if ((*stringp = strpbrk(*stringp, delim)) != NULL) {
*((*stringp)++) = '\0';
}
return(ret);
}
|
Added work/libopennet/strsep.h.
|
|
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
|
/* Compliments of Jay Freeman <saurik@saurik.com> */
#ifndef _OPENNET_STRSEP_H
#define _OPENNET_STRSEP_H
char *strsep(char **stringp, const char *delim);
#endif
|
Added work/makearch.sh.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
#!/bin/sh
cd /home/rkeene/devel/compression/
VER=`/usr/bin/grep "DACT_VER_" dact.h | /bin/cut -f 3 -d " " | /usr/bin/tr "\n" . | /bin/cut -f 1-3 -d "."`
DIRECT=`pwd`
cd ../
echo "Making archive `pwd`/dact-$VER.tar.gz"
cd $DIRECT
VER_MAJ=`echo $VER | cut -f 1 -d .`
VER_MIN=`echo $VER | cut -f 2 -d .`
VER_REV=`echo $VER | cut -f 3 -d .`
mkdir -p ../dact-$VER/Docs
cp * ../dact-$VER 2>/dev/null >/dev/null
cp Docs/* ../dact-$VER/Docs/ 2>/dev/null >/dev/null
cd ../dact-$VER
rm -f makearch.sh .* *.dct *.bak *.swp *.exe makesnapshot.sh *.o joe* bob* f 2>/dev/null >/dev/null
for i in *.[ch]; do
grep -v ^// $i > f
mv f $i
done
./configure 2>&1 >/dev/null
/usr/bin/make distclean >/dev/null 2>/dev/null
/usr/bin/make Makefile.dep 2>/dev/null >/dev/null
/usr/bin/sed s/"DACT_VERSION"/$VER/g README > f
/bin/mv f README
/usr/bin/md5sum * 2>/dev/null > MD5SUM
/usr/bin/file * 2>/dev/null > FILETYPE
printf "%03i%03i%03i\n" $VER_MAJ $VER_MIN $VER_REV > VERSION
cd ..
/bin/tar -zhcf dact-$VER.tar.gz dact-$VER/*
/bin/rm -rf dact-$VER
|
Added work/makesnapshot.sh.
|
|
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
|
#!/bin/bash
cd /home/rkeene/devel/compression
VER=`/usr/bin/grep "DACT_VER_" dact.h | /bin/cut -f 3 -d " " | /usr/bin/tr "\n" . | /bin/cut -f 1-3 -d "."`
./makearch.sh 2>/dev/null >/dev/null
cp ../dact-$VER.tar.gz /web/rkeene/devel/dact-snapshot.tar.gz
|
Added work/man/man1/bzcmp.1.
Added work/man/man1/bzdiff.1.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
\"Shamelessly copied from zmore.1 by Philippe Troin <phil@fifi.org>
\"for Debian GNU/Linux
.TH BZDIFF 1
.SH NAME
bzcmp, bzdiff \- compare bzip2 compressed files
.SH SYNOPSIS
.B bzcmp
[ cmp_options ] file1
[ file2 ]
.br
.B bzdiff
[ diff_options ] file1
[ file2 ]
.SH DESCRIPTION
.I Bzcmp
and
.I bzdiff
are used to invoke the
.I cmp
or the
.I diff
program on bzip2 compressed files. All options specified are passed
directly to
.I cmp
or
.IR diff "."
If only 1 file is specified, then the files compared are
.I file1
and an uncompressed
.IR file1 ".bz2."
If two files are specified, then they are uncompressed if necessary and fed to
.I cmp
or
.IR diff "."
The exit status from
.I cmp
or
.I diff
is preserved.
.SH "SEE ALSO"
cmp(1), diff(1), bzmore(1), bzless(1), bzgrep(1), bzip2(1)
.SH BUGS
Messages from the
.I cmp
or
.I diff
programs refer to temporary filenames instead of those specified.
|
Added work/man/man1/bzegrep.1.
Added work/man/man1/bzfgrep.1.
Added work/man/man1/bzgrep.1.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
\"Shamelessly copied from zmore.1 by Philippe Troin <phil@fifi.org>
\"for Debian GNU/Linux
.TH BZGREP 1
.SH NAME
bzgrep, bzfgrep, bzegrep \- search possibly bzip2 compressed files for a regular expression
.SH SYNOPSIS
.B bzgrep
[ grep_options ]
.BI [\ -e\ ] " pattern"
.IR filename ".\|.\|."
.br
.B bzegrep
[ egrep_options ]
.BI [\ -e\ ] " pattern"
.IR filename ".\|.\|."
.br
.B bzfgrep
[ fgrep_options ]
.BI [\ -e\ ] " pattern"
.IR filename ".\|.\|."
.SH DESCRIPTION
.IR Bzgrep
is used to invoke the
.I grep
on bzip2-compressed files. All options specified are passed directly to
.I grep.
If no file is specified, then the standard input is decompressed
if necessary and fed to grep.
Otherwise the given files are uncompressed if necessary and fed to
.I grep.
.PP
If
.I bzgrep
is invoked as
.I bzegrep
or
.I bzfgrep
then
.I egrep
or
.I fgrep
is used instead of
.I grep.
If the GREP environment variable is set,
.I bzgrep
uses it as the
.I grep
program to be invoked. For example:
for sh: GREP=fgrep bzgrep string files
for csh: (setenv GREP fgrep; bzgrep string files)
.SH AUTHOR
Charles Levert (charles@comm.polymtl.ca). Adapted to bzip2 by Philippe
Troin <phil@fifi.org> for Debian GNU/Linux.
.SH "SEE ALSO"
grep(1), egrep(1), fgrep(1), bzdiff(1), bzmore(1), bzless(1), bzip2(1)
|
Added work/man/man1/bzip2.1.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
|
.PU
.TH bzip2 1
.SH NAME
bzip2, bunzip2 \- a block-sorting file compressor, v1.0.2
.br
bzcat \- decompresses files to stdout
.br
bzip2recover \- recovers data from damaged bzip2 files
.SH SYNOPSIS
.ll +8
.B bzip2
.RB [ " \-cdfkqstvzVL123456789 " ]
[
.I "filenames \&..."
]
.ll -8
.br
.B bunzip2
.RB [ " \-fkvsVL " ]
[
.I "filenames \&..."
]
.br
.B bzcat
.RB [ " \-s " ]
[
.I "filenames \&..."
]
.br
.B bzip2recover
.I "filename"
.SH DESCRIPTION
.I bzip2
compresses files using the Burrows-Wheeler block sorting
text compression algorithm, and Huffman coding. Compression is
generally considerably better than that achieved by more conventional
LZ77/LZ78-based compressors, and approaches the performance of the PPM
family of statistical compressors.
The command-line options are deliberately very similar to
those of
.I GNU gzip,
but they are not identical.
.I bzip2
expects a list of file names to accompany the
command-line flags. Each file is replaced by a compressed version of
itself, with the name "original_name.bz2".
Each compressed file
has the same modification date, permissions, and, when possible,
ownership as the corresponding original, so that these properties can
be correctly restored at decompression time. File name handling is
naive in the sense that there is no mechanism for preserving original
file names, permissions, ownerships or dates in filesystems which lack
these concepts, or have serious file name length restrictions, such as
MS-DOS.
.I bzip2
and
.I bunzip2
will by default not overwrite existing
files. If you want this to happen, specify the \-f flag.
If no file names are specified,
.I bzip2
compresses from standard
input to standard output. In this case,
.I bzip2
will decline to
write compressed output to a terminal, as this would be entirely
incomprehensible and therefore pointless.
.I bunzip2
(or
.I bzip2 \-d)
decompresses all
specified files. Files which were not created by
.I bzip2
will be detected and ignored, and a warning issued.
.I bzip2
attempts to guess the filename for the decompressed file
from that of the compressed file as follows:
filename.bz2 becomes filename
filename.bz becomes filename
filename.tbz2 becomes filename.tar
filename.tbz becomes filename.tar
anyothername becomes anyothername.out
If the file does not end in one of the recognised endings,
.I .bz2,
.I .bz,
.I .tbz2
or
.I .tbz,
.I bzip2
complains that it cannot
guess the name of the original file, and uses the original name
with
.I .out
appended.
As with compression, supplying no
filenames causes decompression from
standard input to standard output.
.I bunzip2
will correctly decompress a file which is the
concatenation of two or more compressed files. The result is the
concatenation of the corresponding uncompressed files. Integrity
testing (\-t)
of concatenated
compressed files is also supported.
You can also compress or decompress files to the standard output by
giving the \-c flag. Multiple files may be compressed and
decompressed like this. The resulting outputs are fed sequentially to
stdout. Compression of multiple files
in this manner generates a stream
containing multiple compressed file representations. Such a stream
can be decompressed correctly only by
.I bzip2
version 0.9.0 or
later. Earlier versions of
.I bzip2
will stop after decompressing
the first file in the stream.
.I bzcat
(or
.I bzip2 -dc)
decompresses all specified files to
the standard output.
.I bzip2
will read arguments from the environment variables
.I BZIP2
and
.I BZIP,
in that order, and will process them
before any arguments read from the command line. This gives a
convenient way to supply default arguments.
Compression is always performed, even if the compressed
file is slightly
larger than the original. Files of less than about one hundred bytes
tend to get larger, since the compression mechanism has a constant
overhead in the region of 50 bytes. Random data (including the output
of most file compressors) is coded at about 8.05 bits per byte, giving
an expansion of around 0.5%.
As a self-check for your protection,
.I
bzip2
uses 32-bit CRCs to
make sure that the decompressed version of a file is identical to the
original. This guards against corruption of the compressed data, and
against undetected bugs in
.I bzip2
(hopefully very unlikely). The
chances of data corruption going undetected is microscopic, about one
chance in four billion for each file processed. Be aware, though, that
the check occurs upon decompression, so it can only tell you that
something is wrong. It can't help you
recover the original uncompressed
data. You can use
.I bzip2recover
to try to recover data from
damaged files.
Return values: 0 for a normal exit, 1 for environmental problems (file
not found, invalid flags, I/O errors, &c), 2 to indicate a corrupt
compressed file, 3 for an internal consistency error (eg, bug) which
caused
.I bzip2
to panic.
.SH OPTIONS
.TP
.B \-c --stdout
Compress or decompress to standard output.
.TP
.B \-d --decompress
Force decompression.
.I bzip2,
.I bunzip2
and
.I bzcat
are
really the same program, and the decision about what actions to take is
done on the basis of which name is used. This flag overrides that
mechanism, and forces
.I bzip2
to decompress.
.TP
.B \-z --compress
The complement to \-d: forces compression, regardless of the
invocation name.
.TP
.B \-t --test
Check integrity of the specified file(s), but don't decompress them.
This really performs a trial decompression and throws away the result.
.TP
.B \-f --force
Force overwrite of output files. Normally,
.I bzip2
will not overwrite
existing output files. Also forces
.I bzip2
to break hard links
to files, which it otherwise wouldn't do.
bzip2 normally declines to decompress files which don't have the
correct magic header bytes. If forced (-f), however, it will pass
such files through unmodified. This is how GNU gzip behaves.
.TP
.B \-k --keep
Keep (don't delete) input files during compression
or decompression.
.TP
.B \-s --small
Reduce memory usage, for compression, decompression and testing. Files
are decompressed and tested using a modified algorithm which only
requires 2.5 bytes per block byte. This means any file can be
decompressed in 2300k of memory, albeit at about half the normal speed.
During compression, \-s selects a block size of 200k, which limits
memory use to around the same figure, at the expense of your compression
ratio. In short, if your machine is low on memory (8 megabytes or
less), use \-s for everything. See MEMORY MANAGEMENT below.
.TP
.B \-q --quiet
Suppress non-essential warning messages. Messages pertaining to
I/O errors and other critical events will not be suppressed.
.TP
.B \-v --verbose
Verbose mode -- show the compression ratio for each file processed.
Further \-v's increase the verbosity level, spewing out lots of
information which is primarily of interest for diagnostic purposes.
.TP
.B \-L --license -V --version
Display the software version, license terms and conditions.
.TP
.B \-1 (or \-\-fast) to \-9 (or \-\-best)
Set the block size to 100 k, 200 k .. 900 k when compressing. Has no
effect when decompressing. See MEMORY MANAGEMENT below.
The \-\-fast and \-\-best aliases are primarily for GNU gzip
compatibility. In particular, \-\-fast doesn't make things
significantly faster.
And \-\-best merely selects the default behaviour.
.TP
.B \--
Treats all subsequent arguments as file names, even if they start
with a dash. This is so you can handle files with names beginning
with a dash, for example: bzip2 \-- \-myfilename.
.TP
.B \--repetitive-fast --repetitive-best
These flags are redundant in versions 0.9.5 and above. They provided
some coarse control over the behaviour of the sorting algorithm in
earlier versions, which was sometimes useful. 0.9.5 and above have an
improved algorithm which renders these flags irrelevant.
.SH MEMORY MANAGEMENT
.I bzip2
compresses large files in blocks. The block size affects
both the compression ratio achieved, and the amount of memory needed for
compression and decompression. The flags \-1 through \-9
specify the block size to be 100,000 bytes through 900,000 bytes (the
default) respectively. At decompression time, the block size used for
compression is read from the header of the compressed file, and
.I bunzip2
then allocates itself just enough memory to decompress
the file. Since block sizes are stored in compressed files, it follows
that the flags \-1 to \-9 are irrelevant to and so ignored
during decompression.
Compression and decompression requirements,
in bytes, can be estimated as:
Compression: 400k + ( 8 x block size )
Decompression: 100k + ( 4 x block size ), or
100k + ( 2.5 x block size )
Larger block sizes give rapidly diminishing marginal returns. Most of
the compression comes from the first two or three hundred k of block
size, a fact worth bearing in mind when using
.I bzip2
on small machines.
It is also important to appreciate that the decompression memory
requirement is set at compression time by the choice of block size.
For files compressed with the default 900k block size,
.I bunzip2
will require about 3700 kbytes to decompress. To support decompression
of any file on a 4 megabyte machine,
.I bunzip2
has an option to
decompress using approximately half this amount of memory, about 2300
kbytes. Decompression speed is also halved, so you should use this
option only where necessary. The relevant flag is -s.
In general, try and use the largest block size memory constraints allow,
since that maximises the compression achieved. Compression and
decompression speed are virtually unaffected by block size.
Another significant point applies to files which fit in a single block
-- that means most files you'd encounter using a large block size. The
amount of real memory touched is proportional to the size of the file,
since the file is smaller than a block. For example, compressing a file
20,000 bytes long with the flag -9 will cause the compressor to
allocate around 7600k of memory, but only touch 400k + 20000 * 8 = 560
kbytes of it. Similarly, the decompressor will allocate 3700k but only
touch 100k + 20000 * 4 = 180 kbytes.
Here is a table which summarises the maximum memory usage for different
block sizes. Also recorded is the total compressed size for 14 files of
the Calgary Text Compression Corpus totalling 3,141,622 bytes. This
column gives some feel for how compression varies with block size.
These figures tend to understate the advantage of larger block sizes for
larger files, since the Corpus is dominated by smaller files.
Compress Decompress Decompress Corpus
Flag usage usage -s usage Size
-1 1200k 500k 350k 914704
-2 2000k 900k 600k 877703
-3 2800k 1300k 850k 860338
-4 3600k 1700k 1100k 846899
-5 4400k 2100k 1350k 845160
-6 5200k 2500k 1600k 838626
-7 6100k 2900k 1850k 834096
-8 6800k 3300k 2100k 828642
-9 7600k 3700k 2350k 828642
.SH RECOVERING DATA FROM DAMAGED FILES
.I bzip2
compresses files in blocks, usually 900kbytes long. Each
block is handled independently. If a media or transmission error causes
a multi-block .bz2
file to become damaged, it may be possible to
recover data from the undamaged blocks in the file.
The compressed representation of each block is delimited by a 48-bit
pattern, which makes it possible to find the block boundaries with
reasonable certainty. Each block also carries its own 32-bit CRC, so
damaged blocks can be distinguished from undamaged ones.
.I bzip2recover
is a simple program whose purpose is to search for
blocks in .bz2 files, and write each block out into its own .bz2
file. You can then use
.I bzip2
\-t
to test the
integrity of the resulting files, and decompress those which are
undamaged.
.I bzip2recover
takes a single argument, the name of the damaged file,
and writes a number of files "rec00001file.bz2",
"rec00002file.bz2", etc, containing the extracted blocks.
The output filenames are designed so that the use of
wildcards in subsequent processing -- for example,
"bzip2 -dc rec*file.bz2 > recovered_data" -- processes the files in
the correct order.
.I bzip2recover
should be of most use dealing with large .bz2
files, as these will contain many blocks. It is clearly
futile to use it on damaged single-block files, since a
damaged block cannot be recovered. If you wish to minimise
any potential data loss through media or transmission errors,
you might consider compressing with a smaller
block size.
.SH PERFORMANCE NOTES
The sorting phase of compression gathers together similar strings in the
file. Because of this, files containing very long runs of repeated
symbols, like "aabaabaabaab ..." (repeated several hundred times) may
compress more slowly than normal. Versions 0.9.5 and above fare much
better than previous versions in this respect. The ratio between
worst-case and average-case compression time is in the region of 10:1.
For previous versions, this figure was more like 100:1. You can use the
\-vvvv option to monitor progress in great detail, if you want.
Decompression speed is unaffected by these phenomena.
.I bzip2
usually allocates several megabytes of memory to operate
in, and then charges all over it in a fairly random fashion. This means
that performance, both for compressing and decompressing, is largely
determined by the speed at which your machine can service cache misses.
Because of this, small changes to the code to reduce the miss rate have
been observed to give disproportionately large performance improvements.
I imagine
.I bzip2
will perform best on machines with very large caches.
.SH CAVEATS
I/O error messages are not as helpful as they could be.
.I bzip2
tries hard to detect I/O errors and exit cleanly, but the details of
what the problem is sometimes seem rather misleading.
This manual page pertains to version 1.0.2 of
.I bzip2.
Compressed data created by this version is entirely forwards and
backwards compatible with the previous public releases, versions
0.1pl2, 0.9.0, 0.9.5, 1.0.0 and 1.0.1, but with the following
exception: 0.9.0 and above can correctly decompress multiple
concatenated compressed files. 0.1pl2 cannot do this; it will stop
after decompressing just the first file in the stream.
.I bzip2recover
versions prior to this one, 1.0.2, used 32-bit integers to represent
bit positions in compressed files, so it could not handle compressed
files more than 512 megabytes long. Version 1.0.2 and above uses
64-bit ints on some platforms which support them (GNU supported
targets, and Windows). To establish whether or not bzip2recover was
built with such a limitation, run it without arguments. In any event
you can build yourself an unlimited version if you can recompile it
with MaybeUInt64 set to be an unsigned 64-bit integer.
.SH AUTHOR
Julian Seward, jseward@acm.org.
http://sources.redhat.com/bzip2
The ideas embodied in
.I bzip2
are due to (at least) the following
people: Michael Burrows and David Wheeler (for the block sorting
transformation), David Wheeler (again, for the Huffman coder), Peter
Fenwick (for the structured coding model in the original
.I bzip,
and many refinements), and Alistair Moffat, Radford Neal and Ian Witten
(for the arithmetic coder in the original
.I bzip).
I am much
indebted for their help, support and advice. See the manual in the
source distribution for pointers to sources of documentation. Christian
von Roques encouraged me to look for faster sorting algorithms, so as to
speed up compression. Bela Lubkin encouraged me to improve the
worst-case compression performance.
The bz* scripts are derived from those of GNU gzip.
Many people sent patches, helped
with portability problems, lent machines, gave advice and were generally
helpful.
|
Added work/man/man1/bzless.1.
Added work/man/man1/bzmore.1.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
.\"Shamelessly copied from zmore.1 by Philippe Troin <phil@fifi.org>
.\"for Debian GNU/Linux
.TH BZMORE 1
.SH NAME
bzmore, bzless \- file perusal filter for crt viewing of bzip2 compressed text
.SH SYNOPSIS
.B bzmore
[ name ... ]
.br
.B bzless
[ name ... ]
.SH NOTE
In the following description,
.I bzless
and
.I less
can be used interchangeably with
.I bzmore
and
.I more.
.SH DESCRIPTION
.I Bzmore
is a filter which allows examination of compressed or plain text files
one screenful at a time on a soft-copy terminal.
.I bzmore
works on files compressed with
.I bzip2
and also on uncompressed files.
If a file does not exist,
.I bzmore
looks for a file of the same name with the addition of a .bz2 suffix.
.PP
.I Bzmore
normally pauses after each screenful, printing --More--
at the bottom of the screen.
If the user then types a carriage return, one more line is displayed.
If the user hits a space,
another screenful is displayed. Other possibilities are enumerated later.
.PP
.I Bzmore
looks in the file
.I /etc/termcap
to determine terminal characteristics,
and to determine the default window size.
On a terminal capable of displaying 24 lines,
the default window size is 22 lines.
Other sequences which may be typed when
.I bzmore
pauses, and their effects, are as follows (\fIi\fP is an optional integer
argument, defaulting to 1) :
.PP
.IP \fIi\|\fP<space>
display
.I i
more lines, (or another screenful if no argument is given)
.PP
.IP ^D
display 11 more lines (a ``scroll'').
If
.I i
is given, then the scroll size is set to \fIi\|\fP.
.PP
.IP d
same as ^D (control-D)
.PP
.IP \fIi\|\fPz
same as typing a space except that \fIi\|\fP, if present, becomes the new
window size. Note that the window size reverts back to the default at the
end of the current file.
.PP
.IP \fIi\|\fPs
skip \fIi\|\fP lines and print a screenful of lines
.PP
.IP \fIi\|\fPf
skip \fIi\fP screenfuls and print a screenful of lines
.PP
.IP "q or Q"
quit reading the current file; go on to the next (if any)
.PP
.IP "e or q"
When the prompt --More--(Next file:
.IR file )
is printed, this command causes bzmore to exit.
.PP
.IP s
When the prompt --More--(Next file:
.IR file )
is printed, this command causes bzmore to skip the next file and continue.
.PP
.IP =
Display the current line number.
.PP
.IP \fIi\|\fP/expr
search for the \fIi\|\fP-th occurrence of the regular expression \fIexpr.\fP
If the pattern is not found,
.I bzmore
goes on to the next file (if any).
Otherwise, a screenful is displayed, starting two lines before the place
where the expression was found.
The user's erase and kill characters may be used to edit the regular
expression.
Erasing back past the first column cancels the search command.
.PP
.IP \fIi\|\fPn
search for the \fIi\|\fP-th occurrence of the last regular expression entered.
.PP
.IP !command
invoke a shell with \fIcommand\|\fP.
The character `!' in "command" are replaced with the
previous shell command. The sequence "\\!" is replaced by "!".
.PP
.IP ":q or :Q"
quit reading the current file; go on to the next (if any)
(same as q or Q).
.PP
.IP .
(dot) repeat the previous command.
.PP
The commands take effect immediately, i.e., it is not necessary to
type a carriage return.
Up to the time when the command character itself is given,
the user may hit the line kill character to cancel the numerical
argument being formed.
In addition, the user may hit the erase character to redisplay the
--More-- message.
.PP
At any time when output is being sent to the terminal, the user can
hit the quit key (normally control\-\\).
.I Bzmore
will stop sending output, and will display the usual --More--
prompt.
The user may then enter one of the above commands in the normal manner.
Unfortunately, some output is lost when this is done, due to the
fact that any characters waiting in the terminal's output queue
are flushed when the quit signal occurs.
.PP
The terminal is set to
.I noecho
mode by this program so that the output can be continuous.
What you type will thus not show on your terminal, except for the / and !
commands.
.PP
If the standard output is not a teletype, then
.I bzmore
acts just like
.I bzcat,
except that a header is printed before each file.
.SH FILES
.DT
/etc/termcap Terminal data base
.SH "SEE ALSO"
more(1), less(1), bzip2(1), bzdiff(1), bzgrep(1)
|
Added work/open_net/.net.c.swp.
cannot compute difference between binary files
Added work/open_net/Makefile.
|
|
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
|
CC = gcc
LDFLAGS = -shared -rdynamic -ldl -lm
CFLAGS = -Wall
net.so: net.o parse.o
$(CC) $(LDFLAGS) -o net.so net.o parse.o
net.o: net.c net.h
parse.o: parse.c parse.h
|
Added work/open_net/net.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
|
/*
* Network related functions
*/
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <arpa/inet.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <stdarg.h>
#include <fcntl.h>
#include <netdb.h>
#include <dlfcn.h>
#include <errno.h>
#include <stdio.h>
#include "parse.h"
#include "net.h"
#define REAL_LIBC RTLD_NEXT
extern int errno;
/*
* Create a listening port on tcp port PORT
*/
int createlisten(int port)
{
struct sockaddr_in localname;
int sockFd;
sockFd=socket(AF_INET,SOCK_STREAM,IPPROTO_IP);
localname.sin_family=AF_INET;
localname.sin_port=htons(port);
localname.sin_addr.s_addr=INADDR_ANY;
if (bind(sockFd,(struct sockaddr *) & localname,sizeof(localname))==-1) { perror("bind");return(-1); }
if (listen(sockFd,1024)==-1) { perror("listen"); return(-1); }
return(sockFd);
}
/*
* Close that socket, yeah.
*/
void closeconnection(int sockfd) {
shutdown(sockfd, 1);
close(sockfd);
}
int createconnection_tcp(char *host, int port) {
int sockid;
struct hostent *hostinfo;
struct sockaddr_in sock;
if ((hostinfo=gethostbyname(host))==NULL) {
#ifdef HAVE_INET_ATON
if (!inet_aton(host,&sock.sin_addr))
#else
if ( (sock.sin_addr.s_addr=inet_addr(host) )==-1)
#endif
return(-1);
} else {
memcpy(&sock.sin_addr.s_addr,hostinfo->h_addr_list[0],hostinfo->h_length);
}
sock.sin_family=AF_INET;
sock.sin_port=htons(port);
if ((sockid=socket(AF_INET, SOCK_STREAM, 0))<0)
return(-1);
connect(sockid, (struct sockaddr *) &sock, sizeof(sock));
return(sockid);
}
int __open(const char *pathname, int flags, ...) {
static int (*old_open)(const char *, int, mode_t) = NULL;
uint32_t scheme_val=0;
va_list args;
mode_t mode;
char scheme[5], host[512], file[1024];
char username[128], password[128];
char *read_buf, *read_buf_s=NULL;
int port, fd, x;
if (!old_open) old_open=(int (*)(const char *, int, mode_t)) dlsym(REAL_LIBC, "__open");
va_start(args, flags);
mode = va_arg(args, mode_t);
va_end(args);
if (!parse_url(pathname,scheme,username,password,host,&port,file)) {
if ((fd=createconnection_tcp(host,port))<0) {
errno=ENOENT;
return(-1);
}
for (x=0;x<strlen(scheme);x++) scheme_val|=(scheme[x]<<(x*8));
switch (scheme_val) {
case 1886680168: /* http */
/* No writing via HTTP yet. */
if (flags==O_WRONLY || flags==O_RDWR) {
errno=EACCES;
return(-1);
}
read_buf_s=read_buf=malloc(50);
write(fd, "GET ", 4);
write(fd, file, strlen(file));
write(fd, " HTTP/1.1\nHost: ",16);
write(fd, host, strlen(host));
write(fd, "\n\n", 2);
x=read(fd, read_buf, 50);
strsep(&read_buf," ");
if (strncmp("200 ",read_buf,4)) {
free(read_buf_s);
close(fd);
errno=ENOENT;
return(-1);
}
read_buf=read_buf_s;
while (1) {
read(fd, read_buf, 1);
if ((read_buf[0]==read_buf[2]&&read_buf[0]=='\n')||(read_buf[0]==read_buf[1]=='\n')) break;
read_buf[3]=read_buf[2];
read_buf[2]=read_buf[1];
read_buf[1]=read_buf[0];
}
free(read_buf_s);
return(fd);
break;
case 7369830: /* ftp */
read_buf_s=read_buf=malloc(50);
break;
}
free(read_buf_s);
close(fd);
} else {
return(old_open(pathname,flags,mode));
}
errno=ENOTDIR;
return(-1);
}
int open(const char *pathname, int flags, ...) {
va_list args;
mode_t mode;
va_start(args, flags);
mode = va_arg(args, mode_t);
va_end(args);
return(__open(pathname,flags,mode));
}
int __xstat(int ver, const char *file_name, struct stat *buf) {
static int (*old_stat)(int, const char *, struct stat *) = NULL;
uint32_t scheme_val=0;
char scheme[5], host[512], file[1024];
char username[128], password[128];
char *read_buf, *read_buf_s=NULL;
int port, fd, x;
if (!old_stat) old_stat=(int (*)(int, const char *, struct stat *)) dlsym(REAL_LIBC, "__xstat");
if (!parse_url(file_name,scheme,username,password,host,&port,file)) {
if ((fd=createconnection_tcp(host,port))<0) {
errno=ENOENT;
return(-1);
}
buf->st_dev=0;
buf->st_ino=0;
buf->st_mode=0104755;
buf->st_nlink=1;
buf->st_uid=0;
// buf->st_uid=getuid();
buf->st_gid=getgid();
buf->st_rdev=0;
buf->st_size=0;
buf->st_blksize=512;
buf->st_blocks=0;
buf->st_atime=0;
buf->st_mtime=0;
buf->st_ctime=0;
for (x=0;x<strlen(scheme);x++) scheme_val|=(scheme[x]<<(x*8));
switch (scheme_val) {
case 1886680168: /* http */
case 7369830: /* ftp */
}
close(fd);
} else {
return(old_stat(ver,file_name,buf));
}
return(0);
}
int __lxstat(int ver, const char *file_name, struct stat *buf) {
static int (*old_stat)(int, const char *, struct stat *) = NULL;
uint32_t scheme_val=0;
char scheme[5], host[512], file[1024];
char username[128], password[128];
char *read_buf, *read_buf_s=NULL;
int port, fd, x;
if (!old_stat) old_stat=(int (*)(int, const char *, struct stat *)) dlsym(REAL_LIBC, "__lxstat");
if (!parse_url(file_name,scheme,username,password,host,&port,file)) {
if ((fd=createconnection_tcp(host,port))<0) {
errno=ENOENT;
return(-1);
}
buf->st_dev=0;
buf->st_ino=0;
buf->st_mode=0104755;
buf->st_nlink=1;
buf->st_uid=0;
// buf->st_uid=getuid();
buf->st_gid=getgid();
buf->st_rdev=0;
buf->st_size=0;
buf->st_blksize=512;
buf->st_blocks=0;
buf->st_atime=0;
buf->st_mtime=0;
buf->st_ctime=0;
for (x=0;x<strlen(scheme);x++) scheme_val|=(scheme[x]<<(x*8));
switch (scheme_val) {
case 1886680168: /* http */
case 7369830: /* ftp */
}
close(fd);
} else {
return(old_stat(ver,file_name,buf));
}
return(0);
}
int access(const char *pathname, int mode) {
static int (*old_access)(const char *, int) = NULL;
uint32_t scheme_val=0;
char scheme[5], host[512], file[1024];
char username[128], password[128];
char *read_buf, *read_buf_s=NULL;
int port, fd, x;
if (!old_access) old_access=(int (*)(const char *, int)) dlsym(REAL_LIBC, "access");
if (!parse_url(pathname,scheme,username,password,host,&port,file)) {
if ((fd=createconnection_tcp(host,port))<0) {
errno=ENOENT;
return(-1);
}
for (x=0;x<strlen(scheme);x++) scheme_val|=(scheme[x]<<(x*8));
switch (scheme_val) {
case 1886680168: /* http */
close(fd);
if (mode&F_OK || mode&R_OK) { return(0); } else { return(-1); }
case 7369830: /* ftp */
close(fd);
return(-1);
}
close(fd);
} else {
return(old_access(pathname,mode));
}
return(0);
}
|
Added work/open_net/net.h.
|
|
>
>
>
|
1
2
3
|
int createlisten(int port);
void closeconnection(int sockfd);
int createconnection_tcp(char *host, int port);
|
Added work/open_net/net.so.
cannot compute difference between binary files
Added work/open_net/parse.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
/*
Help, my atoi() is broken.
*/
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <math.h>
#include "parse.h"
uint32_t atoi2(const char *n) {
uint32_t retval=0;
int i,m;
if (n==NULL) return(0);
m=strcspn(n,".");
for (i=0;i<m;i++) retval+=(n[i]-48)*pow(10,m-i-1);
return(retval);
}
/* Parse those stupid netscape-style URLs, icky.
* And I know this REALLY crummy looking, but it works
* (albeit, probably not perfectly) suffciently well.
* -- Roy Keene <rkeene@Rkeene.org>
* `scheme' will never exceed 5 bytes
* `username' will never exceed 128 bytes
* `password' will never exceed 128 bytes
* `host' will never exceed 512 bytes
* `file' will never exceed 1024 bytes
*/
int parse_url(const char *url, char *scheme, char *username, char *password, char *host, int *port, char *file) {
char *local_url=NULL, *local_url_s;
int i=0;
if (strstr(url,"p:/")==NULL) { /* Make sure we have an URL */
strncpy(file,url,1023);
return(1);
};
local_url_s=local_url=strdup(url);
file[1]=0;
*port=0;
strncpy(scheme,strsep(&local_url,":"),5);
local_url++;
if (local_url[0]=='/') local_url++;
strncpy(host,strsep(&local_url,"/"),512);
if (local_url!=NULL) strncpy(file+1,local_url,1023);
file[0]='/';
password[0]=0;
if (strchr(host,'@')!=NULL) {
strcpy(local_url,host);
strncpy(username,strsep(&local_url,"@:"),128);
if (strchr(local_url,'@')!=NULL)
strncpy(password,strsep(&local_url,"@"),128);
strcpy(host,local_url);
} else {
strcpy(username,"");
}
if (strchr(host,':')!=NULL) {
strcpy(local_url,host);
strcpy(host,strsep(&local_url,":"));
*port=atoi(local_url);
} else {
if (!strcasecmp(scheme,"http")) *port=80;
if (!strcasecmp(scheme,"ftp")) *port=21;
}
free(local_url_s);
while (scheme[i]) scheme[i++]=tolower(scheme[i]);
return(0);
}
|
Added work/open_net/parse.h.
|
|
>
>
|
1
2
|
uint32_t atoi2(const char *n);
int parse_url(const char *url, char *scheme, char *username, char *password, char *host, int *port, char *file);
|
Added work/open_net/smtv.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
/*
* Network related functions
*/
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <arpa/inet.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <stdarg.h>
#include <fcntl.h>
#include <netdb.h>
#include <dlfcn.h>
#include <errno.h>
#include <stdio.h>
#include "parse.h"
#include "net.h"
#define REAL_LIBC RTLD_NEXT
int __open(const char *pathname, int flags, ...) {
static int (*old_open)(const char *, int, mode_t) = NULL;
uint32_t scheme_val=0;
va_list args;
mode_t mode;
char scheme[5], host[512], file[1024];
char username[128], password[128];
char *read_buf, *read_buf_s=NULL;
int port, fd, x;
if (!old_open) old_open=(int (*)(const char *, int, mode_t)) dlsym(REAL_LIBC, "__open");
va_start(args, flags);
mode = va_arg(args, mode_t);
va_end(args);
if (!strcmp(pathname,"/dev/audio")) {
return(old_open("/etc/showmetv/audio",flags,mode));
} else {
return(old_open(pathname,flags,mode));
}
return(-1);
}
int open(const char *pathname, int flags, ...) {
va_list args;
mode_t mode;
va_start(args, flags);
mode = va_arg(args, mode_t);
va_end(args);
return(__open(pathname,flags,mode));
}
|
Added work/open_net/smtv.so.
cannot compute difference between binary files
Added work/share/man/man3/zlib.3.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
|
.TH ZLIB 3 "17 November 2003"
.SH NAME
zlib \- compression/decompression library
.SH SYNOPSIS
[see
.I zlib.h
for full description]
.SH DESCRIPTION
The
.I zlib
library is a general purpose data compression library.
The code is thread safe.
It provides in-memory compression and decompression functions,
including integrity checks of the uncompressed data.
This version of the library supports only one compression method (deflation)
but other algorithms will be added later
and will have the same stream interface.
.LP
Compression can be done in a single step if the buffers are large enough
(for example if an input file is mmap'ed),
or can be done by repeated calls of the compression function.
In the latter case,
the application must provide more input and/or consume the output
(providing more output space) before each call.
.LP
The library also supports reading and writing files in
.IR gzip (1)
(.gz) format
with an interface similar to that of stdio.
.LP
The library does not install any signal handler.
The decoder checks the consistency of the compressed data,
so the library should never crash even in case of corrupted input.
.LP
All functions of the compression library are documented in the file
.IR zlib.h .
The distribution source includes examples of use of the library
in the files
.I example.c
and
.IR minigzip.c .
.LP
Changes to this version are documented in the file
.I ChangeLog
that accompanies the source,
and are concerned primarily with bug fixes and portability enhancements.
.LP
A Java implementation of
.I zlib
is available in the Java Development Kit 1.1:
.IP
http://www.javasoft.com/products/JDK/1.1/docs/api/Package-java.util.zip.html
.LP
A Perl interface to
.IR zlib ,
written by Paul Marquess (pmqs@cpan.org),
is available at CPAN (Comprehensive Perl Archive Network) sites,
including:
.IP
http://www.cpan.org/modules/by-module/Compress/
.LP
A Python interface to
.IR zlib ,
written by A.M. Kuchling (amk@magnet.com),
is available in Python 1.5 and later versions:
.IP
http://www.python.org/doc/lib/module-zlib.html
.LP
A
.I zlib
binding for
.IR tcl (1),
written by Andreas Kupries (a.kupries@westend.com),
is availlable at:
.IP
http://www.westend.com/~kupries/doc/trf/man/man.html
.LP
An experimental package to read and write files in .zip format,
written on top of
.I zlib
by Gilles Vollant (info@winimage.com),
is available at:
.IP
http://www.winimage.com/zLibDll/unzip.html
and also in the
.I contrib/minizip
directory of the main
.I zlib
web site.
.SH "SEE ALSO"
The
.I zlib
web site can be found at either of these locations:
.IP
http://www.zlib.org
.br
http://www.gzip.org/zlib/
.LP
The data format used by the zlib library is described by RFC
(Request for Comments) 1950 to 1952 in the files:
.IP
http://www.ietf.org/rfc/rfc1950.txt (concerning zlib format)
.br
http://www.ietf.org/rfc/rfc1951.txt (concerning deflate format)
.br
http://www.ietf.org/rfc/rfc1952.txt (concerning gzip format)
.LP
These documents are also available in other formats from:
.IP
ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html
.LP
Mark Nelson (markn@ieee.org) wrote an article about
.I zlib
for the Jan. 1997 issue of Dr. Dobb's Journal;
a copy of the article is available at:
.IP
http://dogma.net/markn/articles/zlibtool/zlibtool.htm
.SH "REPORTING PROBLEMS"
Before reporting a problem,
please check the
.I zlib
web site to verify that you have the latest version of
.IR zlib ;
otherwise,
obtain the latest version and see if the problem still exists.
Please read the
.I zlib
FAQ at:
.IP
http://www.gzip.org/zlib/zlib_faq.html
.LP
before asking for help.
Send questions and/or comments to zlib@gzip.org,
or (for the Windows DLL version) to Gilles Vollant (info@winimage.com).
.SH AUTHORS
Version 1.2.1
Copyright (C) 1995-2003 Jean-loup Gailly (jloup@gzip.org)
and Mark Adler (madler@alumni.caltech.edu).
.LP
This software is provided "as-is,"
without any express or implied warranty.
In no event will the authors be held liable for any damages
arising from the use of this software.
See the distribution directory with respect to requirements
governing redistribution.
The deflate format used by
.I zlib
was defined by Phil Katz.
The deflate and
.I zlib
specifications were written by L. Peter Deutsch.
Thanks to all the people who reported problems and suggested various
improvements in
.IR zlib ;
who are too numerous to cite here.
.LP
UNIX manual page by R. P. C. Rodgers,
U.S. National Library of Medicine (rodgers@nlm.nih.gov).
.\" end of man page
|
Added work/src/bzip2-1.0.2.tar.gz.
cannot compute difference between binary files
Added work/src/bzip2-1.0.2/CHANGES.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
|
0.9.0
~~~~~
First version.
0.9.0a
~~~~~~
Removed 'ranlib' from Makefile, since most modern Unix-es
don't need it, or even know about it.
0.9.0b
~~~~~~
Fixed a problem with error reporting in bzip2.c. This does not effect
the library in any way. Problem is: versions 0.9.0 and 0.9.0a (of the
program proper) compress and decompress correctly, but give misleading
error messages (internal panics) when an I/O error occurs, instead of
reporting the problem correctly. This shouldn't give any data loss
(as far as I can see), but is confusing.
Made the inline declarations disappear for non-GCC compilers.
0.9.0c
~~~~~~
Fixed some problems in the library pertaining to some boundary cases.
This makes the library behave more correctly in those situations. The
fixes apply only to features (calls and parameters) not used by
bzip2.c, so the non-fixedness of them in previous versions has no
effect on reliability of bzip2.c.
In bzlib.c:
* made zero-length BZ_FLUSH work correctly in bzCompress().
* fixed bzWrite/bzRead to ignore zero-length requests.
* fixed bzread to correctly handle read requests after EOF.
* wrong parameter order in call to bzDecompressInit in
bzBuffToBuffDecompress. Fixed.
In compress.c:
* changed setting of nGroups in sendMTFValues() so as to
do a bit better on small files. This _does_ effect
bzip2.c.
0.9.5a
~~~~~~
Major change: add a fallback sorting algorithm (blocksort.c)
to give reasonable behaviour even for very repetitive inputs.
Nuked --repetitive-best and --repetitive-fast since they are
no longer useful.
Minor changes: mostly a whole bunch of small changes/
bugfixes in the driver (bzip2.c). Changes pertaining to the
user interface are:
allow decompression of symlink'd files to stdout
decompress/test files even without .bz2 extension
give more accurate error messages for I/O errors
when compressing/decompressing to stdout, don't catch control-C
read flags from BZIP2 and BZIP environment variables
decline to break hard links to a file unless forced with -f
allow -c flag even with no filenames
preserve file ownerships as far as possible
make -s -1 give the expected block size (100k)
add a flag -q --quiet to suppress nonessential warnings
stop decoding flags after --, so files beginning in - can be handled
resolved inconsistent naming: bzcat or bz2cat ?
bzip2 --help now returns 0
Programming-level changes are:
fixed syntax error in GET_LL4 for Borland C++ 5.02
let bzBuffToBuffDecompress return BZ_DATA_ERROR{_MAGIC}
fix overshoot of mode-string end in bzopen_or_bzdopen
wrapped bzlib.h in #ifdef __cplusplus ... extern "C" { ... }
close file handles under all error conditions
added minor mods so it compiles with DJGPP out of the box
fixed Makefile so it doesn't give problems with BSD make
fix uninitialised memory reads in dlltest.c
0.9.5b
~~~~~~
Open stdin/stdout in binary mode for DJGPP.
0.9.5c
~~~~~~
Changed BZ_N_OVERSHOOT to be ... + 2 instead of ... + 1. The + 1
version could cause the sorted order to be wrong in some extremely
obscure cases. Also changed setting of quadrant in blocksort.c.
0.9.5d
~~~~~~
The only functional change is to make bzlibVersion() in the library
return the correct string. This has no effect whatsoever on the
functioning of the bzip2 program or library. Added a couple of casts
so the library compiles without warnings at level 3 in MS Visual
Studio 6.0. Included a Y2K statement in the file Y2K_INFO. All other
changes are minor documentation changes.
1.0
~~~
Several minor bugfixes and enhancements:
* Large file support. The library uses 64-bit counters to
count the volume of data passing through it. bzip2.c
is now compiled with -D_FILE_OFFSET_BITS=64 to get large
file support from the C library. -v correctly prints out
file sizes greater than 4 gigabytes. All these changes have
been made without assuming a 64-bit platform or a C compiler
which supports 64-bit ints, so, except for the C library
aspect, they are fully portable.
* Decompression robustness. The library/program should be
robust to any corruption of compressed data, detecting and
handling _all_ corruption, instead of merely relying on
the CRCs. What this means is that the program should
never crash, given corrupted data, and the library should
always return BZ_DATA_ERROR.
* Fixed an obscure race-condition bug only ever observed on
Solaris, in which, if you were very unlucky and issued
control-C at exactly the wrong time, both input and output
files would be deleted.
* Don't run out of file handles on test/decompression when
large numbers of files have invalid magic numbers.
* Avoid library namespace pollution. Prefix all exported
symbols with BZ2_.
* Minor sorting enhancements from my DCC2000 paper.
* Advance the version number to 1.0, so as to counteract the
(false-in-this-case) impression some people have that programs
with version numbers less than 1.0 are in some way, experimental,
pre-release versions.
* Create an initial Makefile-libbz2_so to build a shared library.
Yes, I know I should really use libtool et al ...
* Make the program exit with 2 instead of 0 when decompression
fails due to a bad magic number (ie, an invalid bzip2 header).
Also exit with 1 (as the manual claims :-) whenever a diagnostic
message would have been printed AND the corresponding operation
is aborted, for example
bzip2: Output file xx already exists.
When a diagnostic message is printed but the operation is not
aborted, for example
bzip2: Can't guess original name for wurble -- using wurble.out
then the exit value 0 is returned, unless some other problem is
also detected.
I think it corresponds more closely to what the manual claims now.
1.0.1
~~~~~
* Modified dlltest.c so it uses the new BZ2_ naming scheme.
* Modified makefile-msc to fix minor build probs on Win2k.
* Updated README.COMPILATION.PROBLEMS.
There are no functionality changes or bug fixes relative to version
1.0.0. This is just a documentation update + a fix for minor Win32
build problems. For almost everyone, upgrading from 1.0.0 to 1.0.1 is
utterly pointless. Don't bother.
1.0.2
~~~~~
A bug fix release, addressing various minor issues which have appeared
in the 18 or so months since 1.0.1 was released. Most of the fixes
are to do with file-handling or documentation bugs. To the best of my
knowledge, there have been no data-loss-causing bugs reported in the
compression/decompression engine of 1.0.0 or 1.0.1.
Note that this release does not improve the rather crude build system
for Unix platforms. The general plan here is to autoconfiscate/
libtoolise 1.0.2 soon after release, and release the result as 1.1.0
or perhaps 1.2.0. That, however, is still just a plan at this point.
Here are the changes in 1.0.2. Bug-reporters and/or patch-senders in
parentheses.
* Fix an infinite segfault loop in 1.0.1 when a directory is
encountered in -f (force) mode.
(Trond Eivind Glomsrod, Nicholas Nethercote, Volker Schmidt)
* Avoid double fclose() of output file on certain I/O error paths.
(Solar Designer)
* Don't fail with internal error 1007 when fed a long stream (> 48MB)
of byte 251. Also print useful message suggesting that 1007s may be
caused by bad memory.
(noticed by Juan Pedro Vallejo, fixed by me)
* Fix uninitialised variable silly bug in demo prog dlltest.c.
(Jorj Bauer)
* Remove 512-MB limitation on recovered file size for bzip2recover
on selected platforms which support 64-bit ints. At the moment
all GCC supported platforms, and Win32.
(me, Alson van der Meulen)
* Hard-code header byte values, to give correct operation on platforms
using EBCDIC as their native character set (IBM's OS/390).
(Leland Lucius)
* Copy file access times correctly.
(Marty Leisner)
* Add distclean and check targets to Makefile.
(Michael Carmack)
* Parameterise use of ar and ranlib in Makefile. Also add $(LDFLAGS).
(Rich Ireland, Bo Thorsen)
* Pass -p (create parent dirs as needed) to mkdir during make install.
(Jeremy Fusco)
* Dereference symlinks when copying file permissions in -f mode.
(Volker Schmidt)
* Majorly simplify implementation of uInt64_qrm10.
(Bo Lindbergh)
* Check the input file still exists before deleting the output one,
when aborting in cleanUpAndFail().
(Joerg Prante, Robert Linden, Matthias Krings)
Also a bunch of patches courtesy of Philippe Troin, the Debian maintainer
of bzip2:
* Wrapper scripts (with manpages): bzdiff, bzgrep, bzmore.
* Spelling changes and minor enhancements in bzip2.1.
* Avoid race condition between creating the output file and setting its
interim permissions safely, by using fopen_output_safely().
No changes to bzip2recover since there is no issue with file
permissions there.
* do not print senseless report with -v when compressing an empty
file.
* bzcat -f works on non-bzip2 files.
* do not try to escape shell meta-characters on unix (the shell takes
care of these).
* added --fast and --best aliases for -1 -9 for gzip compatibility.
|
Added work/src/bzip2-1.0.2/LICENSE.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
This program, "bzip2" and associated library "libbzip2", are
copyright (C) 1996-2002 Julian R Seward. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.
3. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
4. The name of the author may not be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Julian Seward, Cambridge, UK.
jseward@acm.org
bzip2/libbzip2 version 1.0.2 of 30 December 2001
|
Added work/src/bzip2-1.0.2/Makefile.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
|
SHELL=/bin/sh
# To assist in cross-compiling
CROSS=i586-mingw32msvc-
CC=$(CROSS)gcc
AR=$(CROSS)ar
RANLIB=$(CROSS)ranlib
LDFLAGS=
# Suitably paranoid flags to avoid bugs in gcc-2.7
BIGFILES=-D_FILE_OFFSET_BITS=64
CFLAGS=-Wall -Winline -O2 -fomit-frame-pointer -fno-strength-reduce $(BIGFILES)
# Where you want it installed when you do 'make install'
PREFIX=/home/rkeene/devel/work/
OBJS= blocksort.o \
huffman.o \
crctable.o \
randtable.o \
compress.o \
decompress.o \
bzlib.o
all: libbz2.a bzip2 bzip2recover test
bzip2: libbz2.a bzip2.o
$(CC) $(CFLAGS) $(LDFLAGS) -o bzip2 bzip2.o -L. -lbz2
bzip2recover: bzip2recover.o
$(CC) $(CFLAGS) $(LDFLAGS) -o bzip2recover bzip2recover.o
libbz2.a: $(OBJS)
rm -f libbz2.a
$(AR) cq libbz2.a $(OBJS)
@if ( test -f $(RANLIB) -o -f /usr/bin/ranlib -o \
-f /bin/ranlib -o -f /usr/ccs/bin/ranlib ) ; then \
echo $(RANLIB) libbz2.a ; \
$(RANLIB) libbz2.a ; \
fi
check: test
test: bzip2
@cat words1
./bzip2 -1 < sample1.ref > sample1.rb2
./bzip2 -2 < sample2.ref > sample2.rb2
./bzip2 -3 < sample3.ref > sample3.rb2
./bzip2 -d < sample1.bz2 > sample1.tst
./bzip2 -d < sample2.bz2 > sample2.tst
./bzip2 -ds < sample3.bz2 > sample3.tst
cmp sample1.bz2 sample1.rb2
cmp sample2.bz2 sample2.rb2
cmp sample3.bz2 sample3.rb2
cmp sample1.tst sample1.ref
cmp sample2.tst sample2.ref
cmp sample3.tst sample3.ref
@cat words3
install: bzip2 bzip2recover
if ( test ! -d $(PREFIX)/bin ) ; then mkdir -p $(PREFIX)/bin ; fi
if ( test ! -d $(PREFIX)/lib ) ; then mkdir -p $(PREFIX)/lib ; fi
if ( test ! -d $(PREFIX)/man ) ; then mkdir -p $(PREFIX)/man ; fi
if ( test ! -d $(PREFIX)/man/man1 ) ; then mkdir -p $(PREFIX)/man/man1 ; fi
if ( test ! -d $(PREFIX)/include ) ; then mkdir -p $(PREFIX)/include ; fi
cp -f bzip2 $(PREFIX)/bin/bzip2
cp -f bzip2 $(PREFIX)/bin/bunzip2
cp -f bzip2 $(PREFIX)/bin/bzcat
cp -f bzip2recover $(PREFIX)/bin/bzip2recover
chmod a+x $(PREFIX)/bin/bzip2
chmod a+x $(PREFIX)/bin/bunzip2
chmod a+x $(PREFIX)/bin/bzcat
chmod a+x $(PREFIX)/bin/bzip2recover
cp -f bzip2.1 $(PREFIX)/man/man1
chmod a+r $(PREFIX)/man/man1/bzip2.1
cp -f bzlib.h $(PREFIX)/include
chmod a+r $(PREFIX)/include/bzlib.h
cp -f libbz2.a $(PREFIX)/lib
chmod a+r $(PREFIX)/lib/libbz2.a
cp -f bzgrep $(PREFIX)/bin/bzgrep
ln $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzegrep
ln $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzfgrep
chmod a+x $(PREFIX)/bin/bzgrep
cp -f bzmore $(PREFIX)/bin/bzmore
ln $(PREFIX)/bin/bzmore $(PREFIX)/bin/bzless
chmod a+x $(PREFIX)/bin/bzmore
cp -f bzdiff $(PREFIX)/bin/bzdiff
ln $(PREFIX)/bin/bzdiff $(PREFIX)/bin/bzcmp
chmod a+x $(PREFIX)/bin/bzdiff
cp -f bzgrep.1 bzmore.1 bzdiff.1 $(PREFIX)/man/man1
chmod a+r $(PREFIX)/man/man1/bzgrep.1
chmod a+r $(PREFIX)/man/man1/bzmore.1
chmod a+r $(PREFIX)/man/man1/bzdiff.1
echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzegrep.1
echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzfgrep.1
echo ".so man1/bzmore.1" > $(PREFIX)/man/man1/bzless.1
echo ".so man1/bzdiff.1" > $(PREFIX)/man/man1/bzcmp.1
distclean: clean
clean:
rm -f *.o libbz2.a bzip2 bzip2recover \
sample1.rb2 sample2.rb2 sample3.rb2 \
sample1.tst sample2.tst sample3.tst
blocksort.o: blocksort.c
@cat words0
$(CC) $(CFLAGS) -c blocksort.c
huffman.o: huffman.c
$(CC) $(CFLAGS) -c huffman.c
crctable.o: crctable.c
$(CC) $(CFLAGS) -c crctable.c
randtable.o: randtable.c
$(CC) $(CFLAGS) -c randtable.c
compress.o: compress.c
$(CC) $(CFLAGS) -c compress.c
decompress.o: decompress.c
$(CC) $(CFLAGS) -c decompress.c
bzlib.o: bzlib.c
$(CC) $(CFLAGS) -c bzlib.c
bzip2.o: bzip2.c
$(CC) $(CFLAGS) -c bzip2.c
bzip2recover.o: bzip2recover.c
$(CC) $(CFLAGS) -c bzip2recover.c
DISTNAME=bzip2-1.0.2
tarfile:
rm -f $(DISTNAME)
ln -sf . $(DISTNAME)
tar cvf $(DISTNAME).tar \
$(DISTNAME)/blocksort.c \
$(DISTNAME)/huffman.c \
$(DISTNAME)/crctable.c \
$(DISTNAME)/randtable.c \
$(DISTNAME)/compress.c \
$(DISTNAME)/decompress.c \
$(DISTNAME)/bzlib.c \
$(DISTNAME)/bzip2.c \
$(DISTNAME)/bzip2recover.c \
$(DISTNAME)/bzlib.h \
$(DISTNAME)/bzlib_private.h \
$(DISTNAME)/Makefile \
$(DISTNAME)/manual.texi \
$(DISTNAME)/manual.ps \
$(DISTNAME)/manual.pdf \
$(DISTNAME)/LICENSE \
$(DISTNAME)/bzip2.1 \
$(DISTNAME)/bzip2.1.preformatted \
$(DISTNAME)/bzip2.txt \
$(DISTNAME)/words0 \
$(DISTNAME)/words1 \
$(DISTNAME)/words2 \
$(DISTNAME)/words3 \
$(DISTNAME)/sample1.ref \
$(DISTNAME)/sample2.ref \
$(DISTNAME)/sample3.ref \
$(DISTNAME)/sample1.bz2 \
$(DISTNAME)/sample2.bz2 \
$(DISTNAME)/sample3.bz2 \
$(DISTNAME)/dlltest.c \
$(DISTNAME)/*.html \
$(DISTNAME)/README \
$(DISTNAME)/README.COMPILATION.PROBLEMS \
$(DISTNAME)/CHANGES \
$(DISTNAME)/libbz2.def \
$(DISTNAME)/libbz2.dsp \
$(DISTNAME)/dlltest.dsp \
$(DISTNAME)/makefile.msc \
$(DISTNAME)/Y2K_INFO \
$(DISTNAME)/unzcrash.c \
$(DISTNAME)/spewG.c \
$(DISTNAME)/mk251.c \
$(DISTNAME)/bzdiff \
$(DISTNAME)/bzdiff.1 \
$(DISTNAME)/bzmore \
$(DISTNAME)/bzmore.1 \
$(DISTNAME)/bzgrep \
$(DISTNAME)/bzgrep.1 \
$(DISTNAME)/Makefile-libbz2_so
gzip -v $(DISTNAME).tar
# For rebuilding the manual from sources on my RedHat 7.2 box
manual: manual.ps manual.pdf manual.html
manual.ps: manual.texi
tex manual.texi
dvips -o manual.ps manual.dvi
manual.pdf: manual.ps
ps2pdf manual.ps
manual.html: manual.texi
texi2html -split_chapter manual.texi
|
Added work/src/bzip2-1.0.2/Makefile-libbz2_so.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
# This Makefile builds a shared version of the library,
# libbz2.so.1.0.2, with soname libbz2.so.1.0,
# at least on x86-Linux (RedHat 7.2),
# with gcc-2.96 20000731 (Red Hat Linux 7.1 2.96-98).
# Please see the README file for some
# important info about building the library like this.
SHELL=/bin/sh
CC=gcc
BIGFILES=-D_FILE_OFFSET_BITS=64
CFLAGS=-fpic -fPIC -Wall -Winline -O2 -fomit-frame-pointer -fno-strength-reduce $(BIGFILES)
OBJS= blocksort.o \
huffman.o \
crctable.o \
randtable.o \
compress.o \
decompress.o \
bzlib.o
all: $(OBJS)
$(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.2 $(OBJS)
$(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.2
rm -f libbz2.so.1.0
ln -s libbz2.so.1.0.2 libbz2.so.1.0
clean:
rm -f $(OBJS) bzip2.o libbz2.so.1.0.2 libbz2.so.1.0 bzip2-shared
blocksort.o: blocksort.c
$(CC) $(CFLAGS) -c blocksort.c
huffman.o: huffman.c
$(CC) $(CFLAGS) -c huffman.c
crctable.o: crctable.c
$(CC) $(CFLAGS) -c crctable.c
randtable.o: randtable.c
$(CC) $(CFLAGS) -c randtable.c
compress.o: compress.c
$(CC) $(CFLAGS) -c compress.c
decompress.o: decompress.c
$(CC) $(CFLAGS) -c decompress.c
bzlib.o: bzlib.c
$(CC) $(CFLAGS) -c bzlib.c
|
Added work/src/bzip2-1.0.2/README.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
|
This is the README for bzip2, a block-sorting file compressor, version
1.0.2. This version is fully compatible with the previous public
releases, versions 0.1pl2, 0.9.0, 0.9.5, 1.0.0 and 1.0.1.
bzip2-1.0.2 is distributed under a BSD-style license. For details,
see the file LICENSE.
Complete documentation is available in Postscript form (manual.ps),
PDF (manual.pdf, amazingly enough) or html (manual_toc.html). A
plain-text version of the manual page is available as bzip2.txt.
A statement about Y2K issues is now included in the file Y2K_INFO.
HOW TO BUILD -- UNIX
Type `make'. This builds the library libbz2.a and then the
programs bzip2 and bzip2recover. Six self-tests are run.
If the self-tests complete ok, carry on to installation:
To install in /usr/bin, /usr/lib, /usr/man and /usr/include, type
make install
To install somewhere else, eg, /xxx/yyy/{bin,lib,man,include}, type
make install PREFIX=/xxx/yyy
If you are (justifiably) paranoid and want to see what 'make install'
is going to do, you can first do
make -n install or
make -n install PREFIX=/xxx/yyy respectively.
The -n instructs make to show the commands it would execute, but
not actually execute them.
HOW TO BUILD -- UNIX, shared library libbz2.so.
Do 'make -f Makefile-libbz2_so'. This Makefile seems to work for
Linux-ELF (RedHat 7.2 on an x86 box), with gcc. I make no claims
that it works for any other platform, though I suspect it probably
will work for most platforms employing both ELF and gcc.
bzip2-shared, a client of the shared library, is also built, but not
self-tested. So I suggest you also build using the normal Makefile,
since that conducts a self-test. A second reason to prefer the
version statically linked to the library is that, on x86 platforms,
building shared objects makes a valuable register (%ebx) unavailable
to gcc, resulting in a slowdown of 10%-20%, at least for bzip2.
Important note for people upgrading .so's from 0.9.0/0.9.5 to version
1.0.X. All the functions in the library have been renamed, from (eg)
bzCompress to BZ2_bzCompress, to avoid namespace pollution.
Unfortunately this means that the libbz2.so created by
Makefile-libbz2_so will not work with any program which used an older
version of the library. Sorry. I do encourage library clients to
make the effort to upgrade to use version 1.0, since it is both faster
and more robust than previous versions.
HOW TO BUILD -- Windows 95, NT, DOS, Mac, etc.
It's difficult for me to support compilation on all these platforms.
My approach is to collect binaries for these platforms, and put them
on the master web page (http://sources.redhat.com/bzip2). Look there.
However (FWIW), bzip2-1.0.X is very standard ANSI C and should compile
unmodified with MS Visual C. If you have difficulties building, you
might want to read README.COMPILATION.PROBLEMS.
At least using MS Visual C++ 6, you can build from the unmodified
sources by issuing, in a command shell:
nmake -f makefile.msc
(you may need to first run the MSVC-provided script VCVARS32.BAT
so as to set up paths to the MSVC tools correctly).
VALIDATION
Correct operation, in the sense that a compressed file can always be
decompressed to reproduce the original, is obviously of paramount
importance. To validate bzip2, I used a modified version of Mark
Nelson's churn program. Churn is an automated test driver which
recursively traverses a directory structure, using bzip2 to compress
and then decompress each file it encounters, and checking that the
decompressed data is the same as the original. There are more details
in Section 4 of the user guide.
Please read and be aware of the following:
WARNING:
This program (attempts to) compress data by performing several
non-trivial transformations on it. Unless you are 100% familiar
with *all* the algorithms contained herein, and with the
consequences of modifying them, you should NOT meddle with the
compression or decompression machinery. Incorrect changes can and
very likely *will* lead to disastrous loss of data.
DISCLAIMER:
I TAKE NO RESPONSIBILITY FOR ANY LOSS OF DATA ARISING FROM THE
USE OF THIS PROGRAM, HOWSOEVER CAUSED.
Every compression of a file implies an assumption that the
compressed file can be decompressed to reproduce the original.
Great efforts in design, coding and testing have been made to
ensure that this program works correctly. However, the complexity
of the algorithms, and, in particular, the presence of various
special cases in the code which occur with very low but non-zero
probability make it impossible to rule out the possibility of bugs
remaining in the program. DO NOT COMPRESS ANY DATA WITH THIS
PROGRAM UNLESS YOU ARE PREPARED TO ACCEPT THE POSSIBILITY, HOWEVER
SMALL, THAT THE DATA WILL NOT BE RECOVERABLE.
That is not to say this program is inherently unreliable. Indeed,
I very much hope the opposite is true. bzip2 has been carefully
constructed and extensively tested.
PATENTS:
To the best of my knowledge, bzip2 does not use any patented
algorithms. However, I do not have the resources available to
carry out a full patent search. Therefore I cannot give any
guarantee of the above statement.
End of legalities.
WHAT'S NEW IN 0.9.0 (as compared to 0.1pl2) ?
* Approx 10% faster compression, 30% faster decompression
* -t (test mode) is a lot quicker
* Can decompress concatenated compressed files
* Programming interface, so programs can directly read/write .bz2 files
* Less restrictive (BSD-style) licensing
* Flag handling more compatible with GNU gzip
* Much more documentation, i.e., a proper user manual
* Hopefully, improved portability (at least of the library)
WHAT'S NEW IN 0.9.5 ?
* Compression speed is much less sensitive to the input
data than in previous versions. Specifically, the very
slow performance caused by repetitive data is fixed.
* Many small improvements in file and flag handling.
* A Y2K statement.
WHAT'S NEW IN 1.0.0 ?
See the CHANGES file.
WHAT'S NEW IN 1.0.2 ?
See the CHANGES file.
I hope you find bzip2 useful. Feel free to contact me at
jseward@acm.org
if you have any suggestions or queries. Many people mailed me with
comments, suggestions and patches after the releases of bzip-0.15,
bzip-0.21, and bzip2 versions 0.1pl2, 0.9.0, 0.9.5, 1.0.0 and 1.0.1,
and the changes in bzip2 are largely a result of this feedback.
I thank you for your comments.
At least for the time being, bzip2's "home" is (or can be reached via)
http://sources.redhat.com/bzip2.
Julian Seward
jseward@acm.org
Cambridge, UK (and what a great town this is!)
18 July 1996 (version 0.15)
25 August 1996 (version 0.21)
7 August 1997 (bzip2, version 0.1)
29 August 1997 (bzip2, version 0.1pl2)
23 August 1998 (bzip2, version 0.9.0)
8 June 1999 (bzip2, version 0.9.5)
4 Sept 1999 (bzip2, version 0.9.5d)
5 May 2000 (bzip2, version 1.0pre8)
30 December 2001 (bzip2, version 1.0.2pre1)
|
Added work/src/bzip2-1.0.2/README.COMPILATION.PROBLEMS.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
bzip2-1.0 should compile without problems on the vast majority of
platforms. Using the supplied Makefile, I've built and tested it
myself for x86-linux, sparc-solaris, alpha-linux, x86-cygwin32 and
alpha-tru64unix. With makefile.msc, Visual C++ 6.0 and nmake, you can
build a native Win32 version too. Large file support seems to work
correctly on at least alpha-tru64unix and x86-cygwin32 (on Windows
2000).
When I say "large file" I mean a file of size 2,147,483,648 (2^31)
bytes or above. Many older OSs can't handle files above this size,
but many newer ones can. Large files are pretty huge -- most files
you'll encounter are not Large Files.
Earlier versions of bzip2 (0.1, 0.9.0, 0.9.5) compiled on a wide
variety of platforms without difficulty, and I hope this version will
continue in that tradition. However, in order to support large files,
I've had to include the define -D_FILE_OFFSET_BITS=64 in the Makefile.
This can cause problems.
The technique of adding -D_FILE_OFFSET_BITS=64 to get large file
support is, as far as I know, the Recommended Way to get correct large
file support. For more details, see the Large File Support
Specification, published by the Large File Summit, at
http://www.sas.com/standard/large.file/
As a general comment, if you get compilation errors which you think
are related to large file support, try removing the above define from
the Makefile, ie, delete the line
BIGFILES=-D_FILE_OFFSET_BITS=64
from the Makefile, and do 'make clean ; make'. This will give you a
version of bzip2 without large file support, which, for most
applications, is probably not a problem.
Alternatively, try some of the platform-specific hints listed below.
You can use the spewG.c program to generate huge files to test bzip2's
large file support, if you are feeling paranoid. Be aware though that
any compilation problems which affect bzip2 will also affect spewG.c,
alas.
Known problems as of 1.0pre8:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* HP/UX 10.20 and 11.00, using gcc (2.7.2.3 and 2.95.2): A large
number of warnings appear, including the following:
/usr/include/sys/resource.h: In function `getrlimit':
/usr/include/sys/resource.h:168:
warning: implicit declaration of function `__getrlimit64'
/usr/include/sys/resource.h: In function `setrlimit':
/usr/include/sys/resource.h:170:
warning: implicit declaration of function `__setrlimit64'
This would appear to be a problem with large file support, header
files and gcc. gcc may or may not give up at this point. If it
fails, you might be able to improve matters by adding
-D__STDC_EXT__=1
to the BIGFILES variable in the Makefile (ie, change its definition
to
BIGFILES=-D_FILE_OFFSET_BITS=64 -D__STDC_EXT__=1
Even if gcc does produce a binary which appears to work (ie passes
its self-tests), you might want to test it to see if it works properly
on large files.
* HP/UX 10.20 and 11.00, using HP's cc compiler.
No specific problems for this combination, except that you'll need to
specify the -Ae flag, and zap the gcc-specific stuff
-Wall -Winline -O2 -fomit-frame-pointer -fno-strength-reduce.
You should retain -D_FILE_OFFSET_BITS=64 in order to get large
file support -- which is reported to work ok for this HP/UX + cc
combination.
* SunOS 4.1.X.
Amazingly, there are still people out there using this venerable old
banger. I shouldn't be too rude -- I started life on SunOS, and
it was a pretty darn good OS, way back then. Anyway:
SunOS doesn't seem to have strerror(), so you'll have to use
perror(), perhaps by doing adding this (warning: UNTESTED CODE):
char* strerror ( int errnum )
{
if (errnum < 0 || errnum >= sys_nerr)
return "Unknown error";
else
return sys_errlist[errnum];
}
Or you could comment out the relevant calls to strerror; they're
not mission-critical. Or you could upgrade to Solaris. Ha ha ha!
(what?? you think I've got Bad Attitude?)
* Making a shared library on Solaris. (Not really a compilation
problem, but many people ask ...)
Firstly, if you have Solaris 8, either you have libbz2.so already
on your system, or you can install it from the Solaris CD.
Secondly, be aware that there are potential naming conflicts
between the .so file supplied with Solaris 8, and the .so file
which Makefile-libbz2_so will make. Makefile-libbz2_so creates
a .so which has the names which I intend to be "official" as
of version 1.0.0 and onwards. Unfortunately, the .so in
Solaris 8 appeared before I decided on the final names, so
the two libraries are incompatible. We have since communicated
and I hope that the problems will have been solved in the next
version of Solaris, whenever that might appear.
All that said: you might be able to get somewhere
by finding the line in Makefile-libbz2_so which says
$(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.2 $(OBJS)
and replacing with
$(CC) -G -shared -o libbz2.so.1.0.2 -h libbz2.so.1.0 $(OBJS)
If gcc objects to the combination -fpic -fPIC, get rid of
the second one, leaving just "-fpic".
That's the end of the currently known compilation problems.
|
Added work/src/bzip2-1.0.2/Y2K_INFO.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
Y2K status of bzip2 and libbzip2, versions 0.1, 0.9.0 and 0.9.5
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Informally speaking:
bzip2 is a compression program built on top of libbzip2,
a library which does the real work of compression and
decompression. As far as I am aware, libbzip2 does not have
any date-related code at all.
bzip2 itself copies dates from source to destination files
when compressing or decompressing, using the 'stat' and 'utime'
UNIX system calls. It doesn't examine, manipulate or store the
dates in any way. So as far as I can see, there shouldn't be any
problem with bzip2 providing 'stat' and 'utime' work correctly
on your system.
On non-unix platforms (those for which BZ_UNIX in bzip2.c is
not set to 1), bzip2 doesn't even do the date copying.
Overall, informally speaking, I don't think bzip2 or libbzip2
have a Y2K problem.
Formally speaking:
I am not prepared to offer you any assurance whatsoever
regarding Y2K issues in my software. You alone assume the
entire risk of using the software. The disclaimer of liability
in the LICENSE file in the bzip2 source distribution continues
to apply on this issue as with every other issue pertaining
to the software.
Julian Seward
Cambridge, UK
25 August 1999
|
Added work/src/bzip2-1.0.2/blocksort.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
|
/*-------------------------------------------------------------*/
/*--- Block sorting machinery ---*/
/*--- blocksort.c ---*/
/*-------------------------------------------------------------*/
/*--
This file is a part of bzip2 and/or libbzip2, a program and
library for lossless, block-sorting data compression.
Copyright (C) 1996-2002 Julian R Seward. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.
3. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
4. The name of the author may not be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Julian Seward, Cambridge, UK.
jseward@acm.org
bzip2/libbzip2 version 1.0 of 21 March 2000
This program is based on (at least) the work of:
Mike Burrows
David Wheeler
Peter Fenwick
Alistair Moffat
Radford Neal
Ian H. Witten
Robert Sedgewick
Jon L. Bentley
For more information on these sources, see the manual.
To get some idea how the block sorting algorithms in this file
work, read my paper
On the Performance of BWT Sorting Algorithms
in Proceedings of the IEEE Data Compression Conference 2000,
Snowbird, Utah, USA, 27-30 March 2000. The main sort in this
file implements the algorithm called cache in the paper.
--*/
#include "bzlib_private.h"
/*---------------------------------------------*/
/*--- Fallback O(N log(N)^2) sorting ---*/
/*--- algorithm, for repetitive blocks ---*/
/*---------------------------------------------*/
/*---------------------------------------------*/
static
__inline__
void fallbackSimpleSort ( UInt32* fmap,
UInt32* eclass,
Int32 lo,
Int32 hi )
{
Int32 i, j, tmp;
UInt32 ec_tmp;
if (lo == hi) return;
if (hi - lo > 3) {
for ( i = hi-4; i >= lo; i-- ) {
tmp = fmap[i];
ec_tmp = eclass[tmp];
for ( j = i+4; j <= hi && ec_tmp > eclass[fmap[j]]; j += 4 )
fmap[j-4] = fmap[j];
fmap[j-4] = tmp;
}
}
for ( i = hi-1; i >= lo; i-- ) {
tmp = fmap[i];
ec_tmp = eclass[tmp];
for ( j = i+1; j <= hi && ec_tmp > eclass[fmap[j]]; j++ )
fmap[j-1] = fmap[j];
fmap[j-1] = tmp;
}
}
/*---------------------------------------------*/
#define fswap(zz1, zz2) \
{ Int32 zztmp = zz1; zz1 = zz2; zz2 = zztmp; }
#define fvswap(zzp1, zzp2, zzn) \
{ \
Int32 yyp1 = (zzp1); \
Int32 yyp2 = (zzp2); \
Int32 yyn = (zzn); \
while (yyn > 0) { \
fswap(fmap[yyp1], fmap[yyp2]); \
yyp1++; yyp2++; yyn--; \
} \
}
#define fmin(a,b) ((a) < (b)) ? (a) : (b)
#define fpush(lz,hz) { stackLo[sp] = lz; \
stackHi[sp] = hz; \
sp++; }
#define fpop(lz,hz) { sp--; \
lz = stackLo[sp]; \
hz = stackHi[sp]; }
#define FALLBACK_QSORT_SMALL_THRESH 10
#define FALLBACK_QSORT_STACK_SIZE 100
static
void fallbackQSort3 ( UInt32* fmap,
UInt32* eclass,
Int32 loSt,
Int32 hiSt )
{
Int32 unLo, unHi, ltLo, gtHi, n, m;
Int32 sp, lo, hi;
UInt32 med, r, r3;
Int32 stackLo[FALLBACK_QSORT_STACK_SIZE];
Int32 stackHi[FALLBACK_QSORT_STACK_SIZE];
r = 0;
sp = 0;
fpush ( loSt, hiSt );
while (sp > 0) {
AssertH ( sp < FALLBACK_QSORT_STACK_SIZE, 1004 );
fpop ( lo, hi );
if (hi - lo < FALLBACK_QSORT_SMALL_THRESH) {
fallbackSimpleSort ( fmap, eclass, lo, hi );
continue;
}
/* Random partitioning. Median of 3 sometimes fails to
avoid bad cases. Median of 9 seems to help but
looks rather expensive. This too seems to work but
is cheaper. Guidance for the magic constants
7621 and 32768 is taken from Sedgewick's algorithms
book, chapter 35.
*/
r = ((r * 7621) + 1) % 32768;
r3 = r % 3;
if (r3 == 0) med = eclass[fmap[lo]]; else
if (r3 == 1) med = eclass[fmap[(lo+hi)>>1]]; else
med = eclass[fmap[hi]];
unLo = ltLo = lo;
unHi = gtHi = hi;
while (1) {
while (1) {
if (unLo > unHi) break;
n = (Int32)eclass[fmap[unLo]] - (Int32)med;
if (n == 0) {
fswap(fmap[unLo], fmap[ltLo]);
ltLo++; unLo++;
continue;
};
if (n > 0) break;
unLo++;
}
while (1) {
if (unLo > unHi) break;
n = (Int32)eclass[fmap[unHi]] - (Int32)med;
if (n == 0) {
fswap(fmap[unHi], fmap[gtHi]);
gtHi--; unHi--;
continue;
};
if (n < 0) break;
unHi--;
}
if (unLo > unHi) break;
fswap(fmap[unLo], fmap[unHi]); unLo++; unHi--;
}
AssertD ( unHi == unLo-1, "fallbackQSort3(2)" );
if (gtHi < ltLo) continue;
n = fmin(ltLo-lo, unLo-ltLo); fvswap(lo, unLo-n, n);
m = fmin(hi-gtHi, gtHi-unHi); fvswap(unLo, hi-m+1, m);
n = lo + unLo - ltLo - 1;
m = hi - (gtHi - unHi) + 1;
if (n - lo > hi - m) {
fpush ( lo, n );
fpush ( m, hi );
} else {
fpush ( m, hi );
fpush ( lo, n );
}
}
}
#undef fmin
#undef fpush
#undef fpop
#undef fswap
#undef fvswap
#undef FALLBACK_QSORT_SMALL_THRESH
#undef FALLBACK_QSORT_STACK_SIZE
/*---------------------------------------------*/
/* Pre:
nblock > 0
eclass exists for [0 .. nblock-1]
((UChar*)eclass) [0 .. nblock-1] holds block
ptr exists for [0 .. nblock-1]
Post:
((UChar*)eclass) [0 .. nblock-1] holds block
All other areas of eclass destroyed
fmap [0 .. nblock-1] holds sorted order
bhtab [ 0 .. 2+(nblock/32) ] destroyed
*/
#define SET_BH(zz) bhtab[(zz) >> 5] |= (1 << ((zz) & 31))
#define CLEAR_BH(zz) bhtab[(zz) >> 5] &= ~(1 << ((zz) & 31))
#define ISSET_BH(zz) (bhtab[(zz) >> 5] & (1 << ((zz) & 31)))
#define WORD_BH(zz) bhtab[(zz) >> 5]
#define UNALIGNED_BH(zz) ((zz) & 0x01f)
static
void fallbackSort ( UInt32* fmap,
UInt32* eclass,
UInt32* bhtab,
Int32 nblock,
Int32 verb )
{
Int32 ftab[257];
Int32 ftabCopy[256];
Int32 H, i, j, k, l, r, cc, cc1;
Int32 nNotDone;
Int32 nBhtab;
UChar* eclass8 = (UChar*)eclass;
/*--
Initial 1-char radix sort to generate
initial fmap and initial BH bits.
--*/
if (verb >= 4)
VPrintf0 ( " bucket sorting ...\n" );
for (i = 0; i < 257; i++) ftab[i] = 0;
for (i = 0; i < nblock; i++) ftab[eclass8[i]]++;
for (i = 0; i < 256; i++) ftabCopy[i] = ftab[i];
for (i = 1; i < 257; i++) ftab[i] += ftab[i-1];
for (i = 0; i < nblock; i++) {
j = eclass8[i];
k = ftab[j] - 1;
ftab[j] = k;
fmap[k] = i;
}
nBhtab = 2 + (nblock / 32);
for (i = 0; i < nBhtab; i++) bhtab[i] = 0;
for (i = 0; i < 256; i++) SET_BH(ftab[i]);
/*--
Inductively refine the buckets. Kind-of an
"exponential radix sort" (!), inspired by the
Manber-Myers suffix array construction algorithm.
--*/
/*-- set sentinel bits for block-end detection --*/
for (i = 0; i < 32; i++) {
SET_BH(nblock + 2*i);
CLEAR_BH(nblock + 2*i + 1);
}
/*-- the log(N) loop --*/
H = 1;
while (1) {
if (verb >= 4)
VPrintf1 ( " depth %6d has ", H );
j = 0;
for (i = 0; i < nblock; i++) {
if (ISSET_BH(i)) j = i;
k = fmap[i] - H; if (k < 0) k += nblock;
eclass[k] = j;
}
nNotDone = 0;
r = -1;
while (1) {
/*-- find the next non-singleton bucket --*/
k = r + 1;
while (ISSET_BH(k) && UNALIGNED_BH(k)) k++;
if (ISSET_BH(k)) {
while (WORD_BH(k) == 0xffffffff) k += 32;
while (ISSET_BH(k)) k++;
}
l = k - 1;
if (l >= nblock) break;
while (!ISSET_BH(k) && UNALIGNED_BH(k)) k++;
if (!ISSET_BH(k)) {
while (WORD_BH(k) == 0x00000000) k += 32;
while (!ISSET_BH(k)) k++;
}
r = k - 1;
if (r >= nblock) break;
/*-- now [l, r] bracket current bucket --*/
if (r > l) {
nNotDone += (r - l + 1);
fallbackQSort3 ( fmap, eclass, l, r );
/*-- scan bucket and generate header bits-- */
cc = -1;
for (i = l; i <= r; i++) {
cc1 = eclass[fmap[i]];
if (cc != cc1) { SET_BH(i); cc = cc1; };
}
}
}
if (verb >= 4)
VPrintf1 ( "%6d unresolved strings\n", nNotDone );
H *= 2;
if (H > nblock || nNotDone == 0) break;
}
/*--
Reconstruct the original block in
eclass8 [0 .. nblock-1], since the
previous phase destroyed it.
--*/
if (verb >= 4)
VPrintf0 ( " reconstructing block ...\n" );
j = 0;
for (i = 0; i < nblock; i++) {
while (ftabCopy[j] == 0) j++;
ftabCopy[j]--;
eclass8[fmap[i]] = (UChar)j;
}
AssertH ( j < 256, 1005 );
}
#undef SET_BH
#undef CLEAR_BH
#undef ISSET_BH
#undef WORD_BH
#undef UNALIGNED_BH
/*---------------------------------------------*/
/*--- The main, O(N^2 log(N)) sorting ---*/
/*--- algorithm. Faster for "normal" ---*/
/*--- non-repetitive blocks. ---*/
/*---------------------------------------------*/
/*---------------------------------------------*/
static
__inline__
Bool mainGtU ( UInt32 i1,
UInt32 i2,
UChar* block,
UInt16* quadrant,
UInt32 nblock,
Int32* budget )
{
Int32 k;
UChar c1, c2;
UInt16 s1, s2;
AssertD ( i1 != i2, "mainGtU" );
/* 1 */
c1 = block[i1]; c2 = block[i2];
if (c1 != c2) return (c1 > c2);
i1++; i2++;
/* 2 */
c1 = block[i1]; c2 = block[i2];
if (c1 != c2) return (c1 > c2);
i1++; i2++;
/* 3 */
c1 = block[i1]; c2 = block[i2];
if (c1 != c2) return (c1 > c2);
i1++; i2++;
/* 4 */
c1 = block[i1]; c2 = block[i2];
if (c1 != c2) return (c1 > c2);
i1++; i2++;
/* 5 */
c1 = block[i1]; c2 = block[i2];
if (c1 != c2) return (c1 > c2);
i1++; i2++;
/* 6 */
c1 = block[i1]; c2 = block[i2];
if (c1 != c2) return (c1 > c2);
i1++; i2++;
/* 7 */
c1 = block[i1]; c2 = block[i2];
if (c1 != c2) return (c1 > c2);
i1++; i2++;
/* 8 */
c1 = block[i1]; c2 = block[i2];
if (c1 != c2) return (c1 > c2);
i1++; i2++;
/* 9 */
c1 = block[i1]; c2 = block[i2];
if (c1 != c2) return (c1 > c2);
i1++; i2++;
/* 10 */
c1 = block[i1]; c2 = block[i2];
if (c1 != c2) return (c1 > c2);
i1++; i2++;
/* 11 */
c1 = block[i1]; c2 = block[i2];
if (c1 != c2) return (c1 > c2);
i1++; i2++;
/* 12 */
c1 = block[i1]; c2 = block[i2];
if (c1 != c2) return (c1 > c2);
i1++; i2++;
k = nblock + 8;
do {
/* 1 */
c1 = block[i1]; c2 = block[i2];
if (c1 != c2) return (c1 > c2);
s1 = quadrant[i1]; s2 = quadrant[i2];
if (s1 != s2) return (s1 > s2);
i1++; i2++;
/* 2 */
c1 = block[i1]; c2 = block[i2];
if (c1 != c2) return (c1 > c2);
s1 = quadrant[i1]; s2 = quadrant[i2];
if (s1 != s2) return (s1 > s2);
i1++; i2++;
/* 3 */
c1 = block[i1]; c2 = block[i2];
if (c1 != c2) return (c1 > c2);
s1 = quadrant[i1]; s2 = quadrant[i2];
if (s1 != s2) return (s1 > s2);
i1++; i2++;
/* 4 */
c1 = block[i1]; c2 = block[i2];
if (c1 != c2) return (c1 > c2);
s1 = quadrant[i1]; s2 = quadrant[i2];
if (s1 != s2) return (s1 > s2);
i1++; i2++;
/* 5 */
c1 = block[i1]; c2 = block[i2];
if (c1 != c2) return (c1 > c2);
s1 = quadrant[i1]; s2 = quadrant[i2];
if (s1 != s2) return (s1 > s2);
i1++; i2++;
/* 6 */
c1 = block[i1]; c2 = block[i2];
if (c1 != c2) return (c1 > c2);
s1 = quadrant[i1]; s2 = quadrant[i2];
if (s1 != s2) return (s1 > s2);
i1++; i2++;
/* 7 */
c1 = block[i1]; c2 = block[i2];
if (c1 != c2) return (c1 > c2);
s1 = quadrant[i1]; s2 = quadrant[i2];
if (s1 != s2) return (s1 > s2);
i1++; i2++;
/* 8 */
c1 = block[i1]; c2 = block[i2];
if (c1 != c2) return (c1 > c2);
s1 = quadrant[i1]; s2 = quadrant[i2];
if (s1 != s2) return (s1 > s2);
i1++; i2++;
if (i1 >= nblock) i1 -= nblock;
if (i2 >= nblock) i2 -= nblock;
k -= 8;
(*budget)--;
}
while (k >= 0);
return False;
}
/*---------------------------------------------*/
/*--
Knuth's increments seem to work better
than Incerpi-Sedgewick here. Possibly
because the number of elems to sort is
usually small, typically <= 20.
--*/
static
Int32 incs[14] = { 1, 4, 13, 40, 121, 364, 1093, 3280,
9841, 29524, 88573, 265720,
797161, 2391484 };
static
void mainSimpleSort ( UInt32* ptr,
UChar* block,
UInt16* quadrant,
Int32 nblock,
Int32 lo,
Int32 hi,
Int32 d,
Int32* budget )
{
Int32 i, j, h, bigN, hp;
UInt32 v;
bigN = hi - lo + 1;
if (bigN < 2) return;
hp = 0;
while (incs[hp] < bigN) hp++;
hp--;
for (; hp >= 0; hp--) {
h = incs[hp];
i = lo + h;
while (True) {
/*-- copy 1 --*/
if (i > hi) break;
v = ptr[i];
j = i;
while ( mainGtU (
ptr[j-h]+d, v+d, block, quadrant, nblock, budget
) ) {
ptr[j] = ptr[j-h];
j = j - h;
if (j <= (lo + h - 1)) break;
}
ptr[j] = v;
i++;
/*-- copy 2 --*/
if (i > hi) break;
v = ptr[i];
j = i;
while ( mainGtU (
ptr[j-h]+d, v+d, block, quadrant, nblock, budget
) ) {
ptr[j] = ptr[j-h];
j = j - h;
if (j <= (lo + h - 1)) break;
}
ptr[j] = v;
i++;
/*-- copy 3 --*/
if (i > hi) break;
v = ptr[i];
j = i;
while ( mainGtU (
ptr[j-h]+d, v+d, block, quadrant, nblock, budget
) ) {
ptr[j] = ptr[j-h];
j = j - h;
if (j <= (lo + h - 1)) break;
}
ptr[j] = v;
i++;
if (*budget < 0) return;
}
}
}
/*---------------------------------------------*/
/*--
The following is an implementation of
an elegant 3-way quicksort for strings,
described in a paper "Fast Algorithms for
Sorting and Searching Strings", by Robert
Sedgewick and Jon L. Bentley.
--*/
#define mswap(zz1, zz2) \
{ Int32 zztmp = zz1; zz1 = zz2; zz2 = zztmp; }
#define mvswap(zzp1, zzp2, zzn) \
{ \
Int32 yyp1 = (zzp1); \
Int32 yyp2 = (zzp2); \
Int32 yyn = (zzn); \
while (yyn > 0) { \
mswap(ptr[yyp1], ptr[yyp2]); \
yyp1++; yyp2++; yyn--; \
} \
}
static
__inline__
UChar mmed3 ( UChar a, UChar b, UChar c )
{
UChar t;
if (a > b) { t = a; a = b; b = t; };
if (b > c) {
b = c;
if (a > b) b = a;
}
return b;
}
#define mmin(a,b) ((a) < (b)) ? (a) : (b)
#define mpush(lz,hz,dz) { stackLo[sp] = lz; \
stackHi[sp] = hz; \
stackD [sp] = dz; \
sp++; }
#define mpop(lz,hz,dz) { sp--; \
lz = stackLo[sp]; \
hz = stackHi[sp]; \
dz = stackD [sp]; }
#define mnextsize(az) (nextHi[az]-nextLo[az])
#define mnextswap(az,bz) \
{ Int32 tz; \
tz = nextLo[az]; nextLo[az] = nextLo[bz]; nextLo[bz] = tz; \
tz = nextHi[az]; nextHi[az] = nextHi[bz]; nextHi[bz] = tz; \
tz = nextD [az]; nextD [az] = nextD [bz]; nextD [bz] = tz; }
#define MAIN_QSORT_SMALL_THRESH 20
#define MAIN_QSORT_DEPTH_THRESH (BZ_N_RADIX + BZ_N_QSORT)
#define MAIN_QSORT_STACK_SIZE 100
static
void mainQSort3 ( UInt32* ptr,
UChar* block,
UInt16* quadrant,
Int32 nblock,
Int32 loSt,
Int32 hiSt,
Int32 dSt,
Int32* budget )
{
Int32 unLo, unHi, ltLo, gtHi, n, m, med;
Int32 sp, lo, hi, d;
Int32 stackLo[MAIN_QSORT_STACK_SIZE];
Int32 stackHi[MAIN_QSORT_STACK_SIZE];
Int32 stackD [MAIN_QSORT_STACK_SIZE];
Int32 nextLo[3];
Int32 nextHi[3];
Int32 nextD [3];
sp = 0;
mpush ( loSt, hiSt, dSt );
while (sp > 0) {
AssertH ( sp < MAIN_QSORT_STACK_SIZE, 1001 );
mpop ( lo, hi, d );
if (hi - lo < MAIN_QSORT_SMALL_THRESH ||
d > MAIN_QSORT_DEPTH_THRESH) {
mainSimpleSort ( ptr, block, quadrant, nblock, lo, hi, d, budget );
if (*budget < 0) return;
continue;
}
med = (Int32)
mmed3 ( block[ptr[ lo ]+d],
block[ptr[ hi ]+d],
block[ptr[ (lo+hi)>>1 ]+d] );
unLo = ltLo = lo;
unHi = gtHi = hi;
while (True) {
while (True) {
if (unLo > unHi) break;
n = ((Int32)block[ptr[unLo]+d]) - med;
if (n == 0) {
mswap(ptr[unLo], ptr[ltLo]);
ltLo++; unLo++; continue;
};
if (n > 0) break;
unLo++;
}
while (True) {
if (unLo > unHi) break;
n = ((Int32)block[ptr[unHi]+d]) - med;
if (n == 0) {
mswap(ptr[unHi], ptr[gtHi]);
gtHi--; unHi--; continue;
};
if (n < 0) break;
unHi--;
}
if (unLo > unHi) break;
mswap(ptr[unLo], ptr[unHi]); unLo++; unHi--;
}
AssertD ( unHi == unLo-1, "mainQSort3(2)" );
if (gtHi < ltLo) {
mpush(lo, hi, d+1 );
continue;
}
n = mmin(ltLo-lo, unLo-ltLo); mvswap(lo, unLo-n, n);
m = mmin(hi-gtHi, gtHi-unHi); mvswap(unLo, hi-m+1, m);
n = lo + unLo - ltLo - 1;
m = hi - (gtHi - unHi) + 1;
nextLo[0] = lo; nextHi[0] = n; nextD[0] = d;
nextLo[1] = m; nextHi[1] = hi; nextD[1] = d;
nextLo[2] = n+1; nextHi[2] = m-1; nextD[2] = d+1;
if (mnextsize(0) < mnextsize(1)) mnextswap(0,1);
if (mnextsize(1) < mnextsize(2)) mnextswap(1,2);
if (mnextsize(0) < mnextsize(1)) mnextswap(0,1);
AssertD (mnextsize(0) >= mnextsize(1), "mainQSort3(8)" );
AssertD (mnextsize(1) >= mnextsize(2), "mainQSort3(9)" );
mpush (nextLo[0], nextHi[0], nextD[0]);
mpush (nextLo[1], nextHi[1], nextD[1]);
mpush (nextLo[2], nextHi[2], nextD[2]);
}
}
#undef mswap
#undef mvswap
#undef mpush
#undef mpop
#undef mmin
#undef mnextsize
#undef mnextswap
#undef MAIN_QSORT_SMALL_THRESH
#undef MAIN_QSORT_DEPTH_THRESH
#undef MAIN_QSORT_STACK_SIZE
/*---------------------------------------------*/
/* Pre:
nblock > N_OVERSHOOT
block32 exists for [0 .. nblock-1 +N_OVERSHOOT]
((UChar*)block32) [0 .. nblock-1] holds block
ptr exists for [0 .. nblock-1]
Post:
((UChar*)block32) [0 .. nblock-1] holds block
All other areas of block32 destroyed
ftab [0 .. 65536 ] destroyed
ptr [0 .. nblock-1] holds sorted order
if (*budget < 0), sorting was abandoned
*/
#define BIGFREQ(b) (ftab[((b)+1) << 8] - ftab[(b) << 8])
#define SETMASK (1 << 21)
#define CLEARMASK (~(SETMASK))
static
void mainSort ( UInt32* ptr,
UChar* block,
UInt16* quadrant,
UInt32* ftab,
Int32 nblock,
Int32 verb,
Int32* budget )
{
Int32 i, j, k, ss, sb;
Int32 runningOrder[256];
Bool bigDone[256];
Int32 copyStart[256];
Int32 copyEnd [256];
UChar c1;
Int32 numQSorted;
UInt16 s;
if (verb >= 4) VPrintf0 ( " main sort initialise ...\n" );
/*-- set up the 2-byte frequency table --*/
for (i = 65536; i >= 0; i--) ftab[i] = 0;
j = block[0] << 8;
i = nblock-1;
for (; i >= 3; i -= 4) {
quadrant[i] = 0;
j = (j >> 8) | ( ((UInt16)block[i]) << 8);
ftab[j]++;
quadrant[i-1] = 0;
j = (j >> 8) | ( ((UInt16)block[i-1]) << 8);
ftab[j]++;
quadrant[i-2] = 0;
j = (j >> 8) | ( ((UInt16)block[i-2]) << 8);
ftab[j]++;
quadrant[i-3] = 0;
j = (j >> 8) | ( ((UInt16)block[i-3]) << 8);
ftab[j]++;
}
for (; i >= 0; i--) {
quadrant[i] = 0;
j = (j >> 8) | ( ((UInt16)block[i]) << 8);
ftab[j]++;
}
/*-- (emphasises close relationship of block & quadrant) --*/
for (i = 0; i < BZ_N_OVERSHOOT; i++) {
block [nblock+i] = block[i];
quadrant[nblock+i] = 0;
}
if (verb >= 4) VPrintf0 ( " bucket sorting ...\n" );
/*-- Complete the initial radix sort --*/
for (i = 1; i <= 65536; i++) ftab[i] += ftab[i-1];
s = block[0] << 8;
i = nblock-1;
for (; i >= 3; i -= 4) {
s = (s >> 8) | (block[i] << 8);
j = ftab[s] -1;
ftab[s] = j;
ptr[j] = i;
s = (s >> 8) | (block[i-1] << 8);
j = ftab[s] -1;
ftab[s] = j;
ptr[j] = i-1;
s = (s >> 8) | (block[i-2] << 8);
j = ftab[s] -1;
ftab[s] = j;
ptr[j] = i-2;
s = (s >> 8) | (block[i-3] << 8);
j = ftab[s] -1;
ftab[s] = j;
ptr[j] = i-3;
}
for (; i >= 0; i--) {
s = (s >> 8) | (block[i] << 8);
j = ftab[s] -1;
ftab[s] = j;
ptr[j] = i;
}
/*--
Now ftab contains the first loc of every small bucket.
Calculate the running order, from smallest to largest
big bucket.
--*/
for (i = 0; i <= 255; i++) {
bigDone [i] = False;
runningOrder[i] = i;
}
{
Int32 vv;
Int32 h = 1;
do h = 3 * h + 1; while (h <= 256);
do {
h = h / 3;
for (i = h; i <= 255; i++) {
vv = runningOrder[i];
j = i;
while ( BIGFREQ(runningOrder[j-h]) > BIGFREQ(vv) ) {
runningOrder[j] = runningOrder[j-h];
j = j - h;
if (j <= (h - 1)) goto zero;
}
zero:
runningOrder[j] = vv;
}
} while (h != 1);
}
/*--
The main sorting loop.
--*/
numQSorted = 0;
for (i = 0; i <= 255; i++) {
/*--
Process big buckets, starting with the least full.
Basically this is a 3-step process in which we call
mainQSort3 to sort the small buckets [ss, j], but
also make a big effort to avoid the calls if we can.
--*/
ss = runningOrder[i];
/*--
Step 1:
Complete the big bucket [ss] by quicksorting
any unsorted small buckets [ss, j], for j != ss.
Hopefully previous pointer-scanning phases have already
completed many of the small buckets [ss, j], so
we don't have to sort them at all.
--*/
for (j = 0; j <= 255; j++) {
if (j != ss) {
sb = (ss << 8) + j;
if ( ! (ftab[sb] & SETMASK) ) {
Int32 lo = ftab[sb] & CLEARMASK;
Int32 hi = (ftab[sb+1] & CLEARMASK) - 1;
if (hi > lo) {
if (verb >= 4)
VPrintf4 ( " qsort [0x%x, 0x%x] "
"done %d this %d\n",
ss, j, numQSorted, hi - lo + 1 );
mainQSort3 (
ptr, block, quadrant, nblock,
lo, hi, BZ_N_RADIX, budget
);
numQSorted += (hi - lo + 1);
if (*budget < 0) return;
}
}
ftab[sb] |= SETMASK;
}
}
AssertH ( !bigDone[ss], 1006 );
/*--
Step 2:
Now scan this big bucket [ss] so as to synthesise the
sorted order for small buckets [t, ss] for all t,
including, magically, the bucket [ss,ss] too.
This will avoid doing Real Work in subsequent Step 1's.
--*/
{
for (j = 0; j <= 255; j++) {
copyStart[j] = ftab[(j << 8) + ss] & CLEARMASK;
copyEnd [j] = (ftab[(j << 8) + ss + 1] & CLEARMASK) - 1;
}
for (j = ftab[ss << 8] & CLEARMASK; j < copyStart[ss]; j++) {
k = ptr[j]-1; if (k < 0) k += nblock;
c1 = block[k];
if (!bigDone[c1])
ptr[ copyStart[c1]++ ] = k;
}
for (j = (ftab[(ss+1) << 8] & CLEARMASK) - 1; j > copyEnd[ss]; j--) {
k = ptr[j]-1; if (k < 0) k += nblock;
c1 = block[k];
if (!bigDone[c1])
ptr[ copyEnd[c1]-- ] = k;
}
}
AssertH ( (copyStart[ss]-1 == copyEnd[ss])
||
/* Extremely rare case missing in bzip2-1.0.0 and 1.0.1.
Necessity for this case is demonstrated by compressing
a sequence of approximately 48.5 million of character
251; 1.0.0/1.0.1 will then die here. */
(copyStart[ss] == 0 && copyEnd[ss] == nblock-1),
1007 )
for (j = 0; j <= 255; j++) ftab[(j << 8) + ss] |= SETMASK;
/*--
Step 3:
The [ss] big bucket is now done. Record this fact,
and update the quadrant descriptors. Remember to
update quadrants in the overshoot area too, if
necessary. The "if (i < 255)" test merely skips
this updating for the last bucket processed, since
updating for the last bucket is pointless.
The quadrant array provides a way to incrementally
cache sort orderings, as they appear, so as to
make subsequent comparisons in fullGtU() complete
faster. For repetitive blocks this makes a big
difference (but not big enough to be able to avoid
the fallback sorting mechanism, exponential radix sort).
The precise meaning is: at all times:
for 0 <= i < nblock and 0 <= j <= nblock
if block[i] != block[j],
then the relative values of quadrant[i] and
quadrant[j] are meaningless.
else {
if quadrant[i] < quadrant[j]
then the string starting at i lexicographically
precedes the string starting at j
else if quadrant[i] > quadrant[j]
then the string starting at j lexicographically
precedes the string starting at i
else
the relative ordering of the strings starting
at i and j has not yet been determined.
}
--*/
bigDone[ss] = True;
if (i < 255) {
Int32 bbStart = ftab[ss << 8] & CLEARMASK;
Int32 bbSize = (ftab[(ss+1) << 8] & CLEARMASK) - bbStart;
Int32 shifts = 0;
while ((bbSize >> shifts) > 65534) shifts++;
for (j = bbSize-1; j >= 0; j--) {
Int32 a2update = ptr[bbStart + j];
UInt16 qVal = (UInt16)(j >> shifts);
quadrant[a2update] = qVal;
if (a2update < BZ_N_OVERSHOOT)
quadrant[a2update + nblock] = qVal;
}
AssertH ( ((bbSize-1) >> shifts) <= 65535, 1002 );
}
}
if (verb >= 4)
VPrintf3 ( " %d pointers, %d sorted, %d scanned\n",
nblock, numQSorted, nblock - numQSorted );
}
#undef BIGFREQ
#undef SETMASK
#undef CLEARMASK
/*---------------------------------------------*/
/* Pre:
nblock > 0
arr2 exists for [0 .. nblock-1 +N_OVERSHOOT]
((UChar*)arr2) [0 .. nblock-1] holds block
arr1 exists for [0 .. nblock-1]
Post:
((UChar*)arr2) [0 .. nblock-1] holds block
All other areas of block destroyed
ftab [ 0 .. 65536 ] destroyed
arr1 [0 .. nblock-1] holds sorted order
*/
void BZ2_blockSort ( EState* s )
{
UInt32* ptr = s->ptr;
UChar* block = s->block;
UInt32* ftab = s->ftab;
Int32 nblock = s->nblock;
Int32 verb = s->verbosity;
Int32 wfact = s->workFactor;
UInt16* quadrant;
Int32 budget;
Int32 budgetInit;
Int32 i;
if (nblock < 10000) {
fallbackSort ( s->arr1, s->arr2, ftab, nblock, verb );
} else {
/* Calculate the location for quadrant, remembering to get
the alignment right. Assumes that &(block[0]) is at least
2-byte aligned -- this should be ok since block is really
the first section of arr2.
*/
i = nblock+BZ_N_OVERSHOOT;
if (i & 1) i++;
quadrant = (UInt16*)(&(block[i]));
/* (wfact-1) / 3 puts the default-factor-30
transition point at very roughly the same place as
with v0.1 and v0.9.0.
Not that it particularly matters any more, since the
resulting compressed stream is now the same regardless
of whether or not we use the main sort or fallback sort.
*/
if (wfact < 1 ) wfact = 1;
if (wfact > 100) wfact = 100;
budgetInit = nblock * ((wfact-1) / 3);
budget = budgetInit;
mainSort ( ptr, block, quadrant, ftab, nblock, verb, &budget );
if (verb >= 3)
VPrintf3 ( " %d work, %d block, ratio %5.2f\n",
budgetInit - budget,
nblock,
(float)(budgetInit - budget) /
(float)(nblock==0 ? 1 : nblock) );
if (budget < 0) {
if (verb >= 2)
VPrintf0 ( " too repetitive; using fallback"
" sorting algorithm\n" );
fallbackSort ( s->arr1, s->arr2, ftab, nblock, verb );
}
}
s->origPtr = -1;
for (i = 0; i < s->nblock; i++)
if (ptr[i] == 0)
{ s->origPtr = i; break; };
AssertH( s->origPtr != -1, 1003 );
}
/*-------------------------------------------------------------*/
/*--- end blocksort.c ---*/
/*-------------------------------------------------------------*/
|
Added work/src/bzip2-1.0.2/bzdiff.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
#!/bin/sh
# sh is buggy on RS/6000 AIX 3.2. Replace above line with #!/bin/ksh
# Bzcmp/diff wrapped for bzip2,
# adapted from zdiff by Philippe Troin <phil@fifi.org> for Debian GNU/Linux.
# Bzcmp and bzdiff are used to invoke the cmp or the diff pro-
# gram on compressed files. All options specified are passed
# directly to cmp or diff. If only 1 file is specified, then
# the files compared are file1 and an uncompressed file1.gz.
# If two files are specified, then they are uncompressed (if
# necessary) and fed to cmp or diff. The exit status from cmp
# or diff is preserved.
PATH="/usr/bin:$PATH"; export PATH
prog=`echo $0 | sed 's|.*/||'`
case "$prog" in
*cmp) comp=${CMP-cmp} ;;
*) comp=${DIFF-diff} ;;
esac
OPTIONS=
FILES=
for ARG
do
case "$ARG" in
-*) OPTIONS="$OPTIONS $ARG";;
*) if test -f "$ARG"; then
FILES="$FILES $ARG"
else
echo "${prog}: $ARG not found or not a regular file"
exit 1
fi ;;
esac
done
if test -z "$FILES"; then
echo "Usage: $prog [${comp}_options] file [file]"
exit 1
fi
tmp=`tempfile -d /tmp -p bz` || {
echo 'cannot create a temporary file' >&2
exit 1
}
set $FILES
if test $# -eq 1; then
FILE=`echo "$1" | sed 's/.bz2$//'`
bzip2 -cd "$FILE.bz2" | $comp $OPTIONS - "$FILE"
STAT="$?"
elif test $# -eq 2; then
case "$1" in
*.bz2)
case "$2" in
*.bz2)
F=`echo "$2" | sed 's|.*/||;s|.bz2$||'`
bzip2 -cdfq "$2" > $tmp
bzip2 -cdfq "$1" | $comp $OPTIONS - $tmp
STAT="$?"
/bin/rm -f $tmp;;
*) bzip2 -cdfq "$1" | $comp $OPTIONS - "$2"
STAT="$?";;
esac;;
*) case "$2" in
*.bz2)
bzip2 -cdfq "$2" | $comp $OPTIONS "$1" -
STAT="$?";;
*) $comp $OPTIONS "$1" "$2"
STAT="$?";;
esac;;
esac
exit "$STAT"
else
echo "Usage: $prog [${comp}_options] file [file]"
exit 1
fi
|
Added work/src/bzip2-1.0.2/bzdiff.1.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
\"Shamelessly copied from zmore.1 by Philippe Troin <phil@fifi.org>
\"for Debian GNU/Linux
.TH BZDIFF 1
.SH NAME
bzcmp, bzdiff \- compare bzip2 compressed files
.SH SYNOPSIS
.B bzcmp
[ cmp_options ] file1
[ file2 ]
.br
.B bzdiff
[ diff_options ] file1
[ file2 ]
.SH DESCRIPTION
.I Bzcmp
and
.I bzdiff
are used to invoke the
.I cmp
or the
.I diff
program on bzip2 compressed files. All options specified are passed
directly to
.I cmp
or
.IR diff "."
If only 1 file is specified, then the files compared are
.I file1
and an uncompressed
.IR file1 ".bz2."
If two files are specified, then they are uncompressed if necessary and fed to
.I cmp
or
.IR diff "."
The exit status from
.I cmp
or
.I diff
is preserved.
.SH "SEE ALSO"
cmp(1), diff(1), bzmore(1), bzless(1), bzgrep(1), bzip2(1)
.SH BUGS
Messages from the
.I cmp
or
.I diff
programs refer to temporary filenames instead of those specified.
|
Added work/src/bzip2-1.0.2/bzgrep.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
#!/bin/sh
# Bzgrep wrapped for bzip2,
# adapted from zgrep by Philippe Troin <phil@fifi.org> for Debian GNU/Linux.
## zgrep notice:
## zgrep -- a wrapper around a grep program that decompresses files as needed
## Adapted from a version sent by Charles Levert <charles@comm.polymtl.ca>
PATH="/usr/bin:$PATH"; export PATH
prog=`echo $0 | sed 's|.*/||'`
case "$prog" in
*egrep) grep=${EGREP-egrep} ;;
*fgrep) grep=${FGREP-fgrep} ;;
*) grep=${GREP-grep} ;;
esac
pat=""
while test $# -ne 0; do
case "$1" in
-e | -f) opt="$opt $1"; shift; pat="$1"
if test "$grep" = grep; then # grep is buggy with -e on SVR4
grep=egrep
fi;;
-A | -B) opt="$opt $1 $2"; shift;;
-*) opt="$opt $1";;
*) if test -z "$pat"; then
pat="$1"
else
break;
fi;;
esac
shift
done
if test -z "$pat"; then
echo "grep through bzip2 files"
echo "usage: $prog [grep_options] pattern [files]"
exit 1
fi
list=0
silent=0
op=`echo "$opt" | sed -e 's/ //g' -e 's/-//g'`
case "$op" in
*l*) list=1
esac
case "$op" in
*h*) silent=1
esac
if test $# -eq 0; then
bzip2 -cdfq | $grep $opt "$pat"
exit $?
fi
res=0
for i do
if test -f "$i"; then :; else if test -f "$i.bz2"; then i="$i.bz2"; fi; fi
if test $list -eq 1; then
bzip2 -cdfq "$i" | $grep $opt "$pat" 2>&1 > /dev/null && echo $i
r=$?
elif test $# -eq 1 -o $silent -eq 1; then
bzip2 -cdfq "$i" | $grep $opt "$pat"
r=$?
else
bzip2 -cdfq "$i" | $grep $opt "$pat" | sed "s|^|${i}:|"
r=$?
fi
test "$r" -ne 0 && res="$r"
done
exit $res
|
Added work/src/bzip2-1.0.2/bzgrep.1.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
\"Shamelessly copied from zmore.1 by Philippe Troin <phil@fifi.org>
\"for Debian GNU/Linux
.TH BZGREP 1
.SH NAME
bzgrep, bzfgrep, bzegrep \- search possibly bzip2 compressed files for a regular expression
.SH SYNOPSIS
.B bzgrep
[ grep_options ]
.BI [\ -e\ ] " pattern"
.IR filename ".\|.\|."
.br
.B bzegrep
[ egrep_options ]
.BI [\ -e\ ] " pattern"
.IR filename ".\|.\|."
.br
.B bzfgrep
[ fgrep_options ]
.BI [\ -e\ ] " pattern"
.IR filename ".\|.\|."
.SH DESCRIPTION
.IR Bzgrep
is used to invoke the
.I grep
on bzip2-compressed files. All options specified are passed directly to
.I grep.
If no file is specified, then the standard input is decompressed
if necessary and fed to grep.
Otherwise the given files are uncompressed if necessary and fed to
.I grep.
.PP
If
.I bzgrep
is invoked as
.I bzegrep
or
.I bzfgrep
then
.I egrep
or
.I fgrep
is used instead of
.I grep.
If the GREP environment variable is set,
.I bzgrep
uses it as the
.I grep
program to be invoked. For example:
for sh: GREP=fgrep bzgrep string files
for csh: (setenv GREP fgrep; bzgrep string files)
.SH AUTHOR
Charles Levert (charles@comm.polymtl.ca). Adapted to bzip2 by Philippe
Troin <phil@fifi.org> for Debian GNU/Linux.
.SH "SEE ALSO"
grep(1), egrep(1), fgrep(1), bzdiff(1), bzmore(1), bzless(1), bzip2(1)
|
Added work/src/bzip2-1.0.2/bzip2.
cannot compute difference between binary files
Added work/src/bzip2-1.0.2/bzip2.1.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
|
.PU
.TH bzip2 1
.SH NAME
bzip2, bunzip2 \- a block-sorting file compressor, v1.0.2
.br
bzcat \- decompresses files to stdout
.br
bzip2recover \- recovers data from damaged bzip2 files
.SH SYNOPSIS
.ll +8
.B bzip2
.RB [ " \-cdfkqstvzVL123456789 " ]
[
.I "filenames \&..."
]
.ll -8
.br
.B bunzip2
.RB [ " \-fkvsVL " ]
[
.I "filenames \&..."
]
.br
.B bzcat
.RB [ " \-s " ]
[
.I "filenames \&..."
]
.br
.B bzip2recover
.I "filename"
.SH DESCRIPTION
.I bzip2
compresses files using the Burrows-Wheeler block sorting
text compression algorithm, and Huffman coding. Compression is
generally considerably better than that achieved by more conventional
LZ77/LZ78-based compressors, and approaches the performance of the PPM
family of statistical compressors.
The command-line options are deliberately very similar to
those of
.I GNU gzip,
but they are not identical.
.I bzip2
expects a list of file names to accompany the
command-line flags. Each file is replaced by a compressed version of
itself, with the name "original_name.bz2".
Each compressed file
has the same modification date, permissions, and, when possible,
ownership as the corresponding original, so that these properties can
be correctly restored at decompression time. File name handling is
naive in the sense that there is no mechanism for preserving original
file names, permissions, ownerships or dates in filesystems which lack
these concepts, or have serious file name length restrictions, such as
MS-DOS.
.I bzip2
and
.I bunzip2
will by default not overwrite existing
files. If you want this to happen, specify the \-f flag.
If no file names are specified,
.I bzip2
compresses from standard
input to standard output. In this case,
.I bzip2
will decline to
write compressed output to a terminal, as this would be entirely
incomprehensible and therefore pointless.
.I bunzip2
(or
.I bzip2 \-d)
decompresses all
specified files. Files which were not created by
.I bzip2
will be detected and ignored, and a warning issued.
.I bzip2
attempts to guess the filename for the decompressed file
from that of the compressed file as follows:
filename.bz2 becomes filename
filename.bz becomes filename
filename.tbz2 becomes filename.tar
filename.tbz becomes filename.tar
anyothername becomes anyothername.out
If the file does not end in one of the recognised endings,
.I .bz2,
.I .bz,
.I .tbz2
or
.I .tbz,
.I bzip2
complains that it cannot
guess the name of the original file, and uses the original name
with
.I .out
appended.
As with compression, supplying no
filenames causes decompression from
standard input to standard output.
.I bunzip2
will correctly decompress a file which is the
concatenation of two or more compressed files. The result is the
concatenation of the corresponding uncompressed files. Integrity
testing (\-t)
of concatenated
compressed files is also supported.
You can also compress or decompress files to the standard output by
giving the \-c flag. Multiple files may be compressed and
decompressed like this. The resulting outputs are fed sequentially to
stdout. Compression of multiple files
in this manner generates a stream
containing multiple compressed file representations. Such a stream
can be decompressed correctly only by
.I bzip2
version 0.9.0 or
later. Earlier versions of
.I bzip2
will stop after decompressing
the first file in the stream.
.I bzcat
(or
.I bzip2 -dc)
decompresses all specified files to
the standard output.
.I bzip2
will read arguments from the environment variables
.I BZIP2
and
.I BZIP,
in that order, and will process them
before any arguments read from the command line. This gives a
convenient way to supply default arguments.
Compression is always performed, even if the compressed
file is slightly
larger than the original. Files of less than about one hundred bytes
tend to get larger, since the compression mechanism has a constant
overhead in the region of 50 bytes. Random data (including the output
of most file compressors) is coded at about 8.05 bits per byte, giving
an expansion of around 0.5%.
As a self-check for your protection,
.I
bzip2
uses 32-bit CRCs to
make sure that the decompressed version of a file is identical to the
original. This guards against corruption of the compressed data, and
against undetected bugs in
.I bzip2
(hopefully very unlikely). The
chances of data corruption going undetected is microscopic, about one
chance in four billion for each file processed. Be aware, though, that
the check occurs upon decompression, so it can only tell you that
something is wrong. It can't help you
recover the original uncompressed
data. You can use
.I bzip2recover
to try to recover data from
damaged files.
Return values: 0 for a normal exit, 1 for environmental problems (file
not found, invalid flags, I/O errors, &c), 2 to indicate a corrupt
compressed file, 3 for an internal consistency error (eg, bug) which
caused
.I bzip2
to panic.
.SH OPTIONS
.TP
.B \-c --stdout
Compress or decompress to standard output.
.TP
.B \-d --decompress
Force decompression.
.I bzip2,
.I bunzip2
and
.I bzcat
are
really the same program, and the decision about what actions to take is
done on the basis of which name is used. This flag overrides that
mechanism, and forces
.I bzip2
to decompress.
.TP
.B \-z --compress
The complement to \-d: forces compression, regardless of the
invocation name.
.TP
.B \-t --test
Check integrity of the specified file(s), but don't decompress them.
This really performs a trial decompression and throws away the result.
.TP
.B \-f --force
Force overwrite of output files. Normally,
.I bzip2
will not overwrite
existing output files. Also forces
.I bzip2
to break hard links
to files, which it otherwise wouldn't do.
bzip2 normally declines to decompress files which don't have the
correct magic header bytes. If forced (-f), however, it will pass
such files through unmodified. This is how GNU gzip behaves.
.TP
.B \-k --keep
Keep (don't delete) input files during compression
or decompression.
.TP
.B \-s --small
Reduce memory usage, for compression, decompression and testing. Files
are decompressed and tested using a modified algorithm which only
requires 2.5 bytes per block byte. This means any file can be
decompressed in 2300k of memory, albeit at about half the normal speed.
During compression, \-s selects a block size of 200k, which limits
memory use to around the same figure, at the expense of your compression
ratio. In short, if your machine is low on memory (8 megabytes or
less), use \-s for everything. See MEMORY MANAGEMENT below.
.TP
.B \-q --quiet
Suppress non-essential warning messages. Messages pertaining to
I/O errors and other critical events will not be suppressed.
.TP
.B \-v --verbose
Verbose mode -- show the compression ratio for each file processed.
Further \-v's increase the verbosity level, spewing out lots of
information which is primarily of interest for diagnostic purposes.
.TP
.B \-L --license -V --version
Display the software version, license terms and conditions.
.TP
.B \-1 (or \-\-fast) to \-9 (or \-\-best)
Set the block size to 100 k, 200 k .. 900 k when compressing. Has no
effect when decompressing. See MEMORY MANAGEMENT below.
The \-\-fast and \-\-best aliases are primarily for GNU gzip
compatibility. In particular, \-\-fast doesn't make things
significantly faster.
And \-\-best merely selects the default behaviour.
.TP
.B \--
Treats all subsequent arguments as file names, even if they start
with a dash. This is so you can handle files with names beginning
with a dash, for example: bzip2 \-- \-myfilename.
.TP
.B \--repetitive-fast --repetitive-best
These flags are redundant in versions 0.9.5 and above. They provided
some coarse control over the behaviour of the sorting algorithm in
earlier versions, which was sometimes useful. 0.9.5 and above have an
improved algorithm which renders these flags irrelevant.
.SH MEMORY MANAGEMENT
.I bzip2
compresses large files in blocks. The block size affects
both the compression ratio achieved, and the amount of memory needed for
compression and decompression. The flags \-1 through \-9
specify the block size to be 100,000 bytes through 900,000 bytes (the
default) respectively. At decompression time, the block size used for
compression is read from the header of the compressed file, and
.I bunzip2
then allocates itself just enough memory to decompress
the file. Since block sizes are stored in compressed files, it follows
that the flags \-1 to \-9 are irrelevant to and so ignored
during decompression.
Compression and decompression requirements,
in bytes, can be estimated as:
Compression: 400k + ( 8 x block size )
Decompression: 100k + ( 4 x block size ), or
100k + ( 2.5 x block size )
Larger block sizes give rapidly diminishing marginal returns. Most of
the compression comes from the first two or three hundred k of block
size, a fact worth bearing in mind when using
.I bzip2
on small machines.
It is also important to appreciate that the decompression memory
requirement is set at compression time by the choice of block size.
For files compressed with the default 900k block size,
.I bunzip2
will require about 3700 kbytes to decompress. To support decompression
of any file on a 4 megabyte machine,
.I bunzip2
has an option to
decompress using approximately half this amount of memory, about 2300
kbytes. Decompression speed is also halved, so you should use this
option only where necessary. The relevant flag is -s.
In general, try and use the largest block size memory constraints allow,
since that maximises the compression achieved. Compression and
decompression speed are virtually unaffected by block size.
Another significant point applies to files which fit in a single block
-- that means most files you'd encounter using a large block size. The
amount of real memory touched is proportional to the size of the file,
since the file is smaller than a block. For example, compressing a file
20,000 bytes long with the flag -9 will cause the compressor to
allocate around 7600k of memory, but only touch 400k + 20000 * 8 = 560
kbytes of it. Similarly, the decompressor will allocate 3700k but only
touch 100k + 20000 * 4 = 180 kbytes.
Here is a table which summarises the maximum memory usage for different
block sizes. Also recorded is the total compressed size for 14 files of
the Calgary Text Compression Corpus totalling 3,141,622 bytes. This
column gives some feel for how compression varies with block size.
These figures tend to understate the advantage of larger block sizes for
larger files, since the Corpus is dominated by smaller files.
Compress Decompress Decompress Corpus
Flag usage usage -s usage Size
-1 1200k 500k 350k 914704
-2 2000k 900k 600k 877703
-3 2800k 1300k 850k 860338
-4 3600k 1700k 1100k 846899
-5 4400k 2100k 1350k 845160
-6 5200k 2500k 1600k 838626
-7 6100k 2900k 1850k 834096
-8 6800k 3300k 2100k 828642
-9 7600k 3700k 2350k 828642
.SH RECOVERING DATA FROM DAMAGED FILES
.I bzip2
compresses files in blocks, usually 900kbytes long. Each
block is handled independently. If a media or transmission error causes
a multi-block .bz2
file to become damaged, it may be possible to
recover data from the undamaged blocks in the file.
The compressed representation of each block is delimited by a 48-bit
pattern, which makes it possible to find the block boundaries with
reasonable certainty. Each block also carries its own 32-bit CRC, so
damaged blocks can be distinguished from undamaged ones.
.I bzip2recover
is a simple program whose purpose is to search for
blocks in .bz2 files, and write each block out into its own .bz2
file. You can then use
.I bzip2
\-t
to test the
integrity of the resulting files, and decompress those which are
undamaged.
.I bzip2recover
takes a single argument, the name of the damaged file,
and writes a number of files "rec00001file.bz2",
"rec00002file.bz2", etc, containing the extracted blocks.
The output filenames are designed so that the use of
wildcards in subsequent processing -- for example,
"bzip2 -dc rec*file.bz2 > recovered_data" -- processes the files in
the correct order.
.I bzip2recover
should be of most use dealing with large .bz2
files, as these will contain many blocks. It is clearly
futile to use it on damaged single-block files, since a
damaged block cannot be recovered. If you wish to minimise
any potential data loss through media or transmission errors,
you might consider compressing with a smaller
block size.
.SH PERFORMANCE NOTES
The sorting phase of compression gathers together similar strings in the
file. Because of this, files containing very long runs of repeated
symbols, like "aabaabaabaab ..." (repeated several hundred times) may
compress more slowly than normal. Versions 0.9.5 and above fare much
better than previous versions in this respect. The ratio between
worst-case and average-case compression time is in the region of 10:1.
For previous versions, this figure was more like 100:1. You can use the
\-vvvv option to monitor progress in great detail, if you want.
Decompression speed is unaffected by these phenomena.
.I bzip2
usually allocates several megabytes of memory to operate
in, and then charges all over it in a fairly random fashion. This means
that performance, both for compressing and decompressing, is largely
determined by the speed at which your machine can service cache misses.
Because of this, small changes to the code to reduce the miss rate have
been observed to give disproportionately large performance improvements.
I imagine
.I bzip2
will perform best on machines with very large caches.
.SH CAVEATS
I/O error messages are not as helpful as they could be.
.I bzip2
tries hard to detect I/O errors and exit cleanly, but the details of
what the problem is sometimes seem rather misleading.
This manual page pertains to version 1.0.2 of
.I bzip2.
Compressed data created by this version is entirely forwards and
backwards compatible with the previous public releases, versions
0.1pl2, 0.9.0, 0.9.5, 1.0.0 and 1.0.1, but with the following
exception: 0.9.0 and above can correctly decompress multiple
concatenated compressed files. 0.1pl2 cannot do this; it will stop
after decompressing just the first file in the stream.
.I bzip2recover
versions prior to this one, 1.0.2, used 32-bit integers to represent
bit positions in compressed files, so it could not handle compressed
files more than 512 megabytes long. Version 1.0.2 and above uses
64-bit ints on some platforms which support them (GNU supported
targets, and Windows). To establish whether or not bzip2recover was
built with such a limitation, run it without arguments. In any event
you can build yourself an unlimited version if you can recompile it
with MaybeUInt64 set to be an unsigned 64-bit integer.
.SH AUTHOR
Julian Seward, jseward@acm.org.
http://sources.redhat.com/bzip2
The ideas embodied in
.I bzip2
are due to (at least) the following
people: Michael Burrows and David Wheeler (for the block sorting
transformation), David Wheeler (again, for the Huffman coder), Peter
Fenwick (for the structured coding model in the original
.I bzip,
and many refinements), and Alistair Moffat, Radford Neal and Ian Witten
(for the arithmetic coder in the original
.I bzip).
I am much
indebted for their help, support and advice. See the manual in the
source distribution for pointers to sources of documentation. Christian
von Roques encouraged me to look for faster sorting algorithms, so as to
speed up compression. Bela Lubkin encouraged me to improve the
worst-case compression performance.
The bz* scripts are derived from those of GNU gzip.
Many people sent patches, helped
with portability problems, lent machines, gave advice and were generally
helpful.
|
Added work/src/bzip2-1.0.2/bzip2.1.preformatted.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
|
bzip2(1) bzip2(1)
NNAAMMEE
bzip2, bunzip2 - a block-sorting file compressor, v1.0.2
bzcat - decompresses files to stdout
bzip2recover - recovers data from damaged bzip2 files
SSYYNNOOPPSSIISS
bbzziipp22 [ --ccddffkkqqssttvvzzVVLL112233445566778899 ] [ _f_i_l_e_n_a_m_e_s _._._. ]
bbuunnzziipp22 [ --ffkkvvssVVLL ] [ _f_i_l_e_n_a_m_e_s _._._. ]
bbzzccaatt [ --ss ] [ _f_i_l_e_n_a_m_e_s _._._. ]
bbzziipp22rreeccoovveerr _f_i_l_e_n_a_m_e
DDEESSCCRRIIPPTTIIOONN
_b_z_i_p_2 compresses files using the Burrows-Wheeler block
sorting text compression algorithm, and Huffman coding.
Compression is generally considerably better than that
achieved by more conventional LZ77/LZ78-based compressors,
and approaches the performance of the PPM family of sta
tistical compressors.
The command-line options are deliberately very similar to
those of _G_N_U _g_z_i_p_, but they are not identical.
_b_z_i_p_2 expects a list of file names to accompany the com
mand-line flags. Each file is replaced by a compressed
version of itself, with the name "original_name.bz2".
Each compressed file has the same modification date, per
missions, and, when possible, ownership as the correspond
ing original, so that these properties can be correctly
restored at decompression time. File name handling is
naive in the sense that there is no mechanism for preserv
ing original file names, permissions, ownerships or dates
in filesystems which lack these concepts, or have serious
file name length restrictions, such as MS-DOS.
_b_z_i_p_2 and _b_u_n_z_i_p_2 will by default not overwrite existing
files. If you want this to happen, specify the -f flag.
If no file names are specified, _b_z_i_p_2 compresses from
standard input to standard output. In this case, _b_z_i_p_2
will decline to write compressed output to a terminal, as
this would be entirely incomprehensible and therefore
pointless.
_b_u_n_z_i_p_2 (or _b_z_i_p_2 _-_d_) decompresses all specified files.
Files which were not created by _b_z_i_p_2 will be detected and
ignored, and a warning issued. _b_z_i_p_2 attempts to guess
the filename for the decompressed file from that of the
compressed file as follows:
filename.bz2 becomes filename
filename.bz becomes filename
filename.tbz2 becomes filename.tar
filename.tbz becomes filename.tar
anyothername becomes anyothername.out
If the file does not end in one of the recognised endings,
_._b_z_2_, _._b_z_, _._t_b_z_2 or _._t_b_z_, _b_z_i_p_2 complains that it cannot
guess the name of the original file, and uses the original
name with _._o_u_t appended.
As with compression, supplying no filenames causes decom
pression from standard input to standard output.
_b_u_n_z_i_p_2 will correctly decompress a file which is the con
catenation of two or more compressed files. The result is
the concatenation of the corresponding uncompressed files.
Integrity testing (-t) of concatenated compressed files is
also supported.
You can also compress or decompress files to the standard
output by giving the -c flag. Multiple files may be com
pressed and decompressed like this. The resulting outputs
are fed sequentially to stdout. Compression of multiple
files in this manner generates a stream containing multi
ple compressed file representations. Such a stream can be
decompressed correctly only by _b_z_i_p_2 version 0.9.0 or
later. Earlier versions of _b_z_i_p_2 will stop after decom
pressing the first file in the stream.
_b_z_c_a_t (or _b_z_i_p_2 _-_d_c_) decompresses all specified files to
the standard output.
_b_z_i_p_2 will read arguments from the environment variables
_B_Z_I_P_2 and _B_Z_I_P_, in that order, and will process them
before any arguments read from the command line. This
gives a convenient way to supply default arguments.
Compression is always performed, even if the compressed
file is slightly larger than the original. Files of less
than about one hundred bytes tend to get larger, since the
compression mechanism has a constant overhead in the
region of 50 bytes. Random data (including the output of
most file compressors) is coded at about 8.05 bits per
byte, giving an expansion of around 0.5%.
As a self-check for your protection, _b_z_i_p_2 uses 32-bit
CRCs to make sure that the decompressed version of a file
is identical to the original. This guards against corrup
tion of the compressed data, and against undetected bugs
in _b_z_i_p_2 (hopefully very unlikely). The chances of data
corruption going undetected is microscopic, about one
chance in four billion for each file processed. Be aware,
though, that the check occurs upon decompression, so it
can only tell you that something is wrong. It can't help
you recover the original uncompressed data. You can use
_b_z_i_p_2_r_e_c_o_v_e_r to try to recover data from damaged files.
Return values: 0 for a normal exit, 1 for environmental
problems (file not found, invalid flags, I/O errors, &c),
2 to indicate a corrupt compressed file, 3 for an internal
consistency error (eg, bug) which caused _b_z_i_p_2 to panic.
OOPPTTIIOONNSS
--cc ----ssttddoouutt
Compress or decompress to standard output.
--dd ----ddeeccoommpprreessss
Force decompression. _b_z_i_p_2_, _b_u_n_z_i_p_2 and _b_z_c_a_t are
really the same program, and the decision about
what actions to take is done on the basis of which
name is used. This flag overrides that mechanism,
and forces _b_z_i_p_2 to decompress.
--zz ----ccoommpprreessss
The complement to -d: forces compression,
regardless of the invocation name.
--tt ----tteesstt
Check integrity of the specified file(s), but don't
decompress them. This really performs a trial
decompression and throws away the result.
--ff ----ffoorrccee
Force overwrite of output files. Normally, _b_z_i_p_2
will not overwrite existing output files. Also
forces _b_z_i_p_2 to break hard links to files, which it
otherwise wouldn't do.
bzip2 normally declines to decompress files which
don't have the correct magic header bytes. If
forced (-f), however, it will pass such files
through unmodified. This is how GNU gzip behaves.
--kk ----kkeeeepp
Keep (don't delete) input files during compression
or decompression.
--ss ----ssmmaallll
Reduce memory usage, for compression, decompression
and testing. Files are decompressed and tested
using a modified algorithm which only requires 2.5
bytes per block byte. This means any file can be
decompressed in 2300k of memory, albeit at about
half the normal speed.
During compression, -s selects a block size of
200k, which limits memory use to around the same
figure, at the expense of your compression ratio.
In short, if your machine is low on memory (8
megabytes or less), use -s for everything. See
MEMORY MANAGEMENT below.
--qq ----qquuiieett
Suppress non-essential warning messages. Messages
pertaining to I/O errors and other critical events
will not be suppressed.
--vv ----vveerrbboossee
Verbose mode -- show the compression ratio for each
file processed. Further -v's increase the ver
bosity level, spewing out lots of information which
is primarily of interest for diagnostic purposes.
--LL ----lliicceennssee --VV ----vveerrssiioonn
Display the software version, license terms and
conditions.
--11 ((oorr ----ffaasstt)) ttoo --99 ((oorr ----bbeesstt))
Set the block size to 100 k, 200 k .. 900 k when
compressing. Has no effect when decompressing.
See MEMORY MANAGEMENT below. The --fast and --best
aliases are primarily for GNU gzip compatibility.
In particular, --fast doesn't make things signifi
cantly faster. And --best merely selects the
default behaviour.
---- Treats all subsequent arguments as file names, even
if they start with a dash. This is so you can han
dle files with names beginning with a dash, for
example: bzip2 -- -myfilename.
----rreeppeettiittiivvee--ffaasstt ----rreeppeettiittiivvee--bbeesstt
These flags are redundant in versions 0.9.5 and
above. They provided some coarse control over the
behaviour of the sorting algorithm in earlier ver
sions, which was sometimes useful. 0.9.5 and above
have an improved algorithm which renders these
flags irrelevant.
MMEEMMOORRYY MMAANNAAGGEEMMEENNTT
_b_z_i_p_2 compresses large files in blocks. The block size
affects both the compression ratio achieved, and the
amount of memory needed for compression and decompression.
The flags -1 through -9 specify the block size to be
100,000 bytes through 900,000 bytes (the default) respec
tively. At decompression time, the block size used for
compression is read from the header of the compressed
file, and _b_u_n_z_i_p_2 then allocates itself just enough memory
to decompress the file. Since block sizes are stored in
compressed files, it follows that the flags -1 to -9 are
irrelevant to and so ignored during decompression.
Compression and decompression requirements, in bytes, can
be estimated as:
Compression: 400k + ( 8 x block size )
Decompression: 100k + ( 4 x block size ), or
100k + ( 2.5 x block size )
Larger block sizes give rapidly diminishing marginal
returns. Most of the compression comes from the first two
or three hundred k of block size, a fact worth bearing in
mind when using _b_z_i_p_2 on small machines. It is also
important to appreciate that the decompression memory
requirement is set at compression time by the choice of
block size.
For files compressed with the default 900k block size,
_b_u_n_z_i_p_2 will require about 3700 kbytes to decompress. To
support decompression of any file on a 4 megabyte machine,
_b_u_n_z_i_p_2 has an option to decompress using approximately
half this amount of memory, about 2300 kbytes. Decompres
sion speed is also halved, so you should use this option
only where necessary. The relevant flag is -s.
In general, try and use the largest block size memory con
straints allow, since that maximises the compression
achieved. Compression and decompression speed are virtu
ally unaffected by block size.
Another significant point applies to files which fit in a
single block -- that means most files you'd encounter
using a large block size. The amount of real memory
touched is proportional to the size of the file, since the
file is smaller than a block. For example, compressing a
file 20,000 bytes long with the flag -9 will cause the
compressor to allocate around 7600k of memory, but only
touch 400k + 20000 * 8 = 560 kbytes of it. Similarly, the
decompressor will allocate 3700k but only touch 100k +
20000 * 4 = 180 kbytes.
Here is a table which summarises the maximum memory usage
for different block sizes. Also recorded is the total
compressed size for 14 files of the Calgary Text Compres
sion Corpus totalling 3,141,622 bytes. This column gives
some feel for how compression varies with block size.
These figures tend to understate the advantage of larger
block sizes for larger files, since the Corpus is domi
nated by smaller files.
Compress Decompress Decompress Corpus
Flag usage usage -s usage Size
-1 1200k 500k 350k 914704
-2 2000k 900k 600k 877703
-3 2800k 1300k 850k 860338
-4 3600k 1700k 1100k 846899
-5 4400k 2100k 1350k 845160
-6 5200k 2500k 1600k 838626
-7 6100k 2900k 1850k 834096
-8 6800k 3300k 2100k 828642
-9 7600k 3700k 2350k 828642
RREECCOOVVEERRIINNGG DDAATTAA FFRROOMM DDAAMMAAGGEEDD FFIILLEESS
_b_z_i_p_2 compresses files in blocks, usually 900kbytes long.
Each block is handled independently. If a media or trans
mission error causes a multi-block .bz2 file to become
damaged, it may be possible to recover data from the
undamaged blocks in the file.
The compressed representation of each block is delimited
by a 48-bit pattern, which makes it possible to find the
block boundaries with reasonable certainty. Each block
also carries its own 32-bit CRC, so damaged blocks can be
distinguished from undamaged ones.
_b_z_i_p_2_r_e_c_o_v_e_r is a simple program whose purpose is to
search for blocks in .bz2 files, and write each block out
into its own .bz2 file. You can then use _b_z_i_p_2 -t to test
the integrity of the resulting files, and decompress those
which are undamaged.
_b_z_i_p_2_r_e_c_o_v_e_r takes a single argument, the name of the dam
aged file, and writes a number of files
"rec00001file.bz2", "rec00002file.bz2", etc, containing
the extracted blocks. The output filenames are
designed so that the use of wildcards in subsequent pro
cessing -- for example, "bzip2 -dc rec*file.bz2 > recov
ered_data" -- processes the files in the correct order.
_b_z_i_p_2_r_e_c_o_v_e_r should be of most use dealing with large .bz2
files, as these will contain many blocks. It is clearly
futile to use it on damaged single-block files, since a
damaged block cannot be recovered. If you wish to min
imise any potential data loss through media or transmis
sion errors, you might consider compressing with a smaller
block size.
PPEERRFFOORRMMAANNCCEE NNOOTTEESS
The sorting phase of compression gathers together similar
strings in the file. Because of this, files containing
very long runs of repeated symbols, like "aabaabaabaab
..." (repeated several hundred times) may compress more
slowly than normal. Versions 0.9.5 and above fare much
better than previous versions in this respect. The ratio
between worst-case and average-case compression time is in
the region of 10:1. For previous versions, this figure
was more like 100:1. You can use the -vvvv option to mon
itor progress in great detail, if you want.
Decompression speed is unaffected by these phenomena.
_b_z_i_p_2 usually allocates several megabytes of memory to
operate in, and then charges all over it in a fairly ran
dom fashion. This means that performance, both for com
pressing and decompressing, is largely determined by the
speed at which your machine can service cache misses.
Because of this, small changes to the code to reduce the
miss rate have been observed to give disproportionately
large performance improvements. I imagine _b_z_i_p_2 will per
form best on machines with very large caches.
CCAAVVEEAATTSS
I/O error messages are not as helpful as they could be.
_b_z_i_p_2 tries hard to detect I/O errors and exit cleanly,
but the details of what the problem is sometimes seem
rather misleading.
This manual page pertains to version 1.0.2 of _b_z_i_p_2_. Com
pressed data created by this version is entirely forwards
and backwards compatible with the previous public
releases, versions 0.1pl2, 0.9.0, 0.9.5, 1.0.0 and 1.0.1,
but with the following exception: 0.9.0 and above can cor
rectly decompress multiple concatenated compressed files.
0.1pl2 cannot do this; it will stop after decompressing
just the first file in the stream.
_b_z_i_p_2_r_e_c_o_v_e_r versions prior to this one, 1.0.2, used
32-bit integers to represent bit positions in compressed
files, so it could not handle compressed files more than
512 megabytes long. Version 1.0.2 and above uses 64-bit
ints on some platforms which support them (GNU supported
targets, and Windows). To establish whether or not
bzip2recover was built with such a limitation, run it
without arguments. In any event you can build yourself an
unlimited version if you can recompile it with MaybeUInt64
set to be an unsigned 64-bit integer.
AAUUTTHHOORR
Julian Seward, jseward@acm.org.
http://sources.redhat.com/bzip2
The ideas embodied in _b_z_i_p_2 are due to (at least) the fol
lowing people: Michael Burrows and David Wheeler (for the
block sorting transformation), David Wheeler (again, for
the Huffman coder), Peter Fenwick (for the structured cod
ing model in the original _b_z_i_p_, and many refinements), and
Alistair Moffat, Radford Neal and Ian Witten (for the
arithmetic coder in the original _b_z_i_p_)_. I am much
indebted for their help, support and advice. See the man
ual in the source distribution for pointers to sources of
documentation. Christian von Roques encouraged me to look
for faster sorting algorithms, so as to speed up compres
sion. Bela Lubkin encouraged me to improve the worst-case
compression performance. The bz* scripts are derived from
those of GNU gzip. Many people sent patches, helped with
portability problems, lent machines, gave advice and were
generally helpful.
bzip2(1)
|
Added work/src/bzip2-1.0.2/bzip2.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
|
/*-----------------------------------------------------------*/
/*--- A block-sorting, lossless compressor bzip2.c ---*/
/*-----------------------------------------------------------*/
/*--
This file is a part of bzip2 and/or libbzip2, a program and
library for lossless, block-sorting data compression.
Copyright (C) 1996-2002 Julian R Seward. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.
3. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
4. The name of the author may not be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Julian Seward, Cambridge, UK.
jseward@acm.org
bzip2/libbzip2 version 1.0 of 21 March 2000
This program is based on (at least) the work of:
Mike Burrows
David Wheeler
Peter Fenwick
Alistair Moffat
Radford Neal
Ian H. Witten
Robert Sedgewick
Jon L. Bentley
For more information on these sources, see the manual.
--*/
/*----------------------------------------------------*/
/*--- IMPORTANT ---*/
/*----------------------------------------------------*/
/*--
WARNING:
This program and library (attempts to) compress data by
performing several non-trivial transformations on it.
Unless you are 100% familiar with *all* the algorithms
contained herein, and with the consequences of modifying them,
you should NOT meddle with the compression or decompression
machinery. Incorrect changes can and very likely *will*
lead to disasterous loss of data.
DISCLAIMER:
I TAKE NO RESPONSIBILITY FOR ANY LOSS OF DATA ARISING FROM THE
USE OF THIS PROGRAM, HOWSOEVER CAUSED.
Every compression of a file implies an assumption that the
compressed file can be decompressed to reproduce the original.
Great efforts in design, coding and testing have been made to
ensure that this program works correctly. However, the
complexity of the algorithms, and, in particular, the presence
of various special cases in the code which occur with very low
but non-zero probability make it impossible to rule out the
possibility of bugs remaining in the program. DO NOT COMPRESS
ANY DATA WITH THIS PROGRAM AND/OR LIBRARY UNLESS YOU ARE PREPARED
TO ACCEPT THE POSSIBILITY, HOWEVER SMALL, THAT THE DATA WILL
NOT BE RECOVERABLE.
That is not to say this program is inherently unreliable.
Indeed, I very much hope the opposite is true. bzip2/libbzip2
has been carefully constructed and extensively tested.
PATENTS:
To the best of my knowledge, bzip2/libbzip2 does not use any
patented algorithms. However, I do not have the resources
available to carry out a full patent search. Therefore I cannot
give any guarantee of the above statement.
--*/
/*----------------------------------------------------*/
/*--- and now for something much more pleasant :-) ---*/
/*----------------------------------------------------*/
/*---------------------------------------------*/
/*--
Place a 1 beside your platform, and 0 elsewhere.
--*/
/*--
Generic 32-bit Unix.
Also works on 64-bit Unix boxes.
This is the default.
--*/
#define BZ_UNIX 1
/*--
Win32, as seen by Jacob Navia's excellent
port of (Chris Fraser & David Hanson)'s excellent
lcc compiler. Or with MS Visual C.
This is selected automatically if compiled by a compiler which
defines _WIN32, not including the Cygwin GCC.
--*/
#define BZ_LCCWIN32 0
#if defined(_WIN32) && !defined(__CYGWIN__)
#undef BZ_LCCWIN32
#define BZ_LCCWIN32 1
#undef BZ_UNIX
#define BZ_UNIX 0
#endif
/*---------------------------------------------*/
/*--
Some stuff for all platforms.
--*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <math.h>
#include <errno.h>
#include <ctype.h>
#include "bzlib.h"
#define ERROR_IF_EOF(i) { if ((i) == EOF) ioError(); }
#define ERROR_IF_NOT_ZERO(i) { if ((i) != 0) ioError(); }
#define ERROR_IF_MINUS_ONE(i) { if ((i) == (-1)) ioError(); }
/*---------------------------------------------*/
/*--
Platform-specific stuff.
--*/
#if BZ_UNIX
# include <fcntl.h>
# include <sys/types.h>
# include <utime.h>
# include <unistd.h>
# include <sys/stat.h>
# include <sys/times.h>
# define PATH_SEP '/'
# define MY_LSTAT lstat
# define MY_STAT stat
# define MY_S_ISREG S_ISREG
# define MY_S_ISDIR S_ISDIR
# define APPEND_FILESPEC(root, name) \
root=snocString((root), (name))
# define APPEND_FLAG(root, name) \
root=snocString((root), (name))
# define SET_BINARY_MODE(fd) /**/
# ifdef __GNUC__
# define NORETURN __attribute__ ((noreturn))
# else
# define NORETURN /**/
# endif
# ifdef __DJGPP__
# include <io.h>
# include <fcntl.h>
# undef MY_LSTAT
# undef MY_STAT
# define MY_LSTAT stat
# define MY_STAT stat
# undef SET_BINARY_MODE
# define SET_BINARY_MODE(fd) \
do { \
int retVal = setmode ( fileno ( fd ), \
O_BINARY ); \
ERROR_IF_MINUS_ONE ( retVal ); \
} while ( 0 )
# endif
# ifdef __CYGWIN__
# include <io.h>
# include <fcntl.h>
# undef SET_BINARY_MODE
# define SET_BINARY_MODE(fd) \
do { \
int retVal = setmode ( fileno ( fd ), \
O_BINARY ); \
ERROR_IF_MINUS_ONE ( retVal ); \
} while ( 0 )
# endif
#endif /* BZ_UNIX */
#if BZ_LCCWIN32
# include <io.h>
# include <fcntl.h>
# include <sys/stat.h>
# define NORETURN /**/
# define PATH_SEP '\\'
# define MY_LSTAT _stat
# define MY_STAT _stat
# define MY_S_ISREG(x) ((x) & _S_IFREG)
# define MY_S_ISDIR(x) ((x) & _S_IFDIR)
# define APPEND_FLAG(root, name) \
root=snocString((root), (name))
# define APPEND_FILESPEC(root, name) \
root = snocString ((root), (name))
# define SET_BINARY_MODE(fd) \
do { \
int retVal = setmode ( fileno ( fd ), \
O_BINARY ); \
ERROR_IF_MINUS_ONE ( retVal ); \
} while ( 0 )
#endif /* BZ_LCCWIN32 */
/*---------------------------------------------*/
/*--
Some more stuff for all platforms :-)
--*/
typedef char Char;
typedef unsigned char Bool;
typedef unsigned char UChar;
typedef int Int32;
typedef unsigned int UInt32;
typedef short Int16;
typedef unsigned short UInt16;
#define True ((Bool)1)
#define False ((Bool)0)
/*--
IntNative is your platform's `native' int size.
Only here to avoid probs with 64-bit platforms.
--*/
typedef int IntNative;
/*---------------------------------------------------*/
/*--- Misc (file handling) data decls ---*/
/*---------------------------------------------------*/
Int32 verbosity;
Bool keepInputFiles, smallMode, deleteOutputOnInterrupt;
Bool forceOverwrite, testFailsExist, unzFailsExist, noisy;
Int32 numFileNames, numFilesProcessed, blockSize100k;
Int32 exitValue;
/*-- source modes; F==file, I==stdin, O==stdout --*/
#define SM_I2O 1
#define SM_F2O 2
#define SM_F2F 3
/*-- operation modes --*/
#define OM_Z 1
#define OM_UNZ 2
#define OM_TEST 3
Int32 opMode;
Int32 srcMode;
#define FILE_NAME_LEN 1034
Int32 longestFileName;
Char inName [FILE_NAME_LEN];
Char outName[FILE_NAME_LEN];
Char tmpName[FILE_NAME_LEN];
Char *progName;
Char progNameReally[FILE_NAME_LEN];
FILE *outputHandleJustInCase;
Int32 workFactor;
static void panic ( Char* ) NORETURN;
static void ioError ( void ) NORETURN;
static void outOfMemory ( void ) NORETURN;
static void configError ( void ) NORETURN;
static void crcError ( void ) NORETURN;
static void cleanUpAndFail ( Int32 ) NORETURN;
static void compressedStreamEOF ( void ) NORETURN;
static void copyFileName ( Char*, Char* );
static void* myMalloc ( Int32 );
/*---------------------------------------------------*/
/*--- An implementation of 64-bit ints. Sigh. ---*/
/*--- Roll on widespread deployment of ANSI C9X ! ---*/
/*---------------------------------------------------*/
typedef
struct { UChar b[8]; }
UInt64;
static
void uInt64_from_UInt32s ( UInt64* n, UInt32 lo32, UInt32 hi32 )
{
n->b[7] = (UChar)((hi32 >> 24) & 0xFF);
n->b[6] = (UChar)((hi32 >> 16) & 0xFF);
n->b[5] = (UChar)((hi32 >> 8) & 0xFF);
n->b[4] = (UChar) (hi32 & 0xFF);
n->b[3] = (UChar)((lo32 >> 24) & 0xFF);
n->b[2] = (UChar)((lo32 >> 16) & 0xFF);
n->b[1] = (UChar)((lo32 >> 8) & 0xFF);
n->b[0] = (UChar) (lo32 & 0xFF);
}
static
double uInt64_to_double ( UInt64* n )
{
Int32 i;
double base = 1.0;
double sum = 0.0;
for (i = 0; i < 8; i++) {
sum += base * (double)(n->b[i]);
base *= 256.0;
}
return sum;
}
static
Bool uInt64_isZero ( UInt64* n )
{
Int32 i;
for (i = 0; i < 8; i++)
if (n->b[i] != 0) return 0;
return 1;
}
/* Divide *n by 10, and return the remainder. */
static
Int32 uInt64_qrm10 ( UInt64* n )
{
UInt32 rem, tmp;
Int32 i;
rem = 0;
for (i = 7; i >= 0; i--) {
tmp = rem * 256 + n->b[i];
n->b[i] = tmp / 10;
rem = tmp % 10;
}
return rem;
}
/* ... and the Whole Entire Point of all this UInt64 stuff is
so that we can supply the following function.
*/
static
void uInt64_toAscii ( char* outbuf, UInt64* n )
{
Int32 i, q;
UChar buf[32];
Int32 nBuf = 0;
UInt64 n_copy = *n;
do {
q = uInt64_qrm10 ( &n_copy );
buf[nBuf] = q + '0';
nBuf++;
} while (!uInt64_isZero(&n_copy));
outbuf[nBuf] = 0;
for (i = 0; i < nBuf; i++)
outbuf[i] = buf[nBuf-i-1];
}
/*---------------------------------------------------*/
/*--- Processing of complete files and streams ---*/
/*---------------------------------------------------*/
/*---------------------------------------------*/
static
Bool myfeof ( FILE* f )
{
Int32 c = fgetc ( f );
if (c == EOF) return True;
ungetc ( c, f );
return False;
}
/*---------------------------------------------*/
static
void compressStream ( FILE *stream, FILE *zStream )
{
BZFILE* bzf = NULL;
UChar ibuf[5000];
Int32 nIbuf;
UInt32 nbytes_in_lo32, nbytes_in_hi32;
UInt32 nbytes_out_lo32, nbytes_out_hi32;
Int32 bzerr, bzerr_dummy, ret;
SET_BINARY_MODE(stream);
SET_BINARY_MODE(zStream);
if (ferror(stream)) goto errhandler_io;
if (ferror(zStream)) goto errhandler_io;
bzf = BZ2_bzWriteOpen ( &bzerr, zStream,
blockSize100k, verbosity, workFactor );
if (bzerr != BZ_OK) goto errhandler;
if (verbosity >= 2) fprintf ( stderr, "\n" );
while (True) {
if (myfeof(stream)) break;
nIbuf = fread ( ibuf, sizeof(UChar), 5000, stream );
if (ferror(stream)) goto errhandler_io;
if (nIbuf > 0) BZ2_bzWrite ( &bzerr, bzf, (void*)ibuf, nIbuf );
if (bzerr != BZ_OK) goto errhandler;
}
BZ2_bzWriteClose64 ( &bzerr, bzf, 0,
&nbytes_in_lo32, &nbytes_in_hi32,
&nbytes_out_lo32, &nbytes_out_hi32 );
if (bzerr != BZ_OK) goto errhandler;
if (ferror(zStream)) goto errhandler_io;
ret = fflush ( zStream );
if (ret == EOF) goto errhandler_io;
if (zStream != stdout) {
ret = fclose ( zStream );
outputHandleJustInCase = NULL;
if (ret == EOF) goto errhandler_io;
}
outputHandleJustInCase = NULL;
if (ferror(stream)) goto errhandler_io;
ret = fclose ( stream );
if (ret == EOF) goto errhandler_io;
if (verbosity >= 1) {
if (nbytes_in_lo32 == 0 && nbytes_in_hi32 == 0) {
fprintf ( stderr, " no data compressed.\n");
} else {
Char buf_nin[32], buf_nout[32];
UInt64 nbytes_in, nbytes_out;
double nbytes_in_d, nbytes_out_d;
uInt64_from_UInt32s ( &nbytes_in,
nbytes_in_lo32, nbytes_in_hi32 );
uInt64_from_UInt32s ( &nbytes_out,
nbytes_out_lo32, nbytes_out_hi32 );
nbytes_in_d = uInt64_to_double ( &nbytes_in );
nbytes_out_d = uInt64_to_double ( &nbytes_out );
uInt64_toAscii ( buf_nin, &nbytes_in );
uInt64_toAscii ( buf_nout, &nbytes_out );
fprintf ( stderr, "%6.3f:1, %6.3f bits/byte, "
"%5.2f%% saved, %s in, %s out.\n",
nbytes_in_d / nbytes_out_d,
(8.0 * nbytes_out_d) / nbytes_in_d,
100.0 * (1.0 - nbytes_out_d / nbytes_in_d),
buf_nin,
buf_nout
);
}
}
return;
errhandler:
BZ2_bzWriteClose64 ( &bzerr_dummy, bzf, 1,
&nbytes_in_lo32, &nbytes_in_hi32,
&nbytes_out_lo32, &nbytes_out_hi32 );
switch (bzerr) {
case BZ_CONFIG_ERROR:
configError(); break;
case BZ_MEM_ERROR:
outOfMemory (); break;
case BZ_IO_ERROR:
errhandler_io:
ioError(); break;
default:
panic ( "compress:unexpected error" );
}
panic ( "compress:end" );
/*notreached*/
}
/*---------------------------------------------*/
static
Bool uncompressStream ( FILE *zStream, FILE *stream )
{
BZFILE* bzf = NULL;
Int32 bzerr, bzerr_dummy, ret, nread, streamNo, i;
UChar obuf[5000];
UChar unused[BZ_MAX_UNUSED];
Int32 nUnused;
UChar* unusedTmp;
nUnused = 0;
streamNo = 0;
SET_BINARY_MODE(stream);
SET_BINARY_MODE(zStream);
if (ferror(stream)) goto errhandler_io;
if (ferror(zStream)) goto errhandler_io;
while (True) {
bzf = BZ2_bzReadOpen (
&bzerr, zStream, verbosity,
(int)smallMode, unused, nUnused
);
if (bzf == NULL || bzerr != BZ_OK) goto errhandler;
streamNo++;
while (bzerr == BZ_OK) {
nread = BZ2_bzRead ( &bzerr, bzf, obuf, 5000 );
if (bzerr == BZ_DATA_ERROR_MAGIC) goto trycat;
if ((bzerr == BZ_OK || bzerr == BZ_STREAM_END) && nread > 0)
fwrite ( obuf, sizeof(UChar), nread, stream );
if (ferror(stream)) goto errhandler_io;
}
if (bzerr != BZ_STREAM_END) goto errhandler;
BZ2_bzReadGetUnused ( &bzerr, bzf, (void**)(&unusedTmp), &nUnused );
if (bzerr != BZ_OK) panic ( "decompress:bzReadGetUnused" );
for (i = 0; i < nUnused; i++) unused[i] = unusedTmp[i];
BZ2_bzReadClose ( &bzerr, bzf );
if (bzerr != BZ_OK) panic ( "decompress:bzReadGetUnused" );
if (nUnused == 0 && myfeof(zStream)) break;
}
closeok:
if (ferror(zStream)) goto errhandler_io;
ret = fclose ( zStream );
if (ret == EOF) goto errhandler_io;
if (ferror(stream)) goto errhandler_io;
ret = fflush ( stream );
if (ret != 0) goto errhandler_io;
if (stream != stdout) {
ret = fclose ( stream );
outputHandleJustInCase = NULL;
if (ret == EOF) goto errhandler_io;
}
outputHandleJustInCase = NULL;
if (verbosity >= 2) fprintf ( stderr, "\n " );
return True;
trycat:
if (forceOverwrite) {
rewind(zStream);
while (True) {
if (myfeof(zStream)) break;
nread = fread ( obuf, sizeof(UChar), 5000, zStream );
if (ferror(zStream)) goto errhandler_io;
if (nread > 0) fwrite ( obuf, sizeof(UChar), nread, stream );
if (ferror(stream)) goto errhandler_io;
}
goto closeok;
}
errhandler:
BZ2_bzReadClose ( &bzerr_dummy, bzf );
switch (bzerr) {
case BZ_CONFIG_ERROR:
configError(); break;
case BZ_IO_ERROR:
errhandler_io:
ioError(); break;
case BZ_DATA_ERROR:
crcError();
case BZ_MEM_ERROR:
outOfMemory();
case BZ_UNEXPECTED_EOF:
compressedStreamEOF();
case BZ_DATA_ERROR_MAGIC:
if (zStream != stdin) fclose(zStream);
if (stream != stdout) fclose(stream);
if (streamNo == 1) {
return False;
} else {
if (noisy)
fprintf ( stderr,
"\n%s: %s: trailing garbage after EOF ignored\n",
progName, inName );
return True;
}
default:
panic ( "decompress:unexpected error" );
}
panic ( "decompress:end" );
return True; /*notreached*/
}
/*---------------------------------------------*/
static
Bool testStream ( FILE *zStream )
{
BZFILE* bzf = NULL;
Int32 bzerr, bzerr_dummy, ret, nread, streamNo, i;
UChar obuf[5000];
UChar unused[BZ_MAX_UNUSED];
Int32 nUnused;
UChar* unusedTmp;
nUnused = 0;
streamNo = 0;
SET_BINARY_MODE(zStream);
if (ferror(zStream)) goto errhandler_io;
while (True) {
bzf = BZ2_bzReadOpen (
&bzerr, zStream, verbosity,
(int)smallMode, unused, nUnused
);
if (bzf == NULL || bzerr != BZ_OK) goto errhandler;
streamNo++;
while (bzerr == BZ_OK) {
nread = BZ2_bzRead ( &bzerr, bzf, obuf, 5000 );
if (bzerr == BZ_DATA_ERROR_MAGIC) goto errhandler;
}
if (bzerr != BZ_STREAM_END) goto errhandler;
BZ2_bzReadGetUnused ( &bzerr, bzf, (void**)(&unusedTmp), &nUnused );
if (bzerr != BZ_OK) panic ( "test:bzReadGetUnused" );
for (i = 0; i < nUnused; i++) unused[i] = unusedTmp[i];
BZ2_bzReadClose ( &bzerr, bzf );
if (bzerr != BZ_OK) panic ( "test:bzReadGetUnused" );
if (nUnused == 0 && myfeof(zStream)) break;
}
if (ferror(zStream)) goto errhandler_io;
ret = fclose ( zStream );
if (ret == EOF) goto errhandler_io;
if (verbosity >= 2) fprintf ( stderr, "\n " );
return True;
errhandler:
BZ2_bzReadClose ( &bzerr_dummy, bzf );
if (verbosity == 0)
fprintf ( stderr, "%s: %s: ", progName, inName );
switch (bzerr) {
case BZ_CONFIG_ERROR:
configError(); break;
case BZ_IO_ERROR:
errhandler_io:
ioError(); break;
case BZ_DATA_ERROR:
fprintf ( stderr,
"data integrity (CRC) error in data\n" );
return False;
case BZ_MEM_ERROR:
outOfMemory();
case BZ_UNEXPECTED_EOF:
fprintf ( stderr,
"file ends unexpectedly\n" );
return False;
case BZ_DATA_ERROR_MAGIC:
if (zStream != stdin) fclose(zStream);
if (streamNo == 1) {
fprintf ( stderr,
"bad magic number (file not created by bzip2)\n" );
return False;
} else {
if (noisy)
fprintf ( stderr,
"trailing garbage after EOF ignored\n" );
return True;
}
default:
panic ( "test:unexpected error" );
}
panic ( "test:end" );
return True; /*notreached*/
}
/*---------------------------------------------------*/
/*--- Error [non-] handling grunge ---*/
/*---------------------------------------------------*/
/*---------------------------------------------*/
static
void setExit ( Int32 v )
{
if (v > exitValue) exitValue = v;
}
/*---------------------------------------------*/
static
void cadvise ( void )
{
if (noisy)
fprintf (
stderr,
"\nIt is possible that the compressed file(s) have become corrupted.\n"
"You can use the -tvv option to test integrity of such files.\n\n"
"You can use the `bzip2recover' program to attempt to recover\n"
"data from undamaged sections of corrupted files.\n\n"
);
}
/*---------------------------------------------*/
static
void showFileNames ( void )
{
if (noisy)
fprintf (
stderr,
"\tInput file = %s, output file = %s\n",
inName, outName
);
}
/*---------------------------------------------*/
static
void cleanUpAndFail ( Int32 ec )
{
IntNative retVal;
struct MY_STAT statBuf;
if ( srcMode == SM_F2F
&& opMode != OM_TEST
&& deleteOutputOnInterrupt ) {
/* Check whether input file still exists. Delete output file
only if input exists to avoid loss of data. Joerg Prante, 5
January 2002. (JRS 06-Jan-2002: other changes in 1.0.2 mean
this is less likely to happen. But to be ultra-paranoid, we
do the check anyway.) */
retVal = MY_STAT ( inName, &statBuf );
if (retVal == 0) {
if (noisy)
fprintf ( stderr,
"%s: Deleting output file %s, if it exists.\n",
progName, outName );
if (outputHandleJustInCase != NULL)
fclose ( outputHandleJustInCase );
retVal = remove ( outName );
if (retVal != 0)
fprintf ( stderr,
"%s: WARNING: deletion of output file "
"(apparently) failed.\n",
progName );
} else {
fprintf ( stderr,
"%s: WARNING: deletion of output file suppressed\n",
progName );
fprintf ( stderr,
"%s: since input file no longer exists. Output file\n",
progName );
fprintf ( stderr,
"%s: `%s' may be incomplete.\n",
progName, outName );
fprintf ( stderr,
"%s: I suggest doing an integrity test (bzip2 -tv)"
" of it.\n",
progName );
}
}
if (noisy && numFileNames > 0 && numFilesProcessed < numFileNames) {
fprintf ( stderr,
"%s: WARNING: some files have not been processed:\n"
"%s: %d specified on command line, %d not processed yet.\n\n",
progName, progName,
numFileNames, numFileNames - numFilesProcessed );
}
setExit(ec);
exit(exitValue);
}
/*---------------------------------------------*/
static
void panic ( Char* s )
{
fprintf ( stderr,
"\n%s: PANIC -- internal consistency error:\n"
"\t%s\n"
"\tThis is a BUG. Please report it to me at:\n"
"\tjseward@acm.org\n",
progName, s );
showFileNames();
cleanUpAndFail( 3 );
}
/*---------------------------------------------*/
static
void crcError ( void )
{
fprintf ( stderr,
"\n%s: Data integrity error when decompressing.\n",
progName );
showFileNames();
cadvise();
cleanUpAndFail( 2 );
}
/*---------------------------------------------*/
static
void compressedStreamEOF ( void )
{
if (noisy) {
fprintf ( stderr,
"\n%s: Compressed file ends unexpectedly;\n\t"
"perhaps it is corrupted? *Possible* reason follows.\n",
progName );
perror ( progName );
showFileNames();
cadvise();
}
cleanUpAndFail( 2 );
}
/*---------------------------------------------*/
static
void ioError ( void )
{
fprintf ( stderr,
"\n%s: I/O or other error, bailing out. "
"Possible reason follows.\n",
progName );
perror ( progName );
showFileNames();
cleanUpAndFail( 1 );
}
/*---------------------------------------------*/
static
void mySignalCatcher ( IntNative n )
{
fprintf ( stderr,
"\n%s: Control-C or similar caught, quitting.\n",
progName );
cleanUpAndFail(1);
}
/*---------------------------------------------*/
static
void mySIGSEGVorSIGBUScatcher ( IntNative n )
{
if (opMode == OM_Z)
fprintf (
stderr,
"\n%s: Caught a SIGSEGV or SIGBUS whilst compressing.\n"
"\n"
" Possible causes are (most likely first):\n"
" (1) This computer has unreliable memory or cache hardware\n"
" (a surprisingly common problem; try a different machine.)\n"
" (2) A bug in the compiler used to create this executable\n"
" (unlikely, if you didn't compile bzip2 yourself.)\n"
" (3) A real bug in bzip2 -- I hope this should never be the case.\n"
" The user's manual, Section 4.3, has more info on (1) and (2).\n"
" \n"
" If you suspect this is a bug in bzip2, or are unsure about (1)\n"
" or (2), feel free to report it to me at: jseward@acm.org.\n"
" Section 4.3 of the user's manual describes the info a useful\n"
" bug report should have. If the manual is available on your\n"
" system, please try and read it before mailing me. If you don't\n"
" have the manual or can't be bothered to read it, mail me anyway.\n"
"\n",
progName );
else
fprintf (
stderr,
"\n%s: Caught a SIGSEGV or SIGBUS whilst decompressing.\n"
"\n"
" Possible causes are (most likely first):\n"
" (1) The compressed data is corrupted, and bzip2's usual checks\n"
" failed to detect this. Try bzip2 -tvv my_file.bz2.\n"
" (2) This computer has unreliable memory or cache hardware\n"
" (a surprisingly common problem; try a different machine.)\n"
" (3) A bug in the compiler used to create this executable\n"
" (unlikely, if you didn't compile bzip2 yourself.)\n"
" (4) A real bug in bzip2 -- I hope this should never be the case.\n"
" The user's manual, Section 4.3, has more info on (2) and (3).\n"
" \n"
" If you suspect this is a bug in bzip2, or are unsure about (2)\n"
" or (3), feel free to report it to me at: jseward@acm.org.\n"
" Section 4.3 of the user's manual describes the info a useful\n"
" bug report should have. If the manual is available on your\n"
" system, please try and read it before mailing me. If you don't\n"
" have the manual or can't be bothered to read it, mail me anyway.\n"
"\n",
progName );
showFileNames();
if (opMode == OM_Z)
cleanUpAndFail( 3 ); else
{ cadvise(); cleanUpAndFail( 2 ); }
}
/*---------------------------------------------*/
static
void outOfMemory ( void )
{
fprintf ( stderr,
"\n%s: couldn't allocate enough memory\n",
progName );
showFileNames();
cleanUpAndFail(1);
}
/*---------------------------------------------*/
static
void configError ( void )
{
fprintf ( stderr,
"bzip2: I'm not configured correctly for this platform!\n"
"\tI require Int32, Int16 and Char to have sizes\n"
"\tof 4, 2 and 1 bytes to run properly, and they don't.\n"
"\tProbably you can fix this by defining them correctly,\n"
"\tand recompiling. Bye!\n" );
setExit(3);
exit(exitValue);
}
/*---------------------------------------------------*/
/*--- The main driver machinery ---*/
/*---------------------------------------------------*/
/* All rather crufty. The main problem is that input files
are stat()d multiple times before use. This should be
cleaned up.
*/
/*---------------------------------------------*/
static
void pad ( Char *s )
{
Int32 i;
if ( (Int32)strlen(s) >= longestFileName ) return;
for (i = 1; i <= longestFileName - (Int32)strlen(s); i++)
fprintf ( stderr, " " );
}
/*---------------------------------------------*/
static
void copyFileName ( Char* to, Char* from )
{
if ( strlen(from) > FILE_NAME_LEN-10 ) {
fprintf (
stderr,
"bzip2: file name\n`%s'\n"
"is suspiciously (more than %d chars) long.\n"
"Try using a reasonable file name instead. Sorry! :-)\n",
from, FILE_NAME_LEN-10
);
setExit(1);
exit(exitValue);
}
strncpy(to,from,FILE_NAME_LEN-10);
to[FILE_NAME_LEN-10]='\0';
}
/*---------------------------------------------*/
static
Bool fileExists ( Char* name )
{
FILE *tmp = fopen ( name, "rb" );
Bool exists = (tmp != NULL);
if (tmp != NULL) fclose ( tmp );
return exists;
}
/*---------------------------------------------*/
/* Open an output file safely with O_EXCL and good permissions.
This avoids a race condition in versions < 1.0.2, in which
the file was first opened and then had its interim permissions
set safely. We instead use open() to create the file with
the interim permissions required. (--- --- rw-).
For non-Unix platforms, if we are not worrying about
security issues, simple this simply behaves like fopen.
*/
FILE* fopen_output_safely ( Char* name, const char* mode )
{
# if BZ_UNIX
FILE* fp;
IntNative fh;
fh = open(name, O_WRONLY|O_CREAT|O_EXCL, S_IWUSR|S_IRUSR);
if (fh == -1) return NULL;
fp = fdopen(fh, mode);
if (fp == NULL) close(fh);
return fp;
# else
return fopen(name, mode);
# endif
}
/*---------------------------------------------*/
/*--
if in doubt, return True
--*/
static
Bool notAStandardFile ( Char* name )
{
IntNative i;
struct MY_STAT statBuf;
i = MY_LSTAT ( name, &statBuf );
if (i != 0) return True;
if (MY_S_ISREG(statBuf.st_mode)) return False;
return True;
}
/*---------------------------------------------*/
/*--
rac 11/21/98 see if file has hard links to it
--*/
static
Int32 countHardLinks ( Char* name )
{
IntNative i;
struct MY_STAT statBuf;
i = MY_LSTAT ( name, &statBuf );
if (i != 0) return 0;
return (statBuf.st_nlink - 1);
}
/*---------------------------------------------*/
/* Copy modification date, access date, permissions and owner from the
source to destination file. We have to copy this meta-info off
into fileMetaInfo before starting to compress / decompress it,
because doing it afterwards means we get the wrong access time.
To complicate matters, in compress() and decompress() below, the
sequence of tests preceding the call to saveInputFileMetaInfo()
involves calling fileExists(), which in turn establishes its result
by attempting to fopen() the file, and if successful, immediately
fclose()ing it again. So we have to assume that the fopen() call
does not cause the access time field to be updated.
Reading of the man page for stat() (man 2 stat) on RedHat 7.2 seems
to imply that merely doing open() will not affect the access time.
Therefore we merely need to hope that the C library only does
open() as a result of fopen(), and not any kind of read()-ahead
cleverness.
It sounds pretty fragile to me. Whether this carries across
robustly to arbitrary Unix-like platforms (or even works robustly
on this one, RedHat 7.2) is unknown to me. Nevertheless ...
*/
#if BZ_UNIX
static
struct MY_STAT fileMetaInfo;
#endif
static
void saveInputFileMetaInfo ( Char *srcName )
{
# if BZ_UNIX
IntNative retVal;
/* Note use of stat here, not lstat. */
retVal = MY_STAT( srcName, &fileMetaInfo );
ERROR_IF_NOT_ZERO ( retVal );
# endif
}
static
void applySavedMetaInfoToOutputFile ( Char *dstName )
{
# if BZ_UNIX
IntNative retVal;
struct utimbuf uTimBuf;
uTimBuf.actime = fileMetaInfo.st_atime;
uTimBuf.modtime = fileMetaInfo.st_mtime;
retVal = chmod ( dstName, fileMetaInfo.st_mode );
ERROR_IF_NOT_ZERO ( retVal );
retVal = utime ( dstName, &uTimBuf );
ERROR_IF_NOT_ZERO ( retVal );
retVal = chown ( dstName, fileMetaInfo.st_uid, fileMetaInfo.st_gid );
/* chown() will in many cases return with EPERM, which can
be safely ignored.
*/
# endif
}
/*---------------------------------------------*/
static
Bool containsDubiousChars ( Char* name )
{
# if BZ_UNIX
/* On unix, files can contain any characters and the file expansion
* is performed by the shell.
*/
return False;
# else /* ! BZ_UNIX */
/* On non-unix (Win* platforms), wildcard characters are not allowed in
* filenames.
*/
for (; *name != '\0'; name++)
if (*name == '?' || *name == '*') return True;
return False;
# endif /* BZ_UNIX */
}
/*---------------------------------------------*/
#define BZ_N_SUFFIX_PAIRS 4
Char* zSuffix[BZ_N_SUFFIX_PAIRS]
= { ".bz2", ".bz", ".tbz2", ".tbz" };
Char* unzSuffix[BZ_N_SUFFIX_PAIRS]
= { "", "", ".tar", ".tar" };
static
Bool hasSuffix ( Char* s, Char* suffix )
{
Int32 ns = strlen(s);
Int32 nx = strlen(suffix);
if (ns < nx) return False;
if (strcmp(s + ns - nx, suffix) == 0) return True;
return False;
}
static
Bool mapSuffix ( Char* name,
Char* oldSuffix, Char* newSuffix )
{
if (!hasSuffix(name,oldSuffix)) return False;
name[strlen(name)-strlen(oldSuffix)] = 0;
strcat ( name, newSuffix );
return True;
}
/*---------------------------------------------*/
static
void compress ( Char *name )
{
FILE *inStr;
FILE *outStr;
Int32 n, i;
struct MY_STAT statBuf;
deleteOutputOnInterrupt = False;
if (name == NULL && srcMode != SM_I2O)
panic ( "compress: bad modes\n" );
switch (srcMode) {
case SM_I2O:
copyFileName ( inName, "(stdin)" );
copyFileName ( outName, "(stdout)" );
break;
case SM_F2F:
copyFileName ( inName, name );
copyFileName ( outName, name );
strcat ( outName, ".bz2" );
break;
case SM_F2O:
copyFileName ( inName, name );
copyFileName ( outName, "(stdout)" );
break;
}
if ( srcMode != SM_I2O && containsDubiousChars ( inName ) ) {
if (noisy)
fprintf ( stderr, "%s: There are no files matching `%s'.\n",
progName, inName );
setExit(1);
return;
}
if ( srcMode != SM_I2O && !fileExists ( inName ) ) {
fprintf ( stderr, "%s: Can't open input file %s: %s.\n",
progName, inName, strerror(errno) );
setExit(1);
return;
}
for (i = 0; i < BZ_N_SUFFIX_PAIRS; i++) {
if (hasSuffix(inName, zSuffix[i])) {
if (noisy)
fprintf ( stderr,
"%s: Input file %s already has %s suffix.\n",
progName, inName, zSuffix[i] );
setExit(1);
return;
}
}
if ( srcMode == SM_F2F || srcMode == SM_F2O ) {
MY_STAT(inName, &statBuf);
if ( MY_S_ISDIR(statBuf.st_mode) ) {
fprintf( stderr,
"%s: Input file %s is a directory.\n",
progName,inName);
setExit(1);
return;
}
}
if ( srcMode == SM_F2F && !forceOverwrite && notAStandardFile ( inName )) {
if (noisy)
fprintf ( stderr, "%s: Input file %s is not a normal file.\n",
progName, inName );
setExit(1);
return;
}
if ( srcMode == SM_F2F && fileExists ( outName ) ) {
if (forceOverwrite) {
remove(outName);
} else {
fprintf ( stderr, "%s: Output file %s already exists.\n",
progName, outName );
setExit(1);
return;
}
}
if ( srcMode == SM_F2F && !forceOverwrite &&
(n=countHardLinks ( inName )) > 0) {
fprintf ( stderr, "%s: Input file %s has %d other link%s.\n",
progName, inName, n, n > 1 ? "s" : "" );
setExit(1);
return;
}
if ( srcMode == SM_F2F ) {
/* Save the file's meta-info before we open it. Doing it later
means we mess up the access times. */
saveInputFileMetaInfo ( inName );
}
switch ( srcMode ) {
case SM_I2O:
inStr = stdin;
outStr = stdout;
if ( isatty ( fileno ( stdout ) ) ) {
fprintf ( stderr,
"%s: I won't write compressed data to a terminal.\n",
progName );
fprintf ( stderr, "%s: For help, type: `%s --help'.\n",
progName, progName );
setExit(1);
return;
};
break;
case SM_F2O:
inStr = fopen ( inName, "rb" );
outStr = stdout;
if ( isatty ( fileno ( stdout ) ) ) {
fprintf ( stderr,
"%s: I won't write compressed data to a terminal.\n",
progName );
fprintf ( stderr, "%s: For help, type: `%s --help'.\n",
progName, progName );
if ( inStr != NULL ) fclose ( inStr );
setExit(1);
return;
};
if ( inStr == NULL ) {
fprintf ( stderr, "%s: Can't open input file %s: %s.\n",
progName, inName, strerror(errno) );
setExit(1);
return;
};
break;
case SM_F2F:
inStr = fopen ( inName, "rb" );
outStr = fopen_output_safely ( outName, "wb" );
if ( outStr == NULL) {
fprintf ( stderr, "%s: Can't create output file %s: %s.\n",
progName, outName, strerror(errno) );
if ( inStr != NULL ) fclose ( inStr );
setExit(1);
return;
}
if ( inStr == NULL ) {
fprintf ( stderr, "%s: Can't open input file %s: %s.\n",
progName, inName, strerror(errno) );
if ( outStr != NULL ) fclose ( outStr );
setExit(1);
return;
};
break;
default:
panic ( "compress: bad srcMode" );
break;
}
if (verbosity >= 1) {
fprintf ( stderr, " %s: ", inName );
pad ( inName );
fflush ( stderr );
}
/*--- Now the input and output handles are sane. Do the Biz. ---*/
outputHandleJustInCase = outStr;
deleteOutputOnInterrupt = True;
compressStream ( inStr, outStr );
outputHandleJustInCase = NULL;
/*--- If there was an I/O error, we won't get here. ---*/
if ( srcMode == SM_F2F ) {
applySavedMetaInfoToOutputFile ( outName );
deleteOutputOnInterrupt = False;
if ( !keepInputFiles ) {
IntNative retVal = remove ( inName );
ERROR_IF_NOT_ZERO ( retVal );
}
}
deleteOutputOnInterrupt = False;
}
/*---------------------------------------------*/
static
void uncompress ( Char *name )
{
FILE *inStr;
FILE *outStr;
Int32 n, i;
Bool magicNumberOK;
Bool cantGuess;
struct MY_STAT statBuf;
deleteOutputOnInterrupt = False;
if (name == NULL && srcMode != SM_I2O)
panic ( "uncompress: bad modes\n" );
cantGuess = False;
switch (srcMode) {
case SM_I2O:
copyFileName ( inName, "(stdin)" );
copyFileName ( outName, "(stdout)" );
break;
case SM_F2F:
copyFileName ( inName, name );
copyFileName ( outName, name );
for (i = 0; i < BZ_N_SUFFIX_PAIRS; i++)
if (mapSuffix(outName,zSuffix[i],unzSuffix[i]))
goto zzz;
cantGuess = True;
strcat ( outName, ".out" );
break;
case SM_F2O:
copyFileName ( inName, name );
copyFileName ( outName, "(stdout)" );
break;
}
zzz:
if ( srcMode != SM_I2O && containsDubiousChars ( inName ) ) {
if (noisy)
fprintf ( stderr, "%s: There are no files matching `%s'.\n",
progName, inName );
setExit(1);
return;
}
if ( srcMode != SM_I2O && !fileExists ( inName ) ) {
fprintf ( stderr, "%s: Can't open input file %s: %s.\n",
progName, inName, strerror(errno) );
setExit(1);
return;
}
if ( srcMode == SM_F2F || srcMode == SM_F2O ) {
MY_STAT(inName, &statBuf);
if ( MY_S_ISDIR(statBuf.st_mode) ) {
fprintf( stderr,
"%s: Input file %s is a directory.\n",
progName,inName);
setExit(1);
return;
}
}
if ( srcMode == SM_F2F && !forceOverwrite && notAStandardFile ( inName )) {
if (noisy)
fprintf ( stderr, "%s: Input file %s is not a normal file.\n",
progName, inName );
setExit(1);
return;
}
if ( /* srcMode == SM_F2F implied && */ cantGuess ) {
if (noisy)
fprintf ( stderr,
"%s: Can't guess original name for %s -- using %s\n",
progName, inName, outName );
/* just a warning, no return */
}
if ( srcMode == SM_F2F && fileExists ( outName ) ) {
if (forceOverwrite) {
remove(outName);
} else {
fprintf ( stderr, "%s: Output file %s already exists.\n",
progName, outName );
setExit(1);
return;
}
}
if ( srcMode == SM_F2F && !forceOverwrite &&
(n=countHardLinks ( inName ) ) > 0) {
fprintf ( stderr, "%s: Input file %s has %d other link%s.\n",
progName, inName, n, n > 1 ? "s" : "" );
setExit(1);
return;
}
if ( srcMode == SM_F2F ) {
/* Save the file's meta-info before we open it. Doing it later
means we mess up the access times. */
saveInputFileMetaInfo ( inName );
}
switch ( srcMode ) {
case SM_I2O:
inStr = stdin;
outStr = stdout;
if ( isatty ( fileno ( stdin ) ) ) {
fprintf ( stderr,
"%s: I won't read compressed data from a terminal.\n",
progName );
fprintf ( stderr, "%s: For help, type: `%s --help'.\n",
progName, progName );
setExit(1);
return;
};
break;
case SM_F2O:
inStr = fopen ( inName, "rb" );
outStr = stdout;
if ( inStr == NULL ) {
fprintf ( stderr, "%s: Can't open input file %s:%s.\n",
progName, inName, strerror(errno) );
if ( inStr != NULL ) fclose ( inStr );
setExit(1);
return;
};
break;
case SM_F2F:
inStr = fopen ( inName, "rb" );
outStr = fopen_output_safely ( outName, "wb" );
if ( outStr == NULL) {
fprintf ( stderr, "%s: Can't create output file %s: %s.\n",
progName, outName, strerror(errno) );
if ( inStr != NULL ) fclose ( inStr );
setExit(1);
return;
}
if ( inStr == NULL ) {
fprintf ( stderr, "%s: Can't open input file %s: %s.\n",
progName, inName, strerror(errno) );
if ( outStr != NULL ) fclose ( outStr );
setExit(1);
return;
};
break;
default:
panic ( "uncompress: bad srcMode" );
break;
}
if (verbosity >= 1) {
fprintf ( stderr, " %s: ", inName );
pad ( inName );
fflush ( stderr );
}
/*--- Now the input and output handles are sane. Do the Biz. ---*/
outputHandleJustInCase = outStr;
deleteOutputOnInterrupt = True;
magicNumberOK = uncompressStream ( inStr, outStr );
outputHandleJustInCase = NULL;
/*--- If there was an I/O error, we won't get here. ---*/
if ( magicNumberOK ) {
if ( srcMode == SM_F2F ) {
applySavedMetaInfoToOutputFile ( outName );
deleteOutputOnInterrupt = False;
if ( !keepInputFiles ) {
IntNative retVal = remove ( inName );
ERROR_IF_NOT_ZERO ( retVal );
}
}
} else {
unzFailsExist = True;
deleteOutputOnInterrupt = False;
if ( srcMode == SM_F2F ) {
IntNative retVal = remove ( outName );
ERROR_IF_NOT_ZERO ( retVal );
}
}
deleteOutputOnInterrupt = False;
if ( magicNumberOK ) {
if (verbosity >= 1)
fprintf ( stderr, "done\n" );
} else {
setExit(2);
if (verbosity >= 1)
fprintf ( stderr, "not a bzip2 file.\n" ); else
fprintf ( stderr,
"%s: %s is not a bzip2 file.\n",
progName, inName );
}
}
/*---------------------------------------------*/
static
void testf ( Char *name )
{
FILE *inStr;
Bool allOK;
struct MY_STAT statBuf;
deleteOutputOnInterrupt = False;
if (name == NULL && srcMode != SM_I2O)
panic ( "testf: bad modes\n" );
copyFileName ( outName, "(none)" );
switch (srcMode) {
case SM_I2O: copyFileName ( inName, "(stdin)" ); break;
case SM_F2F: copyFileName ( inName, name ); break;
case SM_F2O: copyFileName ( inName, name ); break;
}
if ( srcMode != SM_I2O && containsDubiousChars ( inName ) ) {
if (noisy)
fprintf ( stderr, "%s: There are no files matching `%s'.\n",
progName, inName );
setExit(1);
return;
}
if ( srcMode != SM_I2O && !fileExists ( inName ) ) {
fprintf ( stderr, "%s: Can't open input %s: %s.\n",
progName, inName, strerror(errno) );
setExit(1);
return;
}
if ( srcMode != SM_I2O ) {
MY_STAT(inName, &statBuf);
if ( MY_S_ISDIR(statBuf.st_mode) ) {
fprintf( stderr,
"%s: Input file %s is a directory.\n",
progName,inName);
setExit(1);
return;
}
}
switch ( srcMode ) {
case SM_I2O:
if ( isatty ( fileno ( stdin ) ) ) {
fprintf ( stderr,
"%s: I won't read compressed data from a terminal.\n",
progName );
fprintf ( stderr, "%s: For help, type: `%s --help'.\n",
progName, progName );
setExit(1);
return;
};
inStr = stdin;
break;
case SM_F2O: case SM_F2F:
inStr = fopen ( inName, "rb" );
if ( inStr == NULL ) {
fprintf ( stderr, "%s: Can't open input file %s:%s.\n",
progName, inName, strerror(errno) );
setExit(1);
return;
};
break;
default:
panic ( "testf: bad srcMode" );
break;
}
if (verbosity >= 1) {
fprintf ( stderr, " %s: ", inName );
pad ( inName );
fflush ( stderr );
}
/*--- Now the input handle is sane. Do the Biz. ---*/
outputHandleJustInCase = NULL;
allOK = testStream ( inStr );
if (allOK && verbosity >= 1) fprintf ( stderr, "ok\n" );
if (!allOK) testFailsExist = True;
}
/*---------------------------------------------*/
static
void license ( void )
{
fprintf ( stderr,
"bzip2, a block-sorting file compressor. "
"Version %s.\n"
" \n"
" Copyright (C) 1996-2002 by Julian Seward.\n"
" \n"
" This program is free software; you can redistribute it and/or modify\n"
" it under the terms set out in the LICENSE file, which is included\n"
" in the bzip2-1.0 source distribution.\n"
" \n"
" This program is distributed in the hope that it will be useful,\n"
" but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
" LICENSE file for more details.\n"
" \n",
BZ2_bzlibVersion()
);
}
/*---------------------------------------------*/
static
void usage ( Char *fullProgName )
{
fprintf (
stderr,
"bzip2, a block-sorting file compressor. "
"Version %s.\n"
"\n usage: %s [flags and input files in any order]\n"
"\n"
" -h --help print this message\n"
" -d --decompress force decompression\n"
" -z --compress force compression\n"
" -k --keep keep (don't delete) input files\n"
" -f --force overwrite existing output files\n"
" -t --test test compressed file integrity\n"
" -c --stdout output to standard out\n"
" -q --quiet suppress noncritical error messages\n"
" -v --verbose be verbose (a 2nd -v gives more)\n"
" -L --license display software version & license\n"
" -V --version display software version & license\n"
" -s --small use less memory (at most 2500k)\n"
" -1 .. -9 set block size to 100k .. 900k\n"
" --fast alias for -1\n"
" --best alias for -9\n"
"\n"
" If invoked as `bzip2', default action is to compress.\n"
" as `bunzip2', default action is to decompress.\n"
" as `bzcat', default action is to decompress to stdout.\n"
"\n"
" If no file names are given, bzip2 compresses or decompresses\n"
" from standard input to standard output. You can combine\n"
" short flags, so `-v -4' means the same as -v4 or -4v, &c.\n"
# if BZ_UNIX
"\n"
# endif
,
BZ2_bzlibVersion(),
fullProgName
);
}
/*---------------------------------------------*/
static
void redundant ( Char* flag )
{
fprintf (
stderr,
"%s: %s is redundant in versions 0.9.5 and above\n",
progName, flag );
}
/*---------------------------------------------*/
/*--
All the garbage from here to main() is purely to
implement a linked list of command-line arguments,
into which main() copies argv[1 .. argc-1].
The purpose of this exercise is to facilitate
the expansion of wildcard characters * and ? in
filenames for OSs which don't know how to do it
themselves, like MSDOS, Windows 95 and NT.
The actual Dirty Work is done by the platform-
specific macro APPEND_FILESPEC.
--*/
typedef
struct zzzz {
Char *name;
struct zzzz *link;
}
Cell;
/*---------------------------------------------*/
static
void *myMalloc ( Int32 n )
{
void* p;
p = malloc ( (size_t)n );
if (p == NULL) outOfMemory ();
return p;
}
/*---------------------------------------------*/
static
Cell *mkCell ( void )
{
Cell *c;
c = (Cell*) myMalloc ( sizeof ( Cell ) );
c->name = NULL;
c->link = NULL;
return c;
}
/*---------------------------------------------*/
static
Cell *snocString ( Cell *root, Char *name )
{
if (root == NULL) {
Cell *tmp = mkCell();
tmp->name = (Char*) myMalloc ( 5 + strlen(name) );
strcpy ( tmp->name, name );
return tmp;
} else {
Cell *tmp = root;
while (tmp->link != NULL) tmp = tmp->link;
tmp->link = snocString ( tmp->link, name );
return root;
}
}
/*---------------------------------------------*/
static
void addFlagsFromEnvVar ( Cell** argList, Char* varName )
{
Int32 i, j, k;
Char *envbase, *p;
envbase = getenv(varName);
if (envbase != NULL) {
p = envbase;
i = 0;
while (True) {
if (p[i] == 0) break;
p += i;
i = 0;
while (isspace((Int32)(p[0]))) p++;
while (p[i] != 0 && !isspace((Int32)(p[i]))) i++;
if (i > 0) {
k = i; if (k > FILE_NAME_LEN-10) k = FILE_NAME_LEN-10;
for (j = 0; j < k; j++) tmpName[j] = p[j];
tmpName[k] = 0;
APPEND_FLAG(*argList, tmpName);
}
}
}
}
/*---------------------------------------------*/
#define ISFLAG(s) (strcmp(aa->name, (s))==0)
IntNative main ( IntNative argc, Char *argv[] )
{
Int32 i, j;
Char *tmp;
Cell *argList;
Cell *aa;
Bool decode;
/*-- Be really really really paranoid :-) --*/
if (sizeof(Int32) != 4 || sizeof(UInt32) != 4 ||
sizeof(Int16) != 2 || sizeof(UInt16) != 2 ||
sizeof(Char) != 1 || sizeof(UChar) != 1)
configError();
/*-- Initialise --*/
outputHandleJustInCase = NULL;
smallMode = False;
keepInputFiles = False;
forceOverwrite = False;
noisy = True;
verbosity = 0;
blockSize100k = 9;
testFailsExist = False;
unzFailsExist = False;
numFileNames = 0;
numFilesProcessed = 0;
workFactor = 30;
deleteOutputOnInterrupt = False;
exitValue = 0;
i = j = 0; /* avoid bogus warning from egcs-1.1.X */
/*-- Set up signal handlers for mem access errors --*/
signal (SIGSEGV, mySIGSEGVorSIGBUScatcher);
# if BZ_UNIX
# ifndef __DJGPP__
signal (SIGBUS, mySIGSEGVorSIGBUScatcher);
# endif
# endif
copyFileName ( inName, "(none)" );
copyFileName ( outName, "(none)" );
copyFileName ( progNameReally, argv[0] );
progName = &progNameReally[0];
for (tmp = &progNameReally[0]; *tmp != '\0'; tmp++)
if (*tmp == PATH_SEP) progName = tmp + 1;
/*-- Copy flags from env var BZIP2, and
expand filename wildcards in arg list.
--*/
argList = NULL;
addFlagsFromEnvVar ( &argList, "BZIP2" );
addFlagsFromEnvVar ( &argList, "BZIP" );
for (i = 1; i <= argc-1; i++)
APPEND_FILESPEC(argList, argv[i]);
/*-- Find the length of the longest filename --*/
longestFileName = 7;
numFileNames = 0;
decode = True;
for (aa = argList; aa != NULL; aa = aa->link) {
if (ISFLAG("--")) { decode = False; continue; }
if (aa->name[0] == '-' && decode) continue;
numFileNames++;
if (longestFileName < (Int32)strlen(aa->name) )
longestFileName = (Int32)strlen(aa->name);
}
/*-- Determine source modes; flag handling may change this too. --*/
if (numFileNames == 0)
srcMode = SM_I2O; else srcMode = SM_F2F;
/*-- Determine what to do (compress/uncompress/test/cat). --*/
/*-- Note that subsequent flag handling may change this. --*/
opMode = OM_Z;
if ( (strstr ( progName, "unzip" ) != 0) ||
(strstr ( progName, "UNZIP" ) != 0) )
opMode = OM_UNZ;
if ( (strstr ( progName, "z2cat" ) != 0) ||
(strstr ( progName, "Z2CAT" ) != 0) ||
(strstr ( progName, "zcat" ) != 0) ||
(strstr ( progName, "ZCAT" ) != 0) ) {
opMode = OM_UNZ;
srcMode = (numFileNames == 0) ? SM_I2O : SM_F2O;
}
/*-- Look at the flags. --*/
for (aa = argList; aa != NULL; aa = aa->link) {
if (ISFLAG("--")) break;
if (aa->name[0] == '-' && aa->name[1] != '-') {
for (j = 1; aa->name[j] != '\0'; j++) {
switch (aa->name[j]) {
case 'c': srcMode = SM_F2O; break;
case 'd': opMode = OM_UNZ; break;
case 'z': opMode = OM_Z; break;
case 'f': forceOverwrite = True; break;
case 't': opMode = OM_TEST; break;
case 'k': keepInputFiles = True; break;
case 's': smallMode = True; break;
case 'q': noisy = False; break;
case '1': blockSize100k = 1; break;
case '2': blockSize100k = 2; break;
case '3': blockSize100k = 3; break;
case '4': blockSize100k = 4; break;
case '5': blockSize100k = 5; break;
case '6': blockSize100k = 6; break;
case '7': blockSize100k = 7; break;
case '8': blockSize100k = 8; break;
case '9': blockSize100k = 9; break;
case 'V':
case 'L': license(); break;
case 'v': verbosity++; break;
case 'h': usage ( progName );
exit ( 0 );
break;
default: fprintf ( stderr, "%s: Bad flag `%s'\n",
progName, aa->name );
usage ( progName );
exit ( 1 );
break;
}
}
}
}
/*-- And again ... --*/
for (aa = argList; aa != NULL; aa = aa->link) {
if (ISFLAG("--")) break;
if (ISFLAG("--stdout")) srcMode = SM_F2O; else
if (ISFLAG("--decompress")) opMode = OM_UNZ; else
if (ISFLAG("--compress")) opMode = OM_Z; else
if (ISFLAG("--force")) forceOverwrite = True; else
if (ISFLAG("--test")) opMode = OM_TEST; else
if (ISFLAG("--keep")) keepInputFiles = True; else
if (ISFLAG("--small")) smallMode = True; else
if (ISFLAG("--quiet")) noisy = False; else
if (ISFLAG("--version")) license(); else
if (ISFLAG("--license")) license(); else
if (ISFLAG("--exponential")) workFactor = 1; else
if (ISFLAG("--repetitive-best")) redundant(aa->name); else
if (ISFLAG("--repetitive-fast")) redundant(aa->name); else
if (ISFLAG("--fast")) blockSize100k = 1; else
if (ISFLAG("--best")) blockSize100k = 9; else
if (ISFLAG("--verbose")) verbosity++; else
if (ISFLAG("--help")) { usage ( progName ); exit ( 0 ); }
else
if (strncmp ( aa->name, "--", 2) == 0) {
fprintf ( stderr, "%s: Bad flag `%s'\n", progName, aa->name );
usage ( progName );
exit ( 1 );
}
}
if (verbosity > 4) verbosity = 4;
if (opMode == OM_Z && smallMode && blockSize100k > 2)
blockSize100k = 2;
if (opMode == OM_TEST && srcMode == SM_F2O) {
fprintf ( stderr, "%s: -c and -t cannot be used together.\n",
progName );
exit ( 1 );
}
if (srcMode == SM_F2O && numFileNames == 0)
srcMode = SM_I2O;
if (opMode != OM_Z) blockSize100k = 0;
if (srcMode == SM_F2F) {
signal (SIGINT, mySignalCatcher);
signal (SIGTERM, mySignalCatcher);
# if BZ_UNIX
signal (SIGHUP, mySignalCatcher);
# endif
}
if (opMode == OM_Z) {
if (srcMode == SM_I2O) {
compress ( NULL );
} else {
decode = True;
for (aa = argList; aa != NULL; aa = aa->link) {
if (ISFLAG("--")) { decode = False; continue; }
if (aa->name[0] == '-' && decode) continue;
numFilesProcessed++;
compress ( aa->name );
}
}
}
else
if (opMode == OM_UNZ) {
unzFailsExist = False;
if (srcMode == SM_I2O) {
uncompress ( NULL );
} else {
decode = True;
for (aa = argList; aa != NULL; aa = aa->link) {
if (ISFLAG("--")) { decode = False; continue; }
if (aa->name[0] == '-' && decode) continue;
numFilesProcessed++;
uncompress ( aa->name );
}
}
if (unzFailsExist) {
setExit(2);
exit(exitValue);
}
}
else {
testFailsExist = False;
if (srcMode == SM_I2O) {
testf ( NULL );
} else {
decode = True;
for (aa = argList; aa != NULL; aa = aa->link) {
if (ISFLAG("--")) { decode = False; continue; }
if (aa->name[0] == '-' && decode) continue;
numFilesProcessed++;
testf ( aa->name );
}
}
if (testFailsExist && noisy) {
fprintf ( stderr,
"\n"
"You can use the `bzip2recover' program to attempt to recover\n"
"data from undamaged sections of corrupted files.\n\n"
);
setExit(2);
exit(exitValue);
}
}
/* Free the argument list memory to mollify leak detectors
(eg) Purify, Checker. Serves no other useful purpose.
*/
aa = argList;
while (aa != NULL) {
Cell* aa2 = aa->link;
if (aa->name != NULL) free(aa->name);
free(aa);
aa = aa2;
}
return exitValue;
}
/*-----------------------------------------------------------*/
/*--- end bzip2.c ---*/
/*-----------------------------------------------------------*/
|
Added work/src/bzip2-1.0.2/bzip2.txt.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
|
NAME
bzip2, bunzip2 - a block-sorting file compressor, v1.0.2
bzcat - decompresses files to stdout
bzip2recover - recovers data from damaged bzip2 files
SYNOPSIS
bzip2 [ -cdfkqstvzVL123456789 ] [ filenames ... ]
bunzip2 [ -fkvsVL ] [ filenames ... ]
bzcat [ -s ] [ filenames ... ]
bzip2recover filename
DESCRIPTION
bzip2 compresses files using the Burrows-Wheeler block
sorting text compression algorithm, and Huffman coding.
Compression is generally considerably better than that
achieved by more conventional LZ77/LZ78-based compressors,
and approaches the performance of the PPM family of sta
tistical compressors.
The command-line options are deliberately very similar to
those of GNU gzip, but they are not identical.
bzip2 expects a list of file names to accompany the com
mand-line flags. Each file is replaced by a compressed
version of itself, with the name "original_name.bz2".
Each compressed file has the same modification date, per
missions, and, when possible, ownership as the correspond
ing original, so that these properties can be correctly
restored at decompression time. File name handling is
naive in the sense that there is no mechanism for preserv
ing original file names, permissions, ownerships or dates
in filesystems which lack these concepts, or have serious
file name length restrictions, such as MS-DOS.
bzip2 and bunzip2 will by default not overwrite existing
files. If you want this to happen, specify the -f flag.
If no file names are specified, bzip2 compresses from
standard input to standard output. In this case, bzip2
will decline to write compressed output to a terminal, as
this would be entirely incomprehensible and therefore
pointless.
bunzip2 (or bzip2 -d) decompresses all specified files.
Files which were not created by bzip2 will be detected and
ignored, and a warning issued. bzip2 attempts to guess
the filename for the decompressed file from that of the
compressed file as follows:
filename.bz2 becomes filename
filename.bz becomes filename
filename.tbz2 becomes filename.tar
filename.tbz becomes filename.tar
anyothername becomes anyothername.out
If the file does not end in one of the recognised endings,
.bz2, .bz, .tbz2 or .tbz, bzip2 complains that it cannot
guess the name of the original file, and uses the original
name with .out appended.
As with compression, supplying no filenames causes decom
pression from standard input to standard output.
bunzip2 will correctly decompress a file which is the con
catenation of two or more compressed files. The result is
the concatenation of the corresponding uncompressed files.
Integrity testing (-t) of concatenated compressed files is
also supported.
You can also compress or decompress files to the standard
output by giving the -c flag. Multiple files may be com
pressed and decompressed like this. The resulting outputs
are fed sequentially to stdout. Compression of multiple
files in this manner generates a stream containing multi
ple compressed file representations. Such a stream can be
decompressed correctly only by bzip2 version 0.9.0 or
later. Earlier versions of bzip2 will stop after decom
pressing the first file in the stream.
bzcat (or bzip2 -dc) decompresses all specified files to
the standard output.
bzip2 will read arguments from the environment variables
BZIP2 and BZIP, in that order, and will process them
before any arguments read from the command line. This
gives a convenient way to supply default arguments.
Compression is always performed, even if the compressed
file is slightly larger than the original. Files of less
than about one hundred bytes tend to get larger, since the
compression mechanism has a constant overhead in the
region of 50 bytes. Random data (including the output of
most file compressors) is coded at about 8.05 bits per
byte, giving an expansion of around 0.5%.
As a self-check for your protection, bzip2 uses 32-bit
CRCs to make sure that the decompressed version of a file
is identical to the original. This guards against corrup
tion of the compressed data, and against undetected bugs
in bzip2 (hopefully very unlikely). The chances of data
corruption going undetected is microscopic, about one
chance in four billion for each file processed. Be aware,
though, that the check occurs upon decompression, so it
can only tell you that something is wrong. It can't help
you recover the original uncompressed data. You can use
bzip2recover to try to recover data from damaged files.
Return values: 0 for a normal exit, 1 for environmental
problems (file not found, invalid flags, I/O errors, &c),
2 to indicate a corrupt compressed file, 3 for an internal
consistency error (eg, bug) which caused bzip2 to panic.
OPTIONS
-c --stdout
Compress or decompress to standard output.
-d --decompress
Force decompression. bzip2, bunzip2 and bzcat are
really the same program, and the decision about
what actions to take is done on the basis of which
name is used. This flag overrides that mechanism,
and forces bzip2 to decompress.
-z --compress
The complement to -d: forces compression,
regardless of the invocation name.
-t --test
Check integrity of the specified file(s), but don't
decompress them. This really performs a trial
decompression and throws away the result.
-f --force
Force overwrite of output files. Normally, bzip2
will not overwrite existing output files. Also
forces bzip2 to break hard links to files, which it
otherwise wouldn't do.
bzip2 normally declines to decompress files which
don't have the correct magic header bytes. If
forced (-f), however, it will pass such files
through unmodified. This is how GNU gzip behaves.
-k --keep
Keep (don't delete) input files during compression
or decompression.
-s --small
Reduce memory usage, for compression, decompression
and testing. Files are decompressed and tested
using a modified algorithm which only requires 2.5
bytes per block byte. This means any file can be
decompressed in 2300k of memory, albeit at about
half the normal speed.
During compression, -s selects a block size of
200k, which limits memory use to around the same
figure, at the expense of your compression ratio.
In short, if your machine is low on memory (8
megabytes or less), use -s for everything. See
MEMORY MANAGEMENT below.
-q --quiet
Suppress non-essential warning messages. Messages
pertaining to I/O errors and other critical events
will not be suppressed.
-v --verbose
Verbose mode -- show the compression ratio for each
file processed. Further -v's increase the ver
bosity level, spewing out lots of information which
is primarily of interest for diagnostic purposes.
-L --license -V --version
Display the software version, license terms and
conditions.
-1 (or --fast) to -9 (or --best)
Set the block size to 100 k, 200 k .. 900 k when
compressing. Has no effect when decompressing.
See MEMORY MANAGEMENT below. The --fast and --best
aliases are primarily for GNU gzip compatibility.
In particular, --fast doesn't make things signifi
cantly faster. And --best merely selects the
default behaviour.
-- Treats all subsequent arguments as file names, even
if they start with a dash. This is so you can han
dle files with names beginning with a dash, for
example: bzip2 -- -myfilename.
--repetitive-fast --repetitive-best
These flags are redundant in versions 0.9.5 and
above. They provided some coarse control over the
behaviour of the sorting algorithm in earlier ver
sions, which was sometimes useful. 0.9.5 and above
have an improved algorithm which renders these
flags irrelevant.
MEMORY MANAGEMENT
bzip2 compresses large files in blocks. The block size
affects both the compression ratio achieved, and the
amount of memory needed for compression and decompression.
The flags -1 through -9 specify the block size to be
100,000 bytes through 900,000 bytes (the default) respec
tively. At decompression time, the block size used for
compression is read from the header of the compressed
file, and bunzip2 then allocates itself just enough memory
to decompress the file. Since block sizes are stored in
compressed files, it follows that the flags -1 to -9 are
irrelevant to and so ignored during decompression.
Compression and decompression requirements, in bytes, can
be estimated as:
Compression: 400k + ( 8 x block size )
Decompression: 100k + ( 4 x block size ), or
100k + ( 2.5 x block size )
Larger block sizes give rapidly diminishing marginal
returns. Most of the compression comes from the first two
or three hundred k of block size, a fact worth bearing in
mind when using bzip2 on small machines. It is also
important to appreciate that the decompression memory
requirement is set at compression time by the choice of
block size.
For files compressed with the default 900k block size,
bunzip2 will require about 3700 kbytes to decompress. To
support decompression of any file on a 4 megabyte machine,
bunzip2 has an option to decompress using approximately
half this amount of memory, about 2300 kbytes. Decompres
sion speed is also halved, so you should use this option
only where necessary. The relevant flag is -s.
In general, try and use the largest block size memory con
straints allow, since that maximises the compression
achieved. Compression and decompression speed are virtu
ally unaffected by block size.
Another significant point applies to files which fit in a
single block -- that means most files you'd encounter
using a large block size. The amount of real memory
touched is proportional to the size of the file, since the
file is smaller than a block. For example, compressing a
file 20,000 bytes long with the flag -9 will cause the
compressor to allocate around 7600k of memory, but only
touch 400k + 20000 * 8 = 560 kbytes of it. Similarly, the
decompressor will allocate 3700k but only touch 100k +
20000 * 4 = 180 kbytes.
Here is a table which summarises the maximum memory usage
for different block sizes. Also recorded is the total
compressed size for 14 files of the Calgary Text Compres
sion Corpus totalling 3,141,622 bytes. This column gives
some feel for how compression varies with block size.
These figures tend to understate the advantage of larger
block sizes for larger files, since the Corpus is domi
nated by smaller files.
Compress Decompress Decompress Corpus
Flag usage usage -s usage Size
-1 1200k 500k 350k 914704
-2 2000k 900k 600k 877703
-3 2800k 1300k 850k 860338
-4 3600k 1700k 1100k 846899
-5 4400k 2100k 1350k 845160
-6 5200k 2500k 1600k 838626
-7 6100k 2900k 1850k 834096
-8 6800k 3300k 2100k 828642
-9 7600k 3700k 2350k 828642
RECOVERING DATA FROM DAMAGED FILES
bzip2 compresses files in blocks, usually 900kbytes long.
Each block is handled independently. If a media or trans
mission error causes a multi-block .bz2 file to become
damaged, it may be possible to recover data from the
undamaged blocks in the file.
The compressed representation of each block is delimited
by a 48-bit pattern, which makes it possible to find the
block boundaries with reasonable certainty. Each block
also carries its own 32-bit CRC, so damaged blocks can be
distinguished from undamaged ones.
bzip2recover is a simple program whose purpose is to
search for blocks in .bz2 files, and write each block out
into its own .bz2 file. You can then use bzip2 -t to test
the integrity of the resulting files, and decompress those
which are undamaged.
bzip2recover takes a single argument, the name of the dam
aged file, and writes a number of files
"rec00001file.bz2", "rec00002file.bz2", etc, containing
the extracted blocks. The output filenames are
designed so that the use of wildcards in subsequent pro
cessing -- for example, "bzip2 -dc rec*file.bz2 > recov
ered_data" -- processes the files in the correct order.
bzip2recover should be of most use dealing with large .bz2
files, as these will contain many blocks. It is clearly
futile to use it on damaged single-block files, since a
damaged block cannot be recovered. If you wish to min
imise any potential data loss through media or transmis
sion errors, you might consider compressing with a smaller
block size.
PERFORMANCE NOTES
The sorting phase of compression gathers together similar
strings in the file. Because of this, files containing
very long runs of repeated symbols, like "aabaabaabaab
..." (repeated several hundred times) may compress more
slowly than normal. Versions 0.9.5 and above fare much
better than previous versions in this respect. The ratio
between worst-case and average-case compression time is in
the region of 10:1. For previous versions, this figure
was more like 100:1. You can use the -vvvv option to mon
itor progress in great detail, if you want.
Decompression speed is unaffected by these phenomena.
bzip2 usually allocates several megabytes of memory to
operate in, and then charges all over it in a fairly ran
dom fashion. This means that performance, both for com
pressing and decompressing, is largely determined by the
speed at which your machine can service cache misses.
Because of this, small changes to the code to reduce the
miss rate have been observed to give disproportionately
large performance improvements. I imagine bzip2 will per
form best on machines with very large caches.
CAVEATS
I/O error messages are not as helpful as they could be.
bzip2 tries hard to detect I/O errors and exit cleanly,
but the details of what the problem is sometimes seem
rather misleading.
This manual page pertains to version 1.0.2 of bzip2. Com
pressed data created by this version is entirely forwards
and backwards compatible with the previous public
releases, versions 0.1pl2, 0.9.0, 0.9.5, 1.0.0 and 1.0.1,
but with the following exception: 0.9.0 and above can cor
rectly decompress multiple concatenated compressed files.
0.1pl2 cannot do this; it will stop after decompressing
just the first file in the stream.
bzip2recover versions prior to this one, 1.0.2, used
32-bit integers to represent bit positions in compressed
files, so it could not handle compressed files more than
512 megabytes long. Version 1.0.2 and above uses 64-bit
ints on some platforms which support them (GNU supported
targets, and Windows). To establish whether or not
bzip2recover was built with such a limitation, run it
without arguments. In any event you can build yourself an
unlimited version if you can recompile it with MaybeUInt64
set to be an unsigned 64-bit integer.
AUTHOR
Julian Seward, jseward@acm.org.
http://sources.redhat.com/bzip2
The ideas embodied in bzip2 are due to (at least) the fol
lowing people: Michael Burrows and David Wheeler (for the
block sorting transformation), David Wheeler (again, for
the Huffman coder), Peter Fenwick (for the structured cod
ing model in the original bzip, and many refinements), and
Alistair Moffat, Radford Neal and Ian Witten (for the
arithmetic coder in the original bzip). I am much
indebted for their help, support and advice. See the man
ual in the source distribution for pointers to sources of
documentation. Christian von Roques encouraged me to look
for faster sorting algorithms, so as to speed up compres
sion. Bela Lubkin encouraged me to improve the worst-case
compression performance. The bz* scripts are derived from
those of GNU gzip. Many people sent patches, helped with
portability problems, lent machines, gave advice and were
generally helpful.
|
Added work/src/bzip2-1.0.2/bzip2recover.
cannot compute difference between binary files
Added work/src/bzip2-1.0.2/bzip2recover.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
|
/*-----------------------------------------------------------*/
/*--- Block recoverer program for bzip2 ---*/
/*--- bzip2recover.c ---*/
/*-----------------------------------------------------------*/
/*--
This program is bzip2recover, a program to attempt data
salvage from damaged files created by the accompanying
bzip2-1.0 program.
Copyright (C) 1996-2002 Julian R Seward. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.
3. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
4. The name of the author may not be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Julian Seward, Cambridge, UK.
jseward@acm.org
bzip2/libbzip2 version 1.0 of 21 March 2000
--*/
/*--
This program is a complete hack and should be rewritten
properly. It isn't very complicated.
--*/
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
/* This program records bit locations in the file to be recovered.
That means that if 64-bit ints are not supported, we will not
be able to recover .bz2 files over 512MB (2^32 bits) long.
On GNU supported platforms, we take advantage of the 64-bit
int support to circumvent this problem. Ditto MSVC.
This change occurred in version 1.0.2; all prior versions have
the 512MB limitation.
*/
#ifdef __GNUC__
typedef unsigned long long int MaybeUInt64;
# define MaybeUInt64_FMT "%Lu"
#else
#ifdef _MSC_VER
typedef unsigned __int64 MaybeUInt64;
# define MaybeUInt64_FMT "%I64u"
#else
typedef unsigned int MaybeUInt64;
# define MaybeUInt64_FMT "%u"
#endif
#endif
typedef unsigned int UInt32;
typedef int Int32;
typedef unsigned char UChar;
typedef char Char;
typedef unsigned char Bool;
#define True ((Bool)1)
#define False ((Bool)0)
#define BZ_MAX_FILENAME 2000
Char inFileName[BZ_MAX_FILENAME];
Char outFileName[BZ_MAX_FILENAME];
Char progName[BZ_MAX_FILENAME];
MaybeUInt64 bytesOut = 0;
MaybeUInt64 bytesIn = 0;
/*---------------------------------------------------*/
/*--- Header bytes ---*/
/*---------------------------------------------------*/
#define BZ_HDR_B 0x42 /* 'B' */
#define BZ_HDR_Z 0x5a /* 'Z' */
#define BZ_HDR_h 0x68 /* 'h' */
#define BZ_HDR_0 0x30 /* '0' */
/*---------------------------------------------------*/
/*--- I/O errors ---*/
/*---------------------------------------------------*/
/*---------------------------------------------*/
void readError ( void )
{
fprintf ( stderr,
"%s: I/O error reading `%s', possible reason follows.\n",
progName, inFileName );
perror ( progName );
fprintf ( stderr, "%s: warning: output file(s) may be incomplete.\n",
progName );
exit ( 1 );
}
/*---------------------------------------------*/
void writeError ( void )
{
fprintf ( stderr,
"%s: I/O error reading `%s', possible reason follows.\n",
progName, inFileName );
perror ( progName );
fprintf ( stderr, "%s: warning: output file(s) may be incomplete.\n",
progName );
exit ( 1 );
}
/*---------------------------------------------*/
void mallocFail ( Int32 n )
{
fprintf ( stderr,
"%s: malloc failed on request for %d bytes.\n",
progName, n );
fprintf ( stderr, "%s: warning: output file(s) may be incomplete.\n",
progName );
exit ( 1 );
}
/*---------------------------------------------*/
void tooManyBlocks ( Int32 max_handled_blocks )
{
fprintf ( stderr,
"%s: `%s' appears to contain more than %d blocks\n",
progName, inFileName, max_handled_blocks );
fprintf ( stderr,
"%s: and cannot be handled. To fix, increase\n",
progName );
fprintf ( stderr,
"%s: BZ_MAX_HANDLED_BLOCKS in bzip2recover.c, and recompile.\n",
progName );
exit ( 1 );
}
/*---------------------------------------------------*/
/*--- Bit stream I/O ---*/
/*---------------------------------------------------*/
typedef
struct {
FILE* handle;
Int32 buffer;
Int32 buffLive;
Char mode;
}
BitStream;
/*---------------------------------------------*/
BitStream* bsOpenReadStream ( FILE* stream )
{
BitStream *bs = malloc ( sizeof(BitStream) );
if (bs == NULL) mallocFail ( sizeof(BitStream) );
bs->handle = stream;
bs->buffer = 0;
bs->buffLive = 0;
bs->mode = 'r';
return bs;
}
/*---------------------------------------------*/
BitStream* bsOpenWriteStream ( FILE* stream )
{
BitStream *bs = malloc ( sizeof(BitStream) );
if (bs == NULL) mallocFail ( sizeof(BitStream) );
bs->handle = stream;
bs->buffer = 0;
bs->buffLive = 0;
bs->mode = 'w';
return bs;
}
/*---------------------------------------------*/
void bsPutBit ( BitStream* bs, Int32 bit )
{
if (bs->buffLive == 8) {
Int32 retVal = putc ( (UChar) bs->buffer, bs->handle );
if (retVal == EOF) writeError();
bytesOut++;
bs->buffLive = 1;
bs->buffer = bit & 0x1;
} else {
bs->buffer = ( (bs->buffer << 1) | (bit & 0x1) );
bs->buffLive++;
};
}
/*---------------------------------------------*/
/*--
Returns 0 or 1, or 2 to indicate EOF.
--*/
Int32 bsGetBit ( BitStream* bs )
{
if (bs->buffLive > 0) {
bs->buffLive --;
return ( ((bs->buffer) >> (bs->buffLive)) & 0x1 );
} else {
Int32 retVal = getc ( bs->handle );
if ( retVal == EOF ) {
if (errno != 0) readError();
return 2;
}
bs->buffLive = 7;
bs->buffer = retVal;
return ( ((bs->buffer) >> 7) & 0x1 );
}
}
/*---------------------------------------------*/
void bsClose ( BitStream* bs )
{
Int32 retVal;
if ( bs->mode == 'w' ) {
while ( bs->buffLive < 8 ) {
bs->buffLive++;
bs->buffer <<= 1;
};
retVal = putc ( (UChar) (bs->buffer), bs->handle );
if (retVal == EOF) writeError();
bytesOut++;
retVal = fflush ( bs->handle );
if (retVal == EOF) writeError();
}
retVal = fclose ( bs->handle );
if (retVal == EOF) {
if (bs->mode == 'w') writeError(); else readError();
}
free ( bs );
}
/*---------------------------------------------*/
void bsPutUChar ( BitStream* bs, UChar c )
{
Int32 i;
for (i = 7; i >= 0; i--)
bsPutBit ( bs, (((UInt32) c) >> i) & 0x1 );
}
/*---------------------------------------------*/
void bsPutUInt32 ( BitStream* bs, UInt32 c )
{
Int32 i;
for (i = 31; i >= 0; i--)
bsPutBit ( bs, (c >> i) & 0x1 );
}
/*---------------------------------------------*/
Bool endsInBz2 ( Char* name )
{
Int32 n = strlen ( name );
if (n <= 4) return False;
return
(name[n-4] == '.' &&
name[n-3] == 'b' &&
name[n-2] == 'z' &&
name[n-1] == '2');
}
/*---------------------------------------------------*/
/*--- ---*/
/*---------------------------------------------------*/
/* This logic isn't really right when it comes to Cygwin. */
#ifdef _WIN32
# define BZ_SPLIT_SYM '\\' /* path splitter on Windows platform */
#else
# define BZ_SPLIT_SYM '/' /* path splitter on Unix platform */
#endif
#define BLOCK_HEADER_HI 0x00003141UL
#define BLOCK_HEADER_LO 0x59265359UL
#define BLOCK_ENDMARK_HI 0x00001772UL
#define BLOCK_ENDMARK_LO 0x45385090UL
/* Increase if necessary. However, a .bz2 file with > 50000 blocks
would have an uncompressed size of at least 40GB, so the chances
are low you'll need to up this.
*/
#define BZ_MAX_HANDLED_BLOCKS 50000
MaybeUInt64 bStart [BZ_MAX_HANDLED_BLOCKS];
MaybeUInt64 bEnd [BZ_MAX_HANDLED_BLOCKS];
MaybeUInt64 rbStart[BZ_MAX_HANDLED_BLOCKS];
MaybeUInt64 rbEnd [BZ_MAX_HANDLED_BLOCKS];
Int32 main ( Int32 argc, Char** argv )
{
FILE* inFile;
FILE* outFile;
BitStream* bsIn, *bsWr;
Int32 b, wrBlock, currBlock, rbCtr;
MaybeUInt64 bitsRead;
UInt32 buffHi, buffLo, blockCRC;
Char* p;
strcpy ( progName, argv[0] );
inFileName[0] = outFileName[0] = 0;
fprintf ( stderr,
"bzip2recover 1.0.2: extracts blocks from damaged .bz2 files.\n" );
if (argc != 2) {
fprintf ( stderr, "%s: usage is `%s damaged_file_name'.\n",
progName, progName );
switch (sizeof(MaybeUInt64)) {
case 8:
fprintf(stderr,
"\trestrictions on size of recovered file: None\n");
break;
case 4:
fprintf(stderr,
"\trestrictions on size of recovered file: 512 MB\n");
fprintf(stderr,
"\tto circumvent, recompile with MaybeUInt64 as an\n"
"\tunsigned 64-bit int.\n");
break;
default:
fprintf(stderr,
"\tsizeof(MaybeUInt64) is not 4 or 8 -- "
"configuration error.\n");
break;
}
exit(1);
}
if (strlen(argv[1]) >= BZ_MAX_FILENAME-20) {
fprintf ( stderr,
"%s: supplied filename is suspiciously (>= %d chars) long. Bye!\n",
progName, strlen(argv[1]) );
exit(1);
}
strcpy ( inFileName, argv[1] );
inFile = fopen ( inFileName, "rb" );
if (inFile == NULL) {
fprintf ( stderr, "%s: can't read `%s'\n", progName, inFileName );
exit(1);
}
bsIn = bsOpenReadStream ( inFile );
fprintf ( stderr, "%s: searching for block boundaries ...\n", progName );
bitsRead = 0;
buffHi = buffLo = 0;
currBlock = 0;
bStart[currBlock] = 0;
rbCtr = 0;
while (True) {
b = bsGetBit ( bsIn );
bitsRead++;
if (b == 2) {
if (bitsRead >= bStart[currBlock] &&
(bitsRead - bStart[currBlock]) >= 40) {
bEnd[currBlock] = bitsRead-1;
if (currBlock > 0)
fprintf ( stderr, " block %d runs from " MaybeUInt64_FMT
" to " MaybeUInt64_FMT " (incomplete)\n",
currBlock, bStart[currBlock], bEnd[currBlock] );
} else
currBlock--;
break;
}
buffHi = (buffHi << 1) | (buffLo >> 31);
buffLo = (buffLo << 1) | (b & 1);
if ( ( (buffHi & 0x0000ffff) == BLOCK_HEADER_HI
&& buffLo == BLOCK_HEADER_LO)
||
( (buffHi & 0x0000ffff) == BLOCK_ENDMARK_HI
&& buffLo == BLOCK_ENDMARK_LO)
) {
if (bitsRead > 49) {
bEnd[currBlock] = bitsRead-49;
} else {
bEnd[currBlock] = 0;
}
if (currBlock > 0 &&
(bEnd[currBlock] - bStart[currBlock]) >= 130) {
fprintf ( stderr, " block %d runs from " MaybeUInt64_FMT
" to " MaybeUInt64_FMT "\n",
rbCtr+1, bStart[currBlock], bEnd[currBlock] );
rbStart[rbCtr] = bStart[currBlock];
rbEnd[rbCtr] = bEnd[currBlock];
rbCtr++;
}
if (currBlock >= BZ_MAX_HANDLED_BLOCKS)
tooManyBlocks(BZ_MAX_HANDLED_BLOCKS);
currBlock++;
bStart[currBlock] = bitsRead;
}
}
bsClose ( bsIn );
/*-- identified blocks run from 1 to rbCtr inclusive. --*/
if (rbCtr < 1) {
fprintf ( stderr,
"%s: sorry, I couldn't find any block boundaries.\n",
progName );
exit(1);
};
fprintf ( stderr, "%s: splitting into blocks\n", progName );
inFile = fopen ( inFileName, "rb" );
if (inFile == NULL) {
fprintf ( stderr, "%s: can't open `%s'\n", progName, inFileName );
exit(1);
}
bsIn = bsOpenReadStream ( inFile );
/*-- placate gcc's dataflow analyser --*/
blockCRC = 0; bsWr = 0;
bitsRead = 0;
outFile = NULL;
wrBlock = 0;
while (True) {
b = bsGetBit(bsIn);
if (b == 2) break;
buffHi = (buffHi << 1) | (buffLo >> 31);
buffLo = (buffLo << 1) | (b & 1);
if (bitsRead == 47+rbStart[wrBlock])
blockCRC = (buffHi << 16) | (buffLo >> 16);
if (outFile != NULL && bitsRead >= rbStart[wrBlock]
&& bitsRead <= rbEnd[wrBlock]) {
bsPutBit ( bsWr, b );
}
bitsRead++;
if (bitsRead == rbEnd[wrBlock]+1) {
if (outFile != NULL) {
bsPutUChar ( bsWr, 0x17 ); bsPutUChar ( bsWr, 0x72 );
bsPutUChar ( bsWr, 0x45 ); bsPutUChar ( bsWr, 0x38 );
bsPutUChar ( bsWr, 0x50 ); bsPutUChar ( bsWr, 0x90 );
bsPutUInt32 ( bsWr, blockCRC );
bsClose ( bsWr );
}
if (wrBlock >= rbCtr) break;
wrBlock++;
} else
if (bitsRead == rbStart[wrBlock]) {
/* Create the output file name, correctly handling leading paths.
(31.10.2001 by Sergey E. Kusikov) */
Char* split;
Int32 ofs, k;
for (k = 0; k < BZ_MAX_FILENAME; k++)
outFileName[k] = 0;
strcpy (outFileName, inFileName);
split = strrchr (outFileName, BZ_SPLIT_SYM);
if (split == NULL) {
split = outFileName;
} else {
++split;
}
/* Now split points to the start of the basename. */
ofs = split - outFileName;
sprintf (split, "rec%5d", wrBlock+1);
for (p = split; *p != 0; p++) if (*p == ' ') *p = '0';
strcat (outFileName, inFileName + ofs);
if ( !endsInBz2(outFileName)) strcat ( outFileName, ".bz2" );
fprintf ( stderr, " writing block %d to `%s' ...\n",
wrBlock+1, outFileName );
outFile = fopen ( outFileName, "wb" );
if (outFile == NULL) {
fprintf ( stderr, "%s: can't write `%s'\n",
progName, outFileName );
exit(1);
}
bsWr = bsOpenWriteStream ( outFile );
bsPutUChar ( bsWr, BZ_HDR_B );
bsPutUChar ( bsWr, BZ_HDR_Z );
bsPutUChar ( bsWr, BZ_HDR_h );
bsPutUChar ( bsWr, BZ_HDR_0 + 9 );
bsPutUChar ( bsWr, 0x31 ); bsPutUChar ( bsWr, 0x41 );
bsPutUChar ( bsWr, 0x59 ); bsPutUChar ( bsWr, 0x26 );
bsPutUChar ( bsWr, 0x53 ); bsPutUChar ( bsWr, 0x59 );
}
}
fprintf ( stderr, "%s: finished\n", progName );
return 0;
}
/*-----------------------------------------------------------*/
/*--- end bzip2recover.c ---*/
/*-----------------------------------------------------------*/
|
Added work/src/bzip2-1.0.2/bzlib.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
|
/*-------------------------------------------------------------*/
/*--- Library top-level functions. ---*/
/*--- bzlib.c ---*/
/*-------------------------------------------------------------*/
/*--
This file is a part of bzip2 and/or libbzip2, a program and
library for lossless, block-sorting data compression.
Copyright (C) 1996-2002 Julian R Seward. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.
3. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
4. The name of the author may not be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Julian Seward, Cambridge, UK.
jseward@acm.org
bzip2/libbzip2 version 1.0 of 21 March 2000
This program is based on (at least) the work of:
Mike Burrows
David Wheeler
Peter Fenwick
Alistair Moffat
Radford Neal
Ian H. Witten
Robert Sedgewick
Jon L. Bentley
For more information on these sources, see the manual.
--*/
/*--
CHANGES
~~~~~~~
0.9.0 -- original version.
0.9.0a/b -- no changes in this file.
0.9.0c
* made zero-length BZ_FLUSH work correctly in bzCompress().
* fixed bzWrite/bzRead to ignore zero-length requests.
* fixed bzread to correctly handle read requests after EOF.
* wrong parameter order in call to bzDecompressInit in
bzBuffToBuffDecompress. Fixed.
--*/
#include "bzlib_private.h"
/*---------------------------------------------------*/
/*--- Compression stuff ---*/
/*---------------------------------------------------*/
/*---------------------------------------------------*/
#ifndef BZ_NO_STDIO
void BZ2_bz__AssertH__fail ( int errcode )
{
fprintf(stderr,
"\n\nbzip2/libbzip2: internal error number %d.\n"
"This is a bug in bzip2/libbzip2, %s.\n"
"Please report it to me at: jseward@acm.org. If this happened\n"
"when you were using some program which uses libbzip2 as a\n"
"component, you should also report this bug to the author(s)\n"
"of that program. Please make an effort to report this bug;\n"
"timely and accurate bug reports eventually lead to higher\n"
"quality software. Thanks. Julian Seward, 30 December 2001.\n\n",
errcode,
BZ2_bzlibVersion()
);
if (errcode == 1007) {
fprintf(stderr,
"\n*** A special note about internal error number 1007 ***\n"
"\n"
"Experience suggests that a common cause of i.e. 1007\n"
"is unreliable memory or other hardware. The 1007 assertion\n"
"just happens to cross-check the results of huge numbers of\n"
"memory reads/writes, and so acts (unintendedly) as a stress\n"
"test of your memory system.\n"
"\n"
"I suggest the following: try compressing the file again,\n"
"possibly monitoring progress in detail with the -vv flag.\n"
"\n"
"* If the error cannot be reproduced, and/or happens at different\n"
" points in compression, you may have a flaky memory system.\n"
" Try a memory-test program. I have used Memtest86\n"
" (www.memtest86.com). At the time of writing it is free (GPLd).\n"
" Memtest86 tests memory much more thorougly than your BIOSs\n"
" power-on test, and may find failures that the BIOS doesn't.\n"
"\n"
"* If the error can be repeatably reproduced, this is a bug in\n"
" bzip2, and I would very much like to hear about it. Please\n"
" let me know, and, ideally, save a copy of the file causing the\n"
" problem -- without which I will be unable to investigate it.\n"
"\n"
);
}
exit(3);
}
#endif
/*---------------------------------------------------*/
static
int bz_config_ok ( void )
{
if (sizeof(int) != 4) return 0;
if (sizeof(short) != 2) return 0;
if (sizeof(char) != 1) return 0;
return 1;
}
/*---------------------------------------------------*/
static
void* default_bzalloc ( void* opaque, Int32 items, Int32 size )
{
void* v = malloc ( items * size );
return v;
}
static
void default_bzfree ( void* opaque, void* addr )
{
if (addr != NULL) free ( addr );
}
/*---------------------------------------------------*/
static
void prepare_new_block ( EState* s )
{
Int32 i;
s->nblock = 0;
s->numZ = 0;
s->state_out_pos = 0;
BZ_INITIALISE_CRC ( s->blockCRC );
for (i = 0; i < 256; i++) s->inUse[i] = False;
s->blockNo++;
}
/*---------------------------------------------------*/
static
void init_RL ( EState* s )
{
s->state_in_ch = 256;
s->state_in_len = 0;
}
static
Bool isempty_RL ( EState* s )
{
if (s->state_in_ch < 256 && s->state_in_len > 0)
return False; else
return True;
}
/*---------------------------------------------------*/
int BZ_API(BZ2_bzCompressInit)
( bz_stream* strm,
int blockSize100k,
int verbosity,
int workFactor )
{
Int32 n;
EState* s;
if (!bz_config_ok()) return BZ_CONFIG_ERROR;
if (strm == NULL ||
blockSize100k < 1 || blockSize100k > 9 ||
workFactor < 0 || workFactor > 250)
return BZ_PARAM_ERROR;
if (workFactor == 0) workFactor = 30;
if (strm->bzalloc == NULL) strm->bzalloc = default_bzalloc;
if (strm->bzfree == NULL) strm->bzfree = default_bzfree;
s = BZALLOC( sizeof(EState) );
if (s == NULL) return BZ_MEM_ERROR;
s->strm = strm;
s->arr1 = NULL;
s->arr2 = NULL;
s->ftab = NULL;
n = 100000 * blockSize100k;
s->arr1 = BZALLOC( n * sizeof(UInt32) );
s->arr2 = BZALLOC( (n+BZ_N_OVERSHOOT) * sizeof(UInt32) );
s->ftab = BZALLOC( 65537 * sizeof(UInt32) );
if (s->arr1 == NULL || s->arr2 == NULL || s->ftab == NULL) {
if (s->arr1 != NULL) BZFREE(s->arr1);
if (s->arr2 != NULL) BZFREE(s->arr2);
if (s->ftab != NULL) BZFREE(s->ftab);
if (s != NULL) BZFREE(s);
return BZ_MEM_ERROR;
}
s->blockNo = 0;
s->state = BZ_S_INPUT;
s->mode = BZ_M_RUNNING;
s->combinedCRC = 0;
s->blockSize100k = blockSize100k;
s->nblockMAX = 100000 * blockSize100k - 19;
s->verbosity = verbosity;
s->workFactor = workFactor;
s->block = (UChar*)s->arr2;
s->mtfv = (UInt16*)s->arr1;
s->zbits = NULL;
s->ptr = (UInt32*)s->arr1;
strm->state = s;
strm->total_in_lo32 = 0;
strm->total_in_hi32 = 0;
strm->total_out_lo32 = 0;
strm->total_out_hi32 = 0;
init_RL ( s );
prepare_new_block ( s );
return BZ_OK;
}
/*---------------------------------------------------*/
static
void add_pair_to_block ( EState* s )
{
Int32 i;
UChar ch = (UChar)(s->state_in_ch);
for (i = 0; i < s->state_in_len; i++) {
BZ_UPDATE_CRC( s->blockCRC, ch );
}
s->inUse[s->state_in_ch] = True;
switch (s->state_in_len) {
case 1:
s->block[s->nblock] = (UChar)ch; s->nblock++;
break;
case 2:
s->block[s->nblock] = (UChar)ch; s->nblock++;
s->block[s->nblock] = (UChar)ch; s->nblock++;
break;
case 3:
s->block[s->nblock] = (UChar)ch; s->nblock++;
s->block[s->nblock] = (UChar)ch; s->nblock++;
s->block[s->nblock] = (UChar)ch; s->nblock++;
break;
default:
s->inUse[s->state_in_len-4] = True;
s->block[s->nblock] = (UChar)ch; s->nblock++;
s->block[s->nblock] = (UChar)ch; s->nblock++;
s->block[s->nblock] = (UChar)ch; s->nblock++;
s->block[s->nblock] = (UChar)ch; s->nblock++;
s->block[s->nblock] = ((UChar)(s->state_in_len-4));
s->nblock++;
break;
}
}
/*---------------------------------------------------*/
static
void flush_RL ( EState* s )
{
if (s->state_in_ch < 256) add_pair_to_block ( s );
init_RL ( s );
}
/*---------------------------------------------------*/
#define ADD_CHAR_TO_BLOCK(zs,zchh0) \
{ \
UInt32 zchh = (UInt32)(zchh0); \
/*-- fast track the common case --*/ \
if (zchh != zs->state_in_ch && \
zs->state_in_len == 1) { \
UChar ch = (UChar)(zs->state_in_ch); \
BZ_UPDATE_CRC( zs->blockCRC, ch ); \
zs->inUse[zs->state_in_ch] = True; \
zs->block[zs->nblock] = (UChar)ch; \
zs->nblock++; \
zs->state_in_ch = zchh; \
} \
else \
/*-- general, uncommon cases --*/ \
if (zchh != zs->state_in_ch || \
zs->state_in_len == 255) { \
if (zs->state_in_ch < 256) \
add_pair_to_block ( zs ); \
zs->state_in_ch = zchh; \
zs->state_in_len = 1; \
} else { \
zs->state_in_len++; \
} \
}
/*---------------------------------------------------*/
static
Bool copy_input_until_stop ( EState* s )
{
Bool progress_in = False;
if (s->mode == BZ_M_RUNNING) {
/*-- fast track the common case --*/
while (True) {
/*-- block full? --*/
if (s->nblock >= s->nblockMAX) break;
/*-- no input? --*/
if (s->strm->avail_in == 0) break;
progress_in = True;
ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) );
s->strm->next_in++;
s->strm->avail_in--;
s->strm->total_in_lo32++;
if (s->strm->total_in_lo32 == 0) s->strm->total_in_hi32++;
}
} else {
/*-- general, uncommon case --*/
while (True) {
/*-- block full? --*/
if (s->nblock >= s->nblockMAX) break;
/*-- no input? --*/
if (s->strm->avail_in == 0) break;
/*-- flush/finish end? --*/
if (s->avail_in_expect == 0) break;
progress_in = True;
ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) );
s->strm->next_in++;
s->strm->avail_in--;
s->strm->total_in_lo32++;
if (s->strm->total_in_lo32 == 0) s->strm->total_in_hi32++;
s->avail_in_expect--;
}
}
return progress_in;
}
/*---------------------------------------------------*/
static
Bool copy_output_until_stop ( EState* s )
{
Bool progress_out = False;
while (True) {
/*-- no output space? --*/
if (s->strm->avail_out == 0) break;
/*-- block done? --*/
if (s->state_out_pos >= s->numZ) break;
progress_out = True;
*(s->strm->next_out) = s->zbits[s->state_out_pos];
s->state_out_pos++;
s->strm->avail_out--;
s->strm->next_out++;
s->strm->total_out_lo32++;
if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++;
}
return progress_out;
}
/*---------------------------------------------------*/
static
Bool handle_compress ( bz_stream* strm )
{
Bool progress_in = False;
Bool progress_out = False;
EState* s = strm->state;
while (True) {
if (s->state == BZ_S_OUTPUT) {
progress_out |= copy_output_until_stop ( s );
if (s->state_out_pos < s->numZ) break;
if (s->mode == BZ_M_FINISHING &&
s->avail_in_expect == 0 &&
isempty_RL(s)) break;
prepare_new_block ( s );
s->state = BZ_S_INPUT;
if (s->mode == BZ_M_FLUSHING &&
s->avail_in_expect == 0 &&
isempty_RL(s)) break;
}
if (s->state == BZ_S_INPUT) {
progress_in |= copy_input_until_stop ( s );
if (s->mode != BZ_M_RUNNING && s->avail_in_expect == 0) {
flush_RL ( s );
BZ2_compressBlock ( s, (Bool)(s->mode == BZ_M_FINISHING) );
s->state = BZ_S_OUTPUT;
}
else
if (s->nblock >= s->nblockMAX) {
BZ2_compressBlock ( s, False );
s->state = BZ_S_OUTPUT;
}
else
if (s->strm->avail_in == 0) {
break;
}
}
}
return progress_in || progress_out;
}
/*---------------------------------------------------*/
int BZ_API(BZ2_bzCompress) ( bz_stream *strm, int action )
{
Bool progress;
EState* s;
if (strm == NULL) return BZ_PARAM_ERROR;
s = strm->state;
if (s == NULL) return BZ_PARAM_ERROR;
if (s->strm != strm) return BZ_PARAM_ERROR;
preswitch:
switch (s->mode) {
case BZ_M_IDLE:
return BZ_SEQUENCE_ERROR;
case BZ_M_RUNNING:
if (action == BZ_RUN) {
progress = handle_compress ( strm );
return progress ? BZ_RUN_OK : BZ_PARAM_ERROR;
}
else
if (action == BZ_FLUSH) {
s->avail_in_expect = strm->avail_in;
s->mode = BZ_M_FLUSHING;
goto preswitch;
}
else
if (action == BZ_FINISH) {
s->avail_in_expect = strm->avail_in;
s->mode = BZ_M_FINISHING;
goto preswitch;
}
else
return BZ_PARAM_ERROR;
case BZ_M_FLUSHING:
if (action != BZ_FLUSH) return BZ_SEQUENCE_ERROR;
if (s->avail_in_expect != s->strm->avail_in)
return BZ_SEQUENCE_ERROR;
progress = handle_compress ( strm );
if (s->avail_in_expect > 0 || !isempty_RL(s) ||
s->state_out_pos < s->numZ) return BZ_FLUSH_OK;
s->mode = BZ_M_RUNNING;
return BZ_RUN_OK;
case BZ_M_FINISHING:
if (action != BZ_FINISH) return BZ_SEQUENCE_ERROR;
if (s->avail_in_expect != s->strm->avail_in)
return BZ_SEQUENCE_ERROR;
progress = handle_compress ( strm );
if (!progress) return BZ_SEQUENCE_ERROR;
if (s->avail_in_expect > 0 || !isempty_RL(s) ||
s->state_out_pos < s->numZ) return BZ_FINISH_OK;
s->mode = BZ_M_IDLE;
return BZ_STREAM_END;
}
return BZ_OK; /*--not reached--*/
}
/*---------------------------------------------------*/
int BZ_API(BZ2_bzCompressEnd) ( bz_stream *strm )
{
EState* s;
if (strm == NULL) return BZ_PARAM_ERROR;
s = strm->state;
if (s == NULL) return BZ_PARAM_ERROR;
if (s->strm != strm) return BZ_PARAM_ERROR;
if (s->arr1 != NULL) BZFREE(s->arr1);
if (s->arr2 != NULL) BZFREE(s->arr2);
if (s->ftab != NULL) BZFREE(s->ftab);
BZFREE(strm->state);
strm->state = NULL;
return BZ_OK;
}
/*---------------------------------------------------*/
/*--- Decompression stuff ---*/
/*---------------------------------------------------*/
/*---------------------------------------------------*/
int BZ_API(BZ2_bzDecompressInit)
( bz_stream* strm,
int verbosity,
int small )
{
DState* s;
if (!bz_config_ok()) return BZ_CONFIG_ERROR;
if (strm == NULL) return BZ_PARAM_ERROR;
if (small != 0 && small != 1) return BZ_PARAM_ERROR;
if (verbosity < 0 || verbosity > 4) return BZ_PARAM_ERROR;
if (strm->bzalloc == NULL) strm->bzalloc = default_bzalloc;
if (strm->bzfree == NULL) strm->bzfree = default_bzfree;
s = BZALLOC( sizeof(DState) );
if (s == NULL) return BZ_MEM_ERROR;
s->strm = strm;
strm->state = s;
s->state = BZ_X_MAGIC_1;
s->bsLive = 0;
s->bsBuff = 0;
s->calculatedCombinedCRC = 0;
strm->total_in_lo32 = 0;
strm->total_in_hi32 = 0;
strm->total_out_lo32 = 0;
strm->total_out_hi32 = 0;
s->smallDecompress = (Bool)small;
s->ll4 = NULL;
s->ll16 = NULL;
s->tt = NULL;
s->currBlockNo = 0;
s->verbosity = verbosity;
return BZ_OK;
}
/*---------------------------------------------------*/
static
void unRLE_obuf_to_output_FAST ( DState* s )
{
UChar k1;
if (s->blockRandomised) {
while (True) {
/* try to finish existing run */
while (True) {
if (s->strm->avail_out == 0) return;
if (s->state_out_len == 0) break;
*( (UChar*)(s->strm->next_out) ) = s->state_out_ch;
BZ_UPDATE_CRC ( s->calculatedBlockCRC, s->state_out_ch );
s->state_out_len--;
s->strm->next_out++;
s->strm->avail_out--;
s->strm->total_out_lo32++;
if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++;
}
/* can a new run be started? */
if (s->nblock_used == s->save_nblock+1) return;
s->state_out_len = 1;
s->state_out_ch = s->k0;
BZ_GET_FAST(k1); BZ_RAND_UPD_MASK;
k1 ^= BZ_RAND_MASK; s->nblock_used++;
if (s->nblock_used == s->save_nblock+1) continue;
if (k1 != s->k0) { s->k0 = k1; continue; };
s->state_out_len = 2;
BZ_GET_FAST(k1); BZ_RAND_UPD_MASK;
k1 ^= BZ_RAND_MASK; s->nblock_used++;
if (s->nblock_used == s->save_nblock+1) continue;
if (k1 != s->k0) { s->k0 = k1; continue; };
s->state_out_len = 3;
BZ_GET_FAST(k1); BZ_RAND_UPD_MASK;
k1 ^= BZ_RAND_MASK; s->nblock_used++;
if (s->nblock_used == s->save_nblock+1) continue;
if (k1 != s->k0) { s->k0 = k1; continue; };
BZ_GET_FAST(k1); BZ_RAND_UPD_MASK;
k1 ^= BZ_RAND_MASK; s->nblock_used++;
s->state_out_len = ((Int32)k1) + 4;
BZ_GET_FAST(s->k0); BZ_RAND_UPD_MASK;
s->k0 ^= BZ_RAND_MASK; s->nblock_used++;
}
} else {
/* restore */
UInt32 c_calculatedBlockCRC = s->calculatedBlockCRC;
UChar c_state_out_ch = s->state_out_ch;
Int32 c_state_out_len = s->state_out_len;
Int32 c_nblock_used = s->nblock_used;
Int32 c_k0 = s->k0;
UInt32* c_tt = s->tt;
UInt32 c_tPos = s->tPos;
char* cs_next_out = s->strm->next_out;
unsigned int cs_avail_out = s->strm->avail_out;
/* end restore */
UInt32 avail_out_INIT = cs_avail_out;
Int32 s_save_nblockPP = s->save_nblock+1;
unsigned int total_out_lo32_old;
while (True) {
/* try to finish existing run */
if (c_state_out_len > 0) {
while (True) {
if (cs_avail_out == 0) goto return_notr;
if (c_state_out_len == 1) break;
*( (UChar*)(cs_next_out) ) = c_state_out_ch;
BZ_UPDATE_CRC ( c_calculatedBlockCRC, c_state_out_ch );
c_state_out_len--;
cs_next_out++;
cs_avail_out--;
}
s_state_out_len_eq_one:
{
if (cs_avail_out == 0) {
c_state_out_len = 1; goto return_notr;
};
*( (UChar*)(cs_next_out) ) = c_state_out_ch;
BZ_UPDATE_CRC ( c_calculatedBlockCRC, c_state_out_ch );
cs_next_out++;
cs_avail_out--;
}
}
/* can a new run be started? */
if (c_nblock_used == s_save_nblockPP) {
c_state_out_len = 0; goto return_notr;
};
c_state_out_ch = c_k0;
BZ_GET_FAST_C(k1); c_nblock_used++;
if (k1 != c_k0) {
c_k0 = k1; goto s_state_out_len_eq_one;
};
if (c_nblock_used == s_save_nblockPP)
goto s_state_out_len_eq_one;
c_state_out_len = 2;
BZ_GET_FAST_C(k1); c_nblock_used++;
if (c_nblock_used == s_save_nblockPP) continue;
if (k1 != c_k0) { c_k0 = k1; continue; };
c_state_out_len = 3;
BZ_GET_FAST_C(k1); c_nblock_used++;
if (c_nblock_used == s_save_nblockPP) continue;
if (k1 != c_k0) { c_k0 = k1; continue; };
BZ_GET_FAST_C(k1); c_nblock_used++;
c_state_out_len = ((Int32)k1) + 4;
BZ_GET_FAST_C(c_k0); c_nblock_used++;
}
return_notr:
total_out_lo32_old = s->strm->total_out_lo32;
s->strm->total_out_lo32 += (avail_out_INIT - cs_avail_out);
if (s->strm->total_out_lo32 < total_out_lo32_old)
s->strm->total_out_hi32++;
/* save */
s->calculatedBlockCRC = c_calculatedBlockCRC;
s->state_out_ch = c_state_out_ch;
s->state_out_len = c_state_out_len;
s->nblock_used = c_nblock_used;
s->k0 = c_k0;
s->tt = c_tt;
s->tPos = c_tPos;
s->strm->next_out = cs_next_out;
s->strm->avail_out = cs_avail_out;
/* end save */
}
}
/*---------------------------------------------------*/
__inline__ Int32 BZ2_indexIntoF ( Int32 indx, Int32 *cftab )
{
Int32 nb, na, mid;
nb = 0;
na = 256;
do {
mid = (nb + na) >> 1;
if (indx >= cftab[mid]) nb = mid; else na = mid;
}
while (na - nb != 1);
return nb;
}
/*---------------------------------------------------*/
static
void unRLE_obuf_to_output_SMALL ( DState* s )
{
UChar k1;
if (s->blockRandomised) {
while (True) {
/* try to finish existing run */
while (True) {
if (s->strm->avail_out == 0) return;
if (s->state_out_len == 0) break;
*( (UChar*)(s->strm->next_out) ) = s->state_out_ch;
BZ_UPDATE_CRC ( s->calculatedBlockCRC, s->state_out_ch );
s->state_out_len--;
s->strm->next_out++;
s->strm->avail_out--;
s->strm->total_out_lo32++;
if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++;
}
/* can a new run be started? */
if (s->nblock_used == s->save_nblock+1) return;
s->state_out_len = 1;
s->state_out_ch = s->k0;
BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK;
k1 ^= BZ_RAND_MASK; s->nblock_used++;
if (s->nblock_used == s->save_nblock+1) continue;
if (k1 != s->k0) { s->k0 = k1; continue; };
s->state_out_len = 2;
BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK;
k1 ^= BZ_RAND_MASK; s->nblock_used++;
if (s->nblock_used == s->save_nblock+1) continue;
if (k1 != s->k0) { s->k0 = k1; continue; };
s->state_out_len = 3;
BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK;
k1 ^= BZ_RAND_MASK; s->nblock_used++;
if (s->nblock_used == s->save_nblock+1) continue;
if (k1 != s->k0) { s->k0 = k1; continue; };
BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK;
k1 ^= BZ_RAND_MASK; s->nblock_used++;
s->state_out_len = ((Int32)k1) + 4;
BZ_GET_SMALL(s->k0); BZ_RAND_UPD_MASK;
s->k0 ^= BZ_RAND_MASK; s->nblock_used++;
}
} else {
while (True) {
/* try to finish existing run */
while (True) {
if (s->strm->avail_out == 0) return;
if (s->state_out_len == 0) break;
*( (UChar*)(s->strm->next_out) ) = s->state_out_ch;
BZ_UPDATE_CRC ( s->calculatedBlockCRC, s->state_out_ch );
s->state_out_len--;
s->strm->next_out++;
s->strm->avail_out--;
s->strm->total_out_lo32++;
if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++;
}
/* can a new run be started? */
if (s->nblock_used == s->save_nblock+1) return;
s->state_out_len = 1;
s->state_out_ch = s->k0;
BZ_GET_SMALL(k1); s->nblock_used++;
if (s->nblock_used == s->save_nblock+1) continue;
if (k1 != s->k0) { s->k0 = k1; continue; };
s->state_out_len = 2;
BZ_GET_SMALL(k1); s->nblock_used++;
if (s->nblock_used == s->save_nblock+1) continue;
if (k1 != s->k0) { s->k0 = k1; continue; };
s->state_out_len = 3;
BZ_GET_SMALL(k1); s->nblock_used++;
if (s->nblock_used == s->save_nblock+1) continue;
if (k1 != s->k0) { s->k0 = k1; continue; };
BZ_GET_SMALL(k1); s->nblock_used++;
s->state_out_len = ((Int32)k1) + 4;
BZ_GET_SMALL(s->k0); s->nblock_used++;
}
}
}
/*---------------------------------------------------*/
int BZ_API(BZ2_bzDecompress) ( bz_stream *strm )
{
DState* s;
if (strm == NULL) return BZ_PARAM_ERROR;
s = strm->state;
if (s == NULL) return BZ_PARAM_ERROR;
if (s->strm != strm) return BZ_PARAM_ERROR;
while (True) {
if (s->state == BZ_X_IDLE) return BZ_SEQUENCE_ERROR;
if (s->state == BZ_X_OUTPUT) {
if (s->smallDecompress)
unRLE_obuf_to_output_SMALL ( s ); else
unRLE_obuf_to_output_FAST ( s );
if (s->nblock_used == s->save_nblock+1 && s->state_out_len == 0) {
BZ_FINALISE_CRC ( s->calculatedBlockCRC );
if (s->verbosity >= 3)
VPrintf2 ( " {0x%x, 0x%x}", s->storedBlockCRC,
s->calculatedBlockCRC );
if (s->verbosity >= 2) VPrintf0 ( "]" );
if (s->calculatedBlockCRC != s->storedBlockCRC)
return BZ_DATA_ERROR;
s->calculatedCombinedCRC
= (s->calculatedCombinedCRC << 1) |
(s->calculatedCombinedCRC >> 31);
s->calculatedCombinedCRC ^= s->calculatedBlockCRC;
s->state = BZ_X_BLKHDR_1;
} else {
return BZ_OK;
}
}
if (s->state >= BZ_X_MAGIC_1) {
Int32 r = BZ2_decompress ( s );
if (r == BZ_STREAM_END) {
if (s->verbosity >= 3)
VPrintf2 ( "\n combined CRCs: stored = 0x%x, computed = 0x%x",
s->storedCombinedCRC, s->calculatedCombinedCRC );
if (s->calculatedCombinedCRC != s->storedCombinedCRC)
return BZ_DATA_ERROR;
return r;
}
if (s->state != BZ_X_OUTPUT) return r;
}
}
AssertH ( 0, 6001 );
return 0; /*NOTREACHED*/
}
/*---------------------------------------------------*/
int BZ_API(BZ2_bzDecompressEnd) ( bz_stream *strm )
{
DState* s;
if (strm == NULL) return BZ_PARAM_ERROR;
s = strm->state;
if (s == NULL) return BZ_PARAM_ERROR;
if (s->strm != strm) return BZ_PARAM_ERROR;
if (s->tt != NULL) BZFREE(s->tt);
if (s->ll16 != NULL) BZFREE(s->ll16);
if (s->ll4 != NULL) BZFREE(s->ll4);
BZFREE(strm->state);
strm->state = NULL;
return BZ_OK;
}
#ifndef BZ_NO_STDIO
/*---------------------------------------------------*/
/*--- File I/O stuff ---*/
/*---------------------------------------------------*/
#define BZ_SETERR(eee) \
{ \
if (bzerror != NULL) *bzerror = eee; \
if (bzf != NULL) bzf->lastErr = eee; \
}
typedef
struct {
FILE* handle;
Char buf[BZ_MAX_UNUSED];
Int32 bufN;
Bool writing;
bz_stream strm;
Int32 lastErr;
Bool initialisedOk;
}
bzFile;
/*---------------------------------------------*/
static Bool myfeof ( FILE* f )
{
Int32 c = fgetc ( f );
if (c == EOF) return True;
ungetc ( c, f );
return False;
}
/*---------------------------------------------------*/
BZFILE* BZ_API(BZ2_bzWriteOpen)
( int* bzerror,
FILE* f,
int blockSize100k,
int verbosity,
int workFactor )
{
Int32 ret;
bzFile* bzf = NULL;
BZ_SETERR(BZ_OK);
if (f == NULL ||
(blockSize100k < 1 || blockSize100k > 9) ||
(workFactor < 0 || workFactor > 250) ||
(verbosity < 0 || verbosity > 4))
{ BZ_SETERR(BZ_PARAM_ERROR); return NULL; };
if (ferror(f))
{ BZ_SETERR(BZ_IO_ERROR); return NULL; };
bzf = malloc ( sizeof(bzFile) );
if (bzf == NULL)
{ BZ_SETERR(BZ_MEM_ERROR); return NULL; };
BZ_SETERR(BZ_OK);
bzf->initialisedOk = False;
bzf->bufN = 0;
bzf->handle = f;
bzf->writing = True;
bzf->strm.bzalloc = NULL;
bzf->strm.bzfree = NULL;
bzf->strm.opaque = NULL;
if (workFactor == 0) workFactor = 30;
ret = BZ2_bzCompressInit ( &(bzf->strm), blockSize100k,
verbosity, workFactor );
if (ret != BZ_OK)
{ BZ_SETERR(ret); free(bzf); return NULL; };
bzf->strm.avail_in = 0;
bzf->initialisedOk = True;
return bzf;
}
/*---------------------------------------------------*/
void BZ_API(BZ2_bzWrite)
( int* bzerror,
BZFILE* b,
void* buf,
int len )
{
Int32 n, n2, ret;
bzFile* bzf = (bzFile*)b;
BZ_SETERR(BZ_OK);
if (bzf == NULL || buf == NULL || len < 0)
{ BZ_SETERR(BZ_PARAM_ERROR); return; };
if (!(bzf->writing))
{ BZ_SETERR(BZ_SEQUENCE_ERROR); return; };
if (ferror(bzf->handle))
{ BZ_SETERR(BZ_IO_ERROR); return; };
if (len == 0)
{ BZ_SETERR(BZ_OK); return; };
bzf->strm.avail_in = len;
bzf->strm.next_in = buf;
while (True) {
bzf->strm.avail_out = BZ_MAX_UNUSED;
bzf->strm.next_out = bzf->buf;
ret = BZ2_bzCompress ( &(bzf->strm), BZ_RUN );
if (ret != BZ_RUN_OK)
{ BZ_SETERR(ret); return; };
if (bzf->strm.avail_out < BZ_MAX_UNUSED) {
n = BZ_MAX_UNUSED - bzf->strm.avail_out;
n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar),
n, bzf->handle );
if (n != n2 || ferror(bzf->handle))
{ BZ_SETERR(BZ_IO_ERROR); return; };
}
if (bzf->strm.avail_in == 0)
{ BZ_SETERR(BZ_OK); return; };
}
}
/*---------------------------------------------------*/
void BZ_API(BZ2_bzWriteClose)
( int* bzerror,
BZFILE* b,
int abandon,
unsigned int* nbytes_in,
unsigned int* nbytes_out )
{
BZ2_bzWriteClose64 ( bzerror, b, abandon,
nbytes_in, NULL, nbytes_out, NULL );
}
void BZ_API(BZ2_bzWriteClose64)
( int* bzerror,
BZFILE* b,
int abandon,
unsigned int* nbytes_in_lo32,
unsigned int* nbytes_in_hi32,
unsigned int* nbytes_out_lo32,
unsigned int* nbytes_out_hi32 )
{
Int32 n, n2, ret;
bzFile* bzf = (bzFile*)b;
if (bzf == NULL)
{ BZ_SETERR(BZ_OK); return; };
if (!(bzf->writing))
{ BZ_SETERR(BZ_SEQUENCE_ERROR); return; };
if (ferror(bzf->handle))
{ BZ_SETERR(BZ_IO_ERROR); return; };
if (nbytes_in_lo32 != NULL) *nbytes_in_lo32 = 0;
if (nbytes_in_hi32 != NULL) *nbytes_in_hi32 = 0;
if (nbytes_out_lo32 != NULL) *nbytes_out_lo32 = 0;
if (nbytes_out_hi32 != NULL) *nbytes_out_hi32 = 0;
if ((!abandon) && bzf->lastErr == BZ_OK) {
while (True) {
bzf->strm.avail_out = BZ_MAX_UNUSED;
bzf->strm.next_out = bzf->buf;
ret = BZ2_bzCompress ( &(bzf->strm), BZ_FINISH );
if (ret != BZ_FINISH_OK && ret != BZ_STREAM_END)
{ BZ_SETERR(ret); return; };
if (bzf->strm.avail_out < BZ_MAX_UNUSED) {
n = BZ_MAX_UNUSED - bzf->strm.avail_out;
n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar),
n, bzf->handle );
if (n != n2 || ferror(bzf->handle))
{ BZ_SETERR(BZ_IO_ERROR); return; };
}
if (ret == BZ_STREAM_END) break;
}
}
if ( !abandon && !ferror ( bzf->handle ) ) {
fflush ( bzf->handle );
if (ferror(bzf->handle))
{ BZ_SETERR(BZ_IO_ERROR); return; };
}
if (nbytes_in_lo32 != NULL)
*nbytes_in_lo32 = bzf->strm.total_in_lo32;
if (nbytes_in_hi32 != NULL)
*nbytes_in_hi32 = bzf->strm.total_in_hi32;
if (nbytes_out_lo32 != NULL)
*nbytes_out_lo32 = bzf->strm.total_out_lo32;
if (nbytes_out_hi32 != NULL)
*nbytes_out_hi32 = bzf->strm.total_out_hi32;
BZ_SETERR(BZ_OK);
BZ2_bzCompressEnd ( &(bzf->strm) );
free ( bzf );
}
/*---------------------------------------------------*/
BZFILE* BZ_API(BZ2_bzReadOpen)
( int* bzerror,
FILE* f,
int verbosity,
int small,
void* unused,
int nUnused )
{
bzFile* bzf = NULL;
int ret;
BZ_SETERR(BZ_OK);
if (f == NULL ||
(small != 0 && small != 1) ||
(verbosity < 0 || verbosity > 4) ||
(unused == NULL && nUnused != 0) ||
(unused != NULL && (nUnused < 0 || nUnused > BZ_MAX_UNUSED)))
{ BZ_SETERR(BZ_PARAM_ERROR); return NULL; };
if (ferror(f))
{ BZ_SETERR(BZ_IO_ERROR); return NULL; };
bzf = malloc ( sizeof(bzFile) );
if (bzf == NULL)
{ BZ_SETERR(BZ_MEM_ERROR); return NULL; };
BZ_SETERR(BZ_OK);
bzf->initialisedOk = False;
bzf->handle = f;
bzf->bufN = 0;
bzf->writing = False;
bzf->strm.bzalloc = NULL;
bzf->strm.bzfree = NULL;
bzf->strm.opaque = NULL;
while (nUnused > 0) {
bzf->buf[bzf->bufN] = *((UChar*)(unused)); bzf->bufN++;
unused = ((void*)( 1 + ((UChar*)(unused)) ));
nUnused--;
}
ret = BZ2_bzDecompressInit ( &(bzf->strm), verbosity, small );
if (ret != BZ_OK)
{ BZ_SETERR(ret); free(bzf); return NULL; };
bzf->strm.avail_in = bzf->bufN;
bzf->strm.next_in = bzf->buf;
bzf->initialisedOk = True;
return bzf;
}
/*---------------------------------------------------*/
void BZ_API(BZ2_bzReadClose) ( int *bzerror, BZFILE *b )
{
bzFile* bzf = (bzFile*)b;
BZ_SETERR(BZ_OK);
if (bzf == NULL)
{ BZ_SETERR(BZ_OK); return; };
if (bzf->writing)
{ BZ_SETERR(BZ_SEQUENCE_ERROR); return; };
if (bzf->initialisedOk)
(void)BZ2_bzDecompressEnd ( &(bzf->strm) );
free ( bzf );
}
/*---------------------------------------------------*/
int BZ_API(BZ2_bzRead)
( int* bzerror,
BZFILE* b,
void* buf,
int len )
{
Int32 n, ret;
bzFile* bzf = (bzFile*)b;
BZ_SETERR(BZ_OK);
if (bzf == NULL || buf == NULL || len < 0)
{ BZ_SETERR(BZ_PARAM_ERROR); return 0; };
if (bzf->writing)
{ BZ_SETERR(BZ_SEQUENCE_ERROR); return 0; };
if (len == 0)
{ BZ_SETERR(BZ_OK); return 0; };
bzf->strm.avail_out = len;
bzf->strm.next_out = buf;
while (True) {
if (ferror(bzf->handle))
{ BZ_SETERR(BZ_IO_ERROR); return 0; };
if (bzf->strm.avail_in == 0 && !myfeof(bzf->handle)) {
n = fread ( bzf->buf, sizeof(UChar),
BZ_MAX_UNUSED, bzf->handle );
if (ferror(bzf->handle))
{ BZ_SETERR(BZ_IO_ERROR); return 0; };
bzf->bufN = n;
bzf->strm.avail_in = bzf->bufN;
bzf->strm.next_in = bzf->buf;
}
ret = BZ2_bzDecompress ( &(bzf->strm) );
if (ret != BZ_OK && ret != BZ_STREAM_END)
{ BZ_SETERR(ret); return 0; };
if (ret == BZ_OK && myfeof(bzf->handle) &&
bzf->strm.avail_in == 0 && bzf->strm.avail_out > 0)
{ BZ_SETERR(BZ_UNEXPECTED_EOF); return 0; };
if (ret == BZ_STREAM_END)
{ BZ_SETERR(BZ_STREAM_END);
return len - bzf->strm.avail_out; };
if (bzf->strm.avail_out == 0)
{ BZ_SETERR(BZ_OK); return len; };
}
return 0; /*not reached*/
}
/*---------------------------------------------------*/
void BZ_API(BZ2_bzReadGetUnused)
( int* bzerror,
BZFILE* b,
void** unused,
int* nUnused )
{
bzFile* bzf = (bzFile*)b;
if (bzf == NULL)
{ BZ_SETERR(BZ_PARAM_ERROR); return; };
if (bzf->lastErr != BZ_STREAM_END)
{ BZ_SETERR(BZ_SEQUENCE_ERROR); return; };
if (unused == NULL || nUnused == NULL)
{ BZ_SETERR(BZ_PARAM_ERROR); return; };
BZ_SETERR(BZ_OK);
*nUnused = bzf->strm.avail_in;
*unused = bzf->strm.next_in;
}
#endif
/*---------------------------------------------------*/
/*--- Misc convenience stuff ---*/
/*---------------------------------------------------*/
/*---------------------------------------------------*/
int BZ_API(BZ2_bzBuffToBuffCompress)
( char* dest,
unsigned int* destLen,
char* source,
unsigned int sourceLen,
int blockSize100k,
int verbosity,
int workFactor )
{
bz_stream strm;
int ret;
if (dest == NULL || destLen == NULL ||
source == NULL ||
blockSize100k < 1 || blockSize100k > 9 ||
verbosity < 0 || verbosity > 4 ||
workFactor < 0 || workFactor > 250)
return BZ_PARAM_ERROR;
if (workFactor == 0) workFactor = 30;
strm.bzalloc = NULL;
strm.bzfree = NULL;
strm.opaque = NULL;
ret = BZ2_bzCompressInit ( &strm, blockSize100k,
verbosity, workFactor );
if (ret != BZ_OK) return ret;
strm.next_in = source;
strm.next_out = dest;
strm.avail_in = sourceLen;
strm.avail_out = *destLen;
ret = BZ2_bzCompress ( &strm, BZ_FINISH );
if (ret == BZ_FINISH_OK) goto output_overflow;
if (ret != BZ_STREAM_END) goto errhandler;
/* normal termination */
*destLen -= strm.avail_out;
BZ2_bzCompressEnd ( &strm );
return BZ_OK;
output_overflow:
BZ2_bzCompressEnd ( &strm );
return BZ_OUTBUFF_FULL;
errhandler:
BZ2_bzCompressEnd ( &strm );
return ret;
}
/*---------------------------------------------------*/
int BZ_API(BZ2_bzBuffToBuffDecompress)
( char* dest,
unsigned int* destLen,
char* source,
unsigned int sourceLen,
int small,
int verbosity )
{
bz_stream strm;
int ret;
if (dest == NULL || destLen == NULL ||
source == NULL ||
(small != 0 && small != 1) ||
verbosity < 0 || verbosity > 4)
return BZ_PARAM_ERROR;
strm.bzalloc = NULL;
strm.bzfree = NULL;
strm.opaque = NULL;
ret = BZ2_bzDecompressInit ( &strm, verbosity, small );
if (ret != BZ_OK) return ret;
strm.next_in = source;
strm.next_out = dest;
strm.avail_in = sourceLen;
strm.avail_out = *destLen;
ret = BZ2_bzDecompress ( &strm );
if (ret == BZ_OK) goto output_overflow_or_eof;
if (ret != BZ_STREAM_END) goto errhandler;
/* normal termination */
*destLen -= strm.avail_out;
BZ2_bzDecompressEnd ( &strm );
return BZ_OK;
output_overflow_or_eof:
if (strm.avail_out > 0) {
BZ2_bzDecompressEnd ( &strm );
return BZ_UNEXPECTED_EOF;
} else {
BZ2_bzDecompressEnd ( &strm );
return BZ_OUTBUFF_FULL;
};
errhandler:
BZ2_bzDecompressEnd ( &strm );
return ret;
}
/*---------------------------------------------------*/
/*--
Code contributed by Yoshioka Tsuneo
(QWF00133@niftyserve.or.jp/tsuneo-y@is.aist-nara.ac.jp),
to support better zlib compatibility.
This code is not _officially_ part of libbzip2 (yet);
I haven't tested it, documented it, or considered the
threading-safeness of it.
If this code breaks, please contact both Yoshioka and me.
--*/
/*---------------------------------------------------*/
/*---------------------------------------------------*/
/*--
return version like "0.9.0c".
--*/
const char * BZ_API(BZ2_bzlibVersion)(void)
{
return BZ_VERSION;
}
#ifndef BZ_NO_STDIO
/*---------------------------------------------------*/
#if defined(_WIN32) || defined(OS2) || defined(MSDOS)
# include <fcntl.h>
# include <io.h>
# define SET_BINARY_MODE(file) setmode(fileno(file),O_BINARY)
#else
# define SET_BINARY_MODE(file)
#endif
static
BZFILE * bzopen_or_bzdopen
( const char *path, /* no use when bzdopen */
int fd, /* no use when bzdopen */
const char *mode,
int open_mode) /* bzopen: 0, bzdopen:1 */
{
int bzerr;
char unused[BZ_MAX_UNUSED];
int blockSize100k = 9;
int writing = 0;
char mode2[10] = "";
FILE *fp = NULL;
BZFILE *bzfp = NULL;
int verbosity = 0;
int workFactor = 30;
int smallMode = 0;
int nUnused = 0;
if (mode == NULL) return NULL;
while (*mode) {
switch (*mode) {
case 'r':
writing = 0; break;
case 'w':
writing = 1; break;
case 's':
smallMode = 1; break;
default:
if (isdigit((int)(*mode))) {
blockSize100k = *mode-BZ_HDR_0;
}
}
mode++;
}
strcat(mode2, writing ? "w" : "r" );
strcat(mode2,"b"); /* binary mode */
if (open_mode==0) {
if (path==NULL || strcmp(path,"")==0) {
fp = (writing ? stdout : stdin);
SET_BINARY_MODE(fp);
} else {
fp = fopen(path,mode2);
}
} else {
#ifdef BZ_STRICT_ANSI
fp = NULL;
#else
fp = fdopen(fd,mode2);
#endif
}
if (fp == NULL) return NULL;
if (writing) {
/* Guard against total chaos and anarchy -- JRS */
if (blockSize100k < 1) blockSize100k = 1;
if (blockSize100k > 9) blockSize100k = 9;
bzfp = BZ2_bzWriteOpen(&bzerr,fp,blockSize100k,
verbosity,workFactor);
} else {
bzfp = BZ2_bzReadOpen(&bzerr,fp,verbosity,smallMode,
unused,nUnused);
}
if (bzfp == NULL) {
if (fp != stdin && fp != stdout) fclose(fp);
return NULL;
}
return bzfp;
}
/*---------------------------------------------------*/
/*--
open file for read or write.
ex) bzopen("file","w9")
case path="" or NULL => use stdin or stdout.
--*/
BZFILE * BZ_API(BZ2_bzopen)
( const char *path,
const char *mode )
{
return bzopen_or_bzdopen(path,-1,mode,/*bzopen*/0);
}
/*---------------------------------------------------*/
BZFILE * BZ_API(BZ2_bzdopen)
( int fd,
const char *mode )
{
return bzopen_or_bzdopen(NULL,fd,mode,/*bzdopen*/1);
}
/*---------------------------------------------------*/
int BZ_API(BZ2_bzread) (BZFILE* b, void* buf, int len )
{
int bzerr, nread;
if (((bzFile*)b)->lastErr == BZ_STREAM_END) return 0;
nread = BZ2_bzRead(&bzerr,b,buf,len);
if (bzerr == BZ_OK || bzerr == BZ_STREAM_END) {
return nread;
} else {
return -1;
}
}
/*---------------------------------------------------*/
int BZ_API(BZ2_bzwrite) (BZFILE* b, void* buf, int len )
{
int bzerr;
BZ2_bzWrite(&bzerr,b,buf,len);
if(bzerr == BZ_OK){
return len;
}else{
return -1;
}
}
/*---------------------------------------------------*/
int BZ_API(BZ2_bzflush) (BZFILE *b)
{
/* do nothing now... */
return 0;
}
/*---------------------------------------------------*/
void BZ_API(BZ2_bzclose) (BZFILE* b)
{
int bzerr;
FILE *fp = ((bzFile *)b)->handle;
if (b==NULL) {return;}
if(((bzFile*)b)->writing){
BZ2_bzWriteClose(&bzerr,b,0,NULL,NULL);
if(bzerr != BZ_OK){
BZ2_bzWriteClose(NULL,b,1,NULL,NULL);
}
}else{
BZ2_bzReadClose(&bzerr,b);
}
if(fp!=stdin && fp!=stdout){
fclose(fp);
}
}
/*---------------------------------------------------*/
/*--
return last error code
--*/
static char *bzerrorstrings[] = {
"OK"
,"SEQUENCE_ERROR"
,"PARAM_ERROR"
,"MEM_ERROR"
,"DATA_ERROR"
,"DATA_ERROR_MAGIC"
,"IO_ERROR"
,"UNEXPECTED_EOF"
,"OUTBUFF_FULL"
,"CONFIG_ERROR"
,"???" /* for future */
,"???" /* for future */
,"???" /* for future */
,"???" /* for future */
,"???" /* for future */
,"???" /* for future */
};
const char * BZ_API(BZ2_bzerror) (BZFILE *b, int *errnum)
{
int err = ((bzFile *)b)->lastErr;
if(err>0) err = 0;
*errnum = err;
return bzerrorstrings[err*-1];
}
#endif
/*-------------------------------------------------------------*/
/*--- end bzlib.c ---*/
/*-------------------------------------------------------------*/
|
Added work/src/bzip2-1.0.2/bzlib.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
|
/*-------------------------------------------------------------*/
/*--- Public header file for the library. ---*/
/*--- bzlib.h ---*/
/*-------------------------------------------------------------*/
/*--
This file is a part of bzip2 and/or libbzip2, a program and
library for lossless, block-sorting data compression.
Copyright (C) 1996-2002 Julian R Seward. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.
3. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
4. The name of the author may not be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Julian Seward, Cambridge, UK.
jseward@acm.org
bzip2/libbzip2 version 1.0 of 21 March 2000
This program is based on (at least) the work of:
Mike Burrows
David Wheeler
Peter Fenwick
Alistair Moffat
Radford Neal
Ian H. Witten
Robert Sedgewick
Jon L. Bentley
For more information on these sources, see the manual.
--*/
#ifndef _BZLIB_H
#define _BZLIB_H
#ifdef __cplusplus
extern "C" {
#endif
#define BZ_RUN 0
#define BZ_FLUSH 1
#define BZ_FINISH 2
#define BZ_OK 0
#define BZ_RUN_OK 1
#define BZ_FLUSH_OK 2
#define BZ_FINISH_OK 3
#define BZ_STREAM_END 4
#define BZ_SEQUENCE_ERROR (-1)
#define BZ_PARAM_ERROR (-2)
#define BZ_MEM_ERROR (-3)
#define BZ_DATA_ERROR (-4)
#define BZ_DATA_ERROR_MAGIC (-5)
#define BZ_IO_ERROR (-6)
#define BZ_UNEXPECTED_EOF (-7)
#define BZ_OUTBUFF_FULL (-8)
#define BZ_CONFIG_ERROR (-9)
typedef
struct {
char *next_in;
unsigned int avail_in;
unsigned int total_in_lo32;
unsigned int total_in_hi32;
char *next_out;
unsigned int avail_out;
unsigned int total_out_lo32;
unsigned int total_out_hi32;
void *state;
void *(*bzalloc)(void *,int,int);
void (*bzfree)(void *,void *);
void *opaque;
}
bz_stream;
#ifndef BZ_IMPORT
#define BZ_EXPORT
#endif
/* Need a definitition for FILE */
#include <stdio.h>
#ifdef _WIN32
# include <windows.h>
# ifdef small
/* windows.h define small to char */
# undef small
# endif
# ifdef BZ_EXPORT
# define BZ_API(func) WINAPI func
# define BZ_EXTERN extern
# else
/* import windows dll dynamically */
# define BZ_API(func) (WINAPI * func)
# define BZ_EXTERN
# endif
#else
# define BZ_API(func) func
# define BZ_EXTERN extern
#endif
/*-- Core (low-level) library functions --*/
BZ_EXTERN int BZ_API(BZ2_bzCompressInit) (
bz_stream* strm,
int blockSize100k,
int verbosity,
int workFactor
);
BZ_EXTERN int BZ_API(BZ2_bzCompress) (
bz_stream* strm,
int action
);
BZ_EXTERN int BZ_API(BZ2_bzCompressEnd) (
bz_stream* strm
);
BZ_EXTERN int BZ_API(BZ2_bzDecompressInit) (
bz_stream *strm,
int verbosity,
int small
);
BZ_EXTERN int BZ_API(BZ2_bzDecompress) (
bz_stream* strm
);
BZ_EXTERN int BZ_API(BZ2_bzDecompressEnd) (
bz_stream *strm
);
/*-- High(er) level library functions --*/
#ifndef BZ_NO_STDIO
#define BZ_MAX_UNUSED 5000
typedef void BZFILE;
BZ_EXTERN BZFILE* BZ_API(BZ2_bzReadOpen) (
int* bzerror,
FILE* f,
int verbosity,
int small,
void* unused,
int nUnused
);
BZ_EXTERN void BZ_API(BZ2_bzReadClose) (
int* bzerror,
BZFILE* b
);
BZ_EXTERN void BZ_API(BZ2_bzReadGetUnused) (
int* bzerror,
BZFILE* b,
void** unused,
int* nUnused
);
BZ_EXTERN int BZ_API(BZ2_bzRead) (
int* bzerror,
BZFILE* b,
void* buf,
int len
);
BZ_EXTERN BZFILE* BZ_API(BZ2_bzWriteOpen) (
int* bzerror,
FILE* f,
int blockSize100k,
int verbosity,
int workFactor
);
BZ_EXTERN void BZ_API(BZ2_bzWrite) (
int* bzerror,
BZFILE* b,
void* buf,
int len
);
BZ_EXTERN void BZ_API(BZ2_bzWriteClose) (
int* bzerror,
BZFILE* b,
int abandon,
unsigned int* nbytes_in,
unsigned int* nbytes_out
);
BZ_EXTERN void BZ_API(BZ2_bzWriteClose64) (
int* bzerror,
BZFILE* b,
int abandon,
unsigned int* nbytes_in_lo32,
unsigned int* nbytes_in_hi32,
unsigned int* nbytes_out_lo32,
unsigned int* nbytes_out_hi32
);
#endif
/*-- Utility functions --*/
BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffCompress) (
char* dest,
unsigned int* destLen,
char* source,
unsigned int sourceLen,
int blockSize100k,
int verbosity,
int workFactor
);
BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffDecompress) (
char* dest,
unsigned int* destLen,
char* source,
unsigned int sourceLen,
int small,
int verbosity
);
/*--
Code contributed by Yoshioka Tsuneo
(QWF00133@niftyserve.or.jp/tsuneo-y@is.aist-nara.ac.jp),
to support better zlib compatibility.
This code is not _officially_ part of libbzip2 (yet);
I haven't tested it, documented it, or considered the
threading-safeness of it.
If this code breaks, please contact both Yoshioka and me.
--*/
BZ_EXTERN const char * BZ_API(BZ2_bzlibVersion) (
void
);
#ifndef BZ_NO_STDIO
BZ_EXTERN BZFILE * BZ_API(BZ2_bzopen) (
const char *path,
const char *mode
);
BZ_EXTERN BZFILE * BZ_API(BZ2_bzdopen) (
int fd,
const char *mode
);
BZ_EXTERN int BZ_API(BZ2_bzread) (
BZFILE* b,
void* buf,
int len
);
BZ_EXTERN int BZ_API(BZ2_bzwrite) (
BZFILE* b,
void* buf,
int len
);
BZ_EXTERN int BZ_API(BZ2_bzflush) (
BZFILE* b
);
BZ_EXTERN void BZ_API(BZ2_bzclose) (
BZFILE* b
);
BZ_EXTERN const char * BZ_API(BZ2_bzerror) (
BZFILE *b,
int *errnum
);
#endif
#ifdef __cplusplus
}
#endif
#endif
/*-------------------------------------------------------------*/
/*--- end bzlib.h ---*/
/*-------------------------------------------------------------*/
|
Added work/src/bzip2-1.0.2/bzlib_private.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
|
/*-------------------------------------------------------------*/
/*--- Private header file for the library. ---*/
/*--- bzlib_private.h ---*/
/*-------------------------------------------------------------*/
/*--
This file is a part of bzip2 and/or libbzip2, a program and
library for lossless, block-sorting data compression.
Copyright (C) 1996-2002 Julian R Seward. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.
3. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
4. The name of the author may not be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Julian Seward, Cambridge, UK.
jseward@acm.org
bzip2/libbzip2 version 1.0 of 21 March 2000
This program is based on (at least) the work of:
Mike Burrows
David Wheeler
Peter Fenwick
Alistair Moffat
Radford Neal
Ian H. Witten
Robert Sedgewick
Jon L. Bentley
For more information on these sources, see the manual.
--*/
#ifndef _BZLIB_PRIVATE_H
#define _BZLIB_PRIVATE_H
#include <stdlib.h>
#ifndef BZ_NO_STDIO
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#endif
#include "bzlib.h"
/*-- General stuff. --*/
#define BZ_VERSION "1.0.2, 30-Dec-2001"
typedef char Char;
typedef unsigned char Bool;
typedef unsigned char UChar;
typedef int Int32;
typedef unsigned int UInt32;
typedef short Int16;
typedef unsigned short UInt16;
#define True ((Bool)1)
#define False ((Bool)0)
#ifndef __GNUC__
#define __inline__ /* */
#endif
#ifndef BZ_NO_STDIO
extern void BZ2_bz__AssertH__fail ( int errcode );
#define AssertH(cond,errcode) \
{ if (!(cond)) BZ2_bz__AssertH__fail ( errcode ); }
#if BZ_DEBUG
#define AssertD(cond,msg) \
{ if (!(cond)) { \
fprintf ( stderr, \
"\n\nlibbzip2(debug build): internal error\n\t%s\n", msg );\
exit(1); \
}}
#else
#define AssertD(cond,msg) /* */
#endif
#define VPrintf0(zf) \
fprintf(stderr,zf)
#define VPrintf1(zf,za1) \
fprintf(stderr,zf,za1)
#define VPrintf2(zf,za1,za2) \
fprintf(stderr,zf,za1,za2)
#define VPrintf3(zf,za1,za2,za3) \
fprintf(stderr,zf,za1,za2,za3)
#define VPrintf4(zf,za1,za2,za3,za4) \
fprintf(stderr,zf,za1,za2,za3,za4)
#define VPrintf5(zf,za1,za2,za3,za4,za5) \
fprintf(stderr,zf,za1,za2,za3,za4,za5)
#else
extern void bz_internal_error ( int errcode );
#define AssertH(cond,errcode) \
{ if (!(cond)) bz_internal_error ( errcode ); }
#define AssertD(cond,msg) /* */
#define VPrintf0(zf) /* */
#define VPrintf1(zf,za1) /* */
#define VPrintf2(zf,za1,za2) /* */
#define VPrintf3(zf,za1,za2,za3) /* */
#define VPrintf4(zf,za1,za2,za3,za4) /* */
#define VPrintf5(zf,za1,za2,za3,za4,za5) /* */
#endif
#define BZALLOC(nnn) (strm->bzalloc)(strm->opaque,(nnn),1)
#define BZFREE(ppp) (strm->bzfree)(strm->opaque,(ppp))
/*-- Header bytes. --*/
#define BZ_HDR_B 0x42 /* 'B' */
#define BZ_HDR_Z 0x5a /* 'Z' */
#define BZ_HDR_h 0x68 /* 'h' */
#define BZ_HDR_0 0x30 /* '0' */
/*-- Constants for the back end. --*/
#define BZ_MAX_ALPHA_SIZE 258
#define BZ_MAX_CODE_LEN 23
#define BZ_RUNA 0
#define BZ_RUNB 1
#define BZ_N_GROUPS 6
#define BZ_G_SIZE 50
#define BZ_N_ITERS 4
#define BZ_MAX_SELECTORS (2 + (900000 / BZ_G_SIZE))
/*-- Stuff for randomising repetitive blocks. --*/
extern Int32 BZ2_rNums[512];
#define BZ_RAND_DECLS \
Int32 rNToGo; \
Int32 rTPos \
#define BZ_RAND_INIT_MASK \
s->rNToGo = 0; \
s->rTPos = 0 \
#define BZ_RAND_MASK ((s->rNToGo == 1) ? 1 : 0)
#define BZ_RAND_UPD_MASK \
if (s->rNToGo == 0) { \
s->rNToGo = BZ2_rNums[s->rTPos]; \
s->rTPos++; \
if (s->rTPos == 512) s->rTPos = 0; \
} \
s->rNToGo--;
/*-- Stuff for doing CRCs. --*/
extern UInt32 BZ2_crc32Table[256];
#define BZ_INITIALISE_CRC(crcVar) \
{ \
crcVar = 0xffffffffL; \
}
#define BZ_FINALISE_CRC(crcVar) \
{ \
crcVar = ~(crcVar); \
}
#define BZ_UPDATE_CRC(crcVar,cha) \
{ \
crcVar = (crcVar << 8) ^ \
BZ2_crc32Table[(crcVar >> 24) ^ \
((UChar)cha)]; \
}
/*-- States and modes for compression. --*/
#define BZ_M_IDLE 1
#define BZ_M_RUNNING 2
#define BZ_M_FLUSHING 3
#define BZ_M_FINISHING 4
#define BZ_S_OUTPUT 1
#define BZ_S_INPUT 2
#define BZ_N_RADIX 2
#define BZ_N_QSORT 12
#define BZ_N_SHELL 18
#define BZ_N_OVERSHOOT (BZ_N_RADIX + BZ_N_QSORT + BZ_N_SHELL + 2)
/*-- Structure holding all the compression-side stuff. --*/
typedef
struct {
/* pointer back to the struct bz_stream */
bz_stream* strm;
/* mode this stream is in, and whether inputting */
/* or outputting data */
Int32 mode;
Int32 state;
/* remembers avail_in when flush/finish requested */
UInt32 avail_in_expect;
/* for doing the block sorting */
UInt32* arr1;
UInt32* arr2;
UInt32* ftab;
Int32 origPtr;
/* aliases for arr1 and arr2 */
UInt32* ptr;
UChar* block;
UInt16* mtfv;
UChar* zbits;
/* for deciding when to use the fallback sorting algorithm */
Int32 workFactor;
/* run-length-encoding of the input */
UInt32 state_in_ch;
Int32 state_in_len;
BZ_RAND_DECLS;
/* input and output limits and current posns */
Int32 nblock;
Int32 nblockMAX;
Int32 numZ;
Int32 state_out_pos;
/* map of bytes used in block */
Int32 nInUse;
Bool inUse[256];
UChar unseqToSeq[256];
/* the buffer for bit stream creation */
UInt32 bsBuff;
Int32 bsLive;
/* block and combined CRCs */
UInt32 blockCRC;
UInt32 combinedCRC;
/* misc administratium */
Int32 verbosity;
Int32 blockNo;
Int32 blockSize100k;
/* stuff for coding the MTF values */
Int32 nMTF;
Int32 mtfFreq [BZ_MAX_ALPHA_SIZE];
UChar selector [BZ_MAX_SELECTORS];
UChar selectorMtf[BZ_MAX_SELECTORS];
UChar len [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
Int32 code [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
Int32 rfreq [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
/* second dimension: only 3 needed; 4 makes index calculations faster */
UInt32 len_pack[BZ_MAX_ALPHA_SIZE][4];
}
EState;
/*-- externs for compression. --*/
extern void
BZ2_blockSort ( EState* );
extern void
BZ2_compressBlock ( EState*, Bool );
extern void
BZ2_bsInitWrite ( EState* );
extern void
BZ2_hbAssignCodes ( Int32*, UChar*, Int32, Int32, Int32 );
extern void
BZ2_hbMakeCodeLengths ( UChar*, Int32*, Int32, Int32 );
/*-- states for decompression. --*/
#define BZ_X_IDLE 1
#define BZ_X_OUTPUT 2
#define BZ_X_MAGIC_1 10
#define BZ_X_MAGIC_2 11
#define BZ_X_MAGIC_3 12
#define BZ_X_MAGIC_4 13
#define BZ_X_BLKHDR_1 14
#define BZ_X_BLKHDR_2 15
#define BZ_X_BLKHDR_3 16
#define BZ_X_BLKHDR_4 17
#define BZ_X_BLKHDR_5 18
#define BZ_X_BLKHDR_6 19
#define BZ_X_BCRC_1 20
#define BZ_X_BCRC_2 21
#define BZ_X_BCRC_3 22
#define BZ_X_BCRC_4 23
#define BZ_X_RANDBIT 24
#define BZ_X_ORIGPTR_1 25
#define BZ_X_ORIGPTR_2 26
#define BZ_X_ORIGPTR_3 27
#define BZ_X_MAPPING_1 28
#define BZ_X_MAPPING_2 29
#define BZ_X_SELECTOR_1 30
#define BZ_X_SELECTOR_2 31
#define BZ_X_SELECTOR_3 32
#define BZ_X_CODING_1 33
#define BZ_X_CODING_2 34
#define BZ_X_CODING_3 35
#define BZ_X_MTF_1 36
#define BZ_X_MTF_2 37
#define BZ_X_MTF_3 38
#define BZ_X_MTF_4 39
#define BZ_X_MTF_5 40
#define BZ_X_MTF_6 41
#define BZ_X_ENDHDR_2 42
#define BZ_X_ENDHDR_3 43
#define BZ_X_ENDHDR_4 44
#define BZ_X_ENDHDR_5 45
#define BZ_X_ENDHDR_6 46
#define BZ_X_CCRC_1 47
#define BZ_X_CCRC_2 48
#define BZ_X_CCRC_3 49
#define BZ_X_CCRC_4 50
/*-- Constants for the fast MTF decoder. --*/
#define MTFA_SIZE 4096
#define MTFL_SIZE 16
/*-- Structure holding all the decompression-side stuff. --*/
typedef
struct {
/* pointer back to the struct bz_stream */
bz_stream* strm;
/* state indicator for this stream */
Int32 state;
/* for doing the final run-length decoding */
UChar state_out_ch;
Int32 state_out_len;
Bool blockRandomised;
BZ_RAND_DECLS;
/* the buffer for bit stream reading */
UInt32 bsBuff;
Int32 bsLive;
/* misc administratium */
Int32 blockSize100k;
Bool smallDecompress;
Int32 currBlockNo;
Int32 verbosity;
/* for undoing the Burrows-Wheeler transform */
Int32 origPtr;
UInt32 tPos;
Int32 k0;
Int32 unzftab[256];
Int32 nblock_used;
Int32 cftab[257];
Int32 cftabCopy[257];
/* for undoing the Burrows-Wheeler transform (FAST) */
UInt32 *tt;
/* for undoing the Burrows-Wheeler transform (SMALL) */
UInt16 *ll16;
UChar *ll4;
/* stored and calculated CRCs */
UInt32 storedBlockCRC;
UInt32 storedCombinedCRC;
UInt32 calculatedBlockCRC;
UInt32 calculatedCombinedCRC;
/* map of bytes used in block */
Int32 nInUse;
Bool inUse[256];
Bool inUse16[16];
UChar seqToUnseq[256];
/* for decoding the MTF values */
UChar mtfa [MTFA_SIZE];
Int32 mtfbase[256 / MTFL_SIZE];
UChar selector [BZ_MAX_SELECTORS];
UChar selectorMtf[BZ_MAX_SELECTORS];
UChar len [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
Int32 limit [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
Int32 base [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
Int32 perm [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
Int32 minLens[BZ_N_GROUPS];
/* save area for scalars in the main decompress code */
Int32 save_i;
Int32 save_j;
Int32 save_t;
Int32 save_alphaSize;
Int32 save_nGroups;
Int32 save_nSelectors;
Int32 save_EOB;
Int32 save_groupNo;
Int32 save_groupPos;
Int32 save_nextSym;
Int32 save_nblockMAX;
Int32 save_nblock;
Int32 save_es;
Int32 save_N;
Int32 save_curr;
Int32 save_zt;
Int32 save_zn;
Int32 save_zvec;
Int32 save_zj;
Int32 save_gSel;
Int32 save_gMinlen;
Int32* save_gLimit;
Int32* save_gBase;
Int32* save_gPerm;
}
DState;
/*-- Macros for decompression. --*/
#define BZ_GET_FAST(cccc) \
s->tPos = s->tt[s->tPos]; \
cccc = (UChar)(s->tPos & 0xff); \
s->tPos >>= 8;
#define BZ_GET_FAST_C(cccc) \
c_tPos = c_tt[c_tPos]; \
cccc = (UChar)(c_tPos & 0xff); \
c_tPos >>= 8;
#define SET_LL4(i,n) \
{ if (((i) & 0x1) == 0) \
s->ll4[(i) >> 1] = (s->ll4[(i) >> 1] & 0xf0) | (n); else \
s->ll4[(i) >> 1] = (s->ll4[(i) >> 1] & 0x0f) | ((n) << 4); \
}
#define GET_LL4(i) \
((((UInt32)(s->ll4[(i) >> 1])) >> (((i) << 2) & 0x4)) & 0xF)
#define SET_LL(i,n) \
{ s->ll16[i] = (UInt16)(n & 0x0000ffff); \
SET_LL4(i, n >> 16); \
}
#define GET_LL(i) \
(((UInt32)s->ll16[i]) | (GET_LL4(i) << 16))
#define BZ_GET_SMALL(cccc) \
cccc = BZ2_indexIntoF ( s->tPos, s->cftab ); \
s->tPos = GET_LL(s->tPos);
/*-- externs for decompression. --*/
extern Int32
BZ2_indexIntoF ( Int32, Int32* );
extern Int32
BZ2_decompress ( DState* );
extern void
BZ2_hbCreateDecodeTables ( Int32*, Int32*, Int32*, UChar*,
Int32, Int32, Int32 );
#endif
/*-- BZ_NO_STDIO seems to make NULL disappear on some platforms. --*/
#ifdef BZ_NO_STDIO
#ifndef NULL
#define NULL 0
#endif
#endif
/*-------------------------------------------------------------*/
/*--- end bzlib_private.h ---*/
/*-------------------------------------------------------------*/
|
Added work/src/bzip2-1.0.2/bzmore.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
#!/bin/sh
# Bzmore wrapped for bzip2,
# adapted from zmore by Philippe Troin <phil@fifi.org> for Debian GNU/Linux.
PATH="/usr/bin:$PATH"; export PATH
prog=`echo $0 | sed 's|.*/||'`
case "$prog" in
*less) more=less ;;
*) more=more ;;
esac
if test "`echo -n a`" = "-n a"; then
# looks like a SysV system:
n1=''; n2='\c'
else
n1='-n'; n2=''
fi
oldtty=`stty -g 2>/dev/null`
if stty -cbreak 2>/dev/null; then
cb='cbreak'; ncb='-cbreak'
else
# 'stty min 1' resets eof to ^a on both SunOS and SysV!
cb='min 1 -icanon'; ncb='icanon eof ^d'
fi
if test $? -eq 0 -a -n "$oldtty"; then
trap 'stty $oldtty 2>/dev/null; exit' 0 2 3 5 10 13 15
else
trap 'stty $ncb echo 2>/dev/null; exit' 0 2 3 5 10 13 15
fi
if test $# = 0; then
if test -t 0; then
echo usage: $prog files...
else
bzip2 -cdfq | eval $more
fi
else
FIRST=1
for FILE
do
if test $FIRST -eq 0; then
echo $n1 "--More--(Next file: $FILE)$n2"
stty $cb -echo 2>/dev/null
ANS=`dd bs=1 count=1 2>/dev/null`
stty $ncb echo 2>/dev/null
echo " "
if test "$ANS" = 'e' -o "$ANS" = 'q'; then
exit
fi
fi
if test "$ANS" != 's'; then
echo "------> $FILE <------"
bzip2 -cdfq "$FILE" | eval $more
fi
if test -t; then
FIRST=0
fi
done
fi
|
Added work/src/bzip2-1.0.2/bzmore.1.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
.\"Shamelessly copied from zmore.1 by Philippe Troin <phil@fifi.org>
.\"for Debian GNU/Linux
.TH BZMORE 1
.SH NAME
bzmore, bzless \- file perusal filter for crt viewing of bzip2 compressed text
.SH SYNOPSIS
.B bzmore
[ name ... ]
.br
.B bzless
[ name ... ]
.SH NOTE
In the following description,
.I bzless
and
.I less
can be used interchangeably with
.I bzmore
and
.I more.
.SH DESCRIPTION
.I Bzmore
is a filter which allows examination of compressed or plain text files
one screenful at a time on a soft-copy terminal.
.I bzmore
works on files compressed with
.I bzip2
and also on uncompressed files.
If a file does not exist,
.I bzmore
looks for a file of the same name with the addition of a .bz2 suffix.
.PP
.I Bzmore
normally pauses after each screenful, printing --More--
at the bottom of the screen.
If the user then types a carriage return, one more line is displayed.
If the user hits a space,
another screenful is displayed. Other possibilities are enumerated later.
.PP
.I Bzmore
looks in the file
.I /etc/termcap
to determine terminal characteristics,
and to determine the default window size.
On a terminal capable of displaying 24 lines,
the default window size is 22 lines.
Other sequences which may be typed when
.I bzmore
pauses, and their effects, are as follows (\fIi\fP is an optional integer
argument, defaulting to 1) :
.PP
.IP \fIi\|\fP<space>
display
.I i
more lines, (or another screenful if no argument is given)
.PP
.IP ^D
display 11 more lines (a ``scroll'').
If
.I i
is given, then the scroll size is set to \fIi\|\fP.
.PP
.IP d
same as ^D (control-D)
.PP
.IP \fIi\|\fPz
same as typing a space except that \fIi\|\fP, if present, becomes the new
window size. Note that the window size reverts back to the default at the
end of the current file.
.PP
.IP \fIi\|\fPs
skip \fIi\|\fP lines and print a screenful of lines
.PP
.IP \fIi\|\fPf
skip \fIi\fP screenfuls and print a screenful of lines
.PP
.IP "q or Q"
quit reading the current file; go on to the next (if any)
.PP
.IP "e or q"
When the prompt --More--(Next file:
.IR file )
is printed, this command causes bzmore to exit.
.PP
.IP s
When the prompt --More--(Next file:
.IR file )
is printed, this command causes bzmore to skip the next file and continue.
.PP
.IP =
Display the current line number.
.PP
.IP \fIi\|\fP/expr
search for the \fIi\|\fP-th occurrence of the regular expression \fIexpr.\fP
If the pattern is not found,
.I bzmore
goes on to the next file (if any).
Otherwise, a screenful is displayed, starting two lines before the place
where the expression was found.
The user's erase and kill characters may be used to edit the regular
expression.
Erasing back past the first column cancels the search command.
.PP
.IP \fIi\|\fPn
search for the \fIi\|\fP-th occurrence of the last regular expression entered.
.PP
.IP !command
invoke a shell with \fIcommand\|\fP.
The character `!' in "command" are replaced with the
previous shell command. The sequence "\\!" is replaced by "!".
.PP
.IP ":q or :Q"
quit reading the current file; go on to the next (if any)
(same as q or Q).
.PP
.IP .
(dot) repeat the previous command.
.PP
The commands take effect immediately, i.e., it is not necessary to
type a carriage return.
Up to the time when the command character itself is given,
the user may hit the line kill character to cancel the numerical
argument being formed.
In addition, the user may hit the erase character to redisplay the
--More-- message.
.PP
At any time when output is being sent to the terminal, the user can
hit the quit key (normally control\-\\).
.I Bzmore
will stop sending output, and will display the usual --More--
prompt.
The user may then enter one of the above commands in the normal manner.
Unfortunately, some output is lost when this is done, due to the
fact that any characters waiting in the terminal's output queue
are flushed when the quit signal occurs.
.PP
The terminal is set to
.I noecho
mode by this program so that the output can be continuous.
What you type will thus not show on your terminal, except for the / and !
commands.
.PP
If the standard output is not a teletype, then
.I bzmore
acts just like
.I bzcat,
except that a header is printed before each file.
.SH FILES
.DT
/etc/termcap Terminal data base
.SH "SEE ALSO"
more(1), less(1), bzip2(1), bzdiff(1), bzgrep(1)
|
Added work/src/bzip2-1.0.2/compress.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
|
/*-------------------------------------------------------------*/
/*--- Compression machinery (not incl block sorting) ---*/
/*--- compress.c ---*/
/*-------------------------------------------------------------*/
/*--
This file is a part of bzip2 and/or libbzip2, a program and
library for lossless, block-sorting data compression.
Copyright (C) 1996-2002 Julian R Seward. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.
3. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
4. The name of the author may not be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Julian Seward, Cambridge, UK.
jseward@acm.org
bzip2/libbzip2 version 1.0 of 21 March 2000
This program is based on (at least) the work of:
Mike Burrows
David Wheeler
Peter Fenwick
Alistair Moffat
Radford Neal
Ian H. Witten
Robert Sedgewick
Jon L. Bentley
For more information on these sources, see the manual.
--*/
/*--
CHANGES
~~~~~~~
0.9.0 -- original version.
0.9.0a/b -- no changes in this file.
0.9.0c
* changed setting of nGroups in sendMTFValues() so as to
do a bit better on small files
--*/
#include "bzlib_private.h"
/*---------------------------------------------------*/
/*--- Bit stream I/O ---*/
/*---------------------------------------------------*/
/*---------------------------------------------------*/
void BZ2_bsInitWrite ( EState* s )
{
s->bsLive = 0;
s->bsBuff = 0;
}
/*---------------------------------------------------*/
static
void bsFinishWrite ( EState* s )
{
while (s->bsLive > 0) {
s->zbits[s->numZ] = (UChar)(s->bsBuff >> 24);
s->numZ++;
s->bsBuff <<= 8;
s->bsLive -= 8;
}
}
/*---------------------------------------------------*/
#define bsNEEDW(nz) \
{ \
while (s->bsLive >= 8) { \
s->zbits[s->numZ] \
= (UChar)(s->bsBuff >> 24); \
s->numZ++; \
s->bsBuff <<= 8; \
s->bsLive -= 8; \
} \
}
/*---------------------------------------------------*/
static
__inline__
void bsW ( EState* s, Int32 n, UInt32 v )
{
bsNEEDW ( n );
s->bsBuff |= (v << (32 - s->bsLive - n));
s->bsLive += n;
}
/*---------------------------------------------------*/
static
void bsPutUInt32 ( EState* s, UInt32 u )
{
bsW ( s, 8, (u >> 24) & 0xffL );
bsW ( s, 8, (u >> 16) & 0xffL );
bsW ( s, 8, (u >> 8) & 0xffL );
bsW ( s, 8, u & 0xffL );
}
/*---------------------------------------------------*/
static
void bsPutUChar ( EState* s, UChar c )
{
bsW( s, 8, (UInt32)c );
}
/*---------------------------------------------------*/
/*--- The back end proper ---*/
/*---------------------------------------------------*/
/*---------------------------------------------------*/
static
void makeMaps_e ( EState* s )
{
Int32 i;
s->nInUse = 0;
for (i = 0; i < 256; i++)
if (s->inUse[i]) {
s->unseqToSeq[i] = s->nInUse;
s->nInUse++;
}
}
/*---------------------------------------------------*/
static
void generateMTFValues ( EState* s )
{
UChar yy[256];
Int32 i, j;
Int32 zPend;
Int32 wr;
Int32 EOB;
/*
After sorting (eg, here),
s->arr1 [ 0 .. s->nblock-1 ] holds sorted order,
and
((UChar*)s->arr2) [ 0 .. s->nblock-1 ]
holds the original block data.
The first thing to do is generate the MTF values,
and put them in
((UInt16*)s->arr1) [ 0 .. s->nblock-1 ].
Because there are strictly fewer or equal MTF values
than block values, ptr values in this area are overwritten
with MTF values only when they are no longer needed.
The final compressed bitstream is generated into the
area starting at
(UChar*) (&((UChar*)s->arr2)[s->nblock])
These storage aliases are set up in bzCompressInit(),
except for the last one, which is arranged in
compressBlock().
*/
UInt32* ptr = s->ptr;
UChar* block = s->block;
UInt16* mtfv = s->mtfv;
makeMaps_e ( s );
EOB = s->nInUse+1;
for (i = 0; i <= EOB; i++) s->mtfFreq[i] = 0;
wr = 0;
zPend = 0;
for (i = 0; i < s->nInUse; i++) yy[i] = (UChar) i;
for (i = 0; i < s->nblock; i++) {
UChar ll_i;
AssertD ( wr <= i, "generateMTFValues(1)" );
j = ptr[i]-1; if (j < 0) j += s->nblock;
ll_i = s->unseqToSeq[block[j]];
AssertD ( ll_i < s->nInUse, "generateMTFValues(2a)" );
if (yy[0] == ll_i) {
zPend++;
} else {
if (zPend > 0) {
zPend--;
while (True) {
if (zPend & 1) {
mtfv[wr] = BZ_RUNB; wr++;
s->mtfFreq[BZ_RUNB]++;
} else {
mtfv[wr] = BZ_RUNA; wr++;
s->mtfFreq[BZ_RUNA]++;
}
if (zPend < 2) break;
zPend = (zPend - 2) / 2;
};
zPend = 0;
}
{
register UChar rtmp;
register UChar* ryy_j;
register UChar rll_i;
rtmp = yy[1];
yy[1] = yy[0];
ryy_j = &(yy[1]);
rll_i = ll_i;
while ( rll_i != rtmp ) {
register UChar rtmp2;
ryy_j++;
rtmp2 = rtmp;
rtmp = *ryy_j;
*ryy_j = rtmp2;
};
yy[0] = rtmp;
j = ryy_j - &(yy[0]);
mtfv[wr] = j+1; wr++; s->mtfFreq[j+1]++;
}
}
}
if (zPend > 0) {
zPend--;
while (True) {
if (zPend & 1) {
mtfv[wr] = BZ_RUNB; wr++;
s->mtfFreq[BZ_RUNB]++;
} else {
mtfv[wr] = BZ_RUNA; wr++;
s->mtfFreq[BZ_RUNA]++;
}
if (zPend < 2) break;
zPend = (zPend - 2) / 2;
};
zPend = 0;
}
mtfv[wr] = EOB; wr++; s->mtfFreq[EOB]++;
s->nMTF = wr;
}
/*---------------------------------------------------*/
#define BZ_LESSER_ICOST 0
#define BZ_GREATER_ICOST 15
static
void sendMTFValues ( EState* s )
{
Int32 v, t, i, j, gs, ge, totc, bt, bc, iter;
Int32 nSelectors, alphaSize, minLen, maxLen, selCtr;
Int32 nGroups, nBytes;
/*--
UChar len [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
is a global since the decoder also needs it.
Int32 code[BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
Int32 rfreq[BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
are also globals only used in this proc.
Made global to keep stack frame size small.
--*/
UInt16 cost[BZ_N_GROUPS];
Int32 fave[BZ_N_GROUPS];
UInt16* mtfv = s->mtfv;
if (s->verbosity >= 3)
VPrintf3( " %d in block, %d after MTF & 1-2 coding, "
"%d+2 syms in use\n",
s->nblock, s->nMTF, s->nInUse );
alphaSize = s->nInUse+2;
for (t = 0; t < BZ_N_GROUPS; t++)
for (v = 0; v < alphaSize; v++)
s->len[t][v] = BZ_GREATER_ICOST;
/*--- Decide how many coding tables to use ---*/
AssertH ( s->nMTF > 0, 3001 );
if (s->nMTF < 200) nGroups = 2; else
if (s->nMTF < 600) nGroups = 3; else
if (s->nMTF < 1200) nGroups = 4; else
if (s->nMTF < 2400) nGroups = 5; else
nGroups = 6;
/*--- Generate an initial set of coding tables ---*/
{
Int32 nPart, remF, tFreq, aFreq;
nPart = nGroups;
remF = s->nMTF;
gs = 0;
while (nPart > 0) {
tFreq = remF / nPart;
ge = gs-1;
aFreq = 0;
while (aFreq < tFreq && ge < alphaSize-1) {
ge++;
aFreq += s->mtfFreq[ge];
}
if (ge > gs
&& nPart != nGroups && nPart != 1
&& ((nGroups-nPart) % 2 == 1)) {
aFreq -= s->mtfFreq[ge];
ge--;
}
if (s->verbosity >= 3)
VPrintf5( " initial group %d, [%d .. %d], "
"has %d syms (%4.1f%%)\n",
nPart, gs, ge, aFreq,
(100.0 * (float)aFreq) / (float)(s->nMTF) );
for (v = 0; v < alphaSize; v++)
if (v >= gs && v <= ge)
s->len[nPart-1][v] = BZ_LESSER_ICOST; else
s->len[nPart-1][v] = BZ_GREATER_ICOST;
nPart--;
gs = ge+1;
remF -= aFreq;
}
}
/*---
Iterate up to BZ_N_ITERS times to improve the tables.
---*/
for (iter = 0; iter < BZ_N_ITERS; iter++) {
for (t = 0; t < nGroups; t++) fave[t] = 0;
for (t = 0; t < nGroups; t++)
for (v = 0; v < alphaSize; v++)
s->rfreq[t][v] = 0;
/*---
Set up an auxiliary length table which is used to fast-track
the common case (nGroups == 6).
---*/
if (nGroups == 6) {
for (v = 0; v < alphaSize; v++) {
s->len_pack[v][0] = (s->len[1][v] << 16) | s->len[0][v];
s->len_pack[v][1] = (s->len[3][v] << 16) | s->len[2][v];
s->len_pack[v][2] = (s->len[5][v] << 16) | s->len[4][v];
}
}
nSelectors = 0;
totc = 0;
gs = 0;
while (True) {
/*--- Set group start & end marks. --*/
if (gs >= s->nMTF) break;
ge = gs + BZ_G_SIZE - 1;
if (ge >= s->nMTF) ge = s->nMTF-1;
/*--
Calculate the cost of this group as coded
by each of the coding tables.
--*/
for (t = 0; t < nGroups; t++) cost[t] = 0;
if (nGroups == 6 && 50 == ge-gs+1) {
/*--- fast track the common case ---*/
register UInt32 cost01, cost23, cost45;
register UInt16 icv;
cost01 = cost23 = cost45 = 0;
# define BZ_ITER(nn) \
icv = mtfv[gs+(nn)]; \
cost01 += s->len_pack[icv][0]; \
cost23 += s->len_pack[icv][1]; \
cost45 += s->len_pack[icv][2]; \
BZ_ITER(0); BZ_ITER(1); BZ_ITER(2); BZ_ITER(3); BZ_ITER(4);
BZ_ITER(5); BZ_ITER(6); BZ_ITER(7); BZ_ITER(8); BZ_ITER(9);
BZ_ITER(10); BZ_ITER(11); BZ_ITER(12); BZ_ITER(13); BZ_ITER(14);
BZ_ITER(15); BZ_ITER(16); BZ_ITER(17); BZ_ITER(18); BZ_ITER(19);
BZ_ITER(20); BZ_ITER(21); BZ_ITER(22); BZ_ITER(23); BZ_ITER(24);
BZ_ITER(25); BZ_ITER(26); BZ_ITER(27); BZ_ITER(28); BZ_ITER(29);
BZ_ITER(30); BZ_ITER(31); BZ_ITER(32); BZ_ITER(33); BZ_ITER(34);
BZ_ITER(35); BZ_ITER(36); BZ_ITER(37); BZ_ITER(38); BZ_ITER(39);
BZ_ITER(40); BZ_ITER(41); BZ_ITER(42); BZ_ITER(43); BZ_ITER(44);
BZ_ITER(45); BZ_ITER(46); BZ_ITER(47); BZ_ITER(48); BZ_ITER(49);
# undef BZ_ITER
cost[0] = cost01 & 0xffff; cost[1] = cost01 >> 16;
cost[2] = cost23 & 0xffff; cost[3] = cost23 >> 16;
cost[4] = cost45 & 0xffff; cost[5] = cost45 >> 16;
} else {
/*--- slow version which correctly handles all situations ---*/
for (i = gs; i <= ge; i++) {
UInt16 icv = mtfv[i];
for (t = 0; t < nGroups; t++) cost[t] += s->len[t][icv];
}
}
/*--
Find the coding table which is best for this group,
and record its identity in the selector table.
--*/
bc = 999999999; bt = -1;
for (t = 0; t < nGroups; t++)
if (cost[t] < bc) { bc = cost[t]; bt = t; };
totc += bc;
fave[bt]++;
s->selector[nSelectors] = bt;
nSelectors++;
/*--
Increment the symbol frequencies for the selected table.
--*/
if (nGroups == 6 && 50 == ge-gs+1) {
/*--- fast track the common case ---*/
# define BZ_ITUR(nn) s->rfreq[bt][ mtfv[gs+(nn)] ]++
BZ_ITUR(0); BZ_ITUR(1); BZ_ITUR(2); BZ_ITUR(3); BZ_ITUR(4);
BZ_ITUR(5); BZ_ITUR(6); BZ_ITUR(7); BZ_ITUR(8); BZ_ITUR(9);
BZ_ITUR(10); BZ_ITUR(11); BZ_ITUR(12); BZ_ITUR(13); BZ_ITUR(14);
BZ_ITUR(15); BZ_ITUR(16); BZ_ITUR(17); BZ_ITUR(18); BZ_ITUR(19);
BZ_ITUR(20); BZ_ITUR(21); BZ_ITUR(22); BZ_ITUR(23); BZ_ITUR(24);
BZ_ITUR(25); BZ_ITUR(26); BZ_ITUR(27); BZ_ITUR(28); BZ_ITUR(29);
BZ_ITUR(30); BZ_ITUR(31); BZ_ITUR(32); BZ_ITUR(33); BZ_ITUR(34);
BZ_ITUR(35); BZ_ITUR(36); BZ_ITUR(37); BZ_ITUR(38); BZ_ITUR(39);
BZ_ITUR(40); BZ_ITUR(41); BZ_ITUR(42); BZ_ITUR(43); BZ_ITUR(44);
BZ_ITUR(45); BZ_ITUR(46); BZ_ITUR(47); BZ_ITUR(48); BZ_ITUR(49);
# undef BZ_ITUR
} else {
/*--- slow version which correctly handles all situations ---*/
for (i = gs; i <= ge; i++)
s->rfreq[bt][ mtfv[i] ]++;
}
gs = ge+1;
}
if (s->verbosity >= 3) {
VPrintf2 ( " pass %d: size is %d, grp uses are ",
iter+1, totc/8 );
for (t = 0; t < nGroups; t++)
VPrintf1 ( "%d ", fave[t] );
VPrintf0 ( "\n" );
}
/*--
Recompute the tables based on the accumulated frequencies.
--*/
for (t = 0; t < nGroups; t++)
BZ2_hbMakeCodeLengths ( &(s->len[t][0]), &(s->rfreq[t][0]),
alphaSize, 20 );
}
AssertH( nGroups < 8, 3002 );
AssertH( nSelectors < 32768 &&
nSelectors <= (2 + (900000 / BZ_G_SIZE)),
3003 );
/*--- Compute MTF values for the selectors. ---*/
{
UChar pos[BZ_N_GROUPS], ll_i, tmp2, tmp;
for (i = 0; i < nGroups; i++) pos[i] = i;
for (i = 0; i < nSelectors; i++) {
ll_i = s->selector[i];
j = 0;
tmp = pos[j];
while ( ll_i != tmp ) {
j++;
tmp2 = tmp;
tmp = pos[j];
pos[j] = tmp2;
};
pos[0] = tmp;
s->selectorMtf[i] = j;
}
};
/*--- Assign actual codes for the tables. --*/
for (t = 0; t < nGroups; t++) {
minLen = 32;
maxLen = 0;
for (i = 0; i < alphaSize; i++) {
if (s->len[t][i] > maxLen) maxLen = s->len[t][i];
if (s->len[t][i] < minLen) minLen = s->len[t][i];
}
AssertH ( !(maxLen > 20), 3004 );
AssertH ( !(minLen < 1), 3005 );
BZ2_hbAssignCodes ( &(s->code[t][0]), &(s->len[t][0]),
minLen, maxLen, alphaSize );
}
/*--- Transmit the mapping table. ---*/
{
Bool inUse16[16];
for (i = 0; i < 16; i++) {
inUse16[i] = False;
for (j = 0; j < 16; j++)
if (s->inUse[i * 16 + j]) inUse16[i] = True;
}
nBytes = s->numZ;
for (i = 0; i < 16; i++)
if (inUse16[i]) bsW(s,1,1); else bsW(s,1,0);
for (i = 0; i < 16; i++)
if (inUse16[i])
for (j = 0; j < 16; j++) {
if (s->inUse[i * 16 + j]) bsW(s,1,1); else bsW(s,1,0);
}
if (s->verbosity >= 3)
VPrintf1( " bytes: mapping %d, ", s->numZ-nBytes );
}
/*--- Now the selectors. ---*/
nBytes = s->numZ;
bsW ( s, 3, nGroups );
bsW ( s, 15, nSelectors );
for (i = 0; i < nSelectors; i++) {
for (j = 0; j < s->selectorMtf[i]; j++) bsW(s,1,1);
bsW(s,1,0);
}
if (s->verbosity >= 3)
VPrintf1( "selectors %d, ", s->numZ-nBytes );
/*--- Now the coding tables. ---*/
nBytes = s->numZ;
for (t = 0; t < nGroups; t++) {
Int32 curr = s->len[t][0];
bsW ( s, 5, curr );
for (i = 0; i < alphaSize; i++) {
while (curr < s->len[t][i]) { bsW(s,2,2); curr++; /* 10 */ };
while (curr > s->len[t][i]) { bsW(s,2,3); curr--; /* 11 */ };
bsW ( s, 1, 0 );
}
}
if (s->verbosity >= 3)
VPrintf1 ( "code lengths %d, ", s->numZ-nBytes );
/*--- And finally, the block data proper ---*/
nBytes = s->numZ;
selCtr = 0;
gs = 0;
while (True) {
if (gs >= s->nMTF) break;
ge = gs + BZ_G_SIZE - 1;
if (ge >= s->nMTF) ge = s->nMTF-1;
AssertH ( s->selector[selCtr] < nGroups, 3006 );
if (nGroups == 6 && 50 == ge-gs+1) {
/*--- fast track the common case ---*/
UInt16 mtfv_i;
UChar* s_len_sel_selCtr
= &(s->len[s->selector[selCtr]][0]);
Int32* s_code_sel_selCtr
= &(s->code[s->selector[selCtr]][0]);
# define BZ_ITAH(nn) \
mtfv_i = mtfv[gs+(nn)]; \
bsW ( s, \
s_len_sel_selCtr[mtfv_i], \
s_code_sel_selCtr[mtfv_i] )
BZ_ITAH(0); BZ_ITAH(1); BZ_ITAH(2); BZ_ITAH(3); BZ_ITAH(4);
BZ_ITAH(5); BZ_ITAH(6); BZ_ITAH(7); BZ_ITAH(8); BZ_ITAH(9);
BZ_ITAH(10); BZ_ITAH(11); BZ_ITAH(12); BZ_ITAH(13); BZ_ITAH(14);
BZ_ITAH(15); BZ_ITAH(16); BZ_ITAH(17); BZ_ITAH(18); BZ_ITAH(19);
BZ_ITAH(20); BZ_ITAH(21); BZ_ITAH(22); BZ_ITAH(23); BZ_ITAH(24);
BZ_ITAH(25); BZ_ITAH(26); BZ_ITAH(27); BZ_ITAH(28); BZ_ITAH(29);
BZ_ITAH(30); BZ_ITAH(31); BZ_ITAH(32); BZ_ITAH(33); BZ_ITAH(34);
BZ_ITAH(35); BZ_ITAH(36); BZ_ITAH(37); BZ_ITAH(38); BZ_ITAH(39);
BZ_ITAH(40); BZ_ITAH(41); BZ_ITAH(42); BZ_ITAH(43); BZ_ITAH(44);
BZ_ITAH(45); BZ_ITAH(46); BZ_ITAH(47); BZ_ITAH(48); BZ_ITAH(49);
# undef BZ_ITAH
} else {
/*--- slow version which correctly handles all situations ---*/
for (i = gs; i <= ge; i++) {
bsW ( s,
s->len [s->selector[selCtr]] [mtfv[i]],
s->code [s->selector[selCtr]] [mtfv[i]] );
}
}
gs = ge+1;
selCtr++;
}
AssertH( selCtr == nSelectors, 3007 );
if (s->verbosity >= 3)
VPrintf1( "codes %d\n", s->numZ-nBytes );
}
/*---------------------------------------------------*/
void BZ2_compressBlock ( EState* s, Bool is_last_block )
{
if (s->nblock > 0) {
BZ_FINALISE_CRC ( s->blockCRC );
s->combinedCRC = (s->combinedCRC << 1) | (s->combinedCRC >> 31);
s->combinedCRC ^= s->blockCRC;
if (s->blockNo > 1) s->numZ = 0;
if (s->verbosity >= 2)
VPrintf4( " block %d: crc = 0x%8x, "
"combined CRC = 0x%8x, size = %d\n",
s->blockNo, s->blockCRC, s->combinedCRC, s->nblock );
BZ2_blockSort ( s );
}
s->zbits = (UChar*) (&((UChar*)s->arr2)[s->nblock]);
/*-- If this is the first block, create the stream header. --*/
if (s->blockNo == 1) {
BZ2_bsInitWrite ( s );
bsPutUChar ( s, BZ_HDR_B );
bsPutUChar ( s, BZ_HDR_Z );
bsPutUChar ( s, BZ_HDR_h );
bsPutUChar ( s, (UChar)(BZ_HDR_0 + s->blockSize100k) );
}
if (s->nblock > 0) {
bsPutUChar ( s, 0x31 ); bsPutUChar ( s, 0x41 );
bsPutUChar ( s, 0x59 ); bsPutUChar ( s, 0x26 );
bsPutUChar ( s, 0x53 ); bsPutUChar ( s, 0x59 );
/*-- Now the block's CRC, so it is in a known place. --*/
bsPutUInt32 ( s, s->blockCRC );
/*--
Now a single bit indicating (non-)randomisation.
As of version 0.9.5, we use a better sorting algorithm
which makes randomisation unnecessary. So always set
the randomised bit to 'no'. Of course, the decoder
still needs to be able to handle randomised blocks
so as to maintain backwards compatibility with
older versions of bzip2.
--*/
bsW(s,1,0);
bsW ( s, 24, s->origPtr );
generateMTFValues ( s );
sendMTFValues ( s );
}
/*-- If this is the last block, add the stream trailer. --*/
if (is_last_block) {
bsPutUChar ( s, 0x17 ); bsPutUChar ( s, 0x72 );
bsPutUChar ( s, 0x45 ); bsPutUChar ( s, 0x38 );
bsPutUChar ( s, 0x50 ); bsPutUChar ( s, 0x90 );
bsPutUInt32 ( s, s->combinedCRC );
if (s->verbosity >= 2)
VPrintf1( " final combined CRC = 0x%x\n ", s->combinedCRC );
bsFinishWrite ( s );
}
}
/*-------------------------------------------------------------*/
/*--- end compress.c ---*/
/*-------------------------------------------------------------*/
|
Added work/src/bzip2-1.0.2/crctable.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
|
/*-------------------------------------------------------------*/
/*--- Table for doing CRCs ---*/
/*--- crctable.c ---*/
/*-------------------------------------------------------------*/
/*--
This file is a part of bzip2 and/or libbzip2, a program and
library for lossless, block-sorting data compression.
Copyright (C) 1996-2002 Julian R Seward. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.
3. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
4. The name of the author may not be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Julian Seward, Cambridge, UK.
jseward@acm.org
bzip2/libbzip2 version 1.0 of 21 March 2000
This program is based on (at least) the work of:
Mike Burrows
David Wheeler
Peter Fenwick
Alistair Moffat
Radford Neal
Ian H. Witten
Robert Sedgewick
Jon L. Bentley
For more information on these sources, see the manual.
--*/
#include "bzlib_private.h"
/*--
I think this is an implementation of the AUTODIN-II,
Ethernet & FDDI 32-bit CRC standard. Vaguely derived
from code by Rob Warnock, in Section 51 of the
comp.compression FAQ.
--*/
UInt32 BZ2_crc32Table[256] = {
/*-- Ugly, innit? --*/
0x00000000L, 0x04c11db7L, 0x09823b6eL, 0x0d4326d9L,
0x130476dcL, 0x17c56b6bL, 0x1a864db2L, 0x1e475005L,
0x2608edb8L, 0x22c9f00fL, 0x2f8ad6d6L, 0x2b4bcb61L,
0x350c9b64L, 0x31cd86d3L, 0x3c8ea00aL, 0x384fbdbdL,
0x4c11db70L, 0x48d0c6c7L, 0x4593e01eL, 0x4152fda9L,
0x5f15adacL, 0x5bd4b01bL, 0x569796c2L, 0x52568b75L,
0x6a1936c8L, 0x6ed82b7fL, 0x639b0da6L, 0x675a1011L,
0x791d4014L, 0x7ddc5da3L, 0x709f7b7aL, 0x745e66cdL,
0x9823b6e0L, 0x9ce2ab57L, 0x91a18d8eL, 0x95609039L,
0x8b27c03cL, 0x8fe6dd8bL, 0x82a5fb52L, 0x8664e6e5L,
0xbe2b5b58L, 0xbaea46efL, 0xb7a96036L, 0xb3687d81L,
0xad2f2d84L, 0xa9ee3033L, 0xa4ad16eaL, 0xa06c0b5dL,
0xd4326d90L, 0xd0f37027L, 0xddb056feL, 0xd9714b49L,
0xc7361b4cL, 0xc3f706fbL, 0xceb42022L, 0xca753d95L,
0xf23a8028L, 0xf6fb9d9fL, 0xfbb8bb46L, 0xff79a6f1L,
0xe13ef6f4L, 0xe5ffeb43L, 0xe8bccd9aL, 0xec7dd02dL,
0x34867077L, 0x30476dc0L, 0x3d044b19L, 0x39c556aeL,
0x278206abL, 0x23431b1cL, 0x2e003dc5L, 0x2ac12072L,
0x128e9dcfL, 0x164f8078L, 0x1b0ca6a1L, 0x1fcdbb16L,
0x018aeb13L, 0x054bf6a4L, 0x0808d07dL, 0x0cc9cdcaL,
0x7897ab07L, 0x7c56b6b0L, 0x71159069L, 0x75d48ddeL,
0x6b93dddbL, 0x6f52c06cL, 0x6211e6b5L, 0x66d0fb02L,
0x5e9f46bfL, 0x5a5e5b08L, 0x571d7dd1L, 0x53dc6066L,
0x4d9b3063L, 0x495a2dd4L, 0x44190b0dL, 0x40d816baL,
0xaca5c697L, 0xa864db20L, 0xa527fdf9L, 0xa1e6e04eL,
0xbfa1b04bL, 0xbb60adfcL, 0xb6238b25L, 0xb2e29692L,
0x8aad2b2fL, 0x8e6c3698L, 0x832f1041L, 0x87ee0df6L,
0x99a95df3L, 0x9d684044L, 0x902b669dL, 0x94ea7b2aL,
0xe0b41de7L, 0xe4750050L, 0xe9362689L, 0xedf73b3eL,
0xf3b06b3bL, 0xf771768cL, 0xfa325055L, 0xfef34de2L,
0xc6bcf05fL, 0xc27dede8L, 0xcf3ecb31L, 0xcbffd686L,
0xd5b88683L, 0xd1799b34L, 0xdc3abdedL, 0xd8fba05aL,
0x690ce0eeL, 0x6dcdfd59L, 0x608edb80L, 0x644fc637L,
0x7a089632L, 0x7ec98b85L, 0x738aad5cL, 0x774bb0ebL,
0x4f040d56L, 0x4bc510e1L, 0x46863638L, 0x42472b8fL,
0x5c007b8aL, 0x58c1663dL, 0x558240e4L, 0x51435d53L,
0x251d3b9eL, 0x21dc2629L, 0x2c9f00f0L, 0x285e1d47L,
0x36194d42L, 0x32d850f5L, 0x3f9b762cL, 0x3b5a6b9bL,
0x0315d626L, 0x07d4cb91L, 0x0a97ed48L, 0x0e56f0ffL,
0x1011a0faL, 0x14d0bd4dL, 0x19939b94L, 0x1d528623L,
0xf12f560eL, 0xf5ee4bb9L, 0xf8ad6d60L, 0xfc6c70d7L,
0xe22b20d2L, 0xe6ea3d65L, 0xeba91bbcL, 0xef68060bL,
0xd727bbb6L, 0xd3e6a601L, 0xdea580d8L, 0xda649d6fL,
0xc423cd6aL, 0xc0e2d0ddL, 0xcda1f604L, 0xc960ebb3L,
0xbd3e8d7eL, 0xb9ff90c9L, 0xb4bcb610L, 0xb07daba7L,
0xae3afba2L, 0xaafbe615L, 0xa7b8c0ccL, 0xa379dd7bL,
0x9b3660c6L, 0x9ff77d71L, 0x92b45ba8L, 0x9675461fL,
0x8832161aL, 0x8cf30badL, 0x81b02d74L, 0x857130c3L,
0x5d8a9099L, 0x594b8d2eL, 0x5408abf7L, 0x50c9b640L,
0x4e8ee645L, 0x4a4ffbf2L, 0x470cdd2bL, 0x43cdc09cL,
0x7b827d21L, 0x7f436096L, 0x7200464fL, 0x76c15bf8L,
0x68860bfdL, 0x6c47164aL, 0x61043093L, 0x65c52d24L,
0x119b4be9L, 0x155a565eL, 0x18197087L, 0x1cd86d30L,
0x029f3d35L, 0x065e2082L, 0x0b1d065bL, 0x0fdc1becL,
0x3793a651L, 0x3352bbe6L, 0x3e119d3fL, 0x3ad08088L,
0x2497d08dL, 0x2056cd3aL, 0x2d15ebe3L, 0x29d4f654L,
0xc5a92679L, 0xc1683bceL, 0xcc2b1d17L, 0xc8ea00a0L,
0xd6ad50a5L, 0xd26c4d12L, 0xdf2f6bcbL, 0xdbee767cL,
0xe3a1cbc1L, 0xe760d676L, 0xea23f0afL, 0xeee2ed18L,
0xf0a5bd1dL, 0xf464a0aaL, 0xf9278673L, 0xfde69bc4L,
0x89b8fd09L, 0x8d79e0beL, 0x803ac667L, 0x84fbdbd0L,
0x9abc8bd5L, 0x9e7d9662L, 0x933eb0bbL, 0x97ffad0cL,
0xafb010b1L, 0xab710d06L, 0xa6322bdfL, 0xa2f33668L,
0xbcb4666dL, 0xb8757bdaL, 0xb5365d03L, 0xb1f740b4L
};
/*-------------------------------------------------------------*/
/*--- end crctable.c ---*/
/*-------------------------------------------------------------*/
|
Added work/src/bzip2-1.0.2/decompress.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
|
/*-------------------------------------------------------------*/
/*--- Decompression machinery ---*/
/*--- decompress.c ---*/
/*-------------------------------------------------------------*/
/*--
This file is a part of bzip2 and/or libbzip2, a program and
library for lossless, block-sorting data compression.
Copyright (C) 1996-2002 Julian R Seward. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.
3. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
4. The name of the author may not be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Julian Seward, Cambridge, UK.
jseward@acm.org
bzip2/libbzip2 version 1.0 of 21 March 2000
This program is based on (at least) the work of:
Mike Burrows
David Wheeler
Peter Fenwick
Alistair Moffat
Radford Neal
Ian H. Witten
Robert Sedgewick
Jon L. Bentley
For more information on these sources, see the manual.
--*/
#include "bzlib_private.h"
/*---------------------------------------------------*/
static
void makeMaps_d ( DState* s )
{
Int32 i;
s->nInUse = 0;
for (i = 0; i < 256; i++)
if (s->inUse[i]) {
s->seqToUnseq[s->nInUse] = i;
s->nInUse++;
}
}
/*---------------------------------------------------*/
#define RETURN(rrr) \
{ retVal = rrr; goto save_state_and_return; };
#define GET_BITS(lll,vvv,nnn) \
case lll: s->state = lll; \
while (True) { \
if (s->bsLive >= nnn) { \
UInt32 v; \
v = (s->bsBuff >> \
(s->bsLive-nnn)) & ((1 << nnn)-1); \
s->bsLive -= nnn; \
vvv = v; \
break; \
} \
if (s->strm->avail_in == 0) RETURN(BZ_OK); \
s->bsBuff \
= (s->bsBuff << 8) | \
((UInt32) \
(*((UChar*)(s->strm->next_in)))); \
s->bsLive += 8; \
s->strm->next_in++; \
s->strm->avail_in--; \
s->strm->total_in_lo32++; \
if (s->strm->total_in_lo32 == 0) \
s->strm->total_in_hi32++; \
}
#define GET_UCHAR(lll,uuu) \
GET_BITS(lll,uuu,8)
#define GET_BIT(lll,uuu) \
GET_BITS(lll,uuu,1)
/*---------------------------------------------------*/
#define GET_MTF_VAL(label1,label2,lval) \
{ \
if (groupPos == 0) { \
groupNo++; \
if (groupNo >= nSelectors) \
RETURN(BZ_DATA_ERROR); \
groupPos = BZ_G_SIZE; \
gSel = s->selector[groupNo]; \
gMinlen = s->minLens[gSel]; \
gLimit = &(s->limit[gSel][0]); \
gPerm = &(s->perm[gSel][0]); \
gBase = &(s->base[gSel][0]); \
} \
groupPos--; \
zn = gMinlen; \
GET_BITS(label1, zvec, zn); \
while (1) { \
if (zn > 20 /* the longest code */) \
RETURN(BZ_DATA_ERROR); \
if (zvec <= gLimit[zn]) break; \
zn++; \
GET_BIT(label2, zj); \
zvec = (zvec << 1) | zj; \
}; \
if (zvec - gBase[zn] < 0 \
|| zvec - gBase[zn] >= BZ_MAX_ALPHA_SIZE) \
RETURN(BZ_DATA_ERROR); \
lval = gPerm[zvec - gBase[zn]]; \
}
/*---------------------------------------------------*/
Int32 BZ2_decompress ( DState* s )
{
UChar uc;
Int32 retVal;
Int32 minLen, maxLen;
bz_stream* strm = s->strm;
/* stuff that needs to be saved/restored */
Int32 i;
Int32 j;
Int32 t;
Int32 alphaSize;
Int32 nGroups;
Int32 nSelectors;
Int32 EOB;
Int32 groupNo;
Int32 groupPos;
Int32 nextSym;
Int32 nblockMAX;
Int32 nblock;
Int32 es;
Int32 N;
Int32 curr;
Int32 zt;
Int32 zn;
Int32 zvec;
Int32 zj;
Int32 gSel;
Int32 gMinlen;
Int32* gLimit;
Int32* gBase;
Int32* gPerm;
if (s->state == BZ_X_MAGIC_1) {
/*initialise the save area*/
s->save_i = 0;
s->save_j = 0;
s->save_t = 0;
s->save_alphaSize = 0;
s->save_nGroups = 0;
s->save_nSelectors = 0;
s->save_EOB = 0;
s->save_groupNo = 0;
s->save_groupPos = 0;
s->save_nextSym = 0;
s->save_nblockMAX = 0;
s->save_nblock = 0;
s->save_es = 0;
s->save_N = 0;
s->save_curr = 0;
s->save_zt = 0;
s->save_zn = 0;
s->save_zvec = 0;
s->save_zj = 0;
s->save_gSel = 0;
s->save_gMinlen = 0;
s->save_gLimit = NULL;
s->save_gBase = NULL;
s->save_gPerm = NULL;
}
/*restore from the save area*/
i = s->save_i;
j = s->save_j;
t = s->save_t;
alphaSize = s->save_alphaSize;
nGroups = s->save_nGroups;
nSelectors = s->save_nSelectors;
EOB = s->save_EOB;
groupNo = s->save_groupNo;
groupPos = s->save_groupPos;
nextSym = s->save_nextSym;
nblockMAX = s->save_nblockMAX;
nblock = s->save_nblock;
es = s->save_es;
N = s->save_N;
curr = s->save_curr;
zt = s->save_zt;
zn = s->save_zn;
zvec = s->save_zvec;
zj = s->save_zj;
gSel = s->save_gSel;
gMinlen = s->save_gMinlen;
gLimit = s->save_gLimit;
gBase = s->save_gBase;
gPerm = s->save_gPerm;
retVal = BZ_OK;
switch (s->state) {
GET_UCHAR(BZ_X_MAGIC_1, uc);
if (uc != BZ_HDR_B) RETURN(BZ_DATA_ERROR_MAGIC);
GET_UCHAR(BZ_X_MAGIC_2, uc);
if (uc != BZ_HDR_Z) RETURN(BZ_DATA_ERROR_MAGIC);
GET_UCHAR(BZ_X_MAGIC_3, uc)
if (uc != BZ_HDR_h) RETURN(BZ_DATA_ERROR_MAGIC);
GET_BITS(BZ_X_MAGIC_4, s->blockSize100k, 8)
if (s->blockSize100k < (BZ_HDR_0 + 1) ||
s->blockSize100k > (BZ_HDR_0 + 9)) RETURN(BZ_DATA_ERROR_MAGIC);
s->blockSize100k -= BZ_HDR_0;
if (s->smallDecompress) {
s->ll16 = BZALLOC( s->blockSize100k * 100000 * sizeof(UInt16) );
s->ll4 = BZALLOC(
((1 + s->blockSize100k * 100000) >> 1) * sizeof(UChar)
);
if (s->ll16 == NULL || s->ll4 == NULL) RETURN(BZ_MEM_ERROR);
} else {
s->tt = BZALLOC( s->blockSize100k * 100000 * sizeof(Int32) );
if (s->tt == NULL) RETURN(BZ_MEM_ERROR);
}
GET_UCHAR(BZ_X_BLKHDR_1, uc);
if (uc == 0x17) goto endhdr_2;
if (uc != 0x31) RETURN(BZ_DATA_ERROR);
GET_UCHAR(BZ_X_BLKHDR_2, uc);
if (uc != 0x41) RETURN(BZ_DATA_ERROR);
GET_UCHAR(BZ_X_BLKHDR_3, uc);
if (uc != 0x59) RETURN(BZ_DATA_ERROR);
GET_UCHAR(BZ_X_BLKHDR_4, uc);
if (uc != 0x26) RETURN(BZ_DATA_ERROR);
GET_UCHAR(BZ_X_BLKHDR_5, uc);
if (uc != 0x53) RETURN(BZ_DATA_ERROR);
GET_UCHAR(BZ_X_BLKHDR_6, uc);
if (uc != 0x59) RETURN(BZ_DATA_ERROR);
s->currBlockNo++;
if (s->verbosity >= 2)
VPrintf1 ( "\n [%d: huff+mtf ", s->currBlockNo );
s->storedBlockCRC = 0;
GET_UCHAR(BZ_X_BCRC_1, uc);
s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc);
GET_UCHAR(BZ_X_BCRC_2, uc);
s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc);
GET_UCHAR(BZ_X_BCRC_3, uc);
s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc);
GET_UCHAR(BZ_X_BCRC_4, uc);
s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc);
GET_BITS(BZ_X_RANDBIT, s->blockRandomised, 1);
s->origPtr = 0;
GET_UCHAR(BZ_X_ORIGPTR_1, uc);
s->origPtr = (s->origPtr << 8) | ((Int32)uc);
GET_UCHAR(BZ_X_ORIGPTR_2, uc);
s->origPtr = (s->origPtr << 8) | ((Int32)uc);
GET_UCHAR(BZ_X_ORIGPTR_3, uc);
s->origPtr = (s->origPtr << 8) | ((Int32)uc);
if (s->origPtr < 0)
RETURN(BZ_DATA_ERROR);
if (s->origPtr > 10 + 100000*s->blockSize100k)
RETURN(BZ_DATA_ERROR);
/*--- Receive the mapping table ---*/
for (i = 0; i < 16; i++) {
GET_BIT(BZ_X_MAPPING_1, uc);
if (uc == 1)
s->inUse16[i] = True; else
s->inUse16[i] = False;
}
for (i = 0; i < 256; i++) s->inUse[i] = False;
for (i = 0; i < 16; i++)
if (s->inUse16[i])
for (j = 0; j < 16; j++) {
GET_BIT(BZ_X_MAPPING_2, uc);
if (uc == 1) s->inUse[i * 16 + j] = True;
}
makeMaps_d ( s );
if (s->nInUse == 0) RETURN(BZ_DATA_ERROR);
alphaSize = s->nInUse+2;
/*--- Now the selectors ---*/
GET_BITS(BZ_X_SELECTOR_1, nGroups, 3);
if (nGroups < 2 || nGroups > 6) RETURN(BZ_DATA_ERROR);
GET_BITS(BZ_X_SELECTOR_2, nSelectors, 15);
if (nSelectors < 1) RETURN(BZ_DATA_ERROR);
for (i = 0; i < nSelectors; i++) {
j = 0;
while (True) {
GET_BIT(BZ_X_SELECTOR_3, uc);
if (uc == 0) break;
j++;
if (j >= nGroups) RETURN(BZ_DATA_ERROR);
}
s->selectorMtf[i] = j;
}
/*--- Undo the MTF values for the selectors. ---*/
{
UChar pos[BZ_N_GROUPS], tmp, v;
for (v = 0; v < nGroups; v++) pos[v] = v;
for (i = 0; i < nSelectors; i++) {
v = s->selectorMtf[i];
tmp = pos[v];
while (v > 0) { pos[v] = pos[v-1]; v--; }
pos[0] = tmp;
s->selector[i] = tmp;
}
}
/*--- Now the coding tables ---*/
for (t = 0; t < nGroups; t++) {
GET_BITS(BZ_X_CODING_1, curr, 5);
for (i = 0; i < alphaSize; i++) {
while (True) {
if (curr < 1 || curr > 20) RETURN(BZ_DATA_ERROR);
GET_BIT(BZ_X_CODING_2, uc);
if (uc == 0) break;
GET_BIT(BZ_X_CODING_3, uc);
if (uc == 0) curr++; else curr--;
}
s->len[t][i] = curr;
}
}
/*--- Create the Huffman decoding tables ---*/
for (t = 0; t < nGroups; t++) {
minLen = 32;
maxLen = 0;
for (i = 0; i < alphaSize; i++) {
if (s->len[t][i] > maxLen) maxLen = s->len[t][i];
if (s->len[t][i] < minLen) minLen = s->len[t][i];
}
BZ2_hbCreateDecodeTables (
&(s->limit[t][0]),
&(s->base[t][0]),
&(s->perm[t][0]),
&(s->len[t][0]),
minLen, maxLen, alphaSize
);
s->minLens[t] = minLen;
}
/*--- Now the MTF values ---*/
EOB = s->nInUse+1;
nblockMAX = 100000 * s->blockSize100k;
groupNo = -1;
groupPos = 0;
for (i = 0; i <= 255; i++) s->unzftab[i] = 0;
/*-- MTF init --*/
{
Int32 ii, jj, kk;
kk = MTFA_SIZE-1;
for (ii = 256 / MTFL_SIZE - 1; ii >= 0; ii--) {
for (jj = MTFL_SIZE-1; jj >= 0; jj--) {
s->mtfa[kk] = (UChar)(ii * MTFL_SIZE + jj);
kk--;
}
s->mtfbase[ii] = kk + 1;
}
}
/*-- end MTF init --*/
nblock = 0;
GET_MTF_VAL(BZ_X_MTF_1, BZ_X_MTF_2, nextSym);
while (True) {
if (nextSym == EOB) break;
if (nextSym == BZ_RUNA || nextSym == BZ_RUNB) {
es = -1;
N = 1;
do {
if (nextSym == BZ_RUNA) es = es + (0+1) * N; else
if (nextSym == BZ_RUNB) es = es + (1+1) * N;
N = N * 2;
GET_MTF_VAL(BZ_X_MTF_3, BZ_X_MTF_4, nextSym);
}
while (nextSym == BZ_RUNA || nextSym == BZ_RUNB);
es++;
uc = s->seqToUnseq[ s->mtfa[s->mtfbase[0]] ];
s->unzftab[uc] += es;
if (s->smallDecompress)
while (es > 0) {
if (nblock >= nblockMAX) RETURN(BZ_DATA_ERROR);
s->ll16[nblock] = (UInt16)uc;
nblock++;
es--;
}
else
while (es > 0) {
if (nblock >= nblockMAX) RETURN(BZ_DATA_ERROR);
s->tt[nblock] = (UInt32)uc;
nblock++;
es--;
};
continue;
} else {
if (nblock >= nblockMAX) RETURN(BZ_DATA_ERROR);
/*-- uc = MTF ( nextSym-1 ) --*/
{
Int32 ii, jj, kk, pp, lno, off;
UInt32 nn;
nn = (UInt32)(nextSym - 1);
if (nn < MTFL_SIZE) {
/* avoid general-case expense */
pp = s->mtfbase[0];
uc = s->mtfa[pp+nn];
while (nn > 3) {
Int32 z = pp+nn;
s->mtfa[(z) ] = s->mtfa[(z)-1];
s->mtfa[(z)-1] = s->mtfa[(z)-2];
s->mtfa[(z)-2] = s->mtfa[(z)-3];
s->mtfa[(z)-3] = s->mtfa[(z)-4];
nn -= 4;
}
while (nn > 0) {
s->mtfa[(pp+nn)] = s->mtfa[(pp+nn)-1]; nn--;
};
s->mtfa[pp] = uc;
} else {
/* general case */
lno = nn / MTFL_SIZE;
off = nn % MTFL_SIZE;
pp = s->mtfbase[lno] + off;
uc = s->mtfa[pp];
while (pp > s->mtfbase[lno]) {
s->mtfa[pp] = s->mtfa[pp-1]; pp--;
};
s->mtfbase[lno]++;
while (lno > 0) {
s->mtfbase[lno]--;
s->mtfa[s->mtfbase[lno]]
= s->mtfa[s->mtfbase[lno-1] + MTFL_SIZE - 1];
lno--;
}
s->mtfbase[0]--;
s->mtfa[s->mtfbase[0]] = uc;
if (s->mtfbase[0] == 0) {
kk = MTFA_SIZE-1;
for (ii = 256 / MTFL_SIZE-1; ii >= 0; ii--) {
for (jj = MTFL_SIZE-1; jj >= 0; jj--) {
s->mtfa[kk] = s->mtfa[s->mtfbase[ii] + jj];
kk--;
}
s->mtfbase[ii] = kk + 1;
}
}
}
}
/*-- end uc = MTF ( nextSym-1 ) --*/
s->unzftab[s->seqToUnseq[uc]]++;
if (s->smallDecompress)
s->ll16[nblock] = (UInt16)(s->seqToUnseq[uc]); else
s->tt[nblock] = (UInt32)(s->seqToUnseq[uc]);
nblock++;
GET_MTF_VAL(BZ_X_MTF_5, BZ_X_MTF_6, nextSym);
continue;
}
}
/* Now we know what nblock is, we can do a better sanity
check on s->origPtr.
*/
if (s->origPtr < 0 || s->origPtr >= nblock)
RETURN(BZ_DATA_ERROR);
s->state_out_len = 0;
s->state_out_ch = 0;
BZ_INITIALISE_CRC ( s->calculatedBlockCRC );
s->state = BZ_X_OUTPUT;
if (s->verbosity >= 2) VPrintf0 ( "rt+rld" );
/*-- Set up cftab to facilitate generation of T^(-1) --*/
s->cftab[0] = 0;
for (i = 1; i <= 256; i++) s->cftab[i] = s->unzftab[i-1];
for (i = 1; i <= 256; i++) s->cftab[i] += s->cftab[i-1];
if (s->smallDecompress) {
/*-- Make a copy of cftab, used in generation of T --*/
for (i = 0; i <= 256; i++) s->cftabCopy[i] = s->cftab[i];
/*-- compute the T vector --*/
for (i = 0; i < nblock; i++) {
uc = (UChar)(s->ll16[i]);
SET_LL(i, s->cftabCopy[uc]);
s->cftabCopy[uc]++;
}
/*-- Compute T^(-1) by pointer reversal on T --*/
i = s->origPtr;
j = GET_LL(i);
do {
Int32 tmp = GET_LL(j);
SET_LL(j, i);
i = j;
j = tmp;
}
while (i != s->origPtr);
s->tPos = s->origPtr;
s->nblock_used = 0;
if (s->blockRandomised) {
BZ_RAND_INIT_MASK;
BZ_GET_SMALL(s->k0); s->nblock_used++;
BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK;
} else {
BZ_GET_SMALL(s->k0); s->nblock_used++;
}
} else {
/*-- compute the T^(-1) vector --*/
for (i = 0; i < nblock; i++) {
uc = (UChar)(s->tt[i] & 0xff);
s->tt[s->cftab[uc]] |= (i << 8);
s->cftab[uc]++;
}
s->tPos = s->tt[s->origPtr] >> 8;
s->nblock_used = 0;
if (s->blockRandomised) {
BZ_RAND_INIT_MASK;
BZ_GET_FAST(s->k0); s->nblock_used++;
BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK;
} else {
BZ_GET_FAST(s->k0); s->nblock_used++;
}
}
RETURN(BZ_OK);
endhdr_2:
GET_UCHAR(BZ_X_ENDHDR_2, uc);
if (uc != 0x72) RETURN(BZ_DATA_ERROR);
GET_UCHAR(BZ_X_ENDHDR_3, uc);
if (uc != 0x45) RETURN(BZ_DATA_ERROR);
GET_UCHAR(BZ_X_ENDHDR_4, uc);
if (uc != 0x38) RETURN(BZ_DATA_ERROR);
GET_UCHAR(BZ_X_ENDHDR_5, uc);
if (uc != 0x50) RETURN(BZ_DATA_ERROR);
GET_UCHAR(BZ_X_ENDHDR_6, uc);
if (uc != 0x90) RETURN(BZ_DATA_ERROR);
s->storedCombinedCRC = 0;
GET_UCHAR(BZ_X_CCRC_1, uc);
s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc);
GET_UCHAR(BZ_X_CCRC_2, uc);
s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc);
GET_UCHAR(BZ_X_CCRC_3, uc);
s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc);
GET_UCHAR(BZ_X_CCRC_4, uc);
s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc);
s->state = BZ_X_IDLE;
RETURN(BZ_STREAM_END);
default: AssertH ( False, 4001 );
}
AssertH ( False, 4002 );
save_state_and_return:
s->save_i = i;
s->save_j = j;
s->save_t = t;
s->save_alphaSize = alphaSize;
s->save_nGroups = nGroups;
s->save_nSelectors = nSelectors;
s->save_EOB = EOB;
s->save_groupNo = groupNo;
s->save_groupPos = groupPos;
s->save_nextSym = nextSym;
s->save_nblockMAX = nblockMAX;
s->save_nblock = nblock;
s->save_es = es;
s->save_N = N;
s->save_curr = curr;
s->save_zt = zt;
s->save_zn = zn;
s->save_zvec = zvec;
s->save_zj = zj;
s->save_gSel = gSel;
s->save_gMinlen = gMinlen;
s->save_gLimit = gLimit;
s->save_gBase = gBase;
s->save_gPerm = gPerm;
return retVal;
}
/*-------------------------------------------------------------*/
/*--- end decompress.c ---*/
/*-------------------------------------------------------------*/
|
Added work/src/bzip2-1.0.2/dlltest.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
|
/*
minibz2
libbz2.dll test program.
by Yoshioka Tsuneo(QWF00133@nifty.ne.jp/tsuneo-y@is.aist-nara.ac.jp)
This file is Public Domain.
welcome any email to me.
usage: minibz2 [-d] [-{1,2,..9}] [[srcfilename] destfilename]
*/
#define BZ_IMPORT
#include <stdio.h>
#include <stdlib.h>
#include "bzlib.h"
#ifdef _WIN32
#include <io.h>
#endif
#ifdef _WIN32
#define BZ2_LIBNAME "libbz2-1.0.2.DLL"
#include <windows.h>
static int BZ2DLLLoaded = 0;
static HINSTANCE BZ2DLLhLib;
int BZ2DLLLoadLibrary(void)
{
HINSTANCE hLib;
if(BZ2DLLLoaded==1){return 0;}
hLib=LoadLibrary(BZ2_LIBNAME);
if(hLib == NULL){
fprintf(stderr,"Can't load %s\n",BZ2_LIBNAME);
return -1;
}
BZ2_bzlibVersion=GetProcAddress(hLib,"BZ2_bzlibVersion");
BZ2_bzopen=GetProcAddress(hLib,"BZ2_bzopen");
BZ2_bzdopen=GetProcAddress(hLib,"BZ2_bzdopen");
BZ2_bzread=GetProcAddress(hLib,"BZ2_bzread");
BZ2_bzwrite=GetProcAddress(hLib,"BZ2_bzwrite");
BZ2_bzflush=GetProcAddress(hLib,"BZ2_bzflush");
BZ2_bzclose=GetProcAddress(hLib,"BZ2_bzclose");
BZ2_bzerror=GetProcAddress(hLib,"BZ2_bzerror");
if (!BZ2_bzlibVersion || !BZ2_bzopen || !BZ2_bzdopen
|| !BZ2_bzread || !BZ2_bzwrite || !BZ2_bzflush
|| !BZ2_bzclose || !BZ2_bzerror) {
fprintf(stderr,"GetProcAddress failed.\n");
return -1;
}
BZ2DLLLoaded=1;
BZ2DLLhLib=hLib;
return 0;
}
int BZ2DLLFreeLibrary(void)
{
if(BZ2DLLLoaded==0){return 0;}
FreeLibrary(BZ2DLLhLib);
BZ2DLLLoaded=0;
}
#endif /* WIN32 */
void usage(void)
{
puts("usage: minibz2 [-d] [-{1,2,..9}] [[srcfilename] destfilename]");
}
int main(int argc,char *argv[])
{
int decompress = 0;
int level = 9;
char *fn_r = NULL;
char *fn_w = NULL;
#ifdef _WIN32
if(BZ2DLLLoadLibrary()<0){
fprintf(stderr,"Loading of %s failed. Giving up.\n", BZ2_LIBNAME);
exit(1);
}
printf("Loading of %s succeeded. Library version is %s.\n",
BZ2_LIBNAME, BZ2_bzlibVersion() );
#endif
while(++argv,--argc){
if(**argv =='-' || **argv=='/'){
char *p;
for(p=*argv+1;*p;p++){
if(*p=='d'){
decompress = 1;
}else if('1'<=*p && *p<='9'){
level = *p - '0';
}else{
usage();
exit(1);
}
}
}else{
break;
}
}
if(argc>=1){
fn_r = *argv;
argc--;argv++;
}else{
fn_r = NULL;
}
if(argc>=1){
fn_w = *argv;
argc--;argv++;
}else{
fn_w = NULL;
}
{
int len;
char buff[0x1000];
char mode[10];
if(decompress){
BZFILE *BZ2fp_r = NULL;
FILE *fp_w = NULL;
if(fn_w){
if((fp_w = fopen(fn_w,"wb"))==NULL){
printf("can't open [%s]\n",fn_w);
perror("reason:");
exit(1);
}
}else{
fp_w = stdout;
}
if((fn_r == NULL && (BZ2fp_r = BZ2_bzdopen(fileno(stdin),"rb"))==NULL)
|| (fn_r != NULL && (BZ2fp_r = BZ2_bzopen(fn_r,"rb"))==NULL)){
printf("can't bz2openstream\n");
exit(1);
}
while((len=BZ2_bzread(BZ2fp_r,buff,0x1000))>0){
fwrite(buff,1,len,fp_w);
}
BZ2_bzclose(BZ2fp_r);
if(fp_w != stdout) fclose(fp_w);
}else{
BZFILE *BZ2fp_w = NULL;
FILE *fp_r = NULL;
if(fn_r){
if((fp_r = fopen(fn_r,"rb"))==NULL){
printf("can't open [%s]\n",fn_r);
perror("reason:");
exit(1);
}
}else{
fp_r = stdin;
}
mode[0]='w';
mode[1] = '0' + level;
mode[2] = '\0';
if((fn_w == NULL && (BZ2fp_w = BZ2_bzdopen(fileno(stdout),mode))==NULL)
|| (fn_w !=NULL && (BZ2fp_w = BZ2_bzopen(fn_w,mode))==NULL)){
printf("can't bz2openstream\n");
exit(1);
}
while((len=fread(buff,1,0x1000,fp_r))>0){
BZ2_bzwrite(BZ2fp_w,buff,len);
}
BZ2_bzclose(BZ2fp_w);
if(fp_r!=stdin)fclose(fp_r);
}
}
#ifdef _WIN32
BZ2DLLFreeLibrary();
#endif
return 0;
}
|
Added work/src/bzip2-1.0.2/dlltest.dsp.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
# Microsoft Developer Studio Project File - Name="dlltest" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 5.00
# ** •ÒW‚µ‚È‚¢‚Å‚‚¾‚³‚¢ **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=dlltest - Win32 Debug
!MESSAGE ‚±‚ê‚Í—LŒø‚ÈÒ²¸Ì§²Ù‚ł͂ ‚è‚Ü‚¹‚ñB ‚±‚ÌÌßÛ¼Þª¸Ä‚ðËÞÙÄÞ‚·‚邽‚ß‚É‚Í NMAKE ‚ðŽg—p‚µ‚Ä‚‚¾‚³‚¢B
!MESSAGE [Ò²¸Ì§²Ù‚Ì´¸½Îß°Ä] ºÏÝÄÞ‚ðŽg—p‚µ‚ÄŽÀs‚µ‚Ä‚‚¾‚³‚¢
!MESSAGE
!MESSAGE NMAKE /f "dlltest.mak".
!MESSAGE
!MESSAGE NMAKE ‚ÌŽÀsŽž‚É\¬‚ðŽw’è‚Å‚«‚Ü‚·
!MESSAGE ºÏÝÄÞ ×²Ýã‚ÅϸۂÌÝ’è‚ð’è‹`‚µ‚Ü‚·B—á:
!MESSAGE
!MESSAGE NMAKE /f "dlltest.mak" CFG="dlltest - Win32 Debug"
!MESSAGE
!MESSAGE ‘I‘ð‰Â”\‚ÈËÞÙÄÞ Ó°ÄÞ:
!MESSAGE
!MESSAGE "dlltest - Win32 Release" ("Win32 (x86) Console Application" —p)
!MESSAGE "dlltest - Win32 Debug" ("Win32 (x86) Console Application" —p)
!MESSAGE
# Begin Project
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "dlltest - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x411 /d "NDEBUG"
# ADD RSC /l 0x411 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"minibz2.exe"
!ELSEIF "$(CFG)" == "dlltest - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "dlltest_"
# PROP BASE Intermediate_Dir "dlltest_"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "dlltest_"
# PROP Intermediate_Dir "dlltest_"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x411 /d "_DEBUG"
# ADD RSC /l 0x411 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"minibz2.exe" /pdbtype:sept
!ENDIF
# Begin Target
# Name "dlltest - Win32 Release"
# Name "dlltest - Win32 Debug"
# Begin Source File
SOURCE=.\bzlib.h
# End Source File
# Begin Source File
SOURCE=.\dlltest.c
# End Source File
# End Target
# End Project
|
Added work/src/bzip2-1.0.2/huffman.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
|
/*-------------------------------------------------------------*/
/*--- Huffman coding low-level stuff ---*/
/*--- huffman.c ---*/
/*-------------------------------------------------------------*/
/*--
This file is a part of bzip2 and/or libbzip2, a program and
library for lossless, block-sorting data compression.
Copyright (C) 1996-2002 Julian R Seward. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.
3. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
4. The name of the author may not be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Julian Seward, Cambridge, UK.
jseward@acm.org
bzip2/libbzip2 version 1.0 of 21 March 2000
This program is based on (at least) the work of:
Mike Burrows
David Wheeler
Peter Fenwick
Alistair Moffat
Radford Neal
Ian H. Witten
Robert Sedgewick
Jon L. Bentley
For more information on these sources, see the manual.
--*/
#include "bzlib_private.h"
/*---------------------------------------------------*/
#define WEIGHTOF(zz0) ((zz0) & 0xffffff00)
#define DEPTHOF(zz1) ((zz1) & 0x000000ff)
#define MYMAX(zz2,zz3) ((zz2) > (zz3) ? (zz2) : (zz3))
#define ADDWEIGHTS(zw1,zw2) \
(WEIGHTOF(zw1)+WEIGHTOF(zw2)) | \
(1 + MYMAX(DEPTHOF(zw1),DEPTHOF(zw2)))
#define UPHEAP(z) \
{ \
Int32 zz, tmp; \
zz = z; tmp = heap[zz]; \
while (weight[tmp] < weight[heap[zz >> 1]]) { \
heap[zz] = heap[zz >> 1]; \
zz >>= 1; \
} \
heap[zz] = tmp; \
}
#define DOWNHEAP(z) \
{ \
Int32 zz, yy, tmp; \
zz = z; tmp = heap[zz]; \
while (True) { \
yy = zz << 1; \
if (yy > nHeap) break; \
if (yy < nHeap && \
weight[heap[yy+1]] < weight[heap[yy]]) \
yy++; \
if (weight[tmp] < weight[heap[yy]]) break; \
heap[zz] = heap[yy]; \
zz = yy; \
} \
heap[zz] = tmp; \
}
/*---------------------------------------------------*/
void BZ2_hbMakeCodeLengths ( UChar *len,
Int32 *freq,
Int32 alphaSize,
Int32 maxLen )
{
/*--
Nodes and heap entries run from 1. Entry 0
for both the heap and nodes is a sentinel.
--*/
Int32 nNodes, nHeap, n1, n2, i, j, k;
Bool tooLong;
Int32 heap [ BZ_MAX_ALPHA_SIZE + 2 ];
Int32 weight [ BZ_MAX_ALPHA_SIZE * 2 ];
Int32 parent [ BZ_MAX_ALPHA_SIZE * 2 ];
for (i = 0; i < alphaSize; i++)
weight[i+1] = (freq[i] == 0 ? 1 : freq[i]) << 8;
while (True) {
nNodes = alphaSize;
nHeap = 0;
heap[0] = 0;
weight[0] = 0;
parent[0] = -2;
for (i = 1; i <= alphaSize; i++) {
parent[i] = -1;
nHeap++;
heap[nHeap] = i;
UPHEAP(nHeap);
}
AssertH( nHeap < (BZ_MAX_ALPHA_SIZE+2), 2001 );
while (nHeap > 1) {
n1 = heap[1]; heap[1] = heap[nHeap]; nHeap--; DOWNHEAP(1);
n2 = heap[1]; heap[1] = heap[nHeap]; nHeap--; DOWNHEAP(1);
nNodes++;
parent[n1] = parent[n2] = nNodes;
weight[nNodes] = ADDWEIGHTS(weight[n1], weight[n2]);
parent[nNodes] = -1;
nHeap++;
heap[nHeap] = nNodes;
UPHEAP(nHeap);
}
AssertH( nNodes < (BZ_MAX_ALPHA_SIZE * 2), 2002 );
tooLong = False;
for (i = 1; i <= alphaSize; i++) {
j = 0;
k = i;
while (parent[k] >= 0) { k = parent[k]; j++; }
len[i-1] = j;
if (j > maxLen) tooLong = True;
}
if (! tooLong) break;
for (i = 1; i < alphaSize; i++) {
j = weight[i] >> 8;
j = 1 + (j / 2);
weight[i] = j << 8;
}
}
}
/*---------------------------------------------------*/
void BZ2_hbAssignCodes ( Int32 *code,
UChar *length,
Int32 minLen,
Int32 maxLen,
Int32 alphaSize )
{
Int32 n, vec, i;
vec = 0;
for (n = minLen; n <= maxLen; n++) {
for (i = 0; i < alphaSize; i++)
if (length[i] == n) { code[i] = vec; vec++; };
vec <<= 1;
}
}
/*---------------------------------------------------*/
void BZ2_hbCreateDecodeTables ( Int32 *limit,
Int32 *base,
Int32 *perm,
UChar *length,
Int32 minLen,
Int32 maxLen,
Int32 alphaSize )
{
Int32 pp, i, j, vec;
pp = 0;
for (i = minLen; i <= maxLen; i++)
for (j = 0; j < alphaSize; j++)
if (length[j] == i) { perm[pp] = j; pp++; };
for (i = 0; i < BZ_MAX_CODE_LEN; i++) base[i] = 0;
for (i = 0; i < alphaSize; i++) base[length[i]+1]++;
for (i = 1; i < BZ_MAX_CODE_LEN; i++) base[i] += base[i-1];
for (i = 0; i < BZ_MAX_CODE_LEN; i++) limit[i] = 0;
vec = 0;
for (i = minLen; i <= maxLen; i++) {
vec += (base[i+1] - base[i]);
limit[i] = vec-1;
vec <<= 1;
}
for (i = minLen + 1; i <= maxLen; i++)
base[i] = ((limit[i-1] + 1) << 1) - base[i];
}
/*-------------------------------------------------------------*/
/*--- end huffman.c ---*/
/*-------------------------------------------------------------*/
|
Added work/src/bzip2-1.0.2/libbz2.a.
cannot compute difference between binary files
Added work/src/bzip2-1.0.2/libbz2.def.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
LIBRARY LIBBZ2
DESCRIPTION "libbzip2: library for data compression"
EXPORTS
BZ2_bzCompressInit
BZ2_bzCompress
BZ2_bzCompressEnd
BZ2_bzDecompressInit
BZ2_bzDecompress
BZ2_bzDecompressEnd
BZ2_bzReadOpen
BZ2_bzReadClose
BZ2_bzReadGetUnused
BZ2_bzRead
BZ2_bzWriteOpen
BZ2_bzWrite
BZ2_bzWriteClose
BZ2_bzWriteClose64
BZ2_bzBuffToBuffCompress
BZ2_bzBuffToBuffDecompress
BZ2_bzlibVersion
BZ2_bzopen
BZ2_bzdopen
BZ2_bzread
BZ2_bzwrite
BZ2_bzflush
BZ2_bzclose
BZ2_bzerror
|
Added work/src/bzip2-1.0.2/libbz2.dsp.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
# Microsoft Developer Studio Project File - Name="libbz2" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 5.00
# ** •ÒW‚µ‚È‚¢‚Å‚‚¾‚³‚¢ **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=libbz2 - Win32 Debug
!MESSAGE ‚±‚ê‚Í—LŒø‚ÈÒ²¸Ì§²Ù‚ł͂ ‚è‚Ü‚¹‚ñB ‚±‚ÌÌßÛ¼Þª¸Ä‚ðËÞÙÄÞ‚·‚邽‚ß‚É‚Í NMAKE ‚ðŽg—p‚µ‚Ä‚‚¾‚³‚¢B
!MESSAGE [Ò²¸Ì§²Ù‚Ì´¸½Îß°Ä] ºÏÝÄÞ‚ðŽg—p‚µ‚ÄŽÀs‚µ‚Ä‚‚¾‚³‚¢
!MESSAGE
!MESSAGE NMAKE /f "libbz2.mak".
!MESSAGE
!MESSAGE NMAKE ‚ÌŽÀsŽž‚É\¬‚ðŽw’è‚Å‚«‚Ü‚·
!MESSAGE ºÏÝÄÞ ×²Ýã‚ÅϸۂÌÝ’è‚ð’è‹`‚µ‚Ü‚·B—á:
!MESSAGE
!MESSAGE NMAKE /f "libbz2.mak" CFG="libbz2 - Win32 Debug"
!MESSAGE
!MESSAGE ‘I‘ð‰Â”\‚ÈËÞÙÄÞ Ó°ÄÞ:
!MESSAGE
!MESSAGE "libbz2 - Win32 Release" ("Win32 (x86) Dynamic-Link Library" —p)
!MESSAGE "libbz2 - Win32 Debug" ("Win32 (x86) Dynamic-Link Library" —p)
!MESSAGE
# Begin Project
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "libbz2 - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
# ADD BASE RSC /l 0x411 /d "NDEBUG"
# ADD RSC /l 0x411 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 /out:"libbz2.dll"
!ELSEIF "$(CFG)" == "libbz2 - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
# ADD BASE RSC /l 0x411 /d "_DEBUG"
# ADD RSC /l 0x411 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"libbz2.dll" /pdbtype:sept
!ENDIF
# Begin Target
# Name "libbz2 - Win32 Release"
# Name "libbz2 - Win32 Debug"
# Begin Source File
SOURCE=.\blocksort.c
# End Source File
# Begin Source File
SOURCE=.\bzlib.c
# End Source File
# Begin Source File
SOURCE=.\bzlib.h
# End Source File
# Begin Source File
SOURCE=.\bzlib_private.h
# End Source File
# Begin Source File
SOURCE=.\compress.c
# End Source File
# Begin Source File
SOURCE=.\crctable.c
# End Source File
# Begin Source File
SOURCE=.\decompress.c
# End Source File
# Begin Source File
SOURCE=.\huffman.c
# End Source File
# Begin Source File
SOURCE=.\libbz2.def
# End Source File
# Begin Source File
SOURCE=.\randtable.c
# End Source File
# End Target
# End Project
|
Added work/src/bzip2-1.0.2/makefile.msc.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
# Makefile for Microsoft Visual C++ 6.0
# usage: nmake -f makefile.msc
# K.M. Syring (syring@gsf.de)
# Fixed up by JRS for bzip2-0.9.5d release.
CC=cl
CFLAGS= -DWIN32 -MD -Ox -D_FILE_OFFSET_BITS=64 -nologo
OBJS= blocksort.obj \
huffman.obj \
crctable.obj \
randtable.obj \
compress.obj \
decompress.obj \
bzlib.obj
all: lib bzip2 test
bzip2: lib
$(CC) $(CFLAGS) -o bzip2 bzip2.c libbz2.lib setargv.obj
$(CC) $(CFLAGS) -o bzip2recover bzip2recover.c
lib: $(OBJS)
lib /out:libbz2.lib $(OBJS)
test: bzip2
type words1
.\\bzip2 -1 < sample1.ref > sample1.rb2
.\\bzip2 -2 < sample2.ref > sample2.rb2
.\\bzip2 -3 < sample3.ref > sample3.rb2
.\\bzip2 -d < sample1.bz2 > sample1.tst
.\\bzip2 -d < sample2.bz2 > sample2.tst
.\\bzip2 -ds < sample3.bz2 > sample3.tst
@echo All six of the fc's should find no differences.
@echo If fc finds an error on sample3.bz2, this could be
@echo because WinZip's 'TAR file smart CR/LF conversion'
@echo is too clever for its own good. Disable this option.
@echo The correct size for sample3.ref is 120,244. If it
@echo is 150,251, WinZip has messed it up.
fc sample1.bz2 sample1.rb2
fc sample2.bz2 sample2.rb2
fc sample3.bz2 sample3.rb2
fc sample1.tst sample1.ref
fc sample2.tst sample2.ref
fc sample3.tst sample3.ref
clean:
del *.obj
del libbz2.lib
del bzip2.exe
del bzip2recover.exe
del sample1.rb2
del sample2.rb2
del sample3.rb2
del sample1.tst
del sample2.tst
del sample3.tst
.c.obj:
$(CC) $(CFLAGS) -c $*.c -o $*.obj
|
Added work/src/bzip2-1.0.2/manual.html.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
<HTML>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- Created on January, 5 2002 by texi2html 1.64 -->
<!--
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
Karl Berry <karl@freefriends.org>
Olaf Bachmann <obachman@mathematik.uni-kl.de>
and many others.
Maintained by: Olaf Bachmann <obachman@mathematik.uni-kl.de>
Send bugs and suggestions to <texi2html@mathematik.uni-kl.de>
-->
<HEAD>
<TITLE>Untitled Document: Untitled Document</TITLE>
<META NAME="description" CONTENT="Untitled Document: Untitled Document">
<META NAME="keywords" CONTENT="Untitled Document: Untitled Document">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META NAME="Generator" CONTENT="texi2html 1.64">
</HEAD>
<BODY LANG="" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">
<A NAME="SEC_Top"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H1>Untitled Document</H1></P><P>
The following text is the License for this software. You should
find it identical to that contained in the file LICENSE in the
source distribution.
</P><P>
@bf{------------------ START OF THE LICENSE ------------------}
</P><P>
This program, <CODE>bzip2</CODE>,
and associated library <CODE>libbzip2</CODE>, are
Copyright (C) 1996-2002 Julian R Seward. All rights reserved.
</P><P>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
<UL>
<LI>
Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
<LI>
The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.
<LI>
Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
<LI>
The name of the author may not be used to endorse or promote
products derived from this software without specific prior written
permission.
</UL>
THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<P>
Julian Seward, Cambridge, UK.
</P><P>
<CODE>jseward@acm.org</CODE>
</P><P>
<CODE>bzip2</CODE>/<CODE>libbzip2</CODE> version 1.0.2 of 30 December 2001.
</P><P>
@bf{------------------ END OF THE LICENSE ------------------}
</P><P>
Web sites:
</P><P>
<CODE>http://sources.redhat.com/bzip2</CODE>
</P><P>
<CODE>http://www.cacheprof.org</CODE>
</P><P>
PATENTS: To the best of my knowledge, <CODE>bzip2</CODE> does not use any patented
algorithms. However, I do not have the resources available to carry out
a full patent search. Therefore I cannot give any guarantee of the
above statement.
</P><P>
<HR SIZE=1>
<BR>
<FONT SIZE="-1">
This document was generated
by <I>Julian Seward</I> on <I>January, 5 2002</I>
using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
"><I>texi2html</I></A>
</BODY>
</HTML>
|
Added work/src/bzip2-1.0.2/manual.pdf.
cannot compute difference between binary files
Added work/src/bzip2-1.0.2/manual.ps.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
|
%!PS-Adobe-2.0
%%Creator: dvips(k) 5.86 Copyright 1999 Radical Eye Software
%%Title: manual.dvi
%%Pages: 40
%%PageOrder: Ascend
%%BoundingBox: 0 0 596 842
%%EndComments
%DVIPSWebPage: (www.radicaleye.com)
%DVIPSCommandLine: dvips -o manual.ps manual.dvi
%DVIPSParameters: dpi=600, compressed
%DVIPSSource: TeX output 2002.01.05:0052
%%BeginProcSet: texc.pro
%!
/TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S
N}B/A{dup}B/TR{translate}N/isls false N/vsize 11 72 mul N/hsize 8.5 72
mul N/landplus90{false}def/@rigin{isls{[0 landplus90{1 -1}{-1 1}ifelse 0
0 0]concat}if 72 Resolution div 72 VResolution div neg scale isls{
landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div hsize
mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul TR[
matrix currentmatrix{A A round sub abs 0.00001 lt{round}if}forall round
exch round exch]setmatrix}N/@landscape{/isls true N}B/@manualfeed{
statusdict/manualfeed true put}B/@copies{/#copies X}B/FMat[1 0 0 -1 0 0]
N/FBB[0 0 0 0]N/nn 0 N/IEn 0 N/ctr 0 N/df-tail{/nn 8 dict N nn begin
/FontType 3 N/FontMatrix fntrx N/FontBBox FBB N string/base X array
/BitMaps X/BuildChar{CharBuilder}N/Encoding IEn N end A{/foo setfont}2
array copy cvx N load 0 nn put/ctr 0 N[}B/sf 0 N/df{/sf 1 N/fntrx FMat N
df-tail}B/dfs{div/sf X/fntrx[sf 0 0 sf neg 0 0]N df-tail}B/E{pop nn A
definefont setfont}B/Cw{Cd A length 5 sub get}B/Ch{Cd A length 4 sub get
}B/Cx{128 Cd A length 3 sub get sub}B/Cy{Cd A length 2 sub get 127 sub}
B/Cdx{Cd A length 1 sub get}B/Ci{Cd A type/stringtype ne{ctr get/ctr ctr
1 add N}if}B/id 0 N/rw 0 N/rc 0 N/gp 0 N/cp 0 N/G 0 N/CharBuilder{save 3
1 roll S A/base get 2 index get S/BitMaps get S get/Cd X pop/ctr 0 N Cdx
0 Cx Cy Ch sub Cx Cw add Cy setcachedevice Cw Ch true[1 0 0 -1 -.1 Cx
sub Cy .1 sub]/id Ci N/rw Cw 7 add 8 idiv string N/rc 0 N/gp 0 N/cp 0 N{
rc 0 ne{rc 1 sub/rc X rw}{G}ifelse}imagemask restore}B/G{{id gp get/gp
gp 1 add N A 18 mod S 18 idiv pl S get exec}loop}B/adv{cp add/cp X}B
/chg{rw cp id gp 4 index getinterval putinterval A gp add/gp X adv}B/nd{
/cp 0 N rw exit}B/lsh{rw cp 2 copy get A 0 eq{pop 1}{A 255 eq{pop 254}{
A A add 255 and S 1 and or}ifelse}ifelse put 1 adv}B/rsh{rw cp 2 copy
get A 0 eq{pop 128}{A 255 eq{pop 127}{A 2 idiv S 128 and or}ifelse}
ifelse put 1 adv}B/clr{rw cp 2 index string putinterval adv}B/set{rw cp
fillstr 0 4 index getinterval putinterval adv}B/fillstr 18 string 0 1 17
{2 copy 255 put pop}for N/pl[{adv 1 chg}{adv 1 chg nd}{1 add chg}{1 add
chg nd}{adv lsh}{adv lsh nd}{adv rsh}{adv rsh nd}{1 add adv}{/rc X nd}{
1 add set}{1 add clr}{adv 2 chg}{adv 2 chg nd}{pop nd}]A{bind pop}
forall N/D{/cc X A type/stringtype ne{]}if nn/base get cc ctr put nn
/BitMaps get S ctr S sf 1 ne{A A length 1 sub A 2 index S get sf div put
}if put/ctr ctr 1 add N}B/I{cc 1 add D}B/bop{userdict/bop-hook known{
bop-hook}if/SI save N @rigin 0 0 moveto/V matrix currentmatrix A 1 get A
mul exch 0 get A mul add .99 lt{/QV}{/RV}ifelse load def pop pop}N/eop{
SI restore userdict/eop-hook known{eop-hook}if showpage}N/@start{
userdict/start-hook known{start-hook}if pop/VResolution X/Resolution X
1000 div/DVImag X/IEn 256 array N 2 string 0 1 255{IEn S A 360 add 36 4
index cvrs cvn put}for pop 65781.76 div/vsize X 65781.76 div/hsize X}N
/p{show}N/RMat[1 0 0 -1 0 0]N/BDot 260 string N/Rx 0 N/Ry 0 N/V{}B/RV/v{
/Ry X/Rx X V}B statusdict begin/product where{pop false[(Display)(NeXT)
(LaserWriter 16/600)]{A length product length le{A length product exch 0
exch getinterval eq{pop true exit}if}{pop}ifelse}forall}{false}ifelse
end{{gsave TR -.1 .1 TR 1 1 scale Rx Ry false RMat{BDot}imagemask
grestore}}{{gsave TR -.1 .1 TR Rx Ry scale 1 1 false RMat{BDot}
imagemask grestore}}ifelse B/QV{gsave newpath transform round exch round
exch itransform moveto Rx 0 rlineto 0 Ry neg rlineto Rx neg 0 rlineto
fill grestore}B/a{moveto}B/delta 0 N/tail{A/delta X 0 rmoveto}B/M{S p
delta add tail}B/b{S p tail}B/c{-4 M}B/d{-3 M}B/e{-2 M}B/f{-1 M}B/g{0 M}
B/h{1 M}B/i{2 M}B/j{3 M}B/k{4 M}B/w{0 rmoveto}B/l{p -4 w}B/m{p -3 w}B/n{
p -2 w}B/o{p -1 w}B/q{p 1 w}B/r{p 2 w}B/s{p 3 w}B/t{p 4 w}B/x{0 S
rmoveto}B/y{3 2 roll p a}B/bos{/SS save N}B/eos{SS restore}B end
%%EndProcSet
TeXDict begin 39158280 55380996 1000 600 600 (manual.dvi)
@start
%DVIPSBitmapFont: Fa cmbxti10 14.4 1
/Fa 1 47 df<13FCEA03FF000F13804813C05AA25AA2B5FCA31480A214006C5A6C5A6C5A
EA0FE0121271912B>46 D E
%EndDVIPSBitmapFont
%DVIPSBitmapFont: Fb cmti10 10.95 26
/Fb 26 122 df<DA0780150EDA3FE0151FDA7870153F4A6C157E902601E03C15FC902603
C01CEC01F8902607801EEC07F0010FD91F80130F90271F001DE0EB7FE0923A1CFC07FFC0
013E91391FFF9F80933903F83F004991C7123E6001FC16FC494B5A4D5A033C495A000102
38495A495E4DC7FC03785B0370137E495D00039138F001F84B485A02015C00014A485A91
3803800F0207495A4B48C8FC020E137E2600F01E5B4A5B9039787001F090383FE0039027
0F8007E013F090C7390FC007FC92391F800F0E92393F001E07033E133C4B903878038003
FC13F0913801F801913903F003E0EC07E091390FC007C0158091391F000F805C027E131F
4A1400495A494815074A4914004948133E130F49485D49C7140E017E143C49027C131E49
161C4848163C0003033C133848485E484816F048485E48C8495A003EED1E03484C5A00FC
DB0F0EC7FC48ED07FC0070ED01F0404974C34A>37 D<EA01E0EA07F8120FA2EA1FFCA4EA
0FF8EA0798EA001813381330A21370136013E013C01201EA0380EA07001206120E5A5A5A
5A5A0E1C7A891C>44 D<120FEA3FC0127FA212FFA31380EA7F00123C0A0A77891C>46
D<15FE913807FF8091381F07C091387C01F0ECF000494813F8494813780107147C495A49
C7FC167E133E137EA25BA2485AA2000315FEA25B000715FCA2491301120FA34848EB03F8
A44848EB07F0A448C7EA0FE0A316C0007E141F12FE1680153FA2481500A2157EA25DA25D
4813015D6C495A127C4A5A4A5A6C49C7FC143E6C5B380FC1F03803FFC0C648C8FC273F76
BC2E>48 D<15031507150F151F151E153E157EEC01FEEC03FC1407141FEB01FF90380FFB
F8EB1FC3EB0E07130015F0A2140FA215E0A2141FA215C0A2143FA21580A2147FA21500A2
5CA25CA21301A25CA21303A25CA21307A25CA2130FA25CA2131FA25CEB7FE0B612F0A215
E0203D77BC2E>I<EB03C0EB07F0130FEB1FF8133FA214F0EB1FE014C0EB078090C7FCB3
EA01E0EA07F0487EA2121FA46C5AEA07B0EA003013701360A213E05B12015B120348C7FC
1206120E5A5A123012705A5A15397AA61C>59 D<147E49B47E903907C1C38090391F80EF
C090383F00FF017E137F4914804848133F485AA248481400120F5B001F5C157E485AA215
FE007F5C90C7FCA21401485C5AA21403EDF0385AA21407EDE078020F1370127C021F13F0
007E013F13E0003E137FECF3E1261F01E313C03A0F8781E3803A03FF00FF00D800FC133E
252977A72E>97 D<EB1FC0EA0FFF5CA2EA003FA291C7FCA25BA2137EA213FEA25BA21201
A25BA21203A25B147E3907F1FF809038F783E09038EF01F013FE390FF800F8A24913FC49
137C485A157E5B15FE123FA290C7FCA248130115FC127EA2140300FE14F85AA2EC07F0A2
15E048130F15C0141F15800078EB3F00127C147E003C5B383E01F8381E03E06C485A6CB4
C7FCEA01F81F4076BE2A>I<EC1FC0ECFFF0903803F03C903807C01E90381F800E90383F
000F017E133F4913FF485A485A000714FE5B000F14FC48481300A2485AA3127F90C8FCA3
5A5AA6481403007E1407150F151E003E143C15786C14F0EC03E0390F800F803903E07E00
3801FFF838003FC0202977A72A>I<EE3F80ED1FFF1700A2ED007FA2167EA216FEA25EA2
1501A25EA21503A25EA21507A25E147E903801FF8F903807C1CF90391F80EFC090383F00
FF017E137F5B48486D5A485AA2485A000F92C7FC5B001F5CA24848137EA215FE127F90C7
5AA214015A485CA2140316384814F0A21407167891380FE070127C021F13F0007E013F5B
003E137FECF3E1261F01E35B3A0F8781E3802703FF00FFC7FCD800FC133E294077BE2E>
I<EC3F80903801FFE0903807E0F890381F803CEB3E0001FC131E485A485A12074848133E
49133C121F4848137C15F8EC03F0397F000FE0ECFF809038FFFC00B512C048C8FCA45AA6
1506150E151E007C143C15786C14F0EC01E06CEB07C0390F801F003807C0FC3801FFF038
007F801F2976A72A>I<167C4BB4FC923807C78092380F83C0ED1F87161FED3F3FA2157E
A21780EE0E004BC7FCA414015DA414035DA30103B512F8A390260007E0C7FCA3140F5DA5
141F5DA4143F92C8FCA45C147EA414FE5CA413015CA4495AA4495AA4495A121E127F5C12
FF49C9FCA2EAFE1EEAF83C1270EA7878EA3FE0EA0F802A5383BF1C>I<EB01FC13FF5CA2
1303A25CA21307A25CA2130FA25CA2131FA25CA2133FA291C8FCEC03F890387F0FFE9138
3E0F80D97E7813C0ECE007D9FFC013E014801400A2485A5BA25B0003140F16C05BA20007
141F16805BA2000F143F16005B5D001F147EEDFE074913FCA2003F0101130FEDF80E1300
161E48ECF01CA2007E1538A200FE1570020013E048EC7FC00038EC1F0028407ABE2E>
104 D<1478EB01FCA21303A314F8EB00E01400AD137C48B4FC38038F80EA0707000E13C0
121E121CEA3C0F1238A2EA781F00701380A2EAF03F140012005B137E13FE5BA212015BA2
12035B1438120713E0000F1378EBC070A214F0EB80E0A2EB81C01383148038078700EA03
FEEA00F8163E79BC1C>I<EB07F0EA03FF14E0A2EA000FA214C0A2131FA21480A2133FA2
1400A25BA2137EA213FEA25BA21201A25BA21203A25BA21207A25BA2120FA25BA2121FA2
5BA2123FA290C7FCA25A1307127EA2EAFE0F130E12FCA2131E131CA2EA7C381378EA3C70
EA1FE0EA0780144079BE17>108 D<D801F0D93F80137F3D07FC01FFE003FFC03D0F3E07
C1F80F83F03D0E1F0F00FC1E01F8001E011C90387C3800001C49D97E707F003C01F05C00
38157F4A5C26783FC05C12704A91C7FC91C7127E00F003FE1301494A5CEA007EA2030114
0301FE5F495CA203031407000160495C180F03075D0003051F13E0494A1480A2030FEC3F
810007F001C0495CA2031F91383E0380120F494AEC0700A2033F150E001FEF1E1C4991C7
EA0FF80007C7000EEC03E0432979A74A>I<D801F0EB3F803A07FC01FFE03A0F3E07C1F8
3A0E1F0F00FC001E011C137C001C49137E003C13F012385C38783FC012705C91C7FC00F0
15FE495CEA007EA2150101FE5C5BA2150300015D5B15075E0003020F13704914C0A2031F
13F00007ED80E05B1681EE01C0120F49EC0380A2EE0700001FEC0F0E49EB07FC0007C7EA
01F02C2979A733>I<EC1FC0ECFFF8903803F07C90380FC01FEB1F8090393F000F80017E
14C0491307484814E0485A12075B000F15F0485AA2485AA2ED0FE0127F90C7FCA2151F48
15C05AA2ED3F80A2ED7F00A248147E007C5C007E13015D4A5A003E495A6C495A4A5A260F
803EC7FC3807C0FC3801FFF038003F80242977A72E>I<903903E001F890390FF807FE90
3A1E7C1E0F80903A1C3E3C07C0013C137801389038E003E0EB783F017001C013F0ED8001
9038F07F0001E015F8147E1603000113FEA2C75AA20101140717F05CA20103140F17E05C
A20107EC1FC0A24A1480163F010F15005E167E5E131F4B5A6E485A4B5A90393FB80F80DA
9C1FC7FCEC0FFCEC03E049C9FCA2137EA213FEA25BA21201A25BA21203A2387FFFE0B5FC
A22D3A80A72E>I<D801F013FC3A07FC07FF803A0F3E0F03C0260E1F1C13E0001EEB380F
001C1370003CEBE01F123814C0D8783F14C00070903880070092C7FC91C8FC12F05BEA00
7EA313FE5BA312015BA312035BA312075BA3120F5BA3121F5B0007C9FC232979A726>
114 D<EC7F80903801FFE0903807C0F890381F003C013E131C013C131E017C133E49137E
15FEA2000114FCA215706D13007FEBFFC014FC6C13FF15806D13C06D13E0010F13F01300
140F14071403120C123F387F80011403D8FF0013E0A300FCEB07C000F0EB0F8012700078
EB1F006C133C381F01F83807FFE0C690C7FC1F297AA725>I<EB01C0EB03F01307A25CA2
130FA25CA2131FA25CA2133FA291C7FCA2007FB51280B6FC1500D8007EC7FC13FEA25BA2
1201A25BA21203A25BA21207A25BA2120FA25BA2121F141C1380A2003F133C1438EB0078
147014F05C495AEA1F03495A6C48C7FCEA07FCEA01F0193A78B81E>I<137C48B4141C26
038F80137EEA0707000E7F001E15FE121CD83C0F5C12381501EA781F007001805BA2D8F0
3F1303140000005D5B017E1307A201FE5C5B150F1201495CA2151F0003EDC1C0491481A2
153F1683EE0380A2ED7F07000102FF13005C01F8EBDF0F00009038079F0E90397C0F0F1C
90391FFC07F8903907F001F02A2979A731>I<017CEB01C048B4EB07F038038F80EA0707
000E01C013F8121E001C1403EA3C0F0038EC01F0A2D8781F130000705BA2EAF03F91C712
E012005B017E130116C013FE5B1503000115805BA2ED07001203495B150EA25DA25D1578
000114706D5B0000495A6D485AD97E0FC7FCEB1FFEEB03F0252979A72A>I<017C167048
B491387001FC3A038F8001F8EA0707000E01C015FE001E1403001CEDF000EA3C0F003817
7C1507D8781F4A133C00701380A2D8F03F130F020049133812005B017E011F14784C1370
13FE5B033F14F0000192C712E05BA2170100034A14C049137E17031880A2EF070015FE17
0E00010101141E01F86D131C0000D9039F5BD9FC076D5A903A3E0F07C1E0903A1FFC03FF
C0902703F0007FC7FC372979A73C>I<137C48B4143826038F8013FCEA0707000E7F001E
1401001C15F8EA3C0F12381503D8781F14F000701380A2D8F03F1307020013E012005B01
7E130F16C013FE5B151F1201491480A2153F000315005BA25D157EA315FE5D00011301EB
F8030000130790387C1FF8EB3FF9EB07E1EB00035DA21407000E5CEA3F80007F495AA24A
5AD8FF0090C7FC143E007C137E00705B387801F0383803E0381E0FC06CB4C8FCEA03F826
3B79A72C>121 D E
%EndDVIPSBitmapFont
%DVIPSBitmapFont: Fc cmtt12 14.4 10
/Fc 10 123 df<EC3FF80103B57E010F14E0013F14F84914FE48B7FC4816C048D9C01F7F
270FFE00017F49EB007FD81FF0EC1FF848486E7E160748486E7E4914018300FF81A26D16
80177FA36C5AA26CC9FCCAFCA217FF1800A25E5F16035F16075F160F4C5A163F4C5A5F4C
5A4B90C7FCED07FE4B5A4B5A4B5A4B5A4B5A4A5B4A90C8FCEC0FFE4A5AEC3FF04A5A4A5A
495B4990C9FCEB0FFC495A495A495A4948143F485B4890C8EA7F80EA0FFC485A48B8FC5A
B9FCA36C17007E314A7AC93E>50 D<383FFF805AB57EA37E7EEA003FAEED07FC92383FFF
8092B512E002C314F802CF8002DF8091B7FCDBF80F1380DBC00113C092C713E04A143F4A
EC1FF04A15F84A140F4AEC07FCA217034A15FE1701A318FF83A95F18FEA280170318FC6E
140718F86E140FEF1FF06E143F6EEC7FE06EECFFC0DBC0031380EDF01F92B6120002DF14
FC02CF5C02C35CD91F8114C090260F807F90C7FC90C7EA0FF8384A7FC83E>98
D<923803FFF85D4B7FA38181ED0003AEEC1FF0ECFFFE0103EBFF83010F14E34914F3017F
14FB90B7FC48EBF80F48EBC00191C7FC4848143F4848141F5B4848140F491407123F4914
03127F5BA312FF90C8FCA97F127FA216077F123F6D140FA26C6C141F6D143F000F157F6C
6C14FF01FF5B6C6D5A6CD9F01FEBFFFC6C90B500FB13FE6D02F313FF6D14E3010F14C36D
020113FE010101FC14FC9026003FE0C8FC384A7CC83E>100 D<143E147F4A7E497FA56D
5B6EC8FC143E91C9FCAC003FB57E5A81A47EC7123FB3B3007FB71280B812C0A56C16802A
4A76C93E>105 D<007FB512C0B6FC81A47EC7121FB3B3B3A5007FB712F8B812FCA56C16
F82E4978C83E>108 D<EC1FF0ECFFFE01036D7E010F14E04980017F14FC90B67E489038
F01FFFECC00748D90001138048486D13C04848EC7FE049143F4848EC1FF049140F003F16
F8491407A24848EC03FCA448C8EA01FEAA6D1403007F16FCA26D1407A2003F16F86D140F
6C6CEC1FF0A26C6CEC3FE06D147F6C6CECFFC06D5B6CD9C00713806CD9F01F13006C90B5
5A6D5C6D5C010F14E001031480010049C7FCEC1FF02F3679B43E>111
D<ED07FC3B3FFF803FFF804891B512E0B500C314F802CF8002DF806C90B7FC6CDAF80F13
80D8003FD9C00113C092C713E04A143F4AEC1FF04A15F84A140F4AEC07FCA217034A15FE
1701A318FF83A95F18FEA280170318FC6E140718F86E140FEF1FF06E143F6EEC7FE06EEC
FFC0DBC0031380EDF01F92B6120002DF14FC02CF5C02C35C02C114C0DAC07F90C7FCED0F
F892C9FCB3003FB512C04880B67EA36C5C6C5C384F7FB33E>I<903901FFF00F011F9038
FE1F8090B612BF000315FF5A5A5A393FFE003F01F01307D87FC0130190C8FC5A48157FA4
7EEE3F00D87FC091C7FC13F0EA3FFE381FFFF06CEBFFC06C14FE6C6E7EC615E0013F14F8
010780D9003F7F02007F03071380030013C0003EED3FE0007F151F48150F17F06D1407A3
7FA26D140F6D15E0161F01FCEC3FC06D14FF9026FFC00F138091B612005E485D013F5C6D
14E0D8FC0714802778007FF8C7FC2C3677B43E>115 D<147C14FC497EAD003FB712FC5A
B87EA36C5EA2260001FEC9FCB3A6173FA2EF7F80A76E14FF6D16006F5A9238C007FE9138
7FF01F92B55A6E5C6E5C6E5C6E1480020149C7FC9138003FF031437DC13E>I<000FB812
804817C04817E0A418C001C0C712014C13804C1300EE1FFE4C5AEE7FF06C484A5A4B5BC8
485B4B90C7FC4B5A4B5A4B5A4B5A4B5A4A5B4A5B4A90C8FC4A5A4A5A4A5A4A5A4A5A495B
495B4990C9FC495A495A4948EC0FC0495A4948EC1FE0485B00075B4890C8FCEA1FFC485A
485A90B8FCB9FCA46C17C07E33337CB23E>122 D E
%EndDVIPSBitmapFont
%DVIPSBitmapFont: Fd cmtt12 13.14 31
/Fd 31 123 df<903801FFC0010F13F8013F13FF4914C048B67E48814815FC4801007FD8
1FF8130F01E0EB03FF48480100138049EC7FC0007F153F90C8121F4816E0160F17F07F16
07A36CC8FC123EC9FCA2160F17E0A2161F17C0163FA2EE7F80EEFF00A24B5A4B5A15074B
5A4B5A4B5A4B5A4B5A020390C7FC4A5A4A5A4A5A4A5AEC7FC049485A4990C8FC495A495A
495AEB3FE0EBFFC04849EB03E04890C7EA07F0485A485AEA1FF048B7FC5AB8FCA37E6C16
E02C447AC338>50 D<003FB6FC4815E0B712F882826C816C16802701FC000113C0923800
7FE0161FEE0FF0A2160717F81603A6160717F0A2160FEE1FE0163FEE7FC0923801FF8003
0F130090B65A5E16F08216FEEEFF8017C001FCC7EA7FE0EE1FF0EE07F8160317FCEE01FE
1600A217FF177FA717FF17FE16011603EE07FC160FEE3FF8EEFFF0003FB7FC4816E0B812
C01780EEFE006C15F86C15C030437DC238>66 D<DA07FC133C91393FFF807E91B512E001
03ECF8FE4914FC4914FF5B90383FFE0390387FF000D9FFC0133F4849131F91C7120F4848
1407485A49140348481401A2485AA248481400A25BA2007F167C90CAFCA35A5AAD7E7EA3
7F003F167C17FE7FA26C7EA26C6C140117FC6C7E6D14036C6C15F86C6C14076EEB0FF06C
6D131FD97FF0EB7FE0903A3FFE03FFC06DB612806D15006D5C6D5C010014F0023F13C0DA
07FCC7FC2F457CC338>I<007FB512F8B7FC16C08216F8826C813A03F8001FFF15070301
13806F13C0167FEE3FE0161FEE0FF0A2EE07F8A2EE03FCA21601A217FE1600A4177FAD17
FF17FEA4160117FCA2160317F81607A2EE0FF0161FEE3FE0167FEEFFC04B13805D031F13
00007FB65AB75A5E5E16C093C7FC6C14F830437DC238>I<007FB712FCB87EA57ED801FC
C8FCA9177C94C7FCA6ED07C04B7EA590B6FCA79038FC000FA56F5A92C9FCA7EF0F80EF1F
C0AA007FB8FCB9FCA56C178032437DC238>I<91391FF003C091397FFC07E049B5FC0107
14CF4914EF4914FF5B90387FF81F9038FFE00748EB800191C7FC4848147F485A49143F48
5A161F485AA249140F123F5BA2127F90C8EA07C093C7FCA35A5AAA923807FFFC4B13FE4B
13FF7E7E6F13FE6F13FC9238000FE07F003F151FA27F121F7F163F6C7EA26C6C147F7F6C
6C14FF6C6C5B6E5A6C6D5A90387FF81F6DB6FC6D14EF6D14CF6D148F0101140F903A007F
FC07C0DA1FF0C7FC30457CC338>71 D<007FB612F0B712F8A56C15F0260001FCC7FCB3B3
B1007FB612F0B712F8A56C15F0254377C238>73 D<90380FFFFE90B612E0000315F84881
48814881A2273FFE000F138001F01301497F49147F4848EC3FC0A290C8121FA44816E0A2
48150FB3AC6C151FA36C16C0A36D143FA36C6CEC7F806D14FF6D5B01FE130F6CB71200A2
6C5D6C5D6C5DC615E0010F49C7FC2B457AC338>79 D<003FB512F04814FEB77E16E0826C
816C813A01FC003FFEED07FF03017F81707E163F161F83160FA7161F5F163F167F4C5A5D
030790C7FCED3FFE90B65A5E5E5EA282829038FC001FED07FC6F7E150115008282AA18E0
EF01F0EF03F8A31783EE3F87263FFFE0ECC7F0486D14FFB56C7F18E07013C06C496D1380
6C496D1300CA12FC35447EC238>82 D<003FB8FC481780B9FCA53BFE0007F0003FA9007C
EE1F00C792C7FCB3B3A70107B512F04980A56D5C31437DC238>84
D<267FFFF090387FFFF0B56C90B512F8A56C496D13F0D801FCC73801FC00B3B3A66D1403
00005EA36D14076D5D6E130F6D6C495A6E133F6D6C495A6D6C495AECFF076D90B5C7FC6D
5C6D5C6D5C023F13E0020F1380DA03FEC8FC35447FC238>I<D83FFE913803FFE0486C4A
13F0B56C4913F8A36C90C76C13F06C486E13E0D80FC09138001F80A36C6CED3F00A86C6C
157EA86C6C5DEC01FC4A7EA24A7EA4D800FC9038DF01F8020F1381A3158F021F13C1A201
7C5DA2017E14C31507023F13E3A490263E3E035BA2027E13F3A2EC7C01013F14F7A3011F
5DEC7800A202F813FFA34A137F010F5DA24A133F6D486DC7FC35447FC238>87
D<001FB712F04816F85AA417F090C8121F17E0EE3FC0167F1780EEFF00A24B5A4B5A123E
C8485A4B5AA24B5A4B5AA24B5A4BC7FCA24A5A14035D4A5A140F5D4A5A143F5D4A5A14FF
92C8FC495A13035C495AA2495A495AA2495A495A17F849C7EA01FC485AA2485A485AA248
5A121F5B485A127F90B7FCB8FCA56C16F82E437BC238>90 D<003FB712804816C0B812E0
A46C16C06C16802B087A7D38>95 D<EB1FFF90B512E0000314F84814FE4880824881D9F0
017F9138003FF0ED0FF815076C486D7E6C481301C87FA21500A4EC03FF147F0107B5FC13
1F90B6FC5A000714C048EBE0004890C7FCEA3FF813E0EA7F8090C8FC5A5AA415017E6C6C
13036D13076C6CEB3FFFD9FC01B6FC6CB812807E6C816C4A7E6CECF80F6C6CD9C0031300
D90FFCC9FC31327AB038>97 D<EA3FFE487EB5FCA37E7EC67EACED3FC0913801FFF80207
13FE021F7F4A804A8091B67E03C07F9139FE001FF802F86D7E4A13034A6D7E5C707E4A80
188091C8123FA318C0171FA9173F6E1580A2177FA26EECFF00A26E495A6E13034C5A6E49
5A02FE133F6E6CB45A92B55A6E5C6E5C6E91C7FC6D6C13FCD91E0313F090C7EA7F803244
7FC238>I<EC3FFF49B512E0010714F8011F8049805B90B7FC48EBE001481300485AEA0F
F8496D5A4848147C93C7FC485A5B127F90CAFCA35A5AA97E7EA27F123F6D141F6DEC3F80
121F6C7E01FC147F6C6CECFF006C6C6C5A6C9038F00FFE91B55A6C6C5C6D5C6D5C010714
80010149C7FC9038003FF0293278B038>I<ED1FFF4B7F5DA38181ED003FACEC7F809038
03FFF0010F13FC013F13FF4914BF90B7FC5A48EBC07F48EB000FD80FFC7F497F48487F49
7F485A167F485A163F90C8FCA25A5AA97E6C157FA36D14FF123F6D5B6C7E5D6C6C5B01FC
5B6C6C133F2603FFC0B6FC6C90B712806C03BF13C06D143F6D13FC6D01F814800107D9E0
1F1300010090C9FC32447CC238>I<EC3FE0903801FFFC010713FF011F14C04980498090
B67E489038E03FFC4890380007FE48481301D80FF86D7E49804848158049143F003F16C0
49141F127F90C8FC17E0160F5A90B7FCA617C048CAFC7E7EA27FA26C7EEE07C06C6CEC0F
E07F6C7ED807FE141F6DEC3FC06C01C013FF6CD9FC0713806C90B612006D5C6D5C010F5C
010314E001001480DA1FFCC7FC2B327AB038>I<ED1FF8ED7FFE4AB5FC020714804A14C0
5C5C91387FF07F15809139FF003F804AEB1F00010191C7FC5CA9003FB612FE4881B8FCA4
6C5D260001FCC8FCB3AF003FB612E04881A56C5D2A447CC338>I<14F0497E497E497EA4
6D5A6D5A6D5A91C8FCAB383FFFFC487FB5FCA37E7EC7FCB3AF007FB612F0B712F816FCA3
16F86C15F0264476C338>105 D<387FFFFEB6FCA57EC77EB3B3B1007FB7FCB81280A56C
1600294379C238>108 D<023FEB07E03B3FE0FFC01FF8D87FF39038E07FFCD8FFF76D48
7E90B500F97F15FB6C91B612806C01C1EBF83F00030100EBE01F4902C013C0A24990387F
800FA2491400A349137EB3A73C3FFF03FFE07FFC4801879038F0FFFEB500C76D13FFA36C
01874913FE6C01039038E07FFC383080AF38>I<ED7FC03A3FFE01FFF8267FFF0713FEB5
001F7F4A805C6C90B67E6CECC07F3B007FFE001FE002F8130F4A805C16075C5CA391C7FC
B3A6273FFFFE03B512E0486D4814F0B6008F14F8A36C020714F06C496C14E035307FAF38
>I<EC7FC0903803FFF8010F13FE497F017F14C090B67E4881489038C07FF8489038001F
FC01FC130748486D7E49130148486D7E4980003F168049143F007F16C090C8121FA300FE
ED0FE0A96C151FA26C16C0A26D143FA26C6CEC7F80A26C6CECFF006D5B6C6C495A6D1307
6CB4EB1FFC6C9038C07FF86C90B55A6C5D6D5C6D5C010F49C7FC010313F89038007FC02B
327AB038>I<ED3FC03A3FFE01FFF8267FFF0713FEB5001F7F4A804A806C90B67E6C02C0
7F3B007FFE001FF802F86D7E4A13034A6D7E5C707E4A80188091C8123FA318C0171FA917
3F6E1580A2177FA26EECFF00A26E495A6E13034C5A6E495A02FE133F6E6CB45A92B55A6E
5C6E5C6E91C7FC6E13FC020313F09138007F8092C9FCB0383FFFFE487FB67EA36C91C9FC
6C5B32487FAF38>I<EEFFC0277FFFC00713F8B5D8E01F13FC037F13FE92B5FC02E114FF
14E36C01E713813A000FEFFC019139FFF000FE4B137C0380130092C8FCA25C5CA25CA25C
A45CB2007FB67EB77E82A35E6C5D30307CAF38>114 D<903907FF80F0017FEBF1F848B5
12FD000714FF5A5A5AEBFC00D87FE0131F0180130F48C71207481403A5007FEC01F001C0
90C7FCEA3FF013FE381FFFF86CEBFFC0000314F8C614FF013F1480010714E0D9003F13F0
020013F8ED0FFC1503003CEC01FE007E140000FE15FF167F7EA37F6D14FF16FE01F01303
6DEB07FC01FF137F91B512F816F016E04815C0D8FC3F1400010F13FCD8780113E0283278
B038>I<EB01E0497E1307AB003FB712804816C0B8FCA46C1680260007F0C8FCB3A4EE03
E0EE07F0A66E130F17E06D6C131F6EEB3FC0903901FF81FF92B512806D15006E5B6E5B6E
13F002075B020190C7FC2C3D7DBB38>I<D83FFE903803FFE0486C497FB55BA36C806C80
C66CEB0007B3A9160FA2161F163F6E137F6D6C13FFDAF007EBFFE091B712F06D16F87F6D
14E76D02C713F00100020313E0DA3FF8C8FC35307FAE38>I<000FB712FC4816FE5AA417
FC0180C7EA1FF8EE3FF0EE7FE0EEFFC04B13804B13006CC7485AC8485A4B5A4B5A4B5A4B
5A4A5B4A90C7FCEC07FC4A5A4A5A4A5A4A5A49485A4990C8FC495A495A495A495A494814
7C494814FE485B4890C8FC485A485A485A485A48B7FCB8FCA56C16FC2F2F7DAE38>122
D E
%EndDVIPSBitmapFont
%DVIPSBitmapFont: Fe cmbx12 13.14 53
/Fe 53 122 df<923803FFE092B512FC020714FF021F81027F9038007FC0DAFFF0EB0FE0
010301C0804990C7EA3FF84948147F4A81494814FF495AA2137F5CA2715A715A715AEF07
8094C8FCA8EF07FCB9FCA526007FF0C7123F171FB3B3003FB5D8E00FB512F8A53D4D7ECC
44>12 D<B7FCAA200A7F9C29>45 D<EA07E0EA1FF8EA3FFCEA7FFEA2B5FCA6EA7FFEA2EA
3FFCEA1FF8EA07E01010778F22>I<177817F8EE01FCA21603A2EE07F8A217F0160FA217
E0161FA2EE3FC0A21780167FA217005EA24B5AA25E1503A24B5AA25E150FA25E151FA24B
5AA25E157FA24BC7FCA25D1401A25D1403A24A5AA25D140FA24A5AA25D143FA25D147FA2
4AC8FCA25C1301A25C1303A2495AA25C130FA2495AA25C133FA25C137FA249C9FCA25B12
01A2485AA25B1207A25B120FA2485AA25B123FA25B127FA248CAFCA25AA2127CA22E6D79
D13D>I<15F014011407141F147FEB03FF137FB6FCA313FC1380C7FCB3B3B2007FB712E0
A52B4777C63D>49 D<ECFFF80107EBFF80013F14F090B612FC4881480101EBFF802707F8
003F13C0D80FE0010F13E0D81F806D13F0003F80D87FF06D13F86D15FC6D7F00FF16FE6D
147FA217FF82A36C5A6C5A6C5A6C5AC95A17FEA3EEFFFCA24B13F817F05D17E04B13C017
804B13004B5A4B5A5EED7FE04B5A4A5B4A90C7FCEC07FC4A5A4A5A4B131FEC3F804AC7FC
14FE4948143E495AEB07E0495A4948147E49C8FC017E15FE90B7FC4816FC5A5A5A5A5A5A
B8FC17F8A430477AC63D>I<EC3FFE0103B512E0010F14FC013F14FF90267FE01F7F9026
FF000713E0D801FC6D7FD803F07F486C6D7FD80FFE817F486D80167FA3805C16FF7E91C7
5B6C5A6C5AD80020495B90C75C5D5F4B5B5F031F90C7FCED3FFC4AB45A49B512E0168016
E016FC90C7EA3FFF030713C06F7F6F7F6F7F83707E83A2701380A318C0EA07E0EA1FF848
7E487EA2B5FCA31880A25E491600127F494A5A6C485D01E05B001F4A5BD80FFC495B2707
FFC03F13C06C90B65AC64BC7FC013F14F8010714E09026007FFEC8FC32487BC63D>I<EE
07E0160FA2161F163F167F16FFA25D5D5DA25D5D5DA2157D15FDEC01F915F1EC03E11407
EC0FC1EC1F811501143F147E14FC14F8EB01F01303EB07E014C0EB0F80131FEB3F00133E
5B13FC485A485A5B1207485A485A90C7FC123E127E5AB912FCA5C80003EBE000AD023FB6
12FCA536487DC73D>I<D8038015E001E0140301FC143F9039FFE003FF91B612C0178017
00A25E5E16F05E5E93C7FC15FC15F001E790C8FC01E0C9FCAAEC1FFC01E1B512C001E714
F001EF14FC9039FFE01FFFDA0007138001FC6D13C001F06D13E04915F0497F17F8C913FC
167F17FEA417FFA3EA0FC0EA3FF0487EA2487EA317FEA34914FF6C4815FC5B018015F86C
C74813F07F6C6C4913E0D80FF04913C0D807FC011F13806CB46CB512006C90B512FC6C5D
013F14C0010F91C7FC010113F030487AC63D>I<ED7FF8913807FFFE021F6D7E027F8090
3A01FFF01FE0010790388003F04948486C7E49486D7ED93FF013074948130F01FF4A7E48
49133F5C5A4890C7FCA25A705A48486E5A705A003F92C8FCA3485AA21520913807FFE002
1F13FC00FF497F4A6D7EDAFC017F9026FDF0007F4A6D7ED9FFC06D7E4A6D7E8391C7FC83
82491680A318C05BA3127FA6123FA27F001F1780A3000F4B1300A26C6C5DA26C6D495A6C
6D5C6C6D495A6D6C48485A90263FFC075B6DB65A6D4AC7FC01035C010014F0020F90C8FC
32487BC63D>I<121F7F7F13FE90B812E0A45A18C0188018005F5FA25F485E90C8EA07E0
007E4B5A5F007C151F4CC7FC167E5E485D15014B5A4B5AC8485A4B5AA24BC8FC157EA25D
1401A24A5A1407A24A5AA2141FA24A5AA2147FA314FFA3495BA45BA55BAA6D5BA26D90C9
FCEB007C334B79C93D>I<EC1FFF49B512F0010714FC011F14FF90263FF00713C049C77F
01FCEC3FF04848EC0FF848481407000782491403000F821601A2121F7FA27F13FE6D1403
02C05C14F002FC495A6C6D130FDAFF805B9238E01FE06C6E485A9238FCFF806C91B5C7FC
6C15FC6C5D7F6D14FE6D806D15C06D81011F81017F81D9FFDF804813072603FE01804848
6C804848133F4848010F1480003F8049130148486D6C13C0161F824848140382A282A217
7FA218807F127FEFFF007F6C6C4A5AA2D81FFC4A5A6C6CEC0FF86C6C6CEB3FF06C9039F0
03FFE06C90B612806C6C92C7FC011F14FC010714E09026003FFEC8FC32487BC63D>I<EC
1FFE49B512C0010F14F04914FC90397FFC0FFE903AFFE003FF804849C67F48496D7E4890
C7FC486F7E484881161F003F825B007F82A28300FF81A31880A518C0A45E127FA3003F5D
7F121F5E120F6C6C91B5FC6C90388001EF6CEBC0036C9038E00FCF6DB5128F011F140F01
0701FE1480010113F8903800010091C7FCA24C1300A3D803F85D487E487E486C4A5AA25F
4C5AA24C5A49495B6C485D49010790C7FC01E0495AD807F8EB3FFC6CB448B45A6C90B55A
6C15C06D91C8FC011F13FC010313C032487BC63D>I<EE01F8A24C7EA34C7EA24C7EA34C
7FA24C7FA34C7FA293B57EA34B8016F303038016E316E103078016C0030F805E83031F81
4C7E4B81153E83037E81037C7F03FC815D830201824B7F0203825D830207824B7F020F82
5D84021F8392B8FC4A83A34A83027CC8120F02FC835C840101844A810103845C84010784
4A81010F845C85011F85496C82B600C091B712F0A5544D7CCC5D>65
D<93261FFF80EB01C00307B500F81303033F02FE13074AB7EA800F0207EEE01F021F903A
FE007FF83F027F01E0903807FC7F91B5C73801FEFF010301FCEC007F4901F0814901C015
0F4949814990C97E494882495A48498248197F5C48193F5C48191F5C48190FA2485BA21A
075AA391CDFCA2B5FCAD7EA280F207C0A27EA36C7F1A0F6C1A80806C191F6E18006C6180
6C197E6C6D177C6D6C17FC6D6C4C5A6D6D4B5A6D6D4B5A6D01F0ED1FC06D01FC4B5A0100
01FF03FFC7FC6E01E0EB07FE021F01FEEB3FFC020790B612F0020116C0DA003F92C8FC03
0714F8DB001F13804A4D79CB59>67 D<B912F0F0FF8019F019FC19FFD8001F9026800001
14C0DD001F7F060713F806017F726C7E737E737F737F737F8587737F8587A2747EA38786
A21C80A51CC0A586A462A51C80A51C00A26263A2631AFF636163614F5B634F5B073F90C7
FC4F5A4F5A06035B061F5B4DB512C0BBC8FC19FC19F0198006F0C9FC524B7CCA5E>I<BB
12C0A486D8000F01E0C77E18071801F0007F193F191F190F1907861903A31901A3EF0F80
A2737EA497C7FC171FA2173F177F17FF160392B6FCA5EDE0031600177F173F171FA2050F
EC0F80A3F21F00A494C8FC621A3EA21A7EA31AFE6219011903A21907190FF13FF819FF18
03183FBBFCA262A3494A7CC951>I<BBFCA41A80D8001F01C0C7FC181F18038484197F19
3F191F1AC0190FA31907A4171FF103E0A496C7FCA25FA25F5F5E160792B6FCA5EDC00716
01828383A283A794C9FCB1B8FCA5434A7CC94D>I<93261FFF80EB01C00307B500F81303
033F02FE13074AB7EA800F0207EEE01F021F903AFE007FF83F027F01E0903807FC7F91B5
C73801FEFF010301FCEC007F4901F0814901C0150F4949814990C97E494882495A484982
48197F5C48193F5C48191F5C48190FA2485BA21A075AA391CEFCA2B5FCAD7E050FB712C0
80A37E94C7001FEBC000807EA27E807E807E806C7F7E6D7E6D7E6D7F6D01E05D6D6D5D6D
13FC010001FF4AB5FC6E01E0EB07F9021F01FFEB3FF0020791B5EAE07F0201EEC01FDA00
3FED0007030702F81301DB001F018090C8FC524D79CB60>I<B7D8FC01B712FCA5D8001F
01C0C8001FEBC000B3AA92B9FCA503C0C8121FB3AEB7D8FC01B712FCA5564B7BCA60>I<
B712FEA5D8000FEBE000B3B3B3ABB712FEA5274B7DCA2E>I<B8FCA5D8001F01C0C9FCB3
B3A4193EA4197E197CA519FCA31801A2F003F8A21807180F181F183F187FEF01FF170717
3FBA12F0A53F4B7BCA4A>76 D<B600E04DB612806F5FA26F5FA2D8001F09FCC7FC6FEF0F
7FA2DABFFE171EA2DA9FFF173CA3028F6D1678A202876D16F0A202836DED01E0A302816D
ED03C0A202806DED0780A26F6CED0F00A36F6C151EA26F6C5DA26F6D5CA26F6D5CA36F6D
495AA26F6D495AA26F6D495AA3706C49C7FCA2706C131EA2706C5BA3706D5AA2706D5AA2
70EBE1E0A370EBF3C0A270EBFF80A27190C8FCA2715AA3715AA2715A497EB600F06D4801
03B71280A3715A715A694B7BCA74>I<B600E092B612FC8181A281D8001F6D9239001FE0
006F705A82A28202BF7F029F7FA2028F7F02877F02837F8214810280806F7F6F7F83816F
7F6F7F6F7F83816F80707F707F8482707F707F707FA2707F7014807113C019E0837113F0
7113F87113FC19FE837113FF71148F7213CF1AEF847213FF8484A284848485A2858585A2
85858585497EB600F8167F1A3F1A1F1A0FA2564B7BCA60>I<EEFFF8031FEBFFC04AB612
FC020715FF021FD9C01F13C091277FFE000313F0902601FFF09038007FFC49496E7E4901
80EC0FFF4990C86C7F49486F7F49486F7F017F8449486F7F4849707EA24849707E4885A2
4849701380A2481AC04A82A2481AE0A34890CA6C13F0A5B519F8AE6C1AF0A26E5EA36C1A
E0A26E5E6C1AC0A26C1A806E5E6C1A006E5E6C616E16FF6C616C6D4B5B6D6C4B5B6E5D6D
6D4A5B6D6D4A5B01076D4A90C7FC6D01F8ECFFFE6D01FE01035B9028007FFFC01F13F002
1F90B612C0020793C8FC020115FCDA001F14C0030101FCC9FC4D4D79CB5C>I<B912C018
FCF0FF8019F085D8001F902680000713FE05007F063F1380060F13C07213E01AF0841AF8
A27213FCA31AFEA81AFCA34E13F8A21AF0601AE04E13C0063F138095B51200050713FC92
B75A19E096C7FC18F803C0CAFCB3ABB712FCA5474B7BCA54>I<B9FC18F8F0FF8019E019
F8D8000F9026C0000713FE9439007FFF80061F7F727F727F727F84868684A286A862A24E
5BA2624E5B4E5B4E5B4E5B95B5C8FC050713FC92B712F0198006FCC9FC18FF9226C0003F
13C0050713F0717F717F717F187F85727FA28486A786A71C3E86A28474137E72157C726D
13FCB700FC6D9038FE01F872EBFF8373EBFFF0071F14E007031480CD383FFE00574C7CCA
5C>82 D<DA7FFCEB01C00103B5EAC003011FECF00749ECFC0F90B7121F48D9E00F13BF48
90C713FFD807FC141F4848804848140382484880177F485A173F171F12FFA2170F7FA217
077F7F7F6D92C7FC6D7E6C13F014FF15F86CECFF8016F86C15FF6C16C0836C826C826C82
6C82013F816D1680010716C01300020F15E01400030714F0ED007F160F16037013F88217
7F127800F8163FA3171FA27E18F0A27EA26CEE3FE07F18C001E0157F6DEDFF8001FC1600
01FF140302E0EB0FFED97FFEEB3FFC486CB612F0D8FC0F5DD8F803158048C66C49C7FC48
010313F0354D79CB44>I<003FBB12C0A5DA80019038FC001FD9FC001601D87FF0943800
7FE001C0183F49181F90C7170FA2007E1907A3007C1903A500FC1AF0481901A5C894C7FC
B3B3A749B812FCA54C4A7CC955>I<B700F8023FB512F8A5D8001F01C0C9380FE000745A
B3B3AD6D180F63811A1F6D96C7FC626D7F1A7E6D7F6D606E6C4B5A6E6CED07F06E6C4B5A
6E01C0EC3FC06E01F049B45A020101FF011F90C8FC6E91B55A033F15F8030715E0030092
C9FC040713F0554C7CCA5E>I<B700F00203B6FCA5D8001F01E0C93803FC00745A6D6181
1A036D6D5F1A076D6D5F1A0F6D616F161FA26D6D94C7FC626E6D153E1A7E6E177C7015FC
6E5F8219016E6D5D19036E5F7014076E5F82190F6E6D5D191F6E6D92C8FC616F153E8319
7E6F6D137C19FC6F6D5B18016F5DEFF003A26F01F85B18076F01FC5B180F6F5DEFFE1F6F
92C9FC17FF607013BE18FE705BA2705BA3705BA2705BA2705BA3705BA27090CAFCA2177E
A2584C7ECA5D>I<B700F84AB6FCA5D8001F01F0C93803FC006F705A6D4E5A6D6D4C5A81
6D4E5A6D6D4C5A826D4EC7FC6E6D5D70157E6E5F6E7F704A5A6E4C5A6E7F704A5A6E4C5A
6E7F71495A6E4CC8FC6F7F71137E6F5D6F7F71485A6F4A5A6F13FC71485A6F4A5A6F13FF
F09F806F02BFC9FC7013FF60705B8260705B8260B3A7037FB612FEA5584B7ECA5D>89
D<ECFFFC010FEBFFC0017F14F090B612FC489038803FFF2703FC00077F486C6D7F486C6D
7F6E7E83707EA3707E6C90C7FC6C5A6C5AC9FCA4ED1FFF021FB5FC49B6FC130F013FEBC0
3F9038FFFE00000313F04813C04890C7FC485A485AA2485AA2485AA4167FA26D14FF007F
15EF6D01017F6C6C903907CFFF806C6CD90F8F13FE6C9038E07F076C9038FFFE0300014A
7ED8003F9038F0007F0103018090C7FC37337CB13C>97 D<EB7FC0B5FCA512037EB3A2ED
0FFF037F13F002C1B512FC02C714FF9126CFF80F7F9126FFC00113E092C76C7E02FC6E7E
4A6E7E5C4A6E7E84831980A219C083A319E0AC19C0A25F1980A34D1300606E141F606E4A
5A6E4A5A02BF4A5A91261F80035B9027FE0FF01F5B496CB548C7FC496C14F849C614E0C8
D80FFEC8FC3B4D7CCB44>I<91380FFF8091B512F8010314FF010F158090263FFE0013C0
D97FF8EB1FE0D9FFE0EB3FF04849EB7FF8484913FF4890C7FC5A5B121F5B003FED7FF0EE
3FE0007FED1FC093C7FC5BA212FFAC127F7FA2123FA26D153E121F6D157E6C167C6C6D14
FC6C16F86C6D13036C01F0EB07F0D97FFCEB1FE06DB4EBFFC0010F90B5120001035C0100
14F0020F13802F337CB137>I<EF1FF0EE3FFFA51600177FB3A2EC0FFF91B512E0010314
F8010F14FE013FEB01FF903A7FF8003FFFD9FFE0130F48497F48497F4890C77E4881485A
A2485AA3127F5BA212FFAC127FA37F123FA2121F7F000F5D6C6C5C5E6C6D5B6C01E0497F
6C6D017FEBFFE090393FFE03FE6DB512F801075C010114C09027001FFC00EBC0003B4D7C
CB44>I<EC0FFF91B512F0010314FC010F14FF90263FFE077F90267FF0007F4948EB3FE0
4801806D7E48824890C76C7E4848140783485A003F6F7EA3485A701380A312FFA290B8FC
A401F8CAFCA5127FA27FA2123FA26C6CED0F80A2000F161F6C6C16006E5C6C6D147E6C6D
5C6C6D495AD97FFCEB07F0903A1FFF803FE06D90B55A010392C7FCD9007F13FC020713C0
31337DB138>I<ED7FE0913807FFFC021F7F027F7F902601FFE0138049018113C0902607
FE0113E049485A14F8131FEB3FF0A26F13C0EB7FE06F1380EE3E0093C7FCADB77EA52600
7FF0C8FCB3B3A2003FB512F8A52B4D7DCC26>I<DA7FFCEB0FF00103B538807FF8011F91
38F1FFFC4991B512FE90267FF01F13F32701FFC007138348EB0001A248486DEBC1FC000F
EEE0F849027F1300A2001F82A8000F5EA26D14FF00075E6C6C495BA26CD9C00790C7FC6C
9038F01FFC4890B55A5ED803C314809026C07FFCC8FC000790CAFCA47FA27F13FC90B612
FCEEFFC06C16F817FE6C8218806C17C06D16E00003B812F0120FD81FFCC7000F13F8D83F
F0140049153F4848ED1FFC00FF160F491507A56D150F007F17F86D151F6C6CED3FF06C6C
ED7FE0D80FFE913801FFC06C6C6C010713806C01F8017F1300C690B612FC013F15F00107
1580D9003F01F0C7FC37487DB03D>I<EB7FC0B5FCA512037EB3A2923801FFC0030F13F8
033F13FE4B7F9126C1FE077F9126C3F0037F9138C7C001DACF8080150002DE7F02FC81A2
5CA25CA35CB3A9B6D8C07FEBFFE0A53B4C7BCB44>I<13FCEA03FF487F487FA2487FA66C
5BA26C5B6C90C7FCEA00FC90C8FCACEB7FC0B5FCA512037EB3B3B61280A5194D7BCC22>
I<EB7FC0B5FCA512037EB3B3B3AAB61280A5194C7BCB22>108 D<90287FC001FFE0EC7F
F8B5010F01FC0103B5FC033F6D010F804B6D6C4814E0DBFE079026C03F817F9126C3F001
9138FC007F0003D9C7E0DAE1F8806CDA8000D9F1E06D7E02CFC7EBF3C002DE91267FF780
131F02FC03FFC77FA24A5DA24A5DA34A5DB3A9B6D8C03FB5D8F00FB512FCA55E317BB067
>I<903A7FC001FFC0B5010F13F8033F13FE4B7F9126C1FE077F9126C3F0037F00039038
C7C0016CD9CF8080150002DE7F02FC81A25CA25CA35CB3A9B6D8C07FEBFFE0A53B317BB0
44>I<913807FF80027F13F80103B6FC010F15C090261FFE017F903A7FF0003FF8D9FFC0
EB0FFC48496D7E4890C76C7E4817804980000F17C048486E13E0A2003F17F049157FA200
7F17F8A400FF17FCAB007F17F8A36C6CEDFFF0A3001F17E06D5C000F17C06C6C4A13806C
17006C6D495A6C01E0EB1FFC6D6C495A903A3FFE01FFF0010FB612C0010392C7FCD9007F
13F80207138036337DB13D>I<90397FC00FFFB5017F13F002C1B512FC02C714FF9126CF
F80F7F9126FFC00313E0000391C77F6C01FC6E7E4A6E7E5C4A6E7E848319808319C0A471
13E0AC4D13C0A319805FA219004D5A804D5A6E4A5A6E4A5A02FF495BDB80075B9126EFF0
1F5B02E7B548C7FC02E314F802E014E0DB0FFEC8FC92CAFCAFB612C0A53B467CB044>I<
9039FF803FE0B5EBFFF8028113FE02837FDA87E11380EC8F830003D99F0713C06C139E14
BCA214F8A24A6C13806F13004A6C5A93C7FCA45CB3A7B612E0A52A317CB032>114
D<90390FFF8070017FEBF1F048B6FC1207380FFC01391FE0003F4848130F491307127F90
C712035A1501A27FA213E06D90C7FC13FE387FFFF0ECFFC015F06C14FC6C14FF6C15806C
15C06C15E0C615F0013F14F8010714FCEB007F14019138003FFE150F0078140700F81403
A26C1401A37E16FC6C14036D14F87F6DEB07F001F8EB1FE001FFEBFFC091B51280D8FC7F
1400D8F81F13FCD8E00313C027337CB130>I<14F8A61301A41303A21307A2130FA2131F
133F137F13FF1203000F90B512F0B7FCA426007FF8C7FCB3A6167CAA013F14F880A29039
1FFE01F0010F1303903907FF87E06DEBFFC06D14806D6C1300EC0FFC26467EC430>I<D9
7FE0EC3FF0B5EC7FFFA5000315016C81B3AB5EA25EA25E7E6EEB0F7F017F021E7F6E017C
EBFFE090393FFE01F86DB512F0010714E0010114C09027003FFE00EBC0003B327BB044>
I<B66C90B512C0A5000101E0C73807F0006E5D6C5F6E140F017F5E80171F013F93C7FC6E
5C011F153E6E147E6D157C6F13FC6D5DEDC001A26D01E05B16036D5DEDF0076D5DEDF80F
027F5CEDFC1F023F91C8FC15FE5E021F133EEDFF7E6E137C16FC6E5BA26E5BA36E5BA26E
5BA26F5AA26FC9FCA23A317DAF41>I<B60081B500FC90387FFFF0A500019026E0000301
80903803FC006E715A6C6F5E6E6F1303017F61A26E496D1307013F616E6F130F011F4A5E
A26E6F131F6D4A93C7FCDD9FFC5B6DD9801F153E170F03C06E137E6D023F157C93383E07
FFDBE07E15FC6DDA7C035C03F015816D02FC5D4C7E03F815C3DA7FF95E9226FDF00013E7
DA3FFF5E4C137F19FF6E5F4C7FA26E496D90C8FCA26E5E93C7120FA26E486E5AA202015E
4B1403A26E486E5A54317EAF59>I<007FB500C090387FFFE0A5C601F0C73803F8006E5D
017F5E6E1407013F5E6E140F011F5E6E141FA26D6D91C7FC5F6D153E6F137E6D157C6F13
FC6D5DEDF0016D5DEDF803027F5C15FC1607DA3FFE5B160F021F5CEDFF1F6E91C8FC16BF
6E13BE16FE6E5BA36E5BA26E5BA26F5AA26F5AA26F5AA393C9FC5D153E157E157CD81F80
13FC486C5B387FE001D8FFF05B14035D14074A5A49485A007F49CAFCEBC07E383F81FC6C
B45A6C5B6C13C0C648CBFC3B467EAF41>121 D E
%EndDVIPSBitmapFont
%DVIPSBitmapFont: Ff cmtt12 17.28 6
/Ff 6 123 df<913803FFC0023F13FC49B67E010715F04981013F15FE498190B812C048
8348D9FC0180489026E0001F7F480180130391C87F48486F7E49153F4848ED0FFF834848
178083496F13C012FF8319E07FA2187FA36C5A6C5A6C5ACBFCA218FFA219C05FA219805F
A24D13005F604D5A173F4D5A4D5AA24C5B4C5B4C5B041F90C7FC4C5A4C5A4C5A4B5B4B5B
4B5B031F5B4B90C8FC4B5AEDFFF84A5B4A5B4A5B021F5B4A90C9FCEC7FFC4A5A495B495B
010F5B495B4948CAFC4948ED1F804948ED3FC04849ED7FE0485B000F5B4890C9FC4890B8
FC5ABAFCA56C18C06C18803B5A79D94A>50 D<383FFFF0487F80B5FCA37EA27EEA000FB0
EE0FFC93B57E030714E0031F14F84B14FE92B7FC02FD8291B87E85DCE01F7FEE000703FC
01017F4B6D7F03E0143F4B6E7E4B140F8592C87E4A6F1380A34A6F13C0A284A21AE0A219
7FAA19FFA21AC0A26E5DA24E138080606F1600606F4A5A6F143F6F4A5A6F4A5A6F130303
FF010F5BDCC03F5B93B65A6102FD93C7FC02FC5D6F5C031F14F0902607F80714C0902603
F00191C8FC90C8EA3FF043597FD74A>98 D<EC01F0EC07FC4A7EA24A7EA56E5AA26E5AEC
01F091CAFCAE001FB512FC4880815AA37EA27EC71203B3B3A8003FB812C04817E0A2B912
F0A36C17E0A26C17C0345974D84A>105 D<003FB512FE4880B77EA57E7EC71201B3B3B3
B0003FB812FC4817FEBAFCA56C17FE6C17FC385877D74A>108 D<EE0FFC263FFFF090B5
7E48D9F80714E0DAFC1F14F8B54914FE92B7FC02FD826C90B87E856CDBE01F7FD8000FEC
000703FC01017F4B6D7F03E0143F4B6E7E4B140F8592C87E4A6F1380A34A6F13C0A284A2
1AE0A2197FAA19FFA21AC0A26E5DA24E138080606F1600606F4A5A6F143F6F4A5A6F4A5A
6F130303FF010F5BDCC03F5B93B65A6102FD93C7FC02FC5D6F5C031F14F0030714C00301
91C8FC9238003FF093CAFCB3A4003FB6FC4881A2B77EA36C5DA26C92CAFC435F7FBE4A>
112 D<000FB912E04818F04818F8A619F001F0C8000313E04D13C04D13804D13004D5A4D
5A4D5A6C484A5B6C484A5BC9000F5B4C5B4C90C7FC4C5A4C5A4B5B4B5B4B5B4B5B4B5B4B
90C8FC4B5A4B5A4A5B4A5B4A5B4A5B4A5B4A90C9FC4A5A4A5A495B495B495B4949EC07E0
4949EC0FF04948C8EA1FF8495A495A485B485B485B485B4890C9FC485A48B9FCBAFCA66C
18F06C18E03D3E7BBD4A>122 D E
%EndDVIPSBitmapFont
%DVIPSBitmapFont: Fg cmbx12 17.28 28
/Fg 28 120 df<16F04B7E1507151F153FEC01FF1407147F010FB5FCB7FCA41487EBF007
C7FCB3B3B3B3007FB91280A6395E74DD51>49 D<913801FFF8021FEBFFC091B612F80103
15FF010F16C0013F8290267FFC0114F89027FFE0003F7F4890C7000F7F48486E7FD807F8
6E148048486E14C048486E14E048486F13F001FC17F8486C816D17FC6E80B56C16FE8380
A219FFA283A36C5BA26C5B6C90C8FCD807FC5DEA01F0CA14FEA34D13FCA219F85F19F04D
13E0A294B512C019804C14004C5B604C5B4C5B604C13804C90C7FC4C5A4C5A4B13F05F4B
13804B90C8FC4B5AED1FF84B5A4B5A4B48143F4A5B4A48C8FC4A5A4A48157E4A5A4A5AEC
7F8092C9FC02FE16FE495A495A4948ED01FCD90FC0150749B8FC5B5B90B9FC5A4818F85A
5A5A5A5ABAFCA219F0A4405E78DD51>I<92B5FC020F14F8023F14FF49B712C04916F001
0FD9C01F13FC90271FFC00077FD93FE001017F49486D8049C86C7F484883486C6F7F14C0
486D826E806E82487FA4805CA36C5E4A5E6C5B6C5B6C495E011FC85A90C95CA294B55A61
4C91C7FC604C5B4C5B4C5B4C5B047F138092260FFFFEC8FC020FB512F817E094C9FC17F8
17FF91C7003F13E0040713F8040113FE707F717F7113E085717FA2717F85A285831A80A3
1AC0EA03FCEA0FFF487F487F487FA2B57EA31A80A34D14005C7E4A5E5F6C495E49C8485B
D81FF85F000F5ED807FE92B55A6C6C6C4914806C01F0010791C7FC6C9026FF803F5B6D90
B65A011F16F0010716C001014BC8FCD9001F14F0020149C9FC426079DD51>I<F01F804E
7E187F18FFA25F5F5F5FA25F5F5FA294B5FC5E5E5EA25E5EEE3FBFEE7F3FA216FEED01FC
ED03F8ED07F0A2ED0FE0ED1FC0ED3F8016005D15FE4A5A4A5AA24A5A4A5A4A5A4A5AA24A
C7FC14FE495A5C1303495A495A495A5C133F49C8FC13FE485AA2485A485A485A5B121F48
5A48C9FC12FEBCFCA6CA6CEBC000B1037FB8FCA6485E7CDD51>I<4DB5ED03C0057F02F0
14070407B600FE140F047FDBFFC0131F4BB800F0133F030F05FC137F033F9127F8007FFE
13FF92B6C73807FF814A02F0020113C3020702C09138007FE74A91C9001FB5FC023F01FC
16074A01F08291B54882490280824991CB7E49498449498449498449865D49498490B5FC
484A84A2484A84A24891CD127FA25A4A1A3F5AA348491A1FA44899C7FCA25CA3B5FCB07E
A380A27EA2F50FC0A26C7FA37E6E1A1F6C1D80A26C801D3F6C6E1A00A26C6E616D1BFE6D
7F6F4E5A7F6D6D4E5A6D6D4E5A6D6D4E5A6D6E171F6D02E04D5A6E6DEFFF806E01FC4C90
C7FC020F01FFEE07FE6E02C0ED1FF8020102F8ED7FF06E02FF913803FFE0033F02F8013F
1380030F91B648C8FC030117F86F6C16E004071680DC007F02F8C9FC050191CAFC626677
E375>67 D<B96C90B91280A6D8000102C0C9000102C0C7FCB3B3A293BBFCA604C0C91201
B3B3A6B96C90B91280A671627AE17E>72 D<B912E0A6C702E0C7FCB3B3B3B3AEB912E0A6
33627CE13C>I<B700C0083FB612F070627097B7FCA37061D800010DF8C7FC70F103EFA2
02FD6DF107CFA202FC6DF10F8FA36F6DF01F0FA26F6D183EA26F6D187CA26F6D18F8A36F
6DEF01F0A26F6DEF03E0A26F6DEF07C0A26F6DEF0F80A3706DEE1F00A2706D163EA2706D
5EA2706D5EA3706D4B5AA2706D4B5AA2706D4B5AA2706D4B5AA3716D4AC7FCA2716D143E
A2716D5CA2716D5CA3716D495AA2716D495AA2716D495AA2716D495AA3726D48C8FCA272
EBC03EA2726D5AA2726D5AA372EBF9F0A272EBFFE0A2725CA2725CA37390C9FCA2735AA2
735A90381FFFC0B700F86E480207B812F0A3735AA2735A8C627AE199>77
D<BB7E1AFCF2FFC01BF81BFE757ED800010280C7001F80070114F0736C7F081F7F747F74
7F7414807414C0A27414E0A21DF0A27513F8A41DFCA91DF8A498B512F0A21DE0A25014C0
1D8062501400505B505B087F5B4FB512E0071F5C93B9C7FC1BFC1BF01B8008F0C8FC04C0
CCFCB3B3A2B97EA65E627AE16E>80 D<001FBEFCA64849C79126E0000F148002E0180091
C8171F498601F81A0349864986A2491B7FA2491B3F007F1DC090C9181FA4007E1C0FA600
FE1DE0481C07A5CA95C7FCB3B3B3A3021FBAFCA663617AE070>84
D<913803FFFE027FEBFFF00103B612FE010F6F7E4916E090273FFE001F7FD97FE001077F
D9FFF801017F486D6D7F717E486D6E7F85717FA2717FA36C496E7FA26C5B6D5AEB1FC090
C9FCA74BB6FC157F0207B7FC147F49B61207010F14C0013FEBFE004913F048B512C04891
C7FC485B4813F85A5C485B5A5CA2B55AA45FA25F806C5E806C047D7F6EEB01F96C6DD903
F1EBFF806C01FED90FE114FF6C9027FFC07FC01580000191B5487E6C6C4B7E011F02FC13
0F010302F001011400D9001F90CBFC49437CC14E>97 D<903807FF80B6FCA6C6FC7F7FB3
A8EFFFF8040FEBFF80047F14F00381B612FC038715FF038F010014C0DBBFF0011F7FDBFF
C001077F93C76C7F4B02007F03F8824B6F7E4B6F13804B17C0851BE0A27313F0A21BF8A3
7313FCA41BFEAE1BFCA44F13F8A31BF0A24F13E0A24F13C06F17804F1300816F4B5A6F4A
5B4AB402075B4A6C6C495B9126F83FE0013F13C09127F00FFC03B55A4A6CB648C7FCDAC0
0115F84A6C15E091C7001F91C8FC90C8000313E04F657BE35A>I<92380FFFF04AB67E02
0F15F0023F15FC91B77E01039039FE001FFF4901F8010113804901E0010713C049018049
13E0017F90C7FC49484A13F0A2485B485B5A5C5A7113E0485B7113C048701380943800FE
0095C7FC485BA4B5FCAE7EA280A27EA2806C18FCA26C6D150119F87E6C6D15036EED07F0
6C18E06C6D150F6D6DEC1FC06D01E0EC7F806D6DECFF00010701FCEB03FE6D9039FFC03F
FC010091B512F0023F5D020F1580020102FCC7FCDA000F13C03E437BC148>I<F17FF805
0FB5FCA6EF000F8484B3A892380FFF804AB512F8020F14FE023FECFF8391B712E3010391
38807FF3499039F8000FFB011F01E00103B5FC494913004990C87E49488148498148834A
815A485BA2485BA25AA3485BA4B5FCAE7EA46C7FA37EA26C7FA26C5F806C5F6C6D5D6C6D
5D017F93B5FC6D6C6C0103806D6D49806D01F0D91FF7EBFFFE6D9039FE01FFE7010190B6
12876D6CECFE07021F14F8020314E09127003FFE00ECC0004F657BE35A>I<92380FFFC0
4AB512FC020FECFF80023F15E091B712F80103D9FE037F499039F0007FFF011F01C0011F
7F49496D7F4990C76C7F49486E7F48498048844A804884485B727E5A5C48717EA35A5C72
1380A2B5FCA391B9FCA41A0002C0CBFCA67EA380A27EA27E6E160FF11F806C183F6C7FF1
7F006C7F6C6D16FE6C17016D6C4B5A6D6D4A5A6D01E04A5A6D6DEC3FE0010301FC49B45A
6D9026FFC01F90C7FC6D6C90B55A021F15F8020715E0020092C8FC030713F041437CC14A
>I<EE3FFC0307B51280033F14C04AB612F0020715F84A9038F03FFC4AEB807F913A7FFE
00FFFE4A5A4B4813FF4913F05B4913E0A24913C0A27013FE4949EB7FFCEF3FF8EF1FF0EF
07C094C7FCB0B812C0A6D8001F01C0C8FCB3B3B0007FB612FCA638657CE431>I<F107F8
DB7FFEEC3FFE020FB5D8F001B5FC027FDAFE03148049B7128F49DCDFFD13C0010FD9F00F
EBFFC149D9800114014990C7EBFC0349486E6C7E4948EC3FFF48496E0181138007801300
48F0C03E97C7FC48496E7FA34884A96C60A36C6D4A5BA26C60A26C6D4A90C8FC6D6C4A5A
6D6C4A5A6D6D485BDBF00F5B4990B612C060D97C7F4AC9FCD9FC0F14F09126007FFECAFC
92CCFC1201A47FA27F8014F091B77E18FE6CEFFFC019F06D17FC19FF6D846D846D846D84
013F8490BAFC0003854801E0C712014890C9000F7F484816014848EE007F4848717E8512
FF5B85A56D5F007F616D173F003F616D177F6C6C4D5A6C01C003035B6C6D4B5B6C01F803
1F5BC601FF92B5C7FC6D01F8011F5B011F90B712F8010717E0010094C8FC020F15F0DA00
3F01FCC9FC4A607CC151>I<903807FF80B6FCA6C6FC7F7FB3A8EF1FFF94B512F0040714
FC041F14FF4C8193267FE07F7F922781FE001F7FDB83F86D7FDB87F07FDB8FC0814C7F03
9FC78015BE03BC8003FC825DA25DA25DA45DB3B2B7D8F007B71280A651647BE35A>I<EB
0FE0EB3FF8497E48B5FCA24880A24880A76C5CA26C91C7FCA238007FFC6D5AEB0FE090C9
FCAF903807FF80007FB5FCA6C6FC7F7FB3B3AEB712C0A622657BE42C>I<903807FF80B6
FCA6C6FC7F7FB3B3B3B3ADB712E0A623647BE32C>108 D<902607FF80D91FFFEEFFF8B6
91B500F00207EBFF80040702FC023F14E0041F02FF91B612F84C6F488193267FE07F6D48
01037F922781FE001F9027E00FF0007FC6DA83F86D9026F01FC06D7F6DD987F06D4A487F
6DD98FC0DBF87EC7804C6D027C80039FC76E488203BEEEFDF003BC6E4A8003FC04FF834B
5FA24B5FA24B94C8FCA44B5EB3B2B7D8F007B7D8803FB612FCA67E417BC087>I<902607
FF80EB1FFFB691B512F0040714FC041F14FF4C8193267FE07F7F922781FE001F7FC6DA83
F86D7F6DD987F07F6DD98FC0814C7F039FC78015BE03BC8003FC825DA25DA25DA45DB3B2
B7D8F007B71280A651417BC05A>I<923807FFE092B6FC020715E0021F15F8027F15FE49
4848C66C6C7E010701F0010F13E04901C001037F49496D7F4990C87F49486F7E49486F7E
48496F13804819C04A814819E048496F13F0A24819F8A348496F13FCA34819FEA4B518FF
AD6C19FEA46C6D4B13FCA36C19F8A26C6D4B13F0A26C19E06C6D4B13C0A26C6D4B13806C
6D4B13006D6C4B5A6D6D495B6D6D495B010701F0010F13E06D01FE017F5B010090B7C7FC
023F15FC020715E0020092C8FC030713E048437CC151>I<D90FFFEB0FFCB690383FFF80
93B512E04B14F04B14F8923907FC7FFC92390FE0FFFEC6EC1F806DD93F0113FF6D133E15
7E157C15F8A215F07013FEA24BEB7FFCEF3FF8EF0FE04B90C7FCA55DB3B0B712F8A63841
7BC042>114 D<913A3FFF8007800107B5EAF81F011FECFE7F017F91B5FC48B8FC48EBE0
014890C7121FD80FFC1407D81FF0801600485A007F167F49153FA212FF171FA27F7F7F6D
92C7FC13FF14E014FF6C14F8EDFFC06C15FC16FF6C16C06C16F06C826C826C826C82013F
1680010F16C01303D9007F15E0020315F0EC001F1500041F13F81607007C150100FC8117
7F6C163FA2171F7EA26D16F0A27F173F6D16E06D157F6D16C001FEEDFF806D0203130002
C0EB0FFE02FCEB7FFC01DFB65A010F5DD8FE0315C026F8007F49C7FC48010F13E035437B
C140>I<EC07E0A6140FA5141FA3143FA2147FA214FF5BA25B5B5B5B137F48B5FC000F91
B512FEB8FCA5D8001F01E0C8FCB3AFEF0FC0AC171F6D6D1480A2173F6D16006F5B6D6D13
7E6D6D5B6DEBFF836EEBFFF86E5C020F14C002035C9126003FFCC7FC325C7DDA3F>I<90
2607FFC0ED3FFEB60207B5FCA6C6EE00076D826D82B3B3A260A360A2607F60183E6D6D14
7E4E7F6D6D4948806D6DD907F0ECFF806D01FFEB3FE06D91B55A6E1500021F5C020314F8
DA003F018002F0C7FC51427BC05A>I<B70081B600FC0103B512FCA6C66C0180C701FCC8
381FFE006F6FED03F86D047F5F856F6E16076D646F70140F6D705F866F6E161F6D646F4A
6D143F6D99C7FC4E7F6F616D1B7E6F4A6D14FE6D6395B57E7001FC15016E62DCC0016E13
036EDBF87F5D05038004E0496C14076E62DCF007ED800F6E4B6C5D050F15C004F8496C14
1F6E62DCFC1FEDE03F6E4B6C92C8FC053F15F004FE496C5C6E197E7048EDF8FE6E027E6D
5C05FE15FC4D6D13FD6F601BFF6F496E5BA24D806F60A26F496E5BA24D806F60A26F496E
90C9FCA294C87E6F5FA26F486F5A047C6F5A6E417DBF75>119 D
E
%EndDVIPSBitmapFont
%DVIPSBitmapFont: Fh cmsy10 10.95 1
/Fh 1 16 df<EB0FFCEB3FFF90B512C0000314F04880488048804880A2481580A3B712C0
AA6C1580A36C1500A26C5C6C5C6C5C6C5CC614C0013F90C7FCEB0FFC22227BA72D>15
D E
%EndDVIPSBitmapFont
%DVIPSBitmapFont: Fi cmtt10 10.95 89
/Fi 89 127 df<121C127FEAFF80B3EA7F00B2123EC7FCA8121C127FA2EAFF80A3EA7F00
A2121C09396DB830>33 D<00101304007C131F00FEEB3F80A26C137FA248133FB2007E14
00007C7F003C131E00101304191C75B830>I<903907C007C0A2496C487EA8011F131FA2
02C05BA3007FB7FCA2B81280A36C16006C5D3A007F807F80A2020090C7FCA9495BA2003F
90B512FE4881B81280A36C1600A22701FC01FCC7FCA300031303A201F85BA76C486C5AA2
29387DB730>I<EB07E0EB1FF8497E137F497E803801FC7F497E810003131F13F0A6143F
92C8FC91387F0FFF9026F87E1F1380000113FEEBF9FC13FB4A6C1300D9FFF013C06C13E0
151F02C05BEB7F809038FF003F4892C7FC485C48EB807E5A15FE391FDFC0FC383F8FE014
E1397F07F1F8EB03F300FEEBFBF0EB01FF5D7FEDC006027F130F91393F801F8015C06C13
7F6CEBFFE049EBF83F018701FC1300263FFFFBB5FC6C01F15B14E06C9038C03FFC000390
38001FF8D801FCEB07E0293A7DB830>38 D<EA07C0EA0FF0EA1FF8A213FCA213FE120F12
07EA007EA513FE13FCA2120113F81203EA07F0120FEA1FE0127FEAFFC013801300127C12
380F1D70B730>I<141E147F14FF5BEB03FEEB07FCEB0FF0EB1FE0EB3FC0EB7F80EBFF00
485A5B12035B485A120F5BA2485AA2123F5BA2127F90C7FCA412FEAD127FA47F123FA27F
121FA26C7EA27F12076C7E7F12017F6C7EEB7F80EB3FC0EB1FE0EB0FF0EB07FCEB03FEEB
01FF7F147F141E184771BE30>I<127812FE7E7F6C7E6C7EEA0FF06C7E6C7E6C7E6C7EEB
7F80133F14C0131FEB0FE014F01307A2EB03F8A214FC1301A214FE1300A4147FAD14FEA4
130114FCA2130314F8A2EB07F0A2130F14E0EB1FC0133F1480137FEBFF00485A485A485A
485AEA3FE0485A485A90C7FC5A1278184778BE30>I<14E0497E497EA60038EC0380007E
EC0FC0D8FF83EB3FE001C3137F9038F3F9FF267FFBFB13C06CB61280000FECFE00000314
F86C5C6C6C13C0011F90C7FC017F13C048B512F04880000F14FE003FECFF80267FFBFB13
C026FFF3F913E09038C3F87F0183133FD87E03EB0FC00038EC0380000091C7FCA66D5A6D
5A23277AAE30>I<143EA2147FAF007FB7FCA2B81280A36C1600A2C76CC8FCAF143EA229
297DAF30>I<EA03E0EA0FF0EA1FF813FCEA3FFEA213FFA27EA27E1203EA007FA2137E13
FEEA01FC1203EA07F8EA3FF0127FEAFFE0EA7F801300123C1019708B30>I<007FB612F0
A2B712F8A36C15F0A225077B9E30>I<120FEA3FC0EA7FE0A2EAFFF0A4EA7FE0A2EA3FC0
EA0F000C0C6E8B30>I<16F01501ED03F8A21507A2ED0FF0A2ED1FE0A2ED3FC0A2ED7F80
A2EDFF00A24A5AA25D1403A24A5AA24A5AA24A5AA24A5AA24A5AA24AC7FCA2495AA25C13
03A2495AA2495AA2495AA2495AA2495AA249C8FCA2485AA25B1203A2485AA2485AA2485A
A2485AA2485AA248C9FCA25AA2127CA225477BBE30>I<14FE903807FFC0497F013F13F8
497F90B57E48EB83FF4848C6138049137F4848EB3FC04848EB1FE049130F001F15F04913
07A24848EB03F8A290C712014815FCA400FEEC00FEAD6C14016C15FCA36D1303003F15F8
A26D1307001F15F0A26D130F6C6CEB1FE0A26C6CEB3FC06C6CEB7F806D13FF2601FF8313
006CEBFFFE6D5B6D5B010F13E06D5BD900FEC7FC273A7CB830>I<EB03C0497EA2130FA2
131FA2133F137F13FF1203123FB5FCA213EF138FEA7E0F1200B3B0003FB512F84814FCB6
12FEA26C14FC6C14F81F3977B830>I<EB07FC90383FFFC090B512F00003804814FE4880
261FF80F1380263FE00113C09038C0007F4848EB3FE090C7121FED0FF04814075A6C15F8
1503A3127E1218C8FCA2150716F0150F16E0151F16C0153FED7F8015FF4A13005DEC07FC
4A5A4A5A4A5A4A5A4A5A4990C7FC495A495AEB0FF0EB3FE0495A495A4890C8FC4848EB01
F04848EB03F8485AEA1FE048B6FCB7FCA37E6C15F025397BB830>I<EB03FF013F13E090
B512F84814FE4880481580260FFE0113C09038F0007F4848EB1FE0150F16F01507A26C5A
6C5AC8FC150F16E0A2151FED3FC0157FEDFF8002071300903807FFFE495B5D8115FF6D14
80D9000113C09138003FE0ED1FF0ED07F8150316FC150116FE1500A21218127EB4FCA215
0116FC4814036C15F86C6C13076DEB1FF0D83FF0133F3A1FFE01FFE06CB612C06C15806C
ECFE00C65C013F13F001031380273A7CB830>I<EC03FC4A7E140F141FA2143F147F157E
14FEA2EB01FCEB03F8A2EB07F0A2EB0FE0EB1FC0A2EB3F80A2EB7F0013FEA2485A485AA2
485AA2485A485AA2485AA248C7FC12FEB8FC1780A46C1600C8007EC7FCAA91387FFFFE91
B6FCA46E5B29397DB830>I<000FB612804815C05AA316800180C8FCAEEB83FF019F13C0
90B512F015FC8181D9FE0313809039F0007FC049133F0180EB1FE06CC7120F000E15F0C8
1207A216F81503A31218127EA2B4FC150716F048140F6C15E06C141F6DEB3FC06D137F3A
3FE001FF80261FFC0F13006CB55A6C5C6C5C6C14E06C6C1380D90FFCC7FC25397BB730>
I<EC0FF8EC7FFF49B51280010714E0131F4914F090387FF80F9039FFC007F84813803803
FE005B485A4848EB03F0ED01E0484890C7FC5B123F5BA2127FEB000C903803FFE0010F13
F8D8FF3F13FE48B6FCB7128016C09039FE007FE001F8EB1FF001E0130F49EB07F849EB03
FCA290C7120116FE1500A37EA46C7E15016D14FC121F6D1303000FEC07F86D130F6C6CEB
1FF06DEB3FE03A03FF81FFC06C90B512806C15006D5B011F13F8010713E001011380273A
7CB830>I<127CB712FC16FEA416FC48C7EA0FF816F0ED1FE0007CEC3FC0C8EA7F80EDFF
00A24A5A4A5A5D14075D140F5D4A5AA24A5AA24AC7FCA25C5C13015CA213035CA213075C
A4495AA6131F5CA96D5A6DC8FC273A7CB830>I<49B4FC011F13F0017F13FC90B57E0003
ECFF804815C048010113E03A1FF8003FF049131FD83FC0EB07F8A24848EB03FC90C71201
A56D1303003F15F86D13076C6CEB0FF06C6CEB1FE0D807FCEB7FC03A03FF83FF806C90B5
12006C6C13FC011F13F0497F90B512FE48802607FE0013C0D80FF8EB3FE0D81FE0EB0FF0
4848EB07F8491303007F15FC90C712014815FE481400A66C14016C15FC6D1303003F15F8
6D1307D81FF0EB1FF06D133F3A0FFF01FFE06C90B512C06C1580C6ECFE006D5B011F13F0
010190C7FC273A7CB830>I<49B4FC010F13E0013F13F890B57E4880488048010113803A
0FFC007FC0D81FF0EB3FE04848131F49EB0FF048481307A290C7EA03F85A4815FC1501A4
16FEA37E7E6D1303A26C6C13076C6C130F6D133FD80FFC13FF6CB6FC7E6C14FE6C14F901
3FEBE1FC010F138190380060011400ED03F8A2150716F0150F000F15E0486C131F486CEB
3FC0157FEDFF804A1300EC07FE391FF01FFC90B55A6C5C6C5C6C1480C649C7FCEB3FF027
3A7CB830>I<120FEA3FC0EA7FE0A2EAFFF0A4EA7FE0A2EA3FC0EA0F00C7FCAF120FEA3F
C0EA7FE0A2EAFFF0A4EA7FE0A2EA3FC0EA0F000C276EA630>I<EA03C0EA0FF0EA1FF8A2
EA3FFCA4EA1FF8A2EA0FF0EA03C0C7FCAFEA03C0EA0FF0121F13F8123F13FCA3121FA212
0F12031200120113F8120313F01207EA1FE0123FEA7FC0EAFF80EA7F00127E12380E3470
A630>I<16F01503ED07F8151F157FEDFFF014034A13C0021F138091383FFE00ECFFF849
5B010713C0495BD93FFEC7FC495A3801FFF0485B000F13804890C8FCEA7FFC5BEAFFE05B
7FEA7FF87FEA1FFF6C7F000313E06C7F38007FFC6D7E90380FFF806D7F010113F06D7FEC
3FFE91381FFF80020713C06E13F01400ED7FF8151F1507ED03F01500252F7BB230>I<00
7FB7FCA2B81280A36C16006C5DCBFCA7003FB612FE4881B81280A36C1600A229157DA530
>I<1278127EB4FC13C07FEA7FF813FEEA1FFF6C13C000037F6C13F86C6C7EEB1FFF6D7F
010313E06D7F9038007FFC6E7E91380FFF806E13C0020113F080ED3FF8151F153FEDFFF0
5C020713C04A138091383FFE004A5A903801FFF0495B010F13804990C7FCEB7FFC48485A
4813E0000F5B4890C8FCEA7FFE13F8EAFFE05B90C9FC127E1278252F7BB230>I<EC1FE0
ECFFF8010313FE010F7F4914804914C090397FF03FE09038FF800F4890380007F0D803FC
13033A07F801FBF89038F007FF380FE01F4A13FCEA1FC0495A003FEBFF0F903800FE0790
3901FC03FE007FEBF801EA7E03ECF000A2EAFE0700FC49137EAA00FE6D13FED87E0314FC
A2ECF801D87F0114F8003FEBFC03903900FE07F0903880FF0F001F90387FFFE06D6C13C0
EA0FE06E13803A07F007FE009038F801F86C6CC7127C6CB414FE6CEB800390387FF01F6D
B512FC6D14F86D14E0010314C00100EBFE00EC1FF0273A7CB830>64
D<147F4A7EA2497FA4497F14F7A401077F14E3A3010F7FA314C1A2011F7FA490383F80FE
A590387F007FA4498049133F90B6FCA34881A39038FC001F00038149130FA40007814913
07A2D87FFFEB7FFFB56CB51280A46C496C130029397DB830>I<007FB512F0B612FE6F7E
82826C813A03F8001FF815076F7E1501A26F7EA615015EA24B5A1507ED1FF0ED7FE090B6
5A5E4BC7FC6F7E16E0829039F8000FF8ED03FC6F7E1500167FA3EE3F80A6167F1700A25E
4B5A1503ED1FFC007FB6FCB75A5E16C05E6C02FCC7FC29387EB730>I<91387F803C9039
03FFF03E49EBFC7E011F13FE49EBFFFE5B9038FFE07F48EB801F3903FE000F484813075B
48481303A2484813015B123F491300A2127F90C8FC167C16005A5AAC7E7EA2167C6D14FE
123FA27F121F6D13016C6C14FCA26C6CEB03F86D13076C6CEB0FF03901FF801F6C9038E0
7FE06DB512C06D14806D1400010713FC6D13F09038007FC0273A7CB830>I<003FB512E0
4814FCB67E6F7E6C816C813A03F8007FF0ED1FF8150F6F7E6F7E15016F7EA2EE7F80A216
3F17C0161FA4EE0FE0AC161F17C0A3163F1780A2167F17005E4B5A15034B5A150F4B5AED
7FF0003FB65A485DB75A93C7FC6C14FC6C14E02B387FB730>I<007FB7FCB81280A47ED8
03F8C7123FA8EE1F0093C7FCA4157C15FEA490B5FCA6EBF800A4157C92C8FCA5EE07C0EE
0FE0A9007FB7FCB8FCA46C16C02B387EB730>I<003FB712804816C0B8FCA27E7ED801FC
C7121FA8EE0F8093C7FCA5153E157FA490B6FCA69038FC007FA4153E92C8FCAE383FFFF8
487FB5FCA27E6C5B2A387EB730>I<02FF13F00103EBC0F8010F13F1013F13FD4913FF90
B6FC4813C1EC007F4848133F4848131F49130F485A491307121F5B123F491303A2127F90
C7FC6F5A92C8FC5A5AA892B5FC4A14805CA26C7F6C6D1400ED03F8A27F003F1407A27F12
1F6D130F120F7F6C6C131FA2D803FE133F6C6C137FECC1FF6C90B5FC7F6D13FB010F13F3
0103EBC1F0010090C8FC293A7DB830>I<3B3FFF800FFFE0486D4813F0B56C4813F8A26C
496C13F06C496C13E0D803F8C7EAFE00B290B6FCA601F8C7FCB3A23B3FFF800FFFE0486D
4813F0B56C4813F8A26C496C13F06C496C13E02D387FB730>I<007FB6FCB71280A46C15
00260007F0C7FCB3B3A8007FB6FCB71280A46C1500213879B730>I<49B512F04914F85B
A27F6D14F090C7EAFE00B3B3123C127EB4FCA24A5A1403EB8007397FF01FF86CB55A5D6C
5C00075C000149C7FC38003FF025397AB730>I<D83FFF90380FFF80486D4813C0B56C5A
A26C497E6C496C1380D803F0903803F8004B5A4B5A151F4B5A5E4BC7FC15FE14014A5A5D
4A5A4A5A141F5D4A5A4AC8FC5C13F18101F37F13F790B57E14EFECC7F01483EC03F81401
01FE7F496C7E5B157F497F82151F82150F826F7EA26F7E1501821500D83FFF903803FFC0
486D4813E0B56C5AA26C497E6C496C13C02B387FB730>I<383FFFF8487FB57EA26C5B6C
5BD801FCC9FCB3B0EE0F80EE1FC0A9003FB7FC5AB8FCA27E6C16802A387EB730>I<D83F
F8ECFFE0486C4913F0486C4913F8A2007F16F06C6C4913E00007160001EF14BFEC800FA3
9039E7C01F3FA4ECE03F01E3133EA2ECF07EA201E1137CA2ECF8FCA201E013F8A214FDEC
7DF0A3147FEC3FE0A3EC1FC0A2EC070091C7FCADD83FFC903801FFE0486C4913F0B54913
F8A26C486D13F06C486D13E02D387FB730>I<D83FFC90381FFF80486C4913C0B54913E0
A26C6D6C13C06C6E13800003913801F800EBF7C0A3EBF3E0A314F013F1A214F8A213F014
FCA2147C147EA2143E143FA2141FA21581A2140F15C1A2140715E1A2140315F1A21401A2
15F91400A3157DA3153FEA3FFF481380B5EAC01FA26CEB800F6C496C5A2B387EB730>I<
90383FFFE048B512FC000714FF4815804815C04815E0EBF80001E0133FD87F80EB0FF0A2
90C71207A44815F8481403B3A96C1407A26C15F0A36D130FA26D131F6C6CEB3FE001F813
FF90B6FC6C15C06C15806C1500000114FCD8003F13E0253A7BB830>I<007FB512F0B612
FE6F7E16E0826C813903F8003FED0FFCED03FE15016F7EA2821780163FA6167F17005EA2
4B5A1503ED0FFCED3FF890B6FC5E5E16804BC7FC15F001F8C9FCB0387FFFC0B57EA46C5B
29387EB730>I<90383FFFE048B512FC000714FF4815804815C04815E0EBF80001E0133F
4848EB1FF049130F90C71207A44815F8481403B3A8147E14FE6CEBFF076C15F0EC7F87A2
EC3FC7018013CF9038C01FFFD83FE014E0EBF80F90B6FC6C15C06C15806C1500000114FC
D8003F7FEB00016E7EA21680157F16C0153F16E0151F16F0150FED07E025467BB830>I<
003FB57E4814F0B612FC15FF6C816C812603F8017F9138003FF0151F6F7E150715038215
01A515035E1507150F4B5A153F4AB45A90B65A5E93C7FC5D8182D9F8007FED3FE0151F15
0F821507A817F8EEF1FCA53A3FFF8003FB4801C0EBFFF8B56C7E17F06C496C13E06C49EB
7FC0C9EA1F002E397FB730>I<90390FF803C0D97FFF13E048B512C74814F74814FF5A38
1FF80F383FE001497E4848137F90C7123F5A48141FA2150FA37EED07C06C91C7FC7F7FEA
3FF0EA1FFEEBFFF06C13FF6C14E0000114F86C80011F13FF01031480D9003F13C0140191
38007FE0151FED0FF0A2ED07F8A2007C140312FEA56C140716F07F6DEB0FE06D131F01F8
EB3FC001FF13FF91B51280160000FD5CD8FC7F13F8D8F81F5BD878011380253A7BB830>
I<003FB712C04816E0B8FCA43AFE003F800FA8007CED07C0C791C7FCB3B1011FB5FC4980
A46D91C7FC2B387EB730>I<3B7FFFC007FFFCB56C4813FEA46C496C13FCD803F8C7EA3F
80B3B16D147F00011600A36C6C14FE6D13016D5CEC800390393FE00FF890391FF83FF06D
B55A6D5C6D5C6D91C7FC9038007FFCEC1FF02F3980B730>I<D87FFE90380FFFC0B54913
E06E5AA24A7E6C486D13C0D807F0903801FC00A26D130300035DA46C6C495AA46C6C495A
A46D131F6D5CA3EC803F013F5CA46D6C48C7FCA490380FE0FEA401075B14F1A301035BA3
14FB01015BA314FFA26D5BA46E5A6E5A2B397EB730>I<D83FFC903801FFE0486C4913F0
00FF16F8A2007F16F06C486D13E0D81FC09038001FC0000F1680A76D143F00071600A700
0390380F803E9039F01FC07EEC3FE0A3EC7FF0A2147D0001157CA29039F8FDF8FCA314F8
A300005D01F913FCA2ECF07CA201FD137DA2017D5CECE03DA3017F133FA2ECC01FA2013F
5CA2EC800F6D486C5A2D397FB730>I<3A3FFF01FFF84801837F02C77FA202835B6C0101
5B3A01FC007F806D91C7FC00005C6D5BEB7F01EC81FCEB3F8314C3011F5B14E7010F5B14
FF6D5BA26D5BA26D5BA26D90C8FCA4497FA2497FA2815B81EB0FE781EB1FC381EB3F8181
EB7F0081497F49800001143F49800003141F49800007140FD87FFEEB7FFFB590B5128080
A25C6C486D130029387DB730>I<D87FFF90381FFFC0B56C4813E0A46C496C13C0D803F8
903803F8006D1307A26C6C495AA26C6C5C151F6D5CEC803F013F5CECC07F011F91C7FCA2
90380FE0FEA214F101075BA2903803FBF8A201015B14FF6D5BA26E5AA36E5AB1903803FF
F8497F497FA26D5B6D5B2B387EB730>I<001FB612FC4815FE5AA490C7EA03FCED07F816
F0150FED1FE016C0153FED7F80003E1500C85A4A5A5D14034A5A5D140F4A5A5D143F4A5A
92C7FC5C495A5C1303495A5C130F495A5C133F495A91C8FC5B4848147C4914FE1203485A
5B120F485A5B123F485A90B6FCB7FCA46C15FC27387CB730>I<007FB5FCB61280A41500
48C8FCB3B3B3A5B6FC1580A46C140019476DBE30>I<007FB5FCB61280A47EC7123FB3B3
B3A5007FB5FCB6FCA46C140019477DBE30>93 D<1307EB1FC0EB7FF0497E000313FE000F
EBFF80003F14E0D87FFD13F039FFF07FF8EBC01FEB800F38FE0003007CEB01F00010EB00
401D0E77B730>I<007FB612F0A2B712F8A36C15F0A225077B7D30>I<EB7FF80003B5FC48
14C04880488048809038E01FFC9038C003FE14016E7E6C487F6CC77FC8123FA491B5FC13
0F137F48B6FC12075A48EB803F383FF800EA7FE0138048C7FC5AA4157F7E6C6C13FFEBC0
03263FF01FEBFF8090B712C07E6C14EF000314876CD9FE01138026003FE0C8FC2A2A7BA8
30>97 D<EA3FFC487E12FFA2127F123F1200AAEC03FE91381FFF80027F13E091B57E90B6
12FC82ECFE079138F001FF4A6C13804A137F4AEB3FC091C7121F17E049140FA217F01607
A8160FA217E07F161F6EEB3FC0A26EEB7F806E13FFDAF00313009138FC0FFE91B55A5E49
5CD97E7F13C0D93C1F90C7FC90380003FC2C3980B730>I<ECFFE0010713FC011F7F017F
7F90B612804815C048EB807F3907FC003F485A485A49EB1F804848EB0F004990C7FC127F
90C9FCA25A5AA87E7EA27F003FEC07C06DEB0FE06C7E6D131F6C6C14C0D807FE133F9039
FFC0FF806C90B5FCC615006D5B011F13F801075B01011380232A7AA830>I<913801FFE0
4A7F5CA28080EC0007AAEB03FE90381FFF874913E790B6FC5A5A481303380FFC00D81FF0
133F49131F485A150F4848130790C7FCA25AA25AA87E6C140FA27F003F141F6D133F6C7E
6D137F390FF801FF2607FE07EBFFC06CB712E06C16F06C14F76D01C713E0011F010313C0
D907FCC8FC2C397DB730>I<49B4FC010713E0011F13F8017F7F90B57E48804801811380
3A07FC007FC04848133FD81FE0EB1FE0150F484814F0491307127F90C7FCED03F85A5AB7
FCA516F048C9FC7E7EA27F003FEC01F06DEB03F86C7E6C7E6D1307D807FEEB1FF03A03FF
C07FE06C90B5FC6C15C0013F14806DEBFE00010713F8010013C0252A7CA830>I<EDFF80
020713E0021F13F05C4A13F891B5FC491387903803FE079138FC03F0903907F800C04A13
00A8003FB612C04815E0B7FCA36C15C0260007F0C7FCB3A9003FB512FE4880B71280A26C
15006C5C25397DB830>I<D903FC13FF90261FFF8713C04913DF90B712E05A5A2607FE07
138F903AF801FE07C048486C6CC7FCA2497F001F8149133FA56D137F000F92C7FC6D5BA2
6C6C485AEBFE0790B55A5D485C15C001DF5BD9C3FCC8FC01C0C9FCA37F7F6CB512F015FF
6C15C04815F0488148813A3FE0001FFE0180130148C8127F007E8100FE168048151FA56C
153F007FED7F006D5C6C6C495A01F013076CB4EB7FFC6C90B55A6C5D000115C06C6C91C7
FC011F13FC010113C02B3E7DA730>I<EA3FFC487E12FFA2127F123F1200AAEC01FE9138
0FFF80023F13E091B57E90B67EA29138FE07FCECF8039138E001FE14C0EC8000A291C7FC
A25BB3A23B3FFFF81FFFF8486D4813FCB500FE14FEA26C01FC14FC6C496C13F82F3880B7
30>I<14E0EB03F8A2497EA36D5AA2EB00E091C8FCA9381FFFF8487F5AA27E7EEA0001B3
A9003FB612C04815E0B7FCA27E6C15C023397AB830>I<EC01C0EC07F0A2EC0FF8A3EC07
F0A2EC01C091C7FCA990B512F04814F8A47EEB0003B3B3A5EC07F0A2123C007EEB0FE0B4
131FEC3FC0147F90B512806C14005C6C5B000F13F0000313C01D4E7CB830>I<EA7FF848
7EA4127F1200AB0203B512804A14C017E0A217C06E14809139001FE0004B5A4B5A4BC7FC
4A5A4A5AEC0FF84A5A4A5A4A5A4A5A01FD7F90B57E8114F7ECE3F8ECC1FCEC81FEEC00FF
497F496D7E6F7E826F7E15076F7E6F7E3B7FFFF81FFFE0B56C4813F017F8A217F06C496C
13E02D387FB730>I<387FFFF8B57EA47EEA0001B3B3A8007FB612F0B712F8A46C15F025
387BB730>I<02FC137E3B7FC3FF01FF80D8FFEF01877F90B500CF7F15DF92B57E6C010F
13872607FE07EB03F801FC13FE9039F803FC01A201F013F8A301E013F0B3A23C7FFE0FFF
07FF80B548018F13C0A46C486C01071380322881A730>I<EC01FE3A3FFC0FFF80267FFE
3F13E000FF90B57E90B67E7E6C9038FE07FCC6EBF8039138E001FE14C0EC8000A291C7FC
A25BB3A23B3FFFF81FFFF8486D4813FCB500FE14FEA26C01FC14FC6C496C13F82F2880A7
30>I<49B4FC010F13E0013F13F8497F90B57E0003ECFF8014013A07FC007FC04848EB3F
E0D81FE0EB0FF0A24848EB07F8491303007F15FC90C71201A300FEEC00FEA86C14016C15
FCA26D1303003F15F86D13076D130F6C6CEB1FF06C6CEB3FE06D137F3A07FF01FFC06C90
B512806C15006C6C13FC6D5B010F13E0010190C7FC272A7CA830>I<EC03FE3A3FFC1FFF
80267FFE7F13E000FF90B57E90B612FC6C816CEBFE07C69038F001FF4A6C13804A137F4A
EB3FC091C7121F17E049140FA217F01607A8160FA217E07F161F6EEB3FC0A26EEB7F806E
13FFDAF00313009138FC0FFE91B55A5E495C6E13C0021F90C7FCEC03FC91C9FCAD383FFF
F8487FB57EA26C5B6C5B2C3C80A730>I<49B413F8010FEBC1FC013F13F14913FD48B6FC
5A481381390FFC007F49131F4848130F491307485A491303127F90C7FC15015A5AA77E7E
15037FA26C6C1307150F6C6C131F6C6C133F01FC137F3907FF01FF6C90B5FC6C14FD6C14
F9013F13F1010F13C1903803FE0190C7FCAD92B512F84A14FCA46E14F82E3C7DA730>I<
ED07F83A3FFF803FFF486DB51280B512C302CF14C06C13DF6C9038FFFC3FD8001F13E092
38801F809238000F004A90C7FC5C5C5CA25CA45CAF003FB512FC4880B7FCA26C5C6C5C2A
287EA730>I<90381FFC1E48B5129F000714FF5A5A5A387FF007EB800100FEC7FC4880A4
6C143E007F91C7FC13E06CB4FC6C13FC6CEBFF806C14E0000114F86C6C7F01037F903800
0FFF02001380007C147F00FEEC1FC0A2150F7EA27F151F6DEB3F806D137F9039FC03FF00
90B6FC5D5D00FC14F0D8F83F13C026780FFEC7FC222A79A830>I<EB0780497E131FA900
3FB612E04815F0B7FCA36C15E026001FC0C7FCB216F8ED01FCA5ECE003010FEB07F814F0
9138FC1FF06DB512E06D14C016806D14009038007FFCEC1FF026337EB130>I<D83FFCEB
3FFC486C497E00FF14FFA2007F147F003F143F00001400B3A41501A2150315076D130F90
3A7FC07FFFF891B612FC6D15FE7F6D4913FC6D9038F87FF8010001C0C7FC2F2880A630>
I<3B3FFFC07FFF80486DB512C0B515E0A26C16C06C496C13803B01F80003F000A26D1307
00005DA26D130F017E5CA2017F131F6D5CA2EC803F011F91C7FCA26E5A010F137EA2ECE0
FE01075BA214F101035BA3903801FBF0A314FF6D5BA36E5A6E5A2B277EA630>I<3B3FFF
C01FFFE0486D4813F0B515F8A26C16F06C496C13E0D807E0C7EA3F00A26D5C0003157EA5
6D14FE00015DEC0F80EC1FC0EC3FE0A33A00FC7FF1F8A2147DA2ECFDF9017C5C14F8A301
7E13FBA290393FF07FE0A3ECE03FA2011F5C90390F800F802D277FA630>I<3A3FFF81FF
FC4801C37FB580A26C5D6C01815BC648C66CC7FC137FEC80FE90383F81FC90381FC3F8EB
0FE3ECE7F06DB45A6D5B7F6D5B92C8FC147E147F5C497F81903803F7E0EB07E790380FE3
F0ECC1F890381F81FC90383F80FE90387F007E017E137F01FE6D7E48486D7E267FFF80B5
FCB500C1148014E3A214C16C0180140029277DA630>I<3B3FFFC07FFF80486DB512C0B5
15E0A26C16C06C496C13803B01FC0003F000A2000014076D5C137E150F017F5C7F151FD9
1F805BA214C0010F49C7FCA214E00107137EA2EB03F0157C15FCEB01F85DA2EB00F9ECFD
F0147D147FA26E5AA36E5AA35DA2143F92C8FCA25C147EA2000F13FE486C5AEA3FC1EBC3
F81387EB8FF0EBFFE06C5B5C6C90C9FC6C5AEA01F02B3C7EA630>I<001FB612FC4815FE
5AA316FC90C7EA0FF8ED1FF0ED3FE0ED7FC0EDFF80003E491300C7485A4A5A4A5A4A5A4A
5A4A5A4A5A4990C7FC495A495A495A495A495A495A4948133E4890C7127F485A485A485A
485A485A48B7FCB8FCA46C15FE28277DA630>I<ED3FF0913803FFF8140F5C147F16F091
38FFF00092C7FC495A5CB3A21303495A133F383FFFF0B55A5C91C8FC14C080003F7F3800
3FF813076D7E1301B3A2806D7E15F091387FFFF016F8141F8014039138003FF025477BBE
30>I<127CA212FEB3B3B3AD127CA207476CBE30>I<EA7FE0EAFFFE6D7E8014F07EC66C7E
13076D7E1301B3A2806D7E15E091387FFFE06E13F8801407141F5C4A13E09138FFE00092
C7FC495A5CB3A21303495A137F387FFFF0B5FC14C05C49C8FCEA7FE025477BBE30>I<01
7C133848B4137C48EB80FE4813C14813C348EBEFFC397FEFFFF0D8FF8713E0010713C048
6C1380D87C0113003838007C1F0C78B730>I E
%EndDVIPSBitmapFont
%DVIPSBitmapFont: Fj cmb10 10.95 87
/Fj 87 125 df<DA07FFEB0FFC027F9038E07FFF49B500F3B51280010791B612C090261F
FE039038FC7FE0D93FF002F013F0494848EBE0FF4948485B02805C481300A24848923800
7FE06FEC3FC0F01F806F91C7FC81A9B97EA50003D900010180C7FCB3ACB5D8F83FEBFF80
A53C407FBF35>11 D<EC07FF027F13C049B512F001078090391FFE03FC90393FF001FE90
387FE0034948487E4A5A481300A2485AA36F5A6F5AED00F093C7FCA616FFB8FCA50003EB
000781B3ABB5D8F87F13FCA52E407EBF33>I<EC07FF027F13FF49B6FC130790381FFE07
90383FF00FEB7FE0EBFFC04A5A48497EA2485A8181ABB8FCA50003EB0003B3ACB500FCB5
12FCA52E407EBF33>I<913B07FF8003FF80027FD9E03F13E049B56CB512F8010702FB80
011F0103B5EA01FE90263FF8019038F800FF90267FE003495A4948484948138002804A5A
48010014805D481600497FA26F6E13006F6E5AF0007896C7FCA6F17F80BBFCA50003D900
01EB800384B3ABB5D8F83FD9FC3F13FEA547407EBF4C>I<EA0FC0EA1FE0EA3FF0EA7FF8
EAFFFCA7EA7FF8A8EA3FF0A7EA1FE0A8EA0FC0A71207C7FCA8EA0FC0EA1FE0EA3FF0EA7F
F8EAFFFCA6EA7FF8EA3FF0EA1FE0EA0FC00E4079BF1C>33 D<D80FC0137E486C13FF486C
481380486C4813C0486C4813E0A301FE14F0A3007F7F003F7F001F7FD80FDE137ED8001E
1300A2013E1301013C14E0A2017C1303A2017814C001F813074914800001140F4848EB1F
004848133EA2D81F8013FC90C75A001E5C000C146024207DBE31>I<D93F801507D9FFE0
ED1F8000037F486D153F260FF1FC157F261FF07F4BC7FC01E06DEB03FE003FD93FE0130F
01C001FCEB3FFC007F6DB65AA2031F5C00FFD90F83EBEFE0923880000F4D5A60173F4DC8
FCA217FE4C5AA24C5A4C5AA2007F4948485A4C5AA2003F49495AD9E03E91C9FC001F017E
5BD9F07C13FE380FF1FC6CB448485A6C49485AC613E090273F8007F0EB3F8090C74848EB
FFE005037F4B48487F923A3F800FF1FC94381FF07CDB7F00EBE07E037E013F133E03FEEC
C03F4A48017F7FA24A5A4A4801FFEB0F80A24A5A4A5AA24A5A4AC7FCA214FE5C1301495A
A24948027FEB1F00495AA24948023F5B4948EDE03E051F137E49C8EBF07C017E92380FF1
FC01FE6FB45A496F5B017C03005B0138EE3F8041497BC34C>37 D<EC0FE0EC3FF8ECFFFC
5B903803FC3E49487EEB0FF0131F6F7EEB3FE0A3137FA3151F93C9FCA2153E14F05D5D14
F15D90263FFBE090387FFFFCECFFC05D92C7FC6D5A4A913800FC006E5D17016D6C4A5A60
6F1307495E017F6D130F90B56C495A4894C7FCD803F96D5BD807F86D133E000F167E4848
6C6C5B003F6E5B91383FFF01007F6D5CEE83E000FF6D13C76EEBEFC06E5C16FF6E91C8FC
6E5B037F15F86D6D7E007F6E7F6FEBC0016C6C013F9038E003F092B5EAF007261FFE0791
38FC1FE06CB5D8FC7FB512C06CDAF81F14800001DAE00714006C6CD980005BD91FF8C7EA
1FF03E417CBF47>I<EA0FC0EA1FE0EA3FF0EA7FF8EAFFFCA313FEA3127F123F121FEA0F
DEEA001EA2133E133CA2137CA2137813F813F01201EA03E0EA07C0A2EA0F80EA1F00121E
120C0F207BBE19>I<147814F81301EB03F0EB07E0EB0FC0A2EB1F80133FEB7F00A213FE
A2485A1203A25B1207A2485AA3121F5BA2123FA4485AA612FFB3A2127FA66C7EA4121FA2
7F120FA36C7EA212037FA212016C7EA2137FA2EB3F80131FEB0FC0A2EB07E0EB03F0EB01
F813001478155A78C323>I<127012F87E127E7E6C7EA26C7E7F6C7EA26C7EA26C7E7FA2
12007FA2EB7F80A314C0133FA214E0A4EB1FF0A614F8B3A214F0A6EB3FE0A414C0A2137F
1480A3EBFF00A25B1201A25B485AA2485AA2485A5B485AA248C7FC127E5A5A1270155A7B
C323>I<EB01E0EB07F8A2497E13075CA3001E141E007FEC3F80903883F07FD8FFC3EBFF
C0EBE3F1EBF3F3267FFBF713806D5A001FB5EAFE00000314F0C66C1380D91FFEC7FCA290
387FFF800003B512F0001F14FE3A7FFDEFFF80497E26FFF3F313C0EBE3F1EBC3F0D87F83
EB7F80903807F83F001EEC1E00000091C7FCA380130F6D5AA2EB01E022287BC32D>I<EA
0FC0EA1FE0EA3FF0EA7FF8EAFFFCA313FEA3127F123F121FEA0FDEEA001EA2133E133CA2
137CA2137813F813F01201EA03E0EA07C0A2EA0F80EA1F00121E120C0F207B8D19>44
D<B512FEA917097F981E>I<EA0FC0EA1FE0EA3FF0EA7FF8EAFFFCA6EA7FF8EA3FF0EA1F
E0EA0FC00E0E7B8D19>I<ED0380ED07C0150FA2151F1680A2153F1600A25D157EA215FE
5DA214015DA214035DA214075DA2140F5DA2141F5DA2143F92C7FCA25C147EA214FE5CA2
13015CA213035CA313075CA2130F5CA2131F5CA2133F91C8FCA25B137EA213FE5BA21201
5BA212035BA212075BA2120F5BA2121F5BA2123F90C9FCA25A127EA212FE5AA25A127822
5B7BC32D>I<EB01FE90380FFFC0013F13F090B512FC48EB87FE3903FE01FF48486C1380
A24848EB7FC0001F15E049133FA2003F15F0A3007F15F8A500FF15FCB3A3007F15F8A600
3F15F0A36C6CEB7FE0A2000F15C06D13FF000715806C6C4813003901FF87FE6CEBFFFC01
3F13F06D5BD901FEC7FC263D7DBB2D>I<143C147CEB01FC1307131FEA03FFB5FCA4EAFC
1F1200B3B3A8007FB6FCA5203C7ABB2D>I<EB0FFC90387FFF8048B512E04814F8488039
0FF07FFE391F801FFF48486C1380387FC00701E014C0486C6C13E013F88016F0A4EA7FF0
EA3FE0EA1FC0EA0700C7FC16E05CA216C04A1380A24A13005D4A5A5D4A5A5D4A5A4A5A49
90C7FC5CEB03F8903907F001F0EB0FE014C090391F8003E0EB3F00137E5B491307485A48
B6FC4815C05AA25A5A5AB7FC1680A4243C7CBB2D>I<EB0FFC90383FFFC090B512F04880
3903F83FFC3907E00FFED80FC07F486C6C138013F801FC14C0123F13FEA5EA1FFC1680EA
0FF8D803E01400C75A5D5D4A5A5DEC7FE090381FFFC092C7FC15C015F09038003FF8EC0F
FE816E1380A216C06E13E0A316F0EA0FC0EA1FE0EA3FF0EA7FF8EAFFFCA416E0A2495A00
7F15C013F0263FC00F13801600391FF83FFE6CB55A6C5C000114E06C6C1380D90FFCC7FC
243D7CBB2D>I<ED1F80A2153F157FA215FF5C5CA25C5CA25C5CA25C91B5FC14FBEB01F3
1303EB07E314C3EB0F83131F1403133E137E137C13F8120113F0EA03E01207EA0FC01380
EA1F005A123E5A12FCB8FCA5C700071380AA010FB6FCA5283C7EBB2D>I<000E1407D80F
80133F9038F801FF90B6FC5D5DA25D5D5D158092C7FC14FC14F00180C8FCA9EB87FE9038
9FFFC090B512F0819038FC0FFC9038F007FE9038C003FF0180148016C0497EC714E0A416
F0A21207EA1FC0EA3FE0EA7FF012FF13F8A316E013F0A26C484813C01380D87E0014806C
491300391FC00FFE390FF03FFC6CB55A6C5C6C14C06C91C7FCEB1FF8243D7CBB2D>I<EC
3FE0903801FFF801077F011F7F90383FF07F90397FC01F809038FF807F48EB00FF484913
C048485AA2EA0FFCA2121FA2003F6D1380496C1300157E007F91C7FCA314309038F9FF80
D8FFFB13E090B512F881EC07FE496C7E496C1380A216C0A201F814E0A316F0A6127FA512
3F16E0A2121F16C0EA0FFC168000075B01FE14003903FF0FFE6CEBFFFC6C5C013F5B6D13
C0D903FEC7FC243D7CBB2D>I<121F7F13F090B612FCA45A16F816F016E0A216C016805A
007EC7EA3F00157E007C147C15FC4A5A4A5A485C14074A5AC75B141F4AC7FCA25C14FEA2
1301A2495AA31307A2130FA25C131FA3133FA6137FAA6D5A6D5A6D5A263F7BBD2D>I<EB
07FE90381FFFC0017F13F090B57E3901FE0FFC3903F803FE48486C7E000F6D1380A2485A
ED7FC0123FA37FA27F7F6DEBFF806D7E6E13006C13F1ECFBFE6CEBFFFC5D6C14E0A26C14
F86C806C80814815805AD807FB14C0EA0FF048486C13E0003F131F497E007F010313F080
00FF7F49137F153FA2151FA416E06C7E153F6D14C0003F147F6D14803A1FF801FF00390F
FE07FE6CB55A6C5CC65C013F13C0D907FEC7FC243D7CBB2D>I<EB07FE90383FFF8090B5
12E0488048EB0FF848486C7E48486C7E001F80497E003F1580A2127F16C0A212FF16E0A5
16F0A6127FA3003F5BA2121FA26C6C5A6C6C5A6CB6FC7E38007FFDD91FF913E0EB00C114
01A3D807E014C0EA0FF0486C5AD83FFC1480A316004A5AA249485AD81FF05B9038E03FF0
000F495A90B55A6C5C6C91C7FCC613FCEB3FE0243D7CBB2D>I<EA0FC0EA1FE0EA3FF0EA
7FF8EAFFFCA6EA7FF8EA3FF0EA1FE0EA0FC0C7FCACEA0FC0EA1FE0EA3FF0EA7FF8EAFFFC
A6EA7FF8EA3FF0EA1FE0EA0FC00E287BA719>I<EA0FC0EA1FE0EA3FF0EA7FF8EAFFFCA6
EA7FF8EA3FF0EA1FE0EA0FC0C7FCACEA0FC0EA1FE0EA3FF0127FEAFFF8A213FCA4127F12
3F121F120FEA003CA2137C1378A313F813F0120113E0120313C01207EA0F80121F130012
1E120C0E3A7BA719>I<007FB912E0BA12F0A4003F18E0CDFCB0003FB912E0BA12F0A46C
18E03C1C7BA447>61 D<EB3FFC48B512804814E0000F14F0391FF03FF8393F801FFC007F
EB0FFE13C0D8FFE013FF13F0A5EA7FE015FE383FC01FD80F0013FCC7123FEC7FF815F0EC
FFC015804913005C5C495AA25C495AA35CAA90C8FCA8EB0FC0497E497E497E497EA66D5A
6D5A6D5A6D5A20407BBF2B>63 D<ED07804B7E4B7EA34B7EA34B7EA34B7EA34A7FA34A7F
A24A8015CFA2020F801587A2021F801503A2023F80EC3E01A2027E80EC7C00A24A6D7EA2
0101814A133FA20103814A7FA249B77EA34982A29138800007011F8291C77EA2496E7F13
3EA2496E7FA201FC8249157FB500F0013FB512FCA53E3F7DBE45>65
D<B712FEEEFFE017F817FE83C69026F0001F1380040713C07013E0A27013F0A28218F8A7
18F05EA218E05E18C04C1380041F1300EE7FFC91B612F017C017F817FE913AF00007FF80
7013C07013E07013F018F8177F18FCA318FEA3173F177FA418FCA217FF18F85E18F04C13
E0160FB912C018005F17F01780373E7CBD41>I<DB7FF8130E0207B5131E023FECC03E91
B6EAF07E0103EDF9FE499038F807FF011FEBC0004990C7123FD97FFC141F4948140F4849
1407484914035C484914015A91C9FC5A187E485AA3007F173EA25BA200FF1700AE127F18
3E7FA2123FA2187E6C7E187C7E6E15FC6C6D15F86C16016EEC03F06C7F6C6DEC07E06D6C
EC0FC06DB4EC3F806D01C0EBFF0001079038F807FE6D90B55A010015F0023F5C02071480
9126007FF8C7FC37407BBE42>I<B712FCEEFFC017F017FC17FFC69026F0003F7F04077F
040113F082717E717E717E170F84831980A219C083A219E0A519F0A483A55FA419E0A519
C0A25F1980A24D1300A24D5A4D5A177F4D5A4C5B04075B043F5BB9C7FC5F17F817C004FC
C8FC3C3E7CBD46>I<B812FEA483C69038F8003F16071601828383A2EF1F80A3170FED01
F0A3EF07C0A3150394C7FCA21507151F91B5FCA5ECF81F1507150318F8A21501EF01F0A5
92C71203A218E0A21707A2170F171F18C0173F17FF1603161FB9FCA21880A3353D7CBC3C
>I<B812F8A417FCC69038F8007F161F1607160316011600A2177EA3173EA2ED03E0A217
1FA417001507A2150F153F91B5FCA5ECF83F150F1507A21503A792C8FCACB612FEA5303D
7CBC39>I<DB7FF0131C912607FFFE133C023F9038FF807C91B6EAE0FC010315F3010F90
38F80FFF49EBC0014948C7127F4948143FD9FFF0141F4849140F4816075C484914035A91
C812015A1700485AA3007F177CA25BA200FF94C7FCAC0303B612F0A2127FA27F92C7387F
FC00123FA36C7EA27E807E6C7F806C7F6C7F6D6C14FF6DB45B6DEBC0036DEBF80F010390
B512E7010015C1023FEC807C02079038FE001C9126007FF090C7FC3C407BBE47>I<B6D8
F87FB512FCA5C601F8C7387FFC00B3A491B7FCA502F8C7127FB3A7B6D8F87FB512FCA53E
3E7CBD47>I<B612F8A5C6EBF800B3B3B0B612F8A51D3E7DBD24>I<010FB61280A5D90001
EBE000B3B3A4EA1FE0EA3FF0EA7FF8A2EAFFFCA44A5BA26C48485B01F091C7FC6C48485A
391FF03FFC6CB55A6C5C000114C026001FFCC8FC293F81BD2F>I<B600F890B512F8A5C6
01F8C73803F8004D5A4D5A4D5A4D5A4DC7FC17FE4C5A4C5A4C5A4C5A4C5A4C5A4CC8FC16
FE4B5A4B5A4B5A4B5A151F4B7E4B7EA24B7E14F902FB7F91B6FC15DF039F7F158F030F7F
4A6C7F4A7E02F880816F7F83167F83707E82848284707F82848284707F177F84B6D8F80F
B512FCA53E3E7CBD47>I<B7FCA5C601F8C8FCB3AD177CA417FC17F8A41601A3160317F0
1607A2160F161F163F16FF1503B8FC17E0A42E3E7CBD37>I<B500FC93B512F86E5DA36E
5DC6F1F800A26FEC07BFA301FD6DEC0F3FA201FC6D141EA36E6C143CA36E6C1478A36E6C
14F0A26E6CEB01E0A36E6CEB03C0A36E9038800780A36E9038C00F00A26EEBE01EA36F6C
5AA36F6C5AA36F6C5AA26FB45AA36F5BA36F5BA36F90C7FCA26F5AB500FC033FB512F8A2
167CA216384D3E7CBD56>I<B500F891B512FC80A28080C6933800FC008181A28181A201
FD7F01FC7FA26E7E6E7E80826E7F80826E7F6E7FA26E7F6F7EA26F7E6F1380A26F13C06F
13E0A26F13F06F13F8A26F13FCEE7FFEA2EE3FFF82A28282A2828282A2177F173FA2171F
170FA21707B500FC1403A217011700A23E3E7CBD47>I<913801FFC0021F13FC91B67E01
0315E04901807F903A1FFE003FFCD93FF8EB0FFE49486D7E49486D7F48496D7F48834A7F
48834890C86C7EA2488349153FA2003F83A249151F007F83A400FF1880AE007F1800A36D
5DA2003F5FA36C6C4B5AA26C5F6E14FF6C5F6C6D495B6E5B6C5F6C6D495B6D6C4990C7FC
D93FFEEB3FFE6D6C6CB45A010790B512F06D5D01001580021F01FCC8FC020113C039407B
BE44>I<B712F816FF17E08317FCC6D9F0007FEE1FFF7013808218C08218E0A318F0A818
E0A318C05E18804C13005EEEFFFE91B612F85F17C04CC7FC02F8C9FCB3A4B612F8A5343E
7CBD3E>I<913801FFC0021F13FC91B67E010315E04901807F903A1FFE003FFCD93FF8EB
0FFE49486D7E49486D7F48496D7F48496D7FA24890C86C7E488349153F001F83A249151F
003F83A3007F834981A300FF1880AE007F1800A46D5D003F5FA36C6C4B5AA2000F027F5C
903AFF01FF807F6C4901E05B6C01876D485A15C16C9026CF80795B6C9026EF007F5B6DB4
6D90C7FC6D5D6D01805B01079038C0FFF06D90B55A0100ED8001021FED03800201EBCFC0
91C7EA0FE01807EFF81F94B5FCA3701400A4705BA2705B60705B715AEF1FC039517BBE44
>I<B712E016FF17C017F883C69039F0007FFE93381FFF801607707F84A2707FA284A860
A24C5BA2604C5B041F90C7FCEEFFFE91B612F817E094C8FC17C0DAF00113F06F6C7E707E
83161F83A2707FA684A6191F18E0A282F0F03FB6D8F003143E70EBF87E70EBFFFC053F13
F8050F13F0CB13C0403F7CBD45>I<D907FE133890393FFFC07890B5EAF0F84814F90007
14FF380FFE07EBF0004848133F4848131F150F007F1407491303A212FF1501A36D1300A2
7F7F6D140013FE387FFFE014FEECFFE06C14FC816CECFF806C15C06C15E016F012016C15
F86D14FC131F010114FEEB001F14019138003FFF150F81A200788012F8A281A27EA216FE
7E15036C15FC7F6DEB07F813F001FCEB1FF09039FFC07FE091B512C000FC1580D8F83F14
00D8F00713FC48C613E028407BBE33>I<003FB812FCA5D9FC03EBE01FD87FE0ED07FE01
C01501018015001300007E177EA3007C173EA400FC173F48171FA5C71600B3AF013FB612
FEA5383D7DBC3F>I<B600F890B512F8A5C601F8C8EAF800B3B3A5017F150160A280013F
1503606D6C1407010F4B5A6E4A5A6D6D133F6D6D01FFC7FC6D9038F807FE6D6CB55A6E5C
020F14E0020314809126003FFCC8FC3D3F7CBD46>I<B600F0010FB5FCA5C601F8C8EA1F
00A26E5D017F163EA26E157E013F167C6E15FC6D5EA26F13016D5EA26D6D495AA26F1307
6D5EA26F130F6D5E816D4BC7FCA26F5B027F143EA26F137E023F147C6F13FC6E5CA21681
6E5CA216C36E5C16E76E5CA216FF6E5CA36E91C8FCA26F5AA36F5AA36F5AA26F5AA36F5A
A2403F7EBD45>I<B600E0B6D8F007B51280A500019026F0000101F8C73807C00070160F
6C6D6184177F6D6C4EC7FC84173F6D6C183E177F846E187E6D92B5147C856F17FC6D4A5E
05F77F03C016016D02035E05E313E003E016036D02075E05C113F003F016076D61DC0F80
13F803F8160F6D6193391F007FFC03FC161F027F95C8FC4C14FE043E013F5BDA3FFE163E
047E14FF047C6D137EDA1FFF167C04FC15FC4C7F6E5FA24C7F6E5FA24C7F6E5FA24C7F6E
5FA24C7F6E5FA293C8127FA26F93C9FC037E81033E153E593F7EBD5E>I<003FB5D8FC0F
B512F0A5D8003F90C7380FC0006D6D495A4DC7FC6D7F6D6D137E5F6D7F4C5A6D6D485A6D
13FC4C5ADA7FFE5B160F6E6C485A6E139F04BFC8FC6E13FEA26E5B6E5BA28082806F7EA2
6F7E83A24B7F92B5FC83DA01FB7FEC03F303F17FEC07E1DA0FC07F707EEC1F804B6C7E5C
027E6D7F707F5C49486D7FA249486D7F49486D7FA249486D7F49486E7EA2B6011FB6FCA5
403E7EBD45>I<B600F80103B512C0A5C66C48C8380F80006E151F6D4CC7FC816D167E6D
7F6F5C6D5E6F13016D5E6F13036D4B5A6D7F6F495A027F5D6F131F6E92C8FC6E6D5AEEC0
7E80705A80EEF1F86E5C6E13FBEEFFE0805F815F6F90C9FC815EB3A2021FB6FCA5423E7F
BD45>I<003FB712F8A5DAC00313F09026FC000713E05B01E04913C05B49491380127F90
C74813004B5A127E4B5AA24A5B127C4A5B5C5E4A5BC7FC4A5BA24A90C7FC5C5D4A5AA249
5BA2495B5B5D4949137CA2495BA24990C7FC4915FC4A14F8495AA2485B1601485BA24849
1303485B16074849130F161F4890C7123FEEFFF04848130FB8FCA52E3E7BBD38>I<EAFF
FEA6EAFC00B3B3B3B3A7EAFFFEA60F5B78C319>I<0160130301F0EB07800001140F0003
141FD807C0EB3E00A248485B48C75A001E5C003E1301003C5C007C1303A200785CA200F8
1307485CA2D8F7E013BFD8FFF0EBFF8001F814C001FC14E001FE14F0A3007F7FA36C486C
13E06C486C13C06C48EB7F806C48EB3F00242077BE31>I<EAFFFEA6EA007EB3B3B3B3A7
EAFFFEA60F5B7FC319>I<EB0FFE90387FFFC048B512F04814FC3907FC0FFE48486C7E6D
6C7F486C7E82A26E7FA36C5A6C5AEA01E0C8FC5C49B5FC131F90B6FC000313F84813C048
1300EA1FFC485A127F5B12FF5BA45CA26C6C5A16F83B3FF807BFFF80391FFC1F3F390FFF
FE1F6C497E0001EBF80326003FE0C8FC292B7EA92C>97 D<13FFB5FCA512077EAFEC03FE
91381FFFC0027F13F091B57E9138FE0FFE9138F003FF4A7E02C014804A6C13C017E0A3EE
7FF0A317F8AC17F0A3EEFFE0A217C05D02C014806E4813006E485A9138FC1FFC01FCB55A
496C13E0D9F01F1380C7D807FCC7FC2D407EBE33>I<EB03FF011F13E0017F13F890B57E
48EB83FE3903FE01FF00075B4848481380121F13F8123FA2127F496C13006E5AEC007800
FF91C7FCAC127FA27F003FEC07C0A26C6C130F16806C6C131F000715006C6C137F6CEBC1
FE6CEBFFFC6D13F0011F5B010390C7FC222B7DA928>I<ED01FEEC01FFA5EC000F1507AF
EB01FF011F13C7017F13F790B6FC4813C148EB007F4848131F485A001F140F5B123FA248
5AA312FFAC127FA36C7EA3001F141F6C7E00074A7E6D90B512F83803FF83C690B6FC6D13
EF011F13CF903A03FE0FF8002D407DBE33>I<49B47E010F13F0013F7F90B512FE48EBC3
FF48010013804848EB7FC04848133F001F15E05B003FEC1FF0A2485A150F16F8A212FFA2
90B6FCA401F0C8FCA5127FA37F003F15F8A26C6C1301000F15F06D13036C6CEB07E06C90
38800FC06C9038F07F806C6CB512006D5B010F13F8010013C0252B7EA92A>I<EC1FF8EC
FFFE01077F491480D91FF813C0D93FE013E0EB7FC1EBFF81481301A348486C13C0ED7F80
ED3F0092C7FCAAB6FCA5000390C8FCB3ACB6FCA523407EBF1C>I<D907FE13FC90393FFF
C3FE90B5EAF7FF4891B5128048130F3907FC03FE3A0FF801FF7F001FEDFF00496C13BE16
80003F81A7001F5DA26D5A000F92C7FC6C6C485A3903FF0FFCECFFF8485CD80F3F13C0D9
07FEC8FC90CAFC5AA27FA213E090B512F015FF6C15C0826C816C8182120F4881393FE000
3FD87F80EB07FF150148C7FC81A56D5B007F5D6D13036C6C495AD81FF8EB1FF86CB4EBFF
F06C90B55A000115806C6C49C7FC010713E0293D7EA82D>I<13FFB5FCA512077EAFED7F
E0913801FFF802077F4A7F91381FC3FFDA3E031380147CEC780102F014C014E0A214C0A3
1480B3A4B5D8FE1F13FFA5303F7EBE33>I<EA01F8487E487E487E481380A66C13006C5A
6C5A6C5AC8FCA913FFB5FCA512077EB3ABB512F8A515407EBF19>I<EC1F80EC3FC0EC7F
E0ECFFF04913F8A66D13F0EC7FE0EC3FC0EC1F8091C7FCA9EC07F8EB0FFFA5EB003F141F
B3B3A2EA1F80EA3FC0EA7FE0EAFFF015F0143FA2EC7FE015C0397FE0FF80D83FC113006C
B45A6C5B6C13F0C613801D5387BF1C>I<13FFB5FCA512077EB092B512E0A592380FE000
4B5A4B5A4BC7FC15FE4A5A4A5A4A5A4A5A4A5A143FECFFE0A28181A2ECDFFCEC8FFE140F
6E7E6E7FA26E7F6E7FA26F7E6F7EA26F7E6F7EB539FC7FFFF8A52D3F7FBE30>I<13FFB5
FCA512077EB3B3AFB512FCA5163F7EBE19>I<01FFD97FE0EB3FF0B52601FFF8EBFFFC02
07D9FC037F4A6D487F91281FC3FF0FE17FDA3E03D99F017F0007017C14BE6CD97801EBBC
0002F002F88002E05CA202C05CA302805CB3A4B5D8FE1FD9FF0FEBFF80A549297EA84C>
I<01FFEB7FE0B53801FFF802077F4A7F91381FC3FFDA3E0313800007137C6CEB780102F0
14C014E0A214C0A31480B3A4B5D8FE1F13FFA530297EA833>I<49B47E010F13F0013F13
FC90B6FC48018113803A03FE007FC04848EB3FE0000F15F049131F001F15F8A24848EB0F
FCA2007F15FEA400FF15FFAB007F15FEA3003F15FC6D131F001F15F8A26C6CEB3FF00007
15E06C6CEB7FC03A01FF81FF806C90B51200013F13FC010F13F001011380282B7EA92D>
I<9038FF03FEB5381FFFC0027F13F091B57E9138FE1FFE9138F007FF0007497E6C01C014
804A6C13C017E081A217F0A2167F17F8ACEEFFF0A317E05D17C0A26E4813806E4813006E
485A9138FC1FFC91B55A16E0029F1380DA87FCC7FC0280C8FCACB512FEA52D3B7EA833>
I<49B4131E010FEBC03E013FEBE07E90B5EAF0FE48EBC1F948EB807F48EB003F485A4848
131FA2003F140F5B127F1507A2485AAC127F7FA2123F150F6C7E151F6C7E0007143F6C6C
13FF6C13C36C90B5FC6D13EF011F138F903803FE0F90C7FCAC0203B512F8A52D3B7DA830
>I<3901FE07F800FFEB0FFE91383FFF804A13C0EC7C7F9138F8FFE03807FFF06C5B5CA2
ED7FC09138803F80ED1F0092C7FCA291C8FCB3A3B6FCA523297FA827>I<90387FE1E038
03FFFB4813FF5A381FE07F383F801F387F000F007E130712FE1403A27EA26DC7FC13F013
FF6C13F014FC6C13FF15806C14C07E6C14E0000114F06C7E010313F8EB003F140F007813
0712F814037EA36C14F06C1307A29038800FE09038F03FC090B51280150000F813FC38E0
3FF01D2B7DA924>I<131FA65BA55BA25BA25A5A5A001FEBFFC0B6FCA4000790C7FCB3EC
03E0A97EEC87C0A26CEBCF806C13FF6D1300EB1FFEEB07F81B3B7EB923>I<D9FF80EB7F
C0B5EB7FFFA5000714036C80B3A55DA35D7E4B13E0DAC01E13FF6CEBE07E6DB45A6D5B01
0F13E0010101801300302A7EA833>I<B539FC1FFFE0A5000390398000F800ECC0016C5D
A2ECE0036C5D1507D97FF05BA2ECF80F013F5CA2ECFC1F011F91C7FC5D90380FFE3EA215
7E903807FF7CA215FC6D5BA26D5BA36D5BA36E5AA26E5AA36EC8FC2B287EA730>I<B500
E1B53887FFF8A50007903B801FF0003F006C6F133E150F02C0157E6C4A6C137CA26C01E0
5D4B7EA2D97FF04A5AED7FFF157DD93FF84A5A03FD138303F81387D91FFCECC7C014FD92
38F07FCFD90FFFECEF80A29238E03FFF6D93C7FCA24B7E6D5DA2ED800F6D5DA2ED00076D
5DA24A1303027E5C027C13013D287EA742>I<3B7FFFFC7FFFE0A5C69039E007E0004B5A
90387FF01FD93FF85B4BC7FC90381FFC7EEB0FFE5D6D6C5A7F5D6D5B7FA26E7E143F814A
7E14FF81497FEB03F301078002E17FEB0FC049487F6F7E90383F003F017E806F7EB500E0
B512F8A52D287FA730>I<B539FC1FFFE0A5000390398000F800ECC0016C5DA2ECE0036C
5D1507D97FF05BA2ECF80F013F5CA2ECFC1F011F91C7FC5D90380FFE3EA2157E903807FF
7CA215FC6D5BA26D5BA36D5BA36E5AA26E5AA36EC8FCA25C143EA2000E5BEA3F80387FC0
FC486C5AA2EBE1F0A2EBE3E013C7387FCFC0387D3F80D83FFFC9FC5BEA0FF8EA07E02B3B
7EA730>I<001FB61280A4D9F80F1300EBE01F01C05B49485A130048495A4A5AA2D83E01
5B5B5D495BA2C64890C7FC5B5C495A017FEB0F8014F8EBFFF0A248EBE01F48150014C048
1380A248495A485A5D48485B007F5B9038F80FFEB6FCA421287EA728>I<B812F0A42C04
809A2D>I<BE12C0A45A04809A5B>I E
%EndDVIPSBitmapFont
%DVIPSBitmapFont: Fk cmbx12 14.4 49
/Fk 49 122 df<EEFFFC031FEBFF804AB612E0020781021F9038C00FF8913A7FFE0003FC
DAFFF0EB00FE4949EB03FF4901805B4990C7487F49485CA2495A4D7F013F6F5B5CA37190
C7FC715AEF01F894C9FCA90403B512C0BAFCA526003FFCC7120783B3B3A6003FB5D8FC03
B612C0A542547DD34B>12 D<B712F0AB240B7F9F2D>45 D<EA07F0487E487E487E487EB5
1280A76C13006C5A6C5A6C5A6C5A1111769025>I<913803FFC0023F13FC91B6FC010315
C0010F018113F0903A1FFC003FF849486D7E49486D7E49486D7E48496D138048496D13C0
A24817E04890C813F0A34817F8A24817FC49157FA3007F17FEA600FF17FFB3A5007F17FE
A6003F17FCA26D15FFA26C17F8A36C17F0A26C6D4913E0A26C6D4913C06C17806E5B6C6D
4913006D6C495AD91FFCEB3FF8903A0FFF81FFF06D90B55A01011580D9003F01FCC7FC02
0313C0384F7BCD43>48 D<157815FC14031407141F14FF130F0007B5FCB6FCA2147F13F0
EAF800C7FCB3B3B3A6007FB712FEA52F4E76CD43>I<EC3FFE0103B512E0010F14FC013F
14FF90B712C048D9C07F7F2703FE000F13F8D807F801037FD80FE06D7F48486D7F484880
01F01680486C6E13C07F486C6E13E07FA27013F0A56C5AA26C5AEA0FF0EA03C0C914E05E
A218C05E1880A24C13005F4C5A4B5B5F4B5B5F4B5B4B90C7FC4B5A5E4B5AED7FE04B5A4A
5B4A48C8FC4A5A5D4A48EB01F04A5AEC3F804AC7FC02FEEC03E0495A495A495A495AD91F
80140749C8FC013E150F017FB7FC90B812C05A5A5A5A5A5A5AB9FC1880A4344E79CD43>
I<91380FFFC091B512FC0107ECFF80011F15E090263FF8077F9026FF800113FC4848C76C
7ED803F86E7E491680D807FC8048B416C080486D15E0A4805CA36C17C06C5B6C90C75AD8
01FC1680C9FC4C13005FA24C5A4B5B4B5B4B13C04B5BDBFFFEC7FC91B512F816E016FCEE
FF80DA000713E0030113F89238007FFE707E7013807013C018E07013F0A218F8A27013FC
A218FEA2EA03E0EA0FF8487E487E487EB57EA318FCA25E18F891C7FC6C17F0495C6C4816
E001F04A13C06C484A1380D80FF84A13006CB44A5A6CD9F0075BC690B612F06D5D011F15
80010302FCC7FCD9001F1380374F7ACD43>I<177C17FEA2160116031607160FA2161F16
3F167FA216FF5D5DA25D5DED1FBFED3F3F153E157C15FCEC01F815F0EC03E01407EC0FC0
1580EC1F005C147E147C5C1301495A495A5C495A131F49C7FC133E5B13FC485A5B485A12
07485A485A90C8FC123E127E5ABA12C0A5C96C48C7FCAF020FB712C0A53A4F7CCE43>I<
D80380150ED807E0157E01FEEC03FED9FFF0137F91B65A5F5F5F5F5F94C7FC5E5E16F016
C093C8FC15F801E190C9FC01E0CAFCABEC0FFF027F13F001E3B512FE01E76E7E9026FFF8
077FDAC0017F49C713F8496E7E49143F4981496E7E6C481680C9FC18C08218E0A418F0A3
EA0FE0487E487E487E487EA418E0A35B6C484A13C05B491680003EC85A003F17006C6C4A
5A6D5D6C6C4A5AD807F8495BD803FE01075B2701FFC03F5B6C90B65A013F4AC7FC6D14F8
010314C09026007FF8C8FC344F79CD43>I<ED0FFF92B512E0020780021F14FC91397FFE
03FE903A01FFF0007F4901C0EB3F804990C7121F4948EC7FC0494814FF49484913E04948
5B01FF5C485BA2485B5AA2486F13C04A6D1380486F1300177E94C7FC5AA291CAFC5AA215
08913801FFF8020713FFB54814C04A14F04AC66C7E023C6D7E4A6D7E4A6D7E7013804A15
C0A24A15E07013F05C18F8A491C714FCA37EA67EA46C17F880A27E18F06C5D18E06C6D15
C07E6E4913806C6D15006D6C495A6D6CEB7FFC6DB448485A6D90B55A010315C0010092C7
FC023F13FC020713C0364F7ACD43>I<121F7F7FEBFF8091B81280A45A1900606060A260
6060485F0180C86CC7FC007EC95A4C5A007C4B5A5F4C5A160F4C5A484B5A4C5A94C8FC16
FEC812014B5A5E4B5A150F4B5AA24B5AA24B5A15FFA24A90C9FCA25C5D1407A2140FA25D
141FA2143FA4147F5DA314FFA55BAC6D5BA2EC3FC06E5A395279D043>I<913807FFC002
7F13FC0103B67E010F15E090261FFC0113F8903A3FE0003FFCD97F80EB0FFE49C76C7E48
488048486E1380000717C04980120F18E0177FA2121F7FA27F7F6E14FF02E015C014F802
FE4913806C7FDBC00313009238F007FE6C02F85B9238FE1FF86C9138FFBFF06CEDFFE017
806C4BC7FC6D806D81010F15E06D81010115FC010781011F81491680EBFFE748018115C0
48D9007F14E04848011F14F048487F48481303030014F8484880161F4848020713FC1601
824848157F173FA2171FA2170FA218F8A27F007F17F06D151FA26C6CED3FE0001F17C06D
157F6C6CEDFF806C6C6C010313006C01E0EB0FFE6C01FCEBFFFC6C6CB612F06D5D010F15
80010102FCC7FCD9000F13C0364F7ACD43>I<91B5FC010F14F8017F14FF90B712C00003
D9C00F7F2707FC00017FD80FE06D7F48486E7E48C87FD87FE06E7E7F7F486C1680A66C5A
18006C485C6C5AC9485A5F4B5B4B5B4B5B4B5B4B90C7FC16FC4B5A4B5A16C04B5A93C8FC
4A5A5D14035D5D14075DA25D140FA25DAB91CAFCAAEC1FC04A7EECFFF8497FA2497FA76D
5BA26D5BEC3FE06E5A315479D340>63 D<BA7E19FCF1FF801AF01AFCD8000701F0C7000F
13FF060014C0071F7F070713F807017F737F747E747F747F86747F747F8886888688A275
7EA31D8087A21DC0A51DE0A387A963A31DC0A51D80A2631D00A3515AA2646264505B6264
505B505B5090C7FCF2FFFE4F5B07075B071F5B96B512C0060F91C8FCBB5A1AF01AC007FC
C9FC19805B527CD167>68 D<BC1280A5D8000701F8C7000114C0F0001F19071901851A7F
1A3F1A1FA2F20FE0A21A07A31A03A318F81BF01A01A497C7FC1701A317031707170F177F
92B6FCA59238F8007F170F170717031701A317001B3EA31B7CA395C8FCA21BFCA21BF8A2
1A01A31A031BF01A071A0FA21A1F1A3FF27FE0F101FF1907191F0603B5FCBCFCA21BC0A3
4F517CD058>I<BB12FEA5D8000701F8C700077FF0007F191F190785858586861B80A21A
1FA31A0FA41BC006F81307A497C7FCA31701A317031707170F177F92B6FCA59238F8007F
170F170717031701A31700A795C9FCB3B812F8A54A517CD055>I<B8D8C003B8FCA5D800
0701F8C9001FEBE000B3AE92BAFCA503F8C9121FB3B1B8D8C003B8FCA560527CD169>72
D<B812C0A5D8000701F8C7FCB3B3B3B2B812C0A52A527CD132>I<027FB71280A591C76C
90C7FCB3B3B3EA07F0EA1FFC487E487EA2B57EA44C5AA34A485B7E49495BD83FF8495BD8
1FE05DD80FFC011F5B2707FF807F90C8FC000190B512FC6C6C14F0011F14C0010101F8C9
FC39537DD145>I<B812F8A5D8000701F8CAFCB3B3A91A7CA41AFC1AF8A51901A31903A2
19071AF0190FA2191F193F197F19FF180360183F4DB5FCBB12E0A546527CD151>76
D<B600FC073FB512FE6F61A26F96B6FCA2D80007F5C00070EF01EFA202EF6DEF03CFA202
E76DEF078FA202E36DEF0F0FA202E16D171EA302E06D173CA26F6C1778A26F6C17F0A26F
6DED01E0A26F6DED03C0A36F6DED0780A26F6DED0F00A26F6D151EA26F6D5DA3706C5DA2
706C5DA2706D495AA2706D495AA2706D495AA3706D49C7FCA2706D131EA2706D5BA2716C
5BA3716C5BA271EB81E0A271EBC3C0A271EBE780A27101FFC8FCA3715BA2715BA2725AA2
725AA2D93FFC6F5AB74DB712FEA2725AA2725A77527CD180>I<BAFC19F819FF1AE086D8
000701F0C7001F13FC060113FF726C13807313C0070F13E01BF0857313F81BFCA27313FE
A41BFFA81BFEA31BFC61A21BF84F13F04F13E0614F13C04F13004E485A061F5B92B812F0
1AC04FC7FC19E003F8CBFCB3AEB812C0A550527CD15C>80 D<B912F0F0FF8019F819FF1A
C0D8000701F0C714F0060F7F060113FE727F737F737F85737F87A2737FA387A863A26163
63A24F5B4F5B4F90C8FC4F5A06035B060F13F095B512C092B8C9FC19F819E019F89226F0
000313FE9439007FFF80727F727F727F727F727F8684A28684A787A71D1C75133EA38575
137E73157C7513FC731401B86C6D9038F803F807039038FE07F07390B512E0736C14C008
0F1400CEEA7FFC5F537CD164>82 D<91260FFF80130791B500F85B010702FF5B011FEDC0
3F49EDF07F9026FFFC006D5A4801E0EB0FFD4801800101B5FC4848C87E48488149150F00
1F824981123F4981007F82A28412FF84A27FA26D82A27F7F6D93C7FC14C06C13F014FF15
F86CECFF8016FC6CEDFFC017F06C16FC6C16FF6C17C06C836C836D826D82010F82130301
0082021F16801400030F15C0ED007F040714E01600173F050F13F08383A200788200F882
A3187FA27EA219E07EA26CEFFFC0A27F6D4B13806D17006D5D01FC4B5A01FF4B5A02C04A
5A02F8EC7FF0903B1FFFC003FFE0486C90B65AD8FC0393C7FC48C66C14FC48010F14F048
D9007F90C8FC3C5479D24B>I<003FBC1280A59126C0003F9038C0007F49C71607D87FF8
060113C001E08449197F49193F90C8171FA2007E1A0FA3007C1A07A500FC1BE0481A03A6
C994C7FCB3B3AC91B912F0A553517BD05E>I<B800C00103B612FCA5D8000701F8CAEBF0
00F31F80B3B3B11B3FA26D97C7FC81637F1B7E6D6D17FE505A6E7E505A6E6D15076E4D5A
6E6D4B5A6E6D4B5A6E01F84B5A6E6DDA03FFC8FC6E6CB46CEB0FFE6F9039F001FFF8030F
90B65A030316C0DB007F92C9FC040F14F8DC007F13805E537CD167>I<B700FC017FB600
FE91B612F0A5D8003F01C0C8001F01E0C9EBF8006F71EE0FC06D7161876F1C1F6D7196C7
FC6F8373606D1E3E6F836D7160876F1CFC6D666F4B801F016D66704A806E525A88704A17
076E059F5F70021F80080F160F6E6570023F806EDC3E074CC8FC8870027E5F6EDC7C0316
3E7002FC804F6C167E6E1C7C700101814F6C16FC6E745B70010317016E4C6D5D060716C0
0580496D14036F63DDC00F16E04F6D14076F07F05BDDE01F170F6F92C76C5D1DF8DDF03E
6E141F6F98C9FCDDF87E16FC067C6E5C6FF1FE3EDDFCFC177E6F4A6E147C1DFFDDFFF06E
14FC6F62A24E816F62A270496F5BA24E817061A295C97E7061A270487090CAFCA3704870
5AA24D1601040360A27048705A84537DD18B>87 D<EC7FFF0107B512F0013F14FE90B77E
48D9E00F7F2703FE000113F0486C6D7F6EEB3FFC48826E131F83707FA36C496D7FA26C90
C7FC6C5AC9FCA6037FB5FC020FB6FC91B7FC01071487013FEBF0074913803901FFFC0048
13F0485B485B485B4890C7FC5A5BA2485AA45EA26D5C007F151D163D6C6C02797F6C6D01
F113F86C9026C003E1EBFFE06C9026F81FC014F06C90B5487EC6ED001F011F01FC010713
E0010101E090C8FC3C387CB641>97 D<EB3FF0B5FCA51203C6FCB3A4923801FFE0030F13
FE033FEBFFC092B612F002F301017F913AF7F8003FFEDAFFE0EB0FFF03806D7F92C76C7F
4A6E7F4A824A6E7FA2727EA285A28584A31A80AC1A00A44E5AA36118FF616E4A5BA26E4A
5B6E4A5B6F495BDACFC04990C7FCDA87F0EB7FFC913A03FE03FFF849C6B612E0496D1480
49011F01FCC8FC90C7000313C041547BD24B>I<913801FFF8021FEBFF8091B612F00103
15FC010F9038C00FFE903A1FFE0001FFD97FFC491380D9FFF05B4817C048495B5C5A485B
A2486F138091C7FC486F1300705A4892C8FC5BA312FFAD127F7FA27EA2EF03E06C7F1707
6C6D15C07E6E140F6CEE1F806C6DEC3F006C6D147ED97FFE5C6D6CEB03F8010F9038E01F
F0010390B55A01001580023F49C7FC020113E033387CB63C>I<4DB47E0407B5FCA5EE00
1F1707B3A4913801FFE0021F13FC91B6FC010315C7010F9038E03FE74990380007F7D97F
FC0101B5FC49487F4849143F484980485B83485B5A91C8FC5AA3485AA412FFAC127FA36C
7EA37EA26C7F5F6C6D5C7E6C6D5C6C6D49B5FC6D6C4914E0D93FFED90FEFEBFF80903A0F
FFC07FCF6D90B5128F0101ECFE0FD9003F13F8020301C049C7FC41547CD24B>I<913803
FFC0023F13FC49B6FC010715C04901817F903A3FFC007FF849486D7E49486D7E4849130F
48496D7E48178048497F18C0488191C7FC4817E0A248815B18F0A212FFA490B8FCA318E0
49CAFCA6127FA27F7EA218E06CEE01F06E14037E6C6DEC07E0A26C6DEC0FC06C6D141F6C
6DEC3F806D6CECFF00D91FFEEB03FE903A0FFFC03FF8010390B55A010015C0021F49C7FC
020113F034387CB63D>I<ED3FFC0203B5FC020F14C0023F14E09139FFF81FF0499038C0
3FF849EB807F49903800FFFC495A495AA2495AA2EE7FF8495AEE3FF0EE0FC093C7FCAEB7
12E0A526007FF8C8FCB3B3A7007FB512FEA52E547CD329>I<DA3FFF14FF0103B5D8F007
13C0010FDAFC1F13E0013FECFF7F90267FFC0F9038FF9FF09026FFE001EBF83F48496C13
E0484990387FF01F4890C7D83FF813E0489338FC0FC0F0078048486E6CC7FCA2003F82A9
001F5EA26C6C4A5AA26C5E6C6D495A6C6D495A6C6D485BDAFC0F5B4890B6C8FCD803EF14
FC01C314F02607C03F90C9FC91CBFCA2120FA37FA213F813FE90B7FC6C16F817FF18C06C
836C836C836D828448B9FC12074848C700031480D81FF8EC003F4848150748486F13C083
485A83A56D5D007F18806D5D003F18006C6C4B5AD80FFEED1FFC6C6C6CEC7FF86C01E049
485A6C01FE011F5B6C6CB71280010F03FCC7FC010115E0D9000F01FCC8FC3C4F7CB543>
I<EB3FF0B5FCA51203C6FCB3A4EE1FFC93B512C0030314F0030F8092391FE07FFC92393F
001FFE037C8003F07FDAF1E081ECF3C0DAF7807F8502FFC7FC5CA25CA45CB3ACB6D8F807
B612C0A542537BD24B>I<137F497E000313E0487FA2487FA76C5BA26C5BC613806DC7FC
90C8FCADEB3FF0B5FCA512017EB3B3A6B612E0A51B547BD325>I<EB3FF0B5FCA51203C6
FCB3A54CB512F8A59339003FFE00EF1FF0EF3FC04D5A4DC7FCEE03FEEE07F84C5A4C5AEE
7FC04CC8FC4B5A4B5AED0FF8ED1FE04B7E4B7EECF1FF02F37F02F77F91B6FC83159F030F
7F02FE80DAF8077F4A7E6F7F6F7F83707E82707F84707F707F82707F84707F177F717E4D
13C0B6D8F003B6FCA540537CD247>107 D<EB3FF0B5FCA512017EB3B3B3B1B612F0A51C
537BD225>I<D93FF0D91FFCEDFFE0B591B500C0010713FE030302F0011F6D7E030F6E01
7F8092271FE07FFCD9FF037F922A3F001FFE01F8007F0003027C9126FF03E080C602F06D
D90780137FDAF1E0038FC77FDAF3C0159EDAF7806D01BC143F07FC8102FFC75C4A5EA24A
5EA44A5EB3ACB6D8F807B6D8C03FB512FEA567367BB570>I<D93FF0EB1FFCB591B512C0
030314F0030F8092391FE07FFC92393F001FFE0003027C80C602F07FDAF1E081ECF3C0DA
F7807F8502FFC7FC5CA25CA45CB3ACB6D8F807B612C0A542367BB54B>I<913801FFE002
1F13FE91B612C0010315F0010F9038807FFC903A1FFC000FFED97FF86D6C7E49486D7F48
496D7F48496D7F4A147F48834890C86C7EA24883A248486F7EA3007F1880A400FF18C0AC
007F1880A3003F18006D5DA26C5FA26C5F6E147F6C5F6C6D4A5A6C6D495B6C6D495B6D6C
495BD93FFE011F90C7FC903A0FFF807FFC6D90B55A010015C0023F91C8FC020113E03A38
7CB643>I<903A3FF001FFE0B5010F13FE033FEBFFC092B612F002F301017F913AF7F800
7FFE0003D9FFE0EB1FFFC602806D7F92C76C7F4A824A6E7F4A6E7FA2717FA285187F85A4
721380AC1A0060A36118FFA2615F616E4A5BA26E4A5B6E4A5B6F495B6F4990C7FC03F0EB
FFFC9126FBFE075B02F8B612E06F1480031F01FCC8FC030313C092CBFCB1B612F8A5414D
7BB54B>I<90397FE003FEB590380FFF80033F13E04B13F09238FE1FF89139E1F83FFC00
03D9E3E013FEC6ECC07FECE78014EF150014EE02FEEB3FFC5CEE1FF8EE0FF04A90C7FCA5
5CB3AAB612FCA52F367CB537>114 D<903903FFF00F013FEBFE1F90B7FC120348EB003F
D80FF81307D81FE0130148487F4980127F90C87EA24881A27FA27F01F091C7FC13FCEBFF
C06C13FF15F86C14FF16C06C15F06C816C816C81C681013F1580010F15C01300020714E0
EC003F030713F015010078EC007F00F8153F161F7E160FA27E17E07E6D141F17C07F6DEC
3F8001F8EC7F0001FEEB01FE9039FFC00FFC6DB55AD8FC1F14E0D8F807148048C601F8C7
FC2C387CB635>I<143EA6147EA414FEA21301A313031307A2130F131F133F13FF5A000F
90B6FCB8FCA426003FFEC8FCB3A9EE07C0AB011FEC0F8080A26DEC1F0015806DEBC03E6D
EBF0FC6DEBFFF86D6C5B021F5B020313802A4D7ECB34>I<D93FF8913801FFC0B50207B5
FCA50003ED001FC61607B3AE5FA35FA2017F5D173B177B6D6C14F3DC01E313F06D6CD907
C3EBFFC0903A0FFFC03F836D90B51203010114FE6D6C13F8020701E091C7FC42377BB54B
>I<B600F00107B5FCA5000101F8C8EA7FE06C6DED3F00A2017F163E6E157E013F167C6E
15FC6D5E6F13016D5E8117036D5E6F13076D5E6F130F6D5E6F131F6D93C7FC815F6E6C13
3E177E023F147C6F13FC6E5C16816E5C16C3A26EEBE3E016E76E5C16FF6E5CA26E91C8FC
A26F5AA36F5AA26F5AA26F5AA26F5A6F5A40367DB447>I<B6D8E07FB5D8C003B512C0A5
000101F0C701F0C7381FF8006E027FED07E06C715DA26E023F150F017F705DA26E181F01
3F4B6C92C7FC6E606D70143E94B5FC6F177E6D4A6E137C03C001F315FC6D715B160303E0
01E114016D020702E05B03F013C06D71485A160F03F8D9807F13076D05F85B93381F003F
03FC160F027F4902FC5BDBFE3E011F131F023F04FE90C8FC167EDBFF7C010F5B6E01FCEC
FF3E4C6D137E6E5FA24C7F6E5F4C7F6E5FA24C7F6E5F4C147FA26E5F93C8123F6F5EA203
3E6FC9FC5A367DB461>I<B600F00107B5FCA5C601F8C8EA7FE06EED3F00A26D6C153E18
7E013F167C6E15FC6D5E6F13016D5E6F13036D5E8117076D6D5C170F6D6D5C171F6D93C7
FC6F5B027F143E6F137E023F147C6F13FCA26E6D5A16816EEBC1F016C36E5C16E76E5C16
FF6E5CA26E91C8FCA36F5AA26F5AA26F5AA26F5AA26F5AA35E150F5E151F93C9FC5DD81F
C0133E486C137E486C137C486C13FC5D14015D14034A5A6C48485A49485A263FC07FCAFC
EB81FE6CB45A6C13F000035BC690CBFC404D7DB447>121 D E
%EndDVIPSBitmapFont
%DVIPSBitmapFont: Fl cmr10 10.95 51
/Fl 51 122 df<EC03FE91383FFF809138FE03E0903903F800F0D90FE013384948137C90
393F8001FE90387F00035B5BA2485A6F5AED007093C7FCAA16FEB7FCA33901FC00031501
1500B3AC486C497EB5D8F87F13FCA32E407EBF33>12 D<1430147014E0EB01C0EB038013
07EB0F00131E133E133C5B13F85B12015B1203A2485AA2120F5BA2121F90C7FCA25AA312
3E127EA6127C12FCB2127C127EA6123E123FA37EA27F120FA27F1207A26C7EA212017F12
007F13787F133E131E7FEB07801303EB01C0EB00E014701430145A77C323>40
D<12C07E12707E7E121E7E6C7E7F12036C7E7F12007F1378137CA27FA2133F7FA2148013
0FA214C0A3130714E0A6130314F0B214E01307A614C0130FA31480A2131F1400A25B133E
A25BA2137813F85B12015B485A12075B48C7FC121E121C5A5A5A5A145A7BC323>I<B512
FEA617067F961E>45 D<121EEA7F80A2EAFFC0A4EA7F80A2EA1E000A0A798919>I<EB01
FE90380FFFC090383F03F090387C00F849137C48487F48487F4848EB0F80A2000F15C048
48EB07E0A3003F15F0A290C712034815F8A64815FCB3A26C15F8A56C6CEB07F0A3001F15
E0A36C6CEB0FC0A26C6CEB1F80000315006C6C133E6C6C5B017C5B90383F03F090380FFF
C0D901FEC7FC263F7DBC2D>48 D<EB01C013031307131F137FEA07FFB5FC139FEAF81F12
00B3B3ACEB7FF0B612F8A31D3D78BC2D>I<EB07FC90383FFF8090B512E03903F01FF839
07C007FC390F0001FE001E6D7E001C1580003CEC7FC05AED3FE01270B4FC6DEB1FF07FA5
6C5A6CC7FC120CC813E0153FA216C0157F168015FF16004A5A5D4A5A4A5A5D4A5A4A5A4A
C7FC147E147C5C495A495A495A495A49C71270133E133C5B4914E0485A485A485A48C712
0148B6FCA25A4815C0B7FCA3243D7CBC2D>I<EB07FC90383FFF809038F80FE03901E003
F839078001FCD80F007F000E6D7E001E1580D81F80137F486C14C07FA27F5BA2121F6C5A
C8138015FF1600A24A5AA24A5A5DEC07E04A5A023FC7FCEB1FFCECFF809038000FE0EC07
F86E7E6E7E6E7E1680ED7FC0A216E0153FA216F0A2120C123F487E487EA316E0A249137F
6CC713C01278EDFF807E6C4913006C495A3907C007FC3903F80FF0C6B55A013F1380D907
F8C7FC243F7CBC2D>I<150E151E153EA2157EA215FE1401A21403EC077E1406140E141C
A214381470A214E0EB01C0A2EB0380EB0700A2130E5BA25B5BA25B5B1201485A90C7FC5A
120E120C121C5AA25A5AB8FCA3C8EAFE00AC4A7E49B6FCA3283E7EBD2D>I<00061403D8
0780131F01F813FE90B5FC5D5D5D15C092C7FC14FCEB3FE090C9FCACEB01FE90380FFF80
90383E03E090387001F8496C7E49137E497F90C713800006141FC813C0A216E0150FA316
F0A3120C127F7F12FFA416E090C7121F12FC007015C012780038EC3F80123C6CEC7F0000
1F14FE6C6C485A6C6C485A3903F80FE0C6B55A013F90C7FCEB07F8243F7CBC2D>I<EC1F
E0ECFFF8903803F03E90380FC00F90391F000780133E017EEB1FC049133F4848137F1203
5B12074848EB3F80ED1F00001F91C7FC5BA2123FA3485AA214FE903887FF8039FF8F07E0
90389C01F09038B800FC01B0137E13F0497F16804914C0A2ED1FE0A34914F0A5127FA612
3F6D14E0A2121FED3FC0A26C6C1480A20007EC7F006C6C137E6C6C5B6C6C485A90387E07
F06DB45A010F1380D903FCC7FC243F7CBC2D>I<1238123C123F90B612FCA316F85A16F0
16E00078C712010070EC03C0ED078016005D48141E151C153C5DC8127015F04A5A5D1403
4A5A92C7FC5C141EA25CA2147C147814F8A213015C1303A31307A3130F5CA2131FA6133F
AA6D5A0107C8FC26407BBD2D>I<EB03FC90381FFF8090387C07E09038F001F83901E000
7C48487F48487F48C7FCED0F80121E16C0003E1407A4123FA26DEB0F807F6C6C131F6D14
0001FC133E6C6C5B9038FF80786C6D5A6CEBF3E06CEBFF806C91C7FC133F6D13C06D7F01
3F13F801787F48486C7E3903E01FFF48486C1380260F800313C048487E489038007FE000
3E143F007E141F007CEC0FF01507481403A31501A46C15E0007C1403A2007E15C06C1407
6CEC0F806DEB1F006C6C133ED807F05B3901FC03F86CB512E0011F1380D903FCC7FC243F
7CBC2D>I<EB03FCEB1FFF90387E07C09038FC03F048486C7E48486C7E4848137C000F14
7E4848137F81003F15805B007F15C0A2151F12FF16E0A516F0A5127F153FA36C7EA2001F
147F120F6C6C13FF6D13DF000313013900F8039F90387E0F1FD91FFE13E0EB07F090C7FC
A2ED3FC0A41680157FD80F801400487E486C13FEA24A5A5D49485AEB8007391E000FE000
1F495A260FC07FC7FC3803FFFE6C13F838003FC0243F7CBC2D>I<121EEA7F80A2EAFFC0
A4EA7F80A2EA1E00C7FCB3121EEA7F80A2EAFFC0A4EA7F80A2EA1E000A2779A619>I<DB
3FF01306912603FFFE130E020F9038FF801E913A3FF007E03E9139FF8000F8D903FEC7EA
7C7ED907F8EC1EFE4948140FD93FE0140749481403495A91C81201484815001203484816
7E5B000F173EA24848161EA2123F5B180E127FA349160012FFAC127F7F180EA2123FA27F
001F171E181C6C7EA20007173C6D16386C6C1678000117706C6C16F06EEC01E06D6C15C0
6D6C1403D90FF0EC07806D6CEC1F00D903FE143E902600FF8013F891393FF007F0020FB5
12C0020391C7FC9138003FF037427BBF42>67 D<B712FCEEFF8017E000019039C0001FF8
6C6C48EB03FEEE00FF717E717EEF0FE084717E717E170184717EA21980187F19C0A3F03F
E0A519F0AB19E0A5F07FC0A21980A218FF19004D5AA24D5A6017074D5A4D5AEF7FC04DC7
FCEE03FE48486CEB1FF8B85A178004FCC8FC3C3E7DBD45>I<B912E0A300019038C00001
6C6C48EB001FEF0FF01703A217011700A31870A418381638A41800A21678A216F8150115
0791B5FCA3EC8007150115001678A21638A2180EA3181C93C7FCA4183C1838A21878A318
F8EF01F0A21707170F173F48486CEB03FFB912E0A3373E7DBD3E>I<B6D8C01FB512F8A3
000101E0C7383FFC0026007F80EC0FF0B3A691B7FCA30280C7120FB3A92601FFE0EC3FFC
B6D8C01FB512F8A33D3E7DBD44>72 D<B612F0A3C6EBF000EB3FC0B3B3B2EBFFF0B612F0
A31C3E7EBD21>I<011FB512FCA3D9000713006E5A1401B3B3A6123FEA7F80EAFFC0A44A
5A1380D87F005B007C130700385C003C495A6C495A6C495A2603E07EC7FC3800FFF8EB3F
C026407CBD2F>I<B612F8A3000101E0C9FC38007F80B3B0EF0380A517071800A45FA35F
A25F5F5F4C5A160748486C133FB8FCA3313E7DBD39>76 D<B500C093B512C0A300016D4B
EBE000D8007F1880D977F0ED03BFA3D973F8ED073FA3D971FC150EA2D970FE151CA3027F
1538A36E6C1470A36E6C14E0A26E6CEB01C0A36E6CEB0380A36E6CEB0700A26E6C130EA3
6E6C5BA3037F5BA26F6C5AA36F6C5AA392380FE1C0A3923807F380A26FB4C7FCA36F5AA2
13F8486C6D5AD807FFEFFFE0B500F80178017FEBFFC0A34A3E7CBD53>I<B56C91B512F8
8080D8007F030713006EEC01FC6E6E5A1870EB77FCEB73FEA2EB71FF01707FA26E7E6E7E
A26E7E6E7EA26E7E6E7EA26E7E6E7FA26F7E6F7EA26F7E6F7EA26F7E6F7EA26F7E6F1380
A2EE7FC0EE3FE0A2EE1FF0EE0FF8A2EE07FCEE03FEA2EE01FF7013F0A2177F173FA2171F
170FA2170701F81503487ED807FF1501B500F81400A218703D3E7DBD44>I<B712F8EEFF
8017E000019039C0003FF86C6C48EB07FCEE01FE707EEF7F80EF3FC018E0A2EF1FF0A218
F8A818F0A2EF3FE0A218C0EF7F80EFFF004C5AEE07FCEE3FF091B612C04CC7FC0280C9FC
B3A73801FFE0B612C0A3353E7DBD3E>80 D<D907FC131890391FFF8038017FEBE0783901
FC03F83A03F0007CF8D807C0133F4848130F001F140748C7FC003E1403007E1401A2007C
140012FC1678A46C1538A27EA26C6C14007F7FEA3FF8EBFF806C13F86CEBFF806C14F06C
14FC6C14FF6C15C0013F14E0010714F0EB007F020713F89138007FFC150FED07FE150315
01ED00FFA200E0157FA3163FA27EA3163E7E167E6C157C6C15FC6C15F86D13016DEB03F0
6DEB07E0D8F9FCEB0FC03AF07F803F8090391FFFFE00D8E00713F839C0007FC028427BBF
33>83 D<003FB91280A3903AF0007FE001018090393FC0003F48C7ED1FC0007E1707127C
00781703A300701701A548EF00E0A5C81600B3B14B7E4B7E0107B612FEA33B3D7DBC42>
I<B66C0103B51280A3000101F0C8EBF8006C6C48ED3FC0725A013F041EC7FC6D7E606D6C
15386D6C1578606D6C5D6E14016D5E6D6D1303606E6C49C8FC6E6C5B170E6E6C131E171C
6E6C5B6E6C137817706E6C13F06F5B6E13016EEB83C05FED7FC7DB3FE7C9FC16EFED1FFE
5E150F6F5AB3A4ED1FFC020FB512FCA3413E7FBD44>89 D<EB0FF8EBFFFE3903F01F8039
078007E0000F6D7E9038E001F8D81FF07F6E7EA3157F6C5AEA0380C8FCA4EC1FFF0103B5
FC90381FF87FEB7F803801FC00EA07F8EA0FE0485A485AA248C7FCEE038012FEA315FFA3
007F5BEC03BF3B3F80071F8700261FC00E13CF3A07F03C0FFE3A01FFF807FC3A003FC001
F0292A7DA82D>97 D<EA01FC12FFA3120712031201B1EC03FC91381FFF8091387C07E090
39FDE001F09039FFC000FC4A137E91C77E49158049141F17C0EE0FE0A217F0A2160717F8
AA17F0A2160FA217E0161F17C06D1580EE3F006D5C6E13FE9039F3C001F89039F1E003F0
9039E0780FC09026C03FFFC7FCC7EA07F82D407EBE33>I<49B4FC010F13E090383F00F8
017C131E4848131F4848137F0007ECFF80485A5B121FA24848EB7F00151C007F91C7FCA2
90C9FC5AAB6C7EA3003FEC01C07F001F140316806C6C13076C6C14000003140E6C6C131E
6C6C137890383F01F090380FFFC0D901FEC7FC222A7DA828>I<ED01FC15FFA315071503
1501B114FF010713E190381F80F990387E003D49131FD803F81307485A49130348481301
121F123F5B127FA290C7FCA25AAA7E7FA2123FA26C7E000F14037F000714076C6C497E6C
6C497ED8007C017913F890383F01F190380FFFC1903A01FE01FC002D407DBE33>I<EB01
FE90380FFFC090383F03F09038FC01F848486C7E4848137E48487F000F158049131F001F
15C04848130FA2127F16E090C7FCA25AA290B6FCA290C9FCA67EA27F123F16E06C7E1501
000F15C06C6C13036DEB07806C6C1400C66C131E017E5B90381F80F8903807FFE0010090
C7FC232A7EA828>I<EC1FC0EC7FF8903801F83C903807E07E90380FC0FFEB1FC1EB3F81
1401137FEC00FE01FE137C1500AEB6FCA3C648C7FCB3AE487E007F13FFA320407EBF1C>
I<167C903903F801FF903A1FFF078F8090397E0FDE1F9038F803F83803F001A23B07E000
FC0600000F6EC7FC49137E001F147FA8000F147E6D13FE00075C6C6C485AA23901F803E0
3903FE0FC026071FFFC8FCEB03F80006CAFC120EA3120FA27F7F6CB512E015FE6C6E7E6C
15E06C810003813A0FC0001FFC48C7EA01FE003E140048157E825A82A46C5D007C153E00
7E157E6C5D6C6C495A6C6C495AD803F0EB0FC0D800FE017FC7FC90383FFFFC010313C029
3D7EA82D>I<EA01FC12FFA3120712031201B1EC01FE913807FFC091381E07E091387803
F09138E001F8D9FDC07F148001FF6D7E91C7FCA25BA25BB3A6486C497EB5D8F87F13FCA3
2E3F7DBE33>I<EA01E0EA07F8A2487EA46C5AA2EA01E0C8FCACEA01FC127FA312071203
1201B3AC487EB512F0A3143E7DBD1A>I<EA01FC12FFA3120712031201B3B3B1487EB512
F8A3153F7DBE1A>108 D<2701F801FE14FF00FF902707FFC00313E0913B1E07E00F03F0
913B7803F03C01F80007903BE001F87000FC2603F9C06D487F000101805C01FBD900FF14
7F91C75B13FF4992C7FCA2495CB3A6486C496CECFF80B5D8F87FD9FC3F13FEA347287DA7
4C>I<3901F801FE00FF903807FFC091381E07E091387803F000079038E001F82603F9C0
7F0001138001FB6D7E91C7FC13FF5BA25BB3A6486C497EB5D8F87F13FCA32E287DA733>
I<14FF010713E090381F81F890387E007E01F8131F4848EB0F804848EB07C04848EB03E0
000F15F04848EB01F8A2003F15FCA248C812FEA44815FFA96C15FEA36C6CEB01FCA3001F
15F86C6CEB03F0A26C6CEB07E06C6CEB0FC06C6CEB1F80D8007EEB7E0090383F81FC9038
0FFFF0010090C7FC282A7EA82D>I<3901FC03FC00FF90381FFF8091387C0FE09039FDE0
03F03A07FFC001FC6C496C7E6C90C7127F49EC3F805BEE1FC017E0A2EE0FF0A3EE07F8AA
EE0FF0A4EE1FE0A2EE3FC06D1580EE7F007F6E13FE9138C001F89039FDE007F09039FC78
0FC0DA3FFFC7FCEC07F891C9FCAD487EB512F8A32D3A7EA733>I<3901F807E000FFEB1F
F8EC787CECE1FE3807F9C100031381EA01FB1401EC00FC01FF1330491300A35BB3A5487E
B512FEA31F287EA724>114 D<90383FC0603901FFF8E03807C03F381F000F003E130700
3C1303127C0078130112F81400A27E7E7E6D1300EA7FF8EBFFC06C13F86C13FE6C7F6C14
80000114C0D8003F13E0010313F0EB001FEC0FF800E01303A214017E1400A27E15F07E14
016C14E06CEB03C0903880078039F3E01F0038E0FFFC38C01FE01D2A7DA824>I<131CA6
133CA4137CA213FCA2120112031207001FB512C0B6FCA2D801FCC7FCB3A215E0A9120090
38FE01C0A2EB7F03013F138090381F8700EB07FEEB01F81B397EB723>I<D801FC14FE00
FF147FA3000714030003140100011400B3A51501A31503120015076DEB06FF017E010E13
806D4913FC90381FC078903807FFE00100903880FE002E297DA733>I<B539E00FFFE0A3
2707FE000313006C48EB00FC5E00015D7F00005DA26D13016D5CA26D6C485AA2ECC00701
1F91C7FCA290380FE00EA2ECF01E0107131CA26D6C5AA2ECFC7801011370A2ECFEF00100
5BA2EC7FC0A36E5AA26EC8FCA3140E2B287EA630>I<B53BC3FFFE03FFF8A3290FFE003F
E00013C06C486D48EB3F806C4817006D010F141E00016F131C15076D163C00004A6C1338
A2017F5E4B7E151DD93F805DED3DFC1538D91FC04A5AED78FE9238707E03D90FE0017F5B
EDE03F02F0140701070387C7FC9138F1C01F02F9148F010315CE9138FB800F02FF14DE6D
15FCED00076D5DA24A1303027E5CA2027C1301023C5C023813003D287EA642>I<B539F0
1FFFE0A30003D9C00F1300C690388007F8D97F0013E002805BD93FC05B011F49C7FC9038
0FE00EECF01E6D6C5A01035B6D6C5A6E5AEB00FF6E5A6E5A81141F814A7E81147BECF1FC
903801E1FEECC0FF01037F49486C7ED90F007F011E6D7E013E130F496D7E01FC80486C80
000F4A7EB539803FFFF8A32D277FA630>I<B539E00FFFE0A32707FE000313006C48EB01
FC6F5A00015D7F00005DA2017F495AA2EC8003013F5CA26D6C48C7FCA26E5A010F130EA2
6D6C5AA2ECF83C01031338A26D6C5AA2ECFEF001005BA2EC7FC0A36E5AA36EC8FCA2140E
A2141E141C143C1438A2147800181370127EB45BA2495AA248485AD87E07C9FCEA780EEA
3C3CEA1FF8EA07E02B3A7EA630>I E
%EndDVIPSBitmapFont
%DVIPSBitmapFont: Fm cmbx12 20.736 9
/Fm 9 123 df<92380FFFE04AB67E020F15F0027F15FE49B87E4917E0010F17F8013F83
49D9C01F14FF9027FFFC0001814801E06D6C80480180021F804890C86C8048486F804848
6F8001FF6F804801C06E8002F081486D18806E816E18C0B5821BE06E81A37214F0A56C5B
A36C5B6C5B6C5B000313C0C690C9FC90CA15E060A34E14C0A21B80601B0060626295B55A
5F624D5C624D5C4D91C7FC614D5B4D13F04D5B6194B55A4C49C8FC4C5B4C5B4C13E04C5B
604C90C9FCEE7FFC4C5A4B5B4B5B4B0180EC0FF04B90C8FC4B5A4B5A4B48ED1FE0EDFFE0
4A5B4A5B4A90C9FC4A48163F4A5ADA3FF017C05D4A48167F4A5A4990CA12FFD903FC1607
49BAFC5B4919805B5B90BBFC5A5A5A5A481A005A5ABCFCA462A44C7176F061>50
D<92383FFFF80207B612E0027F15FC49B87E010717E0011F83499026F0007F13FC4948C7
000F7F90B502036D7E486E6D806F6D80727F486E6E7F8486727FA28684A26C5C72806C5C
6D90C8FC6D5AEB0FF8EB03E090CAFCA70507B6FC041FB7FC0303B8FC157F0203B9FC021F
ECFE0391B612800103ECF800010F14C04991C7FC017F13FC90B512F04814C0485C4891C8
FC485B5A485B5C5A5CA2B5FC5CA360A36E5DA26C5F6E5D187E6C6D846E4A48806C6D4A48
14FC6C6ED90FF0ECFFFC6C02E090263FE07F14FE00019139FC03FFC06C91B6487E013F4B
487E010F4B1307010303F01301D9003F0280D9003F13FC020101F8CBFC57507ACE5E>97
D<903801FFFCB6FCA8C67E131F7FB3ADF0FFFC050FEBFFE0057F14FE0403B77E040F16E0
043F16F84CD9007F13FE9226FDFFF001077F92B500C001018094C86C13E004FC6F7F4C6F
7F04E06F7F4C6F7F5E747F93C915804B7014C0A27414E0A21DF087A21DF8A31DFC87A41D
FEAF1DFCA4631DF8A31DF098B5FC1DE0A25014C0A26F1980501400705D705F704B5B505B
704B5B04FC4B5BDBE7FE92B55A9226C3FF8001035C038101E0011F49C7FC9226807FFC90
B55A4B6CB712F04A010F16C04A010393C8FC4A010015F84A023F14C090C9000301F0C9FC
5F797AF76C>I<97380FFFE00607B6FCA8F00003190086B3AD93383FFF800307B512F803
3F14FF4AB712C0020716F0021F16FC027F9039FE007FFE91B500F0EB0FFF010302800101
90B5FC4949C87E49498149498149498149498190B548814884484A8192CAFC5AA2485BA2
5A5C5AA35A5CA4B5FCAF7EA4807EA37EA2807EA26C7F616C6E5D6C606C80616D6D5D6D6D
5D6D6D92B67E6D6D4A15FC010301FF0207EDFFFE6D02C0EB3FFE6D6C9039FC01FFF86E90
B65A020F16C002031600DA007F14FC030F14E09226007FFEC749C7FC5F797AF76C>100
D<EB01FCEB07FF011F13C0497F497F90B57EA24880A24880A76C5CA26C5CA26D5B6D5B6D
5B010790C8FCEB01FC90CAFCB2903801FFFC007FB5FCA8C67E131F7FB3B3B3A5B81280A8
297979F835>105 D<903801FFFCB6FCA8C67E131F7FB3B3B3B3B3ABB812C0A82A7879F7
35>108 D<902601FFF891380FFFE0B692B512FE05036E7E050F15E0053F15F84D819327
01FFF01F7F4CD900077FDC07FC6D80C66CDA0FF06D80011FDA1FC07F6D4A48824CC8FC04
7E6F7F5EEDF9F85E03FB707F5E15FF5EA25EA293C9FCA45DB3B3A6B8D8E003B81280A861
4E79CD6C>110 D<902601FFFCEC7FFEB6020FB512F0057F14FE4CB712C0040716F0041F
82047F16FE93B5C66C7F92B500F0010F14C0C66C0380010380011F4AC76C806D4A6E8004
F06F7F4C6F7F4C6F7F4C8193C915804B7014C0861DE0A27414F0A27414F8A47513FCA575
13FEAF5113FCA598B512F8A31DF0621DE0621DC0621D806F5E701800704B5B505B704B5B
7092B55A04FC4A5C704A5C706C010F5C05E0013F49C7FC9227FE7FFC01B55A70B712F004
0F16C0040393C8FC040015F8053F14C0050301F0C9FC94CCFCB3A6B812E0A85F6F7ACD6C
>112 D<0007BA12FE1AFFA503E0C76C13FE4AC8B512FC4801F04A14F84A5C4A17F091C8
4814E04D14C0495D4918804D1400494B5B94B5FC61494A5C4C5C5E61001F4B5C494A5C5E
96C7FC4C5B93B55A5DC85D4B5C4B5C5D604B5C4B91C8FC5D5F92B55A4A5C5C4D14FF4A5C
4A5C5C5F4A91C75A4A4915FE91B5FC5E495C495C4917035E495C495C49170793C8FC4949
ED0FFC90B55A48181F5D484A153F484A157F4818FF4B1403484A140F4891C8123F480407
B5FC92B8FCBB12F8A57E484D7BCC56>122 D E
%EndDVIPSBitmapFont
end
%%EndProlog
%%BeginSetup
%%Feature: *Resolution 600dpi
TeXDict begin
%%PaperSize: A4
%%EndSetup
%%Page: 1 1
1 0 bop 150 1318 a Fm(bzip2)64 b(and)g(libbzip2)p 150
1418 3600 34 v 2010 1515 a Fl(a)31 b(program)f(and)g(library)e(for)i
(data)h(compression)2198 1623 y(cop)m(yrigh)m(t)f(\(C\))h(1996-2002)j
(Julian)28 b(Sew)m(ard)2394 1731 y(v)m(ersion)i(1.0.2)i(of)f(30)g
(Decem)m(b)s(er)g(2001)150 5091 y Fk(Julian)46 b(Sew)l(ard)p
150 5141 3600 17 v eop
%%Page: 1 2
1 1 bop 3705 -116 a Fl(1)150 299 y(The)40 b(follo)m(wing)f(text)i(is)f
(the)h(License)f(for)g(this)f(soft)m(w)m(are.)73 b(Y)-8
b(ou)41 b(should)d(\014nd)h(it)h(iden)m(tical)f(to)i(that)150
408 y(con)m(tained)31 b(in)e(the)h(\014le)g(LICENSE)f(in)g(the)h
(source)h(distribution.)150 565 y Fj(||||||)f(ST)-8 b(AR)g(T)30
b(OF)h(THE)f(LICENSE)f(||||||)150 722 y(This)24 b(program,)i
Fi(bzip2)p Fj(,)f(and)f(asso)s(ciated)h(library)g Fi(libbzip2)p
Fj(,)e(are)i(Cop)m(yrigh)m(t)h(\(C\))f(1996-2002)j(Julian)150
832 y(R)i(Sew)m(ard.)41 b(All)30 b(righ)m(ts)h(reserv)m(ed.)150
989 y(Redistribution)46 b(and)f(use)g(in)g(source)h(and)f(binary)f
(forms,)50 b(with)45 b(or)h(without)g(mo)s(di\014cation,)j(are)150
1098 y(p)s(ermitted)31 b(pro)m(vided)f(that)h(the)g(follo)m(wing)g
(conditions)g(are)g(met:)225 1255 y Fh(\017)60 b Fj(Redistributions)44
b(of)g(source)g(co)s(de)f(m)m(ust)h(retain)g(the)g(ab)s(o)m(v)m(e)h
(cop)m(yrigh)m(t)g(notice,)k(this)43 b(list)i(of)330
1365 y(conditions)31 b(and)e(the)i(follo)m(wing)h(disclaimer.)225
1499 y Fh(\017)60 b Fj(The)32 b(origin)g(of)g(this)g(soft)m(w)m(are)h
(m)m(ust)f(not)g(b)s(e)f(misrepresen)m(ted;)j(y)m(ou)e(m)m(ust)g(not)g
(claim)g(that)h(y)m(ou)330 1609 y(wrote)d(the)f(original)h(soft)m(w)m
(are.)42 b(If)29 b(y)m(ou)g(use)g(this)g(soft)m(w)m(are)i(in)d(a)h(pro)
s(duct,)g(an)g(ac)m(kno)m(wledgmen)m(t)330 1718 y(in)h(the)h(pro)s
(duct)e(do)s(cumen)m(tation)j(w)m(ould)e(b)s(e)f(appreciated)j(but)d
(is)i(not)g(required.)225 1853 y Fh(\017)60 b Fj(Altered)36
b(source)g(v)m(ersions)g(m)m(ust)f(b)s(e)f(plainly)i(mark)m(ed)f(as)g
(suc)m(h,)i(and)d(m)m(ust)h(not)h(b)s(e)f(misrepre-)330
1962 y(sen)m(ted)c(as)f(b)s(eing)g(the)h(original)h(soft)m(w)m(are.)225
2097 y Fh(\017)60 b Fj(The)25 b(name)g(of)g(the)g(author)g(ma)m(y)h
(not)f(b)s(e)f(used)h(to)g(endorse)g(or)h(promote)g(pro)s(ducts)e
(deriv)m(ed)h(from)330 2206 y(this)30 b(soft)m(w)m(are)i(without)f(sp)s
(eci\014c)f(prior)g(written)h(p)s(ermission.)150 2388
y(THIS)36 b(SOFTW)-10 b(ARE)35 b(IS)h(PR)m(O)m(VIDED)g(BY)f(THE)h(A)m
(UTHOR)h(\\AS)f(IS")g(AND)f(ANY)h(EXPRESS)150 2498 y(OR)29
b(IMPLIED)g(W)-10 b(ARRANTIES,)28 b(INCLUDING,)h(BUT)g(NOT)g(LIMITED)g
(TO,)h(THE)e(IMPLIED)150 2607 y(W)-10 b(ARRANTIES)60
b(OF)h(MER)m(CHANT)-8 b(ABILITY)61 b(AND)g(FITNESS)f(F)m(OR)i(A)f(P)-8
b(AR)g(TICULAR)150 2717 y(PURPOSE)40 b(ARE)g(DISCLAIMED.)f(IN)i(NO)g
(EVENT)f(SHALL)f(THE)i(A)m(UTHOR)g(BE)f(LIABLE)150 2827
y(F)m(OR)d(ANY)f(DIRECT,)g(INDIRECT,)g(INCIDENT)-8 b(AL,)37
b(SPECIAL,)d(EXEMPLAR)-8 b(Y,)36 b(OR)h(CON-)150 2936
y(SEQUENTIAL)30 b(D)m(AMA)m(GES)h(\(INCLUDING,)h(BUT)e(NOT)i(LIMITED)f
(TO,)h(PR)m(OCUREMENT)150 3046 y(OF)55 b(SUBSTITUTE)e(GOODS)i(OR)f(SER)
-10 b(VICES;)53 b(LOSS)g(OF)i(USE,)f(D)m(A)-8 b(T)g(A,)55
b(OR)g(PR)m(OFITS;)150 3155 y(OR)e(BUSINESS)d(INTERR)m(UPTION\))k(HO)m
(WEVER)e(CA)m(USED)f(AND)h(ON)h(ANY)f(THEOR)-8 b(Y)150
3265 y(OF)71 b(LIABILITY,)f(WHETHER)g(IN)h(CONTRA)m(CT,)g(STRICT)g
(LIABILITY,)e(OR)i(TOR)-8 b(T)150 3374 y(\(INCLUDING)45
b(NEGLIGENCE)g(OR)g(OTHER)-10 b(WISE\))45 b(ARISING)g(IN)g(ANY)g(W)-10
b(A)i(Y)44 b(OUT)i(OF)150 3484 y(THE)i(USE)f(OF)h(THIS)g(SOFTW)-10
b(ARE,)47 b(EVEN)g(IF)h(AD)m(VISED)e(OF)i(THE)g(POSSIBILITY)f(OF)150
3594 y(SUCH)30 b(D)m(AMA)m(GE.)150 3750 y(Julian)g(Sew)m(ard,)g(Cam)m
(bridge,)h(UK.)150 3907 y Fi(jseward@acm.org)150 4064
y(bzip2)p Fj(/)p Fi(libbzip2)c Fj(v)m(ersion)k(1.0.2)i(of)d(30)h(Decem)
m(b)s(er)g(2001.)150 4221 y(||||||)f(END)g(OF)g(THE)g(LICENSE)f(||||||)
150 4378 y(W)-8 b(eb)31 b(sites:)150 4535 y Fi
(http://sources.redhat.co)o(m/bz)o(ip2)150 4691 y
(http://www.cacheprof.org)150 4848 y Fj(P)-8 b(A)g(TENTS:)40
b(T)-8 b(o)40 b(the)f(b)s(est)g(of)g(m)m(y)h(kno)m(wledge,)i
Fi(bzip2)c Fj(do)s(es)h(not)g(use)g(an)m(y)h(paten)m(ted)g(algorithms.)
150 4958 y(Ho)m(w)m(ev)m(er,)31 b(I)c(do)h(not)g(ha)m(v)m(e)g(the)g
(resources)h(a)m(v)-5 b(ailable)29 b(to)f(carry)g(out)g(a)g(full)f
(paten)m(t)i(searc)m(h.)40 b(Therefore)150 5067 y(I)30
b(cannot)h(giv)m(e)h(an)m(y)f(guaran)m(tee)g(of)g(the)g(ab)s(o)m(v)m(e)
g(statemen)m(t.)p eop
%%Page: 2 3
2 2 bop 150 -116 a Fl(Chapter)30 b(1:)41 b(In)m(tro)s(duction)2591
b(2)150 299 y Fg(1)80 b(In)l(tro)t(duction)150 555 y
Fi(bzip2)40 b Fj(compresses)h(\014les)g(using)g(the)g(Burro)m
(ws-Wheeler)h(blo)s(c)m(k-sorting)h(text)f(compression)f(algo-)150
665 y(rithm,)54 b(and)49 b(Hu\013man)f(co)s(ding.)98
b(Compression)49 b(is)h(generally)h(considerably)e(b)s(etter)h(than)f
(that)150 775 y(ac)m(hiev)m(ed)43 b(b)m(y)f(more)g(con)m(v)m(en)m
(tional)i(LZ77/LZ78-based)e(compressors,)j(and)40 b(approac)m(hes)i
(the)g(p)s(er-)150 884 y(formance)31 b(of)f(the)h(PPM)g(family)f(of)h
(statistical)i(compressors.)150 1041 y Fi(bzip2)g Fj(is)h(built)h(on)f
(top)h(of)f Fi(libbzip2)p Fj(,)f(a)i(\015exible)f(library)h(for)f
(handling)g(compressed)g(data)h(in)f(the)150 1151 y Fi(bzip2)29
b Fj(format.)41 b(This)30 b(man)m(ual)g(describ)s(es)g(b)s(oth)f(ho)m
(w)i(to)g(use)f(the)g(program)h(and)e(ho)m(w)h(to)h(w)m(ork)g(with)150
1260 y(the)26 b(library)f(in)m(terface.)41 b(Most)26
b(of)f(the)h(man)m(ual)f(is)g(dev)m(oted)i(to)f(this)f(library)-8
b(,)27 b(not)f(the)g(program,)g(whic)m(h)150 1370 y(is)k(go)s(o)s(d)h
(news)e(if)i(y)m(our)f(in)m(terest)i(is)f(only)f(in)g(the)h(program.)
150 1527 y(Chapter)45 b(2)h(describ)s(es)e(ho)m(w)i(to)g(use)f
Fi(bzip2)p Fj(;)51 b(this)46 b(is)f(the)h(only)f(part)g(y)m(ou)h(need)f
(to)h(read)f(if)h(y)m(ou)150 1636 y(just)39 b(w)m(an)m(t)g(to)h(kno)m
(w)f(ho)m(w)h(to)f(op)s(erate)h(the)g(program.)67 b(Chapter)38
b(3)i(describ)s(es)e(the)i(programming)150 1746 y(in)m(terfaces)27
b(in)f(detail,)i(and)d(Chapter)g(4)h(records)g(some)g(miscellaneous)h
(notes)f(whic)m(h)g(I)g(though)m(t)g(ough)m(t)150 1855
y(to)31 b(b)s(e)f(recorded)h(somewhere.)p eop
%%Page: 3 4
3 3 bop 150 -116 a Fl(Chapter)30 b(2:)41 b(Ho)m(w)31
b(to)g(use)f Fi(bzip2)2375 b Fl(3)150 299 y Fg(2)80 b(Ho)l(w)53
b(to)g(use)g Ff(bzip2)150 566 y Fj(This)30 b(c)m(hapter)h(con)m(tains)h
(a)e(cop)m(y)h(of)g(the)g Fi(bzip2)d Fj(man)i(page,)h(and)f(nothing)g
(else.)390 818 y Fe(NAME)570 1004 y Fi(bzip2)p Fj(,)f
Fi(bunzip2)g Fj(-)h(a)h(blo)s(c)m(k-sorting)h(\014le)e(compressor,)h
(v1.0.2)570 1136 y Fi(bzcat)e Fj(-)i(decompresses)f(\014les)h(to)g
(stdout)570 1267 y Fi(bzip2recover)c Fj(-)k(reco)m(v)m(ers)h(data)f
(from)f(damaged)g(bzip2)h(\014les)390 1519 y Fe(SYNOPSIS)570
1706 y Fi(bzip2)e Fj([)i(-cdfkqstvzVL123456789)j(])d([)g(\014lenames)f
(...)41 b(])570 1837 y Fi(bunzip2)28 b Fj([)j(-fkvsVL)f(])g([)h
(\014lenames)f(...)41 b(])570 1968 y Fi(bzcat)29 b Fj([)i(-s)f(])h([)g
(\014lenames)f(...)41 b(])570 2100 y Fi(bzip2recover)27
b Fj(\014lename)390 2352 y Fe(DESCRIPTION)390 2538 y
Fi(bzip2)e Fj(compresses)i(\014les)f(using)g(the)h(Burro)m(ws-Wheeler)g
(blo)s(c)m(k)f(sorting)i(text)f(compres-)390 2642 y(sion)39
b(algorithm,)k(and)38 b(Hu\013man)h(co)s(ding.)67 b(Compression)39
b(is)g(generally)i(considerably)390 2746 y(b)s(etter)23
b(than)g(that)g(ac)m(hiev)m(ed)h(b)m(y)f(more)g(con)m(v)m(en)m(tional)i
(LZ77/LZ78-based)e(compressors,)390 2850 y(and)k(approac)m(hes)i(the)f
(p)s(erformance)g(of)h(the)f(PPM)h(family)f(of)h(statistical)h
(compressors.)390 3001 y(The)c(command-line)g(options)g(are)g(delib)s
(erately)h(v)m(ery)f(similar)h(to)f(those)h(of)f(GNU)g
Fi(gzip)p Fj(,)390 3104 y(but)k(they)g(are)h(not)g(iden)m(tical.)390
3255 y Fi(bzip2)e Fj(exp)s(ects)j(a)f(list)h(of)f(\014le)g(names)f(to)i
(accompan)m(y)g(the)f(command-line)g(\015ags.)43 b(Eac)m(h)390
3359 y(\014le)d(is)h(replaced)g(b)m(y)f(a)g(compressed)h(v)m(ersion)g
(of)f(itself,)k(with)d(the)f(name)g Fi(original_)390
3463 y(name.bz2)p Fj(.)45 b(Eac)m(h)33 b(compressed)g(\014le)g(has)f
(the)h(same)g(mo)s(di\014cation)g(date,)h(p)s(ermissions,)390
3567 y(and,)47 b(when)c(p)s(ossible,)k(o)m(wnership)c(as)h(the)g
(corresp)s(onding)g(original,)49 b(so)44 b(that)g(these)390
3671 y(prop)s(erties)37 b(can)g(b)s(e)g(correctly)i(restored)f(at)g
(decompression)f(time.)62 b(File)39 b(name)d(han-)390
3774 y(dling)e(is)g(naiv)m(e)h(in)f(the)g(sense)g(that)h(there)f(is)g
(no)g(mec)m(hanism)g(for)h(preserving)f(original)390
3878 y(\014le)41 b(names,)i(p)s(ermissions,)g(o)m(wnerships)d(or)h
(dates)g(in)g(\014lesystems)g(whic)m(h)f(lac)m(k)i(these)390
3982 y(concepts,)32 b(or)e(ha)m(v)m(e)i(serious)e(\014le)h(name)f
(length)h(restrictions,)h(suc)m(h)e(as)g(MS-DOS.)390
4133 y Fi(bzip2)24 b Fj(and)i Fi(bunzip2)d Fj(will)k(b)m(y)f(default)f
(not)i(o)m(v)m(erwrite)h(existing)f(\014les.)39 b(If)26
b(y)m(ou)g(w)m(an)m(t)h(this)390 4237 y(to)k(happ)s(en,)e(sp)s(ecify)h
(the)h Fi(-f)e Fj(\015ag.)390 4388 y(If)k(no)f(\014le)h(names)f(are)i
(sp)s(eci\014ed,)e Fi(bzip2)g Fj(compresses)h(from)f(standard)g(input)g
(to)i(stan-)390 4491 y(dard)d(output.)44 b(In)32 b(this)f(case,)i
Fi(bzip2)e Fj(will)h(decline)g(to)h(write)f(compressed)g(output)f(to)i
(a)390 4595 y(terminal,)e(as)g(this)f(w)m(ould)g(b)s(e)g(en)m(tirely)i
(incomprehensible)e(and)g(therefore)h(p)s(oin)m(tless.)390
4746 y Fi(bunzip2)j Fj(\(or)j Fi(bzip2)29 b(-d)p Fj(\))36
b(decompresses)g(all)h(sp)s(eci\014ed)e(\014les.)58 b(Files)37
b(whic)m(h)f(w)m(ere)h(not)390 4850 y(created)f(b)m(y)e
Fi(bzip2)g Fj(will)g(b)s(e)g(detected)j(and)c(ignored,)k(and)c(a)i(w)m
(arning)g(issued.)52 b Fi(bzip2)390 4954 y Fj(attempts)29
b(to)f(guess)g(the)g(\014lename)f(for)h(the)g(decompressed)f(\014le)h
(from)f(that)h(of)g(the)g(com-)390 5058 y(pressed)i(\014le)g(as)h
(follo)m(ws:)570 5209 y Fi(filename.bz2)57 b Fj(b)s(ecomes)31
b Fi(filename)570 5340 y(filename.bz)58 b Fj(b)s(ecomes)30
b Fi(filename)p eop
%%Page: 4 5
4 4 bop 150 -116 a Fl(Chapter)30 b(2:)41 b(Ho)m(w)31
b(to)g(use)f Fi(bzip2)2375 b Fl(4)570 299 y Fi(filename.tbz2)27
b Fj(b)s(ecomes)j Fi(filename.tar)570 470 y(filename.tbz)57
b Fj(b)s(ecomes)31 b Fi(filename.tar)570 641 y(anyothername)57
b Fj(b)s(ecomes)31 b Fi(anyothername.out)390 859 y Fj(If)i(the)g
(\014le)f(do)s(es)h(not)g(end)f(in)g(one)i(of)e(the)h(recognised)h
(endings,)f Fi(.bz2)p Fj(,)g Fi(.bz)p Fj(,)f Fi(.tbz2)g
Fj(or)390 963 y Fi(.tbz)p Fj(,)h Fi(bzip2)g Fj(complains)g(that)h(it)h
(cannot)f(guess)f(the)h(name)g(of)f(the)h(original)h(\014le,)g(and)390
1067 y(uses)30 b(the)h(original)g(name)f(with)h Fi(.out)e
Fj(app)s(ended.)390 1218 y(As)g(with)h(compression,)h(supplying)e(no)h
(\014lenames)f(causes)i(decompression)f(from)g(stan-)390
1321 y(dard)f(input)h(to)h(standard)f(output.)390 1472
y Fi(bunzip2)h Fj(will)j(correctly)i(decompress)d(a)h(\014le)f(whic)m
(h)g(is)h(the)g(concatenation)h(of)f(t)m(w)m(o)h(or)390
1576 y(more)i(compressed)g(\014les.)61 b(The)37 b(result)g(is)g(the)g
(concatenation)i(of)e(the)g(corresp)s(onding)390 1680
y(uncompressed)c(\014les.)52 b(In)m(tegrit)m(y)37 b(testing)e(\()p
Fi(-t)p Fj(\))f(of)h(concatenated)h(compressed)e(\014les)g(is)390
1784 y(also)d(supp)s(orted.)390 1935 y(Y)-8 b(ou)38 b(can)g(also)g
(compress)g(or)g(decompress)g(\014les)f(to)i(the)f(standard)f(output)g
(b)m(y)h(giving)390 2039 y(the)44 b Fi(-c)e Fj(\015ag.)79
b(Multiple)44 b(\014les)g(ma)m(y)f(b)s(e)g(compressed)g(and)f
(decompressed)h(lik)m(e)i(this.)390 2142 y(The)31 b(resulting)h
(outputs)e(are)i(fed)f(sequen)m(tially)h(to)g(stdout.)43
b(Compression)31 b(of)g(m)m(ultiple)390 2246 y(\014les)43
b(in)g(this)g(manner)g(generates)i(a)e(stream)h(con)m(taining)g(m)m
(ultiple)h(compressed)e(\014le)390 2350 y(represen)m(tations.)48
b(Suc)m(h)32 b(a)g(stream)h(can)f(b)s(e)g(decompressed)g(correctly)j
(only)d(b)m(y)g Fi(bzip2)390 2454 y Fj(v)m(ersion)h(0.9.0)h(or)f
(later.)48 b(Earlier)33 b(v)m(ersions)g(of)g Fi(bzip2)e
Fj(will)i(stop)g(after)g(decompressing)390 2558 y(the)e(\014rst)f
(\014le)g(in)g(the)h(stream.)390 2709 y Fi(bzcat)e Fj(\(or)i
Fi(bzip2)e(-dc)p Fj(\))h(decompresses)g(all)h(sp)s(eci\014ed)f(\014les)
g(to)i(the)e(standard)g(output.)390 2860 y Fi(bzip2)c
Fj(will)j(read)e(argumen)m(ts)i(from)e(the)h(en)m(vironmen)m(t)h(v)-5
b(ariables)28 b Fi(BZIP2)f Fj(and)g Fi(BZIP)p Fj(,)g(in)390
2963 y(that)21 b(order,)i(and)d(will)h(pro)s(cess)f(them)h(b)s(efore)g
(an)m(y)f(argumen)m(ts)h(read)g(from)f(the)h(command)390
3067 y(line.)41 b(This)30 b(giv)m(es)i(a)e(con)m(v)m(enien)m(t)j(w)m(a)
m(y)e(to)g(supply)e(default)i(argumen)m(ts.)390 3218
y(Compression)e(is)h(alw)m(a)m(ys)h(p)s(erformed,)e(ev)m(en)h(if)g(the)
g(compressed)f(\014le)h(is)g(sligh)m(tly)h(larger)390
3322 y(than)24 b(the)h(original.)40 b(Files)25 b(of)f(less)h(than)f(ab)
s(out)g(one)h(h)m(undred)d(b)m(ytes)j(tend)g(to)g(get)h(larger,)390
3426 y(since)33 b(the)g(compression)f(mec)m(hanism)h(has)f(a)h(constan)
m(t)g(o)m(v)m(erhead)h(in)e(the)h(region)g(of)g(50)390
3529 y(b)m(ytes.)50 b(Random)33 b(data)h(\(including)f(the)h(output)f
(of)g(most)h(\014le)g(compressors\))g(is)f(co)s(ded)390
3633 y(at)e(ab)s(out)f(8.05)i(bits)e(p)s(er)g(b)m(yte,)h(giving)h(an)e
(expansion)g(of)g(around)f(0.5\045.)390 3784 y(As)f(a)h(self-c)m(hec)m
(k)i(for)e(y)m(our)g(protection,)i Fi(bzip2)d Fj(uses)g(32-bit)i(CR)m
(Cs)f(to)g(mak)m(e)h(sure)e(that)390 3888 y(the)43 b(decompressed)g(v)m
(ersion)h(of)f(a)g(\014le)f(is)h(iden)m(tical)i(to)f(the)f(original.)79
b(This)43 b(guards)390 3992 y(against)h(corruption)f(of)h(the)f
(compressed)g(data,)k(and)42 b(against)i(undetected)g(bugs)e(in)390
4096 y Fi(bzip2)33 b Fj(\(hop)s(efully)i(v)m(ery)g(unlik)m(ely\).)55
b(The)35 b(c)m(hances)h(of)f(data)g(corruption)g(going)h(unde-)390
4199 y(tected)e(is)f(microscopic,)h(ab)s(out)e(one)h(c)m(hance)g(in)g
(four)f(billion)g(for)h(eac)m(h)g(\014le)g(pro)s(cessed.)390
4303 y(Be)j(a)m(w)m(are,)k(though,)d(that)g(the)g(c)m(hec)m(k)h(o)s
(ccurs)e(up)s(on)f(decompression,)j(so)f(it)f(can)h(only)390
4407 y(tell)28 b(y)m(ou)e(that)h(something)g(is)g(wrong.)39
b(It)27 b(can't)g(help)f(y)m(ou)h(reco)m(v)m(er)i(the)d(original)i
(uncom-)390 4511 y(pressed)f(data.)40 b(Y)-8 b(ou)27
b(can)g(use)h Fi(bzip2recover)23 b Fj(to)29 b(try)e(to)i(reco)m(v)m(er)
g(data)f(from)f(damaged)390 4614 y(\014les.)390 4766
y(Return)42 b(v)-5 b(alues:)65 b(0)42 b(for)h(a)f(normal)g(exit,)47
b(1)c(for)f(en)m(vironmen)m(tal)i(problems)e(\(\014le)h(not)390
4869 y(found,)29 b(in)m(v)-5 b(alid)30 b(\015ags,)g(I/O)h(errors,)g
(&c\),)f(2)h(to)f(indicate)h(a)f(corrupt)g(compressed)g(\014le,)h(3)390
4973 y(for)f(an)g(in)m(ternal)i(consistency)f(error)g(\(eg,)h(bug\))e
(whic)m(h)g(caused)g Fi(bzip2)f Fj(to)i(panic.)390 5304
y Fe(OPTIONS)p eop
%%Page: 5 6
5 5 bop 150 -116 a Fl(Chapter)30 b(2:)41 b(Ho)m(w)31
b(to)g(use)f Fi(bzip2)2375 b Fl(5)390 299 y Fi(-c)30
b(--stdout)870 403 y Fj(Compress)g(or)g(decompress)h(to)g(standard)e
(output.)390 550 y Fi(-d)h(--decompress)870 653 y Fj(F)-8
b(orce)42 b(decompression.)72 b Fi(bzip2)p Fj(,)43 b
Fi(bunzip2)38 b Fj(and)i Fi(bzcat)g Fj(are)h(really)h(the)870
757 y(same)26 b(program,)i(and)d(the)h(decision)h(ab)s(out)f(what)g
(actions)h(to)g(tak)m(e)h(is)e(done)870 861 y(on)j(the)h(basis)f(of)g
(whic)m(h)h(name)f(is)g(used.)40 b(This)29 b(\015ag)g(o)m(v)m(errides)i
(that)f(mec)m(h-)870 965 y(anism,)g(and)g(forces)h(bzip2)f(to)h
(decompress.)390 1112 y Fi(-z)f(--compress)870 1215 y
Fj(The)37 b(complemen)m(t)h(to)g Fi(-d)p Fj(:)54 b(forces)37
b(compression,)j(regardless)d(of)h(the)f(in-)870 1319
y(v)m(ok)-5 b(ation)32 b(name.)390 1466 y Fi(-t)e(--test)66
b Fj(Chec)m(k)26 b(in)m(tegrit)m(y)i(of)e(the)g(sp)s(eci\014ed)f
(\014le\(s\),)i(but)e(don't)h(decompress)g(them.)870
1570 y(This)39 b(really)h(p)s(erforms)f(a)g(trial)h(decompression)g
(and)e(thro)m(ws)i(a)m(w)m(a)m(y)h(the)870 1674 y(result.)390
1821 y Fi(-f)30 b(--force)870 1924 y Fj(F)-8 b(orce)27
b(o)m(v)m(erwrite)h(of)e(output)g(\014les.)39 b(Normally)-8
b(,)28 b Fi(bzip2)c Fj(will)j(not)f(o)m(v)m(erwrite)870
2028 y(existing)i(output)e(\014les.)40 b(Also)27 b(forces)g
Fi(bzip2)f Fj(to)h(break)g(hard)f(links)g(to)i(\014les,)870
2132 y(whic)m(h)i(it)h(otherwise)g(w)m(ouldn't)g(do.)870
2257 y Fi(bzip2)h Fj(normally)h(declines)h(to)f(decompress)h(\014les)f
(whic)m(h)f(don't)i(ha)m(v)m(e)g(the)870 2361 y(correct)39
b(magic)g(header)e(b)m(ytes.)63 b(If)38 b(forced)g(\()p
Fi(-f)p Fj(\),)h(ho)m(w)m(ev)m(er,)i(it)e(will)f(pass)870
2465 y(suc)m(h)30 b(\014les)g(through)g(unmo)s(di\014ed.)39
b(This)30 b(is)h(ho)m(w)f(GNU)h Fi(gzip)e Fj(b)s(eha)m(v)m(es.)390
2612 y Fi(-k)h(--keep)66 b Fj(Keep)34 b(\(don't)g(delete\))h(input)d
(\014les)i(during)e(compression)i(or)f(decompres-)870
2716 y(sion.)390 2863 y Fi(-s)d(--small)870 2966 y Fj(Reduce)35
b(memory)g(usage,)i(for)e(compression,)i(decompression)e(and)f(test-)
870 3070 y(ing.)40 b(Files)29 b(are)f(decompressed)g(and)f(tested)i
(using)f(a)g(mo)s(di\014ed)f(algorithm)870 3174 y(whic)m(h)32
b(only)g(requires)h(2.5)g(b)m(ytes)g(p)s(er)f(blo)s(c)m(k)g(b)m(yte.)48
b(This)32 b(means)f(an)m(y)i(\014le)870 3278 y(can)d(b)s(e)f
(decompressed)g(in)h(2300k)h(of)f(memory)-8 b(,)31 b(alb)s(eit)f(at)g
(ab)s(out)f(half)h(the)870 3381 y(normal)g(sp)s(eed.)870
3507 y(During)35 b(compression,)j Fi(-s)d Fj(selects)j(a)e(blo)s(c)m(k)
h(size)f(of)h(200k,)h(whic)m(h)e(limits)870 3611 y(memory)43
b(use)f(to)h(around)e(the)i(same)f(\014gure,)k(at)d(the)f(exp)s(ense)g
(of)h(y)m(our)870 3714 y(compression)32 b(ratio.)47 b(In)31
b(short,)i(if)e(y)m(our)i(mac)m(hine)f(is)g(lo)m(w)g(on)g(memory)g(\(8)
870 3818 y(megab)m(ytes)39 b(or)e(less\),)j(use)d(-s)g(for)g(ev)m
(erything.)62 b(See)38 b(MEMOR)-8 b(Y)37 b(MAN-)870 3922
y(A)m(GEMENT)31 b(b)s(elo)m(w.)390 4069 y Fi(-q)f(--quiet)870
4173 y Fj(Suppress)h(non-essen)m(tial)j(w)m(arning)f(messages.)49
b(Messages)34 b(p)s(ertaining)f(to)870 4276 y(I/O)e(errors)g(and)e
(other)i(critical)i(ev)m(en)m(ts)f(will)e(not)h(b)s(e)f(suppressed.)390
4423 y Fi(-v)g(--verbose)870 4527 y Fj(V)-8 b(erb)s(ose)25
b(mo)s(de)f({)h(sho)m(w)f(the)h(compression)g(ratio)g(for)g(eac)m(h)g
(\014le)g(pro)s(cessed.)870 4631 y(F)-8 b(urther)27 b
Fi(-v)p Fj('s)g(increase)h(the)g(v)m(erb)s(osit)m(y)g(lev)m(el,)i(sp)s
(ewing)d(out)g(lots)h(of)g(infor-)870 4735 y(mation)j(whic)m(h)f(is)g
(primarily)h(of)f(in)m(terest)i(for)f(diagnostic)g(purp)s(oses.)390
4882 y Fi(-L)f(--license)e(-V)h(--version)870 4985 y
Fj(Displa)m(y)i(the)f(soft)m(w)m(are)i(v)m(ersion,)g(license)f(terms)g
(and)e(conditions.)390 5132 y Fi(-1)h(\(or)f(--fast\))g(to)g(-9)h(\(or)
g(--best\))870 5236 y Fj(Set)h(the)g(blo)s(c)m(k)g(size)g(to)h(100)g
(k,)e(200)i(k)f(..)41 b(900)32 b(k)f(when)e(compressing.)42
b(Has)870 5340 y(no)37 b(e\013ect)i(when)d(decompressing.)62
b(See)37 b(MEMOR)-8 b(Y)38 b(MANA)m(GEMENT)p eop
%%Page: 6 7
6 6 bop 150 -116 a Fl(Chapter)30 b(2:)41 b(Ho)m(w)31
b(to)g(use)f Fi(bzip2)2375 b Fl(6)870 299 y Fj(b)s(elo)m(w.)83
b(The)44 b Fi(--fast)f Fj(and)g Fi(--best)g Fj(aliases)i(are)g
(primarily)f(for)g(GNU)870 403 y Fi(gzip)27 b Fj(compatibilit)m(y)-8
b(.)43 b(In)28 b(particular,)i Fi(--fast)d Fj(do)s(esn't)h(mak)m(e)i
(things)e(sig-)870 506 y(ni\014can)m(tly)d(faster.)40
b(And)23 b Fi(--best)g Fj(merely)i(selects)h(the)f(default)g(b)s(eha)m
(viour.)390 674 y Fi(--)384 b Fj(T)-8 b(reats)38 b(all)f(subsequen)m(t)
f(argumen)m(ts)g(as)h(\014le)f(names,)i(ev)m(en)f(if)f(they)h(start)870
778 y(with)31 b(a)h(dash.)42 b(This)31 b(is)h(so)f(y)m(ou)h(can)f
(handle)g(\014les)g(with)h(names)f(b)s(eginning)870 881
y(with)f(a)h(dash,)e(for)i(example:)41 b Fi(bzip2)29
b(--)h(-myfilename)p Fj(.)390 1049 y Fi(--repetitive-fast)390
1185 y(--repetitive-best)870 1288 y Fj(These)j(\015ags)g(are)g
(redundan)m(t)f(in)h(v)m(ersions)g(0.9.5)i(and)d(ab)s(o)m(v)m(e.)49
b(They)33 b(pro-)870 1392 y(vided)g(some)h(coarse)h(con)m(trol)g(o)m(v)
m(er)g(the)f(b)s(eha)m(viour)f(of)h(the)g(sorting)g(algo-)870
1496 y(rithm)j(in)g(earlier)h(v)m(ersions,)i(whic)m(h)d(w)m(as)g
(sometimes)h(useful.)61 b(0.9.5)39 b(and)870 1600 y(ab)s(o)m(v)m(e)31
b(ha)m(v)m(e)f(an)g(impro)m(v)m(ed)g(algorithm)h(whic)m(h)e(renders)g
(these)h(\015ags)g(irrel-)870 1704 y(ev)-5 b(an)m(t.)390
1964 y Fe(MEMOR)-10 b(Y)40 b(MANA)m(GEMENT)390 2151 y
Fi(bzip2)23 b Fj(compresses)i(large)h(\014les)e(in)g(blo)s(c)m(ks.)40
b(The)24 b(blo)s(c)m(k)h(size)h(a\013ects)g(b)s(oth)e(the)g(compres-)
390 2255 y(sion)38 b(ratio)g(ac)m(hiev)m(ed,)k(and)36
b(the)i(amoun)m(t)g(of)g(memory)g(needed)f(for)h(compression)g(and)390
2358 y(decompression.)57 b(The)35 b(\015ags)h Fi(-1)f
Fj(through)g Fi(-9)g Fj(sp)s(ecify)g(the)h(blo)s(c)m(k)g(size)h(to)f(b)
s(e)f(100,000)390 2462 y(b)m(ytes)25 b(through)f(900,000)j(b)m(ytes)e
(\(the)h(default\))e(resp)s(ectiv)m(ely)-8 b(.)41 b(A)m(t)25
b(decompression)g(time,)390 2566 y(the)k(blo)s(c)m(k)h(size)g(used)f
(for)g(compression)g(is)g(read)h(from)f(the)g(header)g(of)g(the)h
(compressed)390 2670 y(\014le,)j(and)f Fi(bunzip2)f Fj(then)h(allo)s
(cates)i(itself)g(just)e(enough)g(memory)h(to)g(decompress)g(the)390
2773 y(\014le.)40 b(Since)27 b(blo)s(c)m(k)h(sizes)h(are)f(stored)g(in)
f(compressed)g(\014les,)h(it)h(follo)m(ws)f(that)g(the)g(\015ags)g
Fi(-1)390 2877 y Fj(to)j Fi(-9)f Fj(are)h(irrelev)-5
b(an)m(t)32 b(to)f(and)f(so)g(ignored)h(during)e(decompression.)390
3028 y(Compression)h(and)f(decompression)i(requiremen)m(ts,)g(in)f(b)m
(ytes,)i(can)e(b)s(e)g(estimated)i(as:)869 3179 y Fi(Compression:)140
b(400k)46 b(+)i(\()f(8)h(x)f(block)f(size)h(\))869 3387
y(Decompression:)d(100k)i(+)i(\()f(4)h(x)f(block)f(size)h(\),)g(or)1585
3491 y(100k)f(+)i(\()f(2.5)g(x)g(block)g(size)f(\))390
3642 y Fj(Larger)27 b(blo)s(c)m(k)f(sizes)h(giv)m(e)h(rapidly)e
(diminishing)f(marginal)i(returns.)39 b(Most)27 b(of)f(the)h(com-)390
3745 y(pression)e(comes)i(from)f(the)g(\014rst)f(t)m(w)m(o)i(or)f
(three)h(h)m(undred)d(k)h(of)h(blo)s(c)m(k)g(size,)i(a)e(fact)h(w)m
(orth)390 3849 y(b)s(earing)32 b(in)g(mind)f(when)g(using)h
Fi(bzip2)f Fj(on)h(small)g(mac)m(hines.)47 b(It)32 b(is)h(also)f(imp)s
(ortan)m(t)h(to)390 3953 y(appreciate)f(that)g(the)f(decompression)g
(memory)g(requiremen)m(t)h(is)f(set)g(at)h(compression)390
4057 y(time)f(b)m(y)f(the)h(c)m(hoice)h(of)f(blo)s(c)m(k)g(size.)390
4208 y(F)-8 b(or)43 b(\014les)f(compressed)h(with)f(the)g(default)h
(900k)g(blo)s(c)m(k)g(size,)k Fi(bunzip2)40 b Fj(will)j(require)390
4311 y(ab)s(out)28 b(3700)i(kb)m(ytes)f(to)h(decompress.)40
b(T)-8 b(o)29 b(supp)s(ort)e(decompression)i(of)g(an)m(y)f(\014le)h(on)
f(a)h(4)390 4415 y(megab)m(yte)h(mac)m(hine,)g Fi(bunzip2)c
Fj(has)i(an)h(option)g(to)g(decompress)g(using)f(appro)m(ximately)390
4519 y(half)33 b(this)g(amoun)m(t)h(of)f(memory)-8 b(,)35
b(ab)s(out)d(2300)j(kb)m(ytes.)50 b(Decompression)34
b(sp)s(eed)e(is)h(also)390 4623 y(halv)m(ed,)h(so)f(y)m(ou)g(should)e
(use)i(this)f(option)h(only)g(where)g(necessary)-8 b(.)48
b(The)33 b(relev)-5 b(an)m(t)34 b(\015ag)390 4727 y(is)c
Fi(-s)p Fj(.)390 4878 y(In)i(general,)i(try)f(and)e(use)h(the)h
(largest)h(blo)s(c)m(k)f(size)g(memory)g(constrain)m(ts)g(allo)m(w,)i
(since)390 4981 y(that)43 b(maximises)g(the)g(compression)f(ac)m(hiev)m
(ed.)79 b(Compression)42 b(and)g(decompression)390 5085
y(sp)s(eed)30 b(are)g(virtually)h(una\013ected)g(b)m(y)f(blo)s(c)m(k)h
(size.)390 5236 y(Another)24 b(signi\014can)m(t)i(p)s(oin)m(t)e
(applies)g(to)i(\014les)e(whic)m(h)g(\014t)h(in)f(a)g(single)h(blo)s(c)
m(k)g({)g(that)g(means)390 5340 y(most)g(\014les)f(y)m(ou'd)h(encoun)m
(ter)g(using)f(a)g(large)i(blo)s(c)m(k)f(size.)39 b(The)25
b(amoun)m(t)f(of)h(real)g(memory)p eop
%%Page: 7 8
7 7 bop 150 -116 a Fl(Chapter)30 b(2:)41 b(Ho)m(w)31
b(to)g(use)f Fi(bzip2)2375 b Fl(7)390 299 y Fj(touc)m(hed)36
b(is)g(prop)s(ortional)g(to)g(the)g(size)h(of)f(the)g(\014le,)h(since)f
(the)g(\014le)g(is)f(smaller)i(than)e(a)390 403 y(blo)s(c)m(k.)48
b(F)-8 b(or)33 b(example,)h(compressing)f(a)g(\014le)f(20,000)j(b)m
(ytes)f(long)f(with)f(the)h(\015ag)g Fi(-9)f Fj(will)390
506 y(cause)26 b(the)g(compressor)f(to)i(allo)s(cate)g(around)e(7600k)i
(of)f(memory)-8 b(,)27 b(but)e(only)g(touc)m(h)i(400k)390
610 y Fi(+)h Fj(20000)i(*)f(8)g(=)f(560)h(kb)m(ytes)g(of)g(it.)40
b(Similarly)-8 b(,)30 b(the)f(decompressor)f(will)h(allo)s(cate)h
(3700k)390 714 y(but)g(only)g(touc)m(h)h(100k)h Fi(+)e
Fj(20000)j(*)d(4)h(=)f(180)i(kb)m(ytes.)390 865 y(Here)39
b(is)f(a)g(table)h(whic)m(h)f(summarises)f(the)i(maxim)m(um)e(memory)h
(usage)h(for)f(di\013eren)m(t)390 969 y(blo)s(c)m(k)c(sizes.)50
b(Also)33 b(recorded)g(is)h(the)f(total)i(compressed)e(size)h(for)g(14)
g(\014les)f(of)g(the)h(Cal-)390 1073 y(gary)39 b(T)-8
b(ext)39 b(Compression)f(Corpus)g(totalling)i(3,141,622)i(b)m(ytes.)65
b(This)38 b(column)h(giv)m(es)390 1176 y(some)g(feel)f(for)h(ho)m(w)f
(compression)g(v)-5 b(aries)39 b(with)f(blo)s(c)m(k)g(size.)65
b(These)38 b(\014gures)g(tend)g(to)390 1280 y(understate)28
b(the)g(adv)-5 b(an)m(tage)29 b(of)f(larger)h(blo)s(c)m(k)g(sizes)f
(for)g(larger)h(\014les,)g(since)f(the)g(Corpus)390 1384
y(is)i(dominated)h(b)m(y)f(smaller)h(\014les.)1107 1535
y Fi(Compress)141 b(Decompress)g(Decompress)f(Corpus)773
1639 y(Flag)238 b(usage)285 b(usage)332 b(-s)48 b(usage)237
b(Size)821 1846 y(-1)286 b(1200k)332 b(500k)429 b(350k)285
b(914704)821 1950 y(-2)h(2000k)332 b(900k)429 b(600k)285
b(877703)821 2054 y(-3)h(2800k)f(1300k)428 b(850k)285
b(860338)821 2158 y(-4)h(3600k)f(1700k)380 b(1100k)285
b(846899)821 2261 y(-5)h(4400k)f(2100k)380 b(1350k)285
b(845160)821 2365 y(-6)h(5200k)f(2500k)380 b(1600k)285
b(838626)821 2469 y(-7)h(6100k)f(2900k)380 b(1850k)285
b(834096)821 2573 y(-8)h(6800k)f(3300k)380 b(2100k)285
b(828642)821 2676 y(-9)h(7600k)f(3700k)380 b(2350k)285
b(828642)390 2992 y Fe(RECO)m(VERING)38 b(D)m(A)-10 b(T)g(A)40
b(FR)m(OM)h(D)m(AMA)m(GED)f(FILES)390 3179 y Fi(bzip2)24
b Fj(compresses)i(\014les)g(in)f(blo)s(c)m(ks,)i(usually)e(900kb)m
(ytes)j(long.)40 b(Eac)m(h)25 b(blo)s(c)m(k)h(is)g(handled)390
3283 y(indep)s(enden)m(tly)-8 b(.)42 b(If)31 b(a)g(media)g(or)h
(transmission)f(error)g(causes)g(a)g(m)m(ulti-blo)s(c)m(k)i
Fi(.bz2)d Fj(\014le)390 3387 y(to)35 b(b)s(ecome)f(damaged,)i(it)e(ma)m
(y)h(b)s(e)e(p)s(ossible)h(to)h(reco)m(v)m(er)h(data)f(from)f(the)g
(undamaged)390 3491 y(blo)s(c)m(ks)d(in)f(the)h(\014le.)390
3642 y(The)g(compressed)g(represen)m(tation)i(of)f(eac)m(h)g(blo)s(c)m
(k)g(is)f(delimited)h(b)m(y)f(a)h(48-bit)g(pattern,)390
3745 y(whic)m(h)27 b(mak)m(es)g(it)h(p)s(ossible)e(to)i(\014nd)d(the)j
(blo)s(c)m(k)f(b)s(oundaries)e(with)i(reasonable)h(certain)m(t)m(y)-8
b(.)390 3849 y(Eac)m(h)33 b(blo)s(c)m(k)g(also)h(carries)g(its)f(o)m
(wn)g(32-bit)h(CR)m(C,)f(so)g(damaged)g(blo)s(c)m(ks)h(can)f(b)s(e)f
(distin-)390 3953 y(guished)e(from)g(undamaged)f(ones.)390
4104 y Fi(bzip2recover)36 b Fj(is)j(a)g(simple)f(program)h(whose)g
(purp)s(ose)f(is)h(to)g(searc)m(h)h(for)f(blo)s(c)m(ks)g(in)390
4208 y Fi(.bz2)33 b Fj(\014les,)j(and)e(write)h(eac)m(h)h(blo)s(c)m(k)f
(out)g(in)m(to)g(its)g(o)m(wn)g Fi(.bz2)e Fj(\014le.)54
b(Y)-8 b(ou)34 b(can)h(then)f(use)390 4311 y Fi(bzip2)29
b(-t)23 b Fj(to)h(test)h(the)f(in)m(tegrit)m(y)i(of)d(the)h(resulting)g
(\014les,)h(and)e(decompress)g(those)h(whic)m(h)390 4415
y(are)31 b(undamaged.)390 4566 y Fi(bzip2recover)40 b
Fj(tak)m(es)45 b(a)f(single)g(argumen)m(t,)j(the)d(name)g(of)f(the)h
(damaged)g(\014le,)j(and)390 4670 y(writes)33 b(a)f(n)m(um)m(b)s(er)f
(of)h(\014les)h Fi(rec00001file.bz2)p Fj(,)28 b Fi(rec00002file.bz2)p
Fj(,)g(etc,)34 b(con)m(tain-)390 4774 y(ing)29 b(the)g(extracted)i(blo)
s(c)m(ks.)40 b(The)29 b(output)g(\014lenames)g(are)g(designed)g(so)g
(that)g(the)g(use)g(of)390 4878 y(wildcards)h(in)f(subsequen)m(t)h(pro)
s(cessing)g({)h(for)f(example,)h Fi(bzip2)e(-dc)g(rec*file.bz2)e(>)390
4981 y(recovered_data)f Fj({)31 b(pro)s(cesses)g(the)f(\014les)h(in)f
(the)h(correct)h(order.)390 5132 y Fi(bzip2recover)37
b Fj(should)i(b)s(e)h(of)h(most)f(use)g(dealing)h(with)f(large)i
Fi(.bz2)d Fj(\014les,)k(as)d(these)390 5236 y(will)31
b(con)m(tain)i(man)m(y)e(blo)s(c)m(ks.)43 b(It)32 b(is)f(clearly)h
(futile)g(to)g(use)f(it)g(on)g(damaged)g(single-blo)s(c)m(k)390
5340 y(\014les,)g(since)g(a)g(damaged)f(blo)s(c)m(k)h(cannot)h(b)s(e)e
(reco)m(v)m(ered.)43 b(If)31 b(y)m(ou)g(wish)f(to)h(minimise)g(an)m(y)p
eop
%%Page: 8 9
8 8 bop 150 -116 a Fl(Chapter)30 b(2:)41 b(Ho)m(w)31
b(to)g(use)f Fi(bzip2)2375 b Fl(8)390 299 y Fj(p)s(oten)m(tial)36
b(data)f(loss)f(through)g(media)h(or)g(transmission)f(errors,)i(y)m(ou)
e(migh)m(t)i(consider)390 403 y(compressing)31 b(with)f(a)g(smaller)h
(blo)s(c)m(k)g(size.)390 711 y Fe(PERF)m(ORMANCE)39 b(NOTES)390
897 y Fj(The)c(sorting)i(phase)e(of)g(compression)h(gathers)g(together)
i(similar)e(strings)g(in)f(the)h(\014le.)390 1001 y(Because)51
b(of)g(this,)57 b(\014les)51 b(con)m(taining)h(v)m(ery)f(long)h(runs)d
(of)j(rep)s(eated)f(sym)m(b)s(ols,)56 b(lik)m(e)390 1105
y Fi(")p Fj(aabaabaabaab)c(...)p Fi(")h Fj(\(rep)s(eated)g(sev)m(eral)h
(h)m(undred)c(times\))k(ma)m(y)f(compress)f(more)390
1209 y(slo)m(wly)33 b(than)f(normal.)45 b(V)-8 b(ersions)33
b(0.9.5)g(and)e(ab)s(o)m(v)m(e)i(fare)g(m)m(uc)m(h)f(b)s(etter)g(than)g
(previous)390 1312 y(v)m(ersions)54 b(in)g(this)g(resp)s(ect.)111
b(The)54 b(ratio)h(b)s(et)m(w)m(een)g(w)m(orst-case)g(and)e(a)m(v)m
(erage-case)390 1416 y(compression)39 b(time)g(is)g(in)f(the)h(region)h
(of)e(10:1.)67 b(F)-8 b(or)40 b(previous)e(v)m(ersions,)k(this)c
(\014gure)390 1520 y(w)m(as)j(more)g(lik)m(e)g(100:1.)74
b(Y)-8 b(ou)40 b(can)h(use)f(the)h Fi(-vvvv)e Fj(option)i(to)g(monitor)
g(progress)g(in)390 1624 y(great)32 b(detail,)f(if)g(y)m(ou)f(w)m(an)m
(t.)390 1775 y(Decompression)h(sp)s(eed)e(is)i(una\013ected)g(b)m(y)f
(these)h(phenomena.)390 1926 y Fi(bzip2)g Fj(usually)i(allo)s(cates)i
(sev)m(eral)f(megab)m(ytes)g(of)f(memory)g(to)h(op)s(erate)g(in,)f(and)
f(then)390 2030 y(c)m(harges)37 b(all)f(o)m(v)m(er)h(it)f(in)f(a)h
(fairly)g(random)f(fashion.)55 b(This)36 b(means)f(that)h(p)s
(erformance,)390 2133 y(b)s(oth)f(for)g(compressing)h(and)e
(decompressing,)j(is)f(largely)g(determined)g(b)m(y)f(the)h(sp)s(eed)
390 2237 y(at)27 b(whic)m(h)e(y)m(our)h(mac)m(hine)h(can)f(service)h
(cac)m(he)g(misses.)39 b(Because)27 b(of)f(this,)h(small)f(c)m(hanges)
390 2341 y(to)31 b(the)f(co)s(de)h(to)g(reduce)f(the)h(miss)e(rate)i
(ha)m(v)m(e)g(b)s(een)f(observ)m(ed)h(to)g(giv)m(e)g(disprop)s(ortion-)
390 2445 y(ately)i(large)h(p)s(erformance)e(impro)m(v)m(emen)m(ts.)47
b(I)33 b(imagine)g Fi(bzip2)d Fj(will)j(p)s(erform)e(b)s(est)h(on)390
2548 y(mac)m(hines)f(with)f(v)m(ery)h(large)g(cac)m(hes.)390
2856 y Fe(CA)-14 b(VEA)k(TS)390 3043 y Fj(I/O)45 b(error)f(messages)h
(are)f(not)h(as)f(helpful)f(as)h(they)g(could)g(b)s(e.)81
b Fi(bzip2)43 b Fj(tries)i(hard)390 3147 y(to)37 b(detect)g(I/O)f
(errors)h(and)d(exit)j(cleanly)-8 b(,)39 b(but)c(the)h(details)h(of)f
(what)f(the)h(problem)g(is)390 3251 y(sometimes)c(seem)e(rather)h
(misleading.)390 3402 y(This)c(man)m(ual)f(page)i(p)s(ertains)e(to)i(v)
m(ersion)g(1.0.2)h(of)e Fi(bzip2)p Fj(.)38 b(Compressed)26
b(data)i(created)390 3505 y(b)m(y)22 b(this)h(v)m(ersion)g(is)f(en)m
(tirely)i(forw)m(ards)f(and)e(bac)m(kw)m(ards)i(compatible)g(with)f
(the)h(previous)390 3609 y(public)g(releases,)k(v)m(ersions)d(0.1pl2,)i
(0.9.0,)h(0.9.5,)g(1.0.0)f(and)d(1.0.1,)k(but)c(with)g(the)h(follo)m
(w-)390 3713 y(ing)h(exception:)39 b(0.9.0)27 b(and)c(ab)s(o)m(v)m(e)j
(can)f(correctly)i(decompress)d(m)m(ultiple)i(concatenated)390
3817 y(compressed)36 b(\014les.)59 b(0.1pl2)37 b(cannot)g(do)f(this;)k
(it)d(will)f(stop)h(after)g(decompressing)f(just)390
3921 y(the)31 b(\014rst)f(\014le)g(in)g(the)h(stream.)390
4072 y Fi(bzip2recover)19 b Fj(v)m(ersions)j(prior)g(to)h(this)f(one,)i
(1.0.2,)h(used)c(32-bit)j(in)m(tegers)f(to)g(represen)m(t)390
4175 y(bit)32 b(p)s(ositions)g(in)f(compressed)h(\014les,)g(so)g(it)g
(could)g(not)g(handle)f(compressed)h(\014les)f(more)390
4279 y(than)39 b(512)h(megab)m(ytes)h(long.)68 b(V)-8
b(ersion)39 b(1.0.2)i(and)d(ab)s(o)m(v)m(e)j(uses)d(64-bit)j(in)m(ts)e
(on)h(some)390 4383 y(platforms)e(whic)m(h)g(supp)s(ort)f(them)i(\(GNU)
g(supp)s(orted)e(targets,)42 b(and)c(Windo)m(ws\).)64
b(T)-8 b(o)390 4487 y(establish)27 b(whether)g(or)f(not)i
Fi(bzip2recover)23 b Fj(w)m(as)k(built)f(with)h(suc)m(h)f(a)h
(limitation,)j(run)25 b(it)390 4591 y(without)33 b(argumen)m(ts.)50
b(In)33 b(an)m(y)g(ev)m(en)m(t)i(y)m(ou)e(can)h(build)e(y)m(ourself)h
(an)g(unlimited)g(v)m(ersion)390 4694 y(if)28 b(y)m(ou)h(can)g
(recompile)h(it)f(with)f Fi(MaybeUInt64)e Fj(set)j(to)g(b)s(e)f(an)g
(unsigned)g(64-bit)i(in)m(teger.)390 5002 y Fe(A)m(UTHOR)390
5189 y Fj(Julian)g(Sew)m(ard,)g Fi(jseward@acm.org)p
Fj(.)390 5340 y Fi(http://sources.redhat.co)o(m/bz)o(ip2)p
eop
%%Page: 9 10
9 9 bop 150 -116 a Fl(Chapter)30 b(2:)41 b(Ho)m(w)31
b(to)g(use)f Fi(bzip2)2375 b Fl(9)390 299 y Fj(The)22
b(ideas)h(em)m(b)s(o)s(died)f(in)g Fi(bzip2)f Fj(are)i(due)e(to)j(\(at)
f(least\))h(the)f(follo)m(wing)g(p)s(eople:)37 b(Mic)m(hael)390
403 y(Burro)m(ws)45 b(and)g(Da)m(vid)h(Wheeler)g(\(for)g(the)g(blo)s(c)
m(k)h(sorting)f(transformation\),)51 b(Da)m(vid)390 506
y(Wheeler)42 b(\(again,)j(for)c(the)h(Hu\013man)e(co)s(der\),)45
b(P)m(eter)e(F)-8 b(en)m(wic)m(k)43 b(\(for)e(the)h(structured)390
610 y(co)s(ding)34 b(mo)s(del)h(in)f(the)g(original)i
Fi(bzip)p Fj(,)e(and)g(man)m(y)g(re\014nemen)m(ts\),)i(and)e(Alistair)h
(Mof-)390 714 y(fat,)45 b(Radford)d(Neal)g(and)f(Ian)h(Witten)h(\(for)f
(the)h(arithmetic)g(co)s(der)f(in)g(the)g(original)390
818 y Fi(bzip)p Fj(\).)d(I)26 b(am)h(m)m(uc)m(h)g(indebted)f(for)h
(their)g(help,)g(supp)s(ort)e(and)h(advice.)40 b(See)27
b(the)g(man)m(ual)390 922 y(in)k(the)h(source)f(distribution)h(for)f(p)
s(oin)m(ters)h(to)g(sources)f(of)h(do)s(cumen)m(tation.)44
b(Christian)390 1025 y(v)m(on)27 b(Ro)s(ques)f(encouraged)g(me)h(to)g
(lo)s(ok)g(for)f(faster)h(sorting)g(algorithms,)h(so)e(as)h(to)g(sp)s
(eed)390 1129 y(up)32 b(compression.)50 b(Bela)34 b(Lubkin)d
(encouraged)j(me)g(to)g(impro)m(v)m(e)g(the)g(w)m(orst-case)h(com-)390
1233 y(pression)e(p)s(erformance.)51 b(The)34 b Fi(bz*)f
Fj(scripts)h(are)g(deriv)m(ed)g(from)g(those)g(of)g(GNU)h
Fi(gzip)p Fj(.)390 1337 y(Man)m(y)40 b(p)s(eople)f(sen)m(t)h(patc)m
(hes,)i(help)s(ed)c(with)h(p)s(ortabilit)m(y)i(problems,)g(len)m(t)f
(mac)m(hines,)390 1440 y(ga)m(v)m(e)32 b(advice)f(and)f(w)m(ere)h
(generally)h(helpful.)p eop
%%Page: 10 11
10 10 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
b(with)g Fi(libbzip2)1881 b Fl(10)150 299 y Fg(3)80 b(Programming)53
b(with)h Ff(libbzip2)150 568 y Fj(This)30 b(c)m(hapter)h(describ)s(es)f
(the)h(programming)f(in)m(terface)i(to)g Fi(libbzip2)p
Fj(.)150 725 y(F)-8 b(or)33 b(general)g(bac)m(kground)f(information,)h
(particularly)f(ab)s(out)g(memory)g(use)g(and)f(p)s(erformance)h(as-)
150 834 y(p)s(ects,)f(y)m(ou'd)f(b)s(e)g(w)m(ell)h(advised)f(to)i(read)
e(Chapter)g(2)h(as)f(w)m(ell.)150 1124 y Fk(3.1)68 b(T)-11
b(op-lev)l(el)46 b(structure)150 1316 y Fi(libbzip2)32
b Fj(is)i(a)g(\015exible)h(library)f(for)g(compressing)g(and)g
(decompressing)g(data)h(in)e(the)i Fi(bzip2)e Fj(data)150
1426 y(format.)38 b(Although)22 b(pac)m(k)-5 b(aged)24
b(as)e(a)g(single)h(en)m(tit)m(y)-8 b(,)26 b(it)d(helps)f(to)h(regard)f
(the)h(library)f(as)g(three)h(separate)150 1535 y(parts:)41
b(the)30 b(lo)m(w)h(lev)m(el)i(in)m(terface,)f(and)d(the)i(high)f(lev)m
(el)i(in)m(terface,)h(and)c(some)i(utilit)m(y)h(functions.)150
1692 y(The)37 b(structure)g(of)g Fi(libbzip2)p Fj('s)e(in)m(terfaces)j
(is)f(similar)g(to)h(that)f(of)g(Jean-loup)g(Gailly's)i(and)d(Mark)150
1802 y(Adler's)30 b(excellen)m(t)j Fi(zlib)c Fj(library)-8
b(.)150 1959 y(All)29 b(externally)h(visible)g(sym)m(b)s(ols)e(ha)m(v)m
(e)i(names)f(b)s(eginning)f Fi(BZ2_)p Fj(.)39 b(This)29
b(is)g(new)f(in)h(v)m(ersion)h(1.0.)41 b(The)150 2068
y(in)m(ten)m(tion)32 b(is)f(to)g(minimise)f(p)s(ollution)h(of)f(the)h
(namespaces)f(of)h(library)f(clien)m(ts.)150 2321 y Fe(3.1.1)63
b(Lo)m(w-lev)m(el)39 b(summary)150 2514 y Fj(This)52
b(in)m(terface)i(pro)m(vides)e(services)h(for)f(compressing)g(and)g
(decompressing)g(data)g(in)g(memory)-8 b(.)150 2623 y(There's)42
b(no)g(pro)m(vision)g(for)g(dealing)g(with)f(\014les,)k(streams)d(or)g
(an)m(y)g(other)g(I/O)h(mec)m(hanisms,)h(just)150 2733
y(straigh)m(t)51 b(memory-to-memory)g(w)m(ork.)98 b(In)48
b(fact,)55 b(this)49 b(part)h(of)f(the)h(library)f(can)g(b)s(e)f
(compiled)150 2843 y(without)31 b(inclusion)f(of)g Fi(stdio.h)p
Fj(,)f(whic)m(h)h(ma)m(y)h(b)s(e)f(helpful)f(for)i(em)m(b)s(edded)e
(applications.)150 2999 y(The)h(lo)m(w-lev)m(el)k(part)c(of)h(the)f
(library)g(has)g(no)h(global)g(v)-5 b(ariables)31 b(and)e(is)i
(therefore)g(thread-safe.)150 3156 y(Six)26 b(routines)h(mak)m(e)h(up)e
(the)h(lo)m(w)g(lev)m(el)i(in)m(terface:)41 b Fi(BZ2_bzCompressInit)p
Fj(,)22 b Fi(BZ2_bzCompress)p Fj(,)i(and)150 3266 y Fi
(BZ2_bzCompressEnd)i Fj(for)k(compression,)h(and)f(a)g(corresp)s
(onding)g(trio)h Fi(BZ2_bzDecompressInit)p Fj(,)150 3375
y Fi(BZ2_bzDecompress)36 b Fj(and)j Fi(BZ2_bzDecompressEnd)c
Fj(for)41 b(decompression.)70 b(The)40 b Fi(*Init)f Fj(functions)150
3485 y(allo)s(cate)k(memory)e(for)g(compression/decompression)h(and)e
(do)h(other)h(initialisations,)k(whilst)41 b(the)150
3595 y Fi(*End)29 b Fj(functions)h(close)i(do)m(wn)e(op)s(erations)h
(and)e(release)j(memory)-8 b(.)150 3751 y(The)35 b(real)h(w)m(ork)f(is)
g(done)g(b)m(y)g Fi(BZ2_bzCompress)d Fj(and)i Fi(BZ2_bzDecompress)p
Fj(.)50 b(These)36 b(compress)f(and)150 3861 y(decompress)28
b(data)g(from)f(a)h(user-supplied)e(input)h(bu\013er)g(to)h(a)g
(user-supplied)e(output)i(bu\013er.)39 b(These)150 3971
y(bu\013ers)31 b(can)g(b)s(e)g(an)m(y)h(size;)h(arbitrary)f(quan)m
(tities)h(of)f(data)g(are)g(handled)e(b)m(y)i(making)f(rep)s(eated)h
(calls)150 4080 y(to)g(these)g(functions.)43 b(This)31
b(is)g(a)h(\015exible)f(mec)m(hanism)h(allo)m(wing)g(a)g(consumer-pull)
f(st)m(yle)h(of)g(activit)m(y)-8 b(,)150 4190 y(or)31
b(pro)s(ducer-push,)d(or)j(a)f(mixture)h(of)f(b)s(oth.)150
4443 y Fe(3.1.2)63 b(High-lev)m(el)41 b(summary)150 4635
y Fj(This)c(in)m(terface)i(pro)m(vides)e(some)h(handy)e(wrapp)s(ers)f
(around)i(the)g(lo)m(w-lev)m(el)j(in)m(terface)f(to)f(facilitate)150
4745 y(reading)25 b(and)f(writing)h Fi(bzip2)f Fj(format)h(\014les)g
(\()p Fi(.bz2)f Fj(\014les\).)39 b(The)25 b(routines)h(pro)m(vide)f(ho)
s(oks)g(to)g(facilitate)150 4854 y(reading)42 b(\014les)f(in)g(whic)m
(h)h(the)g Fi(bzip2)e Fj(data)i(stream)g(is)f(em)m(b)s(edded)g(within)g
(some)h(larger-scale)i(\014le)150 4964 y(structure,)31
b(or)g(where)f(there)h(are)g(m)m(ultiple)g Fi(bzip2)e
Fj(data)h(streams)h(concatenated)i(end-to-end.)150 5121
y(F)-8 b(or)31 b(reading)g(\014les,)f Fi(BZ2_bzReadOpen)p
Fj(,)d Fi(BZ2_bzRead)p Fj(,)h Fi(BZ2_bzReadClose)e Fj(and)150
5230 y Fi(BZ2_bzReadGetUnused)18 b Fj(are)23 b(supplied.)37
b(F)-8 b(or)24 b(writing)f(\014les,)i Fi(BZ2_bzWriteOpen)p
Fj(,)20 b Fi(BZ2_bzWrite)g Fj(and)150 5340 y Fi(BZ2_bzWriteFinish)26
b Fj(are)k(a)m(v)-5 b(ailable.)p eop
%%Page: 11 12
11 11 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
b(with)g Fi(libbzip2)1881 b Fl(11)150 299 y Fj(As)32
b(with)h(the)g(lo)m(w-lev)m(el)j(library)-8 b(,)33 b(no)g(global)h(v)-5
b(ariables)33 b(are)g(used)f(so)h(the)g(library)g(is)g(p)s(er)f(se)h
(thread-)150 408 y(safe.)62 b(Ho)m(w)m(ev)m(er,)41 b(if)c(I/O)h(errors)
g(o)s(ccur)f(whilst)g(reading)h(or)f(writing)h(the)f(underlying)g
(compressed)150 518 y(\014les,)j(y)m(ou)e(ma)m(y)h(ha)m(v)m(e)f(to)h
(consult)g Fi(errno)d Fj(to)j(determine)f(the)h(cause)f(of)g(the)g
(error.)64 b(In)37 b(that)i(case,)150 628 y(y)m(ou'd)30
b(need)h(a)f(C)g(library)g(whic)m(h)g(correctly)j(supp)s(orts)c
Fi(errno)g Fj(in)h(a)g(m)m(ultithreaded)h(en)m(vironmen)m(t.)150
784 y(T)-8 b(o)77 b(mak)m(e)f(the)g(library)g(a)f(little)j(simpler)e
(and)e(more)j(p)s(ortable,)87 b Fi(BZ2_bzReadOpen)72
b Fj(and)150 894 y Fi(BZ2_bzWriteOpen)34 b Fj(require)39
b(y)m(ou)g(to)g(pass)f(them)h(\014le)f(handles)g(\()p
Fi(FILE*)p Fj(s\))f(whic)m(h)h(ha)m(v)m(e)i(previously)150
1004 y(b)s(een)56 b(op)s(ened)g(for)h(reading)f(or)h(writing)g(resp)s
(ectiv)m(ely)-8 b(.)122 b(That)57 b(a)m(v)m(oids)h(p)s(ortabilit)m(y)f
(problems)150 1113 y(asso)s(ciated)33 b(with)g(\014le)f(op)s(erations)h
(and)e(\014le)i(attributes,)h(whilst)e(not)h(b)s(eing)f(m)m(uc)m(h)g
(of)h(an)f(imp)s(osition)150 1223 y(on)e(the)h(programmer.)150
1474 y Fe(3.1.3)63 b(Utilit)m(y)40 b(functions)h(summary)150
1666 y Fj(F)-8 b(or)43 b(v)m(ery)h(simple)e(needs,)k
Fi(BZ2_bzBuffToBuffCompres)o(s)36 b Fj(and)42 b Fi
(BZ2_bzBuffToBuffDecompres)o(s)150 1776 y Fj(are)26 b(pro)m(vided.)39
b(These)26 b(compress)f(data)h(in)f(memory)h(from)f(one)h(bu\013er)f
(to)h(another)g(bu\013er)f(in)g(a)g(single)150 1885 y(function)37
b(call.)62 b(Y)-8 b(ou)38 b(should)e(assess)h(whether)g(these)h
(functions)f(ful\014ll)f(y)m(our)i(memory-to-memory)150
1995 y(compression/decompression)22 b(requiremen)m(ts)g(b)s(efore)f(in)
m(v)m(esting)i(e\013ort)f(in)f(understanding)f(the)h(more)150
2105 y(general)31 b(but)f(more)h(complex)g(lo)m(w-lev)m(el)i(in)m
(terface.)150 2261 y(Y)-8 b(oshiok)j(a)47 b(Tsuneo)g(\()p
Fi(QWF00133@niftyserve.or.jp)40 b Fj(/)47 b Fi
(tsuneo-y@is.aist-nara.ac)o(.jp)p Fj(\))40 b(has)150
2371 y(con)m(tributed)f(some)f(functions)g(to)h(giv)m(e)h(b)s(etter)e
Fi(zlib)f Fj(compatibilit)m(y)-8 b(.)67 b(These)38 b(functions)g(are)g
Fi(BZ2_)150 2481 y(bzopen)p Fj(,)g Fi(BZ2_bzread)p Fj(,)f
Fi(BZ2_bzwrite)p Fj(,)g Fi(BZ2_bzflush)p Fj(,)g Fi(BZ2_bzclose)p
Fj(,)g Fi(BZ2_bzerror)e Fj(and)i Fi(BZ2_)150 2590 y(bzlibVersion)p
Fj(.)44 b(Y)-8 b(ou)33 b(ma)m(y)g(\014nd)e(these)i(functions)g(more)g
(con)m(v)m(enien)m(t)i(for)e(simple)f(\014le)h(reading)g(and)150
2700 y(writing,)d(than)g(those)g(in)f(the)h(high-lev)m(el)i(in)m
(terface.)42 b(These)30 b(functions)f(are)h(not)g(\(y)m(et\))i
(o\016cially)f(part)150 2809 y(of)h(the)g(library)-8
b(,)33 b(and)e(are)h(minimally)g(do)s(cumen)m(ted)g(here.)45
b(If)31 b(they)h(break,)h(y)m(ou)f(get)h(to)g(k)m(eep)f(all)h(the)150
2919 y(pieces.)42 b(I)30 b(hop)s(e)g(to)h(do)s(cumen)m(t)f(them)h(prop)
s(erly)e(when)h(time)h(p)s(ermits.)150 3076 y(Y)-8 b(oshiok)j(a)27
b(also)g(con)m(tributed)g(mo)s(di\014cations)g(to)g(allo)m(w)h(the)e
(library)h(to)g(b)s(e)f(built)g(as)g(a)h(Windo)m(ws)f(DLL.)150
3362 y Fk(3.2)68 b(Error)45 b(handling)150 3554 y Fj(The)22
b(library)g(is)g(designed)g(to)i(reco)m(v)m(er)g(cleanly)f(in)f(all)h
(situations,)i(including)c(the)i(w)m(orst-case)h(situation)150
3664 y(of)k(decompressing)g(random)f(data.)40 b(I'm)27
b(not)h(100\045)h(sure)e(that)i(it)f(can)g(alw)m(a)m(ys)g(do)g(this,)g
(so)g(y)m(ou)g(migh)m(t)150 3774 y(w)m(an)m(t)i(to)g(add)e(a)i(signal)f
(handler)g(to)h(catc)m(h)g(segmen)m(tation)i(violations)f(during)d
(decompression)h(if)h(y)m(ou)150 3883 y(are)c(feeling)g(esp)s(ecially)g
(paranoid.)39 b(I)25 b(w)m(ould)g(b)s(e)g(in)m(terested)i(in)e(hearing)
g(more)h(ab)s(out)f(the)h(robustness)150 3993 y(of)31
b(the)f(library)h(to)g(corrupted)f(compressed)g(data.)150
4150 y(V)-8 b(ersion)38 b(1.0)h(is)e(m)m(uc)m(h)h(more)g(robust)f(in)g
(this)h(resp)s(ect)g(than)f(0.9.0)i(or)f(0.9.5.)64 b(In)m(v)m
(estigations)40 b(with)150 4259 y(Chec)m(k)m(er)30 b(\(a)f(to)s(ol)h
(for)f(detecting)h(problems)f(with)f(memory)h(managemen)m(t,)i(similar)
e(to)h(Purify\))e(indi-)150 4369 y(cate)34 b(that,)g(at)f(least)g(for)g
(the)g(few)f(\014les)g(I)h(tested,)h(all)f(single-bit)h(errors)e(in)g
(the)h(decompressed)g(data)150 4478 y(are)28 b(caugh)m(t)h(prop)s(erly)
-8 b(,)29 b(with)f(no)g(segmen)m(tation)i(faults,)f(no)f(reads)g(of)g
(uninitialised)g(data)g(and)g(no)g(out)150 4588 y(of)j(range)h(reads)f
(or)h(writes.)44 b(So)31 b(it's)h(certainly)h(m)m(uc)m(h)e(impro)m(v)m
(ed,)i(although)e(I)h(w)m(ouldn't)f(claim)h(it)g(to)150
4698 y(b)s(e)e(totally)i(b)s(om)m(bpro)s(of.)150 4854
y(The)24 b(\014le)g Fi(bzlib.h)e Fj(con)m(tains)j(all)f(de\014nitions)g
(needed)g(to)g(use)g(the)g(library)-8 b(.)39 b(In)24
b(particular,)i(y)m(ou)e(should)150 4964 y(de\014nitely)31
b(not)f(include)h Fi(bzlib_private.h)p Fj(.)150 5121
y(In)38 b Fi(bzlib.h)p Fj(,)g(the)g(v)-5 b(arious)38
b(return)g(v)-5 b(alues)38 b(are)g(de\014ned.)62 b(The)38
b(follo)m(wing)i(list)f(is)f(not)g(in)m(tended)g(as)150
5230 y(an)33 b(exhaustiv)m(e)h(description)g(of)g(the)g(circumstances)g
(in)f(whic)m(h)g(a)h(giv)m(en)g(v)-5 b(alue)34 b(ma)m(y)g(b)s(e)f
(returned)g({)150 5340 y(those)h(descriptions)f(are)h(giv)m(en)g
(later.)50 b(Rather,)34 b(it)g(is)f(in)m(tended)g(to)h(con)m(v)m(ey)h
(the)e(rough)g(meaning)g(of)p eop
%%Page: 12 13
12 12 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
b(with)g Fi(libbzip2)1881 b Fl(12)150 299 y Fj(eac)m(h)35
b(return)f(v)-5 b(alue.)53 b(The)34 b(\014rst)g(\014v)m(e)h(actions)g
(are)g(normal)f(and)f(not)i(in)m(tended)f(to)i(denote)f(an)e(error)150
408 y(situation.)150 592 y Fi(BZ_OK)240 b Fj(The)30 b(requested)h
(action)h(w)m(as)e(completed)i(successfully)-8 b(.)150
756 y Fi(BZ_RUN_OK)150 866 y(BZ_FLUSH_OK)150 975 y(BZ_FINISH_OK)630
1085 y Fj(In)22 b Fi(BZ2_bzCompress)p Fj(,)e(the)j(requested)g
(\015ush/\014nish/nothing-sp)s(ecial)e(action)j(w)m(as)e(com-)630
1194 y(pleted)31 b(successfully)-8 b(.)150 1358 y Fi(BZ_STREAM_END)630
1468 y Fj(Compression)38 b(of)g(data)h(w)m(as)f(completed,)j(or)e(the)f
(logical)j(stream)e(end)e(w)m(as)h(detected)630 1577
y(during)29 b(decompression.)150 1761 y(The)h(follo)m(wing)i(return)e
(v)-5 b(alues)31 b(indicate)g(an)f(error)h(of)f(some)h(kind.)150
1945 y Fi(BZ_CONFIG_ERROR)630 2055 y Fj(Indicates)46
b(that)h(the)f(library)f(has)h(b)s(een)f(improp)s(erly)g(compiled)h(on)
g(y)m(our)g(platform)630 2164 y({)k(a)h(ma)5 b(jor)50
b(con\014guration)h(error.)100 b(Sp)s(eci\014cally)-8
b(,)56 b(it)51 b(means)e(that)i Fi(sizeof\(char\))p Fj(,)630
2274 y Fi(sizeof\(short\))43 b Fj(and)i Fi(sizeof\(int\))e
Fj(are)k(not)g(1,)k(2)46 b(and)g(4)h(resp)s(ectiv)m(ely)-8
b(,)52 b(as)47 b(they)630 2384 y(should)26 b(b)s(e.)38
b(Note)29 b(that)e(the)g(library)f(should)g(still)h(w)m(ork)g(prop)s
(erly)f(on)h(64-bit)h(platforms)630 2493 y(whic)m(h)43
b(follo)m(w)h(the)g(LP64)f(programming)h(mo)s(del)e({)i(that)g(is,)i
(where)d Fi(sizeof\(long\))630 2603 y Fj(and)32 b Fi(sizeof\(void*\))e
Fj(are)j(8.)50 b(Under)32 b(LP64,)j Fi(sizeof\(int\))30
b Fj(is)j(still)h(4,)h(so)e Fi(libbzip2)p Fj(,)630 2712
y(whic)m(h)d(do)s(esn't)g(use)h(the)f Fi(long)f Fj(t)m(yp)s(e,)i(is)g
(OK.)150 2876 y Fi(BZ_SEQUENCE_ERROR)630 2986 y Fj(When)41
b(using)g(the)h(library)-8 b(,)45 b(it)d(is)g(imp)s(ortan)m(t)g(to)g
(call)h(the)f(functions)f(in)g(the)h(correct)630 3095
y(sequence)25 b(and)f(with)g(data)h(structures)g(\(bu\013ers)f(etc\))i
(in)f(the)g(correct)h(states.)40 b Fi(libbzip2)630 3205
y Fj(c)m(hec)m(ks)25 b(as)e(m)m(uc)m(h)g(as)g(it)h(can)f(to)h(ensure)f
(this)g(is)g(happ)s(ening,)g(and)g(returns)f Fi(BZ_SEQUENCE_)630
3314 y(ERROR)35 b Fj(if)i(not.)59 b(Co)s(de)36 b(whic)m(h)h(complies)g
(precisely)h(with)e(the)h(function)f(seman)m(tics,)k(as)630
3424 y(detailed)c(b)s(elo)m(w,)h(should)e(nev)m(er)g(receiv)m(e)j(this)
d(v)-5 b(alue;)38 b(suc)m(h)d(an)g(ev)m(en)m(t)i(denotes)f(buggy)630
3534 y(co)s(de)31 b(whic)m(h)f(y)m(ou)g(should)g(in)m(v)m(estigate.)150
3697 y Fi(BZ_PARAM_ERROR)630 3807 y Fj(Returned)41 b(when)f(a)h
(parameter)h(to)g(a)g(function)f(call)h(is)f(out)h(of)f(range)h(or)f
(otherwise)630 3917 y(manifestly)35 b(incorrect.)55 b(As)34
b(with)g Fi(BZ_SEQUENCE_ERROR)p Fj(,)d(this)k(denotes)g(a)f(bug)g(in)h
(the)630 4026 y(clien)m(t)24 b(co)s(de.)38 b(The)22 b(distinction)h(b)s
(et)m(w)m(een)f Fi(BZ_PARAM_ERROR)d Fj(and)i Fi(BZ_SEQUENCE_ERROR)630
4136 y Fj(is)30 b(a)h(bit)f(hazy)-8 b(,)32 b(but)d(still)j(w)m(orth)e
(making.)150 4300 y Fi(BZ_MEM_ERROR)630 4409 y Fj(Returned)44
b(when)g(a)h(request)g(to)g(allo)s(cate)i(memory)e(failed.)83
b(Note)46 b(that)g(the)f(quan-)630 4519 y(tit)m(y)d(of)f(memory)f
(needed)g(to)i(decompress)e(a)g(stream)h(cannot)g(b)s(e)f(determined)h
(un)m(til)630 4628 y(the)f(stream's)h(header)e(has)h(b)s(een)f(read.)69
b(So)39 b Fi(BZ2_bzDecompress)d Fj(and)j Fi(BZ2_bzRead)630
4738 y Fj(ma)m(y)29 b(return)f Fi(BZ_MEM_ERROR)d Fj(ev)m(en)30
b(though)e(some)h(of)g(the)g(compressed)g(data)g(has)f(b)s(een)630
4847 y(read.)76 b(The)42 b(same)g(is)g(not)g(true)g(for)h(compression;)
48 b(once)43 b Fi(BZ2_bzCompressInit)37 b Fj(or)630 4957
y Fi(BZ2_bzWriteOpen)26 b Fj(ha)m(v)m(e)32 b(successfully)e(completed,)
i Fi(BZ_MEM_ERROR)27 b Fj(cannot)k(o)s(ccur.)150 5121
y Fi(BZ_DATA_ERROR)630 5230 y Fj(Returned)d(when)g(a)h(data)g(in)m
(tegrit)m(y)i(error)e(is)g(detected)h(during)d(decompression.)41
b(Most)630 5340 y(imp)s(ortan)m(tly)-8 b(,)32 b(this)e(means)g(when)f
(stored)i(and)e(computed)h(CR)m(Cs)g(for)g(the)h(data)f(do)h(not)p
eop
%%Page: 13 14
13 13 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
b(with)g Fi(libbzip2)1881 b Fl(13)630 299 y Fj(matc)m(h.)41
b(This)28 b(v)-5 b(alue)28 b(is)h(also)g(returned)e(up)s(on)g
(detection)j(of)f(an)m(y)f(other)h(anomaly)g(in)f(the)630
408 y(compressed)i(data.)150 560 y Fi(BZ_DATA_ERROR_MAGIC)630
670 y Fj(As)j(a)g(sp)s(ecial)g(case)h(of)f Fi(BZ_DATA_ERROR)p
Fj(,)d(it)k(is)f(sometimes)h(useful)f(to)h(kno)m(w)f(when)f(the)630
779 y(compressed)c(stream)g(do)s(es)g(not)g(start)g(with)g(the)g
(correct)i(magic)e(b)m(ytes)h(\()p Fi('B')h('Z')f('h')p
Fj(\).)150 931 y Fi(BZ_IO_ERROR)630 1040 y Fj(Returned)h(b)m(y)h
Fi(BZ2_bzRead)d Fj(and)h Fi(BZ2_bzWrite)f Fj(when)i(there)h(is)g(an)f
(error)h(reading)g(or)630 1150 y(writing)e(in)f(the)h(compressed)g
(\014le,)g(and)f(b)m(y)h Fi(BZ2_bzReadOpen)24 b Fj(and)k
Fi(BZ2_bzWriteOpen)630 1259 y Fj(for)h(attempts)i(to)f(use)f(a)h
(\014le)f(for)h(whic)m(h)f(the)h(error)f(indicator)i(\(viz,)f
Fi(ferror\(f\))p Fj(\))e(is)h(set.)630 1369 y(On)h(receipt)i(of)f
Fi(BZ_IO_ERROR)p Fj(,)c(the)k(caller)h(should)e(consult)h
Fi(errno)e Fj(and/or)h Fi(perror)f Fj(to)630 1479 y(acquire)i(op)s
(erating-system)h(sp)s(eci\014c)e(information)h(ab)s(out)f(the)g
(problem.)150 1630 y Fi(BZ_UNEXPECTED_EOF)630 1740 y
Fj(Returned)j(b)m(y)g Fi(BZ2_bzRead)e Fj(when)h(the)i(compressed)f
(\014le)h(\014nishes)e(b)s(efore)h(the)h(logical)630
1849 y(end)c(of)g(stream)h(is)g(detected.)150 2001 y
Fi(BZ_OUTBUFF_FULL)630 2110 y Fj(Returned)d(b)m(y)g Fi
(BZ2_bzBuffToBuffCompress)22 b Fj(and)27 b Fi
(BZ2_bzBuffToBuffDecompres)o(s)630 2220 y Fj(to)k(indicate)h(that)f
(the)f(output)g(data)h(will)g(not)g(\014t)f(in)m(to)h(the)g(output)f
(bu\013er)g(pro)m(vided.)150 2492 y Fk(3.3)68 b(Lo)l(w-lev)l(el)47
b(in)l(terface)150 2766 y Fe(3.3.1)63 b Fd(BZ2_bzCompressInit)390
2953 y Fi(typedef)533 3057 y(struct)46 b({)676 3161 y(char)h(*next_in;)
676 3264 y(unsigned)f(int)h(avail_in;)676 3368 y(unsigned)f(int)h
(total_in_lo32;)676 3472 y(unsigned)f(int)h(total_in_hi32;)676
3680 y(char)g(*next_out;)676 3783 y(unsigned)f(int)h(avail_out;)676
3887 y(unsigned)f(int)h(total_out_lo32;)676 3991 y(unsigned)f(int)h
(total_out_hi32;)676 4198 y(void)g(*state;)676 4406 y(void)g
(*\(*bzalloc\)\(void)c(*,int,int\);)676 4510 y(void)k
(\(*bzfree\)\(void)d(*,void)i(*\);)676 4614 y(void)h(*opaque;)533
4717 y(})533 4821 y(bz_stream;)390 5029 y(int)g(BZ2_bzCompressInit)c
(\()k(bz_stream)e(*strm,)1583 5132 y(int)i(blockSize100k,)1583
5236 y(int)g(verbosity,)1583 5340 y(int)g(workFactor)e(\);)p
eop
%%Page: 14 15
14 14 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
b(with)g Fi(libbzip2)1881 b Fl(14)150 456 y Fj(Prepares)31
b(for)g(compression.)42 b(The)30 b Fi(bz_stream)e Fj(structure)j(holds)
g(all)g(data)g(p)s(ertaining)g(to)g(the)g(com-)150 565
y(pression)k(activit)m(y)-8 b(.)59 b(A)35 b Fi(bz_stream)d
Fj(structure)k(should)e(b)s(e)h(allo)s(cated)i(and)e(initialised)h
(prior)f(to)i(the)150 675 y(call.)65 b(The)38 b(\014elds)g(of)g
Fi(bz_stream)e Fj(comprise)i(the)h(en)m(tiret)m(y)h(of)f(the)f
(user-visible)h(data.)64 b Fi(state)37 b Fj(is)h(a)150
784 y(p)s(oin)m(ter)31 b(to)g(the)g(priv)-5 b(ate)31
b(data)f(structures)h(required)f(for)h(compression.)150
941 y(Custom)36 b(memory)g(allo)s(cators)i(are)f(supp)s(orted,)f(via)h
(\014elds)e Fi(bzalloc)p Fj(,)h Fi(bzfree)p Fj(,)g(and)g
Fi(opaque)p Fj(.)56 b(The)150 1051 y(v)-5 b(alue)32 b
Fi(opaque)e Fj(is)i(passed)f(to)i(as)f(the)g(\014rst)g(argumen)m(t)g
(to)h(all)f(calls)h(to)g Fi(bzalloc)d Fj(and)h Fi(bzfree)p
Fj(,)g(but)g(is)150 1160 y(otherwise)c(ignored)g(b)m(y)g(the)g(library)
-8 b(.)39 b(The)27 b(call)g Fi(bzalloc)i(\()h(opaque,)e(n,)i(m)g(\))c
Fj(is)h(exp)s(ected)g(to)g(return)150 1270 y(a)h(p)s(oin)m(ter)g
Fi(p)f Fj(to)i Fi(n)h(*)g(m)d Fj(b)m(ytes)h(of)g(memory)-8
b(,)29 b(and)e Fi(bzfree)h(\()i(opaque,)f(p)h(\))d Fj(should)g(free)h
(that)g(memory)-8 b(.)150 1427 y(If)32 b(y)m(ou)h(don't)g(w)m(an)m(t)g
(to)h(use)e(a)h(custom)g(memory)g(allo)s(cator,)i(set)e
Fi(bzalloc)p Fj(,)f Fi(bzfree)e Fj(and)i Fi(opaque)f
Fj(to)150 1537 y Fi(NULL)p Fj(,)e(and)h(the)h(library)f(will)h(then)f
(use)g(the)h(standard)e Fi(malloc)p Fj(/)p Fi(free)f
Fj(routines.)150 1693 y(Before)37 b(calling)h Fi(BZ2_bzCompressInit)p
Fj(,)33 b(\014elds)k Fi(bzalloc)p Fj(,)f Fi(bzfree)f
Fj(and)h Fi(opaque)e Fj(should)i(b)s(e)g(\014lled)150
1803 y(appropriately)-8 b(,)35 b(as)e(just)f(describ)s(ed.)48
b(Up)s(on)31 b(return,)j(the)f(in)m(ternal)h(state)g(will)f(ha)m(v)m(e)
h(b)s(een)e(allo)s(cated)150 1913 y(and)43 b(initialised,)49
b(and)43 b Fi(total_in_lo32)p Fj(,)h Fi(total_in_hi32)p
Fj(,)g Fi(total_out_lo32)c Fj(and)j Fi(total_out_)150
2022 y(hi32)35 b Fj(will)i(ha)m(v)m(e)g(b)s(een)f(set)h(to)g(zero.)59
b(These)37 b(four)f(\014elds)f(are)i(used)f(b)m(y)g(the)g(library)h(to)
g(inform)f(the)150 2132 y(caller)41 b(of)e(the)h(total)h(amoun)m(t)f
(of)f(data)h(passed)e(in)m(to)j(and)d(out)i(of)f(the)h(library)-8
b(,)42 b(resp)s(ectiv)m(ely)-8 b(.)70 b(Y)-8 b(ou)150
2241 y(should)34 b(not)h(try)h(to)g(c)m(hange)g(them.)55
b(As)34 b(of)h(v)m(ersion)h(1.0,)i(64-bit)e(coun)m(ts)g(are)f(main)m
(tained,)i(ev)m(en)f(on)150 2351 y(32-bit)j(platforms,)g(using)e(the)h
Fi(_hi32)d Fj(\014elds)i(to)h(store)h(the)e(upp)s(er)f(32)i(bits)f(of)h
(the)f(coun)m(t.)63 b(So,)39 b(for)150 2460 y(example,)31
b(the)g(total)h(amoun)m(t)f(of)f(data)h(in)f(is)g Fi(\(total_in_hi32)d
(<<)j(32\))f(+)h(total_in_lo32)p Fj(.)150 2617 y(P)m(arameter)37
b Fi(blockSize100k)31 b Fj(sp)s(eci\014es)k(the)h(blo)s(c)m(k)g(size)g
(to)g(b)s(e)e(used)h(for)g(compression.)55 b(It)36 b(should)150
2727 y(b)s(e)27 b(a)h(v)-5 b(alue)28 b(b)s(et)m(w)m(een)g(1)g(and)f(9)h
(inclusiv)m(e,)i(and)c(the)i(actual)h(blo)s(c)m(k)f(size)h(used)e(is)g
(100000)k(x)c(this)h(\014gure.)150 2836 y(9)j(giv)m(es)h(the)e(b)s(est)
g(compression)h(but)f(tak)m(es)h(most)g(memory)-8 b(.)150
2993 y(P)m(arameter)28 b Fi(verbosity)c Fj(should)h(b)s(e)g(set)i(to)g
(a)g(n)m(um)m(b)s(er)e(b)s(et)m(w)m(een)i(0)f(and)g(4)g(inclusiv)m(e.)
41 b(0)26 b(is)g(silen)m(t,)j(and)150 3103 y(greater)d(n)m(um)m(b)s
(ers)e(giv)m(e)i(increasingly)g(v)m(erb)s(ose)f(monitoring/debugging)h
(output.)38 b(If)25 b(the)g(library)f(has)150 3212 y(b)s(een)30
b(compiled)h(with)f Fi(-DBZ_NO_STDIO)p Fj(,)d(no)j(suc)m(h)g(output)g
(will)h(app)s(ear)f(for)g(an)m(y)g(v)m(erb)s(osit)m(y)i(setting.)150
3369 y(P)m(arameter)g Fi(workFactor)c Fj(con)m(trols)k(ho)m(w)f(the)g
(compression)g(phase)f(b)s(eha)m(v)m(es)h(when)e(presen)m(ted)i(with)
150 3479 y(w)m(orst)38 b(case,)j(highly)c(rep)s(etitiv)m(e,)42
b(input)37 b(data.)62 b(If)38 b(compression)g(runs)e(in)m(to)i
(di\016culties)h(caused)e(b)m(y)150 3588 y(rep)s(etitiv)m(e)46
b(data,)i(the)c(library)f(switc)m(hes)i(from)f(the)g(standard)f
(sorting)h(algorithm)h(to)g(a)f(fallbac)m(k)150 3698
y(algorithm.)c(The)27 b(fallbac)m(k)g(is)f(slo)m(w)m(er)i(than)d(the)i
(standard)e(algorithm)j(b)m(y)e(p)s(erhaps)e(a)i(factor)i(of)e(three,)
150 3808 y(but)k(alw)m(a)m(ys)h(b)s(eha)m(v)m(es)g(reasonably)-8
b(,)31 b(no)f(matter)i(ho)m(w)e(bad)g(the)g(input.)150
3965 y(Lo)m(w)m(er)23 b(v)-5 b(alues)23 b(of)g Fi(workFactor)c
Fj(reduce)k(the)g(amoun)m(t)g(of)f(e\013ort)i(the)f(standard)f
(algorithm)h(will)g(exp)s(end)150 4074 y(b)s(efore)h(resorting)g(to)h
(the)f(fallbac)m(k.)39 b(Y)-8 b(ou)24 b(should)f(set)h(this)g
(parameter)g(carefully;)j(to)s(o)d(lo)m(w,)i(and)d(man)m(y)150
4184 y(inputs)32 b(will)h(b)s(e)f(handled)g(b)m(y)h(the)g(fallbac)m(k)g
(algorithm)h(and)e(so)h(compress)g(rather)g(slo)m(wly)-8
b(,)35 b(to)s(o)f(high,)150 4293 y(and)41 b(y)m(our)g(a)m(v)m
(erage-to-w)m(orst)46 b(case)d(compression)e(times)h(can)g(b)s(ecome)g
(v)m(ery)g(large.)74 b(The)42 b(default)150 4403 y(v)-5
b(alue)31 b(of)f(30)h(giv)m(es)h(reasonable)f(b)s(eha)m(viour)f(o)m(v)m
(er)i(a)f(wide)f(range)h(of)f(circumstances.)150 4560
y(Allo)m(w)m(able)j(v)-5 b(alues)31 b(range)g(from)g(0)g(to)h(250)g
(inclusiv)m(e.)44 b(0)31 b(is)g(a)g(sp)s(ecial)h(case,)g(equiv)-5
b(alen)m(t)32 b(to)g(using)f(the)150 4669 y(default)f(v)-5
b(alue)31 b(of)g(30.)150 4826 y(Note)k(that)e(the)h(compressed)f
(output)g(generated)h(is)f(the)h(same)f(regardless)h(of)f(whether)g(or)
g(not)h(the)150 4936 y(fallbac)m(k)d(algorithm)h(is)e(used.)150
5093 y(Be)f(a)m(w)m(are)g(also)h(that)f(this)f(parameter)i(ma)m(y)f
(disapp)s(ear)e(en)m(tirely)j(in)e(future)g(v)m(ersions)i(of)e(the)h
(library)-8 b(.)150 5202 y(In)43 b(principle)h(it)g(should)f(b)s(e)g(p)
s(ossible)h(to)g(devise)h(a)f(go)s(o)s(d)f(w)m(a)m(y)i(to)f
(automatically)i(c)m(ho)s(ose)f(whic)m(h)150 5312 y(algorithm)32
b(to)f(use.)40 b(Suc)m(h)30 b(a)g(mec)m(hanism)h(w)m(ould)f(render)g
(the)h(parameter)g(obsolete.)p eop
%%Page: 15 16
15 15 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
b(with)g Fi(libbzip2)1881 b Fl(15)150 299 y Fj(P)m(ossible)32
b(return)e(v)-5 b(alues:)572 450 y Fi(BZ_CONFIG_ERROR)663
554 y Fj(if)30 b(the)h(library)f(has)g(b)s(een)g(mis-compiled)572
657 y Fi(BZ_PARAM_ERROR)663 761 y Fj(if)g Fi(strm)f Fj(is)i
Fi(NULL)663 865 y Fj(or)f Fi(blockSize)e(<)i Fj(1)h(or)g
Fi(blockSize)c(>)k Fj(9)663 969 y(or)f Fi(verbosity)e(<)i
Fj(0)h(or)g Fi(verbosity)c(>)k Fj(4)663 1073 y(or)f Fi(workFactor)e(<)i
Fj(0)h(or)f Fi(workFactor)e(>)i Fj(250)572 1176 y Fi(BZ_MEM_ERROR)663
1280 y Fj(if)g(not)h(enough)f(memory)h(is)f(a)m(v)-5
b(ailable)572 1384 y Fi(BZ_OK)663 1488 y Fj(otherwise)150
1645 y(Allo)m(w)m(able)32 b(next)f(actions:)572 1796
y Fi(BZ2_bzCompress)663 1899 y Fj(if)f Fi(BZ_OK)f Fj(is)h(returned)572
2003 y(no)g(sp)s(eci\014c)g(action)i(needed)e(in)g(case)h(of)g(error)
150 2255 y Fe(3.3.2)63 b Fd(BZ2_bzCompress)533 2441 y
Fi(int)47 b(BZ2_bzCompress)d(\()j(bz_stream)f(*strm,)g(int)h(action)f
(\);)150 2598 y Fj(Pro)m(vides)27 b(more)f(input)f(and/or)h(output)g
(bu\013er)f(space)h(for)g(the)h(library)-8 b(.)39 b(The)26
b(caller)h(main)m(tains)g(input)150 2708 y(and)j(output)g(bu\013ers,)g
(and)f(calls)i Fi(BZ2_bzCompress)c Fj(to)k(transfer)f(data)h(b)s(et)m
(w)m(een)g(them.)150 2865 y(Before)h(eac)m(h)h(call)g(to)f
Fi(BZ2_bzCompress)p Fj(,)d Fi(next_in)h Fj(should)g(p)s(oin)m(t)i(at)h
(the)f(data)g(to)h(b)s(e)e(compressed,)150 2974 y(and)40
b Fi(avail_in)f Fj(should)h(indicate)i(ho)m(w)f(man)m(y)g(b)m(ytes)h
(the)f(library)g(ma)m(y)g(read.)73 b Fi(BZ2_bzCompress)150
3084 y Fj(up)s(dates)29 b Fi(next_in)p Fj(,)g Fi(avail_in)f
Fj(and)i Fi(total_in)e Fj(to)j(re\015ect)g(the)g(n)m(um)m(b)s(er)e(of)i
(b)m(ytes)g(it)g(has)f(read.)150 3241 y(Similarly)-8
b(,)30 b Fi(next_out)d Fj(should)h(p)s(oin)m(t)h(to)h(a)f(bu\013er)f
(in)h(whic)m(h)g(the)g(compressed)g(data)g(is)g(to)h(b)s(e)e(placed,)
150 3350 y(with)k Fi(avail_out)f Fj(indicating)i(ho)m(w)g(m)m(uc)m(h)f
(output)h(space)g(is)f(a)m(v)-5 b(ailable.)49 b Fi(BZ2_bzCompress)29
b Fj(up)s(dates)150 3460 y Fi(next_out)p Fj(,)f Fi(avail_out)g
Fj(and)i Fi(total_out)e Fj(to)j(re\015ect)g(the)g(n)m(um)m(b)s(er)e(of)
i(b)m(ytes)g(output.)150 3617 y(Y)-8 b(ou)39 b(ma)m(y)g(pro)m(vide)g
(and)f(remo)m(v)m(e)i(as)f(little)i(or)e(as)g(m)m(uc)m(h)f(data)h(as)g
(y)m(ou)g(lik)m(e)h(on)f(eac)m(h)g(call)h(of)f Fi(BZ2_)150
3726 y(bzCompress)p Fj(.)46 b(In)32 b(the)i(limit,)h(it)e(is)g
(acceptable)i(to)f(supply)e(and)g(remo)m(v)m(e)j(data)e(one)g(b)m(yte)h
(at)g(a)f(time,)150 3836 y(although)27 b(this)g(w)m(ould)f(b)s(e)g
(terribly)i(ine\016cien)m(t.)40 b(Y)-8 b(ou)27 b(should)f(alw)m(a)m(ys)
i(ensure)e(that)h(at)g(least)h(one)f(b)m(yte)150 3946
y(of)k(output)f(space)g(is)h(a)m(v)-5 b(ailable)32 b(at)f(eac)m(h)g
(call.)150 4102 y(A)36 b(second)g(purp)s(ose)f(of)i Fi(BZ2_bzCompress)
32 b Fj(is)37 b(to)g(request)g(a)f(c)m(hange)h(of)g(mo)s(de)f(of)g(the)
h(compressed)150 4212 y(stream.)150 4369 y(Conceptually)-8
b(,)24 b(a)d(compressed)g(stream)g(can)g(b)s(e)f(in)h(one)g(of)g(four)f
(states:)38 b(IDLE,)20 b(R)m(UNNING,)i(FLUSH-)150 4478
y(ING)34 b(and)d(FINISHING.)k(Before)e(initialisation)i(\()p
Fi(BZ2_bzCompressInit)p Fj(\))28 b(and)k(after)i(termination)150
4588 y(\()p Fi(BZ2_bzCompressEnd)p Fj(\),)27 b(a)j(stream)h(is)f
(regarded)h(as)f(IDLE.)150 4745 y(Up)s(on)j(initialisation)i(\()p
Fi(BZ2_bzCompressInit)p Fj(\),)c(the)j(stream)g(is)g(placed)g(in)f(the)
h(R)m(UNNING)h(state.)150 4854 y(Subsequen)m(t)k(calls)h(to)h
Fi(BZ2_bzCompress)36 b Fj(should)i(pass)i Fi(BZ_RUN)e
Fj(as)h(the)h(requested)g(action;)46 b(other)150 4964
y(actions)31 b(are)g(illegal)i(and)c(will)i(result)g(in)f
Fi(BZ_SEQUENCE_ERROR)p Fj(.)150 5121 y(A)m(t)37 b(some)f(p)s(oin)m(t,)i
(the)e(calling)h(program)f(will)h(ha)m(v)m(e)g(pro)m(vided)e(all)i(the)
f(input)g(data)g(it)g(w)m(an)m(ts)h(to.)58 b(It)150 5230
y(will)30 b(then)f(w)m(an)m(t)h(to)g(\014nish)e(up)g({)i(in)f
(e\013ect,)j(asking)d(the)h(library)f(to)h(pro)s(cess)g(an)m(y)f(data)h
(it)g(migh)m(t)g(ha)m(v)m(e)150 5340 y(bu\013ered)23
b(in)m(ternally)-8 b(.)40 b(In)24 b(this)g(state,)j Fi(BZ2_bzCompress)
20 b Fj(will)k(no)g(longer)h(attempt)g(to)g(read)f(data)g(from)p
eop
%%Page: 16 17
16 16 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
b(with)g Fi(libbzip2)1881 b Fl(16)150 299 y Fi(next_in)p
Fj(,)32 b(but)g(it)i(will)f(w)m(an)m(t)h(to)g(write)g(data)f(to)h
Fi(next_out)p Fj(.)46 b(Because)34 b(the)f(output)g(bu\013er)f
(supplied)150 408 y(b)m(y)d(the)g(user)g(can)g(b)s(e)f(arbitrarily)i
(small,)g(the)f(\014nishing-up)f(op)s(eration)h(cannot)h(necessarily)g
(b)s(e)e(done)150 518 y(with)i(a)h(single)g(call)g(of)g
Fi(BZ2_bzCompress)p Fj(.)150 675 y(Instead,)47 b(the)d(calling)g
(program)g(passes)f Fi(BZ_FINISH)e Fj(as)i(an)g(action)i(to)f
Fi(BZ2_bzCompress)p Fj(.)76 b(This)150 784 y(c)m(hanges)26
b(the)g(stream's)g(state)h(to)f(FINISHING.)h(An)m(y)e(remaining)h
(input)e(\(ie,)k Fi(next_in[0)g(..)i(avail_)150 894 y(in-1])p
Fj(\))k(is)h(compressed)g(and)f(transferred)h(to)h(the)f(output)g
(bu\013er.)54 b(T)-8 b(o)36 b(do)f(this,)i Fi(BZ2_bzCompress)150
1004 y Fj(m)m(ust)h(b)s(e)f(called)i(rep)s(eatedly)g(un)m(til)f(all)g
(the)h(output)f(has)f(b)s(een)g(consumed.)63 b(A)m(t)38
b(that)h(p)s(oin)m(t,)h Fi(BZ2_)150 1113 y(bzCompress)g
Fj(returns)i Fi(BZ_STREAM_END)p Fj(,)g(and)f(the)i(stream's)g(state)h
(is)e(set)h(bac)m(k)g(to)h(IDLE.)d Fi(BZ2_)150 1223 y(bzCompressEnd)27
b Fj(should)i(then)h(b)s(e)g(called.)150 1380 y(Just)g(to)i(mak)m(e)f
(sure)f(the)h(calling)g(program)g(do)s(es)f(not)h(c)m(heat,)h(the)f
(library)f(mak)m(es)h(a)g(note)g(of)g Fi(avail_)150 1489
y(in)i Fj(at)h(the)g(time)h(of)e(the)h(\014rst)g(call)g(to)h
Fi(BZ2_bzCompress)30 b Fj(whic)m(h)j(has)g Fi(BZ_FINISH)e
Fj(as)j(an)f(action)i(\(ie,)150 1599 y(at)g(the)g(time)h(the)e(program)
h(has)f(announced)g(its)h(in)m(ten)m(tion)h(to)g(not)f(supply)e(an)m(y)
h(more)h(input\).)53 b(By)150 1708 y(comparing)30 b(this)f(v)-5
b(alue)29 b(with)h(that)f(of)h Fi(avail_in)d Fj(o)m(v)m(er)k(subsequen)
m(t)d(calls)j(to)f Fi(BZ2_bzCompress)p Fj(,)c(the)150
1818 y(library)k(can)f(detect)j(an)m(y)e(attempts)h(to)f(slip)g(in)f
(more)h(data)g(to)h(compress.)41 b(An)m(y)29 b(calls)i(for)e(whic)m(h)h
(this)150 1928 y(is)h(detected)i(will)f(return)f Fi(BZ_SEQUENCE_ERROR)p
Fj(.)39 b(This)31 b(indicates)i(a)e(programming)g(mistak)m(e)i(whic)m
(h)150 2037 y(should)c(b)s(e)h(corrected.)150 2194 y(Instead)36
b(of)g(asking)h(to)g(\014nish,)f(the)h(calling)g(program)f(ma)m(y)h
(ask)f Fi(BZ2_bzCompress)c Fj(to)37 b(tak)m(e)h(all)f(the)150
2304 y(remaining)f(input,)g(compress)f(it)h(and)f(terminate)h(the)g
(curren)m(t)g(\(Burro)m(ws-Wheeler\))h(compression)150
2413 y(blo)s(c)m(k.)j(This)25 b(could)h(b)s(e)g(useful)f(for)h(error)g
(con)m(trol)i(purp)s(oses.)38 b(The)26 b(mec)m(hanism)g(is)g(analogous)
h(to)f(that)150 2523 y(for)35 b(\014nishing:)48 b(call)35
b Fi(BZ2_bzCompress)c Fj(with)k(an)f(action)i(of)f Fi(BZ_FLUSH)p
Fj(,)f(remo)m(v)m(e)i(output)f(data,)h(and)150 2632 y(p)s(ersist)i
(with)g(the)h Fi(BZ_FLUSH)d Fj(action)k(un)m(til)e(the)h(v)-5
b(alue)39 b Fi(BZ_RUN)d Fj(is)j(returned.)64 b(As)38
b(with)g(\014nishing,)150 2742 y Fi(BZ2_bzCompress)21
b Fj(detects)27 b(an)m(y)f(attempt)g(to)h(pro)m(vide)e(more)h(input)f
(data)g(once)i(the)e(\015ush)f(has)h(b)s(egun.)150 2899
y(Once)31 b(the)g(\015ush)d(is)j(complete,)h(the)f(stream)f(returns)g
(to)i(the)e(normal)h(R)m(UNNING)h(state.)150 3056 y(This)f(all)g
(sounds)f(prett)m(y)i(complex,)g(but)f(isn't)g(really)-8
b(.)44 b(Here's)32 b(a)f(table)h(whic)m(h)e(sho)m(ws)h(whic)m(h)g
(actions)150 3165 y(are)d(allo)m(w)m(able)i(in)e(eac)m(h)h(state,)h
(what)d(action)j(will)e(b)s(e)f(tak)m(en,)j(what)d(the)i(next)f(state)h
(is,)g(and)e(what)h(the)150 3275 y(non-error)g(return)f(v)-5
b(alues)28 b(are.)40 b(Note)30 b(that)e(y)m(ou)g(can't)g(explicitly)i
(ask)d(what)h(state)h(the)f(stream)g(is)g(in,)150 3384
y(but)h(nor)h(do)f(y)m(ou)h(need)g(to)g({)h(it)f(can)g(b)s(e)f
(inferred)g(from)h(the)g(v)-5 b(alues)30 b(returned)f(b)m(y)h
Fi(BZ2_bzCompress)p Fj(.)390 3535 y(IDLE/)p Fi(any)572
3639 y Fj(Illegal.)63 b(IDLE)29 b(state)j(only)e(exists)h(after)g
Fi(BZ2_bzCompressEnd)26 b Fj(or)572 3743 y(b)s(efore)k
Fi(BZ2_bzCompressInit)p Fj(.)572 3847 y(Return)g(v)-5
b(alue)31 b(=)f Fi(BZ_SEQUENCE_ERROR)390 4054 y Fj(R)m(UNNING/)p
Fi(BZ_RUN)572 4158 y Fj(Compress)g(from)g Fi(next_in)e
Fj(to)j Fi(next_out)d Fj(as)j(m)m(uc)m(h)f(as)h(p)s(ossible.)572
4262 y(Next)g(state)h(=)e(R)m(UNNING)572 4366 y(Return)g(v)-5
b(alue)31 b(=)f Fi(BZ_RUN_OK)390 4573 y Fj(R)m(UNNING/)p
Fi(BZ_FLUSH)572 4677 y Fj(Remem)m(b)s(er)g(curren)m(t)h(v)-5
b(alue)31 b(of)f Fi(next_in)p Fj(.)59 b(Compress)30 b(from)g
Fi(next_in)572 4781 y Fj(to)h Fi(next_out)d Fj(as)j(m)m(uc)m(h)f(as)g
(p)s(ossible,)g(but)g(do)h(not)f(accept)i(an)m(y)e(more)h(input.)572
4885 y(Next)g(state)h(=)e(FLUSHING)572 4988 y(Return)g(v)-5
b(alue)31 b(=)f Fi(BZ_FLUSH_OK)390 5196 y Fj(R)m(UNNING/)p
Fi(BZ_FINISH)572 5300 y Fj(Remem)m(b)s(er)g(curren)m(t)h(v)-5
b(alue)31 b(of)f Fi(next_in)p Fj(.)59 b(Compress)30 b(from)g
Fi(next_in)p eop
%%Page: 17 18
17 17 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
b(with)g Fi(libbzip2)1881 b Fl(17)572 299 y Fj(to)31
b Fi(next_out)d Fj(as)j(m)m(uc)m(h)f(as)g(p)s(ossible,)g(but)g(do)h
(not)f(accept)i(an)m(y)e(more)h(input.)572 403 y(Next)g(state)h(=)e
(FINISHING)572 506 y(Return)g(v)-5 b(alue)31 b(=)f Fi(BZ_FINISH_OK)390
714 y Fj(FLUSHING/)p Fi(BZ_FLUSH)572 818 y Fj(Compress)g(from)g
Fi(next_in)e Fj(to)j Fi(next_out)d Fj(as)j(m)m(uc)m(h)f(as)h(p)s
(ossible,)572 922 y(but)f(do)g(not)h(accept)g(an)m(y)g(more)g(input.)
572 1025 y(If)f(all)h(the)g(existing)g(input)f(has)g(b)s(een)f(used)h
(up)f(and)h(all)h(compressed)572 1129 y(output)f(has)g(b)s(een)g(remo)m
(v)m(ed)663 1233 y(Next)h(state)h(=)e(R)m(UNNING;)i(Return)e(v)-5
b(alue)31 b(=)f Fi(BZ_RUN_OK)572 1337 y Fj(else)663 1440
y(Next)h(state)h(=)e(FLUSHING;)g(Return)h(v)-5 b(alue)30
b(=)g Fi(BZ_FLUSH_OK)390 1648 y Fj(FLUSHING/other)572
1752 y(Illegal.)572 1856 y(Return)g(v)-5 b(alue)31 b(=)f
Fi(BZ_SEQUENCE_ERROR)390 2063 y Fj(FINISHING/)p Fi(BZ_FINISH)572
2167 y Fj(Compress)g(from)g Fi(next_in)e Fj(to)j Fi(next_out)d
Fj(as)j(m)m(uc)m(h)f(as)h(p)s(ossible,)572 2271 y(but)f(to)h(not)g
(accept)g(an)m(y)g(more)g(input.)572 2374 y(If)f(all)h(the)g(existing)g
(input)f(has)g(b)s(een)f(used)h(up)f(and)h(all)h(compressed)572
2478 y(output)f(has)g(b)s(een)g(remo)m(v)m(ed)663 2582
y(Next)h(state)h(=)e(IDLE;)f(Return)i(v)-5 b(alue)30
b(=)g Fi(BZ_STREAM_END)572 2686 y Fj(else)663 2790 y(Next)h(state)h(=)e
(FINISHING;)h(Return)g(v)-5 b(alue)30 b(=)g Fi(BZ_FINISHING)390
2997 y Fj(FINISHING/other)572 3101 y(Illegal.)572 3205
y(Return)g(v)-5 b(alue)31 b(=)f Fi(BZ_SEQUENCE_ERROR)150
3361 y Fj(That)23 b(still)h(lo)s(oks)g(complicated?)39
b(W)-8 b(ell,)26 b(fair)d(enough.)39 b(The)23 b(usual)f(sequence)h(of)h
(calls)g(for)f(compressing)150 3471 y(a)30 b(load)h(of)g(data)f(is:)225
3628 y Fh(\017)60 b Fj(Get)32 b(started)f(with)f Fi(BZ2_bzCompressInit)
p Fj(.)225 3774 y Fh(\017)60 b Fj(Sho)m(v)m(el)37 b(data)g(in)f(and)g
(shlurp)f(out)i(its)f(compressed)h(form)f(using)g(zero)i(or)e(more)h
(calls)h(of)e Fi(BZ2_)330 3884 y(bzCompress)28 b Fj(with)i(action)h(=)f
Fi(BZ_RUN)p Fj(.)225 4030 y Fh(\017)60 b Fj(Finish)24
b(up.)38 b(Rep)s(eatedly)25 b(call)h Fi(BZ2_bzCompress)21
b Fj(with)k(action)h(=)e Fi(BZ_FINISH)p Fj(,)g(cop)m(ying)h(out)h(the)
330 4139 y(compressed)k(output,)h(un)m(til)g Fi(BZ_STREAM_END)26
b Fj(is)31 b(returned.)225 4285 y Fh(\017)60 b Fj(Close)31
b(up)e(and)h(go)h(home.)41 b(Call)30 b Fi(BZ2_bzCompressEnd)p
Fj(.)150 4478 y(If)23 b(the)g(data)g(y)m(ou)h(w)m(an)m(t)g(to)f
(compress)g(\014ts)g(in)m(to)h(y)m(our)g(input)e(bu\013er)g(all)i(at)f
(once,)j(y)m(ou)d(can)g(skip)g(the)g(calls)150 4588 y(of)37
b Fi(BZ2_bzCompress)26 b(\()k(...,)f(BZ_RUN)g(\))36 b
Fj(and)g(just)g(do)g(the)h Fi(BZ2_bzCompress)26 b(\()k(...,)f
(BZ_FINISH)150 4698 y(\))h Fj(calls.)150 4854 y(All)35
b(required)g(memory)h(is)f(allo)s(cated)i(b)m(y)e Fi
(BZ2_bzCompressInit)p Fj(.)51 b(The)35 b(compression)h(library)f(can)
150 4964 y(accept)f(an)m(y)e(data)h(at)g(all)h(\(ob)m(viously\).)48
b(So)32 b(y)m(ou)h(shouldn't)f(get)i(an)m(y)f(error)g(return)f(v)-5
b(alues)32 b(from)h(the)150 5074 y Fi(BZ2_bzCompress)28
b Fj(calls.)48 b(If)32 b(y)m(ou)g(do,)h(they)g(will)g(b)s(e)e
Fi(BZ_SEQUENCE_ERROR)p Fj(,)e(and)i(indicate)i(a)g(bug)e(in)150
5183 y(y)m(our)g(programming.)150 5340 y(T)-8 b(rivial)32
b(other)f(p)s(ossible)f(return)g(v)-5 b(alues:)p eop
%%Page: 18 19
18 18 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
b(with)g Fi(libbzip2)1881 b Fl(18)572 299 y Fi(BZ_PARAM_ERROR)663
403 y Fj(if)30 b Fi(strm)f Fj(is)i Fi(NULL)p Fj(,)e(or)i
Fi(strm->s)d Fj(is)j Fi(NULL)150 652 y Fe(3.3.3)63 b
Fd(BZ2_bzCompressEnd)390 839 y Fi(int)47 b(BZ2_bzCompressEnd)c(\()k
(bz_stream)f(*strm)g(\);)150 996 y Fj(Releases)32 b(all)f(memory)f
(asso)s(ciated)i(with)e(a)h(compression)f(stream.)150
1153 y(P)m(ossible)i(return)e(v)-5 b(alues:)481 1304
y Fi(BZ_PARAM_ERROR)117 b Fj(if)31 b Fi(strm)e Fj(is)h
Fi(NULL)f Fj(or)i Fi(strm->s)d Fj(is)j Fi(NULL)481 1408
y(BZ_OK)120 b Fj(otherwise)150 1657 y Fe(3.3.4)63 b Fd
(BZ2_bzDecompressInit)390 1844 y Fi(int)47 b(BZ2_bzDecompressInit)42
b(\()48 b(bz_stream)d(*strm,)h(int)h(verbosity,)e(int)i(small)f(\);)150
2001 y Fj(Prepares)39 b(for)f(decompression.)65 b(As)38
b(with)h Fi(BZ2_bzCompressInit)p Fj(,)c(a)k Fi(bz_stream)d
Fj(record)j(should)150 2110 y(b)s(e)30 b(allo)s(cated)j(and)d
(initialised)i(b)s(efore)f(the)g(call.)44 b(Fields)31
b Fi(bzalloc)p Fj(,)e Fi(bzfree)g Fj(and)h Fi(opaque)g
Fj(should)g(b)s(e)150 2220 y(set)35 b(if)f(a)g(custom)h(memory)f(allo)s
(cator)i(is)e(required,)h(or)g(made)f Fi(NULL)f Fj(for)h(the)g(normal)g
Fi(malloc)p Fj(/)p Fi(free)150 2330 y Fj(routines.)72
b(Up)s(on)40 b(return,)j(the)e(in)m(ternal)h(state)g(will)g(ha)m(v)m(e)
f(b)s(een)f(initialised,)45 b(and)40 b Fi(total_in)f
Fj(and)150 2439 y Fi(total_out)28 b Fj(will)j(b)s(e)e(zero.)150
2596 y(F)-8 b(or)31 b(the)g(meaning)f(of)h(parameter)g
Fi(verbosity)p Fj(,)d(see)j Fi(BZ2_bzCompressInit)p Fj(.)150
2753 y(If)26 b Fi(small)f Fj(is)i(nonzero,)h(the)f(library)f(will)h
(use)f(an)g(alternativ)m(e)j(decompression)e(algorithm)g(whic)m(h)f
(uses)150 2862 y(less)42 b(memory)h(but)e(at)i(the)f(cost)i(of)e
(decompressing)g(more)h(slo)m(wly)g(\(roughly)f(sp)s(eaking,)j(half)d
(the)150 2972 y(sp)s(eed,)29 b(but)f(the)h(maxim)m(um)f(memory)i
(requiremen)m(t)f(drops)f(to)i(around)e(2300k\).)42 b(See)29
b(Chapter)g(2)g(for)150 3082 y(more)i(information)g(on)f(memory)g
(managemen)m(t.)150 3238 y(Note)37 b(that)f(the)g(amoun)m(t)g(of)g
(memory)g(needed)f(to)h(decompress)g(a)g(stream)g(cannot)g(b)s(e)f
(determined)150 3348 y(un)m(til)41 b(the)f(stream's)h(header)f(has)g(b)
s(een)f(read,)k(so)e(ev)m(en)g(if)f Fi(BZ2_bzDecompressInit)35
b Fj(succeeds,)43 b(a)150 3458 y(subsequen)m(t)30 b Fi
(BZ2_bzDecompress)c Fj(could)k(fail)h(with)f Fi(BZ_MEM_ERROR)p
Fj(.)150 3614 y(P)m(ossible)i(return)e(v)-5 b(alues:)572
3765 y Fi(BZ_CONFIG_ERROR)663 3869 y Fj(if)30 b(the)h(library)f(has)g
(b)s(een)g(mis-compiled)572 3973 y Fi(BZ_PARAM_ERROR)663
4077 y Fj(if)g Fi(\(small)46 b(!=)h(0)h(&&)f(small)f(!=)h(1\))663
4181 y Fj(or)30 b Fi(\(verbosity)45 b(<)j(0)f(||)g(verbosity)f(>)h(4\))
572 4284 y(BZ_MEM_ERROR)663 4388 y Fj(if)30 b(insu\016cien)m(t)h
(memory)f(is)h(a)m(v)-5 b(ailable)150 4545 y(Allo)m(w)m(able)32
b(next)f(actions:)572 4696 y Fi(BZ2_bzDecompress)663
4800 y Fj(if)f Fi(BZ_OK)f Fj(w)m(as)h(returned)572 4904
y(no)g(sp)s(eci\014c)g(action)i(required)e(in)g(case)h(of)g(error)150
5153 y Fe(3.3.5)63 b Fd(BZ2_bzDecompress)390 5340 y Fi(int)47
b(BZ2_bzDecompress)c(\()48 b(bz_stream)d(*strm)h(\);)p
eop
%%Page: 19 20
19 19 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
b(with)g Fi(libbzip2)1881 b Fl(19)150 299 y Fj(Pro)m(vides)41
b(more)g(input)f(and/out)g(output)h(bu\013er)e(space)i(for)f(the)h
(library)-8 b(.)71 b(The)41 b(caller)h(main)m(tains)150
408 y(input)30 b(and)f(output)h(bu\013ers,)g(and)g(uses)g
Fi(BZ2_bzDecompress)25 b Fj(to)32 b(transfer)e(data)h(b)s(et)m(w)m(een)
g(them.)150 565 y(Before)45 b(eac)m(h)h(call)f(to)h Fi
(BZ2_bzDecompress)p Fj(,)e Fi(next_in)e Fj(should)i(p)s(oin)m(t)h(at)g
(the)g(compressed)f(data,)150 675 y(and)33 b Fi(avail_in)e
Fj(should)i(indicate)i(ho)m(w)e(man)m(y)h(b)m(ytes)g(the)g(library)g
(ma)m(y)g(read.)50 b Fi(BZ2_bzDecompress)150 784 y Fj(up)s(dates)29
b Fi(next_in)p Fj(,)g Fi(avail_in)f Fj(and)i Fi(total_in)e
Fj(to)j(re\015ect)g(the)g(n)m(um)m(b)s(er)e(of)i(b)m(ytes)g(it)g(has)f
(read.)150 941 y(Similarly)-8 b(,)40 b Fi(next_out)34
b Fj(should)i(p)s(oin)m(t)h(to)h(a)f(bu\013er)f(in)h(whic)m(h)g(the)g
(uncompressed)f(output)h(is)g(to)h(b)s(e)150 1051 y(placed,)f(with)e
Fi(avail_out)e Fj(indicating)j(ho)m(w)f(m)m(uc)m(h)h(output)f(space)g
(is)h(a)m(v)-5 b(ailable.)57 b Fi(BZ2_bzCompress)150
1160 y Fj(up)s(dates)29 b Fi(next_out)p Fj(,)g Fi(avail_out)f
Fj(and)h Fi(total_out)f Fj(to)j(re\015ect)h(the)e(n)m(um)m(b)s(er)g(of)
g(b)m(ytes)h(output.)150 1317 y(Y)-8 b(ou)39 b(ma)m(y)g(pro)m(vide)g
(and)f(remo)m(v)m(e)i(as)f(little)i(or)e(as)g(m)m(uc)m(h)f(data)h(as)g
(y)m(ou)g(lik)m(e)h(on)f(eac)m(h)g(call)h(of)f Fi(BZ2_)150
1427 y(bzDecompress)p Fj(.)d(In)27 b(the)h(limit,)h(it)f(is)f
(acceptable)i(to)f(supply)e(and)g(remo)m(v)m(e)j(data)f(one)g(b)m(yte)g
(at)f(a)h(time,)150 1537 y(although)f(this)g(w)m(ould)f(b)s(e)g
(terribly)i(ine\016cien)m(t.)40 b(Y)-8 b(ou)27 b(should)f(alw)m(a)m(ys)
i(ensure)e(that)h(at)g(least)h(one)f(b)m(yte)150 1646
y(of)k(output)f(space)g(is)h(a)m(v)-5 b(ailable)32 b(at)f(eac)m(h)g
(call.)150 1803 y(Use)g(of)f Fi(BZ2_bzDecompress)c Fj(is)k(simpler)h
(than)f Fi(BZ2_bzCompress)p Fj(.)150 1960 y(Y)-8 b(ou)28
b(should)f(pro)m(vide)i(input)f(and)f(remo)m(v)m(e)j(output)e(as)g
(describ)s(ed)g(ab)s(o)m(v)m(e,)i(and)d(rep)s(eatedly)i(call)g
Fi(BZ2_)150 2069 y(bzDecompress)k Fj(un)m(til)k Fi(BZ_STREAM_END)c
Fj(is)k(returned.)59 b(App)s(earance)36 b(of)g Fi(BZ_STREAM_END)d
Fj(denotes)150 2179 y(that)45 b Fi(BZ2_bzDecompress)40
b Fj(has)45 b(detected)h(the)f(logical)i(end)d(of)g(the)h(compressed)g
(stream.)84 b Fi(BZ2_)150 2289 y(bzDecompress)27 b Fj(will)k(not)g(pro)
s(duce)e Fi(BZ_STREAM_END)e Fj(un)m(til)k(all)g(output)g(data)f(has)g
(b)s(een)g(placed)h(in)m(to)150 2398 y(the)k(output)f(bu\013er,)i(so)e
(once)i Fi(BZ_STREAM_END)31 b Fj(app)s(ears,)k(y)m(ou)g(are)g(guaran)m
(teed)g(to)h(ha)m(v)m(e)f(a)m(v)-5 b(ailable)150 2508
y(all)31 b(the)g(decompressed)f(output,)h(and)e Fi(BZ2_bzDecompressEnd)
c Fj(can)31 b(safely)f(b)s(e)g(called.)150 2665 y(If)38
b(case)i(of)f(an)f(error)h(return)f(v)-5 b(alue,)42 b(y)m(ou)d(should)e
(call)j Fi(BZ2_bzDecompressEnd)33 b Fj(to)40 b(clean)f(up)f(and)150
2774 y(release)32 b(memory)-8 b(.)150 2931 y(P)m(ossible)32
b(return)e(v)-5 b(alues:)572 3082 y Fi(BZ_PARAM_ERROR)663
3186 y Fj(if)30 b Fi(strm)f Fj(is)i Fi(NULL)e Fj(or)i
Fi(strm->s)d Fj(is)i Fi(NULL)663 3290 y Fj(or)g Fi(strm->avail_out)44
b(<)j(1)572 3393 y(BZ_DATA_ERROR)663 3497 y Fj(if)30
b(a)h(data)f(in)m(tegrit)m(y)j(error)e(is)f(detected)i(in)e(the)h
(compressed)g(stream)572 3601 y Fi(BZ_DATA_ERROR_MAGIC)663
3705 y Fj(if)f(the)h(compressed)f(stream)h(do)s(esn't)f(b)s(egin)g
(with)h(the)f(righ)m(t)i(magic)f(b)m(ytes)572 3808 y
Fi(BZ_MEM_ERROR)663 3912 y Fj(if)f(there)h(w)m(asn't)g(enough)f(memory)
h(a)m(v)-5 b(ailable)572 4016 y Fi(BZ_STREAM_END)663
4120 y Fj(if)30 b(the)h(logical)h(end)e(of)h(the)f(data)h(stream)g(w)m
(as)f(detected)i(and)e(all)663 4224 y(output)g(in)g(has)g(b)s(een)g
(consumed,)g(eg)h Fi(s->avail_out)44 b(>)k(0)572 4327
y(BZ_OK)663 4431 y Fj(otherwise)150 4588 y(Allo)m(w)m(able)32
b(next)f(actions:)572 4739 y Fi(BZ2_bzDecompress)663
4843 y Fj(if)f Fi(BZ_OK)f Fj(w)m(as)h(returned)572 4946
y Fi(BZ2_bzDecompressEnd)663 5050 y Fj(otherwise)p eop
%%Page: 20 21
20 20 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
b(with)g Fi(libbzip2)1881 b Fl(20)150 299 y Fe(3.3.6)63
b Fd(BZ2_bzDecompressEnd)390 486 y Fi(int)47 b(BZ2_bzDecompressEnd)42
b(\()48 b(bz_stream)d(*strm)i(\);)150 643 y Fj(Releases)32
b(all)f(memory)f(asso)s(ciated)i(with)e(a)h(decompression)f(stream.)150
799 y(P)m(ossible)i(return)e(v)-5 b(alues:)572 950 y
Fi(BZ_PARAM_ERROR)663 1054 y Fj(if)30 b Fi(strm)f Fj(is)i
Fi(NULL)e Fj(or)i Fi(strm->s)d Fj(is)i Fi(NULL)572 1158
y(BZ_OK)663 1262 y Fj(otherwise)150 1419 y(Allo)m(w)m(able)i(next)f
(actions:)572 1570 y(None.)150 1857 y Fk(3.4)68 b(High-lev)l(el)47
b(in)l(terface)150 2050 y Fj(This)35 b(in)m(terface)i(pro)m(vides)e
(functions)g(for)g(reading)g(and)f(writing)i Fi(bzip2)d
Fj(format)j(\014les.)55 b(First,)37 b(some)150 2159 y(general)31
b(p)s(oin)m(ts.)225 2316 y Fh(\017)60 b Fj(All)35 b(of)g(the)h
(functions)e(tak)m(e)j(an)d Fi(int*)g Fj(\014rst)h(argumen)m(t,)i
Fi(bzerror)p Fj(.)52 b(After)36 b(eac)m(h)f(call,)j Fi(bzerror)330
2426 y Fj(should)23 b(b)s(e)f(consulted)i(\014rst)f(to)i(determine)f
(the)g(outcome)h(of)e(the)h(call.)40 b(If)23 b Fi(bzerror)e
Fj(is)j Fi(BZ_OK)p Fj(,)g(the)330 2535 y(call)35 b(completed)g
(successfully)-8 b(,)36 b(and)d(only)i(then)e(should)h(the)g(return)g
(v)-5 b(alue)34 b(of)g(the)h(function)f(\(if)330 2645
y(an)m(y\))27 b(b)s(e)e(consulted.)40 b(If)26 b Fi(bzerror)f
Fj(is)h Fi(BZ_IO_ERROR)p Fj(,)e(there)j(w)m(as)g(an)e(error)i
(reading/writing)h(the)330 2754 y(underlying)k(compressed)h(\014le,)h
(and)e(y)m(ou)h(should)f(then)h(consult)g Fi(errno)p
Fj(/)p Fi(perror)e Fj(to)i(determine)330 2864 y(the)k(cause)f(of)h(the)
f(di\016cult)m(y)-8 b(.)60 b Fi(bzerror)34 b Fj(ma)m(y)j(also)g(b)s(e)e
(set)i(to)g(v)-5 b(arious)37 b(other)g(v)-5 b(alues;)39
b(precise)330 2974 y(details)31 b(are)g(giv)m(en)g(on)g(a)f(p)s
(er-function)g(basis)g(b)s(elo)m(w.)225 3111 y Fh(\017)60
b Fj(If)39 b Fi(bzerror)e Fj(indicates)i(an)g(error)g(\(ie,)k(an)m
(ything)c(except)h Fi(BZ_OK)d Fj(and)i Fi(BZ_STREAM_END)p
Fj(\),)f(y)m(ou)330 3220 y(should)56 b(immediately)i(call)g
Fi(BZ2_bzReadClose)53 b Fj(\(or)58 b Fi(BZ2_bzWriteClose)p
Fj(,)h(dep)s(ending)d(on)330 3330 y(whether)37 b(y)m(ou)h(are)f
(attempting)i(to)f(read)f(or)h(to)g(write\))g(to)g(free)g(up)e(all)i
(resources)g(asso)s(ciated)330 3439 y(with)44 b(the)g(stream.)83
b(Once)44 b(an)g(error)h(has)e(b)s(een)h(indicated,)k(b)s(eha)m(viour)c
(of)g(all)h(calls)g(except)330 3549 y Fi(BZ2_bzReadClose)h
Fj(\()p Fi(BZ2_bzWriteClose)p Fj(\))h(is)j(unde\014ned.)99
b(The)51 b(implication)g(is)g(that)g(\(1\))330 3659 y
Fi(bzerror)42 b Fj(should)i(b)s(e)f(c)m(hec)m(k)m(ed)k(after)e(eac)m(h)
g(call,)k(and)43 b(\(2\))j(if)e Fi(bzerror)e Fj(indicates)j(an)f
(error,)330 3768 y Fi(BZ2_bzReadClose)26 b Fj(\()p Fi(BZ2_bzWriteClose)
p Fj(\))h(should)i(then)h(b)s(e)g(called)i(to)f(clean)g(up.)225
3905 y Fh(\017)60 b Fj(The)32 b Fi(FILE*)f Fj(argumen)m(ts)i(passed)f
(to)h Fi(BZ2_bzReadOpen)p Fj(/)p Fi(BZ2_bzWriteO)o(pen)26
b Fj(should)31 b(b)s(e)h(set)h(to)330 4015 y(binary)22
b(mo)s(de.)38 b(Most)24 b(Unix)f(systems)g(will)g(do)g(this)g(b)m(y)g
(default,)i(but)d(other)i(platforms,)g(including)330
4124 y(Windo)m(ws)41 b(and)g(Mac,)46 b(will)c(not.)76
b(If)41 b(y)m(ou)i(omit)f(this,)j(y)m(ou)e(ma)m(y)f(encoun)m(ter)h
(problems)e(when)330 4234 y(mo)m(ving)31 b(co)s(de)g(to)g(new)f
(platforms.)225 4371 y Fh(\017)60 b Fj(Memory)45 b(allo)s(cation)h
(requests)f(are)g(handled)e(b)m(y)h Fi(malloc)p Fj(/)p
Fi(free)p Fj(.)80 b(A)m(t)45 b(presen)m(t)g(there)g(is)f(no)330
4481 y(facilit)m(y)39 b(for)f(user-de\014ned)e(memory)h(allo)s(cators)j
(in)d(the)g(\014le)h(I/O)g(functions)f(\(could)g(easily)i(b)s(e)330
4590 y(added,)30 b(though\).)150 4842 y Fe(3.4.1)63 b
Fd(BZ2_bzReadOpen)533 5029 y Fi(typedef)46 b(void)h(BZFILE;)533
5236 y(BZFILE)f(*BZ2_bzReadOpen)e(\()j(int)g(*bzerror,)f(FILE)g(*f,)
1726 5340 y(int)h(small,)f(int)h(verbosity,)p eop
%%Page: 21 22
21 21 bop 150 -116 a Fl(Chapter)30 b(3:)h(Programming)e(with)g
Fi(libbzip2)1891 b Fl(21)1726 299 y Fi(void)47 b(*unused,)f(int)g
(nUnused)g(\);)150 456 y Fj(Prepare)27 b(to)g(read)f(compressed)h(data)
g(from)f(\014le)g(handle)g Fi(f)p Fj(.)39 b Fi(f)26 b
Fj(should)g(refer)g(to)i(a)e(\014le)h(whic)m(h)f(has)g(b)s(een)150
565 y(op)s(ened)i(for)g(reading,)i(and)d(for)i(whic)m(h)f(the)h(error)g
(indicator)h(\()p Fi(ferror\(f\))p Fj(\)is)c(not)j(set.)41
b(If)29 b Fi(small)e Fj(is)h(1,)150 675 y(the)j(library)f(will)h(try)f
(to)i(decompress)e(using)g(less)h(memory)-8 b(,)31 b(at)g(the)f(exp)s
(ense)g(of)h(sp)s(eed.)150 832 y(F)-8 b(or)37 b(reasons)f(explained)h
(b)s(elo)m(w,)h Fi(BZ2_bzRead)33 b Fj(will)k(decompress)f(the)h
Fi(nUnused)d Fj(b)m(ytes)j(starting)g(at)150 941 y Fi(unused)p
Fj(,)j(b)s(efore)f(starting)h(to)g(read)f(from)g(the)h(\014le)f
Fi(f)p Fj(.)67 b(A)m(t)40 b(most)g Fi(BZ_MAX_UNUSED)35
b Fj(b)m(ytes)40 b(ma)m(y)g(b)s(e)150 1051 y(supplied)34
b(lik)m(e)i(this.)54 b(If)34 b(this)h(facilit)m(y)i(is)e(not)g
(required,)h(y)m(ou)f(should)f(pass)g Fi(NULL)f Fj(and)h
Fi(0)h Fj(for)g Fi(unused)150 1160 y Fj(and)30 b(n)p
Fi(Unused)e Fj(resp)s(ectiv)m(ely)-8 b(.)150 1317 y(F)g(or)31
b(the)g(meaning)f(of)h(parameters)g Fi(small)e Fj(and)g
Fi(verbosity)p Fj(,)f(see)j Fi(BZ2_bzDecompressInit)p
Fj(.)150 1474 y(The)i(amoun)m(t)g(of)f(memory)h(needed)g(to)g
(decompress)g(a)g(\014le)g(cannot)g(b)s(e)f(determined)h(un)m(til)g
(the)g(\014le's)150 1584 y(header)h(has)f(b)s(een)g(read.)51
b(So)33 b(it)i(is)e(p)s(ossible)h(that)g Fi(BZ2_bzReadOpen)c
Fj(returns)j Fi(BZ_OK)g Fj(but)g(a)h(subse-)150 1693
y(quen)m(t)d(call)g(of)g Fi(BZ2_bzRead)c Fj(will)k(return)f
Fi(BZ_MEM_ERROR)p Fj(.)150 1850 y(P)m(ossible)i(assignmen)m(ts)e(to)i
Fi(bzerror)p Fj(:)572 2001 y Fi(BZ_CONFIG_ERROR)663 2105
y Fj(if)e(the)h(library)f(has)g(b)s(een)g(mis-compiled)572
2209 y Fi(BZ_PARAM_ERROR)663 2313 y Fj(if)g Fi(f)g Fj(is)h
Fi(NULL)663 2416 y Fj(or)f Fi(small)f Fj(is)i(neither)g
Fi(0)f Fj(nor)g Fi(1)663 2520 y Fj(or)g Fi(\(unused)46
b(==)h(NULL)g(&&)g(nUnused)f(!=)h(0\))663 2624 y Fj(or)30
b Fi(\(unused)46 b(!=)h(NULL)g(&&)g(!\(0)g(<=)g(nUnused)f(<=)h
(BZ_MAX_UNUSED\)\))572 2728 y(BZ_IO_ERROR)663 2831 y
Fj(if)30 b Fi(ferror\(f\))e Fj(is)i(nonzero)572 2935
y Fi(BZ_MEM_ERROR)663 3039 y Fj(if)g(insu\016cien)m(t)h(memory)f(is)h
(a)m(v)-5 b(ailable)572 3143 y Fi(BZ_OK)663 3247 y Fj(otherwise.)150
3403 y(P)m(ossible)32 b(return)e(v)-5 b(alues:)572 3554
y(P)m(oin)m(ter)32 b(to)f(an)f(abstract)i Fi(BZFILE)663
3658 y Fj(if)e Fi(bzerror)e Fj(is)j Fi(BZ_OK)572 3762
y(NULL)663 3866 y Fj(otherwise)150 4023 y(Allo)m(w)m(able)h(next)f
(actions:)572 4174 y Fi(BZ2_bzRead)663 4277 y Fj(if)f
Fi(bzerror)e Fj(is)j Fi(BZ_OK)572 4381 y(BZ2_bzClose)663
4485 y Fj(otherwise)150 4887 y Fe(3.4.2)63 b Fd(BZ2_bzRead)533
5074 y Fi(int)47 b(BZ2_bzRead)e(\()j(int)e(*bzerror,)g(BZFILE)g(*b,)h
(void)f(*buf,)h(int)g(len)g(\);)150 5230 y Fj(Reads)33
b(up)e(to)j Fi(len)d Fj(\(uncompressed\))i(b)m(ytes)g(from)f(the)h
(compressed)g(\014le)g Fi(b)f Fj(in)m(to)i(the)f(bu\013er)f
Fi(buf)p Fj(.)46 b(If)150 5340 y(the)28 b(read)f(w)m(as)h(successful,)g
Fi(bzerror)d Fj(is)j(set)g(to)g Fi(BZ_OK)f Fj(and)f(the)i(n)m(um)m(b)s
(er)e(of)i(b)m(ytes)g(read)g(is)f(returned.)p eop
%%Page: 22 23
22 22 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
b(with)g Fi(libbzip2)1881 b Fl(22)150 299 y Fj(If)32
b(the)g(logical)i(end-of-stream)e(w)m(as)g(detected,)i
Fi(bzerror)c Fj(will)i(b)s(e)g(set)g(to)h Fi(BZ_STREAM_END)p
Fj(,)c(and)i(the)150 408 y(n)m(um)m(b)s(er)e(of)i(b)m(ytes)g(read)f(is)
h(returned.)40 b(All)30 b(other)h Fi(bzerror)e Fj(v)-5
b(alues)30 b(denote)h(an)f(error.)150 565 y Fi(BZ2_bzRead)k
Fj(will)k(supply)e Fi(len)g Fj(b)m(ytes,)k(unless)d(the)g(logical)j
(stream)d(end)g(is)g(detected)i(or)f(an)e(error)150 675
y(o)s(ccurs.)70 b(Because)40 b(of)g(this,)j(it)e(is)f(p)s(ossible)f(to)
i(detect)h(the)e(stream)h(end)e(b)m(y)h(observing)h(when)e(the)150
784 y(n)m(um)m(b)s(er)24 b(of)h(b)m(ytes)h(returned)e(is)h(less)h(than)
e(the)i(n)m(um)m(b)s(er)e(requested.)39 b(Nev)m(ertheless,)29
b(this)c(is)g(regarded)150 894 y(as)37 b(inadvisable;)i(y)m(ou)e
(should)f(instead)h(c)m(hec)m(k)h Fi(bzerror)c Fj(after)k(ev)m(ery)f
(call)h(and)e(w)m(atc)m(h)h(out)g(for)g Fi(BZ_)150 1004
y(STREAM_END)p Fj(.)150 1160 y(In)m(ternally)-8 b(,)47
b Fi(BZ2_bzRead)39 b Fj(copies)k(data)f(from)g(the)g(compressed)g
(\014le)g(in)g(c)m(h)m(unks)g(of)g(size)h Fi(BZ_MAX_)150
1270 y(UNUSED)28 b Fj(b)m(ytes)j(b)s(efore)e(decompressing)h(it.)41
b(If)30 b(the)g(\014le)g(con)m(tains)h(more)f(b)m(ytes)h(than)e
(strictly)i(needed)150 1380 y(to)46 b(reac)m(h)g(the)f(logical)i
(end-of-stream,)j Fi(BZ2_bzRead)42 b Fj(will)j(almost)h(certainly)g
(read)f(some)g(of)h(the)150 1489 y(trailing)f(data)g(b)s(efore)f
(signalling)h Fi(BZ_SEQUENCE_END)p Fj(.)78 b(T)-8 b(o)45
b(collect)i(the)d(read)g(but)g(un)m(used)f(data)150 1599
y(once)27 b Fi(BZ_SEQUENCE_END)22 b Fj(has)k(app)s(eared,)g(call)h
Fi(BZ2_bzReadGetUnused)21 b Fj(immediately)28 b(b)s(efore)e
Fi(BZ2_)150 1708 y(bzReadClose)p Fj(.)150 1865 y(P)m(ossible)32
b(assignmen)m(ts)e(to)i Fi(bzerror)p Fj(:)572 2016 y
Fi(BZ_PARAM_ERROR)663 2120 y Fj(if)e Fi(b)g Fj(is)h Fi(NULL)e
Fj(or)h Fi(buf)g Fj(is)g Fi(NULL)f Fj(or)i Fi(len)47
b(<)g(0)572 2224 y(BZ_SEQUENCE_ERROR)663 2328 y Fj(if)30
b Fi(b)g Fj(w)m(as)h(op)s(ened)e(with)h Fi(BZ2_bzWriteOpen)572
2431 y(BZ_IO_ERROR)663 2535 y Fj(if)g(there)h(is)f(an)g(error)h
(reading)g(from)f(the)h(compressed)f(\014le)572 2639
y Fi(BZ_UNEXPECTED_EOF)663 2743 y Fj(if)g(the)h(compressed)f(\014le)h
(ended)e(b)s(efore)i(the)f(logical)j(end-of-stream)e(w)m(as)g(detected)
572 2847 y Fi(BZ_DATA_ERROR)663 2950 y Fj(if)f(a)h(data)f(in)m(tegrit)m
(y)j(error)e(w)m(as)g(detected)g(in)g(the)f(compressed)h(stream)572
3054 y Fi(BZ_DATA_ERROR_MAGIC)663 3158 y Fj(if)f(the)h(stream)g(do)s
(es)f(not)g(b)s(egin)g(with)h(the)f(requisite)i(header)e(b)m(ytes)h
(\(ie,)h(is)e(not)663 3262 y(a)g Fi(bzip2)f Fj(data)i(\014le\).)61
b(This)30 b(is)h(really)g(a)f(sp)s(ecial)h(case)g(of)g
Fi(BZ_DATA_ERROR)p Fj(.)572 3365 y Fi(BZ_MEM_ERROR)663
3469 y Fj(if)f(insu\016cien)m(t)h(memory)f(w)m(as)h(a)m(v)-5
b(ailable)572 3573 y Fi(BZ_STREAM_END)663 3677 y Fj(if)30
b(the)h(logical)h(end)e(of)h(stream)g(w)m(as)f(detected.)572
3781 y Fi(BZ_OK)663 3884 y Fj(otherwise.)150 4041 y(P)m(ossible)i
(return)e(v)-5 b(alues:)572 4192 y(n)m(um)m(b)s(er)29
b(of)i(b)m(ytes)g(read)663 4296 y(if)f Fi(bzerror)e Fj(is)j
Fi(BZ_OK)e Fj(or)h Fi(BZ_STREAM_END)572 4400 y Fj(unde\014ned)663
4503 y(otherwise)150 4660 y(Allo)m(w)m(able)i(next)f(actions:)572
4811 y(collect)i(data)d(from)h Fi(buf)p Fj(,)e(then)i
Fi(BZ2_bzRead)c Fj(or)k Fi(BZ2_bzReadClose)663 4915 y
Fj(if)f Fi(bzerror)e Fj(is)j Fi(BZ_OK)572 5019 y Fj(collect)i(data)d
(from)h Fi(buf)p Fj(,)e(then)i Fi(BZ2_bzReadClose)26
b Fj(or)k Fi(BZ2_bzReadGetUnused)663 5123 y Fj(if)g Fi(bzerror)e
Fj(is)j Fi(BZ_SEQUENCE_END)572 5226 y(BZ2_bzReadClose)663
5330 y Fj(otherwise)p eop
%%Page: 23 24
23 23 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
b(with)g Fi(libbzip2)1881 b Fl(23)150 299 y Fe(3.4.3)63
b Fd(BZ2_bzReadGetUnused)533 486 y Fi(void)47 b(BZ2_bzReadGetUnused)42
b(\()48 b(int*)e(bzerror,)g(BZFILE)g(*b,)1822 589 y(void**)g(unused,)g
(int*)g(nUnused)g(\);)150 746 y Fj(Returns)35 b(data)g(whic)m(h)f(w)m
(as)i(read)e(from)h(the)g(compressed)g(\014le)g(but)g(w)m(as)g(not)g
(needed)g(to)h(get)g(to)g(the)150 856 y(logical)44 b(end-of-stream.)76
b Fi(*unused)39 b Fj(is)j(set)h(to)f(the)g(address)f(of)h(the)g(data,)k
(and)40 b Fi(*nUnused)g Fj(to)j(the)150 965 y(n)m(um)m(b)s(er)28
b(of)h(b)m(ytes.)41 b Fi(*nUnused)27 b Fj(will)i(b)s(e)g(set)g(to)h(a)f
(v)-5 b(alue)30 b(b)s(et)m(w)m(een)g Fi(0)e Fj(and)g
Fi(BZ_MAX_UNUSED)e Fj(inclusiv)m(e.)150 1122 y(This)f(function)g(ma)m
(y)h(only)f(b)s(e)g(called)h(once)g Fi(BZ2_bzRead)d Fj(has)i(signalled)
h Fi(BZ_STREAM_END)21 b Fj(but)k(b)s(efore)150 1232 y
Fi(BZ2_bzReadClose)p Fj(.)150 1389 y(P)m(ossible)32 b(assignmen)m(ts)e
(to)i Fi(bzerror)p Fj(:)572 1540 y Fi(BZ_PARAM_ERROR)663
1644 y Fj(if)e Fi(b)g Fj(is)h Fi(NULL)663 1747 y Fj(or)f
Fi(unused)f Fj(is)h Fi(NULL)g Fj(or)g Fi(nUnused)f Fj(is)h
Fi(NULL)572 1851 y(BZ_SEQUENCE_ERROR)663 1955 y Fj(if)g
Fi(BZ_STREAM_END)d Fj(has)j(not)g(b)s(een)g(signalled)663
2059 y(or)g(if)h Fi(b)f Fj(w)m(as)g(op)s(ened)g(with)g
Fi(BZ2_bzWriteOpen)542 2162 y(BZ_OK)663 2266 y Fj(otherwise)150
2423 y(Allo)m(w)m(able)i(next)f(actions:)572 2574 y Fi(BZ2_bzReadClose)
150 2882 y Fe(3.4.4)63 b Fd(BZ2_bzReadClose)533 3068
y Fi(void)47 b(BZ2_bzReadClose)c(\()48 b(int)f(*bzerror,)e(BZFILE)h(*b)
h(\);)150 3225 y Fj(Releases)35 b(all)e(memory)h(p)s(ertaining)f(to)h
(the)f(compressed)h(\014le)f Fi(b)p Fj(.)49 b Fi(BZ2_bzReadClose)29
b Fj(do)s(es)j(not)i(call)150 3335 y Fi(fclose)d Fj(on)h(the)g
(underlying)g(\014le)g(handle,)h(so)f(y)m(ou)h(should)e(do)h(that)h(y)m
(ourself)g(if)f(appropriate.)47 b Fi(BZ2_)150 3445 y(bzReadClose)27
b Fj(should)j(b)s(e)f(called)j(to)f(clean)g(up)e(after)i(all)g(error)g
(situations.)150 3601 y(P)m(ossible)h(assignmen)m(ts)e(to)i
Fi(bzerror)p Fj(:)572 3752 y Fi(BZ_SEQUENCE_ERROR)663
3856 y Fj(if)e Fi(b)g Fj(w)m(as)h(op)s(ened)e(with)h
Fi(BZ2_bzOpenWrite)572 3960 y(BZ_OK)663 4064 y Fj(otherwise)150
4221 y(Allo)m(w)m(able)i(next)f(actions:)572 4372 y(none)150
4679 y Fe(3.4.5)63 b Fd(BZ2_bzWriteOpen)533 4866 y Fi(BZFILE)46
b(*BZ2_bzWriteOpen)e(\()j(int)g(*bzerror,)e(FILE)i(*f,)1774
4970 y(int)g(blockSize100k,)d(int)j(verbosity,)1774 5074
y(int)g(workFactor)e(\);)150 5230 y Fj(Prepare)31 b(to)h(write)g
(compressed)f(data)g(to)h(\014le)f(handle)f Fi(f)p Fj(.)42
b Fi(f)30 b Fj(should)g(refer)i(to)f(a)h(\014le)f(whic)m(h)f(has)h(b)s
(een)150 5340 y(op)s(ened)f(for)g(writing,)h(and)f(for)g(whic)m(h)g
(the)h(error)g(indicator)g(\()p Fi(ferror\(f\))p Fj(\)is)e(not)h(set.)p
eop
%%Page: 24 25
24 24 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
b(with)g Fi(libbzip2)1881 b Fl(24)150 299 y Fj(F)-8 b(or)31
b(the)g(meaning)f(of)h(parameters)g Fi(blockSize100k)p
Fj(,)c Fi(verbosity)h Fj(and)h Fi(workFactor)p Fj(,)f(see)150
408 y Fi(BZ2_bzCompressInit)p Fj(.)150 565 y(All)38 b(required)g
(memory)g(is)g(allo)s(cated)i(at)e(this)h(stage,)i(so)d(if)g(the)h
(call)g(completes)g(successfully)-8 b(,)41 b Fi(BZ_)150
675 y(MEM_ERROR)28 b Fj(cannot)j(b)s(e)e(signalled)i(b)m(y)g(a)f
(subsequen)m(t)g(call)h(to)h Fi(BZ2_bzWrite)p Fj(.)150
832 y(P)m(ossible)g(assignmen)m(ts)e(to)i Fi(bzerror)p
Fj(:)572 983 y Fi(BZ_CONFIG_ERROR)663 1087 y Fj(if)e(the)h(library)f
(has)g(b)s(een)g(mis-compiled)572 1190 y Fi(BZ_PARAM_ERROR)663
1294 y Fj(if)g Fi(f)g Fj(is)h Fi(NULL)663 1398 y Fj(or)f
Fi(blockSize100k)45 b(<)i(1)30 b Fj(or)h Fi(blockSize100k)44
b(>)j(9)572 1502 y(BZ_IO_ERROR)663 1605 y Fj(if)30 b
Fi(ferror\(f\))e Fj(is)i(nonzero)572 1709 y Fi(BZ_MEM_ERROR)663
1813 y Fj(if)g(insu\016cien)m(t)h(memory)f(is)h(a)m(v)-5
b(ailable)572 1917 y Fi(BZ_OK)663 2021 y Fj(otherwise)150
2177 y(P)m(ossible)32 b(return)e(v)-5 b(alues:)572 2328
y(P)m(oin)m(ter)32 b(to)f(an)f(abstract)i Fi(BZFILE)663
2432 y Fj(if)e Fi(bzerror)e Fj(is)j Fi(BZ_OK)572 2536
y(NULL)663 2640 y Fj(otherwise)150 2797 y(Allo)m(w)m(able)h(next)f
(actions:)572 2948 y Fi(BZ2_bzWrite)663 3051 y Fj(if)f
Fi(bzerror)e Fj(is)j Fi(BZ_OK)597 3155 y Fj(\(y)m(ou)24
b(could)f(go)h(directly)g(to)g Fi(BZ2_bzWriteClose)p
Fj(,)19 b(but)j(this)h(w)m(ould)g(b)s(e)g(prett)m(y)h(p)s(oin)m
(tless\))572 3259 y Fi(BZ2_bzWriteClose)663 3363 y Fj(otherwise)150
3852 y Fe(3.4.6)63 b Fd(BZ2_bzWrite)533 4039 y Fi(void)47
b(BZ2_bzWrite)e(\()i(int)g(*bzerror,)e(BZFILE)h(*b,)h(void)g(*buf,)f
(int)h(len)g(\);)150 4196 y Fj(Absorbs)35 b Fi(len)h
Fj(b)m(ytes)h(from)f(the)h(bu\013er)f Fi(buf)p Fj(,)h(ev)m(en)m(tually)
i(to)e(b)s(e)f(compressed)g(and)g(written)h(to)h(the)150
4306 y(\014le.)150 4463 y(P)m(ossible)32 b(assignmen)m(ts)e(to)i
Fi(bzerror)p Fj(:)572 4614 y Fi(BZ_PARAM_ERROR)663 4717
y Fj(if)e Fi(b)g Fj(is)h Fi(NULL)e Fj(or)h Fi(buf)g Fj(is)g
Fi(NULL)f Fj(or)i Fi(len)47 b(<)g(0)572 4821 y(BZ_SEQUENCE_ERROR)663
4925 y Fj(if)30 b(b)g(w)m(as)g(op)s(ened)g(with)g Fi(BZ2_bzReadOpen)572
5029 y(BZ_IO_ERROR)663 5132 y Fj(if)g(there)h(is)f(an)g(error)h
(writing)g(the)g(compressed)f(\014le.)572 5236 y Fi(BZ_OK)663
5340 y Fj(otherwise)p eop
%%Page: 25 26
25 25 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
b(with)g Fi(libbzip2)1881 b Fl(25)150 299 y Fe(3.4.7)63
b Fd(BZ2_bzWriteClose)533 486 y Fi(void)47 b(BZ2_bzWriteClose)c(\()48
b(int)f(*bzerror,)e(BZFILE*)h(f,)1679 589 y(int)h(abandon,)1679
693 y(unsigned)e(int*)i(nbytes_in,)1679 797 y(unsigned)e(int*)i
(nbytes_out)e(\);)533 1005 y(void)i(BZ2_bzWriteClose64)c(\()k(int)g
(*bzerror,)e(BZFILE*)h(f,)1774 1108 y(int)h(abandon,)1774
1212 y(unsigned)f(int*)g(nbytes_in_lo32,)1774 1316 y(unsigned)g(int*)g
(nbytes_in_hi32,)1774 1420 y(unsigned)g(int*)g(nbytes_out_lo32,)1774
1523 y(unsigned)g(int*)g(nbytes_out_hi32)e(\);)150 1680
y Fj(Compresses)38 b(and)f(\015ushes)g(to)i(the)g(compressed)f(\014le)h
(all)f(data)h(so)g(far)f(supplied)f(b)m(y)h Fi(BZ2_bzWrite)p
Fj(.)150 1790 y(The)h(logical)i(end-of-stream)e(mark)m(ers)h(are)f
(also)g(written,)j(so)d(subsequen)m(t)g(calls)g(to)h
Fi(BZ2_bzWrite)150 1899 y Fj(are)31 b(illegal.)45 b(All)31
b(memory)g(asso)s(ciated)h(with)f(the)g(compressed)g(\014le)h
Fi(b)e Fj(is)h(released.)44 b Fi(fflush)29 b Fj(is)i(called)150
2009 y(on)f(the)h(compressed)f(\014le,)h(but)f(it)h(is)f(not)h
Fi(fclose)p Fj('d.)150 2166 y(If)g Fi(BZ2_bzWriteClose)d
Fj(is)j(called)i(to)f(clean)g(up)f(after)h(an)f(error,)i(the)f(only)g
(action)h(is)e(to)i(release)g(the)150 2275 y(memory)-8
b(.)40 b(The)28 b(library)g(records)g(the)g(error)g(co)s(des)g(issued)f
(b)m(y)g(previous)h(calls,)h(so)f(this)g(situation)h(will)150
2385 y(b)s(e)37 b(detected)i(automatically)-8 b(.)64
b(There)38 b(is)f(no)h(attempt)g(to)h(complete)g(the)e(compression)h
(op)s(eration,)150 2495 y(nor)f(to)h Fi(fflush)e Fj(the)h(compressed)g
(\014le.)62 b(Y)-8 b(ou)37 b(can)g(force)h(this)g(b)s(eha)m(viour)e(to)
i(happ)s(en)e(ev)m(en)i(in)f(the)150 2604 y(case)31 b(of)g(no)f(error,)
h(b)m(y)f(passing)g(a)h(nonzero)g(v)-5 b(alue)30 b(to)i
Fi(abandon)p Fj(.)150 2761 y(If)h Fi(nbytes_in)d Fj(is)j(non-n)m(ull,)g
Fi(*nbytes_in)d Fj(will)j(b)s(e)f(set)i(to)f(b)s(e)g(the)g(total)h(v)m
(olume)g(of)f(uncompressed)150 2871 y(data)k(handled.)58
b(Similarly)-8 b(,)38 b Fi(nbytes_out)c Fj(will)j(b)s(e)f(set)h(to)g
(the)g(total)h(v)m(olume)g(of)e(compressed)h(data)150
2980 y(written.)i(F)-8 b(or)24 b(compatibilit)m(y)i(with)d(older)h(v)m
(ersions)g(of)g(the)g(library)-8 b(,)25 b Fi(BZ2_bzWriteClose)19
b Fj(only)24 b(yields)150 3090 y(the)39 b(lo)m(w)m(er)i(32)e(bits)g(of)
g(these)g(coun)m(ts.)67 b(Use)39 b Fi(BZ2_bzWriteClose64)34
b Fj(if)39 b(y)m(ou)g(w)m(an)m(t)g(the)h(full)e(64)i(bit)150
3199 y(coun)m(ts.)h(These)31 b(t)m(w)m(o)h(functions)e(are)h(otherwise)
g(absolutely)g(iden)m(tical.)150 3356 y(P)m(ossible)h(assignmen)m(ts)e
(to)i Fi(bzerror)p Fj(:)572 3507 y Fi(BZ_SEQUENCE_ERROR)663
3611 y Fj(if)e Fi(b)g Fj(w)m(as)h(op)s(ened)e(with)h
Fi(BZ2_bzReadOpen)572 3715 y(BZ_IO_ERROR)663 3819 y Fj(if)g(there)h(is)
f(an)g(error)h(writing)g(the)g(compressed)f(\014le)572
3922 y Fi(BZ_OK)663 4026 y Fj(otherwise)150 4296 y Fe(3.4.8)63
b(Handling)41 b(em)m(b)s(edded)g(compressed)h(data)e(streams)150
4489 y Fj(The)i(high-lev)m(el)h(library)e(facilitates)k(use)c(of)h
Fi(bzip2)e Fj(data)i(streams)g(whic)m(h)f(form)g(some)h(part)g(of)g(a)
150 4598 y(surrounding,)29 b(larger)i(data)g(stream.)225
4755 y Fh(\017)60 b Fj(F)-8 b(or)49 b(writing,)k(the)c(library)f(tak)m
(es)i(an)e(op)s(en)f(\014le)i(handle,)j(writes)d(compressed)f(data)h
(to)g(it,)330 4865 y Fi(fflush)p Fj(es)37 b(it)h(but)f(do)s(es)h(not)g
Fi(fclose)f Fj(it.)64 b(The)38 b(calling)h(application)g(can)f(write)g
(its)h(o)m(wn)f(data)330 4974 y(b)s(efore)30 b(and)g(after)h(the)g
(compressed)f(data)h(stream,)g(using)f(that)h(same)f(\014le)h(handle.)
225 5121 y Fh(\017)60 b Fj(Reading)33 b(is)g(more)g(complex,)h(and)e
(the)h(facilities)i(are)e(not)g(as)g(general)h(as)f(they)g(could)f(b)s
(e)h(since)330 5230 y(generalit)m(y)e(is)d(hard)g(to)h(reconcile)i
(with)d(e\016ciency)-8 b(.)42 b Fi(BZ2_bzRead)25 b Fj(reads)k(from)f
(the)h(compressed)330 5340 y(\014le)39 b(in)g(blo)s(c)m(ks)g(of)h(size)
f Fi(BZ_MAX_UNUSED)d Fj(b)m(ytes,)42 b(and)c(in)h(doing)g(so)g
(probably)g(will)g(o)m(v)m(ersho)s(ot)p eop
%%Page: 26 27
26 26 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
b(with)g Fi(libbzip2)1881 b Fl(26)330 299 y Fj(the)37
b(logical)i(end)e(of)g(compressed)g(stream.)60 b(T)-8
b(o)38 b(reco)m(v)m(er)i(this)c(data)i(once)f(decompression)g(has)330
408 y(ended,)27 b(call)h Fi(BZ2_bzReadGetUnused)21 b
Fj(after)27 b(the)g(last)h(call)f(of)g Fi(BZ2_bzRead)d
Fj(\(the)j(one)g(returning)330 518 y Fi(BZ_STREAM_END)p
Fj(\))g(but)j(b)s(efore)g(calling)i Fi(BZ2_bzReadClose)p
Fj(.)150 702 y(This)j(mec)m(hanism)h(mak)m(es)g(it)h(easy)f(to)g
(decompress)g(m)m(ultiple)g Fi(bzip2)e Fj(streams)i(placed)g
(end-to-end.)150 812 y(As)67 b(the)h(end)g(of)f(one)i(stream,)77
b(when)67 b Fi(BZ2_bzRead)e Fj(returns)j Fi(BZ_STREAM_END)p
Fj(,)73 b(call)c Fi(BZ2_)150 921 y(bzReadGetUnused)34
b Fj(to)40 b(collect)h(the)e(un)m(used)e(data)i(\(cop)m(y)g(it)g(in)m
(to)h(y)m(our)f(o)m(wn)f(bu\013er)g(somewhere\).)150
1031 y(That)52 b(data)h(forms)f(the)g(start)h(of)f(the)h(next)f
(compressed)g(stream.)107 b(T)-8 b(o)53 b(start)g(uncompressing)150
1140 y(that)61 b(next)f(stream,)68 b(call)62 b Fi(BZ2_bzReadOpen)56
b Fj(again,)68 b(feeding)61 b(in)e(the)i(un)m(used)e(data)h(via)h(the)
150 1250 y Fi(unused)p Fj(/)p Fi(nUnused)28 b Fj(parameters.)45
b(Keep)32 b(doing)f(this)h(un)m(til)g Fi(BZ_STREAM_END)c
Fj(return)j(coincides)h(with)150 1360 y(the)j(ph)m(ysical)g(end)f(of)h
(\014le)f(\()p Fi(feof\(f\))p Fj(\).)52 b(In)34 b(this)h(situation)g
Fi(BZ2_bzReadGetUnused)30 b Fj(will)35 b(of)f(course)150
1469 y(return)c(no)g(data.)150 1626 y(This)24 b(should)g(giv)m(e)i
(some)f(feel)h(for)f(ho)m(w)g(the)g(high-lev)m(el)h(in)m(terface)h(can)
d(b)s(e)g(used.)38 b(If)25 b(y)m(ou)g(require)g(extra)150
1736 y(\015exibilit)m(y)-8 b(,)32 b(y)m(ou'll)g(ha)m(v)m(e)f(to)g(bite)
g(the)g(bullet)g(and)e(get)j(to)f(grips)f(with)h(the)f(lo)m(w-lev)m(el)
k(in)m(terface.)150 1987 y Fe(3.4.9)63 b(Standard)40
b(\014le-reading/writing)j(co)s(de)150 2179 y Fj(Here's)31
b(ho)m(w)g(y)m(ou'd)f(write)h(data)g(to)g(a)g(compressed)f(\014le:)390
2538 y Fi(FILE*)142 b(f;)390 2642 y(BZFILE*)46 b(b;)390
2746 y(int)238 b(nBuf;)390 2849 y(char)190 b(buf[)46
b(/*)i(whatever)d(size)i(you)g(like)f(*/)i(];)390 2953
y(int)238 b(bzerror;)390 3057 y(int)g(nWritten;)390 3264
y(f)47 b(=)h(fopen)e(\()i("myfile.bz2",)c("w")j(\);)390
3368 y(if)g(\(!f\))g({)533 3472 y(/*)g(handle)f(error)h(*/)390
3576 y(})390 3680 y(b)g(=)h(BZ2_bzWriteOpen)c(\()j(&bzerror,)e(f,)i(9)h
(\);)390 3783 y(if)f(\(bzerror)f(!=)h(BZ_OK\))f({)533
3887 y(BZ2_bzWriteClose)e(\()j(b)g(\);)533 3991 y(/*)g(handle)f(error)h
(*/)390 4095 y(})390 4302 y(while)f(\()i(/*)f(condition)e(*/)i(\))h({)
533 4406 y(/*)f(get)g(data)g(to)g(write)f(into)h(buf,)g(and)g(set)g
(nBuf)f(appropriately)e(*/)533 4510 y(nWritten)i(=)h(BZ2_bzWrite)e(\()i
(&bzerror,)f(b,)h(buf,)f(nBuf)h(\);)533 4614 y(if)g(\(bzerror)f(==)h
(BZ_IO_ERROR\))e({)676 4717 y(BZ2_bzWriteClose)f(\()j(&bzerror,)e(b)j
(\);)676 4821 y(/*)g(handle)e(error)g(*/)533 4925 y(})390
5029 y(})390 5236 y(BZ2_bzWriteClose)d(\()48 b(&bzerror,)d(b)j(\);)390
5340 y(if)f(\(bzerror)f(==)h(BZ_IO_ERROR\))d({)p eop
%%Page: 27 28
27 27 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
b(with)g Fi(libbzip2)1881 b Fl(27)533 299 y Fi(/*)47
b(handle)f(error)h(*/)390 403 y(})150 559 y Fj(And)29
b(to)i(read)g(from)f(a)g(compressed)h(\014le:)390 711
y Fi(FILE*)142 b(f;)390 814 y(BZFILE*)46 b(b;)390 918
y(int)238 b(nBuf;)390 1022 y(char)190 b(buf[)46 b(/*)i(whatever)d(size)
i(you)g(like)f(*/)i(];)390 1126 y(int)238 b(bzerror;)390
1229 y(int)g(nWritten;)390 1437 y(f)47 b(=)h(fopen)e(\()i
("myfile.bz2",)c("r")j(\);)390 1541 y(if)g(\(!f\))g({)533
1645 y(/*)g(handle)f(error)h(*/)390 1748 y(})390 1852
y(b)g(=)h(BZ2_bzReadOpen)c(\()j(&bzerror,)f(f,)h(0,)g(NULL,)f(0)i(\);)
390 1956 y(if)f(\(bzerror)f(!=)h(BZ_OK\))f({)533 2060
y(BZ2_bzReadClose)e(\()j(&bzerror,)f(b)h(\);)533 2163
y(/*)g(handle)f(error)h(*/)390 2267 y(})390 2475 y(bzerror)f(=)h
(BZ_OK;)390 2579 y(while)f(\(bzerror)g(==)h(BZ_OK)f(&&)i(/*)f
(arbitrary)e(other)h(conditions)f(*/\))i({)533 2682 y(nBuf)g(=)g
(BZ2_bzRead)e(\()j(&bzerror,)d(b,)i(buf,)g(/*)g(size)g(of)g(buf)g(*/)g
(\);)533 2786 y(if)g(\(bzerror)f(==)h(BZ_OK\))f({)676
2890 y(/*)i(do)f(something)e(with)i(buf[0)f(..)h(nBuf-1])f(*/)533
2994 y(})390 3097 y(})390 3201 y(if)h(\(bzerror)f(!=)h(BZ_STREAM_END\))
d({)533 3305 y(BZ2_bzReadClose)g(\()j(&bzerror,)f(b)h(\);)533
3409 y(/*)g(handle)f(error)h(*/)390 3513 y(})g(else)g({)533
3616 y(BZ2_bzReadClose)d(\()j(&bzerror)f(\);)390 3720
y(})150 3991 y Fk(3.5)68 b(Utilit)l(y)47 b(functions)150
4264 y Fe(3.5.1)63 b Fd(BZ2_bzBuffToBuffCompress)533
4451 y Fi(int)47 b(BZ2_bzBuffToBuffCompress\()41 b(char*)428
b(dest,)1965 4555 y(unsigned)46 b(int*)g(destLen,)1965
4658 y(char*)428 b(source,)1965 4762 y(unsigned)46 b(int)94
b(sourceLen,)1965 4866 y(int)524 b(blockSize100k,)1965
4970 y(int)g(verbosity,)1965 5074 y(int)g(workFactor)45
b(\);)150 5230 y Fj(A)m(ttempts)32 b(to)f(compress)f(the)h(data)g(in)f
Fi(source[0)e(..)i(sourceLen-1])d Fj(in)m(to)k(the)g(destination)g
(bu\013er,)150 5340 y Fi(dest[0)e(..)g(*destLen-1])p
Fj(.)36 b(If)25 b(the)g(destination)h(bu\013er)e(is)h(big)f(enough,)i
Fi(*destLen)d Fj(is)i(set)g(to)h(the)f(size)p eop
%%Page: 28 29
28 28 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
b(with)g Fi(libbzip2)1881 b Fl(28)150 299 y Fj(of)27
b(the)f(compressed)h(data,)h(and)d Fi(BZ_OK)g Fj(is)i(returned.)38
b(If)27 b(the)f(compressed)h(data)g(w)m(on't)g(\014t,)g
Fi(*destLen)150 408 y Fj(is)j(unc)m(hanged,)g(and)g Fi(BZ_OUTBUFF_FULL)
c Fj(is)31 b(returned.)150 565 y(Compression)22 b(in)h(this)f(manner)g
(is)h(a)f(one-shot)i(ev)m(en)m(t,)i(done)d(with)f(a)h(single)g(call)h
(to)f(this)g(function.)38 b(The)150 675 y(resulting)26
b(compressed)g(data)f(is)h(a)g(complete)h Fi(bzip2)d
Fj(format)i(data)g(stream.)39 b(There)26 b(is)f(no)h(mec)m(hanism)150
784 y(for)d(making)g(additional)h(calls)f(to)h(pro)m(vide)g(extra)f
(input)g(data.)38 b(If)23 b(y)m(ou)g(w)m(an)m(t)h(that)f(kind)f(of)i
(mec)m(hanism,)150 894 y(use)30 b(the)h(lo)m(w-lev)m(el)i(in)m
(terface.)150 1051 y(F)-8 b(or)31 b(the)g(meaning)f(of)h(parameters)g
Fi(blockSize100k)p Fj(,)c Fi(verbosity)h Fj(and)h Fi(workFactor)p
Fj(,)150 1160 y(see)i Fi(BZ2_bzCompressInit)p Fj(.)150
1317 y(T)-8 b(o)37 b(guaran)m(tee)h(that)f(the)f(compressed)h(data)f
(will)h(\014t)f(in)g(its)h(bu\013er,)g(allo)s(cate)h(an)e(output)g
(bu\013er)g(of)150 1427 y(size)31 b(1\045)g(larger)g(than)f(the)h
(uncompressed)e(data,)i(plus)f(six)g(h)m(undred)f(extra)i(b)m(ytes.)150
1584 y Fi(BZ2_bzBuffToBuffDecompre)o(ss)24 b Fj(will)31
b(not)g(write)g(data)f(at)h(or)g(b)s(ey)m(ond)e Fi(dest[*destLen])p
Fj(,)e(ev)m(en)k(in)150 1693 y(case)g(of)g(bu\013er)e(o)m(v)m(er\015o)m
(w.)150 1850 y(P)m(ossible)j(return)e(v)-5 b(alues:)572
2001 y Fi(BZ_CONFIG_ERROR)663 2105 y Fj(if)30 b(the)h(library)f(has)g
(b)s(een)g(mis-compiled)572 2209 y Fi(BZ_PARAM_ERROR)663
2313 y Fj(if)g Fi(dest)f Fj(is)i Fi(NULL)e Fj(or)i Fi(destLen)d
Fj(is)i Fi(NULL)663 2416 y Fj(or)g Fi(blockSize100k)45
b(<)i(1)30 b Fj(or)h Fi(blockSize100k)44 b(>)j(9)663
2520 y Fj(or)30 b Fi(verbosity)46 b(<)h(0)30 b Fj(or)h
Fi(verbosity)45 b(>)i(4)663 2624 y Fj(or)30 b Fi(workFactor)45
b(<)j(0)30 b Fj(or)g Fi(workFactor)45 b(>)j(250)572 2728
y(BZ_MEM_ERROR)663 2831 y Fj(if)30 b(insu\016cien)m(t)h(memory)f(is)h
(a)m(v)-5 b(ailable)572 2935 y Fi(BZ_OUTBUFF_FULL)663
3039 y Fj(if)30 b(the)h(size)g(of)g(the)f(compressed)h(data)f(exceeds)i
Fi(*destLen)572 3143 y(BZ_OK)663 3247 y Fj(otherwise)150
3616 y Fe(3.5.2)63 b Fd(BZ2_bzBuffToBuffDecompress)533
3803 y Fi(int)47 b(BZ2_bzBuffToBuffDecompres)o(s)42 b(\()47
b(char*)428 b(dest,)2108 3906 y(unsigned)46 b(int*)g(destLen,)2108
4010 y(char*)428 b(source,)2108 4114 y(unsigned)46 b(int)94
b(sourceLen,)2108 4218 y(int)524 b(small,)2108 4322 y(int)g(verbosity)
46 b(\);)150 4478 y Fj(A)m(ttempts)22 b(to)g(decompress)f(the)h(data)f
(in)g Fi(source[0)28 b(..)i(sourceLen-1])18 b Fj(in)m(to)k(the)f
(destination)h(bu\013er,)150 4588 y Fi(dest[0)29 b(..)g(*destLen-1])p
Fj(.)61 b(If)37 b(the)h(destination)h(bu\013er)e(is)h(big)g(enough,)i
Fi(*destLen)35 b Fj(is)j(set)h(to)g(the)150 4698 y(size)e(of)e(the)h
(uncompressed)f(data,)j(and)c Fi(BZ_OK)h Fj(is)g(returned.)56
b(If)36 b(the)g(compressed)f(data)h(w)m(on't)h(\014t,)150
4807 y Fi(*destLen)28 b Fj(is)j(unc)m(hanged,)f(and)f
Fi(BZ_OUTBUFF_FULL)d Fj(is)31 b(returned.)150 4964 y
Fi(source)e Fj(is)h(assumed)f(to)j(hold)e(a)g(complete)i
Fi(bzip2)d Fj(format)i(data)g(stream.)150 5074 y Fi
(BZ2_bzBuffToBuffDecompre)o(ss)38 b Fj(tries)46 b(to)f(decompress)f
(the)h(en)m(tiret)m(y)i(of)d(the)h(stream)g(in)m(to)h(the)150
5183 y(output)30 b(bu\013er.)150 5340 y(F)-8 b(or)31
b(the)g(meaning)f(of)h(parameters)g Fi(small)e Fj(and)g
Fi(verbosity)p Fj(,)f(see)j Fi(BZ2_bzDecompressInit)p
Fj(.)p eop
%%Page: 29 30
29 29 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
b(with)g Fi(libbzip2)1881 b Fl(29)150 299 y Fj(Because)31
b(the)g(compression)g(ratio)g(of)g(the)g(compressed)f(data)h(cannot)g
(b)s(e)f(kno)m(wn)g(in)g(adv)-5 b(ance,)31 b(there)150
408 y(is)g(no)f(easy)i(w)m(a)m(y)f(to)h(guaran)m(tee)g(that)f(the)g
(output)g(bu\013er)f(will)h(b)s(e)f(big)h(enough.)42
b(Y)-8 b(ou)30 b(ma)m(y)i(of)e(course)150 518 y(mak)m(e)j(arrangemen)m
(ts)h(in)e(y)m(our)h(co)s(de)f(to)i(record)f(the)g(size)g(of)g(the)g
(uncompressed)e(data,)j(but)e(suc)m(h)g(a)150 628 y(mec)m(hanism)e(is)h
(b)s(ey)m(ond)f(the)g(scop)s(e)h(of)f(this)h(library)-8
b(.)150 784 y Fi(BZ2_bzBuffToBuffDecompre)o(ss)24 b Fj(will)31
b(not)g(write)g(data)f(at)h(or)g(b)s(ey)m(ond)e Fi(dest[*destLen])p
Fj(,)e(ev)m(en)k(in)150 894 y(case)g(of)g(bu\013er)e(o)m(v)m(er\015o)m
(w.)150 1051 y(P)m(ossible)j(return)e(v)-5 b(alues:)572
1202 y Fi(BZ_CONFIG_ERROR)663 1306 y Fj(if)30 b(the)h(library)f(has)g
(b)s(een)g(mis-compiled)572 1409 y Fi(BZ_PARAM_ERROR)663
1513 y Fj(if)g Fi(dest)f Fj(is)i Fi(NULL)e Fj(or)i Fi(destLen)d
Fj(is)i Fi(NULL)663 1617 y Fj(or)g Fi(small)47 b(!=)g(0)g(&&)h(small)e
(!=)h(1)663 1721 y Fj(or)30 b Fi(verbosity)46 b(<)h(0)30
b Fj(or)h Fi(verbosity)45 b(>)i(4)572 1825 y(BZ_MEM_ERROR)663
1928 y Fj(if)30 b(insu\016cien)m(t)h(memory)f(is)h(a)m(v)-5
b(ailable)572 2032 y Fi(BZ_OUTBUFF_FULL)663 2136 y Fj(if)30
b(the)h(size)g(of)g(the)f(compressed)h(data)f(exceeds)i
Fi(*destLen)572 2240 y(BZ_DATA_ERROR)663 2343 y Fj(if)e(a)h(data)f(in)m
(tegrit)m(y)j(error)e(w)m(as)g(detected)g(in)g(the)f(compressed)h(data)
572 2447 y Fi(BZ_DATA_ERROR_MAGIC)663 2551 y Fj(if)f(the)h(compressed)f
(data)h(do)s(esn't)f(b)s(egin)g(with)g(the)h(righ)m(t)g(magic)h(b)m
(ytes)572 2655 y Fi(BZ_UNEXPECTED_EOF)663 2759 y Fj(if)e(the)h
(compressed)f(data)h(ends)e(unexp)s(ectedly)572 2862
y Fi(BZ_OK)663 2966 y Fj(otherwise)150 3370 y Fk(3.6)68
b Fc(zlib)43 b Fk(compatibilit)l(y)k(functions)150 3563
y Fj(Y)-8 b(oshiok)j(a)32 b(Tsuneo)f(has)f(con)m(tributed)i(some)f
(functions)g(to)h(giv)m(e)h(b)s(etter)e Fi(zlib)f Fj(compatibilit)m(y)
-8 b(.)46 b(These)150 3673 y(functions)37 b(are)g Fi(BZ2_bzopen)p
Fj(,)f Fi(BZ2_bzread)p Fj(,)g Fi(BZ2_bzwrite)p Fj(,)g
Fi(BZ2_bzflush)p Fj(,)f Fi(BZ2_bzclose)p Fj(,)h Fi(BZ2_)150
3782 y(bzerror)22 b Fj(and)g Fi(BZ2_bzlibVersion)p Fj(.)34
b(These)24 b(functions)f(are)h(not)g(\(y)m(et\))h(o\016cially)g(part)f
(of)g(the)f(library)-8 b(.)150 3892 y(If)30 b(they)h(break,)f(y)m(ou)h
(get)h(to)f(k)m(eep)g(all)g(the)g(pieces.)41 b(Nev)m(ertheless,)33
b(I)e(think)f(they)g(w)m(ork)h(ok.)390 4043 y Fi(typedef)46
b(void)g(BZFILE;)390 4250 y(const)g(char)h(*)g(BZ2_bzlibVersion)d(\()j
(void)g(\);)150 4407 y Fj(Returns)30 b(a)h(string)f(indicating)h(the)g
(library)f(v)m(ersion.)390 4558 y Fi(BZFILE)46 b(*)i(BZ2_bzopen)92
b(\()48 b(const)e(char)h(*path,)f(const)g(char)h(*mode)f(\);)390
4662 y(BZFILE)g(*)i(BZ2_bzdopen)c(\()k(int)381 b(fd,)190
b(const)46 b(char)h(*mode)f(\);)150 4819 y Fj(Op)s(ens)36
b(a)i Fi(.bz2)e Fj(\014le)i(for)f(reading)h(or)f(writing,)j(using)d
(either)h(its)g(name)f(or)h(a)g(pre-existing)g(\014le)g(de-)150
4928 y(scriptor.)j(Analogous)31 b(to)g Fi(fopen)e Fj(and)h
Fi(fdopen)p Fj(.)390 5079 y Fi(int)47 b(BZ2_bzread)93
b(\()47 b(BZFILE*)f(b,)h(void*)f(buf,)h(int)g(len)g(\);)390
5183 y(int)g(BZ2_bzwrite)e(\()i(BZFILE*)f(b,)h(void*)f(buf,)h(int)g
(len)g(\);)150 5340 y Fj(Reads/writes)31 b(data)g(from/to)g(a)g
(previously)f(op)s(ened)f Fi(BZFILE)p Fj(.)39 b(Analogous)31
b(to)g Fi(fread)e Fj(and)g Fi(fwrite)p Fj(.)p eop
%%Page: 30 31
30 30 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
b(with)g Fi(libbzip2)1881 b Fl(30)390 299 y Fi(int)95
b(BZ2_bzflush)44 b(\()k(BZFILE*)e(b)h(\);)390 403 y(void)g(BZ2_bzclose)
d(\()k(BZFILE*)e(b)h(\);)150 559 y Fj(Flushes/closes)29
b(a)f Fi(BZFILE)p Fj(.)38 b Fi(BZ2_bzflush)25 b Fj(do)s(esn't)j
(actually)h(do)f(an)m(ything.)41 b(Analogous)28 b(to)h
Fi(fflush)150 669 y Fj(and)h Fi(fclose)p Fj(.)390 820
y Fi(const)46 b(char)h(*)g(BZ2_bzerror)e(\()j(BZFILE)e(*b,)h(int)g
(*errnum)e(\))150 977 y Fj(Returns)29 b(a)h(string)g(describing)g(the)f
(more)i(recen)m(t)g(error)f(status)g(of)f Fi(b)p Fj(,)h(and)f(also)h
(sets)g Fi(*errnum)e Fj(to)i(its)150 1087 y(n)m(umerical)h(v)-5
b(alue.)150 1411 y Fk(3.7)68 b(Using)46 b(the)f(library)g(in)g(a)g
Fc(stdio)p Fk(-free)f(en)l(vironmen)l(t)150 1723 y Fe(3.7.1)63
b(Getting)41 b(rid)g(of)g Fd(stdio)150 1915 y Fj(In)g(a)g(deeply)h(em)m
(b)s(edded)e(application,)46 b(y)m(ou)41 b(migh)m(t)i(w)m(an)m(t)f(to)g
(use)f(just)g(the)h(memory-to-memory)150 2025 y(functions.)d(Y)-8
b(ou)27 b(can)g(do)g(this)g(con)m(v)m(enien)m(tly)j(b)m(y)d(compiling)h
(the)f(library)g(with)g(prepro)s(cessor)g(sym)m(b)s(ol)150
2135 y Fi(BZ_NO_STDIO)34 b Fj(de\014ned.)60 b(Doing)38
b(this)f(giv)m(es)i(y)m(ou)e(a)h(library)f(con)m(taining)i(only)e(the)h
(follo)m(wing)g(eigh)m(t)150 2244 y(functions:)150 2401
y Fi(BZ2_bzCompressInit)p Fj(,)26 b Fi(BZ2_bzCompress)p
Fj(,)g Fi(BZ2_bzCompressEnd)150 2511 y(BZ2_bzDecompressInit)p
Fj(,)f Fi(BZ2_bzDecompress)p Fj(,)h Fi(BZ2_bzDecompressEnd)150
2620 y(BZ2_bzBuffToBuffCompress)o Fj(,)f Fi(BZ2_bzBuffToBuffDecompre)o
(ss)150 2777 y Fj(When)30 b(compiled)h(lik)m(e)g(this,)g(all)g
(functions)f(will)h(ignore)g Fi(verbosity)d Fj(settings.)150
3053 y Fe(3.7.2)63 b(Critical)40 b(error)h(handling)150
3246 y Fi(libbzip2)18 b Fj(con)m(tains)k(a)f(n)m(um)m(b)s(er)e(of)i(in)
m(ternal)h(assertion)f(c)m(hec)m(ks)h(whic)m(h)f(should,)g(needless)g
(to)h(sa)m(y)-8 b(,)23 b(nev)m(er)150 3355 y(b)s(e)35
b(activ)-5 b(ated.)58 b(Nev)m(ertheless,)40 b(if)35 b(an)h(assertion)g
(should)f(fail,)i(b)s(eha)m(viour)f(dep)s(ends)e(on)h(whether)h(or)150
3465 y(not)31 b(the)f(library)h(w)m(as)f(compiled)h(with)f
Fi(BZ_NO_STDIO)e Fj(set.)150 3622 y(F)-8 b(or)31 b(a)g(normal)f
(compile,)i(an)e(assertion)h(failure)f(yields)h(the)g(message)533
3773 y Fi(bzip2/libbzip2:)44 b(internal)h(error)i(number)f(N.)533
3877 y(This)h(is)g(a)g(bug)g(in)h(bzip2/libbzip2,)43
b(1.0.2,)j(30-Dec-2001.)533 3980 y(Please)g(report)g(it)i(to)f(me)g
(at:)g(jseward@acm.org.)91 b(If)47 b(this)g(happened)533
4084 y(when)g(you)g(were)f(using)h(some)f(program)g(which)h(uses)f
(libbzip2)g(as)h(a)533 4188 y(component,)e(you)i(should)f(also)h
(report)f(this)h(bug)f(to)i(the)f(author\(s\))533 4292
y(of)g(that)g(program.)93 b(Please)46 b(make)h(an)g(effort)f(to)h
(report)g(this)f(bug;)533 4395 y(timely)g(and)h(accurate)f(bug)h
(reports)e(eventually)g(lead)i(to)g(higher)533 4499 y(quality)f
(software.)93 b(Thanks.)h(Julian)46 b(Seward,)f(30)j(December)d(2001.)
150 4656 y Fj(where)33 b Fi(N)g Fj(is)g(some)g(error)h(co)s(de)f(n)m
(um)m(b)s(er.)48 b(If)32 b Fi(N)e(==)g(1007)p Fj(,)j(it)h(also)f(prin)m
(ts)g(some)h(extra)g(text)g(advising)150 4766 y(the)e(reader)f(that)h
(unreliable)f(memory)h(is)f(often)h(asso)s(ciated)g(with)f(in)m(ternal)
h(error)g(1007.)45 b(\(This)32 b(is)f(a)150 4875 y(frequen)m
(tly-observ)m(ed-phenomenon)g(with)f(v)m(ersions)h(1.0.0/1.0.1\).)150
5032 y Fi(exit\(3\))d Fj(is)j(then)f(called.)150 5189
y(F)-8 b(or)31 b(a)g Fi(stdio)p Fj(-free)e(library)-8
b(,)31 b(assertion)h(failures)e(result)h(in)f(a)g(call)i(to)f(a)f
(function)h(declared)f(as:)533 5340 y Fi(extern)46 b(void)h
(bz_internal_error)c(\()k(int)g(errcode)f(\);)p eop
%%Page: 31 32
31 31 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
b(with)g Fi(libbzip2)1881 b Fl(31)150 299 y Fj(The)30
b(relev)-5 b(an)m(t)32 b(co)s(de)f(is)f(passed)g(as)g(a)h(parameter.)41
b(Y)-8 b(ou)31 b(should)e(supply)g(suc)m(h)h(a)g(function.)150
456 y(In)f(either)h(case,)g(once)g(an)f(assertion)h(failure)f(has)f(o)s
(ccurred,)i(an)m(y)f Fi(bz_stream)e Fj(records)i(in)m(v)m(olv)m(ed)i
(can)150 565 y(b)s(e)f(regarded)g(as)h(in)m(v)-5 b(alid.)41
b(Y)-8 b(ou)30 b(should)f(not)i(attempt)h(to)f(resume)f(normal)h(op)s
(eration)g(with)f(them.)150 722 y(Y)-8 b(ou)27 b(ma)m(y)-8
b(,)28 b(of)f(course,)h(c)m(hange)f(critical)i(error)e(handling)f(to)h
(suit)g(y)m(our)g(needs.)39 b(As)26 b(I)h(said)f(ab)s(o)m(v)m(e,)j
(crit-)150 832 y(ical)f(errors)g(indicate)g(bugs)e(in)h(the)h(library)f
(and)f(should)g(not)i(o)s(ccur.)40 b(All)27 b Fi(")p
Fj(normal)p Fi(")g Fj(error)g(situations)150 941 y(are)k(indicated)g
(via)f(error)h(return)f(co)s(des)h(from)f(functions,)g(and)g(can)g(b)s
(e)g(reco)m(v)m(ered)i(from.)150 1221 y Fk(3.8)68 b(Making)45
b(a)g(Windo)l(ws)h(DLL)150 1414 y Fj(Ev)m(erything)31
b(related)g(to)h(Windo)m(ws)e(has)f(b)s(een)h(con)m(tributed)h(b)m(y)f
(Y)-8 b(oshiok)j(a)32 b(Tsuneo)150 1523 y(\()p Fi
(QWF00133@niftyserve.or.jp)45 b Fj(/)53 b Fi(tsuneo-y@is.aist-nara.a)o
(c.jp)o Fj(\),)f(so)g(y)m(ou)h(should)e(send)150 1633
y(y)m(our)31 b(queries)f(to)h(him)f(\(but)g(p)s(erhaps)f(Cc:)41
b(me,)31 b Fi(jseward@acm.org)p Fj(\).)150 1790 y(My)42
b(v)-5 b(ague)43 b(understanding)d(of)i(what)g(to)h(do)f(is:)64
b(using)41 b(Visual)h(C)p Fi(++)f Fj(5.0,)46 b(op)s(en)c(the)g(pro)5
b(ject)43 b(\014le)150 1899 y Fi(libbz2.dsp)p Fj(,)28
b(and)h(build.)40 b(That's)31 b(all.)150 2056 y(If)39
b(y)m(ou)g(can't)h(op)s(en)f(the)g(pro)5 b(ject)40 b(\014le)f(for)g
(some)h(reason,)i(mak)m(e)e(a)f(new)f(one,)k(naming)d(these)h(\014les:)
150 2166 y Fi(blocksort.c)p Fj(,)28 b Fi(bzlib.c)p Fj(,)g
Fi(compress.c)p Fj(,)g Fi(crctable.c)p Fj(,)g Fi(decompress.c)p
Fj(,)f Fi(huffman.c)p Fj(,)150 2275 y Fi(randtable.c)32
b Fj(and)h Fi(libbz2.def)p Fj(.)51 b(Y)-8 b(ou)35 b(will)g(also)g(need)
f(to)i(name)e(the)h(header)g(\014les)f Fi(bzlib.h)f Fj(and)150
2385 y Fi(bzlib_private.h)p Fj(.)150 2542 y(If)d(y)m(ou)h(don't)f(use)h
(V)m(C)p Fi(++)p Fj(,)e(y)m(ou)i(ma)m(y)g(need)f(to)h(de\014ne)f(the)h
(propro)s(cessor)f(sym)m(b)s(ol)g Fi(_WIN32)p Fj(.)150
2698 y(Finally)-8 b(,)30 b Fi(dlltest.c)25 b Fj(is)j(a)g(sample)g
(program)h(using)e(the)i(DLL.)e(It)h(has)g(a)g(pro)5
b(ject)29 b(\014le,)g Fi(dlltest.dsp)p Fj(.)150 2855
y(If)h(y)m(ou)h(just)f(w)m(an)m(t)h(a)f(mak)m(e\014le)i(for)e(Visual)g
(C,)g(ha)m(v)m(e)i(a)e(lo)s(ok)h(at)g Fi(makefile.msc)p
Fj(.)150 3012 y(Be)j(a)m(w)m(are)i(that)f(if)g(y)m(ou)f(compile)i
Fi(bzip2)d Fj(itself)i(on)g(Win32,)h(y)m(ou)f(m)m(ust)f(set)i
Fi(BZ_UNIX)c Fj(to)j(0)g(and)f Fi(BZ_)150 3122 y(LCCWIN32)25
b Fj(to)j(1,)g(in)f(the)h(\014le)f Fi(bzip2.c)p Fj(,)f(b)s(efore)h
(compiling.)41 b(Otherwise)27 b(the)h(resulting)g(binary)e(w)m(on't)150
3231 y(w)m(ork)31 b(correctly)-8 b(.)150 3388 y(I)30
b(ha)m(v)m(en't)i(tried)f(an)m(y)f(of)h(this)f(stu\013)g(m)m(yself,)i
(but)d(it)i(all)g(lo)s(oks)g(plausible.)p eop
%%Page: 32 33
32 32 bop 150 -116 a Fl(Chapter)30 b(4:)41 b(Miscellanea)2586
b(32)150 299 y Fg(4)80 b(Miscellanea)150 549 y Fj(These)31
b(are)f(just)g(some)h(random)f(though)m(ts)h(of)f(mine.)41
b(Y)-8 b(our)30 b(mileage)i(ma)m(y)f(v)-5 b(ary)d(.)150
826 y Fk(4.1)68 b(Limitations)47 b(of)e(the)g(compressed)g(\014le)h
(format)150 1018 y Fi(bzip2-1.0)p Fj(,)c Fi(0.9.5)e Fj(and)h
Fi(0.9.0)f Fj(use)i(exactly)h(the)f(same)g(\014le)g(format)g(as)f(the)h
(previous)g(v)m(ersion,)150 1128 y Fi(bzip2-0.1)p Fj(.)72
b(This)41 b(decision)h(w)m(as)g(made)f(in)g(the)h(in)m(terests)h(of)f
(stabilit)m(y)-8 b(.)76 b(Creating)43 b(y)m(et)g(another)150
1238 y(incompatible)i(compressed)g(\014le)g(format)g(w)m(ould)f(create)
i(further)e(confusion)h(and)e(disruption)h(for)150 1347
y(users.)150 1504 y(Nev)m(ertheless,)30 b(this)d(is)f(not)h(a)g
(painless)g(decision.)40 b(Dev)m(elopmen)m(t)28 b(w)m(ork)f(since)h
(the)f(release)h(of)f Fi(bzip2-)150 1614 y(0.1)g Fj(in)h(August)g(1997)
i(has)d(sho)m(wn)h(complexities)i(in)e(the)g(\014le)g(format)h(whic)m
(h)f(slo)m(w)h(do)m(wn)e(decompres-)150 1723 y(sion)j(and,)g(in)g
(retrosp)s(ect,)i(are)f(unnecessary)-8 b(.)41 b(These)30
b(are:)225 1880 y Fh(\017)60 b Fj(The)33 b(run-length)g(enco)s(der,)h
(whic)m(h)f(is)g(the)h(\014rst)f(of)g(the)h(compression)f
(transformations,)i(is)e(en-)330 1990 y(tirely)h(irrelev)-5
b(an)m(t.)48 b(The)32 b(original)i(purp)s(ose)d(w)m(as)i(to)g(protect)h
(the)f(sorting)g(algorithm)g(from)g(the)330 2099 y(v)m(ery)26
b(w)m(orst)g(case)h(input:)37 b(a)26 b(string)g(of)f(rep)s(eated)h(sym)
m(b)s(ols.)39 b(But)25 b(algorithm)h(steps)g(Q6a)g(and)f(Q6b)330
2209 y(in)j(the)g(original)i(Burro)m(ws-Wheeler)e(tec)m(hnical)i(rep)s
(ort)f(\(SR)m(C-124\))h(sho)m(w)e(ho)m(w)g(rep)s(eats)g(can)h(b)s(e)330
2318 y(handled)g(without)i(di\016cult)m(y)g(in)f(blo)s(c)m(k)h
(sorting.)225 2451 y Fh(\017)60 b Fj(The)27 b(randomisation)h(mec)m
(hanism)f(do)s(esn't)g(really)i(need)e(to)h(b)s(e)e(there.)41
b(Udi)27 b(Man)m(b)s(er)g(and)f(Gene)330 2561 y(My)m(ers)31
b(published)d(a)j(su\016x)e(arra)m(y)h(construction)i(algorithm)f(a)f
(few)g(y)m(ears)h(bac)m(k,)g(whic)m(h)e(can)i(b)s(e)330
2670 y(emplo)m(y)m(ed)26 b(to)g(sort)f(an)m(y)g(blo)s(c)m(k,)i(no)e
(matter)h(ho)m(w)f(rep)s(etitiv)m(e,)j(in)c(O\(N)i(log)g(N\))f(time.)40
b(Subsequen)m(t)330 2780 y(w)m(ork)24 b(b)m(y)f(Kunihik)m(o)g(Sadak)-5
b(ane)23 b(has)g(pro)s(duced)e(a)j(deriv)-5 b(ativ)m(e)25
b(O\(N)f(\(log)g(N\))p Fi(^)p Fj(2\))h(algorithm)f(whic)m(h)330
2890 y(usually)30 b(outp)s(erforms)g(the)g(Man)m(b)s(er-My)m(ers)i
(algorithm.)330 3023 y(I)f(could)f(ha)m(v)m(e)i(c)m(hanged)f(to)g
(Sadak)-5 b(ane's)30 b(algorithm,)i(but)e(I)h(\014nd)e(it)i(to)g(b)s(e)
f(slo)m(w)m(er)i(than)e Fi(bzip2)p Fj('s)330 3132 y(existing)39
b(algorithm)f(for)g(most)g(inputs,)h(and)d(the)i(randomisation)g(mec)m
(hanism)g(protects)h(ade-)330 3242 y(quately)34 b(against)g(bad)f
(cases.)50 b(I)33 b(didn't)g(think)g(it)h(w)m(as)f(a)h(go)s(o)s(d)f
(tradeo\013)h(to)g(mak)m(e.)50 b(P)m(artly)35 b(this)330
3351 y(is)40 b(due)f(to)i(the)f(fact)h(that)f(I)g(w)m(as)g(not)g(\015o)
s(o)s(ded)f(with)g(email)i(complain)m(ts)g(ab)s(out)e
Fi(bzip2-0.1)p Fj('s)330 3461 y(p)s(erformance)30 b(on)g(rep)s(etitiv)m
(e)j(data,)e(so)f(p)s(erhaps)f(it)i(isn't)g(a)f(problem)g(for)h(real)g
(inputs.)330 3594 y(Probably)g(the)h(b)s(est)f(long-term)i(solution,)f
(and)f(the)g(one)h(I)f(ha)m(v)m(e)i(incorp)s(orated)e(in)m(to)i(0.9.5)g
(and)330 3704 y(ab)s(o)m(v)m(e,)41 b(is)d(to)h(use)f(the)h(existing)g
(sorting)g(algorithm)g(initially)-8 b(,)42 b(and)37 b(fall)i(bac)m(k)g
(to)f(a)h(O\(N)f(\(log)330 3813 y(N\))p Fi(^)p Fj(2\))31
b(algorithm)h(if)e(the)h(standard)e(algorithm)j(gets)f(in)m(to)h
(di\016culties.)225 3946 y Fh(\017)60 b Fj(The)29 b(compressed)g
(\014le)g(format)h(w)m(as)f(nev)m(er)g(designed)g(to)h(b)s(e)e(handled)
g(b)m(y)h(a)g(library)-8 b(,)30 b(and)e(I)h(ha)m(v)m(e)330
4056 y(had)e(to)h(jump)e(though)h(some)h(ho)s(ops)e(to)i(pro)s(duce)f
(an)g(e\016cien)m(t)i(implemen)m(tation)g(of)e(decompres-)330
4165 y(sion.)39 b(It's)24 b(a)h(bit)f(hairy)-8 b(.)39
b(T)-8 b(ry)24 b(passing)g Fi(decompress.c)d Fj(through)i(the)i(C)e
(prepro)s(cessor)i(and)e(y)m(ou'll)330 4275 y(see)31
b(what)e(I)h(mean.)41 b(Muc)m(h)30 b(of)g(this)g(complexit)m(y)i(could)
e(ha)m(v)m(e)g(b)s(een)g(a)m(v)m(oided)h(if)f(the)g(compressed)330
4384 y(size)h(of)g(eac)m(h)g(blo)s(c)m(k)g(of)g(data)f(w)m(as)h
(recorded)f(in)h(the)f(data)h(stream.)225 4517 y Fh(\017)60
b Fj(An)29 b(Adler-32)j(c)m(hec)m(ksum,)f(rather)g(than)f(a)g(CR)m(C32)
h(c)m(hec)m(ksum,)h(w)m(ould)e(b)s(e)g(faster)h(to)g(compute.)150
4698 y(It)45 b(w)m(ould)g(b)s(e)f(fair)h(to)h(sa)m(y)f(that)g(the)h
Fi(bzip2)d Fj(format)i(w)m(as)g(frozen)g(b)s(efore)g(I)g(prop)s(erly)f
(and)g(fully)150 4807 y(understo)s(o)s(d)29 b(the)i(p)s(erformance)f
(consequences)h(of)f(doing)h(so.)150 4964 y(Impro)m(v)m(emen)m(ts)25
b(whic)m(h)d(I)i(w)m(as)f(able)g(to)h(incorp)s(orate)g(in)m(to)g
(0.9.0,)j(despite)d(using)e(the)i(same)f(\014le)g(format,)150
5074 y(are:)225 5230 y Fh(\017)60 b Fj(Single)30 b(arra)m(y)g(implemen)
m(tation)i(of)d(the)h(in)m(v)m(erse)h(BWT.)f(This)f(signi\014can)m(tly)
i(sp)s(eeds)e(up)f(decom-)330 5340 y(pression,)i(presumably)f(b)s
(ecause)i(it)g(reduces)f(the)h(n)m(um)m(b)s(er)e(of)i(cac)m(he)g
(misses.)p eop
%%Page: 33 34
33 33 bop 150 -116 a Fl(Chapter)30 b(4:)41 b(Miscellanea)2586
b(33)225 299 y Fh(\017)60 b Fj(F)-8 b(aster)25 b(in)m(v)m(erse)f(MTF)g
(transform)f(for)g(large)i(MTF)f(v)-5 b(alues.)38 b(The)23
b(new)g(implemen)m(tation)i(is)f(based)330 408 y(on)30
b(the)h(notion)g(of)f(sliding)h(blo)s(c)m(ks)g(of)f(v)-5
b(alues.)225 544 y Fh(\017)60 b Fi(bzip2-0.9.0)23 b Fj(no)m(w)j(reads)g
(and)f(writes)h(\014les)g(with)g Fi(fread)f Fj(and)g
Fi(fwrite)p Fj(;)h(v)m(ersion)h(0.1)g(used)e Fi(putc)330
653 y Fj(and)30 b Fi(getc)p Fj(.)39 b(Duh!)g(W)-8 b(ell,)32
b(y)m(ou)f(liv)m(e)g(and)f(learn.)150 836 y(F)-8 b(urther)28
b(ahead,)h(it)g(w)m(ould)f(b)s(e)g(nice)g(to)i(b)s(e)d(able)i(to)g(do)f
(random)f(access)j(in)m(to)f(\014les.)40 b(This)28 b(will)h(require)150
945 y(some)i(careful)g(design)f(of)g(compressed)h(\014le)f(formats.)150
1227 y Fk(4.2)68 b(P)l(ortabilit)l(y)47 b(issues)150
1419 y Fj(After)33 b(some)h(consideration,)h(I)e(ha)m(v)m(e)h(decided)f
(not)g(to)h(use)f(GNU)g Fi(autoconf)e Fj(to)j(con\014gure)f(0.9.5)i(or)
150 1529 y(1.0.)150 1686 y Fi(autoconf)p Fj(,)30 b(admirable)i(and)e(w)
m(onderful)h(though)h(it)g(is,)h(mainly)e(assists)h(with)g(p)s
(ortabilit)m(y)g(problems)150 1795 y(b)s(et)m(w)m(een)46
b(Unix-lik)m(e)h(platforms.)85 b(But)45 b Fi(bzip2)f
Fj(do)s(esn't)h(ha)m(v)m(e)h(m)m(uc)m(h)g(in)f(the)g(w)m(a)m(y)h(of)g
(p)s(ortabilit)m(y)150 1905 y(problems)21 b(on)h(Unix;)j(most)d(of)g
(the)g(di\016culties)g(app)s(ear)f(when)g(p)s(orting)h(to)g(the)h(Mac,)
h(or)e(to)h(Microsoft's)150 2015 y(op)s(erating)j(systems.)40
b Fi(autoconf)23 b Fj(do)s(esn't)j(help)f(in)g(those)i(cases,)g(and)e
(brings)g(in)h(a)g(whole)f(load)i(of)e(new)150 2124 y(complexit)m(y)-8
b(.)150 2281 y(Most)34 b(p)s(eople)e(should)g(b)s(e)g(able)h(to)g
(compile)h(the)f(library)f(and)g(program)h(under)e(Unix)h(straigh)m(t)i
(out-)150 2391 y(of-the-b)s(o)m(x,)e(so)e(to)i(sp)s(eak,)e(esp)s
(ecially)h(if)f(y)m(ou)h(ha)m(v)m(e)g(a)g(v)m(ersion)g(of)g(GNU)g(C)e
(a)m(v)-5 b(ailable.)150 2547 y(There)31 b(are)h(a)f(couple)g(of)g
Fi(__inline__)e Fj(directiv)m(es)k(in)d(the)i(co)s(de.)42
b(GNU)32 b(C)f(\()p Fi(gcc)p Fj(\))f(should)g(b)s(e)h(able)g(to)150
2657 y(handle)23 b(them.)38 b(If)23 b(y)m(ou're)h(not)g(using)f(GNU)h
(C,)f(y)m(our)h(C)e(compiler)j(shouldn't)d(see)i(them)g(at)g(all.)39
b(If)23 b(y)m(our)150 2767 y(compiler)30 b(do)s(es,)f(for)f(some)h
(reason,)h(see)f(them)g(and)f(do)s(esn't)g(lik)m(e)i(them,)g(just)e
Fi(#define)f(__inline__)150 2876 y Fj(to)37 b(b)s(e)f
Fi(/*)29 b(*/)p Fj(.)58 b(One)36 b(easy)h(w)m(a)m(y)f(to)i(do)e(this)g
(is)g(to)h(compile)g(with)f(the)h(\015ag)f Fi(-D__inline__=)p
Fj(,)e(whic)m(h)150 2986 y(should)29 b(b)s(e)h(understo)s(o)s(d)f(b)m
(y)h(most)h(Unix)f(compilers.)150 3143 y(If)k(y)m(ou)g(still)h(ha)m(v)m
(e)g(di\016culties,)h(try)e(compiling)g(with)g(the)g(macro)h
Fi(BZ_STRICT_ANSI)30 b Fj(de\014ned.)50 b(This)150 3252
y(should)27 b(enable)i(y)m(ou)g(to)g(build)e(the)i(library)f(in)g(a)g
(strictly)i(ANSI)e(complian)m(t)i(en)m(vironmen)m(t.)41
b(Building)150 3362 y(the)22 b(program)h(itself)g(lik)m(e)g(this)f(is)g
(dangerous)g(and)f(not)h(supp)s(orted,)h(since)f(y)m(ou)h(remo)m(v)m(e)
h Fi(bzip2)p Fj('s)c(c)m(hec)m(ks)150 3471 y(against)27
b(compressing)g(directories,)i(sym)m(b)s(olic)d(links,)h(devices,)h
(and)e(other)h(not-really-a-\014le)i(en)m(tities.)150
3581 y(This)h(could)g(cause)h(\014lesystem)g(corruption!)150
3738 y(One)c(other)h(thing:)40 b(if)27 b(y)m(ou)h(create)h(a)e
Fi(bzip2)f Fj(binary)h(for)g(public)g(distribution,)h(please)g(try)g
(and)e(link)h(it)150 3847 y(statically)g(\()p Fi(gcc)j(-s)p
Fj(\).)39 b(This)24 b(a)m(v)m(oids)j(all)e(sorts)h(of)f(library-v)m
(ersion)h(issues)e(that)i(others)g(ma)m(y)f(encoun)m(ter)150
3957 y(later)32 b(on.)150 4114 y(If)d(y)m(ou)g(build)e
Fi(bzip2)h Fj(on)g(Win32,)i(y)m(ou)f(m)m(ust)g(set)h
Fi(BZ_UNIX)c Fj(to)k(0)f(and)f Fi(BZ_LCCWIN32)e Fj(to)k(1,)f(in)g(the)g
(\014le)150 4223 y Fi(bzip2.c)p Fj(,)g(b)s(efore)h(compiling.)41
b(Otherwise)31 b(the)g(resulting)g(binary)f(w)m(on't)h(w)m(ork)g
(correctly)-8 b(.)150 4505 y Fk(4.3)68 b(Rep)t(orting)46
b(bugs)150 4698 y Fj(I)23 b(tried)g(prett)m(y)h(hard)e(to)i(mak)m(e)f
(sure)g Fi(bzip2)e Fj(is)i(bug)f(free,)j(b)s(oth)d(b)m(y)h(design)g
(and)f(b)m(y)h(testing.)39 b(Hop)s(efully)150 4807 y(y)m(ou'll)31
b(nev)m(er)g(need)g(to)g(read)f(this)h(section)g(for)g(real.)150
4964 y(Nev)m(ertheless,)j(if)d Fi(bzip2)f Fj(dies)h(with)g(a)g(segmen)m
(tation)j(fault,)e(a)f(bus)f(error)i(or)f(an)g(in)m(ternal)h(assertion)
150 5074 y(failure,)j(it)f(will)f(ask)h(y)m(ou)g(to)g(email)g(me)g(a)f
(bug)g(rep)s(ort.)50 b(Exp)s(erience)33 b(with)g(v)m(ersion)i(0.1)f
(sho)m(ws)f(that)150 5183 y(almost)e(all)g(these)g(problems)f(can)h(b)s
(e)e(traced)j(to)f(either)g(compiler)g(bugs)f(or)h(hardw)m(are)f
(problems.)225 5340 y Fh(\017)60 b Fj(Recompile)22 b(the)f(program)f
(with)h(no)f(optimisation,)k(and)c(see)h(if)g(it)g(w)m(orks.)38
b(And/or)20 b(try)g(a)h(di\013eren)m(t)p eop
%%Page: 34 35
34 34 bop 150 -116 a Fl(Chapter)30 b(4:)41 b(Miscellanea)2586
b(34)330 299 y Fj(compiler.)74 b(I)41 b(heard)f(all)i(sorts)f(of)g
(stories)i(ab)s(out)d(v)-5 b(arious)41 b(\015a)m(v)m(ours)g(of)h(GNU)f
(C)g(\(and)f(other)330 408 y(compilers\))45 b(generating)g(bad)e(co)s
(de)g(for)h Fi(bzip2)p Fj(,)i(and)d(I'v)m(e)i(run)d(across)i(t)m(w)m(o)
h(suc)m(h)f(examples)330 518 y(m)m(yself.)330 716 y(2.7.X)i(v)m
(ersions)f(of)g(GNU)h(C)e(are)h(kno)m(wn)g(to)g(generate)i(bad)d(co)s
(de)h(from)f(time)i(to)g(time,)j(at)330 825 y(high)32
b(optimisation)h(lev)m(els.)47 b(If)31 b(y)m(ou)i(get)g(problems,)f
(try)g(using)f(the)i(\015ags)f Fi(-O2)f(-fomit-frame-)330
935 y(pointer)d(-fno-strength-reduce)p Fj(.)36 b(Y)-8
b(ou)30 b(should)f(sp)s(eci\014cally)i Fb(not)40 b Fj(use)30
b Fi(-funroll-loops)p Fj(.)330 1132 y(Y)-8 b(ou)36 b(ma)m(y)g(notice)i
(that)e(the)g(Mak)m(e\014le)i(runs)d(six)g(tests)i(as)f(part)g(of)g
(the)h(build)e(pro)s(cess.)57 b(If)36 b(the)330 1242
y(program)42 b(passes)g(all)h(of)f(these,)k(it's)d(a)f(prett)m(y)i(go)s
(o)s(d)e(\(but)g(not)g(100\045\))i(indication)f(that)g(the)330
1352 y(compiler)31 b(has)f(done)g(its)h(job)f(correctly)-8
b(.)225 1549 y Fh(\017)60 b Fj(If)32 b Fi(bzip2)e Fj(crashes)j
(randomly)-8 b(,)32 b(and)f(the)i(crashes)f(are)g(not)h(rep)s(eatable,)
g(y)m(ou)g(ma)m(y)f(ha)m(v)m(e)h(a)f(\015aky)330 1659
y(memory)37 b(subsystem.)57 b Fi(bzip2)35 b Fj(really)i(hammers)f(y)m
(our)h(memory)f(hierarc)m(h)m(y)-8 b(,)39 b(and)d(if)g(it's)h(a)g(bit)
330 1768 y(marginal,)c(y)m(ou)g(ma)m(y)g(get)g(these)g(problems.)46
b(Ditto)34 b(if)e(y)m(our)h(disk)f(or)g(I/O)h(subsystem)f(is)g(slo)m
(wly)330 1878 y(failing.)41 b(Y)-8 b(up,)30 b(this)g(really)i(do)s(es)e
(happ)s(en.)330 2075 y(T)-8 b(ry)27 b(using)f(a)h(di\013eren)m(t)h(mac)
m(hine)f(of)g(the)g(same)g(t)m(yp)s(e,)h(and)e(see)h(if)g(y)m(ou)g(can)
g(rep)s(eat)g(the)g(problem.)225 2273 y Fh(\017)60 b
Fj(This)21 b(isn't)h(really)g(a)g(bug,)h(but)d(...)39
b(If)21 b Fi(bzip2)f Fj(tells)i(y)m(ou)g(y)m(our)g(\014le)f(is)h
(corrupted)f(on)g(decompression,)330 2383 y(and)g(y)m(ou)h(obtained)g
(the)h(\014le)f(via)g(FTP)-8 b(,)23 b(there)f(is)g(a)g(p)s(ossibilit)m
(y)h(that)f(y)m(ou)h(forgot)g(to)g(tell)g(FTP)f(to)h(do)330
2492 y(a)31 b(binary)g(mo)s(de)g(transfer.)43 b(That)31
b(absolutely)h(will)g(cause)f(the)h(\014le)f(to)h(b)s(e)e
(non-decompressible.)330 2602 y(Y)-8 b(ou'll)31 b(ha)m(v)m(e)g(to)h
(transfer)e(it)h(again.)150 2847 y(If)e(y)m(ou'v)m(e)i(incorp)s(orated)
e Fi(libbzip2)e Fj(in)m(to)k(y)m(our)e(o)m(wn)g(program)h(and)e(are)i
(getting)h(problems,)e(please,)150 2956 y(please,)e(please,)g(c)m(hec)m
(k)f(that)g(the)f(parameters)h(y)m(ou)f(are)h(passing)e(in)h(calls)h
(to)f(the)h(library)-8 b(,)26 b(are)g(correct,)150 3066
y(and)g(in)g(accordance)i(with)f(what)f(the)h(do)s(cumen)m(tation)h(sa)
m(ys)f(is)f(allo)m(w)m(able.)42 b(I)27 b(ha)m(v)m(e)g(tried)h(to)f(mak)
m(e)h(the)150 3175 y(library)i(robust)g(against)h(suc)m(h)g(problems,)f
(but)g(I'm)g(sure)g(I)g(ha)m(v)m(en't)i(succeeded.)150
3332 y(Finally)-8 b(,)33 b(if)f(the)h(ab)s(o)m(v)m(e)g(commen)m(ts)g
(don't)f(help,)g(y)m(ou'll)h(ha)m(v)m(e)g(to)g(send)e(me)h(a)g(bug)f
(rep)s(ort.)46 b(No)m(w,)33 b(it's)150 3442 y(just)d(amazing)h(ho)m(w)f
(man)m(y)h(p)s(eople)f(will)h(send)e(me)i(a)f(bug)g(rep)s(ort)h(sa)m
(ying)g(something)g(lik)m(e)481 3593 y(bzip2)f(crashed)g(with)h(segmen)
m(tation)h(fault)f(on)f(m)m(y)g(mac)m(hine)150 3750 y(and)h(absolutely)
h(nothing)g(else.)45 b(Needless)33 b(to)f(sa)m(y)-8 b(,)33
b(a)f(suc)m(h)f(a)h(rep)s(ort)g(is)f Fb(total)5 b(ly,)36
b(utterly,)e(c)-5 b(ompletely)150 3859 y(and)27 b(c)-5
b(ompr)g(ehensively)29 b(100\045)f(useless;)g(a)f(waste)g(of)g(your)g
(time,)h(my)e(time,)i(and)f(net)g(b)-5 b(andwidth)p Fj(.)41
b(With)150 3969 y(no)30 b(details)i(at)f(all,)g(there's)g(no)f(w)m(a)m
(y)h(I)g(can)f(p)s(ossibly)g(b)s(egin)g(to)h(\014gure)f(out)h(what)f
(the)g(problem)h(is.)150 4126 y(The)e(rules)f(of)h(the)g(game)h(are:)40
b(facts,)30 b(facts,)g(facts.)41 b(Don't)29 b(omit)h(them)f(b)s(ecause)
f Fi(")p Fj(oh,)h(they)g(w)m(on't)h(b)s(e)150 4235 y(relev)-5
b(an)m(t)p Fi(")p Fj(.)42 b(A)m(t)31 b(the)g(bare)f(minim)m(um:)481
4386 y(Mac)m(hine)h(t)m(yp)s(e.)62 b(Op)s(erating)30
b(system)h(v)m(ersion.)481 4490 y(Exact)g(v)m(ersion)g(of)g
Fi(bzip2)d Fj(\(do)j Fi(bzip2)46 b(-V)p Fj(\).)481 4594
y(Exact)31 b(v)m(ersion)g(of)g(the)f(compiler)h(used.)481
4698 y(Flags)g(passed)f(to)h(the)g(compiler.)150 4854
y(Ho)m(w)m(ev)m(er,)f(the)e(most)g(imp)s(ortan)m(t)f(single)h(thing)g
(that)f(will)h(help)f(me)g(is)g(the)h(\014le)f(that)h(y)m(ou)f(w)m(ere)
h(trying)150 4964 y(to)35 b(compress)f(or)g(decompress)g(at)g(the)h
(time)f(the)h(problem)e(happ)s(ened.)50 b(Without)34
b(that,)i(m)m(y)e(abilit)m(y)150 5074 y(to)d(do)g(an)m(ything)f(more)h
(than)f(sp)s(eculate)h(ab)s(out)f(the)h(cause,)f(is)h(limited.)150
5230 y(Please)h(remem)m(b)s(er)g(that)g(I)f(connect)h(to)g(the)g(In)m
(ternet)g(with)f(a)h(mo)s(dem,)f(so)g(y)m(ou)h(should)e(con)m(tact)k
(me)150 5340 y(b)s(efore)c(mailing)h(me)g(h)m(uge)f(\014les.)p
eop
%%Page: 35 36
35 35 bop 150 -116 a Fl(Chapter)30 b(4:)41 b(Miscellanea)2586
b(35)150 299 y Fk(4.4)68 b(Did)45 b(y)l(ou)g(get)h(the)f(righ)l(t)h
(pac)l(k)-7 b(age?)150 491 y Fi(bzip2)33 b Fj(is)h(a)h(resource)g(hog.)
54 b(It)35 b(soaks)f(up)g(large)h(amoun)m(ts)g(of)f(CPU)h(cycles)g(and)
f(memory)-8 b(.)53 b(Also,)36 b(it)150 601 y(giv)m(es)25
b(v)m(ery)e(large)i(latencies.)40 b(In)23 b(the)g(w)m(orst)h(case,)i(y)
m(ou)d(can)h(feed)f(man)m(y)g(megab)m(ytes)i(of)e(uncompressed)150
711 y(data)42 b(in)m(to)h(the)f(library)g(b)s(efore)f(getting)j(an)m(y)
e(compressed)g(output,)i(so)e(this)g(probably)f(rules)h(out)150
820 y(applications)31 b(requiring)g(in)m(teractiv)m(e)i(b)s(eha)m
(viour.)150 977 y(These)j(aren't)h(faults)f(of)g(m)m(y)g(implemen)m
(tation,)j(I)d(hop)s(e,)h(but)f(more)g(an)g(in)m(trinsic)g(prop)s(ert)m
(y)g(of)h(the)150 1087 y(Burro)m(ws-Wheeler)31 b(transform)f
(\(unfortunately\).)41 b(Ma)m(yb)s(e)31 b(this)f(isn't)h(what)f(y)m(ou)
h(w)m(an)m(t.)150 1244 y(If)f(y)m(ou)g(w)m(an)m(t)h(a)f(compressor)g
(and/or)g(library)g(whic)m(h)g(is)g(faster,)h(uses)f(less)g(memory)g
(but)g(gets)h(prett)m(y)150 1353 y(go)s(o)s(d)f(compression,)g(and)g
(has)f(minimal)h(latency)-8 b(,)32 b(consider)e(Jean-loup)g(Gailly's)i
(and)d(Mark)h(Adler's)150 1463 y(w)m(ork,)h Fi(zlib-1.1.3)d
Fj(and)h Fi(gzip-1.2.4)p Fj(.)38 b(Lo)s(ok)30 b(for)h(them)f(at)150
1620 y Fi(http://www.zlib.org)25 b Fj(and)30 b Fi(http://www.gzip.org)
25 b Fj(resp)s(ectiv)m(ely)-8 b(.)150 1776 y(F)g(or)30
b(something)h(faster)f(and)e(ligh)m(ter)k(still,)f(y)m(ou)f(migh)m(t)g
(try)g(Markus)f(F)h(X)f(J)h(Ob)s(erh)m(umer's)e Fi(LZO)h
Fj(real-)150 1886 y(time)i(compression/decompression)h(library)-8
b(,)31 b(at)150 1996 y Fi(http://wildsau.idv.uni-l)o(inz.)o(ac.a)o(t/m)
o(fx/l)o(zo.h)o(tml)o Fj(.)150 2152 y(If)37 b(y)m(ou)h(w)m(an)m(t)h(to)
f(use)f(the)h Fi(bzip2)e Fj(algorithms)j(to)f(compress)g(small)g(blo)s
(c)m(ks)f(of)h(data,)i(64k)e(b)m(ytes)h(or)150 2262 y(smaller,)h(for)e
(example)g(on)g(an)g(on-the-\015y)g(disk)f(compressor,)j(y)m(ou'd)e(b)s
(e)f(w)m(ell)i(advised)e(not)i(to)f(use)150 2372 y(this)k(library)-8
b(.)74 b(Instead,)45 b(I'v)m(e)d(made)g(a)f(sp)s(ecial)h(library)g
(tuned)f(for)g(that)h(kind)f(of)h(use.)74 b(It's)42 b(part)150
2481 y(of)d Fi(e2compr-0.40)p Fj(,)e(an)i(on-the-\015y)g(disk)f
(compressor)h(for)g(the)g(Lin)m(ux)e Fi(ext2)h Fj(\014lesystem.)66
b(Lo)s(ok)38 b(at)150 2591 y Fi(http://www.netspace.net.)o(au/~)o(reit)
o(er/)o(e2co)o(mpr)p Fj(.)150 2880 y Fk(4.5)68 b(T)-11
b(esting)150 3072 y Fj(A)30 b(record)h(of)f(the)h(tests)h(I'v)m(e)f
(done.)150 3229 y(First,)g(some)g(data)g(sets:)225 3386
y Fh(\017)60 b Fj(B:)29 b(a)g(directory)h(con)m(taining)h(6001)f
(\014les,)g(one)f(for)g(ev)m(ery)h(length)g(in)e(the)i(range)f(0)g(to)h
(6000)h(b)m(ytes.)330 3496 y(The)f(\014les)h(con)m(tain)g(random)f(lo)m
(w)m(ercase)j(letters.)42 b(18.7)32 b(megab)m(ytes.)225
3633 y Fh(\017)60 b Fj(H:)33 b(m)m(y)h(home)f(directory)h(tree.)50
b(Do)s(cumen)m(ts,)34 b(source)f(co)s(de,)h(mail)g(\014les,)g
(compressed)f(data.)49 b(H)330 3743 y(con)m(tains)39
b(B,)e(and)g(also)i(a)e(directory)i(of)f(\014les)g(designed)f(as)h(b)s
(oundary)e(cases)i(for)g(the)g(sorting;)330 3853 y(mostly)31
b(v)m(ery)g(rep)s(etitiv)m(e,)i(nast)m(y)e(\014les.)40
b(565)32 b(megab)m(ytes.)225 3990 y Fh(\017)60 b Fj(A:)40
b(directory)i(tree)g(holding)e(v)-5 b(arious)41 b(applications)g(built)
g(from)f(source:)62 b Fi(egcs)p Fj(,)42 b Fi(gcc-2.8.1)p
Fj(,)330 4100 y(KDE,)30 b(GTK,)h(Octa)m(v)m(e,)j(etc.)42
b(2200)32 b(megab)m(ytes.)150 4285 y(The)i(tests)h(conducted)f(are)h
(as)f(follo)m(ws.)53 b(Eac)m(h)34 b(test)i(means)d(compressing)i(\(a)f
(cop)m(y)h(of)10 b(\))35 b(eac)m(h)g(\014le)f(in)150
4394 y(the)d(data)f(set,)i(decompressing)e(it)h(and)f(comparing)h(it)g
(against)g(the)g(original.)150 4551 y(First,)36 b(a)f(bunc)m(h)f(of)h
(tests)g(with)g(blo)s(c)m(k)g(sizes)g(and)f(in)m(ternal)i(bu\013er)e
(sizes)h(set)g(v)m(ery)h(small,)g(to)f(detect)150 4661
y(an)m(y)h(problems)g(with)h(the)f(blo)s(c)m(king)h(and)f(bu\013ering)g
(mec)m(hanisms.)59 b(This)36 b(required)g(mo)s(difying)g(the)150
4770 y(source)31 b(co)s(de)f(so)h(as)f(to)i(try)e(to)i(break)e(it.)199
4927 y(1.)61 b(Data)31 b(set)g(H,)g(with)f(bu\013er)g(size)h(of)f(1)h
(b)m(yte,)h(and)d(blo)s(c)m(k)i(size)g(of)g(23)g(b)m(ytes.)199
5065 y(2.)61 b(Data)31 b(set)g(B,)f(bu\013er)g(sizes)h(1)g(b)m(yte,)g
(blo)s(c)m(k)g(size)g(1)g(b)m(yte.)199 5202 y(3.)61 b(As)30
b(\(2\))h(but)f(small-mo)s(de)h(decompression.)199 5340
y(4.)61 b(As)30 b(\(2\))h(with)g(blo)s(c)m(k)f(size)i(2)e(b)m(ytes.)p
eop
%%Page: 36 37
36 36 bop 150 -116 a Fl(Chapter)30 b(4:)41 b(Miscellanea)2586
b(36)199 299 y Fj(5.)61 b(As)30 b(\(2\))h(with)g(blo)s(c)m(k)f(size)i
(3)e(b)m(ytes.)199 431 y(6.)61 b(As)30 b(\(2\))h(with)g(blo)s(c)m(k)f
(size)i(4)e(b)m(ytes.)199 564 y(7.)61 b(As)30 b(\(2\))h(with)g(blo)s(c)
m(k)f(size)i(5)e(b)m(ytes.)199 697 y(8.)61 b(As)30 b(\(2\))h(with)g
(blo)s(c)m(k)f(size)i(6)e(b)m(ytes)h(and)f(small-mo)s(de)h
(decompression.)199 829 y(9.)61 b(H)31 b(with)f(bu\013er)f(size)j(of)e
(1)h(b)m(yte,)g(but)f(normal)g(blo)s(c)m(k)h(size)h(\(up)d(to)j(900000)
h(b)m(ytes\).)150 1009 y(Then)d(some)h(tests)g(with)f(unmo)s(di\014ed)f
(source)h(co)s(de.)199 1166 y(1.)61 b(H,)31 b(all)g(settings)g(normal.)
199 1299 y(2.)61 b(As)30 b(\(1\),)i(with)e(small-mo)s(de)g(decompress.)
199 1431 y(3.)61 b(H,)31 b(compress)f(with)g(\015ag)h
Fi(-1)p Fj(.)199 1564 y(4.)61 b(H,)31 b(compress)f(with)g(\015ag)h
Fi(-s)p Fj(,)f(decompress)g(with)g(\015ag)h Fi(-s)p Fj(.)199
1697 y(5.)61 b(F)-8 b(orw)m(ards)31 b(compatibilit)m(y:)43
b(H,)31 b Fi(bzip2-0.1pl2)d Fj(compressing,)j Fi(bzip2-0.9.5)c
Fj(decompressing,)330 1806 y(all)k(settings)h(normal.)199
1939 y(6.)61 b(Bac)m(kw)m(ards)38 b(compatibilit)m(y:)59
b(H,)39 b Fi(bzip2-0.9.5)c Fj(compressing,)41 b Fi(bzip2-0.1pl2)35
b Fj(decompress-)330 2048 y(ing,)c(all)g(settings)g(normal.)199
2181 y(7.)61 b(Bigger)31 b(tests:)42 b(A,)30 b(all)h(settings)h
(normal.)199 2314 y(8.)61 b(As)30 b(\(7\),)i(using)d(the)i(fallbac)m(k)
g(\(Sadak)-5 b(ane-lik)m(e\))33 b(sorting)e(algorithm.)199
2446 y(9.)61 b(As)30 b(\(8\),)i(compress)e(with)g(\015ag)h
Fi(-1)p Fj(,)f(decompress)g(with)g(\015ag)h Fi(-s)p Fj(.)154
2579 y(10.)61 b(H,)31 b(using)f(the)g(fallbac)m(k)i(sorting)f
(algorithm.)154 2711 y(11.)61 b(F)-8 b(orw)m(ards)31
b(compatibilit)m(y:)44 b(A,)31 b Fi(bzip2-0.1pl2)d Fj(compressing,)k
Fi(bzip2-0.9.5)27 b Fj(decompressing,)330 2821 y(all)k(settings)h
(normal.)154 2954 y(12.)61 b(Bac)m(kw)m(ards)39 b(compatibilit)m(y:)59
b(A,)39 b Fi(bzip2-0.9.5)c Fj(compressing,)41 b Fi(bzip2-0.1pl2)36
b Fj(decompress-)330 3063 y(ing,)31 b(all)g(settings)g(normal.)154
3196 y(13.)61 b(Misc)38 b(test:)57 b(ab)s(out)37 b(400)i(megab)m(ytes)g
(of)f Fi(.tar)f Fj(\014les)g(with)h Fi(bzip2)e Fj(compiled)i(with)g
(Chec)m(k)m(er)g(\(a)330 3305 y(memory)31 b(access)g(error)g(detector,)
h(lik)m(e)g(Purify\).)154 3438 y(14.)61 b(Misc)31 b(tests)h(to)f(mak)m
(e)g(sure)f(it)h(builds)e(and)h(runs)f(ok)h(on)h(non-Lin)m(ux/x86)f
(platforms.)150 3618 y(These)k(tests)g(w)m(ere)h(conducted)e(on)h(a)f
(225)i(MHz)f(IDT)g(WinChip)e(mac)m(hine,)j(running)d(Lin)m(ux)g
(2.0.36.)150 3728 y(They)c(represen)m(t)h(nearly)g(a)f(w)m(eek)h(of)f
(con)m(tin)m(uous)h(computation.)41 b(All)29 b(tests)g(completed)g
(successfully)-8 b(.)150 4003 y Fk(4.6)68 b(F)-11 b(urther)44
b(reading)150 4196 y Fi(bzip2)26 b Fj(is)h(not)h(researc)m(h)g(w)m
(ork,)g(in)f(the)h(sense)f(that)h(it)g(do)s(esn't)f(presen)m(t)h(an)m
(y)f(new)g(ideas.)40 b(Rather,)28 b(it's)150 4306 y(an)i(engineering)h
(exercise)h(based)e(on)g(existing)i(ideas.)150 4463 y(F)-8
b(our)31 b(do)s(cumen)m(ts)f(describ)s(e)g(essen)m(tially)i(all)f(the)g
(ideas)f(b)s(ehind)f Fi(bzip2)p Fj(:)390 4614 y Fi(Michael)46
b(Burrows)g(and)h(D.)g(J.)g(Wheeler:)485 4717 y("A)h(block-sorting)c
(lossless)h(data)i(compression)e(algorithm")533 4821
y(10th)i(May)g(1994.)533 4925 y(Digital)f(SRC)h(Research)e(Report)i
(124.)533 5029 y(ftp://ftp.digital.com/pub)o(/DEC)o(/SR)o(C/re)o(sear)o
(ch-)o(repo)o(rts/)o(SRC)o(-124)o(.ps.)o(gz)533 5132
y(If)g(you)g(have)g(trouble)f(finding)g(it,)g(try)h(searching)f(at)h
(the)533 5236 y(New)g(Zealand)f(Digital)g(Library,)f
(http://www.nzdl.org.)p eop
%%Page: 37 38
37 37 bop 150 -116 a Fl(Chapter)30 b(4:)41 b(Miscellanea)2586
b(37)390 299 y Fi(Daniel)46 b(S.)h(Hirschberg)e(and)i(Debra)g(A.)g
(LeLewer)485 403 y("Efficient)e(Decoding)h(of)h(Prefix)f(Codes")533
506 y(Communications)e(of)j(the)g(ACM,)g(April)f(1990,)h(Vol)f(33,)h
(Number)f(4.)533 610 y(You)h(might)f(be)i(able)e(to)h(get)g(an)h
(electronic)d(copy)h(of)h(this)676 714 y(from)g(the)g(ACM)g(Digital)f
(Library.)390 922 y(David)g(J.)i(Wheeler)533 1025 y(Program)e(bred3.c)g
(and)h(accompanying)d(document)i(bred3.ps.)533 1129 y(This)h(contains)e
(the)i(idea)g(behind)f(the)h(multi-table)e(Huffman)533
1233 y(coding)h(scheme.)533 1337 y(ftp://ftp.cl.cam.ac.uk/us)o(ers/)o
(djw)o(3/)390 1544 y(Jon)h(L.)g(Bentley)f(and)h(Robert)f(Sedgewick)485
1648 y("Fast)h(Algorithms)e(for)i(Sorting)f(and)g(Searching)g(Strings")
533 1752 y(Available)f(from)i(Sedgewick's)e(web)i(page,)533
1856 y(www.cs.princeton.edu/~rs)150 2012 y Fj(The)29
b(follo)m(wing)h(pap)s(er)d(giv)m(es)j(v)-5 b(aluable)29
b(additional)g(insigh)m(ts)g(in)m(to)h(the)f(algorithm,)h(but)e(is)h
(not)g(imme-)150 2122 y(diately)i(the)g(basis)f(of)h(an)m(y)f(co)s(de)h
(used)e(in)h(bzip2.)390 2273 y Fi(Peter)46 b(Fenwick:)533
2377 y(Block)h(Sorting)e(Text)i(Compression)533 2481
y(Proceedings)e(of)i(the)g(19th)g(Australasian)d(Computer)i(Science)f
(Conference,)629 2584 y(Melbourne,)g(Australia.)92 b(Jan)47
b(31)g(-)h(Feb)f(2,)g(1996.)533 2688 y(ftp://ftp.cs.auckland.ac.)o
(nz/p)o(ub/)o(pete)o(r-f/)o(ACS)o(C96p)o(aper)o(.ps)150
2845 y Fj(Kunihik)m(o)30 b(Sadak)-5 b(ane's)30 b(sorting)i(algorithm,)f
(men)m(tioned)g(ab)s(o)m(v)m(e,)h(is)e(a)m(v)-5 b(ailable)32
b(from:)390 2996 y Fi(http://naomi.is.s.u-toky)o(o.ac)o(.jp/)o(~sa)o
(da/p)o(aper)o(s/S)o(ada9)o(8b.p)o(s.g)o(z)150 3153 y
Fj(The)38 b(Man)m(b)s(er-My)m(ers)h(su\016x)e(arra)m(y)i(construction)g
(algorithm)h(is)e(describ)s(ed)f(in)h(a)g(pap)s(er)f(a)m(v)-5
b(ailable)150 3262 y(from:)390 3413 y Fi(http://www.cs.arizona.ed)o
(u/pe)o(ople)o(/ge)o(ne/P)o(APER)o(S/s)o(uffi)o(x.ps)150
3570 y Fj(Finally)d(,)33 b(the)e(follo)m(wing)i(pap)s(er)d(do)s(cumen)m
(ts)h(some)g(recen)m(t)i(in)m(v)m(estigations)h(I)d(made)g(in)m(to)i
(the)e(p)s(erfor-)150 3680 y(mance)g(of)f(sorting)h(algorithms:)390
3831 y Fi(Julian)46 b(Seward:)533 3935 y(On)h(the)g(Performance)e(of)i
(BWT)g(Sorting)f(Algorithms)533 4038 y(Proceedings)f(of)i(the)g(IEEE)g
(Data)f(Compression)f(Conference)g(2000)629 4142 y(Snowbird,)g(Utah.)94
b(28-30)46 b(March)h(2000.)p eop
%%Page: -1 39
-1 38 bop 3725 -116 a Fl(i)150 299 y Fg(T)-13 b(able)54
b(of)g(Con)l(ten)l(ts)150 641 y Fk(1)135 b(In)l(tro)t(duction)15
b Fa(.)20 b(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f
(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)60
b Fk(2)150 911 y(2)135 b(Ho)l(w)45 b(to)h(use)f Fc(bzip2)31
b Fa(.)19 b(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g
(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)78 b Fk(3)1047
1048 y Fj(NAME)18 b Fb(.)d(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)
g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)48 b Fl(3)1047
1157 y Fj(SYNOPSIS)18 b Fb(.)c(.)h(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)
g(.)g(.)g(.)g(.)g(.)g(.)g(.)48 b Fl(3)1047 1267 y Fj(DESCRIPTION)28
b Fb(.)15 b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)59
b Fl(3)1047 1377 y Fj(OPTIONS)16 b Fb(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)46 b Fl(4)1047
1486 y Fj(MEMOR)-8 b(Y)31 b(MANA)m(GEMENT)9 b Fb(.)16
b(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
(.)g(.)39 b Fl(6)1047 1596 y Fj(RECO)m(VERING)30 b(D)m(A)-8
b(T)g(A)31 b(FR)m(OM)g(D)m(AMA)m(GED)g(FILES)1256 1705
y Fb(.)15 b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)
g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)57 b Fl(7)1047 1815 y
Fj(PERF)m(ORMANCE)30 b(NOTES)10 b Fb(.)15 b(.)g(.)g(.)g(.)g(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)40
b Fl(8)1047 1924 y Fj(CA)-10 b(VEA)i(TS)12 b Fb(.)h(.)i(.)g(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)
g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)42
b Fl(8)1047 2034 y Fj(A)m(UTHOR)22 b Fb(.)15 b(.)g(.)g(.)g(.)g(.)g(.)g
(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)52 b
Fl(8)150 2276 y Fk(3)135 b(Programming)46 b(with)f Fc(libbzip2)27
b Fa(.)16 b(.)j(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)72
b Fk(10)449 2413 y Fj(3.1)92 b(T)-8 b(op-lev)m(el)33
b(structure)18 b Fb(.)d(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
g(.)g(.)g(.)g(.)g(.)g(.)47 b Fl(10)748 2523 y Fj(3.1.1)93
b(Lo)m(w-lev)m(el)32 b(summary)20 b Fb(.)15 b(.)g(.)g(.)g(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
g(.)g(.)g(.)50 b Fl(10)748 2633 y Fj(3.1.2)93 b(High-lev)m(el)32
b(summary)27 b Fb(.)15 b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)57
b Fl(10)748 2742 y Fj(3.1.3)93 b(Utilit)m(y)32 b(functions)e(summary)10
b Fb(.)k(.)h(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
g(.)g(.)g(.)g(.)g(.)39 b Fl(11)449 2852 y Fj(3.2)92 b(Error)30
b(handling)15 b Fb(.)f(.)h(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)44 b Fl(11)449
2961 y Fj(3.3)92 b(Lo)m(w-lev)m(el)32 b(in)m(terface)26
b Fb(.)15 b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
g(.)g(.)g(.)53 b Fl(13)748 3071 y Fj(3.3.1)93 b Fi(BZ2_bzCompressInit)
21 b Fb(.)9 b(.)15 b(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)
g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)50 b Fl(13)748
3181 y Fj(3.3.2)93 b Fi(BZ2_bzCompress)9 b Fb(.)h(.)15
b(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)38 b Fl(15)748
3290 y Fj(3.3.3)93 b Fi(BZ2_bzCompressEnd)23 b Fb(.)10
b(.)15 b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)52 b Fl(18)748 3400
y Fj(3.3.4)93 b Fi(BZ2_bzDecompressInit)16 b Fb(.)9 b(.)15
b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)45 b Fl(18)748 3509 y Fj(3.3.5)93
b Fi(BZ2_bzDecompress)21 b Fb(.)15 b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
(.)55 b Fl(18)748 3619 y Fj(3.3.6)93 b Fi(BZ2_bzDecompressEnd)18
b Fb(.)10 b(.)15 b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)48 b Fl(20)449
3729 y Fj(3.4)92 b(High-lev)m(el)33 b(in)m(terface)9
b Fb(.)17 b(.)e(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)
g(.)g(.)g(.)38 b Fl(20)748 3838 y Fj(3.4.1)93 b Fi(BZ2_bzReadOpen)9
b Fb(.)h(.)15 b(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)38
b Fl(20)748 3948 y Fj(3.4.2)93 b Fi(BZ2_bzRead)18 b Fb(.)12
b(.)j(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)47
b Fl(21)748 4057 y Fj(3.4.3)93 b Fi(BZ2_bzReadGetUnused)18
b Fb(.)10 b(.)15 b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)48 b Fl(23)748
4167 y Fj(3.4.4)93 b Fi(BZ2_bzReadClose)23 b Fb(.)15
b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)57 b Fl(23)748
4276 y Fj(3.4.5)93 b Fi(BZ2_bzWriteOpen)23 b Fb(.)15
b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)57 b Fl(23)748
4386 y Fj(3.4.6)93 b Fi(BZ2_bzWrite)16 b Fb(.)11 b(.)k(.)g(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)45 b Fl(24)748
4496 y Fj(3.4.7)93 b Fi(BZ2_bzWriteClose)21 b Fb(.)15
b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)55 b Fl(25)748
4605 y Fj(3.4.8)93 b(Handling)30 b(em)m(b)s(edded)f(compressed)h(data)h
(streams)9 b Fb(.)15 b(.)g(.)g(.)38 b Fl(25)748 4715
y Fj(3.4.9)93 b(Standard)29 b(\014le-reading/writing)j(co)s(de)16
b Fb(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)45
b Fl(26)449 4824 y Fj(3.5)92 b(Utilit)m(y)32 b(functions)c
Fb(.)15 b(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
g(.)g(.)g(.)g(.)h(.)57 b Fl(27)748 4934 y Fj(3.5.1)93
b Fi(BZ2_bzBuffToBuffCompres)o(s)22 b Fb(.)15 b(.)g(.)g(.)g(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)57 b Fl(27)748
5044 y Fj(3.5.2)93 b Fi(BZ2_bzBuffToBuffDecompr)o(ess)17
b Fb(.)e(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
53 b Fl(28)449 5153 y Fj(3.6)92 b Fi(zlib)29 b Fj(compatibilit)m(y)k
(functions)23 b Fb(.)15 b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)52
b Fl(29)449 5263 y Fj(3.7)92 b(Using)30 b(the)h(library)f(in)g(a)h
Fi(stdio)p Fj(-free)f(en)m(vironmen)m(t)12 b Fb(.)k(.)f(.)g(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)41 b Fl(30)p eop
%%Page: -2 40
-2 39 bop 3699 -116 a Fl(ii)748 83 y Fj(3.7.1)93 b(Getting)32
b(rid)e(of)g Fi(stdio)17 b Fb(.)d(.)h(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)46
b Fl(30)748 193 y Fj(3.7.2)93 b(Critical)31 b(error)g(handling)18
b Fb(.)c(.)h(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)
g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)47 b Fl(30)449 302 y
Fj(3.8)92 b(Making)31 b(a)f(Windo)m(ws)g(DLL)17 b Fb(.)d(.)h(.)g(.)g(.)
g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)46 b Fl(31)150
545 y Fk(4)135 b(Miscellanea)11 b Fa(.)21 b(.)f(.)f(.)h(.)f(.)g(.)h(.)f
(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)
f(.)h(.)f(.)g(.)h(.)56 b Fk(32)449 682 y Fj(4.1)92 b(Limitations)31
b(of)g(the)g(compressed)f(\014le)g(format)c Fb(.)15 b(.)g(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)54 b Fl(32)449
791 y Fj(4.2)92 b(P)m(ortabilit)m(y)33 b(issues)12 b
Fb(.)j(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)
g(.)g(.)g(.)g(.)41 b Fl(33)449 901 y Fj(4.3)92 b(Rep)s(orting)31
b(bugs)24 b Fb(.)15 b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)54 b Fl(33)449 1010
y Fj(4.4)92 b(Did)30 b(y)m(ou)g(get)i(the)f(righ)m(t)g(pac)m(k)-5
b(age?)18 b Fb(.)f(.)e(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)47 b Fl(35)449
1120 y Fj(4.5)92 b(T)-8 b(esting)16 b Fb(.)h(.)e(.)g(.)g(.)g(.)g(.)g(.)
g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
g(.)g(.)g(.)g(.)g(.)46 b Fl(35)449 1230 y Fj(4.6)92 b(F)-8
b(urther)30 b(reading)17 b Fb(.)f(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)46 b
Fl(36)p eop
%%Trailer
end
userdict /end-hook known{end-hook}if
%%EOF
|
Added work/src/bzip2-1.0.2/manual.texi.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
|
\input texinfo @c -*- Texinfo -*-
@setfilename bzip2.info
@ignore
This file documents bzip2 version 1.0.2, and associated library
libbzip2, written by Julian Seward (jseward@acm.org).
Copyright (C) 1996-2002 Julian R Seward
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.
Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for verbatim copies.
@end ignore
@ifinfo
@format
START-INFO-DIR-ENTRY
* Bzip2: (bzip2). A program and library for data compression.
END-INFO-DIR-ENTRY
@end format
@end ifinfo
@iftex
@c @finalout
@settitle bzip2 and libbzip2
@titlepage
@title bzip2 and libbzip2
@subtitle a program and library for data compression
@subtitle copyright (C) 1996-2002 Julian Seward
@subtitle version 1.0.2 of 30 December 2001
@author Julian Seward
@end titlepage
@parindent 0mm
@parskip 2mm
@end iftex
@node Top,,, (dir)
The following text is the License for this software. You should
find it identical to that contained in the file LICENSE in the
source distribution.
@bf{------------------ START OF THE LICENSE ------------------}
This program, @code{bzip2},
and associated library @code{libbzip2}, are
Copyright (C) 1996-2002 Julian R Seward. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
@itemize @bullet
@item
Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
@item
The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.
@item
Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
@item
The name of the author may not be used to endorse or promote
products derived from this software without specific prior written
permission.
@end itemize
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Julian Seward, Cambridge, UK.
@code{jseward@@acm.org}
@code{bzip2}/@code{libbzip2} version 1.0.2 of 30 December 2001.
@bf{------------------ END OF THE LICENSE ------------------}
Web sites:
@code{http://sources.redhat.com/bzip2}
@code{http://www.cacheprof.org}
PATENTS: To the best of my knowledge, @code{bzip2} does not use any patented
algorithms. However, I do not have the resources available to carry out
a full patent search. Therefore I cannot give any guarantee of the
above statement.
@chapter Introduction
@code{bzip2} compresses files using the Burrows-Wheeler
block-sorting text compression algorithm, and Huffman coding.
Compression is generally considerably better than that
achieved by more conventional LZ77/LZ78-based compressors,
and approaches the performance of the PPM family of statistical compressors.
@code{bzip2} is built on top of @code{libbzip2}, a flexible library
for handling compressed data in the @code{bzip2} format. This manual
describes both how to use the program and
how to work with the library interface. Most of the
manual is devoted to this library, not the program,
which is good news if your interest is only in the program.
Chapter 2 describes how to use @code{bzip2}; this is the only part
you need to read if you just want to know how to operate the program.
Chapter 3 describes the programming interfaces in detail, and
Chapter 4 records some miscellaneous notes which I thought
ought to be recorded somewhere.
@chapter How to use @code{bzip2}
This chapter contains a copy of the @code{bzip2} man page,
and nothing else.
@quotation
@unnumberedsubsubsec NAME
@itemize
@item @code{bzip2}, @code{bunzip2}
- a block-sorting file compressor, v1.0.2
@item @code{bzcat}
- decompresses files to stdout
@item @code{bzip2recover}
- recovers data from damaged bzip2 files
@end itemize
@unnumberedsubsubsec SYNOPSIS
@itemize
@item @code{bzip2} [ -cdfkqstvzVL123456789 ] [ filenames ... ]
@item @code{bunzip2} [ -fkvsVL ] [ filenames ... ]
@item @code{bzcat} [ -s ] [ filenames ... ]
@item @code{bzip2recover} filename
@end itemize
@unnumberedsubsubsec DESCRIPTION
@code{bzip2} compresses files using the Burrows-Wheeler block sorting
text compression algorithm, and Huffman coding. Compression is
generally considerably better than that achieved by more conventional
LZ77/LZ78-based compressors, and approaches the performance of the PPM
family of statistical compressors.
The command-line options are deliberately very similar to those of GNU
@code{gzip}, but they are not identical.
@code{bzip2} expects a list of file names to accompany the command-line
flags. Each file is replaced by a compressed version of itself, with
the name @code{original_name.bz2}. Each compressed file has the same
modification date, permissions, and, when possible, ownership as the
corresponding original, so that these properties can be correctly
restored at decompression time. File name handling is naive in the
sense that there is no mechanism for preserving original file names,
permissions, ownerships or dates in filesystems which lack these
concepts, or have serious file name length restrictions, such as MS-DOS.
@code{bzip2} and @code{bunzip2} will by default not overwrite existing
files. If you want this to happen, specify the @code{-f} flag.
If no file names are specified, @code{bzip2} compresses from standard
input to standard output. In this case, @code{bzip2} will decline to
write compressed output to a terminal, as this would be entirely
incomprehensible and therefore pointless.
@code{bunzip2} (or @code{bzip2 -d}) decompresses all
specified files. Files which were not created by @code{bzip2}
will be detected and ignored, and a warning issued.
@code{bzip2} attempts to guess the filename for the decompressed file
from that of the compressed file as follows:
@itemize
@item @code{filename.bz2 } becomes @code{filename}
@item @code{filename.bz } becomes @code{filename}
@item @code{filename.tbz2} becomes @code{filename.tar}
@item @code{filename.tbz } becomes @code{filename.tar}
@item @code{anyothername } becomes @code{anyothername.out}
@end itemize
If the file does not end in one of the recognised endings,
@code{.bz2}, @code{.bz},
@code{.tbz2} or @code{.tbz}, @code{bzip2} complains that it cannot
guess the name of the original file, and uses the original name
with @code{.out} appended.
As with compression, supplying no
filenames causes decompression from standard input to standard output.
@code{bunzip2} will correctly decompress a file which is the
concatenation of two or more compressed files. The result is the
concatenation of the corresponding uncompressed files. Integrity
testing (@code{-t}) of concatenated compressed files is also supported.
You can also compress or decompress files to the standard output by
giving the @code{-c} flag. Multiple files may be compressed and
decompressed like this. The resulting outputs are fed sequentially to
stdout. Compression of multiple files in this manner generates a stream
containing multiple compressed file representations. Such a stream
can be decompressed correctly only by @code{bzip2} version 0.9.0 or
later. Earlier versions of @code{bzip2} will stop after decompressing
the first file in the stream.
@code{bzcat} (or @code{bzip2 -dc}) decompresses all specified files to
the standard output.
@code{bzip2} will read arguments from the environment variables
@code{BZIP2} and @code{BZIP}, in that order, and will process them
before any arguments read from the command line. This gives a
convenient way to supply default arguments.
Compression is always performed, even if the compressed file is slightly
larger than the original. Files of less than about one hundred bytes
tend to get larger, since the compression mechanism has a constant
overhead in the region of 50 bytes. Random data (including the output
of most file compressors) is coded at about 8.05 bits per byte, giving
an expansion of around 0.5%.
As a self-check for your protection, @code{bzip2} uses 32-bit CRCs to
make sure that the decompressed version of a file is identical to the
original. This guards against corruption of the compressed data, and
against undetected bugs in @code{bzip2} (hopefully very unlikely). The
chances of data corruption going undetected is microscopic, about one
chance in four billion for each file processed. Be aware, though, that
the check occurs upon decompression, so it can only tell you that
something is wrong. It can't help you recover the original uncompressed
data. You can use @code{bzip2recover} to try to recover data from
damaged files.
Return values: 0 for a normal exit, 1 for environmental problems (file
not found, invalid flags, I/O errors, &c), 2 to indicate a corrupt
compressed file, 3 for an internal consistency error (eg, bug) which
caused @code{bzip2} to panic.
@unnumberedsubsubsec OPTIONS
@table @code
@item -c --stdout
Compress or decompress to standard output.
@item -d --decompress
Force decompression. @code{bzip2}, @code{bunzip2} and @code{bzcat} are
really the same program, and the decision about what actions to take is
done on the basis of which name is used. This flag overrides that
mechanism, and forces bzip2 to decompress.
@item -z --compress
The complement to @code{-d}: forces compression, regardless of the
invokation name.
@item -t --test
Check integrity of the specified file(s), but don't decompress them.
This really performs a trial decompression and throws away the result.
@item -f --force
Force overwrite of output files. Normally, @code{bzip2} will not overwrite
existing output files. Also forces @code{bzip2} to break hard links
to files, which it otherwise wouldn't do.
@code{bzip2} normally declines to decompress files which don't have the
correct magic header bytes. If forced (@code{-f}), however, it will
pass such files through unmodified. This is how GNU @code{gzip}
behaves.
@item -k --keep
Keep (don't delete) input files during compression
or decompression.
@item -s --small
Reduce memory usage, for compression, decompression and testing. Files
are decompressed and tested using a modified algorithm which only
requires 2.5 bytes per block byte. This means any file can be
decompressed in 2300k of memory, albeit at about half the normal speed.
During compression, @code{-s} selects a block size of 200k, which limits
memory use to around the same figure, at the expense of your compression
ratio. In short, if your machine is low on memory (8 megabytes or
less), use -s for everything. See MEMORY MANAGEMENT below.
@item -q --quiet
Suppress non-essential warning messages. Messages pertaining to
I/O errors and other critical events will not be suppressed.
@item -v --verbose
Verbose mode -- show the compression ratio for each file processed.
Further @code{-v}'s increase the verbosity level, spewing out lots of
information which is primarily of interest for diagnostic purposes.
@item -L --license -V --version
Display the software version, license terms and conditions.
@item -1 (or --fast) to -9 (or --best)
Set the block size to 100 k, 200 k .. 900 k when compressing. Has no
effect when decompressing. See MEMORY MANAGEMENT below.
The @code{--fast} and @code{--best} aliases are primarily for GNU
@code{gzip} compatibility. In particular, @code{--fast} doesn't make
things significantly faster. And @code{--best} merely selects the
default behaviour.
@item --
Treats all subsequent arguments as file names, even if they start
with a dash. This is so you can handle files with names beginning
with a dash, for example: @code{bzip2 -- -myfilename}.
@item --repetitive-fast
@item --repetitive-best
These flags are redundant in versions 0.9.5 and above. They provided
some coarse control over the behaviour of the sorting algorithm in
earlier versions, which was sometimes useful. 0.9.5 and above have an
improved algorithm which renders these flags irrelevant.
@end table
@unnumberedsubsubsec MEMORY MANAGEMENT
@code{bzip2} compresses large files in blocks. The block size affects
both the compression ratio achieved, and the amount of memory needed for
compression and decompression. The flags @code{-1} through @code{-9}
specify the block size to be 100,000 bytes through 900,000 bytes (the
default) respectively. At decompression time, the block size used for
compression is read from the header of the compressed file, and
@code{bunzip2} then allocates itself just enough memory to decompress
the file. Since block sizes are stored in compressed files, it follows
that the flags @code{-1} to @code{-9} are irrelevant to and so ignored
during decompression.
Compression and decompression requirements, in bytes, can be estimated
as:
@example
Compression: 400k + ( 8 x block size )
Decompression: 100k + ( 4 x block size ), or
100k + ( 2.5 x block size )
@end example
Larger block sizes give rapidly diminishing marginal returns. Most of
the compression comes from the first two or three hundred k of block
size, a fact worth bearing in mind when using @code{bzip2} on small machines.
It is also important to appreciate that the decompression memory
requirement is set at compression time by the choice of block size.
For files compressed with the default 900k block size, @code{bunzip2}
will require about 3700 kbytes to decompress. To support decompression
of any file on a 4 megabyte machine, @code{bunzip2} has an option to
decompress using approximately half this amount of memory, about 2300
kbytes. Decompression speed is also halved, so you should use this
option only where necessary. The relevant flag is @code{-s}.
In general, try and use the largest block size memory constraints allow,
since that maximises the compression achieved. Compression and
decompression speed are virtually unaffected by block size.
Another significant point applies to files which fit in a single block
-- that means most files you'd encounter using a large block size. The
amount of real memory touched is proportional to the size of the file,
since the file is smaller than a block. For example, compressing a file
20,000 bytes long with the flag @code{-9} will cause the compressor to
allocate around 7600k of memory, but only touch 400k + 20000 * 8 = 560
kbytes of it. Similarly, the decompressor will allocate 3700k but only
touch 100k + 20000 * 4 = 180 kbytes.
Here is a table which summarises the maximum memory usage for different
block sizes. Also recorded is the total compressed size for 14 files of
the Calgary Text Compression Corpus totalling 3,141,622 bytes. This
column gives some feel for how compression varies with block size.
These figures tend to understate the advantage of larger block sizes for
larger files, since the Corpus is dominated by smaller files.
@example
Compress Decompress Decompress Corpus
Flag usage usage -s usage Size
-1 1200k 500k 350k 914704
-2 2000k 900k 600k 877703
-3 2800k 1300k 850k 860338
-4 3600k 1700k 1100k 846899
-5 4400k 2100k 1350k 845160
-6 5200k 2500k 1600k 838626
-7 6100k 2900k 1850k 834096
-8 6800k 3300k 2100k 828642
-9 7600k 3700k 2350k 828642
@end example
@unnumberedsubsubsec RECOVERING DATA FROM DAMAGED FILES
@code{bzip2} compresses files in blocks, usually 900kbytes long. Each
block is handled independently. If a media or transmission error causes
a multi-block @code{.bz2} file to become damaged, it may be possible to
recover data from the undamaged blocks in the file.
The compressed representation of each block is delimited by a 48-bit
pattern, which makes it possible to find the block boundaries with
reasonable certainty. Each block also carries its own 32-bit CRC, so
damaged blocks can be distinguished from undamaged ones.
@code{bzip2recover} is a simple program whose purpose is to search for
blocks in @code{.bz2} files, and write each block out into its own
@code{.bz2} file. You can then use @code{bzip2 -t} to test the
integrity of the resulting files, and decompress those which are
undamaged.
@code{bzip2recover}
takes a single argument, the name of the damaged file, and writes a
number of files @code{rec00001file.bz2}, @code{rec00002file.bz2}, etc,
containing the extracted blocks. The output filenames are designed so
that the use of wildcards in subsequent processing -- for example,
@code{bzip2 -dc rec*file.bz2 > recovered_data} -- processes the files in
the correct order.
@code{bzip2recover} should be of most use dealing with large @code{.bz2}
files, as these will contain many blocks. It is clearly futile to use
it on damaged single-block files, since a damaged block cannot be
recovered. If you wish to minimise any potential data loss through
media or transmission errors, you might consider compressing with a
smaller block size.
@unnumberedsubsubsec PERFORMANCE NOTES
The sorting phase of compression gathers together similar strings in the
file. Because of this, files containing very long runs of repeated
symbols, like "aabaabaabaab ..." (repeated several hundred times) may
compress more slowly than normal. Versions 0.9.5 and above fare much
better than previous versions in this respect. The ratio between
worst-case and average-case compression time is in the region of 10:1.
For previous versions, this figure was more like 100:1. You can use the
@code{-vvvv} option to monitor progress in great detail, if you want.
Decompression speed is unaffected by these phenomena.
@code{bzip2} usually allocates several megabytes of memory to operate
in, and then charges all over it in a fairly random fashion. This means
that performance, both for compressing and decompressing, is largely
determined by the speed at which your machine can service cache misses.
Because of this, small changes to the code to reduce the miss rate have
been observed to give disproportionately large performance improvements.
I imagine @code{bzip2} will perform best on machines with very large
caches.
@unnumberedsubsubsec CAVEATS
I/O error messages are not as helpful as they could be. @code{bzip2}
tries hard to detect I/O errors and exit cleanly, but the details of
what the problem is sometimes seem rather misleading.
This manual page pertains to version 1.0.2 of @code{bzip2}. Compressed
data created by this version is entirely forwards and backwards
compatible with the previous public releases, versions 0.1pl2, 0.9.0,
0.9.5, 1.0.0 and 1.0.1, but with the following exception: 0.9.0 and
above can correctly decompress multiple concatenated compressed files.
0.1pl2 cannot do this; it will stop after decompressing just the first
file in the stream.
@code{bzip2recover} versions prior to this one, 1.0.2, used 32-bit
integers to represent bit positions in compressed files, so it could not
handle compressed files more than 512 megabytes long. Version 1.0.2 and
above uses 64-bit ints on some platforms which support them (GNU
supported targets, and Windows). To establish whether or not
@code{bzip2recover} was built with such a limitation, run it without
arguments. In any event you can build yourself an unlimited version if
you can recompile it with @code{MaybeUInt64} set to be an unsigned
64-bit integer.
@unnumberedsubsubsec AUTHOR
Julian Seward, @code{jseward@@acm.org}.
@code{http://sources.redhat.com/bzip2}
The ideas embodied in @code{bzip2} are due to (at least) the following
people: Michael Burrows and David Wheeler (for the block sorting
transformation), David Wheeler (again, for the Huffman coder), Peter
Fenwick (for the structured coding model in the original @code{bzip},
and many refinements), and Alistair Moffat, Radford Neal and Ian Witten
(for the arithmetic coder in the original @code{bzip}). I am much
indebted for their help, support and advice. See the manual in the
source distribution for pointers to sources of documentation. Christian
von Roques encouraged me to look for faster sorting algorithms, so as to
speed up compression. Bela Lubkin encouraged me to improve the
worst-case compression performance. The @code{bz*} scripts are derived
from those of GNU @code{gzip}. Many people sent patches, helped with
portability problems, lent machines, gave advice and were generally
helpful.
@end quotation
@chapter Programming with @code{libbzip2}
This chapter describes the programming interface to @code{libbzip2}.
For general background information, particularly about memory
use and performance aspects, you'd be well advised to read Chapter 2
as well.
@section Top-level structure
@code{libbzip2} is a flexible library for compressing and decompressing
data in the @code{bzip2} data format. Although packaged as a single
entity, it helps to regard the library as three separate parts: the low
level interface, and the high level interface, and some utility
functions.
The structure of @code{libbzip2}'s interfaces is similar to
that of Jean-loup Gailly's and Mark Adler's excellent @code{zlib}
library.
All externally visible symbols have names beginning @code{BZ2_}.
This is new in version 1.0. The intention is to minimise pollution
of the namespaces of library clients.
@subsection Low-level summary
This interface provides services for compressing and decompressing
data in memory. There's no provision for dealing with files, streams
or any other I/O mechanisms, just straight memory-to-memory work.
In fact, this part of the library can be compiled without inclusion
of @code{stdio.h}, which may be helpful for embedded applications.
The low-level part of the library has no global variables and
is therefore thread-safe.
Six routines make up the low level interface:
@code{BZ2_bzCompressInit}, @code{BZ2_bzCompress}, and @* @code{BZ2_bzCompressEnd}
for compression,
and a corresponding trio @code{BZ2_bzDecompressInit}, @* @code{BZ2_bzDecompress}
and @code{BZ2_bzDecompressEnd} for decompression.
The @code{*Init} functions allocate
memory for compression/decompression and do other
initialisations, whilst the @code{*End} functions close down operations
and release memory.
The real work is done by @code{BZ2_bzCompress} and @code{BZ2_bzDecompress}.
These compress and decompress data from a user-supplied input buffer
to a user-supplied output buffer. These buffers can be any size;
arbitrary quantities of data are handled by making repeated calls
to these functions. This is a flexible mechanism allowing a
consumer-pull style of activity, or producer-push, or a mixture of
both.
@subsection High-level summary
This interface provides some handy wrappers around the low-level
interface to facilitate reading and writing @code{bzip2} format
files (@code{.bz2} files). The routines provide hooks to facilitate
reading files in which the @code{bzip2} data stream is embedded
within some larger-scale file structure, or where there are
multiple @code{bzip2} data streams concatenated end-to-end.
For reading files, @code{BZ2_bzReadOpen}, @code{BZ2_bzRead},
@code{BZ2_bzReadClose} and @* @code{BZ2_bzReadGetUnused} are supplied. For
writing files, @code{BZ2_bzWriteOpen}, @code{BZ2_bzWrite} and
@code{BZ2_bzWriteFinish} are available.
As with the low-level library, no global variables are used
so the library is per se thread-safe. However, if I/O errors
occur whilst reading or writing the underlying compressed files,
you may have to consult @code{errno} to determine the cause of
the error. In that case, you'd need a C library which correctly
supports @code{errno} in a multithreaded environment.
To make the library a little simpler and more portable,
@code{BZ2_bzReadOpen} and @code{BZ2_bzWriteOpen} require you to pass them file
handles (@code{FILE*}s) which have previously been opened for reading or
writing respectively. That avoids portability problems associated with
file operations and file attributes, whilst not being much of an
imposition on the programmer.
@subsection Utility functions summary
For very simple needs, @code{BZ2_bzBuffToBuffCompress} and
@code{BZ2_bzBuffToBuffDecompress} are provided. These compress
data in memory from one buffer to another buffer in a single
function call. You should assess whether these functions
fulfill your memory-to-memory compression/decompression
requirements before investing effort in understanding the more
general but more complex low-level interface.
Yoshioka Tsuneo (@code{QWF00133@@niftyserve.or.jp} /
@code{tsuneo-y@@is.aist-nara.ac.jp}) has contributed some functions to
give better @code{zlib} compatibility. These functions are
@code{BZ2_bzopen}, @code{BZ2_bzread}, @code{BZ2_bzwrite}, @code{BZ2_bzflush},
@code{BZ2_bzclose},
@code{BZ2_bzerror} and @code{BZ2_bzlibVersion}. You may find these functions
more convenient for simple file reading and writing, than those in the
high-level interface. These functions are not (yet) officially part of
the library, and are minimally documented here. If they break, you
get to keep all the pieces. I hope to document them properly when time
permits.
Yoshioka also contributed modifications to allow the library to be
built as a Windows DLL.
@section Error handling
The library is designed to recover cleanly in all situations, including
the worst-case situation of decompressing random data. I'm not
100% sure that it can always do this, so you might want to add
a signal handler to catch segmentation violations during decompression
if you are feeling especially paranoid. I would be interested in
hearing more about the robustness of the library to corrupted
compressed data.
Version 1.0 is much more robust in this respect than
0.9.0 or 0.9.5. Investigations with Checker (a tool for
detecting problems with memory management, similar to Purify)
indicate that, at least for the few files I tested, all single-bit
errors in the decompressed data are caught properly, with no
segmentation faults, no reads of uninitialised data and no
out of range reads or writes. So it's certainly much improved,
although I wouldn't claim it to be totally bombproof.
The file @code{bzlib.h} contains all definitions needed to use
the library. In particular, you should definitely not include
@code{bzlib_private.h}.
In @code{bzlib.h}, the various return values are defined. The following
list is not intended as an exhaustive description of the circumstances
in which a given value may be returned -- those descriptions are given
later. Rather, it is intended to convey the rough meaning of each
return value. The first five actions are normal and not intended to
denote an error situation.
@table @code
@item BZ_OK
The requested action was completed successfully.
@item BZ_RUN_OK
@itemx BZ_FLUSH_OK
@itemx BZ_FINISH_OK
In @code{BZ2_bzCompress}, the requested flush/finish/nothing-special action
was completed successfully.
@item BZ_STREAM_END
Compression of data was completed, or the logical stream end was
detected during decompression.
@end table
The following return values indicate an error of some kind.
@table @code
@item BZ_CONFIG_ERROR
Indicates that the library has been improperly compiled on your
platform -- a major configuration error. Specifically, it means
that @code{sizeof(char)}, @code{sizeof(short)} and @code{sizeof(int)}
are not 1, 2 and 4 respectively, as they should be. Note that the
library should still work properly on 64-bit platforms which follow
the LP64 programming model -- that is, where @code{sizeof(long)}
and @code{sizeof(void*)} are 8. Under LP64, @code{sizeof(int)} is
still 4, so @code{libbzip2}, which doesn't use the @code{long} type,
is OK.
@item BZ_SEQUENCE_ERROR
When using the library, it is important to call the functions in the
correct sequence and with data structures (buffers etc) in the correct
states. @code{libbzip2} checks as much as it can to ensure this is
happening, and returns @code{BZ_SEQUENCE_ERROR} if not. Code which
complies precisely with the function semantics, as detailed below,
should never receive this value; such an event denotes buggy code
which you should investigate.
@item BZ_PARAM_ERROR
Returned when a parameter to a function call is out of range
or otherwise manifestly incorrect. As with @code{BZ_SEQUENCE_ERROR},
this denotes a bug in the client code. The distinction between
@code{BZ_PARAM_ERROR} and @code{BZ_SEQUENCE_ERROR} is a bit hazy, but still worth
making.
@item BZ_MEM_ERROR
Returned when a request to allocate memory failed. Note that the
quantity of memory needed to decompress a stream cannot be determined
until the stream's header has been read. So @code{BZ2_bzDecompress} and
@code{BZ2_bzRead} may return @code{BZ_MEM_ERROR} even though some of
the compressed data has been read. The same is not true for
compression; once @code{BZ2_bzCompressInit} or @code{BZ2_bzWriteOpen} have
successfully completed, @code{BZ_MEM_ERROR} cannot occur.
@item BZ_DATA_ERROR
Returned when a data integrity error is detected during decompression.
Most importantly, this means when stored and computed CRCs for the
data do not match. This value is also returned upon detection of any
other anomaly in the compressed data.
@item BZ_DATA_ERROR_MAGIC
As a special case of @code{BZ_DATA_ERROR}, it is sometimes useful to
know when the compressed stream does not start with the correct
magic bytes (@code{'B' 'Z' 'h'}).
@item BZ_IO_ERROR
Returned by @code{BZ2_bzRead} and @code{BZ2_bzWrite} when there is an error
reading or writing in the compressed file, and by @code{BZ2_bzReadOpen}
and @code{BZ2_bzWriteOpen} for attempts to use a file for which the
error indicator (viz, @code{ferror(f)}) is set.
On receipt of @code{BZ_IO_ERROR}, the caller should consult
@code{errno} and/or @code{perror} to acquire operating-system
specific information about the problem.
@item BZ_UNEXPECTED_EOF
Returned by @code{BZ2_bzRead} when the compressed file finishes
before the logical end of stream is detected.
@item BZ_OUTBUFF_FULL
Returned by @code{BZ2_bzBuffToBuffCompress} and
@code{BZ2_bzBuffToBuffDecompress} to indicate that the output data
will not fit into the output buffer provided.
@end table
@section Low-level interface
@subsection @code{BZ2_bzCompressInit}
@example
typedef
struct @{
char *next_in;
unsigned int avail_in;
unsigned int total_in_lo32;
unsigned int total_in_hi32;
char *next_out;
unsigned int avail_out;
unsigned int total_out_lo32;
unsigned int total_out_hi32;
void *state;
void *(*bzalloc)(void *,int,int);
void (*bzfree)(void *,void *);
void *opaque;
@}
bz_stream;
int BZ2_bzCompressInit ( bz_stream *strm,
int blockSize100k,
int verbosity,
int workFactor );
@end example
Prepares for compression. The @code{bz_stream} structure
holds all data pertaining to the compression activity.
A @code{bz_stream} structure should be allocated and initialised
prior to the call.
The fields of @code{bz_stream}
comprise the entirety of the user-visible data. @code{state}
is a pointer to the private data structures required for compression.
Custom memory allocators are supported, via fields @code{bzalloc},
@code{bzfree},
and @code{opaque}. The value
@code{opaque} is passed to as the first argument to
all calls to @code{bzalloc} and @code{bzfree}, but is
otherwise ignored by the library.
The call @code{bzalloc ( opaque, n, m )} is expected to return a
pointer @code{p} to
@code{n * m} bytes of memory, and @code{bzfree ( opaque, p )}
should free
that memory.
If you don't want to use a custom memory allocator, set @code{bzalloc},
@code{bzfree} and
@code{opaque} to @code{NULL},
and the library will then use the standard @code{malloc}/@code{free}
routines.
Before calling @code{BZ2_bzCompressInit}, fields @code{bzalloc},
@code{bzfree} and @code{opaque} should
be filled appropriately, as just described. Upon return, the internal
state will have been allocated and initialised, and @code{total_in_lo32},
@code{total_in_hi32}, @code{total_out_lo32} and
@code{total_out_hi32} will have been set to zero.
These four fields are used by the library
to inform the caller of the total amount of data passed into and out of
the library, respectively. You should not try to change them.
As of version 1.0, 64-bit counts are maintained, even on 32-bit
platforms, using the @code{_hi32} fields to store the upper 32 bits
of the count. So, for example, the total amount of data in
is @code{(total_in_hi32 << 32) + total_in_lo32}.
Parameter @code{blockSize100k} specifies the block size to be used for
compression. It should be a value between 1 and 9 inclusive, and the
actual block size used is 100000 x this figure. 9 gives the best
compression but takes most memory.
Parameter @code{verbosity} should be set to a number between 0 and 4
inclusive. 0 is silent, and greater numbers give increasingly verbose
monitoring/debugging output. If the library has been compiled with
@code{-DBZ_NO_STDIO}, no such output will appear for any verbosity
setting.
Parameter @code{workFactor} controls how the compression phase behaves
when presented with worst case, highly repetitive, input data. If
compression runs into difficulties caused by repetitive data, the
library switches from the standard sorting algorithm to a fallback
algorithm. The fallback is slower than the standard algorithm by
perhaps a factor of three, but always behaves reasonably, no matter how
bad the input.
Lower values of @code{workFactor} reduce the amount of effort the
standard algorithm will expend before resorting to the fallback. You
should set this parameter carefully; too low, and many inputs will be
handled by the fallback algorithm and so compress rather slowly, too
high, and your average-to-worst case compression times can become very
large. The default value of 30 gives reasonable behaviour over a wide
range of circumstances.
Allowable values range from 0 to 250 inclusive. 0 is a special case,
equivalent to using the default value of 30.
Note that the compressed output generated is the same regardless of
whether or not the fallback algorithm is used.
Be aware also that this parameter may disappear entirely in future
versions of the library. In principle it should be possible to devise a
good way to automatically choose which algorithm to use. Such a
mechanism would render the parameter obsolete.
Possible return values:
@display
@code{BZ_CONFIG_ERROR}
if the library has been mis-compiled
@code{BZ_PARAM_ERROR}
if @code{strm} is @code{NULL}
or @code{blockSize} < 1 or @code{blockSize} > 9
or @code{verbosity} < 0 or @code{verbosity} > 4
or @code{workFactor} < 0 or @code{workFactor} > 250
@code{BZ_MEM_ERROR}
if not enough memory is available
@code{BZ_OK}
otherwise
@end display
Allowable next actions:
@display
@code{BZ2_bzCompress}
if @code{BZ_OK} is returned
no specific action needed in case of error
@end display
@subsection @code{BZ2_bzCompress}
@example
int BZ2_bzCompress ( bz_stream *strm, int action );
@end example
Provides more input and/or output buffer space for the library. The
caller maintains input and output buffers, and calls @code{BZ2_bzCompress} to
transfer data between them.
Before each call to @code{BZ2_bzCompress}, @code{next_in} should point at
the data to be compressed, and @code{avail_in} should indicate how many
bytes the library may read. @code{BZ2_bzCompress} updates @code{next_in},
@code{avail_in} and @code{total_in} to reflect the number of bytes it
has read.
Similarly, @code{next_out} should point to a buffer in which the
compressed data is to be placed, with @code{avail_out} indicating how
much output space is available. @code{BZ2_bzCompress} updates
@code{next_out}, @code{avail_out} and @code{total_out} to reflect the
number of bytes output.
You may provide and remove as little or as much data as you like on each
call of @code{BZ2_bzCompress}. In the limit, it is acceptable to supply and
remove data one byte at a time, although this would be terribly
inefficient. You should always ensure that at least one byte of output
space is available at each call.
A second purpose of @code{BZ2_bzCompress} is to request a change of mode of the
compressed stream.
Conceptually, a compressed stream can be in one of four states: IDLE,
RUNNING, FLUSHING and FINISHING. Before initialisation
(@code{BZ2_bzCompressInit}) and after termination (@code{BZ2_bzCompressEnd}), a
stream is regarded as IDLE.
Upon initialisation (@code{BZ2_bzCompressInit}), the stream is placed in the
RUNNING state. Subsequent calls to @code{BZ2_bzCompress} should pass
@code{BZ_RUN} as the requested action; other actions are illegal and
will result in @code{BZ_SEQUENCE_ERROR}.
At some point, the calling program will have provided all the input data
it wants to. It will then want to finish up -- in effect, asking the
library to process any data it might have buffered internally. In this
state, @code{BZ2_bzCompress} will no longer attempt to read data from
@code{next_in}, but it will want to write data to @code{next_out}.
Because the output buffer supplied by the user can be arbitrarily small,
the finishing-up operation cannot necessarily be done with a single call
of @code{BZ2_bzCompress}.
Instead, the calling program passes @code{BZ_FINISH} as an action to
@code{BZ2_bzCompress}. This changes the stream's state to FINISHING. Any
remaining input (ie, @code{next_in[0 .. avail_in-1]}) is compressed and
transferred to the output buffer. To do this, @code{BZ2_bzCompress} must be
called repeatedly until all the output has been consumed. At that
point, @code{BZ2_bzCompress} returns @code{BZ_STREAM_END}, and the stream's
state is set back to IDLE. @code{BZ2_bzCompressEnd} should then be
called.
Just to make sure the calling program does not cheat, the library makes
a note of @code{avail_in} at the time of the first call to
@code{BZ2_bzCompress} which has @code{BZ_FINISH} as an action (ie, at the
time the program has announced its intention to not supply any more
input). By comparing this value with that of @code{avail_in} over
subsequent calls to @code{BZ2_bzCompress}, the library can detect any
attempts to slip in more data to compress. Any calls for which this is
detected will return @code{BZ_SEQUENCE_ERROR}. This indicates a
programming mistake which should be corrected.
Instead of asking to finish, the calling program may ask
@code{BZ2_bzCompress} to take all the remaining input, compress it and
terminate the current (Burrows-Wheeler) compression block. This could
be useful for error control purposes. The mechanism is analogous to
that for finishing: call @code{BZ2_bzCompress} with an action of
@code{BZ_FLUSH}, remove output data, and persist with the
@code{BZ_FLUSH} action until the value @code{BZ_RUN} is returned. As
with finishing, @code{BZ2_bzCompress} detects any attempt to provide more
input data once the flush has begun.
Once the flush is complete, the stream returns to the normal RUNNING
state.
This all sounds pretty complex, but isn't really. Here's a table
which shows which actions are allowable in each state, what action
will be taken, what the next state is, and what the non-error return
values are. Note that you can't explicitly ask what state the
stream is in, but nor do you need to -- it can be inferred from the
values returned by @code{BZ2_bzCompress}.
@display
IDLE/@code{any}
Illegal. IDLE state only exists after @code{BZ2_bzCompressEnd} or
before @code{BZ2_bzCompressInit}.
Return value = @code{BZ_SEQUENCE_ERROR}
RUNNING/@code{BZ_RUN}
Compress from @code{next_in} to @code{next_out} as much as possible.
Next state = RUNNING
Return value = @code{BZ_RUN_OK}
RUNNING/@code{BZ_FLUSH}
Remember current value of @code{next_in}. Compress from @code{next_in}
to @code{next_out} as much as possible, but do not accept any more input.
Next state = FLUSHING
Return value = @code{BZ_FLUSH_OK}
RUNNING/@code{BZ_FINISH}
Remember current value of @code{next_in}. Compress from @code{next_in}
to @code{next_out} as much as possible, but do not accept any more input.
Next state = FINISHING
Return value = @code{BZ_FINISH_OK}
FLUSHING/@code{BZ_FLUSH}
Compress from @code{next_in} to @code{next_out} as much as possible,
but do not accept any more input.
If all the existing input has been used up and all compressed
output has been removed
Next state = RUNNING; Return value = @code{BZ_RUN_OK}
else
Next state = FLUSHING; Return value = @code{BZ_FLUSH_OK}
FLUSHING/other
Illegal.
Return value = @code{BZ_SEQUENCE_ERROR}
FINISHING/@code{BZ_FINISH}
Compress from @code{next_in} to @code{next_out} as much as possible,
but to not accept any more input.
If all the existing input has been used up and all compressed
output has been removed
Next state = IDLE; Return value = @code{BZ_STREAM_END}
else
Next state = FINISHING; Return value = @code{BZ_FINISHING}
FINISHING/other
Illegal.
Return value = @code{BZ_SEQUENCE_ERROR}
@end display
That still looks complicated? Well, fair enough. The usual sequence
of calls for compressing a load of data is:
@itemize @bullet
@item Get started with @code{BZ2_bzCompressInit}.
@item Shovel data in and shlurp out its compressed form using zero or more
calls of @code{BZ2_bzCompress} with action = @code{BZ_RUN}.
@item Finish up.
Repeatedly call @code{BZ2_bzCompress} with action = @code{BZ_FINISH},
copying out the compressed output, until @code{BZ_STREAM_END} is returned.
@item Close up and go home. Call @code{BZ2_bzCompressEnd}.
@end itemize
If the data you want to compress fits into your input buffer all
at once, you can skip the calls of @code{BZ2_bzCompress ( ..., BZ_RUN )} and
just do the @code{BZ2_bzCompress ( ..., BZ_FINISH )} calls.
All required memory is allocated by @code{BZ2_bzCompressInit}. The
compression library can accept any data at all (obviously). So you
shouldn't get any error return values from the @code{BZ2_bzCompress} calls.
If you do, they will be @code{BZ_SEQUENCE_ERROR}, and indicate a bug in
your programming.
Trivial other possible return values:
@display
@code{BZ_PARAM_ERROR}
if @code{strm} is @code{NULL}, or @code{strm->s} is @code{NULL}
@end display
@subsection @code{BZ2_bzCompressEnd}
@example
int BZ2_bzCompressEnd ( bz_stream *strm );
@end example
Releases all memory associated with a compression stream.
Possible return values:
@display
@code{BZ_PARAM_ERROR} if @code{strm} is @code{NULL} or @code{strm->s} is @code{NULL}
@code{BZ_OK} otherwise
@end display
@subsection @code{BZ2_bzDecompressInit}
@example
int BZ2_bzDecompressInit ( bz_stream *strm, int verbosity, int small );
@end example
Prepares for decompression. As with @code{BZ2_bzCompressInit}, a
@code{bz_stream} record should be allocated and initialised before the
call. Fields @code{bzalloc}, @code{bzfree} and @code{opaque} should be
set if a custom memory allocator is required, or made @code{NULL} for
the normal @code{malloc}/@code{free} routines. Upon return, the internal
state will have been initialised, and @code{total_in} and
@code{total_out} will be zero.
For the meaning of parameter @code{verbosity}, see @code{BZ2_bzCompressInit}.
If @code{small} is nonzero, the library will use an alternative
decompression algorithm which uses less memory but at the cost of
decompressing more slowly (roughly speaking, half the speed, but the
maximum memory requirement drops to around 2300k). See Chapter 2 for
more information on memory management.
Note that the amount of memory needed to decompress
a stream cannot be determined until the stream's header has been read,
so even if @code{BZ2_bzDecompressInit} succeeds, a subsequent
@code{BZ2_bzDecompress} could fail with @code{BZ_MEM_ERROR}.
Possible return values:
@display
@code{BZ_CONFIG_ERROR}
if the library has been mis-compiled
@code{BZ_PARAM_ERROR}
if @code{(small != 0 && small != 1)}
or @code{(verbosity < 0 || verbosity > 4)}
@code{BZ_MEM_ERROR}
if insufficient memory is available
@end display
Allowable next actions:
@display
@code{BZ2_bzDecompress}
if @code{BZ_OK} was returned
no specific action required in case of error
@end display
@subsection @code{BZ2_bzDecompress}
@example
int BZ2_bzDecompress ( bz_stream *strm );
@end example
Provides more input and/out output buffer space for the library. The
caller maintains input and output buffers, and uses @code{BZ2_bzDecompress}
to transfer data between them.
Before each call to @code{BZ2_bzDecompress}, @code{next_in}
should point at the compressed data,
and @code{avail_in} should indicate how many bytes the library
may read. @code{BZ2_bzDecompress} updates @code{next_in}, @code{avail_in}
and @code{total_in}
to reflect the number of bytes it has read.
Similarly, @code{next_out} should point to a buffer in which the uncompressed
output is to be placed, with @code{avail_out} indicating how much output space
is available. @code{BZ2_bzCompress} updates @code{next_out},
@code{avail_out} and @code{total_out} to reflect
the number of bytes output.
You may provide and remove as little or as much data as you like on
each call of @code{BZ2_bzDecompress}.
In the limit, it is acceptable to
supply and remove data one byte at a time, although this would be
terribly inefficient. You should always ensure that at least one
byte of output space is available at each call.
Use of @code{BZ2_bzDecompress} is simpler than @code{BZ2_bzCompress}.
You should provide input and remove output as described above, and
repeatedly call @code{BZ2_bzDecompress} until @code{BZ_STREAM_END} is
returned. Appearance of @code{BZ_STREAM_END} denotes that
@code{BZ2_bzDecompress} has detected the logical end of the compressed
stream. @code{BZ2_bzDecompress} will not produce @code{BZ_STREAM_END} until
all output data has been placed into the output buffer, so once
@code{BZ_STREAM_END} appears, you are guaranteed to have available all
the decompressed output, and @code{BZ2_bzDecompressEnd} can safely be
called.
If case of an error return value, you should call @code{BZ2_bzDecompressEnd}
to clean up and release memory.
Possible return values:
@display
@code{BZ_PARAM_ERROR}
if @code{strm} is @code{NULL} or @code{strm->s} is @code{NULL}
or @code{strm->avail_out < 1}
@code{BZ_DATA_ERROR}
if a data integrity error is detected in the compressed stream
@code{BZ_DATA_ERROR_MAGIC}
if the compressed stream doesn't begin with the right magic bytes
@code{BZ_MEM_ERROR}
if there wasn't enough memory available
@code{BZ_STREAM_END}
if the logical end of the data stream was detected and all
output in has been consumed, eg @code{s->avail_out > 0}
@code{BZ_OK}
otherwise
@end display
Allowable next actions:
@display
@code{BZ2_bzDecompress}
if @code{BZ_OK} was returned
@code{BZ2_bzDecompressEnd}
otherwise
@end display
@subsection @code{BZ2_bzDecompressEnd}
@example
int BZ2_bzDecompressEnd ( bz_stream *strm );
@end example
Releases all memory associated with a decompression stream.
Possible return values:
@display
@code{BZ_PARAM_ERROR}
if @code{strm} is @code{NULL} or @code{strm->s} is @code{NULL}
@code{BZ_OK}
otherwise
@end display
Allowable next actions:
@display
None.
@end display
@section High-level interface
This interface provides functions for reading and writing
@code{bzip2} format files. First, some general points.
@itemize @bullet
@item All of the functions take an @code{int*} first argument,
@code{bzerror}.
After each call, @code{bzerror} should be consulted first to determine
the outcome of the call. If @code{bzerror} is @code{BZ_OK},
the call completed
successfully, and only then should the return value of the function
(if any) be consulted. If @code{bzerror} is @code{BZ_IO_ERROR},
there was an error
reading/writing the underlying compressed file, and you should
then consult @code{errno}/@code{perror} to determine the
cause of the difficulty.
@code{bzerror} may also be set to various other values; precise details are
given on a per-function basis below.
@item If @code{bzerror} indicates an error
(ie, anything except @code{BZ_OK} and @code{BZ_STREAM_END}),
you should immediately call @code{BZ2_bzReadClose} (or @code{BZ2_bzWriteClose},
depending on whether you are attempting to read or to write)
to free up all resources associated
with the stream. Once an error has been indicated, behaviour of all calls
except @code{BZ2_bzReadClose} (@code{BZ2_bzWriteClose}) is undefined.
The implication is that (1) @code{bzerror} should
be checked after each call, and (2) if @code{bzerror} indicates an error,
@code{BZ2_bzReadClose} (@code{BZ2_bzWriteClose}) should then be called to clean up.
@item The @code{FILE*} arguments passed to
@code{BZ2_bzReadOpen}/@code{BZ2_bzWriteOpen}
should be set to binary mode.
Most Unix systems will do this by default, but other platforms,
including Windows and Mac, will not. If you omit this, you may
encounter problems when moving code to new platforms.
@item Memory allocation requests are handled by
@code{malloc}/@code{free}.
At present
there is no facility for user-defined memory allocators in the file I/O
functions (could easily be added, though).
@end itemize
@subsection @code{BZ2_bzReadOpen}
@example
typedef void BZFILE;
BZFILE *BZ2_bzReadOpen ( int *bzerror, FILE *f,
int small, int verbosity,
void *unused, int nUnused );
@end example
Prepare to read compressed data from file handle @code{f}. @code{f}
should refer to a file which has been opened for reading, and for which
the error indicator (@code{ferror(f)})is not set. If @code{small} is 1,
the library will try to decompress using less memory, at the expense of
speed.
For reasons explained below, @code{BZ2_bzRead} will decompress the
@code{nUnused} bytes starting at @code{unused}, before starting to read
from the file @code{f}. At most @code{BZ_MAX_UNUSED} bytes may be
supplied like this. If this facility is not required, you should pass
@code{NULL} and @code{0} for @code{unused} and n@code{Unused}
respectively.
For the meaning of parameters @code{small} and @code{verbosity},
see @code{BZ2_bzDecompressInit}.
The amount of memory needed to decompress a file cannot be determined
until the file's header has been read. So it is possible that
@code{BZ2_bzReadOpen} returns @code{BZ_OK} but a subsequent call of
@code{BZ2_bzRead} will return @code{BZ_MEM_ERROR}.
Possible assignments to @code{bzerror}:
@display
@code{BZ_CONFIG_ERROR}
if the library has been mis-compiled
@code{BZ_PARAM_ERROR}
if @code{f} is @code{NULL}
or @code{small} is neither @code{0} nor @code{1}
or @code{(unused == NULL && nUnused != 0)}
or @code{(unused != NULL && !(0 <= nUnused <= BZ_MAX_UNUSED))}
@code{BZ_IO_ERROR}
if @code{ferror(f)} is nonzero
@code{BZ_MEM_ERROR}
if insufficient memory is available
@code{BZ_OK}
otherwise.
@end display
Possible return values:
@display
Pointer to an abstract @code{BZFILE}
if @code{bzerror} is @code{BZ_OK}
@code{NULL}
otherwise
@end display
Allowable next actions:
@display
@code{BZ2_bzRead}
if @code{bzerror} is @code{BZ_OK}
@code{BZ2_bzClose}
otherwise
@end display
@subsection @code{BZ2_bzRead}
@example
int BZ2_bzRead ( int *bzerror, BZFILE *b, void *buf, int len );
@end example
Reads up to @code{len} (uncompressed) bytes from the compressed file
@code{b} into
the buffer @code{buf}. If the read was successful,
@code{bzerror} is set to @code{BZ_OK}
and the number of bytes read is returned. If the logical end-of-stream
was detected, @code{bzerror} will be set to @code{BZ_STREAM_END},
and the number
of bytes read is returned. All other @code{bzerror} values denote an error.
@code{BZ2_bzRead} will supply @code{len} bytes,
unless the logical stream end is detected
or an error occurs. Because of this, it is possible to detect the
stream end by observing when the number of bytes returned is
less than the number
requested. Nevertheless, this is regarded as inadvisable; you should
instead check @code{bzerror} after every call and watch out for
@code{BZ_STREAM_END}.
Internally, @code{BZ2_bzRead} copies data from the compressed file in chunks
of size @code{BZ_MAX_UNUSED} bytes
before decompressing it. If the file contains more bytes than strictly
needed to reach the logical end-of-stream, @code{BZ2_bzRead} will almost certainly
read some of the trailing data before signalling @code{BZ_SEQUENCE_END}.
To collect the read but unused data once @code{BZ_SEQUENCE_END} has
appeared, call @code{BZ2_bzReadGetUnused} immediately before @code{BZ2_bzReadClose}.
Possible assignments to @code{bzerror}:
@display
@code{BZ_PARAM_ERROR}
if @code{b} is @code{NULL} or @code{buf} is @code{NULL} or @code{len < 0}
@code{BZ_SEQUENCE_ERROR}
if @code{b} was opened with @code{BZ2_bzWriteOpen}
@code{BZ_IO_ERROR}
if there is an error reading from the compressed file
@code{BZ_UNEXPECTED_EOF}
if the compressed file ended before the logical end-of-stream was detected
@code{BZ_DATA_ERROR}
if a data integrity error was detected in the compressed stream
@code{BZ_DATA_ERROR_MAGIC}
if the stream does not begin with the requisite header bytes (ie, is not
a @code{bzip2} data file). This is really a special case of @code{BZ_DATA_ERROR}.
@code{BZ_MEM_ERROR}
if insufficient memory was available
@code{BZ_STREAM_END}
if the logical end of stream was detected.
@code{BZ_OK}
otherwise.
@end display
Possible return values:
@display
number of bytes read
if @code{bzerror} is @code{BZ_OK} or @code{BZ_STREAM_END}
undefined
otherwise
@end display
Allowable next actions:
@display
collect data from @code{buf}, then @code{BZ2_bzRead} or @code{BZ2_bzReadClose}
if @code{bzerror} is @code{BZ_OK}
collect data from @code{buf}, then @code{BZ2_bzReadClose} or @code{BZ2_bzReadGetUnused}
if @code{bzerror} is @code{BZ_SEQUENCE_END}
@code{BZ2_bzReadClose}
otherwise
@end display
@subsection @code{BZ2_bzReadGetUnused}
@example
void BZ2_bzReadGetUnused ( int* bzerror, BZFILE *b,
void** unused, int* nUnused );
@end example
Returns data which was read from the compressed file but was not needed
to get to the logical end-of-stream. @code{*unused} is set to the address
of the data, and @code{*nUnused} to the number of bytes. @code{*nUnused} will
be set to a value between @code{0} and @code{BZ_MAX_UNUSED} inclusive.
This function may only be called once @code{BZ2_bzRead} has signalled
@code{BZ_STREAM_END} but before @code{BZ2_bzReadClose}.
Possible assignments to @code{bzerror}:
@display
@code{BZ_PARAM_ERROR}
if @code{b} is @code{NULL}
or @code{unused} is @code{NULL} or @code{nUnused} is @code{NULL}
@code{BZ_SEQUENCE_ERROR}
if @code{BZ_STREAM_END} has not been signalled
or if @code{b} was opened with @code{BZ2_bzWriteOpen}
@code{BZ_OK}
otherwise
@end display
Allowable next actions:
@display
@code{BZ2_bzReadClose}
@end display
@subsection @code{BZ2_bzReadClose}
@example
void BZ2_bzReadClose ( int *bzerror, BZFILE *b );
@end example
Releases all memory pertaining to the compressed file @code{b}.
@code{BZ2_bzReadClose} does not call @code{fclose} on the underlying file
handle, so you should do that yourself if appropriate.
@code{BZ2_bzReadClose} should be called to clean up after all error
situations.
Possible assignments to @code{bzerror}:
@display
@code{BZ_SEQUENCE_ERROR}
if @code{b} was opened with @code{BZ2_bzOpenWrite}
@code{BZ_OK}
otherwise
@end display
Allowable next actions:
@display
none
@end display
@subsection @code{BZ2_bzWriteOpen}
@example
BZFILE *BZ2_bzWriteOpen ( int *bzerror, FILE *f,
int blockSize100k, int verbosity,
int workFactor );
@end example
Prepare to write compressed data to file handle @code{f}.
@code{f} should refer to
a file which has been opened for writing, and for which the error
indicator (@code{ferror(f)})is not set.
For the meaning of parameters @code{blockSize100k},
@code{verbosity} and @code{workFactor}, see
@* @code{BZ2_bzCompressInit}.
All required memory is allocated at this stage, so if the call
completes successfully, @code{BZ_MEM_ERROR} cannot be signalled by a
subsequent call to @code{BZ2_bzWrite}.
Possible assignments to @code{bzerror}:
@display
@code{BZ_CONFIG_ERROR}
if the library has been mis-compiled
@code{BZ_PARAM_ERROR}
if @code{f} is @code{NULL}
or @code{blockSize100k < 1} or @code{blockSize100k > 9}
@code{BZ_IO_ERROR}
if @code{ferror(f)} is nonzero
@code{BZ_MEM_ERROR}
if insufficient memory is available
@code{BZ_OK}
otherwise
@end display
Possible return values:
@display
Pointer to an abstract @code{BZFILE}
if @code{bzerror} is @code{BZ_OK}
@code{NULL}
otherwise
@end display
Allowable next actions:
@display
@code{BZ2_bzWrite}
if @code{bzerror} is @code{BZ_OK}
(you could go directly to @code{BZ2_bzWriteClose}, but this would be pretty pointless)
@code{BZ2_bzWriteClose}
otherwise
@end display
@subsection @code{BZ2_bzWrite}
@example
void BZ2_bzWrite ( int *bzerror, BZFILE *b, void *buf, int len );
@end example
Absorbs @code{len} bytes from the buffer @code{buf}, eventually to be
compressed and written to the file.
Possible assignments to @code{bzerror}:
@display
@code{BZ_PARAM_ERROR}
if @code{b} is @code{NULL} or @code{buf} is @code{NULL} or @code{len < 0}
@code{BZ_SEQUENCE_ERROR}
if b was opened with @code{BZ2_bzReadOpen}
@code{BZ_IO_ERROR}
if there is an error writing the compressed file.
@code{BZ_OK}
otherwise
@end display
@subsection @code{BZ2_bzWriteClose}
@example
void BZ2_bzWriteClose ( int *bzerror, BZFILE* f,
int abandon,
unsigned int* nbytes_in,
unsigned int* nbytes_out );
void BZ2_bzWriteClose64 ( int *bzerror, BZFILE* f,
int abandon,
unsigned int* nbytes_in_lo32,
unsigned int* nbytes_in_hi32,
unsigned int* nbytes_out_lo32,
unsigned int* nbytes_out_hi32 );
@end example
Compresses and flushes to the compressed file all data so far supplied
by @code{BZ2_bzWrite}. The logical end-of-stream markers are also written, so
subsequent calls to @code{BZ2_bzWrite} are illegal. All memory associated
with the compressed file @code{b} is released.
@code{fflush} is called on the
compressed file, but it is not @code{fclose}'d.
If @code{BZ2_bzWriteClose} is called to clean up after an error, the only
action is to release the memory. The library records the error codes
issued by previous calls, so this situation will be detected
automatically. There is no attempt to complete the compression
operation, nor to @code{fflush} the compressed file. You can force this
behaviour to happen even in the case of no error, by passing a nonzero
value to @code{abandon}.
If @code{nbytes_in} is non-null, @code{*nbytes_in} will be set to be the
total volume of uncompressed data handled. Similarly, @code{nbytes_out}
will be set to the total volume of compressed data written. For
compatibility with older versions of the library, @code{BZ2_bzWriteClose}
only yields the lower 32 bits of these counts. Use
@code{BZ2_bzWriteClose64} if you want the full 64 bit counts. These
two functions are otherwise absolutely identical.
Possible assignments to @code{bzerror}:
@display
@code{BZ_SEQUENCE_ERROR}
if @code{b} was opened with @code{BZ2_bzReadOpen}
@code{BZ_IO_ERROR}
if there is an error writing the compressed file
@code{BZ_OK}
otherwise
@end display
@subsection Handling embedded compressed data streams
The high-level library facilitates use of
@code{bzip2} data streams which form some part of a surrounding, larger
data stream.
@itemize @bullet
@item For writing, the library takes an open file handle, writes
compressed data to it, @code{fflush}es it but does not @code{fclose} it.
The calling application can write its own data before and after the
compressed data stream, using that same file handle.
@item Reading is more complex, and the facilities are not as general
as they could be since generality is hard to reconcile with efficiency.
@code{BZ2_bzRead} reads from the compressed file in blocks of size
@code{BZ_MAX_UNUSED} bytes, and in doing so probably will overshoot
the logical end of compressed stream.
To recover this data once decompression has
ended, call @code{BZ2_bzReadGetUnused} after the last call of @code{BZ2_bzRead}
(the one returning @code{BZ_STREAM_END}) but before calling
@code{BZ2_bzReadClose}.
@end itemize
This mechanism makes it easy to decompress multiple @code{bzip2}
streams placed end-to-end. As the end of one stream, when @code{BZ2_bzRead}
returns @code{BZ_STREAM_END}, call @code{BZ2_bzReadGetUnused} to collect the
unused data (copy it into your own buffer somewhere).
That data forms the start of the next compressed stream.
To start uncompressing that next stream, call @code{BZ2_bzReadOpen} again,
feeding in the unused data via the @code{unused}/@code{nUnused}
parameters.
Keep doing this until @code{BZ_STREAM_END} return coincides with the
physical end of file (@code{feof(f)}). In this situation
@code{BZ2_bzReadGetUnused}
will of course return no data.
This should give some feel for how the high-level interface can be used.
If you require extra flexibility, you'll have to bite the bullet and get
to grips with the low-level interface.
@subsection Standard file-reading/writing code
Here's how you'd write data to a compressed file:
@example @code
FILE* f;
BZFILE* b;
int nBuf;
char buf[ /* whatever size you like */ ];
int bzerror;
int nWritten;
f = fopen ( "myfile.bz2", "w" );
if (!f) @{
/* handle error */
@}
b = BZ2_bzWriteOpen ( &bzerror, f, 9 );
if (bzerror != BZ_OK) @{
BZ2_bzWriteClose ( b );
/* handle error */
@}
while ( /* condition */ ) @{
/* get data to write into buf, and set nBuf appropriately */
nWritten = BZ2_bzWrite ( &bzerror, b, buf, nBuf );
if (bzerror == BZ_IO_ERROR) @{
BZ2_bzWriteClose ( &bzerror, b );
/* handle error */
@}
@}
BZ2_bzWriteClose ( &bzerror, b );
if (bzerror == BZ_IO_ERROR) @{
/* handle error */
@}
@end example
And to read from a compressed file:
@example
FILE* f;
BZFILE* b;
int nBuf;
char buf[ /* whatever size you like */ ];
int bzerror;
int nWritten;
f = fopen ( "myfile.bz2", "r" );
if (!f) @{
/* handle error */
@}
b = BZ2_bzReadOpen ( &bzerror, f, 0, NULL, 0 );
if (bzerror != BZ_OK) @{
BZ2_bzReadClose ( &bzerror, b );
/* handle error */
@}
bzerror = BZ_OK;
while (bzerror == BZ_OK && /* arbitrary other conditions */) @{
nBuf = BZ2_bzRead ( &bzerror, b, buf, /* size of buf */ );
if (bzerror == BZ_OK) @{
/* do something with buf[0 .. nBuf-1] */
@}
@}
if (bzerror != BZ_STREAM_END) @{
BZ2_bzReadClose ( &bzerror, b );
/* handle error */
@} else @{
BZ2_bzReadClose ( &bzerror );
@}
@end example
@section Utility functions
@subsection @code{BZ2_bzBuffToBuffCompress}
@example
int BZ2_bzBuffToBuffCompress( char* dest,
unsigned int* destLen,
char* source,
unsigned int sourceLen,
int blockSize100k,
int verbosity,
int workFactor );
@end example
Attempts to compress the data in @code{source[0 .. sourceLen-1]}
into the destination buffer, @code{dest[0 .. *destLen-1]}.
If the destination buffer is big enough, @code{*destLen} is
set to the size of the compressed data, and @code{BZ_OK} is
returned. If the compressed data won't fit, @code{*destLen}
is unchanged, and @code{BZ_OUTBUFF_FULL} is returned.
Compression in this manner is a one-shot event, done with a single call
to this function. The resulting compressed data is a complete
@code{bzip2} format data stream. There is no mechanism for making
additional calls to provide extra input data. If you want that kind of
mechanism, use the low-level interface.
For the meaning of parameters @code{blockSize100k}, @code{verbosity}
and @code{workFactor}, @* see @code{BZ2_bzCompressInit}.
To guarantee that the compressed data will fit in its buffer, allocate
an output buffer of size 1% larger than the uncompressed data, plus
six hundred extra bytes.
@code{BZ2_bzBuffToBuffDecompress} will not write data at or
beyond @code{dest[*destLen]}, even in case of buffer overflow.
Possible return values:
@display
@code{BZ_CONFIG_ERROR}
if the library has been mis-compiled
@code{BZ_PARAM_ERROR}
if @code{dest} is @code{NULL} or @code{destLen} is @code{NULL}
or @code{blockSize100k < 1} or @code{blockSize100k > 9}
or @code{verbosity < 0} or @code{verbosity > 4}
or @code{workFactor < 0} or @code{workFactor > 250}
@code{BZ_MEM_ERROR}
if insufficient memory is available
@code{BZ_OUTBUFF_FULL}
if the size of the compressed data exceeds @code{*destLen}
@code{BZ_OK}
otherwise
@end display
@subsection @code{BZ2_bzBuffToBuffDecompress}
@example
int BZ2_bzBuffToBuffDecompress ( char* dest,
unsigned int* destLen,
char* source,
unsigned int sourceLen,
int small,
int verbosity );
@end example
Attempts to decompress the data in @code{source[0 .. sourceLen-1]}
into the destination buffer, @code{dest[0 .. *destLen-1]}.
If the destination buffer is big enough, @code{*destLen} is
set to the size of the uncompressed data, and @code{BZ_OK} is
returned. If the compressed data won't fit, @code{*destLen}
is unchanged, and @code{BZ_OUTBUFF_FULL} is returned.
@code{source} is assumed to hold a complete @code{bzip2} format
data stream. @* @code{BZ2_bzBuffToBuffDecompress} tries to decompress
the entirety of the stream into the output buffer.
For the meaning of parameters @code{small} and @code{verbosity},
see @code{BZ2_bzDecompressInit}.
Because the compression ratio of the compressed data cannot be known in
advance, there is no easy way to guarantee that the output buffer will
be big enough. You may of course make arrangements in your code to
record the size of the uncompressed data, but such a mechanism is beyond
the scope of this library.
@code{BZ2_bzBuffToBuffDecompress} will not write data at or
beyond @code{dest[*destLen]}, even in case of buffer overflow.
Possible return values:
@display
@code{BZ_CONFIG_ERROR}
if the library has been mis-compiled
@code{BZ_PARAM_ERROR}
if @code{dest} is @code{NULL} or @code{destLen} is @code{NULL}
or @code{small != 0 && small != 1}
or @code{verbosity < 0} or @code{verbosity > 4}
@code{BZ_MEM_ERROR}
if insufficient memory is available
@code{BZ_OUTBUFF_FULL}
if the size of the compressed data exceeds @code{*destLen}
@code{BZ_DATA_ERROR}
if a data integrity error was detected in the compressed data
@code{BZ_DATA_ERROR_MAGIC}
if the compressed data doesn't begin with the right magic bytes
@code{BZ_UNEXPECTED_EOF}
if the compressed data ends unexpectedly
@code{BZ_OK}
otherwise
@end display
@section @code{zlib} compatibility functions
Yoshioka Tsuneo has contributed some functions to
give better @code{zlib} compatibility. These functions are
@code{BZ2_bzopen}, @code{BZ2_bzread}, @code{BZ2_bzwrite}, @code{BZ2_bzflush},
@code{BZ2_bzclose},
@code{BZ2_bzerror} and @code{BZ2_bzlibVersion}.
These functions are not (yet) officially part of
the library. If they break, you get to keep all the pieces.
Nevertheless, I think they work ok.
@example
typedef void BZFILE;
const char * BZ2_bzlibVersion ( void );
@end example
Returns a string indicating the library version.
@example
BZFILE * BZ2_bzopen ( const char *path, const char *mode );
BZFILE * BZ2_bzdopen ( int fd, const char *mode );
@end example
Opens a @code{.bz2} file for reading or writing, using either its name
or a pre-existing file descriptor.
Analogous to @code{fopen} and @code{fdopen}.
@example
int BZ2_bzread ( BZFILE* b, void* buf, int len );
int BZ2_bzwrite ( BZFILE* b, void* buf, int len );
@end example
Reads/writes data from/to a previously opened @code{BZFILE}.
Analogous to @code{fread} and @code{fwrite}.
@example
int BZ2_bzflush ( BZFILE* b );
void BZ2_bzclose ( BZFILE* b );
@end example
Flushes/closes a @code{BZFILE}. @code{BZ2_bzflush} doesn't actually do
anything. Analogous to @code{fflush} and @code{fclose}.
@example
const char * BZ2_bzerror ( BZFILE *b, int *errnum )
@end example
Returns a string describing the more recent error status of
@code{b}, and also sets @code{*errnum} to its numerical value.
@section Using the library in a @code{stdio}-free environment
@subsection Getting rid of @code{stdio}
In a deeply embedded application, you might want to use just
the memory-to-memory functions. You can do this conveniently
by compiling the library with preprocessor symbol @code{BZ_NO_STDIO}
defined. Doing this gives you a library containing only the following
eight functions:
@code{BZ2_bzCompressInit}, @code{BZ2_bzCompress}, @code{BZ2_bzCompressEnd} @*
@code{BZ2_bzDecompressInit}, @code{BZ2_bzDecompress}, @code{BZ2_bzDecompressEnd} @*
@code{BZ2_bzBuffToBuffCompress}, @code{BZ2_bzBuffToBuffDecompress}
When compiled like this, all functions will ignore @code{verbosity}
settings.
@subsection Critical error handling
@code{libbzip2} contains a number of internal assertion checks which
should, needless to say, never be activated. Nevertheless, if an
assertion should fail, behaviour depends on whether or not the library
was compiled with @code{BZ_NO_STDIO} set.
For a normal compile, an assertion failure yields the message
@example
bzip2/libbzip2: internal error number N.
This is a bug in bzip2/libbzip2, 1.0.2, 30-Dec-2001.
Please report it to me at: jseward@@acm.org. If this happened
when you were using some program which uses libbzip2 as a
component, you should also report this bug to the author(s)
of that program. Please make an effort to report this bug;
timely and accurate bug reports eventually lead to higher
quality software. Thanks. Julian Seward, 30 December 2001.
@end example
where @code{N} is some error code number. If @code{N == 1007}, it also
prints some extra text advising the reader that unreliable memory is
often associated with internal error 1007. (This is a
frequently-observed-phenomenon with versions 1.0.0/1.0.1).
@code{exit(3)} is then called.
For a @code{stdio}-free library, assertion failures result
in a call to a function declared as:
@example
extern void bz_internal_error ( int errcode );
@end example
The relevant code is passed as a parameter. You should supply
such a function.
In either case, once an assertion failure has occurred, any
@code{bz_stream} records involved can be regarded as invalid.
You should not attempt to resume normal operation with them.
You may, of course, change critical error handling to suit
your needs. As I said above, critical errors indicate bugs
in the library and should not occur. All "normal" error
situations are indicated via error return codes from functions,
and can be recovered from.
@section Making a Windows DLL
Everything related to Windows has been contributed by Yoshioka Tsuneo
@* (@code{QWF00133@@niftyserve.or.jp} /
@code{tsuneo-y@@is.aist-nara.ac.jp}), so you should send your queries to
him (but perhaps Cc: me, @code{jseward@@acm.org}).
My vague understanding of what to do is: using Visual C++ 5.0,
open the project file @code{libbz2.dsp}, and build. That's all.
If you can't
open the project file for some reason, make a new one, naming these files:
@code{blocksort.c}, @code{bzlib.c}, @code{compress.c},
@code{crctable.c}, @code{decompress.c}, @code{huffman.c}, @*
@code{randtable.c} and @code{libbz2.def}. You will also need
to name the header files @code{bzlib.h} and @code{bzlib_private.h}.
If you don't use VC++, you may need to define the proprocessor symbol
@code{_WIN32}.
Finally, @code{dlltest.c} is a sample program using the DLL. It has a
project file, @code{dlltest.dsp}.
If you just want a makefile for Visual C, have a look at
@code{makefile.msc}.
Be aware that if you compile @code{bzip2} itself on Win32, you must set
@code{BZ_UNIX} to 0 and @code{BZ_LCCWIN32} to 1, in the file
@code{bzip2.c}, before compiling. Otherwise the resulting binary won't
work correctly.
I haven't tried any of this stuff myself, but it all looks plausible.
@chapter Miscellanea
These are just some random thoughts of mine. Your mileage may
vary.
@section Limitations of the compressed file format
@code{bzip2-1.0}, @code{0.9.5} and @code{0.9.0}
use exactly the same file format as the previous
version, @code{bzip2-0.1}. This decision was made in the interests of
stability. Creating yet another incompatible compressed file format
would create further confusion and disruption for users.
Nevertheless, this is not a painless decision. Development
work since the release of @code{bzip2-0.1} in August 1997
has shown complexities in the file format which slow down
decompression and, in retrospect, are unnecessary. These are:
@itemize @bullet
@item The run-length encoder, which is the first of the
compression transformations, is entirely irrelevant.
The original purpose was to protect the sorting algorithm
from the very worst case input: a string of repeated
symbols. But algorithm steps Q6a and Q6b in the original
Burrows-Wheeler technical report (SRC-124) show how
repeats can be handled without difficulty in block
sorting.
@item The randomisation mechanism doesn't really need to be
there. Udi Manber and Gene Myers published a suffix
array construction algorithm a few years back, which
can be employed to sort any block, no matter how
repetitive, in O(N log N) time. Subsequent work by
Kunihiko Sadakane has produced a derivative O(N (log N)^2)
algorithm which usually outperforms the Manber-Myers
algorithm.
I could have changed to Sadakane's algorithm, but I find
it to be slower than @code{bzip2}'s existing algorithm for
most inputs, and the randomisation mechanism protects
adequately against bad cases. I didn't think it was
a good tradeoff to make. Partly this is due to the fact
that I was not flooded with email complaints about
@code{bzip2-0.1}'s performance on repetitive data, so
perhaps it isn't a problem for real inputs.
Probably the best long-term solution,
and the one I have incorporated into 0.9.5 and above,
is to use the existing sorting
algorithm initially, and fall back to a O(N (log N)^2)
algorithm if the standard algorithm gets into difficulties.
@item The compressed file format was never designed to be
handled by a library, and I have had to jump though
some hoops to produce an efficient implementation of
decompression. It's a bit hairy. Try passing
@code{decompress.c} through the C preprocessor
and you'll see what I mean. Much of this complexity
could have been avoided if the compressed size of
each block of data was recorded in the data stream.
@item An Adler-32 checksum, rather than a CRC32 checksum,
would be faster to compute.
@end itemize
It would be fair to say that the @code{bzip2} format was frozen
before I properly and fully understood the performance
consequences of doing so.
Improvements which I was able to incorporate into
0.9.0, despite using the same file format, are:
@itemize @bullet
@item Single array implementation of the inverse BWT. This
significantly speeds up decompression, presumably
because it reduces the number of cache misses.
@item Faster inverse MTF transform for large MTF values. The
new implementation is based on the notion of sliding blocks
of values.
@item @code{bzip2-0.9.0} now reads and writes files with @code{fread}
and @code{fwrite}; version 0.1 used @code{putc} and @code{getc}.
Duh! Well, you live and learn.
@end itemize
Further ahead, it would be nice
to be able to do random access into files. This will
require some careful design of compressed file formats.
@section Portability issues
After some consideration, I have decided not to use
GNU @code{autoconf} to configure 0.9.5 or 1.0.
@code{autoconf}, admirable and wonderful though it is,
mainly assists with portability problems between Unix-like
platforms. But @code{bzip2} doesn't have much in the way
of portability problems on Unix; most of the difficulties appear
when porting to the Mac, or to Microsoft's operating systems.
@code{autoconf} doesn't help in those cases, and brings in a
whole load of new complexity.
Most people should be able to compile the library and program
under Unix straight out-of-the-box, so to speak, especially
if you have a version of GNU C available.
There are a couple of @code{__inline__} directives in the code. GNU C
(@code{gcc}) should be able to handle them. If you're not using
GNU C, your C compiler shouldn't see them at all.
If your compiler does, for some reason, see them and doesn't
like them, just @code{#define} @code{__inline__} to be @code{/* */}. One
easy way to do this is to compile with the flag @code{-D__inline__=},
which should be understood by most Unix compilers.
If you still have difficulties, try compiling with the macro
@code{BZ_STRICT_ANSI} defined. This should enable you to build the
library in a strictly ANSI compliant environment. Building the program
itself like this is dangerous and not supported, since you remove
@code{bzip2}'s checks against compressing directories, symbolic links,
devices, and other not-really-a-file entities. This could cause
filesystem corruption!
One other thing: if you create a @code{bzip2} binary for public
distribution, please try and link it statically (@code{gcc -s}). This
avoids all sorts of library-version issues that others may encounter
later on.
If you build @code{bzip2} on Win32, you must set @code{BZ_UNIX} to 0 and
@code{BZ_LCCWIN32} to 1, in the file @code{bzip2.c}, before compiling.
Otherwise the resulting binary won't work correctly.
@section Reporting bugs
I tried pretty hard to make sure @code{bzip2} is
bug free, both by design and by testing. Hopefully
you'll never need to read this section for real.
Nevertheless, if @code{bzip2} dies with a segmentation
fault, a bus error or an internal assertion failure, it
will ask you to email me a bug report. Experience with
version 0.1 shows that almost all these problems can
be traced to either compiler bugs or hardware problems.
@itemize @bullet
@item
Recompile the program with no optimisation, and see if it
works. And/or try a different compiler.
I heard all sorts of stories about various flavours
of GNU C (and other compilers) generating bad code for
@code{bzip2}, and I've run across two such examples myself.
2.7.X versions of GNU C are known to generate bad code from
time to time, at high optimisation levels.
If you get problems, try using the flags
@code{-O2} @code{-fomit-frame-pointer} @code{-fno-strength-reduce}.
You should specifically @emph{not} use @code{-funroll-loops}.
You may notice that the Makefile runs six tests as part of
the build process. If the program passes all of these, it's
a pretty good (but not 100%) indication that the compiler has
done its job correctly.
@item
If @code{bzip2} crashes randomly, and the crashes are not
repeatable, you may have a flaky memory subsystem. @code{bzip2}
really hammers your memory hierarchy, and if it's a bit marginal,
you may get these problems. Ditto if your disk or I/O subsystem
is slowly failing. Yup, this really does happen.
Try using a different machine of the same type, and see if
you can repeat the problem.
@item This isn't really a bug, but ... If @code{bzip2} tells
you your file is corrupted on decompression, and you
obtained the file via FTP, there is a possibility that you
forgot to tell FTP to do a binary mode transfer. That absolutely
will cause the file to be non-decompressible. You'll have to transfer
it again.
@end itemize
If you've incorporated @code{libbzip2} into your own program
and are getting problems, please, please, please, check that the
parameters you are passing in calls to the library, are
correct, and in accordance with what the documentation says
is allowable. I have tried to make the library robust against
such problems, but I'm sure I haven't succeeded.
Finally, if the above comments don't help, you'll have to send
me a bug report. Now, it's just amazing how many people will
send me a bug report saying something like
@display
bzip2 crashed with segmentation fault on my machine
@end display
and absolutely nothing else. Needless to say, a such a report
is @emph{totally, utterly, completely and comprehensively 100% useless;
a waste of your time, my time, and net bandwidth}.
With no details at all, there's no way I can possibly begin
to figure out what the problem is.
The rules of the game are: facts, facts, facts. Don't omit
them because "oh, they won't be relevant". At the bare
minimum:
@display
Machine type. Operating system version.
Exact version of @code{bzip2} (do @code{bzip2 -V}).
Exact version of the compiler used.
Flags passed to the compiler.
@end display
However, the most important single thing that will help me is
the file that you were trying to compress or decompress at the
time the problem happened. Without that, my ability to do anything
more than speculate about the cause, is limited.
Please remember that I connect to the Internet with a modem, so
you should contact me before mailing me huge files.
@section Did you get the right package?
@code{bzip2} is a resource hog. It soaks up large amounts of CPU cycles
and memory. Also, it gives very large latencies. In the worst case, you
can feed many megabytes of uncompressed data into the library before
getting any compressed output, so this probably rules out applications
requiring interactive behaviour.
These aren't faults of my implementation, I hope, but more
an intrinsic property of the Burrows-Wheeler transform (unfortunately).
Maybe this isn't what you want.
If you want a compressor and/or library which is faster, uses less
memory but gets pretty good compression, and has minimal latency,
consider Jean-loup
Gailly's and Mark Adler's work, @code{zlib-1.1.3} and
@code{gzip-1.2.4}. Look for them at
@code{http://www.zlib.org} and
@code{http://www.gzip.org} respectively.
For something faster and lighter still, you might try Markus F X J
Oberhumer's @code{LZO} real-time compression/decompression library, at
@* @code{http://wildsau.idv.uni-linz.ac.at/mfx/lzo.html}.
If you want to use the @code{bzip2} algorithms to compress small blocks
of data, 64k bytes or smaller, for example on an on-the-fly disk
compressor, you'd be well advised not to use this library. Instead,
I've made a special library tuned for that kind of use. It's part of
@code{e2compr-0.40}, an on-the-fly disk compressor for the Linux
@code{ext2} filesystem. Look at
@code{http://www.netspace.net.au/~reiter/e2compr}.
@section Testing
A record of the tests I've done.
First, some data sets:
@itemize @bullet
@item B: a directory containing 6001 files, one for every length in the
range 0 to 6000 bytes. The files contain random lowercase
letters. 18.7 megabytes.
@item H: my home directory tree. Documents, source code, mail files,
compressed data. H contains B, and also a directory of
files designed as boundary cases for the sorting; mostly very
repetitive, nasty files. 565 megabytes.
@item A: directory tree holding various applications built from source:
@code{egcs}, @code{gcc-2.8.1}, KDE, GTK, Octave, etc.
2200 megabytes.
@end itemize
The tests conducted are as follows. Each test means compressing
(a copy of) each file in the data set, decompressing it and
comparing it against the original.
First, a bunch of tests with block sizes and internal buffer
sizes set very small,
to detect any problems with the
blocking and buffering mechanisms.
This required modifying the source code so as to try to
break it.
@enumerate
@item Data set H, with
buffer size of 1 byte, and block size of 23 bytes.
@item Data set B, buffer sizes 1 byte, block size 1 byte.
@item As (2) but small-mode decompression.
@item As (2) with block size 2 bytes.
@item As (2) with block size 3 bytes.
@item As (2) with block size 4 bytes.
@item As (2) with block size 5 bytes.
@item As (2) with block size 6 bytes and small-mode decompression.
@item H with buffer size of 1 byte, but normal block
size (up to 900000 bytes).
@end enumerate
Then some tests with unmodified source code.
@enumerate
@item H, all settings normal.
@item As (1), with small-mode decompress.
@item H, compress with flag @code{-1}.
@item H, compress with flag @code{-s}, decompress with flag @code{-s}.
@item Forwards compatibility: H, @code{bzip2-0.1pl2} compressing,
@code{bzip2-0.9.5} decompressing, all settings normal.
@item Backwards compatibility: H, @code{bzip2-0.9.5} compressing,
@code{bzip2-0.1pl2} decompressing, all settings normal.
@item Bigger tests: A, all settings normal.
@item As (7), using the fallback (Sadakane-like) sorting algorithm.
@item As (8), compress with flag @code{-1}, decompress with flag
@code{-s}.
@item H, using the fallback sorting algorithm.
@item Forwards compatibility: A, @code{bzip2-0.1pl2} compressing,
@code{bzip2-0.9.5} decompressing, all settings normal.
@item Backwards compatibility: A, @code{bzip2-0.9.5} compressing,
@code{bzip2-0.1pl2} decompressing, all settings normal.
@item Misc test: about 400 megabytes of @code{.tar} files with
@code{bzip2} compiled with Checker (a memory access error
detector, like Purify).
@item Misc tests to make sure it builds and runs ok on non-Linux/x86
platforms.
@end enumerate
These tests were conducted on a 225 MHz IDT WinChip machine, running
Linux 2.0.36. They represent nearly a week of continuous computation.
All tests completed successfully.
@section Further reading
@code{bzip2} is not research work, in the sense that it doesn't present
any new ideas. Rather, it's an engineering exercise based on existing
ideas.
Four documents describe essentially all the ideas behind @code{bzip2}:
@example
Michael Burrows and D. J. Wheeler:
"A block-sorting lossless data compression algorithm"
10th May 1994.
Digital SRC Research Report 124.
ftp://ftp.digital.com/pub/DEC/SRC/research-reports/SRC-124.ps.gz
If you have trouble finding it, try searching at the
New Zealand Digital Library, http://www.nzdl.org.
Daniel S. Hirschberg and Debra A. LeLewer
"Efficient Decoding of Prefix Codes"
Communications of the ACM, April 1990, Vol 33, Number 4.
You might be able to get an electronic copy of this
from the ACM Digital Library.
David J. Wheeler
Program bred3.c and accompanying document bred3.ps.
This contains the idea behind the multi-table Huffman
coding scheme.
ftp://ftp.cl.cam.ac.uk/users/djw3/
Jon L. Bentley and Robert Sedgewick
"Fast Algorithms for Sorting and Searching Strings"
Available from Sedgewick's web page,
www.cs.princeton.edu/~rs
@end example
The following paper gives valuable additional insights into the
algorithm, but is not immediately the basis of any code
used in bzip2.
@example
Peter Fenwick:
Block Sorting Text Compression
Proceedings of the 19th Australasian Computer Science Conference,
Melbourne, Australia. Jan 31 - Feb 2, 1996.
ftp://ftp.cs.auckland.ac.nz/pub/peter-f/ACSC96paper.ps
@end example
Kunihiko Sadakane's sorting algorithm, mentioned above,
is available from:
@example
http://naomi.is.s.u-tokyo.ac.jp/~sada/papers/Sada98b.ps.gz
@end example
The Manber-Myers suffix array construction
algorithm is described in a paper
available from:
@example
http://www.cs.arizona.edu/people/gene/PAPERS/suffix.ps
@end example
Finally, the following paper documents some recent investigations
I made into the performance of sorting algorithms:
@example
Julian Seward:
On the Performance of BWT Sorting Algorithms
Proceedings of the IEEE Data Compression Conference 2000
Snowbird, Utah. 28-30 March 2000.
@end example
@contents
@bye
|
Added work/src/bzip2-1.0.2/manual_1.html.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
<HTML>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- Created on January, 5 2002 by texi2html 1.64 -->
<!--
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
Karl Berry <karl@freefriends.org>
Olaf Bachmann <obachman@mathematik.uni-kl.de>
and many others.
Maintained by: Olaf Bachmann <obachman@mathematik.uni-kl.de>
Send bugs and suggestions to <texi2html@mathematik.uni-kl.de>
-->
<HEAD>
<TITLE>Untitled Document: 1. Introduction</TITLE>
<META NAME="description" CONTENT="Untitled Document: 1. Introduction">
<META NAME="keywords" CONTENT="Untitled Document: 1. Introduction">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META NAME="Generator" CONTENT="texi2html 1.64">
</HEAD>
<BODY LANG="" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">
<A NAME="SEC1"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_2.html#SEC2"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H1> 1. Introduction </H1>
<!--docid::SEC1::-->
<P>
<CODE>bzip2</CODE> compresses files using the Burrows-Wheeler
block-sorting text compression algorithm, and Huffman coding.
Compression is generally considerably better than that
achieved by more conventional LZ77/LZ78-based compressors,
and approaches the performance of the PPM family of statistical compressors.
</P><P>
<CODE>bzip2</CODE> is built on top of <CODE>libbzip2</CODE>, a flexible library
for handling compressed data in the <CODE>bzip2</CODE> format. This manual
describes both how to use the program and
how to work with the library interface. Most of the
manual is devoted to this library, not the program,
which is good news if your interest is only in the program.
</P><P>
Chapter 2 describes how to use <CODE>bzip2</CODE>; this is the only part
you need to read if you just want to know how to operate the program.
Chapter 3 describes the programming interfaces in detail, and
Chapter 4 records some miscellaneous notes which I thought
ought to be recorded somewhere.
</P><P>
<HR SIZE="6">
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<BR>
<FONT SIZE="-1">
This document was generated
by <I>Julian Seward</I> on <I>January, 5 2002</I>
using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
"><I>texi2html</I></A>
</BODY>
</HTML>
|
Added work/src/bzip2-1.0.2/manual_2.html.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
|
<HTML>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- Created on January, 5 2002 by texi2html 1.64 -->
<!--
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
Karl Berry <karl@freefriends.org>
Olaf Bachmann <obachman@mathematik.uni-kl.de>
and many others.
Maintained by: Olaf Bachmann <obachman@mathematik.uni-kl.de>
Send bugs and suggestions to <texi2html@mathematik.uni-kl.de>
-->
<HEAD>
<TITLE>Untitled Document: 2. How to use <CODE>bzip2</CODE></TITLE>
<META NAME="description" CONTENT="Untitled Document: 2. How to use <CODE>bzip2</CODE>">
<META NAME="keywords" CONTENT="Untitled Document: 2. How to use <CODE>bzip2</CODE>">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META NAME="Generator" CONTENT="texi2html 1.64">
</HEAD>
<BODY LANG="" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">
<A NAME="SEC2"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_1.html#SEC1"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_2.html#SEC3"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H1> 2. How to use <CODE>bzip2</CODE> </H1>
<!--docid::SEC2::-->
<P>
This chapter contains a copy of the <CODE>bzip2</CODE> man page,
and nothing else.
</P><P>
<BLOCKQUOTE>
<P>
<HR SIZE="6">
<A NAME="SEC3"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_2.html#SEC2"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_2.html#SEC4"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H4> NAME </H4>
<!--docid::SEC3::-->
<UL>
<LI><CODE>bzip2</CODE>, <CODE>bunzip2</CODE>
- a block-sorting file compressor, v1.0.2
<LI><CODE>bzcat</CODE>
- decompresses files to stdout
<LI><CODE>bzip2recover</CODE>
- recovers data from damaged bzip2 files
</UL>
<P>
<HR SIZE="6">
<A NAME="SEC4"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_2.html#SEC3"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_2.html#SEC5"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H4> SYNOPSIS </H4>
<!--docid::SEC4::-->
<UL>
<LI><CODE>bzip2</CODE> [ -cdfkqstvzVL123456789 ] [ filenames ... ]
<LI><CODE>bunzip2</CODE> [ -fkvsVL ] [ filenames ... ]
<LI><CODE>bzcat</CODE> [ -s ] [ filenames ... ]
<LI><CODE>bzip2recover</CODE> filename
</UL>
<P>
<HR SIZE="6">
<A NAME="SEC5"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_2.html#SEC4"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_2.html#SEC6"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H4> DESCRIPTION </H4>
<!--docid::SEC5::-->
<P>
<CODE>bzip2</CODE> compresses files using the Burrows-Wheeler block sorting
text compression algorithm, and Huffman coding. Compression is
generally considerably better than that achieved by more conventional
LZ77/LZ78-based compressors, and approaches the performance of the PPM
family of statistical compressors.
</P><P>
The command-line options are deliberately very similar to those of GNU
<CODE>gzip</CODE>, but they are not identical.
</P><P>
<CODE>bzip2</CODE> expects a list of file names to accompany the command-line
flags. Each file is replaced by a compressed version of itself, with
the name <CODE>original_name.bz2</CODE>. Each compressed file has the same
modification date, permissions, and, when possible, ownership as the
corresponding original, so that these properties can be correctly
restored at decompression time. File name handling is naive in the
sense that there is no mechanism for preserving original file names,
permissions, ownerships or dates in filesystems which lack these
concepts, or have serious file name length restrictions, such as MS-DOS.
</P><P>
<CODE>bzip2</CODE> and <CODE>bunzip2</CODE> will by default not overwrite existing
files. If you want this to happen, specify the <CODE>-f</CODE> flag.
</P><P>
If no file names are specified, <CODE>bzip2</CODE> compresses from standard
input to standard output. In this case, <CODE>bzip2</CODE> will decline to
write compressed output to a terminal, as this would be entirely
incomprehensible and therefore pointless.
</P><P>
<CODE>bunzip2</CODE> (or <CODE>bzip2 -d</CODE>) decompresses all
specified files. Files which were not created by <CODE>bzip2</CODE>
will be detected and ignored, and a warning issued.
<CODE>bzip2</CODE> attempts to guess the filename for the decompressed file
from that of the compressed file as follows:
<UL>
<LI><CODE>filename.bz2 </CODE> becomes <CODE>filename</CODE>
<LI><CODE>filename.bz </CODE> becomes <CODE>filename</CODE>
<LI><CODE>filename.tbz2</CODE> becomes <CODE>filename.tar</CODE>
<LI><CODE>filename.tbz </CODE> becomes <CODE>filename.tar</CODE>
<LI><CODE>anyothername </CODE> becomes <CODE>anyothername.out</CODE>
</UL>
If the file does not end in one of the recognised endings,
<CODE>.bz2</CODE>, <CODE>.bz</CODE>,
<CODE>.tbz2</CODE> or <CODE>.tbz</CODE>, <CODE>bzip2</CODE> complains that it cannot
guess the name of the original file, and uses the original name
with <CODE>.out</CODE> appended.
<P>
As with compression, supplying no
filenames causes decompression from standard input to standard output.
</P><P>
<CODE>bunzip2</CODE> will correctly decompress a file which is the
concatenation of two or more compressed files. The result is the
concatenation of the corresponding uncompressed files. Integrity
testing (<CODE>-t</CODE>) of concatenated compressed files is also supported.
</P><P>
You can also compress or decompress files to the standard output by
giving the <CODE>-c</CODE> flag. Multiple files may be compressed and
decompressed like this. The resulting outputs are fed sequentially to
stdout. Compression of multiple files in this manner generates a stream
containing multiple compressed file representations. Such a stream
can be decompressed correctly only by <CODE>bzip2</CODE> version 0.9.0 or
later. Earlier versions of <CODE>bzip2</CODE> will stop after decompressing
the first file in the stream.
</P><P>
<CODE>bzcat</CODE> (or <CODE>bzip2 -dc</CODE>) decompresses all specified files to
the standard output.
</P><P>
<CODE>bzip2</CODE> will read arguments from the environment variables
<CODE>BZIP2</CODE> and <CODE>BZIP</CODE>, in that order, and will process them
before any arguments read from the command line. This gives a
convenient way to supply default arguments.
</P><P>
Compression is always performed, even if the compressed file is slightly
larger than the original. Files of less than about one hundred bytes
tend to get larger, since the compression mechanism has a constant
overhead in the region of 50 bytes. Random data (including the output
of most file compressors) is coded at about 8.05 bits per byte, giving
an expansion of around 0.5%.
</P><P>
As a self-check for your protection, <CODE>bzip2</CODE> uses 32-bit CRCs to
make sure that the decompressed version of a file is identical to the
original. This guards against corruption of the compressed data, and
against undetected bugs in <CODE>bzip2</CODE> (hopefully very unlikely). The
chances of data corruption going undetected is microscopic, about one
chance in four billion for each file processed. Be aware, though, that
the check occurs upon decompression, so it can only tell you that
something is wrong. It can't help you recover the original uncompressed
data. You can use <CODE>bzip2recover</CODE> to try to recover data from
damaged files.
</P><P>
Return values: 0 for a normal exit, 1 for environmental problems (file
not found, invalid flags, I/O errors, &c), 2 to indicate a corrupt
compressed file, 3 for an internal consistency error (eg, bug) which
caused <CODE>bzip2</CODE> to panic.
</P><P>
<HR SIZE="6">
<A NAME="SEC6"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_2.html#SEC5"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_2.html#SEC7"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H4> OPTIONS </H4>
<!--docid::SEC6::-->
<DL COMPACT>
<DT><CODE>-c --stdout</CODE>
<DD>Compress or decompress to standard output.
<DT><CODE>-d --decompress</CODE>
<DD>Force decompression. <CODE>bzip2</CODE>, <CODE>bunzip2</CODE> and <CODE>bzcat</CODE> are
really the same program, and the decision about what actions to take is
done on the basis of which name is used. This flag overrides that
mechanism, and forces bzip2 to decompress.
<DT><CODE>-z --compress</CODE>
<DD>The complement to <CODE>-d</CODE>: forces compression, regardless of the
invokation name.
<DT><CODE>-t --test</CODE>
<DD>Check integrity of the specified file(s), but don't decompress them.
This really performs a trial decompression and throws away the result.
<DT><CODE>-f --force</CODE>
<DD>Force overwrite of output files. Normally, <CODE>bzip2</CODE> will not overwrite
existing output files. Also forces <CODE>bzip2</CODE> to break hard links
to files, which it otherwise wouldn't do.
<P>
<CODE>bzip2</CODE> normally declines to decompress files which don't have the
correct magic header bytes. If forced (<CODE>-f</CODE>), however, it will
pass such files through unmodified. This is how GNU <CODE>gzip</CODE>
behaves.
<DT><CODE>-k --keep</CODE>
<DD>Keep (don't delete) input files during compression
or decompression.
<DT><CODE>-s --small</CODE>
<DD>Reduce memory usage, for compression, decompression and testing. Files
are decompressed and tested using a modified algorithm which only
requires 2.5 bytes per block byte. This means any file can be
decompressed in 2300k of memory, albeit at about half the normal speed.
<P>
During compression, <CODE>-s</CODE> selects a block size of 200k, which limits
memory use to around the same figure, at the expense of your compression
ratio. In short, if your machine is low on memory (8 megabytes or
less), use -s for everything. See MEMORY MANAGEMENT below.
<DT><CODE>-q --quiet</CODE>
<DD>Suppress non-essential warning messages. Messages pertaining to
I/O errors and other critical events will not be suppressed.
<DT><CODE>-v --verbose</CODE>
<DD>Verbose mode -- show the compression ratio for each file processed.
Further <CODE>-v</CODE>'s increase the verbosity level, spewing out lots of
information which is primarily of interest for diagnostic purposes.
<DT><CODE>-L --license -V --version</CODE>
<DD>Display the software version, license terms and conditions.
<DT><CODE>-1 (or --fast) to -9 (or --best)</CODE>
<DD>Set the block size to 100 k, 200 k .. 900 k when compressing. Has no
effect when decompressing. See MEMORY MANAGEMENT below.
The <CODE>--fast</CODE> and <CODE>--best</CODE> aliases are primarily for GNU
<CODE>gzip</CODE> compatibility. In particular, <CODE>--fast</CODE> doesn't make
things significantly faster. And <CODE>--best</CODE> merely selects the
default behaviour.
<DT><CODE>--</CODE>
<DD>Treats all subsequent arguments as file names, even if they start
with a dash. This is so you can handle files with names beginning
with a dash, for example: <CODE>bzip2 -- -myfilename</CODE>.
<DT><CODE>--repetitive-fast</CODE>
<DD><DT><CODE>--repetitive-best</CODE>
<DD>These flags are redundant in versions 0.9.5 and above. They provided
some coarse control over the behaviour of the sorting algorithm in
earlier versions, which was sometimes useful. 0.9.5 and above have an
improved algorithm which renders these flags irrelevant.
</DL>
<P>
<HR SIZE="6">
<A NAME="SEC7"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_2.html#SEC6"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_2.html#SEC8"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H4> MEMORY MANAGEMENT </H4>
<!--docid::SEC7::-->
<P>
<CODE>bzip2</CODE> compresses large files in blocks. The block size affects
both the compression ratio achieved, and the amount of memory needed for
compression and decompression. The flags <CODE>-1</CODE> through <CODE>-9</CODE>
specify the block size to be 100,000 bytes through 900,000 bytes (the
default) respectively. At decompression time, the block size used for
compression is read from the header of the compressed file, and
<CODE>bunzip2</CODE> then allocates itself just enough memory to decompress
the file. Since block sizes are stored in compressed files, it follows
that the flags <CODE>-1</CODE> to <CODE>-9</CODE> are irrelevant to and so ignored
during decompression.
</P><P>
Compression and decompression requirements, in bytes, can be estimated
as:
<TABLE><tr><td> </td><td class=example><pre> Compression: 400k + ( 8 x block size )
Decompression: 100k + ( 4 x block size ), or
100k + ( 2.5 x block size )
</pre></td></tr></table>Larger block sizes give rapidly diminishing marginal returns. Most of
the compression comes from the first two or three hundred k of block
size, a fact worth bearing in mind when using <CODE>bzip2</CODE> on small machines.
It is also important to appreciate that the decompression memory
requirement is set at compression time by the choice of block size.
</P><P>
For files compressed with the default 900k block size, <CODE>bunzip2</CODE>
will require about 3700 kbytes to decompress. To support decompression
of any file on a 4 megabyte machine, <CODE>bunzip2</CODE> has an option to
decompress using approximately half this amount of memory, about 2300
kbytes. Decompression speed is also halved, so you should use this
option only where necessary. The relevant flag is <CODE>-s</CODE>.
</P><P>
In general, try and use the largest block size memory constraints allow,
since that maximises the compression achieved. Compression and
decompression speed are virtually unaffected by block size.
</P><P>
Another significant point applies to files which fit in a single block
-- that means most files you'd encounter using a large block size. The
amount of real memory touched is proportional to the size of the file,
since the file is smaller than a block. For example, compressing a file
20,000 bytes long with the flag <CODE>-9</CODE> will cause the compressor to
allocate around 7600k of memory, but only touch 400k + 20000 * 8 = 560
kbytes of it. Similarly, the decompressor will allocate 3700k but only
touch 100k + 20000 * 4 = 180 kbytes.
</P><P>
Here is a table which summarises the maximum memory usage for different
block sizes. Also recorded is the total compressed size for 14 files of
the Calgary Text Compression Corpus totalling 3,141,622 bytes. This
column gives some feel for how compression varies with block size.
These figures tend to understate the advantage of larger block sizes for
larger files, since the Corpus is dominated by smaller files.
<TABLE><tr><td> </td><td class=example><pre> Compress Decompress Decompress Corpus
Flag usage usage -s usage Size
-1 1200k 500k 350k 914704
-2 2000k 900k 600k 877703
-3 2800k 1300k 850k 860338
-4 3600k 1700k 1100k 846899
-5 4400k 2100k 1350k 845160
-6 5200k 2500k 1600k 838626
-7 6100k 2900k 1850k 834096
-8 6800k 3300k 2100k 828642
-9 7600k 3700k 2350k 828642
</pre></td></tr></table></P><P>
<HR SIZE="6">
<A NAME="SEC8"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_2.html#SEC7"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_2.html#SEC9"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H4> RECOVERING DATA FROM DAMAGED FILES </H4>
<!--docid::SEC8::-->
<P>
<CODE>bzip2</CODE> compresses files in blocks, usually 900kbytes long. Each
block is handled independently. If a media or transmission error causes
a multi-block <CODE>.bz2</CODE> file to become damaged, it may be possible to
recover data from the undamaged blocks in the file.
</P><P>
The compressed representation of each block is delimited by a 48-bit
pattern, which makes it possible to find the block boundaries with
reasonable certainty. Each block also carries its own 32-bit CRC, so
damaged blocks can be distinguished from undamaged ones.
</P><P>
<CODE>bzip2recover</CODE> is a simple program whose purpose is to search for
blocks in <CODE>.bz2</CODE> files, and write each block out into its own
<CODE>.bz2</CODE> file. You can then use <CODE>bzip2 -t</CODE> to test the
integrity of the resulting files, and decompress those which are
undamaged.
</P><P>
<CODE>bzip2recover</CODE>
takes a single argument, the name of the damaged file, and writes a
number of files <CODE>rec00001file.bz2</CODE>, <CODE>rec00002file.bz2</CODE>, etc,
containing the extracted blocks. The output filenames are designed so
that the use of wildcards in subsequent processing -- for example,
<CODE>bzip2 -dc rec*file.bz2 > recovered_data</CODE> -- processes the files in
the correct order.
</P><P>
<CODE>bzip2recover</CODE> should be of most use dealing with large <CODE>.bz2</CODE>
files, as these will contain many blocks. It is clearly futile to use
it on damaged single-block files, since a damaged block cannot be
recovered. If you wish to minimise any potential data loss through
media or transmission errors, you might consider compressing with a
smaller block size.
</P><P>
<HR SIZE="6">
<A NAME="SEC9"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_2.html#SEC8"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_2.html#SEC10"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H4> PERFORMANCE NOTES </H4>
<!--docid::SEC9::-->
<P>
The sorting phase of compression gathers together similar strings in the
file. Because of this, files containing very long runs of repeated
symbols, like "aabaabaabaab ..." (repeated several hundred times) may
compress more slowly than normal. Versions 0.9.5 and above fare much
better than previous versions in this respect. The ratio between
worst-case and average-case compression time is in the region of 10:1.
For previous versions, this figure was more like 100:1. You can use the
<CODE>-vvvv</CODE> option to monitor progress in great detail, if you want.
</P><P>
Decompression speed is unaffected by these phenomena.
</P><P>
<CODE>bzip2</CODE> usually allocates several megabytes of memory to operate
in, and then charges all over it in a fairly random fashion. This means
that performance, both for compressing and decompressing, is largely
determined by the speed at which your machine can service cache misses.
Because of this, small changes to the code to reduce the miss rate have
been observed to give disproportionately large performance improvements.
I imagine <CODE>bzip2</CODE> will perform best on machines with very large
caches.
</P><P>
<HR SIZE="6">
<A NAME="SEC10"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_2.html#SEC9"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_2.html#SEC11"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H4> CAVEATS </H4>
<!--docid::SEC10::-->
<P>
I/O error messages are not as helpful as they could be. <CODE>bzip2</CODE>
tries hard to detect I/O errors and exit cleanly, but the details of
what the problem is sometimes seem rather misleading.
</P><P>
This manual page pertains to version 1.0.2 of <CODE>bzip2</CODE>. Compressed
data created by this version is entirely forwards and backwards
compatible with the previous public releases, versions 0.1pl2, 0.9.0,
0.9.5, 1.0.0 and 1.0.1, but with the following exception: 0.9.0 and
above can correctly decompress multiple concatenated compressed files.
0.1pl2 cannot do this; it will stop after decompressing just the first
file in the stream.
</P><P>
<CODE>bzip2recover</CODE> versions prior to this one, 1.0.2, used 32-bit
integers to represent bit positions in compressed files, so it could not
handle compressed files more than 512 megabytes long. Version 1.0.2 and
above uses 64-bit ints on some platforms which support them (GNU
supported targets, and Windows). To establish whether or not
<CODE>bzip2recover</CODE> was built with such a limitation, run it without
arguments. In any event you can build yourself an unlimited version if
you can recompile it with <CODE>MaybeUInt64</CODE> set to be an unsigned
64-bit integer.
</P><P>
<HR SIZE="6">
<A NAME="SEC11"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_2.html#SEC10"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC12"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H4> AUTHOR </H4>
<!--docid::SEC11::-->
Julian Seward, <CODE>jseward@acm.org</CODE>.
<P>
<CODE>http://sources.redhat.com/bzip2</CODE>
</P><P>
The ideas embodied in <CODE>bzip2</CODE> are due to (at least) the following
people: Michael Burrows and David Wheeler (for the block sorting
transformation), David Wheeler (again, for the Huffman coder), Peter
Fenwick (for the structured coding model in the original <CODE>bzip</CODE>,
and many refinements), and Alistair Moffat, Radford Neal and Ian Witten
(for the arithmetic coder in the original <CODE>bzip</CODE>). I am much
indebted for their help, support and advice. See the manual in the
source distribution for pointers to sources of documentation. Christian
von Roques encouraged me to look for faster sorting algorithms, so as to
speed up compression. Bela Lubkin encouraged me to improve the
worst-case compression performance. The <CODE>bz*</CODE> scripts are derived
from those of GNU <CODE>gzip</CODE>. Many people sent patches, helped with
portability problems, lent machines, gave advice and were generally
helpful.
</P><P>
</BLOCKQUOTE>
<HR SIZE="6">
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<BR>
<FONT SIZE="-1">
This document was generated
by <I>Julian Seward</I> on <I>January, 5 2002</I>
using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
"><I>texi2html</I></A>
</BODY>
</HTML>
|
Added work/src/bzip2-1.0.2/manual_3.html.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
|
<HTML>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- Created on January, 5 2002 by texi2html 1.64 -->
<!--
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
Karl Berry <karl@freefriends.org>
Olaf Bachmann <obachman@mathematik.uni-kl.de>
and many others.
Maintained by: Olaf Bachmann <obachman@mathematik.uni-kl.de>
Send bugs and suggestions to <texi2html@mathematik.uni-kl.de>
-->
<HEAD>
<TITLE>Untitled Document: 3. Programming with <CODE>libbzip2</CODE></TITLE>
<META NAME="description" CONTENT="Untitled Document: 3. Programming with <CODE>libbzip2</CODE>">
<META NAME="keywords" CONTENT="Untitled Document: 3. Programming with <CODE>libbzip2</CODE>">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META NAME="Generator" CONTENT="texi2html 1.64">
</HEAD>
<BODY LANG="" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">
<A NAME="SEC12"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_2.html#SEC11"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC13"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H1> 3. Programming with <CODE>libbzip2</CODE> </H1>
<!--docid::SEC12::-->
<P>
This chapter describes the programming interface to <CODE>libbzip2</CODE>.
</P><P>
For general background information, particularly about memory
use and performance aspects, you'd be well advised to read Chapter 2
as well.
</P><P>
<HR SIZE="6">
<A NAME="SEC13"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC12"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC14"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 3.1 Top-level structure </H2>
<!--docid::SEC13::-->
<P>
<CODE>libbzip2</CODE> is a flexible library for compressing and decompressing
data in the <CODE>bzip2</CODE> data format. Although packaged as a single
entity, it helps to regard the library as three separate parts: the low
level interface, and the high level interface, and some utility
functions.
</P><P>
The structure of <CODE>libbzip2</CODE>'s interfaces is similar to
that of Jean-loup Gailly's and Mark Adler's excellent <CODE>zlib</CODE>
library.
</P><P>
All externally visible symbols have names beginning <CODE>BZ2_</CODE>.
This is new in version 1.0. The intention is to minimise pollution
of the namespaces of library clients.
</P><P>
<HR SIZE="6">
<A NAME="SEC14"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC13"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC15"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 3.1.1 Low-level summary </H3>
<!--docid::SEC14::-->
<P>
This interface provides services for compressing and decompressing
data in memory. There's no provision for dealing with files, streams
or any other I/O mechanisms, just straight memory-to-memory work.
In fact, this part of the library can be compiled without inclusion
of <CODE>stdio.h</CODE>, which may be helpful for embedded applications.
</P><P>
The low-level part of the library has no global variables and
is therefore thread-safe.
</P><P>
Six routines make up the low level interface:
<CODE>BZ2_bzCompressInit</CODE>, <CODE>BZ2_bzCompress</CODE>, and <BR> <CODE>BZ2_bzCompressEnd</CODE>
for compression,
and a corresponding trio <CODE>BZ2_bzDecompressInit</CODE>, <BR> <CODE>BZ2_bzDecompress</CODE>
and <CODE>BZ2_bzDecompressEnd</CODE> for decompression.
The <CODE>*Init</CODE> functions allocate
memory for compression/decompression and do other
initialisations, whilst the <CODE>*End</CODE> functions close down operations
and release memory.
</P><P>
The real work is done by <CODE>BZ2_bzCompress</CODE> and <CODE>BZ2_bzDecompress</CODE>.
These compress and decompress data from a user-supplied input buffer
to a user-supplied output buffer. These buffers can be any size;
arbitrary quantities of data are handled by making repeated calls
to these functions. This is a flexible mechanism allowing a
consumer-pull style of activity, or producer-push, or a mixture of
both.
</P><P>
<HR SIZE="6">
<A NAME="SEC15"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC14"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC16"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 3.1.2 High-level summary </H3>
<!--docid::SEC15::-->
<P>
This interface provides some handy wrappers around the low-level
interface to facilitate reading and writing <CODE>bzip2</CODE> format
files (<CODE>.bz2</CODE> files). The routines provide hooks to facilitate
reading files in which the <CODE>bzip2</CODE> data stream is embedded
within some larger-scale file structure, or where there are
multiple <CODE>bzip2</CODE> data streams concatenated end-to-end.
</P><P>
For reading files, <CODE>BZ2_bzReadOpen</CODE>, <CODE>BZ2_bzRead</CODE>,
<CODE>BZ2_bzReadClose</CODE> and <BR> <CODE>BZ2_bzReadGetUnused</CODE> are supplied. For
writing files, <CODE>BZ2_bzWriteOpen</CODE>, <CODE>BZ2_bzWrite</CODE> and
<CODE>BZ2_bzWriteFinish</CODE> are available.
</P><P>
As with the low-level library, no global variables are used
so the library is per se thread-safe. However, if I/O errors
occur whilst reading or writing the underlying compressed files,
you may have to consult <CODE>errno</CODE> to determine the cause of
the error. In that case, you'd need a C library which correctly
supports <CODE>errno</CODE> in a multithreaded environment.
</P><P>
To make the library a little simpler and more portable,
<CODE>BZ2_bzReadOpen</CODE> and <CODE>BZ2_bzWriteOpen</CODE> require you to pass them file
handles (<CODE>FILE*</CODE>s) which have previously been opened for reading or
writing respectively. That avoids portability problems associated with
file operations and file attributes, whilst not being much of an
imposition on the programmer.
</P><P>
<HR SIZE="6">
<A NAME="SEC16"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC15"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC17"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 3.1.3 Utility functions summary </H3>
<!--docid::SEC16::-->
For very simple needs, <CODE>BZ2_bzBuffToBuffCompress</CODE> and
<CODE>BZ2_bzBuffToBuffDecompress</CODE> are provided. These compress
data in memory from one buffer to another buffer in a single
function call. You should assess whether these functions
fulfill your memory-to-memory compression/decompression
requirements before investing effort in understanding the more
general but more complex low-level interface.
<P>
Yoshioka Tsuneo (<CODE>QWF00133@niftyserve.or.jp</CODE> /
<CODE>tsuneo-y@is.aist-nara.ac.jp</CODE>) has contributed some functions to
give better <CODE>zlib</CODE> compatibility. These functions are
<CODE>BZ2_bzopen</CODE>, <CODE>BZ2_bzread</CODE>, <CODE>BZ2_bzwrite</CODE>, <CODE>BZ2_bzflush</CODE>,
<CODE>BZ2_bzclose</CODE>,
<CODE>BZ2_bzerror</CODE> and <CODE>BZ2_bzlibVersion</CODE>. You may find these functions
more convenient for simple file reading and writing, than those in the
high-level interface. These functions are not (yet) officially part of
the library, and are minimally documented here. If they break, you
get to keep all the pieces. I hope to document them properly when time
permits.
</P><P>
Yoshioka also contributed modifications to allow the library to be
built as a Windows DLL.
</P><P>
<HR SIZE="6">
<A NAME="SEC17"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC16"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC18"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 3.2 Error handling </H2>
<!--docid::SEC17::-->
<P>
The library is designed to recover cleanly in all situations, including
the worst-case situation of decompressing random data. I'm not
100% sure that it can always do this, so you might want to add
a signal handler to catch segmentation violations during decompression
if you are feeling especially paranoid. I would be interested in
hearing more about the robustness of the library to corrupted
compressed data.
</P><P>
Version 1.0 is much more robust in this respect than
0.9.0 or 0.9.5. Investigations with Checker (a tool for
detecting problems with memory management, similar to Purify)
indicate that, at least for the few files I tested, all single-bit
errors in the decompressed data are caught properly, with no
segmentation faults, no reads of uninitialised data and no
out of range reads or writes. So it's certainly much improved,
although I wouldn't claim it to be totally bombproof.
</P><P>
The file <CODE>bzlib.h</CODE> contains all definitions needed to use
the library. In particular, you should definitely not include
<CODE>bzlib_private.h</CODE>.
</P><P>
In <CODE>bzlib.h</CODE>, the various return values are defined. The following
list is not intended as an exhaustive description of the circumstances
in which a given value may be returned -- those descriptions are given
later. Rather, it is intended to convey the rough meaning of each
return value. The first five actions are normal and not intended to
denote an error situation.
<DL COMPACT>
<DT><CODE>BZ_OK</CODE>
<DD>The requested action was completed successfully.
<DT><CODE>BZ_RUN_OK</CODE>
<DD><DT><CODE>BZ_FLUSH_OK</CODE>
<DD><DT><CODE>BZ_FINISH_OK</CODE>
<DD>In <CODE>BZ2_bzCompress</CODE>, the requested flush/finish/nothing-special action
was completed successfully.
<DT><CODE>BZ_STREAM_END</CODE>
<DD>Compression of data was completed, or the logical stream end was
detected during decompression.
</DL>
<P>
The following return values indicate an error of some kind.
<DL COMPACT>
<DT><CODE>BZ_CONFIG_ERROR</CODE>
<DD>Indicates that the library has been improperly compiled on your
platform -- a major configuration error. Specifically, it means
that <CODE>sizeof(char)</CODE>, <CODE>sizeof(short)</CODE> and <CODE>sizeof(int)</CODE>
are not 1, 2 and 4 respectively, as they should be. Note that the
library should still work properly on 64-bit platforms which follow
the LP64 programming model -- that is, where <CODE>sizeof(long)</CODE>
and <CODE>sizeof(void*)</CODE> are 8. Under LP64, <CODE>sizeof(int)</CODE> is
still 4, so <CODE>libbzip2</CODE>, which doesn't use the <CODE>long</CODE> type,
is OK.
<DT><CODE>BZ_SEQUENCE_ERROR</CODE>
<DD>When using the library, it is important to call the functions in the
correct sequence and with data structures (buffers etc) in the correct
states. <CODE>libbzip2</CODE> checks as much as it can to ensure this is
happening, and returns <CODE>BZ_SEQUENCE_ERROR</CODE> if not. Code which
complies precisely with the function semantics, as detailed below,
should never receive this value; such an event denotes buggy code
which you should investigate.
<DT><CODE>BZ_PARAM_ERROR</CODE>
<DD>Returned when a parameter to a function call is out of range
or otherwise manifestly incorrect. As with <CODE>BZ_SEQUENCE_ERROR</CODE>,
this denotes a bug in the client code. The distinction between
<CODE>BZ_PARAM_ERROR</CODE> and <CODE>BZ_SEQUENCE_ERROR</CODE> is a bit hazy, but still worth
making.
<DT><CODE>BZ_MEM_ERROR</CODE>
<DD>Returned when a request to allocate memory failed. Note that the
quantity of memory needed to decompress a stream cannot be determined
until the stream's header has been read. So <CODE>BZ2_bzDecompress</CODE> and
<CODE>BZ2_bzRead</CODE> may return <CODE>BZ_MEM_ERROR</CODE> even though some of
the compressed data has been read. The same is not true for
compression; once <CODE>BZ2_bzCompressInit</CODE> or <CODE>BZ2_bzWriteOpen</CODE> have
successfully completed, <CODE>BZ_MEM_ERROR</CODE> cannot occur.
<DT><CODE>BZ_DATA_ERROR</CODE>
<DD>Returned when a data integrity error is detected during decompression.
Most importantly, this means when stored and computed CRCs for the
data do not match. This value is also returned upon detection of any
other anomaly in the compressed data.
<DT><CODE>BZ_DATA_ERROR_MAGIC</CODE>
<DD>As a special case of <CODE>BZ_DATA_ERROR</CODE>, it is sometimes useful to
know when the compressed stream does not start with the correct
magic bytes (<CODE>'B' 'Z' 'h'</CODE>).
<DT><CODE>BZ_IO_ERROR</CODE>
<DD>Returned by <CODE>BZ2_bzRead</CODE> and <CODE>BZ2_bzWrite</CODE> when there is an error
reading or writing in the compressed file, and by <CODE>BZ2_bzReadOpen</CODE>
and <CODE>BZ2_bzWriteOpen</CODE> for attempts to use a file for which the
error indicator (viz, <CODE>ferror(f)</CODE>) is set.
On receipt of <CODE>BZ_IO_ERROR</CODE>, the caller should consult
<CODE>errno</CODE> and/or <CODE>perror</CODE> to acquire operating-system
specific information about the problem.
<DT><CODE>BZ_UNEXPECTED_EOF</CODE>
<DD>Returned by <CODE>BZ2_bzRead</CODE> when the compressed file finishes
before the logical end of stream is detected.
<DT><CODE>BZ_OUTBUFF_FULL</CODE>
<DD>Returned by <CODE>BZ2_bzBuffToBuffCompress</CODE> and
<CODE>BZ2_bzBuffToBuffDecompress</CODE> to indicate that the output data
will not fit into the output buffer provided.
</DL>
<P>
<HR SIZE="6">
<A NAME="SEC18"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC17"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC19"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 3.3 Low-level interface </H2>
<!--docid::SEC18::-->
<P>
<HR SIZE="6">
<A NAME="SEC19"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC18"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC20"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 3.3.1 <CODE>BZ2_bzCompressInit</CODE> </H3>
<!--docid::SEC19::-->
<TABLE><tr><td> </td><td class=example><pre>typedef
struct {
char *next_in;
unsigned int avail_in;
unsigned int total_in_lo32;
unsigned int total_in_hi32;
char *next_out;
unsigned int avail_out;
unsigned int total_out_lo32;
unsigned int total_out_hi32;
void *state;
void *(*bzalloc)(void *,int,int);
void (*bzfree)(void *,void *);
void *opaque;
}
bz_stream;
int BZ2_bzCompressInit ( bz_stream *strm,
int blockSize100k,
int verbosity,
int workFactor );
</pre></td></tr></table><P>
Prepares for compression. The <CODE>bz_stream</CODE> structure
holds all data pertaining to the compression activity.
A <CODE>bz_stream</CODE> structure should be allocated and initialised
prior to the call.
The fields of <CODE>bz_stream</CODE>
comprise the entirety of the user-visible data. <CODE>state</CODE>
is a pointer to the private data structures required for compression.
</P><P>
Custom memory allocators are supported, via fields <CODE>bzalloc</CODE>,
<CODE>bzfree</CODE>,
and <CODE>opaque</CODE>. The value
<CODE>opaque</CODE> is passed to as the first argument to
all calls to <CODE>bzalloc</CODE> and <CODE>bzfree</CODE>, but is
otherwise ignored by the library.
The call <CODE>bzalloc ( opaque, n, m )</CODE> is expected to return a
pointer <CODE>p</CODE> to
<CODE>n * m</CODE> bytes of memory, and <CODE>bzfree ( opaque, p )</CODE>
should free
that memory.
</P><P>
If you don't want to use a custom memory allocator, set <CODE>bzalloc</CODE>,
<CODE>bzfree</CODE> and
<CODE>opaque</CODE> to <CODE>NULL</CODE>,
and the library will then use the standard <CODE>malloc</CODE>/<CODE>free</CODE>
routines.
</P><P>
Before calling <CODE>BZ2_bzCompressInit</CODE>, fields <CODE>bzalloc</CODE>,
<CODE>bzfree</CODE> and <CODE>opaque</CODE> should
be filled appropriately, as just described. Upon return, the internal
state will have been allocated and initialised, and <CODE>total_in_lo32</CODE>,
<CODE>total_in_hi32</CODE>, <CODE>total_out_lo32</CODE> and
<CODE>total_out_hi32</CODE> will have been set to zero.
These four fields are used by the library
to inform the caller of the total amount of data passed into and out of
the library, respectively. You should not try to change them.
As of version 1.0, 64-bit counts are maintained, even on 32-bit
platforms, using the <CODE>_hi32</CODE> fields to store the upper 32 bits
of the count. So, for example, the total amount of data in
is <CODE>(total_in_hi32 << 32) + total_in_lo32</CODE>.
</P><P>
Parameter <CODE>blockSize100k</CODE> specifies the block size to be used for
compression. It should be a value between 1 and 9 inclusive, and the
actual block size used is 100000 x this figure. 9 gives the best
compression but takes most memory.
</P><P>
Parameter <CODE>verbosity</CODE> should be set to a number between 0 and 4
inclusive. 0 is silent, and greater numbers give increasingly verbose
monitoring/debugging output. If the library has been compiled with
<CODE>-DBZ_NO_STDIO</CODE>, no such output will appear for any verbosity
setting.
</P><P>
Parameter <CODE>workFactor</CODE> controls how the compression phase behaves
when presented with worst case, highly repetitive, input data. If
compression runs into difficulties caused by repetitive data, the
library switches from the standard sorting algorithm to a fallback
algorithm. The fallback is slower than the standard algorithm by
perhaps a factor of three, but always behaves reasonably, no matter how
bad the input.
</P><P>
Lower values of <CODE>workFactor</CODE> reduce the amount of effort the
standard algorithm will expend before resorting to the fallback. You
should set this parameter carefully; too low, and many inputs will be
handled by the fallback algorithm and so compress rather slowly, too
high, and your average-to-worst case compression times can become very
large. The default value of 30 gives reasonable behaviour over a wide
range of circumstances.
</P><P>
Allowable values range from 0 to 250 inclusive. 0 is a special case,
equivalent to using the default value of 30.
</P><P>
Note that the compressed output generated is the same regardless of
whether or not the fallback algorithm is used.
</P><P>
Be aware also that this parameter may disappear entirely in future
versions of the library. In principle it should be possible to devise a
good way to automatically choose which algorithm to use. Such a
mechanism would render the parameter obsolete.
</P><P>
Possible return values:
<TABLE><tr><td> </td><td class=display><pre style="font-family: serif"> <CODE>BZ_CONFIG_ERROR</CODE>
if the library has been mis-compiled
<CODE>BZ_PARAM_ERROR</CODE>
if <CODE>strm</CODE> is <CODE>NULL</CODE>
or <CODE>blockSize</CODE> < 1 or <CODE>blockSize</CODE> > 9
or <CODE>verbosity</CODE> < 0 or <CODE>verbosity</CODE> > 4
or <CODE>workFactor</CODE> < 0 or <CODE>workFactor</CODE> > 250
<CODE>BZ_MEM_ERROR</CODE>
if not enough memory is available
<CODE>BZ_OK</CODE>
otherwise
</pre></td></tr></table>Allowable next actions:
<TABLE><tr><td> </td><td class=display><pre style="font-family: serif"> <CODE>BZ2_bzCompress</CODE>
if <CODE>BZ_OK</CODE> is returned
no specific action needed in case of error
</pre></td></tr></table></P><P>
<HR SIZE="6">
<A NAME="SEC20"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC19"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC21"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 3.3.2 <CODE>BZ2_bzCompress</CODE> </H3>
<!--docid::SEC20::-->
<TABLE><tr><td> </td><td class=example><pre> int BZ2_bzCompress ( bz_stream *strm, int action );
</pre></td></tr></table>Provides more input and/or output buffer space for the library. The
caller maintains input and output buffers, and calls <CODE>BZ2_bzCompress</CODE> to
transfer data between them.
<P>
Before each call to <CODE>BZ2_bzCompress</CODE>, <CODE>next_in</CODE> should point at
the data to be compressed, and <CODE>avail_in</CODE> should indicate how many
bytes the library may read. <CODE>BZ2_bzCompress</CODE> updates <CODE>next_in</CODE>,
<CODE>avail_in</CODE> and <CODE>total_in</CODE> to reflect the number of bytes it
has read.
</P><P>
Similarly, <CODE>next_out</CODE> should point to a buffer in which the
compressed data is to be placed, with <CODE>avail_out</CODE> indicating how
much output space is available. <CODE>BZ2_bzCompress</CODE> updates
<CODE>next_out</CODE>, <CODE>avail_out</CODE> and <CODE>total_out</CODE> to reflect the
number of bytes output.
</P><P>
You may provide and remove as little or as much data as you like on each
call of <CODE>BZ2_bzCompress</CODE>. In the limit, it is acceptable to supply and
remove data one byte at a time, although this would be terribly
inefficient. You should always ensure that at least one byte of output
space is available at each call.
</P><P>
A second purpose of <CODE>BZ2_bzCompress</CODE> is to request a change of mode of the
compressed stream.
</P><P>
Conceptually, a compressed stream can be in one of four states: IDLE,
RUNNING, FLUSHING and FINISHING. Before initialisation
(<CODE>BZ2_bzCompressInit</CODE>) and after termination (<CODE>BZ2_bzCompressEnd</CODE>), a
stream is regarded as IDLE.
</P><P>
Upon initialisation (<CODE>BZ2_bzCompressInit</CODE>), the stream is placed in the
RUNNING state. Subsequent calls to <CODE>BZ2_bzCompress</CODE> should pass
<CODE>BZ_RUN</CODE> as the requested action; other actions are illegal and
will result in <CODE>BZ_SEQUENCE_ERROR</CODE>.
</P><P>
At some point, the calling program will have provided all the input data
it wants to. It will then want to finish up -- in effect, asking the
library to process any data it might have buffered internally. In this
state, <CODE>BZ2_bzCompress</CODE> will no longer attempt to read data from
<CODE>next_in</CODE>, but it will want to write data to <CODE>next_out</CODE>.
Because the output buffer supplied by the user can be arbitrarily small,
the finishing-up operation cannot necessarily be done with a single call
of <CODE>BZ2_bzCompress</CODE>.
</P><P>
Instead, the calling program passes <CODE>BZ_FINISH</CODE> as an action to
<CODE>BZ2_bzCompress</CODE>. This changes the stream's state to FINISHING. Any
remaining input (ie, <CODE>next_in[0 .. avail_in-1]</CODE>) is compressed and
transferred to the output buffer. To do this, <CODE>BZ2_bzCompress</CODE> must be
called repeatedly until all the output has been consumed. At that
point, <CODE>BZ2_bzCompress</CODE> returns <CODE>BZ_STREAM_END</CODE>, and the stream's
state is set back to IDLE. <CODE>BZ2_bzCompressEnd</CODE> should then be
called.
</P><P>
Just to make sure the calling program does not cheat, the library makes
a note of <CODE>avail_in</CODE> at the time of the first call to
<CODE>BZ2_bzCompress</CODE> which has <CODE>BZ_FINISH</CODE> as an action (ie, at the
time the program has announced its intention to not supply any more
input). By comparing this value with that of <CODE>avail_in</CODE> over
subsequent calls to <CODE>BZ2_bzCompress</CODE>, the library can detect any
attempts to slip in more data to compress. Any calls for which this is
detected will return <CODE>BZ_SEQUENCE_ERROR</CODE>. This indicates a
programming mistake which should be corrected.
</P><P>
Instead of asking to finish, the calling program may ask
<CODE>BZ2_bzCompress</CODE> to take all the remaining input, compress it and
terminate the current (Burrows-Wheeler) compression block. This could
be useful for error control purposes. The mechanism is analogous to
that for finishing: call <CODE>BZ2_bzCompress</CODE> with an action of
<CODE>BZ_FLUSH</CODE>, remove output data, and persist with the
<CODE>BZ_FLUSH</CODE> action until the value <CODE>BZ_RUN</CODE> is returned. As
with finishing, <CODE>BZ2_bzCompress</CODE> detects any attempt to provide more
input data once the flush has begun.
</P><P>
Once the flush is complete, the stream returns to the normal RUNNING
state.
</P><P>
This all sounds pretty complex, but isn't really. Here's a table
which shows which actions are allowable in each state, what action
will be taken, what the next state is, and what the non-error return
values are. Note that you can't explicitly ask what state the
stream is in, but nor do you need to -- it can be inferred from the
values returned by <CODE>BZ2_bzCompress</CODE>.
<TABLE><tr><td> </td><td class=display><pre style="font-family: serif">IDLE/<CODE>any</CODE>
Illegal. IDLE state only exists after <CODE>BZ2_bzCompressEnd</CODE> or
before <CODE>BZ2_bzCompressInit</CODE>.
Return value = <CODE>BZ_SEQUENCE_ERROR</CODE>
RUNNING/<CODE>BZ_RUN</CODE>
Compress from <CODE>next_in</CODE> to <CODE>next_out</CODE> as much as possible.
Next state = RUNNING
Return value = <CODE>BZ_RUN_OK</CODE>
RUNNING/<CODE>BZ_FLUSH</CODE>
Remember current value of <CODE>next_in</CODE>. Compress from <CODE>next_in</CODE>
to <CODE>next_out</CODE> as much as possible, but do not accept any more input.
Next state = FLUSHING
Return value = <CODE>BZ_FLUSH_OK</CODE>
RUNNING/<CODE>BZ_FINISH</CODE>
Remember current value of <CODE>next_in</CODE>. Compress from <CODE>next_in</CODE>
to <CODE>next_out</CODE> as much as possible, but do not accept any more input.
Next state = FINISHING
Return value = <CODE>BZ_FINISH_OK</CODE>
FLUSHING/<CODE>BZ_FLUSH</CODE>
Compress from <CODE>next_in</CODE> to <CODE>next_out</CODE> as much as possible,
but do not accept any more input.
If all the existing input has been used up and all compressed
output has been removed
Next state = RUNNING; Return value = <CODE>BZ_RUN_OK</CODE>
else
Next state = FLUSHING; Return value = <CODE>BZ_FLUSH_OK</CODE>
FLUSHING/other
Illegal.
Return value = <CODE>BZ_SEQUENCE_ERROR</CODE>
FINISHING/<CODE>BZ_FINISH</CODE>
Compress from <CODE>next_in</CODE> to <CODE>next_out</CODE> as much as possible,
but to not accept any more input.
If all the existing input has been used up and all compressed
output has been removed
Next state = IDLE; Return value = <CODE>BZ_STREAM_END</CODE>
else
Next state = FINISHING; Return value = <CODE>BZ_FINISHING</CODE>
FINISHING/other
Illegal.
Return value = <CODE>BZ_SEQUENCE_ERROR</CODE>
</pre></td></tr></table></P><P>
That still looks complicated? Well, fair enough. The usual sequence
of calls for compressing a load of data is:
<UL>
<LI>Get started with <CODE>BZ2_bzCompressInit</CODE>.
<LI>Shovel data in and shlurp out its compressed form using zero or more
calls of <CODE>BZ2_bzCompress</CODE> with action = <CODE>BZ_RUN</CODE>.
<LI>Finish up.
Repeatedly call <CODE>BZ2_bzCompress</CODE> with action = <CODE>BZ_FINISH</CODE>,
copying out the compressed output, until <CODE>BZ_STREAM_END</CODE> is returned.
<LI>Close up and go home. Call <CODE>BZ2_bzCompressEnd</CODE>.
</UL>
If the data you want to compress fits into your input buffer all
at once, you can skip the calls of <CODE>BZ2_bzCompress ( ..., BZ_RUN )</CODE> and
just do the <CODE>BZ2_bzCompress ( ..., BZ_FINISH )</CODE> calls.
<P>
All required memory is allocated by <CODE>BZ2_bzCompressInit</CODE>. The
compression library can accept any data at all (obviously). So you
shouldn't get any error return values from the <CODE>BZ2_bzCompress</CODE> calls.
If you do, they will be <CODE>BZ_SEQUENCE_ERROR</CODE>, and indicate a bug in
your programming.
</P><P>
Trivial other possible return values:
<TABLE><tr><td> </td><td class=display><pre style="font-family: serif"> <CODE>BZ_PARAM_ERROR</CODE>
if <CODE>strm</CODE> is <CODE>NULL</CODE>, or <CODE>strm->s</CODE> is <CODE>NULL</CODE>
</pre></td></tr></table></P><P>
<HR SIZE="6">
<A NAME="SEC21"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC20"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC22"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 3.3.3 <CODE>BZ2_bzCompressEnd</CODE> </H3>
<!--docid::SEC21::-->
<TABLE><tr><td> </td><td class=example><pre>int BZ2_bzCompressEnd ( bz_stream *strm );
</pre></td></tr></table>Releases all memory associated with a compression stream.
<P>
Possible return values:
<TABLE><tr><td> </td><td class=display><pre style="font-family: serif"> <CODE>BZ_PARAM_ERROR</CODE> if <CODE>strm</CODE> is <CODE>NULL</CODE> or <CODE>strm->s</CODE> is <CODE>NULL</CODE>
<CODE>BZ_OK</CODE> otherwise
</pre></td></tr></table></P><P>
<HR SIZE="6">
<A NAME="SEC22"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC21"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC23"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 3.3.4 <CODE>BZ2_bzDecompressInit</CODE> </H3>
<!--docid::SEC22::-->
<TABLE><tr><td> </td><td class=example><pre>int BZ2_bzDecompressInit ( bz_stream *strm, int verbosity, int small );
</pre></td></tr></table>Prepares for decompression. As with <CODE>BZ2_bzCompressInit</CODE>, a
<CODE>bz_stream</CODE> record should be allocated and initialised before the
call. Fields <CODE>bzalloc</CODE>, <CODE>bzfree</CODE> and <CODE>opaque</CODE> should be
set if a custom memory allocator is required, or made <CODE>NULL</CODE> for
the normal <CODE>malloc</CODE>/<CODE>free</CODE> routines. Upon return, the internal
state will have been initialised, and <CODE>total_in</CODE> and
<CODE>total_out</CODE> will be zero.
<P>
For the meaning of parameter <CODE>verbosity</CODE>, see <CODE>BZ2_bzCompressInit</CODE>.
</P><P>
If <CODE>small</CODE> is nonzero, the library will use an alternative
decompression algorithm which uses less memory but at the cost of
decompressing more slowly (roughly speaking, half the speed, but the
maximum memory requirement drops to around 2300k). See Chapter 2 for
more information on memory management.
</P><P>
Note that the amount of memory needed to decompress
a stream cannot be determined until the stream's header has been read,
so even if <CODE>BZ2_bzDecompressInit</CODE> succeeds, a subsequent
<CODE>BZ2_bzDecompress</CODE> could fail with <CODE>BZ_MEM_ERROR</CODE>.
</P><P>
Possible return values:
<TABLE><tr><td> </td><td class=display><pre style="font-family: serif"> <CODE>BZ_CONFIG_ERROR</CODE>
if the library has been mis-compiled
<CODE>BZ_PARAM_ERROR</CODE>
if <CODE>(small != 0 && small != 1)</CODE>
or <CODE>(verbosity < 0 || verbosity > 4)</CODE>
<CODE>BZ_MEM_ERROR</CODE>
if insufficient memory is available
</pre></td></tr></table></P><P>
Allowable next actions:
<TABLE><tr><td> </td><td class=display><pre style="font-family: serif"> <CODE>BZ2_bzDecompress</CODE>
if <CODE>BZ_OK</CODE> was returned
no specific action required in case of error
</pre></td></tr></table></P><P>
</P><P>
<HR SIZE="6">
<A NAME="SEC23"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC22"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC24"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 3.3.5 <CODE>BZ2_bzDecompress</CODE> </H3>
<!--docid::SEC23::-->
<TABLE><tr><td> </td><td class=example><pre>int BZ2_bzDecompress ( bz_stream *strm );
</pre></td></tr></table>Provides more input and/out output buffer space for the library. The
caller maintains input and output buffers, and uses <CODE>BZ2_bzDecompress</CODE>
to transfer data between them.
<P>
Before each call to <CODE>BZ2_bzDecompress</CODE>, <CODE>next_in</CODE>
should point at the compressed data,
and <CODE>avail_in</CODE> should indicate how many bytes the library
may read. <CODE>BZ2_bzDecompress</CODE> updates <CODE>next_in</CODE>, <CODE>avail_in</CODE>
and <CODE>total_in</CODE>
to reflect the number of bytes it has read.
</P><P>
Similarly, <CODE>next_out</CODE> should point to a buffer in which the uncompressed
output is to be placed, with <CODE>avail_out</CODE> indicating how much output space
is available. <CODE>BZ2_bzCompress</CODE> updates <CODE>next_out</CODE>,
<CODE>avail_out</CODE> and <CODE>total_out</CODE> to reflect
the number of bytes output.
</P><P>
You may provide and remove as little or as much data as you like on
each call of <CODE>BZ2_bzDecompress</CODE>.
In the limit, it is acceptable to
supply and remove data one byte at a time, although this would be
terribly inefficient. You should always ensure that at least one
byte of output space is available at each call.
</P><P>
Use of <CODE>BZ2_bzDecompress</CODE> is simpler than <CODE>BZ2_bzCompress</CODE>.
</P><P>
You should provide input and remove output as described above, and
repeatedly call <CODE>BZ2_bzDecompress</CODE> until <CODE>BZ_STREAM_END</CODE> is
returned. Appearance of <CODE>BZ_STREAM_END</CODE> denotes that
<CODE>BZ2_bzDecompress</CODE> has detected the logical end of the compressed
stream. <CODE>BZ2_bzDecompress</CODE> will not produce <CODE>BZ_STREAM_END</CODE> until
all output data has been placed into the output buffer, so once
<CODE>BZ_STREAM_END</CODE> appears, you are guaranteed to have available all
the decompressed output, and <CODE>BZ2_bzDecompressEnd</CODE> can safely be
called.
</P><P>
If case of an error return value, you should call <CODE>BZ2_bzDecompressEnd</CODE>
to clean up and release memory.
</P><P>
Possible return values:
<TABLE><tr><td> </td><td class=display><pre style="font-family: serif"> <CODE>BZ_PARAM_ERROR</CODE>
if <CODE>strm</CODE> is <CODE>NULL</CODE> or <CODE>strm->s</CODE> is <CODE>NULL</CODE>
or <CODE>strm->avail_out < 1</CODE>
<CODE>BZ_DATA_ERROR</CODE>
if a data integrity error is detected in the compressed stream
<CODE>BZ_DATA_ERROR_MAGIC</CODE>
if the compressed stream doesn't begin with the right magic bytes
<CODE>BZ_MEM_ERROR</CODE>
if there wasn't enough memory available
<CODE>BZ_STREAM_END</CODE>
if the logical end of the data stream was detected and all
output in has been consumed, eg <CODE>s->avail_out > 0</CODE>
<CODE>BZ_OK</CODE>
otherwise
</pre></td></tr></table>Allowable next actions:
<TABLE><tr><td> </td><td class=display><pre style="font-family: serif"> <CODE>BZ2_bzDecompress</CODE>
if <CODE>BZ_OK</CODE> was returned
<CODE>BZ2_bzDecompressEnd</CODE>
otherwise
</pre></td></tr></table></P><P>
<HR SIZE="6">
<A NAME="SEC24"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC23"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC25"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 3.3.6 <CODE>BZ2_bzDecompressEnd</CODE> </H3>
<!--docid::SEC24::-->
<TABLE><tr><td> </td><td class=example><pre>int BZ2_bzDecompressEnd ( bz_stream *strm );
</pre></td></tr></table>Releases all memory associated with a decompression stream.
<P>
Possible return values:
<TABLE><tr><td> </td><td class=display><pre style="font-family: serif"> <CODE>BZ_PARAM_ERROR</CODE>
if <CODE>strm</CODE> is <CODE>NULL</CODE> or <CODE>strm->s</CODE> is <CODE>NULL</CODE>
<CODE>BZ_OK</CODE>
otherwise
</pre></td></tr></table></P><P>
Allowable next actions:
<TABLE><tr><td> </td><td class=display><pre style="font-family: serif"> None.
</pre></td></tr></table></P><P>
<HR SIZE="6">
<A NAME="SEC25"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC24"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC26"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 3.4 High-level interface </H2>
<!--docid::SEC25::-->
<P>
This interface provides functions for reading and writing
<CODE>bzip2</CODE> format files. First, some general points.
</P><P>
<UL>
<LI>All of the functions take an <CODE>int*</CODE> first argument,
<CODE>bzerror</CODE>.
After each call, <CODE>bzerror</CODE> should be consulted first to determine
the outcome of the call. If <CODE>bzerror</CODE> is <CODE>BZ_OK</CODE>,
the call completed
successfully, and only then should the return value of the function
(if any) be consulted. If <CODE>bzerror</CODE> is <CODE>BZ_IO_ERROR</CODE>,
there was an error
reading/writing the underlying compressed file, and you should
then consult <CODE>errno</CODE>/<CODE>perror</CODE> to determine the
cause of the difficulty.
<CODE>bzerror</CODE> may also be set to various other values; precise details are
given on a per-function basis below.
<LI>If <CODE>bzerror</CODE> indicates an error
(ie, anything except <CODE>BZ_OK</CODE> and <CODE>BZ_STREAM_END</CODE>),
you should immediately call <CODE>BZ2_bzReadClose</CODE> (or <CODE>BZ2_bzWriteClose</CODE>,
depending on whether you are attempting to read or to write)
to free up all resources associated
with the stream. Once an error has been indicated, behaviour of all calls
except <CODE>BZ2_bzReadClose</CODE> (<CODE>BZ2_bzWriteClose</CODE>) is undefined.
The implication is that (1) <CODE>bzerror</CODE> should
be checked after each call, and (2) if <CODE>bzerror</CODE> indicates an error,
<CODE>BZ2_bzReadClose</CODE> (<CODE>BZ2_bzWriteClose</CODE>) should then be called to clean up.
<LI>The <CODE>FILE*</CODE> arguments passed to
<CODE>BZ2_bzReadOpen</CODE>/<CODE>BZ2_bzWriteOpen</CODE>
should be set to binary mode.
Most Unix systems will do this by default, but other platforms,
including Windows and Mac, will not. If you omit this, you may
encounter problems when moving code to new platforms.
<LI>Memory allocation requests are handled by
<CODE>malloc</CODE>/<CODE>free</CODE>.
At present
there is no facility for user-defined memory allocators in the file I/O
functions (could easily be added, though).
</UL>
<P>
<HR SIZE="6">
<A NAME="SEC26"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC25"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC27"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 3.4.1 <CODE>BZ2_bzReadOpen</CODE> </H3>
<!--docid::SEC26::-->
<TABLE><tr><td> </td><td class=example><pre> typedef void BZFILE;
BZFILE *BZ2_bzReadOpen ( int *bzerror, FILE *f,
int small, int verbosity,
void *unused, int nUnused );
</pre></td></tr></table>Prepare to read compressed data from file handle <CODE>f</CODE>. <CODE>f</CODE>
should refer to a file which has been opened for reading, and for which
the error indicator (<CODE>ferror(f)</CODE>)is not set. If <CODE>small</CODE> is 1,
the library will try to decompress using less memory, at the expense of
speed.
<P>
For reasons explained below, <CODE>BZ2_bzRead</CODE> will decompress the
<CODE>nUnused</CODE> bytes starting at <CODE>unused</CODE>, before starting to read
from the file <CODE>f</CODE>. At most <CODE>BZ_MAX_UNUSED</CODE> bytes may be
supplied like this. If this facility is not required, you should pass
<CODE>NULL</CODE> and <CODE>0</CODE> for <CODE>unused</CODE> and n<CODE>Unused</CODE>
respectively.
</P><P>
For the meaning of parameters <CODE>small</CODE> and <CODE>verbosity</CODE>,
see <CODE>BZ2_bzDecompressInit</CODE>.
</P><P>
The amount of memory needed to decompress a file cannot be determined
until the file's header has been read. So it is possible that
<CODE>BZ2_bzReadOpen</CODE> returns <CODE>BZ_OK</CODE> but a subsequent call of
<CODE>BZ2_bzRead</CODE> will return <CODE>BZ_MEM_ERROR</CODE>.
</P><P>
Possible assignments to <CODE>bzerror</CODE>:
<TABLE><tr><td> </td><td class=display><pre style="font-family: serif"> <CODE>BZ_CONFIG_ERROR</CODE>
if the library has been mis-compiled
<CODE>BZ_PARAM_ERROR</CODE>
if <CODE>f</CODE> is <CODE>NULL</CODE>
or <CODE>small</CODE> is neither <CODE>0</CODE> nor <CODE>1</CODE>
or <CODE>(unused == NULL && nUnused != 0)</CODE>
or <CODE>(unused != NULL && !(0 <= nUnused <= BZ_MAX_UNUSED))</CODE>
<CODE>BZ_IO_ERROR</CODE>
if <CODE>ferror(f)</CODE> is nonzero
<CODE>BZ_MEM_ERROR</CODE>
if insufficient memory is available
<CODE>BZ_OK</CODE>
otherwise.
</pre></td></tr></table></P><P>
Possible return values:
<TABLE><tr><td> </td><td class=display><pre style="font-family: serif"> Pointer to an abstract <CODE>BZFILE</CODE>
if <CODE>bzerror</CODE> is <CODE>BZ_OK</CODE>
<CODE>NULL</CODE>
otherwise
</pre></td></tr></table></P><P>
Allowable next actions:
<TABLE><tr><td> </td><td class=display><pre style="font-family: serif"> <CODE>BZ2_bzRead</CODE>
if <CODE>bzerror</CODE> is <CODE>BZ_OK</CODE>
<CODE>BZ2_bzClose</CODE>
otherwise
</pre></td></tr></table></P><P>
<HR SIZE="6">
<A NAME="SEC27"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC26"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC28"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 3.4.2 <CODE>BZ2_bzRead</CODE> </H3>
<!--docid::SEC27::-->
<TABLE><tr><td> </td><td class=example><pre> int BZ2_bzRead ( int *bzerror, BZFILE *b, void *buf, int len );
</pre></td></tr></table>Reads up to <CODE>len</CODE> (uncompressed) bytes from the compressed file
<CODE>b</CODE> into
the buffer <CODE>buf</CODE>. If the read was successful,
<CODE>bzerror</CODE> is set to <CODE>BZ_OK</CODE>
and the number of bytes read is returned. If the logical end-of-stream
was detected, <CODE>bzerror</CODE> will be set to <CODE>BZ_STREAM_END</CODE>,
and the number
of bytes read is returned. All other <CODE>bzerror</CODE> values denote an error.
<P>
<CODE>BZ2_bzRead</CODE> will supply <CODE>len</CODE> bytes,
unless the logical stream end is detected
or an error occurs. Because of this, it is possible to detect the
stream end by observing when the number of bytes returned is
less than the number
requested. Nevertheless, this is regarded as inadvisable; you should
instead check <CODE>bzerror</CODE> after every call and watch out for
<CODE>BZ_STREAM_END</CODE>.
</P><P>
Internally, <CODE>BZ2_bzRead</CODE> copies data from the compressed file in chunks
of size <CODE>BZ_MAX_UNUSED</CODE> bytes
before decompressing it. If the file contains more bytes than strictly
needed to reach the logical end-of-stream, <CODE>BZ2_bzRead</CODE> will almost certainly
read some of the trailing data before signalling <CODE>BZ_SEQUENCE_END</CODE>.
To collect the read but unused data once <CODE>BZ_SEQUENCE_END</CODE> has
appeared, call <CODE>BZ2_bzReadGetUnused</CODE> immediately before <CODE>BZ2_bzReadClose</CODE>.
</P><P>
Possible assignments to <CODE>bzerror</CODE>:
<TABLE><tr><td> </td><td class=display><pre style="font-family: serif"> <CODE>BZ_PARAM_ERROR</CODE>
if <CODE>b</CODE> is <CODE>NULL</CODE> or <CODE>buf</CODE> is <CODE>NULL</CODE> or <CODE>len < 0</CODE>
<CODE>BZ_SEQUENCE_ERROR</CODE>
if <CODE>b</CODE> was opened with <CODE>BZ2_bzWriteOpen</CODE>
<CODE>BZ_IO_ERROR</CODE>
if there is an error reading from the compressed file
<CODE>BZ_UNEXPECTED_EOF</CODE>
if the compressed file ended before the logical end-of-stream was detected
<CODE>BZ_DATA_ERROR</CODE>
if a data integrity error was detected in the compressed stream
<CODE>BZ_DATA_ERROR_MAGIC</CODE>
if the stream does not begin with the requisite header bytes (ie, is not
a <CODE>bzip2</CODE> data file). This is really a special case of <CODE>BZ_DATA_ERROR</CODE>.
<CODE>BZ_MEM_ERROR</CODE>
if insufficient memory was available
<CODE>BZ_STREAM_END</CODE>
if the logical end of stream was detected.
<CODE>BZ_OK</CODE>
otherwise.
</pre></td></tr></table></P><P>
Possible return values:
<TABLE><tr><td> </td><td class=display><pre style="font-family: serif"> number of bytes read
if <CODE>bzerror</CODE> is <CODE>BZ_OK</CODE> or <CODE>BZ_STREAM_END</CODE>
undefined
otherwise
</pre></td></tr></table></P><P>
Allowable next actions:
<TABLE><tr><td> </td><td class=display><pre style="font-family: serif"> collect data from <CODE>buf</CODE>, then <CODE>BZ2_bzRead</CODE> or <CODE>BZ2_bzReadClose</CODE>
if <CODE>bzerror</CODE> is <CODE>BZ_OK</CODE>
collect data from <CODE>buf</CODE>, then <CODE>BZ2_bzReadClose</CODE> or <CODE>BZ2_bzReadGetUnused</CODE>
if <CODE>bzerror</CODE> is <CODE>BZ_SEQUENCE_END</CODE>
<CODE>BZ2_bzReadClose</CODE>
otherwise
</pre></td></tr></table></P><P>
<HR SIZE="6">
<A NAME="SEC28"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC27"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC29"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 3.4.3 <CODE>BZ2_bzReadGetUnused</CODE> </H3>
<!--docid::SEC28::-->
<TABLE><tr><td> </td><td class=example><pre> void BZ2_bzReadGetUnused ( int* bzerror, BZFILE *b,
void** unused, int* nUnused );
</pre></td></tr></table>Returns data which was read from the compressed file but was not needed
to get to the logical end-of-stream. <CODE>*unused</CODE> is set to the address
of the data, and <CODE>*nUnused</CODE> to the number of bytes. <CODE>*nUnused</CODE> will
be set to a value between <CODE>0</CODE> and <CODE>BZ_MAX_UNUSED</CODE> inclusive.
<P>
This function may only be called once <CODE>BZ2_bzRead</CODE> has signalled
<CODE>BZ_STREAM_END</CODE> but before <CODE>BZ2_bzReadClose</CODE>.
</P><P>
Possible assignments to <CODE>bzerror</CODE>:
<TABLE><tr><td> </td><td class=display><pre style="font-family: serif"> <CODE>BZ_PARAM_ERROR</CODE>
if <CODE>b</CODE> is <CODE>NULL</CODE>
or <CODE>unused</CODE> is <CODE>NULL</CODE> or <CODE>nUnused</CODE> is <CODE>NULL</CODE>
<CODE>BZ_SEQUENCE_ERROR</CODE>
if <CODE>BZ_STREAM_END</CODE> has not been signalled
or if <CODE>b</CODE> was opened with <CODE>BZ2_bzWriteOpen</CODE>
<CODE>BZ_OK</CODE>
otherwise
</pre></td></tr></table></P><P>
Allowable next actions:
<TABLE><tr><td> </td><td class=display><pre style="font-family: serif"> <CODE>BZ2_bzReadClose</CODE>
</pre></td></tr></table></P><P>
<HR SIZE="6">
<A NAME="SEC29"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC28"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC30"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 3.4.4 <CODE>BZ2_bzReadClose</CODE> </H3>
<!--docid::SEC29::-->
<TABLE><tr><td> </td><td class=example><pre> void BZ2_bzReadClose ( int *bzerror, BZFILE *b );
</pre></td></tr></table>Releases all memory pertaining to the compressed file <CODE>b</CODE>.
<CODE>BZ2_bzReadClose</CODE> does not call <CODE>fclose</CODE> on the underlying file
handle, so you should do that yourself if appropriate.
<CODE>BZ2_bzReadClose</CODE> should be called to clean up after all error
situations.
<P>
Possible assignments to <CODE>bzerror</CODE>:
<TABLE><tr><td> </td><td class=display><pre style="font-family: serif"> <CODE>BZ_SEQUENCE_ERROR</CODE>
if <CODE>b</CODE> was opened with <CODE>BZ2_bzOpenWrite</CODE>
<CODE>BZ_OK</CODE>
otherwise
</pre></td></tr></table></P><P>
Allowable next actions:
<TABLE><tr><td> </td><td class=display><pre style="font-family: serif"> none
</pre></td></tr></table></P><P>
<HR SIZE="6">
<A NAME="SEC30"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC29"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC31"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 3.4.5 <CODE>BZ2_bzWriteOpen</CODE> </H3>
<!--docid::SEC30::-->
<TABLE><tr><td> </td><td class=example><pre> BZFILE *BZ2_bzWriteOpen ( int *bzerror, FILE *f,
int blockSize100k, int verbosity,
int workFactor );
</pre></td></tr></table>Prepare to write compressed data to file handle <CODE>f</CODE>.
<CODE>f</CODE> should refer to
a file which has been opened for writing, and for which the error
indicator (<CODE>ferror(f)</CODE>)is not set.
<P>
For the meaning of parameters <CODE>blockSize100k</CODE>,
<CODE>verbosity</CODE> and <CODE>workFactor</CODE>, see
<BR> <CODE>BZ2_bzCompressInit</CODE>.
</P><P>
All required memory is allocated at this stage, so if the call
completes successfully, <CODE>BZ_MEM_ERROR</CODE> cannot be signalled by a
subsequent call to <CODE>BZ2_bzWrite</CODE>.
</P><P>
Possible assignments to <CODE>bzerror</CODE>:
<TABLE><tr><td> </td><td class=display><pre style="font-family: serif"> <CODE>BZ_CONFIG_ERROR</CODE>
if the library has been mis-compiled
<CODE>BZ_PARAM_ERROR</CODE>
if <CODE>f</CODE> is <CODE>NULL</CODE>
or <CODE>blockSize100k < 1</CODE> or <CODE>blockSize100k > 9</CODE>
<CODE>BZ_IO_ERROR</CODE>
if <CODE>ferror(f)</CODE> is nonzero
<CODE>BZ_MEM_ERROR</CODE>
if insufficient memory is available
<CODE>BZ_OK</CODE>
otherwise
</pre></td></tr></table></P><P>
Possible return values:
<TABLE><tr><td> </td><td class=display><pre style="font-family: serif"> Pointer to an abstract <CODE>BZFILE</CODE>
if <CODE>bzerror</CODE> is <CODE>BZ_OK</CODE>
<CODE>NULL</CODE>
otherwise
</pre></td></tr></table></P><P>
Allowable next actions:
<TABLE><tr><td> </td><td class=display><pre style="font-family: serif"> <CODE>BZ2_bzWrite</CODE>
if <CODE>bzerror</CODE> is <CODE>BZ_OK</CODE>
(you could go directly to <CODE>BZ2_bzWriteClose</CODE>, but this would be pretty pointless)
<CODE>BZ2_bzWriteClose</CODE>
otherwise
</pre></td></tr></table></P><P>
<HR SIZE="6">
<A NAME="SEC31"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC30"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC32"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 3.4.6 <CODE>BZ2_bzWrite</CODE> </H3>
<!--docid::SEC31::-->
<TABLE><tr><td> </td><td class=example><pre> void BZ2_bzWrite ( int *bzerror, BZFILE *b, void *buf, int len );
</pre></td></tr></table>Absorbs <CODE>len</CODE> bytes from the buffer <CODE>buf</CODE>, eventually to be
compressed and written to the file.
<P>
Possible assignments to <CODE>bzerror</CODE>:
<TABLE><tr><td> </td><td class=display><pre style="font-family: serif"> <CODE>BZ_PARAM_ERROR</CODE>
if <CODE>b</CODE> is <CODE>NULL</CODE> or <CODE>buf</CODE> is <CODE>NULL</CODE> or <CODE>len < 0</CODE>
<CODE>BZ_SEQUENCE_ERROR</CODE>
if b was opened with <CODE>BZ2_bzReadOpen</CODE>
<CODE>BZ_IO_ERROR</CODE>
if there is an error writing the compressed file.
<CODE>BZ_OK</CODE>
otherwise
</pre></td></tr></table></P><P>
<HR SIZE="6">
<A NAME="SEC32"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC31"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC33"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 3.4.7 <CODE>BZ2_bzWriteClose</CODE> </H3>
<!--docid::SEC32::-->
<TABLE><tr><td> </td><td class=example><pre> void BZ2_bzWriteClose ( int *bzerror, BZFILE* f,
int abandon,
unsigned int* nbytes_in,
unsigned int* nbytes_out );
void BZ2_bzWriteClose64 ( int *bzerror, BZFILE* f,
int abandon,
unsigned int* nbytes_in_lo32,
unsigned int* nbytes_in_hi32,
unsigned int* nbytes_out_lo32,
unsigned int* nbytes_out_hi32 );
</pre></td></tr></table><P>
Compresses and flushes to the compressed file all data so far supplied
by <CODE>BZ2_bzWrite</CODE>. The logical end-of-stream markers are also written, so
subsequent calls to <CODE>BZ2_bzWrite</CODE> are illegal. All memory associated
with the compressed file <CODE>b</CODE> is released.
<CODE>fflush</CODE> is called on the
compressed file, but it is not <CODE>fclose</CODE>'d.
</P><P>
If <CODE>BZ2_bzWriteClose</CODE> is called to clean up after an error, the only
action is to release the memory. The library records the error codes
issued by previous calls, so this situation will be detected
automatically. There is no attempt to complete the compression
operation, nor to <CODE>fflush</CODE> the compressed file. You can force this
behaviour to happen even in the case of no error, by passing a nonzero
value to <CODE>abandon</CODE>.
</P><P>
If <CODE>nbytes_in</CODE> is non-null, <CODE>*nbytes_in</CODE> will be set to be the
total volume of uncompressed data handled. Similarly, <CODE>nbytes_out</CODE>
will be set to the total volume of compressed data written. For
compatibility with older versions of the library, <CODE>BZ2_bzWriteClose</CODE>
only yields the lower 32 bits of these counts. Use
<CODE>BZ2_bzWriteClose64</CODE> if you want the full 64 bit counts. These
two functions are otherwise absolutely identical.
</P><P>
Possible assignments to <CODE>bzerror</CODE>:
<TABLE><tr><td> </td><td class=display><pre style="font-family: serif"> <CODE>BZ_SEQUENCE_ERROR</CODE>
if <CODE>b</CODE> was opened with <CODE>BZ2_bzReadOpen</CODE>
<CODE>BZ_IO_ERROR</CODE>
if there is an error writing the compressed file
<CODE>BZ_OK</CODE>
otherwise
</pre></td></tr></table></P><P>
<HR SIZE="6">
<A NAME="SEC33"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC32"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC34"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 3.4.8 Handling embedded compressed data streams </H3>
<!--docid::SEC33::-->
<P>
The high-level library facilitates use of
<CODE>bzip2</CODE> data streams which form some part of a surrounding, larger
data stream.
<UL>
<LI>For writing, the library takes an open file handle, writes
compressed data to it, <CODE>fflush</CODE>es it but does not <CODE>fclose</CODE> it.
The calling application can write its own data before and after the
compressed data stream, using that same file handle.
<LI>Reading is more complex, and the facilities are not as general
as they could be since generality is hard to reconcile with efficiency.
<CODE>BZ2_bzRead</CODE> reads from the compressed file in blocks of size
<CODE>BZ_MAX_UNUSED</CODE> bytes, and in doing so probably will overshoot
the logical end of compressed stream.
To recover this data once decompression has
ended, call <CODE>BZ2_bzReadGetUnused</CODE> after the last call of <CODE>BZ2_bzRead</CODE>
(the one returning <CODE>BZ_STREAM_END</CODE>) but before calling
<CODE>BZ2_bzReadClose</CODE>.
</UL>
<P>
This mechanism makes it easy to decompress multiple <CODE>bzip2</CODE>
streams placed end-to-end. As the end of one stream, when <CODE>BZ2_bzRead</CODE>
returns <CODE>BZ_STREAM_END</CODE>, call <CODE>BZ2_bzReadGetUnused</CODE> to collect the
unused data (copy it into your own buffer somewhere).
That data forms the start of the next compressed stream.
To start uncompressing that next stream, call <CODE>BZ2_bzReadOpen</CODE> again,
feeding in the unused data via the <CODE>unused</CODE>/<CODE>nUnused</CODE>
parameters.
Keep doing this until <CODE>BZ_STREAM_END</CODE> return coincides with the
physical end of file (<CODE>feof(f)</CODE>). In this situation
<CODE>BZ2_bzReadGetUnused</CODE>
will of course return no data.
</P><P>
This should give some feel for how the high-level interface can be used.
If you require extra flexibility, you'll have to bite the bullet and get
to grips with the low-level interface.
</P><P>
<HR SIZE="6">
<A NAME="SEC34"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC33"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC35"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 3.4.9 Standard file-reading/writing code </H3>
<!--docid::SEC34::-->
Here's how you'd write data to a compressed file:
<TABLE><tr><td> </td><td class=example><pre>FILE* f;
BZFILE* b;
int nBuf;
char buf[ /* whatever size you like */ ];
int bzerror;
int nWritten;
f = fopen ( "myfile.bz2", "w" );
if (!f) {
/* handle error */
}
b = BZ2_bzWriteOpen ( &bzerror, f, 9 );
if (bzerror != BZ_OK) {
BZ2_bzWriteClose ( b );
/* handle error */
}
while ( /* condition */ ) {
/* get data to write into buf, and set nBuf appropriately */
nWritten = BZ2_bzWrite ( &bzerror, b, buf, nBuf );
if (bzerror == BZ_IO_ERROR) {
BZ2_bzWriteClose ( &bzerror, b );
/* handle error */
}
}
BZ2_bzWriteClose ( &bzerror, b );
if (bzerror == BZ_IO_ERROR) {
/* handle error */
}
</pre></td></tr></table>And to read from a compressed file:
<TABLE><tr><td> </td><td class=example><pre>FILE* f;
BZFILE* b;
int nBuf;
char buf[ /* whatever size you like */ ];
int bzerror;
int nWritten;
f = fopen ( "myfile.bz2", "r" );
if (!f) {
/* handle error */
}
b = BZ2_bzReadOpen ( &bzerror, f, 0, NULL, 0 );
if (bzerror != BZ_OK) {
BZ2_bzReadClose ( &bzerror, b );
/* handle error */
}
bzerror = BZ_OK;
while (bzerror == BZ_OK && /* arbitrary other conditions */) {
nBuf = BZ2_bzRead ( &bzerror, b, buf, /* size of buf */ );
if (bzerror == BZ_OK) {
/* do something with buf[0 .. nBuf-1] */
}
}
if (bzerror != BZ_STREAM_END) {
BZ2_bzReadClose ( &bzerror, b );
/* handle error */
} else {
BZ2_bzReadClose ( &bzerror );
}
</pre></td></tr></table><P>
<HR SIZE="6">
<A NAME="SEC35"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC34"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC36"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 3.5 Utility functions </H2>
<!--docid::SEC35::-->
<HR SIZE="6">
<A NAME="SEC36"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC35"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC37"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 3.5.1 <CODE>BZ2_bzBuffToBuffCompress</CODE> </H3>
<!--docid::SEC36::-->
<TABLE><tr><td> </td><td class=example><pre> int BZ2_bzBuffToBuffCompress( char* dest,
unsigned int* destLen,
char* source,
unsigned int sourceLen,
int blockSize100k,
int verbosity,
int workFactor );
</pre></td></tr></table>Attempts to compress the data in <CODE>source[0 .. sourceLen-1]</CODE>
into the destination buffer, <CODE>dest[0 .. *destLen-1]</CODE>.
If the destination buffer is big enough, <CODE>*destLen</CODE> is
set to the size of the compressed data, and <CODE>BZ_OK</CODE> is
returned. If the compressed data won't fit, <CODE>*destLen</CODE>
is unchanged, and <CODE>BZ_OUTBUFF_FULL</CODE> is returned.
<P>
Compression in this manner is a one-shot event, done with a single call
to this function. The resulting compressed data is a complete
<CODE>bzip2</CODE> format data stream. There is no mechanism for making
additional calls to provide extra input data. If you want that kind of
mechanism, use the low-level interface.
</P><P>
For the meaning of parameters <CODE>blockSize100k</CODE>, <CODE>verbosity</CODE>
and <CODE>workFactor</CODE>, <BR> see <CODE>BZ2_bzCompressInit</CODE>.
</P><P>
To guarantee that the compressed data will fit in its buffer, allocate
an output buffer of size 1% larger than the uncompressed data, plus
six hundred extra bytes.
</P><P>
<CODE>BZ2_bzBuffToBuffDecompress</CODE> will not write data at or
beyond <CODE>dest[*destLen]</CODE>, even in case of buffer overflow.
</P><P>
Possible return values:
<TABLE><tr><td> </td><td class=display><pre style="font-family: serif"> <CODE>BZ_CONFIG_ERROR</CODE>
if the library has been mis-compiled
<CODE>BZ_PARAM_ERROR</CODE>
if <CODE>dest</CODE> is <CODE>NULL</CODE> or <CODE>destLen</CODE> is <CODE>NULL</CODE>
or <CODE>blockSize100k < 1</CODE> or <CODE>blockSize100k > 9</CODE>
or <CODE>verbosity < 0</CODE> or <CODE>verbosity > 4</CODE>
or <CODE>workFactor < 0</CODE> or <CODE>workFactor > 250</CODE>
<CODE>BZ_MEM_ERROR</CODE>
if insufficient memory is available
<CODE>BZ_OUTBUFF_FULL</CODE>
if the size of the compressed data exceeds <CODE>*destLen</CODE>
<CODE>BZ_OK</CODE>
otherwise
</pre></td></tr></table></P><P>
<HR SIZE="6">
<A NAME="SEC37"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC36"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC38"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 3.5.2 <CODE>BZ2_bzBuffToBuffDecompress</CODE> </H3>
<!--docid::SEC37::-->
<TABLE><tr><td> </td><td class=example><pre> int BZ2_bzBuffToBuffDecompress ( char* dest,
unsigned int* destLen,
char* source,
unsigned int sourceLen,
int small,
int verbosity );
</pre></td></tr></table>Attempts to decompress the data in <CODE>source[0 .. sourceLen-1]</CODE>
into the destination buffer, <CODE>dest[0 .. *destLen-1]</CODE>.
If the destination buffer is big enough, <CODE>*destLen</CODE> is
set to the size of the uncompressed data, and <CODE>BZ_OK</CODE> is
returned. If the compressed data won't fit, <CODE>*destLen</CODE>
is unchanged, and <CODE>BZ_OUTBUFF_FULL</CODE> is returned.
<P>
<CODE>source</CODE> is assumed to hold a complete <CODE>bzip2</CODE> format
data stream. <BR> <CODE>BZ2_bzBuffToBuffDecompress</CODE> tries to decompress
the entirety of the stream into the output buffer.
</P><P>
For the meaning of parameters <CODE>small</CODE> and <CODE>verbosity</CODE>,
see <CODE>BZ2_bzDecompressInit</CODE>.
</P><P>
Because the compression ratio of the compressed data cannot be known in
advance, there is no easy way to guarantee that the output buffer will
be big enough. You may of course make arrangements in your code to
record the size of the uncompressed data, but such a mechanism is beyond
the scope of this library.
</P><P>
<CODE>BZ2_bzBuffToBuffDecompress</CODE> will not write data at or
beyond <CODE>dest[*destLen]</CODE>, even in case of buffer overflow.
</P><P>
Possible return values:
<TABLE><tr><td> </td><td class=display><pre style="font-family: serif"> <CODE>BZ_CONFIG_ERROR</CODE>
if the library has been mis-compiled
<CODE>BZ_PARAM_ERROR</CODE>
if <CODE>dest</CODE> is <CODE>NULL</CODE> or <CODE>destLen</CODE> is <CODE>NULL</CODE>
or <CODE>small != 0 && small != 1</CODE>
or <CODE>verbosity < 0</CODE> or <CODE>verbosity > 4</CODE>
<CODE>BZ_MEM_ERROR</CODE>
if insufficient memory is available
<CODE>BZ_OUTBUFF_FULL</CODE>
if the size of the compressed data exceeds <CODE>*destLen</CODE>
<CODE>BZ_DATA_ERROR</CODE>
if a data integrity error was detected in the compressed data
<CODE>BZ_DATA_ERROR_MAGIC</CODE>
if the compressed data doesn't begin with the right magic bytes
<CODE>BZ_UNEXPECTED_EOF</CODE>
if the compressed data ends unexpectedly
<CODE>BZ_OK</CODE>
otherwise
</pre></td></tr></table></P><P>
<HR SIZE="6">
<A NAME="SEC38"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC37"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC39"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 3.6 <CODE>zlib</CODE> compatibility functions </H2>
<!--docid::SEC38::-->
Yoshioka Tsuneo has contributed some functions to
give better <CODE>zlib</CODE> compatibility. These functions are
<CODE>BZ2_bzopen</CODE>, <CODE>BZ2_bzread</CODE>, <CODE>BZ2_bzwrite</CODE>, <CODE>BZ2_bzflush</CODE>,
<CODE>BZ2_bzclose</CODE>,
<CODE>BZ2_bzerror</CODE> and <CODE>BZ2_bzlibVersion</CODE>.
These functions are not (yet) officially part of
the library. If they break, you get to keep all the pieces.
Nevertheless, I think they work ok.
<TABLE><tr><td> </td><td class=example><pre>typedef void BZFILE;
const char * BZ2_bzlibVersion ( void );
</pre></td></tr></table>Returns a string indicating the library version.
<TABLE><tr><td> </td><td class=example><pre>BZFILE * BZ2_bzopen ( const char *path, const char *mode );
BZFILE * BZ2_bzdopen ( int fd, const char *mode );
</pre></td></tr></table>Opens a <CODE>.bz2</CODE> file for reading or writing, using either its name
or a pre-existing file descriptor.
Analogous to <CODE>fopen</CODE> and <CODE>fdopen</CODE>.
<TABLE><tr><td> </td><td class=example><pre>int BZ2_bzread ( BZFILE* b, void* buf, int len );
int BZ2_bzwrite ( BZFILE* b, void* buf, int len );
</pre></td></tr></table>Reads/writes data from/to a previously opened <CODE>BZFILE</CODE>.
Analogous to <CODE>fread</CODE> and <CODE>fwrite</CODE>.
<TABLE><tr><td> </td><td class=example><pre>int BZ2_bzflush ( BZFILE* b );
void BZ2_bzclose ( BZFILE* b );
</pre></td></tr></table>Flushes/closes a <CODE>BZFILE</CODE>. <CODE>BZ2_bzflush</CODE> doesn't actually do
anything. Analogous to <CODE>fflush</CODE> and <CODE>fclose</CODE>.
<P>
<TABLE><tr><td> </td><td class=example><pre>const char * BZ2_bzerror ( BZFILE *b, int *errnum )
</pre></td></tr></table>Returns a string describing the more recent error status of
<CODE>b</CODE>, and also sets <CODE>*errnum</CODE> to its numerical value.
</P><P>
<HR SIZE="6">
<A NAME="SEC39"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC38"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC40"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 3.7 Using the library in a <CODE>stdio</CODE>-free environment </H2>
<!--docid::SEC39::-->
<P>
<HR SIZE="6">
<A NAME="SEC40"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC39"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC41"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 3.7.1 Getting rid of <CODE>stdio</CODE> </H3>
<!--docid::SEC40::-->
<P>
In a deeply embedded application, you might want to use just
the memory-to-memory functions. You can do this conveniently
by compiling the library with preprocessor symbol <CODE>BZ_NO_STDIO</CODE>
defined. Doing this gives you a library containing only the following
eight functions:
</P><P>
<CODE>BZ2_bzCompressInit</CODE>, <CODE>BZ2_bzCompress</CODE>, <CODE>BZ2_bzCompressEnd</CODE> <BR>
<CODE>BZ2_bzDecompressInit</CODE>, <CODE>BZ2_bzDecompress</CODE>, <CODE>BZ2_bzDecompressEnd</CODE> <BR>
<CODE>BZ2_bzBuffToBuffCompress</CODE>, <CODE>BZ2_bzBuffToBuffDecompress</CODE>
</P><P>
When compiled like this, all functions will ignore <CODE>verbosity</CODE>
settings.
</P><P>
<HR SIZE="6">
<A NAME="SEC41"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC40"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC42"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 3.7.2 Critical error handling </H3>
<!--docid::SEC41::-->
<CODE>libbzip2</CODE> contains a number of internal assertion checks which
should, needless to say, never be activated. Nevertheless, if an
assertion should fail, behaviour depends on whether or not the library
was compiled with <CODE>BZ_NO_STDIO</CODE> set.
<P>
For a normal compile, an assertion failure yields the message
<TABLE><tr><td> </td><td class=example><pre> bzip2/libbzip2: internal error number N.
This is a bug in bzip2/libbzip2, 1.0.2, 30-Dec-2001.
Please report it to me at: jseward@acm.org. If this happened
when you were using some program which uses libbzip2 as a
component, you should also report this bug to the author(s)
of that program. Please make an effort to report this bug;
timely and accurate bug reports eventually lead to higher
quality software. Thanks. Julian Seward, 30 December 2001.
</pre></td></tr></table>where <CODE>N</CODE> is some error code number. If <CODE>N == 1007</CODE>, it also
prints some extra text advising the reader that unreliable memory is
often associated with internal error 1007. (This is a
frequently-observed-phenomenon with versions 1.0.0/1.0.1).
</P><P>
<CODE>exit(3)</CODE> is then called.
</P><P>
For a <CODE>stdio</CODE>-free library, assertion failures result
in a call to a function declared as:
<TABLE><tr><td> </td><td class=example><pre> extern void bz_internal_error ( int errcode );
</pre></td></tr></table>The relevant code is passed as a parameter. You should supply
such a function.
</P><P>
In either case, once an assertion failure has occurred, any
<CODE>bz_stream</CODE> records involved can be regarded as invalid.
You should not attempt to resume normal operation with them.
</P><P>
You may, of course, change critical error handling to suit
your needs. As I said above, critical errors indicate bugs
in the library and should not occur. All "normal" error
situations are indicated via error return codes from functions,
and can be recovered from.
</P><P>
<HR SIZE="6">
<A NAME="SEC42"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC41"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_4.html#SEC43"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 3.8 Making a Windows DLL </H2>
<!--docid::SEC42::-->
Everything related to Windows has been contributed by Yoshioka Tsuneo
<BR> (<CODE>QWF00133@niftyserve.or.jp</CODE> /
<CODE>tsuneo-y@is.aist-nara.ac.jp</CODE>), so you should send your queries to
him (but perhaps Cc: me, <CODE>jseward@acm.org</CODE>).
<P>
My vague understanding of what to do is: using Visual C++ 5.0,
open the project file <CODE>libbz2.dsp</CODE>, and build. That's all.
</P><P>
If you can't
open the project file for some reason, make a new one, naming these files:
<CODE>blocksort.c</CODE>, <CODE>bzlib.c</CODE>, <CODE>compress.c</CODE>,
<CODE>crctable.c</CODE>, <CODE>decompress.c</CODE>, <CODE>huffman.c</CODE>, <BR>
<CODE>randtable.c</CODE> and <CODE>libbz2.def</CODE>. You will also need
to name the header files <CODE>bzlib.h</CODE> and <CODE>bzlib_private.h</CODE>.
</P><P>
If you don't use VC++, you may need to define the proprocessor symbol
<CODE>_WIN32</CODE>.
</P><P>
Finally, <CODE>dlltest.c</CODE> is a sample program using the DLL. It has a
project file, <CODE>dlltest.dsp</CODE>.
</P><P>
If you just want a makefile for Visual C, have a look at
<CODE>makefile.msc</CODE>.
</P><P>
Be aware that if you compile <CODE>bzip2</CODE> itself on Win32, you must set
<CODE>BZ_UNIX</CODE> to 0 and <CODE>BZ_LCCWIN32</CODE> to 1, in the file
<CODE>bzip2.c</CODE>, before compiling. Otherwise the resulting binary won't
work correctly.
</P><P>
I haven't tried any of this stuff myself, but it all looks plausible.
</P><P>
<HR SIZE="6">
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<BR>
<FONT SIZE="-1">
This document was generated
by <I>Julian Seward</I> on <I>January, 5 2002</I>
using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
"><I>texi2html</I></A>
</BODY>
</HTML>
|
Added work/src/bzip2-1.0.2/manual_4.html.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
|
<HTML>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- Created on January, 5 2002 by texi2html 1.64 -->
<!--
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
Karl Berry <karl@freefriends.org>
Olaf Bachmann <obachman@mathematik.uni-kl.de>
and many others.
Maintained by: Olaf Bachmann <obachman@mathematik.uni-kl.de>
Send bugs and suggestions to <texi2html@mathematik.uni-kl.de>
-->
<HEAD>
<TITLE>Untitled Document: 4. Miscellanea</TITLE>
<META NAME="description" CONTENT="Untitled Document: 4. Miscellanea">
<META NAME="keywords" CONTENT="Untitled Document: 4. Miscellanea">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META NAME="Generator" CONTENT="texi2html 1.64">
</HEAD>
<BODY LANG="" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">
<A NAME="SEC43"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_3.html#SEC42"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_4.html#SEC44"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H1> 4. Miscellanea </H1>
<!--docid::SEC43::-->
<P>
These are just some random thoughts of mine. Your mileage may
vary.
</P><P>
<HR SIZE="6">
<A NAME="SEC44"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_4.html#SEC43"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_4.html#SEC45"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 4.1 Limitations of the compressed file format </H2>
<!--docid::SEC44::-->
<CODE>bzip2-1.0</CODE>, <CODE>0.9.5</CODE> and <CODE>0.9.0</CODE>
use exactly the same file format as the previous
version, <CODE>bzip2-0.1</CODE>. This decision was made in the interests of
stability. Creating yet another incompatible compressed file format
would create further confusion and disruption for users.
<P>
Nevertheless, this is not a painless decision. Development
work since the release of <CODE>bzip2-0.1</CODE> in August 1997
has shown complexities in the file format which slow down
decompression and, in retrospect, are unnecessary. These are:
<UL>
<LI>The run-length encoder, which is the first of the
compression transformations, is entirely irrelevant.
The original purpose was to protect the sorting algorithm
from the very worst case input: a string of repeated
symbols. But algorithm steps Q6a and Q6b in the original
Burrows-Wheeler technical report (SRC-124) show how
repeats can be handled without difficulty in block
sorting.
<LI>The randomisation mechanism doesn't really need to be
there. Udi Manber and Gene Myers published a suffix
array construction algorithm a few years back, which
can be employed to sort any block, no matter how
repetitive, in O(N log N) time. Subsequent work by
Kunihiko Sadakane has produced a derivative O(N (log N)^2)
algorithm which usually outperforms the Manber-Myers
algorithm.
<P>
I could have changed to Sadakane's algorithm, but I find
it to be slower than <CODE>bzip2</CODE>'s existing algorithm for
most inputs, and the randomisation mechanism protects
adequately against bad cases. I didn't think it was
a good tradeoff to make. Partly this is due to the fact
that I was not flooded with email complaints about
<CODE>bzip2-0.1</CODE>'s performance on repetitive data, so
perhaps it isn't a problem for real inputs.
</P><P>
Probably the best long-term solution,
and the one I have incorporated into 0.9.5 and above,
is to use the existing sorting
algorithm initially, and fall back to a O(N (log N)^2)
algorithm if the standard algorithm gets into difficulties.
<LI>The compressed file format was never designed to be
handled by a library, and I have had to jump though
some hoops to produce an efficient implementation of
decompression. It's a bit hairy. Try passing
<CODE>decompress.c</CODE> through the C preprocessor
and you'll see what I mean. Much of this complexity
could have been avoided if the compressed size of
each block of data was recorded in the data stream.
<LI>An Adler-32 checksum, rather than a CRC32 checksum,
would be faster to compute.
</UL>
It would be fair to say that the <CODE>bzip2</CODE> format was frozen
before I properly and fully understood the performance
consequences of doing so.
<P>
Improvements which I was able to incorporate into
0.9.0, despite using the same file format, are:
<UL>
<LI>Single array implementation of the inverse BWT. This
significantly speeds up decompression, presumably
because it reduces the number of cache misses.
<LI>Faster inverse MTF transform for large MTF values. The
new implementation is based on the notion of sliding blocks
of values.
<LI><CODE>bzip2-0.9.0</CODE> now reads and writes files with <CODE>fread</CODE>
and <CODE>fwrite</CODE>; version 0.1 used <CODE>putc</CODE> and <CODE>getc</CODE>.
Duh! Well, you live and learn.
<P>
</UL>
Further ahead, it would be nice
to be able to do random access into files. This will
require some careful design of compressed file formats.
<P>
<HR SIZE="6">
<A NAME="SEC45"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_4.html#SEC44"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_4.html#SEC46"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 4.2 Portability issues </H2>
<!--docid::SEC45::-->
After some consideration, I have decided not to use
GNU <CODE>autoconf</CODE> to configure 0.9.5 or 1.0.
<P>
<CODE>autoconf</CODE>, admirable and wonderful though it is,
mainly assists with portability problems between Unix-like
platforms. But <CODE>bzip2</CODE> doesn't have much in the way
of portability problems on Unix; most of the difficulties appear
when porting to the Mac, or to Microsoft's operating systems.
<CODE>autoconf</CODE> doesn't help in those cases, and brings in a
whole load of new complexity.
</P><P>
Most people should be able to compile the library and program
under Unix straight out-of-the-box, so to speak, especially
if you have a version of GNU C available.
</P><P>
There are a couple of <CODE>__inline__</CODE> directives in the code. GNU C
(<CODE>gcc</CODE>) should be able to handle them. If you're not using
GNU C, your C compiler shouldn't see them at all.
If your compiler does, for some reason, see them and doesn't
like them, just <CODE>#define</CODE> <CODE>__inline__</CODE> to be <CODE>/* */</CODE>. One
easy way to do this is to compile with the flag <CODE>-D__inline__=</CODE>,
which should be understood by most Unix compilers.
</P><P>
If you still have difficulties, try compiling with the macro
<CODE>BZ_STRICT_ANSI</CODE> defined. This should enable you to build the
library in a strictly ANSI compliant environment. Building the program
itself like this is dangerous and not supported, since you remove
<CODE>bzip2</CODE>'s checks against compressing directories, symbolic links,
devices, and other not-really-a-file entities. This could cause
filesystem corruption!
</P><P>
One other thing: if you create a <CODE>bzip2</CODE> binary for public
distribution, please try and link it statically (<CODE>gcc -s</CODE>). This
avoids all sorts of library-version issues that others may encounter
later on.
</P><P>
If you build <CODE>bzip2</CODE> on Win32, you must set <CODE>BZ_UNIX</CODE> to 0 and
<CODE>BZ_LCCWIN32</CODE> to 1, in the file <CODE>bzip2.c</CODE>, before compiling.
Otherwise the resulting binary won't work correctly.
</P><P>
<HR SIZE="6">
<A NAME="SEC46"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_4.html#SEC45"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_4.html#SEC47"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 4.3 Reporting bugs </H2>
<!--docid::SEC46::-->
I tried pretty hard to make sure <CODE>bzip2</CODE> is
bug free, both by design and by testing. Hopefully
you'll never need to read this section for real.
<P>
Nevertheless, if <CODE>bzip2</CODE> dies with a segmentation
fault, a bus error or an internal assertion failure, it
will ask you to email me a bug report. Experience with
version 0.1 shows that almost all these problems can
be traced to either compiler bugs or hardware problems.
<UL>
<LI>
Recompile the program with no optimisation, and see if it
works. And/or try a different compiler.
I heard all sorts of stories about various flavours
of GNU C (and other compilers) generating bad code for
<CODE>bzip2</CODE>, and I've run across two such examples myself.
<P>
2.7.X versions of GNU C are known to generate bad code from
time to time, at high optimisation levels.
If you get problems, try using the flags
<CODE>-O2</CODE> <CODE>-fomit-frame-pointer</CODE> <CODE>-fno-strength-reduce</CODE>.
You should specifically <EM>not</EM> use <CODE>-funroll-loops</CODE>.
</P><P>
You may notice that the Makefile runs six tests as part of
the build process. If the program passes all of these, it's
a pretty good (but not 100%) indication that the compiler has
done its job correctly.
<LI>
If <CODE>bzip2</CODE> crashes randomly, and the crashes are not
repeatable, you may have a flaky memory subsystem. <CODE>bzip2</CODE>
really hammers your memory hierarchy, and if it's a bit marginal,
you may get these problems. Ditto if your disk or I/O subsystem
is slowly failing. Yup, this really does happen.
<P>
Try using a different machine of the same type, and see if
you can repeat the problem.
<LI>This isn't really a bug, but ... If <CODE>bzip2</CODE> tells
you your file is corrupted on decompression, and you
obtained the file via FTP, there is a possibility that you
forgot to tell FTP to do a binary mode transfer. That absolutely
will cause the file to be non-decompressible. You'll have to transfer
it again.
</UL>
<P>
If you've incorporated <CODE>libbzip2</CODE> into your own program
and are getting problems, please, please, please, check that the
parameters you are passing in calls to the library, are
correct, and in accordance with what the documentation says
is allowable. I have tried to make the library robust against
such problems, but I'm sure I haven't succeeded.
</P><P>
Finally, if the above comments don't help, you'll have to send
me a bug report. Now, it's just amazing how many people will
send me a bug report saying something like
<TABLE><tr><td> </td><td class=display><pre style="font-family: serif"> bzip2 crashed with segmentation fault on my machine
</pre></td></tr></table>and absolutely nothing else. Needless to say, a such a report
is <EM>totally, utterly, completely and comprehensively 100% useless;
a waste of your time, my time, and net bandwidth</EM>.
With no details at all, there's no way I can possibly begin
to figure out what the problem is.
</P><P>
The rules of the game are: facts, facts, facts. Don't omit
them because "oh, they won't be relevant". At the bare
minimum:
<TABLE><tr><td> </td><td class=display><pre style="font-family: serif"> Machine type. Operating system version.
Exact version of <CODE>bzip2</CODE> (do <CODE>bzip2 -V</CODE>).
Exact version of the compiler used.
Flags passed to the compiler.
</pre></td></tr></table>However, the most important single thing that will help me is
the file that you were trying to compress or decompress at the
time the problem happened. Without that, my ability to do anything
more than speculate about the cause, is limited.
</P><P>
Please remember that I connect to the Internet with a modem, so
you should contact me before mailing me huge files.
</P><P>
<HR SIZE="6">
<A NAME="SEC47"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_4.html#SEC46"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_4.html#SEC48"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 4.4 Did you get the right package? </H2>
<!--docid::SEC47::-->
<P>
<CODE>bzip2</CODE> is a resource hog. It soaks up large amounts of CPU cycles
and memory. Also, it gives very large latencies. In the worst case, you
can feed many megabytes of uncompressed data into the library before
getting any compressed output, so this probably rules out applications
requiring interactive behaviour.
</P><P>
These aren't faults of my implementation, I hope, but more
an intrinsic property of the Burrows-Wheeler transform (unfortunately).
Maybe this isn't what you want.
</P><P>
If you want a compressor and/or library which is faster, uses less
memory but gets pretty good compression, and has minimal latency,
consider Jean-loup
Gailly's and Mark Adler's work, <CODE>zlib-1.1.3</CODE> and
<CODE>gzip-1.2.4</CODE>. Look for them at
</P><P>
<CODE>http://www.zlib.org</CODE> and
<CODE>http://www.gzip.org</CODE> respectively.
</P><P>
For something faster and lighter still, you might try Markus F X J
Oberhumer's <CODE>LZO</CODE> real-time compression/decompression library, at
<BR> <CODE>http://wildsau.idv.uni-linz.ac.at/mfx/lzo.html</CODE>.
</P><P>
If you want to use the <CODE>bzip2</CODE> algorithms to compress small blocks
of data, 64k bytes or smaller, for example on an on-the-fly disk
compressor, you'd be well advised not to use this library. Instead,
I've made a special library tuned for that kind of use. It's part of
<CODE>e2compr-0.40</CODE>, an on-the-fly disk compressor for the Linux
<CODE>ext2</CODE> filesystem. Look at
<CODE>http://www.netspace.net.au/~reiter/e2compr</CODE>.
</P><P>
<HR SIZE="6">
<A NAME="SEC48"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_4.html#SEC47"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_4.html#SEC49"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 4.5 Testing </H2>
<!--docid::SEC48::-->
<P>
A record of the tests I've done.
</P><P>
First, some data sets:
<UL>
<LI>B: a directory containing 6001 files, one for every length in the
range 0 to 6000 bytes. The files contain random lowercase
letters. 18.7 megabytes.
<LI>H: my home directory tree. Documents, source code, mail files,
compressed data. H contains B, and also a directory of
files designed as boundary cases for the sorting; mostly very
repetitive, nasty files. 565 megabytes.
<LI>A: directory tree holding various applications built from source:
<CODE>egcs</CODE>, <CODE>gcc-2.8.1</CODE>, KDE, GTK, Octave, etc.
2200 megabytes.
</UL>
The tests conducted are as follows. Each test means compressing
(a copy of) each file in the data set, decompressing it and
comparing it against the original.
<P>
First, a bunch of tests with block sizes and internal buffer
sizes set very small,
to detect any problems with the
blocking and buffering mechanisms.
This required modifying the source code so as to try to
break it.
<OL>
<LI>Data set H, with
buffer size of 1 byte, and block size of 23 bytes.
<LI>Data set B, buffer sizes 1 byte, block size 1 byte.
<LI>As (2) but small-mode decompression.
<LI>As (2) with block size 2 bytes.
<LI>As (2) with block size 3 bytes.
<LI>As (2) with block size 4 bytes.
<LI>As (2) with block size 5 bytes.
<LI>As (2) with block size 6 bytes and small-mode decompression.
<LI>H with buffer size of 1 byte, but normal block
size (up to 900000 bytes).
</OL>
Then some tests with unmodified source code.
<OL>
<LI>H, all settings normal.
<LI>As (1), with small-mode decompress.
<LI>H, compress with flag <CODE>-1</CODE>.
<LI>H, compress with flag <CODE>-s</CODE>, decompress with flag <CODE>-s</CODE>.
<LI>Forwards compatibility: H, <CODE>bzip2-0.1pl2</CODE> compressing,
<CODE>bzip2-0.9.5</CODE> decompressing, all settings normal.
<LI>Backwards compatibility: H, <CODE>bzip2-0.9.5</CODE> compressing,
<CODE>bzip2-0.1pl2</CODE> decompressing, all settings normal.
<LI>Bigger tests: A, all settings normal.
<LI>As (7), using the fallback (Sadakane-like) sorting algorithm.
<LI>As (8), compress with flag <CODE>-1</CODE>, decompress with flag
<CODE>-s</CODE>.
<LI>H, using the fallback sorting algorithm.
<LI>Forwards compatibility: A, <CODE>bzip2-0.1pl2</CODE> compressing,
<CODE>bzip2-0.9.5</CODE> decompressing, all settings normal.
<LI>Backwards compatibility: A, <CODE>bzip2-0.9.5</CODE> compressing,
<CODE>bzip2-0.1pl2</CODE> decompressing, all settings normal.
<LI>Misc test: about 400 megabytes of <CODE>.tar</CODE> files with
<CODE>bzip2</CODE> compiled with Checker (a memory access error
detector, like Purify).
<LI>Misc tests to make sure it builds and runs ok on non-Linux/x86
platforms.
</OL>
These tests were conducted on a 225 MHz IDT WinChip machine, running
Linux 2.0.36. They represent nearly a week of continuous computation.
All tests completed successfully.
<P>
<HR SIZE="6">
<A NAME="SEC49"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_4.html#SEC48"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ > ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 4.6 Further reading </H2>
<!--docid::SEC49::-->
<CODE>bzip2</CODE> is not research work, in the sense that it doesn't present
any new ideas. Rather, it's an engineering exercise based on existing
ideas.
<P>
Four documents describe essentially all the ideas behind <CODE>bzip2</CODE>:
<TABLE><tr><td> </td><td class=example><pre>Michael Burrows and D. J. Wheeler:
"A block-sorting lossless data compression algorithm"
10th May 1994.
Digital SRC Research Report 124.
ftp://ftp.digital.com/pub/DEC/SRC/research-reports/SRC-124.ps.gz
If you have trouble finding it, try searching at the
New Zealand Digital Library, http://www.nzdl.org.
Daniel S. Hirschberg and Debra A. LeLewer
"Efficient Decoding of Prefix Codes"
Communications of the ACM, April 1990, Vol 33, Number 4.
You might be able to get an electronic copy of this
from the ACM Digital Library.
David J. Wheeler
Program bred3.c and accompanying document bred3.ps.
This contains the idea behind the multi-table Huffman
coding scheme.
ftp://ftp.cl.cam.ac.uk/users/djw3/
Jon L. Bentley and Robert Sedgewick
"Fast Algorithms for Sorting and Searching Strings"
Available from Sedgewick's web page,
www.cs.princeton.edu/~rs
</pre></td></tr></table>The following paper gives valuable additional insights into the
algorithm, but is not immediately the basis of any code
used in bzip2.
<TABLE><tr><td> </td><td class=example><pre>Peter Fenwick:
Block Sorting Text Compression
Proceedings of the 19th Australasian Computer Science Conference,
Melbourne, Australia. Jan 31 - Feb 2, 1996.
ftp://ftp.cs.auckland.ac.nz/pub/peter-f/ACSC96paper.ps
</pre></td></tr></table>Kunihiko Sadakane's sorting algorithm, mentioned above,
is available from:
<TABLE><tr><td> </td><td class=example><pre>http://naomi.is.s.u-tokyo.ac.jp/~sada/papers/Sada98b.ps.gz
</pre></td></tr></table>The Manber-Myers suffix array construction
algorithm is described in a paper
available from:
<TABLE><tr><td> </td><td class=example><pre>http://www.cs.arizona.edu/people/gene/PAPERS/suffix.ps
</pre></td></tr></table>Finally, the following paper documents some recent investigations
I made into the performance of sorting algorithms:
<TABLE><tr><td> </td><td class=example><pre>Julian Seward:
On the Performance of BWT Sorting Algorithms
Proceedings of the IEEE Data Compression Conference 2000
Snowbird, Utah. 28-30 March 2000.
</pre></td></tr></table></P><P>
<HR SIZE="6">
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<BR>
<FONT SIZE="-1">
This document was generated
by <I>Julian Seward</I> on <I>January, 5 2002</I>
using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
"><I>texi2html</I></A>
</BODY>
</HTML>
|
Added work/src/bzip2-1.0.2/manual_abt.html.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
|
<HTML>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- Created on January, 5 2002 by texi2html 1.64 -->
<!--
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
Karl Berry <karl@freefriends.org>
Olaf Bachmann <obachman@mathematik.uni-kl.de>
and many others.
Maintained by: Olaf Bachmann <obachman@mathematik.uni-kl.de>
Send bugs and suggestions to <texi2html@mathematik.uni-kl.de>
-->
<HEAD>
<TITLE>Untitled Document: About this document</TITLE>
<META NAME="description" CONTENT="Untitled Document: About this document">
<META NAME="keywords" CONTENT="Untitled Document: About this document">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META NAME="Generator" CONTENT="texi2html 1.64">
</HEAD>
<BODY LANG="" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">
<A NAME="SEC_About"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H1>About this document</H1>
This document was generated by <I>Julian Seward</I> on <I>January, 5 2002</I>
using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
"><I>texi2html</I></A>
<P></P>
The buttons in the navigation panels have the following meaning:
<P></P>
<table border = "1">
<TR>
<TH> Button </TH>
<TH> Name </TH>
<TH> Go to </TH>
<TH> From 1.2.3 go to</TH>
</TR>
<TR>
<TD ALIGN="CENTER">
[ < ] </TD>
<TD ALIGN="CENTER">
Back
</TD>
<TD>
previous section in reading order
</TD>
<TD>
1.2.2
</TD>
</TR>
<TR>
<TD ALIGN="CENTER">
[ > ] </TD>
<TD ALIGN="CENTER">
Forward
</TD>
<TD>
next section in reading order
</TD>
<TD>
1.2.4
</TD>
</TR>
<TR>
<TD ALIGN="CENTER">
[ << ] </TD>
<TD ALIGN="CENTER">
FastBack
</TD>
<TD>
previous or up-and-previous section
</TD>
<TD>
1.1
</TD>
</TR>
<TR>
<TD ALIGN="CENTER">
[ Up ] </TD>
<TD ALIGN="CENTER">
Up
</TD>
<TD>
up section
</TD>
<TD>
1.2
</TD>
</TR>
<TR>
<TD ALIGN="CENTER">
[ >> ] </TD>
<TD ALIGN="CENTER">
FastForward
</TD>
<TD>
next or up-and-next section
</TD>
<TD>
1.3
</TD>
</TR>
<TR>
<TD ALIGN="CENTER">
[Top] </TD>
<TD ALIGN="CENTER">
Top
</TD>
<TD>
cover (top) of document
</TD>
<TD>
</TD>
</TR>
<TR>
<TD ALIGN="CENTER">
[Contents] </TD>
<TD ALIGN="CENTER">
Contents
</TD>
<TD>
table of contents
</TD>
<TD>
</TD>
</TR>
<TR>
<TD ALIGN="CENTER">
[Index] </TD>
<TD ALIGN="CENTER">
Index
</TD>
<TD>
concept index
</TD>
<TD>
</TD>
</TR>
<TR>
<TD ALIGN="CENTER">
[ ? ] </TD>
<TD ALIGN="CENTER">
About
</TD>
<TD>
this page
</TD>
<TD>
</TD>
</TR>
</TABLE>
<P></P>
where the <STRONG> Example </STRONG> assumes that the current position
is at <STRONG> Subsubsection One-Two-Three </STRONG> of a document of
the following structure:
<UL>
<LI> 1. Section One </LI>
<UL>
<LI>1.1 Subsection One-One</LI>
<UL>
<LI> ... </LI>
</UL>
<LI>1.2 Subsection One-Two</LI>
<UL>
<LI>1.2.1 Subsubsection One-Two-One
</LI><LI>1.2.2 Subsubsection One-Two-Two
</LI><LI>1.2.3 Subsubsection One-Two-Three <STRONG>
<== Current Position </STRONG>
</LI><LI>1.2.4 Subsubsection One-Two-Four
</LI></UL>
<LI>1.3 Subsection One-Three</LI>
<UL>
<LI> ... </LI>
</UL>
<LI>1.4 Subsection One-Four</LI>
</UL>
</UL>
<HR SIZE=1>
<BR>
<FONT SIZE="-1">
This document was generated
by <I>Julian Seward</I> on <I>January, 5 2002</I>
using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
"><I>texi2html</I></A>
</BODY>
</HTML>
|
Added work/src/bzip2-1.0.2/manual_ovr.html.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
<HTML>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- Created on January, 5 2002 by texi2html 1.64 -->
<!--
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
Karl Berry <karl@freefriends.org>
Olaf Bachmann <obachman@mathematik.uni-kl.de>
and many others.
Maintained by: Olaf Bachmann <obachman@mathematik.uni-kl.de>
Send bugs and suggestions to <texi2html@mathematik.uni-kl.de>
-->
<HEAD>
<TITLE>Untitled Document: Short Table of Contents</TITLE>
<META NAME="description" CONTENT="Untitled Document: Short Table of Contents">
<META NAME="keywords" CONTENT="Untitled Document: Short Table of Contents">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META NAME="Generator" CONTENT="texi2html 1.64">
</HEAD>
<BODY LANG="" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">
<A NAME="SEC_OVERVIEW"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H1>Short Table of Contents</H1>
<BLOCKQUOTE>
<A NAME="TOC1" HREF="manual_1.html#SEC1">1. Introduction</A>
<BR>
<A NAME="TOC2" HREF="manual_2.html#SEC2">2. How to use <CODE>bzip2</CODE></A>
<BR>
<A NAME="TOC12" HREF="manual_3.html#SEC12">3. Programming with <CODE>libbzip2</CODE></A>
<BR>
<A NAME="TOC43" HREF="manual_4.html#SEC43">4. Miscellanea</A>
<BR>
</BLOCKQUOTE>
<HR SIZE=1>
<BR>
<FONT SIZE="-1">
This document was generated
by <I>Julian Seward</I> on <I>January, 5 2002</I>
using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
"><I>texi2html</I></A>
</BODY>
</HTML>
|
Added work/src/bzip2-1.0.2/manual_toc.html.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
|
<HTML>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- Created on January, 5 2002 by texi2html 1.64 -->
<!--
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
Karl Berry <karl@freefriends.org>
Olaf Bachmann <obachman@mathematik.uni-kl.de>
and many others.
Maintained by: Olaf Bachmann <obachman@mathematik.uni-kl.de>
Send bugs and suggestions to <texi2html@mathematik.uni-kl.de>
-->
<HEAD>
<TITLE>Untitled Document: Table of Contents</TITLE>
<META NAME="description" CONTENT="Untitled Document: Table of Contents">
<META NAME="keywords" CONTENT="Untitled Document: Table of Contents">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META NAME="Generator" CONTENT="texi2html 1.64">
</HEAD>
<BODY LANG="" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">
<A NAME="SEC_Contents"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H1>Table of Contents</H1>
<UL>
<A NAME="TOC1" HREF="manual_1.html#SEC1">1. Introduction</A>
<BR>
<A NAME="TOC2" HREF="manual_2.html#SEC2">2. How to use <CODE>bzip2</CODE></A>
<BR>
<UL>
<UL>
<UL>
<A NAME="TOC3" HREF="manual_2.html#SEC3">NAME</A>
<BR>
<A NAME="TOC4" HREF="manual_2.html#SEC4">SYNOPSIS</A>
<BR>
<A NAME="TOC5" HREF="manual_2.html#SEC5">DESCRIPTION</A>
<BR>
<A NAME="TOC6" HREF="manual_2.html#SEC6">OPTIONS</A>
<BR>
<A NAME="TOC7" HREF="manual_2.html#SEC7">MEMORY MANAGEMENT</A>
<BR>
<A NAME="TOC8" HREF="manual_2.html#SEC8">RECOVERING DATA FROM DAMAGED FILES</A>
<BR>
<A NAME="TOC9" HREF="manual_2.html#SEC9">PERFORMANCE NOTES</A>
<BR>
<A NAME="TOC10" HREF="manual_2.html#SEC10">CAVEATS</A>
<BR>
<A NAME="TOC11" HREF="manual_2.html#SEC11">AUTHOR</A>
<BR>
</UL>
</UL>
</UL>
<A NAME="TOC12" HREF="manual_3.html#SEC12">3. Programming with <CODE>libbzip2</CODE></A>
<BR>
<UL>
<A NAME="TOC13" HREF="manual_3.html#SEC13">3.1 Top-level structure</A>
<BR>
<UL>
<A NAME="TOC14" HREF="manual_3.html#SEC14">3.1.1 Low-level summary</A>
<BR>
<A NAME="TOC15" HREF="manual_3.html#SEC15">3.1.2 High-level summary</A>
<BR>
<A NAME="TOC16" HREF="manual_3.html#SEC16">3.1.3 Utility functions summary</A>
<BR>
</UL>
<A NAME="TOC17" HREF="manual_3.html#SEC17">3.2 Error handling</A>
<BR>
<A NAME="TOC18" HREF="manual_3.html#SEC18">3.3 Low-level interface</A>
<BR>
<UL>
<A NAME="TOC19" HREF="manual_3.html#SEC19">3.3.1 <CODE>BZ2_bzCompressInit</CODE></A>
<BR>
<A NAME="TOC20" HREF="manual_3.html#SEC20">3.3.2 <CODE>BZ2_bzCompress</CODE></A>
<BR>
<A NAME="TOC21" HREF="manual_3.html#SEC21">3.3.3 <CODE>BZ2_bzCompressEnd</CODE></A>
<BR>
<A NAME="TOC22" HREF="manual_3.html#SEC22">3.3.4 <CODE>BZ2_bzDecompressInit</CODE></A>
<BR>
<A NAME="TOC23" HREF="manual_3.html#SEC23">3.3.5 <CODE>BZ2_bzDecompress</CODE></A>
<BR>
<A NAME="TOC24" HREF="manual_3.html#SEC24">3.3.6 <CODE>BZ2_bzDecompressEnd</CODE></A>
<BR>
</UL>
<A NAME="TOC25" HREF="manual_3.html#SEC25">3.4 High-level interface</A>
<BR>
<UL>
<A NAME="TOC26" HREF="manual_3.html#SEC26">3.4.1 <CODE>BZ2_bzReadOpen</CODE></A>
<BR>
<A NAME="TOC27" HREF="manual_3.html#SEC27">3.4.2 <CODE>BZ2_bzRead</CODE></A>
<BR>
<A NAME="TOC28" HREF="manual_3.html#SEC28">3.4.3 <CODE>BZ2_bzReadGetUnused</CODE></A>
<BR>
<A NAME="TOC29" HREF="manual_3.html#SEC29">3.4.4 <CODE>BZ2_bzReadClose</CODE></A>
<BR>
<A NAME="TOC30" HREF="manual_3.html#SEC30">3.4.5 <CODE>BZ2_bzWriteOpen</CODE></A>
<BR>
<A NAME="TOC31" HREF="manual_3.html#SEC31">3.4.6 <CODE>BZ2_bzWrite</CODE></A>
<BR>
<A NAME="TOC32" HREF="manual_3.html#SEC32">3.4.7 <CODE>BZ2_bzWriteClose</CODE></A>
<BR>
<A NAME="TOC33" HREF="manual_3.html#SEC33">3.4.8 Handling embedded compressed data streams</A>
<BR>
<A NAME="TOC34" HREF="manual_3.html#SEC34">3.4.9 Standard file-reading/writing code</A>
<BR>
</UL>
<A NAME="TOC35" HREF="manual_3.html#SEC35">3.5 Utility functions</A>
<BR>
<UL>
<A NAME="TOC36" HREF="manual_3.html#SEC36">3.5.1 <CODE>BZ2_bzBuffToBuffCompress</CODE></A>
<BR>
<A NAME="TOC37" HREF="manual_3.html#SEC37">3.5.2 <CODE>BZ2_bzBuffToBuffDecompress</CODE></A>
<BR>
</UL>
<A NAME="TOC38" HREF="manual_3.html#SEC38">3.6 <CODE>zlib</CODE> compatibility functions</A>
<BR>
<A NAME="TOC39" HREF="manual_3.html#SEC39">3.7 Using the library in a <CODE>stdio</CODE>-free environment</A>
<BR>
<UL>
<A NAME="TOC40" HREF="manual_3.html#SEC40">3.7.1 Getting rid of <CODE>stdio</CODE></A>
<BR>
<A NAME="TOC41" HREF="manual_3.html#SEC41">3.7.2 Critical error handling</A>
<BR>
</UL>
<A NAME="TOC42" HREF="manual_3.html#SEC42">3.8 Making a Windows DLL</A>
<BR>
</UL>
<A NAME="TOC43" HREF="manual_4.html#SEC43">4. Miscellanea</A>
<BR>
<UL>
<A NAME="TOC44" HREF="manual_4.html#SEC44">4.1 Limitations of the compressed file format</A>
<BR>
<A NAME="TOC45" HREF="manual_4.html#SEC45">4.2 Portability issues</A>
<BR>
<A NAME="TOC46" HREF="manual_4.html#SEC46">4.3 Reporting bugs</A>
<BR>
<A NAME="TOC47" HREF="manual_4.html#SEC47">4.4 Did you get the right package?</A>
<BR>
<A NAME="TOC48" HREF="manual_4.html#SEC48">4.5 Testing</A>
<BR>
<A NAME="TOC49" HREF="manual_4.html#SEC49">4.6 Further reading</A>
<BR>
</UL>
</UL>
<HR SIZE=1>
<BR>
<FONT SIZE="-1">
This document was generated
by <I>Julian Seward</I> on <I>January, 5 2002</I>
using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
"><I>texi2html</I></A>
</BODY>
</HTML>
|
Added work/src/bzip2-1.0.2/mk251.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
/* Spew out a long sequence of the byte 251. When fed to bzip2
versions 1.0.0 or 1.0.1, causes it to die with internal error
1007 in blocksort.c. This assertion misses an extremely rare
case, which is fixed in this version (1.0.2) and above.
*/
#include <stdio.h>
int main ()
{
int i;
for (i = 0; i < 48500000 ; i++)
putchar(251);
return 0;
}
|
Added work/src/bzip2-1.0.2/randtable.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
|
/*-------------------------------------------------------------*/
/*--- Table for randomising repetitive blocks ---*/
/*--- randtable.c ---*/
/*-------------------------------------------------------------*/
/*--
This file is a part of bzip2 and/or libbzip2, a program and
library for lossless, block-sorting data compression.
Copyright (C) 1996-2002 Julian R Seward. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.
3. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
4. The name of the author may not be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Julian Seward, Cambridge, UK.
jseward@acm.org
bzip2/libbzip2 version 1.0 of 21 March 2000
This program is based on (at least) the work of:
Mike Burrows
David Wheeler
Peter Fenwick
Alistair Moffat
Radford Neal
Ian H. Witten
Robert Sedgewick
Jon L. Bentley
For more information on these sources, see the manual.
--*/
#include "bzlib_private.h"
/*---------------------------------------------*/
Int32 BZ2_rNums[512] = {
619, 720, 127, 481, 931, 816, 813, 233, 566, 247,
985, 724, 205, 454, 863, 491, 741, 242, 949, 214,
733, 859, 335, 708, 621, 574, 73, 654, 730, 472,
419, 436, 278, 496, 867, 210, 399, 680, 480, 51,
878, 465, 811, 169, 869, 675, 611, 697, 867, 561,
862, 687, 507, 283, 482, 129, 807, 591, 733, 623,
150, 238, 59, 379, 684, 877, 625, 169, 643, 105,
170, 607, 520, 932, 727, 476, 693, 425, 174, 647,
73, 122, 335, 530, 442, 853, 695, 249, 445, 515,
909, 545, 703, 919, 874, 474, 882, 500, 594, 612,
641, 801, 220, 162, 819, 984, 589, 513, 495, 799,
161, 604, 958, 533, 221, 400, 386, 867, 600, 782,
382, 596, 414, 171, 516, 375, 682, 485, 911, 276,
98, 553, 163, 354, 666, 933, 424, 341, 533, 870,
227, 730, 475, 186, 263, 647, 537, 686, 600, 224,
469, 68, 770, 919, 190, 373, 294, 822, 808, 206,
184, 943, 795, 384, 383, 461, 404, 758, 839, 887,
715, 67, 618, 276, 204, 918, 873, 777, 604, 560,
951, 160, 578, 722, 79, 804, 96, 409, 713, 940,
652, 934, 970, 447, 318, 353, 859, 672, 112, 785,
645, 863, 803, 350, 139, 93, 354, 99, 820, 908,
609, 772, 154, 274, 580, 184, 79, 626, 630, 742,
653, 282, 762, 623, 680, 81, 927, 626, 789, 125,
411, 521, 938, 300, 821, 78, 343, 175, 128, 250,
170, 774, 972, 275, 999, 639, 495, 78, 352, 126,
857, 956, 358, 619, 580, 124, 737, 594, 701, 612,
669, 112, 134, 694, 363, 992, 809, 743, 168, 974,
944, 375, 748, 52, 600, 747, 642, 182, 862, 81,
344, 805, 988, 739, 511, 655, 814, 334, 249, 515,
897, 955, 664, 981, 649, 113, 974, 459, 893, 228,
433, 837, 553, 268, 926, 240, 102, 654, 459, 51,
686, 754, 806, 760, 493, 403, 415, 394, 687, 700,
946, 670, 656, 610, 738, 392, 760, 799, 887, 653,
978, 321, 576, 617, 626, 502, 894, 679, 243, 440,
680, 879, 194, 572, 640, 724, 926, 56, 204, 700,
707, 151, 457, 449, 797, 195, 791, 558, 945, 679,
297, 59, 87, 824, 713, 663, 412, 693, 342, 606,
134, 108, 571, 364, 631, 212, 174, 643, 304, 329,
343, 97, 430, 751, 497, 314, 983, 374, 822, 928,
140, 206, 73, 263, 980, 736, 876, 478, 430, 305,
170, 514, 364, 692, 829, 82, 855, 953, 676, 246,
369, 970, 294, 750, 807, 827, 150, 790, 288, 923,
804, 378, 215, 828, 592, 281, 565, 555, 710, 82,
896, 831, 547, 261, 524, 462, 293, 465, 502, 56,
661, 821, 976, 991, 658, 869, 905, 758, 745, 193,
768, 550, 608, 933, 378, 286, 215, 979, 792, 961,
61, 688, 793, 644, 986, 403, 106, 366, 905, 644,
372, 567, 466, 434, 645, 210, 389, 550, 919, 135,
780, 773, 635, 389, 707, 100, 626, 958, 165, 504,
920, 176, 193, 713, 857, 265, 203, 50, 668, 108,
645, 990, 626, 197, 510, 357, 358, 850, 858, 364,
936, 638
};
/*-------------------------------------------------------------*/
/*--- end randtable.c ---*/
/*-------------------------------------------------------------*/
|
Added work/src/bzip2-1.0.2/sample1.bz2.
cannot compute difference between binary files
Added work/src/bzip2-1.0.2/sample1.rb2.
Added work/src/bzip2-1.0.2/sample1.ref.
cannot compute difference between binary files
Added work/src/bzip2-1.0.2/sample2.bz2.
cannot compute difference between binary files
Added work/src/bzip2-1.0.2/sample2.ref.
cannot compute difference between binary files
Added work/src/bzip2-1.0.2/sample3.bz2.
cannot compute difference between binary files
Added work/src/bzip2-1.0.2/sample3.ref.
more than 10,000 changes
Added work/src/bzip2-1.0.2/spewG.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
/* spew out a thoroughly gigantic file designed so that bzip2
can compress it reasonably rapidly. This is to help test
support for large files (> 2GB) in a reasonable amount of time.
I suggest you use the undocumented --exponential option to
bzip2 when compressing the resulting file; this saves a bit of
time. Note: *don't* bother with --exponential when compressing
Real Files; it'll just waste a lot of CPU time :-)
(but is otherwise harmless).
*/
#define _FILE_OFFSET_BITS 64
#include <stdio.h>
#include <stdlib.h>
/* The number of megabytes of junk to spew out (roughly) */
#define MEGABYTES 5000
#define N_BUF 1000000
char buf[N_BUF];
int main ( int argc, char** argv )
{
int ii, kk, p;
srandom(1);
setbuffer ( stdout, buf, N_BUF );
for (kk = 0; kk < MEGABYTES * 515; kk+=3) {
p = 25+random()%50;
for (ii = 0; ii < p; ii++)
printf ( "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" );
for (ii = 0; ii < p-1; ii++)
printf ( "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" );
for (ii = 0; ii < p+1; ii++)
printf ( "ccccccccccccccccccccccccccccccccccccc" );
}
fflush(stdout);
return 0;
}
|
Added work/src/bzip2-1.0.2/unzcrash.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
/* A test program written to test robustness to decompression of
corrupted data. Usage is
unzcrash filename
and the program will read the specified file, compress it (in memory),
and then repeatedly decompress it, each time with a different bit of
the compressed data inverted, so as to test all possible one-bit errors.
This should not cause any invalid memory accesses. If it does,
I want to know about it!
p.s. As you can see from the above description, the process is
incredibly slow. A file of size eg 5KB will cause it to run for
many hours.
*/
#include <stdio.h>
#include <assert.h>
#include "bzlib.h"
#define M_BLOCK 1000000
typedef unsigned char uchar;
#define M_BLOCK_OUT (M_BLOCK + 1000000)
uchar inbuf[M_BLOCK];
uchar outbuf[M_BLOCK_OUT];
uchar zbuf[M_BLOCK + 600 + (M_BLOCK / 100)];
int nIn, nOut, nZ;
static char *bzerrorstrings[] = {
"OK"
,"SEQUENCE_ERROR"
,"PARAM_ERROR"
,"MEM_ERROR"
,"DATA_ERROR"
,"DATA_ERROR_MAGIC"
,"IO_ERROR"
,"UNEXPECTED_EOF"
,"OUTBUFF_FULL"
,"???" /* for future */
,"???" /* for future */
,"???" /* for future */
,"???" /* for future */
,"???" /* for future */
,"???" /* for future */
};
void flip_bit ( int bit )
{
int byteno = bit / 8;
int bitno = bit % 8;
uchar mask = 1 << bitno;
//fprintf ( stderr, "(byte %d bit %d mask %d)",
// byteno, bitno, (int)mask );
zbuf[byteno] ^= mask;
}
int main ( int argc, char** argv )
{
FILE* f;
int r;
int bit;
int i;
if (argc != 2) {
fprintf ( stderr, "usage: unzcrash filename\n" );
return 1;
}
f = fopen ( argv[1], "r" );
if (!f) {
fprintf ( stderr, "unzcrash: can't open %s\n", argv[1] );
return 1;
}
nIn = fread ( inbuf, 1, M_BLOCK, f );
fprintf ( stderr, "%d bytes read\n", nIn );
nZ = M_BLOCK;
r = BZ2_bzBuffToBuffCompress (
zbuf, &nZ, inbuf, nIn, 9, 0, 30 );
assert (r == BZ_OK);
fprintf ( stderr, "%d after compression\n", nZ );
for (bit = 0; bit < nZ*8; bit++) {
fprintf ( stderr, "bit %d ", bit );
flip_bit ( bit );
nOut = M_BLOCK_OUT;
r = BZ2_bzBuffToBuffDecompress (
outbuf, &nOut, zbuf, nZ, 0, 0 );
fprintf ( stderr, " %d %s ", r, bzerrorstrings[-r] );
if (r != BZ_OK) {
fprintf ( stderr, "\n" );
} else {
if (nOut != nIn) {
fprintf(stderr, "nIn/nOut mismatch %d %d\n", nIn, nOut );
return 1;
} else {
for (i = 0; i < nOut; i++)
if (inbuf[i] != outbuf[i]) {
fprintf(stderr, "mismatch at %d\n", i );
return 1;
}
if (i == nOut) fprintf(stderr, "really ok!\n" );
}
}
flip_bit ( bit );
}
#if 0
assert (nOut == nIn);
for (i = 0; i < nOut; i++) {
if (inbuf[i] != outbuf[i]) {
fprintf ( stderr, "difference at %d !\n", i );
return 1;
}
}
#endif
fprintf ( stderr, "all ok\n" );
return 0;
}
|
Added work/src/bzip2-1.0.2/words0.
|
|
>
>
>
>
>
|
1
2
3
4
5
|
If compilation produces errors, or a large number of warnings,
please read README.COMPILATION.PROBLEMS -- you might be able to
adjust the flags in this Makefile to improve matters.
|
Added work/src/bzip2-1.0.2/words1.
|
|
>
>
>
>
|
1
2
3
4
|
Doing 6 tests (3 compress, 3 uncompress) ...
If there's a problem, things might stop at this point.
|
Added work/src/bzip2-1.0.2/words2.
|
|
>
>
>
>
>
|
1
2
3
4
5
|
Checking test results. If any of the four "cmp"s which follow
report any differences, something is wrong. If you can't easily
figure out what, please let me know (jseward@acm.org).
|
Added work/src/bzip2-1.0.2/words3.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
If you got this far and the "cmp"s didn't complain, it looks
like you're in business.
To install in /usr/bin, /usr/lib, /usr/man and /usr/include, type
make install
To install somewhere else, eg, /xxx/yyy/{bin,lib,man,include}, type
make install PREFIX=/xxx/yyy
If you are (justifiably) paranoid and want to see what 'make install'
is going to do, you can first do
make -n install or
make -n install PREFIX=/xxx/yyy respectively.
The -n instructs make to show the commands it would execute, but
not actually execute them.
Instructions for use are in the preformatted manual page, in the file
bzip2.txt. For more detailed documentation, read the full manual.
It is available in Postscript form (manual.ps), PDF form (manual.pdf),
and HTML form (manual_toc.html).
You can also do "bzip2 --help" to see some helpful information.
"bzip2 -L" displays the software license.
|
Added work/src/lzo-1.08.tar.gz.
cannot compute difference between binary files
Added work/src/zlib-1.2.1.tar.gz.
cannot compute difference between binary files
Added work/subst.dct.
cannot compute difference between binary files
Added work/tar.txt.
|
|
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
|
[rkeene@unleaded work]$ tar -cf bob.tar Makefile
[rkeene@unleaded work]$ tar -xOf bob.tar Makefile
all:
cd ../; make all
%:
cd ../; make $@
|
Added work/test/Makefile.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
CC = gcc
CFLAGS = -O3 -Wall -I../../ -L../../
LDFLAGS = -lm -lncurses
all: parse-test crc-test sort
parse-test: parse-test.o ../../parse.o ../../crc.o ../../buffer.o ../../net.o ../../ui.o
crc-test: crc-test.o ../../crc.o
sort: sort.o ../../sort.o
sort.o: sort.c
crc-test.o: crc-test.c
parse-test.o: parse-test.c
clean:
rm sort.o sort crc-test.o crc-test
|
Added work/test/config.h.in.
|
|
>
|
1
|
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
Added work/test/crc-test.
cannot compute difference between binary files
Added work/test/crc-test.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
#define DEBUG 1
#include <stdio.h>
#include "crc.h"
int main(void) {
unsigned long crc0=0,crc1=0;
crc0=ELFCRC(crc0,"joe", 3);
crc0=ELFCRC(crc0,"bob", 3);
crc1=ELFCRC(crc1,"joeboa", 6);
SPOTVAR_NUM(crc0);
SPOTVAR_NUM(crc1);
return(0);
}
|
Added work/test/filter.
cannot compute difference between binary files
Added work/test/filter.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
#include <stdio.h>
void ft(int *data)
{
data[1] -= (5*data[0] + 15*data[2] - 5*data[4] + data[6]) >> 4;
data[3] -= (-1*data[0] + 9*data[2] + 9*data[4] - data[6]) >> 4;
data[5] -= (1*data[0] - 5*data[2] + 15*data[4] + 5*data[6]) >> 4;
data[7] -= (-5*data[0] + 21*data[2] - 35*data[4] + 35*data[6]) >> 4;
data[0] -= (35*data[1] - 35*data[3] + 21*data[5] - 5*data[7]) >> 4;
data[2] -= (5*data[1] + 15*data[3] - 5*data[5] + 1*data[7]) >> 4;
data[4] -= (-1*data[1] + 9*data[3] + 9*data[5] - 1*data[7]) >> 4;
data[6] -= (1*data[1] - 5*data[3] + 15*data[5] + 5*data[7]) >> 4;
}
void it(int *data)
{
data[0] += (35*data[1] - 35*data[3] + 21*data[5] - 5*data[7]) >> 4;
data[2] += (5*data[1] + 15*data[3] - 5*data[5] + 1*data[7]) >> 4;
data[4] += (-1*data[1] + 9*data[3] + 9*data[5] - 1*data[7]) >> 4;
data[6] += (1*data[1] - 5*data[3] + 15*data[5] + 5*data[7]) >> 4;
data[1] += (5*data[0] + 15*data[2] - 5*data[4] + data[6]) >> 4;
data[3] += (-1*data[0] + 9*data[2] + 9*data[4] - data[6]) >> 4;
data[5] += (1*data[0] - 5*data[2] + 15*data[4] + 5*data[6]) >> 4;
data[7] += (-5*data[0] + 21*data[2] - 35*data[4] + 35*data[6]) >> 4;
}
void pack(int *data)
{
int temp[8], x;
for (x = 0; x < 4; x++) {
temp[x] = data[x+x+0];
temp[x+4] = data[x+x+1];
}
for (x = 0; x < 8; x++)
data[x] = temp[x];
}
void depack(int *data)
{
int temp[8], x;
for (x = 0; x < 4; x++) {
temp[x+x+0] = data[x];
temp[x+x+1] = data[x+4];
}
for (x = 0; x < 8; x++)
data[x] = temp[x];
}
main()
{
int buf[8], x;
/* clrscr(); */
for (x = 0; x < 8; x++)
buf[x] = x;
for (x = 0; x < 8; x++) printf("%d, ", buf[x]); printf("\n");
ft(buf); pack(buf);
for (x = 0; x < 8; x++) printf("%d, ", buf[x]); printf("\n");
depack(buf); it(buf);
for (x = 0; x < 8; x++) printf("%d, ", buf[x]); printf("\n");
}
|
Added work/test/meep.
cannot compute difference between binary files
Added work/test/meep.c.
|
|
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
|
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
int main(void) {
char ch;
read(STDIN_FILENO, &ch, 1);
if (lseek(STDIN_FILENO, -1, SEEK_CUR) == -1) printf("Cannot seek on stdin!\n");
}
|
Added work/test/mtrace.log.
|
|
>
>
>
>
>
|
1
2
3
4
5
|
= Start
@ /lib/libc.so.6:(__strdup+0x2b)[0x1a0227] + 0x804b1e0 0x1b
@ [0x8049631] + 0x804b200 0x2d
@ /lib/libc.so.6:(__strdup+0x2b)[0x1a0227] + 0x804b238 0x1b
@ [0x8048e99] - 0x804b238
|
Added work/test/parse-test.
cannot compute difference between binary files
Added work/test/parse-test.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <curses.h>
#include <fcntl.h>
#include <stdio.h>
#include "dact.h"
#include "net.h"
#include "parse.h"
#include "ui.h"
void mtrace (void);
uint32_t DACT_BLK_SIZE=3;
int main(int argc, char **argv) {
char *ret;
char scheme[5];
char username[128], password[128];
char host[512],file[1024];
int port, x;
#if 0
mtrace();
dact_ui_init();
dact_ui_setup(300);
for (x=0;x<=100;x++) {
dact_ui_incrblkcnt(3);
if (x==13) dact_ui_status(0,"Test.");
usleep(40000);
}
fprintf(stderr, "\n");
if (argv[1]==NULL) return(1);
#endif
ret=parse_url_subst(argv[1],"joe");
SPOTVAR_STR(mime64(ret));
SPOTVAR_NUM(hash_fourbyte(ret,':'));
if (!parse_url(ret,scheme,username,password,host,&port,file)) {
printf("SCHEME=[%s]\n",scheme);
printf("HOST =[%s]\n",host);
printf("PORT =[%i]\n",port);
printf("USER =[%s]\n",username);
printf("PASS =[%s]\n",password);
}
printf("FILE =[%s]\n",file);
return(0);
}
|
Added work/test/parse-test.static.gz.
cannot compute difference between binary files
Added work/test/sort.
cannot compute difference between binary files
Added work/test/sort.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "sort.h"
/* void bob_int_sort(uint32_t array[], int size, int mode) {
uint32_t *mod_array=NULL;
unsigned int i,j,temp;
if (mode!=0) {
mod_array=malloc(size*sizeof(uint32_t));
for (i=0;i<size;i++) {
mod_array[i]=i;
}
}
for (i=0;i<size;i++) {
//
}
if (mode!=0) {
memcpy(array,mod_array,size*sizeof(uint32_t));
free(mod_array);
}
return;
} */
int main(void) {
uint32_t test[6];
uint32_t *test_b;
uint32_t *test_c;
int mode=0;
int i,num=sizeof(test)/sizeof(uint32_t);
// test[0]=4294967294;
// test[1]=4089;
// test[2]=597869825;
test[0]=3;
test[1]=9;
test[2]=21;
test[3]=5;
test[4]=7;
test[5]=3;
test_b=malloc(sizeof(test));
test_c=malloc(sizeof(test));
memcpy(test_b,test,sizeof(test));
memcpy(test_c,test,sizeof(test));
int_sort_fast(test,num,mode);
int_sort(test_b,num,mode);
int_sort_really_fast(test_c,num,mode);
printf("A: %i", test[0]);
for (i=1;i<num;i++) printf(", %i",test[i]);
printf("\n");
printf("B: %i", test_b[0]);
for (i=1;i<num;i++) printf(", %i",test_b[i]);
printf("\n");
printf("C: %i", test_c[0]);
for (i=1;i<num;i++) printf(", %i",test_c[i]);
printf("\n");
return(0);
}
|
Added work/testLON/Makefile.in.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
CC = @CC@
CFLAGS = @CFLAGS@ @DEFS@
CPPFLAGS = @CPPFLAGS@
LD = @CC@
LOADLIBES =
LDLIBS += @LIBS@ -lm
LDFLAGS += @LDFLAGS@
INSTALL = @INSTALL@
@SET_MAKE@
VER = 0.8.1
prefix = @prefix@
mandir = @mandir@
sysconfdir = @sysconfdir@
datadir = @datadir@
exec_prefix = @exec_prefix@
bindir = @bindir@
LIBS = libopennet.so
OBJS = buffer.o crc.o opennet.o parse.o
all: $(LIBS)
libopennet.so: $(OBJS)
$(CC) -o libopennet.so -shared $(LDFLAGS) $(OBJS)
install: $(LIBS)
cp libopennet.so $(prefix)/lib/libopennet.so.$(VER)
ln -fs $(prefix)/lib/libopennet.so.$(VER) $(prefix)/lib/libopennet.so
cp opennet.h $(prefix)/include/
clean:
rm -f $(OBJS) core
distclean: clean
rm -f $(LIBS) config.h config.cache config.log config.status Makefile
parse.o: parse.c parse.h
crc.o: crc.c crc.h
opennet.o: opennet.c opennet.h
buffer.o: buffer.c buffer.h
|
Added work/testLON/acconfig.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
|
/* Define to the unsigned int type. */
#undef uint
/* Define to activate debugging mode. */
#undef DEBUG
/* Define if you have the inet_aton function. */
#undef HAVE_INET_ATON
/* Define if you want to disable network support */
#undef NO_NETWORK
|
Added work/testLON/aclocal.m4.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
AC_DEFUN(DC_PROG_GCC, [
AC_SUBST(DEPEND)
if test -n "$GCC"; then
CFLAGS="$CFLAGS -Wall"
DEPEND="Makefile.dep"
fi
])
AC_DEFUN(DC_DO_NETSET, [
AC_SEARCH_LIBS(socket, socket nsl)
AC_SEARCH_LIBS(gethostbyname, nsl)
AC_SEARCH_LIBS(inet_aton, xnet, AC_DEFINE(HAVE_INET_ATON), AC_SEARCH_LIBS(inet_addr, nsl))
])
AC_DEFUN(DC_ASK_NETWORK, [
AC_ARG_ENABLE(network, [ --disable-network], [
case "$enableval" in
no)
AC_DEFINE(NO_NETWORK)
;;
*)
DC_DO_NETSET
;;
esac
], DC_DO_NETSET )
])
AC_DEFUN(DC_DO_DEBUG, [
LIBOBJS="$LIBOBJS"
ALGO="$ALGO"
AC_DEFINE(DEBUG)
])
AC_DEFUN(DC_ASK_DEBUG, [
AC_ARG_ENABLE(debug, [ --enable-debug], [
if test "$enable_version" != "no"; then
DC_DO_DEBUG
fi
], [
case "`uname -n`" in
rkeene | unleaded | *.saurik.com )
DC_DO_DEBUG
;;
esac
])
])
|
Added work/testLON/config.h.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
/* config.h. Generated automatically by configure. */
/* config.h.in. Generated automatically from configure.in by autoheader. */
/* Define as __inline if that's what the C compiler calls it. */
/* #undef inline */
/* Define if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define to the unsigned int type. */
/* #undef uint */
/* Define to activate debugging mode. */
#define DEBUG 1
/* Define if you have the inet_aton function. */
#define HAVE_INET_ATON 1
/* Define if you want to disable network support */
/* #undef NO_NETWORK */
/* The number of bytes in a int. */
#define SIZEOF_INT 4
/* The number of bytes in a long. */
#define SIZEOF_LONG 4
/* The number of bytes in a short. */
#define SIZEOF_SHORT 2
/* Define if you have the Strsep function. */
/* #undef HAVE_STRSEP */
/* Define if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define if you have the <sys/socket.h> header file. */
#define HAVE_SYS_SOCKET_H 1
|
Added work/testLON/config.h.in.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
/* config.h.in. Generated automatically from configure.in by autoheader. */
/* Define as __inline if that's what the C compiler calls it. */
#undef inline
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define to the unsigned int type. */
#undef uint
/* Define to activate debugging mode. */
#undef DEBUG
/* Define if you have the inet_aton function. */
#undef HAVE_INET_ATON
/* Define if you want to disable network support */
#undef NO_NETWORK
/* The number of bytes in a int. */
#undef SIZEOF_INT
/* The number of bytes in a long. */
#undef SIZEOF_LONG
/* The number of bytes in a short. */
#undef SIZEOF_SHORT
/* Define if you have the Strsep function. */
#undef HAVE_STRSEP
/* Define if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
|
Added work/testLON/configure.in.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
dnl Process this file with autoconf to produce a configure script.
AC_REVISION($Revision $)
AC_INIT
AC_CONFIG_HEADER(config.h)
dnl Checks for programs.
AC_PROG_CC
AC_PROG_MAKE_SET
AC_PROG_INSTALL
DC_PROG_GCC
dnl Checks for libraries.
DC_ASK_NETWORK
DC_ASK_DEBUG
dnl Checks for header files.
AC_CHECK_HEADERS(stdint.h sys/socket.h)
dnl Checks for typedefs.
AC_CHECK_TYPE(uint, unsigned int)
dnl Checks for structures.
dnl Checks for compiler characteristics.
AC_C_INLINE
AC_CHECK_SIZEOF(long, 4)
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(short, 2)
dnl Checks for library functions.
AC_REPLACE_FUNCS(Strsep)
dnl Checks for system services.
AC_OUTPUT(Makefile)
|
Added work/testLON/test.c.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
#include <opennet.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int main(void) {
int fd,x;
char smbuf[1024];
fd=open_net("http://www.rkeene.org/", O_RDONLY);
printf("fd=%i\n",fd);
while ((x=read_net(fd,&smbuf,1024) ) >0) {
write(STDOUT_FILENO, &smbuf,x);
}
close(fd);
}
|
Added work/txt/README.
|
|
>
>
>
|
1
2
3
|
http://www.internz.com/compression-pointers.html
http://www.faqs.org/faqs/compression-faq/part1/
ftp://sunsite.unc.edu/pub/Linux/utils/compress/ha0999p-linux.tar.gz
|
Added work/txt/rskc001.txt.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
8 General registers (ax[0],bx[1],cx[2],dx[3],ex[4],fx[5],gx[6],hx[7])
Upto 64 `large' STACKS, atleast 1.
1 `IN' FIFO, GEN_BUFFER
1 Condition Bit (cb)
1 Stack Size Value (st)
OPCODES:
00.n[3] OUT /reg/ Write 1 byte from lowest byte of reg"N".
01.i[5] JMP /imm/ Jump signed-imm"I" bytes.
02.i[5] JE /imm/ Jump signed-imm"I" bytes if CB set.
03.i[5] JNE /imm/ Jump signed-imm"I" bytes if CB not set.
04.n[3].i[8] CMP /reg/ /imm/ Compare lower byte of imm"I" to reg"N".
05.n[3].i[16] CMP /reg/ /imm/ Compare lower word of imm"I" to reg"N".
06.n[3].i[32] CMP /reg/ /imm/ Compare imm"I" to reg"N".
07.c[1] LOOP /bit/ ?"C"=0: Begin loop (if in loop, nest.)
?"C"=1: End loop(cx--, unless cx=0, then end.)
08.n[3].s[3] MOV /reg/ /reg/ Copy contents of reg"S" to reg"N".
09.n[3].i[8] MOV /reg/ /imm/ Copy imm"I" to reg"N".
10.n[3].i[16] MOV /reg/ /imm/ Copy imm"I" to reg"N".
11.n[3].i[32] MOV /reg/ /imm/ Copy imm"I" to reg"N".
12.n[3] PUSH /reg/ Copy reg"N" to stack #0.
13.n[3] POP /reg/ Move 32 bits from stack #0 to reg"N".
14.n[3] POP /reg/ Move 8 bits from stack #0 to reg"N".
15.n[3].s[3] ADD /reg/ /reg/ Add reg"S" to reg"N" (store in reg"N".)
16.n[3].i[32] ADD /reg/ /imm/ Add imm"I" to reg"N".
17.n[3].i[16] ADD /reg/ /imm/ Add imm"I" to reg"N".
18.n[3].i[8] ADD /reg/ /imm/ Add imm"I" to reg"N".
19.n[3].s[3] SUB /reg/ /reg/ Subtract reg"S" from reg"N" (store in reg"N".)
20.n[3].i[32] SUB /reg/ /imm/ Subtract imm"I" from reg"N".
21.n[3].i[16] SUB /reg/ /imm/ Subtract imm"I" from reg"N".
22.n[3].i[8] SUB /reg/ /imm/ Subtract imm"I" from reg"N".
23.n[3].s[3] MUL /reg/ /reg/ Multiply reg"S" by reg"N" (store in reg"N".)
24.n[3].i[32] MUL /reg/ /imm/ Multiply imm"I" by reg"N".
25.n[3].i[16] MUL /reg/ /imm/ Multiply imm"I" by reg"N".
26.n[3].i[8] MUL /reg/ /imm/ Multiply imm"I" by reg"N".
27.n[3].s[3] DIV /reg/ /reg/ Divide reg"S" by reg"N" (int=reg"N", rem=dx.)
28.n[3].i[32] DIV /reg/ /imm/ Divide imm"I" by reg"N".
29.n[3].i[16] DIV /reg/ /imm/ Divide imm"I" by reg"N".
30.n[3].i[8] DIV /reg/ /imm/ Divide imm"I" by reg"N".
31.n[3].i[5] SHR /reg/ /imm/ Shift reg"N" right imm"I" bits.
32.n[3].i[5] SHL /reg/ /imm/ Shift reg"N" left imm"I" bits.
33.n[3].s[3] SHR /reg/ /reg/ Shift reg"N" right reg"S" bits.
34.n[3].s[3] SHL /reg/ /reg/ Shift reg"N" left reg"S" bits.
35.i[5] PROC /imm/ Begin definition of proc imm"I" [Not execd].
36.i[5] CALL /imm/ Run proc imm"I".
37.null RET End definition of proc.
38.n[3].s[3] XOR /reg/ /reg/ Excl-bws-OR reg"N" with reg"S" sto in reg"N".
39.n[3].i[32] XOR /reg/ /imm/ Excl-bws-OR reg"N" with imm"I".
40.n[3].i[16] XOR /reg/ /imm/ Excl-bws-OR reg"N" with imm"I".
41.n[3].i[8] XOR /reg/ /imm/ Excl-bws-OR reg"N" with imm"I".
42.n[3].s[3] OR /reg/ /reg/ Bws-OR reg"N" with reg"S" sto in reg"N".
43.n[3].i[32] OR /reg/ /imm/ Bws-OR reg"N" with imm"I".
44.n[3].i[16] OR /reg/ /imm/ Bws-OR reg"N" with imm"I".
45.n[3].i[8] OR /reg/ /imm/ Bws-OR reg"N" with imm"I".
46.n[3].s[3] AND /reg/ /reg/ Bws-AND reg"N" with reg"S" sto in reg"N".
47.n[3].i[32] AND /reg/ /imm/ Bws-AND reg"N" with imm"I".
48.n[3].i[16] AND /reg/ /imm/ Bws-AND reg"N" with imm"I".
49.n[3].i[8] AND /reg/ /imm/ Bws-AND reg"N" with imm"I".
50.n[3].s[3] EXP /reg/ /reg/ Raise reg"N" to the reg"S" powr sto in reg"N".
51.n[3].i[32] EXP /reg/ /imm/ Raise reg"N" to the imm"I" power.
52.n[3].i[16] EXP /reg/ /imm/ Raise reg"N" to the imm"I" power.
53.n[3].i[8] EXP /reg/ /imm/ Raise reg"N" to the imm"I" power.
54.i[6] NR-STACKS /imm/ Set # of stacks <ST> to imm"I".
55.i[|ST|].n[3] PUSH /imm/ /reg/ Copy reg"N" to stack #imm"I".
56.i[|ST|].n[3] POP /imm/ /reg/ Move 32bits from stack #imm"I" to reg"N".
57.c[1].i[|ST|].n[3] POP /imm/ /imm/ /reg/
?"C"=0: Move 8bits from stk #imm"I" to reg"N".
?"C"=1: Move 16bits frm stk #imm"I" to reg"N".
58.??????????????????????????????????????????????????????????
59.i[|ST|] OUT /imm/ Write stack #imm"I" to disk.
60.null OUTREG Write all registers to disk in order.
61.??????????????????????????????????????????????????????????
62.n[3] POP /reg/ Move 16 bits from stack #0 to reg"N".
63.c[5] EXT /imm/ /.../ (Least frequently called functions go here)
?"C"=0: HLT (compression okay, all done.)
?"C"=1: .i[8]; DISP Display imm"I" bytes following.
?"C"=2: ABRT (compression failed, all done.)
?"C"=3: .n[3]; LOAD Load 1 byte from GEN_BUF to reg"N".
?"C"=4: .i[|ST|]; OUTLOW Write lowest order bytes of
stack #imm"I" to disk.
?"C"=5: .i[|ST|]; STFLIP Flip stack #imm"I".
?"C"=6: .i[1]; CWSC (control word size change)
?"I"=0: Enter 5bit Control Word State.
?"I"=1: Enter 6bit Control Word State (default).
?"C"=7: .i[3].r[6]...; REMAP enter imm"I" bit Control
Word State, with opcodes
remapped as opcode X=imm"R"_X.
(Example: [3F.07.1.00.3F])
?"C"=8:
|
Added work/win32-errors.txt.
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
--------------------Configuration: dact - Win32 Debug--------------------
Compiling...
cipher_chaos.c
c:\temp\rsk13\dact-0.8.11\cipher_chaos.c(75) : warning C4101: 'b' : unreferenced local variable
cipher_psub.c
c:\temp\rsk13\dact-0.8.11\cipher_psub.c(75) : warning C4018: '<' : signed/unsigned mismatch
cipher_serpent.c
cipher_sub.c
c:\temp\rsk13\dact-0.8.11\cipher_sub.c(72) : warning C4013: 'open' undefined; assuming extern returning int
c:\temp\rsk13\dact-0.8.11\cipher_sub.c(74) : warning C4013: 'read' undefined; assuming extern returning int
c:\temp\rsk13\dact-0.8.11\cipher_sub.c(81) : warning C4013: 'close' undefined; assuming extern returning int
c:\temp\rsk13\dact-0.8.11\cipher_sub.c(89) : warning C4013: 'write' undefined; assuming extern returning int
comp_bitsums.c
comp_bzlib.c
comp_delta.c
c:\temp\rsk13\dact-0.8.11\comp_delta.c(91) : warning C4018: '>=' : signed/unsigned mismatch
comp_factor.c
comp_fail.c
comp_mzlib.c
comp_mzlib2.c
comp_plain.c
comp_rle.c
c:\temp\rsk13\dact-0.8.11\comp_rle.c(111) : warning C4018: '>' : signed/unsigned mismatch
comp_snibble.c
c:\temp\rsk13\dact-0.8.11\comp_snibble.c(142) : warning C4018: '<=' : signed/unsigned mismatch
comp_split.c
c:\temp\rsk13\dact-0.8.11\comp_split.c(62) : warning C4244: '=' : conversion from 'double ' to 'int ', possible loss of data
comp_text.c
c:\temp\rsk13\dact-0.8.11\comp_text.c(131) : warning C4018: '>=' : signed/unsigned mismatch
comp_textrle.c
c:\temp\rsk13\dact-0.8.11\comp_textrle.c(63) : warning C4101: 'prevchar' : unreferenced local variable
c:\temp\rsk13\dact-0.8.11\comp_textrle.c(61) : warning C4101: 'm' : unreferenced local variable
c:\temp\rsk13\dact-0.8.11\comp_textrle.c(97) : warning C4018: '>' : signed/unsigned mismatch
comp_zlib.c
crc.c
dact.c
c:\temp\rsk13\dact-0.8.11\dact.c(235) : warning C4003: not enough actual parameters for macro 'open_net'
c:\temp\rsk13\dact-0.8.11\dact.c(235) : warning C4013: 'open' undefined; assuming extern returning int
c:\temp\rsk13\dact-0.8.11\dact.c(235) : error C2059: syntax error : ')'
c:\temp\rsk13\dact-0.8.11\dact.c(235) : error C2143: syntax error : missing ';' before ')'
c:\temp\rsk13\dact-0.8.11\dact.c(235) : error C2059: syntax error : ')'
c:\temp\rsk13\dact-0.8.11\dact.c(240) : warning C4013: 'write' undefined; assuming extern returning int
c:\temp\rsk13\dact-0.8.11\dact.c(240) : error C2065: 'STDERR_FILENO' : undeclared identifier
c:\temp\rsk13\dact-0.8.11\dact.c(244) : warning C4013: 'close' undefined; assuming extern returning int
c:\temp\rsk13\dact-0.8.11\dact.c(252) : error C2143: syntax error : missing ')' before '('
c:\temp\rsk13\dact-0.8.11\dact.c(252) : error C2143: syntax error : missing ')' before 'string'
c:\temp\rsk13\dact-0.8.11\dact.c(252) : error C2091: function returns function
c:\temp\rsk13\dact-0.8.11\dact.c(252) : error C2143: syntax error : missing '{' before 'string'
c:\temp\rsk13\dact-0.8.11\dact.c(252) : error C2059: syntax error : '<Unknown>'
c:\temp\rsk13\dact-0.8.11\dact.c(252) : error C2059: syntax error : ')'
c:\temp\rsk13\dact-0.8.11\dact.c(253) : error C2059: syntax error : ','
c:\temp\rsk13\dact-0.8.11\dact.c(253) : error C2143: syntax error : missing ')' before 'string'
c:\temp\rsk13\dact-0.8.11\dact.c(253) : error C2143: syntax error : missing '{' before 'string'
c:\temp\rsk13\dact-0.8.11\dact.c(253) : error C2059: syntax error : '<Unknown>'
c:\temp\rsk13\dact-0.8.11\dact.c(254) : error C2059: syntax error : ','
c:\temp\rsk13\dact-0.8.11\dact.c(254) : error C2143: syntax error : missing ')' before 'constant'
c:\temp\rsk13\dact-0.8.11\dact.c(254) : error C2143: syntax error : missing '{' before 'constant'
c:\temp\rsk13\dact-0.8.11\dact.c(254) : error C2059: syntax error : '<Unknown>'
c:\temp\rsk13\dact-0.8.11\dact.c(254) : error C2059: syntax error : ')'
c:\temp\rsk13\dact-0.8.11\dact.c(255) : error C2059: syntax error : ','
c:\temp\rsk13\dact-0.8.11\dact.c(255) : error C2143: syntax error : missing ')' before 'string'
c:\temp\rsk13\dact-0.8.11\dact.c(255) : error C2143: syntax error : missing '{' before 'string'
c:\temp\rsk13\dact-0.8.11\dact.c(255) : error C2059: syntax error : '<Unknown>'
c:\temp\rsk13\dact-0.8.11\dact.c(257) : error C2099: initializer is not a constant
c:\temp\rsk13\dact-0.8.11\dact.c(258) : error C2059: syntax error : 'if'
c:\temp\rsk13\dact-0.8.11\dact.c(258) : error C2059: syntax error : ')'
c:\temp\rsk13\dact-0.8.11\dact.c(258) : error C2059: syntax error : '<'
c:\temp\rsk13\dact-0.8.11\dact.c(258) : error C2059: syntax error : ')'
c:\temp\rsk13\dact-0.8.11\dact.c(259) : error C2059: syntax error : 'if'
c:\temp\rsk13\dact-0.8.11\dact.c(259) : warning C4003: not enough actual parameters for macro 'open_net'
c:\temp\rsk13\dact-0.8.11\dact.c(259) : error C2059: syntax error : ')'
c:\temp\rsk13\dact-0.8.11\dact.c(259) : error C2059: syntax error : '<'
c:\temp\rsk13\dact-0.8.11\dact.c(259) : error C2059: syntax error : ')'
c:\temp\rsk13\dact-0.8.11\dact.c(260) : error C2059: syntax error : 'if'
c:\temp\rsk13\dact-0.8.11\dact.c(269) : error C2059: syntax error : 'if'
c:\temp\rsk13\dact-0.8.11\dact.c(272) : error C2059: syntax error : 'return'
c:\temp\rsk13\dact-0.8.11\dact.c(273) : error C2059: syntax error : '}'
c:\temp\rsk13\dact-0.8.11\dact.c(385) : warning C4013: 'mkstemp' undefined; assuming extern returning int
c:\temp\rsk13\dact-0.8.11\dact.c(562) : warning C4244: 'function' : conversion from 'double ' to 'unsigned int ', possible loss of data
c:\temp\rsk13\dact-0.8.11\dact.c(585) : warning C4018: '<' : signed/unsigned mismatch
c:\temp\rsk13\dact-0.8.11\dact.c(633) : warning C4018: '!=' : signed/unsigned mismatch
c:\temp\rsk13\dact-0.8.11\dact.c(691) : warning C4013: 'read' undefined; assuming extern returning int
c:\temp\rsk13\dact-0.8.11\dact.c(778) : warning C4018: '<' : signed/unsigned mismatch
c:\temp\rsk13\dact-0.8.11\dact.c(781) : warning C4003: not enough actual parameters for macro 'open_net'
c:\temp\rsk13\dact-0.8.11\dact.c(781) : error C2059: syntax error : ')'
c:\temp\rsk13\dact-0.8.11\dact.c(781) : error C2143: syntax error : missing ';' before ')'
c:\temp\rsk13\dact-0.8.11\dact.c(781) : error C2059: syntax error : ')'
c:\temp\rsk13\dact-0.8.11\dact.c(933) : error C2059: syntax error : 'if'
c:\temp\rsk13\dact-0.8.11\dact.c(1043) : warning C4003: not enough actual parameters for macro 'open_net'
c:\temp\rsk13\dact-0.8.11\dact.c(1058) : error C2059: syntax error : 'return'
c:\temp\rsk13\dact-0.8.11\dact.c(1059) : error C2059: syntax error : '}'
c:\temp\rsk13\dact-0.8.11\dact.c(1267) : warning C4003: not enough actual parameters for macro 'open_net'
dendian.c
c:\temp\rsk13\dact-0.8.11\dendian.c(39) : warning C4013: 'write' undefined; assuming extern returning int
c:\temp\rsk13\dact-0.8.11\dendian.c(56) : warning C4013: 'read' undefined; assuming extern returning int
header.c
c:\temp\rsk13\dact-0.8.11\header.c(65) : warning C4018: '<' : signed/unsigned mismatch
module.c
net.c
c:\temp\rsk13\dact-0.8.11\net.c(311) : error C2061: syntax error : identifier 'lseek_net'
c:\temp\rsk13\dact-0.8.11\net.c(311) : error C2059: syntax error : ';'
c:\temp\rsk13\dact-0.8.11\net.c(311) : error C2059: syntax error : 'type'
parse.c
c:\temp\rsk13\dact-0.8.11\parse.c(25) : fatal error C1083: Cannot open include file: 'sys/utsname.h': No such file or directory
sort.c
c:\temp\rsk13\dact-0.8.11\sort.c(130) : warning C4018: '<' : signed/unsigned mismatch
ui.c
c:\temp\rsk13\dact-0.8.11\ui.c(164) : warning C4013: 'getpass' undefined; assuming extern returning int
c:\temp\rsk13\dact-0.8.11\ui.c(164) : warning C4047: '=' : 'char *' differs in levels of indirection from 'int '
buffer.c
c:\temp\rsk13\dact-0.8.11\buffer.c(174) : warning C4018: '<' : signed/unsigned mismatch
Error executing cl.exe.
dact.exe - 46 error(s), 35 warning(s)
|