mirror of
https://github.com/PCSX2/xz.git
synced 2026-02-05 03:41:17 +01:00
Compare commits
991 Commits
v4.999.3al
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f76f7516d6 | ||
|
|
3cbcaeb07e | ||
|
|
76762ae609 | ||
|
|
2267f5b0d2 | ||
|
|
cee3021d30 | ||
|
|
c5c7ceb08a | ||
|
|
114cab97af | ||
|
|
b8139e11c5 | ||
|
|
47b59d47cf | ||
|
|
bc19799169 | ||
|
|
fb6d4f83cb | ||
|
|
bc577d35c2 | ||
|
|
713bbc1a80 | ||
|
|
a0ee1afbd9 | ||
|
|
a1e2c568de | ||
|
|
cea5cf8d26 | ||
|
|
95d563db3e | ||
|
|
ab72416d62 | ||
|
|
8238898018 | ||
|
|
94e3f986aa | ||
|
|
0b0e1e6803 | ||
|
|
a015cd1f90 | ||
|
|
c2e29f06a7 | ||
|
|
1520f6ec80 | ||
|
|
8269782283 | ||
|
|
e353d0b1cc | ||
|
|
144ef9e19e | ||
|
|
8c9842c265 | ||
|
|
662b27c417 | ||
|
|
c28f0b3d00 | ||
|
|
bba477257d | ||
|
|
310d19816d | ||
|
|
a27920002d | ||
|
|
a0b1dda409 | ||
|
|
84462afaad | ||
|
|
cbc7401793 | ||
|
|
78ae13bced | ||
|
|
0297863fdb | ||
|
|
d4a0462abe | ||
|
|
a01794c52a | ||
|
|
df8f446e3a | ||
|
|
446e4318fa | ||
|
|
1b0ac0c53c | ||
|
|
c83b7a0334 | ||
|
|
ade31a2bfb | ||
|
|
ac398c3baf | ||
|
|
6fd5ecb589 | ||
|
|
473ef0dc69 | ||
|
|
faf302137e | ||
|
|
e52e9151cf | ||
|
|
14115f84a3 | ||
|
|
f4c95ba94b | ||
|
|
c7bc20a6f3 | ||
|
|
5cbca1205d | ||
|
|
af13781886 | ||
|
|
9fa5949330 | ||
|
|
cb3111e3ed | ||
|
|
4cc584985c | ||
|
|
23ed1d4148 | ||
|
|
b0bc3e0385 | ||
|
|
c6bf438ab3 | ||
|
|
e18adc56f2 | ||
|
|
282e768a14 | ||
|
|
372e402713 | ||
|
|
21515d79d7 | ||
|
|
09f395b6b3 | ||
|
|
3bf857edfe | ||
|
|
7f05803979 | ||
|
|
397fcc0946 | ||
|
|
cbc9e39bae | ||
|
|
bcacd8ce7a | ||
|
|
0275a5398c | ||
|
|
a74525cf9b | ||
|
|
fbbb295a91 | ||
|
|
713dbe5c23 | ||
|
|
3a5d755d05 | ||
|
|
b0798c6aa6 | ||
|
|
9b02a4ffda | ||
|
|
c7f4041f6b | ||
|
|
17b29d4f0a | ||
|
|
49c26920d6 | ||
|
|
5b2458cb24 | ||
|
|
6bd0349c58 | ||
|
|
fc0df0f8db | ||
|
|
57393615b3 | ||
|
|
1238381143 | ||
|
|
29a087fb5a | ||
|
|
6e845c6a3e | ||
|
|
3717885f9e | ||
|
|
eccd8155e1 | ||
|
|
25263fd9e7 | ||
|
|
4c544d2410 | ||
|
|
e0ea6737b0 | ||
|
|
8bcca29a65 | ||
|
|
f243f5f44c | ||
|
|
7f0a4c50f4 | ||
|
|
f6ec468015 | ||
|
|
a24518971c | ||
|
|
dec11497a7 | ||
|
|
29e39c7997 | ||
|
|
7a11c4a8e5 | ||
|
|
117d962685 | ||
|
|
ae984e31c1 | ||
|
|
2205bb5853 | ||
|
|
d935b0cdf3 | ||
|
|
eb61bc58c2 | ||
|
|
b9a5b6b7a2 | ||
|
|
c45757135f | ||
|
|
3c500174ed | ||
|
|
fec88d41e6 | ||
|
|
a9b45badfe | ||
|
|
541aee6dd4 | ||
|
|
4170edc914 | ||
|
|
04bbc0c284 | ||
|
|
f0f1f6c723 | ||
|
|
d2d484647d | ||
|
|
aae6a6aeda | ||
|
|
7815112153 | ||
|
|
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 | ||
|
|
682efdc1f9 | ||
|
|
c8c184db1c | ||
|
|
9756fce565 | ||
|
|
77007a7fb2 | ||
|
|
04dcbfdeb9 | ||
|
|
fd7618611a | ||
|
|
c29e76c0f9 | ||
|
|
696d7ee395 | ||
|
|
4c3558aa83 | ||
|
|
35b29e4424 | ||
|
|
2341437719 | ||
|
|
371b04e19f | ||
|
|
d88c4072b3 | ||
|
|
92e536d8b8 | ||
|
|
3e2ba8b585 | ||
|
|
8e8ebc17c5 | ||
|
|
b198e770a1 | ||
|
|
fe111a25cd | ||
|
|
10242a21e9 | ||
|
|
3ce1916c83 | ||
|
|
66da129c8e | ||
|
|
8238c4b240 | ||
|
|
71f18e8a06 | ||
|
|
5aa4678b23 | ||
|
|
e51b4e49e8 | ||
|
|
a4165d0584 | ||
|
|
df636eb4e0 | ||
|
|
180bdf58ea | ||
|
|
e1ce2291e7 | ||
|
|
e71903fc61 | ||
|
|
1d314b81aa | ||
|
|
a7f5d2fe48 | ||
|
|
b735cde20c | ||
|
|
0fd157cc00 | ||
|
|
b198da96ff | ||
|
|
669413bb2d | ||
|
|
dbbd8fb870 | ||
|
|
adbad2d16c | ||
|
|
e0236f1256 | ||
|
|
2f34fb2692 | ||
|
|
0db1befcfb | ||
|
|
8f8ec942d6 | ||
|
|
99f9e879a6 | ||
|
|
ef4cf1851d | ||
|
|
4c9c989d45 | ||
|
|
366e436090 | ||
|
|
64e498c89d | ||
|
|
a35755c5de | ||
|
|
98f3cac1ad | ||
|
|
d873a09e95 | ||
|
|
cd69a5a6c1 | ||
|
|
eed9953732 | ||
|
|
6f62fa88f4 | ||
|
|
1754b7e03e | ||
|
|
3bdb53792c | ||
|
|
5f16ef4abf | ||
|
|
96e4b257e1 | ||
|
|
25cc7a6e8c | ||
|
|
18c10c30d2 | ||
|
|
0a289c01ac | ||
|
|
5cc99db5ba | ||
|
|
7653d1cf48 | ||
|
|
f42ee98166 | ||
|
|
89dac1db6f | ||
|
|
6e685aae45 | ||
|
|
73f560ee5f | ||
|
|
7ff0004fbc | ||
|
|
449c634674 | ||
|
|
792db79f27 | ||
|
|
0adc72feb8 | ||
|
|
ad12edc952 | ||
|
|
b2b1f86753 | ||
|
|
c393055947 | ||
|
|
da0af22e4b | ||
|
|
65014fd211 | ||
|
|
5e1257466d | ||
|
|
cad62551c5 | ||
|
|
fe378d4707 | ||
|
|
390a640856 | ||
|
|
1c9360b7d1 | ||
|
|
d45615c555 | ||
|
|
eaf8367368 | ||
|
|
b317b218e2 | ||
|
|
ae82dde5d9 | ||
|
|
1735d31ea3 | ||
|
|
8ed156ce89 | ||
|
|
f6df39afaa | ||
|
|
1774f27c61 | ||
|
|
cb61345564 | ||
|
|
083c23c680 | ||
|
|
b4f5c81409 | ||
|
|
b1edee2cdc | ||
|
|
72aa0e9c5f | ||
|
|
dcedb6998c | ||
|
|
5f735dae80 | ||
|
|
b60376249e | ||
|
|
b4f92f522d | ||
|
|
4dd21d23f2 | ||
|
|
8836139b63 | ||
|
|
b0063023f8 | ||
|
|
071b825b23 | ||
|
|
03ca67fd37 | ||
|
|
a6f43e6412 | ||
|
|
f6ce63ebdb | ||
|
|
be06858d5c | ||
|
|
0255401e57 | ||
|
|
1496ff437c | ||
|
|
21c6b94373 | ||
|
|
e518d167aa | ||
|
|
31decdce04 | ||
|
|
4787d65443 | ||
|
|
2f0bc9cd40 | ||
|
|
02ddf09bc3 | ||
|
|
e79c42d854 | ||
|
|
94eb9ad46f | ||
|
|
9bab5336eb | ||
|
|
a0497ff7a0 | ||
|
|
390e69887f | ||
|
|
0df9299e24 | ||
|
|
cf751edfde | ||
|
|
63df14c57d | ||
|
|
fd6a380f4e | ||
|
|
68bf7ac298 | ||
|
|
47c2e21f82 | ||
|
|
489a3dbaa0 | ||
|
|
7494816ab0 | ||
|
|
11ae4ae35f | ||
|
|
3084d662d2 | ||
|
|
9c62371eab | ||
|
|
0dae8b7751 | ||
|
|
fdbc0cfa71 | ||
|
|
1d924e584b | ||
|
|
96c46df7de | ||
|
|
b6a30ee8c2 | ||
|
|
1ec5b00279 | ||
|
|
154f5aec2d | ||
|
|
e605c26636 | ||
|
|
a3bbbe05d3 | ||
|
|
53f7598998 | ||
|
|
0e27028d74 | ||
|
|
ae1ad9af54 | ||
|
|
79e25eded4 | ||
|
|
bc7c7109cc | ||
|
|
edfc2031e5 | ||
|
|
880c330938 | ||
|
|
3f86532407 | ||
|
|
bd7ca1dad5 | ||
|
|
d0ab8c1c73 | ||
|
|
bfd91198e4 | ||
|
|
3306cf3883 | ||
|
|
b719e63c5f | ||
|
|
fe5434f940 | ||
|
|
3dfa58a9ee | ||
|
|
975d8fd72a | ||
|
|
094b1b09a5 | ||
|
|
e1c3412eec | ||
|
|
75905a9afc | ||
|
|
d0c0b9e94e | ||
|
|
ccf92a29e8 | ||
|
|
99c1c2abfa | ||
|
|
22a0c6dd94 | ||
|
|
8dd7b6052e | ||
|
|
55fd41431e | ||
|
|
3e54ecee5c | ||
|
|
d64ca34f1b | ||
|
|
6a2eb54092 | ||
|
|
d9993fcb4d | ||
|
|
2dbdc5befb | ||
|
|
4ab7601091 | ||
|
|
b2172cf823 | ||
|
|
1aae869874 | ||
|
|
f54bcf6f80 | ||
|
|
982da7ed31 | ||
|
|
c4683a660b | ||
|
|
3241317093 | ||
|
|
f76e39cf93 | ||
|
|
449b8c832b | ||
|
|
850f740042 | ||
|
|
667481f1aa | ||
|
|
5fb34d8324 | ||
|
|
c129748675 | ||
|
|
1859d22d75 | ||
|
|
2c5fe958e4 | ||
|
|
c81f13ff29 | ||
|
|
0b3318661c | ||
|
|
9ec80355a7 | ||
|
|
d8b58d0993 | ||
|
|
0c09810cb3 | ||
|
|
2f1a8e8eb8 | ||
|
|
4810b6bc25 | ||
|
|
00be5d2e09 | ||
|
|
128586213f | ||
|
|
b056379490 | ||
|
|
dc8f3be06d | ||
|
|
8286a60b8f | ||
|
|
4fd43cb3a9 | ||
|
|
061748f593 | ||
|
|
9c45658ddc | ||
|
|
b59f1e98f5 | ||
|
|
d1d17a40d3 | ||
|
|
88d3e6b0b1 | ||
|
|
322ecf93c9 | ||
|
|
7eea8bec3a | ||
|
|
28e75f7086 | ||
|
|
7ed9d943b3 | ||
|
|
5cda29b566 | ||
|
|
050eb14d29 | ||
|
|
4820f10d0f | ||
|
|
e33194e79d | ||
|
|
4d00652e75 | ||
|
|
634636fa56 | ||
|
|
4fed98417d | ||
|
|
653e457e37 | ||
|
|
671a5adf1e | ||
|
|
17781c2c20 | ||
|
|
f9f2d1e743 | ||
|
|
ff7fb2c605 | ||
|
|
1ceebcf7e1 | ||
|
|
a94bf00d0a | ||
|
|
8582d392ba | ||
|
|
b1ae6dd731 | ||
|
|
1ea9e7f15a | ||
|
|
bceb3918db | ||
|
|
6efa2d80d4 | ||
|
|
f20a03206b | ||
|
|
ef7890d564 | ||
|
|
ccd57afa09 | ||
|
|
c596fda40b | ||
|
|
c58f469be5 | ||
|
|
cd70801520 | ||
|
|
656ec87882 | ||
|
|
691a9155b7 | ||
|
|
c7007ddf06 | ||
|
|
ae65dcfde2 | ||
|
|
a8368b75cd | ||
|
|
69472ee5f0 | ||
|
|
4249c8c15a | ||
|
|
6d1d6f4598 | ||
|
|
f901a290ee | ||
|
|
86a0ed8f01 | ||
|
|
54f716ba89 | ||
|
|
1880a3927b | ||
|
|
e114502b2b | ||
|
|
3c3905b534 | ||
|
|
0f295bf7a3 | ||
|
|
1e8e4fd1f3 | ||
|
|
5e4df4c3c0 | ||
|
|
fcfb86c777 | ||
|
|
bd137524f2 | ||
|
|
4c321a41c4 | ||
|
|
8e60c889a2 | ||
|
|
3bdbc12c05 | ||
|
|
a6639022fd | ||
|
|
ed3709000a | ||
|
|
ea560b0ea8 | ||
|
|
ad97483b6e | ||
|
|
7a57069167 | ||
|
|
018ae09df8 | ||
|
|
3a62a5fb85 | ||
|
|
c6ca26eef7 | ||
|
|
1dcecfb09b | ||
|
|
5cc5064cae | ||
|
|
f147666a5c | ||
|
|
13d68b0698 | ||
|
|
13a74b78e3 | ||
|
|
320601b2c7 | ||
|
|
ec490da522 | ||
|
|
16e8b98f26 | ||
|
|
5a710c3805 | ||
|
|
01892b2ca5 | ||
|
|
962f2231d4 | ||
|
|
fa3ab0df8a | ||
|
|
9373e81e18 | ||
|
|
cb072b7c84 | ||
|
|
123ab0acec | ||
|
|
9cfcd0c4f2 | ||
|
|
2ba01bfa75 | ||
|
|
07efcb5a6b | ||
|
|
32fe5fa541 | ||
|
|
0a31ed9d5e | ||
|
|
da98df5440 | ||
|
|
2496aee8a7 | ||
|
|
bea301c26d | ||
|
|
9c75b089b4 | ||
|
|
bab0590504 | ||
|
|
689602336d | ||
|
|
80c4158f19 | ||
|
|
fc68165745 | ||
|
|
ede675f9ac | ||
|
|
3b34851de1 | ||
|
|
57b9a145a5 | ||
|
|
eaafc4367c | ||
|
|
0809c46534 | ||
|
|
d25ab1b961 | ||
|
|
6368a2fa59 | ||
|
|
7d17818cec | ||
|
|
bf6348d1a3 | ||
|
|
803194ddd2 | ||
|
|
0ea98e52ba | ||
|
|
436fa5fae9 | ||
|
|
369f72fd65 | ||
|
|
e55e0e873c | ||
|
|
ed6664146f | ||
|
|
b09464bf9a | ||
|
|
11de5d5267 | ||
|
|
dc192b6343 | ||
|
|
944b62b932 | ||
|
|
8e074349e4 | ||
|
|
2f361ac19b | ||
|
|
3be21fb12f |
66
.gitignore
vendored
Normal file
66
.gitignore
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
*~
|
||||
*.bak
|
||||
*.bak[0-9]
|
||||
.gdb_history
|
||||
|
||||
.deps
|
||||
.libs
|
||||
*.la
|
||||
*.lo
|
||||
*.o
|
||||
Makefile.in
|
||||
|
||||
/ABOUT-NLS
|
||||
/autom4te.cache
|
||||
/Doxyfile
|
||||
/aclocal.m4
|
||||
/config.h
|
||||
/config.h.in
|
||||
/config.log
|
||||
/config.status
|
||||
/configure
|
||||
/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
|
||||
|
||||
/src/scripts/xzdiff
|
||||
/src/scripts/xzgrep
|
||||
/src/scripts/xzless
|
||||
/src/scripts/xzmore
|
||||
|
||||
/tests/compress_generated_abc
|
||||
/tests/compress_generated_random
|
||||
/tests/compress_generated_text
|
||||
/tests/create_compress_files
|
||||
/tests/test_block_header
|
||||
/tests/test_check
|
||||
/tests/test_filter_flags
|
||||
/tests/test_index
|
||||
/tests/test_stream_flags
|
||||
|
||||
/lib/Makefile
|
||||
/tests/Makefile
|
||||
/Makefile
|
||||
/debug/Makefile
|
||||
/src/scripts/Makefile
|
||||
/src/xz/Makefile
|
||||
/src/Makefile
|
||||
/src/liblzma/Makefile
|
||||
/src/liblzma/api/Makefile
|
||||
/src/lzmainfo/Makefile
|
||||
/src/xzdec/Makefile
|
||||
35
AUTHORS
35
AUTHORS
@@ -1,18 +1,27 @@
|
||||
|
||||
Authors of LZMA Utils
|
||||
---------------------
|
||||
Authors of XZ Utils
|
||||
===================
|
||||
|
||||
Igor Pavlov
|
||||
* designed LZMA as an algorithm;
|
||||
* wrote an implementation known as LZMA SDK, which is part of
|
||||
the bigger 7-Zip project.
|
||||
XZ Utils is developed and maintained by Lasse Collin
|
||||
<lasse.collin@tukaani.org>.
|
||||
|
||||
Ville Koskinen
|
||||
* wrote the first version of the gzip-like lzma command line
|
||||
utility (C++)
|
||||
* helped a lot with the documentation.
|
||||
Major parts of liblzma are based on code written by Igor Pavlov,
|
||||
specifically the LZMA SDK <http://7-zip.org/sdk.html>. Without
|
||||
this code, XZ Utils wouldn't exist.
|
||||
|
||||
Lasse Collin
|
||||
* ported LZMA SDK to C and zlib-like API (liblzma);
|
||||
* rewrote the command line tool again to use liblzma and pthreads.
|
||||
The SHA-256 implementation in liblzma is based on the code found from
|
||||
7-Zip <http://7-zip.org/>, which has a modified version of the SHA-256
|
||||
code found from Crypto++ <http://www.cryptopp.com/>. The SHA-256 code
|
||||
in Crypto++ was written by Kevin Springle and Wei Dai.
|
||||
|
||||
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 scripts and their man pages for
|
||||
XZ Utils.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
70
COPYING
70
COPYING
@@ -1,25 +1,65 @@
|
||||
|
||||
LZMA Utils Licenses
|
||||
-------------------
|
||||
XZ Utils Licensing
|
||||
==================
|
||||
|
||||
Different licenses apply to different files in this package. Here
|
||||
is a rough summary of which license apply to which parts of this
|
||||
is a rough summary of which licenses apply to which parts of this
|
||||
package (but check the individual files to be sure!):
|
||||
- Everything under src/liblzma/check and tests/files is public
|
||||
domain.
|
||||
- Everything else under the src directory is under the GNU LGPL
|
||||
2.1 or (at your opinion) any later version.
|
||||
- Outside the src directory, there are some files that are under
|
||||
the GNU GPL 2 or (at your opinion) any later version, or under
|
||||
the GNU GPL 3 or (at your opinion) any later version.
|
||||
- Most documentation files are under an all-permissive license.
|
||||
|
||||
The following license texts are included in the following files
|
||||
in this package:
|
||||
- liblzma is in the public domain.
|
||||
|
||||
- xz, xzdec, and lzmadec command line tools are in the public
|
||||
domain unless GNU getopt_long had to be compiled and linked
|
||||
in from the lib directory. The getopt_long code is under
|
||||
GNU LGPLv2.1+.
|
||||
|
||||
- The scripts to grep, diff, and view compressed files have been
|
||||
adapted from gzip. These scripts and their documentation are
|
||||
under GNU GPLv2+.
|
||||
|
||||
- All the documentation in the doc directory and most of the
|
||||
XZ Utils specific documentation files in other directories
|
||||
are in the public domain.
|
||||
|
||||
- Translated messages are in the public domain.
|
||||
|
||||
- The build system contains public domain files, and files that
|
||||
are under GNU GPLv2+ or GNU GPLv3+. None of these files end up
|
||||
in the binaries being built.
|
||||
|
||||
- Test files and test code in the tests directory, and debugging
|
||||
utilities in the debug directory are in the public domain.
|
||||
|
||||
- The extra directory may contain public domain files, and files
|
||||
that are under various free software licenses.
|
||||
|
||||
You can do whatever you want with the files that have been put into
|
||||
the public domain. If you find public domain legally problematic,
|
||||
take the previous sentence as a license grant. If you still find
|
||||
the lack of copyright legally problematic, you have too many
|
||||
lawyers.
|
||||
|
||||
As usual, this software is provided "as is", without any warranty.
|
||||
|
||||
If you copy significant amounts of public domain code from XZ Utils
|
||||
into your project, acknowledging this somewhere in your software is
|
||||
polite (especially if it is proprietary, non-free software), but
|
||||
naturally it is not legally required. Here is an example of a good
|
||||
notice to put into "about box" or into documentation:
|
||||
|
||||
This software includes code from XZ Utils <https://tukaani.org/xz/>.
|
||||
|
||||
The following license texts are included in the following files:
|
||||
- COPYING.LGPLv2.1: GNU Lesser General Public License version 2.1
|
||||
- COPYING.GPLv2: GNU General Public License version 2
|
||||
- COPYING.GPLv3: GNU General Public License version 3
|
||||
|
||||
If you have questions, don't hesitate to ask the copyright holder(s)
|
||||
for more information.
|
||||
Note that the toolchain (compiler, linker etc.) may add some code
|
||||
pieces that are copyrighted. Thus, it is possible that e.g. liblzma
|
||||
binary wouldn't actually be in the public domain in its entirety
|
||||
even though it contains no copyrighted code from the XZ Utils source
|
||||
package.
|
||||
|
||||
If you have questions, don't hesitate to ask the author(s) for more
|
||||
information.
|
||||
|
||||
|
||||
@@ -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,2 +1,7 @@
|
||||
See the commit log in the git repository:
|
||||
git://ctrl.tukaani.org/lzma-utils.git
|
||||
|
||||
git clone https://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
|
||||
Makefile.am for details.
|
||||
|
||||
13
Doxyfile.in
13
Doxyfile.in
@@ -1,5 +1,8 @@
|
||||
# Doxyfile 1.4.7
|
||||
|
||||
# Copyright (C) 1997-2007 by Dimitri van Heesch
|
||||
# License: GNU GPLv2+
|
||||
|
||||
# This file describes the settings to be used by the documentation system
|
||||
# doxygen (www.doxygen.org) for a project
|
||||
#
|
||||
@@ -115,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
|
||||
@@ -955,13 +958,13 @@ ENABLE_PREPROCESSING = YES
|
||||
# compilation will be performed. Macro expansion can be done in a controlled
|
||||
# way by setting EXPAND_ONLY_PREDEF to YES.
|
||||
|
||||
MACRO_EXPANSION = NO
|
||||
MACRO_EXPANSION = YES
|
||||
|
||||
# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
|
||||
# then the macro expansion is limited to the macros specified with the
|
||||
# PREDEFINED and EXPAND_AS_DEFINED tags.
|
||||
|
||||
EXPAND_ONLY_PREDEF = NO
|
||||
EXPAND_ONLY_PREDEF = YES
|
||||
|
||||
# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
|
||||
# in the INCLUDE_PATH (see below) will be search if a #include is found.
|
||||
@@ -989,7 +992,9 @@ INCLUDE_FILE_PATTERNS =
|
||||
# undefined via #undef or recursively expanded use the := operator
|
||||
# instead of the = operator.
|
||||
|
||||
PREDEFINED =
|
||||
PREDEFINED = LZMA_API(type)=type \
|
||||
LZMA_API_IMPORT \
|
||||
LZMA_API_CALL=
|
||||
|
||||
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
|
||||
# this tag can be used to specify a list of macro names that should be expanded.
|
||||
|
||||
613
INSTALL
Normal file
613
INSTALL
Normal file
@@ -0,0 +1,613 @@
|
||||
|
||||
XZ Utils Installation
|
||||
=====================
|
||||
|
||||
0. Preface
|
||||
1. Supported platforms
|
||||
1.1. Compilers
|
||||
1.2. Platform-specific notes
|
||||
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.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
|
||||
----------
|
||||
|
||||
If you aren't familiar with building packages that use GNU Autotools,
|
||||
see the file INSTALL.generic for generic instructions before reading
|
||||
further.
|
||||
|
||||
If you are going to build a package for distribution, see also the
|
||||
file PACKAGERS. It contains information that should help making the
|
||||
binary packages as good as possible, but the information isn't very
|
||||
interesting to those making local builds for private use or for use
|
||||
in special situations like embedded systems.
|
||||
|
||||
|
||||
1. Supported platforms
|
||||
----------------------
|
||||
|
||||
XZ Utils are developed on GNU/Linux, but they should work on many
|
||||
POSIX-like operating systems like *BSDs and Solaris, and even on
|
||||
a few non-POSIX operating systems.
|
||||
|
||||
|
||||
1.1. Compilers
|
||||
|
||||
A C99 compiler is required to compile XZ Utils. If you use GCC, you
|
||||
need at least version 3.x.x. GCC version 2.xx.x doesn't support some
|
||||
C99 features used in XZ Utils source code, thus GCC 2 won't compile
|
||||
XZ Utils.
|
||||
|
||||
XZ Utils takes advantage of some GNU C extensions when building
|
||||
with GCC. Because these extensions are used only when building
|
||||
with GCC, it should be possible to use any C99 compiler.
|
||||
|
||||
|
||||
1.2. Platform-specific notes
|
||||
|
||||
1.2.1. AIX
|
||||
|
||||
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. 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.
|
||||
|
||||
test_scripts.sh in "make check" may fail if good enough tools are
|
||||
missing from PATH (/usr/xpg4/bin or /usr/xpg6/bin). See sections
|
||||
4.5 and 3.2 for more information.
|
||||
|
||||
|
||||
1.2.6. Tru64
|
||||
|
||||
If you try to use the native C compiler on Tru64 (passing CC=cc to
|
||||
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.7. Windows
|
||||
|
||||
Building XZ Utils on Windows is supported under the following
|
||||
environments:
|
||||
|
||||
- MinGW-w64 + MSYS (32-bit and 64-bit x86): This is used
|
||||
for building the official binary packages for Windows.
|
||||
There is windows/build.bash to ease packaging XZ Utils with
|
||||
MinGW(-w64) + MSYS into a redistributable .zip or .7z file.
|
||||
See windows/INSTALL-MinGW.txt for more information.
|
||||
|
||||
- MinGW + MSYS (32-bit x86): I haven't recently tested this.
|
||||
|
||||
- Cygwin 1.7.35 and later: NOTE that using XZ Utils >= 5.2.0
|
||||
under Cygwin older than 1.7.35 can lead to DATA LOSS! If
|
||||
you must use an old Cygwin version, stick to XZ Utils 5.0.x
|
||||
which is safe under older Cygwin versions. You can check
|
||||
the Cygwin version with the command "cygcheck -V".
|
||||
|
||||
- Microsoft Visual Studio 2013 update 2 or later (MSVC for short):
|
||||
See windows/INSTALL-MSVC.txt for more information.
|
||||
|
||||
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.
|
||||
|
||||
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.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. See dos/README for more information.
|
||||
|
||||
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
|
||||
|
||||
If you have written patches to make XZ Utils to work on previously
|
||||
unsupported platform, please send the patches to me! I will consider
|
||||
including them to the official version. It's nice to minimize the
|
||||
need of third-party patching.
|
||||
|
||||
One exception: Don't request or send patches to change the whole
|
||||
source package to C89. I find C99 substantially nicer to write and
|
||||
maintain. However, the public library headers must be in C89 to
|
||||
avoid frustrating those who maintain programs, which are strictly
|
||||
in C89 or C++.
|
||||
|
||||
|
||||
2. configure 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.
|
||||
|
||||
--enable-encoders=LIST
|
||||
--disable-encoders
|
||||
Specify a comma-separated LIST of filter encoders to
|
||||
build. See "./configure --help" for exact list of
|
||||
available filter encoders. The default is to build all
|
||||
supported encoders.
|
||||
|
||||
If LIST is empty or --disable-encoders is used, no filter
|
||||
encoders will be built and also the code shared between
|
||||
encoders will be omitted.
|
||||
|
||||
Disabling encoders will remove some symbols from the
|
||||
liblzma ABI, so this option should be used only when it
|
||||
is known to not cause problems.
|
||||
|
||||
--enable-decoders=LIST
|
||||
--disable-decoders
|
||||
This is like --enable-encoders but for decoders. The
|
||||
default is to build all supported decoders.
|
||||
|
||||
--enable-match-finders=LIST
|
||||
liblzma includes two categories of match finders:
|
||||
hash chains and binary trees. Hash chains (hc3 and hc4)
|
||||
are quite fast but they don't provide the best compression
|
||||
ratio. Binary trees (bt2, bt3 and bt4) give excellent
|
||||
compression ratio, but they are slower and need more
|
||||
memory than hash chains.
|
||||
|
||||
You need to enable at least one match finder to build the
|
||||
LZMA1 or LZMA2 filter encoders. Usually hash chains are
|
||||
used only in the fast mode, while binary trees are used to
|
||||
when the best compression ratio is wanted.
|
||||
|
||||
The default is to build all the match finders if LZMA1
|
||||
or LZMA2 filter encoders are being built.
|
||||
|
||||
--enable-checks=LIST
|
||||
liblzma support multiple integrity checks. CRC32 is
|
||||
mandatory, and cannot be omitted. See "./configure --help"
|
||||
for exact list of available integrity check types.
|
||||
|
||||
liblzma and the command line tools can decompress files
|
||||
which use unsupported integrity check type, but naturally
|
||||
the file integrity cannot be verified in that case.
|
||||
|
||||
Disabling integrity checks may remove some symbols from
|
||||
the liblzma ABI, so this option should be used only when
|
||||
it is known to not cause problems.
|
||||
|
||||
--enable-external-sha256
|
||||
Try to use SHA-256 code from the operating system libc
|
||||
or similar base system libraries. This doesn't try to
|
||||
use OpenSSL or libgcrypt or such libraries.
|
||||
|
||||
The reasons to use this option:
|
||||
|
||||
- It makes liblzma slightly smaller.
|
||||
|
||||
- It might improve SHA-256 speed if the implementation
|
||||
in the operating is very good (but see below).
|
||||
|
||||
External SHA-256 is disabled by default for two reasons:
|
||||
|
||||
- On some operating systems the symbol names of the
|
||||
SHA-256 functions conflict with OpenSSL's libcrypto.
|
||||
This causes weird problems such as decompression
|
||||
errors if an application is linked against both
|
||||
liblzma and libcrypto. This problem affects at least
|
||||
FreeBSD 10 and older and MINIX 3.3.0 and older, but
|
||||
other OSes that provide a function "SHA256_Init" might
|
||||
also be affected. FreeBSD 11 has the problem fixed.
|
||||
NetBSD had the problem but it was fixed it in 2009
|
||||
already. OpenBSD uses "SHA256Init" and thus never had
|
||||
a conflict with libcrypto.
|
||||
|
||||
- The SHA-256 code in liblzma is faster than the SHA-256
|
||||
code provided by some operating systems. If you are
|
||||
curious, build two copies of xz (internal and external
|
||||
SHA-256) and compare the decompression (xz --test)
|
||||
times:
|
||||
|
||||
dd if=/dev/zero bs=1024k count=1024 \
|
||||
| xz -v -0 -Csha256 > foo.xz
|
||||
time xz --test foo.xz
|
||||
|
||||
--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
|
||||
32-bit x86.
|
||||
|
||||
All the assembler code in liblzma is position-independent
|
||||
code, which is suitable for use in shared libraries and
|
||||
position-independent executables. So far only i386
|
||||
instructions are used, but the code is optimized for i686
|
||||
class CPUs. If you are compiling liblzma exclusively for
|
||||
pre-i686 systems, you may want to disable the assembler
|
||||
code.
|
||||
|
||||
--enable-unaligned-access
|
||||
Allow liblzma to use unaligned memory access for 16-bit
|
||||
and 32-bit loads and stores. This should be enabled only
|
||||
when the hardware supports this, i.e. when unaligned
|
||||
access is fast. Some operating system kernels emulate
|
||||
unaligned access, which is extremely slow. This option
|
||||
shouldn't be used on systems that rely on such emulation.
|
||||
|
||||
Unaligned access is enabled by default on x86, x86-64,
|
||||
and big endian PowerPC.
|
||||
|
||||
--enable-small
|
||||
Reduce the size of liblzma by selecting smaller but
|
||||
semantically equivalent version of some functions, and
|
||||
omit precomputed lookup tables. This option tends to
|
||||
make liblzma slightly slower.
|
||||
|
||||
Note that while omitting the precomputed tables makes
|
||||
liblzma smaller on disk, the tables are still needed at
|
||||
run time, and need to be computed at startup. This also
|
||||
means that the RAM holding the tables won't be shared
|
||||
between applications linked against shared liblzma.
|
||||
|
||||
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.
|
||||
|
||||
--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.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
--enable-threads=METHOD
|
||||
Threading support is enabled by default so normally there
|
||||
is no need to specify this option.
|
||||
|
||||
Supported values for METHOD:
|
||||
|
||||
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-sandbox=METHOD
|
||||
There is limited sandboxing support in the xz tool. If
|
||||
built with sandbox support, it's used automatically when
|
||||
(de)compressing exactly one file to standard output and
|
||||
the options --files or --files0 weren't used. This is a
|
||||
common use case, for example, (de)compressing .tar.xz
|
||||
files via GNU tar. The sandbox is also used for
|
||||
single-file `xz --test' or `xz --list'.
|
||||
|
||||
Supported METHODs:
|
||||
|
||||
auto Look for a supported sandboxing method
|
||||
and use it if found. If no method is
|
||||
found, then sandboxing isn't used.
|
||||
This is the default.
|
||||
|
||||
no Disable sandboxing support.
|
||||
|
||||
capsicum
|
||||
Use Capsicum (FreeBSD >= 10) for
|
||||
sandboxing. If no Capsicum support
|
||||
is found, configure will give an error.
|
||||
|
||||
--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
|
||||
run-time consistency checks. It makes the code slower, so
|
||||
you normally don't want to have this enabled.
|
||||
|
||||
--enable-werror
|
||||
If building with GCC, make all compiler warnings an error,
|
||||
that abort the compilation. This may help catching bugs,
|
||||
and should work on most systems. This has no effect on the
|
||||
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
|
||||
---------------------------
|
||||
|
||||
3.1. Dependencies
|
||||
|
||||
POSIX shell (sh) and bunch of other standard POSIX tools are required
|
||||
to run the scripts. The configure script tries to find a POSIX
|
||||
compliant sh, but if it fails, you can force the shell by passing
|
||||
gl_cv_posix_shell=/path/to/posix-sh as an argument to the configure
|
||||
script.
|
||||
|
||||
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
|
||||
|
||||
The scripts assume that the required tools (standard POSIX utilities,
|
||||
mktemp, and xz) are in PATH; the scripts don't set the PATH themselves.
|
||||
Some people like this while some think this is a bug. Those in the
|
||||
latter group can easily patch the scripts before running the configure
|
||||
script by taking advantage of a placeholder line in the scripts.
|
||||
|
||||
For example, to make the scripts prefix /usr/bin:/bin to PATH:
|
||||
|
||||
perl -pi -e 's|^#SET_PATH.*$|PATH=/usr/bin:/bin:\$PATH|' \
|
||||
src/scripts/xz*.in
|
||||
|
||||
|
||||
4. Troubleshooting
|
||||
------------------
|
||||
|
||||
4.1. "No C99 compiler was found."
|
||||
|
||||
You need a C99 compiler to build XZ Utils. If the configure script
|
||||
cannot find a C99 compiler and you think you have such a compiler
|
||||
installed, set the compiler command by passing CC=/path/to/c99 as
|
||||
an argument to the configure script.
|
||||
|
||||
If you get this error even when you think your compiler supports C99,
|
||||
you can override the test by passing ac_cv_prog_cc_c99= as an argument
|
||||
to the configure script. The test for C99 compiler is not perfect (and
|
||||
it is not as easy to make it perfect as it sounds), so sometimes this
|
||||
may be needed. You will get a compile error if your compiler doesn't
|
||||
support enough C99.
|
||||
|
||||
|
||||
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
|
||||
it fails, you can force the shell to be used by passing
|
||||
gl_cv_posix_shell=/path/to/posix-sh as an argument to the configure
|
||||
script. Alternatively you can omit the installation of scripts and
|
||||
this error by passing --disable-scripts to configure.
|
||||
|
||||
|
||||
4.3. configure works but build fails at crc32_x86.S
|
||||
|
||||
The easy fix is to pass --disable-assembler to the configure script.
|
||||
|
||||
The configure script determines if assembler code can be used by
|
||||
looking at the configure triplet; there is currently no check if
|
||||
the assembler code can actually actually be built. The x86 assembler
|
||||
code should work on x86 GNU/Linux, *BSDs, Solaris, Darwin, MinGW,
|
||||
Cygwin, and DJGPP. On other x86 systems, there may be problems and
|
||||
the assembler code may need to be disabled with the configure option.
|
||||
|
||||
If you get this error when building for x86-64, you have specified or
|
||||
the configure script has misguessed your architecture. Pass the
|
||||
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).
|
||||
|
||||
365
INSTALL.generic
Normal file
365
INSTALL.generic
Normal file
@@ -0,0 +1,365 @@
|
||||
Installation Instructions
|
||||
*************************
|
||||
|
||||
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
|
||||
2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
|
||||
|
||||
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
|
||||
==================
|
||||
|
||||
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. 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
|
||||
those values to create a `Makefile' in each directory of the package.
|
||||
It may also create one or more `.h' files containing system-dependent
|
||||
definitions. Finally, it creates a shell script `config.status' that
|
||||
you can run in the future to recreate the current configuration, and a
|
||||
file `config.log' containing compiler output (useful mainly for
|
||||
debugging `configure').
|
||||
|
||||
It can also use an optional file (typically called `config.cache'
|
||||
and enabled with `--cache-file=config.cache' or simply `-C') that saves
|
||||
the results of its tests to speed up reconfiguring. Caching is
|
||||
disabled by default to prevent problems with accidental use of stale
|
||||
cache files.
|
||||
|
||||
If you need to do unusual things to compile the package, please try
|
||||
to figure out how `configure' could check whether to do them, and mail
|
||||
diffs or instructions to the address given in the `README' so they can
|
||||
be considered for the next release. If you are using the cache, and at
|
||||
some point `config.cache' contains results you don't want to keep, you
|
||||
may remove or edit it.
|
||||
|
||||
The file `configure.ac' (or `configure.in') is used to create
|
||||
`configure' by a program called `autoconf'. You need `configure.ac' if
|
||||
you want to change it or regenerate `configure' using a newer version
|
||||
of `autoconf'.
|
||||
|
||||
The simplest way to compile this package is:
|
||||
|
||||
1. `cd' to the directory containing the package's source code and type
|
||||
`./configure' to configure the package for your system.
|
||||
|
||||
Running `configure' might take a while. While running, it prints
|
||||
some messages telling which features it is checking for.
|
||||
|
||||
2. Type `make' to compile the package.
|
||||
|
||||
3. Optionally, type `make check' to run any self-tests that come with
|
||||
the package, generally using the just-built uninstalled binaries.
|
||||
|
||||
4. Type `make install' to install the programs and any data files and
|
||||
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. 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
|
||||
also a `make maintainer-clean' target, but that is intended mainly
|
||||
for the package's developers. If you use it, you may have to get
|
||||
all sorts of other programs in order to regenerate files that came
|
||||
with the distribution.
|
||||
|
||||
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
|
||||
=====================
|
||||
|
||||
Some systems require unusual options for compilation or linking that
|
||||
the `configure' script does not know about. Run `./configure --help'
|
||||
for details on some of the pertinent environment variables.
|
||||
|
||||
You can give `configure' initial values for configuration parameters
|
||||
by setting variables in the command line or in the environment. Here
|
||||
is an example:
|
||||
|
||||
./configure CC=c99 CFLAGS=-g LIBS=-lposix
|
||||
|
||||
*Note Defining Variables::, for more details.
|
||||
|
||||
Compiling For Multiple Architectures
|
||||
====================================
|
||||
|
||||
You can compile the package for more than one kind of computer at the
|
||||
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 `..'. 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
|
||||
installed the package for one architecture, use `make distclean' before
|
||||
reconfiguring for another architecture.
|
||||
|
||||
On MacOS X 10.5 and later systems, you can create libraries and
|
||||
executables that work on multiple system types--known as "fat" or
|
||||
"universal" binaries--by specifying multiple `-arch' options to the
|
||||
compiler but only a single `-arch' option to the preprocessor. Like
|
||||
this:
|
||||
|
||||
./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
|
||||
CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
|
||||
CPP="gcc -E" CXXCPP="g++ -E"
|
||||
|
||||
This is not guaranteed to produce working output in all cases, you
|
||||
may have to build one architecture at a time and combine the results
|
||||
using the `lipo' tool if you have problems.
|
||||
|
||||
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', where PREFIX must be an
|
||||
absolute file name.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
|
||||
PREFIX as the prefix for installing programs and libraries.
|
||||
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. 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'.
|
||||
|
||||
Some packages pay attention to `--enable-FEATURE' options to
|
||||
`configure', where FEATURE indicates an optional part of the package.
|
||||
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||
is something like `gnu-as' or `x' (for the X Window System). The
|
||||
`README' should mention any `--enable-' and `--with-' options that the
|
||||
package recognizes.
|
||||
|
||||
For packages that use the X Window System, `configure' can usually
|
||||
find the X include and library files automatically, but if it doesn't,
|
||||
you can use the `configure' options `--x-includes=DIR' and
|
||||
`--x-libraries=DIR' to specify their locations.
|
||||
|
||||
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
|
||||
==================
|
||||
|
||||
On HP-UX, the default C compiler is not ANSI C compatible. If GNU
|
||||
CC is not installed, it is recommended to use the following options in
|
||||
order to use an ANSI C compiler:
|
||||
|
||||
./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
|
||||
|
||||
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
|
||||
|
||||
On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
|
||||
parse its `<wchar.h>' header file. The option `-nodtk' can be used as
|
||||
a workaround. If GNU CC is not installed, it is therefore recommended
|
||||
to try
|
||||
|
||||
./configure CC="cc"
|
||||
|
||||
and if that doesn't work, try
|
||||
|
||||
./configure CC="cc -nodtk"
|
||||
|
||||
On Solaris, don't put `/usr/ucb' early in your `PATH'. This
|
||||
directory contains several dysfunctional programs; working variants of
|
||||
these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
|
||||
in your `PATH', put it _after_ `/usr/bin'.
|
||||
|
||||
On Haiku, software installed for all users goes in `/boot/common',
|
||||
not `/usr/local'. It is recommended to use the following options:
|
||||
|
||||
./configure --prefix=/boot/common
|
||||
|
||||
Specifying the System Type
|
||||
==========================
|
||||
|
||||
There may be some features `configure' cannot figure out
|
||||
automatically, but needs to determine by the type of machine the package
|
||||
will run on. Usually, assuming the package is built to be run on the
|
||||
_same_ architectures, `configure' can figure that out, but if it prints
|
||||
a message saying it cannot guess the machine type, give it the
|
||||
`--build=TYPE' option. TYPE can either be a short name for the system
|
||||
type, such as `sun4', or a canonical name which has the form:
|
||||
|
||||
CPU-COMPANY-SYSTEM
|
||||
|
||||
where SYSTEM can have one of these forms:
|
||||
|
||||
OS
|
||||
KERNEL-OS
|
||||
|
||||
See the file `config.sub' for the possible values of each field. If
|
||||
`config.sub' isn't included in this package, then this package doesn't
|
||||
need to know the machine type.
|
||||
|
||||
If you are _building_ compiler tools for cross-compiling, you should
|
||||
use the option `--target=TYPE' to select the type of system they will
|
||||
produce code for.
|
||||
|
||||
If you want to _use_ a cross compiler, that generates code for a
|
||||
platform different from the build platform, you should specify the
|
||||
"host" platform (i.e., that on which the generated programs will
|
||||
eventually be run) with `--host=TYPE'.
|
||||
|
||||
Sharing Defaults
|
||||
================
|
||||
|
||||
If you want to set default values for `configure' scripts to share,
|
||||
you can create a site shell script called `config.site' that gives
|
||||
default values for variables like `CC', `cache_file', and `prefix'.
|
||||
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||
`CONFIG_SITE' environment variable to the location of the site script.
|
||||
A warning: not all `configure' scripts look for a site script.
|
||||
|
||||
Defining Variables
|
||||
==================
|
||||
|
||||
Variables not defined in a site shell script can be set in the
|
||||
environment passed to `configure'. However, some packages may run
|
||||
configure again during the build, and the customized values of these
|
||||
variables may be lost. In order to avoid this problem, you should set
|
||||
them in the `configure' command line, using `VAR=value'. For example:
|
||||
|
||||
./configure CC=/usr/local2/bin/gcc
|
||||
|
||||
causes the specified `gcc' to be used as the C compiler (unless it is
|
||||
overridden in the site shell script).
|
||||
|
||||
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
|
||||
an Autoconf bug. Until the bug is fixed you can use this workaround:
|
||||
|
||||
CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
|
||||
|
||||
`configure' Invocation
|
||||
======================
|
||||
|
||||
`configure' recognizes the following options to control how it
|
||||
operates.
|
||||
|
||||
`--help'
|
||||
`-h'
|
||||
Print a summary of all of the options to `configure', and exit.
|
||||
|
||||
`--help=short'
|
||||
`--help=recursive'
|
||||
Print a summary of the options unique to this package's
|
||||
`configure', and exit. The `short' variant lists options used
|
||||
only in the top level, while the `recursive' variant lists options
|
||||
also present in any nested packages.
|
||||
|
||||
`--version'
|
||||
`-V'
|
||||
Print the version of Autoconf used to generate the `configure'
|
||||
script, and exit.
|
||||
|
||||
`--cache-file=FILE'
|
||||
Enable the cache: use and save the results of the tests in FILE,
|
||||
traditionally `config.cache'. FILE defaults to `/dev/null' to
|
||||
disable caching.
|
||||
|
||||
`--config-cache'
|
||||
`-C'
|
||||
Alias for `--cache-file=config.cache'.
|
||||
|
||||
`--quiet'
|
||||
`--silent'
|
||||
`-q'
|
||||
Do not print messages saying which checks are being made. To
|
||||
suppress all normal output, redirect it to `/dev/null' (any error
|
||||
messages will still be shown).
|
||||
|
||||
`--srcdir=DIR'
|
||||
Look for the package's source code in directory DIR. Usually
|
||||
`configure' can determine that directory automatically.
|
||||
|
||||
`--prefix=DIR'
|
||||
Use DIR as the installation prefix. *note Installation Names::
|
||||
for more details, including other options available for fine-tuning
|
||||
the installation locations.
|
||||
|
||||
`--no-create'
|
||||
`-n'
|
||||
Run the configure checks, but stop before creating any output
|
||||
files.
|
||||
|
||||
`configure' also accepts some other, not widely useful, options. Run
|
||||
`configure --help' for more details.
|
||||
|
||||
103
Makefile.am
103
Makefile.am
@@ -1,17 +1,13 @@
|
||||
##
|
||||
## Copyright (C) 2007 Lasse Collin
|
||||
## Author: Lasse Collin
|
||||
##
|
||||
## This library is free software; you can redistribute it and/or
|
||||
## modify it under the terms of the GNU Lesser General Public
|
||||
## License as published by the Free Software Foundation; either
|
||||
## version 2.1 of the License, or (at your option) any later version.
|
||||
##
|
||||
## This library is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
## Lesser General Public License for more details.
|
||||
## This file has been put into the public domain.
|
||||
## 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 =
|
||||
|
||||
@@ -21,19 +17,94 @@ endif
|
||||
|
||||
SUBDIRS += src po tests
|
||||
|
||||
if COND_DOC
|
||||
dist_doc_DATA = \
|
||||
AUTHORS \
|
||||
COPYING \
|
||||
COPYING.GPLv2 \
|
||||
NEWS \
|
||||
README \
|
||||
THANKS \
|
||||
TODO \
|
||||
doc/faq.txt \
|
||||
doc/history.txt \
|
||||
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 = \
|
||||
m4 \
|
||||
config.rpath \
|
||||
Doxyfile.in \
|
||||
extra \
|
||||
doc \
|
||||
dos \
|
||||
windows \
|
||||
macosx \
|
||||
autogen.sh \
|
||||
Doxyfile.in \
|
||||
COPYING.GPLv2 \
|
||||
COPYING.GPLv3 \
|
||||
COPYING.LGPLv2.1
|
||||
COPYING.LGPLv2.1 \
|
||||
INSTALL.generic \
|
||||
PACKAGERS \
|
||||
build-aux/manconv.sh \
|
||||
build-aux/version.sh
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
# List of man pages to conver to PDF and plain text in the dist-hook target.
|
||||
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 \
|
||||
src/scripts/xzmore.1
|
||||
|
||||
# Create ChangeLog from output of "git log --date=iso --stat".
|
||||
# Convert the man pages to PDF and plain text (ASCII only) formats.
|
||||
dist-hook:
|
||||
if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \
|
||||
( cd "$(srcdir)" && git log --date=iso --stat \
|
||||
b667a3ef6338a2c1db7b7706b1f6c99ea392221c^..HEAD ) \
|
||||
> "$(distdir)/ChangeLog"; \
|
||||
fi
|
||||
if type groff > /dev/null 2>&1 && type ps2pdf > /dev/null 2>&1; then \
|
||||
dest="$(distdir)/doc/man" && \
|
||||
$(MKDIR_P) "$$dest/pdf-a4" "$$dest/pdf-letter" "$$dest/txt" && \
|
||||
for FILE in $(manfiles); do \
|
||||
BASE=`basename $$FILE .1` && \
|
||||
sh "$(srcdir)/build-aux/manconv.sh" pdf a4 \
|
||||
< "$(srcdir)/$$FILE" \
|
||||
> "$$dest/pdf-a4/$$BASE-a4.pdf" && \
|
||||
sh "$(srcdir)/build-aux/manconv.sh" pdf letter \
|
||||
< "$(srcdir)/$$FILE" \
|
||||
> "$$dest/pdf-letter/$$BASE-letter.pdf" && \
|
||||
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
|
||||
|
||||
582
NEWS
582
NEWS
@@ -0,0 +1,582 @@
|
||||
|
||||
XZ Utils Release Notes
|
||||
======================
|
||||
|
||||
5.3.1alpha (2018-04-29)
|
||||
|
||||
* All fixes from 5.2.4.
|
||||
|
||||
* Add lzma_file_info_decoder() into liblzma and use it in xz to
|
||||
implement the --list feature.
|
||||
|
||||
* Capsicum sandbox support is enabled by default where available
|
||||
(FreeBSD >= 10).
|
||||
|
||||
|
||||
5.2.4 (2018-04-29)
|
||||
|
||||
* liblzma:
|
||||
|
||||
- Allow 0 as memory usage limit instead of returning
|
||||
LZMA_PROG_ERROR. Now 0 is treated as if 1 byte was specified,
|
||||
which effectively is the same as 0.
|
||||
|
||||
- Use "noexcept" keyword instead of "throw()" in the public
|
||||
headers when a C++11 (or newer standard) compiler is used.
|
||||
|
||||
- Added a portability fix for recent Intel C Compilers.
|
||||
|
||||
- Microsoft Visual Studio build files have been moved under
|
||||
windows/vs2013 and windows/vs2017.
|
||||
|
||||
* xz:
|
||||
|
||||
- Fix "xz --list --robot missing_or_bad_file.xz" which would
|
||||
try to print an unitialized string and thus produce garbage
|
||||
output. Since the exit status is non-zero, most uses of such
|
||||
a command won't try to interpret the garbage output.
|
||||
|
||||
- "xz --list foo.xz" could print "Internal error (bug)" in a
|
||||
corner case where a specific memory usage limit had been set.
|
||||
|
||||
|
||||
5.2.3 (2016-12-30)
|
||||
|
||||
* xz:
|
||||
|
||||
- Always close a file before trying to delete it to avoid
|
||||
problems on some operating system and file system combinations.
|
||||
|
||||
- Fixed copying of file timestamps on Windows.
|
||||
|
||||
- Added experimental (disabled by default) sandbox support using
|
||||
Capsicum (FreeBSD >= 10). See --enable-sandbox in INSTALL.
|
||||
|
||||
* C99/C11 conformance fixes to liblzma. The issues affected at least
|
||||
some builds using link-time optimizations.
|
||||
|
||||
* Fixed bugs in the rarely-used function lzma_index_dup().
|
||||
|
||||
* Use of external SHA-256 code is now disabled by default.
|
||||
It can still be enabled by passing --enable-external-sha256
|
||||
to configure. The reasons to disable it by default (see INSTALL
|
||||
for more details):
|
||||
|
||||
- Some OS-specific SHA-256 implementations conflict with
|
||||
OpenSSL and cause problems in programs that link against both
|
||||
liblzma and libcrypto. At least FreeBSD 10 and MINIX 3.3.0
|
||||
are affected.
|
||||
|
||||
- The internal SHA-256 is faster than the SHA-256 code in
|
||||
some operating systems.
|
||||
|
||||
* Changed CPU core count detection to use sched_getaffinity() on
|
||||
GNU/Linux and GNU/kFreeBSD.
|
||||
|
||||
* Fixes to the build-system and xz to make xz buildable even when
|
||||
encoders, decoders, or threading have been disabled from libilzma
|
||||
using configure options. These fixes added two new #defines to
|
||||
config.h: HAVE_ENCODERS and HAVE_DECODERS.
|
||||
|
||||
|
||||
5.2.2 (2015-09-29)
|
||||
|
||||
* Fixed bugs in QNX-specific code.
|
||||
|
||||
* Omitted the use of pipe2() even if it is available to avoid
|
||||
portability issues with some old Linux and glibc combinations.
|
||||
|
||||
* Updated German translation.
|
||||
|
||||
* Added project files to build static and shared liblzma (not the
|
||||
whole XZ Utils) with Visual Studio 2013 update 2 or later.
|
||||
|
||||
* Documented that threaded decompression hasn't been implemented
|
||||
yet. A 5.2.0 NEWS entry describing multi-threading support had
|
||||
incorrectly said "decompression" when it should have said
|
||||
"compression".
|
||||
|
||||
|
||||
5.2.1 (2015-02-26)
|
||||
|
||||
* Fixed a compression-ratio regression in fast mode of LZMA1 and
|
||||
LZMA2. The bug is present in 5.1.4beta and 5.2.0 releases.
|
||||
|
||||
* Fixed a portability problem in xz that affected at least OpenBSD.
|
||||
|
||||
* Fixed xzdiff to be compatible with FreeBSD's mktemp which differs
|
||||
from most other mktemp implementations.
|
||||
|
||||
* Changed CPU core count detection to use cpuset_getaffinity() on
|
||||
FreeBSD.
|
||||
|
||||
|
||||
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 compression can be enabled with the
|
||||
--threads (-T) option.
|
||||
[Fixed: This originally said "decompression".]
|
||||
|
||||
- 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.
|
||||
|
||||
|
||||
231
PACKAGERS
Normal file
231
PACKAGERS
Normal file
@@ -0,0 +1,231 @@
|
||||
|
||||
Information to packagers of XZ Utils
|
||||
====================================
|
||||
|
||||
0. Preface
|
||||
1. Package naming
|
||||
2. Package description
|
||||
3. License
|
||||
4. configure options
|
||||
5. Additional documentation
|
||||
6. Extra files
|
||||
7. Installing XZ Utils and LZMA Utils in parallel
|
||||
8. Example
|
||||
|
||||
|
||||
0. Preface
|
||||
----------
|
||||
|
||||
This document is meant for people who create and maintain XZ Utils
|
||||
packages for operating system distributions. The focus is on GNU/Linux
|
||||
systems, but most things apply to other systems too.
|
||||
|
||||
While the standard "configure && make DESTDIR=$PKG install" should
|
||||
give a pretty good package, there are some details which packagers
|
||||
may want to tweak.
|
||||
|
||||
Packagers should also read the INSTALL file.
|
||||
|
||||
|
||||
1. Package naming
|
||||
-----------------
|
||||
|
||||
The preferred name for the XZ Utils package is "xz", because that's
|
||||
the name of the upstream tarball. Naturally you may have good reasons
|
||||
to use some other name; I won't get angry about it. ;-) It's just nice
|
||||
to be able to point people to the correct package name without asking
|
||||
what distro they have.
|
||||
|
||||
If your distro policy is to split things into small pieces, here is
|
||||
one suggestion:
|
||||
|
||||
xz xz, xzdec, scripts (xzdiff, xzgrep, etc.), docs
|
||||
xz-lzma lzma, unlzma, lzcat, lzgrep etc. symlinks and
|
||||
lzmadec binary for compatibility with LZMA Utils
|
||||
liblzma liblzma.so.*
|
||||
liblzma-devel liblzma.so, liblzma.a, API headers
|
||||
|
||||
|
||||
2. Package description
|
||||
----------------------
|
||||
|
||||
Here is a suggestion which you may use as the package description.
|
||||
If you can use only one-line description, pick only the first line.
|
||||
Naturally, feel free to use some other description if you find it
|
||||
better, and maybe send it to me too.
|
||||
|
||||
Library and command line tools for XZ and LZMA compressed files
|
||||
|
||||
XZ Utils provide a general purpose data compression library
|
||||
and 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, of which LZMA2
|
||||
is currently the primary algorithm. With typical files, XZ Utils
|
||||
create about 30 % smaller files than gzip.
|
||||
|
||||
If you are splitting XZ Utils into multiple packages, here are some
|
||||
suggestions for package descriptions:
|
||||
|
||||
xz:
|
||||
|
||||
Command line tools for XZ and LZMA compressed files
|
||||
|
||||
This package includes the xz compression tool and other command
|
||||
line tools from XZ Utils. xz has command line syntax similar to
|
||||
that of gzip. The native file format is the .xz format, but also
|
||||
the legacy .lzma format is supported. The .xz format supports
|
||||
multiple compression algorithms, of which LZMA2 is currently the
|
||||
primary algorithm. With typical files, XZ Utils create about 30 %
|
||||
smaller files than gzip.
|
||||
|
||||
Note that this package doesn't include the files needed for
|
||||
LZMA Utils 4.32.x compatibility. Install also the xz-lzma
|
||||
package to make XZ Utils emulate LZMA Utils 4.32.x.
|
||||
|
||||
xz-lzma:
|
||||
|
||||
LZMA Utils emulation with XZ Utils
|
||||
|
||||
This package includes executables and symlinks to make
|
||||
XZ Utils emulate lzma, unlzma, lzcat, and other command
|
||||
line tools found from the legacy LZMA Utils 4.32.x package.
|
||||
|
||||
liblzma:
|
||||
|
||||
Library for XZ and LZMA compressed files
|
||||
|
||||
liblzma is a general purpose data compression library with
|
||||
an API similar to that of zlib. liblzma supports multiple
|
||||
algorithms, of which LZMA2 is currently the primary algorithm.
|
||||
The native file format is .xz, but also the legacy .lzma
|
||||
format and raw streams (no headers at all) are supported.
|
||||
|
||||
This package includes the shared library.
|
||||
|
||||
liblzma-devel:
|
||||
|
||||
Library for XZ and LZMA compressed files
|
||||
|
||||
This package includes the API headers, static library, and
|
||||
other development files related to liblzma.
|
||||
|
||||
|
||||
3. License
|
||||
----------
|
||||
|
||||
If the package manager supports a license field, you probably should
|
||||
put GPLv2+ there (GNU GPL v2 or later). The interesting parts of
|
||||
XZ Utils are in the public domain, but some less important files
|
||||
ending up into the binary package are under GPLv2+. So it is simplest
|
||||
to just say GPLv2+ if you cannot specify "public domain and GPLv2+".
|
||||
|
||||
If you split XZ Utils into multiple packages as described earlier
|
||||
in this file, liblzma and liblzma-dev packages will contain only
|
||||
public domain code (from XZ Utils at least; compiler or linker may
|
||||
add some third-party code, which may be copyrighted).
|
||||
|
||||
|
||||
4. configure options
|
||||
--------------------
|
||||
|
||||
Unless you are building a package for a distribution that is meant
|
||||
only for embedded systems, don't use the following configure options:
|
||||
|
||||
--enable-debug
|
||||
--enable-encoders (*)
|
||||
--enable-decoders
|
||||
--enable-match-finders
|
||||
--enable-checks
|
||||
--enable-small (*)
|
||||
--disable-threads (*)
|
||||
|
||||
(*) These are OK when building xzdec and lzmadec as described
|
||||
in INSTALL.
|
||||
|
||||
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). 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
|
||||
--------------
|
||||
|
||||
The "extra" directory contains some small extra tools or other files.
|
||||
The exact set of extra files can vary between XZ Utils releases. The
|
||||
extra files have only limited use or they are too dangerous to be
|
||||
put directly to $bindir (7z2lzma.sh is a good example, since it can
|
||||
silently create corrupt output if certain conditions are not met).
|
||||
|
||||
If you feel like it, you may copy the extra directory under the doc
|
||||
directory (e.g. /usr/share/doc/xz/extra). Maybe some people will find
|
||||
them useful. However, most people needing these tools probably are
|
||||
able to find them from the source package too.
|
||||
|
||||
The "debug" directory contains some tools that are useful only when
|
||||
hacking on XZ Utils. Don't package these tools.
|
||||
|
||||
|
||||
7. Installing XZ Utils and LZMA Utils in parallel
|
||||
-------------------------------------------------
|
||||
|
||||
XZ Utils and LZMA Utils 4.32.x can be installed in parallel by
|
||||
omitting the compatibility symlinks (lzma, unlzma, lzcat, lzgrep etc.)
|
||||
from the XZ Utils package. It's probably a good idea to still package
|
||||
the symlinks into a separate package so that users may choose if they
|
||||
want to use XZ Utils or LZMA Utils for handling .lzma files.
|
||||
|
||||
|
||||
8. Example
|
||||
----------
|
||||
|
||||
Here is an example for i686 GNU/Linux that
|
||||
- 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 \
|
||||
--disable-static \
|
||||
--disable-xzdec \
|
||||
--disable-lzmadec \
|
||||
CFLAGS='-march=i686 -mtune=generic -O2'
|
||||
make
|
||||
make DESTDIR=$PKG install-strip
|
||||
make clean
|
||||
./configure \
|
||||
--prefix=/usr \
|
||||
--disable-shared \
|
||||
--disable-nls \
|
||||
--disable-encoders \
|
||||
--enable-small \
|
||||
--disable-threads \
|
||||
CFLAGS='-march=i686 -mtune=generic -Os'
|
||||
make -C src/liblzma
|
||||
make -C src/xzdec
|
||||
make -C src/xzdec DESTDIR=$PKG install-strip
|
||||
cp -a extra $PKG/usr/share/doc/xz
|
||||
|
||||
398
README
398
README
@@ -1,184 +1,308 @@
|
||||
|
||||
LZMA Utils
|
||||
----------
|
||||
XZ Utils
|
||||
========
|
||||
|
||||
Warning
|
||||
|
||||
This is an early alpha version. Don't trust the files produced by
|
||||
this version of the software - not even if the software can
|
||||
uncompress the files properly! This is because the file format
|
||||
isn't completely frozen yet.
|
||||
|
||||
So please test a lot, but don't use for anything serious yet.
|
||||
0. Overview
|
||||
1. Documentation
|
||||
1.1. Overall documentation
|
||||
1.2. Documentation for command-line tools
|
||||
1.3. Documentation for liblzma
|
||||
2. Version numbering
|
||||
3. Reporting bugs
|
||||
4. Translating the xz tool
|
||||
5. Other implementations of the .xz format
|
||||
6. Contact information
|
||||
|
||||
|
||||
Overview
|
||||
0. Overview
|
||||
-----------
|
||||
|
||||
LZMA is a general purporse compression algorithm designed by
|
||||
Igor Pavlov as part of 7-Zip. It provides high compression ratio
|
||||
while keeping the decompression speed fast.
|
||||
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 the
|
||||
context of XZ Utils. The primary filter is currently LZMA2. With
|
||||
typical files, XZ Utils create about 30 % smaller files than gzip.
|
||||
|
||||
LZMA Utils are an attempt to make LZMA compression easy to use
|
||||
on free (as in freedom) operating systems. This is achieved by
|
||||
providing tools and libraries which are similar to use than the
|
||||
equivalents of the most popular existing compression algorithms.
|
||||
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 a command-line syntax similar to that of gzip.
|
||||
|
||||
LZMA Utils consist of a few relatively separate parts:
|
||||
* liblzma is an encoder/decoder library with support for several
|
||||
filters (algorithm implementations). The primary filter is LZMA.
|
||||
* libzfile enables reading from and writing to gzip, bzip2 and
|
||||
LZMA compressed and uncompressed files with an API similar to
|
||||
the standard ANSI-C file I/O.
|
||||
[ NOTE: libzfile is not implemented yet. ]
|
||||
* lzma command line tool has almost identical syntax than gzip
|
||||
and bzip2. It makes LZMA easy for average users, but also
|
||||
provides advanced options to finetune the compression settings.
|
||||
* A few shell scripts make diffing and grepping LZMA compressed
|
||||
files easy. The scripts were adapted from gzip and bzip2.
|
||||
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, the LZMA2 encoder
|
||||
competes with bzip2 in compression speed, RAM usage, and compression
|
||||
ratio.
|
||||
|
||||
LZMA2 is reasonably fast to decompress. It is a little slower than
|
||||
gzip, but a lot faster than bzip2. Being fast to decompress means
|
||||
that the .xz format is especially nice when the same file will be
|
||||
decompressed very many times (usually on different computers), which
|
||||
is the case e.g. when distributing software packages. In such
|
||||
situations, it's not too bad if the compression takes some time,
|
||||
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 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.
|
||||
|
||||
Since the .xz format allows adding new filter IDs, it is possible that
|
||||
some day there will be a filter that is, for example, much faster to
|
||||
compress than LZMA2 (but probably with worse compression ratio).
|
||||
Similarly, it is possible that some day there is a filter that will
|
||||
compress better than LZMA2.
|
||||
|
||||
XZ Utils doesn't support multithreaded compression or decompression
|
||||
yet. It has been planned though and taken into account when designing
|
||||
the .xz file format.
|
||||
|
||||
|
||||
Supported platforms
|
||||
1. Documentation
|
||||
----------------
|
||||
|
||||
LZMA Utils are developed on GNU+Linux, but they should work at
|
||||
least on *BSDs and Solaris. They probably work on some other
|
||||
POSIX-like operating systems too.
|
||||
1.1. Overall documentation
|
||||
|
||||
If you use GCC to compile LZMA Utils, you need at least version
|
||||
3.x.x. GCC version 2.xx.x doesn't support some C99 features used
|
||||
in LZMA Utils source code, thus GCC 2 won't compile LZMA Utils.
|
||||
README This file
|
||||
|
||||
If you have written patches to make LZMA Utils to work on previously
|
||||
unsupported platform, please send the patches to me! I will consider
|
||||
including them to the official version. It's nice to minimize the
|
||||
need of third-party patching.
|
||||
INSTALL.generic Generic install instructions for those not familiar
|
||||
with packages using GNU Autotools
|
||||
INSTALL Installation instructions specific to XZ Utils
|
||||
PACKAGERS Information to packagers of XZ Utils
|
||||
|
||||
One exception: Don't request or send patches to change the whole
|
||||
source package to C89. I find C99 substantially nicer to write and
|
||||
maintain. However, the public library headers must be in C89 to
|
||||
avoid frustrating those who maintain programs, which are strictly
|
||||
in C89 or C++.
|
||||
COPYING XZ Utils copyright and license information
|
||||
COPYING.GPLv2 GNU General Public License version 2
|
||||
COPYING.GPLv3 GNU General Public License version 3
|
||||
COPYING.LGPLv2.1 GNU Lesser General Public License version 2.1
|
||||
|
||||
AUTHORS The main authors of XZ Utils
|
||||
THANKS Incomplete list of people who have helped making
|
||||
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.
|
||||
|
||||
|
||||
Version numbering
|
||||
1.2. Documentation for command-line tools
|
||||
|
||||
Starting from LZMA Utils 5, the version number of LZMA Utils has
|
||||
absolutely nothing to do with the version number of LZMA SDK or
|
||||
7-Zip. The new version number format of LZMA Utils is X.Y.ZS:
|
||||
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
|
||||
whose operating system doesn't provide an easy way to view man pages.
|
||||
|
||||
|
||||
1.3. Documentation for liblzma
|
||||
|
||||
The liblzma API headers include short docs about each function
|
||||
and data type as Doxygen tags. These docs should be quite OK as
|
||||
a quick reference.
|
||||
|
||||
I have planned to write a bunch of very well documented example
|
||||
programs, which (due to comments) should work as a tutorial to
|
||||
various features of liblzma. No such example programs have been
|
||||
written yet.
|
||||
|
||||
For now, if you have never used liblzma, libbzip2, or zlib, I
|
||||
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
|
||||
|
||||
|
||||
2. Version numbering
|
||||
--------------------
|
||||
|
||||
The version number format of XZ Utils is X.Y.ZS:
|
||||
|
||||
- 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.
|
||||
|
||||
|
||||
configure options
|
||||
3. Reporting bugs
|
||||
-----------------
|
||||
|
||||
If you are not familiar with `configure' scripts, read the file
|
||||
INSTALL first.
|
||||
Naturally it is easiest for me if you already know what causes the
|
||||
unexpected behavior. Even better if you have a patch to propose.
|
||||
However, quite often the reason for unexpected behavior is unknown,
|
||||
so here are a few things to do before sending a bug report:
|
||||
|
||||
In most cases, the default --enable/--disable/--with/--without options
|
||||
are what you want. Don't touch them if you are unsure.
|
||||
1. Try to create a small example how to reproduce the issue.
|
||||
|
||||
--disable-encoder
|
||||
Do not compile the encoder component of liblzma. This
|
||||
implies --disable-match-finders. If you need only
|
||||
the decoder, you can decrease the library size
|
||||
dramatically with this option.
|
||||
2. Compile XZ Utils with debugging code using configure switches
|
||||
--enable-debug and, if possible, --disable-shared. If you are
|
||||
using GCC, use CFLAGS='-O0 -ggdb3'. Don't strip the resulting
|
||||
binaries.
|
||||
|
||||
The default is to build the encoder.
|
||||
3. Turn on core dumps. The exact command depends on your shell;
|
||||
for example in GNU bash it is done with "ulimit -c unlimited",
|
||||
and in tcsh with "limit coredumpsize unlimited".
|
||||
|
||||
--disable-decoder
|
||||
Do not compile the decoder component of liblzma.
|
||||
4. Try to reproduce the suspected bug. If you get "assertion failed"
|
||||
message, be sure to include the complete message in your bug
|
||||
report. If the application leaves a coredump, get a backtrace
|
||||
using gdb:
|
||||
$ gdb /path/to/app-binary # Load the app to the debugger.
|
||||
(gdb) core core # Open the coredump.
|
||||
(gdb) bt # Print the backtrace. Copy & paste to bug report.
|
||||
(gdb) quit # Quit gdb.
|
||||
|
||||
The default is to build the decoder.
|
||||
Report your bug via email or IRC (see Contact information below).
|
||||
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 a URL to the file(s) in the bug report.
|
||||
|
||||
--enable-filters=
|
||||
liblzma supports several filters. See liblzma-intro.txt
|
||||
for a little more information about these.
|
||||
|
||||
The default is to build all the filters.
|
||||
|
||||
--enable-match-finders=
|
||||
liblzma includes two categories of match finders:
|
||||
hash chains and binary trees. Hash chains (hc3 and hc4)
|
||||
are quite fast but they don't provide the best compression
|
||||
ratio. Binary trees (bt2, bt3 and bt4) give excellent
|
||||
compression ratio, but they are slower and need more
|
||||
memory than hash chains.
|
||||
|
||||
You need to enable at least one match finder to build the
|
||||
LZMA filter encoder. Usually hash chains are used only in
|
||||
the fast mode, while binary trees are used to when the best
|
||||
compression ratio is wanted.
|
||||
|
||||
The default is to build all the match finders.
|
||||
|
||||
--enable-checks=
|
||||
liblzma support multiple integrity checks. CRC32 is
|
||||
mandatory, and cannot be omitted. See liblzma-intro.txt
|
||||
for more information about usage of the integrity checks.
|
||||
|
||||
--disable-assembler
|
||||
liblzma includes some assembler optimizations. Currently
|
||||
there is only assembler code for CRC32 and CRC64 for
|
||||
32-bit x86.
|
||||
|
||||
All the assembler code in liblzma is position-independent
|
||||
code, which is suitable for use in shared libraries and
|
||||
position-independent executables. So far only i386
|
||||
instructions are used, but the code is optimized for i686
|
||||
class CPUs. If you are compiling liblzma exclusively for
|
||||
pre-i686 systems, you may want to disable the assembler
|
||||
code.
|
||||
|
||||
--enable-small
|
||||
Omits precomputed tables. This makes liblzma a few KiB
|
||||
smaller. Startup time increases, because the tables need
|
||||
to be computed first.
|
||||
|
||||
--enable-debug
|
||||
This enables the assert() macro and possibly some other
|
||||
run-time consistency checks. It slows down things somewhat,
|
||||
so you normally don't want to have this enabled.
|
||||
|
||||
--enable-werror
|
||||
Makes all compiler warnings an error, that abort the
|
||||
compilation. This may help catching bugs, and should work
|
||||
on most systems. This has no effect on the resulting
|
||||
binaries.
|
||||
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"
|
||||
to get the exact snapshot version. If you are using XZ Utils shipped
|
||||
in an operating system distribution, mention the distribution name,
|
||||
distribution version, and exact xz package version; if you cannot
|
||||
repeat the bug with the code compiled from unpatched source code,
|
||||
you probably need to report a bug to your distribution's bug tracking
|
||||
system.
|
||||
|
||||
|
||||
Static vs. dynamic linking of the command line tools
|
||||
4. Translating the xz tool
|
||||
--------------------------
|
||||
|
||||
By default, the command line tools are linked statically against
|
||||
liblzma. There a are a few reasons:
|
||||
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.
|
||||
|
||||
- The executable(s) can be in /bin while the shared liblzma can still
|
||||
be in /usr/lib (if the distro uses such file system hierachy).
|
||||
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.
|
||||
|
||||
- It's easier to copy the executables to other systems, since they
|
||||
depend only on libc.
|
||||
Testing can be done e.g. by installing xz into a temporary directory:
|
||||
|
||||
- It's slightly faster on some architectures like x86.
|
||||
./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
|
||||
|
||||
If you don't like this, you can get the command line tools linked
|
||||
against the shared liblzma by specifying --disable-static to configure.
|
||||
This disables building static liblzma completely.
|
||||
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
|
||||
from the version 9.00alpha.
|
||||
|
||||
http://7-zip.org/
|
||||
http://p7zip.sourceforge.net/
|
||||
|
||||
XZ Embedded is a limited implementation written for use in the Linux
|
||||
kernel, but it is also suitable for other embedded use.
|
||||
|
||||
https://tukaani.org/xz/embedded.html
|
||||
|
||||
|
||||
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).
|
||||
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.
|
||||
|
||||
You can find me also from #tukaani on Freenode; my nick is Larhzu.
|
||||
The channel tends to be pretty quiet, so just ask your question and
|
||||
someone may wake up.
|
||||
|
||||
|
||||
115
THANKS
115
THANKS
@@ -1,26 +1,125 @@
|
||||
|
||||
Thanks
|
||||
------
|
||||
======
|
||||
|
||||
Some people have helped more, some less, some don't even know they have
|
||||
been helpful, but nevertheless everyone's help has been important. :-)
|
||||
In alphabetical order:
|
||||
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
|
||||
- Melanie Blower
|
||||
- Martin Blumenstingl
|
||||
- Ben Boeckel
|
||||
- Jakub Bogusz
|
||||
- Maarten Bosmans
|
||||
- Trent W. Buck
|
||||
- James Buren
|
||||
- David Burklund
|
||||
- Daniel Mealha Cabrita
|
||||
- Milo Casagrande
|
||||
- Marek Černocký
|
||||
- Tomer Chachamu
|
||||
- Gabi Davar
|
||||
- Chris Donawa
|
||||
- Andrew Dudman
|
||||
- Markus Duft
|
||||
- İsmail Dönmez
|
||||
- Jean-loup Gailly
|
||||
- Robert Elz
|
||||
- Gilles Espinasse
|
||||
- Denis Excoffier
|
||||
- Michael Felt
|
||||
- Michael Fox
|
||||
- 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
|
||||
- Eric Lindblad
|
||||
- Lorenzo De Liso
|
||||
- Bela Lubkin
|
||||
- Gregory Margo
|
||||
- Jim Meyering
|
||||
- Arkadiusz Miskiewicz
|
||||
- Conley Moorhous
|
||||
- Rafał Mużyło
|
||||
- Adrien Nader
|
||||
- Evan Nemerson
|
||||
- Hongbo Ni
|
||||
- Jonathan Nieder
|
||||
- Andre Noll
|
||||
- Peter O'Gorman
|
||||
- Peter Pallinger
|
||||
- Rui Paulo
|
||||
- Igor Pavlov
|
||||
- Diego Elio Pettenò
|
||||
- Elbert Pol
|
||||
- Mikko Pouru
|
||||
- Rich Prohaska
|
||||
- Trần Ngọc Quân
|
||||
- Pavel Raiskup
|
||||
- Ole André Vadla Ravnås
|
||||
- Robert Readman
|
||||
- Bernhard Reutner-Fischer
|
||||
- Eric S. Raymond
|
||||
- Cristian Rodríguez
|
||||
- Christian von Roques
|
||||
- Torsten Rupp
|
||||
- Jukka Salmi
|
||||
- Alexandre Sauvé
|
||||
- Julian Seward
|
||||
- Benno Schulenberg
|
||||
- Andreas Schwab
|
||||
- Dan Shechter
|
||||
- Stuart Shelton
|
||||
- Sebastian Andrzej Siewior
|
||||
- Brad Smith
|
||||
- Pippijn van Steenhoven
|
||||
- Jonathan Stott
|
||||
- Dan Stromberg
|
||||
- Vincent Torri
|
||||
- Paul Townsend
|
||||
- Mohammed Adnène Trojette
|
||||
- Alexey Tourbin
|
||||
- Loganaden Velvindron
|
||||
- Patrick J. Volkerding
|
||||
- Martin Väth
|
||||
- Adam Walling
|
||||
- Christian Weisgerber
|
||||
- Bert Wesarg
|
||||
- Fredrik Wikstrom
|
||||
- Jim Wilcoxson
|
||||
- Ralf Wildenhues
|
||||
- Charles Wilson
|
||||
- Lars Wirzenius
|
||||
- Pilorz Wojciech
|
||||
- Ryan Young
|
||||
- Andreas Zieringer
|
||||
|
||||
Also thanks to all the people who have participated the Tukaani project
|
||||
and others who I have forgot.
|
||||
Also thanks to all the people who have participated in the Tukaani project.
|
||||
|
||||
I have probably forgot to add some names to the above list. Sorry about
|
||||
that and thanks for your help.
|
||||
|
||||
|
||||
150
TODO
150
TODO
@@ -1,109 +1,111 @@
|
||||
|
||||
LZMA Utils TODO List
|
||||
--------------------
|
||||
XZ Utils To-Do List
|
||||
===================
|
||||
|
||||
Major missing features
|
||||
Known bugs
|
||||
----------
|
||||
|
||||
Memory limits in the command line tool apply only to compression.
|
||||
The test suite is too incomplete.
|
||||
|
||||
Threading support in the lzma command line tool is still primitive.
|
||||
It cannot split a file in pieces yet.
|
||||
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 --list mode isn't implemented in the command line tool.
|
||||
XZ Utils compress some files significantly worse than LZMA Utils.
|
||||
This is due to faster compression presets used by XZ Utils, and
|
||||
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.
|
||||
|
||||
Handling of Multi-Block Stream information should be separated
|
||||
from Stream encoder and decoder. Those would be useful to implement
|
||||
multi-threaded coding in applications.
|
||||
xz doesn't quote unprintable characters when it displays file names
|
||||
given on the command line.
|
||||
|
||||
Buffer to buffer coding is not implemented in liblzma. Probably
|
||||
a naive version should be written first, which would simply wrap
|
||||
things around lzma_stream. Later, there should be separate buffer
|
||||
coding functions, that are slightly faster (less memcpy()) and
|
||||
have smaller memory usage than the functions using lzma_stream.
|
||||
tuklib_exit() doesn't block signals => EINTR is possible.
|
||||
|
||||
libzfile is not implemented.
|
||||
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).
|
||||
|
||||
LZMA filter doesn't support predefined history buffer.
|
||||
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.
|
||||
|
||||
|
||||
Security
|
||||
Missing features
|
||||
----------------
|
||||
|
||||
Search for bugs, especially security related issues. Security is
|
||||
important in every piece of code in LZMA Utils, but it is extremely
|
||||
important in the decoder part of liblzma.
|
||||
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.
|
||||
|
||||
Subblock: If there is LZMA as a Subfilter but without EOPM, can it
|
||||
trigger infinite loop when Subblock's "Unset Subfilter" flag is hit?
|
||||
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.
|
||||
|
||||
Similarly, can LZ decoder get stuck in infinite loop if the next
|
||||
filter in the chain returns LZMA_STREAM_END but the decoded data
|
||||
doesn't allow finishing the LZ decoding?
|
||||
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.
|
||||
|
||||
Reliability
|
||||
xz doesn't support copying extended attributes, access control
|
||||
lists etc. from source to target file.
|
||||
|
||||
Create a test suite to be run with "make check".
|
||||
Multithreaded compression:
|
||||
- Reduce memory usage of the current method.
|
||||
- Implement threaded match finders.
|
||||
- Implement pigz-style threading in LZMA2.
|
||||
|
||||
Should we use strlimit() and getrlimit() for memory usage limitting?
|
||||
Multithreaded decompression
|
||||
|
||||
Buffer-to-buffer coding could use less RAM (especially when
|
||||
decompressing LZMA1 or LZMA2).
|
||||
|
||||
Performance
|
||||
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.
|
||||
|
||||
Benchmark the CRC code on non-x86 CPUs. Won't have huge effect on
|
||||
overall speed, but it would still be nice to know what algorithm
|
||||
variant is the best on different CPUs.
|
||||
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.
|
||||
|
||||
Third party support
|
||||
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.
|
||||
|
||||
Add support for LZMA to various applications. This naturally requires
|
||||
cooperating with the authors of the specific applications.
|
||||
* GNU grep and GNU diffutils: BSD grep already uses zlib directly
|
||||
instead of ugly shell scripts. It would be nice to get similar
|
||||
feature into relevant GNU tools. With libzfile, multiple
|
||||
compression formats would be easy to support.
|
||||
* kioslave for KDE
|
||||
* Magic for the `file' command
|
||||
* GNU Midnight Commander
|
||||
* GNU Texinfo
|
||||
* The `man' command
|
||||
* Package managers
|
||||
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.
|
||||
|
||||
Test the patches already written. The patches should be sent to
|
||||
upstream developers _once_ LZMA Utils APIs are stable enough (so
|
||||
people don't need to fix those patches all the time).
|
||||
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.
|
||||
|
||||
Mandriva has quite a few patches. Some of them are OK, some need
|
||||
adapting for new LZMA Utils.
|
||||
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
|
||||
-------------
|
||||
|
||||
Revise the man page of lzma command line tool.
|
||||
More tutorial programs are needed for liblzma.
|
||||
|
||||
If the Doxygen docs aren't enough, write good Texinfo manual for
|
||||
liblzma. It's been a long time I've even tried to build the Doxygen
|
||||
docs, so they may look quite bad at the moment.
|
||||
|
||||
Document LZMA as an algorithm. It would be great to have detailed
|
||||
description of the algorithm in English. Many people think, that
|
||||
reading the source code is not the optimal way to learn how LZMA
|
||||
works.
|
||||
Document the LZMA1 and LZMA2 algorithms.
|
||||
|
||||
|
||||
Other
|
||||
Miscellaneous
|
||||
------------
|
||||
|
||||
Some things return LZMA_PROG_ERROR with invalid options, some
|
||||
LZMA_HEADER_ERROR. These must be checked carefully and made so
|
||||
that LZMA_HEADER_ERROR is used only when the given option could
|
||||
make sense in future version of libzma.
|
||||
|
||||
lzma_restrict vs. restrict
|
||||
|
||||
Usage of LZMA_RUN vs. LZMA_FINISH with Metadata coders.
|
||||
|
||||
Port the Deflate implementation from 7-Zip into liblzma. 7-Zip's
|
||||
Deflate compresses better than zlib, gzip or Info-ZIP. I don't
|
||||
know if Deflate will be included in .lzma format (probably not),
|
||||
but it's still useful once we also add support for .gz file format.
|
||||
Try to get the media type for .xz registered at IANA.
|
||||
|
||||
|
||||
52
autogen.sh
52
autogen.sh
@@ -1,38 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Author: Lasse Collin
|
||||
#
|
||||
# This file has been put into the public domain.
|
||||
# You can do whatever you want with this file.
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
# The result of using "autoreconf -fi" should be identical to using this
|
||||
# script. I'm leaving this script here just in case someone finds it useful.
|
||||
|
||||
set -e -x
|
||||
|
||||
# autooint copies all kinds of crap even though we have told in
|
||||
# configure.ac that we don't want the intl directory. It is able
|
||||
# to omit the intl directory but still copies the m4 files needed
|
||||
# only by the stuff in the non-existing intl directory.
|
||||
autopoint -f
|
||||
rm -f \
|
||||
codeset.m4 \
|
||||
glibc2.m4 \
|
||||
glibc21.m4 \
|
||||
intdiv0.m4 \
|
||||
intl.m4 \
|
||||
intldir.m4 \
|
||||
intmax.m4 \
|
||||
inttypes-pri.m4 \
|
||||
inttypes_h.m4 \
|
||||
lcmessage.m4 \
|
||||
lock.m4 \
|
||||
longdouble.m4 \
|
||||
longlong.m4 \
|
||||
printf-posix.m4 \
|
||||
size_max.m4 \
|
||||
stdint_h.m4 \
|
||||
uintmax_t.m4 \
|
||||
ulonglong.m4 \
|
||||
visibility.m4 \
|
||||
wchar_t.m4 \
|
||||
wint_t.m4 \
|
||||
xsize.m4
|
||||
|
||||
libtoolize -c -f || glibtoolize -c -f
|
||||
aclocal -I m4
|
||||
autoconf
|
||||
autoheader
|
||||
automake -acf --foreign
|
||||
${AUTOPOINT:-autopoint} -f
|
||||
${LIBTOOLIZE:-libtoolize} -c -f || glibtoolize -c -f
|
||||
${ACLOCAL:-aclocal} -I m4
|
||||
${AUTOCONF:-autoconf}
|
||||
${AUTOHEADER:-autoheader}
|
||||
${AUTOMAKE:-automake} -acf --foreign
|
||||
|
||||
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
|
||||
24
build-aux/version.sh
Normal file
24
build-aux/version.sh
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Get the version string from version.h and print it out without
|
||||
# trailing newline. This makes it suitable for use in configure.ac.
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Author: Lasse Collin
|
||||
#
|
||||
# This file has been put into the public domain.
|
||||
# You can do whatever you want with this file.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
sed -n 's/LZMA_VERSION_STABILITY_ALPHA/alpha/
|
||||
s/LZMA_VERSION_STABILITY_BETA/beta/
|
||||
s/LZMA_VERSION_STABILITY_STABLE//
|
||||
s/^#define LZMA_VERSION_[MPS][AIT][AJNT][A-Z]* //p' \
|
||||
src/liblzma/api/lzma/version.h \
|
||||
| tr '\n' '|' \
|
||||
| sed 's/|/./; s/|/./; s/|//g' \
|
||||
| tr -d '\r\n'
|
||||
1072
configure.ac
1072
configure.ac
File diff suppressed because it is too large
Load Diff
@@ -1,33 +1,30 @@
|
||||
##
|
||||
## Copyright (C) 2008 Lasse Collin
|
||||
## Author: Lasse Collin
|
||||
##
|
||||
## This library is free software; you can redistribute it and/or
|
||||
## modify it under the terms of the GNU Lesser General Public
|
||||
## License as published by the Free Software Foundation; either
|
||||
## version 2.1 of the License, or (at your option) any later version.
|
||||
##
|
||||
## This library is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
## Lesser General Public License for more details.
|
||||
## This file has been put into the public domain.
|
||||
## You can do whatever you want with this file.
|
||||
##
|
||||
|
||||
EXTRA_DIST = \
|
||||
translation.bash
|
||||
|
||||
noinst_PROGRAMS = \
|
||||
repeat \
|
||||
sync_flush \
|
||||
full_flush \
|
||||
memusage
|
||||
memusage \
|
||||
crc32 \
|
||||
known_sizes \
|
||||
hex2bin
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I@top_srcdir@/src/common \
|
||||
-I@top_srcdir@/src/liblzma/api
|
||||
-I$(top_srcdir)/src/common \
|
||||
-I$(top_srcdir)/src/liblzma/api
|
||||
|
||||
AM_LDFLAGS = -static
|
||||
|
||||
LDADD = \
|
||||
@top_builddir@/src/liblzma/liblzma.la \
|
||||
@LTLIBINTL@
|
||||
LDADD = $(top_builddir)/src/liblzma/liblzma.la
|
||||
|
||||
if COND_GNULIB
|
||||
LDADD += @top_builddir@/lib/libgnu.a
|
||||
LDADD += $(top_builddir)/lib/libgnu.a
|
||||
endif
|
||||
|
||||
LDADD += $(LTLIBINTL)
|
||||
|
||||
@@ -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.
|
||||
|
||||
39
debug/crc32.c
Normal file
39
debug/crc32.c
Normal file
@@ -0,0 +1,39 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file crc32.c
|
||||
/// \brief Primitive CRC32 calculation tool
|
||||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "sysdefs.h"
|
||||
#include "lzma.h"
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
uint32_t crc = 0;
|
||||
|
||||
do {
|
||||
uint8_t buf[BUFSIZ];
|
||||
const size_t size = fread(buf, 1, sizeof(buf), stdin);
|
||||
crc = lzma_crc32(buf, size, crc);
|
||||
} while (!ferror(stdin) && !feof(stdin));
|
||||
|
||||
//printf("%08" PRIX32 "\n", crc);
|
||||
|
||||
// I want it little endian so it's easy to work with hex editor.
|
||||
printf("%02" PRIX32 " ", crc & 0xFF);
|
||||
printf("%02" PRIX32 " ", (crc >> 8) & 0xFF);
|
||||
printf("%02" PRIX32 " ", (crc >> 16) & 0xFF);
|
||||
printf("%02" PRIX32 " ", crc >> 24);
|
||||
printf("\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -3,23 +3,19 @@
|
||||
/// \file full_flush.c
|
||||
/// \brief Encode files using LZMA_FULL_FLUSH
|
||||
//
|
||||
// Copyright (C) 2008 Lasse Collin
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "sysdefs.h"
|
||||
#include "lzma.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#define CHUNK 64
|
||||
|
||||
|
||||
static lzma_stream strm = LZMA_STREAM_INIT;
|
||||
static FILE *file_in;
|
||||
@@ -28,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.
|
||||
@@ -68,28 +63,31 @@ encode(size_t size, lzma_action action)
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
lzma_init_encoder();
|
||||
|
||||
file_in = argc > 1 ? fopen(argv[1], "rb") : stdin;
|
||||
|
||||
|
||||
// Config
|
||||
lzma_options_stream opt_stream = {
|
||||
.check = LZMA_CHECK_CRC32,
|
||||
.has_crc32 = true,
|
||||
.uncompressed_size = LZMA_VLI_VALUE_UNKNOWN,
|
||||
.alignment = 0,
|
||||
};
|
||||
opt_stream.filters[0].id = LZMA_VLI_VALUE_UNKNOWN;
|
||||
opt_stream.metadata_filters[0].id = LZMA_VLI_VALUE_UNKNOWN;
|
||||
opt_stream.header = NULL;
|
||||
opt_stream.footer = NULL;
|
||||
lzma_options_lzma opt_lzma;
|
||||
if (lzma_lzma_preset(&opt_lzma, 1)) {
|
||||
fprintf(stderr, "preset failed\n");
|
||||
exit(1);
|
||||
}
|
||||
lzma_filter filters[LZMA_FILTERS_MAX + 1];
|
||||
filters[0].id = LZMA_FILTER_LZMA2;
|
||||
filters[0].options = &opt_lzma;
|
||||
filters[1].id = LZMA_VLI_UNKNOWN;
|
||||
|
||||
// Init
|
||||
if (lzma_stream_encoder_multi(&strm, &opt_stream) != LZMA_OK) {
|
||||
if (lzma_stream_encoder(&strm, filters, LZMA_CHECK_CRC32) != LZMA_OK) {
|
||||
fprintf(stderr, "init failed\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// if (lzma_easy_encoder(&strm, 1)) {
|
||||
// fprintf(stderr, "init failed\n");
|
||||
// exit(1);
|
||||
// }
|
||||
|
||||
// Encoding
|
||||
encode(0, LZMA_FULL_FLUSH);
|
||||
encode(6, LZMA_FULL_FLUSH);
|
||||
|
||||
53
debug/hex2bin.c
Normal file
53
debug/hex2bin.c
Normal file
@@ -0,0 +1,53 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file hex2bin.c
|
||||
/// \brief Converts hexadecimal input strings to binary
|
||||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "sysdefs.h"
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
|
||||
static int
|
||||
getbin(int x)
|
||||
{
|
||||
if (x >= '0' && x <= '9')
|
||||
return x - '0';
|
||||
|
||||
if (x >= 'A' && x <= 'F')
|
||||
return x - 'A' + 10;
|
||||
|
||||
return x - 'a' + 10;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
while (true) {
|
||||
int byte = getchar();
|
||||
if (byte == EOF)
|
||||
return 0;
|
||||
if (!isxdigit(byte))
|
||||
continue;
|
||||
|
||||
const int digit = getchar();
|
||||
if (digit == EOF || !isxdigit(digit)) {
|
||||
fprintf(stderr, "Invalid input\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
byte = (getbin(byte) << 4) | getbin(digit);
|
||||
if (putchar(byte) == EOF) {
|
||||
perror(NULL);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
129
debug/known_sizes.c
Normal file
129
debug/known_sizes.c
Normal file
@@ -0,0 +1,129 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file known_sizes.c
|
||||
/// \brief Encodes .lzma Stream with sizes known in Block Header
|
||||
///
|
||||
/// The input file is encoded in RAM, and the known Compressed Size
|
||||
/// and/or Uncompressed Size values are stored in the Block Header.
|
||||
/// As of writing there's no such Stream encoder in liblzma.
|
||||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "sysdefs.h"
|
||||
#include "lzma.h"
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/unistd.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
// Support file sizes up to 1 MiB. We use this for output space too, so files
|
||||
// close to 1 MiB had better compress at least a little or we have a buffer
|
||||
// overflow.
|
||||
#define BUFFER_SIZE (1U << 20)
|
||||
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
// Allocate the buffers.
|
||||
uint8_t *in = malloc(BUFFER_SIZE);
|
||||
uint8_t *out = malloc(BUFFER_SIZE);
|
||||
if (in == NULL || out == NULL)
|
||||
return 1;
|
||||
|
||||
// Fill the input buffer.
|
||||
const size_t in_size = fread(in, 1, BUFFER_SIZE, stdin);
|
||||
|
||||
// Filter setup
|
||||
lzma_options_lzma opt_lzma;
|
||||
if (lzma_lzma_preset(&opt_lzma, 1))
|
||||
return 1;
|
||||
|
||||
lzma_filter filters[] = {
|
||||
{
|
||||
.id = LZMA_FILTER_LZMA2,
|
||||
.options = &opt_lzma
|
||||
},
|
||||
{
|
||||
.id = LZMA_VLI_UNKNOWN
|
||||
}
|
||||
};
|
||||
|
||||
lzma_block block = {
|
||||
.check = LZMA_CHECK_CRC32,
|
||||
.compressed_size = BUFFER_SIZE, // Worst case reserve
|
||||
.uncompressed_size = in_size,
|
||||
.filters = filters,
|
||||
};
|
||||
|
||||
lzma_stream strm = LZMA_STREAM_INIT;
|
||||
if (lzma_block_encoder(&strm, &block) != LZMA_OK)
|
||||
return 1;
|
||||
|
||||
// Reserve space for Stream Header and Block Header. We need to
|
||||
// calculate the size of the Block Header first.
|
||||
if (lzma_block_header_size(&block) != LZMA_OK)
|
||||
return 1;
|
||||
|
||||
size_t out_size = LZMA_STREAM_HEADER_SIZE + block.header_size;
|
||||
|
||||
strm.next_in = in;
|
||||
strm.avail_in = in_size;
|
||||
strm.next_out = out + out_size;
|
||||
strm.avail_out = BUFFER_SIZE - out_size;
|
||||
|
||||
if (lzma_code(&strm, LZMA_FINISH) != LZMA_STREAM_END)
|
||||
return 1;
|
||||
|
||||
out_size += strm.total_out;
|
||||
|
||||
if (lzma_block_header_encode(&block, out + LZMA_STREAM_HEADER_SIZE)
|
||||
!= LZMA_OK)
|
||||
return 1;
|
||||
|
||||
lzma_index *idx = lzma_index_init(NULL);
|
||||
if (idx == NULL)
|
||||
return 1;
|
||||
|
||||
if (lzma_index_append(idx, NULL, block.header_size + strm.total_out,
|
||||
strm.total_in) != LZMA_OK)
|
||||
return 1;
|
||||
|
||||
if (lzma_index_encoder(&strm, idx) != LZMA_OK)
|
||||
return 1;
|
||||
|
||||
if (lzma_code(&strm, LZMA_RUN) != LZMA_STREAM_END)
|
||||
return 1;
|
||||
|
||||
out_size += strm.total_out;
|
||||
|
||||
lzma_end(&strm);
|
||||
|
||||
lzma_index_end(idx, NULL);
|
||||
|
||||
// Encode the Stream Header and Stream Footer. backwards_size is
|
||||
// needed only for the Stream Footer.
|
||||
lzma_stream_flags sf = {
|
||||
.backward_size = strm.total_out,
|
||||
.check = block.check,
|
||||
};
|
||||
|
||||
if (lzma_stream_header_encode(&sf, out) != LZMA_OK)
|
||||
return 1;
|
||||
|
||||
if (lzma_stream_footer_encode(&sf, out + out_size) != LZMA_OK)
|
||||
return 1;
|
||||
|
||||
out_size += LZMA_STREAM_HEADER_SIZE;
|
||||
|
||||
// Write out the file.
|
||||
fwrite(out, 1, out_size, stdout);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -2,54 +2,50 @@
|
||||
//
|
||||
/// \file memusage.c
|
||||
/// \brief Calculates memory usage using lzma_memory_usage()
|
||||
///
|
||||
// Copyright (C) 2008 Lasse Collin
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License, or (at your option) any later version.
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "sysdefs.h"
|
||||
#include "lzma.h"
|
||||
#include <stdio.h>
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
|
||||
lzma_options_lzma lzma = {
|
||||
.dictionary_size = (1 << 27) + (1 << 26),
|
||||
.literal_context_bits = 3,
|
||||
.literal_pos_bits = 0,
|
||||
.pos_bits = 2,
|
||||
.preset_dictionary = NULL,
|
||||
.preset_dictionary_size = 0,
|
||||
.mode = LZMA_MODE_BEST,
|
||||
.fast_bytes = 48,
|
||||
.match_finder = LZMA_MF_BT4,
|
||||
.match_finder_cycles = 0,
|
||||
.dict_size = (1U << 30) + (1U << 29),
|
||||
.lc = 3,
|
||||
.lp = 0,
|
||||
.pb = 2,
|
||||
.preset_dict = NULL,
|
||||
.preset_dict_size = 0,
|
||||
.mode = LZMA_MODE_NORMAL,
|
||||
.nice_len = 48,
|
||||
.mf = LZMA_MF_BT4,
|
||||
.depth = 0,
|
||||
};
|
||||
|
||||
/*
|
||||
lzma_options_filter filters[] = {
|
||||
{ LZMA_FILTER_LZMA,
|
||||
{ LZMA_FILTER_LZMA1,
|
||||
(lzma_options_lzma *)&lzma_preset_lzma[6 - 1] },
|
||||
{ UINT64_MAX, NULL }
|
||||
};
|
||||
*/
|
||||
lzma_options_filter filters[] = {
|
||||
{ LZMA_FILTER_LZMA, &lzma },
|
||||
lzma_filter filters[] = {
|
||||
{ LZMA_FILTER_LZMA1, &lzma },
|
||||
{ UINT64_MAX, NULL }
|
||||
};
|
||||
|
||||
printf("%u MiB\n", lzma_memory_usage(filters, true));
|
||||
printf("Encoder: %10" PRIu64 " B\n",
|
||||
lzma_raw_encoder_memusage(filters));
|
||||
printf("Decoder: %10" PRIu64 " B\n",
|
||||
lzma_raw_decoder_memusage(filters));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -7,17 +7,10 @@
|
||||
/// the Subblock filter, especially the condition when repeat count
|
||||
/// doesn't fit into 28-bit integer.
|
||||
//
|
||||
// Copyright (C) 2008 Lasse Collin
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -3,23 +3,19 @@
|
||||
/// \file sync_flush.c
|
||||
/// \brief Encode files using LZMA_SYNC_FLUSH
|
||||
//
|
||||
// Copyright (C) 2008 Lasse Collin
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "sysdefs.h"
|
||||
#include "lzma.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#define CHUNK 64
|
||||
|
||||
|
||||
static lzma_stream strm = LZMA_STREAM_INIT;
|
||||
static FILE *file_in;
|
||||
@@ -28,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.
|
||||
@@ -68,51 +63,32 @@ encode(size_t size, lzma_action action)
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
lzma_init_encoder();
|
||||
|
||||
file_in = argc > 1 ? fopen(argv[1], "rb") : stdin;
|
||||
|
||||
// Config
|
||||
lzma_options_lzma opt_lzma = {
|
||||
.dictionary_size = 1 << 16,
|
||||
.literal_context_bits = LZMA_LITERAL_CONTEXT_BITS_DEFAULT,
|
||||
.literal_pos_bits = LZMA_LITERAL_POS_BITS_DEFAULT,
|
||||
.pos_bits = LZMA_POS_BITS_DEFAULT,
|
||||
.preset_dictionary = NULL,
|
||||
.mode = LZMA_MODE_BEST,
|
||||
.fast_bytes = 32,
|
||||
.match_finder = LZMA_MF_BT3,
|
||||
.match_finder_cycles = 0,
|
||||
.dict_size = 1U << 16,
|
||||
.lc = LZMA_LC_DEFAULT,
|
||||
.lp = LZMA_LP_DEFAULT,
|
||||
.pb = LZMA_PB_DEFAULT,
|
||||
.preset_dict = NULL,
|
||||
.mode = LZMA_MODE_NORMAL,
|
||||
.nice_len = 32,
|
||||
.mf = LZMA_MF_HC3,
|
||||
.depth = 0,
|
||||
};
|
||||
|
||||
lzma_options_delta opt_delta = {
|
||||
.distance = 16
|
||||
.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_LZMA;
|
||||
opt_subblock.subfilter_options.options = &opt_lzma;
|
||||
opt_subblock.subfilter_options.id = LZMA_FILTER_DELTA;
|
||||
opt_subblock.subfilter_options.options = &opt_delta;
|
||||
|
||||
lzma_options_stream opt_stream = {
|
||||
.check = LZMA_CHECK_NONE,
|
||||
.has_crc32 = false,
|
||||
.uncompressed_size = LZMA_VLI_VALUE_UNKNOWN,
|
||||
.alignment = 0,
|
||||
};
|
||||
opt_stream.filters[0].id = LZMA_FILTER_SUBBLOCK;
|
||||
opt_stream.filters[0].options = &opt_subblock;
|
||||
opt_stream.filters[1].id = LZMA_VLI_VALUE_UNKNOWN;
|
||||
lzma_filter filters[LZMA_FILTERS_MAX + 1];
|
||||
filters[0].id = LZMA_FILTER_LZMA2;
|
||||
filters[0].options = &opt_lzma;
|
||||
filters[1].id = LZMA_VLI_UNKNOWN;
|
||||
|
||||
// Init
|
||||
if (lzma_stream_encoder_single(&strm, &opt_stream) != LZMA_OK) {
|
||||
if (lzma_stream_encoder(&strm, filters, LZMA_CHECK_CRC32) != LZMA_OK) {
|
||||
fprintf(stderr, "init failed\n");
|
||||
exit(1);
|
||||
}
|
||||
@@ -121,10 +97,22 @@ main(int argc, char **argv)
|
||||
encode(0, LZMA_SYNC_FLUSH);
|
||||
encode(6, LZMA_SYNC_FLUSH);
|
||||
encode(0, LZMA_SYNC_FLUSH);
|
||||
encode(6, LZMA_SYNC_FLUSH);
|
||||
encode(7, LZMA_SYNC_FLUSH);
|
||||
encode(0, LZMA_SYNC_FLUSH);
|
||||
encode(0, LZMA_FINISH);
|
||||
|
||||
/*
|
||||
encode(53, LZMA_SYNC_FLUSH);
|
||||
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);
|
||||
|
||||
@@ -133,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
|
||||
46
doc/bugs.txt
46
doc/bugs.txt
@@ -1,46 +0,0 @@
|
||||
|
||||
Reporting bugs
|
||||
--------------
|
||||
|
||||
Naturally it is easiest for me if you already know what causes the
|
||||
unexpected behavior. Even better if you have a patch to propose.
|
||||
However, quite often the reason for unexpected behavior is unknown,
|
||||
so below are a few things what to do before sending a bug report.
|
||||
|
||||
In case of a crash (usually segmentation violation):
|
||||
|
||||
1. Try to create a small example how to reprocude the issue.
|
||||
|
||||
2. If you are writing an application using liblzma or libzfile,
|
||||
double check that you are using the libraries correctly (for
|
||||
example, that you didn't forget to call lzma_init()). If it is
|
||||
the command line tool included in LZMA Utils that is crashing,
|
||||
ignore this step.
|
||||
|
||||
3. Compile LZMA Utils with debugging code using configure switch
|
||||
`--enable-debug'. If you are using GCC as the compiler, use
|
||||
CFLAGS='-O0 -ggdb'. Don't strip the resulting binaries.
|
||||
|
||||
4. Turn on core dumps. The exact command depends on your shell;
|
||||
for example in GNU bash it is done with `ulimit -c unlimited',
|
||||
and in tcsh with `limit coredumpsize unlimited'.
|
||||
|
||||
5. Try to reproduce the suspected bug. If you get `assertion failed'
|
||||
message, be sure to include the complete message in your bug
|
||||
report. If the application leaves a coredump, get a backtrace
|
||||
using gdb:
|
||||
$ gdb /path/to/app-binary # Loads the app to the debugger.
|
||||
(gdb) core core # Opens the coredump.
|
||||
(gdb) bt # Prints the backtrace. Copy & paste to bug report.
|
||||
(gdb) quit # Quits gdb.
|
||||
|
||||
Send your bug report to Lasse Collin <lasse.collin@tukaani.org>. Don't
|
||||
send the core dump file or the actual executables. If you have a small
|
||||
example file(s) (total size less than 100 KiB), please include it/them
|
||||
as an attachment.
|
||||
|
||||
Do NOT complain about problems with LZMA Utils to Igor Pavlov.
|
||||
Although the code of LZMA Utils is derived from his code, there are
|
||||
a lot of changes, which may have introduced bugs not present in
|
||||
the original version.
|
||||
|
||||
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_CONCATENATED 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;
|
||||
}
|
||||
206
doc/examples/11_file_info.c
Normal file
206
doc/examples/11_file_info.c
Normal file
@@ -0,0 +1,206 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file 11_file_info.c
|
||||
/// \brief Get uncmopressed size of .xz file(s)
|
||||
///
|
||||
/// Usage: ./11_file_info INFILE1.xz [INFILEn.xz]...
|
||||
///
|
||||
/// Example: ./11_file_info 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 <inttypes.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <lzma.h>
|
||||
|
||||
|
||||
static bool
|
||||
print_file_size(lzma_stream *strm, FILE *infile, const char *filename)
|
||||
{
|
||||
// Get the file size. In standard C it can be done by seeking to
|
||||
// the end of the file and then getting the file position.
|
||||
// In POSIX one can use fstat() and then st_size from struct stat.
|
||||
// Also note that fseek() and ftell() use long and thus don't support
|
||||
// large files on 32-bit systems (POSIX versions fseeko() and
|
||||
// ftello() can support large files).
|
||||
if (fseek(infile, 0, SEEK_END)) {
|
||||
fprintf(stderr, "Error seeking the file `%s': %s\n",
|
||||
filename, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
||||
const long file_size = ftell(infile);
|
||||
|
||||
// The decoder wants to start from the beginning of the .xz file.
|
||||
rewind(infile);
|
||||
|
||||
// Initialize the decoder.
|
||||
lzma_index *i;
|
||||
lzma_ret ret = lzma_file_info_decoder(strm, &i, UINT64_MAX,
|
||||
(uint64_t)file_size);
|
||||
switch (ret) {
|
||||
case LZMA_OK:
|
||||
// Initialization succeeded.
|
||||
break;
|
||||
|
||||
case LZMA_MEM_ERROR:
|
||||
fprintf(stderr, "Out of memory when initializing "
|
||||
"the .xz file info decoder\n");
|
||||
return false;
|
||||
|
||||
case LZMA_PROG_ERROR:
|
||||
default:
|
||||
fprintf(stderr, "Unknown error, possibly a bug\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
// This example program reuses the same lzma_stream structure
|
||||
// for multiple files, so we need to reset this when starting
|
||||
// a new file.
|
||||
strm->avail_in = 0;
|
||||
|
||||
// Buffer for input data.
|
||||
uint8_t inbuf[BUFSIZ];
|
||||
|
||||
// Pass data to the decoder and seek when needed.
|
||||
while (true) {
|
||||
if (strm->avail_in == 0) {
|
||||
strm->next_in = inbuf;
|
||||
strm->avail_in = fread(inbuf, 1, sizeof(inbuf),
|
||||
infile);
|
||||
|
||||
if (ferror(infile)) {
|
||||
fprintf(stderr,
|
||||
"Error reading from `%s': %s\n",
|
||||
filename, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
||||
// We don't need to care about hitting the end of
|
||||
// the file so no need to check for feof().
|
||||
}
|
||||
|
||||
ret = lzma_code(strm, LZMA_RUN);
|
||||
|
||||
switch (ret) {
|
||||
case LZMA_OK:
|
||||
break;
|
||||
|
||||
case LZMA_SEEK_NEEDED:
|
||||
// The cast is safe because liblzma won't ask us to
|
||||
// seek past the known size of the input file which
|
||||
// did fit into a long.
|
||||
//
|
||||
// NOTE: Remember to change these to off_t if you
|
||||
// switch fseeko() or lseek().
|
||||
if (fseek(infile, (long)(strm->seek_pos), SEEK_SET)) {
|
||||
fprintf(stderr, "Error seeking the "
|
||||
"file `%s': %s\n",
|
||||
filename, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
||||
// The old data in the inbuf is useless now. Set
|
||||
// avail_in to zero so that we will read new input
|
||||
// from the new file position on the next iteration
|
||||
// of this loop.
|
||||
strm->avail_in = 0;
|
||||
break;
|
||||
|
||||
case LZMA_STREAM_END:
|
||||
// File information was successfully decoded.
|
||||
// See <lzma/index.h> for functions that can be
|
||||
// used on it. In this example we just print
|
||||
// the uncompressed size (in bytes) of
|
||||
// the .xz file followed by its file name.
|
||||
printf("%10" PRIu64 " %s\n",
|
||||
lzma_index_uncompressed_size(i),
|
||||
filename);
|
||||
|
||||
// Free the memory of the lzma_index structure.
|
||||
lzma_index_end(i, NULL);
|
||||
|
||||
return true;
|
||||
|
||||
case LZMA_FORMAT_ERROR:
|
||||
// .xz magic bytes weren't found.
|
||||
fprintf(stderr, "The file `%s' is not "
|
||||
"in the .xz format\n", filename);
|
||||
return false;
|
||||
|
||||
case LZMA_OPTIONS_ERROR:
|
||||
fprintf(stderr, "The file `%s' has .xz headers that "
|
||||
"are not supported by this liblzma "
|
||||
"version\n", filename);
|
||||
return false;
|
||||
|
||||
case LZMA_DATA_ERROR:
|
||||
fprintf(stderr, "The file `%s' is corrupt\n",
|
||||
filename);
|
||||
return false;
|
||||
|
||||
case LZMA_MEM_ERROR:
|
||||
fprintf(stderr, "Memory allocation failed when "
|
||||
"decoding the file `%s'\n", filename);
|
||||
return false;
|
||||
|
||||
// LZMA_MEMLIMIT_ERROR shouldn't happen because we used
|
||||
// UINT64_MAX as the limit.
|
||||
//
|
||||
// LZMA_BUF_ERROR shouldn't happen because we always provide
|
||||
// new input when the input buffer is empty. The decoder
|
||||
// knows the input file size and thus won't try to read past
|
||||
// the end of the file.
|
||||
case LZMA_MEMLIMIT_ERROR:
|
||||
case LZMA_BUF_ERROR:
|
||||
case LZMA_PROG_ERROR:
|
||||
default:
|
||||
fprintf(stderr, "Unknown error, possibly a bug\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// This line is never reached.
|
||||
}
|
||||
|
||||
|
||||
extern int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
bool success = true;
|
||||
lzma_stream strm = LZMA_STREAM_INIT;
|
||||
|
||||
for (int i = 1; i < argc; ++i) {
|
||||
FILE *infile = fopen(argv[i], "rb");
|
||||
|
||||
if (infile == NULL) {
|
||||
fprintf(stderr, "Cannot open the file `%s': %s\n",
|
||||
argv[i], strerror(errno));
|
||||
success = false;
|
||||
}
|
||||
|
||||
success &= print_file_size(&strm, infile, argv[i]);
|
||||
|
||||
(void)fclose(infile);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
25
doc/examples/Makefile
Normal file
25
doc/examples/Makefile
Normal file
@@ -0,0 +1,25 @@
|
||||
#
|
||||
# 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 \
|
||||
11_file_info
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
353
doc/faq.txt
353
doc/faq.txt
@@ -1,247 +1,224 @@
|
||||
|
||||
LZMA Utils FAQ
|
||||
--------------
|
||||
XZ Utils FAQ
|
||||
============
|
||||
|
||||
Copyright (C) 2007 Lasse Collin
|
||||
Q: What do the letters XZ mean?
|
||||
|
||||
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.
|
||||
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 has no deeper meaning.
|
||||
|
||||
|
||||
Q: What are LZMA, LZMA Utils, lzma, .lzma, liblzma, LZMA SDK, LZMA_Alone,
|
||||
7-Zip and p7zip?
|
||||
Q: What are LZMA and LZMA2?
|
||||
|
||||
A: LZMA stands for Lempel-Ziv-Markov chain-Algorithm. LZMA is the name
|
||||
of the compression algorithm designed by Igor Pavlov. He is the author
|
||||
of 7-Zip, which is a great LGPL'd compression tool for Microsoft
|
||||
Windows operating systems. In addition to 7-Zip itself, also LZMA SDK
|
||||
is available on the website of 7-Zip. LZMA SDK contains LZMA
|
||||
implementations in C++, Java and C#. The C++ version is the original
|
||||
implementation which is used also in 7-Zip itself.
|
||||
A: LZMA stands for Lempel-Ziv-Markov chain-Algorithm. It is the name
|
||||
of the compression algorithm designed by Igor Pavlov for 7-Zip.
|
||||
LZMA is based on LZ77 and range encoding.
|
||||
|
||||
Excluding the unrar plugin, 7-Zip is free software (free as in
|
||||
freedom). Thanks to this, it was possible to port it to POSIX
|
||||
platforms. The port was done and is maintained by myspace (TODO:
|
||||
myspace's real name?). p7zip is a port of 7-Zip's command line version;
|
||||
p7zip doesn't include the 7-Zip's GUI.
|
||||
|
||||
In POSIX world, users are used to gzip and bzip2 command line tools.
|
||||
Developers know APIs of zlib and libbzip2. LZMA Utils try to ease
|
||||
adoption of LZMA on free operating systems by providing a compression
|
||||
library and a set of command line tools. The library is called liblzma.
|
||||
It provides a zlib-like API making it easy to adapt LZMA compression in
|
||||
existing applications. The main command line tool is known as lzma,
|
||||
whose command line syntax is very similar to that of gzip and bzip2.
|
||||
|
||||
The original command line tool from LZMA SDK (lzma.exe) was found from
|
||||
a directory called LZMA_Alone in the LZMA SDK. It used a simple header
|
||||
format in .lzma files. This format was also used by LZMA Utils up to
|
||||
and including 4.32.x. In LZMA Utils documentation, LZMA_Alone refers
|
||||
to both the file format and the command line tool from LZMA SDK.
|
||||
|
||||
Because of various limitations of the LZMA_Alone file format, a new
|
||||
file format was developed. Extending some existing format such as .gz
|
||||
used by gzip was considered, but these formats were found to be too
|
||||
limited. The filename suffix for the new .lzma format is `.lzma'. The
|
||||
same suffix is also used for files in the LZMA_Alone format. To make
|
||||
the transition to the new format as transparent as possible, LZMA Utils
|
||||
support both the new and old formats transparently.
|
||||
|
||||
7-Zip and LZMA SDK: <http://7-zip.org/>
|
||||
p7zip: <http://p7zip.sourceforge.net/>
|
||||
LZMA Utils: <http://tukaani.org/lzma/>
|
||||
LZMA2 is an updated version of the original LZMA to fix a couple of
|
||||
practical issues. In context of XZ Utils, LZMA is called LZMA1 to
|
||||
emphasize that LZMA is not the same thing as LZMA2. LZMA2 is the
|
||||
primary compression algorithm in the .xz file format.
|
||||
|
||||
|
||||
Q: What LZMA implementations there are available?
|
||||
Q: There are many LZMA related projects. How does XZ Utils relate to them?
|
||||
|
||||
A: LZMA SDK contains implementations in C++, Java and C#. The C++ version
|
||||
is the original implementation which is part of 7-Zip. LZMA SDK
|
||||
contains also a small LZMA decoder in C.
|
||||
A: 7-Zip and LZMA SDK are the original projects. LZMA SDK is roughly
|
||||
a subset of the 7-Zip source tree.
|
||||
|
||||
A port of LZMA SDK to Pascal was made by Alan Birtles
|
||||
<http://www.birtles.org.uk/programming/>. It should work with
|
||||
multiple Pascal programming language implementations.
|
||||
p7zip is 7-Zip's command-line tools ported to POSIX-like systems.
|
||||
|
||||
LZMA Utils includes liblzma, which is directly based on LZMA SDK.
|
||||
liblzma is written in C (C99, not C89). In contrast to C++ callback
|
||||
API used by LZMA SDK, liblzma uses zlib-like stateful C API. I do not
|
||||
want to comment whether both/former/latter/neither API(s) are good or
|
||||
bad. The only reason to implement a zlib-like API was, that many
|
||||
developers are already familiar with zlib, and very many applications
|
||||
already use zlib. Having a similar API makes it easier to include LZMA
|
||||
support in existing applications.
|
||||
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.
|
||||
|
||||
See also <http://en.wikipedia.org/wiki/LZMA#External_links>.
|
||||
There are several other projects using LZMA. Most are more or less
|
||||
based on LZMA SDK. See <http://7-zip.org/links.html>.
|
||||
|
||||
|
||||
Q: Which file formats are supported by LZMA Utils?
|
||||
Q: Why is liblzma named liblzma if its primary file format is .xz?
|
||||
Shouldn't it be e.g. libxz?
|
||||
|
||||
A: Even when the raw LZMA stream is always the same, it can be wrapped
|
||||
in different container formats. The preferred format is the new .lzma
|
||||
format. It has magic bytes (the first six bytes: 0xFF 'L' 'Z' 'M'
|
||||
'A' 0x00). The format supports chaining up to seven filters filters,
|
||||
splitting data to multiple blocks for easier multi-threading and rough
|
||||
random-access reading. The file integrity is verified using CRC32,
|
||||
CRC64, or SHA256, and by verifying the uncompressed size of the file.
|
||||
|
||||
LZMA SDK includes a tool called LZMA_Alone. It supports uses a
|
||||
primitive header which includes only the mandatory stream information
|
||||
required by the LZMA decoder. This format can be both read and
|
||||
written by liblzma and the command line tool (use --format=alone to
|
||||
create such files).
|
||||
|
||||
.7z is the native archive format used by 7-Zip. This format is not
|
||||
supported by liblzma, and probably will never be supported. You
|
||||
should use e.g. p7zip to extract .7z files.
|
||||
|
||||
It is possible to implement custom file formats by using raw filter
|
||||
mode in liblzma. In this mode the application needs to store the filter
|
||||
properties and provide them to liblzma before starting to uncompress
|
||||
the data.
|
||||
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: How can I identify files containing LZMA compressed data?
|
||||
Q: Do XZ Utils support the .7z format?
|
||||
|
||||
A: The preferred filename suffix for .lzma files is `.lzma'. `.tar.lzma'
|
||||
may be abbreviated to `.tlz'. The same suffixes are used for files in
|
||||
LZMA_Alone format. In practice this should be no problem since tools
|
||||
included in LZMA Utils support both formats transparently.
|
||||
|
||||
Checking the magic bytes is easy way to detect files in the new .lzma
|
||||
format (the first six bytes: 0xFF 'L' 'Z' 'M' 'A' 0x00). The "file"
|
||||
command version FIXME contains magic strings for this format.
|
||||
|
||||
The old LZMA_Alone format has no magic bytes. Its header cannot contain
|
||||
arbitrary bytes, thus it is possible to make a guess. Unfortunately the
|
||||
guessing is usually too hard to be reliable, so don't try it unless you
|
||||
are desperate.
|
||||
A: No. Use 7-Zip (Windows) or p7zip (POSIX-like systems) to handle .7z
|
||||
files.
|
||||
|
||||
|
||||
Q: Does the lzma command line tool support sparse files?
|
||||
Q: I have many .tar.7z files. Can I convert them to .tar.xz without
|
||||
spending hours recompressing the data?
|
||||
|
||||
A: Sparse files can (of course) be compressed like normal files, but
|
||||
uncompression will not restore sparseness of the file. Use an archiver
|
||||
tool to take care of sparseness before compressing the data with lzma.
|
||||
|
||||
The reason for this is that archiver tools handle files, while
|
||||
compression tools handle streams or buffers. Being a sparse file is
|
||||
a property of the file on the disk, not a property of the stream or
|
||||
buffer.
|
||||
A: In the "extra" directory, there is a script named 7z2lzma.bash which
|
||||
is able to convert some .7z files to the .lzma format (not .xz). It
|
||||
needs the 7za (or 7z) command from p7zip. The script may silently
|
||||
produce corrupt output if certain assumptions are not met, so
|
||||
decompress the resulting .lzma file and compare it against the
|
||||
original before deleting the original file!
|
||||
|
||||
|
||||
Q: Can I recover parts of a broken LZMA file (e.g. corrupted CD-R)?
|
||||
Q: I have many .lzma files. Can I quickly convert them to the .xz format?
|
||||
|
||||
A: With LZMA_Alone and single-block .lzma files, you can uncompress the
|
||||
file until you hit the first broken byte. The data after the broken
|
||||
position is lost. LZMA relies on the uncompression history, and if
|
||||
bytes are missing in the middle of the file, it is impossible to
|
||||
reliably continue after the broken section.
|
||||
A: For now, no. Since XZ Utils supports the .lzma format, it's usually
|
||||
not too bad to keep the old files in the old format. If you want to
|
||||
do the conversion anyway, you need to decompress the .lzma files and
|
||||
then recompress to the .xz format.
|
||||
|
||||
With multi-block .lzma files it may be possible to locale the next
|
||||
block in the file and continue decoding there. A limited recovery
|
||||
tool for this kind of situations is planned.
|
||||
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 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: Is LZMA patented?
|
||||
Q: I have installed xz, but my tar doesn't recognize .tar.xz files.
|
||||
How can I extract .tar.xz files?
|
||||
|
||||
A: No, the authors are not aware of any patents that could affect LZMA.
|
||||
However, due to nature of software patents, the authors cannot
|
||||
guarantee, that LZMA isn't affected by any third party patent.
|
||||
A: xz -dc foo.tar.xz | tar xf -
|
||||
|
||||
|
||||
Q: Where can I find documentation about how LZMA works as an algorithm?
|
||||
Q: Can I recover parts of a broken .xz file (e.g. a corrupted CD-R)?
|
||||
|
||||
A: Read the source code, Luke. There is no documentation about LZMA
|
||||
internals. It is possible that Igor Pavlov is the only person on
|
||||
the Earth that completely knows and understands the algorithm.
|
||||
|
||||
You could begin by downloading LZMA SDK, and start reading from
|
||||
the LZMA decoder to get some idea about the bitstream format.
|
||||
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.
|
||||
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
|
||||
mode. There is no recovery program yet.
|
||||
|
||||
|
||||
Q: What are filters?
|
||||
Q: Is (some part of) XZ Utils patented?
|
||||
|
||||
A: In context of .lzma files, a filter means an implementation of a
|
||||
compression algorithm. The primary filter is LZMA, which is why
|
||||
the names of the tools contain the letters LZMA.
|
||||
A: Lasse Collin is not aware of any patents that could affect XZ Utils.
|
||||
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).
|
||||
|
||||
liblzma and the new .lzma format support also other filters than LZMA.
|
||||
There are different types of filters, which are suitable for different
|
||||
types of data. Thus, to select the optimal filter and settings, the
|
||||
type of the input data being compressed needs to be known.
|
||||
|
||||
Some filters are most useful when combined with another filter like
|
||||
LZMA. These filters increase redundancy in the data, without changing
|
||||
the size of the data, by taking advantage of properties specific to
|
||||
the data being compressed.
|
||||
Q: Where can I find documentation about the file format and algorithms?
|
||||
|
||||
So far, all the filters are always reversible. That is, no matter what
|
||||
data you pass to a filter encoder, it can be always defiltered back to
|
||||
the original form. Because of this, it is safe to compress for example
|
||||
a software package that contains other file types than executables
|
||||
using a filter specific to the architechture of the package being
|
||||
compressed.
|
||||
A: The .xz format is documented in xz-file-format.txt. It is a container
|
||||
format only, and doesn't include descriptions of any non-trivial
|
||||
filters.
|
||||
|
||||
The old LZMA_Alone format supports only the LZMA filter.
|
||||
Documenting LZMA and LZMA2 is planned, but for now, there is no other
|
||||
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.
|
||||
|
||||
|
||||
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: Can I use LZMA in proprietary, non-free applications?
|
||||
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: liblzma is under the GNU LGPL version 2.1 or (at your opinion) any
|
||||
later version. To summarise (*NOTE* This summary is not legally
|
||||
binding, that is, it doesn't give you any extra permissions compared
|
||||
to the LGPL. Read the GNU LGPL carefully for the exact license
|
||||
conditions.):
|
||||
* All the changes made into the library itself must be published
|
||||
under the same license.
|
||||
* End users must be able to replace the used liblzma. Easiest way
|
||||
to assure this is to link dynamically against liblzma so users
|
||||
can replace the shared library file if they want.
|
||||
* You must make it clear to your users, that your application uses
|
||||
liblzma, and that liblzma is free software under the GNU LGPL.
|
||||
A copy of GNU LGPL must be included.
|
||||
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:
|
||||
|
||||
LZMA SDK contains a special exception which allows linking *unmodified*
|
||||
code statically with a non-free application. This exception does *not*
|
||||
apply to liblzma.
|
||||
XZ_DEFAULTS=--memlimit-compress=150MiB
|
||||
export XZ_DEFAULTS
|
||||
|
||||
As an alternative, you can support the development of LZMA and 7-Zip
|
||||
by buying a proprietary license from Igor Pavlov. See homepage of
|
||||
LZMA SDK <http://7-zip.org/sdk.html> for more information. Note that
|
||||
having a proprietary license from Igor Pavlov doesn't allow you to use
|
||||
liblzma in a way that contradicts with the GNU LGPL, because liblzma
|
||||
contains code that is not copyrighted by Igor Pavlov. Please contact
|
||||
both Lasse Collin and Igor Pavlov if the license conditions of liblzma
|
||||
are not suitable for you.
|
||||
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: I would like to help. What can I do?
|
||||
Q: How do I create files that can be decompressed with XZ Embedded?
|
||||
|
||||
A: See the TODO file. Please contact Lasse Collin before starting to do
|
||||
anything, because it is possible that someone else is already working
|
||||
on the same thing.
|
||||
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: How can I contact the authors?
|
||||
Q: Will xz support threaded compression?
|
||||
|
||||
A: Lasse Collin is the maintainer of LZMA Utils. You can contact him
|
||||
either via IRC (Larhzu on #tukaani at Freenode or IRCnet). Email
|
||||
should work too, <lasse.collin@tukaani.org>.
|
||||
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.
|
||||
|
||||
Igor Pavlov is the father of LZMA. He is the author of 7-Zip
|
||||
and LZMA SDK. <http://7-zip.org/>
|
||||
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.
|
||||
|
||||
NOTE: Please don't bother Igor Pavlov with questions specific
|
||||
to LZMA Utils.
|
||||
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)?
|
||||
|
||||
A: liblzmadec is part of LZMA Utils. XZ Utils has liblzma, but no
|
||||
liblzmadec. The code using liblzmadec should be ported to use
|
||||
liblzma instead. If you cannot or don't want to do that, download
|
||||
LZMA Utils from <https://tukaani.org/lzma/>.
|
||||
|
||||
|
||||
Q: The default build of liblzma is too big. How can I make it smaller?
|
||||
|
||||
A: Give --enable-small to the configure script. Use also appropriate
|
||||
--enable or --disable options to include only those filter encoders
|
||||
and decoders and integrity checks that you actually need. Use
|
||||
CFLAGS=-Os (with GCC) or equivalent to tell your compiler to optimize
|
||||
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 significantly
|
||||
smaller XZ decoder implementation than XZ Utils. You can find it
|
||||
at <https://tukaani.org/xz/embedded.html>.
|
||||
|
||||
|
||||
1861
doc/file-format.txt
1861
doc/file-format.txt
File diff suppressed because it is too large
Load Diff
162
doc/history.txt
162
doc/history.txt
@@ -1,24 +1,24 @@
|
||||
|
||||
LZMA Utils history
|
||||
------------------
|
||||
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
|
||||
compressed packages was .tlz, being an abbreviation of .tar.lzma.
|
||||
|
||||
At the end of the year 2007, there's no distribution under the Tukaani
|
||||
project anymore. Development of LZMA Utils still continues. Still,
|
||||
there are .tlz packages around, because at least Vector Linux (a
|
||||
Slackware based distribution) uses LZMA for its packages.
|
||||
At the end of the year 2007, there was no distribution under the
|
||||
Tukaani project anymore, but development of LZMA Utils was kept going.
|
||||
Still, there were .tlz packages around, because at least Vector Linux
|
||||
(a Slackware based distribution) used LZMA for its packages.
|
||||
|
||||
First versions of the modified pkgtools used the LZMA_Alone tool from
|
||||
Igor Pavlov's LZMA SDK as is. It was fine, because users wouldn't need
|
||||
@@ -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,93 +48,103 @@ 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
|
||||
Lasse wrote liblzmadec, which was a small decoder-only library based
|
||||
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 (roughly two years), the 4.32.x branch had to be
|
||||
kept maintained. It got some bug fixes now and then, and finally it was
|
||||
delayed considerably (3-4 years), the 4.32.x branch had to be kept
|
||||
maintained. It got some bug fixes now and then, and finally it was
|
||||
decided to call it stable, although most of the missing features were
|
||||
never added.
|
||||
|
||||
|
||||
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, Mark Adler and Mikko Pouru. Designing the new format
|
||||
took quite a long time. It was mostly because Lasse was quite slow at
|
||||
getting things done due to personal reasons.
|
||||
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 a time would be a more appropriate expression). It was mostly
|
||||
because Lasse was quite slow at getting things done due to personal
|
||||
reasons.
|
||||
|
||||
Near the end of the year 2007 the new format was practically finished.
|
||||
Compared to LZMA_Alone format and the .gz format used by gzip, the new
|
||||
.lzma format is quite complex as a whole. This means that tools having
|
||||
*full* support for the new format would be larger and more complex than
|
||||
the tools supporting only the old LZMA_Alone format.
|
||||
Originally the new format was supposed to use the same .lzma suffix
|
||||
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
|
||||
such a long time, the old format got quite popular, and it was decided
|
||||
that the new file format must use a different suffix.
|
||||
|
||||
For the situations where the full support for the .lzma format wouldn't
|
||||
be required (embedded systems, operating system kernels), the new
|
||||
format has a well-defined subset, which is easy to support with small
|
||||
amount of code. It wouldn't be as small as an implementation using the
|
||||
LZMA_Alone format, but the difference shouldn't be significant.
|
||||
It was decided to use .xz as the suffix of the new file format. The
|
||||
first stable .xz file format specification was finally released in
|
||||
December 2008. In addition to fixing the most obvious problems of
|
||||
the old .lzma format, the .xz format added some new features like
|
||||
support for multiple filters (compression algorithms), filter chaining
|
||||
(like piping on the command line), and limited random-access reading.
|
||||
|
||||
The new .lzma format allows dividing the data in multiple independent
|
||||
blocks, which can be compressed and uncompressed independenly. This
|
||||
makes multi-threading possible with algorithms that aren't inherently
|
||||
parallel (such as LZMA). There's also a central index of the sizes of
|
||||
the blocks, which makes it possible to do limited random-access reading
|
||||
with granularity of the block size.
|
||||
|
||||
The new .lzma format uses the same filename suffix that was used for
|
||||
LZMA_Alone files. The advantage is that users using the new tools won't
|
||||
notice the change to the new format. The disadvantage is that the old
|
||||
tools won't work with the new files.
|
||||
Currently the primary compression algorithm used in .xz is LZMA2.
|
||||
It is an extension on top of the original LZMA to fix some practical
|
||||
problems: LZMA2 adds support for flushing the encoder, uncompressed
|
||||
chunks, eases stateful decoder implementations, and improves support
|
||||
for multithreading. Since LZMA2 is better than the original LZMA, the
|
||||
original LZMA is not supported in .xz.
|
||||
|
||||
|
||||
Third generation
|
||||
Transition to XZ Utils
|
||||
|
||||
LZMA Utils 4.42.0alphas drop the rest of the C++ LZMA SDK. The LZMA and
|
||||
other included filters (algorithm implementations) are still directly
|
||||
based on LZMA SDK, but ported to C.
|
||||
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 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.
|
||||
|
||||
liblzma is now the core of LZMA Utils. It has zlib-like API, which
|
||||
doesn't suffer from the problems of the API of liblzmadec. liblzma
|
||||
supports not only LZMA, but several other filters, which together
|
||||
can improve compression ratio even further with certain file types.
|
||||
The core of the new LZMA Utils was liblzma, a compression library with
|
||||
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 lzma and lzmadec command line tools have been rewritten. They uses
|
||||
liblzma to do the actual compressing or uncompressing.
|
||||
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
|
||||
library retained its name though, because changing it would have
|
||||
caused unnecessary breakage in applications already using the early
|
||||
liblzma snapshots.
|
||||
|
||||
The development of LZMA Utils 4.42.x is still in alpha stage. Several
|
||||
features are still missing or don't fully work yet. Documentation is
|
||||
also very minimal.
|
||||
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
|
||||
format is more or less deprecated. XZ Utils will keep supporting it,
|
||||
but new applications should use the .xz format, and migrating old
|
||||
applications to .xz is often a good idea too.
|
||||
|
||||
|
||||
@@ -1,324 +0,0 @@
|
||||
|
||||
Advanced features of liblzma
|
||||
----------------------------
|
||||
|
||||
0. Introduction
|
||||
|
||||
Most developers need only the basic features of liblzma. These
|
||||
features allow single-threaded encoding and decoding of .lzma files
|
||||
in streamed mode.
|
||||
|
||||
In some cases developers want more. The .lzma file format is
|
||||
designed to allow multi-threaded encoding and decoding and limited
|
||||
random-access reading. These features are possible in non-streamed
|
||||
mode and limitedly also in streamed mode.
|
||||
|
||||
To take advange of these features, the application needs a custom
|
||||
.lzma file format handler. liblzma provides a set of tools to ease
|
||||
this task, but it's still quite a bit of work to get a good custom
|
||||
.lzma handler done.
|
||||
|
||||
|
||||
1. Where to begin
|
||||
|
||||
Start by reading the .lzma file format specification. Understanding
|
||||
the basics of the .lzma file structure is required to implement a
|
||||
custom .lzma file handler and to understand the rest of this document.
|
||||
|
||||
|
||||
2. The basic components
|
||||
|
||||
2.1. Stream Header and tail
|
||||
|
||||
Stream Header begins the .lzma Stream and Stream tail ends it. Stream
|
||||
Header is defined in the file format specification, but Stream tail
|
||||
isn't (thus I write "tail" with a lower-case letter). Stream tail is
|
||||
simply the Stream Flags and the Footer Magic Bytes fields together.
|
||||
It was done this way in liblzma, because the Block coders take care
|
||||
of the rest of the stuff in the Stream Footer.
|
||||
|
||||
For now, the size of Stream Header is fixed to 11 bytes. The header
|
||||
<lzma/stream_flags.h> defines LZMA_STREAM_HEADER_SIZE, which you
|
||||
should use instead of a hardcoded number. Similarly, Stream tail
|
||||
is fixed to 3 bytes, and there is a constant LZMA_STREAM_TAIL_SIZE.
|
||||
|
||||
It is possible, that a future version of the .lzma format will have
|
||||
variable-sized Stream Header and tail. As of writing, this seems so
|
||||
unlikely though, that it was considered simplest to just use a
|
||||
constant instead of providing a functions to get and store the sizes
|
||||
of the Stream Header and tail.
|
||||
|
||||
|
||||
2.x. Stream tail
|
||||
|
||||
For now, the size of Stream tail is fixed to 3 bytes. The header
|
||||
<lzma/stream_flags.h> defines LZMA_STREAM_TAIL_SIZE, which you
|
||||
should use instead of a hardcoded number.
|
||||
|
||||
|
||||
3. Keeping track of size information
|
||||
|
||||
The lzma_info_* functions found from <lzma/info.h> should ease the
|
||||
task of keeping track of sizes of the Blocks and also the Stream
|
||||
as a whole. Using these functions is strongly recommended, because
|
||||
there are surprisingly many situations where an error can occur,
|
||||
and these functions check for possible errors every time some new
|
||||
information becomes available.
|
||||
|
||||
If you find lzma_info_* functions lacking something that you would
|
||||
find useful, please contact the author.
|
||||
|
||||
|
||||
3.1. Start offset of the Stream
|
||||
|
||||
If you are storing the .lzma Stream inside anothe file format, or
|
||||
for some other reason are placing the .lzma Stream to somewhere
|
||||
else than to the beginning of the file, you should tell the starting
|
||||
offset of the Stream using lzma_info_start_offset_set().
|
||||
|
||||
The start offset of the Stream is used for two distinct purporses.
|
||||
First, knowing the start offset of the Stream allows
|
||||
lzma_info_alignment_get() to correctly calculate the alignment of
|
||||
every Block. This information is given to the Block encoder, which
|
||||
will calculate the size of Header Padding so that Compressed Data
|
||||
is alignment at an optimal offset.
|
||||
|
||||
Another use for start offset of the Stream is in random-access
|
||||
reading. If you set the start offset of the Stream, lzma_info_locate()
|
||||
will be able to calculate the offset relative to the beginning of the
|
||||
file containing the Stream (instead of offset relative to the
|
||||
beginning of the Stream).
|
||||
|
||||
|
||||
3.2. Size of Stream Header
|
||||
|
||||
While the size of Stream Header is constant (11 bytes) in the current
|
||||
version of the .lzma file format, this may change in future.
|
||||
|
||||
|
||||
3.3. Size of Header Metadata Block
|
||||
|
||||
This information is needed when doing random-access reading, and
|
||||
to verify the value of this field stored in Footer Metadata Block.
|
||||
|
||||
|
||||
3.4. Total Size of the Data Blocks
|
||||
|
||||
|
||||
3.5. Uncompressed Size of Data Blocks
|
||||
|
||||
|
||||
3.6. Index
|
||||
|
||||
|
||||
|
||||
|
||||
x. Alignment
|
||||
|
||||
There are a few slightly different types of alignment issues when
|
||||
working with .lzma files.
|
||||
|
||||
The .lzma format doesn't strictly require any kind of alignment.
|
||||
However, if the encoder carefully optimizes the alignment in all
|
||||
situations, it can improve compression ratio, speed of the encoder
|
||||
and decoder, and slightly help if the files get damaged and need
|
||||
recovery.
|
||||
|
||||
Alignment has the most significant effect compression ratio FIXME
|
||||
|
||||
|
||||
x.1. Compression ratio
|
||||
|
||||
Some filters take advantage of the alignment of the input data.
|
||||
To get the best compression ratio, make sure that you feed these
|
||||
filters correctly aligned data.
|
||||
|
||||
Some filters (e.g. LZMA) don't necessarily mind too much if the
|
||||
input doesn't match the preferred alignment. With these filters
|
||||
the penalty in compression ratio depends on the specific type of
|
||||
data being compressed.
|
||||
|
||||
Other filters (e.g. PowerPC executable filter) won't work at all
|
||||
with data that is improperly aligned. While the data can still
|
||||
be de-filtered back to its original form, the benefit of the
|
||||
filtering (better compression ratio) is completely lost, because
|
||||
these filters expect certain patterns at properly aligned offsets.
|
||||
The compression ratio may even worse with incorrectly aligned input
|
||||
than without the filter.
|
||||
|
||||
|
||||
x.1.1. Inter-filter alignment
|
||||
|
||||
When there are multiple filters chained, checking the alignment can
|
||||
be useful not only with the input of the first filter and output of
|
||||
the last filter, but also between the filters.
|
||||
|
||||
Inter-filter alignment important especially with the Subblock filter.
|
||||
|
||||
|
||||
x.1.2. Further compression with external tools
|
||||
|
||||
This is relatively rare situation in practice, but still worth
|
||||
understanding.
|
||||
|
||||
Let's say that there are several SPARC executables, which are each
|
||||
filtered to separate .lzma files using only the SPARC filter. If
|
||||
Uncompressed Size is written to the Block Header, the size of Block
|
||||
Header may vary between the .lzma files. If no Padding is used in
|
||||
the Block Header to correct the alignment, the starting offset of
|
||||
the Compressed Data field will be differently aligned in different
|
||||
.lzma files.
|
||||
|
||||
All these .lzma files are archived into a single .tar archive. Due
|
||||
to nature of the .tar format, every file is aligned inside the
|
||||
archive to an offset that is a multiple of 512 bytes.
|
||||
|
||||
The .tar archive is compressed into a new .lzma file using the LZMA
|
||||
filter with options, that prefer input alignment of four bytes. Now
|
||||
if the independent .lzma files don't have the same alignment of
|
||||
the Compressed Data fields, the LZMA filter will be unable to take
|
||||
advantage of the input alignment between the files in the .tar
|
||||
archive, which reduces compression ratio.
|
||||
|
||||
Thus, even if you have only single Block per file, it can be good for
|
||||
compression ratio to align the Compressed Data to optimal offset.
|
||||
|
||||
|
||||
x.2. Speed
|
||||
|
||||
Most modern computers are faster when multi-byte data is located
|
||||
at aligned offsets in RAM. Proper alignment of the Compressed Data
|
||||
fields can slightly increase the speed of some filters.
|
||||
|
||||
|
||||
x.3. Recovery
|
||||
|
||||
Aligning every Block Header to start at an offset with big enough
|
||||
alignment may ease or at least speed up recovery of broken files.
|
||||
|
||||
|
||||
y. Typical usage cases
|
||||
|
||||
y.x. Parsing the Stream backwards
|
||||
|
||||
You may need to parse the Stream backwards if you need to get
|
||||
information such as the sizes of the Stream, Index, or Extra.
|
||||
The basic procedure to do this follows.
|
||||
|
||||
Locate the end of the Stream. If the Stream is stored as is in a
|
||||
standalone .lzma file, simply seek to the end of the file and start
|
||||
reading backwards using appropriate buffer size. The file format
|
||||
specification allows arbitrary amount of Footer Padding (zero or more
|
||||
NUL bytes), which you skip before trying to decode the Stream tail.
|
||||
|
||||
Once you have located the end of the Stream (a non-NULL byte), make
|
||||
sure you have at least the last LZMA_STREAM_TAIL_SIZE bytes of the
|
||||
Stream in a buffer. If there isn't enough bytes left from the file,
|
||||
the file is too small to contain a valid Stream. Decode the Stream
|
||||
tail using lzma_stream_tail_decoder(). Store the offset of the first
|
||||
byte of the Stream tail; you will need it later.
|
||||
|
||||
You may now want to do some internal verifications e.g. if the Check
|
||||
type is supported by the liblzma build you are using.
|
||||
|
||||
Decode the Backward Size field with lzma_vli_reverse_decode(). The
|
||||
field is at maximum of LZMA_VLI_BYTES_MAX bytes long. Check that
|
||||
Backward Size is not zero. Store the offset of the first byte of
|
||||
the Backward Size; you will need it later.
|
||||
|
||||
Now you know the Total Size of the last Block of the Stream. It's the
|
||||
value of Backward Size plus the size of the Backward Size field. Note
|
||||
that you cannot use lzma_vli_size() to calculate the size since there
|
||||
might be padding; you need to use the real observed size of the
|
||||
Backward Size field.
|
||||
|
||||
At this point, the operation continues differently for Single-Block
|
||||
and Multi-Block Streams.
|
||||
|
||||
|
||||
y.x.1. Single-Block Stream
|
||||
|
||||
There might be Uncompressed Size field present in the Stream Footer.
|
||||
You cannot know it for sure unless you have already parsed the Block
|
||||
Header earlier. For security reasons, you probably want to try to
|
||||
decode the Uncompressed Size field, but you must not indicate any
|
||||
error if decoding fails. Later you can give the decoded Uncompressed
|
||||
Size to Block decoder if Uncopmressed Size isn't otherwise known;
|
||||
this prevents it from producing too much output in case of (possibly
|
||||
intentionally) corrupt file.
|
||||
|
||||
Calculate the the start offset of the Stream:
|
||||
|
||||
backward_offset - backward_size - LZMA_STREAM_HEADER_SIZE
|
||||
|
||||
backward_offset is the offset of the first byte of the Backward Size
|
||||
field. Remember to check for integer overflows, which can occur with
|
||||
invalid input files.
|
||||
|
||||
Seek to the beginning of the Stream. Decode the Stream Header using
|
||||
lzma_stream_header_decoder(). Verify that the decoded Stream Flags
|
||||
match the values found from Stream tail. You can use the
|
||||
lzma_stream_flags_is_equal() macro for this.
|
||||
|
||||
Decode the Block Header. Verify that it isn't a Metadata Block, since
|
||||
Single-Block Streams cannot have Metadata. If Uncompressed Size is
|
||||
present in the Block Header, the value you tried to decode from the
|
||||
Stream Footer must be ignored, since Uncompressed Size wasn't actually
|
||||
present there. If Block Header doesn't have Uncompressed Size, and
|
||||
decoding the Uncompressed Size field from the Stream Footer failed,
|
||||
the file is corrupt.
|
||||
|
||||
If you were only looking for the Uncompressed Size of the Stream,
|
||||
you now got that information, and you can stop processing the Stream.
|
||||
|
||||
To decode the Block, the same instructions apply as described in
|
||||
FIXME. However, because you have some extra known information decoded
|
||||
from the Stream Footer, you should give this information to the Block
|
||||
decoder so that it can verify it while decoding:
|
||||
- If Uncompressed Size is not present in the Block Header, set
|
||||
lzma_options_block.uncompressed_size to the value you decoded
|
||||
from the Stream Footer.
|
||||
- Always set lzma_options_block.total_size to backward_size +
|
||||
size_of_backward_size (you calculated this sum earlier already).
|
||||
|
||||
|
||||
y.x.2. Multi-Block Stream
|
||||
|
||||
Calculate the start offset of the Footer Metadata Block:
|
||||
|
||||
backward_offset - backward_size
|
||||
|
||||
backward_offset is the offset of the first byte of the Backward Size
|
||||
field. Remember to check for integer overflows, which can occur with
|
||||
broken input files.
|
||||
|
||||
Decode the Block Header. Verify that it is a Metadata Block. Set
|
||||
lzma_options_block.total_size to backward_size + size_of_backward_size
|
||||
(you calculated this sum earlier already). Then decode the Footer
|
||||
Metadata Block.
|
||||
|
||||
Store the decoded Footer Metadata to lzma_info structure using
|
||||
lzma_info_set_metadata(). Set also the offset of the Backward Size
|
||||
field using lzma_info_size_set(). Then you can get the start offset
|
||||
of the Stream using lzma_info_size_get(). Note that any of these steps
|
||||
may fail so don't omit error checking.
|
||||
|
||||
Seek to the beginning of the Stream. Decode the Stream Header using
|
||||
lzma_stream_header_decoder(). Verify that the decoded Stream Flags
|
||||
match the values found from Stream tail. You can use the
|
||||
lzma_stream_flags_is_equal() macro for this.
|
||||
|
||||
If you were only looking for the Uncompressed Size of the Stream,
|
||||
it's possible that you already have it now. If Uncompressed Size (or
|
||||
whatever information you were looking for) isn't available yet,
|
||||
continue by decoding also the Header Metadata Block. (If some
|
||||
information is missing, the Header Metadata Block has to be present.)
|
||||
|
||||
Decoding the Data Blocks goes the same way as described in FIXME.
|
||||
|
||||
|
||||
y.x.3. Variations
|
||||
|
||||
If you know the offset of the beginning of the Stream, you may want
|
||||
to parse the Stream Header before parsing the Stream tail.
|
||||
|
||||
@@ -1,112 +0,0 @@
|
||||
|
||||
Hacking liblzma
|
||||
---------------
|
||||
|
||||
0. Preface
|
||||
|
||||
This document gives some overall information about the internals of
|
||||
liblzma, which should make it easier to start reading and modifying
|
||||
the code.
|
||||
|
||||
|
||||
1. Programming language
|
||||
|
||||
liblzma was written in C99. If you use GCC, this means that you need
|
||||
at least GCC 3.x.x. GCC 2 isn't and won't be supported.
|
||||
|
||||
Some GCC-specific extensions are used *conditionally*. They aren't
|
||||
required to build a full-featured library. Don't make the code rely
|
||||
on any non-standard compiler extensions or even C99 features that
|
||||
aren't portable between almost-C99 compatible compilers (for example
|
||||
non-static inlines).
|
||||
|
||||
The public API headers are in C89. This is to avoid frustrating those
|
||||
who maintain programs, which are strictly in C89 or C++.
|
||||
|
||||
An assumption about sizeof(size_t) is made. If this assumption is
|
||||
wrong, some porting is probably needed:
|
||||
|
||||
sizeof(uint32_t) <= sizeof(size_t) <= sizeof(uint64_t)
|
||||
|
||||
|
||||
2. Internal vs. external API
|
||||
|
||||
|
||||
|
||||
Input Output
|
||||
v Application ^
|
||||
| liblzma public API |
|
||||
| Stream coder |
|
||||
| Block coder |
|
||||
| Filter coder |
|
||||
| ... |
|
||||
v Filter coder ^
|
||||
|
||||
|
||||
Application
|
||||
`-- liblzma public API
|
||||
`-- Stream coder
|
||||
|-- Stream info handler
|
||||
|-- Stream Header coder
|
||||
|-- Block Header coder
|
||||
| `-- Filter Flags coder
|
||||
|-- Metadata coder
|
||||
| `-- Block coder
|
||||
| `-- Filter 0
|
||||
| `-- Filter 1
|
||||
| ...
|
||||
|-- Data Block coder
|
||||
| `-- Filter 0
|
||||
| `-- Filter 1
|
||||
| ...
|
||||
`-- Stream tail coder
|
||||
|
||||
|
||||
|
||||
x. Designing new filters
|
||||
|
||||
All filters must be designed so that the decoder cannot consume
|
||||
arbitrary amount input without producing any decoded output. Failing
|
||||
to follow this rule makes liblzma vulnerable to DoS attacks if
|
||||
untrusted files are decoded (usually they are untrusted).
|
||||
|
||||
An example should clarify the reason behind this requirement: There
|
||||
are two filters in the chain. The decoder of the first filter produces
|
||||
huge amount of output (many gigabytes or more) with a few bytes of
|
||||
input, which gets passed to the decoder of the second filter. If the
|
||||
data passed to the second filter is interpreted as something that
|
||||
produces no output (e.g. padding), the filter chain as a whole
|
||||
produces no output and consumes no input for a long period of time.
|
||||
|
||||
The above problem was present in the first versions of the Subblock
|
||||
filter. A tiny .lzma file could have taken several years to decode
|
||||
while it wouldn't produce any output at all. The problem was fixed
|
||||
by adding limits for number of consecutive Padding bytes, and requiring
|
||||
that some decoded output must be produced between Set Subfilter and
|
||||
Unset Subfilter.
|
||||
|
||||
|
||||
x. Implementing new filters
|
||||
|
||||
If the filter supports embedding End of Payload Marker, make sure that
|
||||
when your filter detects End of Payload Marker,
|
||||
- the usage of End of Payload Marker is actually allowed (i.e. End
|
||||
of Input isn't used); and
|
||||
- it also checks that there is no more input coming from the next
|
||||
filter in the chain.
|
||||
|
||||
The second requirement is slightly tricky. It's possible that the next
|
||||
filter hasn't returned LZMA_STREAM_END yet. It may even need a few
|
||||
bytes more input before it will do so. You need to give it as much
|
||||
input as it needs, and verify that it doesn't produce any output.
|
||||
|
||||
Don't call the next filter in the chain after it has returned
|
||||
LZMA_STREAM_END (except in encoder if action == LZMA_SYNC_FLUSH).
|
||||
It will result undefined behavior.
|
||||
|
||||
Be pedantic. If the input data isn't exactly valid, reject it.
|
||||
|
||||
At the moment, liblzma isn't modular. You will need to edit several
|
||||
files in src/liblzma/common to include support for a new filter. grep
|
||||
for LZMA_FILTER_LZMA to locate the files needing changes.
|
||||
|
||||
@@ -1,194 +0,0 @@
|
||||
|
||||
Introduction to liblzma
|
||||
-----------------------
|
||||
|
||||
Writing applications to work with liblzma
|
||||
|
||||
liblzma API is split in several subheaders to improve readability and
|
||||
maintainance. The subheaders must not be #included directly. lzma.h
|
||||
requires that certain integer types and macros are available when
|
||||
the header is #included. On systems that have inttypes.h that conforms
|
||||
to C99, the following will work:
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <inttypes.h>
|
||||
#include <lzma.h>
|
||||
|
||||
Those who have used zlib should find liblzma's API easy to use.
|
||||
To developers who haven't used zlib before, I recommend learning
|
||||
zlib first, because zlib has excellent documentation.
|
||||
|
||||
While the API is similar to that of zlib, there are some major
|
||||
differences, which are summarized below.
|
||||
|
||||
For basic stream encoding, zlib has three functions (deflateInit(),
|
||||
deflate(), and deflateEnd()). Similarly, there are three functions
|
||||
for stream decoding (inflateInit(), inflate(), and inflateEnd()).
|
||||
liblzma has only single coding and ending function. Thus, to
|
||||
encode one may use, for example, lzma_stream_encoder_single(),
|
||||
lzma_code(), and lzma_end(). Simlarly for decoding, one may
|
||||
use lzma_auto_decoder(), lzma_code(), and lzma_end().
|
||||
|
||||
zlib has deflateReset() and inflateReset() to reset the stream
|
||||
structure without reallocating all the memory. In liblzma, all
|
||||
coder initialization functions are like zlib's reset functions:
|
||||
the first-time initializations are done with the same functions
|
||||
as the reinitializations (resetting).
|
||||
|
||||
To make all this work, liblzma needs to know when lzma_stream
|
||||
doesn't already point to an allocated and initialized coder.
|
||||
This is achieved by initializing lzma_stream structure with
|
||||
LZMA_STREAM_INIT (static initialization) or LZMA_STREAM_INIT_VAR
|
||||
(for exampple when new lzma_stream has been allocated with malloc()).
|
||||
This initialization should be done exactly once per lzma_stream
|
||||
structure to avoid leaking memory. Calling lzma_end() will leave
|
||||
lzma_stream into a state comparable to the state achieved with
|
||||
LZMA_STREAM_INIT and LZMA_STREAM_INIT_VAR.
|
||||
|
||||
Example probably clarifies a lot. With zlib, compression goes
|
||||
roughly like this:
|
||||
|
||||
z_stream strm;
|
||||
deflateInit(&strm, level);
|
||||
deflate(&strm, Z_RUN);
|
||||
deflate(&strm, Z_RUN);
|
||||
...
|
||||
deflate(&strm, Z_FINISH);
|
||||
deflateEnd(&strm) or deflateReset(&strm)
|
||||
|
||||
With liblzma, it's slightly different:
|
||||
|
||||
lzma_stream strm = LZMA_STREAM_INIT;
|
||||
lzma_stream_encoder_single(&strm, &options);
|
||||
lzma_code(&strm, LZMA_RUN);
|
||||
lzma_code(&strm, LZMA_RUN);
|
||||
...
|
||||
lzma_code(&strm, LZMA_FINISH);
|
||||
lzma_end(&strm) or reinitialize for new coding work
|
||||
|
||||
Reinitialization in the last step can be any function that can
|
||||
initialize lzma_stream; it doesn't need to be the same function
|
||||
that was used for the previous initialization. If it is the same
|
||||
function, liblzma will usually be able to re-use most of the
|
||||
existing memory allocations (depends on how much the initialization
|
||||
options change). If you reinitialize with different function,
|
||||
liblzma will automatically free the memory of the previous coder.
|
||||
|
||||
|
||||
File formats
|
||||
|
||||
liblzma supports multiple container formats for the compressed data.
|
||||
Different initialization functions initialize the lzma_stream to
|
||||
process different container formats. See the details from the public
|
||||
header files.
|
||||
|
||||
The following functions are the most commonly used:
|
||||
|
||||
- lzma_stream_encoder_single(): Encodes Single-Block Stream; this
|
||||
the recommended format for most purporses.
|
||||
|
||||
- lzma_alone_encoder(): Useful if you need to encode into the
|
||||
legacy LZMA_Alone format.
|
||||
|
||||
- lzma_auto_decoder(): Decoder that automatically detects the
|
||||
file format; recommended when you decode compressed files on
|
||||
disk, because this way compatibility with the legacy LZMA_Alone
|
||||
format is transparent.
|
||||
|
||||
- lzma_stream_decoder(): Decoder for Single- and Multi-Block
|
||||
Streams; this is good if you want to accept only .lzma Streams.
|
||||
|
||||
|
||||
Filters
|
||||
|
||||
liblzma supports multiple filters (algorithm implementations). The new
|
||||
.lzma format supports filter-chain having up to seven filters. In the
|
||||
filter chain, the output of one filter is input of the next filter in
|
||||
the chain. The legacy LZMA_Alone format supports only one filter, and
|
||||
that must always be LZMA.
|
||||
|
||||
General-purporse compression:
|
||||
|
||||
LZMA The main algorithm of liblzma (surprise!)
|
||||
|
||||
Branch/Call/Jump filters for executables:
|
||||
|
||||
x86 This filter is known as BCJ in 7-Zip
|
||||
IA64 IA-64 (Itanium)
|
||||
PowerPC Big endian PowerPC
|
||||
ARM
|
||||
ARM-Thumb
|
||||
SPARC
|
||||
|
||||
Other filters:
|
||||
|
||||
Copy Dummy filter that simply copies all the data
|
||||
from input to output.
|
||||
|
||||
Subblock Multi-purporse filter, that can
|
||||
- embed End of Payload Marker if the previous
|
||||
filter in the chain doesn't support it; and
|
||||
- apply Subfilters, which filter only part
|
||||
of the same compressed Block in the Stream.
|
||||
|
||||
Branch/Call/Jump filters never change the size of the data. They
|
||||
should usually be used as a pre-filter for some compression filter
|
||||
like LZMA.
|
||||
|
||||
|
||||
Integrity checks
|
||||
|
||||
The .lzma Stream format uses CRC32 as the integrity check for
|
||||
different file format headers. It is possible to omit CRC32 from
|
||||
the Block Headers, but not from Stream Header. This is the reason
|
||||
why CRC32 code cannot be disabled when building liblzma (in addition,
|
||||
the LZMA encoder uses CRC32 for hashing, so that's another reason).
|
||||
|
||||
The integrity check of the actual data is calculated from the
|
||||
uncompressed data. This check can be CRC32, CRC64, or SHA256.
|
||||
It can also be omitted completely, although that usually is not
|
||||
a good thing to do. There are free IDs left, so support for new
|
||||
checks algorithms can be added later.
|
||||
|
||||
|
||||
API and ABI stability
|
||||
|
||||
The API and ABI of liblzma isn't stable yet, although no huge
|
||||
changes should happen. One potential place for change is the
|
||||
lzma_options_subblock structure.
|
||||
|
||||
In the 4.42.0alpha phase, the shared library version number won't
|
||||
be updated even if ABI breaks. I don't want to track the ABI changes
|
||||
yet. Just rebuild everything when you upgrade liblzma until we get
|
||||
to the beta stage.
|
||||
|
||||
|
||||
Size of the library
|
||||
|
||||
While liblzma isn't huge, it is quite far from the smallest possible
|
||||
LZMA implementation: full liblzma binary (with support for all
|
||||
filters and other features) is way over 100 KiB, but the plain raw
|
||||
LZMA decoder is only 5-10 KiB.
|
||||
|
||||
To decrease the size of the library, you can omit parts of the library
|
||||
by passing certain options to the `configure' script. Disabling
|
||||
everything but the decoders of the require filters will usually give
|
||||
you a small enough library, but if you need a decoder for example
|
||||
embedded in the operating system kernel, the code from liblzma probably
|
||||
isn't suitable as is.
|
||||
|
||||
If you need a minimal implementation supporting .lzma Streams, you
|
||||
may need to do partial rewrite. liblzma uses stateful API like zlib.
|
||||
That increases the size of the library. Using callback API or even
|
||||
simpler buffer-to-buffer API would allow smaller implementation.
|
||||
|
||||
LZMA SDK contains smaller LZMA decoder written in ANSI-C than
|
||||
liblzma, so you may want to take a look at that code. However,
|
||||
it doesn't (at least not yet) support the new .lzma Stream format.
|
||||
|
||||
|
||||
Documentation
|
||||
|
||||
There's no other documentation than the public headers and this
|
||||
text yet. Real docs will be written some day, I hope.
|
||||
|
||||
@@ -1,219 +0,0 @@
|
||||
|
||||
Using liblzma securely
|
||||
----------------------
|
||||
|
||||
0. Introduction
|
||||
|
||||
This document discusses how to use liblzma securely. There are issues
|
||||
that don't apply to zlib or libbzip2, so reading this document is
|
||||
strongly recommended even for those who are very familiar with zlib
|
||||
or libbzip2.
|
||||
|
||||
While making liblzma itself as secure as possible is essential, it's
|
||||
out of scope of this document.
|
||||
|
||||
|
||||
1. Memory usage
|
||||
|
||||
The memory usage of liblzma varies a lot.
|
||||
|
||||
|
||||
1.1. Problem sources
|
||||
|
||||
1.1.1. Block coder
|
||||
|
||||
The memory requirements of Block encoder depend on the used filters
|
||||
and their settings. The memory requirements of the Block decoder
|
||||
depend on the which filters and with which filter settings the Block
|
||||
was encoded. Usually the memory requirements of a decoder are equal
|
||||
or less than the requirements of the encoder with the same settings.
|
||||
|
||||
While the typical memory requirements to decode a Block is from a few
|
||||
hundred kilobytes to tens of megabytes, a maliciously constructed
|
||||
files can require a lot more RAM to decode. With the current filters,
|
||||
the maximum amount is about 7 GiB. If you use multi-threaded decoding,
|
||||
every Block can require this amount of RAM, thus a four-threaded
|
||||
decoder could suddenly try to allocate 28 GiB of RAM.
|
||||
|
||||
If you don't limit the maximum memory usage in any way, and there are
|
||||
no resource limits set on the operating system side, one malicious
|
||||
input file can run the system out of memory, or at least make it swap
|
||||
badly for a long time. This is exceptionally bad on servers e.g.
|
||||
email server doing virus scanning on incoming messages.
|
||||
|
||||
|
||||
1.1.2. Metadata decoder
|
||||
|
||||
Multi-Block .lzma files contain at least one Metadata Block.
|
||||
Externally the Metadata Blocks are similar to Data Blocks, so all
|
||||
the issues mentioned about memory usage of Data Blocks applies to
|
||||
Metadata Blocks too.
|
||||
|
||||
The uncompressed content of Metadata Blocks contain information about
|
||||
the Stream as a whole, and optionally some Extra Records. The
|
||||
information about the Stream is kept in liblzma's internal data
|
||||
structures in RAM. Extra Records can contain arbitrary data. They are
|
||||
not interpreted by liblzma, but liblzma will provide them to the
|
||||
application in uninterpreted form if the application wishes so.
|
||||
|
||||
Usually the Uncompressed Size of a Metadata Block is small. Even on
|
||||
extreme cases, it shouldn't be much bigger than a few megabytes. Once
|
||||
the Metadata has been parsed into native data structures in liblzma,
|
||||
it usually takes a little more memory than in the encoded form. For
|
||||
all normal files, this is no problem, since the resulting memory usage
|
||||
won't be too much.
|
||||
|
||||
The problem is that a maliciously constructed Metadata Block can
|
||||
contain huge amount of "information", which liblzma will try to store
|
||||
in its internal data structures. This may cause liblzma to allocate
|
||||
all the available RAM unless some kind of resource usage limits are
|
||||
applied.
|
||||
|
||||
Note that the Extra Records in Metadata are always parsed but, but
|
||||
memory is allocated for them only if the application has requested
|
||||
liblzma to provide the Extra Records to the application.
|
||||
|
||||
|
||||
1.2. Solutions
|
||||
|
||||
If you need to decode files from untrusted sources (most people do),
|
||||
you must limit the memory usage to avoid denial of service (DoS)
|
||||
conditions caused by malicious input files.
|
||||
|
||||
The first step is to find out how much memory you are allowed consume
|
||||
at maximum. This may be a hardcoded constant or derived from the
|
||||
available RAM; whatever is appropriate in the application.
|
||||
|
||||
The simplest solution is to use setrlimit() if the kernel supports
|
||||
RLIMIT_AS, which limits the memory usage of the whole process.
|
||||
For more portable and fine-grained limitting, you can use
|
||||
memory limitter functions found from <lzma/memlimit.h>.
|
||||
|
||||
|
||||
1.2.1. Encoder
|
||||
|
||||
lzma_memory_usage() will give you a rough estimate about the memory
|
||||
usage of the given filter chain. To dramatically simplify the internal
|
||||
implementation, this function doesn't take into account all the small
|
||||
helper data structures needed in various places; only the structures
|
||||
with significant memory usage are taken into account. Still, the
|
||||
accuracy of this function should be well within a mebibyte.
|
||||
|
||||
The Subblock filter is a special case. If a Subfilter has been
|
||||
specified, it isn't taken into account when lzma_memory_usage()
|
||||
calculates the memory usage. You need to calculate the memory usage
|
||||
of the Subfilter separately.
|
||||
|
||||
Keeping track of Blocks in a Multi-Block Stream takes a few dozen
|
||||
bytes of RAM per Block (size of the lzma_index structure plus overhead
|
||||
of malloc()). It isn't a good idea to put tens of thousands of Blocks
|
||||
into a Stream unless you have a very good reason to do so (compressed
|
||||
dictionary could be an example of such situation).
|
||||
|
||||
Also keep the number and sizes of Extra Records sane. If you produce
|
||||
the list of Extra Records automatically from some untrusted source,
|
||||
you should not only validate the content of these Records, but also
|
||||
their memory usage.
|
||||
|
||||
|
||||
1.2.2. Decoder
|
||||
|
||||
A single-threaded decoder should simply use a memory limitter and
|
||||
indicate an error if it runs out of memory.
|
||||
|
||||
Memory-limitting with multi-threaded decoding is tricky. The simple
|
||||
solution is to divide the maximum allowed memory usage with the
|
||||
maximum allowed threads, and give each Block decoder their own
|
||||
independent lzma_memory_limitter. The drawback is that if one Block
|
||||
needs notably more RAM than any other Block, the decoder will run out
|
||||
of memory when in reality there would be plenty of free RAM.
|
||||
|
||||
An attractive alternative would be using shared lzma_memory_limitter.
|
||||
Depending on the application and the expected type of input, this may
|
||||
either be the best solution or a source of hard-to-repeat problems.
|
||||
Consider the following requirements:
|
||||
- You use at maximum of n threads.
|
||||
- x(i) is the decoder memory requirements of the Block number i
|
||||
in an expected input Stream.
|
||||
- The memory limitter is set to higher value than the sum of n
|
||||
highest values x(i).
|
||||
|
||||
(If you are better at explaining the above conditions, please
|
||||
contribute your improved version.)
|
||||
|
||||
If the above conditions aren't met, it is possible that the decoding
|
||||
will fail unpredictably. That is, on the same machine using the same
|
||||
settings, the decoding may sometimes succeed and sometimes fail. This
|
||||
is because sometimes threads may run so that the Blocks with highest
|
||||
memory usage are tried to be decoded at the same time.
|
||||
|
||||
Most .lzma files have all the Blocks encoded with identical settings,
|
||||
or at least the memory usage won't vary dramatically. That's why most
|
||||
multi-threaded decoders probably want to use the simple "separate
|
||||
lzma_memory_limitter for each thread" solution, possibly fallbacking
|
||||
to single-threaded mode in case the per-thread memory limits aren't
|
||||
enough in multi-threaded mode.
|
||||
|
||||
FIXME: Memory usage of Stream info.
|
||||
|
||||
[
|
||||
|
||||
]
|
||||
|
||||
|
||||
2. Huge uncompressed output
|
||||
|
||||
2.1. Data Blocks
|
||||
|
||||
Decoding a tiny .lzma file can produce huge amount of uncompressed
|
||||
output. There is an example file of 45 bytes, which decodes to 64 PiB
|
||||
(that's 2^56 bytes). Uncompressing such a file to disk is likely to
|
||||
fill even a bigger disk array. If the data is written to a pipe, it
|
||||
may not fill the disk, but would still take very long time to finish.
|
||||
|
||||
To avoid denial of service conditions caused by huge amount of
|
||||
uncompressed output, applications using liblzma should use some method
|
||||
to limit the amount of output produced. The exact method depends on
|
||||
the application.
|
||||
|
||||
All valid .lzma Streams make it possible to find out the uncompressed
|
||||
size of the Stream without actually uncompressing the data. This
|
||||
information is available in at least one of the Metadata Blocks.
|
||||
Once the uncompressed size is parsed, the decoder can verify that
|
||||
it doesn't exceed certain limits (e.g. available disk space).
|
||||
|
||||
When the uncompressed size is known, the decoder can actively keep
|
||||
track of the amount of output produced so far, and that it doesn't
|
||||
exceed the known uncompressed size. If it does exceed, the file is
|
||||
known to be corrupt and an error should be indicated without
|
||||
continuing to decode the rest of the file.
|
||||
|
||||
Unfortunately, finding the uncompressed size beforehand is often
|
||||
possible only in non-streamed mode, because the needed information
|
||||
could be in the Footer Metdata Block, which (obviously) is at the
|
||||
end of the Stream. In purely streamed mode decoding, one may need to
|
||||
use some rough arbitrary limits to prevent the problems described in
|
||||
the beginning of this section.
|
||||
|
||||
|
||||
2.2. Metadata
|
||||
|
||||
Metadata is stored in Metadata Blocks, which are very similar to
|
||||
Data Blocks. Thus, the uncompressed size can be huge just like with
|
||||
Data Blocks. The difference is, that the contents of Metadata Blocks
|
||||
aren't given to the application as is, but parsed by liblzma. Still,
|
||||
reading through a huge Metadata can take very long time, effectively
|
||||
creating a denial of service like piping decoded a Data Block to
|
||||
another process would do.
|
||||
|
||||
At first it would seem that using a memory limitter would prevent
|
||||
this issue as a side effect. But it does so only if the application
|
||||
requests liblzma to allocate the Extra Records and provide them to
|
||||
the application. If Extra Records aren't requested, they aren't
|
||||
allocated either. Still, the Extra Records are being read through
|
||||
to validate that the Metadata is in proper format.
|
||||
|
||||
The solution is to limit the Uncompressed Size of a Metadata Block
|
||||
to some relatively large value. This will make liblzma to give an
|
||||
error when the given limit is reached.
|
||||
|
||||
166
doc/lzma-file-format.txt
Normal file
166
doc/lzma-file-format.txt
Normal file
@@ -0,0 +1,166 @@
|
||||
|
||||
The .lzma File Format
|
||||
=====================
|
||||
|
||||
0. Preface
|
||||
0.1. Notices and Acknowledgements
|
||||
0.2. Changes
|
||||
1. File Format
|
||||
1.1. Header
|
||||
1.1.1. Properties
|
||||
1.1.2. Dictionary Size
|
||||
1.1.3. Uncompressed Size
|
||||
1.2. LZMA Compressed Data
|
||||
2. References
|
||||
|
||||
|
||||
0. Preface
|
||||
|
||||
This document describes the .lzma file format, which is
|
||||
sometimes also called LZMA_Alone format. It is a legacy file
|
||||
format, which is being or has been replaced by the .xz format.
|
||||
The MIME type of the .lzma format is `application/x-lzma'.
|
||||
|
||||
The most commonly used software to handle .lzma files are
|
||||
LZMA SDK, LZMA Utils, 7-Zip, and XZ Utils. This document
|
||||
describes some of the differences between these implementations
|
||||
and gives hints what subset of the .lzma format is the most
|
||||
portable.
|
||||
|
||||
|
||||
0.1. Notices and Acknowledgements
|
||||
|
||||
This file format was designed by Igor Pavlov for use in
|
||||
LZMA SDK. This document was written by Lasse Collin
|
||||
<lasse.collin@tukaani.org> using the documentation found
|
||||
from the LZMA SDK.
|
||||
|
||||
This document has been put into the public domain.
|
||||
|
||||
|
||||
0.2. Changes
|
||||
|
||||
Last modified: 2011-04-12 11:55+0300
|
||||
|
||||
|
||||
1. File Format
|
||||
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+==========================+
|
||||
| Header | LZMA Compressed Data |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+==========================+
|
||||
|
||||
The .lzma format file consist of 13-byte Header followed by
|
||||
the LZMA Compressed Data.
|
||||
|
||||
Unlike the .gz, .bz2, and .xz formats, it is not possible to
|
||||
concatenate multiple .lzma files as is and expect the
|
||||
decompression tool to decode the resulting file as if it were
|
||||
a single .lzma file.
|
||||
|
||||
For example, the command line tools from LZMA Utils and
|
||||
LZMA SDK silently ignore all the data after the first .lzma
|
||||
stream. In contrast, the command line tool from XZ Utils
|
||||
considers the .lzma file to be corrupt if there is data after
|
||||
the first .lzma stream.
|
||||
|
||||
|
||||
1.1. Header
|
||||
|
||||
+------------+----+----+----+----+--+--+--+--+--+--+--+--+
|
||||
| Properties | Dictionary Size | Uncompressed Size |
|
||||
+------------+----+----+----+----+--+--+--+--+--+--+--+--+
|
||||
|
||||
|
||||
1.1.1. Properties
|
||||
|
||||
The Properties field contains three properties. An abbreviation
|
||||
is given in parentheses, followed by the value range of the
|
||||
property. The field consists of
|
||||
|
||||
1) the number of literal context bits (lc, [0, 8]);
|
||||
2) the number of literal position bits (lp, [0, 4]); and
|
||||
3) the number of position bits (pb, [0, 4]).
|
||||
|
||||
The properties are encoded using the following formula:
|
||||
|
||||
Properties = (pb * 5 + lp) * 9 + lc
|
||||
|
||||
The following C code illustrates a straightforward way to
|
||||
decode the Properties field:
|
||||
|
||||
uint8_t lc, lp, pb;
|
||||
uint8_t prop = get_lzma_properties();
|
||||
if (prop > (4 * 5 + 4) * 9 + 8)
|
||||
return LZMA_PROPERTIES_ERROR;
|
||||
|
||||
pb = prop / (9 * 5);
|
||||
prop -= pb * 9 * 5;
|
||||
lp = prop / 9;
|
||||
lc = prop - lp * 9;
|
||||
|
||||
XZ Utils has an additional requirement: lc + lp <= 4. Files
|
||||
which don't follow this requirement cannot be decompressed
|
||||
with XZ Utils. Usually this isn't a problem since the most
|
||||
common lc/lp/pb values are 3/0/2. It is the only lc/lp/pb
|
||||
combination that the files created by LZMA Utils can have,
|
||||
but LZMA Utils can decompress files with any lc/lp/pb.
|
||||
|
||||
|
||||
1.1.2. Dictionary Size
|
||||
|
||||
Dictionary Size is stored as an unsigned 32-bit little endian
|
||||
integer. Any 32-bit value is possible, but for maximum
|
||||
portability, only sizes of 2^n and 2^n + 2^(n-1) should be
|
||||
used.
|
||||
|
||||
LZMA Utils creates only files with dictionary size 2^n,
|
||||
16 <= n <= 25. LZMA Utils can decompress files with any
|
||||
dictionary size.
|
||||
|
||||
XZ Utils creates and decompresses .lzma files only with
|
||||
dictionary sizes 2^n and 2^n + 2^(n-1). If some other
|
||||
dictionary size is specified when compressing, the value
|
||||
stored in the Dictionary Size field is a rounded up, but the
|
||||
specified value is still used in the actual compression code.
|
||||
|
||||
|
||||
1.1.3. Uncompressed Size
|
||||
|
||||
Uncompressed Size is stored as unsigned 64-bit little endian
|
||||
integer. A special value of 0xFFFF_FFFF_FFFF_FFFF indicates
|
||||
that Uncompressed Size is unknown. End of Payload Marker (*)
|
||||
is used if and only if Uncompressed Size is unknown.
|
||||
|
||||
XZ Utils rejects files whose Uncompressed Size field specifies
|
||||
a known size that is 256 GiB or more. This is to reject false
|
||||
positives when trying to guess if the input file is in the
|
||||
.lzma format. When Uncompressed Size is unknown, there is no
|
||||
limit for the uncompressed size of the file.
|
||||
|
||||
(*) Some tools use the term End of Stream (EOS) marker
|
||||
instead of End of Payload Marker.
|
||||
|
||||
|
||||
1.2. LZMA Compressed Data
|
||||
|
||||
Detailed description of the format of this field is out of
|
||||
scope of this document.
|
||||
|
||||
|
||||
2. References
|
||||
|
||||
LZMA SDK - The original LZMA implementation
|
||||
http://7-zip.org/sdk.html
|
||||
|
||||
7-Zip
|
||||
http://7-zip.org/
|
||||
|
||||
LZMA Utils - LZMA adapted to POSIX-like systems
|
||||
http://tukaani.org/lzma/
|
||||
|
||||
XZ Utils - The next generation of LZMA Utils
|
||||
http://tukaani.org/xz/
|
||||
|
||||
The .xz file format - The successor of the .lzma format
|
||||
http://tukaani.org/xz/xz-file-format.txt
|
||||
|
||||
@@ -1,107 +0,0 @@
|
||||
|
||||
Introduction to the lzma command line tool
|
||||
------------------------------------------
|
||||
|
||||
Overview
|
||||
|
||||
The lzma command line tool is similar to gzip and bzip2, but for
|
||||
compressing and uncompressing .lzma files.
|
||||
|
||||
|
||||
Supported file formats
|
||||
|
||||
By default, the tool creates files in the new .lzma format. This can
|
||||
be overriden with --format=FMT command line option. Use --format=alone
|
||||
to create files in the old LZMA_Alone format.
|
||||
|
||||
By default, the tool uncompresses both the new .lzma format and
|
||||
LZMA_Alone format. This is to make it transparent to switch from
|
||||
the old LZMA_Alone format to the new .lzma format. Since both
|
||||
formats use the same filename suffix, average user should never
|
||||
notice which format was used.
|
||||
|
||||
|
||||
Differences to gzip and bzip2
|
||||
|
||||
Standard input and output
|
||||
|
||||
Both gzip and bzip2 refuse to write compressed data to a terminal and
|
||||
read compressed data from a terminal. With gzip (but not with bzip2),
|
||||
this can be overriden with the `--force' option. lzma follows the
|
||||
behavior of gzip here.
|
||||
|
||||
Usage of LZMA_OPT environment variable
|
||||
|
||||
gzip and bzip2 read GZIP and BZIP2 environment variables at startup.
|
||||
These variables may contain extra command line options.
|
||||
|
||||
gzip and bzip2 allow passing not only options, but also end-of-options
|
||||
indicator (`--') and filenames via the environment variable. No quoting
|
||||
is supported with the filenames.
|
||||
|
||||
Here are examples with gzip. bzip2 behaves identically.
|
||||
|
||||
bash$ echo asdf > 'foo bar'
|
||||
bash$ GZIP='"foo bar"' gzip
|
||||
gzip: "foo: No such file or directory
|
||||
gzip: bar": No such file or directory
|
||||
|
||||
bash$ GZIP=-- gzip --help
|
||||
gzip: --help: No such file or directory
|
||||
|
||||
lzma silently ignores all non-option arguments given via the
|
||||
environment variable LZMA_OPT. Like on the command line, everything
|
||||
after `--' is taken as non-options, and thus ignored in LZMA_OPT.
|
||||
|
||||
bash$ LZMA_OPT='--help' lzma --version # Displays help
|
||||
bash$ LZMA_OPT='-- --help' lzma --version # Displays version
|
||||
|
||||
|
||||
Filter chain presets
|
||||
|
||||
Like in gzip and bzip2, lzma supports numbered presets from 1 to 9
|
||||
where 1 is the fastest and 9 the best compression. 1 and 2 are for
|
||||
fast compressing with small memory usage, 3 to 6 for good compression
|
||||
ratio with medium memory usage, and 7 to 9 for excellent compression
|
||||
ratio with higher memory requirements. The default is 7 if memory
|
||||
usage limit allows.
|
||||
|
||||
In future, there will probably be an option like --preset=NAME, which
|
||||
will contain more special presets for specific file types.
|
||||
|
||||
It's also possible that there will be some heuristics to select good
|
||||
filters. For example, the tool could detect when a .tar archive is
|
||||
being compressed, and enable x86 filter only for those files in the
|
||||
.tar archive that are ELF or PE executables for x86.
|
||||
|
||||
|
||||
Specifying custom filter chains
|
||||
|
||||
Custom filter chains are specified by using long options with the name
|
||||
of the filters in correct order. For example, to pass the input data to
|
||||
the x86 filter and the output of that to the LZMA filter, the following
|
||||
command will do:
|
||||
|
||||
lzma --x86 --lzma filename
|
||||
|
||||
Some filters accept options, which are specified as a comma-separated
|
||||
list of key=value pairs:
|
||||
|
||||
lzma --delta=distance=4 --lzma=dict=4Mi,lc=8,lp=2 filename
|
||||
|
||||
|
||||
Memory usage control
|
||||
|
||||
By default, the command line tool limits memory usage to 1/3 of the
|
||||
available physical RAM. If no preset or custom filter chain has been
|
||||
given, the default preset will be used. If the memory limit is too
|
||||
low for the default preset, the tool will silently switch to lower
|
||||
preset.
|
||||
|
||||
When a preset or a custom filter chain has been specified and the
|
||||
memory limit is too low, an error message is displayed and no files
|
||||
are processed.
|
||||
|
||||
If the decoder hits the memory usage limit, an error is displayed and
|
||||
no more files are processed.
|
||||
|
||||
1150
doc/xz-file-format.txt
Normal file
1150
doc/xz-file-format.txt
Normal file
File diff suppressed because it is too large
Load Diff
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.
|
||||
|
||||
148
dos/Makefile
Normal file
148
dos/Makefile
Normal file
@@ -0,0 +1,148 @@
|
||||
###############################################################################
|
||||
#
|
||||
# Makefile to build XZ Utils using DJGPP
|
||||
#
|
||||
# Author: Lasse Collin
|
||||
#
|
||||
# This file has been put into the public domain.
|
||||
# You can do whatever you want with this file.
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
# 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
|
||||
STRIP = strip
|
||||
CPPFLAGS =
|
||||
CFLAGS = -g -Wall -Wextra -Wfatal-errors -march=i386 -mtune=i686 -O2
|
||||
LDFLAGS = -lemu
|
||||
|
||||
# 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
|
||||
|
||||
ALL_CPPFLAGS = \
|
||||
-I. \
|
||||
-I../lib \
|
||||
-I../src/common \
|
||||
-I../src/liblzma/api \
|
||||
-I../src/liblzma/common \
|
||||
-I../src/liblzma/check \
|
||||
-I../src/liblzma/rangecoder \
|
||||
-I../src/liblzma/lz \
|
||||
-I../src/liblzma/lzma \
|
||||
-I../src/liblzma/delta \
|
||||
-I../src/liblzma/simple \
|
||||
-DHAVE_CONFIG_H
|
||||
|
||||
ALL_CPPFLAGS += $(CPPFLAGS)
|
||||
ALL_CFLAGS += $(CFLAGS)
|
||||
|
||||
.PHONY: all
|
||||
all: xz.exe
|
||||
|
||||
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/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/file_info.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_decoder.c \
|
||||
../src/liblzma/common/stream_encoder.c \
|
||||
../src/liblzma/common/stream_flags_common.c \
|
||||
../src/liblzma/common/stream_flags_decoder.c \
|
||||
../src/liblzma/common/stream_flags_encoder.c \
|
||||
../src/liblzma/common/vli_decoder.c \
|
||||
../src/liblzma/common/vli_encoder.c \
|
||||
../src/liblzma/common/vli_size.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 \
|
||||
../src/liblzma/lzma/fastpos_table.c \
|
||||
../src/liblzma/lzma/lzma2_decoder.c \
|
||||
../src/liblzma/lzma/lzma2_encoder.c \
|
||||
../src/liblzma/lzma/lzma_decoder.c \
|
||||
../src/liblzma/lzma/lzma_encoder.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/rangecoder/price_table.c \
|
||||
../src/liblzma/simple/arm.c \
|
||||
../src/liblzma/simple/armthumb.c \
|
||||
../src/liblzma/simple/ia64.c \
|
||||
../src/liblzma/simple/powerpc.c \
|
||||
../src/liblzma/simple/simple_coder.c \
|
||||
../src/liblzma/simple/simple_decoder.c \
|
||||
../src/liblzma/simple/simple_encoder.c \
|
||||
../src/liblzma/simple/sparc.c \
|
||||
../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
|
||||
|
||||
OBJS_C = $(SRCS_C:.c=.o)
|
||||
OBJS_ASM = $(SRCS_ASM:.S=.o)
|
||||
OBJS = $(OBJS_C) $(OBJS_ASM)
|
||||
|
||||
getopt.h:
|
||||
update ../lib/getopt.in.h getopt.h
|
||||
|
||||
$(OBJS): getopt.h
|
||||
|
||||
$(OBJS_C): %.o: %.c
|
||||
$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c -o $@ $<
|
||||
|
||||
$(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 $@
|
||||
del $@
|
||||
copy /b $(DJGPP:DJGPP.ENV=BIN\CWSDSTUB.EXE) + $(@:.exe=) $@
|
||||
del $(@:.exe=)
|
||||
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.
|
||||
|
||||
136
dos/config.h
Normal file
136
dos/config.h
Normal file
@@ -0,0 +1,136 @@
|
||||
/* 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
|
||||
|
||||
/* Define to 1 if crc64 integrity check is enabled. */
|
||||
#define HAVE_CHECK_CRC64 1
|
||||
|
||||
/* Define to 1 if sha256 integrity check is enabled. */
|
||||
#define HAVE_CHECK_SHA256 1
|
||||
|
||||
/* Define to 1 if any of HAVE_DECODER_foo have been defined. */
|
||||
#define HAVE_DECODERS 1
|
||||
|
||||
/* Define to 1 if arm decoder is enabled. */
|
||||
#define HAVE_DECODER_ARM 1
|
||||
|
||||
/* Define to 1 if armthumb decoder is enabled. */
|
||||
#define HAVE_DECODER_ARMTHUMB 1
|
||||
|
||||
/* Define to 1 if delta decoder is enabled. */
|
||||
#define HAVE_DECODER_DELTA 1
|
||||
|
||||
/* Define to 1 if ia64 decoder is enabled. */
|
||||
#define HAVE_DECODER_IA64 1
|
||||
|
||||
/* Define to 1 if lzma1 decoder is enabled. */
|
||||
#define HAVE_DECODER_LZMA1 1
|
||||
|
||||
/* Define to 1 if lzma2 decoder is enabled. */
|
||||
#define HAVE_DECODER_LZMA2 1
|
||||
|
||||
/* Define to 1 if powerpc decoder is enabled. */
|
||||
#define HAVE_DECODER_POWERPC 1
|
||||
|
||||
/* Define to 1 if sparc decoder is enabled. */
|
||||
#define HAVE_DECODER_SPARC 1
|
||||
|
||||
/* Define to 1 if x86 decoder is enabled. */
|
||||
#define HAVE_DECODER_X86 1
|
||||
|
||||
/* Define to 1 if any of HAVE_ENCODER_foo have been defined. */
|
||||
#define HAVE_ENCODERS 1
|
||||
|
||||
/* Define to 1 if arm encoder is enabled. */
|
||||
#define HAVE_ENCODER_ARM 1
|
||||
|
||||
/* Define to 1 if armthumb encoder is enabled. */
|
||||
#define HAVE_ENCODER_ARMTHUMB 1
|
||||
|
||||
/* Define to 1 if delta encoder is enabled. */
|
||||
#define HAVE_ENCODER_DELTA 1
|
||||
|
||||
/* Define to 1 if ia64 encoder is enabled. */
|
||||
#define HAVE_ENCODER_IA64 1
|
||||
|
||||
/* Define to 1 if lzma1 encoder is enabled. */
|
||||
#define HAVE_ENCODER_LZMA1 1
|
||||
|
||||
/* Define to 1 if lzma2 encoder is enabled. */
|
||||
#define HAVE_ENCODER_LZMA2 1
|
||||
|
||||
/* Define to 1 if powerpc encoder is enabled. */
|
||||
#define HAVE_ENCODER_POWERPC 1
|
||||
|
||||
/* Define to 1 if sparc encoder is enabled. */
|
||||
#define HAVE_ENCODER_SPARC 1
|
||||
|
||||
/* Define to 1 if x86 encoder is enabled. */
|
||||
#define HAVE_ENCODER_X86 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 to enable bt2 match finder. */
|
||||
#define HAVE_MF_BT2 1
|
||||
|
||||
/* Define to 1 to enable bt3 match finder. */
|
||||
#define HAVE_MF_BT3 1
|
||||
|
||||
/* Define to 1 to enable bt4 match finder. */
|
||||
#define HAVE_MF_BT4 1
|
||||
|
||||
/* Define to 1 to enable hc3 match finder. */
|
||||
#define HAVE_MF_HC3 1
|
||||
|
||||
/* Define to 1 to enable hc4 match finder. */
|
||||
#define HAVE_MF_HC4 1
|
||||
|
||||
/* Define to 1 if stdbool.h conforms to C99. */
|
||||
#define HAVE_STDBOOL_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#define HAVE_STDINT_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#define HAVE_STDLIB_H 1
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
#define HAVE_SYS_TIME_H 1
|
||||
|
||||
/* Define to 1 if you have the `utimes' function. */
|
||||
#define HAVE_UTIMES 1
|
||||
|
||||
/* Define to 1 or 0, depending whether the compiler supports simple visibility
|
||||
declarations. */
|
||||
#define HAVE_VISIBILITY 0
|
||||
|
||||
/* 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 "https://tukaani.org/xz/"
|
||||
|
||||
/* The size of `size_t', as computed by sizeof. */
|
||||
#define SIZEOF_SIZE_T 4
|
||||
|
||||
/* Define to 1 if the system supports fast unaligned access to 16-bit and
|
||||
32-bit integers. */
|
||||
#define TUKLIB_FAST_UNALIGNED_ACCESS 1
|
||||
115
extra/7z2lzma/7z2lzma.bash
Executable file
115
extra/7z2lzma/7z2lzma.bash
Executable file
@@ -0,0 +1,115 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# 7z2lzma.bash is very primitive .7z to .lzma converter. The input file must
|
||||
# have exactly one LZMA compressed stream, which has been created with the
|
||||
# default lc, lp, and pb values. The CRC32 in the .7z archive is not checked,
|
||||
# and the script may seem to succeed while it actually created a corrupt .lzma
|
||||
# file. You should always try uncompressing both the original .7z and the
|
||||
# created .lzma and compare that the output is identical.
|
||||
#
|
||||
# This script requires basic GNU tools and 7z or 7za tool from p7zip.
|
||||
#
|
||||
# Last modified: 2009-01-15 14:25+0200
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Author: Lasse Collin <lasse.collin@tukaani.org>
|
||||
#
|
||||
# This file has been put into the public domain.
|
||||
# You can do whatever you want with this file.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
# You can use 7z or 7za, both will work.
|
||||
SEVENZIP=7za
|
||||
|
||||
if [ $# != 2 -o -z "$1" -o -z "$2" ]; then
|
||||
echo "Usage: $0 input.7z output.lzma"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Converts an integer variable to little endian binary integer.
|
||||
int2bin()
|
||||
{
|
||||
local LEN=$1
|
||||
local NUM=$2
|
||||
local HEX=(0 1 2 3 4 5 6 7 8 9 A B C D E F)
|
||||
local I
|
||||
for ((I=0; I < "$LEN"; ++I)); do
|
||||
printf "\\x${HEX[(NUM >> 4) & 0x0F]}${HEX[NUM & 0x0F]}"
|
||||
NUM=$((NUM >> 8))
|
||||
done
|
||||
}
|
||||
|
||||
# Make sure we get possible errors from pipes.
|
||||
set -o pipefail
|
||||
|
||||
# Get information about the input file. At least older 7z and 7za versions
|
||||
# may return with zero exit status even when an error occurred, so check
|
||||
# if the output has any lines beginning with "Error".
|
||||
INFO=$("$SEVENZIP" l -slt "$1")
|
||||
if [ $? != 0 ] || printf '%s\n' "$INFO" | grep -q ^Error; then
|
||||
printf '%s\n' "$INFO"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if the input file has more than one compressed block.
|
||||
if printf '%s\n' "$INFO" | grep -q '^Block = 1'; then
|
||||
echo "Cannot convert, because the input file has more than"
|
||||
echo "one compressed block."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 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')
|
||||
|
||||
if [ -z "$CSIZE" -o -z "$USIZE" -o -z "$DICT" ]; then
|
||||
echo "Parsing output of $SEVENZIP failed. Maybe the file uses some"
|
||||
echo "other compression method than plain LZMA."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# The following assumes that the default lc, lp, and pb settings were used.
|
||||
# Otherwise the output will be corrupt.
|
||||
printf '\x5D' > "$2"
|
||||
|
||||
# Dictionary size can be either was power of two, bytes, kibibytes, or
|
||||
# mebibytes. We need to convert it to bytes.
|
||||
case $DICT in
|
||||
*b)
|
||||
DICT=${DICT%b}
|
||||
;;
|
||||
*k)
|
||||
DICT=${DICT%k}
|
||||
DICT=$((DICT << 10))
|
||||
;;
|
||||
*m)
|
||||
DICT=${DICT%m}
|
||||
DICT=$((DICT << 20))
|
||||
;;
|
||||
*)
|
||||
DICT=$((1 << DICT))
|
||||
;;
|
||||
esac
|
||||
int2bin 4 "$DICT" >> "$2"
|
||||
|
||||
# Uncompressed size
|
||||
int2bin 8 "$USIZE" >> "$2"
|
||||
|
||||
# Copy the actual compressed data. Using multiple dd commands to avoid
|
||||
# copying large amount of data with one-byte block size, which would be
|
||||
# annoyingly slow.
|
||||
BS=8192
|
||||
BIGSIZE=$((CSIZE / BS))
|
||||
CSIZE=$((CSIZE % BS))
|
||||
{
|
||||
dd of=/dev/null bs=32 count=1 \
|
||||
&& dd bs="$BS" count="$BIGSIZE" \
|
||||
&& dd bs=1 count="$CSIZE"
|
||||
} < "$1" >> "$2"
|
||||
|
||||
exit $?
|
||||
@@ -37,6 +37,10 @@
|
||||
/* 5 8 Uncompressed size (little endian). -1 means unknown size */
|
||||
/* 13 Compressed data */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#define BUFSIZE 4096
|
||||
|
||||
int find_lzma_header(unsigned char *buf) {
|
||||
@@ -48,7 +52,7 @@ int find_lzma_header(unsigned char *buf) {
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
char buf[BUFSIZE];
|
||||
unsigned char buf[BUFSIZE];
|
||||
int ret, i, numlzma, blocks=0;
|
||||
|
||||
if (argc != 2) {
|
||||
@@ -64,11 +68,11 @@ int main(int argc, char *argv[]) {
|
||||
ret = fread(buf, BUFSIZE, 1, stdin);
|
||||
if (ret != 1)
|
||||
break;
|
||||
|
||||
|
||||
/* Scan for signature. */
|
||||
for (i = 0; i<BUFSIZE-23; i++) {
|
||||
if (find_lzma_header(buf+i) && numlzma-- <= 0) {
|
||||
fwrite(buf+i, (BUFSIZE-i), 1, stdout);
|
||||
fwrite(buf+i, (BUFSIZE-i), 1, stdout);
|
||||
for (;;) {
|
||||
int ch;
|
||||
ch = getchar();
|
||||
@@ -76,7 +80,6 @@ int main(int argc, char *argv[]) {
|
||||
exit(0);
|
||||
putchar(ch);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
blocks++;
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
##
|
||||
## Copyright (C) 2004-2007 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2007 Lasse Collin
|
||||
## Copyright (C) 2004-2007 Free Software Foundation, Inc.
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
## 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.
|
||||
##
|
||||
|
||||
## Not using gnulib-tool, at least for now. Less mess this way.
|
||||
## Not using gnulib-tool, at least for now. It is likely that we won't
|
||||
## need anything else from Gnulib than getopt_long().
|
||||
|
||||
noinst_LIBRARIES = libgnu.a
|
||||
|
||||
@@ -21,12 +21,12 @@ libgnu_a_SOURCES =
|
||||
libgnu_a_DEPENDENCIES = $(LIBOBJS)
|
||||
libgnu_a_LIBADD = $(LIBOBJS)
|
||||
|
||||
EXTRA_DIST = gettext.h getopt_.h getopt.c getopt1.c getopt_int.h
|
||||
EXTRA_DIST = getopt.in.h getopt.c getopt1.c getopt_int.h
|
||||
BUILT_SOURCES = $(GETOPT_H)
|
||||
MOSTLYCLEANFILES = getopt.h getopt.h-t
|
||||
|
||||
getopt.h: getopt_.h
|
||||
getopt.h: getopt.in.h
|
||||
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
|
||||
cat $(srcdir)/getopt_.h; \
|
||||
cat $(srcdir)/getopt.in.h; \
|
||||
} > $@-t
|
||||
mv -f $@-t $@
|
||||
|
||||
14
lib/getopt.c
14
lib/getopt.c
@@ -7,16 +7,16 @@
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
You should have received a copy of the GNU Lesser General Public License along
|
||||
with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
@@ -35,12 +35,18 @@
|
||||
# include <unixlib.h>
|
||||
#endif
|
||||
|
||||
/* Completely disable NLS for getopt. We won't include translations for it
|
||||
anyway. If the system lacks getopt_long, missing translations probably
|
||||
aren't a problem. */
|
||||
/*
|
||||
#ifdef _LIBC
|
||||
# include <libintl.h>
|
||||
#else
|
||||
# include "gettext.h"
|
||||
# define _(msgid) gettext (msgid)
|
||||
#endif
|
||||
*/
|
||||
#define _(msgid) (msgid)
|
||||
|
||||
#if defined _LIBC && defined USE_IN_LIBIO
|
||||
# include <wchar.h>
|
||||
|
||||
@@ -4,16 +4,16 @@
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
You should have received a copy of the GNU Lesser General Public License along
|
||||
with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
@@ -4,16 +4,16 @@
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
You should have received a copy of the GNU Lesser General Public License along
|
||||
with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
|
||||
240
lib/gettext.h
240
lib/gettext.h
@@ -1,240 +0,0 @@
|
||||
/* Convenience header for conditional use of GNU <libintl.h>.
|
||||
Copyright (C) 1995-1998, 2000-2002, 2004-2006 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public License as published
|
||||
by the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
USA. */
|
||||
|
||||
#ifndef _LIBGETTEXT_H
|
||||
#define _LIBGETTEXT_H 1
|
||||
|
||||
/* NLS can be disabled through the configure --disable-nls option.
|
||||
*
|
||||
* Extra hack in LZMA Utils: if DISABLE_NLS is defined, NLS is disabled
|
||||
* even if ENABLE_NLS is true. See Makefile.am for more information.
|
||||
*/
|
||||
#if ENABLE_NLS && !defined(DISABLE_NLS)
|
||||
|
||||
/* Get declarations of GNU message catalog functions. */
|
||||
# include <libintl.h>
|
||||
|
||||
/* You can set the DEFAULT_TEXT_DOMAIN macro to specify the domain used by
|
||||
the gettext() and ngettext() macros. This is an alternative to calling
|
||||
textdomain(), and is useful for libraries. */
|
||||
# ifdef DEFAULT_TEXT_DOMAIN
|
||||
# undef gettext
|
||||
# define gettext(Msgid) \
|
||||
dgettext (DEFAULT_TEXT_DOMAIN, Msgid)
|
||||
# undef ngettext
|
||||
# define ngettext(Msgid1, Msgid2, N) \
|
||||
dngettext (DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N)
|
||||
# endif
|
||||
|
||||
#else
|
||||
|
||||
/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which
|
||||
chokes if dcgettext is defined as a macro. So include it now, to make
|
||||
later inclusions of <locale.h> a NOP. We don't include <libintl.h>
|
||||
as well because people using "gettext.h" will not include <libintl.h>,
|
||||
and also including <libintl.h> would fail on SunOS 4, whereas <locale.h>
|
||||
is OK. */
|
||||
#if defined(__sun)
|
||||
# include <locale.h>
|
||||
#endif
|
||||
|
||||
/* Many header files from the libstdc++ coming with g++ 3.3 or newer include
|
||||
<libintl.h>, which chokes if dcgettext is defined as a macro. So include
|
||||
it now, to make later inclusions of <libintl.h> a NOP. */
|
||||
#if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3)
|
||||
# include <cstdlib>
|
||||
# if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H
|
||||
# include <libintl.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Disabled NLS.
|
||||
The casts to 'const char *' serve the purpose of producing warnings
|
||||
for invalid uses of the value returned from these functions.
|
||||
On pre-ANSI systems without 'const', the config.h file is supposed to
|
||||
contain "#define const". */
|
||||
# define gettext(Msgid) ((const char *) (Msgid))
|
||||
# define dgettext(Domainname, Msgid) ((const char *) (Msgid))
|
||||
# define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid))
|
||||
# define ngettext(Msgid1, Msgid2, N) \
|
||||
((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
|
||||
# define dngettext(Domainname, Msgid1, Msgid2, N) \
|
||||
((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
|
||||
# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
|
||||
((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
|
||||
# define textdomain(Domainname) ((const char *) (Domainname))
|
||||
# define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname))
|
||||
# define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset))
|
||||
|
||||
#endif
|
||||
|
||||
/* A pseudo function call that serves as a marker for the automated
|
||||
extraction of messages, but does not call gettext(). The run-time
|
||||
translation is done at a different place in the code.
|
||||
The argument, String, should be a literal string. Concatenated strings
|
||||
and other string expressions won't work.
|
||||
The macro's expansion is not parenthesized, so that it is suitable as
|
||||
initializer for static 'char[]' or 'const char[]' variables. */
|
||||
#define gettext_noop(String) String
|
||||
|
||||
/* The separator between msgctxt and msgid in a .mo file. */
|
||||
#define GETTEXT_CONTEXT_GLUE "\004"
|
||||
|
||||
/* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a
|
||||
MSGID. MSGCTXT and MSGID must be string literals. MSGCTXT should be
|
||||
short and rarely need to change.
|
||||
The letter 'p' stands for 'particular' or 'special'. */
|
||||
#ifdef DEFAULT_TEXT_DOMAIN
|
||||
# define pgettext(Msgctxt, Msgid) \
|
||||
pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
|
||||
#else
|
||||
# define pgettext(Msgctxt, Msgid) \
|
||||
pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
|
||||
#endif
|
||||
#define dpgettext(Domainname, Msgctxt, Msgid) \
|
||||
pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
|
||||
#define dcpgettext(Domainname, Msgctxt, Msgid, Category) \
|
||||
pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category)
|
||||
#ifdef DEFAULT_TEXT_DOMAIN
|
||||
# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
|
||||
npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
|
||||
#else
|
||||
# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
|
||||
npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
|
||||
#endif
|
||||
#define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
|
||||
npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
|
||||
#define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \
|
||||
npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, Category)
|
||||
|
||||
static inline const char *
|
||||
pgettext_aux (const char *domain,
|
||||
const char *msg_ctxt_id, const char *msgid,
|
||||
int category)
|
||||
{
|
||||
const char *translation = dcgettext (domain, msg_ctxt_id, category);
|
||||
if (translation == msg_ctxt_id)
|
||||
return msgid;
|
||||
else
|
||||
return translation;
|
||||
}
|
||||
|
||||
static inline const char *
|
||||
npgettext_aux (const char *domain,
|
||||
const char *msg_ctxt_id, const char *msgid,
|
||||
const char *msgid_plural, unsigned long int n,
|
||||
int category)
|
||||
{
|
||||
const char *translation =
|
||||
dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
|
||||
if (translation == msg_ctxt_id || translation == msgid_plural)
|
||||
return (n == 1 ? msgid : msgid_plural);
|
||||
else
|
||||
return translation;
|
||||
}
|
||||
|
||||
/* The same thing extended for non-constant arguments. Here MSGCTXT and MSGID
|
||||
can be arbitrary expressions. But for string literals these macros are
|
||||
less efficient than those above. */
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 1
|
||||
|
||||
#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#define pgettext_expr(Msgctxt, Msgid) \
|
||||
dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES)
|
||||
#define dpgettext_expr(Domainname, Msgctxt, Msgid) \
|
||||
dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES)
|
||||
|
||||
static inline const char *
|
||||
dcpgettext_expr (const char *domain,
|
||||
const char *msgctxt, const char *msgid,
|
||||
int category)
|
||||
{
|
||||
size_t msgctxt_len = strlen (msgctxt) + 1;
|
||||
size_t msgid_len = strlen (msgid) + 1;
|
||||
const char *translation;
|
||||
#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
|
||||
char msg_ctxt_id[msgctxt_len + msgid_len];
|
||||
#else
|
||||
char buf[1024];
|
||||
char *msg_ctxt_id =
|
||||
(msgctxt_len + msgid_len <= sizeof (buf)
|
||||
? buf
|
||||
: (char *) malloc (msgctxt_len + msgid_len));
|
||||
if (msg_ctxt_id != NULL)
|
||||
#endif
|
||||
{
|
||||
memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
|
||||
msg_ctxt_id[msgctxt_len - 1] = '\004';
|
||||
memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
|
||||
translation = dcgettext (domain, msg_ctxt_id, category);
|
||||
#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
|
||||
if (msg_ctxt_id != buf)
|
||||
free (msg_ctxt_id);
|
||||
#endif
|
||||
if (translation != msg_ctxt_id)
|
||||
return translation;
|
||||
}
|
||||
return msgid;
|
||||
}
|
||||
|
||||
#define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \
|
||||
dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
|
||||
#define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
|
||||
dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
|
||||
|
||||
static inline const char *
|
||||
dcnpgettext_expr (const char *domain,
|
||||
const char *msgctxt, const char *msgid,
|
||||
const char *msgid_plural, unsigned long int n,
|
||||
int category)
|
||||
{
|
||||
size_t msgctxt_len = strlen (msgctxt) + 1;
|
||||
size_t msgid_len = strlen (msgid) + 1;
|
||||
const char *translation;
|
||||
#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
|
||||
char msg_ctxt_id[msgctxt_len + msgid_len];
|
||||
#else
|
||||
char buf[1024];
|
||||
char *msg_ctxt_id =
|
||||
(msgctxt_len + msgid_len <= sizeof (buf)
|
||||
? buf
|
||||
: (char *) malloc (msgctxt_len + msgid_len));
|
||||
if (msg_ctxt_id != NULL)
|
||||
#endif
|
||||
{
|
||||
memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
|
||||
msg_ctxt_id[msgctxt_len - 1] = '\004';
|
||||
memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
|
||||
translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
|
||||
#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
|
||||
if (msg_ctxt_id != buf)
|
||||
free (msg_ctxt_id);
|
||||
#endif
|
||||
if (!(translation == msg_ctxt_id || translation == msgid_plural))
|
||||
return translation;
|
||||
}
|
||||
return (n == 1 ? msgid : msgid_plural);
|
||||
}
|
||||
|
||||
#endif /* _LIBGETTEXT_H */
|
||||
38
m4/.gitignore
vendored
Normal file
38
m4/.gitignore
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
codeset.m4
|
||||
fcntl-o.m4
|
||||
gettext.m4
|
||||
glibc2.m4
|
||||
glibc21.m4
|
||||
iconv.m4
|
||||
intdiv0.m4
|
||||
intl.m4
|
||||
intldir.m4
|
||||
intlmacosx.m4
|
||||
intmax.m4
|
||||
inttypes-pri.m4
|
||||
inttypes_h.m4
|
||||
lcmessage.m4
|
||||
lib-ld.m4
|
||||
lib-link.m4
|
||||
lib-prefix.m4
|
||||
libtool.m4
|
||||
lock.m4
|
||||
longdouble.m4
|
||||
longlong.m4
|
||||
ltoptions.m4
|
||||
ltsugar.m4
|
||||
ltversion.m4
|
||||
lt~obsolete.m4
|
||||
nls.m4
|
||||
po.m4
|
||||
printf-posix.m4
|
||||
progtest.m4
|
||||
size_max.m4
|
||||
stdint_h.m4
|
||||
threadlib.m4
|
||||
uintmax_t.m4
|
||||
ulonglong.m4
|
||||
visibility.m4
|
||||
wchar_t.m4
|
||||
wint_t.m4
|
||||
xsize.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
|
||||
85
m4/ax_check_capsicum.m4
Normal file
85
m4/ax_check_capsicum.m4
Normal file
@@ -0,0 +1,85 @@
|
||||
# -*- Autoconf -*-
|
||||
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_CHECK_CAPSICUM([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# This macro searches for an installed Capsicum header and library,
|
||||
# and if found:
|
||||
# - AC_DEFINE([HAVE_CAPSICUM]) is called.
|
||||
# - AC_DEFINE([HAVE_SYS_CAPSICUM_H]) is called if <sys/capsicum.h>
|
||||
# is present (otherwise <sys/capability.h> must be used).
|
||||
# - CAPSICUM_LIB is set to the -l option needed to link Capsicum support,
|
||||
# and AC_SUBST([CAPSICUM_LIB]) is called.
|
||||
# - The shell commands in ACTION-IF-FOUND are run. The default
|
||||
# ACTION-IF-FOUND prepends ${CAPSICUM_LIB} into LIBS. If you don't
|
||||
# want to modify LIBS and don't need to run any other commands either,
|
||||
# use a colon as ACTION-IF-FOUND.
|
||||
#
|
||||
# If Capsicum support isn't found:
|
||||
# - The shell commands in ACTION-IF-NOT-FOUND are run. The default
|
||||
# ACTION-IF-NOT-FOUND calls AC_MSG_WARN to print a warning that
|
||||
# Capsicum support wasn't found.
|
||||
#
|
||||
# You should use autoheader to include a definition for the symbols above
|
||||
# in a config.h file.
|
||||
#
|
||||
# Sample usage in a C/C++ source is as follows:
|
||||
#
|
||||
# #ifdef HAVE_CAPSICUM
|
||||
# # ifdef HAVE_SYS_CAPSICUM_H
|
||||
# # include <sys/capsicum.h>
|
||||
# # else
|
||||
# # include <sys/capability.h>
|
||||
# # endif
|
||||
# #endif /* HAVE_CAPSICUM */
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2014 Google Inc.
|
||||
# Copyright (c) 2015 Lasse Collin <lasse.collin@tukaani.org>
|
||||
#
|
||||
# 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 any warranty.
|
||||
|
||||
#serial 2
|
||||
|
||||
AC_DEFUN([AX_CHECK_CAPSICUM], [
|
||||
# On FreeBSD >= 11.x and Linux, Capsicum is uses <sys/capsicum.h>.
|
||||
# If this header is found, it is assumed to be the right one.
|
||||
capsicum_header_found=no
|
||||
AC_CHECK_HEADERS([sys/capsicum.h], [capsicum_header_found=yes])
|
||||
if test "$capsicum_header_found" = no ; then
|
||||
# On FreeBSD 10.x Capsicum uses <sys/capability.h>. Such a header exists
|
||||
# on Linux too but it describes POSIX.1e capabilities. Look for the
|
||||
# declaration of cap_rights_limit to check if <sys/capability.h> is
|
||||
# a Capsicum header.
|
||||
AC_CHECK_DECL([cap_rights_limit], [capsicum_header_found=yes], [],
|
||||
[#include <sys/capability.h>])
|
||||
fi
|
||||
|
||||
capsicum_lib_found=no
|
||||
CAPSICUM_LIB=
|
||||
if test "$capsicum_header_found" = yes ; then
|
||||
AC_LANG_PUSH([C])
|
||||
# FreeBSD >= 10.x has Capsicum functions in libc.
|
||||
AC_LINK_IFELSE([AC_LANG_CALL([], [cap_rights_limit])],
|
||||
[capsicum_lib_found=yes], [])
|
||||
# Linux has Capsicum functions in libcaprights.
|
||||
AC_CHECK_LIB([caprights], [cap_rights_limit],
|
||||
[CAPSICUM_LIB=-lcaprights
|
||||
capsicum_lib_found=yes], [])
|
||||
AC_LANG_POP([C])
|
||||
fi
|
||||
AC_SUBST([CAPSICUM_LIB])
|
||||
|
||||
if test "$capsicum_lib_found" = yes ; then
|
||||
AC_DEFINE([HAVE_CAPSICUM], [1], [Define to 1 if Capsicum is available.])
|
||||
m4_default([$1], [LIBS="${CAPSICUM_LIB} $LIBS"])
|
||||
else
|
||||
m4_default([$2], [AC_MSG_WARN([Capsicum support not found])])
|
||||
fi])
|
||||
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
|
||||
62
m4/getopt.m4
62
m4/getopt.m4
@@ -1,5 +1,5 @@
|
||||
# getopt.m4 serial 13
|
||||
dnl Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
# getopt.m4 serial 14 (modified version)
|
||||
dnl Copyright (C) 2002-2006, 2008 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
@@ -13,7 +13,6 @@ AC_DEFUN([gl_GETOPT_SUBSTITUTE],
|
||||
AC_LIBOBJ([getopt])
|
||||
AC_LIBOBJ([getopt1])
|
||||
gl_GETOPT_SUBSTITUTE_HEADER
|
||||
gl_PREREQ_GETOPT
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER],
|
||||
@@ -32,40 +31,35 @@ AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
|
||||
fi
|
||||
|
||||
if test -z "$GETOPT_H"; then
|
||||
AC_CHECK_FUNCS([getopt_long_only], [], [GETOPT_H=getopt.h])
|
||||
AC_CHECK_FUNCS([getopt_long], [], [GETOPT_H=getopt.h])
|
||||
fi
|
||||
|
||||
dnl BSD getopt_long uses an incompatible method to reset option processing,
|
||||
dnl and (as of 2004-10-15) mishandles optional option-arguments.
|
||||
dnl BSD getopt_long uses a way to reset option processing, that is different
|
||||
dnl from GNU and Solaris (which copied the GNU behavior). We support both
|
||||
dnl GNU and BSD style resetting of getopt_long(), so there's no need to use
|
||||
dnl GNU getopt_long() on BSD due to different resetting style.
|
||||
dnl
|
||||
dnl With getopt_long(), some BSD versions have a bug in handling optional
|
||||
dnl arguments. This bug appears only if the environment variable
|
||||
dnl POSIXLY_CORRECT has been set, so it shouldn't be too bad in most
|
||||
dnl cases; probably most don't have that variable set. But if we actually
|
||||
dnl hit this bug, it is a real problem due to our heavy use of optional
|
||||
dnl arguments.
|
||||
dnl
|
||||
dnl According to CVS logs, the bug was introduced in OpenBSD in 2003-09-22
|
||||
dnl and copied to FreeBSD in 2004-02-24. It was fixed in both in 2006-09-22,
|
||||
dnl so the affected versions shouldn't be popular anymore anyway. NetBSD
|
||||
dnl never had this bug. TODO: What about Darwin and others?
|
||||
if test -z "$GETOPT_H"; then
|
||||
AC_CHECK_DECL([optreset], [GETOPT_H=getopt.h], [], [#include <getopt.h>])
|
||||
AC_CHECK_DECL([optreset],
|
||||
[AC_DEFINE([HAVE_OPTRESET], 1,
|
||||
[Define to 1 if getopt.h declares extern int optreset.])],
|
||||
[], [#include <getopt.h>])
|
||||
fi
|
||||
|
||||
dnl Solaris 10 getopt doesn't handle `+' as a leading character in an
|
||||
dnl option string (as of 2005-05-05).
|
||||
if test -z "$GETOPT_H"; then
|
||||
AC_CACHE_CHECK([for working GNU getopt function], [gl_cv_func_gnu_getopt],
|
||||
[AC_RUN_IFELSE(
|
||||
[AC_LANG_PROGRAM([#include <getopt.h>],
|
||||
[[
|
||||
char *myargv[3];
|
||||
myargv[0] = "conftest";
|
||||
myargv[1] = "-+";
|
||||
myargv[2] = 0;
|
||||
return getopt (2, myargv, "+a") != '?';
|
||||
]])],
|
||||
[gl_cv_func_gnu_getopt=yes],
|
||||
[gl_cv_func_gnu_getopt=no],
|
||||
[dnl cross compiling - pessimistically guess based on decls
|
||||
dnl Solaris 10 getopt doesn't handle `+' as a leading character in an
|
||||
dnl option string (as of 2005-05-05).
|
||||
AC_CHECK_DECL([getopt_clip],
|
||||
[gl_cv_func_gnu_getopt=no], [gl_cv_func_gnu_getopt=yes],
|
||||
[#include <getopt.h>])])])
|
||||
if test "$gl_cv_func_gnu_getopt" = "no"; then
|
||||
GETOPT_H=getopt.h
|
||||
fi
|
||||
fi
|
||||
dnl option string (as of 2005-05-05). We don't use that feature, so this
|
||||
dnl is not a problem for us. Thus, the respective test was removed here.
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_GETOPT_IFELSE],
|
||||
@@ -75,9 +69,3 @@ AC_DEFUN([gl_GETOPT_IFELSE],
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_GETOPT], [gl_GETOPT_IFELSE([gl_GETOPT_SUBSTITUTE])])
|
||||
|
||||
# Prerequisites of lib/getopt*.
|
||||
AC_DEFUN([gl_PREREQ_GETOPT],
|
||||
[
|
||||
AC_CHECK_DECLS_ONCE([getenv])
|
||||
])
|
||||
|
||||
63
m4/posix-shell.m4
Normal file
63
m4/posix-shell.m4
Normal file
@@ -0,0 +1,63 @@
|
||||
# Find a POSIX-conforming shell.
|
||||
|
||||
# Copyright (C) 2007-2008 Free Software Foundation, Inc.
|
||||
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# Written by Paul Eggert.
|
||||
|
||||
# If a POSIX-conforming shell can be found, set POSIX_SHELL and
|
||||
# PREFERABLY_POSIX_SHELL to it. If not, set POSIX_SHELL to the
|
||||
# empty string and PREFERABLY_POSIX_SHELL to '/bin/sh'.
|
||||
|
||||
AC_DEFUN([gl_POSIX_SHELL],
|
||||
[
|
||||
AC_CACHE_CHECK([for a shell that conforms to POSIX], [gl_cv_posix_shell],
|
||||
[gl_test_posix_shell_script='
|
||||
func_return () {
|
||||
(exit [$]1)
|
||||
}
|
||||
func_success () {
|
||||
func_return 0
|
||||
}
|
||||
func_failure () {
|
||||
func_return 1
|
||||
}
|
||||
func_ret_success () {
|
||||
return 0
|
||||
}
|
||||
func_ret_failure () {
|
||||
return 1
|
||||
}
|
||||
subshell_umask_sanity () {
|
||||
(umask 22; (umask 0); test $(umask) -eq 22)
|
||||
}
|
||||
test "[$](echo foo)" = foo &&
|
||||
func_success &&
|
||||
! func_failure &&
|
||||
func_ret_success &&
|
||||
! func_ret_failure &&
|
||||
(set x && func_ret_success y && test x = "[$]1") &&
|
||||
subshell_umask_sanity
|
||||
'
|
||||
for gl_cv_posix_shell in \
|
||||
"$CONFIG_SHELL" "$SHELL" /bin/sh /bin/bash /bin/ksh /bin/sh5 no; do
|
||||
case $gl_cv_posix_shell in
|
||||
/*)
|
||||
"$gl_cv_posix_shell" -c "$gl_test_posix_shell_script" 2>/dev/null \
|
||||
&& break;;
|
||||
esac
|
||||
done])
|
||||
|
||||
if test "$gl_cv_posix_shell" != no; then
|
||||
POSIX_SHELL=$gl_cv_posix_shell
|
||||
PREFERABLY_POSIX_SHELL=$POSIX_SHELL
|
||||
else
|
||||
POSIX_SHELL=
|
||||
PREFERABLY_POSIX_SHELL=/bin/sh
|
||||
fi
|
||||
AC_SUBST([POSIX_SHELL])
|
||||
AC_SUBST([PREFERABLY_POSIX_SHELL])
|
||||
])
|
||||
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
|
||||
176
m4/tuklib_cpucores.m4
Normal file
176
m4/tuklib_cpucores.m4
Normal file
@@ -0,0 +1,176 @@
|
||||
#
|
||||
# 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)
|
||||
# - sched_getaffinity(): glibc (GNU/Linux, GNU/kFreeBSD)
|
||||
# - cpuset_getaffinity(): FreeBSD
|
||||
# - sysctl(): BSDs, OS/2
|
||||
# - sysconf(): GNU/Linux, Solaris, Tru64, IRIX, AIX, QNX, 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], [
|
||||
|
||||
# glibc-based systems (GNU/Linux and GNU/kFreeBSD) have sched_getaffinity().
|
||||
# The CPU_COUNT() macro was added in glibc 2.9 so we try to link the
|
||||
# test program instead of merely compiling it. glibc 2.9 is old enough that
|
||||
# if someone uses the code on older glibc, the fallback to sysconf() should
|
||||
# be good enough.
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <sched.h>
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
cpu_set_t cpu_mask;
|
||||
sched_getaffinity(0, sizeof(cpu_mask), &cpu_mask);
|
||||
return CPU_COUNT(&cpu_mask);
|
||||
}
|
||||
]])], [tuklib_cv_cpucores_method=sched_getaffinity], [
|
||||
|
||||
# FreeBSD has both cpuset and sysctl. Look for cpuset first because
|
||||
# it's a better approach.
|
||||
#
|
||||
# This test would match on GNU/kFreeBSD too but it would require
|
||||
# -lfreebsd-glue when linking and thus in the current form this would
|
||||
# fail on GNU/kFreeBSD. The above test for sched_getaffinity() matches
|
||||
# on GNU/kFreeBSD so the test below should never run on that OS.
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <sys/param.h>
|
||||
#include <sys/cpuset.h>
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
cpuset_t set;
|
||||
cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1,
|
||||
sizeof(set), &set);
|
||||
return 0;
|
||||
}
|
||||
]])], [tuklib_cv_cpucores_method=cpuset], [
|
||||
|
||||
# On OS/2, both sysconf() and sysctl() pass the tests in this file,
|
||||
# but only sysctl() works. On QNX it's the opposite: only sysconf() works
|
||||
# (although it assumes that _POSIX_SOURCE, _XOPEN_SOURCE, and _POSIX_C_SOURCE
|
||||
# are undefined or alternatively _QNX_SOURCE is defined).
|
||||
#
|
||||
# We test sysctl() first and intentionally break the sysctl() test on QNX
|
||||
# so that sysctl() is never used on QNX.
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#ifdef __QNX__
|
||||
compile error
|
||||
#endif
|
||||
#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
|
||||
sched_getaffinity)
|
||||
AC_DEFINE([TUKLIB_CPUCORES_SCHED_GETAFFINITY], [1],
|
||||
[Define to 1 if the number of available CPU cores
|
||||
can be detected with sched_getaffinity()])
|
||||
;;
|
||||
cpuset)
|
||||
AC_DEFINE([TUKLIB_CPUCORES_CPUSET], [1],
|
||||
[Define to 1 if the number of available CPU cores
|
||||
can be detected with cpuset(2).])
|
||||
;;
|
||||
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), OpenVMS, AROS,
|
||||
# and QNX 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__) || defined(__QNX__)
|
||||
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
|
||||
31
po/.gitignore
vendored
Normal file
31
po/.gitignore
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
# autopoint
|
||||
Makefile.in.in
|
||||
Makevars.template
|
||||
Rules-quot
|
||||
boldquot.sed
|
||||
en@boldquot.header
|
||||
en@quot.header
|
||||
insert-header.sin
|
||||
quot.sed
|
||||
remove-potcdate.sin
|
||||
|
||||
# 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
|
||||
@@ -1 +1,6 @@
|
||||
fi
|
||||
cs
|
||||
de
|
||||
fr
|
||||
it
|
||||
pl
|
||||
vi
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
# List of source files which contain translatable strings.
|
||||
src/lzma/help.c
|
||||
src/lzma/alloc.c
|
||||
src/lzma/args.c
|
||||
src/lzma/error.c
|
||||
src/lzma/io.c
|
||||
src/lzma/list.c
|
||||
src/lzma/main.c
|
||||
src/lzma/options.c
|
||||
src/lzma/process.c
|
||||
src/lzma/suffix.c
|
||||
src/lzma/util.c
|
||||
lib/getopt.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/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:"
|
||||
993
po/de.po
Normal file
993
po/de.po
Normal file
@@ -0,0 +1,993 @@
|
||||
# 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: 2015-08-07 05:10+0200\n"
|
||||
"PO-Revision-Date: 2015-08-07 14:00+0200\n"
|
||||
"Last-Translator: <sqrt@entless.org>\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 Dateiformat"
|
||||
|
||||
#: 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 eine Datei 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 einer 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 Softwareversionen 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 Filterkette 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 "Dekomprimierung 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 Speichernutzungslimit 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örterbuchgröße von %s MiB to %s MiB an, um nicht das Speichernutzungslimit von %s MiB zu übersteigen"
|
||||
|
||||
#: src/xz/file_io.c:100 src/xz/file_io.c:108
|
||||
#, c-format
|
||||
msgid "Error creating a pipe: %s"
|
||||
msgstr "Fehler beim Erzeugen der Pipeline: %s"
|
||||
|
||||
#: src/xz/file_io.c:163
|
||||
msgid "Sandbox is disabled due to incompatible command line arguments"
|
||||
msgstr "Sandbox ist wegen inkompatibler Kommandozeilenargumente deaktiviert"
|
||||
|
||||
#: src/xz/file_io.c:206
|
||||
msgid "Sandbox was successfully enabled"
|
||||
msgstr "Sandbox wurde erfolgreich aktiviert"
|
||||
|
||||
#: src/xz/file_io.c:210
|
||||
msgid "Failed to enable the sandbox"
|
||||
msgstr "Konnte Sandbox nicht aktivieren"
|
||||
|
||||
#: src/xz/file_io.c:252
|
||||
#, 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:322
|
||||
#, 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:329 src/xz/file_io.c:847
|
||||
#, c-format
|
||||
msgid "%s: Cannot remove: %s"
|
||||
msgstr "%s: Kann nicht löschen: %s"
|
||||
|
||||
#: src/xz/file_io.c:354
|
||||
#, c-format
|
||||
msgid "%s: Cannot set the file owner: %s"
|
||||
msgstr "%s: Kann Dateieigentümer nicht setzen: %s"
|
||||
|
||||
#: src/xz/file_io.c:360
|
||||
#, c-format
|
||||
msgid "%s: Cannot set the file group: %s"
|
||||
msgstr "%s: Kann Dateigruppe nicht setzen: %s"
|
||||
|
||||
#: src/xz/file_io.c:379
|
||||
#, c-format
|
||||
msgid "%s: Cannot set the file permissions: %s"
|
||||
msgstr "%s: Kann Zugriffsrechte nicht setzen: %s"
|
||||
|
||||
#: src/xz/file_io.c:489
|
||||
#, 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:543 src/xz/file_io.c:605
|
||||
#, c-format
|
||||
msgid "%s: Is a symbolic link, skipping"
|
||||
msgstr "%s: Überspringe symbolischen Link"
|
||||
|
||||
#: src/xz/file_io.c:634
|
||||
#, c-format
|
||||
msgid "%s: Is a directory, skipping"
|
||||
msgstr "%s: Überspringe Verzeichnis"
|
||||
|
||||
#: src/xz/file_io.c:640
|
||||
#, c-format
|
||||
msgid "%s: Not a regular file, skipping"
|
||||
msgstr "%s: Keine reguläre Datei, überspringe"
|
||||
|
||||
#: src/xz/file_io.c:657
|
||||
#, 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:664
|
||||
#, c-format
|
||||
msgid "%s: File has sticky bit set, skipping"
|
||||
msgstr "%s: Datei hat sticky-Bit gesetzt, überspringe"
|
||||
|
||||
#: src/xz/file_io.c:671
|
||||
#, 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:756
|
||||
#, 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:805
|
||||
#, 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:983
|
||||
#, c-format
|
||||
msgid "Error restoring the O_APPEND flag to standard output: %s"
|
||||
msgstr "Fehler beim Wiederherstellen des O_APPEND-Flags bei Standardausgabe: %s"
|
||||
|
||||
#: src/xz/file_io.c:995
|
||||
#, c-format
|
||||
msgid "%s: Closing the file failed: %s"
|
||||
msgstr "%s: Fehler beim Schließen der Datei: %s"
|
||||
|
||||
#: src/xz/file_io.c:1031 src/xz/file_io.c:1257
|
||||
#, c-format
|
||||
msgid "%s: Seeking failed when trying to create a sparse file: %s"
|
||||
msgstr "%s: Positionierungsfehler beim Versuch eine sparse (dünnbesetzte) Datei zu erzeugen: %s"
|
||||
|
||||
#: src/xz/file_io.c:1126
|
||||
#, c-format
|
||||
msgid "%s: Read error: %s"
|
||||
msgstr "%s: Lesefehler: %s"
|
||||
|
||||
#: src/xz/file_io.c:1146
|
||||
#, c-format
|
||||
msgid "%s: Error seeking the file: %s"
|
||||
msgstr "%s: Fehler beim Lesen der Dateinamen: %s"
|
||||
|
||||
#: src/xz/file_io.c:1156
|
||||
#, c-format
|
||||
msgid "%s: Unexpected end of file"
|
||||
msgstr "%s: Unerwartetes Ende der Datei"
|
||||
|
||||
#: src/xz/file_io.c:1215
|
||||
#, 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 "Speichernutzungslimit für Komprimierung: "
|
||||
|
||||
#: src/xz/hardware.c:130
|
||||
msgid "Memory usage limit for decompression: "
|
||||
msgstr "Speichernutzungslimit für Dekomprimierung: "
|
||||
|
||||
#. 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 eine gültige .xz-Datei 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-Zeichen 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 "Komprimierung und Dekomprimierung mit --robot ist noch nicht unterstützt."
|
||||
|
||||
#: src/xz/main.c:249
|
||||
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:714
|
||||
#, c-format
|
||||
msgid "%s: "
|
||||
msgstr "%s: "
|
||||
|
||||
#: src/xz/message.c:777 src/xz/message.c:827
|
||||
msgid "Internal error (bug)"
|
||||
msgstr "Interner Fehler (Bug)"
|
||||
|
||||
#: src/xz/message.c:784
|
||||
msgid "Cannot establish signal handlers"
|
||||
msgstr "Kann Signalroutine nicht setzen"
|
||||
|
||||
#: src/xz/message.c:793
|
||||
msgid "No integrity check; not verifying file integrity"
|
||||
msgstr "Kein Integritäts-Check; werde Datei-Integrität nicht überprüfen"
|
||||
|
||||
#: src/xz/message.c:796
|
||||
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:803
|
||||
msgid "Memory usage limit reached"
|
||||
msgstr "Speichernutzungslimit erreicht"
|
||||
|
||||
#: src/xz/message.c:806
|
||||
msgid "File format not recognized"
|
||||
msgstr "Dateiformat nicht erkannt"
|
||||
|
||||
#: src/xz/message.c:809
|
||||
msgid "Unsupported options"
|
||||
msgstr "Optionen nicht unterstützt"
|
||||
|
||||
#: src/xz/message.c:812
|
||||
msgid "Compressed data is corrupt"
|
||||
msgstr "Komprimierte Daten sind korrupt"
|
||||
|
||||
#: src/xz/message.c:815
|
||||
msgid "Unexpected end of input"
|
||||
msgstr "Unerwartetes Ende der Eingabe"
|
||||
|
||||
#: src/xz/message.c:848
|
||||
#, 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:876
|
||||
#, 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:1043
|
||||
#, c-format
|
||||
msgid "%s: Filter chain: %s\n"
|
||||
msgstr "%s: Filterkette: %s\n"
|
||||
|
||||
#: src/xz/message.c:1053
|
||||
#, c-format
|
||||
msgid "Try `%s --help' for more information."
|
||||
msgstr "Versuchen Sie `%s --help' für mehr Informationen."
|
||||
|
||||
#: src/xz/message.c:1079
|
||||
#, 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:1086
|
||||
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:1090
|
||||
msgid " Operation mode:\n"
|
||||
msgstr " Operationsmodus:\n"
|
||||
|
||||
#: src/xz/message.c:1093
|
||||
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 Dateiintegrität\n"
|
||||
" -l, --list Führe Dateiinformationen auf"
|
||||
|
||||
#: src/xz/message.c:1099
|
||||
msgid ""
|
||||
"\n"
|
||||
" Operation modifiers:\n"
|
||||
msgstr ""
|
||||
"\n"
|
||||
" Operationsmodifikatoren:\n"
|
||||
|
||||
#: src/xz/message.c:1102
|
||||
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 Standardausgabe und lösche nicht die\n"
|
||||
" Eingabedateien"
|
||||
|
||||
#: src/xz/message.c:1108
|
||||
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:1111
|
||||
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 beim Dekomprimieren keine dünnbesetzten\n"
|
||||
" (sparse) Dateien\n"
|
||||
" -S, --suffix=.SUF Benutze `.SUF' als Endung für komprimierte Dateien\n"
|
||||
" --files=[DATEI] Lese zu verarbeitende Dateinamen von DATEI; falls\n"
|
||||
" DATEI nicht angegeben wurde, werden Dateinamen\n"
|
||||
" von der Standardeingabe gelesen. Dateinamen müssen mit\n"
|
||||
" einem Zeilenumbruch voneinander getrennt werden\n"
|
||||
" --files0=[DATEI] Wie --files, aber benutze das Null-Zeichen als Trenner"
|
||||
|
||||
#: src/xz/message.c:1120
|
||||
msgid ""
|
||||
"\n"
|
||||
" Basic file format and compression options:\n"
|
||||
msgstr ""
|
||||
"\n"
|
||||
" Grundlegende Optionen für Dateiformat und Komprimierung:\n"
|
||||
|
||||
#: src/xz/message.c:1122
|
||||
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:1127
|
||||
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:1131
|
||||
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 Komprimierers *und* des\n"
|
||||
" Dekomprimierers, wenn Sie 7-9 benutzen!"
|
||||
|
||||
#: src/xz/message.c:1135
|
||||
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. Dies beeinflusst nicht den\n"
|
||||
" Speicherbedarf des Dekomprimierers."
|
||||
|
||||
#: src/xz/message.c:1139
|
||||
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 Prozessorkerne\n"
|
||||
" gibt"
|
||||
|
||||
#: src/xz/message.c:1144
|
||||
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 Bytes Eingabe;\n"
|
||||
" Benutzen Sie diese Option um die Block Größe für\n"
|
||||
" Komprimierung mit mehreren Threads zu setzen"
|
||||
|
||||
#: src/xz/message.c:1148
|
||||
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:1152
|
||||
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 seit der letzten Flush-Operation ver-\n"
|
||||
" gangen sind und das Lesen von zusätzlichen Eingabe-\n"
|
||||
" daten den Prozess blockieren würde, dann werden alle\n"
|
||||
" noch ausstehenden Daten geschrieben"
|
||||
|
||||
#: src/xz/message.c:1158
|
||||
#, 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 Speichernutzungslimit für Komprimierung,\n"
|
||||
" Dekomprimierung, oder beides; LIMIT ist in Bytes, % RAM,\n"
|
||||
" oder 0 für Verwenden der Grundeinstellungen."
|
||||
|
||||
#: src/xz/message.c:1165
|
||||
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:1171
|
||||
msgid ""
|
||||
"\n"
|
||||
" Custom filter chain for compression (alternative for using presets):"
|
||||
msgstr ""
|
||||
"\n"
|
||||
" Benutzerdef. Filterkette für Komprimierung (alternativ zu Voreinstellung):"
|
||||
|
||||
#: src/xz/message.c:1180
|
||||
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örterbuchgröße (4 KiB - 1536 MiB; 8 MiB)\n"
|
||||
" lc=NUM Anzahl der Literal-Kontext-Bits (0-4; 3)\n"
|
||||
" lp=NUM Anzahl der Literal-Positions-Bits (0-4; 0)\n"
|
||||
" pb=NUM Anzahl der Positions-Bits (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:1195
|
||||
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:1207
|
||||
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:1215
|
||||
msgid ""
|
||||
"\n"
|
||||
" Other options:\n"
|
||||
msgstr ""
|
||||
"\n"
|
||||
" Andere Optionen:\n"
|
||||
|
||||
#: src/xz/message.c:1218
|
||||
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:1223
|
||||
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:1225
|
||||
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:1228
|
||||
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:1231
|
||||
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 an (zeigt nur die grundlegenden\n"
|
||||
" Optionen)\n"
|
||||
" -H, --long-help Zeige diese lange Hilfe an und terminiere"
|
||||
|
||||
#: src/xz/message.c:1235
|
||||
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:1240
|
||||
msgid " -V, --version display the version number and exit"
|
||||
msgstr " -V, --version Zeige Versionsnummer an und terminiere"
|
||||
|
||||
#: src/xz/message.c:1242
|
||||
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:1248
|
||||
#, c-format
|
||||
msgid "Report bugs to <%s> (in English or Finnish).\n"
|
||||
msgstr ""
|
||||
"Melde Bugs an <%s> (auf Englisch oder Finnisch).\n"
|
||||
"Melde Übersetzungsfehler an <maan@tuebingen.mpg.de> (auf Engl. oder Deutsch).\n"
|
||||
|
||||
#: src/xz/message.c:1250
|
||||
#, c-format
|
||||
msgid "%s home page: <%s>\n"
|
||||
msgstr "%s Homepage: <%s>\n"
|
||||
|
||||
#: src/xz/message.c:1254
|
||||
msgid "THIS IS A DEVELOPMENT VERSION NOT INTENDED FOR PRODUCTION USE."
|
||||
msgstr "DIES IST EINE NICHT FÜR DEN PRODUKTIVBETRIEB GEEIGNETE ENTWICKLERVERSION."
|
||||
|
||||
#: 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 Dateiendung"
|
||||
|
||||
#: 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 "Leerer 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"
|
||||
|
||||
#~ msgid "Error setting O_NONBLOCK on standard input: %s"
|
||||
#~ msgstr "Fehler beim Setzen des O_NONBLOCK-Flags für Standardausgabe: %s"
|
||||
|
||||
#~ msgid "Error setting O_NONBLOCK on standard output: %s"
|
||||
#~ msgstr "Fehler beim Setzen von O_NONBLOCK für die Standardausgabe: %s"
|
||||
446
po/fi.po
446
po/fi.po
@@ -1,446 +0,0 @@
|
||||
# translation of fi.po to Finnish
|
||||
# This file is put in the public domain.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: fi\n"
|
||||
"Report-Msgid-Bugs-To: lasse.collin@tukaani.org\n"
|
||||
"POT-Creation-Date: 2008-01-07 21:30+0200\n"
|
||||
"PO-Revision-Date: 2007-08-09 22:14+0300\n"
|
||||
"Last-Translator: Lasse Collin <lasse.collin@tukaani.org>\n"
|
||||
"Language-Team: Finnish\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: src/lzma/help.c:28
|
||||
#, c-format
|
||||
msgid "Try `%s --help' for more information."
|
||||
msgstr "Lisätietoja saa komennolla \"%s --help\"."
|
||||
|
||||
#: src/lzma/help.c:36
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Usage: %s [OPTION]... [FILE]...\n"
|
||||
"Compress or decompress FILEs in the .lzma format.\n"
|
||||
"\n"
|
||||
msgstr ""
|
||||
"Käyttö: %s [VALITSIN]... [TIEDOSTO]...\n"
|
||||
"Pakkaa tai purkaa .lzma-muotoiset TIEDOSTOt\n"
|
||||
"\n"
|
||||
|
||||
#: src/lzma/help.c:40
|
||||
msgid "Mandatory arguments to long options are mandatory for short options too.\n"
|
||||
msgstr "Pitkien valitsinten pakolliset argumentit ovat pakollisia myös lyhyille.\n"
|
||||
|
||||
#: src/lzma/help.c:44
|
||||
msgid ""
|
||||
" Operation mode:\n"
|
||||
"\n"
|
||||
" -z, --compress force compression\n"
|
||||
" -d, --decompress force decompression\n"
|
||||
" -t, --test test compressed file integrity\n"
|
||||
" -l, --list list block sizes, total sizes, and possible metadata\n"
|
||||
msgstr ""
|
||||
|
||||
#: src/lzma/help.c:53
|
||||
msgid ""
|
||||
" Operation modifiers:\n"
|
||||
"\n"
|
||||
" -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\n"
|
||||
" -S, --suffix=.SUF use suffix `.SUF' on compressed files instead of `.lzma'\n"
|
||||
" -F, --format=FMT file format to encode or decode; possible values are\n"
|
||||
" `auto', `native', `single', `multi', and `alone'\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 nul byte as terminator\n"
|
||||
msgstr ""
|
||||
|
||||
#: src/lzma/help.c:68
|
||||
msgid ""
|
||||
" Compression presets and basic compression options:\n"
|
||||
"\n"
|
||||
" -1 .. -2 fast compression\n"
|
||||
" -3 .. -6 good compression\n"
|
||||
" -7 .. -9 excellent compression, but needs a lot of memory;\n"
|
||||
" default is -7 if memory limit allows\n"
|
||||
"\n"
|
||||
" -C, --check=CHECK integrity check type: `crc32', `crc64' (default),\n"
|
||||
" or `sha256'\n"
|
||||
msgstr ""
|
||||
|
||||
#: src/lzma/help.c:80
|
||||
msgid ""
|
||||
" Custom filter chain for compression (alternative for using presets):\n"
|
||||
"\n"
|
||||
" --lzma=[OPTS] LZMA filter; OPTS is a comma-separated list of zero or\n"
|
||||
" more of the following options (valid values; default):\n"
|
||||
" dict=NUM dictionary size in bytes (1 - 1Gi; 8Mi)\n"
|
||||
" lc=NUM number of literal context bits (0-8; 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' or `best'; `best')\n"
|
||||
" fb=NUM number of fast bytes (5-273; 128)\n"
|
||||
" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; bt4)\n"
|
||||
" mfc=NUM match finder cycles; 0=automatic (default)\n"
|
||||
"\n"
|
||||
" --x86 x86 filter (sometimes called BCJ filter)\n"
|
||||
" --powerpc PowerPC (big endian) filter\n"
|
||||
" --ia64 IA64 (Itanium) filter\n"
|
||||
" --arm ARM filter\n"
|
||||
" --armthumb ARM-Thumb filter\n"
|
||||
" --sparc SPARC filter\n"
|
||||
"\n"
|
||||
" --copy No filtering (useful only when specified alone)\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)\n"
|
||||
msgstr ""
|
||||
|
||||
#: src/lzma/help.c:120
|
||||
msgid ""
|
||||
" Resource usage options:\n"
|
||||
"\n"
|
||||
" -M, --memory=NUM use roughly NUM bytes of memory at maximum\n"
|
||||
" -T, --threads=NUM use at maximum of NUM (de)compression threads\n"
|
||||
msgstr ""
|
||||
|
||||
#: src/lzma/help.c:129
|
||||
msgid ""
|
||||
" Other options:\n"
|
||||
"\n"
|
||||
" -q, --quiet suppress warnings; specify twice to suppress errors too\n"
|
||||
" -v, --verbose be verbose; specify twice for even more verbose\n"
|
||||
"\n"
|
||||
" -h, --help display this help and exit\n"
|
||||
" -V, --version display version and license information and exit\n"
|
||||
msgstr ""
|
||||
|
||||
#: src/lzma/help.c:137
|
||||
msgid "With no FILE, or when FILE is -, read standard input.\n"
|
||||
msgstr "Jos TIEDOSTOa ei ole annettu, tai se on \"-\", luetaan vakiosyötettä.\n"
|
||||
|
||||
#: src/lzma/help.c:144
|
||||
msgid "On this system and configuration, the tool will use"
|
||||
msgstr "Tässä järjestelmässä näillä asetuksilla, tämä työkalu käyttää"
|
||||
|
||||
#: src/lzma/help.c:145
|
||||
#, c-format
|
||||
msgid " * roughly %<PRIu64> MiB of memory at maximum; and\n"
|
||||
msgstr " * korkeintaan %<PRIu64> MiB keskusmuistia (suurpiirteinen rajoitus); ja\n"
|
||||
|
||||
#: src/lzma/help.c:147
|
||||
msgid ""
|
||||
" * at maximum of one thread for (de)compression.\n"
|
||||
"\n"
|
||||
msgstr ""
|
||||
" * korkeintaan yhtä säiettä pakkaukseen tai purkuun.\n"
|
||||
"\n"
|
||||
|
||||
#: src/lzma/help.c:152
|
||||
#, c-format
|
||||
msgid "Report bugs to <%s> (in English or Finnish).\n"
|
||||
msgstr ""
|
||||
"Lähetä raportit ohjelmistovioista (englanniksi tai suomeksi)\n"
|
||||
"osoitteeseen <%s>.\n"
|
||||
|
||||
#: src/lzma/args.c:128
|
||||
msgid "Maximum number of filters is seven"
|
||||
msgstr "Suotimia voi olla korkeintaan seitsemän"
|
||||
|
||||
#: src/lzma/args.c:193
|
||||
#, c-format
|
||||
msgid "%s: Invalid filename suffix"
|
||||
msgstr "%s: Virheellinen tiedostonimen pääte"
|
||||
|
||||
#: src/lzma/args.c:327
|
||||
#, c-format
|
||||
msgid "%s: Unknown file format type"
|
||||
msgstr "%s: Tuntematon tiedostomuodon tyyppi"
|
||||
|
||||
#: src/lzma/args.c:353
|
||||
#, c-format
|
||||
msgid "%s: Unknown integrity check type"
|
||||
msgstr "%s: Tuntematon eheystarkisteen tyyppi"
|
||||
|
||||
#: src/lzma/args.c:371
|
||||
msgid "Only one file can be specified with `--files'or `--files0'."
|
||||
msgstr ""
|
||||
|
||||
#: src/lzma/args.c:421
|
||||
msgid "The environment variable LZMA_OPT contains too many arguments"
|
||||
msgstr "Ympäristömuuttuja LZMA_OPT sisältää liian monta argumenttia"
|
||||
|
||||
#: src/lzma/args.c:485
|
||||
msgid "Memory usage limit is too small for any internal filter preset"
|
||||
msgstr ""
|
||||
|
||||
#: src/lzma/args.c:500
|
||||
msgid "Memory usage limit is too small for the given filter setup"
|
||||
msgstr "Muistinkäyttörajoitus on liian pieni annetuille suodinasetusille"
|
||||
|
||||
#: src/lzma/error.c:35
|
||||
msgid "Operation successful"
|
||||
msgstr ""
|
||||
|
||||
#: src/lzma/error.c:38
|
||||
msgid "Operation finished successfully"
|
||||
msgstr ""
|
||||
|
||||
#: src/lzma/error.c:41 src/lzma/error.c:153
|
||||
msgid "Internal error (bug)"
|
||||
msgstr "Sisäinen virhe (bugi)"
|
||||
|
||||
#: src/lzma/error.c:44
|
||||
msgid "Compressed data is corrupt"
|
||||
msgstr "Pakattu data on korruptoitunut"
|
||||
|
||||
#: src/lzma/error.c:50
|
||||
msgid "Unexpected end of input"
|
||||
msgstr ""
|
||||
|
||||
#: src/lzma/error.c:53
|
||||
msgid "Unsupported options"
|
||||
msgstr ""
|
||||
|
||||
#: src/lzma/error.c:56
|
||||
msgid "Unsupported integrity check type"
|
||||
msgstr ""
|
||||
|
||||
#: src/lzma/error.c:87 src/lzma/error.c:93
|
||||
#, c-format
|
||||
msgid "Writing to standard output failed: %s"
|
||||
msgstr ""
|
||||
|
||||
#: src/lzma/io.c:81
|
||||
#, c-format
|
||||
msgid "Cannot get file descriptor of the current directory: %s"
|
||||
msgstr ""
|
||||
|
||||
#: src/lzma/io.c:123 src/lzma/util.c:127
|
||||
#, c-format
|
||||
msgid "%s: Invalid filename"
|
||||
msgstr "%s: Virheellinen tiedostonimi"
|
||||
|
||||
#: src/lzma/io.c:130 src/lzma/io.c:233
|
||||
#, c-format
|
||||
msgid "Cannot change directory: %s"
|
||||
msgstr "Hakemiston vaihtaminen epäonnistui: %s"
|
||||
|
||||
#: src/lzma/io.c:135
|
||||
#, c-format
|
||||
msgid "%s: File seems to be moved, not removing"
|
||||
msgstr "%s: Tiedosto näyttää olevan siirretty, ei poisteta"
|
||||
|
||||
#: src/lzma/io.c:141
|
||||
#, c-format
|
||||
msgid "%s: Cannot remove: %s"
|
||||
msgstr ""
|
||||
|
||||
#: src/lzma/io.c:164
|
||||
#, c-format
|
||||
msgid "%s: Cannot set the file owner: %s"
|
||||
msgstr "%s: Tiedoston omistajuuden asetus epäonnistui: %s"
|
||||
|
||||
#: src/lzma/io.c:170
|
||||
#, c-format
|
||||
msgid "%s: Cannot set the file group: %s"
|
||||
msgstr "%s: Tiedoston ryhmän asetus epäonnistui: %s"
|
||||
|
||||
#: src/lzma/io.c:189
|
||||
#, c-format
|
||||
msgid "%s: Cannot set the file permissions: %s"
|
||||
msgstr "%s: Tiedoston oikeuksien asetus epäonnistui: %s"
|
||||
|
||||
#: src/lzma/io.c:252
|
||||
#, c-format
|
||||
msgid "%s: Cannot open the directory containing the file: %s"
|
||||
msgstr ""
|
||||
|
||||
#: src/lzma/io.c:313
|
||||
#, c-format
|
||||
msgid "%s: Is a symbolic link, skipping"
|
||||
msgstr "%s: Symbolinen linkki, ohitetaan"
|
||||
|
||||
#: src/lzma/io.c:330
|
||||
#, c-format
|
||||
msgid "%s: Is a directory, skipping"
|
||||
msgstr "%s: Hakemisto, ohitetaan"
|
||||
|
||||
#: src/lzma/io.c:337 src/lzma/list.c:445
|
||||
#, c-format
|
||||
msgid "%s: Not a regular file, skipping"
|
||||
msgstr "%s: Ei ole tavallinen tiedosto, ohitetaan"
|
||||
|
||||
#: src/lzma/io.c:348
|
||||
#, c-format
|
||||
msgid "%s: File has setuid or setgid bit set, skipping"
|
||||
msgstr "%s: Tiedostolla on setuid- tai setgid-bitti asetettuna, ohitetaan"
|
||||
|
||||
#: src/lzma/io.c:355
|
||||
#, c-format
|
||||
msgid "%s: File has sticky bit set, skipping"
|
||||
msgstr "%s: Tiedostolla on sticky-bitti asetettuna, ohitetaan"
|
||||
|
||||
#: src/lzma/io.c:362
|
||||
#, c-format
|
||||
msgid "%s: Input file has more than one hard link, skipping"
|
||||
msgstr "%s: Tiedostoon viittaa useampi kuin yksi linkki, ohitetaan"
|
||||
|
||||
#: src/lzma/io.c:390 src/lzma/io.c:468
|
||||
#, c-format
|
||||
msgid "%s: Closing the file failed: %s"
|
||||
msgstr "%s: Tiedoston sulkeminen epäonnistui: %s"
|
||||
|
||||
#: src/lzma/io.c:611
|
||||
#, c-format
|
||||
msgid "%s: Read error: %s"
|
||||
msgstr "%s: Lukeminen epäonnistui: %s"
|
||||
|
||||
#: src/lzma/io.c:654
|
||||
#, c-format
|
||||
msgid "%s: Write error: %s"
|
||||
msgstr "%s: Kirjoitus epäonnistui: %s"
|
||||
|
||||
#: src/lzma/list.c:451
|
||||
#, c-format
|
||||
msgid "%s: File is empty"
|
||||
msgstr ""
|
||||
|
||||
#: src/lzma/main.c:57
|
||||
msgid "Cannot establish signal handlers"
|
||||
msgstr "Signaalikäsittelijöiden asetus epäonnistui"
|
||||
|
||||
#: src/lzma/main.c:75
|
||||
msgid "Compressed data not read from a terminal."
|
||||
msgstr "Pakattua dataa ei lueta päätteeltä."
|
||||
|
||||
#: src/lzma/main.c:77 src/lzma/main.c:92
|
||||
msgid "Use `--force' to force decompression."
|
||||
msgstr "Käytä valitsinta \"--force\" pakottaaksesi purun."
|
||||
|
||||
#: src/lzma/main.c:90
|
||||
msgid "Compressed data not written to a terminal."
|
||||
msgstr "Pakattua dataa ei kirjoiteta päätteelle."
|
||||
|
||||
#: src/lzma/main.c:117
|
||||
#, fuzzy, c-format
|
||||
msgid "%s: Error reading filenames: %s"
|
||||
msgstr "%s: Tiedoston sulkeminen epäonnistui: %s"
|
||||
|
||||
#: src/lzma/main.c:122
|
||||
#, c-format
|
||||
msgid "%s: Unexpected end of input when reading filenames"
|
||||
msgstr ""
|
||||
|
||||
#: src/lzma/main.c:212
|
||||
msgid "Cannot read data from standard input when reading filenames from standard input"
|
||||
msgstr "Dataa ei voida lukea oletussyötteestä, kun tiedostonimiä luetaan oletussyötteestä"
|
||||
|
||||
#: src/lzma/options.c:83
|
||||
#, c-format
|
||||
msgid "%s: Options must be `name=value' pairs separated with commas"
|
||||
msgstr "%s: Asetusten tulee olla \"nimi=arvo\"-pareja, jotka on eroteltu pilkuilla"
|
||||
|
||||
#: src/lzma/options.c:111
|
||||
#, c-format
|
||||
msgid "%s: Invalid option value"
|
||||
msgstr "%s: Virheellinen asetuksen arvo"
|
||||
|
||||
#: src/lzma/options.c:124
|
||||
#, c-format
|
||||
msgid "%s: Invalid option name"
|
||||
msgstr "%s: Virheellinen asetuksen nimi"
|
||||
|
||||
#: src/lzma/process.c:142
|
||||
#, c-format
|
||||
msgid "Cannot create a thread: %s"
|
||||
msgstr "Säikeen luonti epäonnistui: %s"
|
||||
|
||||
#: src/lzma/suffix.c:85
|
||||
#, c-format
|
||||
msgid "%s: Filename has an unknown suffix, skipping"
|
||||
msgstr "%s: Tiedostonimellä on tuntematon pääte, ohitetaan"
|
||||
|
||||
#: src/lzma/suffix.c:114
|
||||
#, c-format
|
||||
msgid "%s: File already has `%s' suffix, skipping"
|
||||
msgstr "%s: Tiedostolla on jo \"%s\"-pääte, ohitetaan"
|
||||
|
||||
#: src/lzma/util.c:44
|
||||
#, c-format
|
||||
msgid "%s: Value is not a non-negative decimal integer"
|
||||
msgstr ""
|
||||
|
||||
#: src/lzma/util.c:84
|
||||
#, c-format
|
||||
msgid "%s: Invalid multiplier suffix. Valid suffixes:"
|
||||
msgstr ""
|
||||
|
||||
#: src/lzma/util.c:105
|
||||
#, c-format
|
||||
msgid "Value of the option `%s' must be in the range [%llu, %llu]"
|
||||
msgstr "Asetuksen \"%s\" arvon tulee olla välillä [%llu, %llu]"
|
||||
|
||||
#: src/lzma/util.c:177
|
||||
msgid "Empty filename, skipping"
|
||||
msgstr "Tyhjä tiedostonimi, ohitetaan"
|
||||
|
||||
#: lib/getopt.c:531 lib/getopt.c:547
|
||||
#, c-format
|
||||
msgid "%s: option `%s' is ambiguous\n"
|
||||
msgstr ""
|
||||
|
||||
#: lib/getopt.c:580 lib/getopt.c:584
|
||||
#, c-format
|
||||
msgid "%s: option `--%s' doesn't allow an argument\n"
|
||||
msgstr ""
|
||||
|
||||
#: lib/getopt.c:593 lib/getopt.c:598
|
||||
#, c-format
|
||||
msgid "%s: option `%c%s' doesn't allow an argument\n"
|
||||
msgstr ""
|
||||
|
||||
#: lib/getopt.c:641 lib/getopt.c:660 lib/getopt.c:976 lib/getopt.c:995
|
||||
#, c-format
|
||||
msgid "%s: option `%s' requires an argument\n"
|
||||
msgstr ""
|
||||
|
||||
#: lib/getopt.c:698 lib/getopt.c:701
|
||||
#, c-format
|
||||
msgid "%s: unrecognized option `--%s'\n"
|
||||
msgstr ""
|
||||
|
||||
#: lib/getopt.c:709 lib/getopt.c:712
|
||||
#, c-format
|
||||
msgid "%s: unrecognized option `%c%s'\n"
|
||||
msgstr ""
|
||||
|
||||
#: lib/getopt.c:764 lib/getopt.c:767
|
||||
#, c-format
|
||||
msgid "%s: illegal option -- %c\n"
|
||||
msgstr ""
|
||||
|
||||
#: lib/getopt.c:773 lib/getopt.c:776
|
||||
#, c-format
|
||||
msgid "%s: invalid option -- %c\n"
|
||||
msgstr "%s: virheellinen valitsin -- %c\n"
|
||||
|
||||
#: lib/getopt.c:828 lib/getopt.c:844 lib/getopt.c:1048 lib/getopt.c:1066
|
||||
#, c-format
|
||||
msgid "%s: option requires an argument -- %c\n"
|
||||
msgstr ""
|
||||
|
||||
#: lib/getopt.c:897 lib/getopt.c:913
|
||||
#, c-format
|
||||
msgid "%s: option `-W %s' is ambiguous\n"
|
||||
msgstr ""
|
||||
|
||||
#: lib/getopt.c:937 lib/getopt.c:955
|
||||
#, c-format
|
||||
msgid "%s: option `-W %s' doesn't allow an argument\n"
|
||||
msgstr ""
|
||||
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"
|
||||
@@ -1,16 +1,42 @@
|
||||
##
|
||||
## Copyright (C) 2007 Lasse Collin
|
||||
## Author: Lasse Collin
|
||||
##
|
||||
## This library is free software; you can redistribute it and/or
|
||||
## modify it under the terms of the GNU Lesser General Public
|
||||
## License as published by the Free Software Foundation; either
|
||||
## version 2.1 of the License, or (at your option) any later version.
|
||||
##
|
||||
## This library is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
## Lesser General Public License for more details.
|
||||
## This file has been put into the public domain.
|
||||
## You can do whatever you want with this file.
|
||||
##
|
||||
|
||||
SUBDIRS = liblzma lzma lzmadec 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
|
||||
|
||||
50
src/common/common_w32res.rc
Normal file
50
src/common/common_w32res.rc
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Author: Lasse Collin
|
||||
*
|
||||
* This file has been put into the public domain.
|
||||
* You can do whatever you want with this file.
|
||||
*/
|
||||
|
||||
#include <winresrc.h>
|
||||
#include "config.h"
|
||||
#define LZMA_H_INTERNAL
|
||||
#define LZMA_H_INTERNAL_RC
|
||||
#include "lzma/version.h"
|
||||
|
||||
#ifndef MY_BUILD
|
||||
# define MY_BUILD 0
|
||||
#endif
|
||||
#define MY_VERSION LZMA_VERSION_MAJOR,LZMA_VERSION_MINOR,LZMA_VERSION_PATCH,MY_BUILD
|
||||
|
||||
#define MY_FILENAME MY_NAME MY_SUFFIX
|
||||
#define MY_COMPANY "The Tukaani Project <https://tukaani.org/>"
|
||||
#define MY_PRODUCT PACKAGE_NAME " <" PACKAGE_URL ">"
|
||||
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION MY_VERSION
|
||||
PRODUCTVERSION MY_VERSION
|
||||
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
|
||||
FILEFLAGS 0
|
||||
FILEOS VOS_NT_WINDOWS32
|
||||
FILETYPE MY_TYPE
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", MY_COMPANY
|
||||
VALUE "FileDescription", MY_DESC
|
||||
VALUE "FileVersion", LZMA_VERSION_STRING
|
||||
VALUE "InternalName", MY_NAME
|
||||
VALUE "OriginalFilename", MY_FILENAME
|
||||
VALUE "ProductName", MY_PRODUCT
|
||||
VALUE "ProductVersion", LZMA_VERSION_STRING
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
521
src/common/mythread.h
Normal file
521
src/common/mythread.h
Normal file
@@ -0,0 +1,521 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file mythread.h
|
||||
/// \brief Some threading related helper macros and functions
|
||||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#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 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)
|
||||
|
||||
|
||||
// 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
|
||||
}
|
||||
|
||||
|
||||
// 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 INIT_ONCE once_ = INIT_ONCE_STATIC_INIT; \
|
||||
BOOL pending_; \
|
||||
if (!InitOnceBeginInitialize(&once_, 0, &pending_, NULL)) \
|
||||
abort(); \
|
||||
if (pending_) \
|
||||
func(); \
|
||||
if (!InitOnceComplete(&once, 0, NULL)) \
|
||||
abort(); \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
|
||||
// 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,66 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file physmem.h
|
||||
/// \brief Get the amount of physical memory
|
||||
//
|
||||
// This code has been put into the public domain.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef PHYSMEM_H
|
||||
#define PHYSMEM_H
|
||||
|
||||
#if defined(HAVE_PHYSMEM_SYSCTL) || defined(HAVE_NCPU_SYSCTL)
|
||||
# ifdef HAVE_SYS_PARAM_H
|
||||
# include <sys/param.h>
|
||||
# endif
|
||||
# ifdef HAVE_SYS_SYSCTL_H
|
||||
# include <sys/sysctl.h>
|
||||
# endif
|
||||
#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(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, HW_PHYSMEM };
|
||||
unsigned long mem;
|
||||
size_t mem_ptr_size = sizeof(mem);
|
||||
if (!sysctl(name, 2, &mem, &mem_ptr_size, NULL, NULL)) {
|
||||
// Some systems use unsigned int as the "return value".
|
||||
// This makes a difference on 64-bit boxes.
|
||||
if (mem_ptr_size != sizeof(mem)) {
|
||||
if (mem_ptr_size == sizeof(unsigned int))
|
||||
ret = *(unsigned int *)(&mem);
|
||||
} else {
|
||||
ret = mem;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -6,17 +6,10 @@
|
||||
/// This file is used also by the lzma command line tool, that's why this
|
||||
/// file is separate from common.h.
|
||||
//
|
||||
// Copyright (C) 2007 Lasse Collin
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -31,12 +24,26 @@
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
// 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>
|
||||
|
||||
#ifdef HAVE_INTTYPES_H
|
||||
# include <inttypes.h>
|
||||
#endif
|
||||
|
||||
// C99 says that inttypes.h always includes stdint.h, but some systems
|
||||
// don't do that, and require including stdint.h separately.
|
||||
#ifdef HAVE_STDINT_H
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
|
||||
// Some pre-C99 systems have SIZE_MAX in limits.h instead of stdint.h. The
|
||||
// limits are also used to figure out some macros missing from pre-C99 systems.
|
||||
#ifdef HAVE_LIMITS_H
|
||||
# include <limits.h>
|
||||
#endif
|
||||
@@ -44,7 +51,12 @@
|
||||
// Be more compatible with systems that have non-conforming inttypes.h.
|
||||
// We assume that int is 32-bit and that long is either 32-bit or 64-bit.
|
||||
// Full Autoconf test could be more correct, but this should work well enough.
|
||||
// Note that this duplicates some code from lzma.h, but this is better since
|
||||
// we can work without inttypes.h thanks to Autoconf tests.
|
||||
#ifndef UINT32_C
|
||||
# if UINT_MAX != 4294967295U
|
||||
# error UINT32_C is not defined and unsigned int is not 32-bit.
|
||||
# endif
|
||||
# define UINT32_C(n) n ## U
|
||||
#endif
|
||||
#ifndef UINT32_MAX
|
||||
@@ -53,16 +65,23 @@
|
||||
#ifndef PRIu32
|
||||
# define PRIu32 "u"
|
||||
#endif
|
||||
#ifndef PRIx32
|
||||
# define PRIx32 "x"
|
||||
#endif
|
||||
#ifndef PRIX32
|
||||
# define PRIX32 "X"
|
||||
#endif
|
||||
#if SIZEOF_UNSIGNED_LONG == 4
|
||||
|
||||
#if ULONG_MAX == 4294967295UL
|
||||
# ifndef UINT64_C
|
||||
# define UINT64_C(n) n ## ULL
|
||||
# endif
|
||||
# ifndef PRIu64
|
||||
# define PRIu64 "llu"
|
||||
# endif
|
||||
# ifndef PRIx64
|
||||
# define PRIx64 "llx"
|
||||
# endif
|
||||
# ifndef PRIX64
|
||||
# define PRIX64 "llX"
|
||||
# endif
|
||||
@@ -73,6 +92,9 @@
|
||||
# ifndef PRIu64
|
||||
# define PRIu64 "lu"
|
||||
# endif
|
||||
# ifndef PRIx64
|
||||
# define PRIx64 "lx"
|
||||
# endif
|
||||
# ifndef PRIX64
|
||||
# define PRIX64 "lX"
|
||||
# endif
|
||||
@@ -80,16 +102,43 @@
|
||||
#ifndef UINT64_MAX
|
||||
# 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
|
||||
# define SIZE_MAX UINT32_MAX
|
||||
# else
|
||||
# elif SIZEOF_SIZE_T == 8
|
||||
# define SIZE_MAX UINT64_MAX
|
||||
# else
|
||||
# error size_t is not 32-bit or 64-bit
|
||||
# endif
|
||||
#endif
|
||||
#if SIZE_MAX != UINT32_MAX && SIZE_MAX != UINT64_MAX
|
||||
# error size_t is not 32-bit or 64-bit
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
|
||||
// Pre-C99 systems lack stdbool.h. All the code in LZMA Utils must be written
|
||||
// so that it works with fake bool type, for example:
|
||||
//
|
||||
// bool foo = (flags & 0x100) != 0;
|
||||
// bool bar = !!(flags & 0x100);
|
||||
//
|
||||
// This works with the real C99 bool but breaks with fake bool:
|
||||
//
|
||||
// bool baz = (flags & 0x100);
|
||||
//
|
||||
#ifdef HAVE_STDBOOL_H
|
||||
# include <stdbool.h>
|
||||
#else
|
||||
@@ -102,17 +151,8 @@ typedef unsigned char _Bool;
|
||||
# define __bool_true_false_are_defined 1
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ASSERT_H
|
||||
# include <assert.h>
|
||||
#else
|
||||
# ifdef NDEBUG
|
||||
# define assert(x)
|
||||
# else
|
||||
// TODO: Pretty bad assert() macro.
|
||||
# define assert(x) (!(x) && abort())
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// string.h should be enough but let's include strings.h and memory.h too if
|
||||
// they exists, since that shouldn't do any harm, but may improve portability.
|
||||
#ifdef HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#endif
|
||||
@@ -125,37 +165,38 @@ typedef unsigned char _Bool;
|
||||
# include <memory.h>
|
||||
#endif
|
||||
|
||||
#include "lzma.h"
|
||||
|
||||
// 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 //
|
||||
////////////
|
||||
|
||||
#ifndef HAVE_MEMCPY
|
||||
# define memcpy(dest, src, n) bcopy(src, dest, n)
|
||||
#endif
|
||||
#undef memzero
|
||||
#define memzero(s, n) memset(s, 0, n)
|
||||
|
||||
#ifndef HAVE_MEMMOVE
|
||||
# define memmove(dest, src, n) bcopy(src, dest, n)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MEMSET
|
||||
# define memzero(s, n) memset(s, 0, n)
|
||||
#else
|
||||
# define memzero(s, n) bzero(s, n)
|
||||
#endif
|
||||
|
||||
#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
|
||||
100
src/common/tuklib_cpucores.c
Normal file
100
src/common/tuklib_cpucores.c
Normal file
@@ -0,0 +1,100 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \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>
|
||||
|
||||
// glibc >= 2.9
|
||||
#elif defined(TUKLIB_CPUCORES_SCHED_GETAFFINITY)
|
||||
# include <sched.h>
|
||||
|
||||
// FreeBSD
|
||||
#elif defined(TUKLIB_CPUCORES_CPUSET)
|
||||
# include <sys/param.h>
|
||||
# include <sys/cpuset.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_SCHED_GETAFFINITY)
|
||||
cpu_set_t cpu_mask;
|
||||
if (sched_getaffinity(0, sizeof(cpu_mask), &cpu_mask) == 0)
|
||||
ret = CPU_COUNT(&cpu_mask);
|
||||
|
||||
#elif defined(TUKLIB_CPUCORES_CPUSET)
|
||||
cpuset_t set;
|
||||
if (cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1,
|
||||
sizeof(set), &set) == 0) {
|
||||
# ifdef CPU_COUNT
|
||||
ret = CPU_COUNT(&set);
|
||||
# else
|
||||
for (unsigned i = 0; i < CPU_SETSIZE; ++i)
|
||||
if (CPU_ISSET(i, &set))
|
||||
++ret;
|
||||
# endif
|
||||
}
|
||||
|
||||
#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;
|
||||
}
|
||||
23
src/common/tuklib_cpucores.h
Normal file
23
src/common/tuklib_cpucores.h
Normal file
@@ -0,0 +1,23 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file tuklib_cpucores.h
|
||||
/// \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.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef TUKLIB_CPUCORES_H
|
||||
#define TUKLIB_CPUCORES_H
|
||||
|
||||
#include "tuklib_common.h"
|
||||
TUKLIB_DECLS_BEGIN
|
||||
|
||||
#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
|
||||
534
src/common/tuklib_integer.h
Normal file
534
src/common/tuklib_integer.h
Normal file
@@ -0,0 +1,534 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \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
|
||||
|
||||
|
||||
////////////////////////////////
|
||||
// Compiler-specific features //
|
||||
////////////////////////////////
|
||||
|
||||
// Newer Intel C compilers require immintrin.h for _bit_scan_reverse()
|
||||
// and such functions.
|
||||
#if defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1500)
|
||||
# include <immintrin.h>
|
||||
#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] = (uint8_t)(num >> 8);
|
||||
buf[1] = (uint8_t)num;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
static inline void
|
||||
unaligned_write16le(uint8_t *buf, uint16_t num)
|
||||
{
|
||||
buf[0] = (uint8_t)num;
|
||||
buf[1] = (uint8_t)(num >> 8);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
static inline void
|
||||
unaligned_write32be(uint8_t *buf, uint32_t num)
|
||||
{
|
||||
buf[0] = (uint8_t)(num >> 24);
|
||||
buf[1] = (uint8_t)(num >> 16);
|
||||
buf[2] = (uint8_t)(num >> 8);
|
||||
buf[3] = (uint8_t)num;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
static inline void
|
||||
unaligned_write32le(uint8_t *buf, 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);
|
||||
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,27 +1,33 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file open_stdxxx.h
|
||||
/// \file tuklib_open_stdxxx.c
|
||||
/// \brief Make sure that file descriptors 0, 1, and 2 are open
|
||||
//
|
||||
// This code has been put into the public domain.
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#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) {
|
||||
@@ -33,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
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user