mirror of
https://github.com/PCSX2/xz.git
synced 2026-02-05 11:51:17 +01:00
Compare commits
563 Commits
v4.999.9be
...
v5.2.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a0cd05ee71 | ||
|
|
b85ee0905e | ||
|
|
cbafa71091 | ||
|
|
8dbb57238d | ||
|
|
6060f7dc76 | ||
|
|
3e8bd1d15e | ||
|
|
72f7307cfd | ||
|
|
2cb82ff21c | ||
|
|
9b9e3536e4 | ||
|
|
a8b6b569e7 | ||
|
|
f168a6fd1a | ||
|
|
cec2ee863b | ||
|
|
42e97a3264 | ||
|
|
29b95d5d66 | ||
|
|
3af91040bb | ||
|
|
0152f72bf6 | ||
|
|
4a1f6133ee | ||
|
|
7f7d093de7 | ||
|
|
009823448b | ||
|
|
7dddfbeb49 | ||
|
|
6eca5be40e | ||
|
|
d1003673e9 | ||
|
|
4c5aa911a0 | ||
|
|
3e3099e36d | ||
|
|
e7d96a5933 | ||
|
|
46cbb9033a | ||
|
|
7ce49d444f | ||
|
|
214c553ebc | ||
|
|
1190c641af | ||
|
|
e4fc1d2f95 | ||
|
|
34f9e40a0a | ||
|
|
6d9c0ce9f2 | ||
|
|
2301f3f05d | ||
|
|
107a263d5b | ||
|
|
b13a781833 | ||
|
|
542cac122e | ||
|
|
7b03a15cea | ||
|
|
f8c13e5e36 | ||
|
|
7716dcf9df | ||
|
|
230fa4a605 | ||
|
|
4e4ae08bc7 | ||
|
|
c923b140b2 | ||
|
|
08c2aa16be | ||
|
|
2f9f61aa83 | ||
|
|
4f9d233f67 | ||
|
|
00502b2bed | ||
|
|
706b049675 | ||
|
|
7c32e6a935 | ||
|
|
076258cc45 | ||
|
|
efa7b0a210 | ||
|
|
9c5f76098c | ||
|
|
c4911f2db3 | ||
|
|
76e75522ed | ||
|
|
d62028b4c1 | ||
|
|
c35de31d42 | ||
|
|
e9e097e22c | ||
|
|
642f856bb8 | ||
|
|
6b5e3b9eff | ||
|
|
9adbc2ff37 | ||
|
|
0e0f34b8e4 | ||
|
|
71e1437ab5 | ||
|
|
41dc9ea06e | ||
|
|
5dcffdbcc2 | ||
|
|
a9477d1e0c | ||
|
|
5a76c7c8ee | ||
|
|
9a096f8e57 | ||
|
|
bc7650d87b | ||
|
|
544aaa3d13 | ||
|
|
f48fce093b | ||
|
|
6bf5308e34 | ||
|
|
353212137e | ||
|
|
5db75054e9 | ||
|
|
e1c8f1d01f | ||
|
|
765735cf52 | ||
|
|
59da01785e | ||
|
|
17215f751c | ||
|
|
96864a6ddf | ||
|
|
a115cc3748 | ||
|
|
3ce3e79769 | ||
|
|
381ac14ed7 | ||
|
|
4244b65b06 | ||
|
|
1e60f2c0a0 | ||
|
|
ceca379017 | ||
|
|
8c19216bac | ||
|
|
87f1a24810 | ||
|
|
da1718f266 | ||
|
|
28af24e9cf | ||
|
|
ed9ac85822 | ||
|
|
d716acdae3 | ||
|
|
4d5b7b3fda | ||
|
|
1555a9c566 | ||
|
|
56056571df | ||
|
|
6de61d8721 | ||
|
|
54df428799 | ||
|
|
5876ca27da | ||
|
|
9494fb6d0f | ||
|
|
673a4cb53d | ||
|
|
ad96a871a1 | ||
|
|
3d5c090872 | ||
|
|
69fd4e1c93 | ||
|
|
a19d9e8575 | ||
|
|
e28528f1c8 | ||
|
|
5ad1effc45 | ||
|
|
3e62c68d75 | ||
|
|
e90ea601fb | ||
|
|
b22e94d8d1 | ||
|
|
d1cd8b1cb8 | ||
|
|
76be7c612e | ||
|
|
dd750acbe2 | ||
|
|
ae222fe980 | ||
|
|
2193837a6a | ||
|
|
ed48e75e27 | ||
|
|
841da0352d | ||
|
|
56feb8665b | ||
|
|
ba413da1d5 | ||
|
|
0cd45fc2bc | ||
|
|
97bb38712f | ||
|
|
fef0c6b410 | ||
|
|
8083e03291 | ||
|
|
6b44b4a775 | ||
|
|
ae0ab74a88 | ||
|
|
72975df6c8 | ||
|
|
1c2b6e7e83 | ||
|
|
124eb69c78 | ||
|
|
eada8a875c | ||
|
|
be0100d01c | ||
|
|
416729e2d7 | ||
|
|
16581080e5 | ||
|
|
3e2b198ba3 | ||
|
|
dee6ad3d59 | ||
|
|
fa381acaf9 | ||
|
|
ea00545bea | ||
|
|
736903c64b | ||
|
|
24edf8d807 | ||
|
|
c0627b3fce | ||
|
|
1936718bb3 | ||
|
|
a37ae8b5eb | ||
|
|
cdba9ddd87 | ||
|
|
e61a5c95da | ||
|
|
9dc319eabb | ||
|
|
3541bc79d0 | ||
|
|
78673a08be | ||
|
|
a616fdad34 | ||
|
|
4a08a6e4c6 | ||
|
|
b790b435da | ||
|
|
84d2da6c9d | ||
|
|
9376f5f8f7 | ||
|
|
b7e200d7bd | ||
|
|
46540e4c10 | ||
|
|
ebb501ec73 | ||
|
|
c09e91dd23 | ||
|
|
eb6ca9854b | ||
|
|
0c0a1947e6 | ||
|
|
2fcda89939 | ||
|
|
97379c5ea7 | ||
|
|
8957c58609 | ||
|
|
ed886e1a92 | ||
|
|
5019413a05 | ||
|
|
5ea900cb5a | ||
|
|
bb117fffa8 | ||
|
|
e572e123b5 | ||
|
|
b465da5988 | ||
|
|
9e6dabcf22 | ||
|
|
e7b424d267 | ||
|
|
2ebbb994e3 | ||
|
|
4c7e28705f | ||
|
|
db5c1817fa | ||
|
|
65536214a3 | ||
|
|
3d93b63549 | ||
|
|
ab22562066 | ||
|
|
f3c1ec69d9 | ||
|
|
d8eaf9d827 | ||
|
|
96e08902b0 | ||
|
|
3778db1be5 | ||
|
|
d625c7cf82 | ||
|
|
0b09d266cc | ||
|
|
d6e0b23d46 | ||
|
|
19de545d86 | ||
|
|
672eccf57c | ||
|
|
cafb523ada | ||
|
|
c7ff218528 | ||
|
|
8f3c1d886f | ||
|
|
0d5fa05466 | ||
|
|
df11317985 | ||
|
|
bd9cc179e8 | ||
|
|
4a238dd9b2 | ||
|
|
88ccf47205 | ||
|
|
972179cdcd | ||
|
|
1403707fc6 | ||
|
|
eccd8017ff | ||
|
|
2e6754eac2 | ||
|
|
b3235a0b1a | ||
|
|
f1675f765f | ||
|
|
3a0c5378ab | ||
|
|
1bd2c2c553 | ||
|
|
905f0ab5b5 | ||
|
|
4bd1a3bd5f | ||
|
|
d2e836f2f3 | ||
|
|
c9a1615157 | ||
|
|
1530a74fd4 | ||
|
|
d8db706acb | ||
|
|
3f94b6d87f | ||
|
|
7769ea051d | ||
|
|
ec92110572 | ||
|
|
27d24eb0a9 | ||
|
|
ab25b82a91 | ||
|
|
d05d6d65c4 | ||
|
|
e077391982 | ||
|
|
fc39849c35 | ||
|
|
29fa0566d5 | ||
|
|
aac1b31ea4 | ||
|
|
df14a46013 | ||
|
|
03ed742a3a | ||
|
|
8c5b13ad59 | ||
|
|
c7376fc415 | ||
|
|
cff070aba6 | ||
|
|
41cafb2bf9 | ||
|
|
2dcea03712 | ||
|
|
7db6bdf4ab | ||
|
|
694952d545 | ||
|
|
418fe668b3 | ||
|
|
7081d82c37 | ||
|
|
232fe7cd70 | ||
|
|
74d2bae4d3 | ||
|
|
4ac4923f47 | ||
|
|
ab50ae3ef4 | ||
|
|
6b620a0f08 | ||
|
|
bd52cf150e | ||
|
|
5c5b225696 | ||
|
|
5b1e1f1074 | ||
|
|
e9ed88126e | ||
|
|
1c673e5681 | ||
|
|
324cde7a86 | ||
|
|
492c863455 | ||
|
|
fc4d443696 | ||
|
|
bd35d903a0 | ||
|
|
afbb244362 | ||
|
|
79bef85e05 | ||
|
|
c029744506 | ||
|
|
8bd91918ac | ||
|
|
fe00f95828 | ||
|
|
21b45b9bab | ||
|
|
48053e8a45 | ||
|
|
bba37df2c9 | ||
|
|
4161d76349 | ||
|
|
b94aa0c838 | ||
|
|
f004128678 | ||
|
|
f779516f42 | ||
|
|
830ba58777 | ||
|
|
ec7106309c | ||
|
|
4c6e146df9 | ||
|
|
7a480e4859 | ||
|
|
c29e6630c1 | ||
|
|
0b77c4a751 | ||
|
|
e4622df9ab | ||
|
|
9c1b05828a | ||
|
|
3de00cc75d | ||
|
|
bd5002f582 | ||
|
|
6ef4eabc0a | ||
|
|
9a4377be0d | ||
|
|
3e321a3acd | ||
|
|
d91a84b534 | ||
|
|
14e6ad8cfe | ||
|
|
70e750f597 | ||
|
|
24e0406c0f | ||
|
|
de678e0c92 | ||
|
|
25fe729532 | ||
|
|
91afb785a1 | ||
|
|
4a9905302a | ||
|
|
0badb0b1bd | ||
|
|
a7934c446a | ||
|
|
5eefc0086d | ||
|
|
d119927475 | ||
|
|
3b22fc2c87 | ||
|
|
71b9380145 | ||
|
|
ec7e3dbad7 | ||
|
|
cd3086ff44 | ||
|
|
fb64a49243 | ||
|
|
a34730cf6a | ||
|
|
9f0a806aef | ||
|
|
352ac82db5 | ||
|
|
9e807fe3fe | ||
|
|
ebd54dbd6e | ||
|
|
cd4fe97852 | ||
|
|
607f9f98ae | ||
|
|
fca396b374 | ||
|
|
b03f6cd3eb | ||
|
|
335fe260a8 | ||
|
|
9edd6ee895 | ||
|
|
411013ea45 | ||
|
|
b34c5ce4b2 | ||
|
|
db33117cc8 | ||
|
|
1039bfcfc0 | ||
|
|
1ef3cf44a8 | ||
|
|
bd432015d3 | ||
|
|
1688901321 | ||
|
|
85cdf7dd4e | ||
|
|
c3f4995586 | ||
|
|
0d21f49a80 | ||
|
|
40277998cb | ||
|
|
2118733045 | ||
|
|
c7210d9a3f | ||
|
|
4eb83e3204 | ||
|
|
923b22483b | ||
|
|
57597d42ca | ||
|
|
96f94bc925 | ||
|
|
8930c7ae3f | ||
|
|
940d5852c6 | ||
|
|
4ebe65f839 | ||
|
|
fc1d292dca | ||
|
|
6dd061adfd | ||
|
|
5fbce0b8d9 | ||
|
|
03ebd1bbb3 | ||
|
|
9d542ceebc | ||
|
|
7bd0a5e7cc | ||
|
|
f71c4e16e9 | ||
|
|
316cbe2446 | ||
|
|
4f2c69a4e3 | ||
|
|
9311774c49 | ||
|
|
4a42aaee28 | ||
|
|
ce56f63c41 | ||
|
|
e6baedddcf | ||
|
|
adb89e68d4 | ||
|
|
b7afd3e22a | ||
|
|
7c24e0d1b8 | ||
|
|
3e564704bc | ||
|
|
2964d8d691 | ||
|
|
b4d42f1a71 | ||
|
|
15ee6935ab | ||
|
|
8e355f7fdb | ||
|
|
37c25658ef | ||
|
|
974ebe6349 | ||
|
|
7c427ec38d | ||
|
|
e45929260c | ||
|
|
6e1326fcdf | ||
|
|
b667a3ef63 | ||
|
|
8c947e9291 | ||
|
|
e61d85e082 | ||
|
|
23e23f1dc0 | ||
|
|
613939fc82 | ||
|
|
68b83f252d | ||
|
|
d09c5753e3 | ||
|
|
33c1c0e102 | ||
|
|
0076e03641 | ||
|
|
ce34ec4f54 | ||
|
|
f0fa880d24 | ||
|
|
ac462b1c47 | ||
|
|
d52b411716 | ||
|
|
ae74d1bdeb | ||
|
|
d492b80ddd | ||
|
|
825e859a90 | ||
|
|
acbc4cdecb | ||
|
|
ef364d3abc | ||
|
|
5629c4be07 | ||
|
|
f25a77e6b9 | ||
|
|
e75100f549 | ||
|
|
efeb998a2b | ||
|
|
389d418445 | ||
|
|
6389c773a4 | ||
|
|
71275457ca | ||
|
|
3ac35719d8 | ||
|
|
7b5db576fd | ||
|
|
d3cd7abe85 | ||
|
|
084c60d318 | ||
|
|
11f51b6714 | ||
|
|
b1c7368f95 | ||
|
|
630a8beda3 | ||
|
|
f9907503f8 | ||
|
|
fda4724d81 | ||
|
|
80b5675fa6 | ||
|
|
f9722dbeca | ||
|
|
61ae593661 | ||
|
|
9166682dc6 | ||
|
|
17d3c61edd | ||
|
|
84af9d8770 | ||
|
|
31575a449a | ||
|
|
cec0ddc8ec | ||
|
|
075257ab04 | ||
|
|
2577da9ebd | ||
|
|
a3c5997c57 | ||
|
|
a1766af582 | ||
|
|
2108801855 | ||
|
|
be16e28ece | ||
|
|
e23ea74f32 | ||
|
|
8dad2fd693 | ||
|
|
0b5f07fe37 | ||
|
|
a8760203f9 | ||
|
|
bb0b1004f8 | ||
|
|
639f8e2af3 | ||
|
|
41bc9956eb | ||
|
|
77a7746616 | ||
|
|
e6ad393358 | ||
|
|
58f5513182 | ||
|
|
bcb1b89834 | ||
|
|
da014d5597 | ||
|
|
8c7d3d1a07 | ||
|
|
ef840950ad | ||
|
|
c46afd6edc | ||
|
|
8fd3ac046d | ||
|
|
474bac0c33 | ||
|
|
373ee26f95 | ||
|
|
2fce9312f3 | ||
|
|
b4b1cbcb53 | ||
|
|
77fe5954cd | ||
|
|
fce69059cf | ||
|
|
a848e47ced | ||
|
|
b3ff7ba044 | ||
|
|
d5653ba8a1 | ||
|
|
792331bdee | ||
|
|
4a45dd4c39 | ||
|
|
01aa4869cb | ||
|
|
ce1f0deafe | ||
|
|
507a4a4dea | ||
|
|
b1cbfd40f0 | ||
|
|
a540198ffb | ||
|
|
bab0f01ed9 | ||
|
|
c15c42abb3 | ||
|
|
2130926dd1 | ||
|
|
bc612d0e0c | ||
|
|
e1b6935d60 | ||
|
|
3e49c8acb0 | ||
|
|
d8b41eedce | ||
|
|
b5fbab6123 | ||
|
|
29a7b250e6 | ||
|
|
e89d987056 | ||
|
|
e243145c84 | ||
|
|
ce6dc3c0a8 | ||
|
|
905e54804a | ||
|
|
4b346ae8af | ||
|
|
07dc34f6da | ||
|
|
44d70cb154 | ||
|
|
a334348dc0 | ||
|
|
70e5e2f6a7 | ||
|
|
01a414eaf4 | ||
|
|
920a69a8d8 | ||
|
|
019ae27c24 | ||
|
|
98a4856a6e | ||
|
|
703d2c33c0 | ||
|
|
d8a55c48b3 | ||
|
|
b6377fc990 | ||
|
|
d9986db782 | ||
|
|
0d3489efca | ||
|
|
3fb3d594a2 | ||
|
|
6548e30465 | ||
|
|
a290cfee3e | ||
|
|
a1f7a986b8 | ||
|
|
c737eec91d | ||
|
|
f4b2b52624 | ||
|
|
cf38da00a1 | ||
|
|
00fc1211ae | ||
|
|
9886d436ff | ||
|
|
2672bcc9f8 | ||
|
|
5527b7269a | ||
|
|
d0d1c51aea | ||
|
|
eb7d51a3fa | ||
|
|
4785f2021a | ||
|
|
6b50c9429b | ||
|
|
6503fde658 | ||
|
|
dd7c3841ff | ||
|
|
9d67588c15 | ||
|
|
fef6333f52 | ||
|
|
455e68c030 | ||
|
|
82220a1490 | ||
|
|
d4da177d5b | ||
|
|
f9dd797a42 | ||
|
|
ee5ddb8b28 | ||
|
|
11936ad3f5 | ||
|
|
2901a8e7e8 | ||
|
|
8884e16864 | ||
|
|
34eb5e201d | ||
|
|
96a4f840e3 | ||
|
|
b3cc4d8edd | ||
|
|
231c3c7098 | ||
|
|
0dbd0641db | ||
|
|
b4b1a56e0c | ||
|
|
5574d64e03 | ||
|
|
b063cc34a3 | ||
|
|
38b8035b5c | ||
|
|
e5496f9628 | ||
|
|
d9a9800597 | ||
|
|
d0b4bbf5da | ||
|
|
0bc9eab243 | ||
|
|
df254ce03b | ||
|
|
ef68dd4a92 | ||
|
|
0dd6d00766 | ||
|
|
2a98fdffd6 | ||
|
|
07a11dad44 | ||
|
|
37f31ead9d | ||
|
|
3ffd5d81a4 | ||
|
|
23ac2c44c3 | ||
|
|
cee12aa852 | ||
|
|
153c7740c5 | ||
|
|
8ea8dc754a | ||
|
|
1a7ec87c8e | ||
|
|
f29997a846 | ||
|
|
097bad0003 | ||
|
|
b56cb1fc31 | ||
|
|
171b03febf | ||
|
|
f7e44c6c11 | ||
|
|
7b76a3e233 | ||
|
|
0696f5d268 | ||
|
|
5e817a50d2 | ||
|
|
6db1c35be9 | ||
|
|
e0c2776b6f | ||
|
|
f057a33c6f | ||
|
|
8767b41534 | ||
|
|
919fbaff86 | ||
|
|
bd13b04e20 | ||
|
|
1f19690914 | ||
|
|
465d1b0d65 | ||
|
|
37de544414 | ||
|
|
f1a28b96c9 | ||
|
|
b9b5c54cd4 | ||
|
|
0733f4c999 | ||
|
|
7ac3985d89 | ||
|
|
c74c132f7f | ||
|
|
d315ca4930 | ||
|
|
e330fb7e6b | ||
|
|
93e418562c | ||
|
|
cf39faca59 | ||
|
|
2ddcae247c | ||
|
|
19b2674f07 | ||
|
|
2291346f0c | ||
|
|
418d64a32e | ||
|
|
f0bf7634b7 | ||
|
|
6d118a0b9d | ||
|
|
78e92c1847 | ||
|
|
7b7fe902d9 | ||
|
|
ebfb2c5e1f | ||
|
|
29fd321033 | ||
|
|
3782b3fee4 | ||
|
|
c5f68b5cc7 | ||
|
|
4a84d1adfd | ||
|
|
188a1dcd0c | ||
|
|
db9119b918 | ||
|
|
b3d105e697 | ||
|
|
5e000ff00d | ||
|
|
932b2e2044 | ||
|
|
4c3630ec41 | ||
|
|
0deb1bb60a | ||
|
|
e599bba421 | ||
|
|
49cfc8d392 | ||
|
|
15ffd675ab | ||
|
|
6bfdd3a88a | ||
|
|
4ab7b16b95 | ||
|
|
8905a33daa | ||
|
|
68059334ff | ||
|
|
221be761f4 | ||
|
|
18a4233a53 | ||
|
|
429910b2ba | ||
|
|
7aca7b3174 | ||
|
|
60ccb80c9c | ||
|
|
173368911c | ||
|
|
319a0fd7d7 | ||
|
|
25adaaa56e | ||
|
|
5f6dddc6c9 | ||
|
|
655457b9ad | ||
|
|
162189c347 | ||
|
|
2331f5f97a | ||
|
|
94c66b3297 | ||
|
|
3432e9c6aa | ||
|
|
27414daadf | ||
|
|
43f44160b1 |
14
.gitignore
vendored
14
.gitignore
vendored
@@ -1,6 +1,7 @@
|
||||
*~
|
||||
*.bak
|
||||
*.bak[0-9]
|
||||
.gdb_history
|
||||
|
||||
.deps
|
||||
.libs
|
||||
@@ -13,7 +14,6 @@ Makefile.in
|
||||
/autom4te.cache
|
||||
/Doxyfile
|
||||
/aclocal.m4
|
||||
/build-aux
|
||||
/config.h
|
||||
/config.h.in
|
||||
/config.log
|
||||
@@ -22,7 +22,18 @@ Makefile.in
|
||||
/libtool
|
||||
/stamp-h1
|
||||
|
||||
build-aux/compile
|
||||
build-aux/config.guess
|
||||
build-aux/config.rpath
|
||||
build-aux/config.sub
|
||||
build-aux/depcomp
|
||||
build-aux/install-sh
|
||||
build-aux/ltmain.sh
|
||||
build-aux/missing
|
||||
build-aux/test-driver
|
||||
|
||||
/src/liblzma/liblzma.pc
|
||||
/src/lzmainfo/lzmainfo
|
||||
/src/xz/xz
|
||||
/src/xzdec/lzmadec
|
||||
/src/xzdec/xzdec
|
||||
@@ -51,4 +62,5 @@ Makefile.in
|
||||
/src/Makefile
|
||||
/src/liblzma/Makefile
|
||||
/src/liblzma/api/Makefile
|
||||
/src/lzmainfo/Makefile
|
||||
/src/xzdec/Makefile
|
||||
|
||||
6
AUTHORS
6
AUTHORS
@@ -16,11 +16,11 @@ Authors of XZ Utils
|
||||
|
||||
Some scripts have been adapted from gzip. The original versions
|
||||
were written by Jean-loup Gailly, Charles Levert, and Paul Eggert.
|
||||
Andrew Dudman helped adapting the script and their man pages for
|
||||
Andrew Dudman helped adapting the scripts and their man pages for
|
||||
XZ Utils.
|
||||
|
||||
The GNU Autotools based build system contains files from many authors,
|
||||
which I'm not trying list here.
|
||||
The GNU Autotools-based build system contains files from many authors,
|
||||
which I'm not trying to list here.
|
||||
|
||||
Several people have contributed fixes or reported bugs. Most of them
|
||||
are mentioned in the file THANKS.
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
@@ -56,7 +56,7 @@ 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
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
@@ -255,7 +255,7 @@ 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
|
||||
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
|
||||
@@ -277,9 +277,9 @@ 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
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
@@ -10,7 +10,7 @@
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
@@ -112,7 +112,7 @@ modification follow. Pay close attention to the difference between a
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
@@ -146,7 +146,7 @@ such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
@@ -432,7 +432,7 @@ 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
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
@@ -455,7 +455,7 @@ FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
@@ -500,5 +500,3 @@ necessary. Here is a sample; alter the names:
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
See the commit log in the git repository:
|
||||
|
||||
git://ctrl.tukaani.org/xz.git
|
||||
git clone http://git.tukaani.org/xz.git
|
||||
|
||||
Note that "make dist" doesn't put this tiny file into the package.
|
||||
Instead, the git commit log is used as ChangeLog. See dist-hook in
|
||||
|
||||
@@ -118,7 +118,7 @@ FULL_PATH_NAMES = YES
|
||||
# If left blank the directory from which doxygen is run is used as the
|
||||
# path to strip.
|
||||
|
||||
STRIP_FROM_PATH =
|
||||
STRIP_FROM_PATH = @top_srcdir@/src
|
||||
|
||||
# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
|
||||
# the path mentioned in the documentation of a class, which tells
|
||||
|
||||
351
INSTALL
351
INSTALL
@@ -6,20 +6,28 @@ XZ Utils Installation
|
||||
1. Supported platforms
|
||||
1.1. Compilers
|
||||
1.2. Platform-specific notes
|
||||
1.2.1. Darwin (Mac OS X)
|
||||
1.2.2. Tru64
|
||||
1.2.3. Windows
|
||||
1.2.4. DOS
|
||||
1.2.5. OS/2
|
||||
1.2.1. AIX
|
||||
1.2.2. IRIX
|
||||
1.2.3. MINIX 3
|
||||
1.2.4. OpenVMS
|
||||
1.2.5. Solaris, OpenSolaris, and derivatives
|
||||
1.2.6. Tru64
|
||||
1.2.7. Windows
|
||||
1.2.8. DOS
|
||||
1.3. Adding support for new platforms
|
||||
2. configure options
|
||||
2.1. Static vs. dynamic linking of liblzma
|
||||
2.2. Optimizing xzdec and lzmadec
|
||||
3. xzgrep and other scripts
|
||||
3.1. Dependencies
|
||||
3.2. PATH
|
||||
4. Troubleshooting
|
||||
4.1. "No C99 compiler was found."
|
||||
4.1. "No POSIX conforming shell (sh) was found."
|
||||
4.2. configure works but build fails at crc32_x86.S
|
||||
4.2. "No POSIX conforming shell (sh) was found."
|
||||
4.3. configure works but build fails at crc32_x86.S
|
||||
4.4. Lots of warnings about symbol visibility
|
||||
4.5. "make check" fails
|
||||
4.6. liblzma.so (or similar) not found when running xz
|
||||
|
||||
|
||||
0. Preface
|
||||
@@ -58,57 +66,101 @@ XZ Utils Installation
|
||||
|
||||
1.2. Platform-specific notes
|
||||
|
||||
1.2.1. Darwin (Mac OS X)
|
||||
1.2.1. AIX
|
||||
|
||||
You may need --disable-assembler if building universal binaries on
|
||||
Darwin. This is because different files are built when assembler is
|
||||
enabled, and there's no way to make it work with universal build.
|
||||
If you want to keep the assembler code, consider building one
|
||||
architecture at a time, and then combining the results to create
|
||||
universal binaries (see lipo(1)).
|
||||
If you use IBM XL C compiler, pass CC=xlc_r to configure. If
|
||||
you use CC=xlc instead, you must disable threading support
|
||||
with --disable-threads (usually not recommended).
|
||||
|
||||
|
||||
1.2.2. Tru64
|
||||
1.2.2. IRIX
|
||||
|
||||
MIPSpro 7.4.4m has been reported to produce broken code if using
|
||||
the -O2 optimization flag ("make check" fails). Using -O1 should
|
||||
work.
|
||||
|
||||
A problem has been reported when using shared liblzma. Passing
|
||||
--disable-shared to configure works around this. Alternatively,
|
||||
putting "-64" to CFLAGS to build a 64-bit version might help too.
|
||||
|
||||
|
||||
1.2.3. MINIX 3
|
||||
|
||||
The default install of MINIX 3 includes Amsterdam Compiler Kit (ACK),
|
||||
which doesn't support C99. Install GCC to compile XZ Utils.
|
||||
|
||||
MINIX 3.1.8 and older have bugs in /usr/include/stdint.h, which has
|
||||
to be patched before XZ Utils can be compiled correctly. See
|
||||
<http://gforge.cs.vu.nl/gf/project/minix/tracker/?action=TrackerItemEdit&tracker_item_id=537>.
|
||||
|
||||
MINIX 3.2.0 and later use a different libc and aren't affected by
|
||||
the above bug.
|
||||
|
||||
XZ Utils doesn't have code to detect the amount of physical RAM and
|
||||
number of CPU cores on MINIX 3.
|
||||
|
||||
See section 4.4 in this file about symbol visibility warnings (you
|
||||
may want to pass gl_cv_cc_visibility=no to configure).
|
||||
|
||||
|
||||
1.2.4. OpenVMS
|
||||
|
||||
XZ Utils can be built for OpenVMS, but the build system files
|
||||
are not included in the XZ Utils source package. The required
|
||||
OpenVMS-specific files are maintained by Jouk Jansen and can be
|
||||
downloaded here:
|
||||
|
||||
http://nchrem.tnw.tudelft.nl/openvms/software2.html#xzutils
|
||||
|
||||
|
||||
1.2.5. Solaris, OpenSolaris, and derivatives
|
||||
|
||||
The following linker error has been reported on some x86 systems:
|
||||
|
||||
ld: fatal: relocation error: R_386_GOTOFF: ...
|
||||
|
||||
This can be worked around by passing gl_cv_cc_visibility=no
|
||||
as an argument to the configure script.
|
||||
|
||||
|
||||
1.2.6. Tru64
|
||||
|
||||
If you try to use the native C compiler on Tru64 (passing CC=cc to
|
||||
configure), it is possible that the configure script will complain
|
||||
that no C99 compiler was found even when the native compiler supports
|
||||
C99. You can safely override the test for C99 compiler by passing
|
||||
ac_cv_prog_cc_c99= as the argument to the configure script.
|
||||
configure), you may need the workaround mention in section 4.1 in
|
||||
this file (pass also ac_cv_prog_cc_c99= to configure).
|
||||
|
||||
|
||||
1.2.3. Windows
|
||||
1.2.7. Windows
|
||||
|
||||
Building XZ Utils on Windows is supported under MinGW and Cygwin.
|
||||
If the Autotools based build gives you trouble with MinGW, you may
|
||||
want try the alternative method found from the "windows" directory.
|
||||
Building XZ Utils on Windows is supported under MinGW + MSYS,
|
||||
MinGW-w64 + MSYS, and Cygwin. There is windows/build.bash to
|
||||
ease packaging XZ Utils with MinGW(-w64) + MSYS into a
|
||||
redistributable .zip or .7z file. See windows/INSTALL-Windows.txt
|
||||
for more information.
|
||||
|
||||
MSVC doesn't support C99, thus it is not possible to use MSVC to
|
||||
compile XZ Utils. However, it is possible to use liblzma.dll from
|
||||
MSVC once liblzma.dll has been built with MinGW. The required
|
||||
import library for MSVC can be created from liblzma.def using the
|
||||
"lib" command shipped in MSVC:
|
||||
It may be possible to build liblzma with other toolchains too, but
|
||||
that will probably require writing a separate makefile. Building
|
||||
the command line tools with non-GNU toolchains will be harder than
|
||||
building only liblzma.
|
||||
|
||||
lib /def:liblzma.def /out:liblzma.lib /machine:ix86
|
||||
Starting with XZ Utils 5.2.0, building liblzma (not the whole
|
||||
XZ Utils) should work with MSVC 2013 update 2 or later using
|
||||
windows/config.h. No project files or makefiles are included yet,
|
||||
so the build process isn't as convenient yet as it could be.
|
||||
|
||||
On x86-64, the /machine argument has to naturally be changed:
|
||||
|
||||
lib /def:liblzma.def /out:liblzma.lib /machine:x64
|
||||
Even if liblzma is built with MinGW(-w64), the resulting DLL can
|
||||
be used by other compilers and linkers, including MSVC. See
|
||||
windows/README-Windows.txt for details.
|
||||
|
||||
|
||||
1.2.4. DOS
|
||||
1.2.8. DOS
|
||||
|
||||
There is an experimental Makefile in the "dos" directory to build
|
||||
XZ Utils on DOS using DJGPP. Support for long file names (LFN) is
|
||||
needed.
|
||||
needed. See dos/README for more information.
|
||||
|
||||
GNU Autotools based build hasn't been tried on DOS.
|
||||
|
||||
|
||||
1.2.5. OS/2
|
||||
|
||||
You will need to pass --disable-assembler to configure when building
|
||||
on OS/2.
|
||||
GNU Autotools based build hasn't been tried on DOS. If you try, I
|
||||
would like to hear if it worked.
|
||||
|
||||
|
||||
1.3. Adding support for new platforms
|
||||
@@ -128,7 +180,7 @@ XZ Utils Installation
|
||||
2. configure options
|
||||
--------------------
|
||||
|
||||
In most cases, the defaults are what you want. Most of the options
|
||||
In most cases, the defaults are what you want. Many of the options
|
||||
below are useful only when building a size-optimized version of
|
||||
liblzma or command line tools.
|
||||
|
||||
@@ -181,6 +233,35 @@ XZ Utils Installation
|
||||
the liblzma ABI, so this option should be used only when
|
||||
it is known to not cause problems.
|
||||
|
||||
--disable-xz
|
||||
--disable-xzdec
|
||||
--disable-lzmadec
|
||||
--disable-lzmainfo
|
||||
Don't build and install the command line tool mentioned
|
||||
in the option name.
|
||||
|
||||
NOTE: Disabling xz will skip some tests in "make check".
|
||||
|
||||
NOTE: If xzdec is disabled and lzmadec is left enabled,
|
||||
a dangling man page symlink lzmadec.1 -> xzdec.1 is
|
||||
created.
|
||||
|
||||
--disable-lzma-links
|
||||
Don't create symlinks for LZMA Utils compatibility.
|
||||
This includes lzma, unlzma, and lzcat. If scripts are
|
||||
installed, also lzdiff, lzcmp, lzgrep, lzegrep, lzfgrep,
|
||||
lzmore, and lzless will be omitted if this option is used.
|
||||
|
||||
--disable-scripts
|
||||
Don't install the scripts xzdiff, xzgrep, xzmore, xzless,
|
||||
and their symlinks.
|
||||
|
||||
--disable-doc
|
||||
Don't install the documentation files to $docdir
|
||||
(often /usr/doc/xz or /usr/local/doc/xz). Man pages
|
||||
will still be installed. The $docdir can be changed
|
||||
with --docdir=DIR.
|
||||
|
||||
--disable-assembler
|
||||
liblzma includes some assembler optimizations. Currently
|
||||
there is only assembler code for CRC32 and CRC64 for
|
||||
@@ -217,38 +298,62 @@ XZ Utils Installation
|
||||
means that the RAM holding the tables won't be shared
|
||||
between applications linked against shared liblzma.
|
||||
|
||||
--disable-threads
|
||||
Disable threading support. This makes some things
|
||||
thread-unsafe, meaning that if multithreaded application
|
||||
calls liblzma functions from more than one thread,
|
||||
something bad may happen.
|
||||
This option doesn't modify CFLAGS to tell the compiler
|
||||
to optimize for size. You need to add -Os or equivalent
|
||||
flag(s) to CFLAGS manually.
|
||||
|
||||
Use this option if threading support causes you trouble,
|
||||
or if you know that you will use liblzma only from
|
||||
single-threaded applications and want to avoid dependency
|
||||
on libpthread.
|
||||
--enable-assume-ram=SIZE
|
||||
On the most common operating systems, XZ Utils is able to
|
||||
detect the amount of physical memory on the system. This
|
||||
information is used by the options --memlimit-compress,
|
||||
--memlimit-decompress, and --memlimit when setting the
|
||||
limit to a percentage of total RAM.
|
||||
|
||||
--enable-dynamic=TYPE
|
||||
Specify how command line tools should be linked against
|
||||
liblzma. Possible TYPES:
|
||||
On some systems, there is no code to detect the amount of
|
||||
RAM though. Using --enable-assume-ram one can set how much
|
||||
memory to assume on these systems. SIZE is given as MiB.
|
||||
The default is 128 MiB.
|
||||
|
||||
yes All command line tools are linked against
|
||||
shared liblzma (if shared liblzma was built).
|
||||
This is equivalent to --enable-dynamic (i.e.
|
||||
no =TYPE).
|
||||
Feel free to send patches to add support for detecting
|
||||
the amount of RAM on the operating system you use. See
|
||||
src/common/tuklib_physmem.c for details.
|
||||
|
||||
mixed Some tools are linked against static liblzma
|
||||
and some against shared liblzma. This is the
|
||||
default and recommended way.
|
||||
--enable-threads=METHOD
|
||||
Threading support is enabled by default so normally there
|
||||
is no need to specify this option.
|
||||
|
||||
no All command line tools are linked against
|
||||
static liblzma (if static liblzma was built).
|
||||
This is equivalent to --disable-dynamic.
|
||||
Supported values for METHOD:
|
||||
|
||||
This option is mostly useful for packagers, if distro
|
||||
policy requires linking against shared libaries. See the
|
||||
file PACKAGERS for more information about pros and cons
|
||||
of this option.
|
||||
yes Autodetect the threading method. If none
|
||||
is found, configure will give an error.
|
||||
|
||||
posix Use POSIX pthreads. This is the default
|
||||
except on Windows outside Cygwin.
|
||||
|
||||
win95 Use Windows 95 compatible threads. This
|
||||
is compatible with Windows XP and later
|
||||
too. This is the default for 32-bit x86
|
||||
Windows builds. The `win95' threading is
|
||||
incompatible with --enable-small.
|
||||
|
||||
vista Use Windows Vista compatible threads. The
|
||||
resulting binaries won't run on Windows XP
|
||||
or older. This is the default for Windows
|
||||
excluding 32-bit x86 builds (that is, on
|
||||
x86-64 the default is `vista').
|
||||
|
||||
no Disable threading support. This is the
|
||||
same as using --disable-threads.
|
||||
NOTE: If combined with --enable-small, the
|
||||
resulting liblzma won't be thread safe,
|
||||
that is, if a multi-threaded application
|
||||
calls any liblzma functions from more than
|
||||
one thread, something bad may happen.
|
||||
|
||||
--enable-symbol-versions
|
||||
Use symbol versioning for liblzma. This is enabled by
|
||||
default on GNU/Linux, other GNU-based systems, and
|
||||
FreeBSD.
|
||||
|
||||
--enable-debug
|
||||
This enables the assert() macro and possibly some other
|
||||
@@ -262,6 +367,52 @@ XZ Utils Installation
|
||||
resulting binaries.
|
||||
|
||||
|
||||
2.1. Static vs. dynamic linking of liblzma
|
||||
|
||||
On 32-bit x86, linking against static liblzma can give a minor
|
||||
speed improvement. Static libraries on x86 are usually compiled as
|
||||
position-dependent code (non-PIC) and shared libraries are built as
|
||||
position-independent code (PIC). PIC wastes one register, which can
|
||||
make the code slightly slower compared to a non-PIC version. (Note
|
||||
that this doesn't apply to x86-64.)
|
||||
|
||||
If you want to link xz against static liblzma, the simplest way
|
||||
is to pass --disable-shared to configure. If you want also shared
|
||||
liblzma, run configure again and run "make install" only for
|
||||
src/liblzma.
|
||||
|
||||
|
||||
2.2. Optimizing xzdec and lzmadec
|
||||
|
||||
xzdec and lzmadec are intended to be relatively small instead of
|
||||
optimizing for the best speed. Thus, it is a good idea to build
|
||||
xzdec and lzmadec separately:
|
||||
|
||||
- To link the tools against static liblzma, pass --disable-shared
|
||||
to configure.
|
||||
|
||||
- To select somewhat size-optimized variant of some things in
|
||||
liblzma, pass --enable-small to configure.
|
||||
|
||||
- Tell the compiler to optimize for size instead of speed.
|
||||
E.g. with GCC, put -Os into CFLAGS.
|
||||
|
||||
- xzdec and lzmadec will never use multithreading capabilities of
|
||||
liblzma. You can avoid dependency on libpthread by passing
|
||||
--disable-threads to configure.
|
||||
|
||||
- There are and will be no translated messages for xzdec and
|
||||
lzmadec, so it is fine to pass also --disable-nls to configure.
|
||||
|
||||
- Only decoder code is needed, so you can speed up the build
|
||||
slightly by passing --disable-encoders to configure. This
|
||||
shouldn't affect the final size of the executables though,
|
||||
because the linker is able to omit the encoder code anyway.
|
||||
|
||||
If you have no use for xzdec or lzmadec, you can disable them with
|
||||
--disable-xzdec and --disable-lzmadec.
|
||||
|
||||
|
||||
3. xzgrep and other scripts
|
||||
---------------------------
|
||||
|
||||
@@ -273,11 +424,16 @@ XZ Utils Installation
|
||||
gl_cv_posix_shell=/path/to/posix-sh as an argument to the configure
|
||||
script.
|
||||
|
||||
Some of the scripts require also mktemp. The original mktemp can be
|
||||
found from <http://www.mktemp.org/>. On GNU, most will use the mktemp
|
||||
program from GNU coreutils instead of the original implementation.
|
||||
Both mktemp versions are fine for XZ Utils (and practically for
|
||||
everything else too).
|
||||
xzdiff (xzcmp/lzdiff/lzcmp) may use mktemp if it is available. As
|
||||
a fallback xzdiff will use mkdir to securely create a temporary
|
||||
directory. Having mktemp available is still recommended since the
|
||||
mkdir fallback method isn't as robust as mktemp is. The original
|
||||
mktemp can be found from <http://www.mktemp.org/>. On GNU, most will
|
||||
use the mktemp program from GNU coreutils instead of the original
|
||||
implementation. Both mktemp versions are fine.
|
||||
|
||||
In addition to using xz to decompress .xz files, xzgrep and xzdiff
|
||||
use gzip, bzip2, and lzop to support .gz, bz2, and .lzo files.
|
||||
|
||||
|
||||
3.2. PATH
|
||||
@@ -312,7 +468,7 @@ XZ Utils Installation
|
||||
support enough C99.
|
||||
|
||||
|
||||
4.1. "No POSIX conforming shell (sh) was found."
|
||||
4.2. "No POSIX conforming shell (sh) was found."
|
||||
|
||||
xzgrep and other scripts need a shell that (roughly) conforms
|
||||
to POSIX. The configure script tries to find such a shell. If
|
||||
@@ -321,7 +477,7 @@ XZ Utils Installation
|
||||
script.
|
||||
|
||||
|
||||
4.2. configure works but build fails at crc32_x86.S
|
||||
4.3. configure works but build fails at crc32_x86.S
|
||||
|
||||
The easy fix is to pass --disable-assembler to the configure script.
|
||||
|
||||
@@ -337,3 +493,48 @@ XZ Utils Installation
|
||||
correct configure triplet using the --build=CPU-COMPANY-SYSTEM option
|
||||
(see INSTALL.generic).
|
||||
|
||||
|
||||
4.4. Lots of warnings about symbol visibility
|
||||
|
||||
On some systems where symbol visibility isn't supported, GCC may
|
||||
still accept the visibility options and attributes, which will make
|
||||
configure think that visibility is supported. This will result in
|
||||
many compiler warnings. You can avoid the warnings by forcing the
|
||||
visibility support off by passing gl_cv_cc_visibility=no as an
|
||||
argument to the configure script. This has no effect on the
|
||||
resulting binaries, but fewer warnings looks nicer and may allow
|
||||
using --enable-werror.
|
||||
|
||||
|
||||
4.5. "make check" fails
|
||||
|
||||
If the other tests pass but test_scripts.sh fails, then the problem
|
||||
is in the scripts in src/scripts. Comparing the contents of
|
||||
tests/xzgrep_test_output to tests/xzgrep_expected_output might
|
||||
give a good idea about problems in xzgrep. One possibility is that
|
||||
some tools are missing from the current PATH or the tools lack
|
||||
support for some POSIX features. This can happen at least on
|
||||
Solaris where the tools in /bin may be ancient but good enough
|
||||
tools are available in /usr/xpg4/bin or /usr/xpg6/bin. One fix
|
||||
for this problem is described in section 3.2 of this file.
|
||||
|
||||
If tests other than test_scripts.sh fail, a likely reason is that
|
||||
libtool links the test programs against an installed version of
|
||||
liblzma instead of the version that was just built. This is
|
||||
obviously a bug which seems to happen on some platforms.
|
||||
A workaround is to uninstall the old liblzma versions first.
|
||||
|
||||
If the problem isn't any of those described above, then it's likely
|
||||
a bug in XZ Utils or in the compiler. See the platform-specific
|
||||
notes in this file for possible known problems. Please report
|
||||
a bug if you cannot solve the problem. See README for contact
|
||||
information.
|
||||
|
||||
|
||||
4.6. liblzma.so (or similar) not found when running xz
|
||||
|
||||
If you installed the package with "make install" and get an error
|
||||
about liblzma.so (or a similarly named file) being missing, try
|
||||
running "ldconfig" to update the run-time linker cache (if your
|
||||
operating system has such a command).
|
||||
|
||||
|
||||
@@ -2,10 +2,12 @@ Installation Instructions
|
||||
*************************
|
||||
|
||||
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
|
||||
2006, 2007, 2008, 2009 Free Software Foundation, Inc.
|
||||
2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
|
||||
|
||||
This file is free documentation; the Free Software Foundation gives
|
||||
unlimited permission to copy, distribute and modify it.
|
||||
Copying and distribution of this file, with or without modification,
|
||||
are permitted in any medium without royalty provided the copyright
|
||||
notice and this notice are preserved. This file is offered as-is,
|
||||
without warranty of any kind.
|
||||
|
||||
Basic Installation
|
||||
==================
|
||||
@@ -13,7 +15,11 @@ Basic Installation
|
||||
Briefly, the shell commands `./configure; make; make install' should
|
||||
configure, build, and install this package. The following
|
||||
more-detailed instructions are generic; see the `README' file for
|
||||
instructions specific to this package.
|
||||
instructions specific to this package. Some packages provide this
|
||||
`INSTALL' file but do not implement all of the features documented
|
||||
below. The lack of an optional feature in a given package is not
|
||||
necessarily a bug. More recommendations for GNU packages can be found
|
||||
in *note Makefile Conventions: (standards)Makefile Conventions.
|
||||
|
||||
The `configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation. It uses
|
||||
@@ -42,7 +48,7 @@ may remove or edit it.
|
||||
you want to change it or regenerate `configure' using a newer version
|
||||
of `autoconf'.
|
||||
|
||||
The simplest way to compile this package is:
|
||||
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.
|
||||
@@ -53,12 +59,22 @@ The simplest way to compile this package is:
|
||||
2. Type `make' to compile the package.
|
||||
|
||||
3. Optionally, type `make check' to run any self-tests that come with
|
||||
the package.
|
||||
the package, generally using the just-built uninstalled binaries.
|
||||
|
||||
4. Type `make install' to install the programs and any data files and
|
||||
documentation.
|
||||
documentation. When installing into a prefix owned by root, it is
|
||||
recommended that the package be configured and built as a regular
|
||||
user, and only the `make install' phase executed with root
|
||||
privileges.
|
||||
|
||||
5. You can remove the program binaries and object files from the
|
||||
5. Optionally, type `make installcheck' to repeat any self-tests, but
|
||||
this time using the binaries in their final installed location.
|
||||
This target does not install anything. Running this target as a
|
||||
regular user, particularly if the prior `make install' required
|
||||
root privileges, verifies that the installation completed
|
||||
correctly.
|
||||
|
||||
6. 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
|
||||
@@ -67,8 +83,15 @@ The simplest way to compile this package is:
|
||||
all sorts of other programs in order to regenerate files that came
|
||||
with the distribution.
|
||||
|
||||
6. Often, you can also type `make uninstall' to remove the installed
|
||||
files again.
|
||||
7. Often, you can also type `make uninstall' to remove the installed
|
||||
files again. In practice, not all packages have tested that
|
||||
uninstallation works correctly, even though it is required by the
|
||||
GNU Coding Standards.
|
||||
|
||||
8. Some packages, particularly those that use Automake, provide `make
|
||||
distcheck', which can by used by developers to test that all other
|
||||
targets like `make install' and `make uninstall' work correctly.
|
||||
This target is generally not run by end users.
|
||||
|
||||
Compilers and Options
|
||||
=====================
|
||||
@@ -93,7 +116,8 @@ same time, by placing the object files for each architecture in their
|
||||
own directory. To do this, you can use GNU `make'. `cd' to the
|
||||
directory where you want the object files and executables to go and run
|
||||
the `configure' script. `configure' automatically checks for the
|
||||
source code in the directory that `configure' is in and in `..'.
|
||||
source code in the directory that `configure' is in and in `..'. This
|
||||
is known as a "VPATH" build.
|
||||
|
||||
With a non-GNU `make', it is safer to compile the package for one
|
||||
architecture at a time in the source code directory. After you have
|
||||
@@ -120,7 +144,8 @@ Installation Names
|
||||
By default, `make install' installs the package's commands under
|
||||
`/usr/local/bin', include files under `/usr/local/include', etc. You
|
||||
can specify an installation prefix other than `/usr/local' by giving
|
||||
`configure' the option `--prefix=PREFIX'.
|
||||
`configure' the option `--prefix=PREFIX', where PREFIX must be an
|
||||
absolute file name.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
@@ -131,15 +156,46 @@ Documentation and other data files still use the regular prefix.
|
||||
In addition, if you use an unusual directory layout you can give
|
||||
options like `--bindir=DIR' 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.
|
||||
you can set and what kinds of files go in them. In general, the
|
||||
default for these options is expressed in terms of `${prefix}', so that
|
||||
specifying just `--prefix' will affect all of the other directory
|
||||
specifications that were not explicitly provided.
|
||||
|
||||
The most portable way to affect installation locations is to pass the
|
||||
correct locations to `configure'; however, many packages provide one or
|
||||
both of the following shortcuts of passing variable assignments to the
|
||||
`make install' command line to change installation locations without
|
||||
having to reconfigure or recompile.
|
||||
|
||||
The first method involves providing an override variable for each
|
||||
affected directory. For example, `make install
|
||||
prefix=/alternate/directory' will choose an alternate location for all
|
||||
directory configuration variables that were expressed in terms of
|
||||
`${prefix}'. Any directories that were specified during `configure',
|
||||
but not in terms of `${prefix}', must each be overridden at install
|
||||
time for the entire installation to be relocated. The approach of
|
||||
makefile variable overrides for each directory variable is required by
|
||||
the GNU Coding Standards, and ideally causes no recompilation.
|
||||
However, some platforms have known limitations with the semantics of
|
||||
shared libraries that end up requiring recompilation when using this
|
||||
method, particularly noticeable in packages that use GNU Libtool.
|
||||
|
||||
The second method involves providing the `DESTDIR' variable. For
|
||||
example, `make install DESTDIR=/alternate/directory' will prepend
|
||||
`/alternate/directory' before all installation names. The approach of
|
||||
`DESTDIR' overrides is not required by the GNU Coding Standards, and
|
||||
does not work on platforms that have drive letters. On the other hand,
|
||||
it does better at avoiding recompilation issues, and works well even
|
||||
when some directory options were not specified in terms of `${prefix}'
|
||||
at `configure' time.
|
||||
|
||||
Optional Features
|
||||
=================
|
||||
|
||||
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
|
||||
@@ -152,6 +208,13 @@ 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.
|
||||
|
||||
Some packages offer the ability to configure how verbose the
|
||||
execution of `make' will be. For these packages, running `./configure
|
||||
--enable-silent-rules' sets the default to minimal output, which can be
|
||||
overridden with `make V=1'; while running `./configure
|
||||
--disable-silent-rules' sets the default to verbose, which can be
|
||||
overridden with `make V=0'.
|
||||
|
||||
Particular systems
|
||||
==================
|
||||
|
||||
@@ -288,7 +351,7 @@ operates.
|
||||
`configure' can determine that directory automatically.
|
||||
|
||||
`--prefix=DIR'
|
||||
Use DIR as the installation prefix. *Note Installation Names::
|
||||
Use DIR as the installation prefix. *note Installation Names::
|
||||
for more details, including other options available for fine-tuning
|
||||
the installation locations.
|
||||
|
||||
|
||||
47
Makefile.am
47
Makefile.am
@@ -5,6 +5,9 @@
|
||||
## You can do whatever you want with this file.
|
||||
##
|
||||
|
||||
# Use -n to prevent gzip from adding a timestamp to the .gz headers.
|
||||
GZIP_ENV = -9n
|
||||
|
||||
DIST_SUBDIRS = lib src po tests debug
|
||||
SUBDIRS =
|
||||
|
||||
@@ -14,6 +17,7 @@ endif
|
||||
|
||||
SUBDIRS += src po tests
|
||||
|
||||
if COND_DOC
|
||||
dist_doc_DATA = \
|
||||
AUTHORS \
|
||||
COPYING \
|
||||
@@ -27,18 +31,35 @@ dist_doc_DATA = \
|
||||
doc/xz-file-format.txt \
|
||||
doc/lzma-file-format.txt
|
||||
|
||||
examplesdir = $(docdir)/examples
|
||||
dist_examples_DATA = \
|
||||
doc/examples/00_README.txt \
|
||||
doc/examples/01_compress_easy.c \
|
||||
doc/examples/02_decompress.c \
|
||||
doc/examples/03_compress_custom.c \
|
||||
doc/examples/04_compress_easy_mt.c \
|
||||
doc/examples/Makefile
|
||||
|
||||
examplesolddir = $(docdir)/examples_old
|
||||
dist_examplesold_DATA = \
|
||||
doc/examples_old/xz_pipe_comp.c \
|
||||
doc/examples_old/xz_pipe_decomp.c
|
||||
endif
|
||||
|
||||
EXTRA_DIST = \
|
||||
extra \
|
||||
dos \
|
||||
windows \
|
||||
macosx \
|
||||
autogen.sh \
|
||||
version.sh \
|
||||
Doxyfile.in \
|
||||
COPYING.GPLv2 \
|
||||
COPYING.GPLv3 \
|
||||
COPYING.LGPLv2.1 \
|
||||
INSTALL.generic \
|
||||
PACKAGERS
|
||||
PACKAGERS \
|
||||
build-aux/manconv.sh \
|
||||
build-aux/version.sh
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
@@ -46,6 +67,7 @@ ACLOCAL_AMFLAGS = -I m4
|
||||
manfiles = \
|
||||
src/xz/xz.1 \
|
||||
src/xzdec/xzdec.1 \
|
||||
src/lzmainfo/lzmainfo.1 \
|
||||
src/scripts/xzdiff.1 \
|
||||
src/scripts/xzgrep.1 \
|
||||
src/scripts/xzless.1 \
|
||||
@@ -63,18 +85,25 @@ dist-hook:
|
||||
$(MKDIR_P) "$$dest/pdf-a4" "$$dest/pdf-letter" "$$dest/txt" && \
|
||||
for FILE in $(manfiles); do \
|
||||
BASE=`basename $$FILE .1` && \
|
||||
groff -man -t -Tps -P-pa4 < "$(srcdir)/$$FILE" \
|
||||
| ps2pdf - - \
|
||||
sh "$(srcdir)/build-aux/manconv.sh" pdf a4 \
|
||||
< "$(srcdir)/$$FILE" \
|
||||
> "$$dest/pdf-a4/$$BASE-a4.pdf" && \
|
||||
groff -man -t -Tps -P-pletter < "$(srcdir)/$$FILE" \
|
||||
| ps2pdf - - \
|
||||
sh "$(srcdir)/build-aux/manconv.sh" pdf letter \
|
||||
< "$(srcdir)/$$FILE" \
|
||||
> "$$dest/pdf-letter/$$BASE-letter.pdf" && \
|
||||
groff -man -t -Tascii < "$(srcdir)/$$FILE" \
|
||||
| col -bx > "$$dest/txt/$$BASE.txt"; \
|
||||
sh "$(srcdir)/build-aux/manconv.sh" ascii \
|
||||
< "$(srcdir)/$$FILE" \
|
||||
> "$$dest/txt/$$BASE.txt"; \
|
||||
done; \
|
||||
fi
|
||||
|
||||
# This works with GNU tar and gives cleaner package than normal 'make dist'.
|
||||
mydist:
|
||||
sh "$(srcdir)/src/liblzma/validate_map.sh"
|
||||
VERSION=$(VERSION); \
|
||||
if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \
|
||||
SNAPSHOT=`cd "$(srcdir)" && git describe --abbrev=4 | cut -b2-`; \
|
||||
test -n "$$SNAPSHOT" && VERSION=$$SNAPSHOT; \
|
||||
fi; \
|
||||
TAR_OPTIONS='--owner=0 --group=0 --numeric-owner --mode=u+rw,go+r-w' \
|
||||
$(MAKE) dist-gzip
|
||||
$(MAKE) VERSION="$$VERSION" dist-gzip
|
||||
|
||||
472
NEWS
472
NEWS
@@ -0,0 +1,472 @@
|
||||
|
||||
XZ Utils Release Notes
|
||||
======================
|
||||
|
||||
5.2.0 (2014-12-21)
|
||||
|
||||
Since 5.1.4beta:
|
||||
|
||||
* All fixes from 5.0.8
|
||||
|
||||
* liblzma: Fixed lzma_stream_encoder_mt_memusage() when a preset
|
||||
was used.
|
||||
|
||||
* xzdiff: If mktemp isn't installed, mkdir will be used as
|
||||
a fallback to create a temporary directory. Installing mktemp
|
||||
is still recommended.
|
||||
|
||||
* Updated French, German, Italian, Polish, and Vietnamese
|
||||
translations.
|
||||
|
||||
Summary of fixes and new features added in the 5.1.x development
|
||||
releases:
|
||||
|
||||
* liblzma:
|
||||
|
||||
- Added support for multi-threaded compression. See the
|
||||
lzma_mt structure, lzma_stream_encoder_mt(), and
|
||||
lzma_stream_encoder_mt_memusage() in <lzma/container.h>,
|
||||
lzma_get_progress() in <lzma/base.h>, and lzma_cputhreads()
|
||||
in <lzma/hardware.h> for details.
|
||||
|
||||
- Made the uses of lzma_allocator const correct.
|
||||
|
||||
- Added lzma_block_uncomp_encode() to create uncompressed
|
||||
.xz Blocks using LZMA2 uncompressed chunks.
|
||||
|
||||
- Added support for LZMA_IGNORE_CHECK.
|
||||
|
||||
- A few speed optimizations were made.
|
||||
|
||||
- Added support for symbol versioning. It is enabled by default
|
||||
on GNU/Linux, other GNU-based systems, and FreeBSD.
|
||||
|
||||
- liblzma (not the whole XZ Utils) should now be buildable
|
||||
with MSVC 2013 update 2 or later using windows/config.h.
|
||||
|
||||
* xz:
|
||||
|
||||
- Fixed a race condition in the signal handling. It was
|
||||
possible that e.g. the first SIGINT didn't make xz exit
|
||||
if reading or writing blocked and one had bad luck. The fix
|
||||
is non-trivial, so as of writing it is unknown if it will be
|
||||
backported to the v5.0 branch.
|
||||
|
||||
- Multi-threaded decompression can be enabled with the
|
||||
--threads (-T) option.
|
||||
|
||||
- New command line options in xz: --single-stream,
|
||||
--block-size=SIZE, --block-list=SIZES,
|
||||
--flush-timeout=TIMEOUT, and --ignore-check.
|
||||
|
||||
- xz -lvv now shows the minimum xz version that is required to
|
||||
decompress the file. Currently it is 5.0.0 for all supported
|
||||
.xz files except files with empty LZMA2 streams require 5.0.2.
|
||||
|
||||
* xzdiff and xzgrep now support .lzo files if lzop is installed.
|
||||
The .tzo suffix is also recognized as a shorthand for .tar.lzo.
|
||||
|
||||
|
||||
5.1.4beta (2014-09-14)
|
||||
|
||||
* All fixes from 5.0.6
|
||||
|
||||
* liblzma: Fixed the use of presets in threaded encoder
|
||||
initialization.
|
||||
|
||||
* xz --block-list and --block-size can now be used together
|
||||
in single-threaded mode. Previously the combination only
|
||||
worked in multi-threaded mode.
|
||||
|
||||
* Added support for LZMA_IGNORE_CHECK to liblzma and made it
|
||||
available in xz as --ignore-check.
|
||||
|
||||
* liblzma speed optimizations:
|
||||
|
||||
- Initialization of a new LZMA1 or LZMA2 encoder has been
|
||||
optimized. (The speed of reinitializing an already-allocated
|
||||
encoder isn't affected.) This helps when compressing many
|
||||
small buffers with lzma_stream_buffer_encode() and other
|
||||
similar situations where an already-allocated encoder state
|
||||
isn't reused. This speed-up is visible in xz too if one
|
||||
compresses many small files one at a time instead running xz
|
||||
once and giving all files as command-line arguments.
|
||||
|
||||
- Buffer comparisons are now much faster when unaligned access
|
||||
is allowed (configured with --enable-unaligned-access). This
|
||||
speeds up encoding significantly. There is arch-specific code
|
||||
for 32-bit and 64-bit x86 (32-bit needs SSE2 for the best
|
||||
results and there's no run-time CPU detection for now).
|
||||
For other archs there is only generic code which probably
|
||||
isn't as optimal as arch-specific solutions could be.
|
||||
|
||||
- A few speed optimizations were made to the SHA-256 code.
|
||||
(Note that the builtin SHA-256 code isn't used on all
|
||||
operating systems.)
|
||||
|
||||
* liblzma can now be built with MSVC 2013 update 2 or later
|
||||
using windows/config.h.
|
||||
|
||||
* Vietnamese translation was added.
|
||||
|
||||
|
||||
5.1.3alpha (2013-10-26)
|
||||
|
||||
* All fixes from 5.0.5
|
||||
|
||||
* liblzma:
|
||||
|
||||
- Fixed a deadlock in the threaded encoder.
|
||||
|
||||
- Made the uses of lzma_allocator const correct.
|
||||
|
||||
- Added lzma_block_uncomp_encode() to create uncompressed
|
||||
.xz Blocks using LZMA2 uncompressed chunks.
|
||||
|
||||
- Added support for native threads on Windows and the ability
|
||||
to detect the number of CPU cores.
|
||||
|
||||
* xz:
|
||||
|
||||
- Fixed a race condition in the signal handling. It was
|
||||
possible that e.g. the first SIGINT didn't make xz exit
|
||||
if reading or writing blocked and one had bad luck. The fix
|
||||
is non-trivial, so as of writing it is unknown if it will be
|
||||
backported to the v5.0 branch.
|
||||
|
||||
- Made the progress indicator work correctly in threaded mode.
|
||||
|
||||
- Threaded encoder now works together with --block-list=SIZES.
|
||||
|
||||
- Added preliminary support for --flush-timeout=TIMEOUT.
|
||||
It can be useful for (somewhat) real-time streaming. For
|
||||
now the decompression side has to be done with something
|
||||
else than the xz tool due to how xz does buffering, but this
|
||||
should be fixed.
|
||||
|
||||
|
||||
5.1.2alpha (2012-07-04)
|
||||
|
||||
* All fixes from 5.0.3 and 5.0.4
|
||||
|
||||
* liblzma:
|
||||
|
||||
- Fixed a deadlock and an invalid free() in the threaded encoder.
|
||||
|
||||
- Added support for symbol versioning. It is enabled by default
|
||||
on GNU/Linux, other GNU-based systems, and FreeBSD.
|
||||
|
||||
- Use SHA-256 implementation from the operating system if one is
|
||||
available in libc, libmd, or libutil. liblzma won't use e.g.
|
||||
OpenSSL or libgcrypt to avoid introducing new dependencies.
|
||||
|
||||
- Fixed liblzma.pc for static linking.
|
||||
|
||||
- Fixed a few portability bugs.
|
||||
|
||||
* xz --decompress --single-stream now fixes the input position after
|
||||
successful decompression. Now the following works:
|
||||
|
||||
echo foo | xz > foo.xz
|
||||
echo bar | xz >> foo.xz
|
||||
( xz -dc --single-stream ; xz -dc --single-stream ) < foo.xz
|
||||
|
||||
Note that it doesn't work if the input is not seekable
|
||||
or if there is Stream Padding between the concatenated
|
||||
.xz Streams.
|
||||
|
||||
* xz -lvv now shows the minimum xz version that is required to
|
||||
decompress the file. Currently it is 5.0.0 for all supported .xz
|
||||
files except files with empty LZMA2 streams require 5.0.2.
|
||||
|
||||
* Added an *incomplete* implementation of --block-list=SIZES to xz.
|
||||
It only works correctly in single-threaded mode and when
|
||||
--block-size isn't used at the same time. --block-list allows
|
||||
specifying the sizes of Blocks which can be useful e.g. when
|
||||
creating files for random-access reading.
|
||||
|
||||
|
||||
5.1.1alpha (2011-04-12)
|
||||
|
||||
* All fixes from 5.0.2
|
||||
|
||||
* liblzma fixes that will also be included in 5.0.3:
|
||||
|
||||
- A memory leak was fixed.
|
||||
|
||||
- lzma_stream_buffer_encode() no longer creates an empty .xz
|
||||
Block if encoding an empty buffer. Such an empty Block with
|
||||
LZMA2 data would trigger a bug in 5.0.1 and older (see the
|
||||
first bullet point in 5.0.2 notes). When releasing 5.0.2,
|
||||
I thought that no encoder creates this kind of files but
|
||||
I was wrong.
|
||||
|
||||
- Validate function arguments better in a few functions. Most
|
||||
importantly, specifying an unsupported integrity check to
|
||||
lzma_stream_buffer_encode() no longer creates a corrupt .xz
|
||||
file. Probably no application tries to do that, so this
|
||||
shouldn't be a big problem in practice.
|
||||
|
||||
- Document that lzma_block_buffer_encode(),
|
||||
lzma_easy_buffer_encode(), lzma_stream_encoder(), and
|
||||
lzma_stream_buffer_encode() may return LZMA_UNSUPPORTED_CHECK.
|
||||
|
||||
- The return values of the _memusage() functions are now
|
||||
documented better.
|
||||
|
||||
* Support for multithreaded compression was added using the simplest
|
||||
method, which splits the input data into blocks and compresses
|
||||
them independently. Other methods will be added in the future.
|
||||
The current method has room for improvement, e.g. it is possible
|
||||
to reduce the memory usage.
|
||||
|
||||
* Added the options --single-stream and --block-size=SIZE to xz.
|
||||
|
||||
* xzdiff and xzgrep now support .lzo files if lzop is installed.
|
||||
The .tzo suffix is also recognized as a shorthand for .tar.lzo.
|
||||
|
||||
* Support for short 8.3 filenames under DOS was added to xz. It is
|
||||
experimental and may change before it gets into a stable release.
|
||||
|
||||
|
||||
5.0.8 (2014-12-21)
|
||||
|
||||
* Fixed an old bug in xzgrep that affected OpenBSD and probably
|
||||
a few other operating systems too.
|
||||
|
||||
* Updated French and German translations.
|
||||
|
||||
* Added support for detecting the amount of RAM on AmigaOS/AROS.
|
||||
|
||||
* Minor build system updates.
|
||||
|
||||
|
||||
5.0.7 (2014-09-20)
|
||||
|
||||
* Fix regressions introduced in 5.0.6:
|
||||
|
||||
- Fix building with non-GNU make.
|
||||
|
||||
- Fix invalid Libs.private value in liblzma.pc which broke
|
||||
static linking against liblzma if the linker flags were
|
||||
taken from pkg-config.
|
||||
|
||||
|
||||
5.0.6 (2014-09-14)
|
||||
|
||||
* xzgrep now exits with status 0 if at least one file matched.
|
||||
|
||||
* A few minor portability and build system fixes
|
||||
|
||||
|
||||
5.0.5 (2013-06-30)
|
||||
|
||||
* lzmadec and liblzma's lzma_alone_decoder(): Support decompressing
|
||||
.lzma files that have less common settings in the headers
|
||||
(dictionary size other than 2^n or 2^n + 2^(n-1), or uncompressed
|
||||
size greater than 256 GiB). The limitations existed to avoid false
|
||||
positives when detecting .lzma files. The lc + lp <= 4 limitation
|
||||
still remains since liblzma's LZMA decoder has that limitation.
|
||||
|
||||
NOTE: xz's .lzma support or liblzma's lzma_auto_decoder() are NOT
|
||||
affected by this change. They still consider uncommon .lzma headers
|
||||
as not being in the .lzma format. Changing this would give way too
|
||||
many false positives.
|
||||
|
||||
* xz:
|
||||
|
||||
- Interaction of preset and custom filter chain options was
|
||||
made less illogical. This affects only certain less typical
|
||||
uses cases so few people are expected to notice this change.
|
||||
|
||||
Now when a custom filter chain option (e.g. --lzma2) is
|
||||
specified, all preset options (-0 ... -9, -e) earlier are on
|
||||
the command line are completely forgotten. Similarly, when
|
||||
a preset option is specified, all custom filter chain options
|
||||
earlier on the command line are completely forgotten.
|
||||
|
||||
Example 1: "xz -9 --lzma2=preset=5 -e" is equivalent to "xz -e"
|
||||
which is equivalent to "xz -6e". Earlier -e didn't put xz back
|
||||
into preset mode and thus the example command was equivalent
|
||||
to "xz --lzma2=preset=5".
|
||||
|
||||
Example 2: "xz -9e --lzma2=preset=5 -7" is equivalent to
|
||||
"xz -7". Earlier a custom filter chain option didn't make
|
||||
xz forget the -e option so the example was equivalent to
|
||||
"xz -7e".
|
||||
|
||||
- Fixes and improvements to error handling.
|
||||
|
||||
- Various fixes to the man page.
|
||||
|
||||
* xzless: Fixed to work with "less" versions 448 and later.
|
||||
|
||||
* xzgrep: Made -h an alias for --no-filename.
|
||||
|
||||
* Include the previously missing debug/translation.bash which can
|
||||
be useful for translators.
|
||||
|
||||
* Include a build script for Mac OS X. This has been in the Git
|
||||
repository since 2010 but due to a mistake in Makefile.am the
|
||||
script hasn't been included in a release tarball before.
|
||||
|
||||
|
||||
5.0.4 (2012-06-22)
|
||||
|
||||
* liblzma:
|
||||
|
||||
- Fix lzma_index_init(). It could crash if memory allocation
|
||||
failed.
|
||||
|
||||
- Fix the possibility of an incorrect LZMA_BUF_ERROR when a BCJ
|
||||
filter is used and the application only provides exactly as
|
||||
much output space as is the uncompressed size of the file.
|
||||
|
||||
- Fix a bug in doc/examples_old/xz_pipe_decompress.c. It didn't
|
||||
check if the last call to lzma_code() really returned
|
||||
LZMA_STREAM_END, which made the program think that truncated
|
||||
files are valid.
|
||||
|
||||
- New example programs in doc/examples (old programs are now in
|
||||
doc/examples_old). These have more comments and more detailed
|
||||
error handling.
|
||||
|
||||
* Fix "xz -lvv foo.xz". It could crash on some corrupted files.
|
||||
|
||||
* Fix output of "xz --robot -lv" and "xz --robot -lvv" which
|
||||
incorrectly printed the filename also in the "foo (x/x)" format.
|
||||
|
||||
* Fix exit status of "xzdiff foo.xz bar.xz".
|
||||
|
||||
* Fix exit status of "xzgrep foo binary_file".
|
||||
|
||||
* Fix portability to EBCDIC systems.
|
||||
|
||||
* Fix a configure issue on AIX with the XL C compiler. See INSTALL
|
||||
for details.
|
||||
|
||||
* Update French, German, Italian, and Polish translations.
|
||||
|
||||
|
||||
5.0.3 (2011-05-21)
|
||||
|
||||
* liblzma fixes:
|
||||
|
||||
- A memory leak was fixed.
|
||||
|
||||
- lzma_stream_buffer_encode() no longer creates an empty .xz
|
||||
Block if encoding an empty buffer. Such an empty Block with
|
||||
LZMA2 data would trigger a bug in 5.0.1 and older (see the
|
||||
first bullet point in 5.0.2 notes). When releasing 5.0.2,
|
||||
I thought that no encoder creates this kind of files but
|
||||
I was wrong.
|
||||
|
||||
- Validate function arguments better in a few functions. Most
|
||||
importantly, specifying an unsupported integrity check to
|
||||
lzma_stream_buffer_encode() no longer creates a corrupt .xz
|
||||
file. Probably no application tries to do that, so this
|
||||
shouldn't be a big problem in practice.
|
||||
|
||||
- Document that lzma_block_buffer_encode(),
|
||||
lzma_easy_buffer_encode(), lzma_stream_encoder(), and
|
||||
lzma_stream_buffer_encode() may return LZMA_UNSUPPORTED_CHECK.
|
||||
|
||||
- The return values of the _memusage() functions are now
|
||||
documented better.
|
||||
|
||||
* Fix command name detection in xzgrep. xzegrep and xzfgrep now
|
||||
correctly use egrep and fgrep instead of grep.
|
||||
|
||||
* French translation was added.
|
||||
|
||||
|
||||
5.0.2 (2011-04-01)
|
||||
|
||||
* LZMA2 decompressor now correctly accepts LZMA2 streams with no
|
||||
uncompressed data. Previously it considered them corrupt. The
|
||||
bug can affect applications that use raw LZMA2 streams. It is
|
||||
very unlikely to affect .xz files because no compressor creates
|
||||
.xz files with empty LZMA2 streams. (Empty .xz files are a
|
||||
different thing than empty LZMA2 streams.)
|
||||
|
||||
* "xz --suffix=.foo filename.foo" now refuses to compress the
|
||||
file due to it already having the suffix .foo. It was already
|
||||
documented on the man page, but the code lacked the test.
|
||||
|
||||
* "xzgrep -l foo bar.xz" works now.
|
||||
|
||||
* Polish translation was added.
|
||||
|
||||
|
||||
5.0.1 (2011-01-29)
|
||||
|
||||
* xz --force now (de)compresses files that have setuid, setgid,
|
||||
or sticky bit set and files that have multiple hard links.
|
||||
The man page had it documented this way already, but the code
|
||||
had a bug.
|
||||
|
||||
* gzip and bzip2 support in xzdiff was fixed.
|
||||
|
||||
* Portability fixes
|
||||
|
||||
* Minor fix to Czech translation
|
||||
|
||||
|
||||
5.0.0 (2010-10-23)
|
||||
|
||||
Only the most important changes compared to 4.999.9beta are listed
|
||||
here. One change is especially important:
|
||||
|
||||
* The memory usage limit is now disabled by default. Some scripts
|
||||
written before this change may have used --memory=max on xz command
|
||||
line or in XZ_OPT. THESE USES OF --memory=max SHOULD BE REMOVED
|
||||
NOW, because they interfere with user's ability to set the memory
|
||||
usage limit himself. If user-specified limit causes problems to
|
||||
your script, blame the user.
|
||||
|
||||
Other significant changes:
|
||||
|
||||
* Added support for XZ_DEFAULTS environment variable. This variable
|
||||
allows users to set default options for xz, e.g. default memory
|
||||
usage limit or default compression level. Scripts that use xz
|
||||
must never set or unset XZ_DEFAULTS. Scripts should use XZ_OPT
|
||||
instead if they need a way to pass options to xz via an
|
||||
environment variable.
|
||||
|
||||
* The compression settings associated with the preset levels
|
||||
-0 ... -9 have been changed. --extreme was changed a little too.
|
||||
It is now less likely to make compression worse, but with some
|
||||
files the new --extreme may compress slightly worse than the old
|
||||
--extreme.
|
||||
|
||||
* If a preset level (-0 ... -9) is specified after a custom filter
|
||||
chain options have been used (e.g. --lzma2), the custom filter
|
||||
chain will be forgotten. Earlier the preset options were
|
||||
completely ignored after custom filter chain options had been
|
||||
seen.
|
||||
|
||||
* xz will create sparse files when decompressing if the uncompressed
|
||||
data contains long sequences of binary zeros. This is done even
|
||||
when writing to standard output that is connected to a regular
|
||||
file and certain additional conditions are met to make it safe.
|
||||
|
||||
* Support for "xz --list" was added. Combine with --verbose or
|
||||
--verbose --verbose (-vv) for detailed output.
|
||||
|
||||
* I had hoped that liblzma API would have been stable after
|
||||
4.999.9beta, but there have been a couple of changes in the
|
||||
advanced features, which don't affect most applications:
|
||||
|
||||
- Index handling code was revised. If you were using the old
|
||||
API, you will get a compiler error (so it's easy to notice).
|
||||
|
||||
- A subtle but important change was made to the Block handling
|
||||
API. lzma_block.version has to be initialized even for
|
||||
lzma_block_header_decode(). Code that doesn't do it will work
|
||||
for now, but might break in the future, which makes this API
|
||||
change easy to miss.
|
||||
|
||||
* The major soname has been bumped to 5.0.0. liblzma API and ABI
|
||||
are now stable, so the need to recompile programs linking against
|
||||
liblzma shouldn't arise soon.
|
||||
|
||||
|
||||
104
PACKAGERS
104
PACKAGERS
@@ -7,8 +7,6 @@ Information to packagers of XZ Utils
|
||||
2. Package description
|
||||
3. License
|
||||
4. configure options
|
||||
4.1. Static vs. dynamic linking of liblzma
|
||||
4.2. Optimizing xzdec and lzmadec
|
||||
5. Additional documentation
|
||||
6. Extra files
|
||||
7. Installing XZ Utils and LZMA Utils in parallel
|
||||
@@ -141,77 +139,31 @@ Information to packagers of XZ Utils
|
||||
--enable-small (*)
|
||||
--disable-threads (*)
|
||||
|
||||
(*) These are OK when building xzdec and lzmadec as explained later.
|
||||
(*) These are OK when building xzdec and lzmadec as described
|
||||
in INSTALL.
|
||||
|
||||
You may use --enable-werror but be careful with it since it may break
|
||||
the build due to some useless warning when the build environment
|
||||
changes (like CPU architecture or compiler version).
|
||||
|
||||
|
||||
4.1. Static vs. dynamic linking of liblzma
|
||||
|
||||
The default is to link the most important command line tools against
|
||||
static liblzma, and the less important tools against shared liblzma.
|
||||
This can be changed by passing --enable-dynamic to configure, or by
|
||||
not building static libraries at all by passing --disable-static
|
||||
to configure. It is mildly recommended that you use the default, but
|
||||
the configure options make it easy to do otherwise if the distro policy
|
||||
so requires.
|
||||
|
||||
On 32-bit x86, linking against static liblzma can give a minor
|
||||
speed improvement. Static libraries on x86 are usually compiled as
|
||||
position-dependent code (non-PIC) and shared libraries are built as
|
||||
position-independent code (PIC). PIC wastes one register, which can
|
||||
make the code slightly slower compared to a non-PIC version. (Note
|
||||
that this doesn't apply to x86-64.)
|
||||
|
||||
Linking against static liblzma avoids a dependency on liblzma shared
|
||||
library, and makes it slightly easier to copy the command line tools
|
||||
between systems (e.g. quick 'n' dirty emergency recovery of some
|
||||
files). It also allows putting the command line tools to /bin while
|
||||
leaving liblzma to /usr/lib (assuming that your distribution uses
|
||||
such a file system hierarchy), if no other file in /bin would require
|
||||
liblzma.
|
||||
|
||||
If you don't want to distribute static libraries but you still
|
||||
want to link the command line tools against static liblzma, it is
|
||||
probably easiest to build both static and shared liblzma, but after
|
||||
"make DESTDIR=$PKG install" remove liblzma.a and modify liblzma.la
|
||||
to not contain a reference to liblzma.a.
|
||||
|
||||
|
||||
4.2. Optimizing xzdec and lzmadec
|
||||
|
||||
xzdec and lzmadec are intended to be relatively small instead of
|
||||
optimizing for the best speed. Thus, it is a good idea to build
|
||||
xzdec and lzmadec separately:
|
||||
|
||||
- Only decoder code is needed, so you can speed up the build
|
||||
slightly by passing --disable-encoders to configure. This
|
||||
shouldn't affect the final size of the executables though,
|
||||
because the linker is able to omit the encoder code anyway.
|
||||
|
||||
- xzdec and lzmadec will never use multithreading capabilities of
|
||||
liblzma. You can avoid dependency on libpthread by passing
|
||||
--disable-threads to configure.
|
||||
|
||||
- There are and will be no translated messages for xzdec and
|
||||
lzmadec, so it is fine to pass also --disable-nls to configure.
|
||||
|
||||
- To select somewhat size-optimized variant of some things in
|
||||
liblzma, pass --enable-small to configure.
|
||||
|
||||
- Tell the compiler to optimize for size instead of speed.
|
||||
E.g. with GCC, put -Os into CFLAGS.
|
||||
xzdec and lzmadec don't provide any functionality that isn't already
|
||||
available in the xz tool. Shipping xzdec and lzmadec without size
|
||||
optimization and statically-linked liblzma isn't very useful. Doing
|
||||
that would give users the xzdec man page, which may make it easier
|
||||
for people to find out that such tools exists, but the executables
|
||||
wouldn't have any advantage over the full-featured xz.
|
||||
|
||||
|
||||
5. Additional documentation
|
||||
---------------------------
|
||||
|
||||
"make install" copies some additional documentation to $docdir
|
||||
(--docdir in configure). These a copy of the GNU GPL v2, which can
|
||||
be replaced with a symlink if your distro ships with shared copies
|
||||
of the common license texts.
|
||||
(--docdir in configure). There is a copy of the GNU GPL v2, which
|
||||
can be replaced with a symlink if your distro ships with shared
|
||||
copies of the common license texts.
|
||||
|
||||
liblzma API is currently only documented using Doxygen tags in the
|
||||
API headers. It hasn't been tested much how good results Doxygen
|
||||
is able to make from the tags (e.g. Doxyfile might need tweaking,
|
||||
the tagging may need to be improved etc.), so it might be simpler
|
||||
to just let people read docs directly from the .h files for now,
|
||||
and also save quite a bit in package size at the same time.
|
||||
|
||||
|
||||
6. Extra files
|
||||
@@ -246,32 +198,32 @@ Information to packagers of XZ Utils
|
||||
----------
|
||||
|
||||
Here is an example for i686 GNU/Linux that
|
||||
- links xz against static liblzma;
|
||||
- includes only shared liblzma in the final package;
|
||||
- links xzdec and lzmadec against static liblzma while
|
||||
avoiding libpthread dependency.
|
||||
- links xz and lzmainfo against shared liblzma;
|
||||
- links size-optimized xzdec and lzmadec against static liblzma
|
||||
while avoiding libpthread dependency;
|
||||
- includes only shared liblzma in the final package; and
|
||||
- copies also the "extra" directory to the package.
|
||||
|
||||
PKG=/tmp/xz-pkg
|
||||
tar xf xz-x.y.z.tar.gz
|
||||
cd xz-x.y.z
|
||||
./configure \
|
||||
--prefix=/usr \
|
||||
--sysconfdir=/etc \
|
||||
CFLAGS='-march=i686 -O2'
|
||||
--disable-static \
|
||||
--disable-xzdec \
|
||||
--disable-lzmadec \
|
||||
CFLAGS='-march=i686 -mtune=generic -O2'
|
||||
make
|
||||
make DESTDIR=$PKG install-strip
|
||||
rm -f $PKG/usr/lib/lib*.a
|
||||
sed -i "s/^old_library=.*$/old_library=''/" $PKG/usr/lib/lib*.la
|
||||
make clean
|
||||
./configure \
|
||||
--prefix=/usr \
|
||||
--sysconfdir=/etc \
|
||||
--disable-shared \
|
||||
--disable-nls \
|
||||
--disable-encoders \
|
||||
--enable-small \
|
||||
--disable-threads \
|
||||
CFLAGS='-march=i686 -Os'
|
||||
CFLAGS='-march=i686 -mtune=generic -Os'
|
||||
make -C src/liblzma
|
||||
make -C src/xzdec
|
||||
make -C src/xzdec DESTDIR=$PKG install-strip
|
||||
|
||||
151
README
151
README
@@ -5,32 +5,33 @@ XZ Utils
|
||||
0. Overview
|
||||
1. Documentation
|
||||
1.1. Overall documentation
|
||||
1.2. Documentation for command line tools
|
||||
1.2. Documentation for command-line tools
|
||||
1.3. Documentation for liblzma
|
||||
2. Version numbering
|
||||
3. Reporting bugs
|
||||
4. Other implementations of the .xz format
|
||||
5. Contact information
|
||||
4. Translating the xz tool
|
||||
5. Other implementations of the .xz format
|
||||
6. Contact information
|
||||
|
||||
|
||||
0. Overview
|
||||
-----------
|
||||
|
||||
XZ Utils provide a general purporse data compression library and
|
||||
command line tools. The native file format is the .xz format, but
|
||||
XZ Utils provide a general-purpose data-compression library plus
|
||||
command-line tools. The native file format is the .xz format, but
|
||||
also the legacy .lzma format is supported. The .xz format supports
|
||||
multiple compression algorithms, which are called "filters" in
|
||||
multiple compression algorithms, which are called "filters" in the
|
||||
context of XZ Utils. The primary filter is currently LZMA2. With
|
||||
typical files, XZ Utils create about 30 % smaller files than gzip.
|
||||
|
||||
To ease adapting support for the .xz format into existing applications
|
||||
and scripts, the API of liblzma is somewhat similar to the API of the
|
||||
popular zlib library. For the same reason, the command line tool xz
|
||||
has similar command line syntax than that of gzip.
|
||||
popular zlib library. For the same reason, the command-line tool xz
|
||||
has a command-line syntax similar to that of gzip.
|
||||
|
||||
When aiming for the highest compression ratio, LZMA2 encoder uses
|
||||
When aiming for the highest compression ratio, the LZMA2 encoder uses
|
||||
a lot of CPU time and may use, depending on the settings, even
|
||||
hundreds of megabytes of RAM. However, in fast modes, LZMA2 encoder
|
||||
hundreds of megabytes of RAM. However, in fast modes, the LZMA2 encoder
|
||||
competes with bzip2 in compression speed, RAM usage, and compression
|
||||
ratio.
|
||||
|
||||
@@ -43,8 +44,8 @@ XZ Utils
|
||||
since that needs to be done only once to benefit many people.
|
||||
|
||||
With some file types, combining (or "chaining") LZMA2 with an
|
||||
additional filter can improve compression ratio. A filter chain may
|
||||
contain up to four filters, although usually only one two is used.
|
||||
additional filter can improve the compression ratio. A filter chain may
|
||||
contain up to four filters, although usually only one or two are used.
|
||||
For example, putting a BCJ (Branch/Call/Jump) filter before LZMA2
|
||||
in the filter chain can improve compression ratio of executable files.
|
||||
|
||||
@@ -81,14 +82,15 @@ XZ Utils
|
||||
this software
|
||||
NEWS User-visible changes between XZ Utils releases
|
||||
ChangeLog Detailed list of changes (commit log)
|
||||
TODO Known bugs and some sort of to-do list
|
||||
|
||||
Note that only some of the above files are included in binary
|
||||
packages.
|
||||
|
||||
|
||||
1.2. Documentation for command line tools
|
||||
1.2. Documentation for command-line tools
|
||||
|
||||
The command line tools are documented as man pages. In source code
|
||||
The command-line tools are documented as man pages. In source code
|
||||
releases (and possibly also in some binary packages), the man pages
|
||||
are also provided in plain text (ASCII only) and PDF formats in the
|
||||
directory "doc/man" to make the man pages more accessible to those
|
||||
@@ -107,8 +109,8 @@ XZ Utils
|
||||
written yet.
|
||||
|
||||
For now, if you have never used liblzma, libbzip2, or zlib, I
|
||||
recommend learning *basics* of zlib API. Once you know that, it
|
||||
should be easier to learn liblzma.
|
||||
recommend learning the *basics* of the zlib API. Once you know that,
|
||||
it should be easier to learn liblzma.
|
||||
|
||||
http://zlib.net/manual.html
|
||||
http://zlib.net/zlib_how.html
|
||||
@@ -122,23 +124,27 @@ XZ Utils
|
||||
- X is the major version. When this is incremented, the library
|
||||
API and ABI break.
|
||||
|
||||
- Y is the minor version. It is incremented when new features are
|
||||
added without breaking existing API or ABI. Even Y indicates
|
||||
stable release and odd Y indicates unstable (alpha or beta
|
||||
version).
|
||||
- Y is the minor version. It is incremented when new features
|
||||
are added without breaking the existing API or ABI. An even Y
|
||||
indicates a stable release and an odd Y indicates unstable
|
||||
(alpha or beta version).
|
||||
|
||||
- Z is the revision. This has different meaning for stable and
|
||||
- Z is the revision. This has a different meaning for stable and
|
||||
unstable releases:
|
||||
|
||||
* Stable: Z is incremented when bugs get fixed without adding
|
||||
any new features.
|
||||
any new features. This is intended to be convenient for
|
||||
downstream distributors that want bug fixes but don't want
|
||||
any new features to minimize the risk of introducing new bugs.
|
||||
|
||||
* Unstable: Z is just a counter. API or ABI of features added
|
||||
in earlier unstable releases having the same X.Y may break.
|
||||
|
||||
- S indicates stability of the release. It is missing from the
|
||||
stable releases where Y is an even number. When Y is odd, S
|
||||
stable releases, where Y is an even number. When Y is odd, S
|
||||
is either "alpha" or "beta" to make it very clear that such
|
||||
versions are not stable releases. The same X.Y.Z combination is
|
||||
not used for more than one stability level i.e. after X.Y.Zalpha,
|
||||
not used for more than one stability level, i.e. after X.Y.Zalpha,
|
||||
the next version can be X.Y.(Z+1)beta but not X.Y.Zbeta.
|
||||
|
||||
|
||||
@@ -150,7 +156,7 @@ XZ Utils
|
||||
However, quite often the reason for unexpected behavior is unknown,
|
||||
so here are a few things to do before sending a bug report:
|
||||
|
||||
1. Try to create a small example how to reprocude the issue.
|
||||
1. Try to create a small example how to reproduce the issue.
|
||||
|
||||
2. Compile XZ Utils with debugging code using configure switches
|
||||
--enable-debug and, if possible, --disable-shared. If you are
|
||||
@@ -174,7 +180,7 @@ XZ Utils
|
||||
Don't send core dump files or any executables. If you have a small
|
||||
example file(s) (total size less than 256 KiB), please include
|
||||
it/them as an attachment. If you have bigger test files, put them
|
||||
online somewhere and include an URL to the file(s) in the bug report.
|
||||
online somewhere and include a URL to the file(s) in the bug report.
|
||||
|
||||
Always include the exact version number of XZ Utils in the bug report.
|
||||
If you are using a snapshot from the git repository, use "git describe"
|
||||
@@ -186,7 +192,94 @@ XZ Utils
|
||||
system.
|
||||
|
||||
|
||||
4. Other implementations of the .xz format
|
||||
4. Translating the xz tool
|
||||
--------------------------
|
||||
|
||||
The messages from the xz tool have been translated into a few
|
||||
languages. Before starting to translate into a new language, ask
|
||||
the author whether someone else hasn't already started working on it.
|
||||
|
||||
Test your translation. Testing includes comparing the translated
|
||||
output to the original English version by running the same commands
|
||||
in both your target locale and with LC_ALL=C. Ask someone to
|
||||
proof-read and test the translation.
|
||||
|
||||
Testing can be done e.g. by installing xz into a temporary directory:
|
||||
|
||||
./configure --disable-shared --prefix=/tmp/xz-test
|
||||
# <Edit the .po file in the po directory.>
|
||||
make -C po update-po
|
||||
make install
|
||||
bash debug/translation.bash | less
|
||||
bash debug/translation.bash | less -S # For --list outputs
|
||||
|
||||
Repeat the above as needed (no need to re-run configure though).
|
||||
|
||||
Note especially the following:
|
||||
|
||||
- The output of --help and --long-help must look nice on
|
||||
an 80-column terminal. It's OK to add extra lines if needed.
|
||||
|
||||
- In contrast, don't add extra lines to error messages and such.
|
||||
They are often preceded with e.g. a filename on the same line,
|
||||
so you have no way to predict where to put a \n. Let the terminal
|
||||
do the wrapping even if it looks ugly. Adding new lines will be
|
||||
even uglier in the generic case even if it looks nice in a few
|
||||
limited examples.
|
||||
|
||||
- Be careful with column alignment in tables and table-like output
|
||||
(--list, --list --verbose --verbose, --info-memory, --help, and
|
||||
--long-help):
|
||||
|
||||
* All descriptions of options in --help should start in the
|
||||
same column (but it doesn't need to be the same column as
|
||||
in the English messages; just be consistent if you change it).
|
||||
Check that both --help and --long-help look OK, since they
|
||||
share several strings.
|
||||
|
||||
* --list --verbose and --info-memory print lines that have
|
||||
the format "Description: %s". If you need a longer
|
||||
description, you can put extra space between the colon
|
||||
and %s. Then you may need to add extra space to other
|
||||
strings too so that the result as a whole looks good (all
|
||||
values start at the same column).
|
||||
|
||||
* The columns of the actual tables in --list --verbose --verbose
|
||||
should be aligned properly. Abbreviate if necessary. It might
|
||||
be good to keep at least 2 or 3 spaces between column headings
|
||||
and avoid spaces in the headings so that the columns stand out
|
||||
better, but this is a matter of opinion. Do what you think
|
||||
looks best.
|
||||
|
||||
- Be careful to put a period at the end of a sentence when the
|
||||
original version has it, and don't put it when the original
|
||||
doesn't have it. Similarly, be careful with \n characters
|
||||
at the beginning and end of the strings.
|
||||
|
||||
- Read the TRANSLATORS comments that have been extracted from the
|
||||
source code and included in xz.pot. If they suggest testing the
|
||||
translation with some type of command, do it. If testing needs
|
||||
input files, use e.g. tests/files/good-*.xz.
|
||||
|
||||
- When updating the translation, read the fuzzy (modified) strings
|
||||
carefully, and don't mark them as updated before you actually
|
||||
have updated them. Reading through the unchanged messages can be
|
||||
good too; sometimes you may find a better wording for them.
|
||||
|
||||
- If you find language problems in the original English strings,
|
||||
feel free to suggest improvements. Ask if something is unclear.
|
||||
|
||||
- The translated messages should be understandable (sometimes this
|
||||
may be a problem with the original English messages too). Don't
|
||||
make a direct word-by-word translation from English especially if
|
||||
the result doesn't sound good in your language.
|
||||
|
||||
In short, take your time and pay attention to the details. Making
|
||||
a good translation is not a quick and trivial thing to do. The
|
||||
translated xz should look as polished as the English version.
|
||||
|
||||
|
||||
5. Other implementations of the .xz format
|
||||
------------------------------------------
|
||||
|
||||
7-Zip and the p7zip port of 7-Zip support the .xz format starting
|
||||
@@ -201,13 +294,11 @@ XZ Utils
|
||||
http://tukaani.org/xz/embedded.html
|
||||
|
||||
|
||||
5. Contact information
|
||||
6. Contact information
|
||||
----------------------
|
||||
|
||||
If you have questions, bug reports, patches etc. related to XZ Utils,
|
||||
contact Lasse Collin <lasse.collin@tukaani.org> (in Finnish or English).
|
||||
tukaani.org uses greylisting to reduce spam, thus when you send your
|
||||
first email, it may get delayed by a few hours. In addition to that,
|
||||
I'm sometimes slow at replying. If you haven't got a reply within two
|
||||
weeks, assume that your email has got lost and resend it or use IRC.
|
||||
|
||||
|
||||
62
THANKS
62
THANKS
@@ -6,38 +6,100 @@ Some people have helped more, some less, but nevertheless everyone's help
|
||||
has been important. :-) In alphabetical order:
|
||||
- Mark Adler
|
||||
- H. Peter Anvin
|
||||
- Jeff Bastian
|
||||
- Nelson H. F. Beebe
|
||||
- Karl Berry
|
||||
- Anders F. Björklund
|
||||
- Emmanuel Blot
|
||||
- Martin Blumenstingl
|
||||
- Jakub Bogusz
|
||||
- Maarten Bosmans
|
||||
- Trent W. Buck
|
||||
- James Buren
|
||||
- David Burklund
|
||||
- Daniel Mealha Cabrita
|
||||
- Milo Casagrande
|
||||
- Marek Černocký
|
||||
- Tomer Chachamu
|
||||
- Chris Donawa
|
||||
- Andrew Dudman
|
||||
- Markus Duft
|
||||
- İsmail Dönmez
|
||||
- Robert Elz
|
||||
- Gilles Espinasse
|
||||
- Denis Excoffier
|
||||
- Michael Felt
|
||||
- Mike Frysinger
|
||||
- Daniel Richard G.
|
||||
- Bill Glessner
|
||||
- Jason Gorski
|
||||
- Juan Manuel Guerrero
|
||||
- Diederik de Haas
|
||||
- Joachim Henke
|
||||
- Christian Hesse
|
||||
- Vincenzo Innocente
|
||||
- Peter Ivanov
|
||||
- Jouk Jansen
|
||||
- Jun I Jin
|
||||
- Per Øyvind Karlsen
|
||||
- Thomas Klausner
|
||||
- Richard Koch
|
||||
- Ville Koskinen
|
||||
- Jan Kratochvil
|
||||
- Christian Kujau
|
||||
- Stephan Kulow
|
||||
- Peter Lawler
|
||||
- James M Leddy
|
||||
- Hin-Tak Leung
|
||||
- Andraž 'ruskie' Levstik
|
||||
- Cary Lewis
|
||||
- Wim Lewis
|
||||
- Lorenzo De Liso
|
||||
- Bela Lubkin
|
||||
- Gregory Margo
|
||||
- Jim Meyering
|
||||
- Arkadiusz Miskiewicz
|
||||
- Conley Moorhous
|
||||
- Rafał Mużyło
|
||||
- Adrien Nader
|
||||
- Hongbo Ni
|
||||
- Jonathan Nieder
|
||||
- Andre Noll
|
||||
- Peter O'Gorman
|
||||
- Peter Pallinger
|
||||
- Igor Pavlov
|
||||
- Diego Elio Pettenò
|
||||
- Elbert Pol
|
||||
- Mikko Pouru
|
||||
- Trần Ngọc Quân
|
||||
- Pavel Raiskup
|
||||
- Robert Readman
|
||||
- Bernhard Reutner-Fischer
|
||||
- Eric S. Raymond
|
||||
- Cristian Rodríguez
|
||||
- Christian von Roques
|
||||
- Jukka Salmi
|
||||
- Alexandre Sauvé
|
||||
- Benno Schulenberg
|
||||
- Andreas Schwab
|
||||
- Dan Shechter
|
||||
- Stuart Shelton
|
||||
- Jonathan Stott
|
||||
- Dan Stromberg
|
||||
- Vincent Torri
|
||||
- Paul Townsend
|
||||
- Mohammed Adnène Trojette
|
||||
- Alexey Tourbin
|
||||
- Patrick J. Volkerding
|
||||
- Martin Väth
|
||||
- Christian Weisgerber
|
||||
- Bert Wesarg
|
||||
- Fredrik Wikstrom
|
||||
- Ralf Wildenhues
|
||||
- Charles Wilson
|
||||
- Lars Wirzenius
|
||||
- Pilorz Wojciech
|
||||
- Ryan Young
|
||||
- Andreas Zieringer
|
||||
|
||||
Also thanks to all the people who have participated in the Tukaani project.
|
||||
|
||||
89
TODO
89
TODO
@@ -7,50 +7,105 @@ Known bugs
|
||||
|
||||
The test suite is too incomplete.
|
||||
|
||||
If the memor usage limit is less than about 13 MiB, xz is unable to
|
||||
If the memory usage limit is less than about 13 MiB, xz is unable to
|
||||
automatically scale down the compression settings enough even though
|
||||
it would be possible by switching from BT2/BT3/BT4 match finder to
|
||||
HC3/HC4.
|
||||
|
||||
The code to detect number of CPU cores doesn't count hyperthreading
|
||||
as multiple cores. In context of xz, it probably should.
|
||||
Hyperthreading is good at least with p7zip.
|
||||
|
||||
XZ Utils compress some files significantly worse than LZMA Utils.
|
||||
This is due to faster compression presets used by XZ Utils, and
|
||||
can be worked around by using "xz --extreme". However, the presets
|
||||
need some tweaking and maybe this issue can be minimized without
|
||||
making the typical case too much slower.
|
||||
can often be worked around by using "xz --extreme". With some files
|
||||
--extreme isn't enough though: it's most likely with files that
|
||||
compress extremely well, so going from compression ratio of 0.003
|
||||
to 0.004 means big relative increase in the compressed file size.
|
||||
|
||||
xz doesn't quote unprintable characters when it displays file names
|
||||
given on the command line.
|
||||
|
||||
tuklib_exit() doesn't block signals => EINTR is possible.
|
||||
|
||||
SIGTSTP is not handled. If xz is stopped, the estimated remaining
|
||||
time and calculated (de)compression speed won't make sense in the
|
||||
progress indicator (xz --verbose).
|
||||
|
||||
If liblzma has created threads and fork() gets called, liblzma
|
||||
code will break in the child process unless it calls exec() and
|
||||
doesn't touch liblzma.
|
||||
|
||||
|
||||
Missing features
|
||||
----------------
|
||||
|
||||
"xz --list"
|
||||
Add support for storing metadata in .xz files. A preliminary
|
||||
idea is to create a new Stream type for metadata. When both
|
||||
metadata and data are wanted in the same .xz file, two or more
|
||||
Streams would be concatenated.
|
||||
|
||||
xz could create sparse files when decompressing. (Some prototyping
|
||||
has been done.)
|
||||
The state stored in lzma_stream should be cloneable, which would
|
||||
be mostly useful when using a preset dictionary in LZMA2, but
|
||||
it may have other uses too. Compare to deflateCopy() in zlib.
|
||||
|
||||
Support LZMA_FINISH in raw decoder to indicate end of LZMA1 and
|
||||
other streams that don't have an end of payload marker.
|
||||
|
||||
Adjust dictionary size when the input file size is known.
|
||||
Maybe do this only if an option is given.
|
||||
|
||||
xz doesn't support copying extended attributes, access control
|
||||
lists etc. from source to target file.
|
||||
|
||||
Multithreaded compression
|
||||
Multithreaded compression:
|
||||
- Reduce memory usage of the current method.
|
||||
- Implement threaded match finders.
|
||||
- Implement pigz-style threading in LZMA2.
|
||||
|
||||
Multithreaded decompression
|
||||
|
||||
Buffer-to-buffer coding could use less RAM (especially when
|
||||
decompressing LZMA1 or LZMA2).
|
||||
|
||||
I/O library is not implemented. It will possibly be named libzzf.
|
||||
I/O library is not implemented (similar to gzopen() in zlib).
|
||||
It will be a separate library that supports uncompressed, .gz,
|
||||
.bz2, .lzma, and .xz files.
|
||||
|
||||
Support changing lzma_options_lzma.mode with lzma_filters_update().
|
||||
|
||||
Support LZMA_FULL_FLUSH for lzma_stream_decoder() to stop at
|
||||
Block and Stream boundaries.
|
||||
|
||||
lzma_strerror() to convert lzma_ret to human readable form?
|
||||
This is tricky, because the same error codes are used with
|
||||
slightly different meanings, and this cannot be fixed anymore.
|
||||
|
||||
Make it possible to adjust LZMA2 options in the middle of a Block
|
||||
so that the encoding speed vs. compression ratio can be optimized
|
||||
when the compressed data is streamed over network.
|
||||
|
||||
Improved BCJ filters. The current filters are small but they aren't
|
||||
so great when compressing binary packages that contain various file
|
||||
types. Specifically, they make things worse if there are static
|
||||
libraries or Linux kernel modules. The filtering could also be
|
||||
more effective (without getting overly complex), for example,
|
||||
streamable variant BCJ2 from 7-Zip could be implemented.
|
||||
|
||||
Filter that autodetects specific data types in the input stream
|
||||
and applies appropriate filters for the corrects parts of the input.
|
||||
Perhaps combine this with the BCJ filter improvement point above.
|
||||
|
||||
Long-range LZ77 method as a separate filter or as a new LZMA2
|
||||
match finder.
|
||||
|
||||
|
||||
Documentation
|
||||
-------------
|
||||
|
||||
Some tutorial is needed for liblzma. I have planned to write some
|
||||
extremely well commented example programs, which would work as
|
||||
a tutorial. I suppose the Doxygen tags are quite OK as a quick
|
||||
reference once one is familiar with the liblzma API.
|
||||
More tutorial programs are needed for liblzma.
|
||||
|
||||
Document the LZMA1 and LZMA2 algorithms.
|
||||
|
||||
|
||||
Miscellaneous
|
||||
------------
|
||||
|
||||
Try to get the media type for .xz registered at IANA.
|
||||
|
||||
|
||||
58
build-aux/manconv.sh
Normal file
58
build-aux/manconv.sh
Normal file
@@ -0,0 +1,58 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
###############################################################################
|
||||
#
|
||||
# Wrapper for GNU groff to convert man pages to a few formats
|
||||
#
|
||||
# Usage: manconv.sh FORMAT [PAPER_SIZE] < in.1 > out.suffix
|
||||
#
|
||||
# FORMAT can be ascii, utf8, ps, or pdf. PAPER_SIZE can be anything that
|
||||
# groff accepts, e.g. a4 or letter. See groff_font(5). PAPER_SIZE defaults
|
||||
# to a4 and is used only when FORMAT is ps (PostScript) or pdf.
|
||||
#
|
||||
# Multiple man pages can be given at once e.g. to create a single PDF file
|
||||
# with continuous page numbering.
|
||||
#
|
||||
###############################################################################
|
||||
#
|
||||
# Author: Lasse Collin
|
||||
#
|
||||
# This file has been put into the public domain.
|
||||
# You can do whatever you want with this file.
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
FORMAT=$1
|
||||
PAPER=${2-a4}
|
||||
|
||||
# Make PostScript and PDF output more readable:
|
||||
# - Use 11 pt font instead of the default 10 pt.
|
||||
# - Use larger paragraph spacing than the default 0.4v (man(7) only).
|
||||
FONT=11
|
||||
PD=0.8
|
||||
|
||||
SED_PD="
|
||||
/^\\.TH /s/\$/\\
|
||||
.PD $PD/
|
||||
s/^\\.PD\$/.PD $PD/"
|
||||
|
||||
case $FORMAT in
|
||||
ascii)
|
||||
groff -t -mandoc -Tascii | col -bx
|
||||
;;
|
||||
utf8)
|
||||
groff -t -mandoc -Tutf8 | col -bx
|
||||
;;
|
||||
ps)
|
||||
sed "$SED_PD" | groff -dpaper=$PAPER -t -mandoc \
|
||||
-rC1 -rS$FONT -Tps -P-p$PAPER
|
||||
;;
|
||||
pdf)
|
||||
sed "$SED_PD" | groff -dpaper=$PAPER -t -mandoc \
|
||||
-rC1 -rS$FONT -Tps -P-p$PAPER | ps2pdf - -
|
||||
;;
|
||||
*)
|
||||
echo 'Invalid arguments' >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
514
configure.ac
514
configure.ac
@@ -15,20 +15,15 @@
|
||||
# of malloc(), stat(), or lstat(), since we don't use those functions in
|
||||
# a way that would cause the problems the autoconf macros check.
|
||||
|
||||
AC_PREREQ([2.61])
|
||||
AC_PREREQ([2.64])
|
||||
|
||||
AC_INIT([XZ Utils], m4_esyscmd([/bin/sh version.sh]),
|
||||
[lasse.collin@tukaani.org], [xz])
|
||||
AC_INIT([XZ Utils], m4_esyscmd([/bin/sh build-aux/version.sh]),
|
||||
[lasse.collin@tukaani.org], [xz], [http://tukaani.org/xz/])
|
||||
AC_CONFIG_SRCDIR([src/liblzma/common/common.h])
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AC_CONFIG_HEADER([config.h])
|
||||
|
||||
PACKAGE_HOMEPAGE=http://tukaani.org/xz/
|
||||
AC_DEFINE_UNQUOTED([PACKAGE_HOMEPAGE], ["$PACKAGE_HOMEPAGE"],
|
||||
[Define to the URL of the home page of this package.])
|
||||
AC_SUBST([PACKAGE_HOMEPAGE])
|
||||
|
||||
echo
|
||||
echo "$PACKAGE_STRING"
|
||||
|
||||
@@ -44,6 +39,15 @@ case $host_os in
|
||||
esac
|
||||
AM_CONDITIONAL([COND_W32], [test "$is_w32" = yes])
|
||||
|
||||
# We need to use $EXEEXT with $(LN_S) when creating symlinks to
|
||||
# executables. Cygwin is an exception to this, since it is recommended
|
||||
# that symlinks don't have the .exe suffix. To make this work, we
|
||||
# define LN_EXEEXT.
|
||||
case $host_os in
|
||||
cygwin) LN_EXEEXT= ;;
|
||||
*) LN_EXEEXT='$(EXEEXT)' ;;
|
||||
esac
|
||||
AC_SUBST([LN_EXEEXT])
|
||||
|
||||
echo
|
||||
echo "Configure options:"
|
||||
@@ -55,7 +59,7 @@ AM_CFLAGS=
|
||||
#############
|
||||
|
||||
AC_MSG_CHECKING([if debugging code should be compiled])
|
||||
AC_ARG_ENABLE([debug], AC_HELP_STRING([--enable-debug], [Enable debugging code.]),
|
||||
AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug], [Enable debugging code.]),
|
||||
[], enable_debug=no)
|
||||
if test "x$enable_debug" = xyes; then
|
||||
AC_MSG_RESULT([yes])
|
||||
@@ -69,7 +73,7 @@ fi
|
||||
# Filters #
|
||||
###########
|
||||
|
||||
m4_define([SUPPORTED_FILTERS], [lzma1,lzma2,subblock,delta,x86,powerpc,ia64,arm,armthumb,sparc])dnl
|
||||
m4_define([SUPPORTED_FILTERS], [lzma1,lzma2,delta,x86,powerpc,ia64,arm,armthumb,sparc])dnl
|
||||
m4_define([SIMPLE_FILTERS], [x86,powerpc,ia64,arm,armthumb,sparc])
|
||||
m4_define([LZ_FILTERS], [lzma1,lzma2])
|
||||
|
||||
@@ -80,17 +84,15 @@ enable_decoder_[]NAME=no
|
||||
])dnl
|
||||
|
||||
AC_MSG_CHECKING([which encoders to build])
|
||||
AC_ARG_ENABLE([encoders], AC_HELP_STRING([--enable-encoders=LIST],
|
||||
AC_ARG_ENABLE([encoders], AS_HELP_STRING([--enable-encoders=LIST],
|
||||
[Comma-separated list of encoders to build. Default=all.
|
||||
Available encoders:]
|
||||
m4_translit(m4_defn([SUPPORTED_FILTERS]), [,], [ ])),
|
||||
[], [enable_encoders=SUPPORTED_FILTERS])
|
||||
enable_encoders=`echo "$enable_encoders" | sed 's/,subblock//; s/,/ /g'`
|
||||
enable_encoders=`echo "$enable_encoders" | sed 's/,/ /g'`
|
||||
if test "x$enable_encoders" = xno || test "x$enable_encoders" = x; then
|
||||
AC_MSG_RESULT([(none)])
|
||||
else
|
||||
AC_DEFINE([HAVE_ENCODER], [1],
|
||||
[Define to 1 if encoder components are enabled.])
|
||||
for arg in $enable_encoders
|
||||
do
|
||||
case $arg in m4_foreach([NAME], [SUPPORTED_FILTERS], [
|
||||
@@ -110,16 +112,14 @@ else
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([which decoders to build])
|
||||
AC_ARG_ENABLE([decoders], AC_HELP_STRING([--enable-decoders=LIST],
|
||||
AC_ARG_ENABLE([decoders], AS_HELP_STRING([--enable-decoders=LIST],
|
||||
[Comma-separated list of decoders to build. Default=all.
|
||||
Available decoders are the same as available encoders.]),
|
||||
[], [enable_decoders=SUPPORTED_FILTERS])
|
||||
enable_decoders=`echo "$enable_decoders" | sed 's/,subblock//; s/,/ /g'`
|
||||
enable_decoders=`echo "$enable_decoders" | sed 's/,/ /g'`
|
||||
if test "x$enable_decoders" = xno || test "x$enable_decoders" = x; then
|
||||
AC_MSG_RESULT([(none)])
|
||||
else
|
||||
AC_DEFINE([HAVE_DECODER], [1],
|
||||
[Define to 1 if decoder components are enabled.])
|
||||
for arg in $enable_decoders
|
||||
do
|
||||
case $arg in m4_foreach([NAME], [SUPPORTED_FILTERS], [
|
||||
@@ -195,7 +195,7 @@ m4_foreach([NAME], [SUPPORTED_MATCH_FINDERS],
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING([which match finders to build])
|
||||
AC_ARG_ENABLE([match-finders], AC_HELP_STRING([--enable-match-finders=LIST],
|
||||
AC_ARG_ENABLE([match-finders], AS_HELP_STRING([--enable-match-finders=LIST],
|
||||
[Comma-separated list of match finders to build. Default=all.
|
||||
At least one match finder is required for encoding with
|
||||
the LZMA1 and LZMA2 filters. Available match finders:]
|
||||
@@ -229,12 +229,12 @@ fi
|
||||
|
||||
m4_define([SUPPORTED_CHECKS], [crc32,crc64,sha256])
|
||||
|
||||
m4_foreach([NAME], [SUPPORTED_FILTERS],
|
||||
m4_foreach([NAME], [SUPPORTED_CHECKS],
|
||||
[enable_check_[]NAME=no
|
||||
])dnl
|
||||
|
||||
AC_MSG_CHECKING([which integrity checks to build])
|
||||
AC_ARG_ENABLE([checks], AC_HELP_STRING([--enable-checks=LIST],
|
||||
AC_ARG_ENABLE([checks], AS_HELP_STRING([--enable-checks=LIST],
|
||||
[Comma-separated list of integrity checks to build.
|
||||
Default=all. Available integrity checks:]
|
||||
m4_translit(m4_defn([SUPPORTED_CHECKS]), [,], [ ])),
|
||||
@@ -260,7 +260,7 @@ else
|
||||
done
|
||||
AC_MSG_RESULT([$enable_checks])
|
||||
fi
|
||||
if test "x$enable_checks_crc32" = xno ; then
|
||||
if test "x$enable_check_crc32" = xno ; then
|
||||
AC_MSG_ERROR([For now, the CRC32 check must always be enabled.])
|
||||
fi
|
||||
|
||||
@@ -274,73 +274,42 @@ m4_foreach([NAME], [SUPPORTED_CHECKS],
|
||||
###########################
|
||||
|
||||
AC_MSG_CHECKING([if assembler optimizations should be used])
|
||||
AC_ARG_ENABLE([assembler], AC_HELP_STRING([--disable-assembler],
|
||||
AC_ARG_ENABLE([assembler], AS_HELP_STRING([--disable-assembler],
|
||||
[Do not use assembler optimizations even if such exist
|
||||
for the architecture.]),
|
||||
[], [enable_assembler=yes])
|
||||
if test "x$enable_assembler" = xyes; then
|
||||
case $host_cpu in
|
||||
i?86) enable_assembler=x86 ;;
|
||||
x86_64) enable_assembler=x86_64 ;;
|
||||
*) enable_assembler=no ;;
|
||||
enable_assembler=no
|
||||
case $host_os in
|
||||
# Darwin should work too but only if not creating universal
|
||||
# binaries. Solaris x86 could work too but I cannot test.
|
||||
linux* | *bsd* | mingw* | cygwin* | *djgpp*)
|
||||
case $host_cpu in
|
||||
i?86) enable_assembler=x86 ;;
|
||||
x86_64) enable_assembler=x86_64 ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
case $enable_assembler in
|
||||
x86)
|
||||
AC_DEFINE([HAVE_ASM_X86], [1],
|
||||
[Define to 1 if using x86 assembler optimizations.])
|
||||
;;
|
||||
x86_64)
|
||||
AC_DEFINE([HAVE_ASM_X86_64], [1],
|
||||
[Define to 1 if using x86_64 assembler optimizations.])
|
||||
;;
|
||||
no)
|
||||
x86 | x86_64 | no)
|
||||
AC_MSG_RESULT([$enable_assembler])
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT([])
|
||||
AC_MSG_ERROR([--enable-assembler accepts only \`yes', \`no', \`x86', or \`x86_64'.])
|
||||
AC_MSG_ERROR([--enable-assembler accepts only `yes', `no', `x86', or `x86_64'.])
|
||||
;;
|
||||
esac
|
||||
AC_MSG_RESULT([$enable_assembler])
|
||||
AM_CONDITIONAL(COND_ASM_X86, test "x$enable_assembler" = xx86)
|
||||
AM_CONDITIONAL(COND_ASM_X86_64, test "x$enable_assembler" = xx86_64)
|
||||
|
||||
|
||||
################################
|
||||
# Fast unaligned memory access #
|
||||
################################
|
||||
|
||||
AC_MSG_CHECKING([if unaligned memory access should be used])
|
||||
AC_ARG_ENABLE([unaligned-access], AC_HELP_STRING([--enable-unaligned-access],
|
||||
[Enable if the system supports *fast* unaligned memory access
|
||||
with 16-bit and 32-bit integers. By default, this is enabled
|
||||
only on x86, x86_64, and big endian PowerPC.]),
|
||||
[], [enable_unaligned_access=auto])
|
||||
if test "x$enable_unaligned_access" = xauto ; then
|
||||
case $host_cpu in
|
||||
i?86|x86_64|powerpc|powerpc64)
|
||||
enable_unaligned_access=yes
|
||||
;;
|
||||
*)
|
||||
enable_unaligned_access=no
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if test "x$enable_unaligned_access" = xyes ; then
|
||||
AC_DEFINE([HAVE_FAST_UNALIGNED_ACCESS], [1], [Define to 1 if
|
||||
the system supports fast unaligned memory access.])
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
|
||||
#####################
|
||||
# Size optimization #
|
||||
#####################
|
||||
|
||||
AC_MSG_CHECKING([if small size is preferred over speed])
|
||||
AC_ARG_ENABLE([small], AC_HELP_STRING([--enable-small],
|
||||
AC_ARG_ENABLE([small], AS_HELP_STRING([--enable-small],
|
||||
[Make liblzma smaller and a little slower.
|
||||
This is disabled by default to optimize for speed.]),
|
||||
[], [enable_small=no])
|
||||
@@ -348,7 +317,7 @@ if test "x$enable_small" = xyes; then
|
||||
AC_DEFINE([HAVE_SMALL], [1], [Define to 1 if optimizing for size.])
|
||||
elif test "x$enable_small" != xno; then
|
||||
AC_MSG_RESULT([])
|
||||
AC_MSG_ERROR([--enable-small accepts only \`yes' or \`no'])
|
||||
AC_MSG_ERROR([--enable-small accepts only `yes' or `no'])
|
||||
fi
|
||||
AC_MSG_RESULT([$enable_small])
|
||||
AM_CONDITIONAL(COND_SMALL, test "x$enable_small" = xyes)
|
||||
@@ -359,51 +328,144 @@ AM_CONDITIONAL(COND_SMALL, test "x$enable_small" = xyes)
|
||||
#############
|
||||
|
||||
AC_MSG_CHECKING([if threading support is wanted])
|
||||
AC_ARG_ENABLE([threads], AC_HELP_STRING([--disable-threads],
|
||||
[Disable threading support.
|
||||
This makes some things thread-unsafe.]),
|
||||
AC_ARG_ENABLE([threads], AS_HELP_STRING([--enable-threads=METHOD],
|
||||
[Supported METHODS are `yes', `no', `posix', `win95', and
|
||||
`vista'. The default is `yes'. Using `no' together with
|
||||
--enable-small makes liblzma thread unsafe.]),
|
||||
[], [enable_threads=yes])
|
||||
if test "x$enable_threads" != xyes && test "x$enable_threads" != xno; then
|
||||
AC_MSG_RESULT([])
|
||||
AC_MSG_ERROR([--enable-threads accepts only \`yes' or \`no'])
|
||||
|
||||
if test "x$enable_threads" = xyes; then
|
||||
case $host_os in
|
||||
mingw*)
|
||||
case $host_cpu in
|
||||
i?86) enable_threads=win95 ;;
|
||||
*) enable_threads=vista ;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
enable_threads=posix
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
AC_MSG_RESULT([$enable_threads])
|
||||
# We use the actual result a little later.
|
||||
|
||||
|
||||
############################################
|
||||
# xz/xzdec/lzmadec linkage against liblzma #
|
||||
############################################
|
||||
|
||||
# Link the xz, xzdec, and lzmadec command line tools against static liblzma
|
||||
# unless using --enable-dynamic. Using static liblzma gives a little bit
|
||||
# faster executable on x86, because no register is wasted for PIC. We also
|
||||
# have one dependency less, which allows users to more freely copy the xz
|
||||
# binary to other boxes. However, I wouldn't be surprised if distro
|
||||
# maintainers still prefer dynamic linking, so let's make it easy for them.
|
||||
|
||||
AC_MSG_CHECKING([how programs should be linked against liblzma])
|
||||
AC_ARG_ENABLE([dynamic], [AC_HELP_STRING([--enable-dynamic=TYPE],
|
||||
[Set how command line tools are linked against liblzma.
|
||||
TYPE can be mixed, yes, or no. The default is mixed.])],
|
||||
[], [enable_dynamic=mixed])
|
||||
case $enable_dynamic in
|
||||
mixed)
|
||||
AC_MSG_RESULT([mixed (some dynamically, some statically)])
|
||||
;;
|
||||
yes)
|
||||
AC_MSG_RESULT([dynamically])
|
||||
case $enable_threads in
|
||||
posix | win95 | vista)
|
||||
AC_MSG_RESULT([yes, $enable_threads])
|
||||
;;
|
||||
no)
|
||||
AC_MSG_RESULT([statically])
|
||||
AC_MSG_RESULT([no])
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT([])
|
||||
AC_MSG_ERROR([--enable-dynamic accepts only \`mixed', \`yes', or \`no'])
|
||||
AC_MSG_ERROR([--enable-threads only accepts `yes', `no', `posix', `win95', or `vista'])
|
||||
;;
|
||||
esac
|
||||
# We use the actual results later, because we don't know yet
|
||||
# if --disable-shared or --disable-static was used.
|
||||
|
||||
# The Win95 threading lacks thread-safe one-time initialization function.
|
||||
# It's better to disallow it instead of allowing threaded but thread-unsafe
|
||||
# build.
|
||||
if test "x$enable_small$enable_threads" = xyeswin95; then
|
||||
AC_MSG_ERROR([--enable-threads=win95 and --enable-small cannot be
|
||||
used at the same time])
|
||||
fi
|
||||
|
||||
# We use the actual result a little later.
|
||||
|
||||
|
||||
#########################
|
||||
# Assumed amount of RAM #
|
||||
#########################
|
||||
|
||||
# We use 128 MiB as default, because it will allow decompressing files
|
||||
# created with "xz -9". It would be slightly safer to guess a lower value,
|
||||
# but most systems, on which we don't have any way to determine the amount
|
||||
# of RAM, will probably have at least 128 MiB of RAM.
|
||||
AC_MSG_CHECKING([how much RAM to assume if the real amount is unknown])
|
||||
AC_ARG_ENABLE([assume-ram], AS_HELP_STRING([--enable-assume-ram=SIZE],
|
||||
[If and only if the real amount of RAM cannot be determined,
|
||||
assume SIZE MiB. The default is 128 MiB. This affects the
|
||||
default memory usage limit.]),
|
||||
[], [enable_assume_ram=128])
|
||||
assume_ram_check=`echo "$enable_assume_ram" | tr -d 0123456789`
|
||||
if test -z "$enable_assume_ram" || test -n "$assume_ram_check"; then
|
||||
AC_MSG_RESULT([])
|
||||
AC_MSG_ERROR([--enable-assume-ram accepts only an integer argument])
|
||||
fi
|
||||
AC_MSG_RESULT([$enable_assume_ram MiB])
|
||||
AC_DEFINE_UNQUOTED([ASSUME_RAM], [$enable_assume_ram],
|
||||
[How many MiB of RAM to assume if the real amount cannot
|
||||
be determined.])
|
||||
|
||||
|
||||
#########################
|
||||
# Components to install #
|
||||
#########################
|
||||
|
||||
AC_ARG_ENABLE([xz], [AS_HELP_STRING([--disable-xz],
|
||||
[do not build the xz tool])],
|
||||
[], [enable_xz=yes])
|
||||
AM_CONDITIONAL([COND_XZ], [test x$enable_xz != xno])
|
||||
|
||||
AC_ARG_ENABLE([xzdec], [AS_HELP_STRING([--disable-xzdec],
|
||||
[do not build xzdec])],
|
||||
[], [enable_xzdec=yes])
|
||||
AM_CONDITIONAL([COND_XZDEC], [test x$enable_xzdec != xno])
|
||||
|
||||
AC_ARG_ENABLE([lzmadec], [AS_HELP_STRING([--disable-lzmadec],
|
||||
[do not build lzmadec
|
||||
(it exists primarily for LZMA Utils compatibility)])],
|
||||
[], [enable_lzmadec=yes])
|
||||
AM_CONDITIONAL([COND_LZMADEC], [test x$enable_lzmadec != xno])
|
||||
|
||||
AC_ARG_ENABLE([lzmainfo], [AS_HELP_STRING([--disable-lzmainfo],
|
||||
[do not build lzmainfo
|
||||
(it exists primarily for LZMA Utils compatibility)])],
|
||||
[], [enable_lzmainfo=yes])
|
||||
AM_CONDITIONAL([COND_LZMAINFO], [test x$enable_lzmainfo != xno])
|
||||
|
||||
AC_ARG_ENABLE([lzma-links], [AS_HELP_STRING([--disable-lzma-links],
|
||||
[do not create symlinks for LZMA Utils compatibility])],
|
||||
[], [enable_lzma_links=yes])
|
||||
AM_CONDITIONAL([COND_LZMALINKS], [test x$enable_lzma_links != xno])
|
||||
|
||||
AC_ARG_ENABLE([scripts], [AS_HELP_STRING([--disable-scripts],
|
||||
[do not install the scripts xzdiff, xzgrep, xzless, xzmore,
|
||||
and their symlinks])],
|
||||
[], [enable_scripts=yes])
|
||||
AM_CONDITIONAL([COND_SCRIPTS], [test x$enable_scripts != xno])
|
||||
|
||||
AC_ARG_ENABLE([doc], [AS_HELP_STRING([--disable-doc],
|
||||
[do not install documentation files to docdir
|
||||
(man pages will still be installed)])],
|
||||
[], [enable_doc=yes])
|
||||
AM_CONDITIONAL([COND_DOC], [test x$enable_doc != xno])
|
||||
|
||||
|
||||
#####################
|
||||
# Symbol versioning #
|
||||
#####################
|
||||
|
||||
AC_MSG_CHECKING([if library symbol versioning should be used])
|
||||
AC_ARG_ENABLE([symbol-versions], [AS_HELP_STRING([--enable-symbol-versions],
|
||||
[Use symbol versioning for liblzma. Enabled by default on
|
||||
GNU/Linux, other GNU-based systems, and FreeBSD.])],
|
||||
[], [enable_symbol_versions=auto])
|
||||
if test "x$enable_symbol_versions" = xauto; then
|
||||
case $host_os in
|
||||
# NOTE: Even if one omits -gnu on GNU/Linux (e.g.
|
||||
# i486-slackware-linux), configure will (via config.sub)
|
||||
# append -gnu (e.g. i486-slackware-linux-gnu), and this
|
||||
# test will work correctly.
|
||||
gnu* | *-gnu* | freebsd*)
|
||||
enable_symbol_versions=yes
|
||||
;;
|
||||
*)
|
||||
enable_symbol_versions=no
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
AC_MSG_RESULT([$enable_symbol_versions])
|
||||
AM_CONDITIONAL([COND_SYMVERS], [test "x$enable_symbol_versions" = xyes])
|
||||
|
||||
|
||||
###############################################################################
|
||||
@@ -419,7 +481,12 @@ fi
|
||||
echo
|
||||
echo "Initializing Automake:"
|
||||
|
||||
AM_INIT_AUTOMAKE([1.10 foreign tar-v7 filename-length-max=99])
|
||||
# We don't use "subdir-objects" yet because it breaks "make distclean" when
|
||||
# dependencies are enabled (as of Automake 1.14.1) due to this bug:
|
||||
# http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17354
|
||||
# The -Wno-unsupported is used to silence warnings about missing
|
||||
# "subdir-objects".
|
||||
AM_INIT_AUTOMAKE([1.12 foreign tar-v7 filename-length-max=99 serial-tests -Wno-unsupported])
|
||||
AC_PROG_LN_S
|
||||
|
||||
AC_PROG_CC_C99
|
||||
@@ -431,14 +498,49 @@ AM_PROG_CC_C_O
|
||||
AM_PROG_AS
|
||||
AC_USE_SYSTEM_EXTENSIONS
|
||||
|
||||
if test "x$enable_threads" = xyes; then
|
||||
echo
|
||||
echo "Threading support:"
|
||||
ACX_PTHREAD
|
||||
LIBS="$LIBS $PTHREAD_LIBS"
|
||||
AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS"
|
||||
CC="$PTHREAD_CC"
|
||||
fi
|
||||
case $enable_threads in
|
||||
posix)
|
||||
echo
|
||||
echo "POSIX threading support:"
|
||||
AX_PTHREAD([:]) dnl We don't need the HAVE_PTHREAD macro.
|
||||
LIBS="$LIBS $PTHREAD_LIBS"
|
||||
AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS"
|
||||
|
||||
dnl NOTE: PTHREAD_CC is ignored. It would be useful on AIX,
|
||||
dnl but it's tricky to get it right together with
|
||||
dnl AC_PROG_CC_C99. Thus, this is handled by telling the
|
||||
dnl user in INSTALL to set the correct CC manually.
|
||||
|
||||
AC_DEFINE([MYTHREAD_POSIX], [1],
|
||||
[Define to 1 when using POSIX threads (pthreads).])
|
||||
|
||||
# These are nice to have but not mandatory.
|
||||
#
|
||||
# FIXME: xz uses clock_gettime if it is available and can do
|
||||
# it even when threading is disabled. Moving this outside
|
||||
# of pthread detection may be undesirable because then
|
||||
# liblzma may get linked against librt even when librt isn't
|
||||
# needed by liblzma.
|
||||
OLD_CFLAGS=$CFLAGS
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
AC_SEARCH_LIBS([clock_gettime], [rt])
|
||||
AC_CHECK_FUNCS([clock_gettime pthread_condattr_setclock])
|
||||
AC_CHECK_DECLS([CLOCK_MONOTONIC], [], [], [[#include <time.h>]])
|
||||
CFLAGS=$OLD_CFLAGS
|
||||
;;
|
||||
win95)
|
||||
AC_DEFINE([MYTHREAD_WIN95], [1], [Define to 1 when using
|
||||
Windows 95 (and thus XP) compatible threads.
|
||||
This avoids use of features that were added in
|
||||
Windows Vista.])
|
||||
;;
|
||||
vista)
|
||||
AC_DEFINE([MYTHREAD_VISTA], [1], [Define to 1 when using
|
||||
Windows Vista compatible threads. This uses
|
||||
features that are not available on Windows XP.])
|
||||
;;
|
||||
esac
|
||||
AM_CONDITIONAL([COND_THREADS], [test "x$enable_threads" != xno])
|
||||
|
||||
echo
|
||||
echo "Initializing Libtool:"
|
||||
@@ -459,9 +561,10 @@ AM_CONDITIONAL([COND_SHARED], [test "x$enable_shared" != xno])
|
||||
|
||||
echo
|
||||
echo "Initializing gettext:"
|
||||
AM_GNU_GETTEXT_VERSION([0.16.1])
|
||||
AM_GNU_GETTEXT_VERSION([0.18])
|
||||
AM_GNU_GETTEXT([external])
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Checks for header files.
|
||||
###############################################################################
|
||||
@@ -475,34 +578,8 @@ AC_CHECK_HEADERS([fcntl.h limits.h sys/time.h],
|
||||
[],
|
||||
[AC_MSG_ERROR([Required header file(s) are missing.])])
|
||||
|
||||
# If any of these headers are missing, things should still work correctly:
|
||||
AC_CHECK_HEADERS([sys/param.h sys/sysctl.h byteswap.h],
|
||||
[], [], [
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
# include <sys/param.h>
|
||||
#endif
|
||||
])
|
||||
|
||||
# Even if we have byteswap.h, we may lack the specific macros/functions.
|
||||
if test x$ac_cv_header_byteswap_h = xyes ; then
|
||||
m4_foreach([FUNC], [bswap_16,bswap_32,bswap_64], [
|
||||
AC_MSG_CHECKING([if FUNC is available])
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
||||
#include <byteswap.h>
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
FUNC[](42);
|
||||
return 0;
|
||||
}
|
||||
])], [
|
||||
AC_DEFINE(HAVE_[]m4_toupper(FUNC), [1],
|
||||
[Define to 1 if] FUNC [is available.])
|
||||
AC_MSG_RESULT([yes])
|
||||
], [AC_MSG_RESULT([no])])
|
||||
|
||||
])dnl
|
||||
fi
|
||||
# This allows the use of the intrinsic functions if they are available.
|
||||
AC_CHECK_HEADERS([immintrin.h])
|
||||
|
||||
|
||||
###############################################################################
|
||||
@@ -526,7 +603,7 @@ AC_TYPE_UINTPTR_T
|
||||
AC_CHECK_SIZEOF([size_t])
|
||||
|
||||
# The command line tool can copy high resolution timestamps if such
|
||||
# information is availabe in struct stat. Otherwise one second accuracy
|
||||
# information is available in struct stat. Otherwise one second accuracy
|
||||
# is used.
|
||||
AC_CHECK_MEMBERS([
|
||||
struct stat.st_atim.tv_nsec,
|
||||
@@ -549,8 +626,77 @@ gl_GETOPT
|
||||
# Find the best function to set timestamps.
|
||||
AC_CHECK_FUNCS([futimens futimes futimesat utimes utime], [break])
|
||||
|
||||
lc_PHYSMEM
|
||||
lc_CPUCORES
|
||||
# This is nice to have but not mandatory.
|
||||
AC_CHECK_FUNCS([posix_fadvise])
|
||||
|
||||
TUKLIB_PROGNAME
|
||||
TUKLIB_INTEGER
|
||||
TUKLIB_PHYSMEM
|
||||
TUKLIB_CPUCORES
|
||||
TUKLIB_MBSTR
|
||||
|
||||
# Check for system-provided SHA-256. At least the following is supported:
|
||||
#
|
||||
# OS Headers Library Type Function
|
||||
# FreeBSD sys/types.h + sha256.h libmd SHA256_CTX SHA256_Init
|
||||
# NetBSD sys/types.h + sha2.h SHA256_CTX SHA256_Init
|
||||
# OpenBSD sys/types.h + sha2.h SHA2_CTX SHA256Init
|
||||
# Solaris sys/types.h + sha2.h libmd SHA256_CTX SHA256Init
|
||||
# MINIX 3 sys/types.h + minix/sha2.h libutil SHA256_CTX SHA256_Init
|
||||
# Darwin CommonCrypto/CommonDigest.h CC_SHA256_CTX CC_SHA256_Init
|
||||
#
|
||||
# Note that Darwin's CC_SHA256_Update takes buffer size as uint32_t instead
|
||||
# of size_t.
|
||||
#
|
||||
# We don't check for e.g. OpenSSL or libgcrypt because we don't want
|
||||
# to introduce dependencies to other packages by default. Maybe such
|
||||
# libraries could be supported via additional configure options though.
|
||||
#
|
||||
if test "x$enable_check_sha256" = "xyes"; then
|
||||
# Test for Common Crypto before others, because Darwin has sha256.h
|
||||
# too and we don't want to use that, because on older versions it
|
||||
# uses OpenSSL functions, whose SHA256_Init is not guaranteed to
|
||||
# succeed.
|
||||
sha256_header_found=no
|
||||
AC_CHECK_HEADERS(
|
||||
[CommonCrypto/CommonDigest.h sha256.h sha2.h minix/sha2.h],
|
||||
[sha256_header_found=yes ; break])
|
||||
if test "x$sha256_header_found" = xyes; then
|
||||
AC_CHECK_TYPES([CC_SHA256_CTX, SHA256_CTX, SHA2_CTX], [], [],
|
||||
[[#ifdef HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_COMMONCRYPTO_COMMONDIGEST_H
|
||||
# include <CommonCrypto/CommonDigest.h>
|
||||
#endif
|
||||
#ifdef HAVE_SHA256_H
|
||||
# include <sha256.h>
|
||||
#endif
|
||||
#ifdef HAVE_SHA2_H
|
||||
# include <sha2.h>
|
||||
#endif
|
||||
#ifdef HAVE_MINIX_SHA2_H
|
||||
# include <minix/sha2.h>
|
||||
#endif]])
|
||||
AC_SEARCH_LIBS([SHA256_Init], [md util])
|
||||
AC_SEARCH_LIBS([SHA256Init], [md])
|
||||
AC_CHECK_FUNCS([CC_SHA256_Init SHA256_Init SHA256Init],
|
||||
[break])
|
||||
fi
|
||||
fi
|
||||
AM_CONDITIONAL([COND_INTERNAL_SHA256],
|
||||
[test "x$ac_cv_func_SHA256_Init" != xyes \
|
||||
&& test "x$ac_cv_func_SHA256Init" != xyes \
|
||||
&& test "x$ac_cv_func_CC_SHA256_Init" != xyes])
|
||||
|
||||
# Check for SSE2 intrinsics.
|
||||
AC_CHECK_DECL([_mm_movemask_epi8],
|
||||
[AC_DEFINE([HAVE__MM_MOVEMASK_EPI8], [1],
|
||||
[Define to 1 if _mm_movemask_epi8 is available.])],
|
||||
[],
|
||||
[#ifdef HAVE_IMMINTRIN_H
|
||||
#include <immintrin.h>
|
||||
#endif])
|
||||
|
||||
|
||||
###############################################################################
|
||||
@@ -585,6 +731,7 @@ if test "$GCC" = yes ; then
|
||||
for NEW_FLAG in \
|
||||
-Wall \
|
||||
-Wextra \
|
||||
-Wvla \
|
||||
-Wformat=2 \
|
||||
-Winit-self \
|
||||
-Wmissing-include-dirs \
|
||||
@@ -606,8 +753,9 @@ if test "$GCC" = yes ; then
|
||||
do
|
||||
AC_MSG_CHECKING([if $CC accepts $NEW_FLAG])
|
||||
OLD_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $NEW_FLAG"
|
||||
AC_COMPILE_IFELSE([void foo(void) { }], [
|
||||
CFLAGS="$CFLAGS $NEW_FLAG -Werror"
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE(
|
||||
[void foo(void); void foo(void) { }])], [
|
||||
AM_CFLAGS="$AM_CFLAGS $NEW_FLAG"
|
||||
AC_MSG_RESULT([yes])
|
||||
], [
|
||||
@@ -617,7 +765,7 @@ if test "$GCC" = yes ; then
|
||||
done
|
||||
|
||||
AC_ARG_ENABLE([werror],
|
||||
AC_HELP_STRING([--enable-werror], [Enable -Werror to abort
|
||||
AS_HELP_STRING([--enable-werror], [Enable -Werror to abort
|
||||
compilation on all compiler warnings.]),
|
||||
[], [enable_werror=no])
|
||||
if test "x$enable_werror" = "xyes"; then
|
||||
@@ -639,45 +787,6 @@ AM_CONDITIONAL([COND_GNULIB], test -n "$LIBOBJS")
|
||||
# Add default AM_CFLAGS.
|
||||
AC_SUBST([AM_CFLAGS])
|
||||
|
||||
# Set additional flags for static/dynamic linking. The idea is that every
|
||||
# program (not library) being built will use either STATIC_{CPPFLAGS,LDFLAGS}
|
||||
# or DYNAMIC_{CPPFLAGS,LDFLAGS} depending on which type of linkage is
|
||||
# preferred. These preferences get overriden by use of --disable-static,
|
||||
# --disable-shared, or --enable-dynamic.
|
||||
#
|
||||
# This is quite messy, because we want to use LZMA_API_STATIC when linking
|
||||
# against static liblzma. It's needed on Windows.
|
||||
if test "x$enable_static" = xno; then
|
||||
enable_dynamic=yes
|
||||
fi
|
||||
if test "x$enable_shared" = xno; then
|
||||
enable_dynamic=no
|
||||
fi
|
||||
case $enable_dynamic in
|
||||
yes)
|
||||
STATIC_CPPFLAGS=
|
||||
STATIC_LDFLAGS=
|
||||
DYNAMIC_CPPFLAGS=
|
||||
DYNAMIC_LDFLAGS=
|
||||
;;
|
||||
mixed)
|
||||
STATIC_CPPFLAGS="-DLZMA_API_STATIC"
|
||||
STATIC_LDFLAGS="-static"
|
||||
DYNAMIC_CPPFLAGS=
|
||||
DYNAMIC_LDFLAGS=
|
||||
;;
|
||||
no)
|
||||
STATIC_CPPFLAGS="-DLZMA_API_STATIC"
|
||||
STATIC_LDFLAGS="-static"
|
||||
DYNAMIC_CPPFLAGS="-DLZMA_API_STATIC"
|
||||
DYNAMIC_LDFLAGS="-static"
|
||||
;;
|
||||
esac
|
||||
AC_SUBST([STATIC_CPPFLAGS])
|
||||
AC_SUBST([STATIC_LDFLAGS])
|
||||
AC_SUBST([DYNAMIC_CPPFLAGS])
|
||||
AC_SUBST([DYNAMIC_LDFLAGS])
|
||||
|
||||
# This is needed for src/scripts.
|
||||
xz=`echo xz | sed "$program_transform_name"`
|
||||
AC_SUBST([xz])
|
||||
@@ -688,19 +797,40 @@ AC_CONFIG_FILES([
|
||||
po/Makefile.in
|
||||
lib/Makefile
|
||||
src/Makefile
|
||||
src/liblzma/liblzma.pc
|
||||
src/liblzma/Makefile
|
||||
src/liblzma/api/Makefile
|
||||
src/xz/Makefile
|
||||
src/xzdec/Makefile
|
||||
src/lzmainfo/Makefile
|
||||
src/scripts/Makefile
|
||||
src/scripts/xzdiff
|
||||
src/scripts/xzgrep
|
||||
src/scripts/xzmore
|
||||
src/scripts/xzless
|
||||
tests/Makefile
|
||||
debug/Makefile
|
||||
])
|
||||
AC_CONFIG_FILES([src/scripts/xzdiff], [chmod +x src/scripts/xzdiff])
|
||||
AC_CONFIG_FILES([src/scripts/xzgrep], [chmod +x src/scripts/xzgrep])
|
||||
AC_CONFIG_FILES([src/scripts/xzmore], [chmod +x src/scripts/xzmore])
|
||||
AC_CONFIG_FILES([src/scripts/xzless], [chmod +x src/scripts/xzless])
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
# Some warnings
|
||||
if test x$tuklib_cv_physmem_method = xunknown; then
|
||||
echo
|
||||
echo "WARNING:"
|
||||
echo "No supported method to detect the amount of RAM."
|
||||
echo "Consider using --enable-assume-ram (if you didn't already)"
|
||||
echo "or make a patch to add support for this operating system."
|
||||
fi
|
||||
|
||||
if test x$tuklib_cv_cpucores_method = xunknown; then
|
||||
echo
|
||||
echo "WARNING:"
|
||||
echo "No supported method to detect the number of CPU cores."
|
||||
fi
|
||||
|
||||
if test "x$enable_threads$enable_small" = xnoyes; then
|
||||
echo
|
||||
echo "NOTE:"
|
||||
echo "liblzma will be thread unsafe due the combination"
|
||||
echo "of --disable-threads --enable-small."
|
||||
fi
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
## You can do whatever you want with this file.
|
||||
##
|
||||
|
||||
EXTRA_DIST = \
|
||||
translation.bash
|
||||
|
||||
noinst_PROGRAMS = \
|
||||
repeat \
|
||||
sync_flush \
|
||||
@@ -16,10 +19,7 @@ noinst_PROGRAMS = \
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/common \
|
||||
-I$(top_srcdir)/src/liblzma/api \
|
||||
$(STATIC_CPPFLAGS)
|
||||
|
||||
AM_LDFLAGS = $(STATIC_LDFLAGS)
|
||||
-I$(top_srcdir)/src/liblzma/api
|
||||
|
||||
LDADD = $(top_builddir)/src/liblzma/liblzma.la
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ Debug tools
|
||||
-----------
|
||||
|
||||
This directory contains a few tiny programs that may be helpful when
|
||||
debugging LZMA Utils.
|
||||
debugging XZ Utils.
|
||||
|
||||
These tools are not meant to be installed. Often one needs to edit
|
||||
the source code a little to make the programs do the wanted things.
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "sysdefs.h"
|
||||
#include "lzma.h"
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
#include "lzma.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#define CHUNK 64
|
||||
|
||||
|
||||
static lzma_stream strm = LZMA_STREAM_INIT;
|
||||
static FILE *file_in;
|
||||
@@ -22,14 +24,13 @@ static FILE *file_in;
|
||||
static void
|
||||
encode(size_t size, lzma_action action)
|
||||
{
|
||||
static const size_t CHUNK = 64;
|
||||
uint8_t in[CHUNK];
|
||||
uint8_t out[CHUNK];
|
||||
lzma_ret ret;
|
||||
|
||||
do {
|
||||
if (strm.avail_in == 0 && size > 0) {
|
||||
const size_t amount = MIN(size, CHUNK);
|
||||
const size_t amount = my_min(size, CHUNK);
|
||||
strm.avail_in = fread(in, 1, amount, file_in);
|
||||
strm.next_in = in;
|
||||
size -= amount; // Intentionally not using avail_in.
|
||||
|
||||
@@ -87,7 +87,7 @@ main(void)
|
||||
!= LZMA_OK)
|
||||
return 1;
|
||||
|
||||
lzma_index *idx = lzma_index_init(NULL, NULL);
|
||||
lzma_index *idx = lzma_index_init(NULL);
|
||||
if (idx == NULL)
|
||||
return 1;
|
||||
|
||||
|
||||
@@ -42,8 +42,10 @@ main(void)
|
||||
{ UINT64_MAX, NULL }
|
||||
};
|
||||
|
||||
printf("Encoder: %10" PRIu64 " B\n", lzma_memusage_encoder(filters));
|
||||
printf("Decoder: %10" PRIu64 " B\n", lzma_memusage_decoder(filters));
|
||||
printf("Encoder: %10" PRIu64 " B\n",
|
||||
lzma_raw_encoder_memusage(filters));
|
||||
printf("Decoder: %10" PRIu64 " B\n",
|
||||
lzma_raw_decoder_memusage(filters));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
#include "lzma.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#define CHUNK 64
|
||||
|
||||
|
||||
static lzma_stream strm = LZMA_STREAM_INIT;
|
||||
static FILE *file_in;
|
||||
@@ -22,14 +24,13 @@ static FILE *file_in;
|
||||
static void
|
||||
encode(size_t size, lzma_action action)
|
||||
{
|
||||
static const size_t CHUNK = 64;
|
||||
uint8_t in[CHUNK];
|
||||
uint8_t out[CHUNK];
|
||||
lzma_ret ret;
|
||||
|
||||
do {
|
||||
if (strm.avail_in == 0 && size > 0) {
|
||||
const size_t amount = MIN(size, CHUNK);
|
||||
const size_t amount = my_min(size, CHUNK);
|
||||
strm.avail_in = fread(in, 1, amount, file_in);
|
||||
strm.next_in = in;
|
||||
size -= amount; // Intentionally not using avail_in.
|
||||
@@ -71,7 +72,6 @@ main(int argc, char **argv)
|
||||
.lp = LZMA_LP_DEFAULT,
|
||||
.pb = LZMA_PB_DEFAULT,
|
||||
.preset_dict = NULL,
|
||||
.persistent = true,
|
||||
.mode = LZMA_MODE_NORMAL,
|
||||
.nice_len = 32,
|
||||
.mf = LZMA_MF_HC3,
|
||||
@@ -82,18 +82,6 @@ main(int argc, char **argv)
|
||||
.dist = 16
|
||||
};
|
||||
|
||||
lzma_options_subblock opt_subblock = {
|
||||
.allow_subfilters = true,
|
||||
.alignment = 8, // LZMA_SUBBLOCK_ALIGNMENT_DEFAULT,
|
||||
.subblock_data_size = LZMA_SUBBLOCK_DATA_SIZE_DEFAULT,
|
||||
.rle = 1, // LZMA_SUBBLOCK_RLE_OFF,
|
||||
.subfilter_mode = LZMA_SUBFILTER_SET,
|
||||
};
|
||||
opt_subblock.subfilter_options.id = LZMA_FILTER_LZMA1;
|
||||
opt_subblock.subfilter_options.options = &opt_lzma;
|
||||
opt_subblock.subfilter_options.id = LZMA_FILTER_DELTA;
|
||||
opt_subblock.subfilter_options.options = &opt_delta;
|
||||
|
||||
lzma_filter filters[LZMA_FILTERS_MAX + 1];
|
||||
filters[0].id = LZMA_FILTER_LZMA2;
|
||||
filters[0].options = &opt_lzma;
|
||||
@@ -106,20 +94,25 @@ main(int argc, char **argv)
|
||||
}
|
||||
|
||||
// Encoding
|
||||
|
||||
encode(0, LZMA_SYNC_FLUSH);
|
||||
encode(6, LZMA_SYNC_FLUSH);
|
||||
encode(0, LZMA_SYNC_FLUSH);
|
||||
encode(7, LZMA_SYNC_FLUSH);
|
||||
encode(0, LZMA_SYNC_FLUSH);
|
||||
encode(0, LZMA_FINISH);
|
||||
|
||||
/*
|
||||
encode(53, LZMA_SYNC_FLUSH);
|
||||
// opt_lzma.literal_context_bits = 2;
|
||||
// opt_lzma.literal_pos_bits = 1;
|
||||
// opt_lzma.pos_bits = 0;
|
||||
opt_lzma.lc = 2;
|
||||
opt_lzma.lp = 1;
|
||||
opt_lzma.pb = 0;
|
||||
if (lzma_filters_update(&strm, filters) != LZMA_OK) {
|
||||
fprintf(stderr, "update failed\n");
|
||||
exit(1);
|
||||
}
|
||||
encode(404, LZMA_FINISH);
|
||||
*/
|
||||
|
||||
// Clean up
|
||||
lzma_end(&strm);
|
||||
|
||||
@@ -128,6 +121,5 @@ main(int argc, char **argv)
|
||||
// Prevent useless warnings so we don't need to have special CFLAGS
|
||||
// to disable -Werror.
|
||||
(void)opt_lzma;
|
||||
(void)opt_subblock;
|
||||
(void)opt_delta;
|
||||
}
|
||||
|
||||
100
debug/translation.bash
Normal file
100
debug/translation.bash
Normal file
@@ -0,0 +1,100 @@
|
||||
#!/bin/bash
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Script to check output of some translated messages
|
||||
#
|
||||
# This should be useful for translators to check that the translated strings
|
||||
# look good. This doesn't make xz print all possible strings, but it should
|
||||
# cover most of the cases where mistakes can easily happen.
|
||||
#
|
||||
# Give the path and filename of the xz executable as an argument. If no
|
||||
# arguments are given, this script uses ../src/xz/xz (relative to the
|
||||
# location of this script).
|
||||
#
|
||||
# You may want to pipe the output of this script to less -S to view the
|
||||
# tables printed by xz --list on a 80-column terminal. On the other hand,
|
||||
# viewing the other messages may be better without -S.
|
||||
#
|
||||
###############################################################################
|
||||
#
|
||||
# Author: Lasse Collin
|
||||
#
|
||||
# This file has been put into the public domain.
|
||||
# You can do whatever you want with this file.
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
set -e
|
||||
|
||||
# If an argument was given, use it to set the location of the xz executable.
|
||||
unset XZ
|
||||
if [ -n "$1" ]; then
|
||||
XZ=$1
|
||||
[ "x${XZ:0:1}" != "x/" ] && XZ="$PWD/$XZ"
|
||||
fi
|
||||
|
||||
# Locate top_srcdir and go there.
|
||||
top_srcdir="$(cd -- "$(dirname -- "$0")" && cd .. && pwd)"
|
||||
cd -- "$top_srcdir"
|
||||
|
||||
# If XZ wasn't already set, use the default location.
|
||||
XZ=${XZ-"$PWD/src/xz/xz"}
|
||||
if [ "$(type -t "$XZ" || true)" != "file" ]; then
|
||||
echo "Give the location of the xz executable as an argument" \
|
||||
"to this script."
|
||||
exit 1
|
||||
fi
|
||||
XZ=$(type -p -- "$XZ")
|
||||
|
||||
# Print the xz version and locale information.
|
||||
echo "$XZ --version"
|
||||
"$XZ" --version
|
||||
echo
|
||||
if [ -d .git ] && type git > /dev/null 2>&1; then
|
||||
echo "Source code version in $PWD:"
|
||||
git describe --abbrev=4
|
||||
fi
|
||||
echo
|
||||
locale
|
||||
echo
|
||||
|
||||
# Make the test files directory the current directory.
|
||||
cd tests/files
|
||||
|
||||
# Put xz in PATH so that argv[0] stays short.
|
||||
PATH=${XZ%/*}:$PATH
|
||||
|
||||
# Some of the test commands are error messages and thus don't
|
||||
# return successfully.
|
||||
set +e
|
||||
|
||||
for CMD in \
|
||||
"xz --foobarbaz" \
|
||||
"xz --memlimit=123abcd" \
|
||||
"xz --memlimit=40MiB -6 /dev/null" \
|
||||
"xz --memlimit=0 --info-memory" \
|
||||
"xz --memlimit-compress=1234MiB --memlimit-decompress=50MiB --info-memory" \
|
||||
"xz --verbose --verbose /dev/null | cat" \
|
||||
"xz --lzma2=foobarbaz" \
|
||||
"xz --lzma2=foobarbaz=abcd" \
|
||||
"xz --lzma2=mf=abcd" \
|
||||
"xz --lzma2=preset=foobarbaz" \
|
||||
"xz --lzma2=mf=bt4,nice=2" \
|
||||
"xz --lzma2=nice=50000" \
|
||||
"xz --help" \
|
||||
"xz --long-help" \
|
||||
"xz --list good-*lzma2*" \
|
||||
"xz --list good-1-check*" \
|
||||
"xz --list --verbose good-*lzma2*" \
|
||||
"xz --list --verbose good-1-check*" \
|
||||
"xz --list --verbose --verbose good-*lzma2*" \
|
||||
"xz --list --verbose --verbose good-1-check*" \
|
||||
"xz --list --verbose --verbose unsupported-check.xz"
|
||||
do
|
||||
echo "-----------------------------------------------------------"
|
||||
echo
|
||||
echo "\$ $CMD"
|
||||
eval "$CMD"
|
||||
echo
|
||||
done 2>&1
|
||||
31
doc/examples/00_README.txt
Normal file
31
doc/examples/00_README.txt
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
liblzma example programs
|
||||
========================
|
||||
|
||||
Introduction
|
||||
|
||||
The examples are written so that the same comments aren't
|
||||
repeated (much) in later files.
|
||||
|
||||
On POSIX systems, the examples should build by just typing "make".
|
||||
|
||||
The examples that use stdin or stdout don't set stdin and stdout
|
||||
to binary mode. On systems where it matters (e.g. Windows) it is
|
||||
possible that the examples won't work without modification.
|
||||
|
||||
|
||||
List of examples
|
||||
|
||||
01_compress_easy.c Multi-call compression using
|
||||
a compression preset
|
||||
|
||||
02_decompress.c Multi-call decompression
|
||||
|
||||
03_compress_custom.c Like 01_compress_easy.c but using
|
||||
a custom filter chain
|
||||
(x86 BCJ + LZMA2)
|
||||
|
||||
04_compress_easy_mt.c Multi-threaded multi-call
|
||||
compression using a compression
|
||||
preset
|
||||
|
||||
297
doc/examples/01_compress_easy.c
Normal file
297
doc/examples/01_compress_easy.c
Normal file
@@ -0,0 +1,297 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file 01_compress_easy.c
|
||||
/// \brief Compress from stdin to stdout in multi-call mode
|
||||
///
|
||||
/// Usage: ./01_compress_easy PRESET < INFILE > OUTFILE
|
||||
///
|
||||
/// Example: ./01_compress_easy 6 < foo > foo.xz
|
||||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <lzma.h>
|
||||
|
||||
|
||||
static void
|
||||
show_usage_and_exit(const char *argv0)
|
||||
{
|
||||
fprintf(stderr, "Usage: %s PRESET < INFILE > OUTFILE\n"
|
||||
"PRESET is a number 0-9 and can optionally be "
|
||||
"followed by `e' to indicate extreme preset\n",
|
||||
argv0);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
||||
static uint32_t
|
||||
get_preset(int argc, char **argv)
|
||||
{
|
||||
// One argument whose first char must be 0-9.
|
||||
if (argc != 2 || argv[1][0] < '0' || argv[1][0] > '9')
|
||||
show_usage_and_exit(argv[0]);
|
||||
|
||||
// Calculate the preste level 0-9.
|
||||
uint32_t preset = argv[1][0] - '0';
|
||||
|
||||
// If there is a second char, it must be 'e'. It will set
|
||||
// the LZMA_PRESET_EXTREME flag.
|
||||
if (argv[1][1] != '\0') {
|
||||
if (argv[1][1] != 'e' || argv[1][2] != '\0')
|
||||
show_usage_and_exit(argv[0]);
|
||||
|
||||
preset |= LZMA_PRESET_EXTREME;
|
||||
}
|
||||
|
||||
return preset;
|
||||
}
|
||||
|
||||
|
||||
static bool
|
||||
init_encoder(lzma_stream *strm, uint32_t preset)
|
||||
{
|
||||
// Initialize the encoder using a preset. Set the integrity to check
|
||||
// to CRC64, which is the default in the xz command line tool. If
|
||||
// the .xz file needs to be decompressed with XZ Embedded, use
|
||||
// LZMA_CHECK_CRC32 instead.
|
||||
lzma_ret ret = lzma_easy_encoder(strm, preset, LZMA_CHECK_CRC64);
|
||||
|
||||
// Return successfully if the initialization went fine.
|
||||
if (ret == LZMA_OK)
|
||||
return true;
|
||||
|
||||
// Something went wrong. The possible errors are documented in
|
||||
// lzma/container.h (src/liblzma/api/lzma/container.h in the source
|
||||
// package or e.g. /usr/include/lzma/container.h depending on the
|
||||
// install prefix).
|
||||
const char *msg;
|
||||
switch (ret) {
|
||||
case LZMA_MEM_ERROR:
|
||||
msg = "Memory allocation failed";
|
||||
break;
|
||||
|
||||
case LZMA_OPTIONS_ERROR:
|
||||
msg = "Specified preset is not supported";
|
||||
break;
|
||||
|
||||
case LZMA_UNSUPPORTED_CHECK:
|
||||
msg = "Specified integrity check is not supported";
|
||||
break;
|
||||
|
||||
default:
|
||||
// This is most likely LZMA_PROG_ERROR indicating a bug in
|
||||
// this program or in liblzma. It is inconvenient to have a
|
||||
// separate error message for errors that should be impossible
|
||||
// to occur, but knowing the error code is important for
|
||||
// debugging. That's why it is good to print the error code
|
||||
// at least when there is no good error message to show.
|
||||
msg = "Unknown error, possibly a bug";
|
||||
break;
|
||||
}
|
||||
|
||||
fprintf(stderr, "Error initializing the encoder: %s (error code %u)\n",
|
||||
msg, ret);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
static bool
|
||||
compress(lzma_stream *strm, FILE *infile, FILE *outfile)
|
||||
{
|
||||
// This will be LZMA_RUN until the end of the input file is reached.
|
||||
// This tells lzma_code() when there will be no more input.
|
||||
lzma_action action = LZMA_RUN;
|
||||
|
||||
// Buffers to temporarily hold uncompressed input
|
||||
// and compressed output.
|
||||
uint8_t inbuf[BUFSIZ];
|
||||
uint8_t outbuf[BUFSIZ];
|
||||
|
||||
// Initialize the input and output pointers. Initializing next_in
|
||||
// and avail_in isn't really necessary when we are going to encode
|
||||
// just one file since LZMA_STREAM_INIT takes care of initializing
|
||||
// those already. But it doesn't hurt much and it will be needed
|
||||
// if encoding more than one file like we will in 02_decompress.c.
|
||||
//
|
||||
// While we don't care about strm->total_in or strm->total_out in this
|
||||
// example, it is worth noting that initializing the encoder will
|
||||
// always reset total_in and total_out to zero. But the encoder
|
||||
// initialization doesn't touch next_in, avail_in, next_out, or
|
||||
// avail_out.
|
||||
strm->next_in = NULL;
|
||||
strm->avail_in = 0;
|
||||
strm->next_out = outbuf;
|
||||
strm->avail_out = sizeof(outbuf);
|
||||
|
||||
// Loop until the file has been successfully compressed or until
|
||||
// an error occurs.
|
||||
while (true) {
|
||||
// Fill the input buffer if it is empty.
|
||||
if (strm->avail_in == 0 && !feof(infile)) {
|
||||
strm->next_in = inbuf;
|
||||
strm->avail_in = fread(inbuf, 1, sizeof(inbuf),
|
||||
infile);
|
||||
|
||||
if (ferror(infile)) {
|
||||
fprintf(stderr, "Read error: %s\n",
|
||||
strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
||||
// Once the end of the input file has been reached,
|
||||
// we need to tell lzma_code() that no more input
|
||||
// will be coming and that it should finish the
|
||||
// encoding.
|
||||
if (feof(infile))
|
||||
action = LZMA_FINISH;
|
||||
}
|
||||
|
||||
// Tell liblzma do the actual encoding.
|
||||
//
|
||||
// This reads up to strm->avail_in bytes of input starting
|
||||
// from strm->next_in. avail_in will be decremented and
|
||||
// next_in incremented by an equal amount to match the
|
||||
// number of input bytes consumed.
|
||||
//
|
||||
// Up to strm->avail_out bytes of compressed output will be
|
||||
// written starting from strm->next_out. avail_out and next_out
|
||||
// will be incremented by an equal amount to match the number
|
||||
// of output bytes written.
|
||||
//
|
||||
// The encoder has to do internal buffering, which means that
|
||||
// it may take quite a bit of input before the same data is
|
||||
// available in compressed form in the output buffer.
|
||||
lzma_ret ret = lzma_code(strm, action);
|
||||
|
||||
// If the output buffer is full or if the compression finished
|
||||
// successfully, write the data from the output bufffer to
|
||||
// the output file.
|
||||
if (strm->avail_out == 0 || ret == LZMA_STREAM_END) {
|
||||
// When lzma_code() has returned LZMA_STREAM_END,
|
||||
// the output buffer is likely to be only partially
|
||||
// full. Calculate how much new data there is to
|
||||
// be written to the output file.
|
||||
size_t write_size = sizeof(outbuf) - strm->avail_out;
|
||||
|
||||
if (fwrite(outbuf, 1, write_size, outfile)
|
||||
!= write_size) {
|
||||
fprintf(stderr, "Write error: %s\n",
|
||||
strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
||||
// Reset next_out and avail_out.
|
||||
strm->next_out = outbuf;
|
||||
strm->avail_out = sizeof(outbuf);
|
||||
}
|
||||
|
||||
// Normally the return value of lzma_code() will be LZMA_OK
|
||||
// until everything has been encoded.
|
||||
if (ret != LZMA_OK) {
|
||||
// Once everything has been encoded successfully, the
|
||||
// return value of lzma_code() will be LZMA_STREAM_END.
|
||||
//
|
||||
// It is important to check for LZMA_STREAM_END. Do not
|
||||
// assume that getting ret != LZMA_OK would mean that
|
||||
// everything has gone well.
|
||||
if (ret == LZMA_STREAM_END)
|
||||
return true;
|
||||
|
||||
// It's not LZMA_OK nor LZMA_STREAM_END,
|
||||
// so it must be an error code. See lzma/base.h
|
||||
// (src/liblzma/api/lzma/base.h in the source package
|
||||
// or e.g. /usr/include/lzma/base.h depending on the
|
||||
// install prefix) for the list and documentation of
|
||||
// possible values. Most values listen in lzma_ret
|
||||
// enumeration aren't possible in this example.
|
||||
const char *msg;
|
||||
switch (ret) {
|
||||
case LZMA_MEM_ERROR:
|
||||
msg = "Memory allocation failed";
|
||||
break;
|
||||
|
||||
case LZMA_DATA_ERROR:
|
||||
// This error is returned if the compressed
|
||||
// or uncompressed size get near 8 EiB
|
||||
// (2^63 bytes) because that's where the .xz
|
||||
// file format size limits currently are.
|
||||
// That is, the possibility of this error
|
||||
// is mostly theoretical unless you are doing
|
||||
// something very unusual.
|
||||
//
|
||||
// Note that strm->total_in and strm->total_out
|
||||
// have nothing to do with this error. Changing
|
||||
// those variables won't increase or decrease
|
||||
// the chance of getting this error.
|
||||
msg = "File size limits exceeded";
|
||||
break;
|
||||
|
||||
default:
|
||||
// This is most likely LZMA_PROG_ERROR, but
|
||||
// if this program is buggy (or liblzma has
|
||||
// a bug), it may be e.g. LZMA_BUF_ERROR or
|
||||
// LZMA_OPTIONS_ERROR too.
|
||||
//
|
||||
// It is inconvenient to have a separate
|
||||
// error message for errors that should be
|
||||
// impossible to occur, but knowing the error
|
||||
// code is important for debugging. That's why
|
||||
// it is good to print the error code at least
|
||||
// when there is no good error message to show.
|
||||
msg = "Unknown error, possibly a bug";
|
||||
break;
|
||||
}
|
||||
|
||||
fprintf(stderr, "Encoder error: %s (error code %u)\n",
|
||||
msg, ret);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
extern int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
// Get the preset number from the command line.
|
||||
uint32_t preset = get_preset(argc, argv);
|
||||
|
||||
// Initialize a lzma_stream structure. When it is allocated on stack,
|
||||
// it is simplest to use LZMA_STREAM_INIT macro like below. When it
|
||||
// is allocated on heap, using memset(strmptr, 0, sizeof(*strmptr))
|
||||
// works (as long as NULL pointers are represented with zero bits
|
||||
// as they are on practically all computers today).
|
||||
lzma_stream strm = LZMA_STREAM_INIT;
|
||||
|
||||
// Initialize the encoder. If it succeeds, compress from
|
||||
// stdin to stdout.
|
||||
bool success = init_encoder(&strm, preset);
|
||||
if (success)
|
||||
success = compress(&strm, stdin, stdout);
|
||||
|
||||
// Free the memory allocated for the encoder. If we were encoding
|
||||
// multiple files, this would only need to be done after the last
|
||||
// file. See 02_decompress.c for handling of multiple files.
|
||||
//
|
||||
// It is OK to call lzma_end() multiple times or when it hasn't been
|
||||
// actually used except initialized with LZMA_STREAM_INIT.
|
||||
lzma_end(&strm);
|
||||
|
||||
// Close stdout to catch possible write errors that can occur
|
||||
// when pending data is flushed from the stdio buffers.
|
||||
if (fclose(stdout)) {
|
||||
fprintf(stderr, "Write error: %s\n", strerror(errno));
|
||||
success = false;
|
||||
}
|
||||
|
||||
return success ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
}
|
||||
287
doc/examples/02_decompress.c
Normal file
287
doc/examples/02_decompress.c
Normal file
@@ -0,0 +1,287 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file 02_decompress.c
|
||||
/// \brief Decompress .xz files to stdout
|
||||
///
|
||||
/// Usage: ./02_decompress INPUT_FILES... > OUTFILE
|
||||
///
|
||||
/// Example: ./02_decompress foo.xz bar.xz > foobar
|
||||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <lzma.h>
|
||||
|
||||
|
||||
static bool
|
||||
init_decoder(lzma_stream *strm)
|
||||
{
|
||||
// Initialize a .xz decoder. The decoder supports a memory usage limit
|
||||
// and a set of flags.
|
||||
//
|
||||
// The memory usage of the decompressor depends on the settings used
|
||||
// to compress a .xz file. It can vary from less than a megabyte to
|
||||
// a few gigabytes, but in practice (at least for now) it rarely
|
||||
// exceeds 65 MiB because that's how much memory is required to
|
||||
// decompress files created with "xz -9". Settings requiring more
|
||||
// memory take extra effort to use and don't (at least for now)
|
||||
// provide significantly better compression in most cases.
|
||||
//
|
||||
// Memory usage limit is useful if it is important that the
|
||||
// decompressor won't consume gigabytes of memory. The need
|
||||
// for limiting depends on the application. In this example,
|
||||
// no memory usage limiting is used. This is done by setting
|
||||
// the limit to UINT64_MAX.
|
||||
//
|
||||
// The .xz format allows concatenating compressed files as is:
|
||||
//
|
||||
// echo foo | xz > foobar.xz
|
||||
// echo bar | xz >> foobar.xz
|
||||
//
|
||||
// When decompressing normal standalone .xz files, LZMA_CONCATENATED
|
||||
// should always be used to support decompression of concatenated
|
||||
// .xz files. If LZMA_CONCATENATED isn't used, the decoder will stop
|
||||
// after the first .xz stream. This can be useful when .xz data has
|
||||
// been embedded inside another file format.
|
||||
//
|
||||
// Flags other than LZMA_CONCATENATED are supported too, and can
|
||||
// be combined with bitwise-or. See lzma/container.h
|
||||
// (src/liblzma/api/lzma/container.h in the source package or e.g.
|
||||
// /usr/include/lzma/container.h depending on the install prefix)
|
||||
// for details.
|
||||
lzma_ret ret = lzma_stream_decoder(
|
||||
strm, UINT64_MAX, LZMA_CONCATENATED);
|
||||
|
||||
// Return successfully if the initialization went fine.
|
||||
if (ret == LZMA_OK)
|
||||
return true;
|
||||
|
||||
// Something went wrong. The possible errors are documented in
|
||||
// lzma/container.h (src/liblzma/api/lzma/container.h in the source
|
||||
// package or e.g. /usr/include/lzma/container.h depending on the
|
||||
// install prefix).
|
||||
//
|
||||
// Note that LZMA_MEMLIMIT_ERROR is never possible here. If you
|
||||
// specify a very tiny limit, the error will be delayed until
|
||||
// the first headers have been parsed by a call to lzma_code().
|
||||
const char *msg;
|
||||
switch (ret) {
|
||||
case LZMA_MEM_ERROR:
|
||||
msg = "Memory allocation failed";
|
||||
break;
|
||||
|
||||
case LZMA_OPTIONS_ERROR:
|
||||
msg = "Unsupported decompressor flags";
|
||||
break;
|
||||
|
||||
default:
|
||||
// This is most likely LZMA_PROG_ERROR indicating a bug in
|
||||
// this program or in liblzma. It is inconvenient to have a
|
||||
// separate error message for errors that should be impossible
|
||||
// to occur, but knowing the error code is important for
|
||||
// debugging. That's why it is good to print the error code
|
||||
// at least when there is no good error message to show.
|
||||
msg = "Unknown error, possibly a bug";
|
||||
break;
|
||||
}
|
||||
|
||||
fprintf(stderr, "Error initializing the decoder: %s (error code %u)\n",
|
||||
msg, ret);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
static bool
|
||||
decompress(lzma_stream *strm, const char *inname, FILE *infile, FILE *outfile)
|
||||
{
|
||||
// When LZMA_CONCATENATED flag was used when initializing the decoder,
|
||||
// we need to tell lzma_code() when there will be no more input.
|
||||
// This is done by setting action to LZMA_FINISH instead of LZMA_RUN
|
||||
// in the same way as it is done when encoding.
|
||||
//
|
||||
// When LZMA_CONCATENATED isn't used, there is no need to use
|
||||
// LZMA_FINISH to tell when all the input has been read, but it
|
||||
// is still OK to use it if you want. When LZMA_CONCATENATED isn't
|
||||
// used, the decoder will stop after the first .xz stream. In that
|
||||
// case some unused data may be left in strm->next_in.
|
||||
lzma_action action = LZMA_RUN;
|
||||
|
||||
uint8_t inbuf[BUFSIZ];
|
||||
uint8_t outbuf[BUFSIZ];
|
||||
|
||||
strm->next_in = NULL;
|
||||
strm->avail_in = 0;
|
||||
strm->next_out = outbuf;
|
||||
strm->avail_out = sizeof(outbuf);
|
||||
|
||||
while (true) {
|
||||
if (strm->avail_in == 0 && !feof(infile)) {
|
||||
strm->next_in = inbuf;
|
||||
strm->avail_in = fread(inbuf, 1, sizeof(inbuf),
|
||||
infile);
|
||||
|
||||
if (ferror(infile)) {
|
||||
fprintf(stderr, "%s: Read error: %s\n",
|
||||
inname, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
||||
// Once the end of the input file has been reached,
|
||||
// we need to tell lzma_code() that no more input
|
||||
// will be coming. As said before, this isn't required
|
||||
// if the LZMA_CONATENATED flag isn't used when
|
||||
// initializing the decoder.
|
||||
if (feof(infile))
|
||||
action = LZMA_FINISH;
|
||||
}
|
||||
|
||||
lzma_ret ret = lzma_code(strm, action);
|
||||
|
||||
if (strm->avail_out == 0 || ret == LZMA_STREAM_END) {
|
||||
size_t write_size = sizeof(outbuf) - strm->avail_out;
|
||||
|
||||
if (fwrite(outbuf, 1, write_size, outfile)
|
||||
!= write_size) {
|
||||
fprintf(stderr, "Write error: %s\n",
|
||||
strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
||||
strm->next_out = outbuf;
|
||||
strm->avail_out = sizeof(outbuf);
|
||||
}
|
||||
|
||||
if (ret != LZMA_OK) {
|
||||
// Once everything has been decoded successfully, the
|
||||
// return value of lzma_code() will be LZMA_STREAM_END.
|
||||
//
|
||||
// It is important to check for LZMA_STREAM_END. Do not
|
||||
// assume that getting ret != LZMA_OK would mean that
|
||||
// everything has gone well or that when you aren't
|
||||
// getting more output it must have successfully
|
||||
// decoded everything.
|
||||
if (ret == LZMA_STREAM_END)
|
||||
return true;
|
||||
|
||||
// It's not LZMA_OK nor LZMA_STREAM_END,
|
||||
// so it must be an error code. See lzma/base.h
|
||||
// (src/liblzma/api/lzma/base.h in the source package
|
||||
// or e.g. /usr/include/lzma/base.h depending on the
|
||||
// install prefix) for the list and documentation of
|
||||
// possible values. Many values listen in lzma_ret
|
||||
// enumeration aren't possible in this example, but
|
||||
// can be made possible by enabling memory usage limit
|
||||
// or adding flags to the decoder initialization.
|
||||
const char *msg;
|
||||
switch (ret) {
|
||||
case LZMA_MEM_ERROR:
|
||||
msg = "Memory allocation failed";
|
||||
break;
|
||||
|
||||
case LZMA_FORMAT_ERROR:
|
||||
// .xz magic bytes weren't found.
|
||||
msg = "The input is not in the .xz format";
|
||||
break;
|
||||
|
||||
case LZMA_OPTIONS_ERROR:
|
||||
// For example, the headers specify a filter
|
||||
// that isn't supported by this liblzma
|
||||
// version (or it hasn't been enabled when
|
||||
// building liblzma, but no-one sane does
|
||||
// that unless building liblzma for an
|
||||
// embedded system). Upgrading to a newer
|
||||
// liblzma might help.
|
||||
//
|
||||
// Note that it is unlikely that the file has
|
||||
// accidentally became corrupt if you get this
|
||||
// error. The integrity of the .xz headers is
|
||||
// always verified with a CRC32, so
|
||||
// unintentionally corrupt files can be
|
||||
// distinguished from unsupported files.
|
||||
msg = "Unsupported compression options";
|
||||
break;
|
||||
|
||||
case LZMA_DATA_ERROR:
|
||||
msg = "Compressed file is corrupt";
|
||||
break;
|
||||
|
||||
case LZMA_BUF_ERROR:
|
||||
// Typically this error means that a valid
|
||||
// file has got truncated, but it might also
|
||||
// be a damaged part in the file that makes
|
||||
// the decoder think the file is truncated.
|
||||
// If you prefer, you can use the same error
|
||||
// message for this as for LZMA_DATA_ERROR.
|
||||
msg = "Compressed file is truncated or "
|
||||
"otherwise corrupt";
|
||||
break;
|
||||
|
||||
default:
|
||||
// This is most likely LZMA_PROG_ERROR.
|
||||
msg = "Unknown error, possibly a bug";
|
||||
break;
|
||||
}
|
||||
|
||||
fprintf(stderr, "%s: Decoder error: "
|
||||
"%s (error code %u)\n",
|
||||
inname, msg, ret);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
extern int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
if (argc <= 1) {
|
||||
fprintf(stderr, "Usage: %s FILES...\n", argv[0]);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
lzma_stream strm = LZMA_STREAM_INIT;
|
||||
|
||||
bool success = true;
|
||||
|
||||
// Try to decompress all files.
|
||||
for (int i = 1; i < argc; ++i) {
|
||||
if (!init_decoder(&strm)) {
|
||||
// Decoder initialization failed. There's no point
|
||||
// to retry it so we need to exit.
|
||||
success = false;
|
||||
break;
|
||||
}
|
||||
|
||||
FILE *infile = fopen(argv[i], "rb");
|
||||
|
||||
if (infile == NULL) {
|
||||
fprintf(stderr, "%s: Error opening the "
|
||||
"input file: %s\n",
|
||||
argv[i], strerror(errno));
|
||||
success = false;
|
||||
} else {
|
||||
success &= decompress(&strm, argv[i], infile, stdout);
|
||||
fclose(infile);
|
||||
}
|
||||
}
|
||||
|
||||
// Free the memory allocated for the decoder. This only needs to be
|
||||
// done after the last file.
|
||||
lzma_end(&strm);
|
||||
|
||||
if (fclose(stdout)) {
|
||||
fprintf(stderr, "Write error: %s\n", strerror(errno));
|
||||
success = false;
|
||||
}
|
||||
|
||||
return success ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
}
|
||||
193
doc/examples/03_compress_custom.c
Normal file
193
doc/examples/03_compress_custom.c
Normal file
@@ -0,0 +1,193 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file 03_compress_custom.c
|
||||
/// \brief Compress in multi-call mode using x86 BCJ and LZMA2
|
||||
///
|
||||
/// Usage: ./03_compress_custom < INFILE > OUTFILE
|
||||
///
|
||||
/// Example: ./03_compress_custom < foo > foo.xz
|
||||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <lzma.h>
|
||||
|
||||
|
||||
static bool
|
||||
init_encoder(lzma_stream *strm)
|
||||
{
|
||||
// Use the default preset (6) for LZMA2.
|
||||
//
|
||||
// The lzma_options_lzma structure and the lzma_lzma_preset() function
|
||||
// are declared in lzma/lzma12.h (src/liblzma/api/lzma/lzma12.h in the
|
||||
// source package or e.g. /usr/include/lzma/lzma12.h depending on
|
||||
// the install prefix).
|
||||
lzma_options_lzma opt_lzma2;
|
||||
if (lzma_lzma_preset(&opt_lzma2, LZMA_PRESET_DEFAULT)) {
|
||||
// It should never fail because the default preset
|
||||
// (and presets 0-9 optionally with LZMA_PRESET_EXTREME)
|
||||
// are supported by all stable liblzma versions.
|
||||
//
|
||||
// (The encoder initialization later in this function may
|
||||
// still fail due to unsupported preset *if* the features
|
||||
// required by the preset have been disabled at build time,
|
||||
// but no-one does such things except on embedded systems.)
|
||||
fprintf(stderr, "Unsupported preset, possibly a bug\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Now we could customize the LZMA2 options if we wanted. For example,
|
||||
// we could set the the dictionary size (opt_lzma2.dict_size) to
|
||||
// something else than the default (8 MiB) of the default preset.
|
||||
// See lzma/lzma12.h for details of all LZMA2 options.
|
||||
//
|
||||
// The x86 BCJ filter will try to modify the x86 instruction stream so
|
||||
// that LZMA2 can compress it better. The x86 BCJ filter doesn't need
|
||||
// any options so it will be set to NULL below.
|
||||
//
|
||||
// Construct the filter chain. The uncompressed data goes first to
|
||||
// the first filter in the array, in this case the x86 BCJ filter.
|
||||
// The array is always terminated by setting .id = LZMA_VLI_UNKNOWN.
|
||||
//
|
||||
// See lzma/filter.h for more information about the lzma_filter
|
||||
// structure.
|
||||
lzma_filter filters[] = {
|
||||
{ .id = LZMA_FILTER_X86, .options = NULL },
|
||||
{ .id = LZMA_FILTER_LZMA2, .options = &opt_lzma2 },
|
||||
{ .id = LZMA_VLI_UNKNOWN, .options = NULL },
|
||||
};
|
||||
|
||||
// Initialize the encoder using the custom filter chain.
|
||||
lzma_ret ret = lzma_stream_encoder(strm, filters, LZMA_CHECK_CRC64);
|
||||
|
||||
if (ret == LZMA_OK)
|
||||
return true;
|
||||
|
||||
const char *msg;
|
||||
switch (ret) {
|
||||
case LZMA_MEM_ERROR:
|
||||
msg = "Memory allocation failed";
|
||||
break;
|
||||
|
||||
case LZMA_OPTIONS_ERROR:
|
||||
// We are no longer using a plain preset so this error
|
||||
// message has been edited accordingly compared to
|
||||
// 01_compress_easy.c.
|
||||
msg = "Specified filter chain is not supported";
|
||||
break;
|
||||
|
||||
case LZMA_UNSUPPORTED_CHECK:
|
||||
msg = "Specified integrity check is not supported";
|
||||
break;
|
||||
|
||||
default:
|
||||
msg = "Unknown error, possibly a bug";
|
||||
break;
|
||||
}
|
||||
|
||||
fprintf(stderr, "Error initializing the encoder: %s (error code %u)\n",
|
||||
msg, ret);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// This function is identical to the one in 01_compress_easy.c.
|
||||
static bool
|
||||
compress(lzma_stream *strm, FILE *infile, FILE *outfile)
|
||||
{
|
||||
lzma_action action = LZMA_RUN;
|
||||
|
||||
uint8_t inbuf[BUFSIZ];
|
||||
uint8_t outbuf[BUFSIZ];
|
||||
|
||||
strm->next_in = NULL;
|
||||
strm->avail_in = 0;
|
||||
strm->next_out = outbuf;
|
||||
strm->avail_out = sizeof(outbuf);
|
||||
|
||||
while (true) {
|
||||
if (strm->avail_in == 0 && !feof(infile)) {
|
||||
strm->next_in = inbuf;
|
||||
strm->avail_in = fread(inbuf, 1, sizeof(inbuf),
|
||||
infile);
|
||||
|
||||
if (ferror(infile)) {
|
||||
fprintf(stderr, "Read error: %s\n",
|
||||
strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (feof(infile))
|
||||
action = LZMA_FINISH;
|
||||
}
|
||||
|
||||
lzma_ret ret = lzma_code(strm, action);
|
||||
|
||||
if (strm->avail_out == 0 || ret == LZMA_STREAM_END) {
|
||||
size_t write_size = sizeof(outbuf) - strm->avail_out;
|
||||
|
||||
if (fwrite(outbuf, 1, write_size, outfile)
|
||||
!= write_size) {
|
||||
fprintf(stderr, "Write error: %s\n",
|
||||
strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
||||
strm->next_out = outbuf;
|
||||
strm->avail_out = sizeof(outbuf);
|
||||
}
|
||||
|
||||
if (ret != LZMA_OK) {
|
||||
if (ret == LZMA_STREAM_END)
|
||||
return true;
|
||||
|
||||
const char *msg;
|
||||
switch (ret) {
|
||||
case LZMA_MEM_ERROR:
|
||||
msg = "Memory allocation failed";
|
||||
break;
|
||||
|
||||
case LZMA_DATA_ERROR:
|
||||
msg = "File size limits exceeded";
|
||||
break;
|
||||
|
||||
default:
|
||||
msg = "Unknown error, possibly a bug";
|
||||
break;
|
||||
}
|
||||
|
||||
fprintf(stderr, "Encoder error: %s (error code %u)\n",
|
||||
msg, ret);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
extern int
|
||||
main(void)
|
||||
{
|
||||
lzma_stream strm = LZMA_STREAM_INIT;
|
||||
|
||||
bool success = init_encoder(&strm);
|
||||
if (success)
|
||||
success = compress(&strm, stdin, stdout);
|
||||
|
||||
lzma_end(&strm);
|
||||
|
||||
if (fclose(stdout)) {
|
||||
fprintf(stderr, "Write error: %s\n", strerror(errno));
|
||||
success = false;
|
||||
}
|
||||
|
||||
return success ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
}
|
||||
206
doc/examples/04_compress_easy_mt.c
Normal file
206
doc/examples/04_compress_easy_mt.c
Normal file
@@ -0,0 +1,206 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file 04_compress_easy_mt.c
|
||||
/// \brief Compress in multi-call mode using LZMA2 in multi-threaded mode
|
||||
///
|
||||
/// Usage: ./04_compress_easy_mt < INFILE > OUTFILE
|
||||
///
|
||||
/// Example: ./04_compress_easy_mt < foo > foo.xz
|
||||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <lzma.h>
|
||||
|
||||
|
||||
static bool
|
||||
init_encoder(lzma_stream *strm)
|
||||
{
|
||||
// The threaded encoder takes the options as pointer to
|
||||
// a lzma_mt structure.
|
||||
lzma_mt mt = {
|
||||
// No flags are needed.
|
||||
.flags = 0,
|
||||
|
||||
// Let liblzma determine a sane block size.
|
||||
.block_size = 0,
|
||||
|
||||
// Use no timeout for lzma_code() calls by setting timeout
|
||||
// to zero. That is, sometimes lzma_code() might block for
|
||||
// a long time (from several seconds to even minutes).
|
||||
// If this is not OK, for example due to progress indicator
|
||||
// needing updates, specify a timeout in milliseconds here.
|
||||
// See the documentation of lzma_mt in lzma/container.h for
|
||||
// information how to choose a reasonable timeout.
|
||||
.timeout = 0,
|
||||
|
||||
// Use the default preset (6) for LZMA2.
|
||||
// To use a preset, filters must be set to NULL.
|
||||
.preset = LZMA_PRESET_DEFAULT,
|
||||
.filters = NULL,
|
||||
|
||||
// Use CRC64 for integrity checking. See also
|
||||
// 01_compress_easy.c about choosing the integrity check.
|
||||
.check = LZMA_CHECK_CRC64,
|
||||
};
|
||||
|
||||
// Detect how many threads the CPU supports.
|
||||
mt.threads = lzma_cputhreads();
|
||||
|
||||
// If the number of CPU cores/threads cannot be detected,
|
||||
// use one thread. Note that this isn't the same as the normal
|
||||
// single-threaded mode as this will still split the data into
|
||||
// blocks and use more RAM than the normal single-threaded mode.
|
||||
// You may want to consider using lzma_easy_encoder() or
|
||||
// lzma_stream_encoder() instead of lzma_stream_encoder_mt() if
|
||||
// lzma_cputhreads() returns 0 or 1.
|
||||
if (mt.threads == 0)
|
||||
mt.threads = 1;
|
||||
|
||||
// If the number of CPU cores/threads exceeds threads_max,
|
||||
// limit the number of threads to keep memory usage lower.
|
||||
// The number 8 is arbitrarily chosen and may be too low or
|
||||
// high depending on the compression preset and the computer
|
||||
// being used.
|
||||
//
|
||||
// FIXME: A better way could be to check the amount of RAM
|
||||
// (or available RAM) and use lzma_stream_encoder_mt_memusage()
|
||||
// to determine if the number of threads should be reduced.
|
||||
const uint32_t threads_max = 8;
|
||||
if (mt.threads > threads_max)
|
||||
mt.threads = threads_max;
|
||||
|
||||
// Initialize the threaded encoder.
|
||||
lzma_ret ret = lzma_stream_encoder_mt(strm, &mt);
|
||||
|
||||
if (ret == LZMA_OK)
|
||||
return true;
|
||||
|
||||
const char *msg;
|
||||
switch (ret) {
|
||||
case LZMA_MEM_ERROR:
|
||||
msg = "Memory allocation failed";
|
||||
break;
|
||||
|
||||
case LZMA_OPTIONS_ERROR:
|
||||
// We are no longer using a plain preset so this error
|
||||
// message has been edited accordingly compared to
|
||||
// 01_compress_easy.c.
|
||||
msg = "Specified filter chain is not supported";
|
||||
break;
|
||||
|
||||
case LZMA_UNSUPPORTED_CHECK:
|
||||
msg = "Specified integrity check is not supported";
|
||||
break;
|
||||
|
||||
default:
|
||||
msg = "Unknown error, possibly a bug";
|
||||
break;
|
||||
}
|
||||
|
||||
fprintf(stderr, "Error initializing the encoder: %s (error code %u)\n",
|
||||
msg, ret);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// This function is identical to the one in 01_compress_easy.c.
|
||||
static bool
|
||||
compress(lzma_stream *strm, FILE *infile, FILE *outfile)
|
||||
{
|
||||
lzma_action action = LZMA_RUN;
|
||||
|
||||
uint8_t inbuf[BUFSIZ];
|
||||
uint8_t outbuf[BUFSIZ];
|
||||
|
||||
strm->next_in = NULL;
|
||||
strm->avail_in = 0;
|
||||
strm->next_out = outbuf;
|
||||
strm->avail_out = sizeof(outbuf);
|
||||
|
||||
while (true) {
|
||||
if (strm->avail_in == 0 && !feof(infile)) {
|
||||
strm->next_in = inbuf;
|
||||
strm->avail_in = fread(inbuf, 1, sizeof(inbuf),
|
||||
infile);
|
||||
|
||||
if (ferror(infile)) {
|
||||
fprintf(stderr, "Read error: %s\n",
|
||||
strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (feof(infile))
|
||||
action = LZMA_FINISH;
|
||||
}
|
||||
|
||||
lzma_ret ret = lzma_code(strm, action);
|
||||
|
||||
if (strm->avail_out == 0 || ret == LZMA_STREAM_END) {
|
||||
size_t write_size = sizeof(outbuf) - strm->avail_out;
|
||||
|
||||
if (fwrite(outbuf, 1, write_size, outfile)
|
||||
!= write_size) {
|
||||
fprintf(stderr, "Write error: %s\n",
|
||||
strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
||||
strm->next_out = outbuf;
|
||||
strm->avail_out = sizeof(outbuf);
|
||||
}
|
||||
|
||||
if (ret != LZMA_OK) {
|
||||
if (ret == LZMA_STREAM_END)
|
||||
return true;
|
||||
|
||||
const char *msg;
|
||||
switch (ret) {
|
||||
case LZMA_MEM_ERROR:
|
||||
msg = "Memory allocation failed";
|
||||
break;
|
||||
|
||||
case LZMA_DATA_ERROR:
|
||||
msg = "File size limits exceeded";
|
||||
break;
|
||||
|
||||
default:
|
||||
msg = "Unknown error, possibly a bug";
|
||||
break;
|
||||
}
|
||||
|
||||
fprintf(stderr, "Encoder error: %s (error code %u)\n",
|
||||
msg, ret);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
extern int
|
||||
main(void)
|
||||
{
|
||||
lzma_stream strm = LZMA_STREAM_INIT;
|
||||
|
||||
bool success = init_encoder(&strm);
|
||||
if (success)
|
||||
success = compress(&strm, stdin, stdout);
|
||||
|
||||
lzma_end(&strm);
|
||||
|
||||
if (fclose(stdout)) {
|
||||
fprintf(stderr, "Write error: %s\n", strerror(errno));
|
||||
success = false;
|
||||
}
|
||||
|
||||
return success ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
}
|
||||
24
doc/examples/Makefile
Normal file
24
doc/examples/Makefile
Normal file
@@ -0,0 +1,24 @@
|
||||
#
|
||||
# Author: Lasse Collin
|
||||
#
|
||||
# This file has been put into the public domain.
|
||||
# You can do whatever you want with this file.
|
||||
#
|
||||
|
||||
CC = c99
|
||||
CFLAGS = -g
|
||||
LDFLAGS = -llzma
|
||||
|
||||
PROGS = \
|
||||
01_compress_easy \
|
||||
02_decompress \
|
||||
03_compress_custom \
|
||||
04_compress_easy_mt
|
||||
|
||||
all: $(PROGS)
|
||||
|
||||
.c:
|
||||
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
|
||||
|
||||
clean:
|
||||
-rm -f $(PROGS)
|
||||
127
doc/examples_old/xz_pipe_comp.c
Normal file
127
doc/examples_old/xz_pipe_comp.c
Normal file
@@ -0,0 +1,127 @@
|
||||
/*
|
||||
* xz_pipe_comp.c
|
||||
* A simple example of pipe-only xz compressor implementation.
|
||||
* version: 2010-07-12 - by Daniel Mealha Cabrita
|
||||
* Not copyrighted -- provided to the public domain.
|
||||
*
|
||||
* Compiling:
|
||||
* Link with liblzma. GCC example:
|
||||
* $ gcc -llzma xz_pipe_comp.c -o xz_pipe_comp
|
||||
*
|
||||
* Usage example:
|
||||
* $ cat some_file | ./xz_pipe_comp > some_file.xz
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdbool.h>
|
||||
#include <lzma.h>
|
||||
|
||||
|
||||
/* COMPRESSION SETTINGS */
|
||||
|
||||
/* analogous to xz CLI options: -0 to -9 */
|
||||
#define COMPRESSION_LEVEL 6
|
||||
|
||||
/* boolean setting, analogous to xz CLI option: -e */
|
||||
#define COMPRESSION_EXTREME true
|
||||
|
||||
/* see: /usr/include/lzma/check.h LZMA_CHECK_* */
|
||||
#define INTEGRITY_CHECK LZMA_CHECK_CRC64
|
||||
|
||||
|
||||
/* read/write buffer sizes */
|
||||
#define IN_BUF_MAX 4096
|
||||
#define OUT_BUF_MAX 4096
|
||||
|
||||
/* error codes */
|
||||
#define RET_OK 0
|
||||
#define RET_ERROR_INIT 1
|
||||
#define RET_ERROR_INPUT 2
|
||||
#define RET_ERROR_OUTPUT 3
|
||||
#define RET_ERROR_COMPRESSION 4
|
||||
|
||||
|
||||
/* note: in_file and out_file must be open already */
|
||||
int xz_compress (FILE *in_file, FILE *out_file)
|
||||
{
|
||||
uint32_t preset = COMPRESSION_LEVEL | (COMPRESSION_EXTREME ? LZMA_PRESET_EXTREME : 0);
|
||||
lzma_check check = INTEGRITY_CHECK;
|
||||
lzma_stream strm = LZMA_STREAM_INIT; /* alloc and init lzma_stream struct */
|
||||
uint8_t in_buf [IN_BUF_MAX];
|
||||
uint8_t out_buf [OUT_BUF_MAX];
|
||||
size_t in_len; /* length of useful data in in_buf */
|
||||
size_t out_len; /* length of useful data in out_buf */
|
||||
bool in_finished = false;
|
||||
bool out_finished = false;
|
||||
lzma_action action;
|
||||
lzma_ret ret_xz;
|
||||
int ret;
|
||||
|
||||
ret = RET_OK;
|
||||
|
||||
/* initialize xz encoder */
|
||||
ret_xz = lzma_easy_encoder (&strm, preset, check);
|
||||
if (ret_xz != LZMA_OK) {
|
||||
fprintf (stderr, "lzma_easy_encoder error: %d\n", (int) ret_xz);
|
||||
return RET_ERROR_INIT;
|
||||
}
|
||||
|
||||
while ((! in_finished) && (! out_finished)) {
|
||||
/* read incoming data */
|
||||
in_len = fread (in_buf, 1, IN_BUF_MAX, in_file);
|
||||
|
||||
if (feof (in_file)) {
|
||||
in_finished = true;
|
||||
}
|
||||
if (ferror (in_file)) {
|
||||
in_finished = true;
|
||||
ret = RET_ERROR_INPUT;
|
||||
}
|
||||
|
||||
strm.next_in = in_buf;
|
||||
strm.avail_in = in_len;
|
||||
|
||||
/* if no more data from in_buf, flushes the
|
||||
internal xz buffers and closes the xz data
|
||||
with LZMA_FINISH */
|
||||
action = in_finished ? LZMA_FINISH : LZMA_RUN;
|
||||
|
||||
/* loop until there's no pending compressed output */
|
||||
do {
|
||||
/* out_buf is clean at this point */
|
||||
strm.next_out = out_buf;
|
||||
strm.avail_out = OUT_BUF_MAX;
|
||||
|
||||
/* compress data */
|
||||
ret_xz = lzma_code (&strm, action);
|
||||
|
||||
if ((ret_xz != LZMA_OK) && (ret_xz != LZMA_STREAM_END)) {
|
||||
fprintf (stderr, "lzma_code error: %d\n", (int) ret_xz);
|
||||
out_finished = true;
|
||||
ret = RET_ERROR_COMPRESSION;
|
||||
} else {
|
||||
/* write compressed data */
|
||||
out_len = OUT_BUF_MAX - strm.avail_out;
|
||||
fwrite (out_buf, 1, out_len, out_file);
|
||||
if (ferror (out_file)) {
|
||||
out_finished = true;
|
||||
ret = RET_ERROR_OUTPUT;
|
||||
}
|
||||
}
|
||||
} while (strm.avail_out == 0);
|
||||
}
|
||||
|
||||
lzma_end (&strm);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int main ()
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = xz_compress (stdin, stdout);
|
||||
return ret;
|
||||
}
|
||||
|
||||
123
doc/examples_old/xz_pipe_decomp.c
Normal file
123
doc/examples_old/xz_pipe_decomp.c
Normal file
@@ -0,0 +1,123 @@
|
||||
/*
|
||||
* xz_pipe_decomp.c
|
||||
* A simple example of pipe-only xz decompressor implementation.
|
||||
* version: 2012-06-14 - by Daniel Mealha Cabrita
|
||||
* Not copyrighted -- provided to the public domain.
|
||||
*
|
||||
* Compiling:
|
||||
* Link with liblzma. GCC example:
|
||||
* $ gcc -llzma xz_pipe_decomp.c -o xz_pipe_decomp
|
||||
*
|
||||
* Usage example:
|
||||
* $ cat some_file.xz | ./xz_pipe_decomp > some_file
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdbool.h>
|
||||
#include <lzma.h>
|
||||
|
||||
|
||||
/* read/write buffer sizes */
|
||||
#define IN_BUF_MAX 4096
|
||||
#define OUT_BUF_MAX 4096
|
||||
|
||||
/* error codes */
|
||||
#define RET_OK 0
|
||||
#define RET_ERROR_INIT 1
|
||||
#define RET_ERROR_INPUT 2
|
||||
#define RET_ERROR_OUTPUT 3
|
||||
#define RET_ERROR_DECOMPRESSION 4
|
||||
|
||||
|
||||
/* note: in_file and out_file must be open already */
|
||||
int xz_decompress (FILE *in_file, FILE *out_file)
|
||||
{
|
||||
lzma_stream strm = LZMA_STREAM_INIT; /* alloc and init lzma_stream struct */
|
||||
const uint32_t flags = LZMA_TELL_UNSUPPORTED_CHECK | LZMA_CONCATENATED;
|
||||
const uint64_t memory_limit = UINT64_MAX; /* no memory limit */
|
||||
uint8_t in_buf [IN_BUF_MAX];
|
||||
uint8_t out_buf [OUT_BUF_MAX];
|
||||
size_t in_len; /* length of useful data in in_buf */
|
||||
size_t out_len; /* length of useful data in out_buf */
|
||||
bool in_finished = false;
|
||||
bool out_finished = false;
|
||||
lzma_action action;
|
||||
lzma_ret ret_xz;
|
||||
int ret;
|
||||
|
||||
ret = RET_OK;
|
||||
|
||||
/* initialize xz decoder */
|
||||
ret_xz = lzma_stream_decoder (&strm, memory_limit, flags);
|
||||
if (ret_xz != LZMA_OK) {
|
||||
fprintf (stderr, "lzma_stream_decoder error: %d\n", (int) ret_xz);
|
||||
return RET_ERROR_INIT;
|
||||
}
|
||||
|
||||
while ((! in_finished) && (! out_finished)) {
|
||||
/* read incoming data */
|
||||
in_len = fread (in_buf, 1, IN_BUF_MAX, in_file);
|
||||
|
||||
if (feof (in_file)) {
|
||||
in_finished = true;
|
||||
}
|
||||
if (ferror (in_file)) {
|
||||
in_finished = true;
|
||||
ret = RET_ERROR_INPUT;
|
||||
}
|
||||
|
||||
strm.next_in = in_buf;
|
||||
strm.avail_in = in_len;
|
||||
|
||||
/* if no more data from in_buf, flushes the
|
||||
internal xz buffers and closes the decompressed data
|
||||
with LZMA_FINISH */
|
||||
action = in_finished ? LZMA_FINISH : LZMA_RUN;
|
||||
|
||||
/* loop until there's no pending decompressed output */
|
||||
do {
|
||||
/* out_buf is clean at this point */
|
||||
strm.next_out = out_buf;
|
||||
strm.avail_out = OUT_BUF_MAX;
|
||||
|
||||
/* decompress data */
|
||||
ret_xz = lzma_code (&strm, action);
|
||||
|
||||
if ((ret_xz != LZMA_OK) && (ret_xz != LZMA_STREAM_END)) {
|
||||
fprintf (stderr, "lzma_code error: %d\n", (int) ret_xz);
|
||||
out_finished = true;
|
||||
ret = RET_ERROR_DECOMPRESSION;
|
||||
} else {
|
||||
/* write decompressed data */
|
||||
out_len = OUT_BUF_MAX - strm.avail_out;
|
||||
fwrite (out_buf, 1, out_len, out_file);
|
||||
if (ferror (out_file)) {
|
||||
out_finished = true;
|
||||
ret = RET_ERROR_OUTPUT;
|
||||
}
|
||||
}
|
||||
} while (strm.avail_out == 0);
|
||||
}
|
||||
|
||||
/* Bug fix (2012-06-14): If no errors were detected, check
|
||||
that the last lzma_code() call returned LZMA_STREAM_END.
|
||||
If not, the file is probably truncated. */
|
||||
if ((ret == RET_OK) && (ret_xz != LZMA_STREAM_END)) {
|
||||
fprintf (stderr, "Input truncated or corrupt\n");
|
||||
ret = RET_ERROR_DECOMPRESSION;
|
||||
}
|
||||
|
||||
lzma_end (&strm);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int main ()
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = xz_decompress (stdin, stdout);
|
||||
return ret;
|
||||
}
|
||||
|
||||
124
doc/faq.txt
124
doc/faq.txt
@@ -6,7 +6,7 @@ Q: What do the letters XZ mean?
|
||||
|
||||
A: Nothing. They are just two letters, which come from the file format
|
||||
suffix .xz. The .xz suffix was selected, because it seemed to be
|
||||
pretty much unused. It is no deeper meaning.
|
||||
pretty much unused. It has no deeper meaning.
|
||||
|
||||
|
||||
Q: What are LZMA and LZMA2?
|
||||
@@ -26,14 +26,25 @@ Q: There are many LZMA related projects. How does XZ Utils relate to them?
|
||||
A: 7-Zip and LZMA SDK are the original projects. LZMA SDK is roughly
|
||||
a subset of the 7-Zip source tree.
|
||||
|
||||
p7zip is 7-Zip's command line tools ported to POSIX-like systems.
|
||||
p7zip is 7-Zip's command-line tools ported to POSIX-like systems.
|
||||
|
||||
LZMA Utils provide a gzip-like lzma tool for POSIX-like systems.
|
||||
LZMA Utils are based on LZMA SDK. XZ Utils are the successor to
|
||||
LZMA Utils.
|
||||
|
||||
There are several other projects using LZMA. Most are more or less
|
||||
based on LZMA SDK.
|
||||
based on LZMA SDK. See <http://7-zip.org/links.html>.
|
||||
|
||||
|
||||
Q: Why is liblzma named liblzma if its primary file format is .xz?
|
||||
Shouldn't it be e.g. libxz?
|
||||
|
||||
A: When the designing of the .xz format began, the idea was to replace
|
||||
the .lzma format and use the same .lzma suffix. It would have been
|
||||
quite OK to reuse the suffix when there were very few .lzma files
|
||||
around. However, the old .lzma format became popular before the
|
||||
new format was finished. The new format was renamed to .xz but the
|
||||
name of liblzma wasn't changed.
|
||||
|
||||
|
||||
Q: Do XZ Utils support the .7z format?
|
||||
@@ -62,12 +73,18 @@ A: For now, no. Since XZ Utils supports the .lzma format, it's usually
|
||||
|
||||
Technically, there is a way to make the conversion relatively fast
|
||||
(roughly twice the time that normal decompression takes). Writing
|
||||
such a tool would take quite a bit time though, and would probably
|
||||
such a tool would take quite a bit of time though, and would probably
|
||||
be useful to only a few people. If you really want such a conversion
|
||||
tool, contact Lasse Collin and offer some money.
|
||||
|
||||
|
||||
Q: Can I recover parts of a broken .xz file (e.g. corrupted CD-R)?
|
||||
Q: I have installed xz, but my tar doesn't recognize .tar.xz files.
|
||||
How can I extract .tar.xz files?
|
||||
|
||||
A: xz -dc foo.tar.xz | tar xf -
|
||||
|
||||
|
||||
Q: Can I recover parts of a broken .xz file (e.g. a corrupted CD-R)?
|
||||
|
||||
A: It may be possible if the file consists of multiple blocks, which
|
||||
typically is not the case if the file was created in single-threaded
|
||||
@@ -77,7 +94,7 @@ A: It may be possible if the file consists of multiple blocks, which
|
||||
Q: Is (some part of) XZ Utils patented?
|
||||
|
||||
A: Lasse Collin is not aware of any patents that could affect XZ Utils.
|
||||
However, due to nature of software patents, it's not possible to
|
||||
However, due to the nature of software patents, it's not possible to
|
||||
guarantee that XZ Utils isn't affected by any third party patent(s).
|
||||
|
||||
|
||||
@@ -88,9 +105,9 @@ A: The .xz format is documented in xz-file-format.txt. It is a container
|
||||
filters.
|
||||
|
||||
Documenting LZMA and LZMA2 is planned, but for now, there is no other
|
||||
documentation that the source code. Before you begin, you should know
|
||||
the basics of LZ77 and range coding algorithms. LZMA is based on LZ77,
|
||||
but LZMA is *a lot* more complex. Range coding is used to compress
|
||||
documentation than the source code. Before you begin, you should know
|
||||
the basics of LZ77 and range-coding algorithms. LZMA is based on LZ77,
|
||||
but LZMA is a lot more complex. Range coding is used to compress
|
||||
the final bitstream like Huffman coding is used in Deflate.
|
||||
|
||||
|
||||
@@ -98,6 +115,90 @@ Q: I cannot find BCJ and BCJ2 filters. Don't they exist in liblzma?
|
||||
|
||||
A: BCJ filter is called "x86" in liblzma. BCJ2 is not included,
|
||||
because it requires using more than one encoded output stream.
|
||||
A streamable version of BCJ2-style filtering is planned.
|
||||
|
||||
|
||||
Q: I need to use a script that runs "xz -9". On a system with 256 MiB
|
||||
of RAM, xz says that it cannot allocate memory. Can I make the
|
||||
script work without modifying it?
|
||||
|
||||
A: Set a default memory usage limit for compression. You can do it e.g.
|
||||
in a shell initialization script such as ~/.bashrc or /etc/profile:
|
||||
|
||||
XZ_DEFAULTS=--memlimit-compress=150MiB
|
||||
export XZ_DEFAULTS
|
||||
|
||||
xz will then scale the compression settings down so that the given
|
||||
memory usage limit is not reached. This way xz shouldn't run out
|
||||
of memory.
|
||||
|
||||
Check also that memory-related resource limits are high enough.
|
||||
On most systems, "ulimit -a" will show the current resource limits.
|
||||
|
||||
|
||||
Q: How do I create files that can be decompressed with XZ Embedded?
|
||||
|
||||
A: See the documentation in XZ Embedded. In short, something like
|
||||
this is a good start:
|
||||
|
||||
xz --check=crc32 --lzma2=preset=6e,dict=64KiB
|
||||
|
||||
Or if a BCJ filter is needed too, e.g. if compressing
|
||||
a kernel image for PowerPC:
|
||||
|
||||
xz --check=crc32 --powerpc --lzma2=preset=6e,dict=64KiB
|
||||
|
||||
Adjust the dictionary size to get a good compromise between
|
||||
compression ratio and decompressor memory usage. Note that
|
||||
in single-call decompression mode of XZ Embedded, a big
|
||||
dictionary doesn't increase memory usage.
|
||||
|
||||
|
||||
Q: Will xz support threaded compression?
|
||||
|
||||
A: It is planned and has been taken into account when designing
|
||||
the .xz file format. Eventually there will probably be three types
|
||||
of threading, each method having its own advantages and disadvantages.
|
||||
|
||||
The simplest method is splitting the uncompressed data into blocks
|
||||
and compressing them in parallel independent from each other.
|
||||
Since the blocks are compressed independently, they can also be
|
||||
decompressed independently. Together with the index feature in .xz,
|
||||
this allows using threads to create .xz files for random-access
|
||||
reading. This also makes threaded decompression possible, although
|
||||
it is not clear if threaded decompression will ever be implemented.
|
||||
|
||||
The independent blocks method has a couple of disadvantages too. It
|
||||
will compress worse than a single-block method. Often the difference
|
||||
is not too big (maybe 1-2 %) but sometimes it can be too big. Also,
|
||||
the memory usage of the compressor increases linearly when adding
|
||||
threads.
|
||||
|
||||
Match finder parallelization is another threading method. It has
|
||||
been in 7-Zip for ages. It doesn't affect compression ratio or
|
||||
memory usage significantly. Among the three threading methods, only
|
||||
this is useful when compressing small files (files that are not
|
||||
significantly bigger than the dictionary). Unfortunately this method
|
||||
scales only to about two CPU cores.
|
||||
|
||||
The third method is pigz-style threading (I use that name, because
|
||||
pigz <http://www.zlib.net/pigz/> uses that method). It doesn't
|
||||
affect compression ratio significantly and scales to many cores.
|
||||
The memory usage scales linearly when threads are added. This isn't
|
||||
significant with pigz, because Deflate uses only a 32 KiB dictionary,
|
||||
but with LZMA2 the memory usage will increase dramatically just like
|
||||
with the independent-blocks method. There is also a constant
|
||||
computational overhead, which may make pigz-method a bit dull on
|
||||
dual-core compared to the parallel match finder method, but with more
|
||||
cores the overhead is not a big deal anymore.
|
||||
|
||||
Combining the threading methods will be possible and also useful.
|
||||
E.g. combining match finder parallelization with pigz-style threading
|
||||
can cut the memory usage by 50 %.
|
||||
|
||||
It is possible that the single-threaded method will be modified to
|
||||
create files identical to the pigz-style method. We'll see once
|
||||
pigz-style threading has been implemented in liblzma.
|
||||
|
||||
|
||||
Q: How do I build a program that needs liblzmadec (lzmadec.h)?
|
||||
@@ -117,6 +218,7 @@ A: Give --enable-small to the configure script. Use also appropriate
|
||||
for size. See INSTALL for information about configure options.
|
||||
|
||||
If the result is still too big, take a look at XZ Embedded. It is
|
||||
a separate project, which provides a limited but signinificantly
|
||||
smaller XZ decoder implementation than XZ Utils.
|
||||
a separate project, which provides a limited but significantly
|
||||
smaller XZ decoder implementation than XZ Utils. You can find it
|
||||
at <http://tukaani.org/xz/embedded.html>.
|
||||
|
||||
|
||||
@@ -4,12 +4,12 @@ History of LZMA Utils and XZ Utils
|
||||
|
||||
Tukaani distribution
|
||||
|
||||
In 2005, there was a small group working on Tukaani distribution, which
|
||||
was a Slackware fork. One of the project goals was to fit the distro on
|
||||
a single 700 MiB ISO-9660 image. Using LZMA instead of gzip helped a
|
||||
lot. Roughly speaking, one could fit data that took 1000 MiB in gzipped
|
||||
form into 700 MiB with LZMA. Naturally compression ratio varied across
|
||||
packages, but this was what we got on average.
|
||||
In 2005, there was a small group working on the Tukaani distribution,
|
||||
which was a Slackware fork. One of the project's goals was to fit the
|
||||
distro on a single 700 MiB ISO-9660 image. Using LZMA instead of gzip
|
||||
helped a lot. Roughly speaking, one could fit data that took 1000 MiB
|
||||
in gzipped form into 700 MiB with LZMA. Naturally, the compression
|
||||
ratio varied across packages, but this was what we got on average.
|
||||
|
||||
Slackware packages have traditionally had .tgz as the filename suffix,
|
||||
which is an abbreviation of .tar.gz. A logical naming for LZMA
|
||||
@@ -30,13 +30,13 @@ Tukaani distribution
|
||||
First steps of LZMA Utils
|
||||
|
||||
The first version of LZMA Utils (4.22.0) included a shell script called
|
||||
lzmash. It was wrapper that had gzip-like command line interface. It
|
||||
lzmash. It was a wrapper that had a gzip-like command-line interface. It
|
||||
used the LZMA_Alone tool from LZMA SDK to do all the real work. zgrep,
|
||||
zdiff, and related scripts from gzip were adapted work with LZMA and
|
||||
zdiff, and related scripts from gzip were adapted to work with LZMA and
|
||||
were part of the first LZMA Utils release too.
|
||||
|
||||
LZMA Utils 4.22.0 included also lzmadec, which was a small (less than
|
||||
10 KiB) decoder-only command line tool. It was written on top of the
|
||||
10 KiB) decoder-only command-line tool. It was written on top of the
|
||||
decoder-only C code found from the LZMA SDK. lzmadec was convenient in
|
||||
situations where LZMA_Alone (a few hundred KiB) would be too big.
|
||||
|
||||
@@ -48,33 +48,34 @@ Second generation
|
||||
The lzmash script was an ugly and not very secure hack. The last
|
||||
version of LZMA Utils to use lzmash was 4.27.1.
|
||||
|
||||
LZMA Utils 4.32.0beta1 introduced a new lzma command line tool written
|
||||
LZMA Utils 4.32.0beta1 introduced a new lzma command-line tool written
|
||||
by Ville Koskinen. It was written in C++, and used the encoder and
|
||||
decoder from C++ LZMA SDK with little modifications. This tool replaced
|
||||
both the lzmash script and the LZMA_Alone command line tool in LZMA
|
||||
Utils.
|
||||
decoder from C++ LZMA SDK with some little modifications. This tool
|
||||
replaced both the lzmash script and the LZMA_Alone command-line tool
|
||||
in LZMA Utils.
|
||||
|
||||
Introducing this new tool caused some temporary incompatibilities,
|
||||
because LZMA_Alone executable was simply named lzma like the new
|
||||
command line tool, but they had completely different command line
|
||||
because the LZMA_Alone executable was simply named lzma like the new
|
||||
command-line tool, but they had a completely different command-line
|
||||
interface. The file format was still the same.
|
||||
|
||||
Lasse wrote liblzmadec, which was a small decoder-only library based
|
||||
on the C code found from LZMA SDK. liblzmadec had API similar to zlib,
|
||||
although there were some significant differences, which made it
|
||||
on the C code found from LZMA SDK. liblzmadec had an API similar to
|
||||
zlib, although there were some significant differences, which made it
|
||||
non-trivial to use it in some applications designed for zlib and
|
||||
libbzip2.
|
||||
|
||||
The lzmadec command line tool was converted to use liblzmadec.
|
||||
The lzmadec command-line tool was converted to use liblzmadec.
|
||||
|
||||
Alexandre Sauvé helped converting build system to use GNU Autotools.
|
||||
This made is easier to test for certain less portable features needed
|
||||
by the new command line tool.
|
||||
Alexandre Sauvé helped converting the build system to use GNU
|
||||
Autotools. This made it easier to test for certain less portable
|
||||
features needed by the new command-line tool.
|
||||
|
||||
Since the new command line tool never got completely finished (for
|
||||
example, it didn't support LZMA_OPT environment variable), the intent
|
||||
was to not call 4.32.x stable. Similarly, liblzmadec wasn't polished,
|
||||
but appeared to work well enough, so some people started using it too.
|
||||
Since the new command-line tool never got completely finished (for
|
||||
example, it didn't support the LZMA_OPT environment variable), the
|
||||
intent was to not call 4.32.x stable. Similarly, liblzmadec wasn't
|
||||
polished, but appeared to work well enough, so some people started
|
||||
using it too.
|
||||
|
||||
Because the development of the third generation of LZMA Utils was
|
||||
delayed considerably (3-4 years), the 4.32.x branch had to be kept
|
||||
@@ -85,16 +86,16 @@ Second generation
|
||||
|
||||
File format problems
|
||||
|
||||
The file format used by LZMA_Alone was primitive. It was designed for
|
||||
embedded systems in mind, and thus provided only minimal set of
|
||||
features. The two biggest problems for non-embedded use were lack of
|
||||
magic bytes and integrity check.
|
||||
The file format used by LZMA_Alone was primitive. It was designed with
|
||||
embedded systems in mind, and thus provided only a minimal set of
|
||||
features. The two biggest problems for non-embedded use were the lack
|
||||
of magic bytes and an integrity check.
|
||||
|
||||
Igor and Lasse started developing a new file format with some help
|
||||
from Ville Koskinen. Also Mark Adler, Mikko Pouru, H. Peter Anvin,
|
||||
and Lars Wirzenius helped with some minor things at some point of the
|
||||
development. Designing the new format took quite a long time (actually,
|
||||
too long time would be more appropriate expression). It was mostly
|
||||
too long a time would be a more appropriate expression). It was mostly
|
||||
because Lasse was quite slow at getting things done due to personal
|
||||
reasons.
|
||||
|
||||
@@ -102,7 +103,7 @@ File format problems
|
||||
that was already used by the old file format. Switching to the new
|
||||
format wouldn't have caused much trouble when the old format wasn't
|
||||
used by many people. But since the development of the new format took
|
||||
so long time, the old format got quite popular, and it was decided
|
||||
such a long time, the old format got quite popular, and it was decided
|
||||
that the new file format must use a different suffix.
|
||||
|
||||
It was decided to use .xz as the suffix of the new file format. The
|
||||
@@ -125,13 +126,13 @@ Transition to XZ Utils
|
||||
The early versions of XZ Utils were called LZMA Utils. The first
|
||||
releases were 4.42.0alphas. They dropped the rest of the C++ LZMA SDK.
|
||||
The code was still directly based on LZMA SDK but ported to C and
|
||||
converted from callback API to stateful API. Later, Igor Pavlov made
|
||||
C version of the LZMA encoder too; these ports from C++ to C were
|
||||
independent in LZMA SDK and LZMA Utils.
|
||||
converted from a callback API to a stateful API. Later, Igor Pavlov
|
||||
made a C version of the LZMA encoder too; these ports from C++ to C
|
||||
were independent in LZMA SDK and LZMA Utils.
|
||||
|
||||
The core of the new LZMA Utils was liblzma, a compression library with
|
||||
zlib-like API. liblzma supported both the old and new file format. The
|
||||
gzip-like lzma command line tool was rewritten to use liblzma.
|
||||
a zlib-like API. liblzma supported both the old and new file format.
|
||||
The gzip-like lzma command-line tool was rewritten to use liblzma.
|
||||
|
||||
The new LZMA Utils code base was renamed to XZ Utils when the name
|
||||
of the new file format had been decided. The liblzma compression
|
||||
@@ -139,7 +140,7 @@ Transition to XZ Utils
|
||||
caused unnecessary breakage in applications already using the early
|
||||
liblzma snapshots.
|
||||
|
||||
The xz command line tool can emulate the gzip-like lzma tool by
|
||||
The xz command-line tool can emulate the gzip-like lzma tool by
|
||||
creating appropriate symlinks (e.g. lzma -> xz). Thus, practically
|
||||
all scripts using the lzma tool from LZMA Utils will work as is with
|
||||
XZ Utils (and will keep using the old .lzma format). Still, the .lzma
|
||||
|
||||
@@ -40,7 +40,7 @@ The .lzma File Format
|
||||
|
||||
0.2. Changes
|
||||
|
||||
Last modified: 2009-05-01 11:15+0300
|
||||
Last modified: 2011-04-12 11:55+0300
|
||||
|
||||
|
||||
1. File Format
|
||||
@@ -161,6 +161,6 @@ The .lzma File Format
|
||||
XZ Utils - The next generation of LZMA Utils
|
||||
http://tukaani.org/xz/
|
||||
|
||||
The .xz file format - The successor of the the .lzma format
|
||||
The .xz file format - The successor of the .lzma format
|
||||
http://tukaani.org/xz/xz-file-format.txt
|
||||
|
||||
|
||||
79
dos/INSTALL.txt
Normal file
79
dos/INSTALL.txt
Normal file
@@ -0,0 +1,79 @@
|
||||
|
||||
Building XZ Utils for DOS
|
||||
=========================
|
||||
|
||||
Introduction
|
||||
|
||||
This document explains how to build XZ Utils for DOS using DJGPP.
|
||||
The resulting binaries should run at least on various DOS versions
|
||||
and under Windows 95/98/98SE/ME, although the Windows version of
|
||||
XZ Utils is recommended under Windows 95 and later.
|
||||
|
||||
This is currently experimental and has got very little testing.
|
||||
|
||||
Note: Makefile and config.h are updated only now and then. This
|
||||
means that especially if you checked out a development version,
|
||||
building for DOS probably won't work without updating Makefile
|
||||
and config.h first.
|
||||
|
||||
|
||||
Getting and Installing DJGPP
|
||||
|
||||
You may use <http://www.delorie.com/djgpp/zip-picker.html> to help
|
||||
deciding what to download, but as of writing (2010-10-09) that may
|
||||
not be the most convenient way taking into account what components
|
||||
are actually required to build XZ Utils. However, using the
|
||||
zip-picker can still be worth doing to get nice short summary of
|
||||
installation instructions (they can be found from readme.1st too).
|
||||
|
||||
For a more manual method, first select a mirror from
|
||||
<http://www.delorie.com/djgpp/getting.html>. You need
|
||||
the following files:
|
||||
|
||||
unzip32.exe (if you don't already have a LFN-capable unzipper)
|
||||
beta/v2/djdev204.zip
|
||||
v2gnu/bnu219b.zip
|
||||
v2gnu/gcc444b.zip
|
||||
v2gnu/mak3791b.zip
|
||||
v2misc/csdpmi7b.zip
|
||||
|
||||
If newer versions are available, probably you should try them first.
|
||||
Note that djdev203.zip is too old to build XZ Utils; you need at
|
||||
least djdev204.zip. Also note that you want csdpmi7b.zip even if you
|
||||
run under Windows or DOSEMU, because the XZ Utils Makefile will embed
|
||||
cwsdstub.exe to the resulting binaries.
|
||||
|
||||
See the instructions in readme.1st found from djdev204.zip. Here's
|
||||
a short summary, but you should still read readme.1st.
|
||||
|
||||
C:\> mkdir DJGPP
|
||||
C:\> cd DJGPP
|
||||
C:\DJGPP> c:\download\unzip32 c:\download\djdev204.zip
|
||||
C:\DJGPP> c:\download\unzip32 c:\download\bnu219b.zip
|
||||
C:\DJGPP> c:\download\unzip32 c:\download\gcc444b.zip
|
||||
C:\DJGPP> c:\download\unzip32 c:\download\mak3791b.zip
|
||||
C:\DJGPP> c:\download\unzip32 c:\download\csdpmi7b.zip
|
||||
|
||||
C:\DJGPP> set PATH=C:\DJGPP\BIN;%PATH%
|
||||
C:\DJGPP> set DJGPP=C:\DJGPP\DJGPP.ENV
|
||||
|
||||
You may want to add the last two lines into AUTOEXEC.BAT or have,
|
||||
for example, DJGPP.BAT which you can run before using DJGPP.
|
||||
|
||||
Make sure you use completely upper case path in the DJGPP environment
|
||||
variable. This is not required by DJGPP, but the XZ Utils Makefile is
|
||||
a bit stupid and expects that everything in DJGPP environment variable
|
||||
is uppercase.
|
||||
|
||||
|
||||
Building
|
||||
|
||||
You need to have an environment that supports long filenames (LFN).
|
||||
Once you have built XZ Utils, the resulting binaries can be run
|
||||
without long filename support.
|
||||
|
||||
Run "make" in this directory (the directory containing this README).
|
||||
You should get xz.exe (and a bunch of temporary files). Other tools
|
||||
are not built. Having e.g. xzdec.exe doesn't save much space compared
|
||||
to xz.exe, because the DJGPP runtime makes the .exe quite big anyway.
|
||||
|
||||
212
dos/Makefile
212
dos/Makefile
@@ -2,16 +2,6 @@
|
||||
#
|
||||
# Makefile to build XZ Utils using DJGPP
|
||||
#
|
||||
# Make flags to alter compilation:
|
||||
#
|
||||
# DEBUG=1 Enable assertions. Don't use this for production builds!
|
||||
# You may also want to set CFLAGS="-g -O0" to disable
|
||||
# optimizations.
|
||||
#
|
||||
# The usual CPPFLAGS and CFLAGS are supported too.
|
||||
#
|
||||
###############################################################################
|
||||
#
|
||||
# Author: Lasse Collin
|
||||
#
|
||||
# This file has been put into the public domain.
|
||||
@@ -19,15 +9,16 @@
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
# For debugging, set comment "#define NDEBUG 1" from config.h to enable
|
||||
# the assert() macro, set STRIP=rem to disable stripping, and finally
|
||||
# e.g. CFLAGS="-g -O0".
|
||||
CC = gcc
|
||||
AR = ar
|
||||
STRIP = strip
|
||||
SED = sed
|
||||
RM = rm -f
|
||||
CPPFLAGS =
|
||||
CFLAGS = -g -Wall -Wextra -Wfatal-errors -march=i386 -mtune=i686 -O2
|
||||
LDFLAGS = -lemu
|
||||
|
||||
CFLAGS = -g -Wextra -Wfatal-errors -Wall -march=i386 -mtune=i686 -O2
|
||||
|
||||
# NOTE: -fgnu89-inline is needed on DJGPP 2.04 beta and GCC 4.3.2
|
||||
# NOTE: -fgnu89-inline is needed on DJGPP 2.04 beta and GCC >= 4.3.0
|
||||
# because time.h uses GNU-style "extern inline".
|
||||
ALL_CFLAGS = -std=gnu99 -fgnu89-inline
|
||||
|
||||
@@ -43,61 +34,46 @@ ALL_CPPFLAGS = \
|
||||
-I../src/liblzma/lzma \
|
||||
-I../src/liblzma/delta \
|
||||
-I../src/liblzma/simple \
|
||||
-I../src/liblzma/subblock
|
||||
|
||||
ALL_CPPFLAGS += -DHAVE_CONFIG_H
|
||||
|
||||
ifdef DEBUG
|
||||
STRIP := rem Skipping strip
|
||||
else
|
||||
ALL_CPPFLAGS += -DNDEBUG
|
||||
endif
|
||||
-DHAVE_CONFIG_H
|
||||
|
||||
ALL_CPPFLAGS += $(CPPFLAGS)
|
||||
ALL_CFLAGS += $(CFLAGS)
|
||||
|
||||
.PHONY: all
|
||||
all: xz.exe
|
||||
|
||||
################
|
||||
# Common rules #
|
||||
################
|
||||
|
||||
.PHONY: all clean
|
||||
all: liblzma.a getopt.a xzdec.exe lzmadec.exe xz.exe
|
||||
clean: liblzma-clean getopt-clean xzdec-clean xz-clean
|
||||
|
||||
|
||||
#############
|
||||
# liblzma.a #
|
||||
#############
|
||||
|
||||
LIBLZMA_SRCS_C = \
|
||||
SRCS_C = \
|
||||
../lib/getopt.c \
|
||||
../lib/getopt1.c \
|
||||
../src/common/tuklib_cpucores.c \
|
||||
../src/common/tuklib_exit.c \
|
||||
../src/common/tuklib_mbstr_fw.c \
|
||||
../src/common/tuklib_mbstr_width.c \
|
||||
../src/common/tuklib_open_stdxxx.c \
|
||||
../src/common/tuklib_physmem.c \
|
||||
../src/common/tuklib_progname.c \
|
||||
../src/liblzma/check/check.c \
|
||||
../src/liblzma/check/crc32_table.c \
|
||||
../src/liblzma/check/crc64_table.c \
|
||||
../src/liblzma/check/sha256.c \
|
||||
../src/liblzma/common/alone_decoder.c \
|
||||
../src/liblzma/common/alone_encoder.c \
|
||||
../src/liblzma/common/auto_decoder.c \
|
||||
../src/liblzma/common/block_buffer_decoder.c \
|
||||
../src/liblzma/common/block_buffer_encoder.c \
|
||||
../src/liblzma/common/block_decoder.c \
|
||||
../src/liblzma/common/block_encoder.c \
|
||||
../src/liblzma/common/block_header_decoder.c \
|
||||
../src/liblzma/common/block_header_encoder.c \
|
||||
../src/liblzma/common/block_util.c \
|
||||
../src/liblzma/common/common.c \
|
||||
../src/liblzma/common/easy_buffer_encoder.c \
|
||||
../src/liblzma/common/easy_decoder_memusage.c \
|
||||
../src/liblzma/common/easy_encoder.c \
|
||||
../src/liblzma/common/easy_encoder_memusage.c \
|
||||
../src/liblzma/common/easy_preset.c \
|
||||
../src/liblzma/common/filter_common.c \
|
||||
../src/liblzma/common/filter_decoder.c \
|
||||
../src/liblzma/common/filter_encoder.c \
|
||||
../src/liblzma/common/filter_flags_decoder.c \
|
||||
../src/liblzma/common/filter_flags_encoder.c \
|
||||
../src/liblzma/common/hardware_physmem.c \
|
||||
../src/liblzma/common/index.c \
|
||||
../src/liblzma/common/index_decoder.c \
|
||||
../src/liblzma/common/index_encoder.c \
|
||||
../src/liblzma/common/index_hash.c \
|
||||
../src/liblzma/common/stream_buffer_decoder.c \
|
||||
../src/liblzma/common/stream_buffer_encoder.c \
|
||||
../src/liblzma/common/stream_decoder.c \
|
||||
../src/liblzma/common/stream_encoder.c \
|
||||
../src/liblzma/common/stream_flags_common.c \
|
||||
@@ -106,11 +82,9 @@ LIBLZMA_SRCS_C = \
|
||||
../src/liblzma/common/vli_decoder.c \
|
||||
../src/liblzma/common/vli_encoder.c \
|
||||
../src/liblzma/common/vli_size.c \
|
||||
../src/liblzma/check/check.c \
|
||||
../src/liblzma/check/crc32_table.c \
|
||||
../src/liblzma/check/crc64_table.c \
|
||||
../src/liblzma/check/sha256.c \
|
||||
../src/liblzma/rangecoder/price_table.c \
|
||||
../src/liblzma/delta/delta_common.c \
|
||||
../src/liblzma/delta/delta_decoder.c \
|
||||
../src/liblzma/delta/delta_encoder.c \
|
||||
../src/liblzma/lz/lz_decoder.c \
|
||||
../src/liblzma/lz/lz_encoder.c \
|
||||
../src/liblzma/lz/lz_encoder_mf.c \
|
||||
@@ -122,9 +96,7 @@ LIBLZMA_SRCS_C = \
|
||||
../src/liblzma/lzma/lzma_encoder_optimum_fast.c \
|
||||
../src/liblzma/lzma/lzma_encoder_optimum_normal.c \
|
||||
../src/liblzma/lzma/lzma_encoder_presets.c \
|
||||
../src/liblzma/delta/delta_common.c \
|
||||
../src/liblzma/delta/delta_decoder.c \
|
||||
../src/liblzma/delta/delta_encoder.c \
|
||||
../src/liblzma/rangecoder/price_table.c \
|
||||
../src/liblzma/simple/arm.c \
|
||||
../src/liblzma/simple/armthumb.c \
|
||||
../src/liblzma/simple/ia64.c \
|
||||
@@ -133,123 +105,43 @@ LIBLZMA_SRCS_C = \
|
||||
../src/liblzma/simple/simple_decoder.c \
|
||||
../src/liblzma/simple/simple_encoder.c \
|
||||
../src/liblzma/simple/sparc.c \
|
||||
../src/liblzma/simple/x86.c
|
||||
|
||||
LIBLZMA_SRCS_ASM = \
|
||||
../src/liblzma/check/crc32_x86.S \
|
||||
../src/liblzma/check/crc64_x86.S
|
||||
|
||||
LIBLZMA_OBJS_C = $(LIBLZMA_SRCS_C:.c=.o)
|
||||
LIBLZMA_OBJS_ASM = $(LIBLZMA_SRCS_ASM:.S=.o)
|
||||
LIBLZMA_OBJS = $(LIBLZMA_OBJS_C) $(LIBLZMA_OBJS_ASM)
|
||||
|
||||
$(LIBLZMA_OBJS_C): %.o: %.c
|
||||
$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c -o $@ $<
|
||||
|
||||
$(LIBLZMA_OBJS_ASM): %.o: %.S
|
||||
$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c -o $@ $<
|
||||
|
||||
liblzma.a: $(LIBLZMA_OBJS)
|
||||
$(RM) $@
|
||||
$(AR) rcs $@ $(LIBLZMA_OBJS)
|
||||
$(STRIP) --strip-unneeded $@
|
||||
|
||||
# Avoid too long command lines.
|
||||
.PHONY: liblzma-clean $(LIBLZMA_OBJS:.o=-clean)
|
||||
liblzma-clean: $(LIBLZMA_OBJS:.o=-clean)
|
||||
-$(RM) liblzma.a
|
||||
|
||||
$(LIBLZMA_OBJS:.o=-clean):
|
||||
-$(RM) $(@:-clean=.o)
|
||||
|
||||
|
||||
###############
|
||||
# getopt_long #
|
||||
###############
|
||||
|
||||
GETOPT_SRCS = \
|
||||
../lib/getopt.c \
|
||||
../lib/getopt1.c
|
||||
|
||||
GETOPT_OBJS = $(GETOPT_SRCS:.c=.o)
|
||||
|
||||
GETOPT_H = ../lib/getopt.h
|
||||
|
||||
$(GETOPT_H): %.h: %.in.h
|
||||
$(SED) "" $< > $@
|
||||
|
||||
$(GETOPT_OBJS): %.o: %.c $(GETOPT_H)
|
||||
$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c -o $@ $<
|
||||
|
||||
getopt.a: $(GETOPT_OBJS)
|
||||
$(RM) $@
|
||||
$(AR) rcs $@ $(GETOPT_OBJS)
|
||||
$(STRIP) --strip-unneeded $@
|
||||
|
||||
getopt-clean:
|
||||
$(RM) $(GETOPT_H) $(GETOPT_OBJS) getopt.a
|
||||
|
||||
|
||||
###########################
|
||||
# xzdec.exe & lzmadec.exe #
|
||||
###########################
|
||||
|
||||
XZDEC_SRCS = ../src/xzdec/xzdec.c
|
||||
|
||||
xzdec.exe: getopt.a liblzma.a $(XZDEC_SRCS)
|
||||
$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) $(XZDEC_SRCS) -o $@ getopt.a liblzma.a
|
||||
$(STRIP) --strip-all $@
|
||||
exe2coff $@
|
||||
$(RM) $@
|
||||
copy /b $(DJGPP:DJGPP.ENV=BIN\CWSDSTUB.EXE) + $(@:.exe=) $@
|
||||
$(RM) $(@:.exe=)
|
||||
|
||||
lzmadec.exe: getopt.a liblzma.a $(XZDEC_SRCS)
|
||||
$(CC) $(ALL_CPPFLAGS) -DLZMADEC $(ALL_CFLAGS) $(XZDEC_SRCS) -o $@ getopt.a liblzma.a
|
||||
$(STRIP) --strip-all $@
|
||||
exe2coff $@
|
||||
$(RM) $@
|
||||
copy /b $(DJGPP:DJGPP.ENV=BIN\CWSDSTUB.EXE) + $(@:.exe=) $@
|
||||
$(RM) $(@:.exe=)
|
||||
|
||||
.PHONY: xzdec-clean
|
||||
xzdec-clean:
|
||||
-$(RM) xzdec.exe lzmadec.exe xzdec lzmadec
|
||||
|
||||
|
||||
##########
|
||||
# xz.exe #
|
||||
##########
|
||||
|
||||
XZ_SRCS = \
|
||||
../src/liblzma/simple/x86.c \
|
||||
../src/xz/args.c \
|
||||
../src/xz/coder.c \
|
||||
../src/xz/file_io.c \
|
||||
../src/xz/hardware.c \
|
||||
../src/xz/list.c \
|
||||
../src/xz/main.c \
|
||||
../src/xz/message.c \
|
||||
../src/xz/mytime.c \
|
||||
../src/xz/options.c \
|
||||
../src/xz/signals.c \
|
||||
../src/xz/suffix.c \
|
||||
../src/xz/util.c
|
||||
SRCS_ASM = \
|
||||
../src/liblzma/check/crc32_x86.S \
|
||||
../src/liblzma/check/crc64_x86.S
|
||||
|
||||
XZ_OBJS = $(XZ_SRCS:.c=.o)
|
||||
OBJS_C = $(SRCS_C:.c=.o)
|
||||
OBJS_ASM = $(SRCS_ASM:.S=.o)
|
||||
OBJS = $(OBJS_C) $(OBJS_ASM)
|
||||
|
||||
$(XZ_OBJS): %.o: %.c
|
||||
getopt.h:
|
||||
update ../lib/getopt.in.h getopt.h
|
||||
|
||||
$(OBJS): getopt.h
|
||||
|
||||
$(OBJS_C): %.o: %.c
|
||||
$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c -o $@ $<
|
||||
|
||||
xz.exe: getopt.a liblzma.a $(XZ_OBJS)
|
||||
$(CC) $(ALL_CFLAGS) $(XZ_OBJS) -o $@ getopt.a liblzma.a
|
||||
$(OBJS_ASM): %.o: %.S
|
||||
$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c -o $@ $<
|
||||
|
||||
# Make xz.exe not depend on an external DPMI server.
|
||||
xz.exe: $(OBJS)
|
||||
$(CC) $(ALL_CFLAGS) $(OBJS) $(LDFLAGS) -o $@
|
||||
$(STRIP) --strip-all $@
|
||||
exe2coff $@
|
||||
$(RM) $@
|
||||
del $@
|
||||
copy /b $(DJGPP:DJGPP.ENV=BIN\CWSDSTUB.EXE) + $(@:.exe=) $@
|
||||
$(RM) $(@:.exe=)
|
||||
|
||||
# Avoid too long command lines.
|
||||
.PHONY: xz-clean $(XZ_OBJS:.o=-clean)
|
||||
xz-clean: $(XZ_OBJS:.o=-clean)
|
||||
-$(RM) xz.exe xz
|
||||
|
||||
$(XZ_OBJS:.o=-clean):
|
||||
-$(RM) $(@:-clean=.o)
|
||||
del $(@:.exe=)
|
||||
|
||||
113
dos/README
113
dos/README
@@ -1,113 +0,0 @@
|
||||
|
||||
XZ Utils on DOS
|
||||
===============
|
||||
|
||||
Introduction
|
||||
|
||||
This document explains how to build XZ Utils for DOS using DJGPP.
|
||||
The resulting binaries should run at least on various DOS versions
|
||||
and under Windows 95/98/98SE/ME, which cannot run the Windows version
|
||||
of XZ Utils.
|
||||
|
||||
This is currently experimental and has got very little testing.
|
||||
|
||||
|
||||
Getting and Installing DJGPP
|
||||
|
||||
You may use <http://www.delorie.com/djgpp/zip-picker.html> to help
|
||||
deciding what to download, but as of writing (2009-02-13) that may
|
||||
not be the most convenient way taking into account what components
|
||||
are actually required to build XZ Utils. However, using the
|
||||
zip-picker can still be worth doing to get nice short summary of
|
||||
installation instructions (they can be found from readme.1st too).
|
||||
|
||||
For more manual method, first select a mirror from
|
||||
<http://www.delorie.com/djgpp/getting.html>. You need
|
||||
the following files:
|
||||
|
||||
unzip32.exe
|
||||
beta/v2/djdev204.zip
|
||||
v2gnu/bnu219b.zip
|
||||
v2gnu/gcc432b.zip
|
||||
v2gnu/mak3791b.zip
|
||||
v2gnu/sed415b.zip
|
||||
v2misc/csdpmi5b.zip
|
||||
|
||||
If newer versions are available, probably you should try them first.
|
||||
Note that djdev203.zip is too old to build XZ Utils; you need at
|
||||
least djdev204.zip. Also note that you want csdpmi5b.zip even if you
|
||||
run under Windows or DOSEMU, because the XZ Utils Makefile will embed
|
||||
cwsdstub.exe to the resulting binaries.
|
||||
|
||||
See the instructions in readme.1st found from djdev204.zip. Here's
|
||||
a short summary, but you should still read readme.1st.
|
||||
|
||||
C:\> mkdir DJGPP
|
||||
C:\> cd DJGPP
|
||||
C:\DJGPP> c:\download\unzip32 c:\download\djdev204.zip
|
||||
C:\DJGPP> c:\download\unzip32 c:\download\bnu219b.zip
|
||||
C:\DJGPP> c:\download\unzip32 c:\download\gcc432b.zip
|
||||
C:\DJGPP> c:\download\unzip32 c:\download\mak3791b.zip
|
||||
C:\DJGPP> c:\download\unzip32 c:\download\sed415b.zip
|
||||
C:\DJGPP> c:\download\unzip32 c:\download\csdpmi5b.zip
|
||||
|
||||
C:\DJGPP> set PATH=C:\DJGPP\BIN;%PATH%
|
||||
C:\DJGPP> set DJGPP=C:\DJGPP\DJGPP.ENV
|
||||
|
||||
You may want to add the last two lines into AUTOEXEC.BAT or have,
|
||||
for example, DJGPP.BAT which you can run before using DJGPP.
|
||||
|
||||
Make sure you use completely upper case path in the DJGPP environment
|
||||
variable. This is not required by DJGPP, but the XZ Utils Makefile is
|
||||
a bit stupid and expects that everything in DJGPP environment variable
|
||||
is uppercase.
|
||||
|
||||
|
||||
Building
|
||||
|
||||
Just run "make" in this directory (the directory containing this
|
||||
README). You should get liblzma.a, xz.exe, xzdec.exe, and
|
||||
lzmadec.exe. Of these, probably xz.exe is the only interesting one.
|
||||
|
||||
Note: You need to have an environment that supports long filenames.
|
||||
Once you have built XZ Utils, the resulting binaries can be run
|
||||
without long filename support.
|
||||
|
||||
|
||||
Additional Make Flags and Targets
|
||||
|
||||
You may want to try some additional optimizations, which may or
|
||||
may not make the code faster (and may or may not hit possible
|
||||
compiler bugs more easily):
|
||||
|
||||
make CFLAGS="-O3 -fomit-frame-pointer -funroll-loops"
|
||||
|
||||
If you want to enable assertions (the assert() macro), use DEBUG=1.
|
||||
You may want to disable optimizations too if you plan to actually
|
||||
debug the code. Never use DEBUG=1 for production builds!
|
||||
|
||||
make DEBUG=1 CFLAGS="-g -O0"
|
||||
|
||||
|
||||
Bugs
|
||||
|
||||
"make clean" may remove src/xz/hardware.c when it tries to remove
|
||||
src/xz/hardware-fixed.c. This is probably a bug somewhere in the
|
||||
DOS environment I use. Maybe it tries truncated 8.3 name first and
|
||||
since that gives a name of an existing file, it doesn't look for
|
||||
long filename.
|
||||
|
||||
"xz -fc /dev/tty" hangs at least in DOSEMU and cannot be interrupted
|
||||
by pressing C-c. Maybe xz should never accept non-regular files on
|
||||
DOS even when --force is used.
|
||||
|
||||
Using different memory usage limit for encoding and decoding doesn't
|
||||
make sense under pure DOS. Maybe it is still OK when running under
|
||||
Windows.
|
||||
|
||||
The progress indicator of "xz -v" doesn't get updated when running
|
||||
under Dosbox, but it works in DOSEMU. I currently (2009-02-13) don't
|
||||
know if it works in other environments.
|
||||
|
||||
Report bugs to <lasse.collin@tukaani.org> (in English or Finnish).
|
||||
|
||||
123
dos/README.txt
Normal file
123
dos/README.txt
Normal file
@@ -0,0 +1,123 @@
|
||||
|
||||
XZ Utils on DOS
|
||||
===============
|
||||
|
||||
DOS-specific filename handling
|
||||
|
||||
xz detects at runtime if long filename (LFN) support is
|
||||
available and will use it by default. It can be disabled by
|
||||
setting an environment variable:
|
||||
|
||||
set lfn=n
|
||||
|
||||
When xz is in LFN mode, it behaves pretty much the same as it
|
||||
does on other operating systems. Examples:
|
||||
|
||||
xz foo.tar -> foo.tar.xz
|
||||
xz -d foo.tar.xz -> foo.tar
|
||||
|
||||
xz -F lzma foo.tar -> foo.tar.lzma
|
||||
xz -d foo.tar.lzma -> foo.tar
|
||||
|
||||
When LFN support isn't available or it is disabled with LFN=n
|
||||
environment setting, xz works in short filename (SFN) mode. This
|
||||
affects filename suffix handling when compressing.
|
||||
|
||||
When compressing to the .xz format in SFN mode:
|
||||
|
||||
- Files without an extension get .xz just like on LFN systems.
|
||||
|
||||
- *.tar files become *.txz (shorthand for *.tar.xz). *.txz
|
||||
is recognized by xz on all supported operating systems.
|
||||
(Try to avoid confusing this with gzipped .txt files.)
|
||||
|
||||
- Files with 1-3 character extension have their extension modified
|
||||
so that the last character is a dash ("-"). If the extension
|
||||
is already three characters, the last character is lost. The
|
||||
resulting *.?- or *.??- filename is recognized in LFN mode, but
|
||||
it isn't recognized by xz on other operating systems.
|
||||
|
||||
Examples:
|
||||
|
||||
xz foo -> foo.xz | xz -d foo.xz -> foo
|
||||
xz foo.tar -> foo.txz | xz -d foo.txz -> foo.tar
|
||||
xz foo.c -> foo.c- | xz -d foo.c- -> foo.c
|
||||
xz read.me -> read.me- | xz -d read.me- -> read.me
|
||||
xz foo.txt -> foo.tx- | xz -d foo.tx- -> foo.tx !
|
||||
|
||||
Note that in the last example above, the third character of the
|
||||
filename extension is lost.
|
||||
|
||||
When compressing to the legacy .lzma format in SFN mode:
|
||||
|
||||
- *.tar files become *.tlz (shorthand for *.tar.lzma). *.tlz
|
||||
is recognized by xz on all supported operating systems.
|
||||
|
||||
- Other files become *.lzm. The original filename extension
|
||||
is lost. *.lzm is recognized also in LFN mode, but it is not
|
||||
recognized by xz on other operating systems.
|
||||
|
||||
Examples:
|
||||
|
||||
xz -F lzma foo -> foo.lzm | xz -d foo.lzm -> foo
|
||||
xz -F lzma foo.tar -> foo.tlz | xz -d foo.tlz -> foo.tar
|
||||
xz -F lzma foo.c -> foo.lzm | xz -d foo.lzm -> foo !
|
||||
xz -F lzma read.me -> read.lzm | xz -d read.lzm -> read !
|
||||
xz -F lzma foo.txt -> foo.lzm | xz -d foo.lzm -> foo !
|
||||
|
||||
When compressing with a custom suffix (-S .SUF, --suffix=.SUF) to
|
||||
any file format:
|
||||
|
||||
- If the suffix begins with a dot, the filename extension is
|
||||
replaced with the new suffix. The original extension is lost.
|
||||
|
||||
- If the suffix doesn't begin with a dot and the filename has no
|
||||
extension and the filename given on the command line doesn't
|
||||
have a dot at the end, the custom suffix is appended just like
|
||||
on LFN systems.
|
||||
|
||||
- If the suffix doesn't begin with a dot and the filename has
|
||||
an extension (or an extension-less filename is given with a dot
|
||||
at the end), the last 1-3 characters of the filename extension
|
||||
may get overwritten to fit the given custom suffix.
|
||||
|
||||
Examples:
|
||||
|
||||
xz -S x foo -> foox | xz -dS x foox -> foo
|
||||
xz -S x foo. -> foo.x | xz -dS x foo.x -> foo
|
||||
xz -S .x foo -> foo.x | xz -dS .x foo.x -> foo
|
||||
xz -S .x foo. -> foo.x | xz -dS .x foo.x -> foo
|
||||
xz -S x.y foo -> foox.y | xz -dS x.y foox.y -> foo
|
||||
xz -S .a foo.c -> foo.a | xz -dS .a foo.a -> foo !
|
||||
xz -S a foo.c -> foo.ca | xz -dS a foo.ca -> foo.c
|
||||
xz -S ab foo.c -> foo.cab | xz -dS ab foo.cab -> foo.c
|
||||
xz -S ab read.me -> read.mab | xz -dS ab read.mab -> read.m !
|
||||
xz -S ab foo.txt -> foo.tab | xz -dS ab foo.tab -> foo.t !
|
||||
xz -S abc foo.txt -> foo.abc | xz -dS abc foo.abc -> foo !
|
||||
|
||||
When decompressing, the suffix handling in SFN mode is the same as
|
||||
in LFN mode. The DOS-specific filenames *.lzm, *.?-, and *.??- are
|
||||
recognized also in LFN mode.
|
||||
|
||||
xz handles certain uncommon situations safely:
|
||||
|
||||
- If the generated output filename refers to the same file as
|
||||
the input file, xz detects this and refuses to compress or
|
||||
decompress the input file even if --force is used. This can
|
||||
happen when giving an overlong filename in SFN mode. E.g.
|
||||
"xz -S x foo.texinfo" would try to write to foo.tex which on
|
||||
SFN system is the same file as foo.texinfo.
|
||||
|
||||
- If the generated output filename is a special file like "con"
|
||||
or "prn", xz detects this and refuses to compress or decompress
|
||||
the input file even if --force is used.
|
||||
|
||||
|
||||
Bugs
|
||||
|
||||
xz doesn't necessarily work in Dosbox. It should work in DOSEMU.
|
||||
|
||||
Pressing Ctrl-c or Ctrl-Break won't remove the incomplete target file
|
||||
when running under Windows XP Command Prompt (something goes wrong
|
||||
with SIGINT handling). It works correctly under Windows 95/98/98SE/ME.
|
||||
|
||||
42
dos/config.h
42
dos/config.h
@@ -1,5 +1,5 @@
|
||||
/* Define to 1 if using x86 assembler optimizations. */
|
||||
#define HAVE_ASM_X86 1
|
||||
/* How many MiB of RAM to assume if the real amount cannot be determined. */
|
||||
#define ASSUME_RAM 32
|
||||
|
||||
/* Define to 1 if crc32 integrity check is enabled. */
|
||||
#define HAVE_CHECK_CRC32 1
|
||||
@@ -10,9 +10,6 @@
|
||||
/* Define to 1 if sha256 integrity check is enabled. */
|
||||
#define HAVE_CHECK_SHA256 1
|
||||
|
||||
/* Define to 1 if decoder components are enabled. */
|
||||
#define HAVE_DECODER 1
|
||||
|
||||
/* Define to 1 if arm decoder is enabled. */
|
||||
#define HAVE_DECODER_ARM 1
|
||||
|
||||
@@ -37,15 +34,9 @@
|
||||
/* Define to 1 if sparc decoder is enabled. */
|
||||
#define HAVE_DECODER_SPARC 1
|
||||
|
||||
/* Define to 1 if subblock decoder is enabled. */
|
||||
/* #undef HAVE_DECODER_SUBBLOCK */
|
||||
|
||||
/* Define to 1 if x86 decoder is enabled. */
|
||||
#define HAVE_DECODER_X86 1
|
||||
|
||||
/* Define to 1 if encoder components are enabled. */
|
||||
#define HAVE_ENCODER 1
|
||||
|
||||
/* Define to 1 if arm encoder is enabled. */
|
||||
#define HAVE_ENCODER_ARM 1
|
||||
|
||||
@@ -70,24 +61,15 @@
|
||||
/* Define to 1 if sparc encoder is enabled. */
|
||||
#define HAVE_ENCODER_SPARC 1
|
||||
|
||||
/* Define to 1 if subblock encoder is enabled. */
|
||||
/* #undef HAVE_ENCODER_SUBBLOCK */
|
||||
|
||||
/* Define to 1 if x86 encoder is enabled. */
|
||||
#define HAVE_ENCODER_X86 1
|
||||
|
||||
/* Define to 1 if the system supports fast unaligned memory access. */
|
||||
#define HAVE_FAST_UNALIGNED_ACCESS 1
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#define HAVE_INTTYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the <limits.h> header file. */
|
||||
#define HAVE_LIMITS_H 1
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#define HAVE_MEMORY_H 1
|
||||
|
||||
/* Define to 1 to enable bt2 match finder. */
|
||||
#define HAVE_MF_BT2 1
|
||||
|
||||
@@ -103,9 +85,6 @@
|
||||
/* Define to 1 to enable hc4 match finder. */
|
||||
#define HAVE_MF_HC4 1
|
||||
|
||||
/* Define to 1 if optimizing for size. */
|
||||
/* #undef HAVE_SMALL */
|
||||
|
||||
/* Define to 1 if stdbool.h conforms to C99. */
|
||||
#define HAVE_STDBOOL_H 1
|
||||
|
||||
@@ -115,15 +94,9 @@
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#define HAVE_STDLIB_H 1
|
||||
|
||||
/* 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 the system has the type `uintptr_t'. */
|
||||
#define HAVE_UINTPTR_T 1
|
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
#define HAVE_SYS_TIME_H 1
|
||||
|
||||
@@ -137,14 +110,21 @@
|
||||
/* Define to 1 if the system has the type `_Bool'. */
|
||||
#define HAVE__BOOL 1
|
||||
|
||||
/* Define to 1 to disable debugging code. */
|
||||
#define NDEBUG 1
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#define PACKAGE_BUGREPORT "lasse.collin@tukaani.org"
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#define PACKAGE_NAME "XZ Utils"
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#define PACKAGE_URL "http://tukaani.org/xz/"
|
||||
|
||||
/* The size of `size_t', as computed by sizeof. */
|
||||
#define SIZEOF_SIZE_T 4
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
/* Define to 1 if the system supports fast unaligned access to 16-bit and
|
||||
32-bit integers. */
|
||||
#define TUKLIB_FAST_UNALIGNED_ACCESS 1
|
||||
|
||||
@@ -62,7 +62,7 @@ if printf '%s\n' "$INFO" | grep -q '^Block = 1'; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Get copmressed, uncompressed, and dictionary size.
|
||||
# Get compressed, uncompressed, and dictionary size.
|
||||
CSIZE=$(printf '%s\n' "$INFO" | sed -rn 's|^Packed Size = ([0-9]+$)|\1|p')
|
||||
USIZE=$(printf '%s\n' "$INFO" | sed -rn 's|^Size = ([0-9]+$)|\1|p')
|
||||
DICT=$(printf '%s\n' "$INFO" | sed -rn 's|^Method = LZMA:([0-9]+[bkm]?)$|\1|p')
|
||||
|
||||
3
m4/.gitignore
vendored
3
m4/.gitignore
vendored
@@ -1,4 +1,5 @@
|
||||
codeset.m4
|
||||
fcntl-o.m4
|
||||
gettext.m4
|
||||
glibc2.m4
|
||||
glibc21.m4
|
||||
@@ -6,6 +7,7 @@ iconv.m4
|
||||
intdiv0.m4
|
||||
intl.m4
|
||||
intldir.m4
|
||||
intlmacosx.m4
|
||||
intmax.m4
|
||||
inttypes-pri.m4
|
||||
inttypes_h.m4
|
||||
@@ -27,6 +29,7 @@ printf-posix.m4
|
||||
progtest.m4
|
||||
size_max.m4
|
||||
stdint_h.m4
|
||||
threadlib.m4
|
||||
uintmax_t.m4
|
||||
ulonglong.m4
|
||||
visibility.m4
|
||||
|
||||
@@ -1,279 +0,0 @@
|
||||
##### http://autoconf-archive.cryp.to/acx_pthread.html
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# This macro figures out how to build C programs using POSIX threads.
|
||||
# It sets the PTHREAD_LIBS output variable to the threads library and
|
||||
# linker flags, and the PTHREAD_CFLAGS output variable to any special
|
||||
# C compiler flags that are needed. (The user can also force certain
|
||||
# compiler flags/libs to be tested by setting these environment
|
||||
# variables.)
|
||||
#
|
||||
# Also sets PTHREAD_CC to any special C compiler that is needed for
|
||||
# multi-threaded programs (defaults to the value of CC otherwise).
|
||||
# (This is necessary on AIX to use the special cc_r compiler alias.)
|
||||
#
|
||||
# NOTE: You are assumed to not only compile your program with these
|
||||
# flags, but also link it with them as well. e.g. you should link
|
||||
# with $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS
|
||||
# $LIBS
|
||||
#
|
||||
# If you are only building threads programs, you may wish to use
|
||||
# these variables in your default LIBS, CFLAGS, and CC:
|
||||
#
|
||||
# LIBS="$PTHREAD_LIBS $LIBS"
|
||||
# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
# CC="$PTHREAD_CC"
|
||||
#
|
||||
# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute
|
||||
# constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to
|
||||
# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
|
||||
#
|
||||
# ACTION-IF-FOUND is a list of shell commands to run if a threads
|
||||
# library is found, and ACTION-IF-NOT-FOUND is a list of commands to
|
||||
# run it if it is not found. If ACTION-IF-FOUND is not specified, the
|
||||
# default action will define HAVE_PTHREAD.
|
||||
#
|
||||
# Please let the authors know if this macro fails on any platform, or
|
||||
# if you have any other suggestions or comments. This macro was based
|
||||
# on work by SGJ on autoconf scripts for FFTW (http://www.fftw.org/)
|
||||
# (with help from M. Frigo), as well as ac_pthread and hb_pthread
|
||||
# macros posted by Alejandro Forero Cuervo to the autoconf macro
|
||||
# repository. We are also grateful for the helpful feedback of
|
||||
# numerous users.
|
||||
#
|
||||
# LAST MODIFICATION
|
||||
#
|
||||
# 2007-07-29
|
||||
#
|
||||
# COPYLEFT
|
||||
#
|
||||
# Copyright (c) 2007 Steven G. Johnson <stevenj@alum.mit.edu>
|
||||
#
|
||||
# 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 3 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, see
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception, the respective Autoconf Macro's copyright
|
||||
# owner gives unlimited permission to copy, distribute and modify the
|
||||
# configure scripts that are the output of Autoconf when processing
|
||||
# the Macro. You need not follow the terms of the GNU General Public
|
||||
# License when using or distributing such scripts, even though
|
||||
# portions of the text of the Macro appear in them. The GNU General
|
||||
# Public License (GPL) does govern all other use of the material that
|
||||
# constitutes the Autoconf Macro.
|
||||
#
|
||||
# This special exception to the GPL applies to versions of the
|
||||
# Autoconf Macro released by the Autoconf Macro Archive. When you
|
||||
# make and distribute a modified version of the Autoconf Macro, you
|
||||
# may extend this special exception to the GPL to apply to your
|
||||
# modified version as well.
|
||||
|
||||
AC_DEFUN([ACX_PTHREAD], [
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_C
|
||||
acx_pthread_ok=no
|
||||
|
||||
# We used to check for pthread.h first, but this fails if pthread.h
|
||||
# requires special compiler flags (e.g. on True64 or Sequent).
|
||||
# It gets checked for in the link test anyway.
|
||||
|
||||
# First of all, check if the user has set any of the PTHREAD_LIBS,
|
||||
# etcetera environment variables, and if threads linking works using
|
||||
# them:
|
||||
if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
|
||||
AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
|
||||
AC_MSG_RESULT($acx_pthread_ok)
|
||||
if test x"$acx_pthread_ok" = xno; then
|
||||
PTHREAD_LIBS=""
|
||||
PTHREAD_CFLAGS=""
|
||||
fi
|
||||
LIBS="$save_LIBS"
|
||||
CFLAGS="$save_CFLAGS"
|
||||
fi
|
||||
|
||||
# We must check for the threads library under a number of different
|
||||
# names; the ordering is very important because some systems
|
||||
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
|
||||
# libraries is broken (non-POSIX).
|
||||
|
||||
# Create a list of thread flags to try. Items starting with a "-" are
|
||||
# C compiler flags, and other items are library names, except for "none"
|
||||
# which indicates that we try without any flags at all, and "pthread-config"
|
||||
# which is a program returning the flags for the Pth emulation library.
|
||||
|
||||
acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
|
||||
|
||||
# The ordering *is* (sometimes) important. Some notes on the
|
||||
# individual items follow:
|
||||
|
||||
# pthreads: AIX (must check this before -lpthread)
|
||||
# none: in case threads are in libc; should be tried before -Kthread and
|
||||
# other compiler flags to prevent continual compiler warnings
|
||||
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
|
||||
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
|
||||
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
|
||||
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
|
||||
# -pthreads: Solaris/gcc
|
||||
# -mthreads: Mingw32/gcc, Lynx/gcc
|
||||
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
|
||||
# doesn't hurt to check since this sometimes defines pthreads too;
|
||||
# also defines -D_REENTRANT)
|
||||
# ... -mt is also the pthreads flag for HP/aCC
|
||||
# pthread: Linux, etcetera
|
||||
# --thread-safe: KAI C++
|
||||
# pthread-config: use pthread-config program (for GNU Pth library)
|
||||
|
||||
case "${host_cpu}-${host_os}" in
|
||||
*solaris*)
|
||||
|
||||
# On Solaris (at least, for some versions), libc contains stubbed
|
||||
# (non-functional) versions of the pthreads routines, so link-based
|
||||
# tests will erroneously succeed. (We need to link with -pthreads/-mt/
|
||||
# -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
|
||||
# a function called by this macro, so we could check for that, but
|
||||
# who knows whether they'll stub that too in a future libc.) So,
|
||||
# we'll just look for -pthreads and -lpthread first:
|
||||
|
||||
acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags"
|
||||
;;
|
||||
esac
|
||||
|
||||
if test x"$acx_pthread_ok" = xno; then
|
||||
for flag in $acx_pthread_flags; do
|
||||
|
||||
case $flag in
|
||||
none)
|
||||
AC_MSG_CHECKING([whether pthreads work without any flags])
|
||||
;;
|
||||
|
||||
-*)
|
||||
AC_MSG_CHECKING([whether pthreads work with $flag])
|
||||
PTHREAD_CFLAGS="$flag"
|
||||
;;
|
||||
|
||||
pthread-config)
|
||||
AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no)
|
||||
if test x"$acx_pthread_config" = xno; then continue; fi
|
||||
PTHREAD_CFLAGS="`pthread-config --cflags`"
|
||||
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
|
||||
;;
|
||||
|
||||
*)
|
||||
AC_MSG_CHECKING([for the pthreads library -l$flag])
|
||||
PTHREAD_LIBS="-l$flag"
|
||||
;;
|
||||
esac
|
||||
|
||||
save_LIBS="$LIBS"
|
||||
save_CFLAGS="$CFLAGS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
|
||||
# Check for various functions. We must include pthread.h,
|
||||
# since some functions may be macros. (On the Sequent, we
|
||||
# need a special flag -Kthread to make this header compile.)
|
||||
# We check for pthread_join because it is in -lpthread on IRIX
|
||||
# while pthread_create is in libc. We check for pthread_attr_init
|
||||
# due to DEC craziness with -lpthreads. We check for
|
||||
# pthread_cleanup_push because it is one of the few pthread
|
||||
# functions on Solaris that doesn't have a non-functional libc stub.
|
||||
# We try pthread_create on general principles.
|
||||
AC_TRY_LINK([#include <pthread.h>],
|
||||
[pthread_t th; pthread_join(th, 0);
|
||||
pthread_attr_init(0); pthread_cleanup_push(0, 0);
|
||||
pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
|
||||
[acx_pthread_ok=yes])
|
||||
|
||||
LIBS="$save_LIBS"
|
||||
CFLAGS="$save_CFLAGS"
|
||||
|
||||
AC_MSG_RESULT($acx_pthread_ok)
|
||||
if test "x$acx_pthread_ok" = xyes; then
|
||||
break;
|
||||
fi
|
||||
|
||||
PTHREAD_LIBS=""
|
||||
PTHREAD_CFLAGS=""
|
||||
done
|
||||
fi
|
||||
|
||||
# Various other checks:
|
||||
if test "x$acx_pthread_ok" = xyes; then
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
|
||||
# Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
|
||||
AC_MSG_CHECKING([for joinable pthread attribute])
|
||||
attr_name=unknown
|
||||
for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
|
||||
AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;],
|
||||
[attr_name=$attr; break])
|
||||
done
|
||||
AC_MSG_RESULT($attr_name)
|
||||
if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
|
||||
AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
|
||||
[Define to necessary symbol if this constant
|
||||
uses a non-standard name on your system.])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([if more special flags are required for pthreads])
|
||||
flag=no
|
||||
case "${host_cpu}-${host_os}" in
|
||||
*-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
|
||||
*solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
|
||||
esac
|
||||
AC_MSG_RESULT(${flag})
|
||||
if test "x$flag" != xno; then
|
||||
PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
|
||||
fi
|
||||
|
||||
LIBS="$save_LIBS"
|
||||
CFLAGS="$save_CFLAGS"
|
||||
|
||||
# More AIX lossage: must compile with xlc_r or cc_r
|
||||
if test x"$GCC" != xyes; then
|
||||
AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
|
||||
else
|
||||
PTHREAD_CC=$CC
|
||||
fi
|
||||
else
|
||||
PTHREAD_CC="$CC"
|
||||
fi
|
||||
|
||||
AC_SUBST(PTHREAD_LIBS)
|
||||
AC_SUBST(PTHREAD_CFLAGS)
|
||||
AC_SUBST(PTHREAD_CC)
|
||||
|
||||
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
|
||||
if test x"$acx_pthread_ok" = xyes; then
|
||||
ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
|
||||
:
|
||||
else
|
||||
acx_pthread_ok=no
|
||||
$2
|
||||
fi
|
||||
AC_LANG_RESTORE
|
||||
])dnl ACX_PTHREAD
|
||||
332
m4/ax_pthread.m4
Normal file
332
m4/ax_pthread.m4
Normal file
@@ -0,0 +1,332 @@
|
||||
# ===========================================================================
|
||||
# http://www.gnu.org/software/autoconf-archive/ax_pthread.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# This macro figures out how to build C programs using POSIX threads. It
|
||||
# sets the PTHREAD_LIBS output variable to the threads library and linker
|
||||
# flags, and the PTHREAD_CFLAGS output variable to any special C compiler
|
||||
# flags that are needed. (The user can also force certain compiler
|
||||
# flags/libs to be tested by setting these environment variables.)
|
||||
#
|
||||
# Also sets PTHREAD_CC to any special C compiler that is needed for
|
||||
# multi-threaded programs (defaults to the value of CC otherwise). (This
|
||||
# is necessary on AIX to use the special cc_r compiler alias.)
|
||||
#
|
||||
# NOTE: You are assumed to not only compile your program with these flags,
|
||||
# but also link it with them as well. e.g. you should link with
|
||||
# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
|
||||
#
|
||||
# If you are only building threads programs, you may wish to use these
|
||||
# variables in your default LIBS, CFLAGS, and CC:
|
||||
#
|
||||
# LIBS="$PTHREAD_LIBS $LIBS"
|
||||
# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
# CC="$PTHREAD_CC"
|
||||
#
|
||||
# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
|
||||
# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name
|
||||
# (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
|
||||
#
|
||||
# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
|
||||
# PTHREAD_PRIO_INHERIT symbol is defined when compiling with
|
||||
# PTHREAD_CFLAGS.
|
||||
#
|
||||
# ACTION-IF-FOUND is a list of shell commands to run if a threads library
|
||||
# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
|
||||
# is not found. If ACTION-IF-FOUND is not specified, the default action
|
||||
# will define HAVE_PTHREAD.
|
||||
#
|
||||
# Please let the authors know if this macro fails on any platform, or if
|
||||
# you have any other suggestions or comments. This macro was based on work
|
||||
# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
|
||||
# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
|
||||
# Alejandro Forero Cuervo to the autoconf macro repository. We are also
|
||||
# grateful for the helpful feedback of numerous users.
|
||||
#
|
||||
# Updated for Autoconf 2.68 by Daniel Richard G.
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
|
||||
# Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception, the respective Autoconf Macro's copyright owner
|
||||
# gives unlimited permission to copy, distribute and modify the configure
|
||||
# scripts that are the output of Autoconf when processing the Macro. You
|
||||
# need not follow the terms of the GNU General Public License when using
|
||||
# or distributing such scripts, even though portions of the text of the
|
||||
# Macro appear in them. The GNU General Public License (GPL) does govern
|
||||
# all other use of the material that constitutes the Autoconf Macro.
|
||||
#
|
||||
# This special exception to the GPL applies to versions of the Autoconf
|
||||
# Macro released by the Autoconf Archive. When you make and distribute a
|
||||
# modified version of the Autoconf Macro, you may extend this special
|
||||
# exception to the GPL to apply to your modified version as well.
|
||||
|
||||
#serial 21
|
||||
|
||||
AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
|
||||
AC_DEFUN([AX_PTHREAD], [
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_LANG_PUSH([C])
|
||||
ax_pthread_ok=no
|
||||
|
||||
# We used to check for pthread.h first, but this fails if pthread.h
|
||||
# requires special compiler flags (e.g. on True64 or Sequent).
|
||||
# It gets checked for in the link test anyway.
|
||||
|
||||
# First of all, check if the user has set any of the PTHREAD_LIBS,
|
||||
# etcetera environment variables, and if threads linking works using
|
||||
# them:
|
||||
if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
|
||||
AC_TRY_LINK_FUNC([pthread_join], [ax_pthread_ok=yes])
|
||||
AC_MSG_RESULT([$ax_pthread_ok])
|
||||
if test x"$ax_pthread_ok" = xno; then
|
||||
PTHREAD_LIBS=""
|
||||
PTHREAD_CFLAGS=""
|
||||
fi
|
||||
LIBS="$save_LIBS"
|
||||
CFLAGS="$save_CFLAGS"
|
||||
fi
|
||||
|
||||
# We must check for the threads library under a number of different
|
||||
# names; the ordering is very important because some systems
|
||||
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
|
||||
# libraries is broken (non-POSIX).
|
||||
|
||||
# Create a list of thread flags to try. Items starting with a "-" are
|
||||
# C compiler flags, and other items are library names, except for "none"
|
||||
# which indicates that we try without any flags at all, and "pthread-config"
|
||||
# which is a program returning the flags for the Pth emulation library.
|
||||
|
||||
ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
|
||||
|
||||
# The ordering *is* (sometimes) important. Some notes on the
|
||||
# individual items follow:
|
||||
|
||||
# pthreads: AIX (must check this before -lpthread)
|
||||
# none: in case threads are in libc; should be tried before -Kthread and
|
||||
# other compiler flags to prevent continual compiler warnings
|
||||
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
|
||||
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
|
||||
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
|
||||
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
|
||||
# -pthreads: Solaris/gcc
|
||||
# -mthreads: Mingw32/gcc, Lynx/gcc
|
||||
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
|
||||
# doesn't hurt to check since this sometimes defines pthreads too;
|
||||
# also defines -D_REENTRANT)
|
||||
# ... -mt is also the pthreads flag for HP/aCC
|
||||
# pthread: Linux, etcetera
|
||||
# --thread-safe: KAI C++
|
||||
# pthread-config: use pthread-config program (for GNU Pth library)
|
||||
|
||||
case ${host_os} in
|
||||
solaris*)
|
||||
|
||||
# On Solaris (at least, for some versions), libc contains stubbed
|
||||
# (non-functional) versions of the pthreads routines, so link-based
|
||||
# tests will erroneously succeed. (We need to link with -pthreads/-mt/
|
||||
# -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
|
||||
# a function called by this macro, so we could check for that, but
|
||||
# who knows whether they'll stub that too in a future libc.) So,
|
||||
# we'll just look for -pthreads and -lpthread first:
|
||||
|
||||
ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
|
||||
;;
|
||||
|
||||
darwin*)
|
||||
ax_pthread_flags="-pthread $ax_pthread_flags"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Clang doesn't consider unrecognized options an error unless we specify
|
||||
# -Werror. We throw in some extra Clang-specific options to ensure that
|
||||
# this doesn't happen for GCC, which also accepts -Werror.
|
||||
|
||||
AC_MSG_CHECKING([if compiler needs -Werror to reject unknown flags])
|
||||
save_CFLAGS="$CFLAGS"
|
||||
ax_pthread_extra_flags="-Werror"
|
||||
CFLAGS="$CFLAGS $ax_pthread_extra_flags -Wunknown-warning-option -Wsizeof-array-argument"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int foo(void);],[foo()])],
|
||||
[AC_MSG_RESULT([yes])],
|
||||
[ax_pthread_extra_flags=
|
||||
AC_MSG_RESULT([no])])
|
||||
CFLAGS="$save_CFLAGS"
|
||||
|
||||
if test x"$ax_pthread_ok" = xno; then
|
||||
for flag in $ax_pthread_flags; do
|
||||
|
||||
case $flag in
|
||||
none)
|
||||
AC_MSG_CHECKING([whether pthreads work without any flags])
|
||||
;;
|
||||
|
||||
-*)
|
||||
AC_MSG_CHECKING([whether pthreads work with $flag])
|
||||
PTHREAD_CFLAGS="$flag"
|
||||
;;
|
||||
|
||||
pthread-config)
|
||||
AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no])
|
||||
if test x"$ax_pthread_config" = xno; then continue; fi
|
||||
PTHREAD_CFLAGS="`pthread-config --cflags`"
|
||||
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
|
||||
;;
|
||||
|
||||
*)
|
||||
AC_MSG_CHECKING([for the pthreads library -l$flag])
|
||||
PTHREAD_LIBS="-l$flag"
|
||||
;;
|
||||
esac
|
||||
|
||||
save_LIBS="$LIBS"
|
||||
save_CFLAGS="$CFLAGS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS $ax_pthread_extra_flags"
|
||||
|
||||
# Check for various functions. We must include pthread.h,
|
||||
# since some functions may be macros. (On the Sequent, we
|
||||
# need a special flag -Kthread to make this header compile.)
|
||||
# We check for pthread_join because it is in -lpthread on IRIX
|
||||
# while pthread_create is in libc. We check for pthread_attr_init
|
||||
# due to DEC craziness with -lpthreads. We check for
|
||||
# pthread_cleanup_push because it is one of the few pthread
|
||||
# functions on Solaris that doesn't have a non-functional libc stub.
|
||||
# We try pthread_create on general principles.
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>
|
||||
static void routine(void *a) { a = 0; }
|
||||
static void *start_routine(void *a) { return a; }],
|
||||
[pthread_t th; pthread_attr_t attr;
|
||||
pthread_create(&th, 0, start_routine, 0);
|
||||
pthread_join(th, 0);
|
||||
pthread_attr_init(&attr);
|
||||
pthread_cleanup_push(routine, 0);
|
||||
pthread_cleanup_pop(0) /* ; */])],
|
||||
[ax_pthread_ok=yes],
|
||||
[])
|
||||
|
||||
LIBS="$save_LIBS"
|
||||
CFLAGS="$save_CFLAGS"
|
||||
|
||||
AC_MSG_RESULT([$ax_pthread_ok])
|
||||
if test "x$ax_pthread_ok" = xyes; then
|
||||
break;
|
||||
fi
|
||||
|
||||
PTHREAD_LIBS=""
|
||||
PTHREAD_CFLAGS=""
|
||||
done
|
||||
fi
|
||||
|
||||
# Various other checks:
|
||||
if test "x$ax_pthread_ok" = xyes; then
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
|
||||
# Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
|
||||
AC_MSG_CHECKING([for joinable pthread attribute])
|
||||
attr_name=unknown
|
||||
for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
|
||||
[int attr = $attr; return attr /* ; */])],
|
||||
[attr_name=$attr; break],
|
||||
[])
|
||||
done
|
||||
AC_MSG_RESULT([$attr_name])
|
||||
if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
|
||||
AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], [$attr_name],
|
||||
[Define to necessary symbol if this constant
|
||||
uses a non-standard name on your system.])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([if more special flags are required for pthreads])
|
||||
flag=no
|
||||
case ${host_os} in
|
||||
aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";;
|
||||
osf* | hpux*) flag="-D_REENTRANT";;
|
||||
solaris*)
|
||||
if test "$GCC" = "yes"; then
|
||||
flag="-D_REENTRANT"
|
||||
else
|
||||
# TODO: What about Clang on Solaris?
|
||||
flag="-mt -D_REENTRANT"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
AC_MSG_RESULT([$flag])
|
||||
if test "x$flag" != xno; then
|
||||
PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
|
||||
[ax_cv_PTHREAD_PRIO_INHERIT], [
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],
|
||||
[[int i = PTHREAD_PRIO_INHERIT;]])],
|
||||
[ax_cv_PTHREAD_PRIO_INHERIT=yes],
|
||||
[ax_cv_PTHREAD_PRIO_INHERIT=no])
|
||||
])
|
||||
AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"],
|
||||
[AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])])
|
||||
|
||||
LIBS="$save_LIBS"
|
||||
CFLAGS="$save_CFLAGS"
|
||||
|
||||
# More AIX lossage: compile with *_r variant
|
||||
if test "x$GCC" != xyes; then
|
||||
case $host_os in
|
||||
aix*)
|
||||
AS_CASE(["x/$CC"],
|
||||
[x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6],
|
||||
[#handle absolute path differently from PATH based program lookup
|
||||
AS_CASE(["x$CC"],
|
||||
[x/*],
|
||||
[AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])],
|
||||
[AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])])
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
|
||||
test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
|
||||
|
||||
AC_SUBST([PTHREAD_LIBS])
|
||||
AC_SUBST([PTHREAD_CFLAGS])
|
||||
AC_SUBST([PTHREAD_CC])
|
||||
|
||||
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
|
||||
if test x"$ax_pthread_ok" = xyes; then
|
||||
ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1])
|
||||
:
|
||||
else
|
||||
ax_pthread_ok=no
|
||||
$2
|
||||
fi
|
||||
AC_LANG_POP
|
||||
])dnl AX_PTHREAD
|
||||
@@ -1,57 +0,0 @@
|
||||
dnl ###########################################################################
|
||||
dnl
|
||||
dnl lc_CPUCORES - Check how to find out the number of online CPU cores
|
||||
dnl
|
||||
dnl Check how to find out the number of available CPU cores in the system.
|
||||
dnl sysconf(_SC_NPROCESSORS_ONLN) works on most systems, except that BSDs
|
||||
dnl use sysctl().
|
||||
dnl
|
||||
dnl ###########################################################################
|
||||
dnl
|
||||
dnl Author: Lasse Collin
|
||||
dnl
|
||||
dnl This file has been put into the public domain.
|
||||
dnl You can do whatever you want with this file.
|
||||
dnl
|
||||
dnl ###########################################################################
|
||||
AC_DEFUN([lc_CPUCORES], [
|
||||
AC_MSG_CHECKING([how to detect the number of available CPU cores])
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <unistd.h>
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
long i;
|
||||
i = sysconf(_SC_NPROCESSORS_ONLN);
|
||||
return 0;
|
||||
}
|
||||
]])], [
|
||||
AC_DEFINE([HAVE_CPUCORES_SYSCONF], [1],
|
||||
[Define to 1 if the number of available CPU cores can be
|
||||
detected with sysconf(_SC_NPROCESSORS_ONLN).])
|
||||
AC_MSG_RESULT([sysconf])
|
||||
], [
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
# include <sys/param.h>
|
||||
#endif
|
||||
#include <sys/sysctl.h>
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
int name[2] = { CTL_HW, HW_NCPU };
|
||||
int cpus;
|
||||
size_t cpus_size = sizeof(cpus);
|
||||
sysctl(name, 2, &cpus, &cpus_size, NULL, NULL);
|
||||
return 0;
|
||||
}
|
||||
]])], [
|
||||
AC_DEFINE([HAVE_CPUCORES_SYSCTL], [1],
|
||||
[Define to 1 if the number of available CPU cores can be
|
||||
detected with sysctl().])
|
||||
AC_MSG_RESULT([sysctl])
|
||||
], [
|
||||
AC_MSG_RESULT([unknown])
|
||||
])])
|
||||
])dnl lc_CPUCORES
|
||||
@@ -1,84 +0,0 @@
|
||||
dnl ###########################################################################
|
||||
dnl
|
||||
dnl lc_PHYSMEM - Check how to find out the amount of physical memory
|
||||
dnl
|
||||
dnl - sysconf() gives all the needed info on GNU+Linux and Solaris.
|
||||
dnl - BSDs use sysctl().
|
||||
dnl - sysinfo() works on Linux/dietlibc and probably on other Linux systems
|
||||
dnl whose libc may lack sysconf().
|
||||
dnl
|
||||
dnl ###########################################################################
|
||||
dnl
|
||||
dnl Author: Lasse Collin
|
||||
dnl
|
||||
dnl This file has been put into the public domain.
|
||||
dnl You can do whatever you want with this file.
|
||||
dnl
|
||||
dnl ###########################################################################
|
||||
AC_DEFUN([lc_PHYSMEM], [
|
||||
AC_MSG_CHECKING([how to detect the amount of physical memory])
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <unistd.h>
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
long i;
|
||||
i = sysconf(_SC_PAGESIZE);
|
||||
i = sysconf(_SC_PHYS_PAGES);
|
||||
return 0;
|
||||
}
|
||||
]])], [
|
||||
AC_DEFINE([HAVE_PHYSMEM_SYSCONF], [1],
|
||||
[Define to 1 if the amount of physical memory can be detected
|
||||
with sysconf(_SC_PAGESIZE) and sysconf(_SC_PHYS_PAGES).])
|
||||
AC_MSG_RESULT([sysconf])
|
||||
], [
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
# include <sys/param.h>
|
||||
#endif
|
||||
#include <sys/sysctl.h>
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
int name[2] = { CTL_HW, HW_PHYSMEM };
|
||||
unsigned long mem;
|
||||
size_t mem_ptr_size = sizeof(mem);
|
||||
sysctl(name, 2, &mem, &mem_ptr_size, NULL, NULL);
|
||||
return 0;
|
||||
}
|
||||
]])], [
|
||||
AC_DEFINE([HAVE_PHYSMEM_SYSCTL], [1],
|
||||
[Define to 1 if the amount of physical memory can be detected
|
||||
with sysctl().])
|
||||
AC_MSG_RESULT([sysctl])
|
||||
], [
|
||||
dnl sysinfo() is Linux-specific. Some non-Linux systems have
|
||||
dnl incompatible sysinfo() so we must check $host_os.
|
||||
case $host_os in
|
||||
linux*)
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <sys/sysinfo.h>
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
struct sysinfo si;
|
||||
sysinfo(&si);
|
||||
return 0;
|
||||
}
|
||||
]])], [
|
||||
AC_DEFINE([HAVE_PHYSMEM_SYSINFO], [1],
|
||||
[Define to 1 if the amount of physical memory
|
||||
can be detected with Linux sysinfo().])
|
||||
AC_MSG_RESULT([sysinfo])
|
||||
], [
|
||||
AC_MSG_RESULT([unknown])
|
||||
])
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT([unknown])
|
||||
;;
|
||||
esac
|
||||
])])
|
||||
])dnl lc_PHYSMEM
|
||||
22
m4/tuklib_common.m4
Normal file
22
m4/tuklib_common.m4
Normal file
@@ -0,0 +1,22 @@
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# TUKLIB_COMMON
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Common checks for tuklib.
|
||||
#
|
||||
# COPYING
|
||||
#
|
||||
# Author: Lasse Collin
|
||||
#
|
||||
# This file has been put into the public domain.
|
||||
# You can do whatever you want with this file.
|
||||
#
|
||||
|
||||
AC_DEFUN_ONCE([TUKLIB_COMMON], [
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_REQUIRE([AC_PROG_CC_C99])
|
||||
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
|
||||
])dnl
|
||||
120
m4/tuklib_cpucores.m4
Normal file
120
m4/tuklib_cpucores.m4
Normal file
@@ -0,0 +1,120 @@
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# TUKLIB_CPUCORES
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Check how to find out the number of available CPU cores in the system.
|
||||
# This information is used by tuklib_cpucores.c.
|
||||
#
|
||||
# Supported methods:
|
||||
# - GetSystemInfo(): Windows (including Cygwin)
|
||||
# - sysctl(): BSDs, OS/2
|
||||
# - sysconf(): GNU/Linux, Solaris, Tru64, IRIX, AIX, Cygwin (but
|
||||
# GetSystemInfo() is used on Cygwin)
|
||||
# - pstat_getdynamic(): HP-UX
|
||||
#
|
||||
# COPYING
|
||||
#
|
||||
# Author: Lasse Collin
|
||||
#
|
||||
# This file has been put into the public domain.
|
||||
# You can do whatever you want with this file.
|
||||
#
|
||||
|
||||
AC_DEFUN_ONCE([TUKLIB_CPUCORES], [
|
||||
AC_REQUIRE([TUKLIB_COMMON])
|
||||
|
||||
# sys/param.h might be needed by sys/sysctl.h.
|
||||
AC_CHECK_HEADERS([sys/param.h])
|
||||
|
||||
AC_CACHE_CHECK([how to detect the number of available CPU cores],
|
||||
[tuklib_cv_cpucores_method], [
|
||||
|
||||
# Maybe checking $host_os would be enough but this matches what
|
||||
# tuklib_cpucores.c does.
|
||||
#
|
||||
# NOTE: IRIX has a compiler that doesn't error out with #error, so use
|
||||
# a non-compilable text instead of #error to generate an error.
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||
int main(void) { return 0; }
|
||||
#else
|
||||
compile error
|
||||
#endif
|
||||
]])], [tuklib_cv_cpucores_method=special], [
|
||||
|
||||
# Look for sysctl() solution first, because on OS/2, both sysconf()
|
||||
# and sysctl() pass the tests in this file, but only sysctl()
|
||||
# actually works.
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
# include <sys/param.h>
|
||||
#endif
|
||||
#include <sys/sysctl.h>
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
int name[2] = { CTL_HW, HW_NCPU };
|
||||
int cpus;
|
||||
size_t cpus_size = sizeof(cpus);
|
||||
sysctl(name, 2, &cpus, &cpus_size, NULL, 0);
|
||||
return 0;
|
||||
}
|
||||
]])], [tuklib_cv_cpucores_method=sysctl], [
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <unistd.h>
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
long i;
|
||||
#ifdef _SC_NPROCESSORS_ONLN
|
||||
/* Many systems using sysconf() */
|
||||
i = sysconf(_SC_NPROCESSORS_ONLN);
|
||||
#else
|
||||
/* IRIX */
|
||||
i = sysconf(_SC_NPROC_ONLN);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
]])], [tuklib_cv_cpucores_method=sysconf], [
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <sys/param.h>
|
||||
#include <sys/pstat.h>
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
struct pst_dynamic pst;
|
||||
pstat_getdynamic(&pst, sizeof(pst), 1, 0);
|
||||
(void)pst.psd_proc_cnt;
|
||||
return 0;
|
||||
}
|
||||
]])], [tuklib_cv_cpucores_method=pstat_getdynamic], [
|
||||
|
||||
tuklib_cv_cpucores_method=unknown
|
||||
])])])])])
|
||||
|
||||
case $tuklib_cv_cpucores_method in
|
||||
sysctl)
|
||||
AC_DEFINE([TUKLIB_CPUCORES_SYSCTL], [1],
|
||||
[Define to 1 if the number of available CPU cores
|
||||
can be detected with sysctl().])
|
||||
;;
|
||||
sysconf)
|
||||
AC_DEFINE([TUKLIB_CPUCORES_SYSCONF], [1],
|
||||
[Define to 1 if the number of available CPU cores
|
||||
can be detected with sysconf(_SC_NPROCESSORS_ONLN)
|
||||
or sysconf(_SC_NPROC_ONLN).])
|
||||
;;
|
||||
pstat_getdynamic)
|
||||
AC_DEFINE([TUKLIB_CPUCORES_PSTAT_GETDYNAMIC], [1],
|
||||
[Define to 1 if the number of available CPU cores
|
||||
can be detected with pstat_getdynamic().])
|
||||
;;
|
||||
esac
|
||||
])dnl
|
||||
74
m4/tuklib_integer.m4
Normal file
74
m4/tuklib_integer.m4
Normal file
@@ -0,0 +1,74 @@
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# TUKLIB_INTEGER
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Checks for tuklib_integer.h:
|
||||
# - Endianness
|
||||
# - Does operating system provide byte swapping macros
|
||||
# - Does the hardware support fast unaligned access to 16-bit
|
||||
# and 32-bit integers
|
||||
#
|
||||
# COPYING
|
||||
#
|
||||
# Author: Lasse Collin
|
||||
#
|
||||
# This file has been put into the public domain.
|
||||
# You can do whatever you want with this file.
|
||||
#
|
||||
|
||||
AC_DEFUN_ONCE([TUKLIB_INTEGER], [
|
||||
AC_REQUIRE([TUKLIB_COMMON])
|
||||
AC_REQUIRE([AC_C_BIGENDIAN])
|
||||
AC_CHECK_HEADERS([byteswap.h sys/endian.h sys/byteorder.h], [break])
|
||||
|
||||
# Even if we have byteswap.h, we may lack the specific macros/functions.
|
||||
if test x$ac_cv_header_byteswap_h = xyes ; then
|
||||
m4_foreach([FUNC], [bswap_16,bswap_32,bswap_64], [
|
||||
AC_MSG_CHECKING([if FUNC is available])
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
||||
#include <byteswap.h>
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
FUNC[](42);
|
||||
return 0;
|
||||
}
|
||||
])], [
|
||||
AC_DEFINE(HAVE_[]m4_toupper(FUNC), [1],
|
||||
[Define to 1 if] FUNC [is available.])
|
||||
AC_MSG_RESULT([yes])
|
||||
], [AC_MSG_RESULT([no])])
|
||||
|
||||
])dnl
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([if unaligned memory access should be used])
|
||||
AC_ARG_ENABLE([unaligned-access], AS_HELP_STRING([--enable-unaligned-access],
|
||||
[Enable if the system supports *fast* unaligned memory access
|
||||
with 16-bit and 32-bit integers. By default, this is enabled
|
||||
only on x86, x86_64, and big endian PowerPC.]),
|
||||
[], [enable_unaligned_access=auto])
|
||||
if test "x$enable_unaligned_access" = xauto ; then
|
||||
# TODO: There may be other architectures, on which unaligned access
|
||||
# is OK.
|
||||
case $host_cpu in
|
||||
i?86|x86_64|powerpc|powerpc64)
|
||||
enable_unaligned_access=yes
|
||||
;;
|
||||
*)
|
||||
enable_unaligned_access=no
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if test "x$enable_unaligned_access" = xyes ; then
|
||||
AC_DEFINE([TUKLIB_FAST_UNALIGNED_ACCESS], [1], [Define to 1 if
|
||||
the system supports fast unaligned access to 16-bit and
|
||||
32-bit integers.])
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
])dnl
|
||||
30
m4/tuklib_mbstr.m4
Normal file
30
m4/tuklib_mbstr.m4
Normal file
@@ -0,0 +1,30 @@
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# TUKLIB_MBSTR
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Check if multibyte and wide character functionality is available
|
||||
# for use by tuklib_mbstr_* functions. If not enough multibyte string
|
||||
# support is available in the C library, the functions keep working
|
||||
# with the assumption that all strings are a in single-byte character
|
||||
# set without combining characters, e.g. US-ASCII or ISO-8859-*.
|
||||
#
|
||||
# This .m4 file and tuklib_mbstr.h are common to all tuklib_mbstr_*
|
||||
# functions, but each function is put into a separate .c file so
|
||||
# that it is possible to pick only what is strictly needed.
|
||||
#
|
||||
# COPYING
|
||||
#
|
||||
# Author: Lasse Collin
|
||||
#
|
||||
# This file has been put into the public domain.
|
||||
# You can do whatever you want with this file.
|
||||
#
|
||||
|
||||
AC_DEFUN_ONCE([TUKLIB_MBSTR], [
|
||||
AC_REQUIRE([TUKLIB_COMMON])
|
||||
AC_FUNC_MBRTOWC
|
||||
AC_CHECK_FUNCS([wcwidth])
|
||||
])dnl
|
||||
212
m4/tuklib_physmem.m4
Normal file
212
m4/tuklib_physmem.m4
Normal file
@@ -0,0 +1,212 @@
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# TUKLIB_PHYSMEM
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Check how to get the amount of physical memory.
|
||||
# This information is used in tuklib_physmem.c.
|
||||
#
|
||||
# Supported methods:
|
||||
#
|
||||
# - Windows (including Cygwin), OS/2, DJGPP (DOS), and OpenVMS have
|
||||
# operating-system specific functions.
|
||||
#
|
||||
# - AIX has _system_configuration.physmem.
|
||||
#
|
||||
# - sysconf() works on GNU/Linux and Solaris, and possibly on
|
||||
# some BSDs.
|
||||
#
|
||||
# - BSDs use sysctl().
|
||||
#
|
||||
# - Tru64 uses getsysinfo().
|
||||
#
|
||||
# - HP-UX uses pstat_getstatic().
|
||||
#
|
||||
# - IRIX has setinvent_r(), getinvent_r(), and endinvent_r().
|
||||
#
|
||||
# - sysinfo() works on Linux/dietlibc and probably on other Linux
|
||||
# systems whose libc may lack sysconf().
|
||||
#
|
||||
# COPYING
|
||||
#
|
||||
# Author: Lasse Collin
|
||||
#
|
||||
# This file has been put into the public domain.
|
||||
# You can do whatever you want with this file.
|
||||
#
|
||||
|
||||
AC_DEFUN_ONCE([TUKLIB_PHYSMEM], [
|
||||
AC_REQUIRE([TUKLIB_COMMON])
|
||||
|
||||
# sys/param.h might be needed by sys/sysctl.h.
|
||||
AC_CHECK_HEADERS([sys/param.h])
|
||||
|
||||
AC_CACHE_CHECK([how to detect the amount of physical memory],
|
||||
[tuklib_cv_physmem_method], [
|
||||
|
||||
# Maybe checking $host_os would be enough but this matches what
|
||||
# tuklib_physmem.c does.
|
||||
#
|
||||
# NOTE: IRIX has a compiler that doesn't error out with #error, so use
|
||||
# a non-compilable text instead of #error to generate an error.
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#if defined(_WIN32) || defined(__CYGWIN__) || defined(__OS2__) \
|
||||
|| defined(__DJGPP__) || defined(__VMS) \
|
||||
|| defined(AMIGA) || defined(__AROS__)
|
||||
int main(void) { return 0; }
|
||||
#else
|
||||
compile error
|
||||
#endif
|
||||
]])], [tuklib_cv_physmem_method=special], [
|
||||
|
||||
# Look for AIX-specific solution before sysconf(), because the test
|
||||
# for sysconf() will pass on AIX but won't actually work
|
||||
# (sysconf(_SC_PHYS_PAGES) compiles but always returns -1 on AIX).
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <sys/systemcfg.h>
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
(void)_system_configuration.physmem;
|
||||
return 0;
|
||||
}
|
||||
]])], [tuklib_cv_physmem_method=aix], [
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <unistd.h>
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
long i;
|
||||
i = sysconf(_SC_PAGESIZE);
|
||||
i = sysconf(_SC_PHYS_PAGES);
|
||||
return 0;
|
||||
}
|
||||
]])], [tuklib_cv_physmem_method=sysconf], [
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
# include <sys/param.h>
|
||||
#endif
|
||||
#include <sys/sysctl.h>
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
int name[2] = { CTL_HW, HW_PHYSMEM };
|
||||
unsigned long mem;
|
||||
size_t mem_ptr_size = sizeof(mem);
|
||||
sysctl(name, 2, &mem, &mem_ptr_size, NULL, 0);
|
||||
return 0;
|
||||
}
|
||||
]])], [tuklib_cv_physmem_method=sysctl], [
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <sys/sysinfo.h>
|
||||
#include <machine/hal_sysinfo.h>
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
int memkb;
|
||||
int start = 0;
|
||||
getsysinfo(GSI_PHYSMEM, (caddr_t)&memkb, sizeof(memkb), &start);
|
||||
return 0;
|
||||
}
|
||||
]])], [tuklib_cv_physmem_method=getsysinfo],[
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <sys/param.h>
|
||||
#include <sys/pstat.h>
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
struct pst_static pst;
|
||||
pstat_getstatic(&pst, sizeof(pst), 1, 0);
|
||||
(void)pst.physical_memory;
|
||||
(void)pst.page_size;
|
||||
return 0;
|
||||
}
|
||||
]])], [tuklib_cv_physmem_method=pstat_getstatic],[
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <invent.h>
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
inv_state_t *st = NULL;
|
||||
setinvent_r(&st);
|
||||
getinvent_r(st);
|
||||
endinvent_r(st);
|
||||
return 0;
|
||||
}
|
||||
]])], [tuklib_cv_physmem_method=getinvent_r], [
|
||||
|
||||
# This version of sysinfo() is Linux-specific. Some non-Linux systems have
|
||||
# different sysinfo() so we must check $host_os.
|
||||
case $host_os in
|
||||
linux*)
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <sys/sysinfo.h>
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
struct sysinfo si;
|
||||
sysinfo(&si);
|
||||
return 0;
|
||||
}
|
||||
]])], [
|
||||
tuklib_cv_physmem_method=sysinfo
|
||||
], [
|
||||
tuklib_cv_physmem_method=unknown
|
||||
])
|
||||
;;
|
||||
*)
|
||||
tuklib_cv_physmem_method=unknown
|
||||
;;
|
||||
esac
|
||||
])])])])])])])])
|
||||
|
||||
case $tuklib_cv_physmem_method in
|
||||
aix)
|
||||
AC_DEFINE([TUKLIB_PHYSMEM_AIX], [1],
|
||||
[Define to 1 if the amount of physical memory
|
||||
can be detected with _system_configuration.physmem.])
|
||||
;;
|
||||
sysconf)
|
||||
AC_DEFINE([TUKLIB_PHYSMEM_SYSCONF], [1],
|
||||
[Define to 1 if the amount of physical memory can
|
||||
be detected with sysconf(_SC_PAGESIZE) and
|
||||
sysconf(_SC_PHYS_PAGES).])
|
||||
;;
|
||||
sysctl)
|
||||
AC_DEFINE([TUKLIB_PHYSMEM_SYSCTL], [1],
|
||||
[Define to 1 if the amount of physical memory can
|
||||
be detected with sysctl().])
|
||||
;;
|
||||
getsysinfo)
|
||||
AC_DEFINE([TUKLIB_PHYSMEM_GETSYSINFO], [1],
|
||||
[Define to 1 if the amount of physical memory can
|
||||
be detected with getsysinfo().])
|
||||
;;
|
||||
pstat_getstatic)
|
||||
AC_DEFINE([TUKLIB_PHYSMEM_PSTAT_GETSTATIC], [1],
|
||||
[Define to 1 if the amount of physical memory can
|
||||
be detected with pstat_getstatic().])
|
||||
;;
|
||||
getinvent_r)
|
||||
AC_DEFINE([TUKLIB_PHYSMEM_GETINVENT_R], [1],
|
||||
[Define to 1 if the amount of physical memory
|
||||
can be detected with getinvent_r().])
|
||||
;;
|
||||
sysinfo)
|
||||
AC_DEFINE([TUKLIB_PHYSMEM_SYSINFO], [1],
|
||||
[Define to 1 if the amount of physical memory
|
||||
can be detected with Linux sysinfo().])
|
||||
;;
|
||||
esac
|
||||
])dnl
|
||||
25
m4/tuklib_progname.m4
Normal file
25
m4/tuklib_progname.m4
Normal file
@@ -0,0 +1,25 @@
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# TUKLIB_PROGNAME
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Put argv[0] into a global variable progname. On DOS-like systems,
|
||||
# modify it so that it looks nice (no full path or .exe suffix).
|
||||
#
|
||||
# This .m4 file is needed allow this module to use glibc's
|
||||
# program_invocation_name.
|
||||
#
|
||||
# COPYING
|
||||
#
|
||||
# Author: Lasse Collin
|
||||
#
|
||||
# This file has been put into the public domain.
|
||||
# You can do whatever you want with this file.
|
||||
#
|
||||
|
||||
AC_DEFUN_ONCE([TUKLIB_PROGNAME], [
|
||||
AC_REQUIRE([TUKLIB_COMMON])
|
||||
AC_CHECK_DECLS([program_invocation_name], [], [], [#include <errno.h>])
|
||||
])dnl
|
||||
113
macosx/build.sh
Executable file
113
macosx/build.sh
Executable file
@@ -0,0 +1,113 @@
|
||||
#!/bin/sh
|
||||
|
||||
###############################################################################
|
||||
# Author: Anders F Björklund <afb@users.sourceforge.net>
|
||||
#
|
||||
# This file has been put into the public domain.
|
||||
# You can do whatever you want with this file.
|
||||
###############################################################################
|
||||
|
||||
mkdir -p Root
|
||||
mkdir -p Resources
|
||||
|
||||
# Abort immediately if something goes wrong.
|
||||
set -e
|
||||
|
||||
GCC="gcc-4.2"
|
||||
SDK="/Developer/SDKs/MacOSX10.5.sdk"
|
||||
MDT="10.5"
|
||||
GTT=i686-apple-darwin9
|
||||
|
||||
ARCHES1="-arch ppc -arch ppc64 -arch i386 -arch x86_64"
|
||||
ARCHES2="-arch ppc -arch i386"
|
||||
PKGFORMAT="10.5" # xar
|
||||
|
||||
# avoid "unknown required load command: 0x80000022" from linking on Snow Leopard
|
||||
uname -r | grep ^1 >/dev/null && LDFLAGS="$LDFLAGS -Wl,-no_compact_linkedit"
|
||||
|
||||
# Clean up if it was already configured.
|
||||
[ -f Makefile ] && make distclean
|
||||
|
||||
# Build the regular fat program
|
||||
|
||||
CC="$GCC" \
|
||||
CFLAGS="-O2 -g $ARCHES1 -isysroot $SDK -mmacosx-version-min=$MDT" \
|
||||
../configure --disable-dependency-tracking --disable-xzdec --disable-lzmadec $GTT
|
||||
|
||||
make
|
||||
|
||||
make check
|
||||
|
||||
make DESTDIR=`pwd`/Root install
|
||||
|
||||
make distclean
|
||||
|
||||
# Build the size-optimized program
|
||||
|
||||
CC="$GCC" \
|
||||
CFLAGS="-Os -g $ARCHES2 -isysroot $SDK -mmacosx-version-min=$MDT" \
|
||||
../configure --disable-dependency-tracking --disable-shared --disable-nls --disable-encoders --enable-small --disable-threads $GTT
|
||||
|
||||
make -C src/liblzma
|
||||
make -C src/xzdec
|
||||
make -C src/xzdec DESTDIR=`pwd`/Root install
|
||||
|
||||
cp -a ../extra Root/usr/local/share/doc/xz
|
||||
|
||||
make distclean
|
||||
|
||||
# Move development files to different package
|
||||
|
||||
test -d liblzma && rm -r liblzma
|
||||
mkdir -p liblzma/usr/local
|
||||
|
||||
mv Root/usr/local/include liblzma/usr/local
|
||||
mv Root/usr/local/lib liblzma/usr/local
|
||||
|
||||
mkdir -p Root/usr/local/lib
|
||||
cp -p liblzma/usr/local/lib/liblzma.5.dylib Root/usr/local/lib
|
||||
mkdir -p liblzma/usr/local/share/doc/xz
|
||||
mv Root/usr/local/share/doc/xz/examples* liblzma/usr/local/share/doc/xz
|
||||
|
||||
# Strip debugging symbols and make relocatable
|
||||
|
||||
for bin in xz lzmainfo xzdec lzmadec; do
|
||||
strip -S Root/usr/local/bin/$bin
|
||||
install_name_tool -change /usr/local/lib/liblzma.5.dylib @executable_path/../lib/liblzma.5.dylib Root/usr/local/bin/$bin
|
||||
done
|
||||
|
||||
for lib in liblzma.5.dylib; do
|
||||
strip -S Root/usr/local/lib/$lib
|
||||
install_name_tool -id @executable_path/../lib/liblzma.5.dylib Root/usr/local/lib/$lib
|
||||
done
|
||||
|
||||
# Create tarball, but without the HFS+ attrib
|
||||
|
||||
rmdir debug lib po src/liblzma/api src/liblzma src/lzmainfo src/scripts src/xz src/xzdec src tests
|
||||
|
||||
( cd Root/usr/local; COPY_EXTENDED_ATTRIBUTES_DISABLE=true COPYFILE_DISABLE=true tar cvjf ../../../XZ.tbz * )
|
||||
( cd liblzma; COPY_EXTENDED_ATTRIBUTES_DISABLE=true COPYFILE_DISABLE=true tar cvjf ../liblzma.tbz ./usr/local )
|
||||
|
||||
# Include documentation files for package
|
||||
|
||||
cp -p ../README Resources/ReadMe.txt
|
||||
cp -p ../COPYING Resources/License.txt
|
||||
|
||||
# Make an Installer.app package
|
||||
|
||||
ID="org.tukaani.xz"
|
||||
VERSION=`cd ..; sh build-aux/version.sh`
|
||||
PACKAGEMAKER=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
|
||||
$PACKAGEMAKER -r Root/usr/local -l /usr/local -e Resources -i $ID -n $VERSION -t XZ -o XZ.pkg -g $PKGFORMAT --verbose
|
||||
$PACKAGEMAKER -r liblzma -w -k -i $ID.liblzma -n $VERSION -o liblzma.pkg -g $PKGFORMAT --verbose
|
||||
|
||||
# Put the package in a disk image
|
||||
|
||||
if [ "$PKGFORMAT" != "10.5" ]; then
|
||||
hdiutil create -fs HFS+ -format UDZO -quiet -srcfolder XZ.pkg -ov XZ.dmg
|
||||
hdiutil internet-enable -yes -quiet XZ.dmg
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "Build completed successfully."
|
||||
echo
|
||||
30
po/.gitignore
vendored
30
po/.gitignore
vendored
@@ -1,15 +1,31 @@
|
||||
# autopoint
|
||||
Makefile.in.in
|
||||
Makevars.template
|
||||
Rules-quot
|
||||
boldquot.sed
|
||||
en@boldquot.header
|
||||
en@quot.header
|
||||
insert-header.sin
|
||||
Makefile
|
||||
Makefile.in
|
||||
Makefile.in.in
|
||||
Makevars.template
|
||||
POTFILES
|
||||
quot.sed
|
||||
remove-potcdate.sed
|
||||
remove-potcdate.sin
|
||||
Rules-quot
|
||||
|
||||
# configure
|
||||
Makefile.in
|
||||
Makefile
|
||||
POTFILES
|
||||
|
||||
# intermediate files (make)
|
||||
stamp-poT
|
||||
xz.po
|
||||
xz.1po
|
||||
xz.2po
|
||||
*.new.po
|
||||
|
||||
# make
|
||||
remove-potcdate.sed
|
||||
xz.mo
|
||||
stamp-po
|
||||
*.gmo
|
||||
|
||||
# cached templates (make)
|
||||
xz.pot
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
cs
|
||||
de
|
||||
fr
|
||||
it
|
||||
pl
|
||||
vi
|
||||
|
||||
@@ -3,8 +3,11 @@ src/xz/args.c
|
||||
src/xz/coder.c
|
||||
src/xz/file_io.c
|
||||
src/xz/hardware.c
|
||||
src/xz/list.c
|
||||
src/xz/main.c
|
||||
src/xz/message.c
|
||||
src/xz/options.c
|
||||
src/xz/signals.c
|
||||
src/xz/suffix.c
|
||||
src/xz/util.c
|
||||
src/common/tuklib_exit.c
|
||||
|
||||
949
po/cs.po
Normal file
949
po/cs.po
Normal file
@@ -0,0 +1,949 @@
|
||||
# XZ Utils Czech translation
|
||||
# This file is put in the public domain.
|
||||
# Marek Černocký <marek@manet.cz>, 2010.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: xz-utils\n"
|
||||
"Report-Msgid-Bugs-To: lasse.collin@tukaani.org\n"
|
||||
"POT-Creation-Date: 2010-12-03 11:25+0100\n"
|
||||
"PO-Revision-Date: 2010-12-03 11:32+0100\n"
|
||||
"Last-Translator: Marek Černocký <marek@manet.cz>\n"
|
||||
"Language-Team: Czech <diskuze@lists.l10n.cz>\n"
|
||||
"Language: cs\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2\n"
|
||||
"X-Poedit-Language: Czech\n"
|
||||
"X-Poedit-SourceCharset: utf-8\n"
|
||||
|
||||
#: src/xz/args.c:333
|
||||
#, c-format
|
||||
msgid "%s: Unknown file format type"
|
||||
msgstr "%s: Neznámý typ formátu souboru"
|
||||
|
||||
#: src/xz/args.c:356 src/xz/args.c:364
|
||||
#, c-format
|
||||
msgid "%s: Unsupported integrity check type"
|
||||
msgstr "%s: Neznámý typ kontroly integrity"
|
||||
|
||||
#: src/xz/args.c:382
|
||||
msgid "Only one file can be specified with `--files' or `--files0'."
|
||||
msgstr ""
|
||||
"Spolu s přepínači „--files“ nebo „--files0“ může být zadán pouze jeden soubor"
|
||||
|
||||
#: src/xz/args.c:445
|
||||
#, c-format
|
||||
msgid "The environment variable %s contains too many arguments"
|
||||
msgstr "Proměnná prostředí %s obsahuje příliš mnoho argumentů"
|
||||
|
||||
#: src/xz/coder.c:95
|
||||
msgid "Maximum number of filters is four"
|
||||
msgstr "Maximální počet filtrů je čtyři"
|
||||
|
||||
#: src/xz/coder.c:108
|
||||
msgid "Memory usage limit is too low for the given filter setup."
|
||||
msgstr "Omezení použitelné paměti je příliš malé pro dané nastavení filtru."
|
||||
|
||||
#: src/xz/coder.c:129
|
||||
msgid "Using a preset in raw mode is discouraged."
|
||||
msgstr "Použití přednastavení v režimu raw je nevhodné."
|
||||
|
||||
#: src/xz/coder.c:131
|
||||
msgid "The exact options of the presets may vary between software versions."
|
||||
msgstr ""
|
||||
"Přesné volby u přednastavení se mohou lišit mezi různými verzemi softwaru."
|
||||
|
||||
#: src/xz/coder.c:157
|
||||
msgid "The .lzma format supports only the LZMA1 filter"
|
||||
msgstr "Formát .lzma podporuje pouze filtr LZMA1"
|
||||
|
||||
#: src/xz/coder.c:165
|
||||
msgid "LZMA1 cannot be used with the .xz format"
|
||||
msgstr "LZMA1 nelze použít s formátem .xz"
|
||||
|
||||
#: src/xz/coder.c:182
|
||||
msgid "Unsupported filter chain or filter options"
|
||||
msgstr "Nepodporovaný omezující filtr nebo volby filtru"
|
||||
|
||||
#: src/xz/coder.c:190
|
||||
#, c-format
|
||||
msgid "Decompression will need %s MiB of memory."
|
||||
msgstr "Dekomprimace bude vyžadovat %s MiB paměti."
|
||||
|
||||
#: src/xz/coder.c:247
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the "
|
||||
"memory usage limit of %s MiB"
|
||||
msgstr ""
|
||||
"Přizpůsobit velikost slovníku LZMA%c z %s MiB na %s MiB, tak aby nebylo "
|
||||
"překročeno omezení použitelné paměti %s MiB"
|
||||
|
||||
#. TRANSLATORS: When compression or decompression finishes,
|
||||
#. and xz is going to remove the source file, xz first checks
|
||||
#. if the source file still exists, and if it does, does its
|
||||
#. device and inode numbers match what xz saw when it opened
|
||||
#. the source file. If these checks fail, this message is
|
||||
#. shown, %s being the filename, and the file is not deleted.
|
||||
#. The check for device and inode numbers is there, because
|
||||
#. it is possible that the user has put a new file in place
|
||||
#. of the original file, and in that case it obviously
|
||||
#. shouldn't be removed.
|
||||
#: src/xz/file_io.c:137
|
||||
#, c-format
|
||||
msgid "%s: File seems to have been moved, not removing"
|
||||
msgstr "%s: Vypadá to, že soubor byl přesunut, proto nebude odstraněn"
|
||||
|
||||
#: src/xz/file_io.c:144 src/xz/file_io.c:590
|
||||
#, c-format
|
||||
msgid "%s: Cannot remove: %s"
|
||||
msgstr "%s: Nelze odstranit: %s"
|
||||
|
||||
#: src/xz/file_io.c:169
|
||||
#, c-format
|
||||
msgid "%s: Cannot set the file owner: %s"
|
||||
msgstr "%s: Nelze nastavit vlastníka souboru: %s"
|
||||
|
||||
#: src/xz/file_io.c:175
|
||||
#, c-format
|
||||
msgid "%s: Cannot set the file group: %s"
|
||||
msgstr "%s: Nelze nastavit skupinu souboru: %s"
|
||||
|
||||
#: src/xz/file_io.c:194
|
||||
#, c-format
|
||||
msgid "%s: Cannot set the file permissions: %s"
|
||||
msgstr "%s: Nelze nastavit oprávnění souboru: %s"
|
||||
|
||||
#: src/xz/file_io.c:337 src/xz/file_io.c:420
|
||||
#, c-format
|
||||
msgid "%s: Is a symbolic link, skipping"
|
||||
msgstr "%s: Jedná se o symbolický odkaz, vynechává se"
|
||||
|
||||
#: src/xz/file_io.c:455
|
||||
#, c-format
|
||||
msgid "%s: Is a directory, skipping"
|
||||
msgstr "%s: Jedná se o složku, vynechává se"
|
||||
|
||||
#: src/xz/file_io.c:462
|
||||
#, c-format
|
||||
msgid "%s: Not a regular file, skipping"
|
||||
msgstr "%s: Nejedná se o běžný soubor, vynechává se"
|
||||
|
||||
#: src/xz/file_io.c:479
|
||||
#, c-format
|
||||
msgid "%s: File has setuid or setgid bit set, skipping"
|
||||
msgstr "%s: Soubor má nastavený bit setuid nebo setgid, vynechává se"
|
||||
|
||||
#: src/xz/file_io.c:486
|
||||
#, c-format
|
||||
msgid "%s: File has sticky bit set, skipping"
|
||||
msgstr "%s: Soubor má nastavený bit sticky, vynechává se"
|
||||
|
||||
#: src/xz/file_io.c:493
|
||||
#, c-format
|
||||
msgid "%s: Input file has more than one hard link, skipping"
|
||||
msgstr "%s: Vstupní soubor má více než jeden pevný odkaz, vynechává se"
|
||||
|
||||
#: src/xz/file_io.c:714
|
||||
#, c-format
|
||||
msgid "Error restoring the O_APPEND flag to standard output: %s"
|
||||
msgstr "Chyba při obnovení příznaku O_APPEND na standardní výstup: %s"
|
||||
|
||||
#: src/xz/file_io.c:726
|
||||
#, c-format
|
||||
msgid "%s: Closing the file failed: %s"
|
||||
msgstr "%s: Selhalo zavření souboru: %s"
|
||||
|
||||
#: src/xz/file_io.c:762 src/xz/file_io.c:946
|
||||
#, c-format
|
||||
msgid "%s: Seeking failed when trying to create a sparse file: %s"
|
||||
msgstr ""
|
||||
"%s: Selhalo nastavení pozice při pokusu o vytvoření souboru řídké matice: %s"
|
||||
|
||||
#: src/xz/file_io.c:821
|
||||
#, c-format
|
||||
msgid "%s: Read error: %s"
|
||||
msgstr "%s: Chyba čtení: %s"
|
||||
|
||||
#: src/xz/file_io.c:844
|
||||
#, c-format
|
||||
msgid "%s: Error seeking the file: %s"
|
||||
msgstr "%s: Chyba při posunu v rámci souboru: %s"
|
||||
|
||||
#: src/xz/file_io.c:854
|
||||
#, c-format
|
||||
msgid "%s: Unexpected end of file"
|
||||
msgstr "%s: Neočekávaný konec souboru"
|
||||
|
||||
#: src/xz/file_io.c:904
|
||||
#, c-format
|
||||
msgid "%s: Write error: %s"
|
||||
msgstr "%s: Chyba zápisu: %s"
|
||||
|
||||
#: src/xz/hardware.c:100
|
||||
msgid "Disabled"
|
||||
msgstr "Vypnuto"
|
||||
|
||||
#. TRANSLATORS: Test with "xz --info-memory" to see if
|
||||
#. the alignment looks nice.
|
||||
#: src/xz/hardware.c:119
|
||||
msgid "Total amount of physical memory (RAM): "
|
||||
msgstr "Celkové množství fyzické paměti (RAM): "
|
||||
|
||||
#: src/xz/hardware.c:121
|
||||
msgid "Memory usage limit for compression: "
|
||||
msgstr "Omezení použitelné paměti pro komprimaci: "
|
||||
|
||||
#: src/xz/hardware.c:123
|
||||
msgid "Memory usage limit for decompression: "
|
||||
msgstr "Omezení použitelné paměti pro dekomprimaci:"
|
||||
|
||||
#. TRANSLATORS: Indicates that there is no integrity check.
|
||||
#. This string is used in tables, so the width must not
|
||||
#. exceed ten columns with a fixed-width font.
|
||||
#: src/xz/list.c:62
|
||||
msgid "None"
|
||||
msgstr "žádná"
|
||||
|
||||
#. TRANSLATORS: Indicates that integrity check name is not known,
|
||||
#. but the Check ID is known (here 2). This and other "Unknown-N"
|
||||
#. strings are used in tables, so the width must not exceed ten
|
||||
#. columns with a fixed-width font. It's OK to omit the dash if
|
||||
#. you need space for one extra letter, but don't use spaces.
|
||||
#: src/xz/list.c:69
|
||||
msgid "Unknown-2"
|
||||
msgstr "neznámá-2"
|
||||
|
||||
#: src/xz/list.c:70
|
||||
msgid "Unknown-3"
|
||||
msgstr "neznámá-3"
|
||||
|
||||
#: src/xz/list.c:72
|
||||
msgid "Unknown-5"
|
||||
msgstr "neznámá-5"
|
||||
|
||||
#: src/xz/list.c:73
|
||||
msgid "Unknown-6"
|
||||
msgstr "neznámá-6"
|
||||
|
||||
#: src/xz/list.c:74
|
||||
msgid "Unknown-7"
|
||||
msgstr "neznámá-7"
|
||||
|
||||
#: src/xz/list.c:75
|
||||
msgid "Unknown-8"
|
||||
msgstr "neznámá-8"
|
||||
|
||||
#: src/xz/list.c:76
|
||||
msgid "Unknown-9"
|
||||
msgstr "neznámá-9"
|
||||
|
||||
#: src/xz/list.c:78
|
||||
msgid "Unknown-11"
|
||||
msgstr "neznámá-11"
|
||||
|
||||
#: src/xz/list.c:79
|
||||
msgid "Unknown-12"
|
||||
msgstr "neznámá-12"
|
||||
|
||||
#: src/xz/list.c:80
|
||||
msgid "Unknown-13"
|
||||
msgstr "neznámá-13"
|
||||
|
||||
#: src/xz/list.c:81
|
||||
msgid "Unknown-14"
|
||||
msgstr "neznámá-14"
|
||||
|
||||
#: src/xz/list.c:82
|
||||
msgid "Unknown-15"
|
||||
msgstr "neznámá-15"
|
||||
|
||||
#: src/xz/list.c:126
|
||||
#, c-format
|
||||
msgid "%s: File is empty"
|
||||
msgstr "%s: Soubor je prázdný"
|
||||
|
||||
#: src/xz/list.c:131
|
||||
#, c-format
|
||||
msgid "%s: Too small to be a valid .xz file"
|
||||
msgstr "%s: Je příliš malý na to, aby to mohl být platný soubor .xz"
|
||||
|
||||
#. TRANSLATORS: These are column headings. From Strms (Streams)
|
||||
#. to Ratio, the columns are right aligned. Check and Filename
|
||||
#. are left aligned. If you need longer words, it's OK to
|
||||
#. use two lines here. Test with "xz -l foo.xz".
|
||||
#: src/xz/list.c:612
|
||||
msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename"
|
||||
msgstr "Proud Bloky Komprim Nekomprim Poměr Kontrl Název souboru"
|
||||
|
||||
#: src/xz/list.c:652
|
||||
#, c-format
|
||||
msgid " Streams: %s\n"
|
||||
msgstr " Proudů: %s\n"
|
||||
|
||||
#: src/xz/list.c:654
|
||||
#, c-format
|
||||
msgid " Blocks: %s\n"
|
||||
msgstr " Bloků: %s\n"
|
||||
|
||||
#: src/xz/list.c:656
|
||||
#, c-format
|
||||
msgid " Compressed size: %s\n"
|
||||
msgstr " Komprimovaná velikost: %s\n"
|
||||
|
||||
#: src/xz/list.c:659
|
||||
#, c-format
|
||||
msgid " Uncompressed size: %s\n"
|
||||
msgstr " Nekomprimovaná velikost: %s\n"
|
||||
|
||||
#: src/xz/list.c:662
|
||||
#, c-format
|
||||
msgid " Ratio: %s\n"
|
||||
msgstr " Poměr komprimace: %s\n"
|
||||
|
||||
#: src/xz/list.c:664
|
||||
#, c-format
|
||||
msgid " Check: %s\n"
|
||||
msgstr " Typ kontroly: %s\n"
|
||||
|
||||
#: src/xz/list.c:665
|
||||
#, c-format
|
||||
msgid " Stream padding: %s\n"
|
||||
msgstr " Zarovnání proudu: %s\n"
|
||||
|
||||
#. TRANSLATORS: The second line is column headings. All except
|
||||
#. Check are right aligned; Check is left aligned. Test with
|
||||
#. "xz -lv foo.xz".
|
||||
#: src/xz/list.c:693
|
||||
msgid ""
|
||||
" Streams:\n"
|
||||
" Stream Blocks CompOffset UncompOffset CompSize "
|
||||
"UncompSize Ratio Check Padding"
|
||||
msgstr ""
|
||||
" Proudy:\n"
|
||||
" Proud Bloky KomprPozice NekomprPozice KomprVelikost "
|
||||
"NekomprVelikost Poměr Kontrola Zarovnání"
|
||||
|
||||
#. TRANSLATORS: The second line is column headings. All
|
||||
#. except Check are right aligned; Check is left aligned.
|
||||
#: src/xz/list.c:748
|
||||
#, c-format
|
||||
msgid ""
|
||||
" Blocks:\n"
|
||||
" Stream Block CompOffset UncompOffset TotalSize "
|
||||
"UncompSize Ratio Check"
|
||||
msgstr ""
|
||||
" Bloky:\n"
|
||||
" Proud Blok KomprPozice NekomprPozice CelkVelikost "
|
||||
"NekomprVelikost Poměr Kontrola"
|
||||
|
||||
#. TRANSLATORS: These are additional column headings
|
||||
#. for the most verbose listing mode. CheckVal
|
||||
#. (Check value), Flags, and Filters are left aligned.
|
||||
#. Header (Block Header Size), CompSize, and MemUsage
|
||||
#. are right aligned. %*s is replaced with 0-120
|
||||
#. spaces to make the CheckVal column wide enough.
|
||||
#. Test with "xz -lvv foo.xz".
|
||||
#: src/xz/list.c:760
|
||||
#, c-format
|
||||
msgid " CheckVal %*s Header Flags CompSize MemUsage Filters"
|
||||
msgstr " KontrHod %*s Hlavič Příznaky KomprVel PoužiPam Filtry"
|
||||
|
||||
#: src/xz/list.c:838 src/xz/list.c:1007
|
||||
#, c-format
|
||||
msgid " Memory needed: %s MiB\n"
|
||||
msgstr " Potřebná paměť: %s MiB\n"
|
||||
|
||||
#: src/xz/list.c:840 src/xz/list.c:1009
|
||||
#, c-format
|
||||
msgid " Sizes in headers: %s\n"
|
||||
msgstr " Velikosti v hlavičkách: %s\n"
|
||||
|
||||
#: src/xz/list.c:841 src/xz/list.c:1010
|
||||
msgid "Yes"
|
||||
msgstr "Ano"
|
||||
|
||||
#: src/xz/list.c:841 src/xz/list.c:1010
|
||||
msgid "No"
|
||||
msgstr "Ne"
|
||||
|
||||
#. TRANSLATORS: %s is an integer. Only the plural form of this
|
||||
#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz".
|
||||
#: src/xz/list.c:986
|
||||
#, c-format
|
||||
msgid "%s file\n"
|
||||
msgid_plural "%s files\n"
|
||||
msgstr[0] "%s soubor\n"
|
||||
msgstr[1] "%s soubory\n"
|
||||
msgstr[2] "%s souborů\n"
|
||||
|
||||
#: src/xz/list.c:999
|
||||
msgid "Totals:"
|
||||
msgstr "Celkem:"
|
||||
|
||||
#: src/xz/list.c:1000
|
||||
#, c-format
|
||||
msgid " Number of files: %s\n"
|
||||
msgstr " Počet souborů: %s\n"
|
||||
|
||||
#: src/xz/list.c:1072
|
||||
msgid "--list works only on .xz files (--format=xz or --format=auto)"
|
||||
msgstr "--list pracuje pouze se soubory .xz (--format=xz nebo --format=auto)"
|
||||
|
||||
#: src/xz/list.c:1078
|
||||
msgid "--list does not support reading from standard input"
|
||||
msgstr "--list nepodporuje čtení ze standardního vstupu"
|
||||
|
||||
#: src/xz/main.c:89
|
||||
#, c-format
|
||||
msgid "%s: Error reading filenames: %s"
|
||||
msgstr "%s: Chyba při čtení názvů souborů: %s"
|
||||
|
||||
#: src/xz/main.c:96
|
||||
#, c-format
|
||||
msgid "%s: Unexpected end of input when reading filenames"
|
||||
msgstr "%s: Neočekávaný konec vstupu při čtení názvů souborů"
|
||||
|
||||
#: src/xz/main.c:120
|
||||
#, c-format
|
||||
msgid ""
|
||||
"%s: Null character found when reading filenames; maybe you meant to use `--"
|
||||
"files0' instead of `--files'?"
|
||||
msgstr ""
|
||||
"%s: Byl nalezen nulový znak při čtení názvů souborů; nechtěli jste náhodou "
|
||||
"použít „--files0“ místo „--files“?"
|
||||
|
||||
#: src/xz/main.c:174
|
||||
msgid "Compression and decompression with --robot are not supported yet."
|
||||
msgstr "Komprimace a dekomprimace s přepínačem --robot není zatím podporovaná."
|
||||
|
||||
#: src/xz/main.c:231
|
||||
msgid ""
|
||||
"Cannot read data from standard input when reading filenames from standard "
|
||||
"input"
|
||||
msgstr ""
|
||||
"Ze standardního vstupu nelze číst data, když se ze standardního vstupu "
|
||||
"načítají názvy souborů"
|
||||
|
||||
#: src/xz/message.c:792 src/xz/message.c:842
|
||||
msgid "Internal error (bug)"
|
||||
msgstr "Interní chyba"
|
||||
|
||||
#: src/xz/message.c:799
|
||||
msgid "Cannot establish signal handlers"
|
||||
msgstr "Nelze ustanovit ovladač signálu"
|
||||
|
||||
#: src/xz/message.c:808
|
||||
msgid "No integrity check; not verifying file integrity"
|
||||
msgstr "Žádná kontrola integrity; integrita souboru se nebude ověřovat"
|
||||
|
||||
#: src/xz/message.c:811
|
||||
msgid "Unsupported type of integrity check; not verifying file integrity"
|
||||
msgstr ""
|
||||
"Nepodporovaný typ kontroly integrity; integrita souboru se nebude ověřovat"
|
||||
|
||||
#: src/xz/message.c:818
|
||||
msgid "Memory usage limit reached"
|
||||
msgstr "Dosaženo omezení použitelné paměti"
|
||||
|
||||
#: src/xz/message.c:821
|
||||
msgid "File format not recognized"
|
||||
msgstr "Formát souboru nebyl rozpoznán"
|
||||
|
||||
#: src/xz/message.c:824
|
||||
msgid "Unsupported options"
|
||||
msgstr "Nepodporovaná volba"
|
||||
|
||||
#: src/xz/message.c:827
|
||||
msgid "Compressed data is corrupt"
|
||||
msgstr "Komprimovaná data jsou poškozená"
|
||||
|
||||
#: src/xz/message.c:830
|
||||
msgid "Unexpected end of input"
|
||||
msgstr "Neočekávaný konec vstupu"
|
||||
|
||||
#: src/xz/message.c:881
|
||||
#, c-format
|
||||
msgid "%s MiB of memory is required. The limit is %s."
|
||||
msgstr "Je vyžadováno %s MiB paměti. Limit je %s."
|
||||
|
||||
#: src/xz/message.c:1048
|
||||
#, c-format
|
||||
msgid "%s: Filter chain: %s\n"
|
||||
msgstr "%s: Omezující filtr: %s\n"
|
||||
|
||||
#: src/xz/message.c:1058
|
||||
#, c-format
|
||||
msgid "Try `%s --help' for more information."
|
||||
msgstr "Zkuste „%s --help“ pro více informací"
|
||||
|
||||
#: src/xz/message.c:1084
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Usage: %s [OPTION]... [FILE]...\n"
|
||||
"Compress or decompress FILEs in the .xz format.\n"
|
||||
"\n"
|
||||
msgstr ""
|
||||
"Použití: %s [PŘEPÍNAČ]... [SOUBOR]...\n"
|
||||
"Komprimuje nebo dekomprimuje SOUBORy ve formátu xz.\n"
|
||||
"\n"
|
||||
|
||||
#: src/xz/message.c:1091
|
||||
msgid ""
|
||||
"Mandatory arguments to long options are mandatory for short options too.\n"
|
||||
msgstr ""
|
||||
"Povinné argumenty pro dlouhé přepínače jsou povinné rovněž pro krátké "
|
||||
"přepínače.\n"
|
||||
|
||||
#: src/xz/message.c:1095
|
||||
msgid " Operation mode:\n"
|
||||
msgstr "Operační režim:\n"
|
||||
|
||||
#: src/xz/message.c:1098
|
||||
msgid ""
|
||||
" -z, --compress force compression\n"
|
||||
" -d, --decompress force decompression\n"
|
||||
" -t, --test test compressed file integrity\n"
|
||||
" -l, --list list information about .xz files"
|
||||
msgstr ""
|
||||
" -z, --compress provést komprimaci\n"
|
||||
" -d, --decompress provést dekomprimaci\n"
|
||||
" -t, --test testovat integritu komprimovaného souboru\n"
|
||||
" -l, --list vypsat informace o souborech .xz"
|
||||
|
||||
#: src/xz/message.c:1104
|
||||
msgid ""
|
||||
"\n"
|
||||
" Operation modifiers:\n"
|
||||
msgstr ""
|
||||
"\n"
|
||||
"Modifikátory operací:\n"
|
||||
|
||||
#: src/xz/message.c:1107
|
||||
msgid ""
|
||||
" -k, --keep keep (don't delete) input files\n"
|
||||
" -f, --force force overwrite of output file and (de)compress links\n"
|
||||
" -c, --stdout write to standard output and don't delete input files"
|
||||
msgstr ""
|
||||
" -k, --keep zachovat (nemazat) vstupní soubory\n"
|
||||
" -f, --force vynutit přepis výstupního souboru a de/komprimovat "
|
||||
"odkazy\n"
|
||||
" -c, --stdout zapisovat na standardní výstup a nemazat vstupní "
|
||||
"soubory"
|
||||
|
||||
#: src/xz/message.c:1113
|
||||
msgid ""
|
||||
" --no-sparse do not create sparse files when decompressing\n"
|
||||
" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n"
|
||||
" --files[=FILE] read filenames to process from FILE; if FILE is\n"
|
||||
" omitted, filenames are read from the standard input;\n"
|
||||
" filenames must be terminated with the newline "
|
||||
"character\n"
|
||||
" --files0[=FILE] like --files but use the null character as terminator"
|
||||
msgstr ""
|
||||
" --no-sparse nevytvářet při dekomprimaci soubory řídkých matic\n"
|
||||
" -S, --suffix=.PRIP použít u komprimovaných souborů příponu „.PRIP“\n"
|
||||
" --files[=SOUBOR] číst názvy souborů, které se mají zpracovat, ze "
|
||||
"SOUBORu;\n"
|
||||
" pokud není SOUBOR zadán, čte se ze standardního "
|
||||
"vstupu;\n"
|
||||
" názvy souborů musí být zakončeny znakem nového řádku\n"
|
||||
" --files0[=SOUBOR] stejné jako --files, ale použít k zakončování nulový "
|
||||
"znak"
|
||||
|
||||
#: src/xz/message.c:1121
|
||||
msgid ""
|
||||
"\n"
|
||||
" Basic file format and compression options:\n"
|
||||
msgstr ""
|
||||
"\n"
|
||||
"Základní přepínače pro formát souboru a komprimaci:\n"
|
||||
|
||||
#: src/xz/message.c:1123
|
||||
msgid ""
|
||||
" -F, --format=FMT file format to encode or decode; possible values are\n"
|
||||
" `auto' (default), `xz', `lzma', and `raw'\n"
|
||||
" -C, --check=CHECK integrity check type: `none' (use with caution),\n"
|
||||
" `crc32', `crc64' (default), or `sha256'"
|
||||
msgstr ""
|
||||
" -F, --format=FORMÁT formát souboru k zakódování nebo dekódování; možné\n"
|
||||
" hodnoty jsou „auto“ (výchozí), „xz“, „lzma“ a „raw“\n"
|
||||
" -C, --check=KONTROLA typ kontroly integrity: „none“ (používejte s "
|
||||
"rozmyslem),\n"
|
||||
" „crc32“, „crc64“ (výchozí) nebo „sha256“"
|
||||
|
||||
#: src/xz/message.c:1130
|
||||
msgid ""
|
||||
" -0 ... -9 compression preset; default is 6; take compressor "
|
||||
"*and*\n"
|
||||
" decompressor memory usage into account before using "
|
||||
"7-9!"
|
||||
msgstr ""
|
||||
" -0 .. -9 přednastavení komprimace; výchozí je 6; než "
|
||||
"použijete\n"
|
||||
" hodnoty 7 – 9, vezměte do úvahy množství použité "
|
||||
"paměti"
|
||||
|
||||
#: src/xz/message.c:1134
|
||||
msgid ""
|
||||
" -e, --extreme try to improve compression ratio by using more CPU "
|
||||
"time;\n"
|
||||
" does not affect decompressor memory requirements"
|
||||
msgstr ""
|
||||
" -e, --extreme zkusit zlepšit poměr komprimace využitím více času\n"
|
||||
" procesoru; nemá vliv na paměťové nároky dekomprimace"
|
||||
|
||||
#: src/xz/message.c:1139
|
||||
#, no-c-format
|
||||
msgid ""
|
||||
" --memlimit-compress=LIMIT\n"
|
||||
" --memlimit-decompress=LIMIT\n"
|
||||
" -M, --memlimit=LIMIT\n"
|
||||
" set memory usage limit for compression, "
|
||||
"decompression,\n"
|
||||
" or both; LIMIT is in bytes, % of RAM, or 0 for defaults"
|
||||
msgstr ""
|
||||
" --memlimit-compress=LIMIT\n"
|
||||
" --memlimit-decompress=LIMIT\n"
|
||||
" -M, --memlimit=LIMIT\n"
|
||||
" nastaví omezení použitelné paměti pro komprimaci,\n"
|
||||
" dekomprimaci nebo obojí; LIMIT je v bajtech, % z "
|
||||
"paměti\n"
|
||||
" RAM nebo 0 pro výchozí"
|
||||
|
||||
#: src/xz/message.c:1146
|
||||
msgid ""
|
||||
" --no-adjust if compression settings exceed the memory usage "
|
||||
"limit,\n"
|
||||
" give an error instead of adjusting the settings "
|
||||
"downwards"
|
||||
msgstr ""
|
||||
" --no-adjust pokud nastavení komprimace přesáhne omezení "
|
||||
"použitelné\n"
|
||||
" paměti, předat chybu namísto snížení nastavení"
|
||||
|
||||
#: src/xz/message.c:1152
|
||||
msgid ""
|
||||
"\n"
|
||||
" Custom filter chain for compression (alternative for using presets):"
|
||||
msgstr ""
|
||||
"\n"
|
||||
"Vlastní omezující filtr pro komprimaci (alternativa k použití "
|
||||
"přednastavených):"
|
||||
|
||||
#: src/xz/message.c:1161
|
||||
msgid ""
|
||||
"\n"
|
||||
" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero "
|
||||
"or\n"
|
||||
" --lzma2[=OPTS] more of the following options (valid values; "
|
||||
"default):\n"
|
||||
" preset=PRE reset options to a preset (0-9[e])\n"
|
||||
" dict=NUM dictionary size (4KiB - 1536MiB; 8MiB)\n"
|
||||
" lc=NUM number of literal context bits (0-4; 3)\n"
|
||||
" lp=NUM number of literal position bits (0-4; 0)\n"
|
||||
" pb=NUM number of position bits (0-4; 2)\n"
|
||||
" mode=MODE compression mode (fast, normal; normal)\n"
|
||||
" nice=NUM nice length of a match (2-273; 64)\n"
|
||||
" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; "
|
||||
"bt4)\n"
|
||||
" depth=NUM maximum search depth; 0=automatic "
|
||||
"(default)"
|
||||
msgstr ""
|
||||
"\n"
|
||||
" --lzma1[=VOLBY] LZMA1 nebo LZMA2; VOLBY je čárkou oddělovaný seznam "
|
||||
"žádné\n"
|
||||
" --lzma2[=VOLBY] nebo více následujících voleb (platné hodnoty; "
|
||||
"výchozí):\n"
|
||||
" preset=PŘE změnit volby na PŘEdnastavené (0 – 9"
|
||||
"[e])\n"
|
||||
" dict=POČ velikost slovníku (4 KiB – 1536 MiB; 8 "
|
||||
"MiB)\n"
|
||||
" lc=POČ počet kontextových bitů literálu (0 – 4; "
|
||||
"3)\n"
|
||||
" lp=POČ počet pozičních bitů literálu (0 – 4; "
|
||||
"0)\n"
|
||||
" pb=POČ počet pozičních bitů (0 – 4; 2)\n"
|
||||
" mode=REŽIM režim komprimace (fast, normal; normal)\n"
|
||||
" nice=NUM příznivá délka shody (2 – 273; 64)\n"
|
||||
" mf=NÁZEV hledání shod (hc3, hc4, bt2, bt3, bt4; "
|
||||
"bt4)\n"
|
||||
" depth=POČ maximální hloubka prohledávání;\n"
|
||||
" 0 = automaticky (výchozí)"
|
||||
|
||||
#: src/xz/message.c:1176
|
||||
msgid ""
|
||||
"\n"
|
||||
" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n"
|
||||
" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n"
|
||||
" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n"
|
||||
" --arm[=OPTS] ARM BCJ filter (little endian only)\n"
|
||||
" --armthumb[=OPTS] ARM-Thumb BCJ filter (little endian only)\n"
|
||||
" --sparc[=OPTS] SPARC BCJ filter\n"
|
||||
" Valid OPTS for all BCJ filters:\n"
|
||||
" start=NUM start offset for conversions (default=0)"
|
||||
msgstr ""
|
||||
"\n"
|
||||
" --x86[=VOLBY] Filtr x86 BCJ (32bitový a 64bitový)\n"
|
||||
" --powerpc[=VOLBY] Filtr PowerPC BCJ (pouze big endian)\n"
|
||||
" --ia64[=VOLBY] Filtr IA64 (Itanium) BCJ\n"
|
||||
" --arm[=VOLBY] Filtr ARM BCJ (pouze little endian)\n"
|
||||
" --armthumb[=VOLBY] Filtr ARM-Thumb BCJ (pouze little endian)\n"
|
||||
" --sparc[=VOLBY] Filtr SPARC BCJ\n"
|
||||
" Platné volby pro všechny filtry BCJ:\n"
|
||||
" start=POČ počáteční posun pro převody (výchozí=0)"
|
||||
|
||||
#: src/xz/message.c:1188
|
||||
msgid ""
|
||||
"\n"
|
||||
" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n"
|
||||
" dist=NUM distance between bytes being subtracted\n"
|
||||
" from each other (1-256; 1)"
|
||||
msgstr ""
|
||||
"\n"
|
||||
" --delta[=VOLBY] Filtr Delta; platné VOLBY (platné hodnoty; výchozí):\n"
|
||||
" dist=POČ vzdálenost mezi bajty, které jsou "
|
||||
"odečítány\n"
|
||||
" jeden od druhého (1 – 256; 1)"
|
||||
|
||||
#: src/xz/message.c:1196
|
||||
msgid ""
|
||||
"\n"
|
||||
" Other options:\n"
|
||||
msgstr ""
|
||||
"\n"
|
||||
" Ostatní přepínače:\n"
|
||||
|
||||
#: src/xz/message.c:1199
|
||||
msgid ""
|
||||
" -q, --quiet suppress warnings; specify twice to suppress errors "
|
||||
"too\n"
|
||||
" -v, --verbose be verbose; specify twice for even more verbose"
|
||||
msgstr ""
|
||||
" -q, --quiet potlačit varování; zadáním dvakrát, potlačíte i "
|
||||
"chyby\n"
|
||||
" -v, --verbose podrobnější zprávy; zadáním dvakrát, budou ještě\n"
|
||||
" podrobnější"
|
||||
|
||||
#: src/xz/message.c:1204
|
||||
msgid " -Q, --no-warn make warnings not affect the exit status"
|
||||
msgstr " -Q, --no-warn způsobí, že varování neovlivní stav ukončení"
|
||||
|
||||
#: src/xz/message.c:1206
|
||||
msgid ""
|
||||
" --robot use machine-parsable messages (useful for scripts)"
|
||||
msgstr ""
|
||||
" --robot použít strojově analyzovatelné zprávy (užitečné pro\n"
|
||||
" skripty)"
|
||||
|
||||
#: src/xz/message.c:1209
|
||||
msgid ""
|
||||
" --info-memory display the total amount of RAM and the currently "
|
||||
"active\n"
|
||||
" memory usage limits, and exit"
|
||||
msgstr ""
|
||||
" --info-memory zobrazit celkové množství paměti RAM a současné "
|
||||
"aktivní\n"
|
||||
" omezení použitelné paměti a skončit"
|
||||
|
||||
#: src/xz/message.c:1212
|
||||
msgid ""
|
||||
" -h, --help display the short help (lists only the basic options)\n"
|
||||
" -H, --long-help display this long help and exit"
|
||||
msgstr ""
|
||||
" -h, --help zobrazit krátkou nápovědu (vypíše jen základní "
|
||||
"přepínače)\n"
|
||||
" -H, --long-help zobrazit tuto úplnou nápovědu a skončit"
|
||||
|
||||
#: src/xz/message.c:1216
|
||||
msgid ""
|
||||
" -h, --help display this short help and exit\n"
|
||||
" -H, --long-help display the long help (lists also the advanced options)"
|
||||
msgstr ""
|
||||
" -h, --help zobrazit tuto zkrácenou nápovědu a skončit\n"
|
||||
" -H, --long-help zobrazit úplnou nápovědu (vypíše i pokročilé "
|
||||
"přepínače)"
|
||||
|
||||
#: src/xz/message.c:1221
|
||||
msgid " -V, --version display the version number and exit"
|
||||
msgstr " -V, --version zobrazit číslo verze a skončit"
|
||||
|
||||
#: src/xz/message.c:1223
|
||||
msgid ""
|
||||
"\n"
|
||||
"With no FILE, or when FILE is -, read standard input.\n"
|
||||
msgstr ""
|
||||
"\n"
|
||||
"Pokud SOUBOR není zadán nebo pokud je -, bude se číst ze standardního "
|
||||
"vstupu.\n"
|
||||
|
||||
#. TRANSLATORS: This message indicates the bug reporting address
|
||||
#. for this package. Please add _another line_ saying
|
||||
#. "Report translation bugs to <...>\n" with the email or WWW
|
||||
#. address for translation bugs. Thanks.
|
||||
#: src/xz/message.c:1229
|
||||
#, c-format
|
||||
msgid "Report bugs to <%s> (in English or Finnish).\n"
|
||||
msgstr "Chyby hlaste na <%s> (v angličtině nebo finštině).\n"
|
||||
|
||||
#: src/xz/message.c:1231
|
||||
#, c-format
|
||||
msgid "%s home page: <%s>\n"
|
||||
msgstr "Domovská stránka %s: <%s>\n"
|
||||
|
||||
#: src/xz/options.c:86
|
||||
#, c-format
|
||||
msgid "%s: Options must be `name=value' pairs separated with commas"
|
||||
msgstr "%s: Volby musí být páry „název=hodnota“ oddělené čárkami"
|
||||
|
||||
#: src/xz/options.c:93
|
||||
#, c-format
|
||||
msgid "%s: Invalid option name"
|
||||
msgstr "%s: Neplatný název volby"
|
||||
|
||||
#: src/xz/options.c:113
|
||||
#, c-format
|
||||
msgid "%s: Invalid option value"
|
||||
msgstr "%s: Neplatná hodnota volby"
|
||||
|
||||
#: src/xz/options.c:247
|
||||
#, c-format
|
||||
msgid "Unsupported LZMA1/LZMA2 preset: %s"
|
||||
msgstr "Nepodporované přednastavení LZMA1/LZMA2: %s"
|
||||
|
||||
#: src/xz/options.c:355
|
||||
msgid "The sum of lc and lp must not exceed 4"
|
||||
msgstr "Součet lc a lp nesmí překročit hodnotu 4"
|
||||
|
||||
#: src/xz/options.c:359
|
||||
#, c-format
|
||||
msgid "The selected match finder requires at least nice=%<PRIu32>"
|
||||
msgstr "Vybraný vyhledávač shod vyžaduje minimálně nice=%<PRIu32>"
|
||||
|
||||
#: src/xz/suffix.c:79 src/xz/suffix.c:164
|
||||
#, c-format
|
||||
msgid ""
|
||||
"%s: With --format=raw, --suffix=.SUF is required unless writing to stdout"
|
||||
msgstr ""
|
||||
"%s: S přepínačem --format=raw je vyžadován --sufix=.PRIP, vyjma zápisu do "
|
||||
"standardního výstupu"
|
||||
|
||||
#: src/xz/suffix.c:99
|
||||
#, c-format
|
||||
msgid "%s: Filename has an unknown suffix, skipping"
|
||||
msgstr "%s: Název souboru má neznámou příponu, vynechává se"
|
||||
|
||||
#: src/xz/suffix.c:154
|
||||
#, c-format
|
||||
msgid "%s: File already has `%s' suffix, skipping"
|
||||
msgstr "%s: Soubor již má příponu „%s“, vynechává se"
|
||||
|
||||
#: src/xz/suffix.c:205
|
||||
#, c-format
|
||||
msgid "%s: Invalid filename suffix"
|
||||
msgstr "%s: Neplatná přípona názvu souboru"
|
||||
|
||||
#: src/xz/util.c:61
|
||||
#, c-format
|
||||
msgid "%s: Value is not a non-negative decimal integer"
|
||||
msgstr "%s: Hodnota není nezáporné desítkové číslo"
|
||||
|
||||
#: src/xz/util.c:103
|
||||
#, c-format
|
||||
msgid "%s: Invalid multiplier suffix"
|
||||
msgstr "%s: Neplatná jednotka s předponou"
|
||||
|
||||
#: src/xz/util.c:105
|
||||
msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)."
|
||||
msgstr ""
|
||||
"Platné jednotky s předponami jsou „KiB“ (2^10 B), „MiB“ (2^20 B) a "
|
||||
"„GiB“ (2^30 B)."
|
||||
|
||||
#: src/xz/util.c:122
|
||||
#, c-format
|
||||
msgid "Value of the option `%s' must be in the range [%<PRIu64>, %<PRIu64>]"
|
||||
msgstr "Hodnota volby „%s“ musí být v rozsahu [%<PRIu64>, %<PRIu64>]"
|
||||
|
||||
#: src/xz/util.c:247
|
||||
msgid "Empty filename, skipping"
|
||||
msgstr "Prázdný název souboru, vynechává se"
|
||||
|
||||
#: src/xz/util.c:261
|
||||
msgid "Compressed data cannot be read from a terminal"
|
||||
msgstr "Z terminálu nelze číst komprimovaná data"
|
||||
|
||||
#: src/xz/util.c:274
|
||||
msgid "Compressed data cannot be written to a terminal"
|
||||
msgstr "Do terminálu nelze zapisovat komprimovaná data"
|
||||
|
||||
#: src/common/tuklib_exit.c:39
|
||||
msgid "Writing to standard output failed"
|
||||
msgstr "Zápis do standardního výstupu selhal"
|
||||
|
||||
#: src/common/tuklib_exit.c:42
|
||||
msgid "Unknown error"
|
||||
msgstr "Neznámá chyba"
|
||||
|
||||
#~ msgid "Limit was %s MiB, but %s MiB would have been needed"
|
||||
#~ msgstr "Limit byl %s MiB, ale bylo by zapotřebí %s MiB"
|
||||
|
||||
#~ msgid "%s MiB (%s bytes)\n"
|
||||
#~ msgstr "%s MiB (%s bajtů)\n"
|
||||
|
||||
#~ msgid ""
|
||||
#~ " -e, --extreme use more CPU time when encoding to increase "
|
||||
#~ "compression\n"
|
||||
#~ " ratio without increasing memory usage of the decoder"
|
||||
#~ msgstr ""
|
||||
#~ " -e, --extreme využít více procesorového času pro kódování, čímž "
|
||||
#~ "se\n"
|
||||
#~ " zvýší kompresní poměr bez zvýšení paměti použité "
|
||||
#~ "kodérem"
|
||||
|
||||
#~ msgid ""
|
||||
#~ " -M, --memory=NUM use roughly NUM bytes of memory at maximum; 0 "
|
||||
#~ "indicates\n"
|
||||
#~ " the default setting, which is 40 % of total RAM"
|
||||
#~ msgstr ""
|
||||
#~ " -M, --memory=POČ použít zhruba POČ bajtů paměti jako maximum; 0 "
|
||||
#~ "znamená\n"
|
||||
#~ " výchozí nastavení, což je 40% celkového množství "
|
||||
#~ "paměti"
|
||||
|
||||
#~ msgid ""
|
||||
#~ "\n"
|
||||
#~ " --subblock[=OPTS] Subblock filter; valid OPTS (valid values; "
|
||||
#~ "default):\n"
|
||||
#~ " size=NUM number of bytes of data per subblock\n"
|
||||
#~ " (1 - 256Mi; 4Ki)\n"
|
||||
#~ " rle=NUM run-length encoder chunk size (0-256; "
|
||||
#~ "0)"
|
||||
#~ msgstr ""
|
||||
#~ "\n"
|
||||
#~ " --subblock[=VOLBY] Subblokový filtr; platné VOLBY (platné hodnoty; "
|
||||
#~ "výchozí):\n"
|
||||
#~ " size=POČ počet bajtů dat na subblok\n"
|
||||
#~ " (1 - 256 Mi; 4 Ki)\n"
|
||||
#~ " rle=POČ velikost dávky pro kodér run-length "
|
||||
#~ "(0-256; 0)"
|
||||
|
||||
#~ msgid ""
|
||||
#~ "On this system and configuration, this program will use a maximum of "
|
||||
#~ "roughly\n"
|
||||
#~ "%s MiB RAM and "
|
||||
#~ msgstr ""
|
||||
#~ "Na tomto systému a s tímto nastavením použije tento program maximum ze "
|
||||
#~ "zhruba\n"
|
||||
#~ "%s MiB RAM a "
|
||||
|
||||
#~ msgid ""
|
||||
#~ "one thread.\n"
|
||||
#~ "\n"
|
||||
#~ msgstr ""
|
||||
#~ "jedno vlákno.\n"
|
||||
#~ "\n"
|
||||
|
||||
#~ msgid "%s: Invalid multiplier suffix. Valid suffixes:"
|
||||
#~ msgstr "%s: Neplatná přípona. Platné přípony jsou:"
|
||||
984
po/de.po
Normal file
984
po/de.po
Normal file
@@ -0,0 +1,984 @@
|
||||
# XZ Utils German translation
|
||||
# This file is put in the public domain.
|
||||
# Andre Noll <maan@tuebingen.mpg.de>, 2010.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: XZ Utils 4.999.9beta\n"
|
||||
"Report-Msgid-Bugs-To: lasse.collin@tukaani.org\n"
|
||||
"POT-Creation-Date: 2014-10-13 01:59+0200\n"
|
||||
"PO-Revision-Date: 2010-09-07 20:27+0200\n"
|
||||
"Last-Translator: <maan@tuebingen.mpg.de>\n"
|
||||
"Language-Team: German\n"
|
||||
"Language: de\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: src/xz/args.c:63
|
||||
#, c-format
|
||||
msgid "%s: Invalid argument to --block-list"
|
||||
msgstr "%s: Ungültiges Argument für --block-list"
|
||||
|
||||
#: src/xz/args.c:73
|
||||
#, c-format
|
||||
msgid "%s: Too many arguments to --block-list"
|
||||
msgstr "%s: Zu viele Argumente für --block-list"
|
||||
|
||||
#: src/xz/args.c:102
|
||||
msgid "0 can only be used as the last element in --block-list"
|
||||
msgstr "0 kann nur das letzte Element in --block-list sein"
|
||||
|
||||
#: src/xz/args.c:406
|
||||
#, c-format
|
||||
msgid "%s: Unknown file format type"
|
||||
msgstr "%s: Unbekanntes file format"
|
||||
|
||||
#: src/xz/args.c:429 src/xz/args.c:437
|
||||
#, c-format
|
||||
msgid "%s: Unsupported integrity check type"
|
||||
msgstr "%s: Integritäts-Check Typ nicht unterstützt"
|
||||
|
||||
#: src/xz/args.c:473
|
||||
msgid "Only one file can be specified with `--files' or `--files0'."
|
||||
msgstr "Nur ein file kann als Argument für --files oder --files0 angegeben werden."
|
||||
|
||||
#: src/xz/args.c:541
|
||||
#, c-format
|
||||
msgid "The environment variable %s contains too many arguments"
|
||||
msgstr "Die Umgebungsvariable %s enthält zu viele Argumente"
|
||||
|
||||
#: src/xz/coder.c:110
|
||||
msgid "Maximum number of filters is four"
|
||||
msgstr "Maximal vier Filter möglich"
|
||||
|
||||
#: src/xz/coder.c:129
|
||||
msgid "Memory usage limit is too low for the given filter setup."
|
||||
msgstr "Das Speicher Limit ist zu niedrig für die gegebene Filter Konfiguration."
|
||||
|
||||
#: src/xz/coder.c:159
|
||||
msgid "Using a preset in raw mode is discouraged."
|
||||
msgstr "Verwendung der Voreinstellung im raw Modus wird nicht empfohlen."
|
||||
|
||||
#: src/xz/coder.c:161
|
||||
msgid "The exact options of the presets may vary between software versions."
|
||||
msgstr "Die genauen Optionen der Voreinstellung können zwischen Software Versionen variieren."
|
||||
|
||||
#: src/xz/coder.c:184
|
||||
msgid "The .lzma format supports only the LZMA1 filter"
|
||||
msgstr "Das .lzma Format unterstützt nur den LZMA1 Filter"
|
||||
|
||||
#: src/xz/coder.c:192
|
||||
msgid "LZMA1 cannot be used with the .xz format"
|
||||
msgstr "LZMA1 kann nicht mit dem .xz Format verwendet werden"
|
||||
|
||||
#: src/xz/coder.c:209
|
||||
msgid "The filter chain is incompatible with --flush-timeout"
|
||||
msgstr "Diese Filter Kette ist inkompatibel zu --flush-timeout"
|
||||
|
||||
#: src/xz/coder.c:215
|
||||
msgid "Switching to single-threaded mode due to --flush-timeout"
|
||||
msgstr "Schalte um auf Single-Thread Modus wegen --flush-timeout"
|
||||
|
||||
#: src/xz/coder.c:234
|
||||
#, c-format
|
||||
msgid "Using up to %<PRIu32> threads."
|
||||
msgstr "Benutze bis zu %<PRIu32> Threads."
|
||||
|
||||
#: src/xz/coder.c:247
|
||||
msgid "Unsupported filter chain or filter options"
|
||||
msgstr "Optionen nicht unterstützt"
|
||||
|
||||
#: src/xz/coder.c:255
|
||||
#, c-format
|
||||
msgid "Decompression will need %s MiB of memory."
|
||||
msgstr "Dekompression wird %s MiB Speicher brauchen."
|
||||
|
||||
#: src/xz/coder.c:290
|
||||
#, c-format
|
||||
msgid "Adjusted the number of threads from %s to %s to not exceed the memory usage limit of %s MiB"
|
||||
msgstr "Passte die Anzahl Threads von %s auf %s an um nicht das Speicher Nutzungslimit von %s MiB zu übersteigen"
|
||||
|
||||
#: src/xz/coder.c:344
|
||||
#, c-format
|
||||
msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB"
|
||||
msgstr "Passte LZMA%c Wörterbuch Größe von %s MiB to %s MiB an, um nicht das Speicher Nutzungslimit von %s MiB zu übersteigen"
|
||||
|
||||
#: src/xz/file_io.c:90
|
||||
#, c-format
|
||||
msgid "Error creating a pipe: %s"
|
||||
msgstr "Fehler beim Erzeugen der Pipeline: %s"
|
||||
|
||||
#: src/xz/file_io.c:166
|
||||
#, c-format
|
||||
msgid "%s: poll() failed: %s"
|
||||
msgstr "%s: poll() Fehler: %s"
|
||||
|
||||
#. TRANSLATORS: When compression or decompression finishes,
|
||||
#. and xz is going to remove the source file, xz first checks
|
||||
#. if the source file still exists, and if it does, does its
|
||||
#. device and inode numbers match what xz saw when it opened
|
||||
#. the source file. If these checks fail, this message is
|
||||
#. shown, %s being the filename, and the file is not deleted.
|
||||
#. The check for device and inode numbers is there, because
|
||||
#. it is possible that the user has put a new file in place
|
||||
#. of the original file, and in that case it obviously
|
||||
#. shouldn't be removed.
|
||||
#: src/xz/file_io.c:236
|
||||
#, c-format
|
||||
msgid "%s: File seems to have been moved, not removing"
|
||||
msgstr "%s: Datei scheint umbenannt worden zu sein, daher wird sie nicht gelöscht"
|
||||
|
||||
#: src/xz/file_io.c:243 src/xz/file_io.c:761
|
||||
#, c-format
|
||||
msgid "%s: Cannot remove: %s"
|
||||
msgstr "%s: Kann nicht löschen: %s"
|
||||
|
||||
#: src/xz/file_io.c:268
|
||||
#, c-format
|
||||
msgid "%s: Cannot set the file owner: %s"
|
||||
msgstr "%s: Kann Datei Eigentümer nicht setzen: %s"
|
||||
|
||||
#: src/xz/file_io.c:274
|
||||
#, c-format
|
||||
msgid "%s: Cannot set the file group: %s"
|
||||
msgstr "%s: Kann Datei Gruppe nicht setzen: %s"
|
||||
|
||||
#: src/xz/file_io.c:293
|
||||
#, c-format
|
||||
msgid "%s: Cannot set the file permissions: %s"
|
||||
msgstr "%s: Kann Zugriffsrechte nicht setzen: %s"
|
||||
|
||||
#: src/xz/file_io.c:399
|
||||
#, c-format
|
||||
msgid "Error getting the file status flags from standard input: %s"
|
||||
msgstr "Kann Status Flags der Standardeingabe nicht ermitteln: %s"
|
||||
|
||||
#: src/xz/file_io.c:408
|
||||
#, c-format
|
||||
msgid "Error setting O_NONBLOCK on standard input: %s"
|
||||
msgstr "Fehler beim Setzen des O_NONBLOCK Flags für Standard Output: %s"
|
||||
|
||||
#: src/xz/file_io.c:460 src/xz/file_io.c:522
|
||||
#, c-format
|
||||
msgid "%s: Is a symbolic link, skipping"
|
||||
msgstr "%s: Überspringe symbolischen Verweis"
|
||||
|
||||
#: src/xz/file_io.c:551
|
||||
#, c-format
|
||||
msgid "%s: Is a directory, skipping"
|
||||
msgstr "%s: Überspringe Verzeichnis"
|
||||
|
||||
#: src/xz/file_io.c:557
|
||||
#, c-format
|
||||
msgid "%s: Not a regular file, skipping"
|
||||
msgstr "%s: Keine reguläre Datei, überspringe"
|
||||
|
||||
#: src/xz/file_io.c:574
|
||||
#, c-format
|
||||
msgid "%s: File has setuid or setgid bit set, skipping"
|
||||
msgstr "%s: Datei hat das setuid oder setgid Bit gesetzt, überspringe"
|
||||
|
||||
#: src/xz/file_io.c:581
|
||||
#, c-format
|
||||
msgid "%s: File has sticky bit set, skipping"
|
||||
msgstr "%s: Datei hat sticky Bit gesetzt, überspringe"
|
||||
|
||||
#: src/xz/file_io.c:588
|
||||
#, c-format
|
||||
msgid "%s: Input file has more than one hard link, skipping"
|
||||
msgstr "%s: Eingabedatei hat mehr als einen hard link, überspringe"
|
||||
|
||||
#: src/xz/file_io.c:668
|
||||
#, c-format
|
||||
msgid "Error restoring the status flags to standard input: %s"
|
||||
msgstr "Fehler beim Wiederherstellen der Status Flags für die Standardausgabe: %s"
|
||||
|
||||
#: src/xz/file_io.c:714
|
||||
#, c-format
|
||||
msgid "Error getting the file status flags from standard output: %s"
|
||||
msgstr "Kann Status Flags der Standardausgabe nicht ermitteln: %s"
|
||||
|
||||
#: src/xz/file_io.c:723
|
||||
#, c-format
|
||||
msgid "Error setting O_NONBLOCK on standard output: %s"
|
||||
msgstr "Fehler beim Setzen von O_NONBLOCK für die Standardausgabe: %s"
|
||||
|
||||
#: src/xz/file_io.c:896
|
||||
#, c-format
|
||||
msgid "Error restoring the O_APPEND flag to standard output: %s"
|
||||
msgstr "Fehler beim Wiederherstellen des O_APPEND flags bei Standard Output: %s"
|
||||
|
||||
#: src/xz/file_io.c:908
|
||||
#, c-format
|
||||
msgid "%s: Closing the file failed: %s"
|
||||
msgstr "%s: Fehler beim Schließen der Datei: %s"
|
||||
|
||||
#: src/xz/file_io.c:944 src/xz/file_io.c:1170
|
||||
#, c-format
|
||||
msgid "%s: Seeking failed when trying to create a sparse file: %s"
|
||||
msgstr "%s: Positionierungsfehler beim Versuch eine sparse Datei zu erzeugen: %s"
|
||||
|
||||
#: src/xz/file_io.c:1039
|
||||
#, c-format
|
||||
msgid "%s: Read error: %s"
|
||||
msgstr "%s: Lesefehler: %s"
|
||||
|
||||
#: src/xz/file_io.c:1059
|
||||
#, c-format
|
||||
msgid "%s: Error seeking the file: %s"
|
||||
msgstr "%s: Fehler beim Lesen der Dateinamen: %s"
|
||||
|
||||
#: src/xz/file_io.c:1069
|
||||
#, c-format
|
||||
msgid "%s: Unexpected end of file"
|
||||
msgstr "%s: Unerwartetes Ende der Datei"
|
||||
|
||||
#: src/xz/file_io.c:1128
|
||||
#, c-format
|
||||
msgid "%s: Write error: %s"
|
||||
msgstr "%s: Schreibfehler: %s"
|
||||
|
||||
#: src/xz/hardware.c:107
|
||||
msgid "Disabled"
|
||||
msgstr "Deaktiviert"
|
||||
|
||||
#. TRANSLATORS: Test with "xz --info-memory" to see if
|
||||
#. the alignment looks nice.
|
||||
#: src/xz/hardware.c:126
|
||||
msgid "Total amount of physical memory (RAM): "
|
||||
msgstr "Gesamtmenge physikalischer Speicher (RAM): "
|
||||
|
||||
#: src/xz/hardware.c:128
|
||||
msgid "Memory usage limit for compression: "
|
||||
msgstr "Speicher Nutzungslimit für Kompression: "
|
||||
|
||||
#: src/xz/hardware.c:130
|
||||
msgid "Memory usage limit for decompression: "
|
||||
msgstr "Speicher Nutzungslimit für Dekompression: "
|
||||
|
||||
#. TRANSLATORS: Indicates that there is no integrity check.
|
||||
#. This string is used in tables, so the width must not
|
||||
#. exceed ten columns with a fixed-width font.
|
||||
#: src/xz/list.c:65
|
||||
msgid "None"
|
||||
msgstr "Kein"
|
||||
|
||||
#. TRANSLATORS: Indicates that integrity check name is not known,
|
||||
#. but the Check ID is known (here 2). This and other "Unknown-N"
|
||||
#. strings are used in tables, so the width must not exceed ten
|
||||
#. columns with a fixed-width font. It's OK to omit the dash if
|
||||
#. you need space for one extra letter, but don't use spaces.
|
||||
#: src/xz/list.c:72
|
||||
msgid "Unknown-2"
|
||||
msgstr "Unbek.2"
|
||||
|
||||
#: src/xz/list.c:73
|
||||
msgid "Unknown-3"
|
||||
msgstr "Unbek.3"
|
||||
|
||||
#: src/xz/list.c:75
|
||||
msgid "Unknown-5"
|
||||
msgstr "Unbek.5"
|
||||
|
||||
#: src/xz/list.c:76
|
||||
msgid "Unknown-6"
|
||||
msgstr "Unbek.6"
|
||||
|
||||
#: src/xz/list.c:77
|
||||
msgid "Unknown-7"
|
||||
msgstr "Unbek.7"
|
||||
|
||||
#: src/xz/list.c:78
|
||||
msgid "Unknown-8"
|
||||
msgstr "Unbek.8"
|
||||
|
||||
#: src/xz/list.c:79
|
||||
msgid "Unknown-9"
|
||||
msgstr "Unbek.9"
|
||||
|
||||
#: src/xz/list.c:81
|
||||
msgid "Unknown-11"
|
||||
msgstr "Unbek.11"
|
||||
|
||||
#: src/xz/list.c:82
|
||||
msgid "Unknown-12"
|
||||
msgstr "Unbek.12"
|
||||
|
||||
#: src/xz/list.c:83
|
||||
msgid "Unknown-13"
|
||||
msgstr "Unbek.13"
|
||||
|
||||
#: src/xz/list.c:84
|
||||
msgid "Unknown-14"
|
||||
msgstr "Unbek.14"
|
||||
|
||||
#: src/xz/list.c:85
|
||||
msgid "Unknown-15"
|
||||
msgstr "Unbek.15"
|
||||
|
||||
#: src/xz/list.c:153
|
||||
#, c-format
|
||||
msgid "%s: File is empty"
|
||||
msgstr "%s: Datei ist leer"
|
||||
|
||||
#: src/xz/list.c:158
|
||||
#, c-format
|
||||
msgid "%s: Too small to be a valid .xz file"
|
||||
msgstr "%s: Zu klein um ein gültiges .xz file zu sein"
|
||||
|
||||
#. TRANSLATORS: These are column headings. From Strms (Streams)
|
||||
#. to Ratio, the columns are right aligned. Check and Filename
|
||||
#. are left aligned. If you need longer words, it's OK to
|
||||
#. use two lines here. Test with "xz -l foo.xz".
|
||||
#: src/xz/list.c:671
|
||||
msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename"
|
||||
msgstr " Str. Blöcke Kompr. Unkompr. Verh. Check Dateiname"
|
||||
|
||||
#: src/xz/list.c:711
|
||||
#, c-format
|
||||
msgid " Streams: %s\n"
|
||||
msgstr " Ströme: %s\n"
|
||||
|
||||
#: src/xz/list.c:713
|
||||
#, c-format
|
||||
msgid " Blocks: %s\n"
|
||||
msgstr " Blöcke: %s\n"
|
||||
|
||||
#: src/xz/list.c:715
|
||||
#, c-format
|
||||
msgid " Compressed size: %s\n"
|
||||
msgstr " Größe komprimiert: %s\n"
|
||||
|
||||
#: src/xz/list.c:718
|
||||
#, c-format
|
||||
msgid " Uncompressed size: %s\n"
|
||||
msgstr " Größe unkomprimiert: %s\n"
|
||||
|
||||
#: src/xz/list.c:721
|
||||
#, c-format
|
||||
msgid " Ratio: %s\n"
|
||||
msgstr " Verhältnis: %s\n"
|
||||
|
||||
#: src/xz/list.c:723
|
||||
#, c-format
|
||||
msgid " Check: %s\n"
|
||||
msgstr " Check: %s\n"
|
||||
|
||||
#: src/xz/list.c:724
|
||||
#, c-format
|
||||
msgid " Stream padding: %s\n"
|
||||
msgstr " Strom Auffüllung: %s\n"
|
||||
|
||||
#. TRANSLATORS: The second line is column headings. All except
|
||||
#. Check are right aligned; Check is left aligned. Test with
|
||||
#. "xz -lv foo.xz".
|
||||
#: src/xz/list.c:752
|
||||
msgid ""
|
||||
" Streams:\n"
|
||||
" Stream Blocks CompOffset UncompOffset CompSize UncompSize Ratio Check Padding"
|
||||
msgstr ""
|
||||
" Ströme:\n"
|
||||
" Strom Blöcke KompOffset UnkompOffset KompGröße UnkompGröße Verh. Check Auffüllung"
|
||||
|
||||
#. TRANSLATORS: The second line is column headings. All
|
||||
#. except Check are right aligned; Check is left aligned.
|
||||
#: src/xz/list.c:807
|
||||
#, c-format
|
||||
msgid ""
|
||||
" Blocks:\n"
|
||||
" Stream Block CompOffset UncompOffset TotalSize UncompSize Ratio Check"
|
||||
msgstr ""
|
||||
" Blöcke:\n"
|
||||
" Strom Block KompOffset UnkompOffset TotalGröße UnkompGröße Verh. Check"
|
||||
|
||||
#. TRANSLATORS: These are additional column headings
|
||||
#. for the most verbose listing mode. CheckVal
|
||||
#. (Check value), Flags, and Filters are left aligned.
|
||||
#. Header (Block Header Size), CompSize, and MemUsage
|
||||
#. are right aligned. %*s is replaced with 0-120
|
||||
#. spaces to make the CheckVal column wide enough.
|
||||
#. Test with "xz -lvv foo.xz".
|
||||
#: src/xz/list.c:819
|
||||
#, c-format
|
||||
msgid " CheckVal %*s Header Flags CompSize MemUsage Filters"
|
||||
msgstr " CheckWert %*s Kopf Schalter KompGröße Speicher Filter"
|
||||
|
||||
#: src/xz/list.c:897 src/xz/list.c:1072
|
||||
#, c-format
|
||||
msgid " Memory needed: %s MiB\n"
|
||||
msgstr " Benötigter Speicher: %s MiB\n"
|
||||
|
||||
#: src/xz/list.c:899 src/xz/list.c:1074
|
||||
#, c-format
|
||||
msgid " Sizes in headers: %s\n"
|
||||
msgstr " Größe in Köpfen: %s\n"
|
||||
|
||||
#: src/xz/list.c:900 src/xz/list.c:1075
|
||||
msgid "Yes"
|
||||
msgstr "Ja"
|
||||
|
||||
#: src/xz/list.c:900 src/xz/list.c:1075
|
||||
msgid "No"
|
||||
msgstr "Nein"
|
||||
|
||||
#: src/xz/list.c:901 src/xz/list.c:1076
|
||||
#, c-format
|
||||
msgid " Minimum XZ Utils version: %s\n"
|
||||
msgstr " Kleinste XZ Utils version: %s\n"
|
||||
|
||||
#. TRANSLATORS: %s is an integer. Only the plural form of this
|
||||
#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz".
|
||||
#: src/xz/list.c:1051
|
||||
#, c-format
|
||||
msgid "%s file\n"
|
||||
msgid_plural "%s files\n"
|
||||
msgstr[0] "%s Datei\n"
|
||||
msgstr[1] "%s Dateien\n"
|
||||
|
||||
#: src/xz/list.c:1064
|
||||
msgid "Totals:"
|
||||
msgstr "Gesamt:"
|
||||
|
||||
#: src/xz/list.c:1065
|
||||
#, c-format
|
||||
msgid " Number of files: %s\n"
|
||||
msgstr " Anzahl Dateien: %s\n"
|
||||
|
||||
#: src/xz/list.c:1140
|
||||
msgid "--list works only on .xz files (--format=xz or --format=auto)"
|
||||
msgstr "--list funktioniert nur mit .xz Dateien (--format=xz oder --format=auto)"
|
||||
|
||||
#: src/xz/list.c:1146
|
||||
msgid "--list does not support reading from standard input"
|
||||
msgstr "--list unterstützt kein Lesen der Standardeingabe"
|
||||
|
||||
#: src/xz/main.c:89
|
||||
#, c-format
|
||||
msgid "%s: Error reading filenames: %s"
|
||||
msgstr "%s: Fehler beim Lesen der Dateinamen: %s"
|
||||
|
||||
#: src/xz/main.c:96
|
||||
#, c-format
|
||||
msgid "%s: Unexpected end of input when reading filenames"
|
||||
msgstr "%s: Unerwartetes Ende beim Lesen der Dateinamen"
|
||||
|
||||
#: src/xz/main.c:120
|
||||
#, c-format
|
||||
msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?"
|
||||
msgstr "%s: Null Charakter gefunden beim Lesen der Dateinamen; Meinten Sie `--files0' statt `--files'?"
|
||||
|
||||
#: src/xz/main.c:174
|
||||
msgid "Compression and decompression with --robot are not supported yet."
|
||||
msgstr "Kompression und Dekompression mit --robot ist noch nicht unterstützt."
|
||||
|
||||
#: src/xz/main.c:231
|
||||
msgid "Cannot read data from standard input when reading filenames from standard input"
|
||||
msgstr "Lesen der Standardeingabe ist nicht möglich, wenn die Dateinamen auch von der Standardeingabe gelesen werden"
|
||||
|
||||
#. TRANSLATORS: This is the program name in the beginning
|
||||
#. of the line in messages. Usually it becomes "xz: ".
|
||||
#. This is a translatable string because French needs
|
||||
#. a space before a colon.
|
||||
#: src/xz/message.c:713
|
||||
#, c-format
|
||||
msgid "%s: "
|
||||
msgstr "%s: "
|
||||
|
||||
#: src/xz/message.c:776 src/xz/message.c:826
|
||||
msgid "Internal error (bug)"
|
||||
msgstr "Interner Fehler (Bug)"
|
||||
|
||||
#: src/xz/message.c:783
|
||||
msgid "Cannot establish signal handlers"
|
||||
msgstr "Kann Signal Routine nicht setzen"
|
||||
|
||||
#: src/xz/message.c:792
|
||||
msgid "No integrity check; not verifying file integrity"
|
||||
msgstr "Kein Integritäts-Check; werde Datei-Integrität nicht überprüfen"
|
||||
|
||||
#: src/xz/message.c:795
|
||||
msgid "Unsupported type of integrity check; not verifying file integrity"
|
||||
msgstr "Typ des Integritäts-Checks nicht unterstützt; werde Datei-Integrität nicht überprüfen"
|
||||
|
||||
#: src/xz/message.c:802
|
||||
msgid "Memory usage limit reached"
|
||||
msgstr "Speicher-Limit erreicht"
|
||||
|
||||
#: src/xz/message.c:805
|
||||
msgid "File format not recognized"
|
||||
msgstr "Datei Format nicht erkannt"
|
||||
|
||||
#: src/xz/message.c:808
|
||||
msgid "Unsupported options"
|
||||
msgstr "Optionen nicht unterstützt"
|
||||
|
||||
#: src/xz/message.c:811
|
||||
msgid "Compressed data is corrupt"
|
||||
msgstr "Komprimierte Daten sind korrupt"
|
||||
|
||||
#: src/xz/message.c:814
|
||||
msgid "Unexpected end of input"
|
||||
msgstr "Unerwartetes Eingabe Ende"
|
||||
|
||||
#: src/xz/message.c:847
|
||||
#, c-format
|
||||
msgid "%s MiB of memory is required. The limiter is disabled."
|
||||
msgstr "%s MiB Speicher wird benötigt. Der Begrenzer ist deaktiviert."
|
||||
|
||||
#: src/xz/message.c:875
|
||||
#, c-format
|
||||
msgid "%s MiB of memory is required. The limit is %s."
|
||||
msgstr "%s MiB Speicher wird benötigt. Limit ist %s."
|
||||
|
||||
#: src/xz/message.c:1042
|
||||
#, c-format
|
||||
msgid "%s: Filter chain: %s\n"
|
||||
msgstr "%s: Filter Kette: %s\n"
|
||||
|
||||
#: src/xz/message.c:1052
|
||||
#, c-format
|
||||
msgid "Try `%s --help' for more information."
|
||||
msgstr "Versuchen Sie `%s --help' für mehr Informationen."
|
||||
|
||||
#: src/xz/message.c:1078
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Usage: %s [OPTION]... [FILE]...\n"
|
||||
"Compress or decompress FILEs in the .xz format.\n"
|
||||
"\n"
|
||||
msgstr ""
|
||||
"Benutzung: %s [OPTION]... [DATEI]...\n"
|
||||
"Komprimiert oder dekomprimiert .xz DATEI(EN).\n"
|
||||
"\n"
|
||||
|
||||
#: src/xz/message.c:1085
|
||||
msgid "Mandatory arguments to long options are mandatory for short options too.\n"
|
||||
msgstr ""
|
||||
"Obligatorische Argumente für lange Optionen sind auch für kurze Optionen\n"
|
||||
"zwingend.\n"
|
||||
|
||||
#: src/xz/message.c:1089
|
||||
msgid " Operation mode:\n"
|
||||
msgstr " Operationsmodus:\n"
|
||||
|
||||
#: src/xz/message.c:1092
|
||||
msgid ""
|
||||
" -z, --compress force compression\n"
|
||||
" -d, --decompress force decompression\n"
|
||||
" -t, --test test compressed file integrity\n"
|
||||
" -l, --list list information about .xz files"
|
||||
msgstr ""
|
||||
" -z, --compress erzwinge Komprimierung\n"
|
||||
" -d, --decompress erzwinge Dekomprimierung\n"
|
||||
" -t, --test überprüfe Datei Integrität\n"
|
||||
" -l, --list liste Datei Informationen"
|
||||
|
||||
#: src/xz/message.c:1098
|
||||
msgid ""
|
||||
"\n"
|
||||
" Operation modifiers:\n"
|
||||
msgstr ""
|
||||
"\n"
|
||||
" Operationsmodifikatoren:\n"
|
||||
|
||||
#: src/xz/message.c:1101
|
||||
msgid ""
|
||||
" -k, --keep keep (don't delete) input files\n"
|
||||
" -f, --force force overwrite of output file and (de)compress links\n"
|
||||
" -c, --stdout write to standard output and don't delete input files"
|
||||
msgstr ""
|
||||
" -k, --keep Eingabedateien beibehalten (nicht löschen)\n"
|
||||
" -f, --force erzwinge Überschreiben der Ausgabedatei und\n"
|
||||
" (de)komprimiere Verweise (Links)\n"
|
||||
" -c, --stdout schreibe nach Standard Output und lösche nicht die\n"
|
||||
" Eingabedateien"
|
||||
|
||||
#: src/xz/message.c:1107
|
||||
msgid ""
|
||||
" --single-stream decompress only the first stream, and silently\n"
|
||||
" ignore possible remaining input data"
|
||||
msgstr ""
|
||||
" --single-stream dekomprimiere nur den ersten Datenstrom und ignoriere\n"
|
||||
" stillschweigend mögliche weitere Eingabedaten"
|
||||
|
||||
#: src/xz/message.c:1110
|
||||
msgid ""
|
||||
" --no-sparse do not create sparse files when decompressing\n"
|
||||
" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n"
|
||||
" --files[=FILE] read filenames to process from FILE; if FILE is\n"
|
||||
" omitted, filenames are read from the standard input;\n"
|
||||
" filenames must be terminated with the newline character\n"
|
||||
" --files0[=FILE] like --files but use the null character as terminator"
|
||||
msgstr ""
|
||||
" --no-sparse erzeuge keine sparse Datei beim Dekomprimieren\n"
|
||||
" -S, --suffix=.SUF benutze `.SUF' Endung für komprimierte Dateien\n"
|
||||
" --files=[DATEI] lese zu verarbeitende Dateinamen von DATEI; falls\n"
|
||||
" DATEI nicht angegeben wurde, werden Dateinamen\n"
|
||||
" von Standard Input gelesen. Dateinamen müssen mit\n"
|
||||
" einem Zeilenumbruch voneinander getrennt werden\n"
|
||||
" --files0=[DATEI] wie --files, aber benutze den Null Charakter als Trenner"
|
||||
|
||||
#: src/xz/message.c:1119
|
||||
msgid ""
|
||||
"\n"
|
||||
" Basic file format and compression options:\n"
|
||||
msgstr ""
|
||||
"\n"
|
||||
" Grundlegende Optionen für Dateiformat und Kompression:\n"
|
||||
|
||||
#: src/xz/message.c:1121
|
||||
msgid ""
|
||||
" -F, --format=FMT file format to encode or decode; possible values are\n"
|
||||
" `auto' (default), `xz', `lzma', and `raw'\n"
|
||||
" -C, --check=CHECK integrity check type: `none' (use with caution),\n"
|
||||
" `crc32', `crc64' (default), or `sha256'"
|
||||
msgstr ""
|
||||
" -F, --format=FMT Dateiformat zur Kodierung oder Dekodierung; mögliche\n"
|
||||
" Werte sind `auto' (Voreinstellung), `xz', `lzma' und\n"
|
||||
" `raw'\n"
|
||||
" -C, --check=CHECK Typ des Integritätschecks: `none' (Vorsicht), `crc32',\n"
|
||||
" `crc64' (Voreinstellung), oder `sha256'"
|
||||
|
||||
#: src/xz/message.c:1126
|
||||
msgid " --ignore-check don't verify the integrity check when decompressing"
|
||||
msgstr " --ignore-check überprüfe nicht den Integritätscheck beim Dekomprimieren"
|
||||
|
||||
#: src/xz/message.c:1130
|
||||
msgid ""
|
||||
" -0 ... -9 compression preset; default is 6; take compressor *and*\n"
|
||||
" decompressor memory usage into account before using 7-9!"
|
||||
msgstr ""
|
||||
" -0 .. -9 Kompressionseinstellung; Voreinstellung is 6. Beachten\n"
|
||||
" Sie den Speicherverbrauch des Komprimieres *und* des\n"
|
||||
" Dekomprimierers, wenn Sie 7-9 benutzen!"
|
||||
|
||||
#: src/xz/message.c:1134
|
||||
msgid ""
|
||||
" -e, --extreme try to improve compression ratio by using more CPU time;\n"
|
||||
" does not affect decompressor memory requirements"
|
||||
msgstr ""
|
||||
" -e, --extreme Versuche durch stärkere CPU Nutzung das Kompressions-\n"
|
||||
" verhältnis zu verbessern. Das beeinflusst nicht den\n"
|
||||
" Speicherbedarf des Dekomprimierers."
|
||||
|
||||
#: src/xz/message.c:1138
|
||||
msgid ""
|
||||
" -T, --threads=NUM use at most NUM threads; the default is 1; set to 0\n"
|
||||
" to use as many threads as there are processor cores"
|
||||
msgstr ""
|
||||
" -T, --threads=ZAHL erzeuge höchstens ZAHL viele Threads; die Grund-\n"
|
||||
" einstellung ist 1. Wenn der Wert 0 angegeben wird, dann\n"
|
||||
" werden so viele Threads erzeugt wie es Prozessor Kerne\n"
|
||||
" gibt"
|
||||
|
||||
#: src/xz/message.c:1143
|
||||
msgid ""
|
||||
" --block-size=SIZE\n"
|
||||
" start a new .xz block after every SIZE bytes of input;\n"
|
||||
" use this to set the block size for threaded compression"
|
||||
msgstr ""
|
||||
" --block-size=GRÖßE\n"
|
||||
" beginne einen neuen .xz Block nach GRÖßE Input Bytes;\n"
|
||||
" Benutzen Sie diese Option um die Block Größe für\n"
|
||||
" Kompression mit mehreren Threads zu setzen"
|
||||
|
||||
#: src/xz/message.c:1147
|
||||
msgid ""
|
||||
" --block-list=SIZES\n"
|
||||
" start a new .xz block after the given comma-separated\n"
|
||||
" intervals of uncompressed data"
|
||||
msgstr ""
|
||||
" --block-list=GRÖßEN\n"
|
||||
" beginne einen neuen .xz Block gemäß der angegebenen,\n"
|
||||
" durch Kommata getrennten Intervalle an unkomprimierten\n"
|
||||
" Daten"
|
||||
|
||||
#: src/xz/message.c:1151
|
||||
msgid ""
|
||||
" --flush-timeout=TIMEOUT\n"
|
||||
" when compressing, if more than TIMEOUT milliseconds has\n"
|
||||
" passed since the previous flush and reading more input\n"
|
||||
" would block, all pending data is flushed out"
|
||||
msgstr ""
|
||||
" --flush-timeout=ZEITÜBERSCHREITUNG\n"
|
||||
" wenn beim Komprimieren mehr als ZEITÜBERSCHREITUNG\n"
|
||||
" Millisekunden vergangen sind seit der letzten Flush\n"
|
||||
" Operation, und das Lesen von zusätzlichem Input den\n"
|
||||
" Prozess blockieren würde, dann werden alle noch aus-\n"
|
||||
" stehenden Daten geschrieben"
|
||||
|
||||
#: src/xz/message.c:1157
|
||||
#, no-c-format
|
||||
msgid ""
|
||||
" --memlimit-compress=LIMIT\n"
|
||||
" --memlimit-decompress=LIMIT\n"
|
||||
" -M, --memlimit=LIMIT\n"
|
||||
" set memory usage limit for compression, decompression,\n"
|
||||
" or both; LIMIT is in bytes, % of RAM, or 0 for defaults"
|
||||
msgstr ""
|
||||
" --memlimit-compress=LIMIT\n"
|
||||
" --memlimit-decompress=LIMIT\n"
|
||||
" -M, --memlimit=LIMIT Setze Speicher Nutzungslimit für Kompression,\n"
|
||||
" Dekompression, oder beides; LIMIT ist in bytes, % RAM,\n"
|
||||
" oder 0 für Grundeinstellungen."
|
||||
|
||||
#: src/xz/message.c:1164
|
||||
msgid ""
|
||||
" --no-adjust if compression settings exceed the memory usage limit,\n"
|
||||
" give an error instead of adjusting the settings downwards"
|
||||
msgstr ""
|
||||
" --no-adjust Wenn die Kompressionseinstellungen das Speicher\n"
|
||||
" Nutzungslimit übersteigen, erzeuge einen Fehler statt\n"
|
||||
" die Einstellungen nach unten anzupassen."
|
||||
|
||||
#: src/xz/message.c:1170
|
||||
msgid ""
|
||||
"\n"
|
||||
" Custom filter chain for compression (alternative for using presets):"
|
||||
msgstr ""
|
||||
"\n"
|
||||
" User-definierte Filter Kette für Kompression (alternativ zu Voreinstellung):"
|
||||
|
||||
#: src/xz/message.c:1179
|
||||
msgid ""
|
||||
"\n"
|
||||
" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n"
|
||||
" --lzma2[=OPTS] more of the following options (valid values; default):\n"
|
||||
" preset=PRE reset options to a preset (0-9[e])\n"
|
||||
" dict=NUM dictionary size (4KiB - 1536MiB; 8MiB)\n"
|
||||
" lc=NUM number of literal context bits (0-4; 3)\n"
|
||||
" lp=NUM number of literal position bits (0-4; 0)\n"
|
||||
" pb=NUM number of position bits (0-4; 2)\n"
|
||||
" mode=MODE compression mode (fast, normal; normal)\n"
|
||||
" nice=NUM nice length of a match (2-273; 64)\n"
|
||||
" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; bt4)\n"
|
||||
" depth=NUM maximum search depth; 0=automatic (default)"
|
||||
msgstr ""
|
||||
"\n"
|
||||
" --lzma1[=OPTIONEN] LZMA1 oder LZMA2; OPTIONEN ist eine durch Kommata\n"
|
||||
" --lzma2[=OPTIONEN] getrennte Liste bestehend aus den folgenden Optionen\n"
|
||||
" (zulässige Werte; Voreinstellung):\n"
|
||||
" preset=NUM Setze Optionen zurück zu Voreinstellung\n"
|
||||
" (0-9[e])\n"
|
||||
" dict=NUM Wörterbuch Größe (4 KiB - 1536 MiB; 8 MiB)\n"
|
||||
" lc=NUM Anzahl der Literal Kontext Bits (0-4; 3)\n"
|
||||
" lp=NUM Anzahl der Literal Positionsbits (0-4; 0)\n"
|
||||
" pb=NUM Anzahl der Positionsbits (0-4; 2)\n"
|
||||
" mode=MODUS Kompressionsmodus (fast, normal; normal)\n"
|
||||
" nice=NUM Nice-Länge eines Treffers (2-273; 64)\n"
|
||||
" mf=NAME Algorithmus zum Auffinden von\n"
|
||||
" Übereinstimmungen (hc3, hc4, bt2, bt3, bt4;\n"
|
||||
" bt4)\n"
|
||||
" depth=NUM Maximale Suchtiefe; 0=automatisch\n"
|
||||
" (Voreinstellung)"
|
||||
|
||||
#: src/xz/message.c:1194
|
||||
msgid ""
|
||||
"\n"
|
||||
" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n"
|
||||
" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n"
|
||||
" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n"
|
||||
" --arm[=OPTS] ARM BCJ filter (little endian only)\n"
|
||||
" --armthumb[=OPTS] ARM-Thumb BCJ filter (little endian only)\n"
|
||||
" --sparc[=OPTS] SPARC BCJ filter\n"
|
||||
" Valid OPTS for all BCJ filters:\n"
|
||||
" start=NUM start offset for conversions (default=0)"
|
||||
msgstr ""
|
||||
"\n"
|
||||
" --x86[=OPTIONEN] x86 BCJ Filter (32-bit und 64-bit)\n"
|
||||
" --powerpc[=OPTIONEN] PowerPC BCJ Filter (nur big endian)\n"
|
||||
" --ia64[=OPTIONEN] IA64 (Itanium) BCJ Filter\n"
|
||||
" --arm[=OPTIONEN] ARM BCJ Filter (nur little endian)\n"
|
||||
" --armthumb[=OPTIONEN] ARM-Thumb BCJ Filter (nur little endian)\n"
|
||||
" --sparc[=OPTIONEN] SPARC BCJ Filter\n"
|
||||
" Zulässige Optionen für alle BCJ Filter:\n"
|
||||
" start=NUM Start-Offset für Konversion\n"
|
||||
" (Voreinstellung=0)"
|
||||
|
||||
#: src/xz/message.c:1206
|
||||
msgid ""
|
||||
"\n"
|
||||
" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n"
|
||||
" dist=NUM distance between bytes being subtracted\n"
|
||||
" from each other (1-256; 1)"
|
||||
msgstr ""
|
||||
"\n"
|
||||
" --delta[=OPTIONEN] Delta Filter; zulässige Optionen (gültige Werte;\n"
|
||||
" Voreinstellung):\n"
|
||||
" dist=NUM Abstand zwischen den Bytes, die voneinander\n"
|
||||
" subtrahiert werden (1-256; 1)"
|
||||
|
||||
#: src/xz/message.c:1214
|
||||
msgid ""
|
||||
"\n"
|
||||
" Other options:\n"
|
||||
msgstr ""
|
||||
"\n"
|
||||
" Andere Optionen:\n"
|
||||
|
||||
#: src/xz/message.c:1217
|
||||
msgid ""
|
||||
" -q, --quiet suppress warnings; specify twice to suppress errors too\n"
|
||||
" -v, --verbose be verbose; specify twice for even more verbose"
|
||||
msgstr ""
|
||||
" -q, --quiet unterdrücke Warnungen; benutze diese Option zweimal\n"
|
||||
" um auch Fehlermeldungen zu unterdrücken\n"
|
||||
" -v, --verbose sei gesprächig; benutze diese Option zweimal um noch\n"
|
||||
" gesprächiger zu sein"
|
||||
|
||||
#: src/xz/message.c:1222
|
||||
msgid " -Q, --no-warn make warnings not affect the exit status"
|
||||
msgstr " -Q, --no-warn Warnungen verändern nicht den exit status"
|
||||
|
||||
#: src/xz/message.c:1224
|
||||
msgid " --robot use machine-parsable messages (useful for scripts)"
|
||||
msgstr ""
|
||||
" --robot benutze Maschinen-lesbare Meldungen (nützlich für\n"
|
||||
" Skripte)"
|
||||
|
||||
#: src/xz/message.c:1227
|
||||
msgid ""
|
||||
" --info-memory display the total amount of RAM and the currently active\n"
|
||||
" memory usage limits, and exit"
|
||||
msgstr " --info-memory zeige Speicherlimit an und terminiere"
|
||||
|
||||
#: src/xz/message.c:1230
|
||||
msgid ""
|
||||
" -h, --help display the short help (lists only the basic options)\n"
|
||||
" -H, --long-help display this long help and exit"
|
||||
msgstr ""
|
||||
" -h, --help zeige kurze Hilfe and (zeigt nur die grundlegenden\n"
|
||||
" Optionen)\n"
|
||||
" -H, --long-help zeige diese lange Hilfe an und terminiere"
|
||||
|
||||
#: src/xz/message.c:1234
|
||||
msgid ""
|
||||
" -h, --help display this short help and exit\n"
|
||||
" -H, --long-help display the long help (lists also the advanced options)"
|
||||
msgstr ""
|
||||
" -h, --help zeige diese kurze Hilfe an und terminiere\n"
|
||||
" -H, --long-help zeige die lange Hilfe an (zeigt auch fortgeschrittene\n"
|
||||
" Optionen an)"
|
||||
|
||||
#: src/xz/message.c:1239
|
||||
msgid " -V, --version display the version number and exit"
|
||||
msgstr " -V, --version zeige Versionsnummer an und terminiere"
|
||||
|
||||
#: src/xz/message.c:1241
|
||||
msgid ""
|
||||
"\n"
|
||||
"With no FILE, or when FILE is -, read standard input.\n"
|
||||
msgstr ""
|
||||
"\n"
|
||||
"Wenn DATEI nicht angegeben wurde, oder DATEI gleich - ist, dann wird von\n"
|
||||
"der Standardeingabe gelesen.\n"
|
||||
|
||||
#. TRANSLATORS: This message indicates the bug reporting address
|
||||
#. for this package. Please add _another line_ saying
|
||||
#. "Report translation bugs to <...>\n" with the email or WWW
|
||||
#. address for translation bugs. Thanks.
|
||||
#: src/xz/message.c:1247
|
||||
#, c-format
|
||||
msgid "Report bugs to <%s> (in English or Finnish).\n"
|
||||
msgstr ""
|
||||
"Melde Bugs an <%s> (in englisch oder finnisch).\n"
|
||||
"Melde Übersetzungsfehler an <maan@tuebingen.mpg.de> (in englisch oder deutsch).\n"
|
||||
|
||||
#: src/xz/message.c:1249
|
||||
#, c-format
|
||||
msgid "%s home page: <%s>\n"
|
||||
msgstr "%s Homepage: <%s>\n"
|
||||
|
||||
#: src/xz/message.c:1253
|
||||
msgid "THIS IS A DEVELOPMENT VERSION NOT INTENDED FOR PRODUCTION USE."
|
||||
msgstr "DAS IST EINE ENTWICKLERVERSION, DIE NICHT FÜR DEN PRODUKTIVBETRIEB GEEIGNET IST."
|
||||
|
||||
#: src/xz/options.c:86
|
||||
#, c-format
|
||||
msgid "%s: Options must be `name=value' pairs separated with commas"
|
||||
msgstr "%s: Optionen müssen in der Form `Name=Wert` gegeben werden, getrennt durch Kommata"
|
||||
|
||||
#: src/xz/options.c:93
|
||||
#, c-format
|
||||
msgid "%s: Invalid option name"
|
||||
msgstr "%s: Ungültige Option"
|
||||
|
||||
#: src/xz/options.c:113
|
||||
#, c-format
|
||||
msgid "%s: Invalid option value"
|
||||
msgstr "%s: Ungültiger Wert für Option"
|
||||
|
||||
#: src/xz/options.c:247
|
||||
#, c-format
|
||||
msgid "Unsupported LZMA1/LZMA2 preset: %s"
|
||||
msgstr "LZMA1/LZMA2 Voreinstellung ist ungültig: %s"
|
||||
|
||||
#: src/xz/options.c:355
|
||||
msgid "The sum of lc and lp must not exceed 4"
|
||||
msgstr "Die Summe aus lc und lp darf höchstens 4 sein"
|
||||
|
||||
#: src/xz/options.c:359
|
||||
#, c-format
|
||||
msgid "The selected match finder requires at least nice=%<PRIu32>"
|
||||
msgstr "Der ausgewählte Algorithmus zum Auffinden von Übereinstimmungen braucht mindestens nice=%<PRIu32>"
|
||||
|
||||
#: src/xz/suffix.c:133 src/xz/suffix.c:258
|
||||
#, c-format
|
||||
msgid "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout"
|
||||
msgstr "%s: Mit --format=raw ist --suffix=.SUF notwendig, falls nicht auf die Standardausgabe geschrieben wird"
|
||||
|
||||
#: src/xz/suffix.c:164
|
||||
#, c-format
|
||||
msgid "%s: Filename has an unknown suffix, skipping"
|
||||
msgstr "%s: Dateiname hat unbekannte Endung, überspringe"
|
||||
|
||||
#: src/xz/suffix.c:185
|
||||
#, c-format
|
||||
msgid "%s: File already has `%s' suffix, skipping"
|
||||
msgstr "%s: Datei hat bereits `%s' Endung, überspringe"
|
||||
|
||||
#: src/xz/suffix.c:393
|
||||
#, c-format
|
||||
msgid "%s: Invalid filename suffix"
|
||||
msgstr "%s: Ungültige Datei Endung"
|
||||
|
||||
#: src/xz/util.c:71
|
||||
#, c-format
|
||||
msgid "%s: Value is not a non-negative decimal integer"
|
||||
msgstr "%s: Wert ist keine nicht-negative ganze Zahl"
|
||||
|
||||
#: src/xz/util.c:113
|
||||
#, c-format
|
||||
msgid "%s: Invalid multiplier suffix"
|
||||
msgstr "%s: Ungültige Einheit"
|
||||
|
||||
#: src/xz/util.c:115
|
||||
msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)."
|
||||
msgstr "Gültige Einheiten sind `KiB' (2^10), `MiB' (2^20), und `GiB' (2^30)."
|
||||
|
||||
#: src/xz/util.c:132
|
||||
#, c-format
|
||||
msgid "Value of the option `%s' must be in the range [%<PRIu64>, %<PRIu64>]"
|
||||
msgstr "Wert der Option `%s' muss im Bereich [%<PRIu64>, %<PRIu64>] sein"
|
||||
|
||||
#: src/xz/util.c:257
|
||||
msgid "Empty filename, skipping"
|
||||
msgstr "Leere Dateiname, überspringe"
|
||||
|
||||
#: src/xz/util.c:271
|
||||
msgid "Compressed data cannot be read from a terminal"
|
||||
msgstr "Komprimierte Daten können nicht vom Terminal gelesen werden"
|
||||
|
||||
#: src/xz/util.c:284
|
||||
msgid "Compressed data cannot be written to a terminal"
|
||||
msgstr "Komprimierte Daten können nicht auf das Terminal geschrieben werden"
|
||||
|
||||
#: src/common/tuklib_exit.c:39
|
||||
msgid "Writing to standard output failed"
|
||||
msgstr "Schreiben auf die Standardausgabe fehlgeschlagen"
|
||||
|
||||
#: src/common/tuklib_exit.c:42
|
||||
msgid "Unknown error"
|
||||
msgstr "Unbekannter Fehler"
|
||||
978
po/fr.po
Normal file
978
po/fr.po
Normal file
@@ -0,0 +1,978 @@
|
||||
# XZ Utils French Translation
|
||||
# This file is put in the public domain.
|
||||
# Adrien Nader <adrien@notk.org>, 2011-2014.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: xz-utils\n"
|
||||
"Report-Msgid-Bugs-To: lasse.collin@tukaani.org\n"
|
||||
"POT-Creation-Date: 2014-11-25 20:23+0100\n"
|
||||
"PO-Revision-Date: 2010-09-24 21;12+0200\n"
|
||||
"Last-Translator: Adrien Nader <adrien@notk.org>\n"
|
||||
"Language-Team: None\n"
|
||||
"Language: fr\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n==1) ? 0 : 1;\n"
|
||||
|
||||
#: src/xz/args.c:63
|
||||
#, c-format
|
||||
msgid "%s: Invalid argument to --block-list"
|
||||
msgstr ""
|
||||
|
||||
#: src/xz/args.c:73
|
||||
#, c-format
|
||||
msgid "%s: Too many arguments to --block-list"
|
||||
msgstr ""
|
||||
|
||||
#: src/xz/args.c:102
|
||||
msgid "0 can only be used as the last element in --block-list"
|
||||
msgstr ""
|
||||
|
||||
#: src/xz/args.c:406
|
||||
#, c-format
|
||||
msgid "%s: Unknown file format type"
|
||||
msgstr "%s : Format de fichier inconnu"
|
||||
|
||||
#: src/xz/args.c:429 src/xz/args.c:437
|
||||
#, c-format
|
||||
msgid "%s: Unsupported integrity check type"
|
||||
msgstr "%s : Type de vérification d'intégrité inconnu"
|
||||
|
||||
#: src/xz/args.c:473
|
||||
msgid "Only one file can be specified with `--files' or `--files0'."
|
||||
msgstr "Un seul fichier peut être spécifié avec `--files' ou `--files0'."
|
||||
|
||||
#: src/xz/args.c:541
|
||||
#, c-format
|
||||
msgid "The environment variable %s contains too many arguments"
|
||||
msgstr "La variable d'environnement %s contient trop d'arguments"
|
||||
|
||||
#: src/xz/coder.c:110
|
||||
msgid "Maximum number of filters is four"
|
||||
msgstr "Le nombre maximal de filtres est quatre"
|
||||
|
||||
#: src/xz/coder.c:129
|
||||
msgid "Memory usage limit is too low for the given filter setup."
|
||||
msgstr "La limite d'utilisation mémoire est trop basse pour la configuration de filtres donnée."
|
||||
|
||||
#: src/xz/coder.c:159
|
||||
msgid "Using a preset in raw mode is discouraged."
|
||||
msgstr "Utiliser un préréglage en mode `raw' est déconseillé."
|
||||
|
||||
#: src/xz/coder.c:161
|
||||
msgid "The exact options of the presets may vary between software versions."
|
||||
msgstr "Le détail des préréglages peut varier entre différentes versions du logiciel."
|
||||
|
||||
#: src/xz/coder.c:184
|
||||
msgid "The .lzma format supports only the LZMA1 filter"
|
||||
msgstr "Le format .lzma ne prend en charge que le filtre LZMA1"
|
||||
|
||||
#: src/xz/coder.c:192
|
||||
msgid "LZMA1 cannot be used with the .xz format"
|
||||
msgstr "Le filtre LZMA1 ne peut être utilisé avec le format .xz"
|
||||
|
||||
#: src/xz/coder.c:209
|
||||
msgid "The filter chain is incompatible with --flush-timeout"
|
||||
msgstr ""
|
||||
|
||||
#: src/xz/coder.c:215
|
||||
msgid "Switching to single-threaded mode due to --flush-timeout"
|
||||
msgstr ""
|
||||
|
||||
#: src/xz/coder.c:234
|
||||
#, c-format
|
||||
msgid "Using up to %<PRIu32> threads."
|
||||
msgstr "Jusqu'à %<PRIu32> threads seront utilisés."
|
||||
|
||||
#: src/xz/coder.c:247
|
||||
msgid "Unsupported filter chain or filter options"
|
||||
msgstr "Enchaînement ou options de filtres non pris en charge"
|
||||
|
||||
#: src/xz/coder.c:255
|
||||
#, c-format
|
||||
msgid "Decompression will need %s MiB of memory."
|
||||
msgstr "La décompression nécessitera %s MiB de mémoire."
|
||||
|
||||
#: src/xz/coder.c:290
|
||||
#, c-format
|
||||
msgid "Adjusted the number of threads from %s to %s to not exceed the memory usage limit of %s MiB"
|
||||
msgstr "Nombre de threads réduit de %s à %s pour ne pas dépasser la limite d'utilisation mémoire de %s MiB"
|
||||
|
||||
#: src/xz/coder.c:344
|
||||
#, c-format
|
||||
msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB"
|
||||
msgstr "Taille du dictionnaire LZMA%c réduite de %s MiB à %s MiB pour ne pas dépasser la limite d'utilisation mémoire de %s MiB"
|
||||
|
||||
#: src/xz/file_io.c:90
|
||||
#, c-format
|
||||
msgid "Error creating a pipe: %s"
|
||||
msgstr "Impossible de créer un tube anonyme (pipe) : %s"
|
||||
|
||||
#: src/xz/file_io.c:166
|
||||
#, c-format
|
||||
msgid "%s: poll() failed: %s"
|
||||
msgstr "%s : L'appel à la fonction poll() a échoué : %s"
|
||||
|
||||
#. TRANSLATORS: When compression or decompression finishes,
|
||||
#. and xz is going to remove the source file, xz first checks
|
||||
#. if the source file still exists, and if it does, does its
|
||||
#. device and inode numbers match what xz saw when it opened
|
||||
#. the source file. If these checks fail, this message is
|
||||
#. shown, %s being the filename, and the file is not deleted.
|
||||
#. The check for device and inode numbers is there, because
|
||||
#. it is possible that the user has put a new file in place
|
||||
#. of the original file, and in that case it obviously
|
||||
#. shouldn't be removed.
|
||||
#: src/xz/file_io.c:236
|
||||
#, c-format
|
||||
msgid "%s: File seems to have been moved, not removing"
|
||||
msgstr "%s : Le fichier a apparemment été déplacé, suppression annulée"
|
||||
|
||||
#: src/xz/file_io.c:243 src/xz/file_io.c:761
|
||||
#, c-format
|
||||
msgid "%s: Cannot remove: %s"
|
||||
msgstr "%s : Impossible de supprimer : %s"
|
||||
|
||||
#: src/xz/file_io.c:268
|
||||
#, c-format
|
||||
msgid "%s: Cannot set the file owner: %s"
|
||||
msgstr "%s : Impossible de modifier le propriétaire du fichier : %s"
|
||||
|
||||
#: src/xz/file_io.c:274
|
||||
#, c-format
|
||||
msgid "%s: Cannot set the file group: %s"
|
||||
msgstr "%s : Impossible de modifier le groupe propriétaire du fichier : %s"
|
||||
|
||||
#: src/xz/file_io.c:293
|
||||
#, c-format
|
||||
msgid "%s: Cannot set the file permissions: %s"
|
||||
msgstr "%s : Impossible de modifier les permissions du fichier : %s"
|
||||
|
||||
# Note from translator on "file status flags".
|
||||
# The following entry is kept un-translated on purpose. It is difficult to
|
||||
# translate and should only happen in exceptional circumstances which means
|
||||
# that translating would:
|
||||
# - lose some of the meaning
|
||||
# - make it more difficult to look up in search engines; it might happen one in
|
||||
# a million times, if we dilute the error message in 20 languages, it will be
|
||||
# almost impossible to find an explanation and support for the error.
|
||||
#: src/xz/file_io.c:399
|
||||
#, c-format
|
||||
msgid "Error getting the file status flags from standard input: %s"
|
||||
msgstr ""
|
||||
|
||||
#: src/xz/file_io.c:408
|
||||
#, c-format
|
||||
msgid "Error setting O_NONBLOCK on standard input: %s"
|
||||
msgstr "Impossible d'établir le drapeau O_NONBLOCK sur la sortie standard : %s"
|
||||
|
||||
#: src/xz/file_io.c:460 src/xz/file_io.c:522
|
||||
#, c-format
|
||||
msgid "%s: Is a symbolic link, skipping"
|
||||
msgstr "%s est un lien symbolique : ignoré"
|
||||
|
||||
#: src/xz/file_io.c:551
|
||||
#, c-format
|
||||
msgid "%s: Is a directory, skipping"
|
||||
msgstr "%s est un répertoire : ignoré"
|
||||
|
||||
#: src/xz/file_io.c:557
|
||||
#, c-format
|
||||
msgid "%s: Not a regular file, skipping"
|
||||
msgstr "%s n'est pas un fichier régulier : ignoré"
|
||||
|
||||
#: src/xz/file_io.c:574
|
||||
#, c-format
|
||||
msgid "%s: File has setuid or setgid bit set, skipping"
|
||||
msgstr "%s : Le fichier possède les bits `setuid' ou `setgid' : ignoré"
|
||||
|
||||
#: src/xz/file_io.c:581
|
||||
#, c-format
|
||||
msgid "%s: File has sticky bit set, skipping"
|
||||
msgstr "%s : Le fichier possède le bit `sticky' : ignoré"
|
||||
|
||||
#: src/xz/file_io.c:588
|
||||
#, c-format
|
||||
msgid "%s: Input file has more than one hard link, skipping"
|
||||
msgstr "%s : Le fichier d'entrée a plus d'un lien matériel : ignoré"
|
||||
|
||||
# See note from translator above titled "file status flags".
|
||||
#: src/xz/file_io.c:668
|
||||
#, c-format
|
||||
msgid "Error restoring the status flags to standard input: %s"
|
||||
msgstr ""
|
||||
|
||||
# See note from translator above titled "file status flags".
|
||||
#: src/xz/file_io.c:714
|
||||
#, c-format
|
||||
msgid "Error getting the file status flags from standard output: %s"
|
||||
msgstr ""
|
||||
|
||||
#: src/xz/file_io.c:723
|
||||
#, c-format
|
||||
msgid "Error setting O_NONBLOCK on standard output: %s"
|
||||
msgstr "Impossible d'activer le drapeau O_NONBLOCK sur la sortie standard : %s"
|
||||
|
||||
#: src/xz/file_io.c:896
|
||||
#, c-format
|
||||
msgid "Error restoring the O_APPEND flag to standard output: %s"
|
||||
msgstr "Impossible de rétablir le drapeau O_APPEND sur la sortie standard : %s"
|
||||
|
||||
#: src/xz/file_io.c:908
|
||||
#, c-format
|
||||
msgid "%s: Closing the file failed: %s"
|
||||
msgstr "%s : Impossible de fermer le fichier : %s"
|
||||
|
||||
#: src/xz/file_io.c:944 src/xz/file_io.c:1170
|
||||
#, c-format
|
||||
msgid "%s: Seeking failed when trying to create a sparse file: %s"
|
||||
msgstr "%s : Impossible de se déplacer dans le fichier pour créer un 'sparse file' : %s"
|
||||
|
||||
#: src/xz/file_io.c:1039
|
||||
#, c-format
|
||||
msgid "%s: Read error: %s"
|
||||
msgstr "%s : Erreur d'écriture : %s"
|
||||
|
||||
#: src/xz/file_io.c:1059
|
||||
#, c-format
|
||||
msgid "%s: Error seeking the file: %s"
|
||||
msgstr "%s : Impossible de se déplacer dans le fichier : %s"
|
||||
|
||||
#: src/xz/file_io.c:1069
|
||||
#, c-format
|
||||
msgid "%s: Unexpected end of file"
|
||||
msgstr "%s : Fin de fichier inattendue"
|
||||
|
||||
#: src/xz/file_io.c:1128
|
||||
#, c-format
|
||||
msgid "%s: Write error: %s"
|
||||
msgstr "%s : Erreur d'écriture : %s"
|
||||
|
||||
#: src/xz/hardware.c:107
|
||||
msgid "Disabled"
|
||||
msgstr "Désactivé"
|
||||
|
||||
#. TRANSLATORS: Test with "xz --info-memory" to see if
|
||||
#. the alignment looks nice.
|
||||
#: src/xz/hardware.c:126
|
||||
msgid "Total amount of physical memory (RAM): "
|
||||
msgstr "Quantité totale de mémoire physique (RAM) : "
|
||||
|
||||
#: src/xz/hardware.c:128
|
||||
msgid "Memory usage limit for compression: "
|
||||
msgstr "Limite d'utilisation pour la compression : "
|
||||
|
||||
#: src/xz/hardware.c:130
|
||||
msgid "Memory usage limit for decompression: "
|
||||
msgstr "Limite d'utilisation pour la décompression : "
|
||||
|
||||
#. TRANSLATORS: Indicates that there is no integrity check.
|
||||
#. This string is used in tables, so the width must not
|
||||
#. exceed ten columns with a fixed-width font.
|
||||
#: src/xz/list.c:65
|
||||
msgid "None"
|
||||
msgstr "Aucune"
|
||||
|
||||
#. TRANSLATORS: Indicates that integrity check name is not known,
|
||||
#. but the Check ID is known (here 2). This and other "Unknown-N"
|
||||
#. strings are used in tables, so the width must not exceed ten
|
||||
#. columns with a fixed-width font. It's OK to omit the dash if
|
||||
#. you need space for one extra letter, but don't use spaces.
|
||||
#: src/xz/list.c:72
|
||||
msgid "Unknown-2"
|
||||
msgstr "Inconnue-2"
|
||||
|
||||
#: src/xz/list.c:73
|
||||
msgid "Unknown-3"
|
||||
msgstr "Inconnue-3"
|
||||
|
||||
#: src/xz/list.c:75
|
||||
msgid "Unknown-5"
|
||||
msgstr "Inconnue-5"
|
||||
|
||||
#: src/xz/list.c:76
|
||||
msgid "Unknown-6"
|
||||
msgstr "Inconnue-6"
|
||||
|
||||
#: src/xz/list.c:77
|
||||
msgid "Unknown-7"
|
||||
msgstr "Inconnue-7"
|
||||
|
||||
#: src/xz/list.c:78
|
||||
msgid "Unknown-8"
|
||||
msgstr "Inconnue-8"
|
||||
|
||||
#: src/xz/list.c:79
|
||||
msgid "Unknown-9"
|
||||
msgstr "Inconnue-9"
|
||||
|
||||
#: src/xz/list.c:81
|
||||
msgid "Unknown-11"
|
||||
msgstr "Inconnue-11"
|
||||
|
||||
#: src/xz/list.c:82
|
||||
msgid "Unknown-12"
|
||||
msgstr "Inconnue-12"
|
||||
|
||||
#: src/xz/list.c:83
|
||||
msgid "Unknown-13"
|
||||
msgstr "Inconnue-13"
|
||||
|
||||
#: src/xz/list.c:84
|
||||
msgid "Unknown-14"
|
||||
msgstr "Inconnue-14"
|
||||
|
||||
#: src/xz/list.c:85
|
||||
msgid "Unknown-15"
|
||||
msgstr "Inconnue-15"
|
||||
|
||||
#: src/xz/list.c:153
|
||||
#, c-format
|
||||
msgid "%s: File is empty"
|
||||
msgstr "%s : Le fichier est vide"
|
||||
|
||||
#: src/xz/list.c:158
|
||||
#, c-format
|
||||
msgid "%s: Too small to be a valid .xz file"
|
||||
msgstr "%s : Trop petit pour être un fichier xz valide."
|
||||
|
||||
#. TRANSLATORS: These are column headings. From Strms (Streams)
|
||||
#. to Ratio, the columns are right aligned. Check and Filename
|
||||
#. are left aligned. If you need longer words, it's OK to
|
||||
#. use two lines here. Test with "xz -l foo.xz".
|
||||
#: src/xz/list.c:671
|
||||
msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename"
|
||||
msgstr "Flux Blocs Compressé Décompressé Ratio Vérif. Nom de fichier"
|
||||
|
||||
#: src/xz/list.c:711
|
||||
#, c-format
|
||||
msgid " Streams: %s\n"
|
||||
msgstr " Flux : %s\n"
|
||||
|
||||
#: src/xz/list.c:713
|
||||
#, c-format
|
||||
msgid " Blocks: %s\n"
|
||||
msgstr " Blocs : %s\n"
|
||||
|
||||
#: src/xz/list.c:715
|
||||
#, c-format
|
||||
msgid " Compressed size: %s\n"
|
||||
msgstr " Taille données avec compression : %s\n"
|
||||
|
||||
#: src/xz/list.c:718
|
||||
#, c-format
|
||||
msgid " Uncompressed size: %s\n"
|
||||
msgstr " Taille données sans compression : %s\n"
|
||||
|
||||
#: src/xz/list.c:721
|
||||
#, c-format
|
||||
msgid " Ratio: %s\n"
|
||||
msgstr " Ratio : %s\n"
|
||||
|
||||
#: src/xz/list.c:723
|
||||
#, c-format
|
||||
msgid " Check: %s\n"
|
||||
msgstr " Vérification : %s\n"
|
||||
|
||||
#: src/xz/list.c:724
|
||||
#, c-format
|
||||
msgid " Stream padding: %s\n"
|
||||
msgstr " Octets de rembourrage du flux : %s\n"
|
||||
|
||||
#. TRANSLATORS: The second line is column headings. All except
|
||||
#. Check are right aligned; Check is left aligned. Test with
|
||||
#. "xz -lv foo.xz".
|
||||
#: src/xz/list.c:752
|
||||
msgid ""
|
||||
" Streams:\n"
|
||||
" Stream Blocks CompOffset UncompOffset CompSize UncompSize Ratio Check Padding"
|
||||
msgstr ""
|
||||
" Flux :\n"
|
||||
" Flux Blocs PositionComp PositionDécomp TailleComp TailleDécomp Ratio Vérif. Bourrage"
|
||||
|
||||
#. TRANSLATORS: The second line is column headings. All
|
||||
#. except Check are right aligned; Check is left aligned.
|
||||
#: src/xz/list.c:807
|
||||
#, c-format
|
||||
msgid ""
|
||||
" Blocks:\n"
|
||||
" Stream Block CompOffset UncompOffset TotalSize UncompSize Ratio Check"
|
||||
msgstr ""
|
||||
" Blocs :\n"
|
||||
" Flux Bloc PositionComp PositionDécomp TailleTot TailleDécomp Ratio Vérif."
|
||||
|
||||
#. TRANSLATORS: These are additional column headings
|
||||
#. for the most verbose listing mode. CheckVal
|
||||
#. (Check value), Flags, and Filters are left aligned.
|
||||
#. Header (Block Header Size), CompSize, and MemUsage
|
||||
#. are right aligned. %*s is replaced with 0-120
|
||||
#. spaces to make the CheckVal column wide enough.
|
||||
#. Test with "xz -lvv foo.xz".
|
||||
#: src/xz/list.c:819
|
||||
#, c-format
|
||||
msgid " CheckVal %*s Header Flags CompSize MemUsage Filters"
|
||||
msgstr " ValVérif %*sEn-tête Drapeaux TailleComp UtilMém Filtres"
|
||||
|
||||
#: src/xz/list.c:897 src/xz/list.c:1072
|
||||
#, c-format
|
||||
msgid " Memory needed: %s MiB\n"
|
||||
msgstr " Mémoire nécessaire : %s MiB\n"
|
||||
|
||||
#: src/xz/list.c:899 src/xz/list.c:1074
|
||||
#, c-format
|
||||
msgid " Sizes in headers: %s\n"
|
||||
msgstr " Tailles stockées dans l'en-tête : %s\n"
|
||||
|
||||
#: src/xz/list.c:900 src/xz/list.c:1075
|
||||
msgid "Yes"
|
||||
msgstr "Oui"
|
||||
|
||||
#: src/xz/list.c:900 src/xz/list.c:1075
|
||||
msgid "No"
|
||||
msgstr "Non"
|
||||
|
||||
#: src/xz/list.c:901 src/xz/list.c:1076
|
||||
#, c-format
|
||||
msgid " Minimum XZ Utils version: %s\n"
|
||||
msgstr " Version minimale de XZ Utils : %s\n"
|
||||
|
||||
#. TRANSLATORS: %s is an integer. Only the plural form of this
|
||||
#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz".
|
||||
#: src/xz/list.c:1051
|
||||
#, c-format
|
||||
msgid "%s file\n"
|
||||
msgid_plural "%s files\n"
|
||||
msgstr[0] "%s fichier\n"
|
||||
msgstr[1] "%s fichiers\n"
|
||||
|
||||
#: src/xz/list.c:1064
|
||||
msgid "Totals:"
|
||||
msgstr "Totaux :"
|
||||
|
||||
#: src/xz/list.c:1065
|
||||
#, c-format
|
||||
msgid " Number of files: %s\n"
|
||||
msgstr " Nombre de fichiers : %s\n"
|
||||
|
||||
#: src/xz/list.c:1140
|
||||
msgid "--list works only on .xz files (--format=xz or --format=auto)"
|
||||
msgstr "--list ne marche que sur les fichiers .xz (--format=xz ou --format=auto)"
|
||||
|
||||
#: src/xz/list.c:1146
|
||||
msgid "--list does not support reading from standard input"
|
||||
msgstr "--list est incompatible avec la lecture sur l'entrée standard"
|
||||
|
||||
#: src/xz/main.c:89
|
||||
#, c-format
|
||||
msgid "%s: Error reading filenames: %s"
|
||||
msgstr "%s : Erreur lors de la lecture des noms de fichiers : %s"
|
||||
|
||||
#: src/xz/main.c:96
|
||||
#, c-format
|
||||
msgid "%s: Unexpected end of input when reading filenames"
|
||||
msgstr "%s : Fin des données inattendue lors de la lecture des noms de fichiers"
|
||||
|
||||
#: src/xz/main.c:120
|
||||
#, c-format
|
||||
msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?"
|
||||
msgstr "%s : Caractère NULL détecté lors de la lecture des noms de fichiers ; peut-être pensiez-vous à `--files0' plutot qu'a `--files' ?"
|
||||
|
||||
#: src/xz/main.c:174
|
||||
msgid "Compression and decompression with --robot are not supported yet."
|
||||
msgstr "La compression et la décompression ne marchent pas encore avec --robot."
|
||||
|
||||
#: src/xz/main.c:231
|
||||
msgid "Cannot read data from standard input when reading filenames from standard input"
|
||||
msgstr "Impossible de lire à la fois les données et les noms de fichiers depuis l'entrée standard"
|
||||
|
||||
#. TRANSLATORS: This is the program name in the beginning
|
||||
#. of the line in messages. Usually it becomes "xz: ".
|
||||
#. This is a translatable string because French needs
|
||||
#. a space before a colon.
|
||||
#: src/xz/message.c:713
|
||||
#, c-format
|
||||
msgid "%s: "
|
||||
msgstr "%s : "
|
||||
|
||||
#: src/xz/message.c:776 src/xz/message.c:826
|
||||
msgid "Internal error (bug)"
|
||||
msgstr "Erreur interne (bug)"
|
||||
|
||||
#: src/xz/message.c:783
|
||||
msgid "Cannot establish signal handlers"
|
||||
msgstr "Impossible d'installer le gestionnaire de signaux"
|
||||
|
||||
#: src/xz/message.c:792
|
||||
msgid "No integrity check; not verifying file integrity"
|
||||
msgstr "Pas de données de vérification d'intégrité ; vérification non effectuée"
|
||||
|
||||
#: src/xz/message.c:795
|
||||
msgid "Unsupported type of integrity check; not verifying file integrity"
|
||||
msgstr "Méthode de vérification d'intégrité non prise en charge ; vérification non effectuée"
|
||||
|
||||
#: src/xz/message.c:802
|
||||
msgid "Memory usage limit reached"
|
||||
msgstr "Limite d'utilisation mémoire atteinte"
|
||||
|
||||
#: src/xz/message.c:805
|
||||
msgid "File format not recognized"
|
||||
msgstr "Format de fichier inconnu"
|
||||
|
||||
#: src/xz/message.c:808
|
||||
msgid "Unsupported options"
|
||||
msgstr "Options non prises en charge"
|
||||
|
||||
#: src/xz/message.c:811
|
||||
msgid "Compressed data is corrupt"
|
||||
msgstr "Les données compressées sont corrompues"
|
||||
|
||||
#: src/xz/message.c:814
|
||||
msgid "Unexpected end of input"
|
||||
msgstr "Fin des données inattendue "
|
||||
|
||||
#: src/xz/message.c:847
|
||||
#, c-format
|
||||
msgid "%s MiB of memory is required. The limiter is disabled."
|
||||
msgstr "%s MiB de mémoire sont nécessaires. La limite est désactivée."
|
||||
|
||||
#: src/xz/message.c:875
|
||||
#, c-format
|
||||
msgid "%s MiB of memory is required. The limit is %s."
|
||||
msgstr "%s MiB de mémoire sont nécessaires, la limite étant %s."
|
||||
|
||||
#: src/xz/message.c:1042
|
||||
#, c-format
|
||||
msgid "%s: Filter chain: %s\n"
|
||||
msgstr "%s : Enchaînement de filtres : %s\n"
|
||||
|
||||
#: src/xz/message.c:1052
|
||||
#, c-format
|
||||
msgid "Try `%s --help' for more information."
|
||||
msgstr "Éxécutez `%s --help' pour obtenir davantage d'informations."
|
||||
|
||||
#: src/xz/message.c:1078
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Usage: %s [OPTION]... [FILE]...\n"
|
||||
"Compress or decompress FILEs in the .xz format.\n"
|
||||
"\n"
|
||||
msgstr ""
|
||||
"Utilisation : %s [OPTION]... [FICHIER]...\n"
|
||||
"Compresse ou decompresse FICHIER(s) au format .xz.\n"
|
||||
"\n"
|
||||
|
||||
#: src/xz/message.c:1085
|
||||
msgid "Mandatory arguments to long options are mandatory for short options too.\n"
|
||||
msgstr ""
|
||||
"Les arguments obligatoires pour les options longues le sont aussi pour les\n"
|
||||
"options courtes.\n"
|
||||
|
||||
#: src/xz/message.c:1089
|
||||
msgid " Operation mode:\n"
|
||||
msgstr " Mode d'opération :\n"
|
||||
|
||||
#: src/xz/message.c:1092
|
||||
msgid ""
|
||||
" -z, --compress force compression\n"
|
||||
" -d, --decompress force decompression\n"
|
||||
" -t, --test test compressed file integrity\n"
|
||||
" -l, --list list information about .xz files"
|
||||
msgstr ""
|
||||
" -z, --compress forcer le mode compression\n"
|
||||
" -d, --decompress forcer le mode décompression\n"
|
||||
" -t, --test tester l'intégrité du fichier compressé\n"
|
||||
" -l, --list lister les informations sur les fichiers .xz"
|
||||
|
||||
#: src/xz/message.c:1098
|
||||
msgid ""
|
||||
"\n"
|
||||
" Operation modifiers:\n"
|
||||
msgstr ""
|
||||
"\n"
|
||||
" Modificateurs :\n"
|
||||
|
||||
#: src/xz/message.c:1101
|
||||
msgid ""
|
||||
" -k, --keep keep (don't delete) input files\n"
|
||||
" -f, --force force overwrite of output file and (de)compress links\n"
|
||||
" -c, --stdout write to standard output and don't delete input files"
|
||||
msgstr ""
|
||||
" -k, --keep ne pas supprimer les fichiers d'entrée\n"
|
||||
" -f, --force forcer l'écrasement éventuel du fichier de sortie et\n"
|
||||
" (dé)compresser les liens symboliques\n"
|
||||
" -c, --stdout écrire sur la sortie standard et ne pas supprimer les\n"
|
||||
" fichiers d'entrée"
|
||||
|
||||
#: src/xz/message.c:1107
|
||||
msgid ""
|
||||
" --single-stream decompress only the first stream, and silently\n"
|
||||
" ignore possible remaining input data"
|
||||
msgstr ""
|
||||
" --single-stream décompresser uniquement le premier flux et ignorer\n"
|
||||
" silencieusement les données éventuellement restantes"
|
||||
|
||||
#: src/xz/message.c:1110
|
||||
msgid ""
|
||||
" --no-sparse do not create sparse files when decompressing\n"
|
||||
" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n"
|
||||
" --files[=FILE] read filenames to process from FILE; if FILE is\n"
|
||||
" omitted, filenames are read from the standard input;\n"
|
||||
" filenames must be terminated with the newline character\n"
|
||||
" --files0[=FILE] like --files but use the null character as terminator"
|
||||
msgstr ""
|
||||
" --no-sparse ne pas créer de 'sparse file' lors de la décompression\n"
|
||||
" -S, --suffix=.SUF utiliser le suffixe `.SUF' pour les fichiers compressés\n"
|
||||
" --files[=FILE] lire les fichiers sur lesquels opérer depuis FILE ; si\n"
|
||||
" FILE est omis, ceux-ci sont lus depuis l'entrée standard\n"
|
||||
" et doivent être suivis d'un caractère retour à la ligne\n"
|
||||
" --files0[=FILE] comme --files mais avec un caractère null comme séparateur"
|
||||
|
||||
#: src/xz/message.c:1119
|
||||
msgid ""
|
||||
"\n"
|
||||
" Basic file format and compression options:\n"
|
||||
msgstr ""
|
||||
"\n"
|
||||
" Options basiques de format de fichier et de compression :\n"
|
||||
|
||||
#: src/xz/message.c:1121
|
||||
msgid ""
|
||||
" -F, --format=FMT file format to encode or decode; possible values are\n"
|
||||
" `auto' (default), `xz', `lzma', and `raw'\n"
|
||||
" -C, --check=CHECK integrity check type: `none' (use with caution),\n"
|
||||
" `crc32', `crc64' (default), or `sha256'"
|
||||
msgstr ""
|
||||
" -F, --format=FMT format du fichier à encoder ou décoder ; sont acceptés :\n"
|
||||
" `auto' (par défaut), `xz', `lzma' et `raw'\n"
|
||||
" -C, --check=CHECK type de vérification d'intégrité : `none' (à utiliser avec\n"
|
||||
" précaution), `crc32', `crc64' (par défaut) ou `sha256'"
|
||||
|
||||
#: src/xz/message.c:1126
|
||||
msgid " --ignore-check don't verify the integrity check when decompressing"
|
||||
msgstr ""
|
||||
" --ignore-check ne pas vérifier l'intégrité des données lors de\n"
|
||||
" la décompression"
|
||||
|
||||
#: src/xz/message.c:1130
|
||||
msgid ""
|
||||
" -0 ... -9 compression preset; default is 6; take compressor *and*\n"
|
||||
" decompressor memory usage into account before using 7-9!"
|
||||
msgstr ""
|
||||
" -0 ... -9 préréglage de compression : 6 par défaut ; pensez à\n"
|
||||
" l'utilisation mémoire du compresseur *et* du décompresseur\n"
|
||||
" avant d'utiliser 7, 8 ou 9 !"
|
||||
|
||||
#: src/xz/message.c:1134
|
||||
msgid ""
|
||||
" -e, --extreme try to improve compression ratio by using more CPU time;\n"
|
||||
" does not affect decompressor memory requirements"
|
||||
msgstr ""
|
||||
" -e, --extreme essayer d'améliorer la compression en utilisant davantage\n"
|
||||
" de temps processeur ;\n"
|
||||
" n'affecte pas les besoins mémoire du décompresseur"
|
||||
|
||||
#: src/xz/message.c:1138
|
||||
msgid ""
|
||||
" -T, --threads=NUM use at most NUM threads; the default is 1; set to 0\n"
|
||||
" to use as many threads as there are processor cores"
|
||||
msgstr ""
|
||||
" -T, --threads=NB créer au plus NB fils de compression (1 par défault) ; la\n"
|
||||
" valeur 0 est spéciale et équivaut au nombre de processeurs\n"
|
||||
" de la machine"
|
||||
|
||||
#: src/xz/message.c:1143
|
||||
msgid ""
|
||||
" --block-size=SIZE\n"
|
||||
" start a new .xz block after every SIZE bytes of input;\n"
|
||||
" use this to set the block size for threaded compression"
|
||||
msgstr ""
|
||||
" --block-size=TAILLE\n"
|
||||
" débuter un bloc XZ après chaque TAILLE octets de données\n"
|
||||
" d'entrée ; ce réglage sert pour la compression paralléle"
|
||||
|
||||
#: src/xz/message.c:1147
|
||||
msgid ""
|
||||
" --block-list=SIZES\n"
|
||||
" start a new .xz block after the given comma-separated\n"
|
||||
" intervals of uncompressed data"
|
||||
msgstr ""
|
||||
" --block-list=TAILLES\n"
|
||||
" débuter des blocs XZ après les TAILLES octets de données\n"
|
||||
" spécifiées avec des virgules pour séparateur"
|
||||
|
||||
#: src/xz/message.c:1151
|
||||
msgid ""
|
||||
" --flush-timeout=TIMEOUT\n"
|
||||
" when compressing, if more than TIMEOUT milliseconds has\n"
|
||||
" passed since the previous flush and reading more input\n"
|
||||
" would block, all pending data is flushed out"
|
||||
msgstr ""
|
||||
|
||||
#: src/xz/message.c:1157
|
||||
#, no-c-format
|
||||
msgid ""
|
||||
" --memlimit-compress=LIMIT\n"
|
||||
" --memlimit-decompress=LIMIT\n"
|
||||
" -M, --memlimit=LIMIT\n"
|
||||
" set memory usage limit for compression, decompression,\n"
|
||||
" or both; LIMIT is in bytes, % of RAM, or 0 for defaults"
|
||||
msgstr ""
|
||||
" --memlimit-compress=LIMIT\n"
|
||||
" --memlimit-decompress=LIMIT\n"
|
||||
" -M, --memlimit=LIMIT\n"
|
||||
" règle la limite d'utilisation mémoire pour la compression,\n"
|
||||
" décompression ou les deux ; LIMIT est en octets,\n"
|
||||
" pourcentage de RAM, ou 0 pour la valeur par défaut"
|
||||
|
||||
#: src/xz/message.c:1164
|
||||
msgid ""
|
||||
" --no-adjust if compression settings exceed the memory usage limit,\n"
|
||||
" give an error instead of adjusting the settings downwards"
|
||||
msgstr ""
|
||||
" --no-adjust si les réglages de compression dépassent la limite\n"
|
||||
" d'utilisation mémoire, renvoyer une erreur plutôt que de\n"
|
||||
" diminuer les réglages"
|
||||
|
||||
#: src/xz/message.c:1170
|
||||
msgid ""
|
||||
"\n"
|
||||
" Custom filter chain for compression (alternative for using presets):"
|
||||
msgstr ""
|
||||
"\n"
|
||||
" Chaîne de filtres de compression personnalisée (en lieu des préréglages) :"
|
||||
|
||||
#: src/xz/message.c:1179
|
||||
msgid ""
|
||||
"\n"
|
||||
" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n"
|
||||
" --lzma2[=OPTS] more of the following options (valid values; default):\n"
|
||||
" preset=PRE reset options to a preset (0-9[e])\n"
|
||||
" dict=NUM dictionary size (4KiB - 1536MiB; 8MiB)\n"
|
||||
" lc=NUM number of literal context bits (0-4; 3)\n"
|
||||
" lp=NUM number of literal position bits (0-4; 0)\n"
|
||||
" pb=NUM number of position bits (0-4; 2)\n"
|
||||
" mode=MODE compression mode (fast, normal; normal)\n"
|
||||
" nice=NUM nice length of a match (2-273; 64)\n"
|
||||
" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; bt4)\n"
|
||||
" depth=NUM maximum search depth; 0=automatic (default)"
|
||||
msgstr ""
|
||||
"\n"
|
||||
" --lzma1[=OPTS] LZMA1/2 ; OPTS est une liste d'options parmi les suivantes\n"
|
||||
" --lzma2[=OPTS] (entre parenthèses : valeurs valides et par défaut) :\n"
|
||||
" preset=PRE remettre les options à un préréglage (0-9[e])\n"
|
||||
" dict=NUM taille dictionnaire (4KiB - 1536MiB ; 8MiB)\n"
|
||||
" lc=NUM nombre de 'literal context bits' (0-4 ; 3)\n"
|
||||
" lp=NUM nombre de 'literal position bits' (0-4 ; 0)\n"
|
||||
" pb=NUM nombre de 'position bits' (0-4 ; 2)\n"
|
||||
" mode=MODE mode de compression (fast, normal ; normal)\n"
|
||||
" nice=NUM nice length of a match (2-273; 64)\n"
|
||||
" mf=NAME 'match finder' (hc3, hc4, bt2, bt3, bt4; bt4)\n"
|
||||
" depth=NUM profondeur de recherche maximale ;\n"
|
||||
" 0=automatique (par défaut)"
|
||||
|
||||
#: src/xz/message.c:1194
|
||||
msgid ""
|
||||
"\n"
|
||||
" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n"
|
||||
" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n"
|
||||
" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n"
|
||||
" --arm[=OPTS] ARM BCJ filter (little endian only)\n"
|
||||
" --armthumb[=OPTS] ARM-Thumb BCJ filter (little endian only)\n"
|
||||
" --sparc[=OPTS] SPARC BCJ filter\n"
|
||||
" Valid OPTS for all BCJ filters:\n"
|
||||
" start=NUM start offset for conversions (default=0)"
|
||||
msgstr ""
|
||||
"\n"
|
||||
" --x86[=OPTS] filtre BCJ x86 (32-bit et 64-bit)\n"
|
||||
" --powerpc[=OPTS] filtre BCJ PowerPC ('big endian' uniquement)\n"
|
||||
" --ia64[=OPTS] filtre BCJ IA-64 (Itanium)\n"
|
||||
" --arm[=OPTS] filtre BCJ ARM ('little endian' uniquement)\n"
|
||||
" --armthumb[=OPTS] filtre BCJ ARM-Thumb ('little endian' uniquement)\n"
|
||||
" --sparc[=OPTS] filtre BCJ SPARC\n"
|
||||
" OPTS valides pour tous les filtres BCJ :\n"
|
||||
" start=NUM position de début de la conversion (défaut=0)"
|
||||
|
||||
#: src/xz/message.c:1206
|
||||
msgid ""
|
||||
"\n"
|
||||
" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n"
|
||||
" dist=NUM distance between bytes being subtracted\n"
|
||||
" from each other (1-256; 1)"
|
||||
msgstr ""
|
||||
"\n"
|
||||
" --delta[=OPTS] Filtre delta ; OPTS valides (vals. valides ; par défaut) :\n"
|
||||
" dist=NUM distance entre les octets soustraits les\n"
|
||||
" uns aux autres (1-256 ; 1)"
|
||||
|
||||
#: src/xz/message.c:1214
|
||||
msgid ""
|
||||
"\n"
|
||||
" Other options:\n"
|
||||
msgstr ""
|
||||
"\n"
|
||||
" Autres options :\n"
|
||||
|
||||
#: src/xz/message.c:1217
|
||||
msgid ""
|
||||
" -q, --quiet suppress warnings; specify twice to suppress errors too\n"
|
||||
" -v, --verbose be verbose; specify twice for even more verbose"
|
||||
msgstr ""
|
||||
" -q, --quiet masquer les avertissements ; spécifier deux fois pour\n"
|
||||
" aussi masquer les erreurs\n"
|
||||
" -v, --verbose être bavard ; spécifier deux fois pour l'être davantage"
|
||||
|
||||
#: src/xz/message.c:1222
|
||||
msgid " -Q, --no-warn make warnings not affect the exit status"
|
||||
msgstr " -Q, --no-warn les avertissements ne modifient pas le code de sortie"
|
||||
|
||||
#: src/xz/message.c:1224
|
||||
msgid " --robot use machine-parsable messages (useful for scripts)"
|
||||
msgstr ""
|
||||
" --robot utiliser des messages lisibles par un programme\n"
|
||||
" (utile pour les scripts)"
|
||||
|
||||
#: src/xz/message.c:1227
|
||||
msgid ""
|
||||
" --info-memory display the total amount of RAM and the currently active\n"
|
||||
" memory usage limits, and exit"
|
||||
msgstr ""
|
||||
" --info-memory afficher la quantité totale de RAM ainsi que la limite\n"
|
||||
" actuelle d'utilisation mémoire puis quitter"
|
||||
|
||||
#: src/xz/message.c:1230
|
||||
msgid ""
|
||||
" -h, --help display the short help (lists only the basic options)\n"
|
||||
" -H, --long-help display this long help and exit"
|
||||
msgstr ""
|
||||
" -h, --help afficher l'aide courte (ne liste que les options de base)\n"
|
||||
" -H, --long-help afficher l'aide longue (ceci) puis quitter"
|
||||
|
||||
#: src/xz/message.c:1234
|
||||
msgid ""
|
||||
" -h, --help display this short help and exit\n"
|
||||
" -H, --long-help display the long help (lists also the advanced options)"
|
||||
msgstr ""
|
||||
" -h, --help afficher l'aide courte (ceci) puis quitter\n"
|
||||
" -H, --long-help afficher l'aide longue (liste aussi les options avancées)"
|
||||
|
||||
#: src/xz/message.c:1239
|
||||
msgid " -V, --version display the version number and exit"
|
||||
msgstr " -V, --version afficher le numéro de version puis quitter"
|
||||
|
||||
#: src/xz/message.c:1241
|
||||
msgid ""
|
||||
"\n"
|
||||
"With no FILE, or when FILE is -, read standard input.\n"
|
||||
msgstr ""
|
||||
"\n"
|
||||
"Sans FILE ou quand FILE est -, lire l'entrée standard.\n"
|
||||
|
||||
#. TRANSLATORS: This message indicates the bug reporting address
|
||||
#. for this package. Please add _another line_ saying
|
||||
#. "Report translation bugs to <...>\n" with the email or WWW
|
||||
#. address for translation bugs. Thanks.
|
||||
#: src/xz/message.c:1247
|
||||
#, c-format
|
||||
msgid "Report bugs to <%s> (in English or Finnish).\n"
|
||||
msgstr ""
|
||||
"Signaler les bogues à <%s> (en anglais ou en finlandais).\n"
|
||||
"Signaler les bogues de traduction à <adrien@notk.org>.\n"
|
||||
|
||||
#: src/xz/message.c:1249
|
||||
#, c-format
|
||||
msgid "%s home page: <%s>\n"
|
||||
msgstr "Page du projet %s : <%s>\n"
|
||||
|
||||
#: src/xz/message.c:1253
|
||||
msgid "THIS IS A DEVELOPMENT VERSION NOT INTENDED FOR PRODUCTION USE."
|
||||
msgstr ""
|
||||
|
||||
#: src/xz/options.c:86
|
||||
#, c-format
|
||||
msgid "%s: Options must be `name=value' pairs separated with commas"
|
||||
msgstr "%s: Les options doivent être des paires `nom=valeur' séparées par des virgules"
|
||||
|
||||
#: src/xz/options.c:93
|
||||
#, c-format
|
||||
msgid "%s: Invalid option name"
|
||||
msgstr "%s : Nom d'option invalide"
|
||||
|
||||
#: src/xz/options.c:113
|
||||
#, c-format
|
||||
msgid "%s: Invalid option value"
|
||||
msgstr "%s : Valeur d'option invalide"
|
||||
|
||||
#: src/xz/options.c:247
|
||||
#, c-format
|
||||
msgid "Unsupported LZMA1/LZMA2 preset: %s"
|
||||
msgstr "Préréglage LZMA1/LZMA2 non reconnu : %s"
|
||||
|
||||
#: src/xz/options.c:355
|
||||
msgid "The sum of lc and lp must not exceed 4"
|
||||
msgstr "La somme de lc et lp ne doit pas dépasser 4"
|
||||
|
||||
#: src/xz/options.c:359
|
||||
#, c-format
|
||||
msgid "The selected match finder requires at least nice=%<PRIu32>"
|
||||
msgstr "Le `match finder' choisi nécessite au moins nice=%<PRIu32>"
|
||||
|
||||
#: src/xz/suffix.c:133 src/xz/suffix.c:258
|
||||
#, c-format
|
||||
msgid "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout"
|
||||
msgstr "%s : Avec --format=raw, --suffix=.SUF est nécessaire sauf lors de l'écriture vers stdout"
|
||||
|
||||
#: src/xz/suffix.c:164
|
||||
#, c-format
|
||||
msgid "%s: Filename has an unknown suffix, skipping"
|
||||
msgstr "%s : Le fichier a un suffixe inconnu, ignoré"
|
||||
|
||||
#: src/xz/suffix.c:185
|
||||
#, c-format
|
||||
msgid "%s: File already has `%s' suffix, skipping"
|
||||
msgstr "%s : Le fichier a déjà le suffixe '%s', ignoré"
|
||||
|
||||
#: src/xz/suffix.c:393
|
||||
#, c-format
|
||||
msgid "%s: Invalid filename suffix"
|
||||
msgstr "%s: Suffixe de nom de fichier invalide"
|
||||
|
||||
#: src/xz/util.c:71
|
||||
#, c-format
|
||||
msgid "%s: Value is not a non-negative decimal integer"
|
||||
msgstr "%s : La valeur n'est pas un entier décimal non négatif"
|
||||
|
||||
#: src/xz/util.c:113
|
||||
#, c-format
|
||||
msgid "%s: Invalid multiplier suffix"
|
||||
msgstr "%s : Suffixe multiplicateur invalide"
|
||||
|
||||
#: src/xz/util.c:115
|
||||
msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)."
|
||||
msgstr "Les suffixes valides sont 'KiB' (2^10), 'MiB' (2^20) et 'GiB' (2^30)."
|
||||
|
||||
#: src/xz/util.c:132
|
||||
#, c-format
|
||||
msgid "Value of the option `%s' must be in the range [%<PRIu64>, %<PRIu64>]"
|
||||
msgstr "La valeur de l'option '%s' doit être inclue entre %<PRIu64> et %<PRIu64>"
|
||||
|
||||
#: src/xz/util.c:257
|
||||
msgid "Empty filename, skipping"
|
||||
msgstr "Nom de fichier vide, ignoré"
|
||||
|
||||
#: src/xz/util.c:271
|
||||
msgid "Compressed data cannot be read from a terminal"
|
||||
msgstr "Les données compressées ne peuvent pas être lues depuis un terminal"
|
||||
|
||||
#: src/xz/util.c:284
|
||||
msgid "Compressed data cannot be written to a terminal"
|
||||
msgstr "Les données compressées ne peuvent pas être écrites dans un terminal"
|
||||
|
||||
#: src/common/tuklib_exit.c:39
|
||||
msgid "Writing to standard output failed"
|
||||
msgstr "Impossible d'écrire vers la sortie standard"
|
||||
|
||||
#: src/common/tuklib_exit.c:42
|
||||
msgid "Unknown error"
|
||||
msgstr "Erreur inconnue"
|
||||
968
po/pl.po
Normal file
968
po/pl.po
Normal file
@@ -0,0 +1,968 @@
|
||||
# Polish translation for xz.
|
||||
# This file is in the public domain.
|
||||
# Jakub Bogusz <qboosh@pld-linux.org>, 2011-2014.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: xz 5.1.4\n"
|
||||
"Report-Msgid-Bugs-To: lasse.collin@tukaani.org\n"
|
||||
"POT-Creation-Date: 2014-09-14 21:56+0300\n"
|
||||
"PO-Revision-Date: 2014-10-15 20:53+0200\n"
|
||||
"Last-Translator: Jakub Bogusz <qboosh@pld-linux.org>\n"
|
||||
"Language-Team: Polish <translation-team-pl@lists.sourceforge.net>\n"
|
||||
"Language: pl\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
|
||||
|
||||
#: src/xz/args.c:63
|
||||
#, c-format
|
||||
msgid "%s: Invalid argument to --block-list"
|
||||
msgstr "%s: Błędny argument dla --block-list"
|
||||
|
||||
#: src/xz/args.c:73
|
||||
#, c-format
|
||||
msgid "%s: Too many arguments to --block-list"
|
||||
msgstr "%s: Zbyt dużo argumentów dla --block-list"
|
||||
|
||||
#: src/xz/args.c:102
|
||||
msgid "0 can only be used as the last element in --block-list"
|
||||
msgstr "0 w --block-list może być użyte wyłącznie jako ostatni element"
|
||||
|
||||
#: src/xz/args.c:406
|
||||
#, c-format
|
||||
msgid "%s: Unknown file format type"
|
||||
msgstr "%s: Nieznany typ formatu pliku"
|
||||
|
||||
#: src/xz/args.c:429 src/xz/args.c:437
|
||||
#, c-format
|
||||
msgid "%s: Unsupported integrity check type"
|
||||
msgstr "%s: Nieobsługiwany typ kontroli spójności"
|
||||
|
||||
#: src/xz/args.c:473
|
||||
msgid "Only one file can be specified with `--files' or `--files0'."
|
||||
msgstr "Wraz z opcją `--files' lub `--files0' można podać tylko jeden plik."
|
||||
|
||||
#: src/xz/args.c:541
|
||||
#, c-format
|
||||
msgid "The environment variable %s contains too many arguments"
|
||||
msgstr "Zmienna środowiskowa %s zawiera zbyt dużo argumentów"
|
||||
|
||||
#: src/xz/coder.c:110
|
||||
msgid "Maximum number of filters is four"
|
||||
msgstr "Maksymalna liczba filtrów to cztery"
|
||||
|
||||
#: src/xz/coder.c:129
|
||||
msgid "Memory usage limit is too low for the given filter setup."
|
||||
msgstr "Limit użycia pamięci jest zbyt mały dla podanej konfiguracji filtra."
|
||||
|
||||
#: src/xz/coder.c:159
|
||||
msgid "Using a preset in raw mode is discouraged."
|
||||
msgstr "Użycie ustawień predefiniowanych w trybie surowym jest odradzane."
|
||||
|
||||
#: src/xz/coder.c:161
|
||||
msgid "The exact options of the presets may vary between software versions."
|
||||
msgstr "Dokładne opcje ustawień predefiniowanych mogą różnić się między wersjami oprogramowania."
|
||||
|
||||
#: src/xz/coder.c:184
|
||||
msgid "The .lzma format supports only the LZMA1 filter"
|
||||
msgstr "Format .lzma obsługuje tylko filtr LZMA1"
|
||||
|
||||
#: src/xz/coder.c:192
|
||||
msgid "LZMA1 cannot be used with the .xz format"
|
||||
msgstr "LZMA1 nie może być używany z formatem .xz"
|
||||
|
||||
#: src/xz/coder.c:209
|
||||
msgid "The filter chain is incompatible with --flush-timeout"
|
||||
msgstr "Łańcuch filtrów jest niezgodny z --flush-timeout"
|
||||
|
||||
#: src/xz/coder.c:215
|
||||
msgid "Switching to single-threaded mode due to --flush-timeout"
|
||||
msgstr "Przełączanie w tryb jednowątkowy z powodu --flush-timeout"
|
||||
|
||||
#: src/xz/coder.c:234
|
||||
#, c-format
|
||||
msgid "Using up to %<PRIu32> threads."
|
||||
msgstr "Maksymalna liczba używanych wątków: %<PRIu32>."
|
||||
|
||||
#: src/xz/coder.c:247
|
||||
msgid "Unsupported filter chain or filter options"
|
||||
msgstr "Nieobsługiwany łańcuch filtrów lub opcje filtra"
|
||||
|
||||
#: src/xz/coder.c:255
|
||||
#, c-format
|
||||
msgid "Decompression will need %s MiB of memory."
|
||||
msgstr "Dekompresja będzie wymagała %s MiB pamięci."
|
||||
|
||||
#: src/xz/coder.c:290
|
||||
#, c-format
|
||||
msgid "Adjusted the number of threads from %s to %s to not exceed the memory usage limit of %s MiB"
|
||||
msgstr "Skorygowano liczbę wątków z %s do %s, aby nie przekroczyć limitu użycia pamięci %s MiB"
|
||||
|
||||
#: src/xz/coder.c:344
|
||||
#, c-format
|
||||
msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB"
|
||||
msgstr "Skorygowano rozmiar słownika LZMA%c z %s MiB do %s MiB aby nie przekroczyć limitu użycia pamięci %s MiB"
|
||||
|
||||
#: src/xz/file_io.c:90
|
||||
#, c-format
|
||||
msgid "Error creating a pipe: %s"
|
||||
msgstr "Błąd tworzenia potoku: %s"
|
||||
|
||||
#: src/xz/file_io.c:166
|
||||
#, c-format
|
||||
msgid "%s: poll() failed: %s"
|
||||
msgstr "%s: poll() nie powiodło się: %s"
|
||||
|
||||
#. TRANSLATORS: When compression or decompression finishes,
|
||||
#. and xz is going to remove the source file, xz first checks
|
||||
#. if the source file still exists, and if it does, does its
|
||||
#. device and inode numbers match what xz saw when it opened
|
||||
#. the source file. If these checks fail, this message is
|
||||
#. shown, %s being the filename, and the file is not deleted.
|
||||
#. The check for device and inode numbers is there, because
|
||||
#. it is possible that the user has put a new file in place
|
||||
#. of the original file, and in that case it obviously
|
||||
#. shouldn't be removed.
|
||||
#: src/xz/file_io.c:236
|
||||
#, c-format
|
||||
msgid "%s: File seems to have been moved, not removing"
|
||||
msgstr "%s: Plik wygląda na przeniesiony, nie zostanie usunięty"
|
||||
|
||||
#: src/xz/file_io.c:243 src/xz/file_io.c:761
|
||||
#, c-format
|
||||
msgid "%s: Cannot remove: %s"
|
||||
msgstr "%s: Nie można usunąć: %s"
|
||||
|
||||
#: src/xz/file_io.c:268
|
||||
#, c-format
|
||||
msgid "%s: Cannot set the file owner: %s"
|
||||
msgstr "%s: Nie można ustawić właściciela pliku: %s"
|
||||
|
||||
#: src/xz/file_io.c:274
|
||||
#, c-format
|
||||
msgid "%s: Cannot set the file group: %s"
|
||||
msgstr "%s: Nie można ustawić grupy pliku: %s"
|
||||
|
||||
#: src/xz/file_io.c:293
|
||||
#, c-format
|
||||
msgid "%s: Cannot set the file permissions: %s"
|
||||
msgstr "%s: Nie można ustawić uprawnień pliku: %s"
|
||||
|
||||
#: src/xz/file_io.c:399
|
||||
#, c-format
|
||||
msgid "Error getting the file status flags from standard input: %s"
|
||||
msgstr "Błąd podczas pobierania flag stanu pliku ze standardowego wejścia: %s"
|
||||
|
||||
#: src/xz/file_io.c:408
|
||||
#, c-format
|
||||
msgid "Error setting O_NONBLOCK on standard input: %s"
|
||||
msgstr "Błąd podczas ustawiania O_NONBLOCK dla standardowego wejścia: %s"
|
||||
|
||||
#: src/xz/file_io.c:460 src/xz/file_io.c:522
|
||||
#, c-format
|
||||
msgid "%s: Is a symbolic link, skipping"
|
||||
msgstr "%s: Jest dowiązaniem symbolicznym, pominięto"
|
||||
|
||||
#: src/xz/file_io.c:551
|
||||
#, c-format
|
||||
msgid "%s: Is a directory, skipping"
|
||||
msgstr "%s: Jest katalogiem, pominięto"
|
||||
|
||||
#: src/xz/file_io.c:557
|
||||
#, c-format
|
||||
msgid "%s: Not a regular file, skipping"
|
||||
msgstr "%s: Nie jest zwykłym plikiem, pominięto"
|
||||
|
||||
#: src/xz/file_io.c:574
|
||||
#, c-format
|
||||
msgid "%s: File has setuid or setgid bit set, skipping"
|
||||
msgstr "%s: Plik ma ustawiony bit setuid lub setgid, pominięto"
|
||||
|
||||
#: src/xz/file_io.c:581
|
||||
#, c-format
|
||||
msgid "%s: File has sticky bit set, skipping"
|
||||
msgstr "%s: Plik ma ustawiony bit sticky, pominięto"
|
||||
|
||||
#: src/xz/file_io.c:588
|
||||
#, c-format
|
||||
msgid "%s: Input file has more than one hard link, skipping"
|
||||
msgstr "%s: Plik wejściowy ma więcej niż jedno dowiązanie zwykłe, pominięto"
|
||||
|
||||
#: src/xz/file_io.c:668
|
||||
#, c-format
|
||||
msgid "Error restoring the status flags to standard input: %s"
|
||||
msgstr "Błąd podczas odtwarzania flag stanu dla standardowego wejścia: %s"
|
||||
|
||||
#: src/xz/file_io.c:714
|
||||
#, c-format
|
||||
msgid "Error getting the file status flags from standard output: %s"
|
||||
msgstr "Błąd podczas pobierania flag stanu pliku ze standardowego wyjścia: %s"
|
||||
|
||||
#: src/xz/file_io.c:723
|
||||
#, c-format
|
||||
msgid "Error setting O_NONBLOCK on standard output: %s"
|
||||
msgstr "Błąd podczas ustawiania O_NONBLOCK dla standardowego wyjścia: %s"
|
||||
|
||||
#: src/xz/file_io.c:896
|
||||
#, c-format
|
||||
msgid "Error restoring the O_APPEND flag to standard output: %s"
|
||||
msgstr "Błąd podczas odtwarzania flagi O_APPEND dla standardowego wyjścia: %s"
|
||||
|
||||
#: src/xz/file_io.c:908
|
||||
#, c-format
|
||||
msgid "%s: Closing the file failed: %s"
|
||||
msgstr "%s: Zamknięcie pliku nie powiodło się: %s"
|
||||
|
||||
#: src/xz/file_io.c:944 src/xz/file_io.c:1170
|
||||
#, c-format
|
||||
msgid "%s: Seeking failed when trying to create a sparse file: %s"
|
||||
msgstr "%s: Zmiana pozycji nie powiodła się podczas próby utworzenia pliku rzadkiego: %s"
|
||||
|
||||
#: src/xz/file_io.c:1039
|
||||
#, c-format
|
||||
msgid "%s: Read error: %s"
|
||||
msgstr "%s: Błąd odczytu: %s"
|
||||
|
||||
#: src/xz/file_io.c:1059
|
||||
#, c-format
|
||||
msgid "%s: Error seeking the file: %s"
|
||||
msgstr "%s: Błąd podczas zmiany pozycji w pliku: %s"
|
||||
|
||||
#: src/xz/file_io.c:1069
|
||||
#, c-format
|
||||
msgid "%s: Unexpected end of file"
|
||||
msgstr "%s: Nieoczekiwany koniec pliku"
|
||||
|
||||
#: src/xz/file_io.c:1128
|
||||
#, c-format
|
||||
msgid "%s: Write error: %s"
|
||||
msgstr "%s: Błąd zapisu: %s"
|
||||
|
||||
#: src/xz/hardware.c:107
|
||||
msgid "Disabled"
|
||||
msgstr "Wyłączony"
|
||||
|
||||
#. TRANSLATORS: Test with "xz --info-memory" to see if
|
||||
#. the alignment looks nice.
|
||||
#: src/xz/hardware.c:126
|
||||
msgid "Total amount of physical memory (RAM): "
|
||||
msgstr "Całkowita ilość pamięci fizycznej (RAM): "
|
||||
|
||||
#: src/xz/hardware.c:128
|
||||
msgid "Memory usage limit for compression: "
|
||||
msgstr "Limit użycia pamięci dla kompresji: "
|
||||
|
||||
#: src/xz/hardware.c:130
|
||||
msgid "Memory usage limit for decompression: "
|
||||
msgstr "Limit użycia pamięci dla dekompresji: "
|
||||
|
||||
#. TRANSLATORS: Indicates that there is no integrity check.
|
||||
#. This string is used in tables, so the width must not
|
||||
#. exceed ten columns with a fixed-width font.
|
||||
#: src/xz/list.c:65
|
||||
msgid "None"
|
||||
msgstr "Brak"
|
||||
|
||||
#. TRANSLATORS: Indicates that integrity check name is not known,
|
||||
#. but the Check ID is known (here 2). This and other "Unknown-N"
|
||||
#. strings are used in tables, so the width must not exceed ten
|
||||
#. columns with a fixed-width font. It's OK to omit the dash if
|
||||
#. you need space for one extra letter, but don't use spaces.
|
||||
#: src/xz/list.c:72
|
||||
msgid "Unknown-2"
|
||||
msgstr "Nieznany-2"
|
||||
|
||||
#: src/xz/list.c:73
|
||||
msgid "Unknown-3"
|
||||
msgstr "Nieznany-3"
|
||||
|
||||
#: src/xz/list.c:75
|
||||
msgid "Unknown-5"
|
||||
msgstr "Nieznany-5"
|
||||
|
||||
#: src/xz/list.c:76
|
||||
msgid "Unknown-6"
|
||||
msgstr "Nieznany-6"
|
||||
|
||||
#: src/xz/list.c:77
|
||||
msgid "Unknown-7"
|
||||
msgstr "Nieznany-7"
|
||||
|
||||
#: src/xz/list.c:78
|
||||
msgid "Unknown-8"
|
||||
msgstr "Nieznany-8"
|
||||
|
||||
#: src/xz/list.c:79
|
||||
msgid "Unknown-9"
|
||||
msgstr "Nieznany-9"
|
||||
|
||||
#: src/xz/list.c:81
|
||||
msgid "Unknown-11"
|
||||
msgstr "Nieznany11"
|
||||
|
||||
#: src/xz/list.c:82
|
||||
msgid "Unknown-12"
|
||||
msgstr "Nieznany12"
|
||||
|
||||
#: src/xz/list.c:83
|
||||
msgid "Unknown-13"
|
||||
msgstr "Nieznany13"
|
||||
|
||||
#: src/xz/list.c:84
|
||||
msgid "Unknown-14"
|
||||
msgstr "Nieznany14"
|
||||
|
||||
#: src/xz/list.c:85
|
||||
msgid "Unknown-15"
|
||||
msgstr "Nieznany15"
|
||||
|
||||
#: src/xz/list.c:153
|
||||
#, c-format
|
||||
msgid "%s: File is empty"
|
||||
msgstr "%s: Plik jest pusty"
|
||||
|
||||
#: src/xz/list.c:158
|
||||
#, c-format
|
||||
msgid "%s: Too small to be a valid .xz file"
|
||||
msgstr "%s: Za mały na poprawny plik .xz"
|
||||
|
||||
#. TRANSLATORS: These are column headings. From Strms (Streams)
|
||||
#. to Ratio, the columns are right aligned. Check and Filename
|
||||
#. are left aligned. If you need longer words, it's OK to
|
||||
#. use two lines here. Test with "xz -l foo.xz".
|
||||
#: src/xz/list.c:671
|
||||
msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename"
|
||||
msgstr "Strum. Bloki Spakowany Rozpakowany Wsp. Kontrola Nazwa pliku"
|
||||
|
||||
#: src/xz/list.c:711
|
||||
#, c-format
|
||||
msgid " Streams: %s\n"
|
||||
msgstr " Strumienie: %s\n"
|
||||
|
||||
#: src/xz/list.c:713
|
||||
#, c-format
|
||||
msgid " Blocks: %s\n"
|
||||
msgstr " Bloki: %s\n"
|
||||
|
||||
#: src/xz/list.c:715
|
||||
#, c-format
|
||||
msgid " Compressed size: %s\n"
|
||||
msgstr " Rozmiar spakowany: %s\n"
|
||||
|
||||
#: src/xz/list.c:718
|
||||
#, c-format
|
||||
msgid " Uncompressed size: %s\n"
|
||||
msgstr " Rozmiar rozpakowany: %s\n"
|
||||
|
||||
#: src/xz/list.c:721
|
||||
#, c-format
|
||||
msgid " Ratio: %s\n"
|
||||
msgstr " Współczynnik: %s\n"
|
||||
|
||||
#: src/xz/list.c:723
|
||||
#, c-format
|
||||
msgid " Check: %s\n"
|
||||
msgstr " Kontrola spójności: %s\n"
|
||||
|
||||
#: src/xz/list.c:724
|
||||
#, c-format
|
||||
msgid " Stream padding: %s\n"
|
||||
msgstr " Wyrównanie strumienia: %s\n"
|
||||
|
||||
#. TRANSLATORS: The second line is column headings. All except
|
||||
#. Check are right aligned; Check is left aligned. Test with
|
||||
#. "xz -lv foo.xz".
|
||||
#: src/xz/list.c:752
|
||||
msgid ""
|
||||
" Streams:\n"
|
||||
" Stream Blocks CompOffset UncompOffset CompSize UncompSize Ratio Check Padding"
|
||||
msgstr ""
|
||||
" Strumienie:\n"
|
||||
" Strumień Bloki Offset spak. Offset rozp. Rozm.spak. Rozm.rozp. Wsp. Kontrola Wyrównanie"
|
||||
|
||||
#. TRANSLATORS: The second line is column headings. All
|
||||
#. except Check are right aligned; Check is left aligned.
|
||||
#: src/xz/list.c:807
|
||||
#, c-format
|
||||
msgid ""
|
||||
" Blocks:\n"
|
||||
" Stream Block CompOffset UncompOffset TotalSize UncompSize Ratio Check"
|
||||
msgstr ""
|
||||
" Bloki:\n"
|
||||
" Strumień Blok Offset spak. Offset rozp. Rozm.całkowity Rozm.rozp. Wsp. Kontrola"
|
||||
|
||||
#. TRANSLATORS: These are additional column headings
|
||||
#. for the most verbose listing mode. CheckVal
|
||||
#. (Check value), Flags, and Filters are left aligned.
|
||||
#. Header (Block Header Size), CompSize, and MemUsage
|
||||
#. are right aligned. %*s is replaced with 0-120
|
||||
#. spaces to make the CheckVal column wide enough.
|
||||
#. Test with "xz -lvv foo.xz".
|
||||
#: src/xz/list.c:819
|
||||
#, c-format
|
||||
msgid " CheckVal %*s Header Flags CompSize MemUsage Filters"
|
||||
msgstr " S.kontr. %*sNagłówek Flagi Rozm. spak. Uż.pamięci Filtry"
|
||||
|
||||
#: src/xz/list.c:897 src/xz/list.c:1072
|
||||
#, c-format
|
||||
msgid " Memory needed: %s MiB\n"
|
||||
msgstr " Wymagana pamięć: %s MiB\n"
|
||||
|
||||
#: src/xz/list.c:899 src/xz/list.c:1074
|
||||
#, c-format
|
||||
msgid " Sizes in headers: %s\n"
|
||||
msgstr " Rozmiar w nagłówkach: %s\n"
|
||||
|
||||
#: src/xz/list.c:900 src/xz/list.c:1075
|
||||
msgid "Yes"
|
||||
msgstr "Tak"
|
||||
|
||||
#: src/xz/list.c:900 src/xz/list.c:1075
|
||||
msgid "No"
|
||||
msgstr "Nie"
|
||||
|
||||
#: src/xz/list.c:901 src/xz/list.c:1076
|
||||
#, c-format
|
||||
msgid " Minimum XZ Utils version: %s\n"
|
||||
msgstr " Minimalna wersja XZ Utils: %s\n"
|
||||
|
||||
#. TRANSLATORS: %s is an integer. Only the plural form of this
|
||||
#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz".
|
||||
#: src/xz/list.c:1051
|
||||
#, c-format
|
||||
msgid "%s file\n"
|
||||
msgid_plural "%s files\n"
|
||||
msgstr[0] "%s plik\n"
|
||||
msgstr[1] "%s pliki\n"
|
||||
msgstr[2] "%s plików\n"
|
||||
|
||||
#: src/xz/list.c:1064
|
||||
msgid "Totals:"
|
||||
msgstr "Sumarycznie:"
|
||||
|
||||
#: src/xz/list.c:1065
|
||||
#, c-format
|
||||
msgid " Number of files: %s\n"
|
||||
msgstr " Liczba plików: %s\n"
|
||||
|
||||
#: src/xz/list.c:1140
|
||||
msgid "--list works only on .xz files (--format=xz or --format=auto)"
|
||||
msgstr "--list działa tylko z plikami .xz (--format=xz lub --format=auto)"
|
||||
|
||||
#: src/xz/list.c:1146
|
||||
msgid "--list does not support reading from standard input"
|
||||
msgstr "--list nie obsługuje odczytu ze standardowego wejścia"
|
||||
|
||||
#: src/xz/main.c:89
|
||||
#, c-format
|
||||
msgid "%s: Error reading filenames: %s"
|
||||
msgstr "%s: Błąd odczytu nazw plików: %s"
|
||||
|
||||
#: src/xz/main.c:96
|
||||
#, c-format
|
||||
msgid "%s: Unexpected end of input when reading filenames"
|
||||
msgstr "%s: Nieoczekiwany koniec wejścia podczas odczytu nazw plików"
|
||||
|
||||
#: src/xz/main.c:120
|
||||
#, c-format
|
||||
msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?"
|
||||
msgstr "%s: Napotkano znak NUL podczas odczytu nazw plików; może miało być `--files0' zamiast `--files'?"
|
||||
|
||||
#: src/xz/main.c:174
|
||||
msgid "Compression and decompression with --robot are not supported yet."
|
||||
msgstr "Kompresja i dekompresja z opcją --robot nie jest jeszcze obsługiwana."
|
||||
|
||||
#: src/xz/main.c:231
|
||||
msgid "Cannot read data from standard input when reading filenames from standard input"
|
||||
msgstr "Nie można odczytać danych ze standardowego wejścia przy czytaniu nazw plików ze standardowego wejścia"
|
||||
|
||||
#. TRANSLATORS: This is the program name in the beginning
|
||||
#. of the line in messages. Usually it becomes "xz: ".
|
||||
#. This is a translatable string because French needs
|
||||
#. a space before a colon.
|
||||
#: src/xz/message.c:713
|
||||
#, c-format
|
||||
msgid "%s: "
|
||||
msgstr "%s: "
|
||||
|
||||
#: src/xz/message.c:776 src/xz/message.c:826
|
||||
msgid "Internal error (bug)"
|
||||
msgstr "Błąd wewnętrzny"
|
||||
|
||||
#: src/xz/message.c:783
|
||||
msgid "Cannot establish signal handlers"
|
||||
msgstr "Nie można ustawić obsługi sygnałów"
|
||||
|
||||
#: src/xz/message.c:792
|
||||
msgid "No integrity check; not verifying file integrity"
|
||||
msgstr "Brak kontroli spójności; poprawność plików nie będzie weryfikowana"
|
||||
|
||||
#: src/xz/message.c:795
|
||||
msgid "Unsupported type of integrity check; not verifying file integrity"
|
||||
msgstr "Nieobsługiwany typ kontroli spójności; poprawność plików nie będzie weryfikowana"
|
||||
|
||||
#: src/xz/message.c:802
|
||||
msgid "Memory usage limit reached"
|
||||
msgstr "Osiągnięto limit użycia pamięci"
|
||||
|
||||
#: src/xz/message.c:805
|
||||
msgid "File format not recognized"
|
||||
msgstr "Nie rozpoznany format pliku"
|
||||
|
||||
#: src/xz/message.c:808
|
||||
msgid "Unsupported options"
|
||||
msgstr "Nieobsługiwane opcje"
|
||||
|
||||
#: src/xz/message.c:811
|
||||
msgid "Compressed data is corrupt"
|
||||
msgstr "Dane skompresowane są uszkodzone"
|
||||
|
||||
#: src/xz/message.c:814
|
||||
msgid "Unexpected end of input"
|
||||
msgstr "Nieoczekiwany koniec wejścia"
|
||||
|
||||
#: src/xz/message.c:847
|
||||
#, c-format
|
||||
msgid "%s MiB of memory is required. The limiter is disabled."
|
||||
msgstr "Wymagane jest %s MiB pamięci. Limit jest wyłączony."
|
||||
|
||||
#: src/xz/message.c:875
|
||||
#, c-format
|
||||
msgid "%s MiB of memory is required. The limit is %s."
|
||||
msgstr "Wymagane jest %s MiB pamięci. Limit to %s."
|
||||
|
||||
#: src/xz/message.c:1042
|
||||
#, c-format
|
||||
msgid "%s: Filter chain: %s\n"
|
||||
msgstr "%s: Łańcuch filtrów: %s\n"
|
||||
|
||||
#: src/xz/message.c:1052
|
||||
#, c-format
|
||||
msgid "Try `%s --help' for more information."
|
||||
msgstr "Polecenie `%s --help' pokaże więcej informacji."
|
||||
|
||||
#: src/xz/message.c:1078
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Usage: %s [OPTION]... [FILE]...\n"
|
||||
"Compress or decompress FILEs in the .xz format.\n"
|
||||
"\n"
|
||||
msgstr ""
|
||||
"Składnia: %s [OPCJA]... [PLIK]...\n"
|
||||
"Kompresja lub dekompresja PLIKÓW w formacie .xz.\n"
|
||||
"\n"
|
||||
|
||||
#: src/xz/message.c:1085
|
||||
msgid "Mandatory arguments to long options are mandatory for short options too.\n"
|
||||
msgstr ""
|
||||
"Argumenty obowiązkowe dla opcji długich są obowiązkowe również dla opcji\n"
|
||||
"krótkich.\n"
|
||||
|
||||
#: src/xz/message.c:1089
|
||||
msgid " Operation mode:\n"
|
||||
msgstr " Tryb pracy:\n"
|
||||
|
||||
#: src/xz/message.c:1092
|
||||
msgid ""
|
||||
" -z, --compress force compression\n"
|
||||
" -d, --decompress force decompression\n"
|
||||
" -t, --test test compressed file integrity\n"
|
||||
" -l, --list list information about .xz files"
|
||||
msgstr ""
|
||||
" -z, --compress wymuszenie kompresji\n"
|
||||
" -d, --decompress wymuszenie dekompresji\n"
|
||||
" -t, --test sprawdzenie spójności plików skompresowanych\n"
|
||||
" -l, --list wypisanie informacji o plikach .xz"
|
||||
|
||||
#: src/xz/message.c:1098
|
||||
msgid ""
|
||||
"\n"
|
||||
" Operation modifiers:\n"
|
||||
msgstr ""
|
||||
"\n"
|
||||
" Modyfikatory operacji:\n"
|
||||
|
||||
#: src/xz/message.c:1101
|
||||
msgid ""
|
||||
" -k, --keep keep (don't delete) input files\n"
|
||||
" -f, --force force overwrite of output file and (de)compress links\n"
|
||||
" -c, --stdout write to standard output and don't delete input files"
|
||||
msgstr ""
|
||||
" -k, --keep zachowanie (nieusuwanie) plików wejściowych\n"
|
||||
" -f, --force nadpisywanie plików wyjściowych i (de)kompresja dowiązań\n"
|
||||
" -c, --stdout zapis na standardowe wyjście, nieusuwanie plików wej."
|
||||
|
||||
#: src/xz/message.c:1107
|
||||
msgid ""
|
||||
" --single-stream decompress only the first stream, and silently\n"
|
||||
" ignore possible remaining input data"
|
||||
msgstr ""
|
||||
" --single-stream dekompresja tylko pierwszego strumienia, ciche\n"
|
||||
" zignorowanie pozostałych danych wejściowych"
|
||||
|
||||
#: src/xz/message.c:1110
|
||||
msgid ""
|
||||
" --no-sparse do not create sparse files when decompressing\n"
|
||||
" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n"
|
||||
" --files[=FILE] read filenames to process from FILE; if FILE is\n"
|
||||
" omitted, filenames are read from the standard input;\n"
|
||||
" filenames must be terminated with the newline character\n"
|
||||
" --files0[=FILE] like --files but use the null character as terminator"
|
||||
msgstr ""
|
||||
" --no-sparse nietworzenie plików rzadkich podczas dekompresji\n"
|
||||
" -S, --suffix=.ROZ użycie rozszerzenia `.ROZ' dla plików skompresowanych\n"
|
||||
" --files[=PLIK] odczyt nazw plików do przetworzenia z PLIKU; jeśli PLIK\n"
|
||||
" nie został podany, nazwy są czytane ze standardowego\n"
|
||||
" wejścia; muszą być zakończone znakiem nowej linii\n"
|
||||
" --files0[=PLIK] podobnie do --files, ale znakiem kończącym musi być NUL"
|
||||
|
||||
#: src/xz/message.c:1119
|
||||
msgid ""
|
||||
"\n"
|
||||
" Basic file format and compression options:\n"
|
||||
msgstr ""
|
||||
"\n"
|
||||
" Podstawowe opcje formatu pliku i kompresji:\n"
|
||||
|
||||
#: src/xz/message.c:1121
|
||||
msgid ""
|
||||
" -F, --format=FMT file format to encode or decode; possible values are\n"
|
||||
" `auto' (default), `xz', `lzma', and `raw'\n"
|
||||
" -C, --check=CHECK integrity check type: `none' (use with caution),\n"
|
||||
" `crc32', `crc64' (default), or `sha256'"
|
||||
msgstr ""
|
||||
" -F, --format=FORM format pliki do kodowania lub dekodowania; możliwe to\n"
|
||||
" `auto' (domyślny), `xz', 'lzma' i `raw'\n"
|
||||
" -C, --check=TEST typ kontroli spójności: `none' (ostrożnie!),\n"
|
||||
" `crc32', `crc64' (domyślny) lub `sha256'"
|
||||
|
||||
#: src/xz/message.c:1126
|
||||
msgid " --ignore-check don't verify the integrity check when decompressing"
|
||||
msgstr " --ignore-check bez kontroli sprawdzania integralności przy dekompresji"
|
||||
|
||||
#: src/xz/message.c:1130
|
||||
msgid ""
|
||||
" -0 ... -9 compression preset; default is 6; take compressor *and*\n"
|
||||
" decompressor memory usage into account before using 7-9!"
|
||||
msgstr ""
|
||||
" -0 ... -9 predefiniowane opcje kompresji; domyślna to 6; przed\n"
|
||||
" użyciem wartości 7-9 należy wziąć pod uwagę wykorzystanie\n"
|
||||
" pamięci przy kompresji *oraz* dekompresji!"
|
||||
|
||||
#: src/xz/message.c:1134
|
||||
msgid ""
|
||||
" -e, --extreme try to improve compression ratio by using more CPU time;\n"
|
||||
" does not affect decompressor memory requirements"
|
||||
msgstr ""
|
||||
" -e, --extreme próba poprawy współczynnika kompresji z użyciem większej\n"
|
||||
" ilości czasu procesora; nie wpływa na wymagania\n"
|
||||
" pamięciowe dekompresora"
|
||||
|
||||
#: src/xz/message.c:1138
|
||||
msgid ""
|
||||
" -T, --threads=NUM use at most NUM threads; the default is 1; set to 0\n"
|
||||
" to use as many threads as there are processor cores"
|
||||
msgstr ""
|
||||
" -T, --threads=ILE użycie maksymalnie ILU wątków; domyślnie 1; 0 oznacza\n"
|
||||
" tyle, ile jest rdzeni procesorów"
|
||||
|
||||
#: src/xz/message.c:1143
|
||||
msgid ""
|
||||
" --block-size=SIZE\n"
|
||||
" start a new .xz block after every SIZE bytes of input;\n"
|
||||
" use this to set the block size for threaded compression"
|
||||
msgstr ""
|
||||
" --block-size=ROZMIAR\n"
|
||||
" rozpoczęcie nowego bloku .xz co ROZMIAR bajtów wejścia;\n"
|
||||
" opcja służy do ustawienia rozmiaru bloku dla kompresji\n"
|
||||
" wielowątkowej"
|
||||
|
||||
#: src/xz/message.c:1147
|
||||
msgid ""
|
||||
" --block-list=SIZES\n"
|
||||
" start a new .xz block after the given comma-separated\n"
|
||||
" intervals of uncompressed data"
|
||||
msgstr ""
|
||||
" --block-list=ROZMIARY\n"
|
||||
" rozpoczęcie nowego bloku .xz po rozdzielonych przecinkiem\n"
|
||||
" przedziałach danych nieskompresowanych"
|
||||
|
||||
#: src/xz/message.c:1151
|
||||
msgid ""
|
||||
" --flush-timeout=TIMEOUT\n"
|
||||
" when compressing, if more than TIMEOUT milliseconds has\n"
|
||||
" passed since the previous flush and reading more input\n"
|
||||
" would block, all pending data is flushed out"
|
||||
msgstr ""
|
||||
" --flush-timeout=CZAS\n"
|
||||
" przy kompresji, jeśli minęło więcej niż CZAS milisekund\n"
|
||||
" ostatniegu zapisu bloku, a odczyt kolejnych danych byłby\n"
|
||||
" blokujący, wszystkie gotowe dane są zapisywane"
|
||||
|
||||
#: src/xz/message.c:1157
|
||||
#, no-c-format
|
||||
msgid ""
|
||||
" --memlimit-compress=LIMIT\n"
|
||||
" --memlimit-decompress=LIMIT\n"
|
||||
" -M, --memlimit=LIMIT\n"
|
||||
" set memory usage limit for compression, decompression,\n"
|
||||
" or both; LIMIT is in bytes, % of RAM, or 0 for defaults"
|
||||
msgstr ""
|
||||
" --memlimit-compress=LIMIT\n"
|
||||
" --memlimit-decompress=LIMIT\n"
|
||||
" -M, --memlimit=LIMIT\n"
|
||||
" ustawienie limitu użycia pamięci dla kompresji,\n"
|
||||
" dekompresji lub obu; LIMIT jest w bajtach, % RAM lub 0\n"
|
||||
" dla limitów domyślnych"
|
||||
|
||||
#: src/xz/message.c:1164
|
||||
msgid ""
|
||||
" --no-adjust if compression settings exceed the memory usage limit,\n"
|
||||
" give an error instead of adjusting the settings downwards"
|
||||
msgstr ""
|
||||
" --no-adjust jeśli ustawienia kompresji przekraczają limit użycia\n"
|
||||
" pamięci, zostanie zgłoszony błąd zamiast zmniejszania\n"
|
||||
" ustawień"
|
||||
|
||||
#: src/xz/message.c:1170
|
||||
msgid ""
|
||||
"\n"
|
||||
" Custom filter chain for compression (alternative for using presets):"
|
||||
msgstr ""
|
||||
"\n"
|
||||
" Łańcuch własnych filtrów do kompresji (alternatywa do używania -0 .. -9):"
|
||||
|
||||
#: src/xz/message.c:1179
|
||||
msgid ""
|
||||
"\n"
|
||||
" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n"
|
||||
" --lzma2[=OPTS] more of the following options (valid values; default):\n"
|
||||
" preset=PRE reset options to a preset (0-9[e])\n"
|
||||
" dict=NUM dictionary size (4KiB - 1536MiB; 8MiB)\n"
|
||||
" lc=NUM number of literal context bits (0-4; 3)\n"
|
||||
" lp=NUM number of literal position bits (0-4; 0)\n"
|
||||
" pb=NUM number of position bits (0-4; 2)\n"
|
||||
" mode=MODE compression mode (fast, normal; normal)\n"
|
||||
" nice=NUM nice length of a match (2-273; 64)\n"
|
||||
" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; bt4)\n"
|
||||
" depth=NUM maximum search depth; 0=automatic (default)"
|
||||
msgstr ""
|
||||
"\n"
|
||||
" --lzma1[=OPCJE] LZMA1 lub LZMA2; OPCJE to oddzielona przecinkami lista\n"
|
||||
" --lzma2[=OPCJE] zera lub więcej następujących opcji (w nawiasach wartości\n"
|
||||
" poprawne; domyślne):\n"
|
||||
" preset=PRE ustawienie opcji na predefiniowane (0-9[e])\n"
|
||||
" dict=ILE rozmiar słownika (4KiB - 1536MiB; 8MiB)\n"
|
||||
" lc=ILE liczba bitów kontekstu literału (0-4; 3)\n"
|
||||
" lp=ILE liczba bitów pozycji literału (0-4; 0)\n"
|
||||
" pp=ILE liczba bitów pozycji (0-4; 2)\n"
|
||||
" mode=TRYB tryb kompresji (fast, normal; normal)\n"
|
||||
" nice=ILE długość dopasowania (2-273; 64)\n"
|
||||
" mf=NAZWA dopasowywacz (hc3, hc4, bt2, bt3, bt4; bt4)\n"
|
||||
" depth=ILE maks. głębokość szukania; 0=auto (domyślne)"
|
||||
|
||||
#: src/xz/message.c:1194
|
||||
msgid ""
|
||||
"\n"
|
||||
" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n"
|
||||
" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n"
|
||||
" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n"
|
||||
" --arm[=OPTS] ARM BCJ filter (little endian only)\n"
|
||||
" --armthumb[=OPTS] ARM-Thumb BCJ filter (little endian only)\n"
|
||||
" --sparc[=OPTS] SPARC BCJ filter\n"
|
||||
" Valid OPTS for all BCJ filters:\n"
|
||||
" start=NUM start offset for conversions (default=0)"
|
||||
msgstr ""
|
||||
"\n"
|
||||
" --x86[=OPCJE] Filtr BCJ x86 (32-bitowy lub 64-bitowy)\n"
|
||||
" --powerpc[=OPCJE] Filtr BCJ PowerPC (tylko big-endian)\n"
|
||||
" --ia64[=OPCJE] Filtr BCJ IA-64 (Itanium)\n"
|
||||
" --arm[=OPCJE] Filtr BCJ ARM (tylko little-endian)\n"
|
||||
" --armthumb[=OPCJE] Filtr BCJ ARM-Thumb (tylko little-endian)\n"
|
||||
" --sparc[=OPCJE] Filtr BCJ SPARC\n"
|
||||
" Poprawne OPCJE dla wszystkich filtrów BCJ:\n"
|
||||
" start=ILE offset początku konwersji (domyślnie=0)"
|
||||
|
||||
#: src/xz/message.c:1206
|
||||
msgid ""
|
||||
"\n"
|
||||
" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n"
|
||||
" dist=NUM distance between bytes being subtracted\n"
|
||||
" from each other (1-256; 1)"
|
||||
msgstr ""
|
||||
"\n"
|
||||
" --delta[=OPCJE] Filtr delta; poprawne OPCJE (poprawne wart.; domyślne):\n"
|
||||
" dist=ILE odległość między bajtami odejmowanymi od\n"
|
||||
" siebie (1-256; 1)"
|
||||
|
||||
#: src/xz/message.c:1214
|
||||
msgid ""
|
||||
"\n"
|
||||
" Other options:\n"
|
||||
msgstr ""
|
||||
"\n"
|
||||
" Inne opcje:\n"
|
||||
|
||||
#: src/xz/message.c:1217
|
||||
msgid ""
|
||||
" -q, --quiet suppress warnings; specify twice to suppress errors too\n"
|
||||
" -v, --verbose be verbose; specify twice for even more verbose"
|
||||
msgstr ""
|
||||
" -q, --quiet pominięcie ostrzeżeń; dwukrotne podanie pomija też błędy\n"
|
||||
" -v, --verbose więcej informacji; dwukrotne podanie to jeszcze więcej"
|
||||
|
||||
#: src/xz/message.c:1222
|
||||
msgid " -Q, --no-warn make warnings not affect the exit status"
|
||||
msgstr " -Q, --no-warn ostrzeżenia nie mają wpływu na status zakończenia"
|
||||
|
||||
#: src/xz/message.c:1224
|
||||
msgid " --robot use machine-parsable messages (useful for scripts)"
|
||||
msgstr " --robot komunikaty w formacie dla maszyny (do skryptów)"
|
||||
|
||||
#: src/xz/message.c:1227
|
||||
msgid ""
|
||||
" --info-memory display the total amount of RAM and the currently active\n"
|
||||
" memory usage limits, and exit"
|
||||
msgstr ""
|
||||
" --info-memory wyświetlenie całkowitej ilości pamięci RAM oraz aktualnie\n"
|
||||
" aktywnych limitów pamięci i zakończenie pracy"
|
||||
|
||||
#: src/xz/message.c:1230
|
||||
msgid ""
|
||||
" -h, --help display the short help (lists only the basic options)\n"
|
||||
" -H, --long-help display this long help and exit"
|
||||
msgstr ""
|
||||
" -h, --help wyświetlenie krótkiego opisu (tylko podstawowe opcje)\n"
|
||||
" -H, --long-help wyświetlenie tego długiego opisu i zakończenie"
|
||||
|
||||
#: src/xz/message.c:1234
|
||||
msgid ""
|
||||
" -h, --help display this short help and exit\n"
|
||||
" -H, --long-help display the long help (lists also the advanced options)"
|
||||
msgstr ""
|
||||
" -h, --help wyświetlenie tego krótkiego opisu i zakończenie\n"
|
||||
" -H, --long-help wyświetlenie długiego opisu (także opcje zaawansowane)"
|
||||
|
||||
#: src/xz/message.c:1239
|
||||
msgid " -V, --version display the version number and exit"
|
||||
msgstr " -V, --version wyświetlenie informacji o wersji i zakończenie"
|
||||
|
||||
#: src/xz/message.c:1241
|
||||
msgid ""
|
||||
"\n"
|
||||
"With no FILE, or when FILE is -, read standard input.\n"
|
||||
msgstr ""
|
||||
"\n"
|
||||
"Jeśli nie podano PLIKU lub PLIK to -, czytane jest standardowe wejście.\n"
|
||||
|
||||
#. TRANSLATORS: This message indicates the bug reporting address
|
||||
#. for this package. Please add _another line_ saying
|
||||
#. "Report translation bugs to <...>\n" with the email or WWW
|
||||
#. address for translation bugs. Thanks.
|
||||
#: src/xz/message.c:1247
|
||||
#, c-format
|
||||
msgid "Report bugs to <%s> (in English or Finnish).\n"
|
||||
msgstr ""
|
||||
"Błędy prosimy zgłaszać na adres <%s>\n"
|
||||
"(w języku angielskim lub fińskim).\n"
|
||||
"Błędy w tłumaczeniu prosimy zgłaszać na adres\n"
|
||||
"<translation-team-pl@lists.sourceforge.net>.\n"
|
||||
|
||||
#: src/xz/message.c:1249
|
||||
#, c-format
|
||||
msgid "%s home page: <%s>\n"
|
||||
msgstr "Strona domowa %s: <%s>\n"
|
||||
|
||||
#: src/xz/message.c:1253
|
||||
msgid "THIS IS A DEVELOPMENT VERSION NOT INTENDED FOR PRODUCTION USE."
|
||||
msgstr "TA WERSJA JEST ROZWOJOWA, NIE PRZEZNACZONA DO UŻYTKU PRODUKCYJNEGO."
|
||||
|
||||
#: src/xz/options.c:86
|
||||
#, c-format
|
||||
msgid "%s: Options must be `name=value' pairs separated with commas"
|
||||
msgstr "%s: Opcje muszą być parami `nazwa=wartość' rozdzielonymi przecinkami"
|
||||
|
||||
#: src/xz/options.c:93
|
||||
#, c-format
|
||||
msgid "%s: Invalid option name"
|
||||
msgstr "%s: Błędna nazwa opcji"
|
||||
|
||||
#: src/xz/options.c:113
|
||||
#, c-format
|
||||
msgid "%s: Invalid option value"
|
||||
msgstr "%s: Błędna wartość opcji"
|
||||
|
||||
#: src/xz/options.c:247
|
||||
#, c-format
|
||||
msgid "Unsupported LZMA1/LZMA2 preset: %s"
|
||||
msgstr "Nieobsługiwane ustawienie predefiniowane LZMA1/LZMA2: %s"
|
||||
|
||||
#: src/xz/options.c:355
|
||||
msgid "The sum of lc and lp must not exceed 4"
|
||||
msgstr "Suma lc i lp nie może przekroczyć 4"
|
||||
|
||||
#: src/xz/options.c:359
|
||||
#, c-format
|
||||
msgid "The selected match finder requires at least nice=%<PRIu32>"
|
||||
msgstr "Wybrany dopasowywacz wymaga przynajmniej nice=%<PRIu32>"
|
||||
|
||||
#: src/xz/suffix.c:133 src/xz/suffix.c:258
|
||||
#, c-format
|
||||
msgid "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout"
|
||||
msgstr "%s: Przy --format=raw i zapisie do pliku wymagana jest opcja --suffix=.ROZ"
|
||||
|
||||
#: src/xz/suffix.c:164
|
||||
#, c-format
|
||||
msgid "%s: Filename has an unknown suffix, skipping"
|
||||
msgstr "%s: Nazwa pliku ma nieznane rozszerzenie, pominięto"
|
||||
|
||||
#: src/xz/suffix.c:185
|
||||
#, c-format
|
||||
msgid "%s: File already has `%s' suffix, skipping"
|
||||
msgstr "%s: Plik już ma rozszerzenie `%s', pominięto"
|
||||
|
||||
#: src/xz/suffix.c:393
|
||||
#, c-format
|
||||
msgid "%s: Invalid filename suffix"
|
||||
msgstr "%s: Błędne rozszerzenie nazwy pliku"
|
||||
|
||||
#: src/xz/util.c:71
|
||||
#, c-format
|
||||
msgid "%s: Value is not a non-negative decimal integer"
|
||||
msgstr "%s: Wartość nie jest nieujemną liczbą całkowitą"
|
||||
|
||||
#: src/xz/util.c:113
|
||||
#, c-format
|
||||
msgid "%s: Invalid multiplier suffix"
|
||||
msgstr "%s: Błędny przyrostek mnożnika"
|
||||
|
||||
#: src/xz/util.c:115
|
||||
msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)."
|
||||
msgstr "Poprawne przyrostki to `KiB' (2^10), `MiB' (2^20) i `GiB' (2^30)."
|
||||
|
||||
#: src/xz/util.c:132
|
||||
#, c-format
|
||||
msgid "Value of the option `%s' must be in the range [%<PRIu64>, %<PRIu64>]"
|
||||
msgstr "Wartość opcji `%s' musi być w przedziale [%<PRIu64>, %<PRIu64>]"
|
||||
|
||||
#: src/xz/util.c:257
|
||||
msgid "Empty filename, skipping"
|
||||
msgstr "Pusta nazwa pliku, pominięto"
|
||||
|
||||
#: src/xz/util.c:271
|
||||
msgid "Compressed data cannot be read from a terminal"
|
||||
msgstr "Dane skompresowane nie mogą być czytane z terminala"
|
||||
|
||||
#: src/xz/util.c:284
|
||||
msgid "Compressed data cannot be written to a terminal"
|
||||
msgstr "Dane skompresowane nie mogą być zapisywane na terminal"
|
||||
|
||||
#: src/common/tuklib_exit.c:39
|
||||
msgid "Writing to standard output failed"
|
||||
msgstr "Zapis na standardowe wyjście nie powiódł się"
|
||||
|
||||
#: src/common/tuklib_exit.c:42
|
||||
msgid "Unknown error"
|
||||
msgstr "Nieznany błąd"
|
||||
@@ -5,5 +5,38 @@
|
||||
## You can do whatever you want with this file.
|
||||
##
|
||||
|
||||
SUBDIRS = liblzma xz xzdec lzmainfo scripts
|
||||
EXTRA_DIST = common
|
||||
SUBDIRS = liblzma xzdec
|
||||
|
||||
if COND_XZ
|
||||
SUBDIRS += xz
|
||||
endif
|
||||
|
||||
if COND_LZMAINFO
|
||||
SUBDIRS += lzmainfo
|
||||
endif
|
||||
|
||||
if COND_SCRIPTS
|
||||
SUBDIRS += scripts
|
||||
endif
|
||||
|
||||
EXTRA_DIST = \
|
||||
common/common_w32res.rc \
|
||||
common/mythread.h \
|
||||
common/sysdefs.h \
|
||||
common/tuklib_common.h \
|
||||
common/tuklib_config.h \
|
||||
common/tuklib_cpucores.c \
|
||||
common/tuklib_cpucores.h \
|
||||
common/tuklib_exit.c \
|
||||
common/tuklib_exit.h \
|
||||
common/tuklib_gettext.h \
|
||||
common/tuklib_integer.h \
|
||||
common/tuklib_mbstr_fw.c \
|
||||
common/tuklib_mbstr.h \
|
||||
common/tuklib_mbstr_width.c \
|
||||
common/tuklib_open_stdxxx.c \
|
||||
common/tuklib_open_stdxxx.h \
|
||||
common/tuklib_physmem.c \
|
||||
common/tuklib_physmem.h \
|
||||
common/tuklib_progname.c \
|
||||
common/tuklib_progname.h
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file bswap.h
|
||||
/// \brief Byte swapping
|
||||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef LZMA_BSWAP_H
|
||||
#define LZMA_BSWAP_H
|
||||
|
||||
// NOTE: We assume that config.h is already #included.
|
||||
|
||||
// At least glibc has byteswap.h which contains inline assembly code for
|
||||
// byteswapping. Some systems have byteswap.h but lack one or more of the
|
||||
// bswap_xx macros/functions, which is why we check them separately even
|
||||
// if byteswap.h is available.
|
||||
|
||||
#ifdef HAVE_BYTESWAP_H
|
||||
# include <byteswap.h>
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_BSWAP_16
|
||||
# define bswap_16(num) \
|
||||
(((num) << 8) | ((num) >> 8))
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_BSWAP_32
|
||||
# define bswap_32(num) \
|
||||
( (((num) << 24) ) \
|
||||
| (((num) << 8) & UINT32_C(0x00FF0000)) \
|
||||
| (((num) >> 8) & UINT32_C(0x0000FF00)) \
|
||||
| (((num) >> 24) ) )
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_BSWAP_64
|
||||
# define bswap_64(num) \
|
||||
( (((num) << 56) ) \
|
||||
| (((num) << 40) & UINT64_C(0x00FF000000000000)) \
|
||||
| (((num) << 24) & UINT64_C(0x0000FF0000000000)) \
|
||||
| (((num) << 8) & UINT64_C(0x000000FF00000000)) \
|
||||
| (((num) >> 8) & UINT64_C(0x00000000FF000000)) \
|
||||
| (((num) >> 24) & UINT64_C(0x0000000000FF0000)) \
|
||||
| (((num) >> 40) & UINT64_C(0x000000000000FF00)) \
|
||||
| (((num) >> 56) ) )
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -17,9 +17,8 @@
|
||||
#define MY_VERSION LZMA_VERSION_MAJOR,LZMA_VERSION_MINOR,LZMA_VERSION_PATCH,MY_BUILD
|
||||
|
||||
#define MY_FILENAME MY_NAME MY_SUFFIX
|
||||
#define MY_COMPANY "Lasse Collin and Igor Pavlov"
|
||||
#define MY_COPYRIGHT "Public Domain by " MY_COMPANY
|
||||
#define MY_COMMENTS "http://tukaani.org/xz/"
|
||||
#define MY_COMPANY "The Tukaani Project <http://tukaani.org/>"
|
||||
#define MY_PRODUCT PACKAGE_NAME " <" PACKAGE_URL ">"
|
||||
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
@@ -35,14 +34,12 @@ BEGIN
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "Comments", MY_COMMENTS
|
||||
VALUE "CompanyName", MY_COMPANY
|
||||
VALUE "FileDescription", MY_DESC
|
||||
VALUE "FileVersion", LZMA_VERSION_STRING
|
||||
VALUE "InternalName", MY_NAME
|
||||
VALUE "LegalCopyright", MY_COPYRIGHT
|
||||
VALUE "OriginalFilename", MY_FILENAME
|
||||
VALUE "ProductName", PACKAGE_NAME
|
||||
VALUE "ProductName", MY_PRODUCT
|
||||
VALUE "ProductVersion", LZMA_VERSION_STRING
|
||||
END
|
||||
END
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file cpucores.h
|
||||
/// \brief Get the number of online CPU cores
|
||||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef CPUCORES_H
|
||||
#define CPUCORES_H
|
||||
|
||||
#if defined(HAVE_CPUCORES_SYSCONF)
|
||||
# include <unistd.h>
|
||||
|
||||
#elif defined(HAVE_CPUCORES_SYSCTL)
|
||||
# ifdef HAVE_SYS_PARAM_H
|
||||
# include <sys/param.h>
|
||||
# endif
|
||||
# ifdef HAVE_SYS_SYSCTL_H
|
||||
# include <sys/sysctl.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
static inline uint32_t
|
||||
cpucores(void)
|
||||
{
|
||||
uint32_t ret = 0;
|
||||
|
||||
#if defined(HAVE_CPUCORES_SYSCONF)
|
||||
const long cpus = sysconf(_SC_NPROCESSORS_ONLN);
|
||||
if (cpus > 0)
|
||||
ret = (uint32_t)(cpus);
|
||||
|
||||
#elif defined(HAVE_CPUCORES_SYSCTL)
|
||||
int name[2] = { CTL_HW, HW_NCPU };
|
||||
int cpus;
|
||||
size_t cpus_size = sizeof(cpus);
|
||||
if (!sysctl(name, &cpus, &cpus_size, NULL, NULL)
|
||||
&& cpus_size == sizeof(cpus) && cpus > 0)
|
||||
ret = (uint32_t)(cpus);
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,170 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file integer.h
|
||||
/// \brief Reading and writing integers from and to buffers
|
||||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef LZMA_INTEGER_H
|
||||
#define LZMA_INTEGER_H
|
||||
|
||||
// On big endian, we need byte swapping. These macros may be used outside
|
||||
// this file, so don't put these inside HAVE_FAST_UNALIGNED_ACCESS.
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
# include "bswap.h"
|
||||
# define integer_le_16(n) bswap_16(n)
|
||||
# define integer_le_32(n) bswap_32(n)
|
||||
# define integer_le_64(n) bswap_64(n)
|
||||
#else
|
||||
# define integer_le_16(n) (n)
|
||||
# define integer_le_32(n) (n)
|
||||
# define integer_le_64(n) (n)
|
||||
#endif
|
||||
|
||||
|
||||
// I'm aware of AC_CHECK_ALIGNED_ACCESS_REQUIRED from Autoconf archive, but
|
||||
// it's not useful here. We don't care if unaligned access is supported,
|
||||
// we care if it is fast. Some systems can emulate unaligned access in
|
||||
// software, which is horribly slow; we want to use byte-by-byte access on
|
||||
// such systems but the Autoconf test would detect such a system as
|
||||
// supporting unaligned access.
|
||||
//
|
||||
// NOTE: HAVE_FAST_UNALIGNED_ACCESS indicates only support for 16-bit and
|
||||
// 32-bit integer loads and stores. 64-bit integers may or may not work.
|
||||
// That's why 64-bit functions are commented out.
|
||||
//
|
||||
// TODO: Big endian PowerPC supports byte swapping load and store instructions
|
||||
// that also allow unaligned access. Inline assembler could be OK for that.
|
||||
//
|
||||
// Performance of these functions isn't that important until LZMA3, but it
|
||||
// doesn't hurt to have these ready already.
|
||||
#ifdef HAVE_FAST_UNALIGNED_ACCESS
|
||||
|
||||
static inline uint16_t
|
||||
integer_read_16(const uint8_t buf[static 2])
|
||||
{
|
||||
uint16_t ret = *(const uint16_t *)(buf);
|
||||
return integer_le_16(ret);
|
||||
}
|
||||
|
||||
|
||||
static inline uint32_t
|
||||
integer_read_32(const uint8_t buf[static 4])
|
||||
{
|
||||
uint32_t ret = *(const uint32_t *)(buf);
|
||||
return integer_le_32(ret);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
static inline uint64_t
|
||||
integer_read_64(const uint8_t buf[static 8])
|
||||
{
|
||||
uint64_t ret = *(const uint64_t *)(buf);
|
||||
return integer_le_64(ret);
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
static inline void
|
||||
integer_write_16(uint8_t buf[static 2], uint16_t num)
|
||||
{
|
||||
*(uint16_t *)(buf) = integer_le_16(num);
|
||||
}
|
||||
|
||||
|
||||
static inline void
|
||||
integer_write_32(uint8_t buf[static 4], uint32_t num)
|
||||
{
|
||||
*(uint32_t *)(buf) = integer_le_32(num);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
static inline void
|
||||
integer_write_64(uint8_t buf[static 8], uint64_t num)
|
||||
{
|
||||
*(uint64_t *)(buf) = integer_le_64(num);
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
#else
|
||||
|
||||
static inline uint16_t
|
||||
integer_read_16(const uint8_t buf[static 2])
|
||||
{
|
||||
uint16_t ret = buf[0] | (buf[1] << 8);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static inline uint32_t
|
||||
integer_read_32(const uint8_t buf[static 4])
|
||||
{
|
||||
uint32_t ret = buf[0];
|
||||
ret |= (uint32_t)(buf[1]) << 8;
|
||||
ret |= (uint32_t)(buf[2]) << 16;
|
||||
ret |= (uint32_t)(buf[3]) << 24;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
static inline uint64_t
|
||||
integer_read_64(const uint8_t buf[static 8])
|
||||
{
|
||||
uint64_t ret = buf[0];
|
||||
ret |= (uint64_t)(buf[1]) << 8;
|
||||
ret |= (uint64_t)(buf[2]) << 16;
|
||||
ret |= (uint64_t)(buf[3]) << 24;
|
||||
ret |= (uint64_t)(buf[4]) << 32;
|
||||
ret |= (uint64_t)(buf[5]) << 40;
|
||||
ret |= (uint64_t)(buf[6]) << 48;
|
||||
ret |= (uint64_t)(buf[7]) << 56;
|
||||
return ret;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
static inline void
|
||||
integer_write_16(uint8_t buf[static 2], uint16_t num)
|
||||
{
|
||||
buf[0] = (uint8_t)(num);
|
||||
buf[1] = (uint8_t)(num >> 8);
|
||||
}
|
||||
|
||||
|
||||
static inline void
|
||||
integer_write_32(uint8_t buf[static 4], uint32_t num)
|
||||
{
|
||||
buf[0] = (uint8_t)(num);
|
||||
buf[1] = (uint8_t)(num >> 8);
|
||||
buf[2] = (uint8_t)(num >> 16);
|
||||
buf[3] = (uint8_t)(num >> 24);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
static inline void
|
||||
integer_write_64(uint8_t buf[static 8], uint64_t num)
|
||||
{
|
||||
buf[0] = (uint8_t)(num);
|
||||
buf[1] = (uint8_t)(num >> 8);
|
||||
buf[2] = (uint8_t)(num >> 16);
|
||||
buf[3] = (uint8_t)(num >> 24);
|
||||
buf[4] = (uint8_t)(num >> 32);
|
||||
buf[5] = (uint8_t)(num >> 40);
|
||||
buf[6] = (uint8_t)(num >> 48);
|
||||
buf[7] = (uint8_t)(num >> 56);
|
||||
}
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,7 +1,7 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file mythread.h
|
||||
/// \brief Wrappers for threads
|
||||
/// \brief Some threading related helper macros and functions
|
||||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
@@ -10,33 +10,512 @@
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef MYTHREAD_H
|
||||
#define MYTHREAD_H
|
||||
|
||||
#include "sysdefs.h"
|
||||
|
||||
// If any type of threading is enabled, #define MYTHREAD_ENABLED.
|
||||
#if defined(MYTHREAD_POSIX) || defined(MYTHREAD_WIN95) \
|
||||
|| defined(MYTHREAD_VISTA)
|
||||
# define MYTHREAD_ENABLED 1
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PTHREAD
|
||||
# include <pthread.h>
|
||||
|
||||
# define mythread_once(func) \
|
||||
#ifdef MYTHREAD_ENABLED
|
||||
|
||||
////////////////////////////////////////
|
||||
// Shared between all threading types //
|
||||
////////////////////////////////////////
|
||||
|
||||
// Locks a mutex for a duration of a block.
|
||||
//
|
||||
// Perform mythread_mutex_lock(&mutex) in the beginning of a block
|
||||
// and mythread_mutex_unlock(&mutex) at the end of the block. "break"
|
||||
// may be used to unlock the mutex and jump out of the block.
|
||||
// mythread_sync blocks may be nested.
|
||||
//
|
||||
// Example:
|
||||
//
|
||||
// mythread_sync(mutex) {
|
||||
// foo();
|
||||
// if (some_error)
|
||||
// break; // Skips bar()
|
||||
// bar();
|
||||
// }
|
||||
//
|
||||
// At least GCC optimizes the loops completely away so it doesn't slow
|
||||
// things down at all compared to plain mythread_mutex_lock(&mutex)
|
||||
// and mythread_mutex_unlock(&mutex) calls.
|
||||
//
|
||||
#define mythread_sync(mutex) mythread_sync_helper1(mutex, __LINE__)
|
||||
#define mythread_sync_helper1(mutex, line) mythread_sync_helper2(mutex, line)
|
||||
#define mythread_sync_helper2(mutex, line) \
|
||||
for (unsigned int mythread_i_ ## line = 0; \
|
||||
mythread_i_ ## line \
|
||||
? (mythread_mutex_unlock(&(mutex)), 0) \
|
||||
: (mythread_mutex_lock(&(mutex)), 1); \
|
||||
mythread_i_ ## line = 1) \
|
||||
for (unsigned int mythread_j_ ## line = 0; \
|
||||
!mythread_j_ ## line; \
|
||||
mythread_j_ ## line = 1)
|
||||
#endif
|
||||
|
||||
|
||||
#if !defined(MYTHREAD_ENABLED)
|
||||
|
||||
//////////////////
|
||||
// No threading //
|
||||
//////////////////
|
||||
|
||||
// Calls the given function once. This isn't thread safe.
|
||||
#define mythread_once(func) \
|
||||
do { \
|
||||
static bool once_ = false; \
|
||||
if (!once_) { \
|
||||
func(); \
|
||||
once_ = true; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
||||
#if !(defined(_WIN32) && !defined(__CYGWIN__))
|
||||
// Use sigprocmask() to set the signal mask in single-threaded programs.
|
||||
#include <signal.h>
|
||||
|
||||
static inline void
|
||||
mythread_sigmask(int how, const sigset_t *restrict set,
|
||||
sigset_t *restrict oset)
|
||||
{
|
||||
int ret = sigprocmask(how, set, oset);
|
||||
assert(ret == 0);
|
||||
(void)ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#elif defined(MYTHREAD_POSIX)
|
||||
|
||||
////////////////////
|
||||
// Using pthreads //
|
||||
////////////////////
|
||||
|
||||
#include <sys/time.h>
|
||||
#include <pthread.h>
|
||||
#include <signal.h>
|
||||
#include <time.h>
|
||||
#include <errno.h>
|
||||
|
||||
#define MYTHREAD_RET_TYPE void *
|
||||
#define MYTHREAD_RET_VALUE NULL
|
||||
|
||||
typedef pthread_t mythread;
|
||||
typedef pthread_mutex_t mythread_mutex;
|
||||
|
||||
typedef struct {
|
||||
pthread_cond_t cond;
|
||||
#ifdef HAVE_CLOCK_GETTIME
|
||||
// Clock ID (CLOCK_REALTIME or CLOCK_MONOTONIC) associated with
|
||||
// the condition variable.
|
||||
clockid_t clk_id;
|
||||
#endif
|
||||
} mythread_cond;
|
||||
|
||||
typedef struct timespec mythread_condtime;
|
||||
|
||||
|
||||
// Calls the given function once in a thread-safe way.
|
||||
#define mythread_once(func) \
|
||||
do { \
|
||||
static pthread_once_t once_ = PTHREAD_ONCE_INIT; \
|
||||
pthread_once(&once_, &func); \
|
||||
} while (0)
|
||||
|
||||
# define mythread_sigmask(how, set, oset) \
|
||||
pthread_sigmask(how, set, oset)
|
||||
|
||||
// Use pthread_sigmask() to set the signal mask in multi-threaded programs.
|
||||
// Do nothing on OpenVMS since it lacks pthread_sigmask().
|
||||
static inline void
|
||||
mythread_sigmask(int how, const sigset_t *restrict set,
|
||||
sigset_t *restrict oset)
|
||||
{
|
||||
#ifdef __VMS
|
||||
(void)how;
|
||||
(void)set;
|
||||
(void)oset;
|
||||
#else
|
||||
int ret = pthread_sigmask(how, set, oset);
|
||||
assert(ret == 0);
|
||||
(void)ret;
|
||||
#endif
|
||||
}
|
||||
|
||||
# define mythread_once(func) \
|
||||
|
||||
// Creates a new thread with all signals blocked. Returns zero on success
|
||||
// and non-zero on error.
|
||||
static inline int
|
||||
mythread_create(mythread *thread, void *(*func)(void *arg), void *arg)
|
||||
{
|
||||
sigset_t old;
|
||||
sigset_t all;
|
||||
sigfillset(&all);
|
||||
|
||||
mythread_sigmask(SIG_SETMASK, &all, &old);
|
||||
const int ret = pthread_create(thread, NULL, func, arg);
|
||||
mythread_sigmask(SIG_SETMASK, &old, NULL);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Joins a thread. Returns zero on success and non-zero on error.
|
||||
static inline int
|
||||
mythread_join(mythread thread)
|
||||
{
|
||||
return pthread_join(thread, NULL);
|
||||
}
|
||||
|
||||
|
||||
// Initiatlizes a mutex. Returns zero on success and non-zero on error.
|
||||
static inline int
|
||||
mythread_mutex_init(mythread_mutex *mutex)
|
||||
{
|
||||
return pthread_mutex_init(mutex, NULL);
|
||||
}
|
||||
|
||||
static inline void
|
||||
mythread_mutex_destroy(mythread_mutex *mutex)
|
||||
{
|
||||
int ret = pthread_mutex_destroy(mutex);
|
||||
assert(ret == 0);
|
||||
(void)ret;
|
||||
}
|
||||
|
||||
static inline void
|
||||
mythread_mutex_lock(mythread_mutex *mutex)
|
||||
{
|
||||
int ret = pthread_mutex_lock(mutex);
|
||||
assert(ret == 0);
|
||||
(void)ret;
|
||||
}
|
||||
|
||||
static inline void
|
||||
mythread_mutex_unlock(mythread_mutex *mutex)
|
||||
{
|
||||
int ret = pthread_mutex_unlock(mutex);
|
||||
assert(ret == 0);
|
||||
(void)ret;
|
||||
}
|
||||
|
||||
|
||||
// Initializes a condition variable.
|
||||
//
|
||||
// Using CLOCK_MONOTONIC instead of the default CLOCK_REALTIME makes the
|
||||
// timeout in pthread_cond_timedwait() work correctly also if system time
|
||||
// is suddenly changed. Unfortunately CLOCK_MONOTONIC isn't available
|
||||
// everywhere while the default CLOCK_REALTIME is, so the default is
|
||||
// used if CLOCK_MONOTONIC isn't available.
|
||||
//
|
||||
// If clock_gettime() isn't available at all, gettimeofday() will be used.
|
||||
static inline int
|
||||
mythread_cond_init(mythread_cond *mycond)
|
||||
{
|
||||
#ifdef HAVE_CLOCK_GETTIME
|
||||
// NOTE: HAVE_DECL_CLOCK_MONOTONIC is always defined to 0 or 1.
|
||||
# if defined(HAVE_PTHREAD_CONDATTR_SETCLOCK) && HAVE_DECL_CLOCK_MONOTONIC
|
||||
struct timespec ts;
|
||||
pthread_condattr_t condattr;
|
||||
|
||||
// POSIX doesn't seem to *require* that pthread_condattr_setclock()
|
||||
// will fail if given an unsupported clock ID. Test that
|
||||
// CLOCK_MONOTONIC really is supported using clock_gettime().
|
||||
if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0
|
||||
&& pthread_condattr_init(&condattr) == 0) {
|
||||
int ret = pthread_condattr_setclock(
|
||||
&condattr, CLOCK_MONOTONIC);
|
||||
if (ret == 0)
|
||||
ret = pthread_cond_init(&mycond->cond, &condattr);
|
||||
|
||||
pthread_condattr_destroy(&condattr);
|
||||
|
||||
if (ret == 0) {
|
||||
mycond->clk_id = CLOCK_MONOTONIC;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// If anything above fails, fall back to the default CLOCK_REALTIME.
|
||||
// POSIX requires that all implementations of clock_gettime() must
|
||||
// support at least CLOCK_REALTIME.
|
||||
# endif
|
||||
|
||||
mycond->clk_id = CLOCK_REALTIME;
|
||||
#endif
|
||||
|
||||
return pthread_cond_init(&mycond->cond, NULL);
|
||||
}
|
||||
|
||||
static inline void
|
||||
mythread_cond_destroy(mythread_cond *cond)
|
||||
{
|
||||
int ret = pthread_cond_destroy(&cond->cond);
|
||||
assert(ret == 0);
|
||||
(void)ret;
|
||||
}
|
||||
|
||||
static inline void
|
||||
mythread_cond_signal(mythread_cond *cond)
|
||||
{
|
||||
int ret = pthread_cond_signal(&cond->cond);
|
||||
assert(ret == 0);
|
||||
(void)ret;
|
||||
}
|
||||
|
||||
static inline void
|
||||
mythread_cond_wait(mythread_cond *cond, mythread_mutex *mutex)
|
||||
{
|
||||
int ret = pthread_cond_wait(&cond->cond, mutex);
|
||||
assert(ret == 0);
|
||||
(void)ret;
|
||||
}
|
||||
|
||||
// Waits on a condition or until a timeout expires. If the timeout expires,
|
||||
// non-zero is returned, otherwise zero is returned.
|
||||
static inline int
|
||||
mythread_cond_timedwait(mythread_cond *cond, mythread_mutex *mutex,
|
||||
const mythread_condtime *condtime)
|
||||
{
|
||||
int ret = pthread_cond_timedwait(&cond->cond, mutex, condtime);
|
||||
assert(ret == 0 || ret == ETIMEDOUT);
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Sets condtime to the absolute time that is timeout_ms milliseconds
|
||||
// in the future. The type of the clock to use is taken from cond.
|
||||
static inline void
|
||||
mythread_condtime_set(mythread_condtime *condtime, const mythread_cond *cond,
|
||||
uint32_t timeout_ms)
|
||||
{
|
||||
condtime->tv_sec = timeout_ms / 1000;
|
||||
condtime->tv_nsec = (timeout_ms % 1000) * 1000000;
|
||||
|
||||
#ifdef HAVE_CLOCK_GETTIME
|
||||
struct timespec now;
|
||||
int ret = clock_gettime(cond->clk_id, &now);
|
||||
assert(ret == 0);
|
||||
(void)ret;
|
||||
|
||||
condtime->tv_sec += now.tv_sec;
|
||||
condtime->tv_nsec += now.tv_nsec;
|
||||
#else
|
||||
(void)cond;
|
||||
|
||||
struct timeval now;
|
||||
gettimeofday(&now, NULL);
|
||||
|
||||
condtime->tv_sec += now.tv_sec;
|
||||
condtime->tv_nsec += now.tv_usec * 1000L;
|
||||
#endif
|
||||
|
||||
// tv_nsec must stay in the range [0, 999_999_999].
|
||||
if (condtime->tv_nsec >= 1000000000L) {
|
||||
condtime->tv_nsec -= 1000000000L;
|
||||
++condtime->tv_sec;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#elif defined(MYTHREAD_WIN95) || defined(MYTHREAD_VISTA)
|
||||
|
||||
/////////////////////
|
||||
// Windows threads //
|
||||
/////////////////////
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#ifdef MYTHREAD_VISTA
|
||||
# undef _WIN32_WINNT
|
||||
# define _WIN32_WINNT 0x0600
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#include <process.h>
|
||||
|
||||
#define MYTHREAD_RET_TYPE unsigned int __stdcall
|
||||
#define MYTHREAD_RET_VALUE 0
|
||||
|
||||
typedef HANDLE mythread;
|
||||
typedef CRITICAL_SECTION mythread_mutex;
|
||||
|
||||
#ifdef MYTHREAD_WIN95
|
||||
typedef HANDLE mythread_cond;
|
||||
#else
|
||||
typedef CONDITION_VARIABLE mythread_cond;
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
// Tick count (milliseconds) in the beginning of the timeout.
|
||||
// NOTE: This is 32 bits so it wraps around after 49.7 days.
|
||||
// Multi-day timeouts may not work as expected.
|
||||
DWORD start;
|
||||
|
||||
// Length of the timeout in milliseconds. The timeout expires
|
||||
// when the current tick count minus "start" is equal or greater
|
||||
// than "timeout".
|
||||
DWORD timeout;
|
||||
} mythread_condtime;
|
||||
|
||||
|
||||
// mythread_once() is only available with Vista threads.
|
||||
#ifdef MYTHREAD_VISTA
|
||||
#define mythread_once(func) \
|
||||
do { \
|
||||
static bool once_ = false; \
|
||||
if (!once_) { \
|
||||
static INIT_ONCE once_ = INIT_ONCE_STATIC_INIT; \
|
||||
BOOL pending_; \
|
||||
if (!InitOnceBeginInitialize(&once_, 0, &pending_, NULL)) \
|
||||
abort(); \
|
||||
if (pending_) \
|
||||
func(); \
|
||||
once_ = true; \
|
||||
} \
|
||||
if (!InitOnceComplete(&once, 0, NULL)) \
|
||||
abort(); \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
# define mythread_sigmask(how, set, oset) \
|
||||
sigprocmask(how, set, oset)
|
||||
|
||||
// mythread_sigmask() isn't available on Windows. Even a dummy version would
|
||||
// make no sense because the other POSIX signal functions are missing anyway.
|
||||
|
||||
|
||||
static inline int
|
||||
mythread_create(mythread *thread,
|
||||
unsigned int (__stdcall *func)(void *arg), void *arg)
|
||||
{
|
||||
uintptr_t ret = _beginthreadex(NULL, 0, func, arg, 0, NULL);
|
||||
if (ret == 0)
|
||||
return -1;
|
||||
|
||||
*thread = (HANDLE)ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int
|
||||
mythread_join(mythread thread)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (WaitForSingleObject(thread, INFINITE) != WAIT_OBJECT_0)
|
||||
ret = -1;
|
||||
|
||||
if (!CloseHandle(thread))
|
||||
ret = -1;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static inline int
|
||||
mythread_mutex_init(mythread_mutex *mutex)
|
||||
{
|
||||
InitializeCriticalSection(mutex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void
|
||||
mythread_mutex_destroy(mythread_mutex *mutex)
|
||||
{
|
||||
DeleteCriticalSection(mutex);
|
||||
}
|
||||
|
||||
static inline void
|
||||
mythread_mutex_lock(mythread_mutex *mutex)
|
||||
{
|
||||
EnterCriticalSection(mutex);
|
||||
}
|
||||
|
||||
static inline void
|
||||
mythread_mutex_unlock(mythread_mutex *mutex)
|
||||
{
|
||||
LeaveCriticalSection(mutex);
|
||||
}
|
||||
|
||||
|
||||
static inline int
|
||||
mythread_cond_init(mythread_cond *cond)
|
||||
{
|
||||
#ifdef MYTHREAD_WIN95
|
||||
*cond = CreateEvent(NULL, FALSE, FALSE, NULL);
|
||||
return *cond == NULL ? -1 : 0;
|
||||
#else
|
||||
InitializeConditionVariable(cond);
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void
|
||||
mythread_cond_destroy(mythread_cond *cond)
|
||||
{
|
||||
#ifdef MYTHREAD_WIN95
|
||||
CloseHandle(*cond);
|
||||
#else
|
||||
(void)cond;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void
|
||||
mythread_cond_signal(mythread_cond *cond)
|
||||
{
|
||||
#ifdef MYTHREAD_WIN95
|
||||
SetEvent(*cond);
|
||||
#else
|
||||
WakeConditionVariable(cond);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void
|
||||
mythread_cond_wait(mythread_cond *cond, mythread_mutex *mutex)
|
||||
{
|
||||
#ifdef MYTHREAD_WIN95
|
||||
LeaveCriticalSection(mutex);
|
||||
WaitForSingleObject(*cond, INFINITE);
|
||||
EnterCriticalSection(mutex);
|
||||
#else
|
||||
BOOL ret = SleepConditionVariableCS(cond, mutex, INFINITE);
|
||||
assert(ret);
|
||||
(void)ret;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline int
|
||||
mythread_cond_timedwait(mythread_cond *cond, mythread_mutex *mutex,
|
||||
const mythread_condtime *condtime)
|
||||
{
|
||||
#ifdef MYTHREAD_WIN95
|
||||
LeaveCriticalSection(mutex);
|
||||
#endif
|
||||
|
||||
DWORD elapsed = GetTickCount() - condtime->start;
|
||||
DWORD timeout = elapsed >= condtime->timeout
|
||||
? 0 : condtime->timeout - elapsed;
|
||||
|
||||
#ifdef MYTHREAD_WIN95
|
||||
DWORD ret = WaitForSingleObject(*cond, timeout);
|
||||
assert(ret == WAIT_OBJECT_0 || ret == WAIT_TIMEOUT);
|
||||
|
||||
EnterCriticalSection(mutex);
|
||||
|
||||
return ret == WAIT_TIMEOUT;
|
||||
#else
|
||||
BOOL ret = SleepConditionVariableCS(cond, mutex, timeout);
|
||||
assert(ret || GetLastError() == ERROR_TIMEOUT);
|
||||
return !ret;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void
|
||||
mythread_condtime_set(mythread_condtime *condtime, const mythread_cond *cond,
|
||||
uint32_t timeout)
|
||||
{
|
||||
(void)cond;
|
||||
condtime->start = GetTickCount();
|
||||
condtime->timeout = timeout;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,134 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file physmem.h
|
||||
/// \brief Get the amount of physical memory
|
||||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef PHYSMEM_H
|
||||
#define PHYSMEM_H
|
||||
|
||||
// Test for Windows first, because we want to use Windows-specific code
|
||||
// on Cygwin, which also has memory information available via sysconf(), but
|
||||
// on Cygwin 1.5 and older it gives wrong results (from our point of view).
|
||||
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||
# ifndef _WIN32_WINNT
|
||||
# define _WIN32_WINNT 0x0500
|
||||
# endif
|
||||
# include <windows.h>
|
||||
|
||||
#elif defined(HAVE_PHYSMEM_SYSCONF)
|
||||
# include <unistd.h>
|
||||
|
||||
#elif defined(HAVE_PHYSMEM_SYSCTL)
|
||||
# ifdef HAVE_SYS_PARAM_H
|
||||
# include <sys/param.h>
|
||||
# endif
|
||||
# ifdef HAVE_SYS_SYSCTL_H
|
||||
# include <sys/sysctl.h>
|
||||
# endif
|
||||
|
||||
#elif defined(HAVE_PHYSMEM_SYSINFO)
|
||||
# include <sys/sysinfo.h>
|
||||
|
||||
#elif defined(__DJGPP__)
|
||||
# include <dpmi.h>
|
||||
#endif
|
||||
|
||||
|
||||
/// \brief Get the amount of physical memory in bytes
|
||||
///
|
||||
/// \return Amount of physical memory in bytes. On error, zero is
|
||||
/// returned.
|
||||
static inline uint64_t
|
||||
physmem(void)
|
||||
{
|
||||
uint64_t ret = 0;
|
||||
|
||||
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||
if ((GetVersion() & 0xFF) >= 5) {
|
||||
// Windows 2000 and later have GlobalMemoryStatusEx() which
|
||||
// supports reporting values greater than 4 GiB. To keep the
|
||||
// code working also on older Windows versions, use
|
||||
// GlobalMemoryStatusEx() conditionally.
|
||||
HMODULE kernel32 = GetModuleHandle("kernel32.dll");
|
||||
if (kernel32 != NULL) {
|
||||
BOOL (WINAPI *gmse)(LPMEMORYSTATUSEX) = GetProcAddress(
|
||||
kernel32, "GlobalMemoryStatusEx");
|
||||
if (gmse != NULL) {
|
||||
MEMORYSTATUSEX meminfo;
|
||||
meminfo.dwLength = sizeof(meminfo);
|
||||
if (gmse(&meminfo))
|
||||
ret = meminfo.ullTotalPhys;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ret == 0) {
|
||||
// GlobalMemoryStatus() is supported by Windows 95 and later,
|
||||
// so it is fine to link against it unconditionally. Note that
|
||||
// GlobalMemoryStatus() has no return value.
|
||||
MEMORYSTATUS meminfo;
|
||||
meminfo.dwLength = sizeof(meminfo);
|
||||
GlobalMemoryStatus(&meminfo);
|
||||
ret = meminfo.dwTotalPhys;
|
||||
}
|
||||
|
||||
#elif defined(HAVE_PHYSMEM_SYSCONF)
|
||||
const long pagesize = sysconf(_SC_PAGESIZE);
|
||||
const long pages = sysconf(_SC_PHYS_PAGES);
|
||||
if (pagesize != -1 || pages != -1)
|
||||
// According to docs, pagesize * pages can overflow.
|
||||
// Simple case is 32-bit box with 4 GiB or more RAM,
|
||||
// which may report exactly 4 GiB of RAM, and "long"
|
||||
// being 32-bit will overflow. Casting to uint64_t
|
||||
// hopefully avoids overflows in the near future.
|
||||
ret = (uint64_t)(pagesize) * (uint64_t)(pages);
|
||||
|
||||
#elif defined(HAVE_PHYSMEM_SYSCTL)
|
||||
int name[2] = {
|
||||
CTL_HW,
|
||||
#ifdef HW_PHYSMEM64
|
||||
HW_PHYSMEM64
|
||||
#else
|
||||
HW_PHYSMEM
|
||||
#endif
|
||||
};
|
||||
union {
|
||||
uint32_t u32;
|
||||
uint64_t u64;
|
||||
} mem;
|
||||
size_t mem_ptr_size = sizeof(mem.u64);
|
||||
if (!sysctl(name, 2, &mem.u64, &mem_ptr_size, NULL, NULL)) {
|
||||
// IIRC, 64-bit "return value" is possible on some 64-bit
|
||||
// BSD systems even with HW_PHYSMEM (instead of HW_PHYSMEM64),
|
||||
// so support both.
|
||||
if (mem_ptr_size == sizeof(mem.u64))
|
||||
ret = mem.u64;
|
||||
else if (mem_ptr_size == sizeof(mem.u32))
|
||||
ret = mem.u32;
|
||||
}
|
||||
|
||||
#elif defined(HAVE_PHYSMEM_SYSINFO)
|
||||
struct sysinfo si;
|
||||
if (sysinfo(&si) == 0)
|
||||
ret = (uint64_t)(si.totalram) * si.mem_unit;
|
||||
|
||||
#elif defined(__DJGPP__)
|
||||
__dpmi_free_mem_info meminfo;
|
||||
if (__dpmi_get_free_memory_information(&meminfo) == 0
|
||||
&& meminfo.total_number_of_physical_pages
|
||||
!= (unsigned long)(-1))
|
||||
ret = (uint64_t)(meminfo.total_number_of_physical_pages)
|
||||
* 4096;
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -24,6 +24,11 @@
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
// Get standard-compliant stdio functions under MinGW and MinGW-w64.
|
||||
#ifdef __MINGW32__
|
||||
# define __USE_MINGW_ANSI_STDIO 1
|
||||
#endif
|
||||
|
||||
// size_t and NULL
|
||||
#include <stddef.h>
|
||||
|
||||
@@ -50,7 +55,7 @@
|
||||
// we can work without inttypes.h thanks to Autoconf tests.
|
||||
#ifndef UINT32_C
|
||||
# if UINT_MAX != 4294967295U
|
||||
# error UINT32_C is not defined and unsiged int is not 32-bit.
|
||||
# error UINT32_C is not defined and unsigned int is not 32-bit.
|
||||
# endif
|
||||
# define UINT32_C(n) n ## U
|
||||
#endif
|
||||
@@ -60,6 +65,9 @@
|
||||
#ifndef PRIu32
|
||||
# define PRIu32 "u"
|
||||
#endif
|
||||
#ifndef PRIx32
|
||||
# define PRIx32 "x"
|
||||
#endif
|
||||
#ifndef PRIX32
|
||||
# define PRIX32 "X"
|
||||
#endif
|
||||
@@ -71,6 +79,9 @@
|
||||
# ifndef PRIu64
|
||||
# define PRIu64 "llu"
|
||||
# endif
|
||||
# ifndef PRIx64
|
||||
# define PRIx64 "llx"
|
||||
# endif
|
||||
# ifndef PRIX64
|
||||
# define PRIX64 "llX"
|
||||
# endif
|
||||
@@ -81,6 +92,9 @@
|
||||
# ifndef PRIu64
|
||||
# define PRIu64 "lu"
|
||||
# endif
|
||||
# ifndef PRIx64
|
||||
# define PRIx64 "lx"
|
||||
# endif
|
||||
# ifndef PRIX64
|
||||
# define PRIX64 "lX"
|
||||
# endif
|
||||
@@ -89,6 +103,15 @@
|
||||
# define UINT64_MAX UINT64_C(18446744073709551615)
|
||||
#endif
|
||||
|
||||
// Incorrect(?) SIZE_MAX:
|
||||
// - Interix headers typedef size_t to unsigned long,
|
||||
// but a few lines later define SIZE_MAX to INT32_MAX.
|
||||
// - SCO OpenServer (x86) headers typedef size_t to unsigned int
|
||||
// but define SIZE_MAX to INT32_MAX.
|
||||
#if defined(__INTERIX) || defined(_SCO_DS)
|
||||
# undef SIZE_MAX
|
||||
#endif
|
||||
|
||||
// The code currently assumes that size_t is either 32-bit or 64-bit.
|
||||
#ifndef SIZE_MAX
|
||||
# if SIZEOF_SIZE_T == 4
|
||||
@@ -96,11 +119,11 @@
|
||||
# elif SIZEOF_SIZE_T == 8
|
||||
# define SIZE_MAX UINT64_MAX
|
||||
# else
|
||||
# error sizeof(size_t) is not 32-bit or 64-bit
|
||||
# error size_t is not 32-bit or 64-bit
|
||||
# endif
|
||||
#endif
|
||||
#if SIZE_MAX != UINT32_MAX && SIZE_MAX != UINT64_MAX
|
||||
# error sizeof(size_t) is not 32-bit or 64-bit
|
||||
# error size_t is not 32-bit or 64-bit
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
@@ -142,28 +165,38 @@ typedef unsigned char _Bool;
|
||||
# include <memory.h>
|
||||
#endif
|
||||
|
||||
// As of MSVC 2013, inline and restrict are supported with
|
||||
// non-standard keywords.
|
||||
#if defined(_WIN32) && defined(_MSC_VER)
|
||||
# ifndef inline
|
||||
# define inline __inline
|
||||
# endif
|
||||
# ifndef restrict
|
||||
# define restrict __restrict
|
||||
# endif
|
||||
#endif
|
||||
|
||||
////////////
|
||||
// Macros //
|
||||
////////////
|
||||
|
||||
#if defined(_WIN32) || defined(__MSDOS__) || defined(__OS2__)
|
||||
# define DOSLIKE 1
|
||||
#endif
|
||||
|
||||
#undef memzero
|
||||
#define memzero(s, n) memset(s, 0, n)
|
||||
|
||||
#ifndef MIN
|
||||
# define MIN(x, y) ((x) < (y) ? (x) : (y))
|
||||
#endif
|
||||
|
||||
#ifndef MAX
|
||||
# define MAX(x, y) ((x) > (y) ? (x) : (y))
|
||||
#endif
|
||||
// NOTE: Avoid using MIN() and MAX(), because even conditionally defining
|
||||
// those macros can cause some portability trouble, since on some systems
|
||||
// the system headers insist defining their own versions.
|
||||
#define my_min(x, y) ((x) < (y) ? (x) : (y))
|
||||
#define my_max(x, y) ((x) > (y) ? (x) : (y))
|
||||
|
||||
#ifndef ARRAY_SIZE
|
||||
# define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
|
||||
#endif
|
||||
|
||||
#if (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) || __GNUC__ > 4
|
||||
# define lzma_attr_alloc_size(x) __attribute__((__alloc_size__(x)))
|
||||
#else
|
||||
# define lzma_attr_alloc_size(x)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
71
src/common/tuklib_common.h
Normal file
71
src/common/tuklib_common.h
Normal file
@@ -0,0 +1,71 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file tuklib_common.h
|
||||
/// \brief Common definitions for tuklib modules
|
||||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef TUKLIB_COMMON_H
|
||||
#define TUKLIB_COMMON_H
|
||||
|
||||
// The config file may be replaced by a package-specific file.
|
||||
// It should include at least stddef.h, inttypes.h, and limits.h.
|
||||
#include "tuklib_config.h"
|
||||
|
||||
// TUKLIB_SYMBOL_PREFIX is prefixed to all symbols exported by
|
||||
// the tuklib modules. If you use a tuklib module in a library,
|
||||
// you should use TUKLIB_SYMBOL_PREFIX to make sure that there
|
||||
// are no symbol conflicts in case someone links your library
|
||||
// into application that also uses the same tuklib module.
|
||||
#ifndef TUKLIB_SYMBOL_PREFIX
|
||||
# define TUKLIB_SYMBOL_PREFIX
|
||||
#endif
|
||||
|
||||
#define TUKLIB_CAT_X(a, b) a ## b
|
||||
#define TUKLIB_CAT(a, b) TUKLIB_CAT_X(a, b)
|
||||
|
||||
#ifndef TUKLIB_SYMBOL
|
||||
# define TUKLIB_SYMBOL(sym) TUKLIB_CAT(TUKLIB_SYMBOL_PREFIX, sym)
|
||||
#endif
|
||||
|
||||
#ifndef TUKLIB_DECLS_BEGIN
|
||||
# ifdef __cplusplus
|
||||
# define TUKLIB_DECLS_BEGIN extern "C" {
|
||||
# else
|
||||
# define TUKLIB_DECLS_BEGIN
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef TUKLIB_DECLS_END
|
||||
# ifdef __cplusplus
|
||||
# define TUKLIB_DECLS_END }
|
||||
# else
|
||||
# define TUKLIB_DECLS_END
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(__GNUC_MINOR__)
|
||||
# define TUKLIB_GNUC_REQ(major, minor) \
|
||||
((__GNUC__ == (major) && __GNUC_MINOR__ >= (minor)) \
|
||||
|| __GNUC__ > (major))
|
||||
#else
|
||||
# define TUKLIB_GNUC_REQ(major, minor) 0
|
||||
#endif
|
||||
|
||||
#if TUKLIB_GNUC_REQ(2, 5)
|
||||
# define tuklib_attr_noreturn __attribute__((__noreturn__))
|
||||
#else
|
||||
# define tuklib_attr_noreturn
|
||||
#endif
|
||||
|
||||
#if (defined(_WIN32) && !defined(__CYGWIN__)) \
|
||||
|| defined(__OS2__) || defined(__MSDOS__)
|
||||
# define TUKLIB_DOSLIKE 1
|
||||
#endif
|
||||
|
||||
#endif
|
||||
7
src/common/tuklib_config.h
Normal file
7
src/common/tuklib_config.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "sysdefs.h"
|
||||
#else
|
||||
# include <stddef.h>
|
||||
# include <inttypes.h>
|
||||
# include <limits.h>
|
||||
#endif
|
||||
73
src/common/tuklib_cpucores.c
Normal file
73
src/common/tuklib_cpucores.c
Normal file
@@ -0,0 +1,73 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file tuklib_cpucores.c
|
||||
/// \brief Get the number of CPU cores online
|
||||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "tuklib_cpucores.h"
|
||||
|
||||
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||
# ifndef _WIN32_WINNT
|
||||
# define _WIN32_WINNT 0x0500
|
||||
# endif
|
||||
# include <windows.h>
|
||||
|
||||
#elif defined(TUKLIB_CPUCORES_SYSCTL)
|
||||
# ifdef HAVE_SYS_PARAM_H
|
||||
# include <sys/param.h>
|
||||
# endif
|
||||
# include <sys/sysctl.h>
|
||||
|
||||
#elif defined(TUKLIB_CPUCORES_SYSCONF)
|
||||
# include <unistd.h>
|
||||
|
||||
// HP-UX
|
||||
#elif defined(TUKLIB_CPUCORES_PSTAT_GETDYNAMIC)
|
||||
# include <sys/param.h>
|
||||
# include <sys/pstat.h>
|
||||
#endif
|
||||
|
||||
|
||||
extern uint32_t
|
||||
tuklib_cpucores(void)
|
||||
{
|
||||
uint32_t ret = 0;
|
||||
|
||||
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||
SYSTEM_INFO sysinfo;
|
||||
GetSystemInfo(&sysinfo);
|
||||
ret = sysinfo.dwNumberOfProcessors;
|
||||
|
||||
#elif defined(TUKLIB_CPUCORES_SYSCTL)
|
||||
int name[2] = { CTL_HW, HW_NCPU };
|
||||
int cpus;
|
||||
size_t cpus_size = sizeof(cpus);
|
||||
if (sysctl(name, 2, &cpus, &cpus_size, NULL, 0) != -1
|
||||
&& cpus_size == sizeof(cpus) && cpus > 0)
|
||||
ret = cpus;
|
||||
|
||||
#elif defined(TUKLIB_CPUCORES_SYSCONF)
|
||||
# ifdef _SC_NPROCESSORS_ONLN
|
||||
// Most systems
|
||||
const long cpus = sysconf(_SC_NPROCESSORS_ONLN);
|
||||
# else
|
||||
// IRIX
|
||||
const long cpus = sysconf(_SC_NPROC_ONLN);
|
||||
# endif
|
||||
if (cpus > 0)
|
||||
ret = cpus;
|
||||
|
||||
#elif defined(TUKLIB_CPUCORES_PSTAT_GETDYNAMIC)
|
||||
struct pst_dynamic pst;
|
||||
if (pstat_getdynamic(&pst, sizeof(pst), 1, 0) != -1)
|
||||
ret = pst.psd_proc_cnt;
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file subblock_encoder.h
|
||||
/// \brief Encoder of the Subblock filter
|
||||
/// \file tuklib_cpucores.h
|
||||
/// \brief Get the number of CPU cores online
|
||||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
@@ -10,12 +10,14 @@
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef LZMA_SUBBLOCK_ENCODER_H
|
||||
#define LZMA_SUBBLOCK_ENCODER_H
|
||||
#ifndef TUKLIB_CPUCORES_H
|
||||
#define TUKLIB_CPUCORES_H
|
||||
|
||||
#include "common.h"
|
||||
#include "tuklib_common.h"
|
||||
TUKLIB_DECLS_BEGIN
|
||||
|
||||
extern lzma_ret lzma_subblock_encoder_init(lzma_next_coder *next,
|
||||
lzma_allocator *allocator, const lzma_filter_info *filters);
|
||||
#define tuklib_cpucores TUKLIB_SYMBOL(tuklib_cpucores)
|
||||
extern uint32_t tuklib_cpucores(void);
|
||||
|
||||
TUKLIB_DECLS_END
|
||||
#endif
|
||||
57
src/common/tuklib_exit.c
Normal file
57
src/common/tuklib_exit.c
Normal file
@@ -0,0 +1,57 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file tuklib_exit.c
|
||||
/// \brief Close stdout and stderr, and exit
|
||||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "tuklib_common.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "tuklib_gettext.h"
|
||||
#include "tuklib_progname.h"
|
||||
#include "tuklib_exit.h"
|
||||
|
||||
|
||||
extern void
|
||||
tuklib_exit(int status, int err_status, int show_error)
|
||||
{
|
||||
if (status != err_status) {
|
||||
// Close stdout. If something goes wrong,
|
||||
// print an error message to stderr.
|
||||
const int ferror_err = ferror(stdout);
|
||||
const int fclose_err = fclose(stdout);
|
||||
if (ferror_err || fclose_err) {
|
||||
status = err_status;
|
||||
|
||||
// If it was fclose() that failed, we have the reason
|
||||
// in errno. If only ferror() indicated an error,
|
||||
// we have no idea what the reason was.
|
||||
if (show_error)
|
||||
fprintf(stderr, "%s: %s: %s\n", progname,
|
||||
_("Writing to standard "
|
||||
"output failed"),
|
||||
fclose_err ? strerror(errno)
|
||||
: _("Unknown error"));
|
||||
}
|
||||
}
|
||||
|
||||
if (status != err_status) {
|
||||
// Close stderr. If something goes wrong, there's
|
||||
// nothing where we could print an error message.
|
||||
// Just set the exit status.
|
||||
const int ferror_err = ferror(stderr);
|
||||
const int fclose_err = fclose(stderr);
|
||||
if (fclose_err || ferror_err)
|
||||
status = err_status;
|
||||
}
|
||||
|
||||
exit(status);
|
||||
}
|
||||
25
src/common/tuklib_exit.h
Normal file
25
src/common/tuklib_exit.h
Normal file
@@ -0,0 +1,25 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file tuklib_exit.h
|
||||
/// \brief Close stdout and stderr, and exit
|
||||
/// \note Requires tuklib_progname and tuklib_gettext modules
|
||||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef TUKLIB_EXIT_H
|
||||
#define TUKLIB_EXIT_H
|
||||
|
||||
#include "tuklib_common.h"
|
||||
TUKLIB_DECLS_BEGIN
|
||||
|
||||
#define tuklib_exit TUKLIB_SYMBOL(tuklib_exit)
|
||||
extern void tuklib_exit(int status, int err_status, int show_error)
|
||||
tuklib_attr_noreturn;
|
||||
|
||||
TUKLIB_DECLS_END
|
||||
#endif
|
||||
44
src/common/tuklib_gettext.h
Normal file
44
src/common/tuklib_gettext.h
Normal file
@@ -0,0 +1,44 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file tuklib_gettext.h
|
||||
/// \brief Wrapper for gettext and friends
|
||||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef TUKLIB_GETTEXT_H
|
||||
#define TUKLIB_GETTEXT_H
|
||||
|
||||
#include "tuklib_common.h"
|
||||
#include <locale.h>
|
||||
|
||||
#ifndef TUKLIB_GETTEXT
|
||||
# ifdef ENABLE_NLS
|
||||
# define TUKLIB_GETTEXT 1
|
||||
# else
|
||||
# define TUKLIB_GETTEXT 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if TUKLIB_GETTEXT
|
||||
# include <libintl.h>
|
||||
# define tuklib_gettext_init(package, localedir) \
|
||||
do { \
|
||||
setlocale(LC_ALL, ""); \
|
||||
bindtextdomain(package, localedir); \
|
||||
textdomain(package); \
|
||||
} while (0)
|
||||
# define _(msgid) gettext(msgid)
|
||||
#else
|
||||
# define tuklib_gettext_init(package, localedir) \
|
||||
setlocale(LC_ALL, "")
|
||||
# define _(msgid) (msgid)
|
||||
# define ngettext(msgid1, msgid2, n) ((n) == 1 ? (msgid1) : (msgid2))
|
||||
#endif
|
||||
#define N_(msgid) msgid
|
||||
|
||||
#endif
|
||||
523
src/common/tuklib_integer.h
Normal file
523
src/common/tuklib_integer.h
Normal file
@@ -0,0 +1,523 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file tuklib_integer.h
|
||||
/// \brief Various integer and bit operations
|
||||
///
|
||||
/// This file provides macros or functions to do some basic integer and bit
|
||||
/// operations.
|
||||
///
|
||||
/// Endianness related integer operations (XX = 16, 32, or 64; Y = b or l):
|
||||
/// - Byte swapping: bswapXX(num)
|
||||
/// - Byte order conversions to/from native: convXXYe(num)
|
||||
/// - Aligned reads: readXXYe(ptr)
|
||||
/// - Aligned writes: writeXXYe(ptr, num)
|
||||
/// - Unaligned reads (16/32-bit only): unaligned_readXXYe(ptr)
|
||||
/// - Unaligned writes (16/32-bit only): unaligned_writeXXYe(ptr, num)
|
||||
///
|
||||
/// Since they can macros, the arguments should have no side effects since
|
||||
/// they may be evaluated more than once.
|
||||
///
|
||||
/// \todo PowerPC and possibly some other architectures support
|
||||
/// byte swapping load and store instructions. This file
|
||||
/// doesn't take advantage of those instructions.
|
||||
///
|
||||
/// Bit scan operations for non-zero 32-bit integers:
|
||||
/// - Bit scan reverse (find highest non-zero bit): bsr32(num)
|
||||
/// - Count leading zeros: clz32(num)
|
||||
/// - Count trailing zeros: ctz32(num)
|
||||
/// - Bit scan forward (simply an alias for ctz32()): bsf32(num)
|
||||
///
|
||||
/// The above bit scan operations return 0-31. If num is zero,
|
||||
/// the result is undefined.
|
||||
//
|
||||
// Authors: Lasse Collin
|
||||
// Joachim Henke
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef TUKLIB_INTEGER_H
|
||||
#define TUKLIB_INTEGER_H
|
||||
|
||||
#include "tuklib_common.h"
|
||||
|
||||
|
||||
////////////////////////////////////////
|
||||
// Operating system specific features //
|
||||
////////////////////////////////////////
|
||||
|
||||
#if defined(HAVE_BYTESWAP_H)
|
||||
// glibc, uClibc, dietlibc
|
||||
# include <byteswap.h>
|
||||
# ifdef HAVE_BSWAP_16
|
||||
# define bswap16(num) bswap_16(num)
|
||||
# endif
|
||||
# ifdef HAVE_BSWAP_32
|
||||
# define bswap32(num) bswap_32(num)
|
||||
# endif
|
||||
# ifdef HAVE_BSWAP_64
|
||||
# define bswap64(num) bswap_64(num)
|
||||
# endif
|
||||
|
||||
#elif defined(HAVE_SYS_ENDIAN_H)
|
||||
// *BSDs and Darwin
|
||||
# include <sys/endian.h>
|
||||
|
||||
#elif defined(HAVE_SYS_BYTEORDER_H)
|
||||
// Solaris
|
||||
# include <sys/byteorder.h>
|
||||
# ifdef BSWAP_16
|
||||
# define bswap16(num) BSWAP_16(num)
|
||||
# endif
|
||||
# ifdef BSWAP_32
|
||||
# define bswap32(num) BSWAP_32(num)
|
||||
# endif
|
||||
# ifdef BSWAP_64
|
||||
# define bswap64(num) BSWAP_64(num)
|
||||
# endif
|
||||
# ifdef BE_16
|
||||
# define conv16be(num) BE_16(num)
|
||||
# endif
|
||||
# ifdef BE_32
|
||||
# define conv32be(num) BE_32(num)
|
||||
# endif
|
||||
# ifdef BE_64
|
||||
# define conv64be(num) BE_64(num)
|
||||
# endif
|
||||
# ifdef LE_16
|
||||
# define conv16le(num) LE_16(num)
|
||||
# endif
|
||||
# ifdef LE_32
|
||||
# define conv32le(num) LE_32(num)
|
||||
# endif
|
||||
# ifdef LE_64
|
||||
# define conv64le(num) LE_64(num)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
///////////////////
|
||||
// Byte swapping //
|
||||
///////////////////
|
||||
|
||||
#ifndef bswap16
|
||||
# define bswap16(num) \
|
||||
(((uint16_t)(num) << 8) | ((uint16_t)(num) >> 8))
|
||||
#endif
|
||||
|
||||
#ifndef bswap32
|
||||
# define bswap32(num) \
|
||||
( (((uint32_t)(num) << 24) ) \
|
||||
| (((uint32_t)(num) << 8) & UINT32_C(0x00FF0000)) \
|
||||
| (((uint32_t)(num) >> 8) & UINT32_C(0x0000FF00)) \
|
||||
| (((uint32_t)(num) >> 24) ) )
|
||||
#endif
|
||||
|
||||
#ifndef bswap64
|
||||
# define bswap64(num) \
|
||||
( (((uint64_t)(num) << 56) ) \
|
||||
| (((uint64_t)(num) << 40) & UINT64_C(0x00FF000000000000)) \
|
||||
| (((uint64_t)(num) << 24) & UINT64_C(0x0000FF0000000000)) \
|
||||
| (((uint64_t)(num) << 8) & UINT64_C(0x000000FF00000000)) \
|
||||
| (((uint64_t)(num) >> 8) & UINT64_C(0x00000000FF000000)) \
|
||||
| (((uint64_t)(num) >> 24) & UINT64_C(0x0000000000FF0000)) \
|
||||
| (((uint64_t)(num) >> 40) & UINT64_C(0x000000000000FF00)) \
|
||||
| (((uint64_t)(num) >> 56) ) )
|
||||
#endif
|
||||
|
||||
// Define conversion macros using the basic byte swapping macros.
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
# ifndef conv16be
|
||||
# define conv16be(num) ((uint16_t)(num))
|
||||
# endif
|
||||
# ifndef conv32be
|
||||
# define conv32be(num) ((uint32_t)(num))
|
||||
# endif
|
||||
# ifndef conv64be
|
||||
# define conv64be(num) ((uint64_t)(num))
|
||||
# endif
|
||||
# ifndef conv16le
|
||||
# define conv16le(num) bswap16(num)
|
||||
# endif
|
||||
# ifndef conv32le
|
||||
# define conv32le(num) bswap32(num)
|
||||
# endif
|
||||
# ifndef conv64le
|
||||
# define conv64le(num) bswap64(num)
|
||||
# endif
|
||||
#else
|
||||
# ifndef conv16be
|
||||
# define conv16be(num) bswap16(num)
|
||||
# endif
|
||||
# ifndef conv32be
|
||||
# define conv32be(num) bswap32(num)
|
||||
# endif
|
||||
# ifndef conv64be
|
||||
# define conv64be(num) bswap64(num)
|
||||
# endif
|
||||
# ifndef conv16le
|
||||
# define conv16le(num) ((uint16_t)(num))
|
||||
# endif
|
||||
# ifndef conv32le
|
||||
# define conv32le(num) ((uint32_t)(num))
|
||||
# endif
|
||||
# ifndef conv64le
|
||||
# define conv64le(num) ((uint64_t)(num))
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
//////////////////////////////
|
||||
// Aligned reads and writes //
|
||||
//////////////////////////////
|
||||
|
||||
static inline uint16_t
|
||||
read16be(const uint8_t *buf)
|
||||
{
|
||||
uint16_t num = *(const uint16_t *)buf;
|
||||
return conv16be(num);
|
||||
}
|
||||
|
||||
|
||||
static inline uint16_t
|
||||
read16le(const uint8_t *buf)
|
||||
{
|
||||
uint16_t num = *(const uint16_t *)buf;
|
||||
return conv16le(num);
|
||||
}
|
||||
|
||||
|
||||
static inline uint32_t
|
||||
read32be(const uint8_t *buf)
|
||||
{
|
||||
uint32_t num = *(const uint32_t *)buf;
|
||||
return conv32be(num);
|
||||
}
|
||||
|
||||
|
||||
static inline uint32_t
|
||||
read32le(const uint8_t *buf)
|
||||
{
|
||||
uint32_t num = *(const uint32_t *)buf;
|
||||
return conv32le(num);
|
||||
}
|
||||
|
||||
|
||||
static inline uint64_t
|
||||
read64be(const uint8_t *buf)
|
||||
{
|
||||
uint64_t num = *(const uint64_t *)buf;
|
||||
return conv64be(num);
|
||||
}
|
||||
|
||||
|
||||
static inline uint64_t
|
||||
read64le(const uint8_t *buf)
|
||||
{
|
||||
uint64_t num = *(const uint64_t *)buf;
|
||||
return conv64le(num);
|
||||
}
|
||||
|
||||
|
||||
// NOTE: Possible byte swapping must be done in a macro to allow GCC
|
||||
// to optimize byte swapping of constants when using glibc's or *BSD's
|
||||
// byte swapping macros. The actual write is done in an inline function
|
||||
// to make type checking of the buf pointer possible similarly to readXXYe()
|
||||
// functions.
|
||||
|
||||
#define write16be(buf, num) write16ne((buf), conv16be(num))
|
||||
#define write16le(buf, num) write16ne((buf), conv16le(num))
|
||||
#define write32be(buf, num) write32ne((buf), conv32be(num))
|
||||
#define write32le(buf, num) write32ne((buf), conv32le(num))
|
||||
#define write64be(buf, num) write64ne((buf), conv64be(num))
|
||||
#define write64le(buf, num) write64ne((buf), conv64le(num))
|
||||
|
||||
|
||||
static inline void
|
||||
write16ne(uint8_t *buf, uint16_t num)
|
||||
{
|
||||
*(uint16_t *)buf = num;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
static inline void
|
||||
write32ne(uint8_t *buf, uint32_t num)
|
||||
{
|
||||
*(uint32_t *)buf = num;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
static inline void
|
||||
write64ne(uint8_t *buf, uint64_t num)
|
||||
{
|
||||
*(uint64_t *)buf = num;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////
|
||||
// Unaligned reads and writes //
|
||||
////////////////////////////////
|
||||
|
||||
// NOTE: TUKLIB_FAST_UNALIGNED_ACCESS indicates only support for 16-bit and
|
||||
// 32-bit unaligned integer loads and stores. It's possible that 64-bit
|
||||
// unaligned access doesn't work or is slower than byte-by-byte access.
|
||||
// Since unaligned 64-bit is probably not needed as often as 16-bit or
|
||||
// 32-bit, we simply don't support 64-bit unaligned access for now.
|
||||
#ifdef TUKLIB_FAST_UNALIGNED_ACCESS
|
||||
# define unaligned_read16be read16be
|
||||
# define unaligned_read16le read16le
|
||||
# define unaligned_read32be read32be
|
||||
# define unaligned_read32le read32le
|
||||
# define unaligned_write16be write16be
|
||||
# define unaligned_write16le write16le
|
||||
# define unaligned_write32be write32be
|
||||
# define unaligned_write32le write32le
|
||||
|
||||
#else
|
||||
|
||||
static inline uint16_t
|
||||
unaligned_read16be(const uint8_t *buf)
|
||||
{
|
||||
uint16_t num = ((uint16_t)buf[0] << 8) | (uint16_t)buf[1];
|
||||
return num;
|
||||
}
|
||||
|
||||
|
||||
static inline uint16_t
|
||||
unaligned_read16le(const uint8_t *buf)
|
||||
{
|
||||
uint16_t num = ((uint16_t)buf[0]) | ((uint16_t)buf[1] << 8);
|
||||
return num;
|
||||
}
|
||||
|
||||
|
||||
static inline uint32_t
|
||||
unaligned_read32be(const uint8_t *buf)
|
||||
{
|
||||
uint32_t num = (uint32_t)buf[0] << 24;
|
||||
num |= (uint32_t)buf[1] << 16;
|
||||
num |= (uint32_t)buf[2] << 8;
|
||||
num |= (uint32_t)buf[3];
|
||||
return num;
|
||||
}
|
||||
|
||||
|
||||
static inline uint32_t
|
||||
unaligned_read32le(const uint8_t *buf)
|
||||
{
|
||||
uint32_t num = (uint32_t)buf[0];
|
||||
num |= (uint32_t)buf[1] << 8;
|
||||
num |= (uint32_t)buf[2] << 16;
|
||||
num |= (uint32_t)buf[3] << 24;
|
||||
return num;
|
||||
}
|
||||
|
||||
|
||||
static inline void
|
||||
unaligned_write16be(uint8_t *buf, uint16_t num)
|
||||
{
|
||||
buf[0] = num >> 8;
|
||||
buf[1] = num;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
static inline void
|
||||
unaligned_write16le(uint8_t *buf, uint16_t num)
|
||||
{
|
||||
buf[0] = num;
|
||||
buf[1] = num >> 8;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
static inline void
|
||||
unaligned_write32be(uint8_t *buf, uint32_t num)
|
||||
{
|
||||
buf[0] = num >> 24;
|
||||
buf[1] = num >> 16;
|
||||
buf[2] = num >> 8;
|
||||
buf[3] = num;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
static inline void
|
||||
unaligned_write32le(uint8_t *buf, uint32_t num)
|
||||
{
|
||||
buf[0] = num;
|
||||
buf[1] = num >> 8;
|
||||
buf[2] = num >> 16;
|
||||
buf[3] = num >> 24;
|
||||
return;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
static inline uint32_t
|
||||
bsr32(uint32_t n)
|
||||
{
|
||||
// Check for ICC first, since it tends to define __GNUC__ too.
|
||||
#if defined(__INTEL_COMPILER)
|
||||
return _bit_scan_reverse(n);
|
||||
|
||||
#elif TUKLIB_GNUC_REQ(3, 4) && UINT_MAX == UINT32_MAX
|
||||
// GCC >= 3.4 has __builtin_clz(), which gives good results on
|
||||
// multiple architectures. On x86, __builtin_clz() ^ 31U becomes
|
||||
// either plain BSR (so the XOR gets optimized away) or LZCNT and
|
||||
// XOR (if -march indicates that SSE4a instructions are supported).
|
||||
return __builtin_clz(n) ^ 31U;
|
||||
|
||||
#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
|
||||
uint32_t i;
|
||||
__asm__("bsrl %1, %0" : "=r" (i) : "rm" (n));
|
||||
return i;
|
||||
|
||||
#elif defined(_MSC_VER) && _MSC_VER >= 1400
|
||||
// MSVC isn't supported by tuklib, but since this code exists,
|
||||
// it doesn't hurt to have it here anyway.
|
||||
uint32_t i;
|
||||
_BitScanReverse((DWORD *)&i, n);
|
||||
return i;
|
||||
|
||||
#else
|
||||
uint32_t i = 31;
|
||||
|
||||
if ((n & UINT32_C(0xFFFF0000)) == 0) {
|
||||
n <<= 16;
|
||||
i = 15;
|
||||
}
|
||||
|
||||
if ((n & UINT32_C(0xFF000000)) == 0) {
|
||||
n <<= 8;
|
||||
i -= 8;
|
||||
}
|
||||
|
||||
if ((n & UINT32_C(0xF0000000)) == 0) {
|
||||
n <<= 4;
|
||||
i -= 4;
|
||||
}
|
||||
|
||||
if ((n & UINT32_C(0xC0000000)) == 0) {
|
||||
n <<= 2;
|
||||
i -= 2;
|
||||
}
|
||||
|
||||
if ((n & UINT32_C(0x80000000)) == 0)
|
||||
--i;
|
||||
|
||||
return i;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
static inline uint32_t
|
||||
clz32(uint32_t n)
|
||||
{
|
||||
#if defined(__INTEL_COMPILER)
|
||||
return _bit_scan_reverse(n) ^ 31U;
|
||||
|
||||
#elif TUKLIB_GNUC_REQ(3, 4) && UINT_MAX == UINT32_MAX
|
||||
return __builtin_clz(n);
|
||||
|
||||
#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
|
||||
uint32_t i;
|
||||
__asm__("bsrl %1, %0\n\t"
|
||||
"xorl $31, %0"
|
||||
: "=r" (i) : "rm" (n));
|
||||
return i;
|
||||
|
||||
#elif defined(_MSC_VER) && _MSC_VER >= 1400
|
||||
uint32_t i;
|
||||
_BitScanReverse((DWORD *)&i, n);
|
||||
return i ^ 31U;
|
||||
|
||||
#else
|
||||
uint32_t i = 0;
|
||||
|
||||
if ((n & UINT32_C(0xFFFF0000)) == 0) {
|
||||
n <<= 16;
|
||||
i = 16;
|
||||
}
|
||||
|
||||
if ((n & UINT32_C(0xFF000000)) == 0) {
|
||||
n <<= 8;
|
||||
i += 8;
|
||||
}
|
||||
|
||||
if ((n & UINT32_C(0xF0000000)) == 0) {
|
||||
n <<= 4;
|
||||
i += 4;
|
||||
}
|
||||
|
||||
if ((n & UINT32_C(0xC0000000)) == 0) {
|
||||
n <<= 2;
|
||||
i += 2;
|
||||
}
|
||||
|
||||
if ((n & UINT32_C(0x80000000)) == 0)
|
||||
++i;
|
||||
|
||||
return i;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
static inline uint32_t
|
||||
ctz32(uint32_t n)
|
||||
{
|
||||
#if defined(__INTEL_COMPILER)
|
||||
return _bit_scan_forward(n);
|
||||
|
||||
#elif TUKLIB_GNUC_REQ(3, 4) && UINT_MAX >= UINT32_MAX
|
||||
return __builtin_ctz(n);
|
||||
|
||||
#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
|
||||
uint32_t i;
|
||||
__asm__("bsfl %1, %0" : "=r" (i) : "rm" (n));
|
||||
return i;
|
||||
|
||||
#elif defined(_MSC_VER) && _MSC_VER >= 1400
|
||||
uint32_t i;
|
||||
_BitScanForward((DWORD *)&i, n);
|
||||
return i;
|
||||
|
||||
#else
|
||||
uint32_t i = 0;
|
||||
|
||||
if ((n & UINT32_C(0x0000FFFF)) == 0) {
|
||||
n >>= 16;
|
||||
i = 16;
|
||||
}
|
||||
|
||||
if ((n & UINT32_C(0x000000FF)) == 0) {
|
||||
n >>= 8;
|
||||
i += 8;
|
||||
}
|
||||
|
||||
if ((n & UINT32_C(0x0000000F)) == 0) {
|
||||
n >>= 4;
|
||||
i += 4;
|
||||
}
|
||||
|
||||
if ((n & UINT32_C(0x00000003)) == 0) {
|
||||
n >>= 2;
|
||||
i += 2;
|
||||
}
|
||||
|
||||
if ((n & UINT32_C(0x00000001)) == 0)
|
||||
++i;
|
||||
|
||||
return i;
|
||||
#endif
|
||||
}
|
||||
|
||||
#define bsf32 ctz32
|
||||
|
||||
#endif
|
||||
66
src/common/tuklib_mbstr.h
Normal file
66
src/common/tuklib_mbstr.h
Normal file
@@ -0,0 +1,66 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file tuklib_mstr.h
|
||||
/// \brief Utility functions for handling multibyte strings
|
||||
///
|
||||
/// If not enough multibyte string support is available in the C library,
|
||||
/// these functions keep working with the assumption that all strings
|
||||
/// are in a single-byte character set without combining characters, e.g.
|
||||
/// US-ASCII or ISO-8859-*.
|
||||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef TUKLIB_MBSTR_H
|
||||
#define TUKLIB_MBSTR_H
|
||||
|
||||
#include "tuklib_common.h"
|
||||
TUKLIB_DECLS_BEGIN
|
||||
|
||||
#define tuklib_mbstr_width TUKLIB_SYMBOL(tuklib_mbstr_width)
|
||||
extern size_t tuklib_mbstr_width(const char *str, size_t *bytes);
|
||||
///<
|
||||
/// \brief Get the number of columns needed for the multibyte string
|
||||
///
|
||||
/// This is somewhat similar to wcswidth() but works on multibyte strings.
|
||||
///
|
||||
/// \param str String whose width is to be calculated. If the
|
||||
/// current locale uses a multibyte character set
|
||||
/// that has shift states, the string must begin
|
||||
/// and end in the initial shift state.
|
||||
/// \param bytes If this is not NULL, *bytes is set to the
|
||||
/// value returned by strlen(str) (even if an
|
||||
/// error occurs when calculating the width).
|
||||
///
|
||||
/// \return On success, the number of columns needed to display the
|
||||
/// string e.g. in a terminal emulator is returned. On error,
|
||||
/// (size_t)-1 is returned. Possible errors include invalid,
|
||||
/// partial, or non-printable multibyte character in str, or
|
||||
/// that str doesn't end in the initial shift state.
|
||||
|
||||
#define tuklib_mbstr_fw TUKLIB_SYMBOL(tuklib_mbstr_fw)
|
||||
extern int tuklib_mbstr_fw(const char *str, int columns_min);
|
||||
///<
|
||||
/// \brief Get the field width for printf() e.g. to align table columns
|
||||
///
|
||||
/// Printing simple tables to a terminal can be done using the field field
|
||||
/// feature in the printf() format string, but it works only with single-byte
|
||||
/// character sets. To do the same with multibyte strings, tuklib_mbstr_fw()
|
||||
/// can be used to calculate appropriate field width.
|
||||
///
|
||||
/// The behavior of this function is undefined, if
|
||||
/// - str is NULL or not terminated with '\0';
|
||||
/// - columns_min <= 0; or
|
||||
/// - the calculated field width exceeds INT_MAX.
|
||||
///
|
||||
/// \return If tuklib_mbstr_width(str, NULL) fails, -1 is returned.
|
||||
/// If str needs more columns than columns_min, zero is returned.
|
||||
/// Otherwise a positive integer is returned, which can be
|
||||
/// used as the field width, e.g. printf("%*s", fw, str).
|
||||
|
||||
TUKLIB_DECLS_END
|
||||
#endif
|
||||
31
src/common/tuklib_mbstr_fw.c
Normal file
31
src/common/tuklib_mbstr_fw.c
Normal file
@@ -0,0 +1,31 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file tuklib_mstr_fw.c
|
||||
/// \brief Get the field width for printf() e.g. to align table columns
|
||||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "tuklib_mbstr.h"
|
||||
|
||||
|
||||
extern int
|
||||
tuklib_mbstr_fw(const char *str, int columns_min)
|
||||
{
|
||||
size_t len;
|
||||
const size_t width = tuklib_mbstr_width(str, &len);
|
||||
if (width == (size_t)-1)
|
||||
return -1;
|
||||
|
||||
if (width > (size_t)columns_min)
|
||||
return 0;
|
||||
|
||||
if (width < (size_t)columns_min)
|
||||
len += (size_t)columns_min - width;
|
||||
|
||||
return len;
|
||||
}
|
||||
64
src/common/tuklib_mbstr_width.c
Normal file
64
src/common/tuklib_mbstr_width.c
Normal file
@@ -0,0 +1,64 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file tuklib_mstr_width.c
|
||||
/// \brief Calculate width of a multibyte string
|
||||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "tuklib_mbstr.h"
|
||||
|
||||
#if defined(HAVE_MBRTOWC) && defined(HAVE_WCWIDTH)
|
||||
# include <wchar.h>
|
||||
#endif
|
||||
|
||||
|
||||
extern size_t
|
||||
tuklib_mbstr_width(const char *str, size_t *bytes)
|
||||
{
|
||||
const size_t len = strlen(str);
|
||||
if (bytes != NULL)
|
||||
*bytes = len;
|
||||
|
||||
#if !(defined(HAVE_MBRTOWC) && defined(HAVE_WCWIDTH))
|
||||
// In single-byte mode, the width of the string is the same
|
||||
// as its length.
|
||||
return len;
|
||||
|
||||
#else
|
||||
mbstate_t state;
|
||||
memset(&state, 0, sizeof(state));
|
||||
|
||||
size_t width = 0;
|
||||
size_t i = 0;
|
||||
|
||||
// Convert one multibyte character at a time to wchar_t
|
||||
// and get its width using wcwidth().
|
||||
while (i < len) {
|
||||
wchar_t wc;
|
||||
const size_t ret = mbrtowc(&wc, str + i, len - i, &state);
|
||||
if (ret < 1 || ret > len)
|
||||
return (size_t)-1;
|
||||
|
||||
i += ret;
|
||||
|
||||
const int wc_width = wcwidth(wc);
|
||||
if (wc_width < 0)
|
||||
return (size_t)-1;
|
||||
|
||||
width += wc_width;
|
||||
}
|
||||
|
||||
// Require that the string ends in the initial shift state.
|
||||
// This way the caller can be combine the string with other
|
||||
// strings without needing to worry about the shift states.
|
||||
if (!mbsinit(&state))
|
||||
return (size_t)-1;
|
||||
|
||||
return width;
|
||||
#endif
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file open_stdxxx.h
|
||||
/// \file tuklib_open_stdxxx.c
|
||||
/// \brief Make sure that file descriptors 0, 1, and 2 are open
|
||||
//
|
||||
// Author: Lasse Collin
|
||||
@@ -10,17 +10,24 @@
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef OPEN_STDXXX_H
|
||||
#define OPEN_STDXXX_H
|
||||
#include "tuklib_open_stdxxx.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#ifndef TUKLIB_DOSLIKE
|
||||
# include <stdlib.h>
|
||||
# include <errno.h>
|
||||
# include <fcntl.h>
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
|
||||
static void
|
||||
open_stdxxx(int status)
|
||||
extern void
|
||||
tuklib_open_stdxxx(int err_status)
|
||||
{
|
||||
#ifdef TUKLIB_DOSLIKE
|
||||
// Do nothing, just silence warnings.
|
||||
(void)err_status;
|
||||
|
||||
#else
|
||||
for (int i = 0; i <= 2; ++i) {
|
||||
// We use fcntl() to check if the file descriptor is open.
|
||||
if (fcntl(i, F_GETFD) == -1 && errno == EBADF) {
|
||||
@@ -32,18 +39,19 @@ open_stdxxx(int status)
|
||||
| (i == 0 ? O_WRONLY : O_RDONLY));
|
||||
|
||||
if (fd != i) {
|
||||
if (fd != -1)
|
||||
(void)close(fd);
|
||||
|
||||
// Something went wrong. Exit with the
|
||||
// exit status we were given. Don't try
|
||||
// to print an error message, since stderr
|
||||
// may very well be non-existent. This
|
||||
// error should be extremely rare.
|
||||
(void)close(fd);
|
||||
exit(status);
|
||||
exit(err_status);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#endif
|
||||
23
src/common/tuklib_open_stdxxx.h
Normal file
23
src/common/tuklib_open_stdxxx.h
Normal file
@@ -0,0 +1,23 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file tuklib_open_stdxxx.h
|
||||
/// \brief Make sure that file descriptors 0, 1, and 2 are open
|
||||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef TUKLIB_OPEN_STDXXX_H
|
||||
#define TUKLIB_OPEN_STDXXX_H
|
||||
|
||||
#include "tuklib_common.h"
|
||||
TUKLIB_DECLS_BEGIN
|
||||
|
||||
#define tuklib_open_stdxx TUKLIB_SYMBOL(tuklib_open_stdxxx)
|
||||
extern void tuklib_open_stdxxx(int err_status);
|
||||
|
||||
TUKLIB_DECLS_END
|
||||
#endif
|
||||
203
src/common/tuklib_physmem.c
Normal file
203
src/common/tuklib_physmem.c
Normal file
@@ -0,0 +1,203 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file tuklib_physmem.c
|
||||
/// \brief Get the amount of physical memory
|
||||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "tuklib_physmem.h"
|
||||
|
||||
// We want to use Windows-specific code on Cygwin, which also has memory
|
||||
// information available via sysconf(), but on Cygwin 1.5 and older it
|
||||
// gives wrong results (from our point of view).
|
||||
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||
# ifndef _WIN32_WINNT
|
||||
# define _WIN32_WINNT 0x0500
|
||||
# endif
|
||||
# include <windows.h>
|
||||
|
||||
#elif defined(__OS2__)
|
||||
# define INCL_DOSMISC
|
||||
# include <os2.h>
|
||||
|
||||
#elif defined(__DJGPP__)
|
||||
# include <dpmi.h>
|
||||
|
||||
#elif defined(__VMS)
|
||||
# include <lib$routines.h>
|
||||
# include <syidef.h>
|
||||
# include <ssdef.h>
|
||||
|
||||
#elif defined(AMIGA) || defined(__AROS__)
|
||||
# define __USE_INLINE__
|
||||
# include <proto/exec.h>
|
||||
|
||||
// AIX
|
||||
#elif defined(TUKLIB_PHYSMEM_AIX)
|
||||
# include <sys/systemcfg.h>
|
||||
|
||||
#elif defined(TUKLIB_PHYSMEM_SYSCONF)
|
||||
# include <unistd.h>
|
||||
|
||||
#elif defined(TUKLIB_PHYSMEM_SYSCTL)
|
||||
# ifdef HAVE_SYS_PARAM_H
|
||||
# include <sys/param.h>
|
||||
# endif
|
||||
# include <sys/sysctl.h>
|
||||
|
||||
// Tru64
|
||||
#elif defined(TUKLIB_PHYSMEM_GETSYSINFO)
|
||||
# include <sys/sysinfo.h>
|
||||
# include <machine/hal_sysinfo.h>
|
||||
|
||||
// HP-UX
|
||||
#elif defined(TUKLIB_PHYSMEM_PSTAT_GETSTATIC)
|
||||
# include <sys/param.h>
|
||||
# include <sys/pstat.h>
|
||||
|
||||
// IRIX
|
||||
#elif defined(TUKLIB_PHYSMEM_GETINVENT_R)
|
||||
# include <invent.h>
|
||||
|
||||
// This sysinfo() is Linux-specific.
|
||||
#elif defined(TUKLIB_PHYSMEM_SYSINFO)
|
||||
# include <sys/sysinfo.h>
|
||||
#endif
|
||||
|
||||
|
||||
extern uint64_t
|
||||
tuklib_physmem(void)
|
||||
{
|
||||
uint64_t ret = 0;
|
||||
|
||||
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||
if ((GetVersion() & 0xFF) >= 5) {
|
||||
// Windows 2000 and later have GlobalMemoryStatusEx() which
|
||||
// supports reporting values greater than 4 GiB. To keep the
|
||||
// code working also on older Windows versions, use
|
||||
// GlobalMemoryStatusEx() conditionally.
|
||||
HMODULE kernel32 = GetModuleHandle("kernel32.dll");
|
||||
if (kernel32 != NULL) {
|
||||
BOOL (WINAPI *gmse)(LPMEMORYSTATUSEX) = GetProcAddress(
|
||||
kernel32, "GlobalMemoryStatusEx");
|
||||
if (gmse != NULL) {
|
||||
MEMORYSTATUSEX meminfo;
|
||||
meminfo.dwLength = sizeof(meminfo);
|
||||
if (gmse(&meminfo))
|
||||
ret = meminfo.ullTotalPhys;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ret == 0) {
|
||||
// GlobalMemoryStatus() is supported by Windows 95 and later,
|
||||
// so it is fine to link against it unconditionally. Note that
|
||||
// GlobalMemoryStatus() has no return value.
|
||||
MEMORYSTATUS meminfo;
|
||||
meminfo.dwLength = sizeof(meminfo);
|
||||
GlobalMemoryStatus(&meminfo);
|
||||
ret = meminfo.dwTotalPhys;
|
||||
}
|
||||
|
||||
#elif defined(__OS2__)
|
||||
unsigned long mem;
|
||||
if (DosQuerySysInfo(QSV_TOTPHYSMEM, QSV_TOTPHYSMEM,
|
||||
&mem, sizeof(mem)) == 0)
|
||||
ret = mem;
|
||||
|
||||
#elif defined(__DJGPP__)
|
||||
__dpmi_free_mem_info meminfo;
|
||||
if (__dpmi_get_free_memory_information(&meminfo) == 0
|
||||
&& meminfo.total_number_of_physical_pages
|
||||
!= (unsigned long)-1)
|
||||
ret = (uint64_t)meminfo.total_number_of_physical_pages * 4096;
|
||||
|
||||
#elif defined(__VMS)
|
||||
int vms_mem;
|
||||
int val = SYI$_MEMSIZE;
|
||||
if (LIB$GETSYI(&val, &vms_mem, 0, 0, 0, 0) == SS$_NORMAL)
|
||||
ret = (uint64_t)vms_mem * 8192;
|
||||
|
||||
#elif defined(AMIGA) || defined(__AROS__)
|
||||
ret = AvailMem(MEMF_TOTAL);
|
||||
|
||||
#elif defined(TUKLIB_PHYSMEM_AIX)
|
||||
ret = _system_configuration.physmem;
|
||||
|
||||
#elif defined(TUKLIB_PHYSMEM_SYSCONF)
|
||||
const long pagesize = sysconf(_SC_PAGESIZE);
|
||||
const long pages = sysconf(_SC_PHYS_PAGES);
|
||||
if (pagesize != -1 && pages != -1)
|
||||
// According to docs, pagesize * pages can overflow.
|
||||
// Simple case is 32-bit box with 4 GiB or more RAM,
|
||||
// which may report exactly 4 GiB of RAM, and "long"
|
||||
// being 32-bit will overflow. Casting to uint64_t
|
||||
// hopefully avoids overflows in the near future.
|
||||
ret = (uint64_t)pagesize * (uint64_t)pages;
|
||||
|
||||
#elif defined(TUKLIB_PHYSMEM_SYSCTL)
|
||||
int name[2] = {
|
||||
CTL_HW,
|
||||
#ifdef HW_PHYSMEM64
|
||||
HW_PHYSMEM64
|
||||
#else
|
||||
HW_PHYSMEM
|
||||
#endif
|
||||
};
|
||||
union {
|
||||
uint32_t u32;
|
||||
uint64_t u64;
|
||||
} mem;
|
||||
size_t mem_ptr_size = sizeof(mem.u64);
|
||||
if (sysctl(name, 2, &mem.u64, &mem_ptr_size, NULL, 0) != -1) {
|
||||
// IIRC, 64-bit "return value" is possible on some 64-bit
|
||||
// BSD systems even with HW_PHYSMEM (instead of HW_PHYSMEM64),
|
||||
// so support both.
|
||||
if (mem_ptr_size == sizeof(mem.u64))
|
||||
ret = mem.u64;
|
||||
else if (mem_ptr_size == sizeof(mem.u32))
|
||||
ret = mem.u32;
|
||||
}
|
||||
|
||||
#elif defined(TUKLIB_PHYSMEM_GETSYSINFO)
|
||||
// Docs are unclear if "start" is needed, but it doesn't hurt
|
||||
// much to have it.
|
||||
int memkb;
|
||||
int start = 0;
|
||||
if (getsysinfo(GSI_PHYSMEM, (caddr_t)&memkb, sizeof(memkb), &start)
|
||||
!= -1)
|
||||
ret = (uint64_t)memkb * 1024;
|
||||
|
||||
#elif defined(TUKLIB_PHYSMEM_PSTAT_GETSTATIC)
|
||||
struct pst_static pst;
|
||||
if (pstat_getstatic(&pst, sizeof(pst), 1, 0) != -1)
|
||||
ret = (uint64_t)pst.physical_memory * (uint64_t)pst.page_size;
|
||||
|
||||
#elif defined(TUKLIB_PHYSMEM_GETINVENT_R)
|
||||
inv_state_t *st = NULL;
|
||||
if (setinvent_r(&st) != -1) {
|
||||
inventory_t *i;
|
||||
while ((i = getinvent_r(st)) != NULL) {
|
||||
if (i->inv_class == INV_MEMORY
|
||||
&& i->inv_type == INV_MAIN_MB) {
|
||||
ret = (uint64_t)i->inv_state << 20;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
endinvent_r(st);
|
||||
}
|
||||
|
||||
#elif defined(TUKLIB_PHYSMEM_SYSINFO)
|
||||
struct sysinfo si;
|
||||
if (sysinfo(&si) == 0)
|
||||
ret = (uint64_t)si.totalram * si.mem_unit;
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
28
src/common/tuklib_physmem.h
Normal file
28
src/common/tuklib_physmem.h
Normal file
@@ -0,0 +1,28 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file tuklib_physmem.h
|
||||
/// \brief Get the amount of physical memory
|
||||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef TUKLIB_PHYSMEM_H
|
||||
#define TUKLIB_PHYSMEM_H
|
||||
|
||||
#include "tuklib_common.h"
|
||||
TUKLIB_DECLS_BEGIN
|
||||
|
||||
#define tuklib_physmem TUKLIB_SYMBOL(tuklib_physmem)
|
||||
extern uint64_t tuklib_physmem(void);
|
||||
///<
|
||||
/// \brief Get the amount of physical memory in bytes
|
||||
///
|
||||
/// \return Amount of physical memory in bytes. On error, zero is
|
||||
/// returned.
|
||||
|
||||
TUKLIB_DECLS_END
|
||||
#endif
|
||||
50
src/common/tuklib_progname.c
Normal file
50
src/common/tuklib_progname.c
Normal file
@@ -0,0 +1,50 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file tuklib_progname.c
|
||||
/// \brief Program name to be displayed in messages
|
||||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "tuklib_progname.h"
|
||||
#include <string.h>
|
||||
|
||||
|
||||
#if !HAVE_DECL_PROGRAM_INVOCATION_NAME
|
||||
char *progname = NULL;
|
||||
#endif
|
||||
|
||||
|
||||
extern void
|
||||
tuklib_progname_init(char **argv)
|
||||
{
|
||||
#ifdef TUKLIB_DOSLIKE
|
||||
// On these systems, argv[0] always has the full path and .exe
|
||||
// suffix even if the user just types the plain program name.
|
||||
// We modify argv[0] to make it nicer to read.
|
||||
|
||||
// Strip the leading path.
|
||||
char *p = argv[0] + strlen(argv[0]);
|
||||
while (argv[0] < p && p[-1] != '/' && p[-1] != '\\')
|
||||
--p;
|
||||
|
||||
argv[0] = p;
|
||||
|
||||
// Strip the .exe suffix.
|
||||
p = strrchr(p, '.');
|
||||
if (p != NULL)
|
||||
*p = '\0';
|
||||
|
||||
// Make it lowercase.
|
||||
for (p = argv[0]; *p != '\0'; ++p)
|
||||
if (*p >= 'A' && *p <= 'Z')
|
||||
*p = *p - 'A' + 'a';
|
||||
#endif
|
||||
|
||||
progname = argv[0];
|
||||
return;
|
||||
}
|
||||
32
src/common/tuklib_progname.h
Normal file
32
src/common/tuklib_progname.h
Normal file
@@ -0,0 +1,32 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file tuklib_progname.h
|
||||
/// \brief Program name to be displayed in messages
|
||||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef TUKLIB_PROGNAME_H
|
||||
#define TUKLIB_PROGNAME_H
|
||||
|
||||
#include "tuklib_common.h"
|
||||
#include <errno.h>
|
||||
|
||||
TUKLIB_DECLS_BEGIN
|
||||
|
||||
#if HAVE_DECL_PROGRAM_INVOCATION_NAME
|
||||
# define progname program_invocation_name
|
||||
#else
|
||||
# define progname TUKLIB_SYMBOL(tuklib_progname)
|
||||
extern char *progname;
|
||||
#endif
|
||||
|
||||
#define tuklib_progname_init TUKLIB_SYMBOL(tuklib_progname_init)
|
||||
extern void tuklib_progname_init(char **argv);
|
||||
|
||||
TUKLIB_DECLS_END
|
||||
#endif
|
||||
@@ -20,11 +20,23 @@ liblzma_la_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/liblzma/lz \
|
||||
-I$(top_srcdir)/src/liblzma/rangecoder \
|
||||
-I$(top_srcdir)/src/liblzma/lzma \
|
||||
-I$(top_srcdir)/src/liblzma/subblock \
|
||||
-I$(top_srcdir)/src/liblzma/delta \
|
||||
-I$(top_srcdir)/src/liblzma/simple \
|
||||
-I$(top_srcdir)/src/common
|
||||
liblzma_la_LDFLAGS = -no-undefined -version-info 0:0:0
|
||||
-I$(top_srcdir)/src/common \
|
||||
-DTUKLIB_SYMBOL_PREFIX=lzma_
|
||||
liblzma_la_LDFLAGS = -no-undefined -version-info 7:0:2
|
||||
|
||||
EXTRA_DIST += liblzma.map validate_map.sh
|
||||
if COND_SYMVERS
|
||||
liblzma_la_LDFLAGS += \
|
||||
-Wl,--version-script=$(top_srcdir)/src/liblzma/liblzma.map
|
||||
endif
|
||||
|
||||
liblzma_la_SOURCES += ../common/tuklib_physmem.c
|
||||
|
||||
if COND_THREADS
|
||||
liblzma_la_SOURCES += ../common/tuklib_cpucores.c
|
||||
endif
|
||||
|
||||
include $(srcdir)/common/Makefile.inc
|
||||
include $(srcdir)/check/Makefile.inc
|
||||
@@ -38,10 +50,6 @@ include $(srcdir)/lzma/Makefile.inc
|
||||
include $(srcdir)/rangecoder/Makefile.inc
|
||||
endif
|
||||
|
||||
if COND_FILTER_SUBBLOCK
|
||||
include $(srcdir)/subblock/Makefile.inc
|
||||
endif
|
||||
|
||||
if COND_FILTER_DELTA
|
||||
include $(srcdir)/delta/Makefile.inc
|
||||
endif
|
||||
@@ -92,3 +100,23 @@ endif
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = liblzma.pc
|
||||
EXTRA_DIST += liblzma.pc.in
|
||||
|
||||
pc_verbose = $(pc_verbose_@AM_V@)
|
||||
pc_verbose_ = $(pc_verbose_@AM_DEFAULT_V@)
|
||||
pc_verbose_0 = @echo " PC " $@;
|
||||
|
||||
liblzma.pc: $(srcdir)/liblzma.pc.in
|
||||
$(AM_V_at)rm -f $@
|
||||
$(pc_verbose)sed \
|
||||
-e 's,@prefix[@],$(prefix),g' \
|
||||
-e 's,@exec_prefix[@],$(exec_prefix),g' \
|
||||
-e 's,@libdir[@],$(libdir),g' \
|
||||
-e 's,@includedir[@],$(includedir),g' \
|
||||
-e 's,@PACKAGE_URL[@],$(PACKAGE_URL),g' \
|
||||
-e 's,@PACKAGE_VERSION[@],$(PACKAGE_VERSION),g' \
|
||||
-e 's,@PTHREAD_CFLAGS[@],$(PTHREAD_CFLAGS),g' \
|
||||
-e 's,@LIBS[@],$(LIBS),g' \
|
||||
< $(srcdir)/liblzma.pc.in > $@ || { rm -f $@; exit 1; }
|
||||
|
||||
clean-local:
|
||||
rm -f liblzma.pc
|
||||
|
||||
@@ -14,10 +14,10 @@ nobase_include_HEADERS = \
|
||||
lzma/container.h \
|
||||
lzma/delta.h \
|
||||
lzma/filter.h \
|
||||
lzma/hardware.h \
|
||||
lzma/index.h \
|
||||
lzma/index_hash.h \
|
||||
lzma/lzma.h \
|
||||
lzma/lzma12.h \
|
||||
lzma/stream_flags.h \
|
||||
lzma/subblock.h \
|
||||
lzma/version.h \
|
||||
lzma/vli.h
|
||||
|
||||
@@ -60,8 +60,8 @@
|
||||
*
|
||||
* Some could argue that liblzma API should provide all the required types,
|
||||
* for example lzma_uint64, LZMA_UINT64_C(n), and LZMA_UINT64_MAX. This was
|
||||
* seen unnecessary mess, since most systems already provide all the necessary
|
||||
* types and macros in the standard headers.
|
||||
* seen as an unnecessary mess, since most systems already provide all the
|
||||
* necessary types and macros in the standard headers.
|
||||
*
|
||||
* Note that liblzma API still has lzma_bool, because using stdbool.h would
|
||||
* break C89 and C++ programs on many systems. sizeof(bool) in C99 isn't
|
||||
@@ -95,8 +95,8 @@
|
||||
/* Use the standard inttypes.h. */
|
||||
# ifdef __cplusplus
|
||||
/*
|
||||
* C99 sections 7.18.2 and 7.18.4 specify that
|
||||
* in C++ implementations define the limit
|
||||
* C99 sections 7.18.2 and 7.18.4 specify
|
||||
* that C++ implementations define the limit
|
||||
* and constant macros only if specifically
|
||||
* requested. Note that if you want the
|
||||
* format macros (PRIu64 etc.) too, you need
|
||||
@@ -162,10 +162,9 @@
|
||||
******************/
|
||||
|
||||
/*
|
||||
* Some systems require (or at least recommend) that the functions and
|
||||
* function pointers are declared specially in the headers. LZMA_API_IMPORT
|
||||
* is for importing symbols and LZMA_API_CALL is to specify calling
|
||||
* convention.
|
||||
* Some systems require that the functions and function pointers are
|
||||
* declared specially in the headers. LZMA_API_IMPORT is for importing
|
||||
* symbols and LZMA_API_CALL is to specify the calling convention.
|
||||
*
|
||||
* By default it is assumed that the application will link dynamically
|
||||
* against liblzma. #define LZMA_API_STATIC in your application if you
|
||||
@@ -174,11 +173,14 @@
|
||||
* against static liblzma on them, don't worry about LZMA_API_STATIC. That
|
||||
* is, most developers will never need to use LZMA_API_STATIC.
|
||||
*
|
||||
* Cygwin is a special case on Windows. We rely on GCC doing the right thing
|
||||
* and thus don't use dllimport and don't specify the calling convention.
|
||||
* The GCC variants are a special case on Windows (Cygwin and MinGW).
|
||||
* We rely on GCC doing the right thing with its auto-import feature,
|
||||
* and thus don't use __declspec(dllimport). This way developers don't
|
||||
* need to worry about LZMA_API_STATIC. Also the calling convention is
|
||||
* omitted on Cygwin but not on MinGW.
|
||||
*/
|
||||
#ifndef LZMA_API_IMPORT
|
||||
# if !defined(LZMA_API_STATIC) && defined(_WIN32) && !defined(__CYGWIN__)
|
||||
# if !defined(LZMA_API_STATIC) && defined(_WIN32) && !defined(__GNUC__)
|
||||
# define LZMA_API_IMPORT __declspec(dllimport)
|
||||
# else
|
||||
# define LZMA_API_IMPORT
|
||||
@@ -210,7 +212,7 @@
|
||||
#ifndef lzma_nothrow
|
||||
# if defined(__cplusplus)
|
||||
# define lzma_nothrow throw()
|
||||
# elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
|
||||
# elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
|
||||
# define lzma_nothrow __attribute__((__nothrow__))
|
||||
# else
|
||||
# define lzma_nothrow
|
||||
@@ -230,10 +232,6 @@
|
||||
#if __GNUC__ >= 3
|
||||
# ifndef lzma_attribute
|
||||
# define lzma_attribute(attr) __attribute__(attr)
|
||||
# endif
|
||||
|
||||
# ifndef lzma_restrict
|
||||
# define lzma_restrict __restrict__
|
||||
# endif
|
||||
|
||||
/* warn_unused_result was added in GCC 3.4. */
|
||||
@@ -247,14 +245,6 @@
|
||||
# ifndef lzma_attribute
|
||||
# define lzma_attribute(attr)
|
||||
# endif
|
||||
|
||||
# ifndef lzma_restrict
|
||||
# if __STDC_VERSION__ >= 199901L
|
||||
# define lzma_restrict restrict
|
||||
# else
|
||||
# define lzma_restrict
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -294,10 +284,9 @@ extern "C" {
|
||||
|
||||
/* Filters */
|
||||
#include "lzma/filter.h"
|
||||
#include "lzma/subblock.h"
|
||||
#include "lzma/bcj.h"
|
||||
#include "lzma/delta.h"
|
||||
#include "lzma/lzma.h"
|
||||
#include "lzma/lzma12.h"
|
||||
|
||||
/* Container formats */
|
||||
#include "lzma/container.h"
|
||||
@@ -308,6 +297,9 @@ extern "C" {
|
||||
#include "lzma/index.h"
|
||||
#include "lzma/index_hash.h"
|
||||
|
||||
/* Hardware information */
|
||||
#include "lzma/hardware.h"
|
||||
|
||||
/*
|
||||
* All subheaders included. Undefine LZMA_H_INTERNAL to prevent applications
|
||||
* re-including the subheaders.
|
||||
|
||||
@@ -81,7 +81,7 @@ typedef enum {
|
||||
* the decoder. LZMA_NO_CHECK is just a warning, and
|
||||
* the decoding can be continued normally.
|
||||
*
|
||||
* It is possible to call lzma_get_check() immediatelly after
|
||||
* It is possible to call lzma_get_check() immediately after
|
||||
* lzma_code has returned LZMA_NO_CHECK. The result will
|
||||
* naturally be LZMA_CHECK_NONE, but the possibility to call
|
||||
* lzma_get_check() may be convenient in some applications.
|
||||
@@ -107,7 +107,7 @@ typedef enum {
|
||||
* errors may go undetected.
|
||||
*
|
||||
* With decoder, it is possible to call lzma_get_check()
|
||||
* immediatelly after lzma_code() has returned
|
||||
* immediately after lzma_code() has returned
|
||||
* LZMA_UNSUPPORTED_CHECK. This way it is possible to find
|
||||
* out what the unsupported Check ID was.
|
||||
*/
|
||||
@@ -240,12 +240,12 @@ typedef enum {
|
||||
/**
|
||||
* \brief The `action' argument for lzma_code()
|
||||
*
|
||||
* After the first use of LZMA_SYNC_FLUSH, LZMA_FULL_FLUSH, or LZMA_FINISH,
|
||||
* the same `action' must is used until lzma_code() returns LZMA_STREAM_END.
|
||||
* Also, the amount of input (that is, strm->avail_in) must not be modified
|
||||
* by the application until lzma_code() returns LZMA_STREAM_END. Changing the
|
||||
* `action' or modifying the amount of input will make lzma_code() return
|
||||
* LZMA_PROG_ERROR.
|
||||
* After the first use of LZMA_SYNC_FLUSH, LZMA_FULL_FLUSH, LZMA_FULL_BARRIER,
|
||||
* or LZMA_FINISH, the same `action' must is used until lzma_code() returns
|
||||
* LZMA_STREAM_END. Also, the amount of input (that is, strm->avail_in) must
|
||||
* not be modified by the application until lzma_code() returns
|
||||
* LZMA_STREAM_END. Changing the `action' or modifying the amount of input
|
||||
* will make lzma_code() return LZMA_PROG_ERROR.
|
||||
*/
|
||||
typedef enum {
|
||||
LZMA_RUN = 0,
|
||||
@@ -280,38 +280,61 @@ typedef enum {
|
||||
*
|
||||
* Using LZMA_SYNC_FLUSH very often can dramatically reduce
|
||||
* the compression ratio. With some filters (for example,
|
||||
* LZMA2), finetuning the compression options may help
|
||||
* mitigate this problem significantly.
|
||||
* LZMA2), fine-tuning the compression options may help
|
||||
* mitigate this problem significantly (for example,
|
||||
* match finder with LZMA2).
|
||||
*
|
||||
* Decoders don't support LZMA_SYNC_FLUSH.
|
||||
*/
|
||||
|
||||
LZMA_FULL_FLUSH = 2,
|
||||
/**<
|
||||
* \brief Make all the input available at output
|
||||
* \brief Finish encoding of the current Block
|
||||
*
|
||||
* Finish encoding of the current Block. All the input
|
||||
* data going to the current Block must have been given
|
||||
* to the encoder (the last bytes can still be pending in
|
||||
* next_in). Call lzma_code() with LZMA_FULL_FLUSH until
|
||||
* it returns LZMA_STREAM_END. Then continue normally with
|
||||
* LZMA_RUN or finish the Stream with LZMA_FINISH.
|
||||
* All the input data going to the current Block must have
|
||||
* been given to the encoder (the last bytes can still be
|
||||
* pending in *next_in). Call lzma_code() with LZMA_FULL_FLUSH
|
||||
* until it returns LZMA_STREAM_END. Then continue normally
|
||||
* with LZMA_RUN or finish the Stream with LZMA_FINISH.
|
||||
*
|
||||
* This action is currently supported only by Stream encoder
|
||||
* and easy encoder (which uses Stream encoder). If there is
|
||||
* no unfinished Block, no empty Block is created.
|
||||
*/
|
||||
|
||||
LZMA_FULL_BARRIER = 4,
|
||||
/**<
|
||||
* \brief Finish encoding of the current Block
|
||||
*
|
||||
* This is like LZMA_FULL_FLUSH except that this doesn't
|
||||
* necessarily wait until all the input has been made
|
||||
* available via the output buffer. That is, lzma_code()
|
||||
* might return LZMA_STREAM_END as soon as all the input
|
||||
* has been consumed (avail_in == 0).
|
||||
*
|
||||
* LZMA_FULL_BARRIER is useful with a threaded encoder if
|
||||
* one wants to split the .xz Stream into Blocks at specific
|
||||
* offsets but doesn't care if the output isn't flushed
|
||||
* immediately. Using LZMA_FULL_BARRIER allows keeping
|
||||
* the threads busy while LZMA_FULL_FLUSH would make
|
||||
* lzma_code() wait until all the threads have finished
|
||||
* until more data could be passed to the encoder.
|
||||
*
|
||||
* With a lzma_stream initialized with the single-threaded
|
||||
* lzma_stream_encoder() or lzma_easy_encoder(),
|
||||
* LZMA_FULL_BARRIER is an alias for LZMA_FULL_FLUSH.
|
||||
*/
|
||||
|
||||
LZMA_FINISH = 3
|
||||
/**<
|
||||
* \brief Finish the coding operation
|
||||
*
|
||||
* Finishes the coding operation. All the input data must
|
||||
* have been given to the encoder (the last bytes can still
|
||||
* be pending in next_in). Call lzma_code() with LZMA_FINISH
|
||||
* until it returns LZMA_STREAM_END. Once LZMA_FINISH has
|
||||
* been used, the amount of input must no longer be changed
|
||||
* by the application.
|
||||
* All the input data must have been given to the encoder
|
||||
* (the last bytes can still be pending in next_in).
|
||||
* Call lzma_code() with LZMA_FINISH until it returns
|
||||
* LZMA_STREAM_END. Once LZMA_FINISH has been used,
|
||||
* the amount of input must no longer be changed by
|
||||
* the application.
|
||||
*
|
||||
* When decoding, using LZMA_FINISH is optional unless the
|
||||
* LZMA_CONCATENATED flag was used when the decoder was
|
||||
@@ -332,11 +355,19 @@ typedef enum {
|
||||
* malloc() and free(). C++ users should note that the custom memory
|
||||
* handling functions must not throw exceptions.
|
||||
*
|
||||
* liblzma doesn't make an internal copy of lzma_allocator. Thus, it is
|
||||
* OK to change these function pointers in the middle of the coding
|
||||
* process, but obviously it must be done carefully to make sure that the
|
||||
* replacement `free' can deallocate memory allocated by the earlier
|
||||
* `alloc' function(s).
|
||||
* Single-threaded mode only: liblzma doesn't make an internal copy of
|
||||
* lzma_allocator. Thus, it is OK to change these function pointers in
|
||||
* the middle of the coding process, but obviously it must be done
|
||||
* carefully to make sure that the replacement `free' can deallocate
|
||||
* memory allocated by the earlier `alloc' function(s).
|
||||
*
|
||||
* Multithreaded mode: liblzma might internally store pointers to the
|
||||
* lzma_allocator given via the lzma_stream structure. The application
|
||||
* must not change the allocator pointer in lzma_stream or the contents
|
||||
* of the pointed lzma_allocator structure until lzma_end() has been used
|
||||
* to free the memory associated with that lzma_stream. The allocation
|
||||
* functions might be called simultaneously from multiple threads, and
|
||||
* thus they must be thread safe.
|
||||
*/
|
||||
typedef struct {
|
||||
/**
|
||||
@@ -448,7 +479,8 @@ typedef struct lzma_internal_s lzma_internal;
|
||||
*
|
||||
* Application may modify the values of total_in and total_out as it wants.
|
||||
* They are updated by liblzma to match the amount of data read and
|
||||
* written, but aren't used for anything else.
|
||||
* written but aren't used for anything else except as a possible return
|
||||
* values from lzma_get_progress().
|
||||
*/
|
||||
typedef struct {
|
||||
const uint8_t *next_in; /**< Pointer to the next input byte. */
|
||||
@@ -464,8 +496,10 @@ typedef struct {
|
||||
*
|
||||
* In most cases this is NULL which makes liblzma use
|
||||
* the standard malloc() and free().
|
||||
*
|
||||
* \note In 5.0.x this is not a const pointer.
|
||||
*/
|
||||
lzma_allocator *allocator;
|
||||
const lzma_allocator *allocator;
|
||||
|
||||
/** Internal state is not visible to applications. */
|
||||
lzma_internal *internal;
|
||||
@@ -478,8 +512,12 @@ typedef struct {
|
||||
*/
|
||||
void *reserved_ptr1;
|
||||
void *reserved_ptr2;
|
||||
void *reserved_ptr3;
|
||||
void *reserved_ptr4;
|
||||
uint64_t reserved_int1;
|
||||
uint64_t reserved_int2;
|
||||
size_t reserved_int3;
|
||||
size_t reserved_int4;
|
||||
lzma_reserved_enum reserved_enum1;
|
||||
lzma_reserved_enum reserved_enum2;
|
||||
|
||||
@@ -489,7 +527,7 @@ typedef struct {
|
||||
/**
|
||||
* \brief Initialization for lzma_stream
|
||||
*
|
||||
* When you declare an instance of lzma_stream, you can immediatelly
|
||||
* When you declare an instance of lzma_stream, you can immediately
|
||||
* initialize it so that initialization functions know that no memory
|
||||
* has been allocated yet:
|
||||
*
|
||||
@@ -506,7 +544,8 @@ typedef struct {
|
||||
*/
|
||||
#define LZMA_STREAM_INIT \
|
||||
{ NULL, 0, 0, NULL, 0, 0, NULL, NULL, \
|
||||
NULL, NULL, 0, 0, LZMA_RESERVED_ENUM, LZMA_RESERVED_ENUM }
|
||||
NULL, NULL, NULL, NULL, 0, 0, 0, 0, \
|
||||
LZMA_RESERVED_ENUM, LZMA_RESERVED_ENUM }
|
||||
|
||||
|
||||
/**
|
||||
@@ -541,6 +580,25 @@ extern LZMA_API(lzma_ret) lzma_code(lzma_stream *strm, lzma_action action)
|
||||
extern LZMA_API(void) lzma_end(lzma_stream *strm) lzma_nothrow;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Get progress information
|
||||
*
|
||||
* In single-threaded mode, applications can get progress information from
|
||||
* strm->total_in and strm->total_out. In multi-threaded mode this is less
|
||||
* useful because a significant amount of both input and output data gets
|
||||
* buffered internally by liblzma. This makes total_in and total_out give
|
||||
* misleading information and also makes the progress indicator updates
|
||||
* non-smooth.
|
||||
*
|
||||
* This function gives realistic progress information also in multi-threaded
|
||||
* mode by taking into account the progress made by each thread. In
|
||||
* single-threaded mode *progress_in and *progress_out are set to
|
||||
* strm->total_in and strm->total_out, respectively.
|
||||
*/
|
||||
extern LZMA_API(void) lzma_get_progress(lzma_stream *strm,
|
||||
uint64_t *progress_in, uint64_t *progress_out) lzma_nothrow;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Get the memory usage of decoder filter chain
|
||||
*
|
||||
@@ -554,11 +612,11 @@ extern LZMA_API(void) lzma_end(lzma_stream *strm) lzma_nothrow;
|
||||
* this may give misleading information if decoding .xz Streams that have
|
||||
* multiple Blocks, because each Block can have different memory requirements.
|
||||
*
|
||||
* \return Rough estimate of how much memory is currently allocated
|
||||
* for the filter decoders. If no filter chain is currently
|
||||
* allocated, some non-zero value is still returned, which is
|
||||
* less than or equal to what any filter chain would indicate
|
||||
* as its memory requirement.
|
||||
* \return How much memory is currently allocated for the filter
|
||||
* decoders. If no filter chain is currently allocated,
|
||||
* some non-zero value is still returned, which is less than
|
||||
* or equal to what any filter chain would indicate as its
|
||||
* memory requirement.
|
||||
*
|
||||
* If this function isn't supported by *strm or some other error
|
||||
* occurs, zero is returned.
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
#define LZMA_FILTER_IA64 LZMA_VLI_C(0x06)
|
||||
/**<
|
||||
* Filter for IA64 (Itanium) binaries.
|
||||
* Filter for IA-64 (Itanium) binaries.
|
||||
*/
|
||||
|
||||
#define LZMA_FILTER_ARM LZMA_VLI_C(0x07)
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
#define LZMA_FILTER_ARMTHUMB LZMA_VLI_C(0x08)
|
||||
/**<
|
||||
* Filter for ARMThumb binaries.
|
||||
* Filter for ARM-Thumb binaries.
|
||||
*/
|
||||
|
||||
#define LZMA_FILTER_SPARC LZMA_VLI_C(0x09)
|
||||
@@ -77,7 +77,7 @@ typedef struct {
|
||||
* This setting is useful only when the same filter is used
|
||||
* _separately_ for multiple sections of the same executable file,
|
||||
* and the sections contain cross-section branch/call/jump
|
||||
* instructions. In that case it is benefical to set the start
|
||||
* instructions. In that case it is beneficial to set the start
|
||||
* offset of the non-first sections so that the relative addresses
|
||||
* of the cross-section branch/call/jump instructions will use the
|
||||
* same absolute addresses as in the first section.
|
||||
|
||||
@@ -31,28 +31,20 @@ typedef struct {
|
||||
/**
|
||||
* \brief Block format version
|
||||
*
|
||||
* To prevent API and ABI breakages if new features are needed in
|
||||
* Block, a version number is used to indicate which fields in this
|
||||
* structure are in use. For now, version must always be zero.
|
||||
* With non-zero version, most Block related functions will return
|
||||
* LZMA_OPTIONS_ERROR.
|
||||
* To prevent API and ABI breakages when new features are needed,
|
||||
* a version number is used to indicate which fields in this
|
||||
* structure are in use:
|
||||
* - liblzma >= 5.0.0: version = 0 is supported.
|
||||
* - liblzma >= 5.1.4beta: Support for version = 1 was added,
|
||||
* which adds the ignore_check field.
|
||||
*
|
||||
* The decoding functions will always set this to the lowest value
|
||||
* that supports all the features indicated by the Block Header field.
|
||||
* The application must check that the version number set by the
|
||||
* decoding functions is supported by the application. Otherwise it
|
||||
* is possible that the application will decode the Block incorrectly.
|
||||
* If version is greater than one, most Block related functions
|
||||
* will return LZMA_OPTIONS_ERROR (lzma_block_header_decode() works
|
||||
* with any version value).
|
||||
*
|
||||
* Read by:
|
||||
* - lzma_block_header_size()
|
||||
* - lzma_block_header_encode()
|
||||
* - lzma_block_compressed_size()
|
||||
* - lzma_block_unpadded_size()
|
||||
* - lzma_block_total_size()
|
||||
* - lzma_block_encoder()
|
||||
* - lzma_block_decoder()
|
||||
* - lzma_block_buffer_encode()
|
||||
* - lzma_block_buffer_decode()
|
||||
* - All functions that take pointer to lzma_block as argument,
|
||||
* including lzma_block_header_decode().
|
||||
*
|
||||
* Written by:
|
||||
* - lzma_block_header_decode()
|
||||
@@ -246,7 +238,28 @@ typedef struct {
|
||||
lzma_reserved_enum reserved_enum2;
|
||||
lzma_reserved_enum reserved_enum3;
|
||||
lzma_reserved_enum reserved_enum4;
|
||||
lzma_bool reserved_bool1;
|
||||
|
||||
/**
|
||||
* \brief A flag to Block decoder to not verify the Check field
|
||||
*
|
||||
* This field is supported by liblzma >= 5.1.4beta if .version >= 1.
|
||||
*
|
||||
* If this is set to true, the integrity check won't be calculated
|
||||
* and verified. Unless you know what you are doing, you should
|
||||
* leave this to false. (A reason to set this to true is when the
|
||||
* file integrity is verified externally anyway and you want to
|
||||
* speed up the decompression, which matters mostly when using
|
||||
* SHA-256 as the integrity check.)
|
||||
*
|
||||
* If .version >= 1, read by:
|
||||
* - lzma_block_decoder()
|
||||
* - lzma_block_buffer_decode()
|
||||
*
|
||||
* Written by (.version is ignored):
|
||||
* - lzma_block_header_decode() always sets this to false
|
||||
*/
|
||||
lzma_bool ignore_check;
|
||||
|
||||
lzma_bool reserved_bool2;
|
||||
lzma_bool reserved_bool3;
|
||||
lzma_bool reserved_bool4;
|
||||
@@ -323,13 +336,25 @@ extern LZMA_API(lzma_ret) lzma_block_header_encode(
|
||||
/**
|
||||
* \brief Decode Block Header
|
||||
*
|
||||
* block->version should (usually) be set to the highest value supported
|
||||
* by the application. If the application sets block->version to a value
|
||||
* higher than supported by the current liblzma version, this function will
|
||||
* downgrade block->version to the highest value supported by it. Thus one
|
||||
* should check the value of block->version after calling this function if
|
||||
* block->version was set to a non-zero value and the application doesn't
|
||||
* otherwise know that the liblzma version being used is new enough to
|
||||
* support the specified block->version.
|
||||
*
|
||||
* The size of the Block Header must have already been decoded with
|
||||
* lzma_block_header_size_decode() macro and stored to block->header_size.
|
||||
* block->filters must have been allocated, but not necessarily initialized.
|
||||
* Possible existing filter options are _not_ freed.
|
||||
*
|
||||
* \param block Destination for block options with header_size
|
||||
* properly initialized.
|
||||
* The integrity check type from Stream Header must have been stored
|
||||
* to block->check.
|
||||
*
|
||||
* block->filters must have been allocated, but they don't need to be
|
||||
* initialized (possible existing filter options are not freed).
|
||||
*
|
||||
* \param block Destination for Block options.
|
||||
* \param allocator lzma_allocator for custom allocator functions.
|
||||
* Set to NULL to use malloc() (and also free()
|
||||
* if an error occurs).
|
||||
@@ -339,14 +364,17 @@ extern LZMA_API(lzma_ret) lzma_block_header_encode(
|
||||
* \return - LZMA_OK: Decoding was successful. block->header_size
|
||||
* bytes were read from the input buffer.
|
||||
* - LZMA_OPTIONS_ERROR: The Block Header specifies some
|
||||
* unsupported options such as unsupported filters.
|
||||
* unsupported options such as unsupported filters. This can
|
||||
* happen also if block->version was set to a too low value
|
||||
* compared to what would be required to properly represent
|
||||
* the information stored in the Block Header.
|
||||
* - LZMA_DATA_ERROR: Block Header is corrupt, for example,
|
||||
* the CRC32 doesn't match.
|
||||
* - LZMA_PROG_ERROR: Invalid arguments, for example
|
||||
* block->header_size is invalid or block->filters is NULL.
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_block_header_decode(lzma_block *block,
|
||||
lzma_allocator *allocator, const uint8_t *in)
|
||||
const lzma_allocator *allocator, const uint8_t *in)
|
||||
lzma_nothrow lzma_attr_warn_unused_result;
|
||||
|
||||
|
||||
@@ -419,7 +447,7 @@ extern LZMA_API(lzma_vli) lzma_block_total_size(const lzma_block *block)
|
||||
* \return - LZMA_OK: All good, continue with lzma_code().
|
||||
* - LZMA_MEM_ERROR
|
||||
* - LZMA_OPTIONS_ERROR
|
||||
* - LZMA_UNSUPPORTED_CHECK: block->check specfies a Check ID
|
||||
* - LZMA_UNSUPPORTED_CHECK: block->check specifies a Check ID
|
||||
* that is not supported by this buid of liblzma. Initializing
|
||||
* the encoder failed.
|
||||
* - LZMA_PROG_ERROR
|
||||
@@ -488,13 +516,32 @@ extern LZMA_API(size_t) lzma_block_buffer_bound(size_t uncompressed_size)
|
||||
*
|
||||
* \return - LZMA_OK: Encoding was successful.
|
||||
* - LZMA_BUF_ERROR: Not enough output buffer space.
|
||||
* - LZMA_UNSUPPORTED_CHECK
|
||||
* - LZMA_OPTIONS_ERROR
|
||||
* - LZMA_MEM_ERROR
|
||||
* - LZMA_DATA_ERROR
|
||||
* - LZMA_PROG_ERROR
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_block_buffer_encode(
|
||||
lzma_block *block, lzma_allocator *allocator,
|
||||
lzma_block *block, const lzma_allocator *allocator,
|
||||
const uint8_t *in, size_t in_size,
|
||||
uint8_t *out, size_t *out_pos, size_t out_size)
|
||||
lzma_nothrow lzma_attr_warn_unused_result;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Single-call uncompressed .xz Block encoder
|
||||
*
|
||||
* This is like lzma_block_buffer_encode() except this doesn't try to
|
||||
* compress the data and instead encodes the data using LZMA2 uncompressed
|
||||
* chunks. The required output buffer size can be determined with
|
||||
* lzma_block_buffer_bound().
|
||||
*
|
||||
* Since the data won't be compressed, this function ignores block->filters.
|
||||
* This function doesn't take lzma_allocator because this function doesn't
|
||||
* allocate any memory from the heap.
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_block_uncomp_encode(lzma_block *block,
|
||||
const uint8_t *in, size_t in_size,
|
||||
uint8_t *out, size_t *out_pos, size_t out_size)
|
||||
lzma_nothrow lzma_attr_warn_unused_result;
|
||||
@@ -528,7 +575,7 @@ extern LZMA_API(lzma_ret) lzma_block_buffer_encode(
|
||||
* - LZMA_PROG_ERROR
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_block_buffer_decode(
|
||||
lzma_block *block, lzma_allocator *allocator,
|
||||
lzma_block *block, const lzma_allocator *allocator,
|
||||
const uint8_t *in, size_t *in_pos, size_t in_size,
|
||||
uint8_t *out, size_t *out_pos, size_t out_size)
|
||||
lzma_nothrow;
|
||||
|
||||
@@ -142,7 +142,7 @@ extern LZMA_API(uint64_t) lzma_crc64(
|
||||
/**
|
||||
* \brief Get the type of the integrity check
|
||||
*
|
||||
* This function can be called only immediatelly after lzma_code() has
|
||||
* This function can be called only immediately after lzma_code() has
|
||||
* returned LZMA_NO_CHECK, LZMA_UNSUPPORTED_CHECK, or LZMA_GET_CHECK.
|
||||
* Calling this function in any other situation has undefined behavior.
|
||||
*/
|
||||
|
||||
@@ -55,28 +55,162 @@
|
||||
*
|
||||
* This flag doesn't affect the memory usage requirements of the decoder (at
|
||||
* least not significantly). The memory usage of the encoder may be increased
|
||||
* a little but only at the lowest preset levels (0-2).
|
||||
* a little but only at the lowest preset levels (0-3).
|
||||
*/
|
||||
#define LZMA_PRESET_EXTREME (UINT32_C(1) << 31)
|
||||
|
||||
|
||||
/**
|
||||
* \brief Calculate rough memory usage of easy encoder
|
||||
* \brief Multithreading options
|
||||
*/
|
||||
typedef struct {
|
||||
/**
|
||||
* \brief Flags
|
||||
*
|
||||
* Set this to zero if no flags are wanted.
|
||||
*
|
||||
* No flags are currently supported.
|
||||
*/
|
||||
uint32_t flags;
|
||||
|
||||
/**
|
||||
* \brief Number of worker threads to use
|
||||
*/
|
||||
uint32_t threads;
|
||||
|
||||
/**
|
||||
* \brief Maximum uncompressed size of a Block
|
||||
*
|
||||
* The encoder will start a new .xz Block every block_size bytes.
|
||||
* Using LZMA_FULL_FLUSH or LZMA_FULL_BARRIER with lzma_code()
|
||||
* the caller may tell liblzma to start a new Block earlier.
|
||||
*
|
||||
* With LZMA2, a recommended block size is 2-4 times the LZMA2
|
||||
* dictionary size. With very small dictionaries, it is recommended
|
||||
* to use at least 1 MiB block size for good compression ratio, even
|
||||
* if this is more than four times the dictionary size. Note that
|
||||
* these are only recommendations for typical use cases; feel free
|
||||
* to use other values. Just keep in mind that using a block size
|
||||
* less than the LZMA2 dictionary size is waste of RAM.
|
||||
*
|
||||
* Set this to 0 to let liblzma choose the block size depending
|
||||
* on the compression options. For LZMA2 it will be 3*dict_size
|
||||
* or 1 MiB, whichever is more.
|
||||
*
|
||||
* For each thread, about 3 * block_size bytes of memory will be
|
||||
* allocated. This may change in later liblzma versions. If so,
|
||||
* the memory usage will probably be reduced, not increased.
|
||||
*/
|
||||
uint64_t block_size;
|
||||
|
||||
/**
|
||||
* \brief Timeout to allow lzma_code() to return early
|
||||
*
|
||||
* Multithreading can make liblzma to consume input and produce
|
||||
* output in a very bursty way: it may first read a lot of input
|
||||
* to fill internal buffers, then no input or output occurs for
|
||||
* a while.
|
||||
*
|
||||
* In single-threaded mode, lzma_code() won't return until it has
|
||||
* either consumed all the input or filled the output buffer. If
|
||||
* this is done in multithreaded mode, it may cause a call
|
||||
* lzma_code() to take even tens of seconds, which isn't acceptable
|
||||
* in all applications.
|
||||
*
|
||||
* To avoid very long blocking times in lzma_code(), a timeout
|
||||
* (in milliseconds) may be set here. If lzma_code() would block
|
||||
* longer than this number of milliseconds, it will return with
|
||||
* LZMA_OK. Reasonable values are 100 ms or more. The xz command
|
||||
* line tool uses 300 ms.
|
||||
*
|
||||
* If long blocking times are fine for you, set timeout to a special
|
||||
* value of 0, which will disable the timeout mechanism and will make
|
||||
* lzma_code() block until all the input is consumed or the output
|
||||
* buffer has been filled.
|
||||
*
|
||||
* \note Even with a timeout, lzma_code() might sometimes take
|
||||
* somewhat long time to return. No timing guarantees
|
||||
* are made.
|
||||
*/
|
||||
uint32_t timeout;
|
||||
|
||||
/**
|
||||
* \brief Compression preset (level and possible flags)
|
||||
*
|
||||
* The preset is set just like with lzma_easy_encoder().
|
||||
* The preset is ignored if filters below is non-NULL.
|
||||
*/
|
||||
uint32_t preset;
|
||||
|
||||
/**
|
||||
* \brief Filter chain (alternative to a preset)
|
||||
*
|
||||
* If this is NULL, the preset above is used. Otherwise the preset
|
||||
* is ignored and the filter chain specified here is used.
|
||||
*/
|
||||
const lzma_filter *filters;
|
||||
|
||||
/**
|
||||
* \brief Integrity check type
|
||||
*
|
||||
* See check.h for available checks. The xz command line tool
|
||||
* defaults to LZMA_CHECK_CRC64, which is a good choice if you
|
||||
* are unsure.
|
||||
*/
|
||||
lzma_check check;
|
||||
|
||||
/*
|
||||
* Reserved space to allow possible future extensions without
|
||||
* breaking the ABI. You should not touch these, because the names
|
||||
* of these variables may change. These are and will never be used
|
||||
* with the currently supported options, so it is safe to leave these
|
||||
* uninitialized.
|
||||
*/
|
||||
lzma_reserved_enum reserved_enum1;
|
||||
lzma_reserved_enum reserved_enum2;
|
||||
lzma_reserved_enum reserved_enum3;
|
||||
uint32_t reserved_int1;
|
||||
uint32_t reserved_int2;
|
||||
uint32_t reserved_int3;
|
||||
uint32_t reserved_int4;
|
||||
uint64_t reserved_int5;
|
||||
uint64_t reserved_int6;
|
||||
uint64_t reserved_int7;
|
||||
uint64_t reserved_int8;
|
||||
void *reserved_ptr1;
|
||||
void *reserved_ptr2;
|
||||
void *reserved_ptr3;
|
||||
void *reserved_ptr4;
|
||||
|
||||
} lzma_mt;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Calculate approximate memory usage of easy encoder
|
||||
*
|
||||
* This function is a wrapper for lzma_raw_encoder_memusage().
|
||||
*
|
||||
* \param preset Compression preset (level and possible flags)
|
||||
*
|
||||
* \return Number of bytes of memory required for the given
|
||||
* preset when encoding. If an error occurs, for example
|
||||
* due to unsupported preset, UINT64_MAX is returned.
|
||||
*/
|
||||
extern LZMA_API(uint64_t) lzma_easy_encoder_memusage(uint32_t preset)
|
||||
lzma_nothrow lzma_attr_pure;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Calculate rough decoder memory usage of a preset
|
||||
* \brief Calculate approximate decoder memory usage of a preset
|
||||
*
|
||||
* This function is a wrapper for lzma_raw_decoder_memusage().
|
||||
*
|
||||
* \param preset Compression preset (level and possible flags)
|
||||
*
|
||||
* \return Number of bytes of memory required to decompress a file
|
||||
* that was compressed using the given preset. If an error
|
||||
* occurs, for example due to unsupported preset, UINT64_MAX
|
||||
* is returned.
|
||||
*/
|
||||
extern LZMA_API(uint64_t) lzma_easy_decoder_memusage(uint32_t preset)
|
||||
lzma_nothrow lzma_attr_pure;
|
||||
@@ -93,16 +227,19 @@ extern LZMA_API(uint64_t) lzma_easy_decoder_memusage(uint32_t preset)
|
||||
* \param preset Compression preset to use. A preset consist of level
|
||||
* number and zero or more flags. Usually flags aren't
|
||||
* used, so preset is simply a number [0, 9] which match
|
||||
* the options -0 .. -9 of the xz command line tool.
|
||||
* the options -0 ... -9 of the xz command line tool.
|
||||
* Additional flags can be be set using bitwise-or with
|
||||
* the preset level number, e.g. 6 | LZMA_PRESET_EXTREME.
|
||||
* \param check Integrity check type to use. See check.h for available
|
||||
* checks. If you are unsure, use LZMA_CHECK_CRC32.
|
||||
* checks. The xz command line tool defaults to
|
||||
* LZMA_CHECK_CRC64, which is a good choice if you are
|
||||
* unsure. LZMA_CHECK_CRC32 is good too as long as the
|
||||
* uncompressed file is not many gigabytes.
|
||||
*
|
||||
* \return - LZMA_OK: Initialization succeeded. Use lzma_code() to
|
||||
* encode your data.
|
||||
* - LZMA_MEM_ERROR: Memory allocation failed.
|
||||
* - LZMA_OPTIONS_ERROR: The given compression level is not
|
||||
* - LZMA_OPTIONS_ERROR: The given compression preset is not
|
||||
* supported by this build of liblzma.
|
||||
* - LZMA_UNSUPPORTED_CHECK: The given check type is not
|
||||
* supported by this liblzma build.
|
||||
@@ -145,6 +282,7 @@ extern LZMA_API(lzma_ret) lzma_easy_encoder(
|
||||
*
|
||||
* \return - LZMA_OK: Encoding was successful.
|
||||
* - LZMA_BUF_ERROR: Not enough output buffer space.
|
||||
* - LZMA_UNSUPPORTED_CHECK
|
||||
* - LZMA_OPTIONS_ERROR
|
||||
* - LZMA_MEM_ERROR
|
||||
* - LZMA_DATA_ERROR
|
||||
@@ -152,7 +290,8 @@ extern LZMA_API(lzma_ret) lzma_easy_encoder(
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_easy_buffer_encode(
|
||||
uint32_t preset, lzma_check check,
|
||||
lzma_allocator *allocator, const uint8_t *in, size_t in_size,
|
||||
const lzma_allocator *allocator,
|
||||
const uint8_t *in, size_t in_size,
|
||||
uint8_t *out, size_t *out_pos, size_t out_size) lzma_nothrow;
|
||||
|
||||
|
||||
@@ -168,6 +307,7 @@ extern LZMA_API(lzma_ret) lzma_easy_buffer_encode(
|
||||
*
|
||||
* \return - LZMA_OK: Initialization was successful.
|
||||
* - LZMA_MEM_ERROR
|
||||
* - LZMA_UNSUPPORTED_CHECK
|
||||
* - LZMA_OPTIONS_ERROR
|
||||
* - LZMA_PROG_ERROR
|
||||
*/
|
||||
@@ -176,6 +316,49 @@ extern LZMA_API(lzma_ret) lzma_stream_encoder(lzma_stream *strm,
|
||||
lzma_nothrow lzma_attr_warn_unused_result;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Calculate approximate memory usage of multithreaded .xz encoder
|
||||
*
|
||||
* Since doing the encoding in threaded mode doesn't affect the memory
|
||||
* requirements of single-threaded decompressor, you can use
|
||||
* lzma_easy_decoder_memusage(options->preset) or
|
||||
* lzma_raw_decoder_memusage(options->filters) to calculate
|
||||
* the decompressor memory requirements.
|
||||
*
|
||||
* \param options Compression options
|
||||
*
|
||||
* \return Number of bytes of memory required for encoding with the
|
||||
* given options. If an error occurs, for example due to
|
||||
* unsupported preset or filter chain, UINT64_MAX is returned.
|
||||
*/
|
||||
extern LZMA_API(uint64_t) lzma_stream_encoder_mt_memusage(
|
||||
const lzma_mt *options) lzma_nothrow lzma_attr_pure;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Initialize multithreaded .xz Stream encoder
|
||||
*
|
||||
* This provides the functionality of lzma_easy_encoder() and
|
||||
* lzma_stream_encoder() as a single function for multithreaded use.
|
||||
*
|
||||
* The supported actions for lzma_code() are LZMA_RUN, LZMA_FULL_FLUSH,
|
||||
* LZMA_FULL_BARRIER, and LZMA_FINISH. Support for LZMA_SYNC_FLUSH might be
|
||||
* added in the future.
|
||||
*
|
||||
* \param strm Pointer to properly prepared lzma_stream
|
||||
* \param options Pointer to multithreaded compression options
|
||||
*
|
||||
* \return - LZMA_OK
|
||||
* - LZMA_MEM_ERROR
|
||||
* - LZMA_UNSUPPORTED_CHECK
|
||||
* - LZMA_OPTIONS_ERROR
|
||||
* - LZMA_PROG_ERROR
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_stream_encoder_mt(
|
||||
lzma_stream *strm, const lzma_mt *options)
|
||||
lzma_nothrow lzma_attr_warn_unused_result;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Initialize .lzma encoder (legacy file format)
|
||||
*
|
||||
@@ -247,6 +430,7 @@ extern LZMA_API(size_t) lzma_stream_buffer_bound(size_t uncompressed_size)
|
||||
*
|
||||
* \return - LZMA_OK: Encoding was successful.
|
||||
* - LZMA_BUF_ERROR: Not enough output buffer space.
|
||||
* - LZMA_UNSUPPORTED_CHECK
|
||||
* - LZMA_OPTIONS_ERROR
|
||||
* - LZMA_MEM_ERROR
|
||||
* - LZMA_DATA_ERROR
|
||||
@@ -254,7 +438,8 @@ extern LZMA_API(size_t) lzma_stream_buffer_bound(size_t uncompressed_size)
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_stream_buffer_encode(
|
||||
lzma_filter *filters, lzma_check check,
|
||||
lzma_allocator *allocator, const uint8_t *in, size_t in_size,
|
||||
const lzma_allocator *allocator,
|
||||
const uint8_t *in, size_t in_size,
|
||||
uint8_t *out, size_t *out_pos, size_t out_size)
|
||||
lzma_nothrow lzma_attr_warn_unused_result;
|
||||
|
||||
@@ -289,6 +474,30 @@ extern LZMA_API(lzma_ret) lzma_stream_buffer_encode(
|
||||
#define LZMA_TELL_ANY_CHECK UINT32_C(0x04)
|
||||
|
||||
|
||||
/**
|
||||
* This flag makes lzma_code() not calculate and verify the integrity check
|
||||
* of the compressed data in .xz files. This means that invalid integrity
|
||||
* check values won't be detected and LZMA_DATA_ERROR won't be returned in
|
||||
* such cases.
|
||||
*
|
||||
* This flag only affects the checks of the compressed data itself; the CRC32
|
||||
* values in the .xz headers will still be verified normally.
|
||||
*
|
||||
* Don't use this flag unless you know what you are doing. Possible reasons
|
||||
* to use this flag:
|
||||
*
|
||||
* - Trying to recover data from a corrupt .xz file.
|
||||
*
|
||||
* - Speeding up decompression, which matters mostly with SHA-256
|
||||
* or with files that have compressed extremely well. It's recommended
|
||||
* to not use this flag for this purpose unless the file integrity is
|
||||
* verified externally in some other way.
|
||||
*
|
||||
* Support for this flag was added in liblzma 5.1.4beta.
|
||||
*/
|
||||
#define LZMA_IGNORE_CHECK UINT32_C(0x10)
|
||||
|
||||
|
||||
/**
|
||||
* This flag enables decoding of concatenated files with file formats that
|
||||
* allow concatenating compressed files as is. From the formats currently
|
||||
@@ -310,7 +519,8 @@ extern LZMA_API(lzma_ret) lzma_stream_buffer_encode(
|
||||
* \brief Initialize .xz Stream decoder
|
||||
*
|
||||
* \param strm Pointer to properly prepared lzma_stream
|
||||
* \param memlimit Rough memory usage limit as bytes
|
||||
* \param memlimit Memory usage limit as bytes. Use UINT64_MAX
|
||||
* to effectively disable the limiter.
|
||||
* \param flags Bitwise-or of zero or more of the decoder flags:
|
||||
* LZMA_TELL_NO_CHECK, LZMA_TELL_UNSUPPORTED_CHECK,
|
||||
* LZMA_TELL_ANY_CHECK, LZMA_CONCATENATED
|
||||
@@ -318,6 +528,7 @@ extern LZMA_API(lzma_ret) lzma_stream_buffer_encode(
|
||||
* \return - LZMA_OK: Initialization was successful.
|
||||
* - LZMA_MEM_ERROR: Cannot allocate memory.
|
||||
* - LZMA_OPTIONS_ERROR: Unsupported flags
|
||||
* - LZMA_PROG_ERROR
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_stream_decoder(
|
||||
lzma_stream *strm, uint64_t memlimit, uint32_t flags)
|
||||
@@ -332,12 +543,14 @@ extern LZMA_API(lzma_ret) lzma_stream_decoder(
|
||||
* of the input file has been detected.
|
||||
*
|
||||
* \param strm Pointer to properly prepared lzma_stream
|
||||
* \param memlimit Rough memory usage limit as bytes
|
||||
* \param memlimit Memory usage limit as bytes. Use UINT64_MAX
|
||||
* to effectively disable the limiter.
|
||||
* \param flags Bitwise-or of flags, or zero for no flags.
|
||||
*
|
||||
* \return - LZMA_OK: Initialization was successful.
|
||||
* - LZMA_MEM_ERROR: Cannot allocate memory.
|
||||
* - LZMA_OPTIONS_ERROR: Unsupported flags
|
||||
* - LZMA_PROG_ERROR
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_auto_decoder(
|
||||
lzma_stream *strm, uint64_t memlimit, uint32_t flags)
|
||||
@@ -353,6 +566,7 @@ extern LZMA_API(lzma_ret) lzma_auto_decoder(
|
||||
*
|
||||
* \return - LZMA_OK
|
||||
* - LZMA_MEM_ERROR
|
||||
* - LZMA_PROG_ERROR
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_alone_decoder(
|
||||
lzma_stream *strm, uint64_t memlimit)
|
||||
@@ -379,7 +593,7 @@ extern LZMA_API(lzma_ret) lzma_alone_decoder(
|
||||
* won't be read is in[in_size].
|
||||
* \param out Beginning of the output buffer
|
||||
* \param out_pos The next byte will be written to out[*out_pos].
|
||||
* *out_pos is updated only if encoding succeeds.
|
||||
* *out_pos is updated only if decoding succeeds.
|
||||
* \param out_size Size of the out buffer; the first byte into
|
||||
* which no data is written to is out[out_size].
|
||||
*
|
||||
@@ -398,7 +612,8 @@ extern LZMA_API(lzma_ret) lzma_alone_decoder(
|
||||
* - LZMA_PROG_ERROR
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_stream_buffer_decode(
|
||||
uint64_t *memlimit, uint32_t flags, lzma_allocator *allocator,
|
||||
uint64_t *memlimit, uint32_t flags,
|
||||
const lzma_allocator *allocator,
|
||||
const uint8_t *in, size_t *in_pos, size_t in_size,
|
||||
uint8_t *out, size_t *out_pos, size_t out_size)
|
||||
lzma_nothrow lzma_attr_warn_unused_result;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* \file lzma/filter.h
|
||||
* \brief Common filter related types
|
||||
* \brief Common filter related types and functions
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -59,11 +59,6 @@ typedef struct {
|
||||
* If the filter doesn't need options, set this to NULL. If id is
|
||||
* set to LZMA_VLI_UNKNOWN, options is ignored, and thus
|
||||
* doesn't need be initialized.
|
||||
*
|
||||
* Some filters support changing the options in the middle of
|
||||
* the encoding process. These filters store the pointer of the
|
||||
* options structure and communicate with the application via
|
||||
* modifications of the options structure.
|
||||
*/
|
||||
void *options;
|
||||
|
||||
@@ -95,32 +90,70 @@ extern LZMA_API(lzma_bool) lzma_filter_decoder_is_supported(lzma_vli id)
|
||||
|
||||
|
||||
/**
|
||||
* \brief Calculate rough memory requirements for raw encoder
|
||||
* \brief Copy the filters array
|
||||
*
|
||||
* Because the calculation is rough, this function can be used to calculate
|
||||
* the memory requirements for Block and Stream encoders too.
|
||||
* Copy the Filter IDs and filter-specific options from src to dest.
|
||||
* Up to LZMA_FILTERS_MAX filters are copied, plus the terminating
|
||||
* .id == LZMA_VLI_UNKNOWN. Thus, dest should have at least
|
||||
* LZMA_FILTERS_MAX + 1 elements space unless the caller knows that
|
||||
* src is smaller than that.
|
||||
*
|
||||
* Unless the filter-specific options is NULL, the Filter ID has to be
|
||||
* supported by liblzma, because liblzma needs to know the size of every
|
||||
* filter-specific options structure. The filter-specific options are not
|
||||
* validated. If options is NULL, any unsupported Filter IDs are copied
|
||||
* without returning an error.
|
||||
*
|
||||
* Old filter-specific options in dest are not freed, so dest doesn't
|
||||
* need to be initialized by the caller in any way.
|
||||
*
|
||||
* If an error occurs, memory possibly already allocated by this function
|
||||
* is always freed.
|
||||
*
|
||||
* \return - LZMA_OK
|
||||
* - LZMA_MEM_ERROR
|
||||
* - LZMA_OPTIONS_ERROR: Unsupported Filter ID and its options
|
||||
* is not NULL.
|
||||
* - LZMA_PROG_ERROR: src or dest is NULL.
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_filters_copy(
|
||||
const lzma_filter *src, lzma_filter *dest,
|
||||
const lzma_allocator *allocator) lzma_nothrow;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Calculate approximate memory requirements for raw encoder
|
||||
*
|
||||
* This function can be used to calculate the memory requirements for
|
||||
* Block and Stream encoders too because Block and Stream encoders don't
|
||||
* need significantly more memory than raw encoder.
|
||||
*
|
||||
* \param filters Array of filters terminated with
|
||||
* .id == LZMA_VLI_UNKNOWN.
|
||||
*
|
||||
* \return Rough number of bytes of memory required for the given
|
||||
* filter chain when encoding.
|
||||
* \return Number of bytes of memory required for the given
|
||||
* filter chain when encoding. If an error occurs,
|
||||
* for example due to unsupported filter chain,
|
||||
* UINT64_MAX is returned.
|
||||
*/
|
||||
extern LZMA_API(uint64_t) lzma_raw_encoder_memusage(const lzma_filter *filters)
|
||||
lzma_nothrow lzma_attr_pure;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Calculate rough memory requirements for raw decoder
|
||||
* \brief Calculate approximate memory requirements for raw decoder
|
||||
*
|
||||
* Because the calculation is rough, this function can be used to calculate
|
||||
* the memory requirements for Block and Stream decoders too.
|
||||
* This function can be used to calculate the memory requirements for
|
||||
* Block and Stream decoders too because Block and Stream decoders don't
|
||||
* need significantly more memory than raw decoder.
|
||||
*
|
||||
* \param filters Array of filters terminated with
|
||||
* .id == LZMA_VLI_UNKNOWN.
|
||||
*
|
||||
* \return Rough number of bytes of memory required for the given
|
||||
* filter chain when decoding.
|
||||
* \return Number of bytes of memory required for the given
|
||||
* filter chain when decoding. If an error occurs,
|
||||
* for example due to unsupported filter chain,
|
||||
* UINT64_MAX is returned.
|
||||
*/
|
||||
extern LZMA_API(uint64_t) lzma_raw_decoder_memusage(const lzma_filter *filters)
|
||||
lzma_nothrow lzma_attr_pure;
|
||||
@@ -166,6 +199,36 @@ extern LZMA_API(lzma_ret) lzma_raw_decoder(
|
||||
lzma_nothrow lzma_attr_warn_unused_result;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Update the filter chain in the encoder
|
||||
*
|
||||
* This function is for advanced users only. This function has two slightly
|
||||
* different purposes:
|
||||
*
|
||||
* - After LZMA_FULL_FLUSH when using Stream encoder: Set a new filter
|
||||
* chain, which will be used starting from the next Block.
|
||||
*
|
||||
* - After LZMA_SYNC_FLUSH using Raw, Block, or Stream encoder: Change
|
||||
* the filter-specific options in the middle of encoding. The actual
|
||||
* filters in the chain (Filter IDs) cannot be changed. In the future,
|
||||
* it might become possible to change the filter options without
|
||||
* using LZMA_SYNC_FLUSH.
|
||||
*
|
||||
* While rarely useful, this function may be called also when no data has
|
||||
* been compressed yet. In that case, this function will behave as if
|
||||
* LZMA_FULL_FLUSH (Stream encoder) or LZMA_SYNC_FLUSH (Raw or Block
|
||||
* encoder) had been used right before calling this function.
|
||||
*
|
||||
* \return - LZMA_OK
|
||||
* - LZMA_MEM_ERROR
|
||||
* - LZMA_MEMLIMIT_ERROR
|
||||
* - LZMA_OPTIONS_ERROR
|
||||
* - LZMA_PROG_ERROR
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_filters_update(
|
||||
lzma_stream *strm, const lzma_filter *filters) lzma_nothrow;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Single-call raw encoder
|
||||
*
|
||||
@@ -190,10 +253,11 @@ extern LZMA_API(lzma_ret) lzma_raw_decoder(
|
||||
*
|
||||
* \note There is no function to calculate how big output buffer
|
||||
* would surely be big enough. (lzma_stream_buffer_bound()
|
||||
* works only for lzma_stream_buffer_encode().)
|
||||
* works only for lzma_stream_buffer_encode(); raw encoder
|
||||
* won't necessarily meet that bound.)
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_raw_buffer_encode(
|
||||
const lzma_filter *filters, lzma_allocator *allocator,
|
||||
const lzma_filter *filters, const lzma_allocator *allocator,
|
||||
const uint8_t *in, size_t in_size, uint8_t *out,
|
||||
size_t *out_pos, size_t out_size) lzma_nothrow;
|
||||
|
||||
@@ -217,7 +281,7 @@ extern LZMA_API(lzma_ret) lzma_raw_buffer_encode(
|
||||
* which no data is written to is out[out_size].
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_raw_buffer_decode(
|
||||
const lzma_filter *filters, lzma_allocator *allocator,
|
||||
const lzma_filter *filters, const lzma_allocator *allocator,
|
||||
const uint8_t *in, size_t *in_pos, size_t in_size,
|
||||
uint8_t *out, size_t *out_pos, size_t out_size) lzma_nothrow;
|
||||
|
||||
@@ -229,7 +293,7 @@ extern LZMA_API(lzma_ret) lzma_raw_buffer_decode(
|
||||
* using the raw encoder and decoder.
|
||||
*
|
||||
* \param size Pointer to uint32_t to hold the size of the properties
|
||||
* \param filter Filter ID and options (the size of the propeties may
|
||||
* \param filter Filter ID and options (the size of the properties may
|
||||
* vary depending on the options)
|
||||
*
|
||||
* \return - LZMA_OK
|
||||
@@ -262,9 +326,10 @@ extern LZMA_API(lzma_ret) lzma_properties_size(
|
||||
* succeeds but using the same options to initialize the encoder
|
||||
* will fail.
|
||||
*
|
||||
* \note It is OK to skip calling this function if
|
||||
* lzma_properties_size() indicated that the size
|
||||
* of the Filter Properties field is zero.
|
||||
* \note If lzma_properties_size() indicated that the size
|
||||
* of the Filter Properties field is zero, calling
|
||||
* lzma_properties_encode() is not required, but it
|
||||
* won't do any harm either.
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_properties_encode(
|
||||
const lzma_filter *filter, uint8_t *props) lzma_nothrow;
|
||||
@@ -292,7 +357,7 @@ extern LZMA_API(lzma_ret) lzma_properties_encode(
|
||||
* - LZMA_MEM_ERROR
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_properties_decode(
|
||||
lzma_filter *filter, lzma_allocator *allocator,
|
||||
lzma_filter *filter, const lzma_allocator *allocator,
|
||||
const uint8_t *props, size_t props_size) lzma_nothrow;
|
||||
|
||||
|
||||
@@ -303,11 +368,11 @@ extern LZMA_API(lzma_ret) lzma_properties_decode(
|
||||
* memory to hold the encoded Filter Flags.
|
||||
*
|
||||
* \param size Pointer to integer to hold the calculated size
|
||||
* \param filters Filter ID and associated options whose encoded
|
||||
* size is to be calculted
|
||||
* \param filter Filter ID and associated options whose encoded
|
||||
* size is to be calculated
|
||||
*
|
||||
* \return - LZMA_OK: *size set successfully. Note that this doesn't
|
||||
* guarantee that filters->options is valid, thus
|
||||
* guarantee that filter->options is valid, thus
|
||||
* lzma_filter_flags_encode() may still fail.
|
||||
* - LZMA_OPTIONS_ERROR: Unknown Filter ID or unsupported options.
|
||||
* - LZMA_PROG_ERROR: Invalid options
|
||||
@@ -316,7 +381,7 @@ extern LZMA_API(lzma_ret) lzma_properties_decode(
|
||||
* you need to loop over every lzma_filter entry.
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_filter_flags_size(
|
||||
uint32_t *size, const lzma_filter *filters)
|
||||
uint32_t *size, const lzma_filter *filter)
|
||||
lzma_nothrow lzma_attr_warn_unused_result;
|
||||
|
||||
|
||||
@@ -326,7 +391,7 @@ extern LZMA_API(lzma_ret) lzma_filter_flags_size(
|
||||
* In contrast to some functions, this doesn't allocate the needed buffer.
|
||||
* This is due to how this function is used internally by liblzma.
|
||||
*
|
||||
* \param filters Filter ID and options to be encoded
|
||||
* \param filter Filter ID and options to be encoded
|
||||
* \param out Beginning of the output buffer
|
||||
* \param out_pos out[*out_pos] is the next write position. This
|
||||
* is updated by the encoder.
|
||||
@@ -338,7 +403,7 @@ extern LZMA_API(lzma_ret) lzma_filter_flags_size(
|
||||
* buffer space (you should have checked it with
|
||||
* lzma_filter_flags_size()).
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_filter_flags_encode(const lzma_filter *filters,
|
||||
extern LZMA_API(lzma_ret) lzma_filter_flags_encode(const lzma_filter *filter,
|
||||
uint8_t *out, size_t *out_pos, size_t out_size)
|
||||
lzma_nothrow lzma_attr_warn_unused_result;
|
||||
|
||||
@@ -346,8 +411,8 @@ extern LZMA_API(lzma_ret) lzma_filter_flags_encode(const lzma_filter *filters,
|
||||
/**
|
||||
* \brief Decode Filter Flags from given buffer
|
||||
*
|
||||
* The decoded result is stored into *filters. filters->options is
|
||||
* initialized but the old value is NOT free()d.
|
||||
* The decoded result is stored into *filter. The old value of
|
||||
* filter->options is not free()d.
|
||||
*
|
||||
* \return - LZMA_OK
|
||||
* - LZMA_OPTIONS_ERROR
|
||||
@@ -355,6 +420,6 @@ extern LZMA_API(lzma_ret) lzma_filter_flags_encode(const lzma_filter *filters,
|
||||
* - LZMA_PROG_ERROR
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_filter_flags_decode(
|
||||
lzma_filter *filters, lzma_allocator *allocator,
|
||||
lzma_filter *filter, const lzma_allocator *allocator,
|
||||
const uint8_t *in, size_t *in_pos, size_t in_size)
|
||||
lzma_nothrow lzma_attr_warn_unused_result;
|
||||
|
||||
64
src/liblzma/api/lzma/hardware.h
Normal file
64
src/liblzma/api/lzma/hardware.h
Normal file
@@ -0,0 +1,64 @@
|
||||
/**
|
||||
* \file lzma/hardware.h
|
||||
* \brief Hardware information
|
||||
*
|
||||
* Since liblzma can consume a lot of system resources, it also provides
|
||||
* ways to limit the resource usage. Applications linking against liblzma
|
||||
* need to do the actual decisions how much resources to let liblzma to use.
|
||||
* To ease making these decisions, liblzma provides functions to find out
|
||||
* the relevant capabilities of the underlaying hardware. Currently there
|
||||
* is only a function to find out the amount of RAM, but in the future there
|
||||
* will be also a function to detect how many concurrent threads the system
|
||||
* can run.
|
||||
*
|
||||
* \note On some operating systems, these function may temporarily
|
||||
* load a shared library or open file descriptor(s) to find out
|
||||
* the requested hardware information. Unless the application
|
||||
* assumes that specific file descriptors are not touched by
|
||||
* other threads, this should have no effect on thread safety.
|
||||
* Possible operations involving file descriptors will restart
|
||||
* the syscalls if they return EINTR.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Author: Lasse Collin
|
||||
*
|
||||
* This file has been put into the public domain.
|
||||
* You can do whatever you want with this file.
|
||||
*
|
||||
* See ../lzma.h for information about liblzma as a whole.
|
||||
*/
|
||||
|
||||
#ifndef LZMA_H_INTERNAL
|
||||
# error Never include this file directly. Use <lzma.h> instead.
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* \brief Get the total amount of physical memory (RAM) in bytes
|
||||
*
|
||||
* This function may be useful when determining a reasonable memory
|
||||
* usage limit for decompressing or how much memory it is OK to use
|
||||
* for compressing.
|
||||
*
|
||||
* \return On success, the total amount of physical memory in bytes
|
||||
* is returned. If the amount of RAM cannot be determined,
|
||||
* zero is returned. This can happen if an error occurs
|
||||
* or if there is no code in liblzma to detect the amount
|
||||
* of RAM on the specific operating system.
|
||||
*/
|
||||
extern LZMA_API(uint64_t) lzma_physmem(void) lzma_nothrow;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Get the number of processor cores or threads
|
||||
*
|
||||
* This function may be useful when determining how many threads to use.
|
||||
* If the hardware supports more than one thread per CPU core, the number
|
||||
* of hardware threads is returned if that information is available.
|
||||
*
|
||||
* \brief On success, the number of available CPU threads or cores is
|
||||
* returned. If this information isn't available or an error
|
||||
* occurs, zero is returned.
|
||||
*/
|
||||
extern LZMA_API(uint32_t) lzma_cputhreads(void) lzma_nothrow;
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* \file lzma/index.h
|
||||
* \brief Handling of .xz Index lists
|
||||
* \brief Handling of .xz Index and related information
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -18,107 +18,306 @@
|
||||
|
||||
|
||||
/**
|
||||
* \brief Opaque data type to hold the Index
|
||||
* \brief Opaque data type to hold the Index(es) and other information
|
||||
*
|
||||
* lzma_index often holds just one .xz Index and possibly the Stream Flags
|
||||
* of the same Stream and size of the Stream Padding field. However,
|
||||
* multiple lzma_indexes can be concatenated with lzma_index_cat() and then
|
||||
* there may be information about multiple Streams in the same lzma_index.
|
||||
*
|
||||
* Notes about thread safety: Only one thread may modify lzma_index at
|
||||
* a time. All functions that take non-const pointer to lzma_index
|
||||
* modify it. As long as no thread is modifying the lzma_index, getting
|
||||
* information from the same lzma_index can be done from multiple threads
|
||||
* at the same time with functions that take a const pointer to
|
||||
* lzma_index or use lzma_index_iter. The same iterator must be used
|
||||
* only by one thread at a time, of course, but there can be as many
|
||||
* iterators for the same lzma_index as needed.
|
||||
*/
|
||||
typedef struct lzma_index_s lzma_index;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Index Record and its location
|
||||
* \brief Iterator to get information about Blocks and Streams
|
||||
*/
|
||||
typedef struct {
|
||||
/**
|
||||
* \brief Total encoded size of a Block including Block Padding
|
||||
*
|
||||
* This value is useful if you need to know the actual size of the
|
||||
* Block that the Block decoder will read.
|
||||
*/
|
||||
lzma_vli total_size;
|
||||
struct {
|
||||
/**
|
||||
* \brief Pointer to Stream Flags
|
||||
*
|
||||
* This is NULL if Stream Flags have not been set for
|
||||
* this Stream with lzma_index_stream_flags().
|
||||
*/
|
||||
const lzma_stream_flags *flags;
|
||||
|
||||
/**
|
||||
* \brief Encoded size of a Block excluding Block Padding
|
||||
*
|
||||
* This value is stored in the Index. When doing random-access
|
||||
* reading, you should give this value to the Block decoder along
|
||||
* with uncompressed_size.
|
||||
*/
|
||||
lzma_vli unpadded_size;
|
||||
const void *reserved_ptr1;
|
||||
const void *reserved_ptr2;
|
||||
const void *reserved_ptr3;
|
||||
|
||||
/**
|
||||
* \brief Uncompressed Size of a Block
|
||||
*/
|
||||
lzma_vli uncompressed_size;
|
||||
/**
|
||||
* \brief Stream number in the lzma_index
|
||||
*
|
||||
* The first Stream is 1.
|
||||
*/
|
||||
lzma_vli number;
|
||||
|
||||
/**
|
||||
* \brief Compressed offset in the Stream(s)
|
||||
*
|
||||
* This is the offset of the first byte of the Block, that is,
|
||||
* where you need to seek to decode the Block. The offset
|
||||
* is relative to the beginning of the Stream, or if there are
|
||||
* multiple Indexes combined, relative to the beginning of the
|
||||
* first Stream.
|
||||
*/
|
||||
lzma_vli stream_offset;
|
||||
/**
|
||||
* \brief Number of Blocks in the Stream
|
||||
*
|
||||
* If this is zero, the block structure below has
|
||||
* undefined values.
|
||||
*/
|
||||
lzma_vli block_count;
|
||||
|
||||
/**
|
||||
* \brief Uncompressed offset
|
||||
*
|
||||
* When doing random-access reading, it is possible that the target
|
||||
* offset is not exactly at Block boundary. One will need to compare
|
||||
* the target offset against uncompressed_offset, and possibly decode
|
||||
* and throw away some amount of data before reaching the target
|
||||
* offset.
|
||||
*/
|
||||
lzma_vli uncompressed_offset;
|
||||
/**
|
||||
* \brief Compressed start offset of this Stream
|
||||
*
|
||||
* The offset is relative to the beginning of the lzma_index
|
||||
* (i.e. usually the beginning of the .xz file).
|
||||
*/
|
||||
lzma_vli compressed_offset;
|
||||
|
||||
} lzma_index_record;
|
||||
/**
|
||||
* \brief Uncompressed start offset of this Stream
|
||||
*
|
||||
* The offset is relative to the beginning of the lzma_index
|
||||
* (i.e. usually the beginning of the .xz file).
|
||||
*/
|
||||
lzma_vli uncompressed_offset;
|
||||
|
||||
/**
|
||||
* \brief Compressed size of this Stream
|
||||
*
|
||||
* This includes all headers except the possible
|
||||
* Stream Padding after this Stream.
|
||||
*/
|
||||
lzma_vli compressed_size;
|
||||
|
||||
/**
|
||||
* \brief Uncompressed size of this Stream
|
||||
*/
|
||||
lzma_vli uncompressed_size;
|
||||
|
||||
/**
|
||||
* \brief Size of Stream Padding after this Stream
|
||||
*
|
||||
* If it hasn't been set with lzma_index_stream_padding(),
|
||||
* this defaults to zero. Stream Padding is always
|
||||
* a multiple of four bytes.
|
||||
*/
|
||||
lzma_vli padding;
|
||||
|
||||
lzma_vli reserved_vli1;
|
||||
lzma_vli reserved_vli2;
|
||||
lzma_vli reserved_vli3;
|
||||
lzma_vli reserved_vli4;
|
||||
} stream;
|
||||
|
||||
struct {
|
||||
/**
|
||||
* \brief Block number in the file
|
||||
*
|
||||
* The first Block is 1.
|
||||
*/
|
||||
lzma_vli number_in_file;
|
||||
|
||||
/**
|
||||
* \brief Compressed start offset of this Block
|
||||
*
|
||||
* This offset is relative to the beginning of the
|
||||
* lzma_index (i.e. usually the beginning of the .xz file).
|
||||
* Normally this is where you should seek in the .xz file
|
||||
* to start decompressing this Block.
|
||||
*/
|
||||
lzma_vli compressed_file_offset;
|
||||
|
||||
/**
|
||||
* \brief Uncompressed start offset of this Block
|
||||
*
|
||||
* This offset is relative to the beginning of the lzma_index
|
||||
* (i.e. usually the beginning of the .xz file).
|
||||
*
|
||||
* When doing random-access reading, it is possible that
|
||||
* the target offset is not exactly at Block boundary. One
|
||||
* will need to compare the target offset against
|
||||
* uncompressed_file_offset or uncompressed_stream_offset,
|
||||
* and possibly decode and throw away some amount of data
|
||||
* before reaching the target offset.
|
||||
*/
|
||||
lzma_vli uncompressed_file_offset;
|
||||
|
||||
/**
|
||||
* \brief Block number in this Stream
|
||||
*
|
||||
* The first Block is 1.
|
||||
*/
|
||||
lzma_vli number_in_stream;
|
||||
|
||||
/**
|
||||
* \brief Compressed start offset of this Block
|
||||
*
|
||||
* This offset is relative to the beginning of the Stream
|
||||
* containing this Block.
|
||||
*/
|
||||
lzma_vli compressed_stream_offset;
|
||||
|
||||
/**
|
||||
* \brief Uncompressed start offset of this Block
|
||||
*
|
||||
* This offset is relative to the beginning of the Stream
|
||||
* containing this Block.
|
||||
*/
|
||||
lzma_vli uncompressed_stream_offset;
|
||||
|
||||
/**
|
||||
* \brief Uncompressed size of this Block
|
||||
*
|
||||
* You should pass this to the Block decoder if you will
|
||||
* decode this Block. It will allow the Block decoder to
|
||||
* validate the uncompressed size.
|
||||
*/
|
||||
lzma_vli uncompressed_size;
|
||||
|
||||
/**
|
||||
* \brief Unpadded size of this Block
|
||||
*
|
||||
* You should pass this to the Block decoder if you will
|
||||
* decode this Block. It will allow the Block decoder to
|
||||
* validate the unpadded size.
|
||||
*/
|
||||
lzma_vli unpadded_size;
|
||||
|
||||
/**
|
||||
* \brief Total compressed size
|
||||
*
|
||||
* This includes all headers and padding in this Block.
|
||||
* This is useful if you need to know how many bytes
|
||||
* the Block decoder will actually read.
|
||||
*/
|
||||
lzma_vli total_size;
|
||||
|
||||
lzma_vli reserved_vli1;
|
||||
lzma_vli reserved_vli2;
|
||||
lzma_vli reserved_vli3;
|
||||
lzma_vli reserved_vli4;
|
||||
|
||||
const void *reserved_ptr1;
|
||||
const void *reserved_ptr2;
|
||||
const void *reserved_ptr3;
|
||||
const void *reserved_ptr4;
|
||||
} block;
|
||||
|
||||
/*
|
||||
* Internal data which is used to store the state of the iterator.
|
||||
* The exact format may vary between liblzma versions, so don't
|
||||
* touch these in any way.
|
||||
*/
|
||||
union {
|
||||
const void *p;
|
||||
size_t s;
|
||||
lzma_vli v;
|
||||
} internal[6];
|
||||
} lzma_index_iter;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Calculate memory usage for Index with given number of Records
|
||||
* \brief Operation mode for lzma_index_iter_next()
|
||||
*/
|
||||
typedef enum {
|
||||
LZMA_INDEX_ITER_ANY = 0,
|
||||
/**<
|
||||
* \brief Get the next Block or Stream
|
||||
*
|
||||
* Go to the next Block if the current Stream has at least
|
||||
* one Block left. Otherwise go to the next Stream even if
|
||||
* it has no Blocks. If the Stream has no Blocks
|
||||
* (lzma_index_iter.stream.block_count == 0),
|
||||
* lzma_index_iter.block will have undefined values.
|
||||
*/
|
||||
|
||||
LZMA_INDEX_ITER_STREAM = 1,
|
||||
/**<
|
||||
* \brief Get the next Stream
|
||||
*
|
||||
* Go to the next Stream even if the current Stream has
|
||||
* unread Blocks left. If the next Stream has at least one
|
||||
* Block, the iterator will point to the first Block.
|
||||
* If there are no Blocks, lzma_index_iter.block will have
|
||||
* undefined values.
|
||||
*/
|
||||
|
||||
LZMA_INDEX_ITER_BLOCK = 2,
|
||||
/**<
|
||||
* \brief Get the next Block
|
||||
*
|
||||
* Go to the next Block if the current Stream has at least
|
||||
* one Block left. If the current Stream has no Blocks left,
|
||||
* the next Stream with at least one Block is located and
|
||||
* the iterator will be made to point to the first Block of
|
||||
* that Stream.
|
||||
*/
|
||||
|
||||
LZMA_INDEX_ITER_NONEMPTY_BLOCK = 3
|
||||
/**<
|
||||
* \brief Get the next non-empty Block
|
||||
*
|
||||
* This is like LZMA_INDEX_ITER_BLOCK except that it will
|
||||
* skip Blocks whose Uncompressed Size is zero.
|
||||
*/
|
||||
|
||||
} lzma_index_iter_mode;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Calculate memory usage of lzma_index
|
||||
*
|
||||
* On disk, the size of the Index field depends on both the number of Records
|
||||
* stored and how big values the Records store (due to variable-length integer
|
||||
* encoding). When the Index is kept in lzma_index structure, the memory usage
|
||||
* depends only on the number of Records stored in the Index. The size in RAM
|
||||
* is almost always a lot bigger than in encoded form on disk.
|
||||
* depends only on the number of Records/Blocks stored in the Index(es), and
|
||||
* in case of concatenated lzma_indexes, the number of Streams. The size in
|
||||
* RAM is almost always significantly bigger than in the encoded form on disk.
|
||||
*
|
||||
* This function calculates an approximate amount of memory needed hold the
|
||||
* given number of Records in lzma_index structure. This value may vary
|
||||
* between liblzma versions if the internal implementation is modified.
|
||||
*
|
||||
* If you want to know how much memory an existing lzma_index structure is
|
||||
* using, use lzma_index_memusage(lzma_index_count(i)).
|
||||
* This function calculates an approximate amount of memory needed hold
|
||||
* the given number of Streams and Blocks in lzma_index structure. This
|
||||
* value may vary between CPU architectures and also between liblzma versions
|
||||
* if the internal implementation is modified.
|
||||
*/
|
||||
extern LZMA_API(uint64_t) lzma_index_memusage(lzma_vli record_count)
|
||||
extern LZMA_API(uint64_t) lzma_index_memusage(
|
||||
lzma_vli streams, lzma_vli blocks) lzma_nothrow;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Calculate the memory usage of an existing lzma_index
|
||||
*
|
||||
* This is a shorthand for lzma_index_memusage(lzma_index_stream_count(i),
|
||||
* lzma_index_block_count(i)).
|
||||
*/
|
||||
extern LZMA_API(uint64_t) lzma_index_memused(const lzma_index *i)
|
||||
lzma_nothrow;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Allocate and initialize a new lzma_index structure
|
||||
*
|
||||
* If i is NULL, a new lzma_index structure is allocated, initialized,
|
||||
* and a pointer to it returned. If allocation fails, NULL is returned.
|
||||
*
|
||||
* If i is non-NULL, it is reinitialized and the same pointer returned.
|
||||
* In this case, return value cannot be NULL or a different pointer than
|
||||
* the i that was given as an argument.
|
||||
* \return On success, a pointer to an empty initialized lzma_index is
|
||||
* returned. If allocation fails, NULL is returned.
|
||||
*/
|
||||
extern LZMA_API(lzma_index *) lzma_index_init(
|
||||
lzma_index *i, lzma_allocator *allocator) lzma_nothrow;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Deallocate the Index
|
||||
*
|
||||
* If i is NULL, this does nothing.
|
||||
*/
|
||||
extern LZMA_API(void) lzma_index_end(lzma_index *i, lzma_allocator *allocator)
|
||||
extern LZMA_API(lzma_index *) lzma_index_init(const lzma_allocator *allocator)
|
||||
lzma_nothrow;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Add a new Record to an Index
|
||||
* \brief Deallocate lzma_index
|
||||
*
|
||||
* If i is NULL, this does nothing.
|
||||
*/
|
||||
extern LZMA_API(void) lzma_index_end(
|
||||
lzma_index *i, const lzma_allocator *allocator) lzma_nothrow;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Add a new Block to lzma_index
|
||||
*
|
||||
* \param i Pointer to a lzma_index structure
|
||||
* \param allocator Pointer to lzma_allocator, or NULL to
|
||||
@@ -130,7 +329,10 @@ extern LZMA_API(void) lzma_index_end(lzma_index *i, lzma_allocator *allocator)
|
||||
* taken directly from lzma_block structure
|
||||
* after encoding or decoding the Block.
|
||||
*
|
||||
* Appending a new Record does not affect the read position.
|
||||
* Appending a new Block does not invalidate iterators. For example,
|
||||
* if an iterator was pointing to the end of the lzma_index, after
|
||||
* lzma_index_append() it is possible to read the next Block with
|
||||
* an existing iterator.
|
||||
*
|
||||
* \return - LZMA_OK
|
||||
* - LZMA_MEM_ERROR
|
||||
@@ -139,15 +341,78 @@ extern LZMA_API(void) lzma_index_end(lzma_index *i, lzma_allocator *allocator)
|
||||
* - LZMA_PROG_ERROR
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_index_append(
|
||||
lzma_index *i, lzma_allocator *allocator,
|
||||
lzma_index *i, const lzma_allocator *allocator,
|
||||
lzma_vli unpadded_size, lzma_vli uncompressed_size)
|
||||
lzma_nothrow lzma_attr_warn_unused_result;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Get the number of Records
|
||||
* \brief Set the Stream Flags
|
||||
*
|
||||
* Set the Stream Flags of the last (and typically the only) Stream
|
||||
* in lzma_index. This can be useful when reading information from the
|
||||
* lzma_index, because to decode Blocks, knowing the integrity check type
|
||||
* is needed.
|
||||
*
|
||||
* The given Stream Flags are copied into internal preallocated structure
|
||||
* in the lzma_index, thus the caller doesn't need to keep the *stream_flags
|
||||
* available after calling this function.
|
||||
*
|
||||
* \return - LZMA_OK
|
||||
* - LZMA_OPTIONS_ERROR: Unsupported stream_flags->version.
|
||||
* - LZMA_PROG_ERROR
|
||||
*/
|
||||
extern LZMA_API(lzma_vli) lzma_index_count(const lzma_index *i)
|
||||
extern LZMA_API(lzma_ret) lzma_index_stream_flags(
|
||||
lzma_index *i, const lzma_stream_flags *stream_flags)
|
||||
lzma_nothrow lzma_attr_warn_unused_result;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Get the types of integrity Checks
|
||||
*
|
||||
* If lzma_index_stream_flags() is used to set the Stream Flags for
|
||||
* every Stream, lzma_index_checks() can be used to get a bitmask to
|
||||
* indicate which Check types have been used. It can be useful e.g. if
|
||||
* showing the Check types to the user.
|
||||
*
|
||||
* The bitmask is 1 << check_id, e.g. CRC32 is 1 << 1 and SHA-256 is 1 << 10.
|
||||
*/
|
||||
extern LZMA_API(uint32_t) lzma_index_checks(const lzma_index *i)
|
||||
lzma_nothrow lzma_attr_pure;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Set the amount of Stream Padding
|
||||
*
|
||||
* Set the amount of Stream Padding of the last (and typically the only)
|
||||
* Stream in the lzma_index. This is needed when planning to do random-access
|
||||
* reading within multiple concatenated Streams.
|
||||
*
|
||||
* By default, the amount of Stream Padding is assumed to be zero bytes.
|
||||
*
|
||||
* \return - LZMA_OK
|
||||
* - LZMA_DATA_ERROR: The file size would grow too big.
|
||||
* - LZMA_PROG_ERROR
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_index_stream_padding(
|
||||
lzma_index *i, lzma_vli stream_padding)
|
||||
lzma_nothrow lzma_attr_warn_unused_result;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Get the number of Streams
|
||||
*/
|
||||
extern LZMA_API(lzma_vli) lzma_index_stream_count(const lzma_index *i)
|
||||
lzma_nothrow lzma_attr_pure;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Get the number of Blocks
|
||||
*
|
||||
* This returns the total number of Blocks in lzma_index. To get number
|
||||
* of Blocks in individual Streams, use lzma_index_iter.
|
||||
*/
|
||||
extern LZMA_API(lzma_vli) lzma_index_block_count(const lzma_index *i)
|
||||
lzma_nothrow lzma_attr_pure;
|
||||
|
||||
|
||||
@@ -160,6 +425,17 @@ extern LZMA_API(lzma_vli) lzma_index_size(const lzma_index *i)
|
||||
lzma_nothrow lzma_attr_pure;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Get the total size of the Stream
|
||||
*
|
||||
* If multiple lzma_indexes have been combined, this works as if the Blocks
|
||||
* were in a single Stream. This is useful if you are going to combine
|
||||
* Blocks from multiple Streams into a single new Stream.
|
||||
*/
|
||||
extern LZMA_API(lzma_vli) lzma_index_stream_size(const lzma_index *i)
|
||||
lzma_nothrow lzma_attr_pure;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Get the total size of the Blocks
|
||||
*
|
||||
@@ -170,146 +446,155 @@ extern LZMA_API(lzma_vli) lzma_index_total_size(const lzma_index *i)
|
||||
lzma_nothrow lzma_attr_pure;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Get the total size of the Stream
|
||||
*
|
||||
* If multiple Indexes have been combined, this works as if the Blocks
|
||||
* were in a single Stream.
|
||||
*/
|
||||
extern LZMA_API(lzma_vli) lzma_index_stream_size(const lzma_index *i)
|
||||
lzma_nothrow lzma_attr_pure;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Get the total size of the file
|
||||
*
|
||||
* When no Indexes have been combined with lzma_index_cat(), this function is
|
||||
* identical to lzma_index_stream_size(). If multiple Indexes have been
|
||||
* combined, this includes also the headers of each separate Stream and the
|
||||
* possible Stream Padding fields.
|
||||
* When no lzma_indexes have been combined with lzma_index_cat() and there is
|
||||
* no Stream Padding, this function is identical to lzma_index_stream_size().
|
||||
* If multiple lzma_indexes have been combined, this includes also the headers
|
||||
* of each separate Stream and the possible Stream Padding fields.
|
||||
*/
|
||||
extern LZMA_API(lzma_vli) lzma_index_file_size(const lzma_index *i)
|
||||
lzma_nothrow lzma_attr_pure;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Get the uncompressed size of the Stream
|
||||
* \brief Get the uncompressed size of the file
|
||||
*/
|
||||
extern LZMA_API(lzma_vli) lzma_index_uncompressed_size(const lzma_index *i)
|
||||
lzma_nothrow lzma_attr_pure;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Get the next Record from the Index
|
||||
* \brief Initialize an iterator
|
||||
*
|
||||
* \param iter Pointer to a lzma_index_iter structure
|
||||
* \param i lzma_index to which the iterator will be associated
|
||||
*
|
||||
* This function associates the iterator with the given lzma_index, and calls
|
||||
* lzma_index_iter_rewind() on the iterator.
|
||||
*
|
||||
* This function doesn't allocate any memory, thus there is no
|
||||
* lzma_index_iter_end(). The iterator is valid as long as the
|
||||
* associated lzma_index is valid, that is, until lzma_index_end() or
|
||||
* using it as source in lzma_index_cat(). Specifically, lzma_index doesn't
|
||||
* become invalid if new Blocks are added to it with lzma_index_append() or
|
||||
* if it is used as the destination in lzma_index_cat().
|
||||
*
|
||||
* It is safe to make copies of an initialized lzma_index_iter, for example,
|
||||
* to easily restart reading at some particular position.
|
||||
*/
|
||||
extern LZMA_API(lzma_bool) lzma_index_read(
|
||||
lzma_index *i, lzma_index_record *record)
|
||||
extern LZMA_API(void) lzma_index_iter_init(
|
||||
lzma_index_iter *iter, const lzma_index *i) lzma_nothrow;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Rewind the iterator
|
||||
*
|
||||
* Rewind the iterator so that next call to lzma_index_iter_next() will
|
||||
* return the first Block or Stream.
|
||||
*/
|
||||
extern LZMA_API(void) lzma_index_iter_rewind(lzma_index_iter *iter)
|
||||
lzma_nothrow;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Get the next Block or Stream
|
||||
*
|
||||
* \param iter Iterator initialized with lzma_index_iter_init()
|
||||
* \param mode Specify what kind of information the caller wants
|
||||
* to get. See lzma_index_iter_mode for details.
|
||||
*
|
||||
* \return If next Block or Stream matching the mode was found, *iter
|
||||
* is updated and this function returns false. If no Block or
|
||||
* Stream matching the mode is found, *iter is not modified
|
||||
* and this function returns true. If mode is set to an unknown
|
||||
* value, *iter is not modified and this function returns true.
|
||||
*/
|
||||
extern LZMA_API(lzma_bool) lzma_index_iter_next(
|
||||
lzma_index_iter *iter, lzma_index_iter_mode mode)
|
||||
lzma_nothrow lzma_attr_warn_unused_result;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Rewind the Index
|
||||
* \brief Locate a Block
|
||||
*
|
||||
* Rewind the Index so that next call to lzma_index_read() will return the
|
||||
* first Record.
|
||||
*/
|
||||
extern LZMA_API(void) lzma_index_rewind(lzma_index *i) lzma_nothrow;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Locate a Record
|
||||
* If it is possible to seek in the .xz file, it is possible to parse
|
||||
* the Index field(s) and use lzma_index_iter_locate() to do random-access
|
||||
* reading with granularity of Block size.
|
||||
*
|
||||
* When the Index is available, it is possible to do random-access reading
|
||||
* with granularity of Block size.
|
||||
*
|
||||
* \param i Pointer to lzma_index structure
|
||||
* \param record Pointer to a structure to hold the search results
|
||||
* \param iter Iterator that was earlier initialized with
|
||||
* lzma_index_iter_init().
|
||||
* \param target Uncompressed target offset which the caller would
|
||||
* like to locate from the Stream
|
||||
*
|
||||
* If the target is smaller than the uncompressed size of the Stream (can be
|
||||
* checked with lzma_index_uncompressed_size()):
|
||||
* - Information about the Record containing the requested uncompressed
|
||||
* offset is stored into *record.
|
||||
* - Read offset will be adjusted so that calling lzma_index_read() can be
|
||||
* used to read subsequent Records.
|
||||
* - Information about the Stream and Block containing the requested
|
||||
* uncompressed offset is stored into *iter.
|
||||
* - Internal state of the iterator is adjusted so that
|
||||
* lzma_index_iter_next() can be used to read subsequent Blocks or Streams.
|
||||
* - This function returns false.
|
||||
*
|
||||
* If target is greater than the uncompressed size of the Stream, *record
|
||||
* and the read position are not modified, and this function returns true.
|
||||
* If target is greater than the uncompressed size of the Stream, *iter
|
||||
* is not modified, and this function returns true.
|
||||
*/
|
||||
extern LZMA_API(lzma_bool) lzma_index_locate(
|
||||
lzma_index *i, lzma_index_record *record, lzma_vli target)
|
||||
lzma_nothrow;
|
||||
extern LZMA_API(lzma_bool) lzma_index_iter_locate(
|
||||
lzma_index_iter *iter, lzma_vli target) lzma_nothrow;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Concatenate Indexes of two Streams
|
||||
* \brief Concatenate lzma_indexes
|
||||
*
|
||||
* Concatenating Indexes is useful when doing random-access reading in
|
||||
* Concatenating lzma_indexes is useful when doing random-access reading in
|
||||
* multi-Stream .xz file, or when combining multiple Streams into single
|
||||
* Stream.
|
||||
*
|
||||
* \param dest Destination Index after which src is appended
|
||||
* \param src Source Index. If this function succeeds, the
|
||||
* memory allocated for src is freed or moved to
|
||||
* be part of dest.
|
||||
* \param dest lzma_index after which src is appended
|
||||
* \param src lzma_index to be appended after dest. If this
|
||||
* function succeeds, the memory allocated for src
|
||||
* is freed or moved to be part of dest, and all
|
||||
* iterators pointing to src will become invalid.
|
||||
* \param allocator Custom memory allocator; can be NULL to use
|
||||
* malloc() and free().
|
||||
* \param padding Size of the Stream Padding field between Streams.
|
||||
* This must be a multiple of four.
|
||||
*
|
||||
* \return - LZMA_OK: Indexes concatenated successfully. src is now
|
||||
* a dangling pointer.
|
||||
* \return - LZMA_OK: lzma_indexes were concatenated successfully.
|
||||
* src is now a dangling pointer.
|
||||
* - LZMA_DATA_ERROR: *dest would grow too big.
|
||||
* - LZMA_MEM_ERROR
|
||||
* - LZMA_PROG_ERROR
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_index_cat(lzma_index *lzma_restrict dest,
|
||||
lzma_index *lzma_restrict src,
|
||||
lzma_allocator *allocator, lzma_vli padding)
|
||||
extern LZMA_API(lzma_ret) lzma_index_cat(lzma_index *dest, lzma_index *src,
|
||||
const lzma_allocator *allocator)
|
||||
lzma_nothrow lzma_attr_warn_unused_result;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Duplicate an Index list
|
||||
* \brief Duplicate lzma_index
|
||||
*
|
||||
* Makes an identical copy of the Index. Also the read position is copied.
|
||||
*
|
||||
* \return A copy of the Index, or NULL if memory allocation failed.
|
||||
* \return A copy of the lzma_index, or NULL if memory allocation failed.
|
||||
*/
|
||||
extern LZMA_API(lzma_index *) lzma_index_dup(
|
||||
const lzma_index *i, lzma_allocator *allocator)
|
||||
const lzma_index *i, const lzma_allocator *allocator)
|
||||
lzma_nothrow lzma_attr_warn_unused_result;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Compare if two Index lists are identical
|
||||
*
|
||||
* Read positions are not compared.
|
||||
*
|
||||
* \return True if *a and *b are equal, false otherwise.
|
||||
*/
|
||||
extern LZMA_API(lzma_bool) lzma_index_equal(
|
||||
const lzma_index *a, const lzma_index *b)
|
||||
lzma_nothrow lzma_attr_pure;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Initialize .xz Index encoder
|
||||
*
|
||||
* \param strm Pointer to properly prepared lzma_stream
|
||||
* \param i Pointer to lzma_index which should be encoded.
|
||||
* The read position will be at the end of the Index
|
||||
* after lzma_code() has returned LZMA_STREAM_END.
|
||||
*
|
||||
* The only valid action value for lzma_code() is LZMA_RUN.
|
||||
* The valid `action' values for lzma_code() are LZMA_RUN and LZMA_FINISH.
|
||||
* It is enough to use only one of them (you can choose freely; use LZMA_RUN
|
||||
* to support liblzma versions older than 5.0.0).
|
||||
*
|
||||
* \return - LZMA_OK: Initialization succeeded, continue with lzma_code().
|
||||
* - LZMA_MEM_ERROR
|
||||
* - LZMA_PROG_ERROR
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_index_encoder(lzma_stream *strm, lzma_index *i)
|
||||
extern LZMA_API(lzma_ret) lzma_index_encoder(
|
||||
lzma_stream *strm, const lzma_index *i)
|
||||
lzma_nothrow lzma_attr_warn_unused_result;
|
||||
|
||||
|
||||
@@ -317,28 +602,24 @@ extern LZMA_API(lzma_ret) lzma_index_encoder(lzma_stream *strm, lzma_index *i)
|
||||
* \brief Initialize .xz Index decoder
|
||||
*
|
||||
* \param strm Pointer to properly prepared lzma_stream
|
||||
* \param i Pointer to a pointer that will be made to point
|
||||
* to the final decoded Index once lzma_code() has
|
||||
* returned LZMA_STREAM_END. That is,
|
||||
* lzma_index_decoder() always takes care of
|
||||
* allocating a new lzma_index structure, and *i
|
||||
* doesn't need to be initialized by the caller.
|
||||
* \param memlimit How much memory the resulting Index is allowed
|
||||
* to require.
|
||||
* \param i The decoded Index will be made available via
|
||||
* this pointer. Initially this function will
|
||||
* set *i to NULL (the old value is ignored). If
|
||||
* decoding succeeds (lzma_code() returns
|
||||
* LZMA_STREAM_END), *i will be set to point
|
||||
* to a new lzma_index, which the application
|
||||
* has to later free with lzma_index_end().
|
||||
* \param memlimit How much memory the resulting lzma_index is
|
||||
* allowed to require.
|
||||
*
|
||||
* The only valid action value for lzma_code() is LZMA_RUN.
|
||||
* The valid `action' values for lzma_code() are LZMA_RUN and LZMA_FINISH.
|
||||
* It is enough to use only one of them (you can choose freely; use LZMA_RUN
|
||||
* to support liblzma versions older than 5.0.0).
|
||||
*
|
||||
* \return - LZMA_OK: Initialization succeeded, continue with lzma_code().
|
||||
* - LZMA_MEM_ERROR
|
||||
* - LZMA_MEMLIMIT_ERROR
|
||||
* - LZMA_PROG_ERROR
|
||||
*
|
||||
* \note The memory usage limit is checked early in the decoding
|
||||
* (within the first dozen input bytes or so). The actual memory
|
||||
* is allocated later in smaller pieces. If the memory usage
|
||||
* limit is modified with lzma_memlimit_set() after a part
|
||||
* of the Index has already been decoded, the new limit may
|
||||
* get ignored.
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_index_decoder(
|
||||
lzma_stream *strm, lzma_index **i, uint64_t memlimit)
|
||||
@@ -348,9 +629,7 @@ extern LZMA_API(lzma_ret) lzma_index_decoder(
|
||||
/**
|
||||
* \brief Single-call .xz Index encoder
|
||||
*
|
||||
* \param i Index to be encoded. The read position will be at
|
||||
* the end of the Index if encoding succeeds, or at
|
||||
* unspecified position in case an error occurs.
|
||||
* \param i lzma_index to be encoded
|
||||
* \param out Beginning of the output buffer
|
||||
* \param out_pos The next byte will be written to out[*out_pos].
|
||||
* *out_pos is updated only if encoding succeeds.
|
||||
@@ -366,23 +645,23 @@ extern LZMA_API(lzma_ret) lzma_index_decoder(
|
||||
* \note This function doesn't take allocator argument since all
|
||||
* the internal data is allocated on stack.
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_index_buffer_encode(lzma_index *i,
|
||||
extern LZMA_API(lzma_ret) lzma_index_buffer_encode(const lzma_index *i,
|
||||
uint8_t *out, size_t *out_pos, size_t out_size) lzma_nothrow;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Single-call .xz Index decoder
|
||||
*
|
||||
* \param i Pointer to a pointer that will be made to point
|
||||
* to the final decoded Index if decoding is
|
||||
* successful. That is, lzma_index_buffer_decode()
|
||||
* always takes care of allocating a new
|
||||
* lzma_index structure, and *i doesn't need to be
|
||||
* \param i If decoding succeeds, *i will point to a new
|
||||
* lzma_index, which the application has to
|
||||
* later free with lzma_index_end(). If an error
|
||||
* occurs, *i will be NULL. The old value of *i
|
||||
* is always ignored and thus doesn't need to be
|
||||
* initialized by the caller.
|
||||
* \param memlimit Pointer to how much memory the resulting Index
|
||||
* is allowed to require. The value pointed by
|
||||
* this pointer is modified if and only if
|
||||
* LZMA_MEMLIMIT_ERROR is returned.
|
||||
* \param memlimit Pointer to how much memory the resulting
|
||||
* lzma_index is allowed to require. The value
|
||||
* pointed by this pointer is modified if and only
|
||||
* if LZMA_MEMLIMIT_ERROR is returned.
|
||||
* \param allocator Pointer to lzma_allocator, or NULL to use malloc()
|
||||
* \param in Beginning of the input buffer
|
||||
* \param in_pos The next byte will be read from in[*in_pos].
|
||||
@@ -398,6 +677,6 @@ extern LZMA_API(lzma_ret) lzma_index_buffer_encode(lzma_index *i,
|
||||
* - LZMA_PROG_ERROR
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_index_buffer_decode(lzma_index **i,
|
||||
uint64_t *memlimit, lzma_allocator *allocator,
|
||||
uint64_t *memlimit, const lzma_allocator *allocator,
|
||||
const uint8_t *in, size_t *in_pos, size_t in_size)
|
||||
lzma_nothrow;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* \file lzma/index_hash.h
|
||||
* \brief Validates Index by using a hash function
|
||||
* \brief Validate Index by using a hash function
|
||||
*
|
||||
* Hashing makes it possible to use constant amount of memory to validate
|
||||
* Index of arbitrary size.
|
||||
@@ -37,7 +37,7 @@ typedef struct lzma_index_hash_s lzma_index_hash;
|
||||
* pointer than the index_hash that was given as an argument.
|
||||
*/
|
||||
extern LZMA_API(lzma_index_hash *) lzma_index_hash_init(
|
||||
lzma_index_hash *index_hash, lzma_allocator *allocator)
|
||||
lzma_index_hash *index_hash, const lzma_allocator *allocator)
|
||||
lzma_nothrow lzma_attr_warn_unused_result;
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ extern LZMA_API(lzma_index_hash *) lzma_index_hash_init(
|
||||
* \brief Deallocate lzma_index_hash structure
|
||||
*/
|
||||
extern LZMA_API(void) lzma_index_hash_end(
|
||||
lzma_index_hash *index_hash, lzma_allocator *allocator)
|
||||
lzma_index_hash *index_hash, const lzma_allocator *allocator)
|
||||
lzma_nothrow;
|
||||
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user