Compare commits
1446 Commits
RELEASE_0_
...
PRE_OSG_PL
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7c410d36e3 | ||
|
|
98a603a570 | ||
|
|
5876052170 | ||
|
|
f8303b4623 | ||
|
|
20005a7a22 | ||
|
|
4f0bfbab21 | ||
|
|
811442832e | ||
|
|
40811311d7 | ||
|
|
198de211f8 | ||
|
|
9f5412fa9d | ||
|
|
0dc9de81ae | ||
|
|
5b8f42ce5e | ||
|
|
5314274ed6 | ||
|
|
c831856711 | ||
|
|
1bade6d796 | ||
|
|
629a4a950e | ||
|
|
aebb1f6ec8 | ||
|
|
6e42bc55e0 | ||
|
|
1235fba7ee | ||
|
|
7a459db022 | ||
|
|
607987def5 | ||
|
|
397ec62180 | ||
|
|
9315210fbe | ||
|
|
5127990a43 | ||
|
|
40ad2b155a | ||
|
|
a0412d026c | ||
|
|
7d2134c488 | ||
|
|
d894f52b97 | ||
|
|
735f475c24 | ||
|
|
353dd73e24 | ||
|
|
49fe06498a | ||
|
|
bc95ec8084 | ||
|
|
f79906bf16 | ||
|
|
b3262fcb80 | ||
|
|
52b8f924aa | ||
|
|
52f57160aa | ||
|
|
6d4f23919c | ||
|
|
899623f71b | ||
|
|
c5d677ac7b | ||
|
|
c75270a9fc | ||
|
|
1588a379eb | ||
|
|
72d2075828 | ||
|
|
e99c682637 | ||
|
|
c815f70831 | ||
|
|
0da50eaa79 | ||
|
|
b0af84a549 | ||
|
|
b9631e8521 | ||
|
|
f664f7a201 | ||
|
|
f72b3882c3 | ||
|
|
ea47a2973c | ||
|
|
04be9ca670 | ||
|
|
6f0baf6ca9 | ||
|
|
1f5ec6b8d5 | ||
|
|
a2a91520aa | ||
|
|
fd7b5d3de7 | ||
|
|
30ea844c43 | ||
|
|
efac53b121 | ||
|
|
73c0ef59c1 | ||
|
|
7e65ab2d3b | ||
|
|
fec769f632 | ||
|
|
90e42642b6 | ||
|
|
9d9610a882 | ||
|
|
1fc81f4b66 | ||
|
|
4f0b1e847c | ||
|
|
9567ac32f2 | ||
|
|
8dd9cfa2a6 | ||
|
|
dbda8ef893 | ||
|
|
cd143c15d5 | ||
|
|
509a388ccc | ||
|
|
76c6482495 | ||
|
|
010a44f831 | ||
|
|
e6b0d644d4 | ||
|
|
02dc68c899 | ||
|
|
11ac97cd09 | ||
|
|
61f6565321 | ||
|
|
55d951f211 | ||
|
|
143ce6fcd5 | ||
|
|
e264c6ad2e | ||
|
|
036b6785f1 | ||
|
|
caf5cc90ae | ||
|
|
b05e98b1b6 | ||
|
|
31d0779377 | ||
|
|
6b056e915e | ||
|
|
9d6c0dc580 | ||
|
|
6e973e07f4 | ||
|
|
c8098b9eac | ||
|
|
ed20ce388a | ||
|
|
33e01e431d | ||
|
|
7d631e4959 | ||
|
|
29eb566448 | ||
|
|
a770d2a972 | ||
|
|
688cffb031 | ||
|
|
2cccc26541 | ||
|
|
f96f083bb5 | ||
|
|
2e078aff7d | ||
|
|
bd1f192dc4 | ||
|
|
b62f241051 | ||
|
|
95d1ac354e | ||
|
|
54728f5d57 | ||
|
|
d9356b0f86 | ||
|
|
6b68d9d90b | ||
|
|
359a8c4a81 | ||
|
|
dcb95d131b | ||
|
|
f4e37ba7c0 | ||
|
|
1cbceec0e1 | ||
|
|
5b3c5407a1 | ||
|
|
27a120c7c3 | ||
|
|
375f3e8bc1 | ||
|
|
a75b4af374 | ||
|
|
b2a4cd488d | ||
|
|
1d8d203e9e | ||
|
|
4e7fe460a5 | ||
|
|
9be14a63b1 | ||
|
|
afd3c76088 | ||
|
|
6b697506c3 | ||
|
|
3eba296157 | ||
|
|
1b51de08f5 | ||
|
|
3e37f3fa54 | ||
|
|
a18679e95d | ||
|
|
0154f81e33 | ||
|
|
366931952b | ||
|
|
606fc352aa | ||
|
|
75f817b39c | ||
|
|
0bc49bf244 | ||
|
|
930a84b459 | ||
|
|
21c89e8163 | ||
|
|
b3770cd26c | ||
|
|
0cd4d44bd3 | ||
|
|
af15e73e64 | ||
|
|
33f176b8f9 | ||
|
|
42f21972fd | ||
|
|
2d79e54c46 | ||
|
|
224408b0e8 | ||
|
|
610e447d7c | ||
|
|
c2c0e19305 | ||
|
|
e8c4b0d57c | ||
|
|
36e7684d9a | ||
|
|
795c079af0 | ||
|
|
94e1d3f0fc | ||
|
|
1df002de81 | ||
|
|
b7115659b3 | ||
|
|
258ec6b89a | ||
|
|
d1ecdfc510 | ||
|
|
a807e66d4a | ||
|
|
8f9921d00c | ||
|
|
99bc4e9a87 | ||
|
|
9289cfdde9 | ||
|
|
bedbe3caad | ||
|
|
2e329426ab | ||
|
|
4c68d03457 | ||
|
|
0911fa4fa2 | ||
|
|
c5737c5f74 | ||
|
|
106198fa20 | ||
|
|
4eb74a3c93 | ||
|
|
3f0bcc9568 | ||
|
|
f0c35fde6d | ||
|
|
8357eeb762 | ||
|
|
61da54d6ca | ||
|
|
efea47833d | ||
|
|
24ea08b6d3 | ||
|
|
2808b334ed | ||
|
|
96159cf739 | ||
|
|
577dfa4f54 | ||
|
|
66075d620e | ||
|
|
60f1d21914 | ||
|
|
b108621a59 | ||
|
|
4a4e703f16 | ||
|
|
61984730ac | ||
|
|
f196d3bab8 | ||
|
|
7da45cb49e | ||
|
|
e994305da6 | ||
|
|
2af37b484e | ||
|
|
faf41f7d96 | ||
|
|
7629e29397 | ||
|
|
1cff7fcfea | ||
|
|
694cf6e958 | ||
|
|
0e12fbb2a0 | ||
|
|
450ad45882 | ||
|
|
d674e50591 | ||
|
|
61f2f4b761 | ||
|
|
baa2f49b14 | ||
|
|
8c0bd234d8 | ||
|
|
c4fd41562f | ||
|
|
a1d1b4e49f | ||
|
|
96fb7a45f7 | ||
|
|
d5eedd2c65 | ||
|
|
fe4f907099 | ||
|
|
1b45eaf3de | ||
|
|
cfbc0a1579 | ||
|
|
db1b99d8dd | ||
|
|
65a880e9fa | ||
|
|
37b4005d3e | ||
|
|
70faa252e7 | ||
|
|
3620be8dbc | ||
|
|
21c64dd60f | ||
|
|
fb69d790ce | ||
|
|
debd066edd | ||
|
|
f58d81b1e9 | ||
|
|
8d507f161b | ||
|
|
b015f7c801 | ||
|
|
80abe952ba | ||
|
|
c12162407c | ||
|
|
7f5c3b223a | ||
|
|
2f3e4ebf39 | ||
|
|
2c14f8587e | ||
|
|
42224052e2 | ||
|
|
a8dd5aa0fc | ||
|
|
f3d0a9bc3f | ||
|
|
d629b9e36a | ||
|
|
4d54ba2200 | ||
|
|
0035ef9194 | ||
|
|
fcb20296d7 | ||
|
|
6bb9080017 | ||
|
|
bbde16dc08 | ||
|
|
ac9716f193 | ||
|
|
8a2bc1c21b | ||
|
|
942b474ad7 | ||
|
|
f3ef9b671f | ||
|
|
3538631e8e | ||
|
|
1577ab04e1 | ||
|
|
7f2dfaa5b4 | ||
|
|
fd126746f7 | ||
|
|
63f7e9feb0 | ||
|
|
5eb380e103 | ||
|
|
832e821919 | ||
|
|
197e3f144d | ||
|
|
056b5b41e2 | ||
|
|
15d40fd64a | ||
|
|
979d3da69c | ||
|
|
72984cc4a8 | ||
|
|
0a7a815124 | ||
|
|
1ce68a49c6 | ||
|
|
b1b6abf285 | ||
|
|
9dfd6970f1 | ||
|
|
3583c13339 | ||
|
|
00ab198c9f | ||
|
|
669d9a89ca | ||
|
|
9c54603726 | ||
|
|
dc09a50472 | ||
|
|
68eb7031e2 | ||
|
|
19623cac21 | ||
|
|
4ca25ca533 | ||
|
|
178c49a430 | ||
|
|
32e2cd9f06 | ||
|
|
7aa514d9ba | ||
|
|
7c2575d723 | ||
|
|
f93ea20d5e | ||
|
|
73cb6ff00d | ||
|
|
72267fa60b | ||
|
|
6b6a27e849 | ||
|
|
daea10121c | ||
|
|
999a1e514b | ||
|
|
be30960366 | ||
|
|
38e5084018 | ||
|
|
fdd9bb1af6 | ||
|
|
81546820ab | ||
|
|
84e87f0e8a | ||
|
|
901592a88e | ||
|
|
24f908d9be | ||
|
|
f62ff0ad66 | ||
|
|
8e0ecbeb8f | ||
|
|
095367f760 | ||
|
|
5d34eb12e0 | ||
|
|
d4e760efe1 | ||
|
|
75ab8e697b | ||
|
|
f4b05d46ed | ||
|
|
04c5f2c36a | ||
|
|
db50f95482 | ||
|
|
0e52a08a47 | ||
|
|
7b5d49ef60 | ||
|
|
430ba60b33 | ||
|
|
3af1f3bc63 | ||
|
|
bdcb94af81 | ||
|
|
2ea9e723c2 | ||
|
|
e19091d809 | ||
|
|
64ab59c0e0 | ||
|
|
4707b363aa | ||
|
|
1a72245c15 | ||
|
|
dea7b9050d | ||
|
|
3bd810fedc | ||
|
|
f9cbf8361d | ||
|
|
eccd4d0325 | ||
|
|
e0decf1233 | ||
|
|
100927f16c | ||
|
|
bb670f6658 | ||
|
|
d37992aaf9 | ||
|
|
9048ee533d | ||
|
|
2b1e5927ca | ||
|
|
b5e03030d1 | ||
|
|
65056bfa72 | ||
|
|
c50bb90374 | ||
|
|
ec4fc265e0 | ||
|
|
8ea41af5c4 | ||
|
|
966331dac7 | ||
|
|
cf056bace7 | ||
|
|
405a455906 | ||
|
|
3a8b431a5b | ||
|
|
3ce0c17237 | ||
|
|
61a2e0f104 | ||
|
|
7c44251216 | ||
|
|
26e70664d6 | ||
|
|
8ac27cc798 | ||
|
|
d314164fed | ||
|
|
d2cbed151b | ||
|
|
fc06ae58b2 | ||
|
|
a8768c78a2 | ||
|
|
ee8763f60d | ||
|
|
db633330fe | ||
|
|
c1ffafd663 | ||
|
|
72f35dc914 | ||
|
|
e5f82f53b9 | ||
|
|
e39e6893e0 | ||
|
|
9ab77d65f4 | ||
|
|
8ed96cad1d | ||
|
|
7795eb8239 | ||
|
|
207c7ab1e0 | ||
|
|
27af79684f | ||
|
|
6b61a8eed1 | ||
|
|
181e6eac75 | ||
|
|
fd1979857c | ||
|
|
448bc3facd | ||
|
|
97cabadb88 | ||
|
|
8e284a70b7 | ||
|
|
73f9febe06 | ||
|
|
6a6cc22e9c | ||
|
|
b293639b76 | ||
|
|
f06036be09 | ||
|
|
867571af78 | ||
|
|
f6314d3124 | ||
|
|
1e87dd7903 | ||
|
|
3b6af2f0c2 | ||
|
|
5bdff41641 | ||
|
|
67e9d105cb | ||
|
|
f1fc99f16f | ||
|
|
f89e359d53 | ||
|
|
77ec170a50 | ||
|
|
34320f5f20 | ||
|
|
a26271e46e | ||
|
|
e2e7466250 | ||
|
|
1e24cc4643 | ||
|
|
dfc23c3528 | ||
|
|
cd11a5dc27 | ||
|
|
899734296b | ||
|
|
7a3a81c152 | ||
|
|
e62a4a05ac | ||
|
|
463ca207ce | ||
|
|
da6e1b31ea | ||
|
|
8c783b1680 | ||
|
|
efce88ff12 | ||
|
|
01608b7e18 | ||
|
|
a5f0e0395a | ||
|
|
0b723174fd | ||
|
|
5d248bf0df | ||
|
|
c039ccdeb0 | ||
|
|
d88fb32a73 | ||
|
|
37ac409586 | ||
|
|
7b24e94c66 | ||
|
|
e12cd2a50c | ||
|
|
98b2ba4fc1 | ||
|
|
2f0afdccc1 | ||
|
|
79734df554 | ||
|
|
c52657fa1a | ||
|
|
9cac8409cd | ||
|
|
18703ce02d | ||
|
|
709a166bd6 | ||
|
|
8048e6297c | ||
|
|
fb0dded103 | ||
|
|
055e969e7a | ||
|
|
f10db8a30e | ||
|
|
c19af3525e | ||
|
|
7c60ccfc35 | ||
|
|
84cba33aab | ||
|
|
a52b1ec64f | ||
|
|
f30c4720ae | ||
|
|
7fc8c02688 | ||
|
|
54a7a0d534 | ||
|
|
8d73160a75 | ||
|
|
ff10602c65 | ||
|
|
ca50fe386d | ||
|
|
39f3c6e41d | ||
|
|
ba1b96e518 | ||
|
|
ef486b2cc6 | ||
|
|
06f3cb4f8e | ||
|
|
074f5ff996 | ||
|
|
8c26f32d5f | ||
|
|
9a2ee54389 | ||
|
|
ab69c03698 | ||
|
|
fab1f4e7a0 | ||
|
|
41eed484c1 | ||
|
|
7d18f9bdde | ||
|
|
3a48c3de7a | ||
|
|
d769a9936b | ||
|
|
1697cb3b1a | ||
|
|
62aa32a417 | ||
|
|
a0d0852838 | ||
|
|
2f479cae69 | ||
|
|
4820d57fa8 | ||
|
|
04e3b0b3c1 | ||
|
|
a7f78b9f68 | ||
|
|
f3d8eb4665 | ||
|
|
090f79b951 | ||
|
|
88c0dbf661 | ||
|
|
9e3822ceaf | ||
|
|
007b0a8fe6 | ||
|
|
7f0ebf8871 | ||
|
|
5414e94a1a | ||
|
|
461dee8657 | ||
|
|
297b6193fe | ||
|
|
4b74e40a5f | ||
|
|
5a9b08dec2 | ||
|
|
5e6f9f79a2 | ||
|
|
e2f93e6ae1 | ||
|
|
93314b59fb | ||
|
|
29269c6686 | ||
|
|
3c84b6e2f6 | ||
|
|
04fb708543 | ||
|
|
df302f277c | ||
|
|
5e63e663bb | ||
|
|
ca10cb2d37 | ||
|
|
c9854153f8 | ||
|
|
129e3c6326 | ||
|
|
66996711ae | ||
|
|
8fe37cea51 | ||
|
|
de64b6f267 | ||
|
|
9a9d9c7cc1 | ||
|
|
a191e9762a | ||
|
|
a7b35c6e22 | ||
|
|
5034346b67 | ||
|
|
661f64b902 | ||
|
|
bbc83f721c | ||
|
|
01f4541331 | ||
|
|
0e4a894f62 | ||
|
|
1c135a9b5b | ||
|
|
e65c85ce73 | ||
|
|
26b58991f9 | ||
|
|
8390df37ca | ||
|
|
371fc73f24 | ||
|
|
921dae5444 | ||
|
|
9b3abbec89 | ||
|
|
6935baba5b | ||
|
|
dec1e32f96 | ||
|
|
710c2ccfcd | ||
|
|
8e66e534ae | ||
|
|
0f5f30b993 | ||
|
|
b199f733f7 | ||
|
|
0cdcf3a3e0 | ||
|
|
8e09486e82 | ||
|
|
0c24b78573 | ||
|
|
1436be9699 | ||
|
|
0489ad7c62 | ||
|
|
c553570533 | ||
|
|
bda112297f | ||
|
|
331a4e4406 | ||
|
|
a9faf8ceff | ||
|
|
2866d1ace9 | ||
|
|
11a74f7a31 | ||
|
|
634a2035ee | ||
|
|
ffada9257d | ||
|
|
e09164e5b3 | ||
|
|
de1a5f3034 | ||
|
|
86e83faef3 | ||
|
|
9f06c8df76 | ||
|
|
6e511de7db | ||
|
|
e34aae9982 | ||
|
|
675b388b8e | ||
|
|
7d239fe4ac | ||
|
|
edd92caba1 | ||
|
|
5c3b4abf42 | ||
|
|
d3a3466b14 | ||
|
|
4399383781 | ||
|
|
bb383998bb | ||
|
|
ffeb174ca1 | ||
|
|
a90d74dde8 | ||
|
|
9d7fd79e76 | ||
|
|
6f29d234eb | ||
|
|
6f5517f602 | ||
|
|
cc43c745b2 | ||
|
|
db8d961b27 | ||
|
|
a0bdec2846 | ||
|
|
5bbcd386fa | ||
|
|
7657632024 | ||
|
|
ab29063a97 | ||
|
|
c06ef23eb1 | ||
|
|
7b2f7aa827 | ||
|
|
7113c10f4b | ||
|
|
14033946e5 | ||
|
|
6e0e056ca7 | ||
|
|
7aa4f0ccdb | ||
|
|
4b04450fa6 | ||
|
|
ad81560be5 | ||
|
|
5c26faa20e | ||
|
|
bd85fa2457 | ||
|
|
430136fdc9 | ||
|
|
a616aa8e55 | ||
|
|
05b9166c25 | ||
|
|
71770eb92e | ||
|
|
2089a2a956 | ||
|
|
488efa2316 | ||
|
|
44551dad2d | ||
|
|
00e0e72bca | ||
|
|
a611b70087 | ||
|
|
757ed2dfe7 | ||
|
|
8971a67aca | ||
|
|
5a343da5cc | ||
|
|
4c77c1691b | ||
|
|
aadff33011 | ||
|
|
25d7705379 | ||
|
|
867ba3c7da | ||
|
|
3f08d9604e | ||
|
|
5d813aa4d0 | ||
|
|
ce3a1ddcb0 | ||
|
|
e37752f957 | ||
|
|
40d920ddc9 | ||
|
|
4362eb79e6 | ||
|
|
f6c9af488b | ||
|
|
a34ac6a596 | ||
|
|
3b3baa996b | ||
|
|
d6b81a9721 | ||
|
|
a460c753e7 | ||
|
|
9f59e956fa | ||
|
|
bd02eb8e6b | ||
|
|
a266790a25 | ||
|
|
3462e3b6c1 | ||
|
|
ed29944b91 | ||
|
|
a0251b3256 | ||
|
|
557474095f | ||
|
|
b7dd267807 | ||
|
|
58a0b1d2c3 | ||
|
|
d8acc3a8f2 | ||
|
|
5f21c75e02 | ||
|
|
79d72b6292 | ||
|
|
aa67c738a1 | ||
|
|
117628bf7e | ||
|
|
70dbbf52f0 | ||
|
|
99bf2c6f9e | ||
|
|
3fdeea7f65 | ||
|
|
ea9d110036 | ||
|
|
16ad232e0d | ||
|
|
5b8e5fce20 | ||
|
|
0633d703d0 | ||
|
|
ec6ce9fcd8 | ||
|
|
c9e53d5a30 | ||
|
|
828e10773c | ||
|
|
34b5c1a1b9 | ||
|
|
b2a7975493 | ||
|
|
f0af686d17 | ||
|
|
eda1121054 | ||
|
|
d97eb240d9 | ||
|
|
8c296d96c7 | ||
|
|
65a49bb6e4 | ||
|
|
cfedc90fdd | ||
|
|
5665a62938 | ||
|
|
36521869ae | ||
|
|
84fd7a49ad | ||
|
|
24b5f05522 | ||
|
|
17415424bf | ||
|
|
920c0fdb62 | ||
|
|
40414f2823 | ||
|
|
3d43bc0480 | ||
|
|
7bee5f1ab6 | ||
|
|
a43f5c8d21 | ||
|
|
8361069344 | ||
|
|
c9661e2732 | ||
|
|
bd13cf84a1 | ||
|
|
e54cfc002b | ||
|
|
5aac63d9f5 | ||
|
|
6a19bbee7d | ||
|
|
2e5c4b4515 | ||
|
|
79d1aaf7f5 | ||
|
|
a659969bcf | ||
|
|
53bdf9dac4 | ||
|
|
ad394fb090 | ||
|
|
92a123a47d | ||
|
|
755173bd2e | ||
|
|
27477402c9 | ||
|
|
dc9c41e119 | ||
|
|
3c7f9e7ba4 | ||
|
|
fbf018598e | ||
|
|
83b4dcb55c | ||
|
|
5812571df4 | ||
|
|
b1c688abe8 | ||
|
|
f4b30bbdd7 | ||
|
|
e4008862ce | ||
|
|
2b7079eed2 | ||
|
|
983685fde3 | ||
|
|
eef1cc716d | ||
|
|
34e2a9dc37 | ||
|
|
1786692406 | ||
|
|
c37afce303 | ||
|
|
1ea99cdd4d | ||
|
|
4c1d22b8a6 | ||
|
|
5f22c93db7 | ||
|
|
13a42f1d9e | ||
|
|
c4d5d85c3e | ||
|
|
d915ccec6e | ||
|
|
ea1b70191c | ||
|
|
19815c3bce | ||
|
|
66fb6b5a1c | ||
|
|
94ac87f4f5 | ||
|
|
79d5bf66a7 | ||
|
|
a4535c92c3 | ||
|
|
cecdb15692 | ||
|
|
3c08eae85b | ||
|
|
db928ea1ae | ||
|
|
bb002356b4 | ||
|
|
431e78cf09 | ||
|
|
81b9ec50b0 | ||
|
|
e0ba803ca9 | ||
|
|
7ae57483f3 | ||
|
|
d22640ef4e | ||
|
|
f3eeeb760f | ||
|
|
695e112039 | ||
|
|
133e67adb8 | ||
|
|
6079cd3df8 | ||
|
|
6f4fd2dc6e | ||
|
|
b30eb9c00c | ||
|
|
1236d8be19 | ||
|
|
cb35ecb4b0 | ||
|
|
54550aa002 | ||
|
|
d3db963dce | ||
|
|
1dde23a0c9 | ||
|
|
5feccc73c7 | ||
|
|
1cf13a7c1a | ||
|
|
7289ac645a | ||
|
|
699909f808 | ||
|
|
344610e24b | ||
|
|
092901b9ea | ||
|
|
3ac6b34f4b | ||
|
|
d56b961c47 | ||
|
|
858a73e187 | ||
|
|
1623aee1e0 | ||
|
|
c0a633ea1d | ||
|
|
5628c85b51 | ||
|
|
2e1accc0f3 | ||
|
|
93b747f1ba | ||
|
|
21c16b4a51 | ||
|
|
e5e1e165b9 | ||
|
|
8ae39ae8d4 | ||
|
|
110e01a861 | ||
|
|
578e774778 | ||
|
|
d7d13e458c | ||
|
|
0bf579cf27 | ||
|
|
77cefa924c | ||
|
|
1fe26901af | ||
|
|
0dd50cf3d8 | ||
|
|
54b3c711c3 | ||
|
|
f404161d23 | ||
|
|
5a13068aaa | ||
|
|
32067b9adf | ||
|
|
ea2f5f0035 | ||
|
|
ea6540ef90 | ||
|
|
1d5c1de5d3 | ||
|
|
4b11d87a22 | ||
|
|
c2149f9ea6 | ||
|
|
73a4994cac | ||
|
|
c9a4a6975c | ||
|
|
1a1aa37a0e | ||
|
|
7d3abdc512 | ||
|
|
db4c2243e3 | ||
|
|
6dc243e1af | ||
|
|
adb5fb3bee | ||
|
|
7955319771 | ||
|
|
3da76522f8 | ||
|
|
c9ac1b5a06 | ||
|
|
51dff6b537 | ||
|
|
1f4b55e98e | ||
|
|
229ea27050 | ||
|
|
505b4c434d | ||
|
|
12ab6872ec | ||
|
|
4c78e887e1 | ||
|
|
8871655a9b | ||
|
|
db1966c156 | ||
|
|
d4c0c8940b | ||
|
|
d4134195ea | ||
|
|
a8fd1b4c16 | ||
|
|
086473c8eb | ||
|
|
5642ef61ca | ||
|
|
fec7c62b17 | ||
|
|
e046b1bfdb | ||
|
|
01007986dc | ||
|
|
ad56ba1bfa | ||
|
|
54c2d5a6cc | ||
|
|
25ad84e5cb | ||
|
|
dcdf8a4d5c | ||
|
|
5d24be8c51 | ||
|
|
fa42efcf91 | ||
|
|
7f4f778bb1 | ||
|
|
8a2e5cace8 | ||
|
|
23c66b6cfe | ||
|
|
b65fe814a0 | ||
|
|
e74c8587bd | ||
|
|
ab34b86574 | ||
|
|
011ecd980d | ||
|
|
9ca1c6666e | ||
|
|
ba5316ca8e | ||
|
|
f957227576 | ||
|
|
70f763dbe0 | ||
|
|
f8201e6478 | ||
|
|
e053941467 | ||
|
|
17e2478522 | ||
|
|
17df7141ae | ||
|
|
5167dee0e3 | ||
|
|
a1a596b02a | ||
|
|
27f98d24eb | ||
|
|
51ef4568dd | ||
|
|
4c731de8b7 | ||
|
|
fc692cb540 | ||
|
|
cedfade08d | ||
|
|
eedbc7f436 | ||
|
|
b6a683eb6e | ||
|
|
df677ff8aa | ||
|
|
1d8b352d2d | ||
|
|
c8432e3763 | ||
|
|
b3f88735a8 | ||
|
|
789b56872c | ||
|
|
009ed26fd2 | ||
|
|
5ed0ce79ab | ||
|
|
8b8a82bb67 | ||
|
|
94c22fec46 | ||
|
|
8be760b594 | ||
|
|
42b4ec310f | ||
|
|
4ea676b229 | ||
|
|
dda676b1b2 | ||
|
|
f7a3dbc5ed | ||
|
|
1f3947ea4c | ||
|
|
cb7589cc95 | ||
|
|
2ca4b30553 | ||
|
|
bb238c4106 | ||
|
|
4b0b49d1ed | ||
|
|
dd080de16c | ||
|
|
1ae257944b | ||
|
|
a2c8cfb84d | ||
|
|
c01740d516 | ||
|
|
1ce5cd154a | ||
|
|
1fce27f0c3 | ||
|
|
4fc985b518 | ||
|
|
0e999f281b | ||
|
|
aadc802fdd | ||
|
|
d8a7589752 | ||
|
|
f1021ab820 | ||
|
|
8bd3cccc08 | ||
|
|
78fbfa1dde | ||
|
|
16dd841ce5 | ||
|
|
992de38184 | ||
|
|
835e86ad19 | ||
|
|
ef5fb7a98e | ||
|
|
e8cb3cbfa4 | ||
|
|
68b2c9e7d3 | ||
|
|
e78427483c | ||
|
|
25364aa2a6 | ||
|
|
525d2df3cc | ||
|
|
701031a473 | ||
|
|
1960e02ab7 | ||
|
|
ca2ed1c941 | ||
|
|
bde8528859 | ||
|
|
86392857c5 | ||
|
|
95c6c16851 | ||
|
|
ce4f0c4fee | ||
|
|
2d081e6ce6 | ||
|
|
000106200f | ||
|
|
2bb4274517 | ||
|
|
5cd81b8c92 | ||
|
|
5712053ad8 | ||
|
|
192db1c343 | ||
|
|
a3bd57489a | ||
|
|
d69e76959b | ||
|
|
6d784a1a7e | ||
|
|
11d2bca8a7 | ||
|
|
f922e84eb6 | ||
|
|
e2bca737f0 | ||
|
|
940ce98d2c | ||
|
|
72590e6b8f | ||
|
|
3e81ca7da5 | ||
|
|
c4fa7a965d | ||
|
|
1a6e14c3bb | ||
|
|
7379d8a54d | ||
|
|
b63464d239 | ||
|
|
1dac4b2dc1 | ||
|
|
44e7b36a8b | ||
|
|
a26c677df4 | ||
|
|
5d10dda5a1 | ||
|
|
0253a46dbb | ||
|
|
9593059258 | ||
|
|
3f0efc2a6f | ||
|
|
b9593adc7c | ||
|
|
6cf3b54b4b | ||
|
|
78411d29a7 | ||
|
|
f8a49c41ef | ||
|
|
a0a0c8e308 | ||
|
|
e5814dad73 | ||
|
|
f076594288 | ||
|
|
7dfe0bf9b2 | ||
|
|
d9ce8828c9 | ||
|
|
cb2df234ae | ||
|
|
7d73dc6602 | ||
|
|
16bd8cef38 | ||
|
|
f2567f9af4 | ||
|
|
c363758449 | ||
|
|
dfdeb8be9b | ||
|
|
d1c8f60ca9 | ||
|
|
2fb961c922 | ||
|
|
2e17b28994 | ||
|
|
c3f558b034 | ||
|
|
65ce1a04b2 | ||
|
|
3af4a19f76 | ||
|
|
5178f69f18 | ||
|
|
52e2005b3e | ||
|
|
94fa51e3f7 | ||
|
|
590547e12d | ||
|
|
c6832d2513 | ||
|
|
1fd63c30e9 | ||
|
|
f08ae9f2ea | ||
|
|
5c61e97358 | ||
|
|
87e38e2617 | ||
|
|
92e1856caa | ||
|
|
20c099b7ef | ||
|
|
7eb74c7e2a | ||
|
|
8d63c300e2 | ||
|
|
01ccdd3ae1 | ||
|
|
ab074726df | ||
|
|
ed26458a24 | ||
|
|
fcf1d34e55 | ||
|
|
19f99ea273 | ||
|
|
fe5bb76def | ||
|
|
7ecf508453 | ||
|
|
83e6e44eab | ||
|
|
69a93342c0 | ||
|
|
e17338622a | ||
|
|
a67fd7ea99 | ||
|
|
cf2b8afbe9 | ||
|
|
a1e7761384 | ||
|
|
d068915b42 | ||
|
|
adeb0d48fc | ||
|
|
55c89ea865 | ||
|
|
8bd07e358f | ||
|
|
01113e82f3 | ||
|
|
6d79582890 | ||
|
|
2ae3c89406 | ||
|
|
1818102ffe | ||
|
|
406d6dd6fc | ||
|
|
c8ef854f01 | ||
|
|
87dcaf5a00 | ||
|
|
c3bdd0e537 | ||
|
|
c23fd6e66f | ||
|
|
e809eee896 | ||
|
|
c44ef2126c | ||
|
|
e2bfb5633b | ||
|
|
064ee8ba8f | ||
|
|
a5c130446e | ||
|
|
4162817c0b | ||
|
|
81cab6e089 | ||
|
|
d78204d147 | ||
|
|
d8b523d067 | ||
|
|
c4cfad6069 | ||
|
|
5bddb88ce2 | ||
|
|
8c4ee69aeb | ||
|
|
b3a533f8ce | ||
|
|
a885314a39 | ||
|
|
0567a76445 | ||
|
|
d6dc2d6eab | ||
|
|
b75a694682 | ||
|
|
2e7e9b73a0 | ||
|
|
7a11523692 | ||
|
|
f85a9866fe | ||
|
|
9b05c27938 | ||
|
|
fd96729362 | ||
|
|
c57cc096f8 | ||
|
|
c8efd0a465 | ||
|
|
db60139845 | ||
|
|
cadefd323a | ||
|
|
baab88f42a | ||
|
|
767b74dd35 | ||
|
|
90e8287f43 | ||
|
|
d8b7e5b8fd | ||
|
|
7769447283 | ||
|
|
d6a790cf13 | ||
|
|
033c66363d | ||
|
|
3ff1789963 | ||
|
|
9737c0c4dd | ||
|
|
b201383a80 | ||
|
|
2253b82304 | ||
|
|
2581446d85 | ||
|
|
a6291b286c | ||
|
|
96a396bfcb | ||
|
|
0833a11686 | ||
|
|
9c7f7f3d32 | ||
|
|
7847fe8074 | ||
|
|
c57d25ac51 | ||
|
|
1341b5b9f8 | ||
|
|
fb54e9e103 | ||
|
|
3a835dde7d | ||
|
|
128a4a36ca | ||
|
|
255bb6dd07 | ||
|
|
786b1e3a30 | ||
|
|
d5f38a558e | ||
|
|
ce5d4b7db8 | ||
|
|
8c0b36fe9e | ||
|
|
c7e6459c64 | ||
|
|
86e31e696d | ||
|
|
be0b1bb994 | ||
|
|
03e74bfeb4 | ||
|
|
972223cd50 | ||
|
|
761b7b9354 | ||
|
|
6a3d1895d9 | ||
|
|
d1178a26ce | ||
|
|
8ffdfa3cb1 | ||
|
|
384e56b9b4 | ||
|
|
d198e962b0 | ||
|
|
0136fdadbb | ||
|
|
c616568830 | ||
|
|
995d2c1ede | ||
|
|
051a5e9a38 | ||
|
|
60d89097de | ||
|
|
6c35255549 | ||
|
|
c985d8846d | ||
|
|
9a8ab26381 | ||
|
|
711622fd5b | ||
|
|
96474823b5 | ||
|
|
bbf4b54613 | ||
|
|
9795c5dd6b | ||
|
|
addcace80d | ||
|
|
77e43a5fa8 | ||
|
|
b751188e56 | ||
|
|
1ad9a15864 | ||
|
|
d0d7878e0a | ||
|
|
be5d365348 | ||
|
|
a8e0002a64 | ||
|
|
bf75cf7225 | ||
|
|
c024b680bc | ||
|
|
c896475765 | ||
|
|
101fdb3598 | ||
|
|
b13505afdf | ||
|
|
9d96b171a0 | ||
|
|
8b5a0cde69 | ||
|
|
bed7593cdd | ||
|
|
9fed946567 | ||
|
|
4d0bc0ae39 | ||
|
|
f9824aa7de | ||
|
|
4d2522964a | ||
|
|
dbe4a59b8e | ||
|
|
918f8a3ed4 | ||
|
|
f645596606 | ||
|
|
d778dd081d | ||
|
|
f6ed02c3fb | ||
|
|
7fa5dd7a35 | ||
|
|
a3186af099 | ||
|
|
a2d95ac742 | ||
|
|
10715bbea7 | ||
|
|
89fcb12556 | ||
|
|
cc3d7ddee5 | ||
|
|
cc01f99acb | ||
|
|
62b75190bb | ||
|
|
520124c1be | ||
|
|
e251bfcbaf | ||
|
|
aef809348f | ||
|
|
2d4a8774b8 | ||
|
|
b55c8fd828 | ||
|
|
dfff091b5f | ||
|
|
47eb7efafa | ||
|
|
b2a7fff26e | ||
|
|
5f70123723 | ||
|
|
dd629da8d3 | ||
|
|
74f7d52d95 | ||
|
|
7a65a990ba | ||
|
|
fe0076e291 | ||
|
|
1a8bc06cc6 | ||
|
|
8c41081a5c | ||
|
|
5b40eed554 | ||
|
|
b1c4d34eef | ||
|
|
0152b607f8 | ||
|
|
ab6e72047b | ||
|
|
15399bfe95 | ||
|
|
0ff748987b | ||
|
|
58e0e7736b | ||
|
|
2d1b2ca938 | ||
|
|
9a4152eb2d | ||
|
|
6ab443545f | ||
|
|
98a9b4a10c | ||
|
|
a6251606dd | ||
|
|
c3b21e143c | ||
|
|
b496593883 | ||
|
|
4ef4b019ca | ||
|
|
a8021531ab | ||
|
|
93fd948978 | ||
|
|
a1b3740dc6 | ||
|
|
40920457cb | ||
|
|
5039c84fd0 | ||
|
|
220a43bf46 | ||
|
|
45d3e19c38 | ||
|
|
5bab565cfe | ||
|
|
319a4282c8 | ||
|
|
c6aa8bc8e9 | ||
|
|
6f1bfa202e | ||
|
|
6fa9f86d1c | ||
|
|
019a9527d2 | ||
|
|
d100ca485f | ||
|
|
35ab6900ee | ||
|
|
c8570302f5 | ||
|
|
74f10486bc | ||
|
|
2b12425a62 | ||
|
|
c600aad7a7 | ||
|
|
67b2f0a977 | ||
|
|
70c6b48a07 | ||
|
|
76084f8538 | ||
|
|
64c408d2b7 | ||
|
|
73b050ae34 | ||
|
|
59991393ca | ||
|
|
69b2717b62 | ||
|
|
f2a323e048 | ||
|
|
7d07e6ea51 | ||
|
|
7c846972bf | ||
|
|
4f76c258af | ||
|
|
eca2afb982 | ||
|
|
9ff6934c83 | ||
|
|
e04839765d | ||
|
|
d0c655109f | ||
|
|
b28b55abb1 | ||
|
|
c3a0db1aba | ||
|
|
5e929d7d01 | ||
|
|
17f113f8cd | ||
|
|
445cd4ccda | ||
|
|
55845bbbb9 | ||
|
|
1976481ba2 | ||
|
|
5f17edbc72 | ||
|
|
6f7fe4b481 | ||
|
|
66ebe6e690 | ||
|
|
a9cd67e0ce | ||
|
|
994a470fbf | ||
|
|
0ce0684dae | ||
|
|
377eb4782a | ||
|
|
f1a79e6b9f | ||
|
|
007a1e4659 | ||
|
|
fcb873b6dd | ||
|
|
a66d1ad855 | ||
|
|
76a5950f19 | ||
|
|
b7a91bdb03 | ||
|
|
e4bbc5c50b | ||
|
|
b481ccd749 | ||
|
|
e7b9e55599 | ||
|
|
05eaa7135f | ||
|
|
d063b319e8 | ||
|
|
be4fd56660 | ||
|
|
a406a3c00b | ||
|
|
c7295da5eb | ||
|
|
505f561e1c | ||
|
|
7bd8477fa1 | ||
|
|
36ef15940e | ||
|
|
f2ba7aefa6 | ||
|
|
73b58b0e87 | ||
|
|
6ce4f096b2 | ||
|
|
3e7ece7f5f | ||
|
|
48a219473e | ||
|
|
887ffd102f | ||
|
|
b1a719dd4c | ||
|
|
b4efe8f374 | ||
|
|
03f844d4be | ||
|
|
a212589865 | ||
|
|
29dfc5bd3c | ||
|
|
a6ac06c47a | ||
|
|
4d914db1db | ||
|
|
68572f106d | ||
|
|
c5ca4db94e | ||
|
|
3980f08cc5 | ||
|
|
f93fa4b613 | ||
|
|
06f2dba92c | ||
|
|
30a14741c9 | ||
|
|
2f39b688f4 | ||
|
|
724a2ef83b | ||
|
|
f7e0e46143 | ||
|
|
83acb47295 | ||
|
|
e5282caea5 | ||
|
|
6a481eed36 | ||
|
|
e145f903de | ||
|
|
2afd1c8663 | ||
|
|
948d02055d | ||
|
|
e2b4c0787a | ||
|
|
2d21e59b54 | ||
|
|
00ccafb90d | ||
|
|
b82e02b5ed | ||
|
|
096550f163 | ||
|
|
81e5963a5d | ||
|
|
14569e4fae | ||
|
|
6cc32a56b9 | ||
|
|
ebdb86c460 | ||
|
|
400c9d6a2d | ||
|
|
e9a1b06746 | ||
|
|
4f3aaa1ede | ||
|
|
187258cc3a | ||
|
|
dfbcb1566b | ||
|
|
e3b0a70eb9 | ||
|
|
790a40ec99 | ||
|
|
a824bec9e1 | ||
|
|
10db0c3c66 | ||
|
|
12620b6152 | ||
|
|
2294283506 | ||
|
|
cebcf6a4fc | ||
|
|
a79a78b6e6 | ||
|
|
c6ad744ce2 | ||
|
|
b430b3c8df | ||
|
|
0b316a8c5e | ||
|
|
b8e93e6099 | ||
|
|
a84a88bf09 | ||
|
|
02d54dd187 | ||
|
|
fb054c7f8d | ||
|
|
77da29b4f7 | ||
|
|
828a9a8c51 | ||
|
|
c680947db5 | ||
|
|
5348f4eafe | ||
|
|
7781498181 | ||
|
|
b8ce139b8a | ||
|
|
75911b6c64 | ||
|
|
bf0d95145d | ||
|
|
4326d560e9 | ||
|
|
65fa6f2f00 | ||
|
|
124629e1d9 | ||
|
|
557fade4a7 | ||
|
|
98a65b5d1d | ||
|
|
caaa35e5a7 | ||
|
|
a7459489ff | ||
|
|
87e59ff876 | ||
|
|
9d87c913e7 | ||
|
|
0e8c010645 | ||
|
|
470d01a508 | ||
|
|
c16b9ed25b | ||
|
|
d498199e8a | ||
|
|
013687dccd | ||
|
|
baf25ca7a7 | ||
|
|
6c28bd884b | ||
|
|
510091f082 | ||
|
|
7db44c113c | ||
|
|
6cbf4306e7 | ||
|
|
777386ea67 | ||
|
|
95e5e90791 | ||
|
|
a86868526e | ||
|
|
f1ab6e2533 | ||
|
|
9f516a8ccc | ||
|
|
e07af68018 | ||
|
|
a37d9a2d8e | ||
|
|
57811b5371 | ||
|
|
7ff9ba4fe6 | ||
|
|
fad34bdbc3 | ||
|
|
22b41d892a | ||
|
|
7a97c7575d | ||
|
|
b0e175ad3d | ||
|
|
0de60aa6aa | ||
|
|
933e10d8a0 | ||
|
|
2efac3d949 | ||
|
|
c33841329d | ||
|
|
f37800560f | ||
|
|
60e61a0627 | ||
|
|
260dbeb3d2 | ||
|
|
70f495b4e1 | ||
|
|
663db8f978 | ||
|
|
c412739040 | ||
|
|
8b13d71fcf | ||
|
|
1b129b289c | ||
|
|
a89ceb96b9 | ||
|
|
9af5f9f094 | ||
|
|
6776c2e536 | ||
|
|
4c3b4219fe | ||
|
|
a09806bb98 | ||
|
|
e175c8cc4d | ||
|
|
a53faf4565 | ||
|
|
dc653ac46c | ||
|
|
c544777d37 | ||
|
|
93a37df90a | ||
|
|
1da02cca4c | ||
|
|
4b1d777ad4 | ||
|
|
fb0916be0f | ||
|
|
806083cb25 | ||
|
|
5ba74e30b8 | ||
|
|
c39e08cb2a | ||
|
|
e4653be9a1 | ||
|
|
cd5765be1e | ||
|
|
c481b06451 | ||
|
|
91ba4618e7 | ||
|
|
fdc5521389 | ||
|
|
e88c915206 | ||
|
|
1e60698053 | ||
|
|
5702bd7ee8 | ||
|
|
8eef3eb582 | ||
|
|
31db353173 | ||
|
|
2c4a0dd998 | ||
|
|
7d7e41dacc | ||
|
|
453a53b372 | ||
|
|
ef68d18f64 | ||
|
|
ded1d2343f | ||
|
|
e6241a2f73 | ||
|
|
467254ec66 | ||
|
|
135e137921 | ||
|
|
e13a5b57d4 | ||
|
|
f1c00cdd18 | ||
|
|
8c3de351b0 | ||
|
|
0bcdb7eb70 | ||
|
|
a92b71fffc | ||
|
|
89960ab715 | ||
|
|
2a369803ae | ||
|
|
b0134a377e | ||
|
|
502c650cd9 | ||
|
|
a1bf8d2229 | ||
|
|
25b743bdec | ||
|
|
dbf7db02a2 | ||
|
|
8c998659c6 | ||
|
|
4e23b3dff5 | ||
|
|
159d3c4c6c | ||
|
|
612b5ae0bc | ||
|
|
60cbe9c1d4 | ||
|
|
4dadd29727 | ||
|
|
e4610b9baa | ||
|
|
926a0f2437 | ||
|
|
9325ec681e | ||
|
|
af383e6c39 | ||
|
|
b000691ab9 | ||
|
|
22812a0aae | ||
|
|
dda7ebfe0d | ||
|
|
9a211af659 | ||
|
|
82459a2802 | ||
|
|
1774fb2d02 | ||
|
|
f0081c7697 | ||
|
|
1e53bedca5 | ||
|
|
cf1c7e7378 | ||
|
|
5c3b569e97 | ||
|
|
cb29dcc238 | ||
|
|
d48b3f1e9a | ||
|
|
a4d60e7bd6 | ||
|
|
1a6e2509c7 | ||
|
|
8159b749f4 | ||
|
|
bec11c2939 | ||
|
|
8a189b6778 | ||
|
|
93c6845a6d | ||
|
|
b659c805fc | ||
|
|
15eaf8dc84 | ||
|
|
cafe89047c | ||
|
|
b5705ff47a | ||
|
|
1b07b25ad2 | ||
|
|
a46163bcd7 | ||
|
|
6531b1ebbc | ||
|
|
dc7bbdce11 | ||
|
|
a29cbc1112 | ||
|
|
afc2099865 | ||
|
|
7d251444e6 | ||
|
|
1c2289dacd | ||
|
|
044ac5d5d3 | ||
|
|
38167ed273 | ||
|
|
e15ffbc856 | ||
|
|
6cf2716615 | ||
|
|
0468b315d4 | ||
|
|
de66c74a91 | ||
|
|
7db73cd215 | ||
|
|
242eceb1c6 | ||
|
|
c2b84db5a2 | ||
|
|
487bee35ab | ||
|
|
9fabeb77bc | ||
|
|
bfea2dec4d | ||
|
|
2ed07850c6 | ||
|
|
b72d36d96f | ||
|
|
e3ff048ff6 | ||
|
|
ceef43681d | ||
|
|
3ec00676e4 | ||
|
|
e6575fb1db | ||
|
|
fa98d733d6 | ||
|
|
2981a10e62 | ||
|
|
551c06f885 | ||
|
|
a1c59071a1 | ||
|
|
13af443057 | ||
|
|
b8e2b0d0f9 | ||
|
|
53cd776bf6 | ||
|
|
180bba8767 | ||
|
|
377cf1662e | ||
|
|
420c747551 | ||
|
|
7c5b4a87f2 | ||
|
|
7ea241b412 | ||
|
|
1547d4ee2f | ||
|
|
3dde4113e7 | ||
|
|
205e6ef18f | ||
|
|
d53830076b | ||
|
|
296a01b7bd | ||
|
|
f47fdd63f7 | ||
|
|
b0b5f5035a | ||
|
|
629ece6e41 | ||
|
|
4c79263dcf | ||
|
|
856b6201dc | ||
|
|
f2160b1479 | ||
|
|
535f6a13b3 | ||
|
|
2ab760e456 | ||
|
|
8b75fbc1e6 | ||
|
|
82f410e955 | ||
|
|
68a19bd39f | ||
|
|
48689622b4 | ||
|
|
acc2075986 | ||
|
|
1984ae1583 | ||
|
|
427f309aea | ||
|
|
84482ad30d | ||
|
|
09b67e9440 | ||
|
|
80cf74d85f | ||
|
|
17e055a00e | ||
|
|
a8d8c9d24e | ||
|
|
99a59763f1 | ||
|
|
0fa3a329e8 | ||
|
|
5fbe532ec5 | ||
|
|
5f3de889d7 | ||
|
|
a8db14196a | ||
|
|
03b10d64a8 | ||
|
|
86892d87e9 | ||
|
|
41218272c4 | ||
|
|
8b5514fa9f | ||
|
|
f14de56712 | ||
|
|
ecc5c9865b | ||
|
|
929a56a6e8 | ||
|
|
4416df8c39 | ||
|
|
fc80610663 | ||
|
|
cb03bfcb80 | ||
|
|
35ed10e252 | ||
|
|
41fc1621b1 | ||
|
|
9fefaef31e | ||
|
|
689a942f19 | ||
|
|
cb9654f1f4 | ||
|
|
a8f8cef484 | ||
|
|
6cf51c3222 | ||
|
|
0d8ae0cabe | ||
|
|
49d6f93d8b | ||
|
|
5173d709e0 | ||
|
|
778c3ab25c | ||
|
|
aa17d9ac9a | ||
|
|
ffe1d9485e | ||
|
|
71abebe837 | ||
|
|
ca07b64af0 | ||
|
|
2fde2ce581 | ||
|
|
cb0da2ca5e | ||
|
|
c0422839b9 | ||
|
|
862b884f02 | ||
|
|
63c9dcdd96 | ||
|
|
770ec00901 | ||
|
|
4c6fe0328a | ||
|
|
29e3a4e231 | ||
|
|
ca444b07bd | ||
|
|
510b9ef07a | ||
|
|
d59a6218ab | ||
|
|
5f26ba99bc | ||
|
|
8fcfb73a57 | ||
|
|
c9fb802b9e | ||
|
|
cbb1a37f5a | ||
|
|
42f9964e76 | ||
|
|
81c8f4c065 | ||
|
|
0703cb0027 | ||
|
|
2487e696b8 | ||
|
|
50227c435c | ||
|
|
256aaa362f | ||
|
|
2198498e29 | ||
|
|
46f79f17c8 | ||
|
|
ed870aac76 | ||
|
|
663964d94c | ||
|
|
8b1784e0d9 | ||
|
|
e6c07f088d | ||
|
|
6ef9ecdda0 | ||
|
|
aecea627e1 | ||
|
|
e2d428d8ba | ||
|
|
c0e1031a4a | ||
|
|
dea5eec440 | ||
|
|
23a8ff8a04 | ||
|
|
a3c95154f5 | ||
|
|
f9e52ea53d | ||
|
|
001a2c89e7 | ||
|
|
38631c9eb3 | ||
|
|
07e9467507 | ||
|
|
a9d109b3ce | ||
|
|
5cbbd7a14e | ||
|
|
424ef2f6e9 | ||
|
|
26a6fa864d | ||
|
|
01327ebd4c | ||
|
|
23be422477 | ||
|
|
1f47fbafff | ||
|
|
19f58936a8 | ||
|
|
0e7c76a38f | ||
|
|
193092ed67 | ||
|
|
ec8667a63c | ||
|
|
554581b099 | ||
|
|
31b3f10cc8 | ||
|
|
bbfd2f802b | ||
|
|
b7c12ea879 | ||
|
|
453b041f0d | ||
|
|
e45190bee4 | ||
|
|
e9ee8471a9 | ||
|
|
854bc45e59 | ||
|
|
4066df3229 | ||
|
|
7710f8f076 | ||
|
|
2dd9bcbd50 | ||
|
|
b6b93c74ea | ||
|
|
c68a524d35 | ||
|
|
3af8529843 | ||
|
|
798ae43c84 | ||
|
|
8a8bb3cf7e | ||
|
|
df79de455f | ||
|
|
978226a275 | ||
|
|
0c5a60713d | ||
|
|
20cf326fec | ||
|
|
3e386f51a1 | ||
|
|
28e2a0560c | ||
|
|
9797633e5c | ||
|
|
b6184dcf29 | ||
|
|
f28bfa6d62 | ||
|
|
f1f01451cc | ||
|
|
cb1bcb398a | ||
|
|
0e53f221cf | ||
|
|
1413fae16c | ||
|
|
fa9d78ffb6 | ||
|
|
327ccd93a4 | ||
|
|
24b5f05d5e | ||
|
|
ccc3af8937 | ||
|
|
b6b503a190 | ||
|
|
fdda5da598 | ||
|
|
86e571f18b | ||
|
|
7b3b55f6ef | ||
|
|
0363628a55 | ||
|
|
f2e7704853 | ||
|
|
66651d0648 | ||
|
|
5909595442 | ||
|
|
bf92d30877 | ||
|
|
9bd9645b3e | ||
|
|
5c5e4fff7b | ||
|
|
de235cc8be | ||
|
|
e4890297a6 | ||
|
|
13d4d0777f | ||
|
|
982d714749 | ||
|
|
4c18fbcafd | ||
|
|
37ec7421aa | ||
|
|
d289222b39 | ||
|
|
ad2947e407 | ||
|
|
41f441bdde | ||
|
|
e24203fb2f | ||
|
|
5997339730 | ||
|
|
b54a4d1f92 | ||
|
|
8f7a446ec8 | ||
|
|
3304526093 | ||
|
|
f711a02a62 | ||
|
|
5b779f5200 | ||
|
|
5bf6d83d2d | ||
|
|
7ea54d28cd | ||
|
|
268a59d0a9 | ||
|
|
9477aad950 | ||
|
|
8feb45fa72 | ||
|
|
b6f07f3058 | ||
|
|
5730a47b00 | ||
|
|
3c35a317d4 | ||
|
|
0c270d61d8 | ||
|
|
1b14d43341 |
19
.cvsignore
Normal file
19
.cvsignore
Normal file
@@ -0,0 +1,19 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
SimGear.spec
|
||||
aclocal.m4
|
||||
autom4te.cache
|
||||
config.cache
|
||||
config.log
|
||||
config.status
|
||||
configure
|
||||
do-config.sh
|
||||
.cdtproject
|
||||
.project
|
||||
config.guess
|
||||
config.sub
|
||||
depcomp
|
||||
INSTALL
|
||||
install-sh
|
||||
missing
|
||||
mkinstalldirs
|
||||
481
COPYING
Normal file
481
COPYING
Normal file
@@ -0,0 +1,481 @@
|
||||
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the library GPL. It is
|
||||
numbered 2 because it goes with version 2 of the ordinary GPL.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Library General Public License, applies to some
|
||||
specially designated Free Software Foundation software, and to any
|
||||
other libraries whose authors decide to use it. You can use it for
|
||||
your libraries, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if
|
||||
you distribute copies of the library, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link a program with the library, you must provide
|
||||
complete object files to the recipients so that they can relink them
|
||||
with the library, after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
Our method of protecting your rights has two steps: (1) copyright
|
||||
the library, and (2) offer you this license which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
Also, for each distributor's protection, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
library. If the library is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original
|
||||
version, so that any problems introduced by others will not reflect on
|
||||
the original authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that companies distributing free
|
||||
software will individually obtain patent licenses, thus in effect
|
||||
transforming the program into proprietary software. To prevent this,
|
||||
we have made it clear that any patent must be licensed for everyone's
|
||||
free use or not licensed at all.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the ordinary
|
||||
GNU General Public License, which was designed for utility programs. This
|
||||
license, the GNU Library General Public License, applies to certain
|
||||
designated libraries. This license is quite different from the ordinary
|
||||
one; be sure to read it in full, and don't assume that anything in it is
|
||||
the same as in the ordinary license.
|
||||
|
||||
The reason we have a separate public license for some libraries is that
|
||||
they blur the distinction we usually make between modifying or adding to a
|
||||
program and simply using it. Linking a program with a library, without
|
||||
changing the library, is in some sense simply using the library, and is
|
||||
analogous to running a utility program or application program. However, in
|
||||
a textual and legal sense, the linked executable is a combined work, a
|
||||
derivative of the original library, and the ordinary General Public License
|
||||
treats it as such.
|
||||
|
||||
Because of this blurred distinction, using the ordinary General
|
||||
Public License for libraries did not effectively promote software
|
||||
sharing, because most developers did not use the libraries. We
|
||||
concluded that weaker conditions might promote sharing better.
|
||||
|
||||
However, unrestricted linking of non-free programs would deprive the
|
||||
users of those programs of all benefit from the free status of the
|
||||
libraries themselves. This Library General Public License is intended to
|
||||
permit developers of non-free programs to use free libraries, while
|
||||
preserving your freedom as a user of such programs to change the free
|
||||
libraries that are incorporated in them. (We have not seen how to achieve
|
||||
this as regards changes in header files, but we have achieved it as regards
|
||||
changes in the actual functions of the Library.) The hope is that this
|
||||
will lead to faster development of free libraries.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, while the latter only
|
||||
works together with the library.
|
||||
|
||||
Note that it is possible for a library to be covered by the ordinary
|
||||
General Public License rather than by this special one.
|
||||
|
||||
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library which
|
||||
contains a notice placed by the copyright holder or other authorized
|
||||
party saying it may be distributed under the terms of this Library
|
||||
General Public License (also called "this License"). Each licensee is
|
||||
addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
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
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also compile or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
c) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
d) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the source code distributed need not include anything that is normally
|
||||
distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Library General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE 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
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library 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 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
811
Doxyfile
Normal file
811
Doxyfile
Normal file
@@ -0,0 +1,811 @@
|
||||
# Doxyfile 1.2.6
|
||||
|
||||
# This file describes the settings to be used by doxygen for a project
|
||||
#
|
||||
# All text after a hash (#) is considered a comment and will be ignored
|
||||
# The format is:
|
||||
# TAG = value [value, ...]
|
||||
# For lists items can also be appended using:
|
||||
# TAG += value [value, ...]
|
||||
# Values that contain spaces should be placed between quotes (" ")
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# General configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
|
||||
# by quotes) that should identify the project.
|
||||
|
||||
PROJECT_NAME = SimGear
|
||||
|
||||
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
|
||||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER = 0.3.10
|
||||
|
||||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
||||
# base path where the generated documentation will be put.
|
||||
# If a relative path is entered, it will be relative to the location
|
||||
# where doxygen was started. If left blank the current directory will be used.
|
||||
|
||||
OUTPUT_DIRECTORY = ../doxy
|
||||
|
||||
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
|
||||
# documentation generated by doxygen is written. Doxygen will use this
|
||||
# information to generate all constant output in the proper language.
|
||||
# The default language is English, other supported languages are:
|
||||
# Dutch, French, Italian, Czech, Swedish, German, Finnish, Japanese,
|
||||
# Korean, Hungarian, Norwegian, Spanish, Romanian, Russian, Croatian,
|
||||
# Polish, Portuguese and Slovene.
|
||||
|
||||
OUTPUT_LANGUAGE = English
|
||||
|
||||
# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
|
||||
# documentation are documented, even if no documentation was available.
|
||||
# Private class members and static file members will be hidden unless
|
||||
# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
|
||||
|
||||
EXTRACT_ALL = NO
|
||||
|
||||
# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
|
||||
# will be included in the documentation.
|
||||
|
||||
EXTRACT_PRIVATE = NO
|
||||
|
||||
# If the EXTRACT_STATIC tag is set to YES all static members of a file
|
||||
# will be included in the documentation.
|
||||
|
||||
EXTRACT_STATIC = NO
|
||||
|
||||
# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
|
||||
# undocumented members of documented classes, files or namespaces.
|
||||
# If set to NO (the default) these members will be included in the
|
||||
# various overviews, but no documentation section is generated.
|
||||
# This option has no effect if EXTRACT_ALL is enabled.
|
||||
|
||||
HIDE_UNDOC_MEMBERS = YES
|
||||
|
||||
# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
|
||||
# undocumented classes that are normally visible in the class hierarchy.
|
||||
# If set to NO (the default) these class will be included in the various
|
||||
# overviews. This option has no effect if EXTRACT_ALL is enabled.
|
||||
|
||||
HIDE_UNDOC_CLASSES = YES
|
||||
|
||||
# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
|
||||
# include brief member descriptions after the members that are listed in
|
||||
# the file and class documentation (similar to JavaDoc).
|
||||
# Set to NO to disable this.
|
||||
|
||||
BRIEF_MEMBER_DESC = YES
|
||||
|
||||
# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
|
||||
# the brief description of a member or function before the detailed description.
|
||||
# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
|
||||
# brief descriptions will be completely suppressed.
|
||||
|
||||
REPEAT_BRIEF = YES
|
||||
|
||||
# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
|
||||
# Doxygen will generate a detailed section even if there is only a brief
|
||||
# description.
|
||||
|
||||
ALWAYS_DETAILED_SEC = NO
|
||||
|
||||
# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
|
||||
# path before files name in the file list and in the header files. If set
|
||||
# to NO the shortest path that makes the file name unique will be used.
|
||||
|
||||
FULL_PATH_NAMES = NO
|
||||
|
||||
# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
|
||||
# can be used to strip a user defined part of the path. Stripping is
|
||||
# only done if one of the specified strings matches the left-hand part of
|
||||
# the path. It is allowed to use relative paths in the argument list.
|
||||
|
||||
STRIP_FROM_PATH =
|
||||
|
||||
# The INTERNAL_DOCS tag determines if documentation
|
||||
# that is typed after a \internal command is included. If the tag is set
|
||||
# to NO (the default) then the documentation will be excluded.
|
||||
# Set it to YES to include the internal documentation.
|
||||
|
||||
INTERNAL_DOCS = NO
|
||||
|
||||
# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
|
||||
# generate a class diagram (in Html and LaTeX) for classes with base or
|
||||
# super classes. Setting the tag to NO turns the diagrams off.
|
||||
|
||||
CLASS_DIAGRAMS = YES
|
||||
|
||||
# If the SOURCE_BROWSER tag is set to YES then a list of source files will
|
||||
# be generated. Documented entities will be cross-referenced with these sources.
|
||||
|
||||
SOURCE_BROWSER = YES
|
||||
|
||||
# Setting the INLINE_SOURCES tag to YES will include the body
|
||||
# of functions and classes directly in the documentation.
|
||||
|
||||
INLINE_SOURCES = NO
|
||||
|
||||
# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
|
||||
# doxygen to hide any special comment blocks from generated source code
|
||||
# fragments. Normal C and C++ comments will always remain visible.
|
||||
|
||||
STRIP_CODE_COMMENTS = YES
|
||||
|
||||
# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
|
||||
# file names in lower case letters. If set to YES upper case letters are also
|
||||
# allowed. This is useful if you have classes or files whose names only differ
|
||||
# in case and if your file system supports case sensitive file names. Windows
|
||||
# users are adviced to set this option to NO.
|
||||
|
||||
CASE_SENSE_NAMES = YES
|
||||
|
||||
# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
|
||||
# will show members with their full class and namespace scopes in the
|
||||
# documentation. If set to YES the scope will be hidden.
|
||||
|
||||
HIDE_SCOPE_NAMES = NO
|
||||
|
||||
# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
|
||||
# will generate a verbatim copy of the header file for each class for
|
||||
# which an include is specified. Set to NO to disable this.
|
||||
|
||||
VERBATIM_HEADERS = YES
|
||||
|
||||
# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
|
||||
# will put list of the files that are included by a file in the documentation
|
||||
# of that file.
|
||||
|
||||
SHOW_INCLUDE_FILES = YES
|
||||
|
||||
# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
|
||||
# will interpret the first line (until the first dot) of a JavaDoc-style
|
||||
# comment as the brief description. If set to NO, the JavaDoc
|
||||
# comments will behave just like the Qt-style comments (thus requiring an
|
||||
# explict @brief command for a brief description.
|
||||
|
||||
JAVADOC_AUTOBRIEF = YES
|
||||
|
||||
# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
|
||||
# member inherits the documentation from any documented member that it
|
||||
# reimplements.
|
||||
|
||||
INHERIT_DOCS = YES
|
||||
|
||||
# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
|
||||
# is inserted in the documentation for inline members.
|
||||
|
||||
INLINE_INFO = YES
|
||||
|
||||
# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
|
||||
# will sort the (detailed) documentation of file and class members
|
||||
# alphabetically by member name. If set to NO the members will appear in
|
||||
# declaration order.
|
||||
|
||||
SORT_MEMBER_DOCS = YES
|
||||
|
||||
# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
|
||||
# tag is set to YES, then doxygen will reuse the documentation of the first
|
||||
# member in the group (if any) for the other members of the group. By default
|
||||
# all members of a group must be documented explicitly.
|
||||
|
||||
DISTRIBUTE_GROUP_DOC = NO
|
||||
|
||||
# The TAB_SIZE tag can be used to set the number of spaces in a tab.
|
||||
# Doxygen uses this value to replace tabs by spaces in code fragments.
|
||||
|
||||
TAB_SIZE = 8
|
||||
|
||||
# The ENABLE_SECTIONS tag can be used to enable conditional
|
||||
# documentation sections, marked by \if sectionname ... \endif.
|
||||
|
||||
ENABLED_SECTIONS =
|
||||
|
||||
# The GENERATE_TODOLIST tag can be used to enable (YES) or
|
||||
# disable (NO) the todo list. This list is created by putting \todo
|
||||
# commands in the documentation.
|
||||
|
||||
GENERATE_TODOLIST = YES
|
||||
|
||||
# The GENERATE_TESTLIST tag can be used to enable (YES) or
|
||||
# disable (NO) the test list. This list is created by putting \test
|
||||
# commands in the documentation.
|
||||
|
||||
GENERATE_TESTLIST = YES
|
||||
|
||||
# The GENERATE_BUGLIST tag can be used to enable (YES) or
|
||||
# disable (NO) the bug list. This list is created by putting \bug
|
||||
# commands in the documentation.
|
||||
|
||||
GENERATE_BUGLIST = YES
|
||||
|
||||
# This tag can be used to specify a number of aliases that acts
|
||||
# as commands in the documentation. An alias has the form "name=value".
|
||||
# For example adding "sideeffect=\par Side Effects:\n" will allow you to
|
||||
# put the command \sideeffect (or @sideeffect) in the documentation, which
|
||||
# will result in a user defined paragraph with heading "Side Effects:".
|
||||
# You can put \n's in the value part of an alias to insert newlines.
|
||||
|
||||
ALIASES =
|
||||
|
||||
# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
|
||||
# the initial value of a variable or define consist of for it to appear in
|
||||
# the documentation. If the initializer consists of more lines than specified
|
||||
# here it will be hidden. Use a value of 0 to hide initializers completely.
|
||||
# The appearance of the initializer of individual variables and defines in the
|
||||
# documentation can be controlled using \showinitializer or \hideinitializer
|
||||
# command in the documentation regardless of this setting.
|
||||
|
||||
MAX_INITIALIZER_LINES = 30
|
||||
|
||||
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
|
||||
# only. Doxygen will then generate output that is more tailored for C.
|
||||
# For instance some of the names that are used will be different. The list
|
||||
# of all members will be omitted, etc.
|
||||
|
||||
OPTIMIZE_OUTPUT_FOR_C = NO
|
||||
|
||||
# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
|
||||
# at the bottom of the documentation of classes and structs. If set to YES the
|
||||
# list will mention the files that were used to generate the documentation.
|
||||
|
||||
SHOW_USED_FILES = YES
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to warning and progress messages
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
# The QUIET tag can be used to turn on/off the messages that are generated
|
||||
# by doxygen. Possible values are YES and NO. If left blank NO is used.
|
||||
|
||||
QUIET = NO
|
||||
|
||||
# The WARNINGS tag can be used to turn on/off the warning messages that are
|
||||
# generated by doxygen. Possible values are YES and NO. If left blank
|
||||
# NO is used.
|
||||
|
||||
WARNINGS = YES
|
||||
|
||||
# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
|
||||
# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
|
||||
# automatically be disabled.
|
||||
|
||||
WARN_IF_UNDOCUMENTED = YES
|
||||
|
||||
# The WARN_FORMAT tag determines the format of the warning messages that
|
||||
# doxygen can produce. The string should contain the $file, $line, and $text
|
||||
# tags, which will be replaced by the file and line number from which the
|
||||
# warning originated and the warning text.
|
||||
|
||||
WARN_FORMAT = "$file:$line: $text"
|
||||
|
||||
# The WARN_LOGFILE tag can be used to specify a file to which warning
|
||||
# and error messages should be written. If left blank the output is written
|
||||
# to stderr.
|
||||
|
||||
WARN_LOGFILE =
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the input files
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
# The INPUT tag can be used to specify the files and/or directories that contain
|
||||
# documented source files. You may enter file names like "myfile.cpp" or
|
||||
# directories like "/usr/src/myproject". Separate the files or directories
|
||||
# with spaces.
|
||||
|
||||
INPUT = \
|
||||
DoxygenMain.cxx \
|
||||
simgear/bucket \
|
||||
simgear/compiler.h \
|
||||
simgear/constants.h \
|
||||
simgear/debug \
|
||||
simgear/environment \
|
||||
simgear/ephemeris \
|
||||
simgear/io \
|
||||
simgear/magvar \
|
||||
simgear/math \
|
||||
simgear/misc \
|
||||
simgear/nasal \
|
||||
simgear/props \
|
||||
simgear/route \
|
||||
simgear/scene \
|
||||
simgear/screen \
|
||||
simgear/serial \
|
||||
simgear/structure \
|
||||
simgear/sg_inlines.h \
|
||||
simgear/sg_traits.hxx \
|
||||
simgear/sound \
|
||||
simgear/threads \
|
||||
simgear/timing \
|
||||
simgear/xml
|
||||
|
||||
# If the value of the INPUT tag contains directories, you can use the
|
||||
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
|
||||
# and *.h) to filter out the source-files in the directories. If left
|
||||
# blank all files are included.
|
||||
|
||||
FILE_PATTERNS = *.h *.hxx *.c *.cxx *.cpp
|
||||
|
||||
# The RECURSIVE tag can be used to turn specify whether or not subdirectories
|
||||
# should be searched for input files as well. Possible values are YES and NO.
|
||||
# If left blank NO is used.
|
||||
|
||||
RECURSIVE = YES
|
||||
|
||||
# The EXCLUDE tag can be used to specify files and/or directories that should
|
||||
# excluded from the INPUT source files. This way you can easily exclude a
|
||||
# subdirectory from a directory tree whose root is specified with the INPUT tag.
|
||||
|
||||
EXCLUDE = simgear/scene/sky/clouds3d
|
||||
|
||||
# If the value of the INPUT tag contains directories, you can use the
|
||||
# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
|
||||
# certain files from those directories.
|
||||
|
||||
EXCLUDE_PATTERNS =
|
||||
|
||||
# The EXAMPLE_PATH tag can be used to specify one or more files or
|
||||
# directories that contain example code fragments that are included (see
|
||||
# the \include command).
|
||||
|
||||
EXAMPLE_PATH =
|
||||
|
||||
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
|
||||
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
|
||||
# and *.h) to filter out the source-files in the directories. If left
|
||||
# blank all files are included.
|
||||
|
||||
EXAMPLE_PATTERNS =
|
||||
|
||||
# The IMAGE_PATH tag can be used to specify one or more files or
|
||||
# directories that contain image that are included in the documentation (see
|
||||
# the \image command).
|
||||
|
||||
IMAGE_PATH =
|
||||
|
||||
# The INPUT_FILTER tag can be used to specify a program that doxygen should
|
||||
# invoke to filter for each input file. Doxygen will invoke the filter program
|
||||
# by executing (via popen()) the command <filter> <input-file>, where <filter>
|
||||
# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
|
||||
# input file. Doxygen will then use the output that the filter program writes
|
||||
# to standard output.
|
||||
|
||||
INPUT_FILTER =
|
||||
|
||||
# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
|
||||
# INPUT_FILTER) will be used to filter the input files when producing source
|
||||
# files to browse.
|
||||
|
||||
FILTER_SOURCE_FILES = NO
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the alphabetical class index
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
|
||||
# of all compounds will be generated. Enable this if the project
|
||||
# contains a lot of classes, structs, unions or interfaces.
|
||||
|
||||
ALPHABETICAL_INDEX = YES
|
||||
|
||||
# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
|
||||
# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
|
||||
# in which this list will be split (can be a number in the range [1..20])
|
||||
|
||||
COLS_IN_ALPHA_INDEX = 5
|
||||
|
||||
# In case all classes in a project start with a common prefix, all
|
||||
# classes will be put under the same header in the alphabetical index.
|
||||
# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
|
||||
# should be ignored while generating the index headers.
|
||||
|
||||
IGNORE_PREFIX =
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the HTML output
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
|
||||
# generate HTML output.
|
||||
|
||||
GENERATE_HTML = YES
|
||||
|
||||
# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
|
||||
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
|
||||
# put in front of it. If left blank `html' will be used as the default path.
|
||||
|
||||
HTML_OUTPUT = html
|
||||
|
||||
# The HTML_HEADER tag can be used to specify a personal HTML header for
|
||||
# each generated HTML page. If it is left blank doxygen will generate a
|
||||
# standard header.
|
||||
|
||||
HTML_HEADER =
|
||||
|
||||
# The HTML_FOOTER tag can be used to specify a personal HTML footer for
|
||||
# each generated HTML page. If it is left blank doxygen will generate a
|
||||
# standard footer.
|
||||
|
||||
HTML_FOOTER =
|
||||
|
||||
# The HTML_STYLESHEET tag can be used to specify a user defined cascading
|
||||
# style sheet that is used by each HTML page. It can be used to
|
||||
# fine-tune the look of the HTML output. If the tag is left blank doxygen
|
||||
# will generate a default style sheet
|
||||
|
||||
HTML_STYLESHEET =
|
||||
|
||||
# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
|
||||
# files or namespaces will be aligned in HTML using tables. If set to
|
||||
# NO a bullet list will be used.
|
||||
|
||||
HTML_ALIGN_MEMBERS = YES
|
||||
|
||||
# If the GENERATE_HTMLHELP tag is set to YES, additional index files
|
||||
# will be generated that can be used as input for tools like the
|
||||
# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
|
||||
# of the generated HTML documentation.
|
||||
|
||||
GENERATE_HTMLHELP = NO
|
||||
|
||||
# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
|
||||
# controls if a separate .chi index file is generated (YES) or that
|
||||
# it should be included in the master .chm file (NO).
|
||||
|
||||
GENERATE_CHI = NO
|
||||
|
||||
# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
|
||||
# controls whether a binary table of contents is generated (YES) or a
|
||||
# normal table of contents (NO) in the .chm file.
|
||||
|
||||
BINARY_TOC = NO
|
||||
|
||||
# The TOC_EXPAND flag can be set YES to add extra items for group members
|
||||
# to the contents of the Html help documentation and to the tree view.
|
||||
|
||||
TOC_EXPAND = NO
|
||||
|
||||
# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
|
||||
# top of each HTML page. The value NO (the default) enables the index and
|
||||
# the value YES disables it.
|
||||
|
||||
DISABLE_INDEX = NO
|
||||
|
||||
# This tag can be used to set the number of enum values (range [1..20])
|
||||
# that doxygen will group on one line in the generated HTML documentation.
|
||||
|
||||
ENUM_VALUES_PER_LINE = 4
|
||||
|
||||
# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
|
||||
# generated containing a tree-like index structure (just like the one that
|
||||
# is generated for HTML Help). For this to work a browser that supports
|
||||
# JavaScript and frames is required (for instance Netscape 4.0+
|
||||
# or Internet explorer 4.0+).
|
||||
|
||||
GENERATE_TREEVIEW = NO
|
||||
|
||||
# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
|
||||
# used to set the initial width (in pixels) of the frame in which the tree
|
||||
# is shown.
|
||||
|
||||
TREEVIEW_WIDTH = 250
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the LaTeX output
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
|
||||
# generate Latex output.
|
||||
|
||||
GENERATE_LATEX = YES
|
||||
|
||||
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
|
||||
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
|
||||
# put in front of it. If left blank `latex' will be used as the default path.
|
||||
|
||||
LATEX_OUTPUT = latex
|
||||
|
||||
# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
|
||||
# LaTeX documents. This may be useful for small projects and may help to
|
||||
# save some trees in general.
|
||||
|
||||
COMPACT_LATEX = NO
|
||||
|
||||
# The PAPER_TYPE tag can be used to set the paper type that is used
|
||||
# by the printer. Possible values are: a4, a4wide, letter, legal and
|
||||
# executive. If left blank a4wide will be used.
|
||||
|
||||
PAPER_TYPE = letter
|
||||
|
||||
# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
|
||||
# packages that should be included in the LaTeX output.
|
||||
|
||||
EXTRA_PACKAGES =
|
||||
|
||||
# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
|
||||
# the generated latex document. The header should contain everything until
|
||||
# the first chapter. If it is left blank doxygen will generate a
|
||||
# standard header. Notice: only use this tag if you know what you are doing!
|
||||
|
||||
LATEX_HEADER =
|
||||
|
||||
# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
|
||||
# is prepared for conversion to pdf (using ps2pdf). The pdf file will
|
||||
# contain links (just like the HTML output) instead of page references
|
||||
# This makes the output suitable for online browsing using a pdf viewer.
|
||||
|
||||
PDF_HYPERLINKS = NO
|
||||
|
||||
# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
|
||||
# plain latex in the generated Makefile. Set this option to YES to get a
|
||||
# higher quality PDF documentation.
|
||||
|
||||
USE_PDFLATEX = NO
|
||||
|
||||
# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
|
||||
# command to the generated LaTeX files. This will instruct LaTeX to keep
|
||||
# running if errors occur, instead of asking the user for help.
|
||||
# This option is also used when generating formulas in HTML.
|
||||
|
||||
LATEX_BATCHMODE = NO
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the RTF output
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
|
||||
# The RTF output is optimised for Word 97 and may not look very pretty with
|
||||
# other RTF readers or editors.
|
||||
|
||||
GENERATE_RTF = YES
|
||||
|
||||
# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
|
||||
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
|
||||
# put in front of it. If left blank `rtf' will be used as the default path.
|
||||
|
||||
RTF_OUTPUT = rtf
|
||||
|
||||
# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
|
||||
# RTF documents. This may be useful for small projects and may help to
|
||||
# save some trees in general.
|
||||
|
||||
COMPACT_RTF = NO
|
||||
|
||||
# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
|
||||
# will contain hyperlink fields. The RTF file will
|
||||
# contain links (just like the HTML output) instead of page references.
|
||||
# This makes the output suitable for online browsing using a WORD or other.
|
||||
# programs which support those fields.
|
||||
# Note: wordpad (write) and others do not support links.
|
||||
|
||||
RTF_HYPERLINKS = NO
|
||||
|
||||
# Load stylesheet definitions from file. Syntax is similar to doxygen's
|
||||
# config file, i.e. a series of assigments. You only have to provide
|
||||
# replacements, missing definitions are set to their default value.
|
||||
|
||||
RTF_STYLESHEET_FILE =
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the man page output
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
|
||||
# generate man pages
|
||||
|
||||
GENERATE_MAN = YES
|
||||
|
||||
# The MAN_OUTPUT tag is used to specify where the man pages will be put.
|
||||
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
|
||||
# put in front of it. If left blank `man' will be used as the default path.
|
||||
|
||||
MAN_OUTPUT = man
|
||||
|
||||
# The MAN_EXTENSION tag determines the extension that is added to
|
||||
# the generated man pages (default is the subroutine's section .3)
|
||||
|
||||
MAN_EXTENSION = .3
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the preprocessor
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
|
||||
# evaluate all C-preprocessor directives found in the sources and include
|
||||
# files.
|
||||
|
||||
ENABLE_PREPROCESSING = YES
|
||||
|
||||
# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
|
||||
# names in the source code. If set to NO (the default) only conditional
|
||||
# compilation will be performed. Macro expansion can be done in a controlled
|
||||
# way by setting EXPAND_ONLY_PREDEF to YES.
|
||||
|
||||
MACRO_EXPANSION = NO
|
||||
|
||||
# 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_PREDEFINED tags.
|
||||
|
||||
EXPAND_ONLY_PREDEF = NO
|
||||
|
||||
# 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.
|
||||
|
||||
SEARCH_INCLUDES = YES
|
||||
|
||||
# The INCLUDE_PATH tag can be used to specify one or more directories that
|
||||
# contain include files that are not input files but should be processed by
|
||||
# the preprocessor.
|
||||
|
||||
INCLUDE_PATH =
|
||||
|
||||
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
|
||||
# patterns (like *.h and *.hpp) to filter out the header-files in the
|
||||
# directories. If left blank, the patterns specified with FILE_PATTERNS will
|
||||
# be used.
|
||||
|
||||
INCLUDE_FILE_PATTERNS =
|
||||
|
||||
# The PREDEFINED tag can be used to specify one or more macro names that
|
||||
# are defined before the preprocessor is started (similar to the -D option of
|
||||
# gcc). The argument of the tag is a list of macros of the form: name
|
||||
# or name=definition (no spaces). If the definition and the = are
|
||||
# omitted =1 is assumed.
|
||||
|
||||
PREDEFINED =
|
||||
|
||||
# If the MACRO_EXPANSION and EXPAND_PREDEF_ONLY tags are set to YES then
|
||||
# this tag can be used to specify a list of macro names that should be expanded.
|
||||
# The macro definition that is found in the sources will be used.
|
||||
# Use the PREDEFINED tag if you want to use a different macro definition.
|
||||
|
||||
EXPAND_AS_DEFINED =
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::addtions related to external references
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
# The TAGFILES tag can be used to specify one or more tagfiles.
|
||||
|
||||
TAGFILES =
|
||||
|
||||
# When a file name is specified after GENERATE_TAGFILE, doxygen will create
|
||||
# a tag file that is based on the input files it reads.
|
||||
|
||||
GENERATE_TAGFILE =
|
||||
|
||||
# If the ALLEXTERNALS tag is set to YES all external classes will be listed
|
||||
# in the class index. If set to NO only the inherited external classes
|
||||
# will be listed.
|
||||
|
||||
ALLEXTERNALS = NO
|
||||
|
||||
# The PERL_PATH should be the absolute path and name of the perl script
|
||||
# interpreter (i.e. the result of `which perl').
|
||||
|
||||
PERL_PATH = /usr/bin/perl
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the dot tool
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
|
||||
# available from the path. This tool is part of Graphviz, a graph visualization
|
||||
# toolkit from AT&T and Lucent Bell Labs. The other options in this section
|
||||
# have no effect if this option is set to NO (the default)
|
||||
|
||||
HAVE_DOT = NO
|
||||
|
||||
# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
|
||||
# will generate a graph for each documented class showing the direct and
|
||||
# indirect inheritance relations. Setting this tag to YES will force the
|
||||
# the CLASS_DIAGRAMS tag to NO.
|
||||
|
||||
CLASS_GRAPH = YES
|
||||
|
||||
# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
|
||||
# will generate a graph for each documented class showing the direct and
|
||||
# indirect implementation dependencies (inheritance, containment, and
|
||||
# class references variables) of the class with other documented classes.
|
||||
|
||||
COLLABORATION_GRAPH = YES
|
||||
|
||||
# If the ENABLE_PREPROCESSING, INCLUDE_GRAPH, and HAVE_DOT tags are set to
|
||||
# YES then doxygen will generate a graph for each documented file showing
|
||||
# the direct and indirect include dependencies of the file with other
|
||||
# documented files.
|
||||
|
||||
INCLUDE_GRAPH = YES
|
||||
|
||||
# If the ENABLE_PREPROCESSING, INCLUDED_BY_GRAPH, and HAVE_DOT tags are set to
|
||||
# YES then doxygen will generate a graph for each documented header file showing
|
||||
# the documented files that directly or indirectly include this file
|
||||
|
||||
INCLUDED_BY_GRAPH = YES
|
||||
|
||||
# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
|
||||
# will graphical hierarchy of all classes instead of a textual one.
|
||||
|
||||
GRAPHICAL_HIERARCHY = YES
|
||||
|
||||
# The tag DOT_PATH can be used to specify the path where the dot tool can be
|
||||
# found. If left blank, it is assumed the dot tool can be found on the path.
|
||||
|
||||
DOT_PATH =
|
||||
|
||||
# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width
|
||||
# (in pixels) of the graphs generated by dot. If a graph becomes larger than
|
||||
# this value, doxygen will try to truncate the graph, so that it fits within
|
||||
# the specified constraint. Beware that most browsers cannot cope with very
|
||||
# large images.
|
||||
|
||||
MAX_DOT_GRAPH_WIDTH = 1024
|
||||
|
||||
# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height
|
||||
# (in pixels) of the graphs generated by dot. If a graph becomes larger than
|
||||
# this value, doxygen will try to truncate the graph, so that it fits within
|
||||
# the specified constraint. Beware that most browsers cannot cope with very
|
||||
# large images.
|
||||
|
||||
MAX_DOT_GRAPH_HEIGHT = 1024
|
||||
|
||||
# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
|
||||
# generate a legend page explaining the meaning of the various boxes and
|
||||
# arrows in the dot generated graphs.
|
||||
|
||||
GENERATE_LEGEND = YES
|
||||
|
||||
# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
|
||||
# remove the intermedate dot files that are used to generate
|
||||
# the various graphs.
|
||||
|
||||
DOT_CLEANUP = YES
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::addtions related to the search engine
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
# The SEARCHENGINE tag specifies whether or not a search engine should be
|
||||
# used. If set to NO the values of all tags below this one will be ignored.
|
||||
|
||||
SEARCHENGINE = NO
|
||||
|
||||
# The CGI_NAME tag should be the name of the CGI script that
|
||||
# starts the search engine (doxysearch) with the correct parameters.
|
||||
# A script with this name will be generated by doxygen.
|
||||
|
||||
CGI_NAME = search.cgi
|
||||
|
||||
# The CGI_URL tag should be the absolute URL to the directory where the
|
||||
# cgi binaries are located. See the documentation of your http daemon for
|
||||
# details.
|
||||
|
||||
CGI_URL =
|
||||
|
||||
# The DOC_URL tag should be the absolute URL to the directory where the
|
||||
# documentation is located. If left blank the absolute path to the
|
||||
# documentation, with file:// prepended to it, will be used.
|
||||
|
||||
DOC_URL =
|
||||
|
||||
# The DOC_ABSPATH tag should be the absolute path to the directory where the
|
||||
# documentation is located. If left blank the directory on the local machine
|
||||
# will be used.
|
||||
|
||||
DOC_ABSPATH =
|
||||
|
||||
# The BIN_ABSPATH tag must point to the directory where the doxysearch binary
|
||||
# is installed.
|
||||
|
||||
BIN_ABSPATH = /usr/local/bin/
|
||||
|
||||
# The EXT_DOC_PATHS tag can be used to specify one or more paths to
|
||||
# documentation generated for other projects. This allows doxysearch to search
|
||||
# the documentation for these projects as well.
|
||||
|
||||
EXT_DOC_PATHS =
|
||||
108
DoxygenMain.cxx
Normal file
108
DoxygenMain.cxx
Normal file
@@ -0,0 +1,108 @@
|
||||
/* This is a dummy code file that only contains doxygen main page
|
||||
documentation. It has a .cxx extension so that emacs will happily
|
||||
autoindent correctly. */
|
||||
|
||||
/** \mainpage SimGear
|
||||
* Simulation, Visualization, and Game development libraries.
|
||||
|
||||
* \section intro Introduction
|
||||
*
|
||||
* SimGear is a collection of libraries which provide a variety of
|
||||
* functionality useful for building simulations, visualizations, and
|
||||
* even games. All the SimGear code is designed to be portable across
|
||||
* a wide variety of platforms and compilers. It has primarily been
|
||||
* developed in support of the FlightGear project, but as development
|
||||
* moves forward, we are generalizing the code to make more of it
|
||||
* useful for other types of applications.
|
||||
*
|
||||
* Some of the functionality provide includes
|
||||
*
|
||||
* - Compiler and platform abstractions for many tricky differences.
|
||||
* (compiler.h)
|
||||
*
|
||||
* - A whole earth tiling/indexing scheme. (SGBucket)
|
||||
*
|
||||
* - A console debugging output scheme that tracks severity and
|
||||
* category that can be completely compiled out for a final build release.
|
||||
* (logstream.hxx)
|
||||
*
|
||||
* - Code to manage "real" time (SGTime), time zones (SGTimeZone), and
|
||||
* millesecond time differences (SGTimeStamp).
|
||||
*
|
||||
* - Code to calculate accurate positions of sun, moon, stars, and
|
||||
* planets for a given time, date, season, earth location, etc.
|
||||
* (SGEphemeris)
|
||||
*
|
||||
* - Code to render a realistic sky dome, cloud layers, sun, moon,
|
||||
* stars, and planets all with realistic day/night/sunset/sunrise
|
||||
* effects. Includes things like correct moon phase, textured moon,
|
||||
* sun halo, etc. (SGSky is built on top of SGCloudLayer ...)
|
||||
*
|
||||
* - Simple serial (SGSerial), file (SGFile), socket (SGSocket), and
|
||||
* UDP socket (SGSocketUDP) I/O abstractions.
|
||||
*
|
||||
* - Code to calculate magnetic variation. (SGMagVar)
|
||||
*
|
||||
* - A variety of classes and functions for interpolation tables
|
||||
* (SGInterpTable), least squares computation (leastsqs.hxx), 3D
|
||||
* point/vectors (Point3D), 3D polar math and conversions (polar3d.hxx),
|
||||
* WGS-84 math and conversions (sg_geodesy.hxx), random number abstraction
|
||||
* (sg_random.h), STL conglomerates for common list types (sg_types.hxx),
|
||||
* and other vector and linear algebra routines (vector.hxx)
|
||||
*
|
||||
* - An abstraction to hide platform dependent path naming schemes. (SGPath)
|
||||
*
|
||||
* - A C++ streams wrapper to handle compress input/output streams.
|
||||
* (sg_gzifstream)
|
||||
*
|
||||
* - An optimized "property manager" which associates ascii property
|
||||
* names with their corresponding value. This can be a great way to build
|
||||
* loose linkages between modules, or build linkages/connections that can
|
||||
* be determined from config files or at runtime. (SGPropertyNode)
|
||||
* Also included is a set of functions to dump the property tree into a
|
||||
* standard xml file and subsequently read/parse a standard xml file and
|
||||
* rebuild the associated property tree. (props_io.hxx)
|
||||
*
|
||||
* - Scene management and drawing routines:
|
||||
* - material property management
|
||||
* - object management
|
||||
* - terrain tile management and paging
|
||||
* - sky dome rendering (with ephemeral objects)
|
||||
*
|
||||
* - Code to handle screen dumps (screen-dump.hxx) and ultra-hires
|
||||
* tile rendered screen dumps (tr.h)
|
||||
*
|
||||
* - A sound effects manager. (SGSoundMgr, SGSimpleSound, SGSound)
|
||||
*
|
||||
* - A threading abstraction. (SGThread)
|
||||
*
|
||||
* - A simple but highly functional XML parser that interfaces nicely
|
||||
* with the property manager. (easyxml.hxx)
|
||||
|
||||
* \section supports Supported Platforms
|
||||
* SimGear has been built on the following platforms:
|
||||
*
|
||||
* - Linux (x86)
|
||||
* - Windows (MSVC, Cygwin, Mingwin)
|
||||
* - SGI (native compilers)
|
||||
* - Mac OS X
|
||||
* - FreeBSD
|
||||
|
||||
* \section depends Dependencies
|
||||
*
|
||||
* SimGear depends on several other open source packages. These must
|
||||
* be installed before SimGear can be installed:
|
||||
*
|
||||
* - glut and opengl
|
||||
* - plib (http://plib.sf.net)
|
||||
* - metakit
|
||||
* - zlib
|
||||
* - libjpeg (optional)
|
||||
* - pthread (optional)
|
||||
|
||||
* \section license Licensing
|
||||
*
|
||||
* SimGear is licensed under the terms of the LGPL
|
||||
|
||||
*/
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
noinst_LIBRARIES = libBucket.a
|
||||
|
||||
libBucket_a_SOURCES = newbucket.cxx newbucket.hxx
|
||||
|
||||
# bin_PROGRAMS = testbucket
|
||||
|
||||
# testbucket_SOURCES = testbucket.cxx
|
||||
|
||||
# testbucket_LDADD = \
|
||||
# $(top_builddir)/Lib/Bucket/libBucket.a \
|
||||
# $(top_builddir)/Lib/Misc/libMisc.a
|
||||
|
||||
INCLUDES += -I$(top_builddir) -I$(top_builddir)/Lib
|
||||
@@ -1,155 +0,0 @@
|
||||
/**************************************************************************
|
||||
* newbucket.hxx -- new bucket routines for better world modeling
|
||||
*
|
||||
* Written by Curtis L. Olson, started February 1999.
|
||||
*
|
||||
* Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* $Id$
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include <Misc/fgpath.hxx>
|
||||
|
||||
#include "newbucket.hxx"
|
||||
|
||||
|
||||
// Build the path name for this bucket
|
||||
string FGBucket::gen_base_path() const {
|
||||
// long int index;
|
||||
int top_lon, top_lat, main_lon, main_lat;
|
||||
char hem, pole;
|
||||
char raw_path[256];
|
||||
|
||||
top_lon = lon / 10;
|
||||
main_lon = lon;
|
||||
if ( (lon < 0) && (top_lon * 10 != lon) ) {
|
||||
top_lon -= 1;
|
||||
}
|
||||
top_lon *= 10;
|
||||
if ( top_lon >= 0 ) {
|
||||
hem = 'e';
|
||||
} else {
|
||||
hem = 'w';
|
||||
top_lon *= -1;
|
||||
}
|
||||
if ( main_lon < 0 ) {
|
||||
main_lon *= -1;
|
||||
}
|
||||
|
||||
top_lat = lat / 10;
|
||||
main_lat = lat;
|
||||
if ( (lat < 0) && (top_lat * 10 != lat) ) {
|
||||
top_lat -= 1;
|
||||
}
|
||||
top_lat *= 10;
|
||||
if ( top_lat >= 0 ) {
|
||||
pole = 'n';
|
||||
} else {
|
||||
pole = 's';
|
||||
top_lat *= -1;
|
||||
}
|
||||
if ( main_lat < 0 ) {
|
||||
main_lat *= -1;
|
||||
}
|
||||
|
||||
sprintf(raw_path, "%c%03d%c%02d/%c%03d%c%02d",
|
||||
hem, top_lon, pole, top_lat,
|
||||
hem, main_lon, pole, main_lat);
|
||||
|
||||
FGPath path( raw_path );
|
||||
|
||||
return path.str();
|
||||
}
|
||||
|
||||
|
||||
// find the bucket which is offset by the specified tile units in the
|
||||
// X & Y direction. We need the current lon and lat to resolve
|
||||
// ambiguities when going from a wider tile to a narrower one above or
|
||||
// below. This assumes that we are feeding in
|
||||
FGBucket fgBucketOffset( double dlon, double dlat, int dx, int dy ) {
|
||||
FGBucket result( dlon, dlat );
|
||||
double clat = result.get_center_lat() + dy * FG_BUCKET_SPAN;
|
||||
|
||||
// walk dy units in the lat direction
|
||||
result.set_bucket( dlon, clat );
|
||||
|
||||
// find the lon span for the new latitude
|
||||
double span = bucket_span( clat );
|
||||
|
||||
// walk dx units in the lon direction
|
||||
double tmp = dlon + dx * span;
|
||||
while ( tmp < -180.0 ) {
|
||||
tmp += 360.0;
|
||||
}
|
||||
while ( tmp >= 180.0 ) {
|
||||
tmp -= 360.0;
|
||||
}
|
||||
result.set_bucket( tmp, clat );
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
// calculate the offset between two buckets
|
||||
void fgBucketDiff( const FGBucket& b1, const FGBucket& b2, int *dx, int *dy ) {
|
||||
|
||||
// Latitude difference
|
||||
double c1_lat = b1.get_center_lat();
|
||||
double c2_lat = b2.get_center_lat();
|
||||
double diff_lat = c2_lat - c1_lat;
|
||||
|
||||
#ifdef HAVE_RINT
|
||||
*dy = (int)rint( diff_lat / FG_BUCKET_SPAN );
|
||||
#else
|
||||
if ( diff_lat > 0 ) {
|
||||
*dy = (int)( diff_lat / FG_BUCKET_SPAN + 0.5 );
|
||||
} else {
|
||||
*dy = (int)( diff_lat / FG_BUCKET_SPAN - 0.5 );
|
||||
}
|
||||
#endif
|
||||
|
||||
// longitude difference
|
||||
double c1_lon = b1.get_center_lon();
|
||||
double c2_lon = b2.get_center_lon();
|
||||
double diff_lon = c2_lon - c1_lon;
|
||||
double span;
|
||||
if ( bucket_span(c1_lat) <= bucket_span(c2_lat) ) {
|
||||
span = bucket_span(c1_lat);
|
||||
} else {
|
||||
span = bucket_span(c2_lat);
|
||||
}
|
||||
|
||||
#ifdef HAVE_RINT
|
||||
*dx = (int)rint( diff_lon / span );
|
||||
#else
|
||||
if ( diff_lon > 0 ) {
|
||||
*dx = (int)( diff_lon / span + 0.5 );
|
||||
} else {
|
||||
*dx = (int)( diff_lon / span - 0.5 );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1,351 +0,0 @@
|
||||
/**************************************************************************
|
||||
* newbucket.hxx -- new bucket routines for better world modeling
|
||||
*
|
||||
* Written by Curtis L. Olson, started February 1999.
|
||||
*
|
||||
* Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* $Id$
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef _NEWBUCKET_HXX
|
||||
#define _NEWBUCKET_HXX
|
||||
|
||||
#include <Include/compiler.h>
|
||||
|
||||
#ifdef FG_HAVE_STD_INCLUDES
|
||||
# include <cmath>
|
||||
# include <cstdio> // sprintf()
|
||||
# include <iostream>
|
||||
#else
|
||||
# include <math.h>
|
||||
# include <stdio.h> // sprintf()
|
||||
# include <iostream.h>
|
||||
#endif
|
||||
|
||||
// I don't understand ... <math.h> or <cmath> should be included
|
||||
// already depending on how you defined FG_HAVE_STD_INCLUDES, but I
|
||||
// can go ahead and add this -- CLO
|
||||
#ifdef __MWERKS__
|
||||
# include <math.h> // needed fabs()
|
||||
#endif
|
||||
|
||||
#include STL_STRING
|
||||
|
||||
FG_USING_STD(string);
|
||||
|
||||
#if ! defined( FG_HAVE_NATIVE_SGI_COMPILERS )
|
||||
FG_USING_STD(ostream);
|
||||
#endif
|
||||
|
||||
#include <Include/fg_constants.h>
|
||||
|
||||
|
||||
#define FG_BUCKET_SPAN 0.125 // 1/8 of a degree
|
||||
#define FG_HALF_BUCKET_SPAN 0.0625 // 1/2 of 1/8 of a degree = 1/16 = 0.0625
|
||||
|
||||
class FGBucket;
|
||||
ostream& operator<< ( ostream&, const FGBucket& );
|
||||
bool operator== ( const FGBucket&, const FGBucket& );
|
||||
|
||||
class FGBucket {
|
||||
|
||||
private:
|
||||
double cx, cy; // centerpoint (lon, lat) in degrees of bucket
|
||||
int lon; // longitude index (-180 to 179)
|
||||
int lat; // latitude index (-90 to 89)
|
||||
int x; // x subdivision (0 to 7)
|
||||
int y; // y subdivision (0 to 7)
|
||||
|
||||
public:
|
||||
|
||||
// default constructor
|
||||
FGBucket();
|
||||
|
||||
// create a bucket which would contain the specified lon/lat
|
||||
FGBucket(const double lon, const double lat);
|
||||
|
||||
// create a bucket based on "long int" index
|
||||
FGBucket(const long int bindex);
|
||||
|
||||
// create an impossible bucket if false
|
||||
FGBucket(const bool is_good);
|
||||
|
||||
~FGBucket();
|
||||
|
||||
// Set the bucket params for the specified lat and lon
|
||||
void set_bucket( double dlon, double dlat );
|
||||
void make_bad ( void );
|
||||
|
||||
// Generate the unique scenery tile index for this bucket
|
||||
long int gen_index();
|
||||
string gen_index_str() const;
|
||||
|
||||
// Build the path name for this bucket
|
||||
string gen_base_path() const;
|
||||
|
||||
// return the center lon of a tile
|
||||
double get_center_lon() const;
|
||||
|
||||
// return width of the tile
|
||||
double get_width() const;
|
||||
|
||||
// return the center lat of a tile
|
||||
double get_center_lat() const;
|
||||
|
||||
// return height of the tile
|
||||
double get_height() const;
|
||||
|
||||
// Informational methods
|
||||
inline int get_lon() const { return lon; }
|
||||
inline int get_lat() const { return lat; }
|
||||
inline int get_x() const { return x; }
|
||||
inline int get_y() const { return y; }
|
||||
|
||||
// friends
|
||||
friend ostream& operator<< ( ostream&, const FGBucket& );
|
||||
friend bool operator== ( const FGBucket&, const FGBucket& );
|
||||
};
|
||||
|
||||
|
||||
// return the horizontal tile span factor based on latitude
|
||||
inline double bucket_span( double l ) {
|
||||
if ( l >= 89.0 ) {
|
||||
return 360.0;
|
||||
} else if ( l >= 88.0 ) {
|
||||
return 8.0;
|
||||
} else if ( l >= 86.0 ) {
|
||||
return 4.0;
|
||||
} else if ( l >= 83.0 ) {
|
||||
return 2.0;
|
||||
} else if ( l >= 76.0 ) {
|
||||
return 1.0;
|
||||
} else if ( l >= 62.0 ) {
|
||||
return 0.5;
|
||||
} else if ( l >= 22.0 ) {
|
||||
return 0.25;
|
||||
} else if ( l >= -22.0 ) {
|
||||
return 0.125;
|
||||
} else if ( l >= -62.0 ) {
|
||||
return 0.25;
|
||||
} else if ( l >= -76.0 ) {
|
||||
return 0.5;
|
||||
} else if ( l >= -83.0 ) {
|
||||
return 1.0;
|
||||
} else if ( l >= -86.0 ) {
|
||||
return 2.0;
|
||||
} else if ( l >= -88.0 ) {
|
||||
return 4.0;
|
||||
} else if ( l >= -89.0 ) {
|
||||
return 8.0;
|
||||
} else {
|
||||
return 360.0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Set the bucket params for the specified lat and lon
|
||||
inline void FGBucket::set_bucket( double dlon, double dlat ) {
|
||||
//
|
||||
// latitude first
|
||||
//
|
||||
double span = bucket_span( dlat );
|
||||
double diff = dlon - (double)(int)dlon;
|
||||
|
||||
// cout << "diff = " << diff << " span = " << span << endl;
|
||||
|
||||
if ( (dlon >= 0) || (fabs(diff) < FG_EPSILON) ) {
|
||||
lon = (int)dlon;
|
||||
} else {
|
||||
lon = (int)dlon - 1;
|
||||
}
|
||||
|
||||
// find subdivision or super lon if needed
|
||||
if ( span < FG_EPSILON ) {
|
||||
// polar cap
|
||||
lon = 0;
|
||||
x = 0;
|
||||
} else if ( span <= 1.0 ) {
|
||||
x = (int)((dlon - lon) / span);
|
||||
} else {
|
||||
if ( (dlon >= 0) || (fabs(diff) < FG_EPSILON) ) {
|
||||
lon = (int)( (int)(lon / span) * span);
|
||||
} else {
|
||||
// cout << " lon = " << lon
|
||||
// << " tmp = " << (int)((lon-1) / span) << endl;
|
||||
lon = (int)( (int)((lon + 1) / span) * span - span);
|
||||
if ( lon < -180 ) {
|
||||
lon = -180;
|
||||
}
|
||||
}
|
||||
x = 0;
|
||||
}
|
||||
|
||||
//
|
||||
// then latitude
|
||||
//
|
||||
diff = dlat - (double)(int)dlat;
|
||||
|
||||
if ( (dlat >= 0) || (fabs(diff) < FG_EPSILON) ) {
|
||||
lat = (int)dlat;
|
||||
} else {
|
||||
lat = (int)dlat - 1;
|
||||
}
|
||||
y = (int)((dlat - lat) * 8);
|
||||
}
|
||||
|
||||
|
||||
// default constructor
|
||||
inline FGBucket::FGBucket() {}
|
||||
|
||||
|
||||
// constructor for specified location
|
||||
inline FGBucket::FGBucket(const double dlon, const double dlat) {
|
||||
set_bucket(dlon, dlat);
|
||||
}
|
||||
|
||||
|
||||
// create an impossible bucket if false
|
||||
inline FGBucket::FGBucket(const bool is_good) {
|
||||
set_bucket(0.0, 0.0);
|
||||
if ( !is_good ) {
|
||||
lon = -1000;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Parse a unique scenery tile index and find the lon, lat, x, and y
|
||||
inline FGBucket::FGBucket(const long int bindex) {
|
||||
long int index = bindex;
|
||||
|
||||
lon = index >> 14;
|
||||
index -= lon << 14;
|
||||
lon -= 180;
|
||||
|
||||
lat = index >> 6;
|
||||
index -= lat << 6;
|
||||
lat -= 90;
|
||||
|
||||
y = index >> 3;
|
||||
index -= y << 3;
|
||||
|
||||
x = index;
|
||||
}
|
||||
|
||||
|
||||
// default destructor
|
||||
inline FGBucket::~FGBucket() {}
|
||||
|
||||
|
||||
// Generate the unique scenery tile index for this bucket
|
||||
//
|
||||
// The index is constructed as follows:
|
||||
//
|
||||
// 9 bits - to represent 360 degrees of longitude (-180 to 179)
|
||||
// 8 bits - to represent 180 degrees of latitude (-90 to 89)
|
||||
//
|
||||
// Each 1 degree by 1 degree tile is further broken down into an 8x8
|
||||
// grid. So we also need:
|
||||
//
|
||||
// 3 bits - to represent x (0 to 7)
|
||||
// 3 bits - to represent y (0 to 7)
|
||||
|
||||
inline long int FGBucket::gen_index() {
|
||||
return ((lon + 180) << 14) + ((lat + 90) << 6) + (y << 3) + x;
|
||||
}
|
||||
|
||||
inline string FGBucket::gen_index_str() const {
|
||||
char tmp[20];
|
||||
sprintf(tmp, "%ld",
|
||||
(((long)lon + 180) << 14) + ((lat + 90) << 6) + (y << 3) + x);
|
||||
return (string)tmp;
|
||||
}
|
||||
|
||||
|
||||
// return the center lon of a tile
|
||||
inline double FGBucket::get_center_lon() const {
|
||||
double span = bucket_span( lat + y / 8.0 + FG_HALF_BUCKET_SPAN );
|
||||
|
||||
if ( span >= 1.0 ) {
|
||||
return lon + span / 2.0;
|
||||
} else {
|
||||
return lon + x * span + span / 2.0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// return the center lat of a tile
|
||||
inline double FGBucket::get_center_lat() const {
|
||||
return lat + y / 8.0 + FG_HALF_BUCKET_SPAN;
|
||||
}
|
||||
|
||||
|
||||
// return width of the tile
|
||||
inline double FGBucket::get_width() const {
|
||||
return bucket_span( get_center_lat() );
|
||||
}
|
||||
|
||||
|
||||
// return height of the tile
|
||||
inline double FGBucket::get_height() const {
|
||||
return FG_BUCKET_SPAN;
|
||||
}
|
||||
|
||||
|
||||
// create an impossible bucket
|
||||
inline void FGBucket::make_bad( void ) {
|
||||
set_bucket(0.0, 0.0);
|
||||
lon = -1000;
|
||||
}
|
||||
|
||||
|
||||
// offset a bucket struct by the specified tile units in the X & Y
|
||||
// direction
|
||||
FGBucket fgBucketOffset( double dlon, double dlat, int x, int y );
|
||||
|
||||
|
||||
// calculate the offset between two buckets
|
||||
void fgBucketDiff( const FGBucket& b1, const FGBucket& b2, int *dx, int *dy );
|
||||
|
||||
|
||||
/*
|
||||
// Given a lat/lon, fill in the local tile index array
|
||||
void fgBucketGenIdxArray(fgBUCKET *p1, fgBUCKET *tiles, int width, int height);
|
||||
*/
|
||||
|
||||
|
||||
inline ostream&
|
||||
operator<< ( ostream& out, const FGBucket& b )
|
||||
{
|
||||
return out << b.lon << ":" << b.x << ", " << b.lat << ":" << b.y;
|
||||
}
|
||||
|
||||
|
||||
inline bool
|
||||
operator== ( const FGBucket& b1, const FGBucket& b2 )
|
||||
{
|
||||
return ( b1.lon == b2.lon &&
|
||||
b1.lat == b2.lat &&
|
||||
b1.x == b2.x &&
|
||||
b1.y == b2.y );
|
||||
}
|
||||
|
||||
|
||||
#endif // _NEWBUCKET_HXX
|
||||
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
// test new bucket routines
|
||||
|
||||
#include "newbucket.cxx"
|
||||
|
||||
main() {
|
||||
double lat = 21.9625;
|
||||
double lon = -110.0 + 0.0625;
|
||||
|
||||
/*
|
||||
while ( lon < 180 ) {
|
||||
FGBucket b1( lon, lat );
|
||||
long int index = b1.gen_index();
|
||||
FGBucket b2( index );
|
||||
|
||||
cout << lon << "," << lat << " ";
|
||||
cout << b2 << " " << b2.get_center_lon() << ","
|
||||
<< b2.get_center_lat() << endl;
|
||||
|
||||
lon += 0.125;
|
||||
}
|
||||
*/
|
||||
|
||||
FGBucket b1;
|
||||
|
||||
for ( int j = 2; j >= -2; j-- ) {
|
||||
for ( int i = -2; i < 3; i++ ) {
|
||||
b1 = fgBucketOffset(lon, lat, i, j);
|
||||
cout << "(" << i << "," << j << ")" << b1 << "\t";
|
||||
}
|
||||
cout << endl;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
EXTRA_DIST = logtest.cxx
|
||||
|
||||
noinst_LIBRARIES = libDebug.a
|
||||
|
||||
libDebug_a_SOURCES = \
|
||||
debug_types.h \
|
||||
logstream.cxx logstream.hxx
|
||||
|
||||
# fg_debug.c fg_debug.h \
|
||||
|
||||
INCLUDES += -I$(top_builddir)
|
||||
@@ -1,37 +0,0 @@
|
||||
// NB: To add a dbg_class, add it here, and add it to the structure in
|
||||
// fg_debug.c
|
||||
|
||||
typedef enum {
|
||||
FG_NONE = 0x00000000,
|
||||
|
||||
FG_TERRAIN = 0x00000001,
|
||||
FG_ASTRO = 0x00000002,
|
||||
FG_FLIGHT = 0x00000004,
|
||||
FG_INPUT = 0x00000008,
|
||||
FG_GL = 0x00000010,
|
||||
FG_VIEW = 0x00000020,
|
||||
FG_COCKPIT = 0x00000040,
|
||||
FG_GENERAL = 0x00000080,
|
||||
FG_MATH = 0x00000100,
|
||||
FG_EVENT = 0x00000200,
|
||||
FG_AIRCRAFT = 0x00000400,
|
||||
FG_AUTOPILOT = 0x00000800,
|
||||
FG_SERIAL = 0x00001000,
|
||||
FG_CLIPPER = 0x00002000,
|
||||
FG_UNDEFD = 0x00004000, // For range checking
|
||||
|
||||
FG_ALL = 0xFFFFFFFF
|
||||
} fgDebugClass;
|
||||
|
||||
|
||||
// NB: To add a priority, add it here.
|
||||
typedef enum {
|
||||
FG_BULK, // For frequent messages
|
||||
FG_DEBUG, // Less frequent debug type messages
|
||||
FG_INFO, // Informatory messages
|
||||
FG_WARN, // Possible impending problem
|
||||
FG_ALERT // Very possible impending problem
|
||||
// FG_EXIT, // Problem (no core)
|
||||
// FG_ABORT // Abandon ship (core)
|
||||
} fgDebugPriority;
|
||||
|
||||
@@ -1,282 +0,0 @@
|
||||
/* -*- Mode: C++ -*-
|
||||
*
|
||||
* fg_debug.c -- Flight Gear debug utility functions
|
||||
*
|
||||
* Written by Paul Bleisch, started January 1998.
|
||||
*
|
||||
* Copyright (C) 1998 Paul Bleisch, pbleisch@acm.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* $Id$
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <Include/cmdargs.h> // Line to command line arguments
|
||||
|
||||
#include "fg_debug.h"
|
||||
|
||||
|
||||
static int fg_DebugSem = 1;
|
||||
fgDebugClass fg_DebugClass = FG_NONE; // Need visibility for
|
||||
fgDebugPriority fg_DebugPriority = FG_INFO; // command line processing.
|
||||
static fgDebugCallback fg_DebugCallback = NULL;
|
||||
|
||||
FILE *fg_DebugOutput = NULL; // Visibility needed for command line processor.
|
||||
// This can be set to a FILE from the command
|
||||
// line. If not, it will be set to stderr.
|
||||
|
||||
/* TODO: Actually make this thing thread safe */
|
||||
#ifdef USETHREADS
|
||||
#define FG_GRABDEBUGSEM while( --fg_DebugSem < 0 ) { fg_DebugSem++; }
|
||||
#define FG_RELEASEDEBUGSEM fg_DebugSem++;
|
||||
#else
|
||||
#define FG_GRABDEBUGSEM
|
||||
#define FG_RELEASEDEBUGSEM
|
||||
#endif
|
||||
|
||||
/* Used for convienence initialization from env variables.
|
||||
*/
|
||||
static struct {
|
||||
char *str;
|
||||
fgDebugClass dbg_class;
|
||||
} fg_DebugClasses[] = {
|
||||
{ "FG_NONE", 0x00000000 },
|
||||
{ "FG_TERRAIN", 0x00000001 },
|
||||
{ "FG_ASTRO", 0x00000002 },
|
||||
{ "FG_FLIGHT", 0x00000004 },
|
||||
{ "FG_INPUT", 0x00000008 },
|
||||
{ "FG_GL", 0x00000010 },
|
||||
{ "FG_VIEW", 0x00000020 },
|
||||
{ "FG_COCKPIT", 0x00000040 },
|
||||
{ "FG_GENERAL", 0x00000080 },
|
||||
{ "FG_MATH", 0x00000100 },
|
||||
{ "FG_EVENT", 0x00000200 },
|
||||
{ "FG_AIRCRAFT", 0x00000400 },
|
||||
{ "FG_AUTOPILOT", 0x00000800 },
|
||||
|
||||
/* Do not edit below here, last entry should be null */
|
||||
{ "FG_ALL", 0xFFFFFFFF },
|
||||
{ NULL, 0 }
|
||||
};
|
||||
|
||||
static fgDebugClass fgDebugStrToClass( char *str );
|
||||
|
||||
|
||||
/* fgInitDebug =============================================================*/
|
||||
void fgInitDebug( void ) {
|
||||
char *pszClass, *pszPrio, *pszFile;
|
||||
|
||||
// Support for log file/alt debug output via command line, environment or
|
||||
// reasonable default.
|
||||
|
||||
/*
|
||||
if( strlen( logArgbuf ) > 3) { // First check for command line option
|
||||
// Assumed that we will append.
|
||||
fg_DebugOutput = fopen(logArgbuf, "a+" );
|
||||
}
|
||||
*/
|
||||
|
||||
if( !fg_DebugOutput ) { // If not set on command line, environment?
|
||||
pszFile = getenv( "FG_DEBUGFILE" );
|
||||
if( pszFile ) { // There is such an environmental variable.
|
||||
fg_DebugOutput = fopen( pszFile, "a+" );
|
||||
}
|
||||
}
|
||||
|
||||
if( !fg_DebugOutput ) { // If neither command line nor environment
|
||||
fg_DebugOutput = stderr; // then we use the fallback position
|
||||
}
|
||||
|
||||
FG_GRABDEBUGSEM;
|
||||
fg_DebugSem = fg_DebugSem; /* shut up GCC */
|
||||
|
||||
// Test command line option overridge of debug priority. If the value
|
||||
// is in range (properly optioned) the we will override both defaults
|
||||
// and the environmental value.
|
||||
|
||||
/*
|
||||
if ((priorityArgValue >= FG_BULK) && (priorityArgValue <= FG_ABORT)) {
|
||||
fg_DebugPriority = priorityArgValue;
|
||||
} else { // Either not set or out of range. We will not warn the user.
|
||||
*/
|
||||
pszPrio = getenv( "FG_DEBUGPRIORITY" );
|
||||
if( pszPrio ) {
|
||||
fg_DebugPriority = atoi( pszPrio );
|
||||
fprintf( stderr,
|
||||
"fg_debug.c: Environment overrides default debug priority (%d)\n",
|
||||
fg_DebugPriority );
|
||||
}
|
||||
/* } */
|
||||
|
||||
|
||||
/*
|
||||
if ((debugArgValue >= FG_ALL) && (debugArgValue < FG_UNDEFD)) {
|
||||
fg_DebugPriority = priorityArgValue;
|
||||
} else { // Either not set or out of range. We will not warn the user.
|
||||
*/
|
||||
pszClass = getenv( "FG_DEBUGCLASS" );
|
||||
if( pszClass ) {
|
||||
fg_DebugClass = fgDebugStrToClass( pszClass );
|
||||
fprintf( stderr,
|
||||
"fg_debug.c: Environment overrides default debug class (0x%08X)\n",
|
||||
fg_DebugClass );
|
||||
}
|
||||
/* } */
|
||||
|
||||
FG_RELEASEDEBUGSEM;
|
||||
}
|
||||
|
||||
/* fgDebugStrToClass ======================================================*/
|
||||
fgDebugClass fgDebugStrToClass( char *str ) {
|
||||
char *hex = "0123456789ABCDEF";
|
||||
char *hexl = "0123456789abcdef";
|
||||
char *pt, *p, *ph, ps = 1;
|
||||
unsigned int val = 0, i;
|
||||
|
||||
if( str == NULL ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Check for 0xXXXXXX notation */
|
||||
p = strstr( str, "0x");
|
||||
if( p ) {
|
||||
p++; p++;
|
||||
while (*p) {
|
||||
ph = strchr(hex,*p);
|
||||
if ( ph ) {
|
||||
val <<= 4;
|
||||
val += ph-hex;
|
||||
p++;
|
||||
} else {
|
||||
ph = strchr(hexl,*p);
|
||||
if ( ph ) {
|
||||
val <<= 4;
|
||||
val += ph-hex;
|
||||
p++;
|
||||
} else {
|
||||
// fprintf( stderr, "Error in hex string '%s'\n", str );
|
||||
return FG_NONE;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* Must be in string format */
|
||||
p = str;
|
||||
ps = 1;
|
||||
while( ps ) {
|
||||
while( *p && (*p==' ' || *p=='\t') ) p++; /* remove whitespace */
|
||||
pt = p; /* mark token */
|
||||
while( *p && (*p!='|') ) p++; /* find OR or EOS */
|
||||
ps = *p; /* save value at p so we can attempt to be bounds safe */
|
||||
*p++ = 0; /* terminate token */
|
||||
/* determine value for token */
|
||||
i=0;
|
||||
while( fg_DebugClasses[i].str &&
|
||||
strncmp( fg_DebugClasses[i].str, pt,
|
||||
strlen(fg_DebugClasses[i].str)) ) i++;
|
||||
if( fg_DebugClasses[i].str == NULL ) {
|
||||
fprintf( stderr,
|
||||
"fg_debug.c: Could not find message class '%s'\n",
|
||||
pt );
|
||||
} else {
|
||||
val |= fg_DebugClasses[i].dbg_class;
|
||||
}
|
||||
}
|
||||
}
|
||||
return (fgDebugClass)val;
|
||||
}
|
||||
|
||||
|
||||
/* fgSetDebugOutput =======================================================*/
|
||||
void fgSetDebugOutput( FILE *out ) {
|
||||
FG_GRABDEBUGSEM;
|
||||
fflush( fg_DebugOutput );
|
||||
fg_DebugOutput = out;
|
||||
FG_RELEASEDEBUGSEM;
|
||||
}
|
||||
|
||||
|
||||
/* fgSetDebugLevels =======================================================*/
|
||||
void fgSetDebugLevels( fgDebugClass dbg_class, fgDebugPriority prio ) {
|
||||
FG_GRABDEBUGSEM;
|
||||
fg_DebugClass = dbg_class;
|
||||
fg_DebugPriority = prio;
|
||||
FG_RELEASEDEBUGSEM;
|
||||
}
|
||||
|
||||
|
||||
/* fgRegisterDebugCallback ================================================*/
|
||||
fgDebugCallback fgRegisterDebugCallback( fgDebugCallback callback ) {
|
||||
fgDebugCallback old;
|
||||
FG_GRABDEBUGSEM;
|
||||
old = fg_DebugCallback;
|
||||
fg_DebugCallback = callback;
|
||||
FG_RELEASEDEBUGSEM;
|
||||
return old;
|
||||
}
|
||||
|
||||
|
||||
/* fgPrintf ===============================================================*/
|
||||
int fgPrintf( fgDebugClass dbg_class, fgDebugPriority prio, char *fmt, ... ) {
|
||||
char szOut[1024+1];
|
||||
va_list ap;
|
||||
int ret = 0;
|
||||
|
||||
// If no action to take, then don't bother with the semaphore
|
||||
// activity Slight speed benefit.
|
||||
|
||||
// printf("dbg_class = %d fg_DebugClass = %d\n", dbg_class, fg_DebugClass);
|
||||
// printf("prio = %d fg_DebugPriority = %d\n", prio, fg_DebugPriority);
|
||||
|
||||
if( !(dbg_class & fg_DebugClass) ) {
|
||||
// Failed to match a specific debug class
|
||||
if ( prio < fg_DebugPriority ) {
|
||||
// priority is less than requested
|
||||
|
||||
// "ret" is zero anyway. But we might think about changing
|
||||
// it upon some error condition?
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
FG_GRABDEBUGSEM;
|
||||
|
||||
/* ret = vsprintf( szOut, fmt, (&fmt+1)); (but it didn't work, thus ... */
|
||||
va_start (ap, fmt);
|
||||
ret = vsprintf( szOut, fmt, ap);
|
||||
va_end (ap);
|
||||
|
||||
if( fg_DebugCallback!=NULL && fg_DebugCallback(dbg_class, prio, szOut) ) {
|
||||
FG_RELEASEDEBUGSEM;
|
||||
return ret;
|
||||
} else {
|
||||
fprintf( fg_DebugOutput, szOut );
|
||||
FG_RELEASEDEBUGSEM;
|
||||
if( prio == FG_EXIT ) {
|
||||
exit(0);
|
||||
} else if( prio == FG_ABORT ) {
|
||||
abort();
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,155 +0,0 @@
|
||||
/* -*- Mode: C++ -*-
|
||||
*
|
||||
* fg_debug.h -- Flight Gear debug utility functions
|
||||
*
|
||||
* Written by Paul Bleisch, started January 1998.
|
||||
*
|
||||
* Copyright (C) 1998 Paul Bleisch, pbleisch@acm.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#error "use logstream"
|
||||
|
||||
#ifndef _FG_DEBUG_H
|
||||
#define _FG_DEBUG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
/* NB: To add a dbg_class, add it here, and add it to the structure in
|
||||
fg_debug.c */
|
||||
typedef enum {
|
||||
FG_NONE = 0x00000000,
|
||||
|
||||
FG_TERRAIN = 0x00000001,
|
||||
FG_ASTRO = 0x00000002,
|
||||
FG_FLIGHT = 0x00000004,
|
||||
FG_INPUT = 0x00000008,
|
||||
FG_GL = 0x00000010,
|
||||
FG_VIEW = 0x00000020,
|
||||
FG_COCKPIT = 0x00000040,
|
||||
FG_GENERAL = 0x00000080,
|
||||
FG_MATH = 0x00000100,
|
||||
FG_EVENT = 0x00000200,
|
||||
FG_AIRCRAFT = 0x00000400,
|
||||
FG_AUTOPILOT = 0x00000800,
|
||||
FG_UNDEFD = 0x00001000, // For range checking
|
||||
|
||||
FG_ALL = 0xFFFFFFFF
|
||||
} fgDebugClass;
|
||||
|
||||
/* NB: To add a priority, add it here. */
|
||||
typedef enum {
|
||||
FG_BULK, /* For frequent messages */
|
||||
FG_DEBUG, /* Less frequent debug type messages */
|
||||
FG_INFO, /* Informatory messages */
|
||||
FG_WARN, /* Possible impending problem */
|
||||
FG_ALERT, /* Very possible impending problem */
|
||||
FG_EXIT, /* Problem (no core) */
|
||||
FG_ABORT /* Abandon ship (core) */
|
||||
} fgDebugPriority;
|
||||
|
||||
|
||||
/* Initialize the debuggin stuff. */
|
||||
void fgInitDebug( void );
|
||||
|
||||
|
||||
/* fgPrintf
|
||||
|
||||
Expects:
|
||||
class fgDebugClass mask for this message.
|
||||
prio fgDebugPriority of this message.
|
||||
fmt printf like string format
|
||||
... var args for fmt
|
||||
|
||||
Returns:
|
||||
number of items in fmt handled.
|
||||
|
||||
This function works like the standard C library function printf() with
|
||||
the addition of message classes and priorities (see fgDebugClasses
|
||||
and fgDebugPriorities). These additions allow us to classify messages
|
||||
and disable sets of messages at runtime. Only messages with a prio
|
||||
greater than or equal to fg_DebugPriority and in the current debug class
|
||||
(fg_DebugClass) are printed.
|
||||
*/
|
||||
int fgPrintf( fgDebugClass dbg_class, fgDebugPriority prio, char *fmt, ... );
|
||||
|
||||
|
||||
/* fgSetDebugLevels()
|
||||
|
||||
Expects:
|
||||
dbg_class Bitmask representing classes to display.
|
||||
prio Minimum priority of messages to display.
|
||||
*/
|
||||
void fgSetDebugLevels( fgDebugClass dbg_class, fgDebugPriority prio );
|
||||
|
||||
/* fgSetDebugOutput()
|
||||
|
||||
Expects:
|
||||
file A FILE* to a stream to send messages to.
|
||||
|
||||
It is assumed the file stream is open and writable. The system
|
||||
defaults to stderr. The current stream is flushed but not
|
||||
closed.
|
||||
*/
|
||||
void fgSetDebugOutput( FILE *out );
|
||||
|
||||
|
||||
/* fgRegisterDebugCallback
|
||||
|
||||
Expects:
|
||||
callback A function that takes parameters as defined by the
|
||||
fgDebugCallback type.
|
||||
|
||||
Returns:
|
||||
a pointer to the previously registered callback (if any)
|
||||
|
||||
Install a user defined debug log callback. This callback is called w
|
||||
whenever fgPrintf is called. The parameters passed to the callback are
|
||||
defined above by fgDebugCallback. outstr is the string that is to be
|
||||
printed. If callback returns nonzero, it is assumed that the message
|
||||
was handled fully by the callback and **fgPrintf need do no further
|
||||
processing of the message.** Only one callback may be installed at a
|
||||
time.
|
||||
*/
|
||||
|
||||
//typedef int (*fgDebugCallback)(fgDebugClass, fgDebugPriority, char *outstr);
|
||||
//fgDebugCallback fgRegisterDebugCallback( fgDebugCallback callback );
|
||||
|
||||
typedef int (*fgDebugCallback)( int DebugClass, int DebugPriority, char *outstr);
|
||||
fgDebugCallback fgRegisterDebugCallback( fgDebugCallback callback );
|
||||
|
||||
|
||||
// Leave these alone. Access intended for fg_debug and command line processing.
|
||||
//
|
||||
extern fgDebugClass fg_DebugClass;
|
||||
extern fgDebugPriority fg_DebugPriority;
|
||||
|
||||
extern FILE * fg_DebugOutput;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _FG_DEBUG_H */
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
// Stream based logging mechanism.
|
||||
//
|
||||
// Written by Bernie Bright, 1998
|
||||
//
|
||||
// Copyright (C) 1998 Bernie Bright - bbright@c031.aone.net.au
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation; either version 2 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
// $Id$
|
||||
|
||||
#include "logstream.hxx"
|
||||
|
||||
bool logbuf::logging_enabled = true;
|
||||
fgDebugClass logbuf::logClass = FG_NONE;
|
||||
fgDebugPriority logbuf::logPriority = FG_INFO;
|
||||
streambuf* logbuf::sbuf = NULL;
|
||||
|
||||
logbuf::logbuf()
|
||||
{
|
||||
// if ( sbuf == NULL )
|
||||
// sbuf = cerr.rdbuf();
|
||||
}
|
||||
|
||||
logbuf::~logbuf()
|
||||
{
|
||||
if ( sbuf )
|
||||
sync();
|
||||
}
|
||||
|
||||
void
|
||||
logbuf::set_sb( streambuf* sb )
|
||||
{
|
||||
if ( sbuf )
|
||||
sync();
|
||||
|
||||
sbuf = sb;
|
||||
}
|
||||
|
||||
void
|
||||
logbuf::set_log_level( fgDebugClass c, fgDebugPriority p )
|
||||
{
|
||||
logClass = c;
|
||||
logPriority = p;
|
||||
}
|
||||
|
||||
void
|
||||
logstream::setLogLevels( fgDebugClass c, fgDebugPriority p )
|
||||
{
|
||||
logbuf::set_log_level( c, p );
|
||||
}
|
||||
|
||||
@@ -1,220 +0,0 @@
|
||||
// Stream based logging mechanism.
|
||||
//
|
||||
// Written by Bernie Bright, 1998
|
||||
//
|
||||
// Copyright (C) 1998 Bernie Bright - bbright@c031.aone.net.au
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation; either version 2 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
// $Id$
|
||||
|
||||
#ifndef _LOGSTREAM_H
|
||||
#define _LOGSTREAM_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
|
||||
#include <Include/compiler.h>
|
||||
|
||||
#ifdef FG_HAVE_STD_INCLUDES
|
||||
# include <streambuf>
|
||||
# include <iostream>
|
||||
#else
|
||||
# include <iostream.h>
|
||||
# include "Include/fg_traits.hxx"
|
||||
#endif
|
||||
|
||||
#include "debug_types.h"
|
||||
|
||||
#ifndef FG_HAVE_NATIVE_SGI_COMPILERS
|
||||
FG_USING_STD(streambuf);
|
||||
FG_USING_STD(ostream);
|
||||
FG_USING_STD(cerr);
|
||||
FG_USING_STD(endl);
|
||||
#endif
|
||||
|
||||
#ifdef __MWERKS__
|
||||
# define cerr std::cerr
|
||||
# define endl std::endl
|
||||
FG_USING_STD(iostream);
|
||||
#endif
|
||||
|
||||
//
|
||||
// TODO:
|
||||
//
|
||||
// 1. Change output destination. Done.
|
||||
// 2. Make logbuf thread safe.
|
||||
// 3. Read environment for default debugClass and debugPriority.
|
||||
//
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// logbuf is an output-only streambuf with the ability to disable sets of
|
||||
// messages at runtime. Only messages with priority >= logbuf::logPriority
|
||||
// and debugClass == logbuf::logClass are output.
|
||||
//
|
||||
class logbuf : public streambuf
|
||||
{
|
||||
public:
|
||||
|
||||
#ifndef FG_HAVE_STD_INCLUDES
|
||||
typedef char_traits<char> traits_type;
|
||||
typedef char_traits<char>::int_type int_type;
|
||||
typedef char_traits<char>::pos_type pos_type;
|
||||
typedef char_traits<char>::off_type off_type;
|
||||
#endif
|
||||
// logbuf( streambuf* sb ) : sbuf(sb) {}
|
||||
logbuf();
|
||||
~logbuf();
|
||||
|
||||
// Is logging enabled?
|
||||
bool enabled() { return logging_enabled; }
|
||||
|
||||
// Set the logging level of subsequent messages.
|
||||
void set_log_state( fgDebugClass c, fgDebugPriority p );
|
||||
|
||||
// Set the global logging level.
|
||||
static void set_log_level( fgDebugClass c, fgDebugPriority p );
|
||||
|
||||
//
|
||||
void set_sb( streambuf* sb );
|
||||
|
||||
protected:
|
||||
|
||||
inline virtual int sync();
|
||||
int_type overflow( int ch );
|
||||
// int xsputn( const char* s, istreamsize n );
|
||||
|
||||
private:
|
||||
|
||||
// The streambuf used for actual output. Defaults to cerr.rdbuf().
|
||||
static streambuf* sbuf;
|
||||
|
||||
static bool logging_enabled;
|
||||
static fgDebugClass logClass;
|
||||
static fgDebugPriority logPriority;
|
||||
|
||||
private:
|
||||
|
||||
// Not defined.
|
||||
logbuf( const logbuf& );
|
||||
void operator= ( const logbuf& );
|
||||
};
|
||||
|
||||
inline int
|
||||
logbuf::sync()
|
||||
{
|
||||
#ifdef FG_HAVE_STD_INCLUDES
|
||||
return sbuf->pubsync();
|
||||
#else
|
||||
return sbuf->sync();
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void
|
||||
logbuf::set_log_state( fgDebugClass c, fgDebugPriority p )
|
||||
{
|
||||
logging_enabled = ((c & logClass) != 0 && p >= logPriority);
|
||||
}
|
||||
|
||||
inline logbuf::int_type
|
||||
logbuf::overflow( int c )
|
||||
{
|
||||
return logging_enabled ? sbuf->sputc(c) : (EOF == 0 ? 1: 0);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// logstream manipulator for setting the log level of a message.
|
||||
//
|
||||
struct loglevel
|
||||
{
|
||||
loglevel( fgDebugClass c, fgDebugPriority p )
|
||||
: logClass(c), logPriority(p) {}
|
||||
|
||||
fgDebugClass logClass;
|
||||
fgDebugPriority logPriority;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// A helper class that ensures a streambuf and ostream are constructed and
|
||||
// destroyed in the correct order. The streambuf must be created before the
|
||||
// ostream but bases are constructed before members. Thus, making this class
|
||||
// a private base of logstream, declared to the left of ostream, we ensure the
|
||||
// correct order of construction and destruction.
|
||||
//
|
||||
struct logstream_base
|
||||
{
|
||||
// logstream_base( streambuf* sb ) : lbuf(sb) {}
|
||||
logstream_base() {}
|
||||
|
||||
logbuf lbuf;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
class logstream : private logstream_base, public ostream
|
||||
{
|
||||
public:
|
||||
// The default is to send messages to cerr.
|
||||
logstream( ostream& out )
|
||||
// : logstream_base(out.rdbuf()),
|
||||
: logstream_base(),
|
||||
ostream(&lbuf) { lbuf.set_sb(out.rdbuf());}
|
||||
|
||||
void set_output( ostream& out ) { lbuf.set_sb( out.rdbuf() ); }
|
||||
|
||||
// Set the global log class and priority level.
|
||||
void setLogLevels( fgDebugClass c, fgDebugPriority p );
|
||||
|
||||
// Output operator to capture the debug level and priority of a message.
|
||||
inline ostream& operator<< ( const loglevel& l );
|
||||
};
|
||||
|
||||
inline ostream&
|
||||
logstream::operator<< ( const loglevel& l )
|
||||
{
|
||||
lbuf.set_log_state( l.logClass, l.logPriority );
|
||||
return *this;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Return the one and only logstream instance.
|
||||
// We use a function instead of a global object so we are assured that cerr
|
||||
// has been initialised.
|
||||
//
|
||||
inline logstream&
|
||||
fglog()
|
||||
{
|
||||
static logstream logstrm( cerr );
|
||||
return logstrm;
|
||||
}
|
||||
|
||||
#ifdef FG_NDEBUG
|
||||
# define FG_LOG(C,P,M)
|
||||
#elif defined( __MWERKS__ )
|
||||
# define FG_LOG(C,P,M) ::fglog() << ::loglevel(C,P) << M << std::endl
|
||||
#else
|
||||
# define FG_LOG(C,P,M) fglog() << loglevel(C,P) << M << endl
|
||||
#endif
|
||||
|
||||
#endif // _LOGSTREAM_H
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
#include <string>
|
||||
#include "Debug/logstream.hxx"
|
||||
|
||||
int
|
||||
main( int argc, char* argv[] )
|
||||
{
|
||||
fglog().setLogLevels( FG_ALL, FG_INFO );
|
||||
|
||||
FG_LOG( FG_TERRAIN, FG_BULK, "terrain::bulk" ); // shouldnt appear
|
||||
FG_LOG( FG_TERRAIN, FG_DEBUG, "terrain::debug" ); // shouldnt appear
|
||||
FG_LOG( FG_TERRAIN, FG_INFO, "terrain::info" );
|
||||
FG_LOG( FG_TERRAIN, FG_WARN, "terrain::warn" );
|
||||
FG_LOG( FG_TERRAIN, FG_ALERT, "terrain::alert" );
|
||||
|
||||
int i = 12345;
|
||||
long l = 54321L;
|
||||
double d = 3.14159;
|
||||
string s = "Hello world!";
|
||||
|
||||
FG_LOG( FG_EVENT, FG_INFO, "event::info "
|
||||
<< "i=" << i
|
||||
<< ", l=" << l
|
||||
<< ", d=" << d
|
||||
<< ", d*l=" << d*l
|
||||
<< ", s=\"" << s << "\"" );
|
||||
|
||||
// This shouldn't appear in log output:
|
||||
FG_LOG( FG_EVENT, FG_DEBUG, "event::debug "
|
||||
<< "- this should be seen - "
|
||||
<< "d=" << d
|
||||
<< ", s=\"" << s << "\"" );
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
if ENABLE_UNIX_SERIAL
|
||||
SERIAL_DIRS = Serial
|
||||
else
|
||||
SERIAL_DIRS =
|
||||
endif
|
||||
|
||||
SUBDIRS = \
|
||||
Bucket \
|
||||
Debug \
|
||||
Math \
|
||||
Misc \
|
||||
$(SERIAL_DIRS) \
|
||||
XGL\
|
||||
zlib
|
||||
@@ -1,168 +0,0 @@
|
||||
/* #include "HEADERS.h" */
|
||||
/* Copyright 1988, Brown Computer Graphics Group. All Rights Reserved. */
|
||||
|
||||
/* --------------------------------------------------------------------------
|
||||
* This file contains routines that perform geometry-related operations
|
||||
* on matrices.
|
||||
* -------------------------------------------------------------------------*/
|
||||
|
||||
#include <Math/mat3defs.h>
|
||||
|
||||
/* -------------------------- Static Routines ---------------------------- */
|
||||
|
||||
/* ------------------------- Internal Routines --------------------------- */
|
||||
|
||||
/* -------------------------- Public Routines ---------------------------- */
|
||||
|
||||
/*
|
||||
* This takes a matrix used to transform points, and returns a corresponding
|
||||
* matrix that can be used to transform direction vectors (between points).
|
||||
*/
|
||||
|
||||
void
|
||||
MAT3direction_matrix(register double (*result_mat)[4], register double (*mat)[4])
|
||||
{
|
||||
register int i;
|
||||
|
||||
MAT3copy(result_mat, mat);
|
||||
|
||||
for (i = 0; i < 4; i++) result_mat[i][3] = result_mat[3][i] = 0.0;
|
||||
|
||||
result_mat[3][3] = 1.0;
|
||||
}
|
||||
|
||||
/*
|
||||
* This takes a matrix used to transform points, and returns a corresponding
|
||||
* matrix that can be used to transform vectors that must remain perpendicular
|
||||
* to planes defined by the points. It is useful when you are transforming
|
||||
* some object that has both points and normals in its definition, and you
|
||||
* only have the transformation matrix for the points. This routine returns
|
||||
* FALSE if the normal matrix is uncomputable. Otherwise, it returns TRUE.
|
||||
*
|
||||
* Spike sez: "This is the adjoint for the non-homogeneous part of the
|
||||
* transformation."
|
||||
*/
|
||||
|
||||
int
|
||||
MAT3normal_matrix(register double (*result_mat)[4], register double (*mat)[4])
|
||||
{
|
||||
register int ret;
|
||||
MAT3mat tmp_mat;
|
||||
|
||||
MAT3direction_matrix(result_mat, mat);
|
||||
|
||||
if ( (ret = MAT3invert(tmp_mat, tmp_mat)) ) {
|
||||
MAT3transpose(result_mat, tmp_mat);
|
||||
}
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/*
|
||||
* Sets the given matrix to be a scale matrix for the given vector of
|
||||
* scale values.
|
||||
*/
|
||||
|
||||
void
|
||||
MAT3scale(double (*result_mat)[4], double *scale)
|
||||
{
|
||||
MAT3identity(result_mat);
|
||||
|
||||
result_mat[0][0] = scale[0];
|
||||
result_mat[1][1] = scale[1];
|
||||
result_mat[2][2] = scale[2];
|
||||
}
|
||||
|
||||
/*
|
||||
* Sets up a matrix for a rotation about an axis given by the line from
|
||||
* (0,0,0) to axis, through an angle (in radians).
|
||||
* Looking along the axis toward the origin, the rotation is counter-clockwise.
|
||||
*/
|
||||
|
||||
#define SELECT .7071 /* selection constant (roughly .5*sqrt(2) */
|
||||
|
||||
void
|
||||
MAT3rotate(double (*result_mat)[4], double *axis, double angle_in_radians)
|
||||
{
|
||||
MAT3vec naxis, /* Axis of rotation, normalized */
|
||||
base2, /* 2nd unit basis vec, perp to axis */
|
||||
base3; /* 3rd unit basis vec, perp to axis & base2 */
|
||||
double dot;
|
||||
MAT3mat base_mat, /* Change-of-basis matrix */
|
||||
base_mat_trans; /* Inverse of c-o-b matrix */
|
||||
register int i;
|
||||
|
||||
/* Step 1: extend { axis } to a basis for 3-space: { axis, base2, base3 }
|
||||
* which is orthonormal (all three have unit length, and all three are
|
||||
* mutually orthogonal). Also should be oriented, i.e. axis cross base2 =
|
||||
* base3, rather than -base3.
|
||||
*
|
||||
* Method: Find a vector linearly independent from axis. For this we
|
||||
* either use the y-axis, or, if that is too close to axis, the
|
||||
* z-axis. 'Too close' means that the dot product is too near to 1.
|
||||
*/
|
||||
|
||||
MAT3_COPY_VEC(naxis, axis);
|
||||
MAT3_NORMALIZE_VEC(naxis, dot);
|
||||
|
||||
if (dot == 0.0) {
|
||||
/* ERR_ERROR(MAT3_errid, ERR_SEVERE,
|
||||
(ERR_S, "Zero-length axis vector given to MAT3rotate")); */
|
||||
return;
|
||||
}
|
||||
|
||||
MAT3perp_vec(base2, naxis, TRUE);
|
||||
MAT3cross_product(base3, naxis, base2);
|
||||
|
||||
/* Set up the change-of-basis matrix, and its inverse */
|
||||
MAT3identity(base_mat);
|
||||
MAT3identity(base_mat_trans);
|
||||
MAT3identity(result_mat);
|
||||
|
||||
for (i = 0; i < 3; i++){
|
||||
base_mat_trans[i][0] = base_mat[0][i] = naxis[i];
|
||||
base_mat_trans[i][1] = base_mat[1][i] = base2[i];
|
||||
base_mat_trans[i][2] = base_mat[2][i] = base3[i];
|
||||
}
|
||||
|
||||
/* If T(u) = uR, where R is base_mat, then T(x-axis) = naxis,
|
||||
* T(y-axis) = base2, and T(z-axis) = base3. The inverse of base_mat is
|
||||
* its transpose. OK?
|
||||
*/
|
||||
|
||||
result_mat[1][1] = result_mat[2][2] = cos(angle_in_radians);
|
||||
result_mat[2][1] = -(result_mat[1][2] = sin(angle_in_radians));
|
||||
|
||||
MAT3mult(result_mat, base_mat_trans, result_mat);
|
||||
MAT3mult(result_mat, result_mat, base_mat);
|
||||
}
|
||||
|
||||
/*
|
||||
* Sets the given matrix to be a translation matrix for the given vector of
|
||||
* translation values.
|
||||
*/
|
||||
|
||||
void
|
||||
MAT3translate(double (*result_mat)[4], double *trans)
|
||||
{
|
||||
MAT3identity(result_mat);
|
||||
|
||||
result_mat[3][0] = trans[0];
|
||||
result_mat[3][1] = trans[1];
|
||||
result_mat[3][2] = trans[2];
|
||||
}
|
||||
|
||||
/*
|
||||
* Sets the given matrix to be a shear matrix for the given x and y shear
|
||||
* values.
|
||||
*/
|
||||
|
||||
void
|
||||
MAT3shear(double (*result_mat)[4], double xshear, double yshear)
|
||||
{
|
||||
MAT3identity(result_mat);
|
||||
|
||||
result_mat[2][0] = xshear;
|
||||
result_mat[2][1] = yshear;
|
||||
}
|
||||
|
||||
@@ -1,311 +0,0 @@
|
||||
/* Copyright 1988, Brown Computer Graphics Group. All Rights Reserved. */
|
||||
|
||||
/* --------------------------------------------------------------------------
|
||||
* This file contains routines that operate solely on matrices.
|
||||
* -------------------------------------------------------------------------*/
|
||||
|
||||
#include <Math/mat3defs.h>
|
||||
|
||||
/* -------------------------- Static Routines ---------------------------- */
|
||||
|
||||
#define SMALL 1e-20 /* Small enough to be considered zero */
|
||||
|
||||
/*
|
||||
* Shuffles rows in inverse of 3x3. See comment in MAT3_inv3_second_col().
|
||||
*/
|
||||
|
||||
static void
|
||||
MAT3_inv3_swap( register double inv[3][3], int row0, int row1, int row2)
|
||||
{
|
||||
register int i, tempi;
|
||||
double temp;
|
||||
|
||||
#define SWAP_ROWS(a, b) \
|
||||
for (i = 0; i < 3; i++) SWAP(inv[a][i], inv[b][i], temp); \
|
||||
SWAP(a, b, tempi)
|
||||
|
||||
if (row0 != 0){
|
||||
if (row1 == 0) {
|
||||
SWAP_ROWS(row0, row1);
|
||||
}
|
||||
else {
|
||||
SWAP_ROWS(row0, row2);
|
||||
}
|
||||
}
|
||||
|
||||
if (row1 != 1) {
|
||||
SWAP_ROWS(row1, row2);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Does Gaussian elimination on second column.
|
||||
*/
|
||||
|
||||
static int
|
||||
MAT3_inv3_second_col (register double source[3][3], register double inv[3][3], int row0)
|
||||
{
|
||||
register int row1, row2, i1, i2, i;
|
||||
double temp;
|
||||
double a, b;
|
||||
|
||||
/* Find which row to use */
|
||||
if (row0 == 0) i1 = 1, i2 = 2;
|
||||
else if (row0 == 1) i1 = 0, i2 = 2;
|
||||
else i1 = 0, i2 = 1;
|
||||
|
||||
/* Find which is larger in abs. val.:the entry in [i1][1] or [i2][1] */
|
||||
/* and use that value for pivoting. */
|
||||
|
||||
a = source[i1][1]; if (a < 0) a = -a;
|
||||
b = source[i2][1]; if (b < 0) b = -b;
|
||||
if (a > b) row1 = i1;
|
||||
else row1 = i2;
|
||||
row2 = (row1 == i1 ? i2 : i1);
|
||||
|
||||
/* Scale row1 in source */
|
||||
if ((source[row1][1] < SMALL) && (source[row1][1] > -SMALL)) return(FALSE);
|
||||
temp = 1.0 / source[row1][1];
|
||||
source[row1][1] = 1.0;
|
||||
source[row1][2] *= temp; /* source[row1][0] is zero already */
|
||||
|
||||
/* Scale row1 in inv */
|
||||
inv[row1][row1] = temp; /* it used to be a 1.0 */
|
||||
inv[row1][row0] *= temp;
|
||||
|
||||
/* Clear column one, source, and make corresponding changes in inv */
|
||||
|
||||
for (i = 0; i < 3; i++) if (i != row1) { /* for i = all rows but row1 */
|
||||
temp = -source[i][1];
|
||||
source[i][1] = 0.0;
|
||||
source[i][2] += temp * source[row1][2];
|
||||
|
||||
inv[i][row1] = temp * inv[row1][row1];
|
||||
inv[i][row0] += temp * inv[row1][row0];
|
||||
}
|
||||
|
||||
/* Scale row2 in source */
|
||||
if ((source[row2][2] < SMALL) && (source[row2][2] > -SMALL)) return(FALSE);
|
||||
temp = 1.0 / source[row2][2];
|
||||
source[row2][2] = 1.0; /* source[row2][*] is zero already */
|
||||
|
||||
/* Scale row2 in inv */
|
||||
inv[row2][row2] = temp; /* it used to be a 1.0 */
|
||||
inv[row2][row0] *= temp;
|
||||
inv[row2][row1] *= temp;
|
||||
|
||||
/* Clear column one, source, and make corresponding changes in inv */
|
||||
for (i = 0; i < 3; i++) if (i != row2) { /* for i = all rows but row2 */
|
||||
temp = -source[i][2];
|
||||
source[i][2] = 0.0;
|
||||
inv[i][row0] += temp * inv[row2][row0];
|
||||
inv[i][row1] += temp * inv[row2][row1];
|
||||
inv[i][row2] += temp * inv[row2][row2];
|
||||
}
|
||||
|
||||
/*
|
||||
* Now all is done except that the inverse needs to have its rows shuffled.
|
||||
* row0 needs to be moved to inv[0][*], row1 to inv[1][*], etc.
|
||||
*
|
||||
* We *didn't* do the swapping before the elimination so that we could more
|
||||
* easily keep track of what ops are needed to be done in the inverse.
|
||||
*/
|
||||
MAT3_inv3_swap(inv, row0, row1, row2);
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Fast inversion routine for 3 x 3 matrices. - Written by jfh.
|
||||
*
|
||||
* This takes 30 multiplies/divides, as opposed to 39 for Cramer's Rule.
|
||||
* The algorithm consists of performing fast gaussian elimination, by never
|
||||
* doing any operations where the result is guaranteed to be zero, or where
|
||||
* one operand is guaranteed to be zero. This is done at the cost of clarity,
|
||||
* alas.
|
||||
*
|
||||
* Returns 1 if the inverse was successful, 0 if it failed.
|
||||
*/
|
||||
|
||||
static int
|
||||
MAT3_invert3 (register double source[3][3], register double inv[3][3])
|
||||
{
|
||||
register int i, row0;
|
||||
double temp;
|
||||
double a, b, c;
|
||||
|
||||
inv[0][0] = inv[1][1] = inv[2][2] = 1.0;
|
||||
inv[0][1] = inv[0][2] = inv[1][0] = inv[1][2] = inv[2][0] = inv[2][1] = 0.0;
|
||||
|
||||
/* attempt to find the largest entry in first column to use as pivot */
|
||||
a = source[0][0]; if (a < 0) a = -a;
|
||||
b = source[1][0]; if (b < 0) b = -b;
|
||||
c = source[2][0]; if (c < 0) c = -c;
|
||||
|
||||
if (a > b) {
|
||||
if (a > c) row0 = 0;
|
||||
else row0 = 2;
|
||||
}
|
||||
else {
|
||||
if (b > c) row0 = 1;
|
||||
else row0 = 2;
|
||||
}
|
||||
|
||||
/* Scale row0 of source */
|
||||
if ((source[row0][0] < SMALL) && (source[row0][0] > -SMALL)) return(FALSE);
|
||||
temp = 1.0 / source[row0][0];
|
||||
source[row0][0] = 1.0;
|
||||
source[row0][1] *= temp;
|
||||
source[row0][2] *= temp;
|
||||
|
||||
/* Scale row0 of inverse */
|
||||
inv[row0][row0] = temp; /* other entries are zero -- no effort */
|
||||
|
||||
/* Clear column zero of source, and make corresponding changes in inverse */
|
||||
|
||||
for (i = 0; i < 3; i++) if (i != row0) { /* for i = all rows but row0 */
|
||||
temp = -source[i][0];
|
||||
source[i][0] = 0.0;
|
||||
source[i][1] += temp * source[row0][1];
|
||||
source[i][2] += temp * source[row0][2];
|
||||
inv[i][row0] = temp * inv[row0][row0];
|
||||
}
|
||||
|
||||
/*
|
||||
* We've now done gaussian elimination so that the source and
|
||||
* inverse look like this:
|
||||
*
|
||||
* 1 * * * 0 0
|
||||
* 0 * * * 1 0
|
||||
* 0 * * * 0 1
|
||||
*
|
||||
* We now proceed to do elimination on the second column.
|
||||
*/
|
||||
if (! MAT3_inv3_second_col(source, inv, row0)) return(FALSE);
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Finds a new pivot for a non-simple 4x4. See comments in MAT3invert().
|
||||
*/
|
||||
|
||||
static int
|
||||
MAT3_inv4_pivot (register MAT3mat src, MAT3vec r, double *s, int *swap)
|
||||
{
|
||||
register int i, j;
|
||||
double temp, max;
|
||||
|
||||
*swap = -1;
|
||||
|
||||
if (MAT3_IS_ZERO(src[3][3])) {
|
||||
|
||||
/* Look for a different pivot element: one with largest abs value */
|
||||
max = 0.0;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
if (src[i][3] > max) max = src[*swap = i][3];
|
||||
else if (src[i][3] < -max) max = -src[*swap = i][3];
|
||||
}
|
||||
|
||||
/* No pivot element available ! */
|
||||
if (*swap < 0) return(FALSE);
|
||||
|
||||
else for (j = 0; j < 4; j++) SWAP(src[*swap][j], src[3][j], temp);
|
||||
}
|
||||
|
||||
MAT3_SET_VEC (r, -src[0][3], -src[1][3], -src[2][3]);
|
||||
|
||||
*s = 1.0 / src[3][3];
|
||||
|
||||
src[0][3] = src[1][3] = src[2][3] = 0.0;
|
||||
src[3][3] = 1.0;
|
||||
|
||||
MAT3_SCALE_VEC(src[3], src[3], *s);
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
src[0][i] += r[0] * src[3][i];
|
||||
src[1][i] += r[1] * src[3][i];
|
||||
src[2][i] += r[2] * src[3][i];
|
||||
}
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
/* ------------------------- Internal Routines --------------------------- */
|
||||
|
||||
/* -------------------------- Public Routines ---------------------------- */
|
||||
|
||||
/*
|
||||
* This returns the inverse of the given matrix. The result matrix
|
||||
* may be the same as the one to invert.
|
||||
*
|
||||
* Fast inversion routine for 4 x 4 matrices, written by jfh.
|
||||
*
|
||||
* Returns 1 if the inverse was successful, 0 if it failed.
|
||||
*
|
||||
* This routine has been specially tweaked to notice the following:
|
||||
* If the matrix has the form
|
||||
* * * * 0
|
||||
* * * * 0
|
||||
* * * * 0
|
||||
* * * * 1
|
||||
*
|
||||
* (as do many matrices in graphics), then we compute the inverse of
|
||||
* the upper left 3x3 matrix and use this to find the general inverse.
|
||||
*
|
||||
* In the event that the right column is not 0-0-0-1, we do gaussian
|
||||
* elimination to make it so, then use the 3x3 inverse, and then do
|
||||
* our gaussian elimination.
|
||||
*/
|
||||
|
||||
int
|
||||
MAT3invert(double (*result_mat)[4], double (*mat)[4])
|
||||
{
|
||||
MAT3mat src, inv;
|
||||
register int i, j, simple;
|
||||
double m[3][3], inv3[3][3], s, temp;
|
||||
MAT3vec r, t;
|
||||
int swap;
|
||||
|
||||
MAT3copy(src, mat);
|
||||
MAT3identity(inv);
|
||||
|
||||
/* If last column is not (0,0,0,1), use special code */
|
||||
simple = (mat[0][3] == 0.0 && mat[1][3] == 0.0 &&
|
||||
mat[2][3] == 0.0 && mat[3][3] == 1.0);
|
||||
|
||||
if (! simple && ! MAT3_inv4_pivot(src, r, &s, &swap)) return(FALSE);
|
||||
|
||||
MAT3_COPY_VEC(t, src[3]); /* Translation vector */
|
||||
|
||||
/* Copy upper-left 3x3 matrix */
|
||||
for (i = 0; i < 3; i++) for (j = 0; j < 3; j++) m[i][j] = src[i][j];
|
||||
|
||||
if (! MAT3_invert3(m, inv3)) return(FALSE);
|
||||
|
||||
for (i = 0; i < 3; i++) for (j = 0; j < 3; j++) inv[i][j] = inv3[i][j];
|
||||
|
||||
for (i = 0; i < 3; i++) for (j = 0; j < 3; j++)
|
||||
inv[3][i] -= t[j] * inv3[j][i];
|
||||
|
||||
if (! simple) {
|
||||
|
||||
/* We still have to undo our gaussian elimination from earlier on */
|
||||
/* add r0 * first col to last col */
|
||||
/* add r1 * 2nd col to last col */
|
||||
/* add r2 * 3rd col to last col */
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
inv[i][3] += r[0] * inv[i][0] + r[1] * inv[i][1] + r[2] * inv[i][2];
|
||||
inv[i][3] *= s;
|
||||
}
|
||||
|
||||
if (swap >= 0)
|
||||
for (i = 0; i < 4; i++) SWAP(inv[i][swap], inv[i][3], temp);
|
||||
}
|
||||
|
||||
MAT3copy(result_mat, inv);
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
/* #include "HEADERS.h" */
|
||||
/* Copyright 1988, Brown Computer Graphics Group. All Rights Reserved. */
|
||||
|
||||
/* --------------------------------------------------------------------------
|
||||
* This file contains routines that operate solely on matrices.
|
||||
* -------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
# ifndef HAVE_STL_SGI_PORT
|
||||
# ifdef __BORLANDC__
|
||||
# include <mem.h>
|
||||
# else
|
||||
# include <memory.h> /* required for memset() and memcpy() */
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <Math/mat3defs.h>
|
||||
|
||||
MAT3mat identityMatrix = {
|
||||
{ 1.0, 0.0, 0.0, 0.0 },
|
||||
{ 0.0, 1.0, 0.0, 0.0 },
|
||||
{ 0.0, 0.0, 1.0, 0.0 },
|
||||
{ 0.0, 0.0, 0.0, 1.0 }
|
||||
};
|
||||
|
||||
/* #include "macros.h" */
|
||||
|
||||
/* -------------------------- Static Routines ---------------------------- */
|
||||
|
||||
/* ------------------------- Internal Routines --------------------------- */
|
||||
|
||||
/* -------------------------- Public Routines ---------------------------- */
|
||||
|
||||
|
||||
#if !defined( USE_XTRA_MAT3_INLINES )
|
||||
|
||||
/*
|
||||
* This multiplies two matrices, producing a third, which may the same as
|
||||
* either of the first two.
|
||||
*/
|
||||
|
||||
void
|
||||
MAT3mult (double (*result_mat)[4], register double (*mat1)[4], register double (*mat2)[4])
|
||||
{
|
||||
register int i, j;
|
||||
MAT3mat tmp_mat;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
for (j = 0; j < 4; j++)
|
||||
tmp_mat[i][j] = (mat1[i][0] * mat2[0][j] +
|
||||
mat1[i][1] * mat2[1][j] +
|
||||
mat1[i][2] * mat2[2][j] +
|
||||
mat1[i][3] * mat2[3][j]);
|
||||
MAT3copy (result_mat, tmp_mat);
|
||||
}
|
||||
#endif // !defined( USE_XTRA_MAT3_INLINES )
|
||||
|
||||
/*
|
||||
* This returns the transpose of a matrix. The result matrix may be
|
||||
* the same as the one to transpose.
|
||||
*/
|
||||
|
||||
void
|
||||
MAT3transpose (double (*result_mat)[4], register double (*mat)[4])
|
||||
{
|
||||
register int i, j;
|
||||
MAT3mat tmp_mat;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
for (j = 0; j < 4; j++)
|
||||
tmp_mat[i][j] = mat[j][i];
|
||||
|
||||
MAT3copy (result_mat, tmp_mat);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* This prints the given matrix to the given file pointer.
|
||||
*/
|
||||
|
||||
void
|
||||
MAT3print(double (*mat)[4], FILE *fp)
|
||||
{
|
||||
MAT3print_formatted(mat, fp, CNULL, CNULL, CNULL, CNULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* This prints the given matrix to the given file pointer.
|
||||
* use the format string to pass to fprintf. head and tail
|
||||
* are printed at the beginning and end of each line.
|
||||
*/
|
||||
|
||||
void
|
||||
MAT3print_formatted(double (*mat)[4], FILE *fp, char *title, char *head, char *format, char *tail)
|
||||
{
|
||||
register int i, j;
|
||||
|
||||
/* This is to allow this to be called easily from a debugger */
|
||||
if (fp == NULL) fp = stderr;
|
||||
|
||||
if (title == NULL) title = "MAT3 matrix:\n";
|
||||
if (head == NULL) head = " ";
|
||||
if (format == NULL) format = "%#8.4lf ";
|
||||
if (tail == NULL) tail = "\n";
|
||||
|
||||
(void) fprintf(fp, title);
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
(void) fprintf(fp, head);
|
||||
for (j = 0; j < 4; j++) (void) fprintf(fp, format, mat[i][j]);
|
||||
(void) fprintf(fp, tail);
|
||||
}
|
||||
}
|
||||
@@ -1,154 +0,0 @@
|
||||
/* Copyright 1988, Brown Computer Graphics Group. All Rights Reserved. */
|
||||
|
||||
/* --------------------------------------------------------------------------
|
||||
* This file contains routines that operate on matrices and vectors, or
|
||||
* vectors and vectors.
|
||||
* -------------------------------------------------------------------------*/
|
||||
|
||||
/* #include "sphigslocal.h" */
|
||||
|
||||
/* -------------------------- Static Routines ---------------------------- */
|
||||
|
||||
/* ------------------------- Internal Routines --------------------------- */
|
||||
|
||||
/* -------------------------- Public Routines ---------------------------- */
|
||||
|
||||
/*
|
||||
* Multiplies a vector by a matrix, setting the result vector.
|
||||
* It assumes all homogeneous coordinates are 1.
|
||||
* The two vectors involved may be the same.
|
||||
*/
|
||||
|
||||
#include <Math/mat3.h>
|
||||
|
||||
#ifndef TRUE
|
||||
# define TRUE 1
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
# define FALSE 0
|
||||
#endif
|
||||
|
||||
#if !defined( USE_XTRA_MAT3_INLINES )
|
||||
|
||||
void
|
||||
MAT3mult_vec(double *result_vec, register double *vec, register double (*mat)[4])
|
||||
{
|
||||
MAT3vec tempvec;
|
||||
register double *temp = tempvec;
|
||||
|
||||
temp[0] = vec[0] * mat[0][0] + vec[1] * mat[1][0] +
|
||||
vec[2] * mat[2][0] + mat[3][0];
|
||||
temp[1] = vec[0] * mat[0][1] + vec[1] * mat[1][1] +
|
||||
vec[2] * mat[2][1] + mat[3][1];
|
||||
temp[2] = vec[0] * mat[0][2] + vec[1] * mat[1][2] +
|
||||
vec[2] * mat[2][2] + mat[3][2];
|
||||
|
||||
MAT3_COPY_VEC(result_vec, temp);
|
||||
}
|
||||
#endif // !defined( USE_XTRA_MAT3_INLINES )
|
||||
|
||||
/*
|
||||
* Multiplies a vector of size 4 by a matrix, setting the result vector.
|
||||
* The fourth element of the vector is the homogeneous coordinate, which
|
||||
* may or may not be 1. If the "normalize" parameter is TRUE, then the
|
||||
* result vector will be normalized so that the homogeneous coordinate is 1.
|
||||
* The two vectors involved may be the same.
|
||||
* This returns zero if the vector was to be normalized, but couldn't be.
|
||||
*/
|
||||
|
||||
int
|
||||
MAT3mult_hvec(double *result_vec, register double *vec, register double (*mat)[4], int normalize)
|
||||
{
|
||||
MAT3hvec tempvec;
|
||||
double norm_fac;
|
||||
register double *temp = tempvec;
|
||||
register int ret = TRUE;
|
||||
|
||||
temp[0] = vec[0] * mat[0][0] + vec[1] * mat[1][0] +
|
||||
vec[2] * mat[2][0] + vec[3] * mat[3][0];
|
||||
temp[1] = vec[0] * mat[0][1] + vec[1] * mat[1][1] +
|
||||
vec[2] * mat[2][1] + vec[3] * mat[3][1];
|
||||
temp[2] = vec[0] * mat[0][2] + vec[1] * mat[1][2] +
|
||||
vec[2] * mat[2][2] + vec[3] * mat[3][2];
|
||||
temp[3] = vec[0] * mat[0][3] + vec[1] * mat[1][3] +
|
||||
vec[2] * mat[2][3] + vec[3] * mat[3][3];
|
||||
|
||||
/* Normalize if asked for, possible, and necessary */
|
||||
if (normalize) {
|
||||
if (MAT3_IS_ZERO(temp[3])) {
|
||||
#ifndef THINK_C
|
||||
fprintf (stderr,
|
||||
"Can't normalize vector: homogeneous coordinate is 0");
|
||||
#endif
|
||||
ret = FALSE;
|
||||
}
|
||||
else {
|
||||
norm_fac = 1.0 / temp[3];
|
||||
MAT3_SCALE_VEC(result_vec, temp, norm_fac);
|
||||
result_vec[3] = 1.0;
|
||||
}
|
||||
}
|
||||
else MAT3_COPY_HVEC(result_vec, temp);
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
#if !defined( USE_XTRA_MAT3_INLINES )
|
||||
|
||||
/*
|
||||
* Sets the first vector to be the cross-product of the last two vectors.
|
||||
*/
|
||||
|
||||
void
|
||||
MAT3cross_product(double *result_vec, register double *vec1, register double *vec2)
|
||||
{
|
||||
MAT3vec tempvec;
|
||||
register double *temp = tempvec;
|
||||
|
||||
temp[0] = vec1[1] * vec2[2] - vec1[2] * vec2[1];
|
||||
temp[1] = vec1[2] * vec2[0] - vec1[0] * vec2[2];
|
||||
temp[2] = vec1[0] * vec2[1] - vec1[1] * vec2[0];
|
||||
|
||||
MAT3_COPY_VEC(result_vec, temp);
|
||||
}
|
||||
#endif // !defined( USE_XTRA_MAT3_INLINES )
|
||||
|
||||
/*
|
||||
* Finds a vector perpendicular to vec and stores it in result_vec.
|
||||
* Method: take any vector (we use <0,1,0>) and subtract the
|
||||
* portion of it pointing in the vec direction. This doesn't
|
||||
* work if vec IS <0,1,0> or is very near it. So if this is
|
||||
* the case, use <0,0,1> instead.
|
||||
* If "is_unit" is TRUE, the given vector is assumed to be unit length.
|
||||
*/
|
||||
|
||||
#define SELECT .7071 /* selection constant (roughly .5*sqrt(2) */
|
||||
|
||||
void
|
||||
MAT3perp_vec(double *result_vec, double *vec, int is_unit)
|
||||
{
|
||||
MAT3vec norm;
|
||||
double dot;
|
||||
|
||||
MAT3_SET_VEC(result_vec, 0.0, 1.0, 0.0);
|
||||
|
||||
MAT3_COPY_VEC(norm, vec);
|
||||
|
||||
if (! is_unit) MAT3_NORMALIZE_VEC(norm, dot);
|
||||
|
||||
/* See if vector is too close to <0,1,0>. If so, use <0,0,1> */
|
||||
if ((dot = MAT3_DOT_PRODUCT(norm, result_vec)) > SELECT || dot < -SELECT) {
|
||||
result_vec[1] = 0.0;
|
||||
result_vec[2] = 1.0;
|
||||
dot = MAT3_DOT_PRODUCT(norm, result_vec);
|
||||
}
|
||||
|
||||
/* Subtract off non-perpendicular part */
|
||||
result_vec[0] -= dot * norm[0];
|
||||
result_vec[1] -= dot * norm[1];
|
||||
result_vec[2] -= dot * norm[2];
|
||||
|
||||
/* Make result unit length */
|
||||
MAT3_NORMALIZE_VEC(result_vec, dot);
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
noinst_LIBRARIES = libMath.a
|
||||
|
||||
libMath_a_SOURCES = \
|
||||
MAT3geom.c \
|
||||
MAT3inv.c \
|
||||
MAT3mat.c \
|
||||
MAT3vec.c \
|
||||
fg_geodesy.cxx fg_geodesy.hxx \
|
||||
fg_random.c fg_random.h \
|
||||
interpolater.cxx interpolater.hxx \
|
||||
leastsqs.cxx leastsqs.hxx \
|
||||
mat3.h mat3defs.h mat3err.h \
|
||||
point3d.hxx \
|
||||
polar3d.cxx polar3d.hxx \
|
||||
vector.cxx vector.hxx
|
||||
|
||||
INCLUDES += -I$(top_builddir) -I$(top_builddir)/Lib -I$(top_builddir)/Simulator
|
||||
@@ -1,211 +0,0 @@
|
||||
// fg_geodesy.cxx -- routines to convert between geodetic and geocentric
|
||||
// coordinate systems.
|
||||
//
|
||||
// Copied and adapted directly from LaRCsim/ls_geodesy.c
|
||||
//
|
||||
// See below for the complete original LaRCsim comments.
|
||||
//
|
||||
// $Id$
|
||||
|
||||
#include "Include/compiler.h"
|
||||
#ifdef FG_HAVE_STD_INCLUDES
|
||||
# include <cmath>
|
||||
# include <cerrno>
|
||||
#else
|
||||
# include <math.h>
|
||||
# include <errno.h>
|
||||
#endif
|
||||
|
||||
#include <Debug/logstream.hxx>
|
||||
#include <Include/fg_constants.h>
|
||||
#include <Math/fg_geodesy.hxx>
|
||||
#include <Math/point3d.hxx>
|
||||
|
||||
#ifndef FG_HAVE_NATIVE_SGI_COMPILERS
|
||||
FG_USING_STD(cout);
|
||||
#endif
|
||||
|
||||
// ONE_SECOND is pi/180/60/60, or about 100 feet at earths' equator
|
||||
#define ONE_SECOND 4.848136811E-6
|
||||
|
||||
|
||||
// fgGeocToGeod(lat_geoc, radius, *lat_geod, *alt, *sea_level_r)
|
||||
// INPUTS:
|
||||
// lat_geoc Geocentric latitude, radians, + = North
|
||||
// radius C.G. radius to earth center (meters)
|
||||
//
|
||||
// OUTPUTS:
|
||||
// lat_geod Geodetic latitude, radians, + = North
|
||||
// alt C.G. altitude above mean sea level (meters)
|
||||
// sea_level_r radius from earth center to sea level at
|
||||
// local vertical (surface normal) of C.G. (meters)
|
||||
|
||||
|
||||
void fgGeocToGeod( double lat_geoc, double radius, double
|
||||
*lat_geod, double *alt, double *sea_level_r )
|
||||
{
|
||||
double t_lat, x_alpha, mu_alpha, delt_mu, r_alpha, l_point, rho_alpha;
|
||||
double sin_mu_a, denom,delt_lambda, lambda_sl, sin_lambda_sl;
|
||||
|
||||
if( ( (FG_PI_2 - lat_geoc) < ONE_SECOND ) // near North pole
|
||||
|| ( (FG_PI_2 + lat_geoc) < ONE_SECOND ) ) // near South pole
|
||||
{
|
||||
*lat_geod = lat_geoc;
|
||||
*sea_level_r = EQUATORIAL_RADIUS_M*E;
|
||||
*alt = radius - *sea_level_r;
|
||||
} else {
|
||||
t_lat = tan(lat_geoc);
|
||||
x_alpha = E*EQUATORIAL_RADIUS_M/sqrt(t_lat*t_lat + E*E);
|
||||
double tmp = RESQ_M - x_alpha * x_alpha;
|
||||
if ( tmp < 0.0 ) { tmp = 0.0; }
|
||||
mu_alpha = atan2(sqrt(tmp),E*x_alpha);
|
||||
if (lat_geoc < 0) mu_alpha = - mu_alpha;
|
||||
sin_mu_a = sin(mu_alpha);
|
||||
delt_lambda = mu_alpha - lat_geoc;
|
||||
r_alpha = x_alpha/cos(lat_geoc);
|
||||
l_point = radius - r_alpha;
|
||||
*alt = l_point*cos(delt_lambda);
|
||||
|
||||
// check for domain error
|
||||
if ( errno == EDOM ) {
|
||||
FG_LOG( FG_GENERAL, FG_ALERT, "Domain ERROR in fgGeocToGeod!!!!" );
|
||||
*alt = 0.0;
|
||||
}
|
||||
|
||||
denom = sqrt(1-EPS*EPS*sin_mu_a*sin_mu_a);
|
||||
rho_alpha = EQUATORIAL_RADIUS_M*(1-EPS)/
|
||||
(denom*denom*denom);
|
||||
delt_mu = atan2(l_point*sin(delt_lambda),rho_alpha + *alt);
|
||||
*lat_geod = mu_alpha - delt_mu;
|
||||
lambda_sl = atan( E*E * tan(*lat_geod) ); // SL geoc. latitude
|
||||
sin_lambda_sl = sin( lambda_sl );
|
||||
*sea_level_r =
|
||||
sqrt(RESQ_M / (1 + ((1/(E*E))-1)*sin_lambda_sl*sin_lambda_sl));
|
||||
|
||||
// check for domain error
|
||||
if ( errno == EDOM ) {
|
||||
FG_LOG( FG_GENERAL, FG_ALERT, "Domain ERROR in fgGeocToGeod!!!!" );
|
||||
*sea_level_r = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// fgGeodToGeoc( lat_geod, alt, *sl_radius, *lat_geoc )
|
||||
// INPUTS:
|
||||
// lat_geod Geodetic latitude, radians, + = North
|
||||
// alt C.G. altitude above mean sea level (meters)
|
||||
//
|
||||
// OUTPUTS:
|
||||
// sl_radius SEA LEVEL radius to earth center (meters)
|
||||
// (add Altitude to get true distance from earth center.
|
||||
// lat_geoc Geocentric latitude, radians, + = North
|
||||
//
|
||||
|
||||
|
||||
void fgGeodToGeoc( double lat_geod, double alt, double *sl_radius,
|
||||
double *lat_geoc )
|
||||
{
|
||||
double lambda_sl, sin_lambda_sl, cos_lambda_sl, sin_mu, cos_mu, px, py;
|
||||
|
||||
lambda_sl = atan( E*E * tan(lat_geod) ); // sea level geocentric latitude
|
||||
sin_lambda_sl = sin( lambda_sl );
|
||||
cos_lambda_sl = cos( lambda_sl );
|
||||
sin_mu = sin(lat_geod); // Geodetic (map makers') latitude
|
||||
cos_mu = cos(lat_geod);
|
||||
*sl_radius =
|
||||
sqrt(RESQ_M / (1 + ((1/(E*E))-1)*sin_lambda_sl*sin_lambda_sl));
|
||||
py = *sl_radius*sin_lambda_sl + alt*sin_mu;
|
||||
px = *sl_radius*cos_lambda_sl + alt*cos_mu;
|
||||
*lat_geoc = atan2( py, px );
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
TITLE: ls_geodesy
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
FUNCTION: Converts geocentric coordinates to geodetic positions
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
MODULE STATUS: developmental
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
GENEALOGY: Written as part of LaRCSim project by E. B. Jackson
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
DESIGNED BY: E. B. Jackson
|
||||
|
||||
CODED BY: E. B. Jackson
|
||||
|
||||
MAINTAINED BY: E. B. Jackson
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
MODIFICATION HISTORY:
|
||||
|
||||
DATE PURPOSE BY
|
||||
|
||||
930208 Modified to avoid singularity near polar region. EBJ
|
||||
930602 Moved backwards calcs here from ls_step. EBJ
|
||||
931214 Changed erroneous Latitude and Altitude variables to
|
||||
*lat_geod and *alt in routine ls_geoc_to_geod. EBJ
|
||||
940111 Changed header files from old ls_eom.h style to ls_types,
|
||||
and ls_constants. Also replaced old DATA type with new
|
||||
SCALAR type. EBJ
|
||||
|
||||
CURRENT RCS HEADER:
|
||||
|
||||
$Header$
|
||||
* Revision 1.5 1994/01/11 18:47:05 bjax
|
||||
* Changed include files to use types and constants, not ls_eom.h
|
||||
* Also changed DATA type to SCALAR type.
|
||||
*
|
||||
* Revision 1.4 1993/12/14 21:06:47 bjax
|
||||
* Removed global variable references Altitude and Latitude. EBJ
|
||||
*
|
||||
* Revision 1.3 1993/06/02 15:03:40 bjax
|
||||
* Made new subroutine for calculating geodetic to geocentric; changed name
|
||||
* of forward conversion routine from ls_geodesy to ls_geoc_to_geod.
|
||||
*
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
REFERENCES:
|
||||
|
||||
[ 1] Stevens, Brian L.; and Lewis, Frank L.: "Aircraft
|
||||
Control and Simulation", Wiley and Sons, 1992.
|
||||
ISBN 0-471-61397-5
|
||||
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
CALLED BY: ls_aux
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
CALLS TO:
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
INPUTS:
|
||||
lat_geoc Geocentric latitude, radians, + = North
|
||||
radius C.G. radius to earth center, ft
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
OUTPUTS:
|
||||
lat_geod Geodetic latitude, radians, + = North
|
||||
alt C.G. altitude above mean sea level, ft
|
||||
sea_level_r radius from earth center to sea level at
|
||||
local vertical (surface normal) of C.G.
|
||||
|
||||
--------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
@@ -1,162 +0,0 @@
|
||||
// fg_geodesy.hxx -- routines to convert between geodetic and geocentric
|
||||
// coordinate systems.
|
||||
//
|
||||
// Copied and adapted directly from LaRCsim/ls_geodesy.c
|
||||
//
|
||||
// See below for the complete original LaRCsim comments.
|
||||
//
|
||||
// $Id$
|
||||
|
||||
|
||||
#ifndef _FG_GEODESY_HXX
|
||||
#define _FG_GEODESY_HXX
|
||||
|
||||
|
||||
#ifndef __cplusplus
|
||||
# error This library requires C++
|
||||
#endif
|
||||
|
||||
|
||||
#include <Math/point3d.hxx>
|
||||
#include <Math/polar3d.hxx>
|
||||
|
||||
|
||||
// fgGeocToGeod(lat_geoc, radius, *lat_geod, *alt, *sea_level_r)
|
||||
// INPUTS:
|
||||
// lat_geoc Geocentric latitude, radians, + = North
|
||||
// radius C.G. radius to earth center (meters)
|
||||
//
|
||||
// OUTPUTS:
|
||||
// lat_geod Geodetic latitude, radians, + = North
|
||||
// alt C.G. altitude above mean sea level (meters)
|
||||
// sea_level_r radius from earth center to sea level at
|
||||
// local vertical (surface normal) of C.G. (meters)
|
||||
|
||||
void fgGeocToGeod( double lat_geoc, double radius, double
|
||||
*lat_geod, double *alt, double *sea_level_r );
|
||||
|
||||
|
||||
// fgGeodToGeoc( lat_geod, alt, *sl_radius, *lat_geoc )
|
||||
// INPUTS:
|
||||
// lat_geod Geodetic latitude, radians, + = North
|
||||
// alt C.G. altitude above mean sea level (meters)
|
||||
//
|
||||
// OUTPUTS:
|
||||
// sl_radius SEA LEVEL radius to earth center (meters)
|
||||
// (add Altitude to get true distance from earth center.
|
||||
// lat_geoc Geocentric latitude, radians, + = North
|
||||
//
|
||||
|
||||
void fgGeodToGeoc( double lat_geod, double alt, double *sl_radius,
|
||||
double *lat_geoc );
|
||||
|
||||
|
||||
// convert a geodetic point lon(radians), lat(radians), elev(meter) to
|
||||
// a cartesian point
|
||||
|
||||
inline Point3D fgGeodToCart(const Point3D& geod) {
|
||||
double gc_lon, gc_lat, sl_radius;
|
||||
|
||||
// printf("A geodetic point is (%.2f, %.2f, %.2f)\n",
|
||||
// geod[0], geod[1], geod[2]);
|
||||
|
||||
gc_lon = geod.lon();
|
||||
fgGeodToGeoc(geod.lat(), geod.radius(), &sl_radius, &gc_lat);
|
||||
|
||||
// printf("A geocentric point is (%.2f, %.2f, %.2f)\n", gc_lon,
|
||||
// gc_lat, sl_radius+geod[2]);
|
||||
|
||||
Point3D pp = Point3D( gc_lon, gc_lat, sl_radius + geod.radius());
|
||||
return fgPolarToCart3d(pp);
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
TITLE: ls_geodesy
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
FUNCTION: Converts geocentric coordinates to geodetic positions
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
MODULE STATUS: developmental
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
GENEALOGY: Written as part of LaRCSim project by E. B. Jackson
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
DESIGNED BY: E. B. Jackson
|
||||
|
||||
CODED BY: E. B. Jackson
|
||||
|
||||
MAINTAINED BY: E. B. Jackson
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
MODIFICATION HISTORY:
|
||||
|
||||
DATE PURPOSE BY
|
||||
|
||||
930208 Modified to avoid singularity near polar region. EBJ
|
||||
930602 Moved backwards calcs here from ls_step. EBJ
|
||||
931214 Changed erroneous Latitude and Altitude variables to
|
||||
*lat_geod and *alt in routine ls_geoc_to_geod. EBJ
|
||||
940111 Changed header files from old ls_eom.h style to ls_types,
|
||||
and ls_constants. Also replaced old DATA type with new
|
||||
SCALAR type. EBJ
|
||||
|
||||
CURRENT RCS HEADER:
|
||||
|
||||
$Header$
|
||||
|
||||
* Revision 1.5 1994/01/11 18:47:05 bjax
|
||||
* Changed include files to use types and constants, not ls_eom.h
|
||||
* Also changed DATA type to SCALAR type.
|
||||
*
|
||||
* Revision 1.4 1993/12/14 21:06:47 bjax
|
||||
* Removed global variable references Altitude and Latitude. EBJ
|
||||
*
|
||||
* Revision 1.3 1993/06/02 15:03:40 bjax
|
||||
* Made new subroutine for calculating geodetic to geocentric; changed name
|
||||
* of forward conversion routine from ls_geodesy to ls_geoc_to_geod.
|
||||
*
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
REFERENCES:
|
||||
|
||||
[ 1] Stevens, Brian L.; and Lewis, Frank L.: "Aircraft
|
||||
Control and Simulation", Wiley and Sons, 1992.
|
||||
ISBN 0-471-61397-5
|
||||
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
CALLED BY: ls_aux
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
CALLS TO:
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
INPUTS:
|
||||
lat_geoc Geocentric latitude, radians, + = North
|
||||
radius C.G. radius to earth center, ft
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
OUTPUTS:
|
||||
lat_geod Geodetic latitude, radians, + = North
|
||||
alt C.G. altitude above mean sea level, ft
|
||||
sea_level_r radius from earth center to sea level at
|
||||
local vertical (surface normal) of C.G.
|
||||
|
||||
--------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#endif // _FG_GEODESY_HXX
|
||||
@@ -1,71 +0,0 @@
|
||||
// fg_random.c -- routines to handle random number generation
|
||||
//
|
||||
// Written by Curtis Olson, started July 1997.
|
||||
//
|
||||
// Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation; either version 2 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
// $Id$
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h> // for random(), srandom()
|
||||
#include <time.h> // for time() to seed srandom()
|
||||
|
||||
#include "fg_random.h"
|
||||
|
||||
#ifndef HAVE_RAND
|
||||
# ifdef sgi
|
||||
# undef RAND_MAX
|
||||
# define RAND_MAX 2147483647
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __SUNPRO_CC
|
||||
extern "C" {
|
||||
long int random(void);
|
||||
void srandom(unsigned int seed);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
// Seed the random number generater with time() so we don't see the
|
||||
// same sequence every time
|
||||
void fg_srandom(void) {
|
||||
// fgPrintf( FG_MATH, FG_INFO, "Seeding random number generater\n");
|
||||
|
||||
#ifdef HAVE_RAND
|
||||
srand(time(NULL));
|
||||
#else
|
||||
srandom(time(NULL));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
// return a random number between [0.0, 1.0)
|
||||
double fg_random(void) {
|
||||
#ifdef HAVE_RAND
|
||||
return(rand() / (double)RAND_MAX);
|
||||
#else
|
||||
return(random() / (double)RAND_MAX);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
// fg_random.h -- routines to handle random number generation
|
||||
//
|
||||
// Written by Curtis Olson, started July 1997.
|
||||
//
|
||||
// Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation; either version 2 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
// $Id$
|
||||
|
||||
|
||||
#ifndef _FG_RANDOM_H
|
||||
#define _FG_RANDOM_H
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
// Seed the random number generater with time() so we don't see the
|
||||
// same sequence every time
|
||||
void fg_srandom(void);
|
||||
|
||||
// return a random number between [0.0, 1.0)
|
||||
double fg_random(void);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif // _FG_RANDOM_H
|
||||
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
#include <Include/fg_constants.h>
|
||||
#include <Math/fg_geodesy.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
void
|
||||
main( void )
|
||||
{
|
||||
double Lon, Alt, sl_radius;
|
||||
double geodetic_Lat;
|
||||
double geocentric_Lat;
|
||||
|
||||
Lon = -87.75 * DEG_TO_RAD;
|
||||
geodetic_Lat = 41.83 * DEG_TO_RAD;
|
||||
Alt = 1.5; /* km */
|
||||
|
||||
printf("Geodetic position = (%.8f, %.8f, %.8f)\n", Lon, geodetic_Lat, Alt);
|
||||
|
||||
fgGeodToGeoc( geodetic_Lat, Alt, &sl_radius, &geocentric_Lat );
|
||||
|
||||
printf("Geocentric position = (%.8f, %.8f, %.8f)\n", Lon, geocentric_Lat,
|
||||
sl_radius + Alt);
|
||||
printf("new sl_radius = %.8f\n", sl_radius);
|
||||
|
||||
fgGeocToGeod( geocentric_Lat, sl_radius + Alt, &geodetic_Lat,
|
||||
&Alt, &sl_radius );
|
||||
|
||||
printf("Geodetic position = (%.8f, %.8f, %.8f)\n", Lon, geodetic_Lat, Alt);
|
||||
printf("new sl_radius = %.8f\n", sl_radius);
|
||||
}
|
||||
@@ -1,107 +0,0 @@
|
||||
//
|
||||
// interpolater.cxx -- routines to handle linear interpolation from a table of
|
||||
// x,y The table must be sorted by "x" in ascending order
|
||||
//
|
||||
// Written by Curtis Olson, started April 1998.
|
||||
//
|
||||
// Copyright (C) 1998 Curtis L. Olson - curt@me.umn.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 2 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
// $Id$
|
||||
|
||||
|
||||
#include <Include/compiler.h>
|
||||
|
||||
#ifdef __MWERKS__
|
||||
#include <stdlib.h> // for exit()
|
||||
#endif
|
||||
|
||||
#include STL_STRING
|
||||
|
||||
#include <Debug/logstream.hxx>
|
||||
#include <Include/fg_zlib.h>
|
||||
#include <Misc/fgstream.hxx>
|
||||
|
||||
#include "interpolater.hxx"
|
||||
|
||||
|
||||
// Constructor -- loads the interpolation table from the specified
|
||||
// file
|
||||
fgINTERPTABLE::fgINTERPTABLE( const string& file ) {
|
||||
FG_LOG( FG_MATH, FG_INFO, "Initializing Interpolator for " << file );
|
||||
|
||||
fg_gzifstream in( file );
|
||||
if ( !in ) {
|
||||
FG_LOG( FG_GENERAL, FG_ALERT, "Cannot open file: " << file );
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
size = 0;
|
||||
in >> skipcomment;
|
||||
while ( in ) {
|
||||
if ( size < MAX_TABLE_SIZE ) {
|
||||
in >> table[size][0] >> table[size][1];
|
||||
size++;
|
||||
} else {
|
||||
FG_LOG( FG_MATH, FG_ALERT,
|
||||
"fgInterpolateInit(): Exceed max table size = "
|
||||
<< MAX_TABLE_SIZE );
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Given an x value, linearly interpolate the y value from the table
|
||||
double fgINTERPTABLE::interpolate(double x) {
|
||||
int i;
|
||||
double y;
|
||||
|
||||
i = 0;
|
||||
|
||||
while ( (x > table[i][0]) && (i < size) ) {
|
||||
i++;
|
||||
}
|
||||
|
||||
// printf ("i = %d ", i);
|
||||
|
||||
if ( (i == 0) && (x < table[0][0]) ) {
|
||||
FG_LOG( FG_MATH, FG_ALERT,
|
||||
"fgInterpolateInit(): lookup error, x to small = " << x );
|
||||
return(0.0);
|
||||
}
|
||||
|
||||
if ( x > table[i][0] ) {
|
||||
FG_LOG( FG_MATH, FG_ALERT,
|
||||
"fgInterpolateInit(): lookup error, x to big = " << x );
|
||||
return(0.0);
|
||||
}
|
||||
|
||||
// y = y1 + (y0 - y1)(x - x1) / (x0 - x1)
|
||||
y = table[i][1] +
|
||||
( (table[i-1][1] - table[i][1]) *
|
||||
(x - table[i][0]) ) /
|
||||
(table[i-1][0] - table[i][0]);
|
||||
|
||||
return(y);
|
||||
}
|
||||
|
||||
|
||||
// Destructor
|
||||
fgINTERPTABLE::~fgINTERPTABLE( void ) {
|
||||
}
|
||||
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
//
|
||||
// interpolater.hxx -- routines to handle linear interpolation from a table of
|
||||
// x,y The table must be sorted by "x" in ascending order
|
||||
//
|
||||
// Written by Curtis Olson, started April 1998.
|
||||
//
|
||||
// Copyright (C) 1998 Curtis L. Olson - curt@me.umn.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 2 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
// $Id$
|
||||
|
||||
|
||||
#ifndef _INTERPOLATER_H
|
||||
#define _INTERPOLATER_H
|
||||
|
||||
|
||||
#ifndef __cplusplus
|
||||
# error This library requires C++
|
||||
#endif
|
||||
|
||||
#include "Include/compiler.h"
|
||||
|
||||
#include STL_STRING
|
||||
FG_USING_STD(string);
|
||||
|
||||
#define MAX_TABLE_SIZE 32
|
||||
|
||||
|
||||
class fgINTERPTABLE {
|
||||
int size;
|
||||
double table[MAX_TABLE_SIZE][2];
|
||||
|
||||
public:
|
||||
|
||||
// Constructor -- loads the interpolation table from the specified
|
||||
// file
|
||||
fgINTERPTABLE( const string& file );
|
||||
|
||||
// Given an x value, linearly interpolate the y value from the table
|
||||
double interpolate(double x);
|
||||
|
||||
// Destructor
|
||||
~fgINTERPTABLE( void );
|
||||
};
|
||||
|
||||
|
||||
#endif // _INTERPOLATER_H
|
||||
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <Debug/fg_debug.h>
|
||||
|
||||
#include "interpolater.hxx"
|
||||
|
||||
main() {
|
||||
fgINTERPTABLE test("test.table");
|
||||
|
||||
fgInitDebug();
|
||||
|
||||
printf("-1.0 = %.2f\n", test.interpolate(-1.0));
|
||||
printf("0.0 = %.2f\n", test.interpolate(0.0));
|
||||
printf("2.9 = %.2f\n", test.interpolate(2.9));
|
||||
printf("3.0 = %.2f\n", test.interpolate(3.0));
|
||||
printf("3.5 = %.2f\n", test.interpolate(3.5));
|
||||
printf("4.0 = %.2f\n", test.interpolate(4.0));
|
||||
printf("4.5 = %.2f\n", test.interpolate(4.5));
|
||||
printf("5.2 = %.2f\n", test.interpolate(5.2));
|
||||
printf("8.0 = %.2f\n", test.interpolate(8.0));
|
||||
printf("8.5 = %.2f\n", test.interpolate(8.5));
|
||||
printf("9.0 = %.2f\n", test.interpolate(9.0));
|
||||
printf("10.0 = %.2f\n", test.interpolate(10.0));
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
// leastsqs.h -- Implements a simple linear least squares best fit routine
|
||||
//
|
||||
// Written by Curtis Olson, started September 1997.
|
||||
//
|
||||
// Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
// $Id$
|
||||
///
|
||||
|
||||
|
||||
#ifndef _LEASTSQS_H
|
||||
#define _LEASTSQS_H
|
||||
|
||||
|
||||
#ifndef __cplusplus
|
||||
# error This library requires C++
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
Least squares fit:
|
||||
|
||||
y = b0 + b1x
|
||||
|
||||
n*sum(xi*yi) - (sum(xi)*sum(yi))
|
||||
b1 = --------------------------------
|
||||
n*sum(xi^2) - (sum(xi))^2
|
||||
|
||||
|
||||
b0 = sum(yi)/n - b1*(sum(xi)/n)
|
||||
*/
|
||||
|
||||
void least_squares(double *x, double *y, int n, double *m, double *b);
|
||||
|
||||
/* incrimentally update existing values with a new data point */
|
||||
void least_squares_update(double x, double y, double *m, double *b);
|
||||
|
||||
|
||||
/*
|
||||
return the least squares error:
|
||||
|
||||
(y[i] - y_hat[i])^2
|
||||
-------------------
|
||||
n
|
||||
*/
|
||||
double least_squares_error(double *x, double *y, int n, double m, double b);
|
||||
|
||||
|
||||
/*
|
||||
return the maximum least squares error:
|
||||
|
||||
(y[i] - y_hat[i])^2
|
||||
*/
|
||||
double least_squares_max_error(double *x, double *y, int n, double m, double b);
|
||||
|
||||
|
||||
#endif // _LEASTSQS_H
|
||||
|
||||
|
||||
233
Lib/Math/mat3.h
233
Lib/Math/mat3.h
@@ -1,233 +0,0 @@
|
||||
/* Copyright 1988, Brown Computer Graphics Group. All Rights Reserved. */
|
||||
|
||||
/* -------------------------------------------------------------------------
|
||||
Public MAT3 include file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#ifndef MAT3_HAS_BEEN_INCLUDED
|
||||
#define MAT3_HAS_BEEN_INCLUDED
|
||||
|
||||
/* ----------------------------- Constants ------------------------------ */
|
||||
|
||||
/*
|
||||
* Make sure the math library .h file is included, in case it wasn't.
|
||||
*/
|
||||
|
||||
#ifndef HUGE
|
||||
#include <math.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
|
||||
#include <string.h>
|
||||
#include "Include/fg_memory.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#define MAT3_DET0 -1 /* Indicates singular mat */
|
||||
#define MAT3_EPSILON 1e-12 /* Close enough to zero */
|
||||
|
||||
#ifdef M_PI
|
||||
# define MAT3_PI M_PI
|
||||
#else
|
||||
# define MAT3_PI 3.14159265358979323846
|
||||
#endif
|
||||
|
||||
#define USE_XTRA_MAT3_INLINES
|
||||
|
||||
#if defined(i386)
|
||||
#define USE_X86_ASM
|
||||
#endif
|
||||
|
||||
#if defined(USE_X86_ASM)
|
||||
static __inline__ int FloatToInt(float f)
|
||||
{
|
||||
int r;
|
||||
__asm__ ("fistpl %0" : "=m" (r) : "t" (f) : "st");
|
||||
return r;
|
||||
}
|
||||
#elif defined(__MSC__) && defined(__WIN32__)
|
||||
static __inline int FloatToInt(float f)
|
||||
{
|
||||
int r;
|
||||
_asm {
|
||||
fld f
|
||||
fistp r
|
||||
}
|
||||
return r;
|
||||
}
|
||||
#else
|
||||
#define FloatToInt(F) ((int) ((F) < 0.0f ? (F)-0.5f : (F)+0.5f))
|
||||
#endif
|
||||
|
||||
/* ------------------------------ Types --------------------------------- */
|
||||
|
||||
typedef double MAT3mat[4][4]; /* 4x4 matrix */
|
||||
typedef double MAT3vec[3]; /* Vector */
|
||||
typedef double MAT3hvec[4]; /* Vector with homogeneous coord */
|
||||
|
||||
/* ------------------------------ Macros -------------------------------- */
|
||||
|
||||
extern MAT3mat identityMatrix;
|
||||
|
||||
/* Tests if a number is within EPSILON of zero */
|
||||
#define MAT3_IS_ZERO(N) ((N) < MAT3_EPSILON && (N) > -MAT3_EPSILON)
|
||||
|
||||
/* Sets a vector to the three given values */
|
||||
#define MAT3_SET_VEC(V,X,Y,Z) ((V)[0]=(X), (V)[1]=(Y), (V)[2]=(Z))
|
||||
|
||||
/* Tests a vector for all components close to zero */
|
||||
#define MAT3_IS_ZERO_VEC(V) (MAT3_IS_ZERO((V)[0]) && \
|
||||
MAT3_IS_ZERO((V)[1]) && \
|
||||
MAT3_IS_ZERO((V)[2]))
|
||||
|
||||
/* Dot product of two vectors */
|
||||
#define MAT3_DOT_PRODUCT(V1,V2) \
|
||||
((V1)[0]*(V2)[0] + (V1)[1]*(V2)[1] + (V1)[2]*(V2)[2])
|
||||
|
||||
/* Copy one vector to other */
|
||||
#define MAT3_COPY_VEC(TO,FROM) ((TO)[0] = (FROM)[0], \
|
||||
(TO)[1] = (FROM)[1], \
|
||||
(TO)[2] = (FROM)[2])
|
||||
|
||||
/* Normalize vector to unit length, using TEMP as temporary variable.
|
||||
* TEMP will be zero if vector has zero length */
|
||||
#define MAT3_NORMALIZE_VEC(V,TEMP) \
|
||||
if ((TEMP = sqrt(MAT3_DOT_PRODUCT(V,V))) > MAT3_EPSILON) { \
|
||||
TEMP = 1.0 / TEMP; \
|
||||
MAT3_SCALE_VEC(V,V,TEMP); \
|
||||
} else TEMP = 0.0
|
||||
|
||||
/* Scale vector by given factor, storing result vector in RESULT_V */
|
||||
#define MAT3_SCALE_VEC(RESULT_V,V,SCALE) \
|
||||
MAT3_SET_VEC(RESULT_V, (V)[0]*(SCALE), (V)[1]*(SCALE), (V)[2]*(SCALE))
|
||||
|
||||
/* Adds vectors V1 and V2, storing result in RESULT_V */
|
||||
#define MAT3_ADD_VEC(RESULT_V,V1,V2) \
|
||||
MAT3_SET_VEC(RESULT_V, (V1)[0]+(V2)[0], (V1)[1]+(V2)[1], \
|
||||
(V1)[2]+(V2)[2])
|
||||
|
||||
/* Subtracts vector V2 from V1, storing result in RESULT_V */
|
||||
#define MAT3_SUB_VEC(RESULT_V,V1,V2) \
|
||||
MAT3_SET_VEC(RESULT_V, (V1)[0]-(V2)[0], (V1)[1]-(V2)[1], \
|
||||
(V1)[2]-(V2)[2])
|
||||
|
||||
/* Multiplies vectors V1 and V2, storing result in RESULT_V */
|
||||
#define MAT3_MULT_VEC(RESULT_V,V1,V2) \
|
||||
MAT3_SET_VEC(RESULT_V, (V1)[0]*(V2)[0], (V1)[1]*(V2)[1], \
|
||||
(V1)[2]*(V2)[2])
|
||||
|
||||
/* Sets RESULT_V to the linear combination of V1 and V2, scaled by
|
||||
* SCALE1 and SCALE2, respectively */
|
||||
#define MAT3_LINEAR_COMB(RESULT_V,SCALE1,V1,SCALE2,V2) \
|
||||
MAT3_SET_VEC(RESULT_V, (SCALE1)*(V1)[0] + (SCALE2)*(V2)[0], \
|
||||
(SCALE1)*(V1)[1] + (SCALE2)*(V2)[1], \
|
||||
(SCALE1)*(V1)[2] + (SCALE2)*(V2)[2])
|
||||
|
||||
/* Several of the vector macros are useful for homogeneous-coord vectors */
|
||||
#define MAT3_SET_HVEC(V,X,Y,Z,W) ((V)[0]=(X), (V)[1]=(Y), \
|
||||
(V)[2]=(Z), (V)[3]=(W))
|
||||
|
||||
#define MAT3_COPY_HVEC(TO,FROM) ((TO)[0] = (FROM)[0], \
|
||||
(TO)[1] = (FROM)[1], \
|
||||
(TO)[2] = (FROM)[2], \
|
||||
(TO)[3] = (FROM)[3])
|
||||
|
||||
#define MAT3_SCALE_HVEC(RESULT_V,V,SCALE) \
|
||||
MAT3_SET_HVEC(RESULT_V, (V)[0]*(SCALE), (V)[1]*(SCALE), \
|
||||
(V)[2]*(SCALE), (V)[3]*(SCALE))
|
||||
|
||||
#define MAT3_ADD_HVEC(RESULT_V,V1,V2) \
|
||||
MAT3_SET_HVEC(RESULT_V, (V1)[0]+(V2)[0], (V1)[1]+(V2)[1], \
|
||||
(V1)[2]+(V2)[2], (V1)[3]+(V2)[3])
|
||||
|
||||
#define MAT3_SUB_HVEC(RESULT_V,V1,V2) \
|
||||
MAT3_SET_HVEC(RESULT_V, (V1)[0]-(V2)[0], (V1)[1]-(V2)[1], \
|
||||
(V1)[2]-(V2)[2], (V1)[3]-(V2)[3])
|
||||
|
||||
#define MAT3_MULT_HVEC(RESULT_V,V1,V2) \
|
||||
MAT3_SET_HVEC(RESULT_V, (V1)[0]*(V2)[0], (V1)[1]*(V2)[1], \
|
||||
(V1)[2]*(V2)[2], (V1)[3]*(V2)[3])
|
||||
|
||||
/* ------------------------------ Entries ------------------------------- */
|
||||
|
||||
|
||||
#define MAT3identity(mat) fgmemcpy( mat, identityMatrix, sizeof(MAT3mat) )
|
||||
#define MAT3zero(mat) fgmemzero( mat, sizeof(MAT3mat) )
|
||||
#define MAT3copy(to, from) fgmemcpy( to, from, sizeof(MAT3mat) )
|
||||
|
||||
#if defined( USE_XTRA_MAT3_INLINES )
|
||||
|
||||
# define MAT3mult_vec( result_vec, vec, mat) { \
|
||||
MAT3vec tempvec; \
|
||||
tempvec[0]=vec[0]*mat[0][0]+vec[1]*mat[1][0]+vec[2]*mat[2][0]+mat[3][0]; \
|
||||
tempvec[1]=vec[0]*mat[0][1]+vec[1]*mat[1][1]+vec[2]*mat[2][1]+mat[3][1]; \
|
||||
tempvec[2]=vec[0]*mat[0][2]+vec[1]*mat[1][2]+vec[2]*mat[2][2]+mat[3][2]; \
|
||||
result_vec[0] = tempvec[0]; \
|
||||
result_vec[1] = tempvec[1]; \
|
||||
result_vec[2] = tempvec[2]; \
|
||||
}
|
||||
|
||||
# define MAT3cross_product(result_vec, vec1, vec2) { \
|
||||
MAT3vec tempvec; \
|
||||
tempvec[0] = vec1[1] * vec2[2] - vec1[2] * vec2[1]; \
|
||||
tempvec[1] = vec1[2] * vec2[0] - vec1[0] * vec2[2]; \
|
||||
tempvec[2] = vec1[0] * vec2[1] - vec1[1] * vec2[0]; \
|
||||
result_vec[0] = tempvec[0]; \
|
||||
result_vec[1] = tempvec[1]; \
|
||||
result_vec[2] = tempvec[2]; \
|
||||
}
|
||||
|
||||
# define MAT3mult( result_mat, mat1, mat2) { \
|
||||
register int i, j; \
|
||||
MAT3mat tmp_mat; \
|
||||
for (i = 0; i < 4; i++) \
|
||||
for (j = 0; j < 4; j++) \
|
||||
tmp_mat[i][j] = (mat1[i][0] * mat2[0][j] + \
|
||||
mat1[i][1] * mat2[1][j] + \
|
||||
mat1[i][2] * mat2[2][j] + \
|
||||
mat1[i][3] * mat2[3][j]); \
|
||||
fgmemcpy(result_mat, tmp_mat, sizeof(MAT3mat)); \
|
||||
}
|
||||
|
||||
#else // !defined( USE_XTRA_MAT3_INLINES )
|
||||
|
||||
/* In MAT3mat.c */
|
||||
void MAT3mult(MAT3mat result, MAT3mat, MAT3mat);
|
||||
void MAT3mult_vec(MAT3vec result_vec, MAT3vec vec, MAT3mat mat);
|
||||
void MAT3cross_product(MAT3vec result,MAT3vec,MAT3vec);
|
||||
|
||||
#endif // defined( USE_XTRA_MAT3_INLINES )
|
||||
|
||||
/* In MAT3geom.c */
|
||||
void MAT3direction_matrix (MAT3mat result_mat, MAT3mat mat);
|
||||
int MAT3normal_matrix (MAT3mat result_mat, MAT3mat mat);
|
||||
void MAT3rotate (MAT3mat result_mat, MAT3vec axis, double angle_in_radians);
|
||||
void MAT3translate (MAT3mat result_mat, MAT3vec trans);
|
||||
void MAT3scale (MAT3mat result_mat, MAT3vec scale);
|
||||
void MAT3shear(MAT3mat result_mat, double xshear, double yshear);
|
||||
|
||||
void MAT3transpose (MAT3mat result, MAT3mat);
|
||||
int MAT3invert (MAT3mat result, MAT3mat);
|
||||
void MAT3print (MAT3mat, FILE *fp);
|
||||
void MAT3print_formatted (MAT3mat, FILE *fp,
|
||||
char *title, char *head, char *format, char *tail);
|
||||
int MAT3equal( void );
|
||||
double MAT3trace( void );
|
||||
int MAT3power( void );
|
||||
int MAT3column_reduce( void );
|
||||
int MAT3kernel_basis( void );
|
||||
|
||||
/* In MAT3vec.c */
|
||||
int MAT3mult_hvec (MAT3hvec result_vec, MAT3hvec vec, MAT3mat mat, int normalize);
|
||||
void MAT3perp_vec(MAT3vec result_vec, MAT3vec vec, int is_unit);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* MAT3_HAS_BEEN_INCLUDED */
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
/* Copyright 1988, Brown Computer Graphics Group. All Rights Reserved. */
|
||||
|
||||
|
||||
#ifndef _MAT3DEFS_H
|
||||
#define _MAT3DEFS_H
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
/* #include <Math/mat3err.h> */
|
||||
#include <Math/mat3.h>
|
||||
|
||||
/* ----------------------------- Constants ------------------------------ */
|
||||
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
||||
#define CNULL ((char *) NULL)
|
||||
|
||||
/* ------------------------------ Macros -------------------------------- */
|
||||
|
||||
#define ALLOCN(P,T,N,M) \
|
||||
if ((P = (T *) malloc((unsigned) (N) * sizeof(T))) == NULL) \
|
||||
ERR_ERROR(MAT3_errid, ERR_FATAL, (ERR_ALLOC1, M)); \
|
||||
else
|
||||
|
||||
#define FREE(P) free((char *) (P))
|
||||
|
||||
#define ABS(A) ((A) > 0 ? (A) : -(A))
|
||||
#define MIN(A,B) ((A) < (B) ? (A) : (B))
|
||||
#define MAX(A,B) ((A) > (B) ? (A) : (B))
|
||||
|
||||
#define SWAP(A,B,T) (T = A, A = B, B = T)
|
||||
|
||||
/* Is N within EPS of zero ? */
|
||||
#define IS_ZERO(N,EPS) ((N) < EPS && (N) > -EPS)
|
||||
|
||||
/* Macros for lu routines */
|
||||
#define LU_PERMUTE(p,i,j) { int LU_T; LU_T = p[i]; p[i] = p[j]; p[j] = LU_T; }
|
||||
|
||||
/* ------------------------- Internal Entries ---------------------------- */
|
||||
|
||||
/* ------------------------- Global Variables ---------------------------- */
|
||||
|
||||
/* extern ERRid *MAT3_errid; */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _MAT3DEFS_H */
|
||||
@@ -1,41 +0,0 @@
|
||||
#ifndef _MAT3ERR_H
|
||||
#define _MAT3ERR_H
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#include "sph_errtypes.h"
|
||||
|
||||
#ifdef THINK_C
|
||||
/* We hide this from gnu's compiler, which doesn't understand it. */
|
||||
void SPH__error (int errtype, ...);
|
||||
#endif
|
||||
|
||||
|
||||
#define ERR_ERROR(A,B,C) \
|
||||
if (1) {char cstr[256]; sprintf C; SPH__error(ERR_MAT3_PACKAGE, cstr); } else
|
||||
|
||||
|
||||
#define ERR_S cstr,"%s\n"
|
||||
#define ERR_SI cstr,"%s: %d\n"
|
||||
#define ERR_SS cstr,"%s: %s\n"
|
||||
|
||||
#define ERR_SEVERE 0
|
||||
#define ERR_FATAL 0
|
||||
|
||||
#define ERR_ALLOC1 0
|
||||
|
||||
typedef int ERRid;
|
||||
|
||||
#define ERRregister_package(S) 100
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _MAT3ERR_H */
|
||||
@@ -1,61 +0,0 @@
|
||||
// polar.cxx -- routines to deal with polar math and transformations
|
||||
//
|
||||
// Written by Curtis Olson, started June 1997.
|
||||
//
|
||||
// Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation; either version 2 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
// $Id$
|
||||
|
||||
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <Include/fg_constants.h>
|
||||
|
||||
#include "polar3d.hxx"
|
||||
|
||||
|
||||
// Find the Altitude above the Ellipsoid (WGS84) given the Earth
|
||||
// Centered Cartesian coordinate vector Distances are specified in
|
||||
// meters.
|
||||
double fgGeodAltFromCart(const Point3D& cp)
|
||||
{
|
||||
double t_lat, x_alpha, mu_alpha;
|
||||
double lat_geoc, radius;
|
||||
double result;
|
||||
|
||||
lat_geoc = FG_PI_2 - atan2( sqrt(cp.x()*cp.x() + cp.y()*cp.y()), cp.z() );
|
||||
radius = sqrt( cp.x()*cp.x() + cp.y()*cp.y() + cp.z()*cp.z() );
|
||||
|
||||
if( ( (FG_PI_2 - lat_geoc) < ONE_SECOND ) // near North pole
|
||||
|| ( (FG_PI_2 + lat_geoc) < ONE_SECOND ) ) // near South pole
|
||||
{
|
||||
result = radius - EQUATORIAL_RADIUS_M*E;
|
||||
} else {
|
||||
t_lat = tan(lat_geoc);
|
||||
x_alpha = E*EQUATORIAL_RADIUS_M/sqrt(t_lat*t_lat + E*E);
|
||||
mu_alpha = atan2(sqrt(RESQ_M - x_alpha*x_alpha),E*x_alpha);
|
||||
if (lat_geoc < 0) {
|
||||
mu_alpha = - mu_alpha;
|
||||
}
|
||||
result = (radius - x_alpha/cos(lat_geoc))*cos(mu_alpha - lat_geoc);
|
||||
}
|
||||
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
// polar.hxx -- routines to deal with polar math and transformations
|
||||
//
|
||||
// Written by Curtis Olson, started June 1997.
|
||||
//
|
||||
// Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation; either version 2 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
// $Id$
|
||||
|
||||
|
||||
#ifndef _POLAR_HXX
|
||||
#define _POLAR_HXX
|
||||
|
||||
|
||||
#ifndef __cplusplus
|
||||
# error This library requires C++
|
||||
#endif
|
||||
|
||||
|
||||
#include <Include/fg_constants.h>
|
||||
#include <Math/point3d.hxx>
|
||||
|
||||
|
||||
// Find the Altitude above the Ellipsoid (WGS84) given the Earth
|
||||
// Centered Cartesian coordinate vector Distances are specified in
|
||||
// meters.
|
||||
double fgGeodAltFromCart(const Point3D& cp);
|
||||
|
||||
|
||||
// Convert a polar coordinate to a cartesian coordinate. Lon and Lat
|
||||
// must be specified in radians. The FG convention is for distances
|
||||
// to be specified in meters
|
||||
inline Point3D fgPolarToCart3d(const Point3D& p) {
|
||||
double tmp = cos( p.lat() ) * p.radius();
|
||||
|
||||
return Point3D( cos( p.lon() ) * tmp,
|
||||
sin( p.lon() ) * tmp,
|
||||
sin( p.lat() ) * p.radius() );
|
||||
}
|
||||
|
||||
|
||||
// Convert a cartesian coordinate to polar coordinates (lon/lat
|
||||
// specified in radians. Distances are specified in meters.
|
||||
inline Point3D fgCartToPolar3d(const Point3D& cp) {
|
||||
return Point3D( atan2( cp.y(), cp.x() ),
|
||||
FG_PI_2 -
|
||||
atan2( sqrt(cp.x()*cp.x() + cp.y()*cp.y()), cp.z() ),
|
||||
sqrt(cp.x()*cp.x() + cp.y()*cp.y() + cp.z()*cp.z()) );
|
||||
}
|
||||
|
||||
|
||||
#endif // _POLAR_HXX
|
||||
|
||||
|
||||
@@ -1,129 +0,0 @@
|
||||
// vector.cxx -- additional vector routines
|
||||
//
|
||||
// Written by Curtis Olson, started December 1997.
|
||||
//
|
||||
// Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation; either version 2 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
// $Id$
|
||||
|
||||
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
|
||||
// #include <Include/fg_types.h>
|
||||
|
||||
#include "vector.hxx"
|
||||
|
||||
#include "mat3.h"
|
||||
|
||||
|
||||
#if !defined( USE_XTRA_MAT3_INLINES )
|
||||
// Map a vector onto the plane specified by normal
|
||||
void map_vec_onto_cur_surface_plane(MAT3vec normal, MAT3vec v0, MAT3vec vec,
|
||||
MAT3vec result)
|
||||
{
|
||||
MAT3vec u1, v, tmp;
|
||||
|
||||
// calculate a vector "u1" representing the shortest distance from
|
||||
// the plane specified by normal and v0 to a point specified by
|
||||
// "vec". "u1" represents both the direction and magnitude of
|
||||
// this desired distance.
|
||||
|
||||
// u1 = ( (normal <dot> vec) / (normal <dot> normal) ) * normal
|
||||
|
||||
MAT3_SCALE_VEC( u1,
|
||||
normal,
|
||||
( MAT3_DOT_PRODUCT(normal, vec) /
|
||||
MAT3_DOT_PRODUCT(normal, normal)
|
||||
)
|
||||
);
|
||||
|
||||
// printf(" vec = %.2f, %.2f, %.2f\n", vec[0], vec[1], vec[2]);
|
||||
// printf(" v0 = %.2f, %.2f, %.2f\n", v0[0], v0[1], v0[2]);
|
||||
// printf(" u1 = %.2f, %.2f, %.2f\n", u1[0], u1[1], u1[2]);
|
||||
|
||||
// calculate the vector "v" which is the vector "vec" mapped onto
|
||||
// the plane specified by "normal" and "v0".
|
||||
|
||||
// v = v0 + vec - u1
|
||||
|
||||
MAT3_ADD_VEC(tmp, v0, vec);
|
||||
MAT3_SUB_VEC(v, tmp, u1);
|
||||
// printf(" v = %.2f, %.2f, %.2f\n", v[0], v[1], v[2]);
|
||||
|
||||
// Calculate the vector "result" which is "v" - "v0" which is a
|
||||
// directional vector pointing from v0 towards v
|
||||
|
||||
// result = v - v0
|
||||
|
||||
MAT3_SUB_VEC(result, v, v0);
|
||||
// printf(" result = %.2f, %.2f, %.2f\n",
|
||||
// result[0], result[1], result[2]);
|
||||
}
|
||||
#endif // !defined( USE_XTRA_MAT3_INLINES )
|
||||
|
||||
|
||||
// Given a point p, and a line through p0 with direction vector d,
|
||||
// find the shortest distance from the point to the line
|
||||
double fgPointLine(MAT3vec p, MAT3vec p0, MAT3vec d) {
|
||||
MAT3vec u, u1, v;
|
||||
double ud, dd, tmp;
|
||||
|
||||
// u = p - p0
|
||||
MAT3_SUB_VEC(u, p, p0);
|
||||
|
||||
// calculate the projection, u1, of u along d.
|
||||
// u1 = ( dot_prod(u, d) / dot_prod(d, d) ) * d;
|
||||
ud = MAT3_DOT_PRODUCT(u, d);
|
||||
dd = MAT3_DOT_PRODUCT(d, d);
|
||||
tmp = ud / dd;
|
||||
|
||||
MAT3_SCALE_VEC(u1, d, tmp);;
|
||||
|
||||
// v = u - u1 = vector from closest point on line, p1, to the
|
||||
// original point, p.
|
||||
MAT3_SUB_VEC(v, u, u1);
|
||||
|
||||
return sqrt(MAT3_DOT_PRODUCT(v, v));
|
||||
}
|
||||
|
||||
|
||||
// Given a point p, and a line through p0 with direction vector d,
|
||||
// find the shortest distance (squared) from the point to the line
|
||||
double fgPointLineSquared(MAT3vec p, MAT3vec p0, MAT3vec d) {
|
||||
MAT3vec u, u1, v;
|
||||
double ud, dd, tmp;
|
||||
|
||||
// u = p - p0
|
||||
MAT3_SUB_VEC(u, p, p0);
|
||||
|
||||
// calculate the projection, u1, of u along d.
|
||||
// u1 = ( dot_prod(u, d) / dot_prod(d, d) ) * d;
|
||||
ud = MAT3_DOT_PRODUCT(u, d);
|
||||
dd = MAT3_DOT_PRODUCT(d, d);
|
||||
tmp = ud / dd;
|
||||
|
||||
MAT3_SCALE_VEC(u1, d, tmp);;
|
||||
|
||||
// v = u - u1 = vector from closest point on line, p1, to the
|
||||
// original point, p.
|
||||
MAT3_SUB_VEC(v, u, u1);
|
||||
|
||||
return ( MAT3_DOT_PRODUCT(v, v) );
|
||||
}
|
||||
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
// vector.hxx -- additional vector routines
|
||||
//
|
||||
// Written by Curtis Olson, started December 1997.
|
||||
//
|
||||
// Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation; either version 2 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
// $Id$
|
||||
|
||||
|
||||
#ifndef _VECTOR_HXX
|
||||
#define _VECTOR_HXX
|
||||
|
||||
|
||||
#ifndef __cplusplus
|
||||
# error This library requires C++
|
||||
#endif
|
||||
|
||||
|
||||
#include "mat3.h"
|
||||
|
||||
|
||||
// Map a vector onto the plane specified by normal
|
||||
#if defined( USE_XTRA_MAT3_INLINES )
|
||||
# define map_vec_onto_cur_surface_plane(normal, v0, vec, result) { \
|
||||
double scale = ((normal[0]*vec[0]+normal[1]*vec[1]+normal[2]*vec[2]) / \
|
||||
(normal[0]*normal[0]+normal[1]*normal[1]+normal[2]*normal[2])); \
|
||||
result[0] = vec[0]-normal[0]*scale; \
|
||||
result[1] = vec[1]-normal[1]*scale; \
|
||||
result[2] = vec[2]-normal[2]*scale; \
|
||||
}
|
||||
#else
|
||||
void map_vec_onto_cur_surface_plane(MAT3vec normal, MAT3vec v0, MAT3vec vec,
|
||||
MAT3vec result);
|
||||
#endif //defined( USE_XTRA_MAT3_INLINES )
|
||||
|
||||
|
||||
// Given a point p, and a line through p0 with direction vector d,
|
||||
// find the shortest distance from the point to the line
|
||||
double fgPointLine(MAT3vec p, MAT3vec p0, MAT3vec d);
|
||||
|
||||
|
||||
// Given a point p, and a line through p0 with direction vector d,
|
||||
// find the shortest distance (squared) from the point to the line
|
||||
double fgPointLineSquared(MAT3vec p, MAT3vec p0, MAT3vec d);
|
||||
|
||||
|
||||
#endif // _VECTOR_HXX
|
||||
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
The following files were unashamedly borrowed from other projects:
|
||||
|
||||
zfstream.hxx
|
||||
zfstream.cxx
|
||||
zlib/contrib/iostream
|
||||
|
||||
stopwatch.hxx was (blitz/time.h)
|
||||
blitz
|
||||
|
||||
Some modifications have been made to fit in with the FlightGear scheme of things.
|
||||
|
||||
As far as I'm aware they are all covered by GNU's licensing agreements.
|
||||
|
||||
Many thanks to their respective authors.
|
||||
|
||||
Bernie Bright (bbright@c031.aone.net.au)
|
||||
@@ -1,12 +0,0 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
noinst_LIBRARIES = libMisc.a
|
||||
|
||||
libMisc_a_SOURCES = \
|
||||
fgpath.cxx fgpath.hxx \
|
||||
fgstream.cxx fgstream.hxx \
|
||||
stopwatch.hxx \
|
||||
strutils.cxx strutils.hxx \
|
||||
zfstream.cxx zfstream.hxx
|
||||
|
||||
INCLUDES += -I$(top_builddir) -I$(top_builddir)/Lib
|
||||
@@ -1,101 +0,0 @@
|
||||
//
|
||||
// fgpath.cxx -- routines to abstract out path separator differences
|
||||
// between MacOS and the rest of the world
|
||||
//
|
||||
// Written by Curtis L. Olson, started April 1999.
|
||||
//
|
||||
// Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation; either version 2 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
// $Id$
|
||||
|
||||
|
||||
#include "fgpath.hxx"
|
||||
|
||||
|
||||
// If Unix, replace all ":" with "/". If MacOS, replace all "/" with
|
||||
// ":" it should go without saying that neither of these characters
|
||||
// should be used in file or directory names. In windoze, allow the
|
||||
// second character to be a ":" for things like c:\foo\bar
|
||||
|
||||
static string fix_path( const string path ) {
|
||||
string result = path;
|
||||
|
||||
for ( int i = 0; i < (int)path.size(); ++i ) {
|
||||
#if defined( WIN32 )
|
||||
// for windoze, don't replace the ":" for the second character
|
||||
if ( i == 1 ) {
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
if ( result[i] == FG_BAD_PATH_SEP ) {
|
||||
result[i] = FG_PATH_SEP;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
// default constructor
|
||||
FGPath::FGPath() {
|
||||
path = "";
|
||||
}
|
||||
|
||||
|
||||
// create a path based on "path"
|
||||
FGPath::FGPath( const string p ) {
|
||||
set( p );
|
||||
}
|
||||
|
||||
|
||||
// destructor
|
||||
FGPath::~FGPath() {
|
||||
}
|
||||
|
||||
|
||||
// set path
|
||||
void FGPath::set( const string p ) {
|
||||
path = fix_path( p );
|
||||
}
|
||||
|
||||
|
||||
// append another piece to the existing path
|
||||
void FGPath::append( const string p ) {
|
||||
string part = fix_path( p );
|
||||
|
||||
if ( path.size() == 0 ) {
|
||||
path = part;
|
||||
} else {
|
||||
if ( part[0] != FG_PATH_SEP ) {
|
||||
path += FG_PATH_SEP;
|
||||
}
|
||||
path += part;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// concatenate a string to the end of the path without inserting a
|
||||
// path separator
|
||||
void FGPath::concat( const string p ) {
|
||||
string part = fix_path( p );
|
||||
|
||||
if ( path.size() == 0 ) {
|
||||
path = part;
|
||||
} else {
|
||||
path += part;
|
||||
}
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
//
|
||||
// fgpath.hxx -- routines to abstract out path separator differences
|
||||
// between MacOS and the rest of the world
|
||||
//
|
||||
// Written by Curtis L. Olson, started April 1999.
|
||||
//
|
||||
// Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation; either version 2 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
// $Id$
|
||||
|
||||
|
||||
#ifndef _FGPATH_HXX
|
||||
#define _FGPATH_HXX
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <Include/compiler.h>
|
||||
|
||||
#include STL_STRING
|
||||
|
||||
FG_USING_STD(string);
|
||||
|
||||
|
||||
#ifdef MACOS
|
||||
# define FG_PATH_SEP ':'
|
||||
# define FG_BAD_PATH_SEP '/'
|
||||
#else
|
||||
# define FG_PATH_SEP '/'
|
||||
# define FG_BAD_PATH_SEP ':'
|
||||
#endif
|
||||
|
||||
|
||||
class FGPath {
|
||||
|
||||
private:
|
||||
|
||||
string path;
|
||||
|
||||
public:
|
||||
|
||||
// default constructor
|
||||
FGPath();
|
||||
|
||||
// create a path based on "path"
|
||||
FGPath( const string p );
|
||||
|
||||
// destructor
|
||||
~FGPath();
|
||||
|
||||
// set path
|
||||
void set( const string p );
|
||||
|
||||
// append another piece to the existing path
|
||||
void append( const string p );
|
||||
|
||||
// concatenate a string to the end of the path without inserting a
|
||||
// path separator
|
||||
void concat( const string p );
|
||||
|
||||
// get the path string
|
||||
inline string str() const { return path; }
|
||||
inline const char *c_str() { return path.c_str(); }
|
||||
};
|
||||
|
||||
|
||||
#endif // _FGPATH_HXX
|
||||
|
||||
|
||||
@@ -1,102 +0,0 @@
|
||||
// zlib input file stream wrapper.
|
||||
//
|
||||
// Written by Bernie Bright, 1998
|
||||
//
|
||||
// Copyright (C) 1998 Bernie Bright - bbright@c031.aone.net.au
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation; either version 2 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
// $Id$
|
||||
|
||||
#ifndef _FGSTREAM_HXX
|
||||
#define _FGSTREAM_HXX
|
||||
|
||||
#ifndef __cplusplus
|
||||
# error This library requires C++
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "Include/config.h"
|
||||
#endif
|
||||
|
||||
#include <Include/compiler.h>
|
||||
|
||||
#if defined( FG_HAVE_STD_INCLUDES )
|
||||
# include <istream>
|
||||
#elif defined ( FG_HAVE_NATIVE_SGI_COMPILERS )
|
||||
# include <CC/stream.h>
|
||||
#elif defined ( __BORLANDC__ )
|
||||
# include <iostream>
|
||||
#else
|
||||
# include <istream.h>
|
||||
#endif
|
||||
|
||||
#include STL_STRING
|
||||
|
||||
#include "zfstream.hxx"
|
||||
|
||||
FG_USING_STD(string);
|
||||
|
||||
#ifndef FG_HAVE_NATIVE_SGI_COMPILERS
|
||||
FG_USING_STD(istream);
|
||||
#endif
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Envelope class for gzifstream.
|
||||
//
|
||||
class fg_gzifstream : private gzifstream_base, public istream
|
||||
{
|
||||
public:
|
||||
//
|
||||
fg_gzifstream();
|
||||
|
||||
// Attempt to open a file with and without ".gz" extension.
|
||||
fg_gzifstream( const string& name,
|
||||
ios_openmode io_mode = ios_in | ios_binary );
|
||||
|
||||
//
|
||||
fg_gzifstream( int fd, ios_openmode io_mode = ios_in|ios_binary );
|
||||
|
||||
// Attempt to open a file with and without ".gz" extension.
|
||||
void open( const string& name,
|
||||
ios_openmode io_mode = ios_in|ios_binary );
|
||||
|
||||
void attach( int fd, ios_openmode io_mode = ios_in|ios_binary );
|
||||
|
||||
void close() { gzbuf.close(); }
|
||||
|
||||
bool is_open() { return gzbuf.is_open(); }
|
||||
|
||||
private:
|
||||
// Not defined!
|
||||
fg_gzifstream( const fg_gzifstream& );
|
||||
void operator= ( const fg_gzifstream& );
|
||||
};
|
||||
|
||||
// istream manipulator that skips to end of line.
|
||||
istream& skipeol( istream& in );
|
||||
|
||||
// istream manipulator that skips over white space.
|
||||
istream& skipws( istream& in );
|
||||
|
||||
// istream manipulator that skips comments and white space.
|
||||
// A comment starts with '#'.
|
||||
istream& skipcomment( istream& in );
|
||||
|
||||
|
||||
#endif /* _FGSTREAM_HXX */
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
// String utilities.
|
||||
//
|
||||
// Written by Bernie Bright, 1998
|
||||
//
|
||||
// Copyright (C) 1998 Bernie Bright - bbright@c031.aone.net.au
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation; either version 2 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
// $Id$
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include "strutils.hxx"
|
||||
|
||||
const string whitespace = " \n\r\t";
|
||||
|
||||
//
|
||||
string
|
||||
trimleft( const string& s, const string& trimmings )
|
||||
{
|
||||
string result;
|
||||
string::size_type pos = s.find_first_not_of( trimmings );
|
||||
if ( pos != string::npos )
|
||||
{
|
||||
result.assign( s.substr( pos ) );
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
string
|
||||
trimright( const string& s, const string& trimmings )
|
||||
{
|
||||
string result;
|
||||
|
||||
string::size_type pos = s.find_last_not_of( trimmings );
|
||||
if ( pos == string::npos )
|
||||
{
|
||||
// Not found, return the original string.
|
||||
result = s;
|
||||
}
|
||||
else
|
||||
{
|
||||
result.assign( s.substr( 0, pos+1 ) );
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
string
|
||||
trim( const string& s, const string& trimmings )
|
||||
{
|
||||
return trimright( trimleft( s, trimmings ), trimmings );
|
||||
}
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
// String utilities.
|
||||
//
|
||||
// Written by Bernie Bright, 1998
|
||||
//
|
||||
// Copyright (C) 1998 Bernie Bright - bbright@c031.aone.net.au
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation; either version 2 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
// $Id$
|
||||
|
||||
#ifndef STRUTILS_H
|
||||
#define STRUTILS_H
|
||||
|
||||
#include <Include/compiler.h>
|
||||
#include STL_STRING
|
||||
|
||||
#ifdef FG_HAVE_STD_INCLUDES
|
||||
# include <cstdlib>
|
||||
#else
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
FG_USING_STD(string);
|
||||
|
||||
// Default characters to remove.
|
||||
extern const string whitespace;
|
||||
|
||||
// Returns a string with trailing characters removed.
|
||||
string trimleft( const string& s, const string& trimmings = whitespace );
|
||||
|
||||
// Returns a string with leading characters removed.
|
||||
string trimright( const string& s, const string& trimmings = whitespace );
|
||||
|
||||
// Returns a string with leading and trailing characters removed.
|
||||
string trim( const string& s, const string& trimmings = whitespace );
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
inline double
|
||||
atof( const string& str )
|
||||
{
|
||||
return ::atof( str.c_str() );
|
||||
}
|
||||
|
||||
inline int
|
||||
atoi( const string& str )
|
||||
{
|
||||
return ::atoi( str.c_str() );
|
||||
}
|
||||
|
||||
#endif // STRUTILS_H
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
bin_PROGRAMS = testserial
|
||||
|
||||
noinst_LIBRARIES = libSerial.a
|
||||
|
||||
libSerial_a_SOURCES = serial.cxx serial.hxx
|
||||
|
||||
testserial_SOURCES = testserial.cxx
|
||||
|
||||
testserial_LDADD = \
|
||||
$(top_builddir)/Lib/Serial/libSerial.a \
|
||||
$(top_builddir)/Lib/Debug/libDebug.a
|
||||
|
||||
INCLUDES += -I$(top_builddir) -I$(top_builddir)/Lib
|
||||
@@ -1,336 +0,0 @@
|
||||
// serial.cxx -- Unix serial I/O support
|
||||
//
|
||||
// Written by Curtis Olson, started November 1998.
|
||||
//
|
||||
// Copyright (C) 1998 Curtis L. Olson - curt@flightgear.org
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation; either version 2 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
// $Id$
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include "Include/compiler.h"
|
||||
#ifdef FG_HAVE_STD_INCLUDE
|
||||
# include <cerrno>
|
||||
#else
|
||||
# include <errno.h>
|
||||
#endif
|
||||
|
||||
#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
|
||||
// maybe include something???
|
||||
#else
|
||||
# include <termios.h>
|
||||
# include <sys/types.h>
|
||||
# include <sys/stat.h>
|
||||
# include <fcntl.h>
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <Debug/logstream.hxx>
|
||||
|
||||
#include "serial.hxx"
|
||||
|
||||
|
||||
fgSERIAL::fgSERIAL()
|
||||
: dev_open(false)
|
||||
{
|
||||
// empty
|
||||
}
|
||||
|
||||
fgSERIAL::fgSERIAL(const string& device, int baud) {
|
||||
open_port(device);
|
||||
|
||||
if ( dev_open ) {
|
||||
set_baud(baud);
|
||||
}
|
||||
}
|
||||
|
||||
fgSERIAL::~fgSERIAL() {
|
||||
// closing the port here screws us up because if we would even so
|
||||
// much as make a copy of an fgSERIAL object and then delete it,
|
||||
// the file descriptor gets closed. Doh!!!
|
||||
}
|
||||
|
||||
bool fgSERIAL::open_port(const string& device) {
|
||||
|
||||
#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
|
||||
|
||||
fd = CreateFile( device.c_str(),
|
||||
GENERIC_READ | GENERIC_WRITE,
|
||||
0, // dwShareMode
|
||||
NULL, // lpSecurityAttributes
|
||||
OPEN_EXISTING,
|
||||
FILE_FLAG_OVERLAPPED,
|
||||
NULL );
|
||||
if ( fd == INVALID_HANDLE_VALUE )
|
||||
{
|
||||
LPVOID lpMsgBuf;
|
||||
FormatMessage(
|
||||
FORMAT_MESSAGE_ALLOCATE_BUFFER |
|
||||
FORMAT_MESSAGE_FROM_SYSTEM |
|
||||
FORMAT_MESSAGE_IGNORE_INSERTS,
|
||||
NULL,
|
||||
GetLastError(),
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
|
||||
(LPTSTR) &lpMsgBuf,
|
||||
0,
|
||||
NULL );
|
||||
|
||||
FG_LOG( FG_SERIAL, FG_ALERT, "Error opening serial device \""
|
||||
<< device << "\" " << (const char*) lpMsgBuf );
|
||||
LocalFree( lpMsgBuf );
|
||||
return false;
|
||||
}
|
||||
|
||||
dev_open = true;
|
||||
return true;
|
||||
|
||||
#else
|
||||
|
||||
struct termios config;
|
||||
|
||||
fd = open(device.c_str(), O_RDWR | O_NONBLOCK);
|
||||
cout << "Serial fd created = " << fd << endl;
|
||||
|
||||
if ( fd == -1 ) {
|
||||
FG_LOG( FG_SERIAL, FG_ALERT, "Cannot open " << device
|
||||
<< " for serial I/O" );
|
||||
return false;
|
||||
} else {
|
||||
dev_open = true;
|
||||
}
|
||||
|
||||
// set required port parameters
|
||||
if ( tcgetattr( fd, &config ) != 0 ) {
|
||||
FG_LOG( FG_SERIAL, FG_ALERT, "Unable to poll port settings" );
|
||||
return false;
|
||||
}
|
||||
|
||||
// cfmakeraw( &config );
|
||||
|
||||
// cout << "config.c_iflag = " << config.c_iflag << endl;
|
||||
|
||||
// software flow control on
|
||||
config.c_iflag |= IXON;
|
||||
// config.c_iflag |= IXOFF;
|
||||
|
||||
// config.c_cflag |= CLOCAL;
|
||||
|
||||
#if ! defined( sgi )
|
||||
// disable hardware flow control
|
||||
config.c_cflag &= ~(CRTSCTS);
|
||||
#endif
|
||||
|
||||
// cout << "config.c_iflag = " << config.c_iflag << endl;
|
||||
|
||||
if ( tcsetattr( fd, TCSANOW, &config ) != 0 ) {
|
||||
FG_LOG( FG_SERIAL, FG_ALERT, "Unable to update port settings" );
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
bool fgSERIAL::close_port() {
|
||||
#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
|
||||
CloseHandle( fd );
|
||||
#else
|
||||
close(fd);
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool fgSERIAL::set_baud(int baud) {
|
||||
|
||||
#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
|
||||
|
||||
return true;
|
||||
|
||||
#else
|
||||
|
||||
struct termios config;
|
||||
speed_t speed = B9600;
|
||||
|
||||
if ( tcgetattr( fd, &config ) != 0 ) {
|
||||
FG_LOG( FG_SERIAL, FG_ALERT, "Unable to poll port settings" );
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( baud == 300 ) {
|
||||
speed = B300;
|
||||
} else if ( baud == 1200 ) {
|
||||
speed = B1200;
|
||||
} else if ( baud == 2400 ) {
|
||||
speed = B2400;
|
||||
} else if ( baud == 4800 ) {
|
||||
speed = B4800;
|
||||
} else if ( baud == 9600 ) {
|
||||
speed = B9600;
|
||||
} else if ( baud == 19200 ) {
|
||||
speed = B19200;
|
||||
} else if ( baud == 38400 ) {
|
||||
speed = B38400;
|
||||
} else if ( baud == 57600 ) {
|
||||
speed = B57600;
|
||||
} else if ( baud == 115200 ) {
|
||||
speed = B115200;
|
||||
#if defined( linux ) || defined( __FreeBSD__ )
|
||||
} else if ( baud == 230400 ) {
|
||||
speed = B230400;
|
||||
#endif
|
||||
} else {
|
||||
FG_LOG( FG_SERIAL, FG_ALERT, "Unsupported baud rate " << baud );
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( cfsetispeed( &config, speed ) != 0 ) {
|
||||
FG_LOG( FG_SERIAL, FG_ALERT, "Problem setting input baud rate" );
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( cfsetospeed( &config, speed ) != 0 ) {
|
||||
FG_LOG( FG_SERIAL, FG_ALERT, "Problem setting output baud rate" );
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( tcsetattr( fd, TCSANOW, &config ) != 0 ) {
|
||||
FG_LOG( FG_SERIAL, FG_ALERT, "Unable to update port settings" );
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
string fgSERIAL::read_port() {
|
||||
|
||||
#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
|
||||
|
||||
string result = "";
|
||||
return result;
|
||||
|
||||
#else
|
||||
|
||||
const int max_count = 1024;
|
||||
char buffer[max_count+1];
|
||||
int count;
|
||||
string result;
|
||||
|
||||
count = read(fd, buffer, max_count);
|
||||
// cout << "read " << count << " bytes" << endl;
|
||||
|
||||
if ( count < 0 ) {
|
||||
// error condition
|
||||
if ( errno != EAGAIN ) {
|
||||
FG_LOG( FG_SERIAL, FG_ALERT,
|
||||
"Serial I/O on read, error number = " << errno );
|
||||
}
|
||||
|
||||
return "";
|
||||
} else {
|
||||
buffer[count] = '\0';
|
||||
result = buffer;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
int fgSERIAL::write_port(const string& value) {
|
||||
|
||||
#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
|
||||
|
||||
LPCVOID lpBuffer = value.c_str();
|
||||
DWORD nNumberOfBytesToWrite = value.length();
|
||||
DWORD lpNumberOfBytesWritten;
|
||||
OVERLAPPED lpOverlapped;
|
||||
|
||||
if ( WriteFile( fd,
|
||||
lpBuffer,
|
||||
nNumberOfBytesToWrite,
|
||||
&lpNumberOfBytesWritten,
|
||||
&lpOverlapped ) == 0 )
|
||||
{
|
||||
LPVOID lpMsgBuf;
|
||||
FormatMessage(
|
||||
FORMAT_MESSAGE_ALLOCATE_BUFFER |
|
||||
FORMAT_MESSAGE_FROM_SYSTEM |
|
||||
FORMAT_MESSAGE_IGNORE_INSERTS,
|
||||
NULL,
|
||||
GetLastError(),
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
|
||||
(LPTSTR) &lpMsgBuf,
|
||||
0,
|
||||
NULL );
|
||||
|
||||
FG_LOG( FG_SERIAL, FG_ALERT, "Serial I/O write error: "
|
||||
<< (const char*) lpMsgBuf );
|
||||
LocalFree( lpMsgBuf );
|
||||
return int(lpNumberOfBytesWritten);
|
||||
}
|
||||
|
||||
return int(lpNumberOfBytesWritten);
|
||||
|
||||
#else
|
||||
|
||||
static bool error = false;
|
||||
int count;
|
||||
|
||||
if ( error ) {
|
||||
// attempt some sort of error recovery
|
||||
count = write(fd, "\n", 1);
|
||||
if ( count == 1 ) {
|
||||
// cout << "Serial error recover successful!\n";
|
||||
error = false;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
count = write(fd, value.c_str(), value.length());
|
||||
// cout << "write '" << value << "' " << count << " bytes" << endl;
|
||||
|
||||
if ( (int)count == (int)value.length() ) {
|
||||
error = false;
|
||||
} else {
|
||||
error = true;
|
||||
if ( errno == EAGAIN ) {
|
||||
// ok ... in our context we don't really care if we can't
|
||||
// write a string, we'll just get it the next time around
|
||||
} else {
|
||||
FG_LOG( FG_SERIAL, FG_ALERT,
|
||||
"Serial I/O on write, error number = " << errno );
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
// serial.hxx -- Unix serial I/O support
|
||||
//
|
||||
// Written by Curtis Olson, started November 1998.
|
||||
//
|
||||
// Copyright (C) 1998 Curtis L. Olson - curt@flightgear.org
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation; either version 2 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
// $Id$
|
||||
|
||||
|
||||
#ifndef _SERIAL_HXX
|
||||
#define _SERIAL_HXX
|
||||
|
||||
|
||||
#ifndef __cplusplus
|
||||
# error This library requires C++
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <Include/compiler.h>
|
||||
#include STL_STRING
|
||||
FG_USING_STD(string);
|
||||
|
||||
// if someone know how to do this all with C++ streams let me know
|
||||
// #include <stdio.h>
|
||||
|
||||
|
||||
class fgSERIAL
|
||||
{
|
||||
#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
|
||||
typedef HANDLE fd_type;
|
||||
#else
|
||||
typedef int fd_type;
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
||||
fd_type fd;
|
||||
bool dev_open;
|
||||
|
||||
public:
|
||||
|
||||
fgSERIAL();
|
||||
fgSERIAL(const string& device, int baud);
|
||||
|
||||
~fgSERIAL();
|
||||
|
||||
bool open_port(const string& device);
|
||||
bool close_port();
|
||||
bool set_baud(int baud);
|
||||
string read_port();
|
||||
int write_port(const string& value);
|
||||
|
||||
inline bool is_enabled() { return dev_open; }
|
||||
};
|
||||
|
||||
|
||||
#endif // _SERIAL_HXX
|
||||
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
lib_LIBRARIES = libXGL.a
|
||||
|
||||
libXGL_a_SOURCES = xgl.c xgl.h xglUtils.c
|
||||
|
||||
INCLUDES += -I$(top_builddir) -I$(top_builddir)/Simulator
|
||||
3034
Lib/XGL/xgl.c
3034
Lib/XGL/xgl.c
File diff suppressed because it is too large
Load Diff
837
Lib/XGL/xgl.h
837
Lib/XGL/xgl.h
@@ -1,837 +0,0 @@
|
||||
#ifndef _XGL_H
|
||||
#define _XGL_H
|
||||
|
||||
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glu.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* xgl Utilities */
|
||||
|
||||
extern FILE *xglTraceFd ;
|
||||
|
||||
int xglTraceIsEnabled ( char *gl_function_name ) ;
|
||||
int xglExecuteIsEnabled ( char *gl_function_name ) ;
|
||||
char *xglExpandGLenum ( GLenum x ) ;
|
||||
|
||||
GLdouble *xglBuild1dv ( GLdouble v ) ;
|
||||
GLfloat *xglBuild1fv ( GLfloat v ) ;
|
||||
GLbyte *xglBuild1bv ( GLbyte v ) ;
|
||||
GLint *xglBuild1iv ( GLint v ) ;
|
||||
GLshort *xglBuild1sv ( GLshort v ) ;
|
||||
GLubyte *xglBuild1ubv ( GLubyte v ) ;
|
||||
GLuint *xglBuild1uiv ( GLuint v ) ;
|
||||
GLushort *xglBuild1usv ( GLushort v ) ;
|
||||
|
||||
GLdouble *xglBuild2dv ( GLdouble v0, GLdouble v1 ) ;
|
||||
GLfloat *xglBuild2fv ( GLfloat v0, GLfloat v1 ) ;
|
||||
GLbyte *xglBuild2bv ( GLbyte v0, GLbyte v1 ) ;
|
||||
GLint *xglBuild2iv ( GLint v0, GLint v1 ) ;
|
||||
GLshort *xglBuild2sv ( GLshort v0, GLshort v1 ) ;
|
||||
GLubyte *xglBuild2ubv ( GLubyte v0, GLubyte v1 ) ;
|
||||
GLuint *xglBuild2uiv ( GLuint v0, GLuint v1 ) ;
|
||||
GLushort *xglBuild2usv ( GLushort v0, GLushort v1 ) ;
|
||||
|
||||
GLdouble *xglBuild3dv ( GLdouble v0, GLdouble v1, GLdouble v2 ) ;
|
||||
GLfloat *xglBuild3fv ( GLfloat v0, GLfloat v1, GLfloat v2 ) ;
|
||||
GLbyte *xglBuild3bv ( GLbyte v0, GLbyte v1, GLbyte v2 ) ;
|
||||
GLint *xglBuild3iv ( GLint v0, GLint v1, GLint v2 ) ;
|
||||
GLshort *xglBuild3sv ( GLshort v0, GLshort v1, GLshort v2 ) ;
|
||||
GLubyte *xglBuild3ubv ( GLubyte v0, GLubyte v1, GLubyte v2 ) ;
|
||||
GLuint *xglBuild3uiv ( GLuint v0, GLuint v1, GLuint v2 ) ;
|
||||
GLushort *xglBuild3usv ( GLushort v0, GLushort v1, GLushort v2 ) ;
|
||||
|
||||
GLdouble *xglBuild4dv ( GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3 ) ;
|
||||
GLfloat *xglBuild4fv ( GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3 ) ;
|
||||
GLbyte *xglBuild4bv ( GLbyte v0, GLbyte v1, GLbyte v2, GLbyte v3 ) ;
|
||||
GLint *xglBuild4iv ( GLint v0, GLint v1, GLint v2, GLint v3 ) ;
|
||||
GLshort *xglBuild4sv ( GLshort v0, GLshort v1, GLshort v2, GLshort v3 ) ;
|
||||
GLubyte *xglBuild4ubv ( GLubyte v0, GLubyte v1, GLubyte v2, GLubyte v3 ) ;
|
||||
GLuint *xglBuild4uiv ( GLuint v0, GLuint v1, GLuint v2, GLuint v3 ) ;
|
||||
GLushort *xglBuild4usv ( GLushort v0, GLushort v1, GLushort v2, GLushort v3 ) ;
|
||||
|
||||
GLfloat *xglBuildMatrixf ( GLfloat m0 , GLfloat m1 , GLfloat m2 , GLfloat m3 ,
|
||||
GLfloat m4 , GLfloat m5 , GLfloat m6 , GLfloat m7 ,
|
||||
GLfloat m8 , GLfloat m9 , GLfloat m10, GLfloat m11,
|
||||
GLfloat m12, GLfloat m13, GLfloat m14, GLfloat m15 ) ;
|
||||
|
||||
GLdouble *xglBuildMatrixd ( GLdouble m0 , GLdouble m1 , GLdouble m2 , GLdouble m3 ,
|
||||
GLdouble m4 , GLdouble m5 , GLdouble m6 , GLdouble m7 ,
|
||||
GLdouble m8 , GLdouble m9 , GLdouble m10, GLdouble m11,
|
||||
GLdouble m12, GLdouble m13, GLdouble m14, GLdouble m15 ) ;
|
||||
|
||||
/*
|
||||
Conditionally compile all 'xgl' calls into standard 'gl' calls...
|
||||
|
||||
OR
|
||||
|
||||
Declare all possible 'xgl' calls as 'extern'.
|
||||
*/
|
||||
|
||||
#ifndef XGL_TRACE
|
||||
|
||||
#define xglAccum glAccum
|
||||
#define xglAlphaFunc glAlphaFunc
|
||||
#ifdef GL_EXT_vertex_array
|
||||
#define xglArrayElementEXT glArrayElementEXT
|
||||
#endif
|
||||
#define xglBegin glBegin
|
||||
#define xglBitmap glBitmap
|
||||
#ifdef GL_EXT_blend_color
|
||||
#define xglBlendColorEXT glBlendColorEXT
|
||||
#endif
|
||||
#ifdef GL_EXT_blend_minmax
|
||||
#define xglBlendEquationEXT glBlendEquationEXT
|
||||
#endif
|
||||
#define xglBlendFunc glBlendFunc
|
||||
#define xglCallList glCallList
|
||||
#define xglCallLists glCallLists
|
||||
#define xglClear glClear
|
||||
#define xglClearAccum glClearAccum
|
||||
#define xglClearColor glClearColor
|
||||
#define xglClearDepth glClearDepth
|
||||
#define xglClearIndex glClearIndex
|
||||
#define xglClearStencil glClearStencil
|
||||
#define xglClipPlane glClipPlane
|
||||
#define xglColor3b glColor3b
|
||||
#define xglColor3bv glColor3bv
|
||||
#define xglColor3d glColor3d
|
||||
#define xglColor3dv glColor3dv
|
||||
#define xglColor3f glColor3f
|
||||
#define xglColor3fv glColor3fv
|
||||
#define xglColor3i glColor3i
|
||||
#define xglColor3iv glColor3iv
|
||||
#define xglColor3s glColor3s
|
||||
#define xglColor3sv glColor3sv
|
||||
#define xglColor3ub glColor3ub
|
||||
#define xglColor3ubv glColor3ubv
|
||||
#define xglColor3ui glColor3ui
|
||||
#define xglColor3uiv glColor3uiv
|
||||
#define xglColor3us glColor3us
|
||||
#define xglColor3usv glColor3usv
|
||||
#define xglColor4b glColor4b
|
||||
#define xglColor4bv glColor4bv
|
||||
#define xglColor4d glColor4d
|
||||
#define xglColor4dv glColor4dv
|
||||
#define xglColor4f glColor4f
|
||||
#define xglColor4fv glColor4fv
|
||||
#define xglColor4i glColor4i
|
||||
#define xglColor4iv glColor4iv
|
||||
#define xglColor4s glColor4s
|
||||
#define xglColor4sv glColor4sv
|
||||
#define xglColor4ub glColor4ub
|
||||
#define xglColor4ubv glColor4ubv
|
||||
#define xglColor4ui glColor4ui
|
||||
#define xglColor4uiv glColor4uiv
|
||||
#define xglColor4us glColor4us
|
||||
#define xglColor4usv glColor4usv
|
||||
#define xglColorMask glColorMask
|
||||
#define xglColorMaterial glColorMaterial
|
||||
#ifdef GL_EXT_vertex_array
|
||||
#define xglColorPointerEXT glColorPointerEXT
|
||||
#endif
|
||||
#define xglCopyPixels glCopyPixels
|
||||
#define xglCullFace glCullFace
|
||||
#define xglDeleteLists glDeleteLists
|
||||
#define xglDepthFunc glDepthFunc
|
||||
#define xglDepthMask glDepthMask
|
||||
#define xglDepthRange glDepthRange
|
||||
#define xglDisable glDisable
|
||||
#ifdef GL_EXT_vertex_array
|
||||
#define xglDrawArraysEXT glDrawArraysEXT
|
||||
#endif
|
||||
#define xglDrawBuffer glDrawBuffer
|
||||
#define xglDrawPixels glDrawPixels
|
||||
#define xglEdgeFlag glEdgeFlag
|
||||
#ifdef GL_EXT_vertex_array
|
||||
#define xglEdgeFlagPointerEXT glEdgeFlagPointerEXT
|
||||
#endif
|
||||
#define xglEdgeFlagv glEdgeFlagv
|
||||
#define xglEnable glEnable
|
||||
#define xglEnd glEnd
|
||||
#define xglEndList glEndList
|
||||
#define xglEvalCoord1d glEvalCoord1d
|
||||
#define xglEvalCoord1dv glEvalCoord1dv
|
||||
#define xglEvalCoord1f glEvalCoord1f
|
||||
#define xglEvalCoord1fv glEvalCoord1fv
|
||||
#define xglEvalCoord2d glEvalCoord2d
|
||||
#define xglEvalCoord2dv glEvalCoord2dv
|
||||
#define xglEvalCoord2f glEvalCoord2f
|
||||
#define xglEvalCoord2fv glEvalCoord2fv
|
||||
#define xglEvalMesh1 glEvalMesh1
|
||||
#define xglEvalMesh2 glEvalMesh2
|
||||
#define xglEvalPoint1 glEvalPoint1
|
||||
#define xglEvalPoint2 glEvalPoint2
|
||||
#define xglFeedbackBuffer glFeedbackBuffer
|
||||
#define xglFinish glFinish
|
||||
#define xglFlush glFlush
|
||||
#define xglFogf glFogf
|
||||
#define xglFogfv glFogfv
|
||||
#define xglFogi glFogi
|
||||
#define xglFogiv glFogiv
|
||||
#define xglFrontFace glFrontFace
|
||||
#define xglFrustum glFrustum
|
||||
#define xglGenLists glGenLists
|
||||
#define xglGetBooleanv glGetBooleanv
|
||||
#define xglGetClipPlane glGetClipPlane
|
||||
#define xglGetDoublev glGetDoublev
|
||||
#define xglGetError glGetError
|
||||
#define xglGetFloatv glGetFloatv
|
||||
#define xglGetIntegerv glGetIntegerv
|
||||
#define xglGetLightfv glGetLightfv
|
||||
#define xglGetLightiv glGetLightiv
|
||||
#define xglGetMapdv glGetMapdv
|
||||
#define xglGetMapfv glGetMapfv
|
||||
#define xglGetMapiv glGetMapiv
|
||||
#define xglGetMaterialfv glGetMaterialfv
|
||||
#define xglGetMaterialiv glGetMaterialiv
|
||||
#define xglGetPixelMapfv glGetPixelMapfv
|
||||
#define xglGetPixelMapuiv glGetPixelMapuiv
|
||||
#define xglGetPixelMapusv glGetPixelMapusv
|
||||
#ifdef GL_EXT_vertex_array
|
||||
#define xglGetPointervEXT glGetPointervEXT
|
||||
#endif
|
||||
#define xglGetPolygonStipple glGetPolygonStipple
|
||||
#define xglGetString glGetString
|
||||
#define xglGetTexEnvfv glGetTexEnvfv
|
||||
#define xglGetTexEnviv glGetTexEnviv
|
||||
#define xglGetTexGendv glGetTexGendv
|
||||
#define xglGetTexGenfv glGetTexGenfv
|
||||
#define xglGetTexGeniv glGetTexGeniv
|
||||
#define xglGetTexImage glGetTexImage
|
||||
#define xglGetTexLevelParameterfv glGetTexLevelParameterfv
|
||||
#define xglGetTexLevelParameteriv glGetTexLevelParameteriv
|
||||
#define xglGetTexParameterfv glGetTexParameterfv
|
||||
#define xglGetTexParameteriv glGetTexParameteriv
|
||||
#define xglHint glHint
|
||||
#define xglIndexMask glIndexMask
|
||||
#ifdef GL_EXT_vertex_array
|
||||
#define xglIndexPointerEXT glIndexPointerEXT
|
||||
#endif
|
||||
#define xglIndexd glIndexd
|
||||
#define xglIndexdv glIndexdv
|
||||
#define xglIndexf glIndexf
|
||||
#define xglIndexfv glIndexfv
|
||||
#define xglIndexi glIndexi
|
||||
#define xglIndexiv glIndexiv
|
||||
#define xglIndexs glIndexs
|
||||
#define xglIndexsv glIndexsv
|
||||
#define xglInitNames glInitNames
|
||||
#define xglIsEnabled glIsEnabled
|
||||
#define xglIsList glIsList
|
||||
#define xglLightModelf glLightModelf
|
||||
#define xglLightModelfv glLightModelfv
|
||||
#define xglLightModeli glLightModeli
|
||||
#define xglLightModeliv glLightModeliv
|
||||
#define xglLightf glLightf
|
||||
#define xglLightfv glLightfv
|
||||
#define xglLighti glLighti
|
||||
#define xglLightiv glLightiv
|
||||
#define xglLineStipple glLineStipple
|
||||
#define xglLineWidth glLineWidth
|
||||
#define xglListBase glListBase
|
||||
#define xglLoadIdentity glLoadIdentity
|
||||
#define xglLoadMatrixd glLoadMatrixd
|
||||
#define xglLoadMatrixf glLoadMatrixf
|
||||
#define xglLoadName glLoadName
|
||||
#define xglLogicOp glLogicOp
|
||||
#define xglMap1d glMap1d
|
||||
#define xglMap1f glMap1f
|
||||
#define xglMap2d glMap2d
|
||||
#define xglMap2f glMap2f
|
||||
#define xglMapGrid1d glMapGrid1d
|
||||
#define xglMapGrid1f glMapGrid1f
|
||||
#define xglMapGrid2d glMapGrid2d
|
||||
#define xglMapGrid2f glMapGrid2f
|
||||
#define xglMaterialf glMaterialf
|
||||
#define xglMaterialfv glMaterialfv
|
||||
#define xglMateriali glMateriali
|
||||
#define xglMaterialiv glMaterialiv
|
||||
#define xglMatrixMode glMatrixMode
|
||||
#define xglMultMatrixd glMultMatrixd
|
||||
#define xglMultMatrixf glMultMatrixf
|
||||
#define xglNewList glNewList
|
||||
#define xglNormal3b glNormal3b
|
||||
#define xglNormal3bv glNormal3bv
|
||||
#define xglNormal3d glNormal3d
|
||||
#define xglNormal3dv glNormal3dv
|
||||
#define xglNormal3f glNormal3f
|
||||
#ifdef DEBUGGING_NORMALS
|
||||
#define xglNormal3fv(f) {\
|
||||
float ff = (f)[0]*(f)[0]+(f)[1]*(f)[1]+(f)[2]*(f)[2];\
|
||||
if ( ff < 0.9 || ff > 1.1 )\
|
||||
{\
|
||||
fprintf(stderr,"glNormal3fv Overflow: %f, %f, %f -> %f [%s,%s,%s]\n",\
|
||||
(f)[0],(f)[1],(f)[2],ff,str1,str2,str3);\
|
||||
normal_bombed = 1 ;\
|
||||
}\
|
||||
glNormal3fv(f);\
|
||||
}
|
||||
#else
|
||||
#define xglNormal3fv glNormal3fv
|
||||
#endif
|
||||
#define xglNormal3i glNormal3i
|
||||
#define xglNormal3iv glNormal3iv
|
||||
#define xglNormal3s glNormal3s
|
||||
#define xglNormal3sv glNormal3sv
|
||||
#ifdef GL_EXT_vertex_array
|
||||
#define xglNormalPointerEXT glNormalPointerEXT
|
||||
#endif
|
||||
#define xglOrtho glOrtho
|
||||
#define xglPassThrough glPassThrough
|
||||
#define xglPixelMapfv glPixelMapfv
|
||||
#define xglPixelMapuiv glPixelMapuiv
|
||||
#define xglPixelMapusv glPixelMapusv
|
||||
#define xglPixelStoref glPixelStoref
|
||||
#define xglPixelStorei glPixelStorei
|
||||
#define xglPixelTransferf glPixelTransferf
|
||||
#define xglPixelTransferi glPixelTransferi
|
||||
#define xglPixelZoom glPixelZoom
|
||||
#define xglPointSize glPointSize
|
||||
#define xglPolygonMode glPolygonMode
|
||||
#ifdef GL_EXT_polygon_offset
|
||||
#define xglPolygonOffsetEXT glPolygonOffsetEXT
|
||||
#endif
|
||||
#define xglPolygonOffset glPolygonOffset
|
||||
#define xglPolygonStipple glPolygonStipple
|
||||
#define xglPopAttrib glPopAttrib
|
||||
#define xglPopMatrix glPopMatrix
|
||||
#define xglPopName glPopName
|
||||
#define xglPushAttrib glPushAttrib
|
||||
#define xglPushMatrix glPushMatrix
|
||||
#define xglPushName glPushName
|
||||
#define xglRasterPos2d glRasterPos2d
|
||||
#define xglRasterPos2dv glRasterPos2dv
|
||||
#define xglRasterPos2f glRasterPos2f
|
||||
#define xglRasterPos2fv glRasterPos2fv
|
||||
#define xglRasterPos2i glRasterPos2i
|
||||
#define xglRasterPos2iv glRasterPos2iv
|
||||
#define xglRasterPos2s glRasterPos2s
|
||||
#define xglRasterPos2sv glRasterPos2sv
|
||||
#define xglRasterPos3d glRasterPos3d
|
||||
#define xglRasterPos3dv glRasterPos3dv
|
||||
#define xglRasterPos3f glRasterPos3f
|
||||
#define xglRasterPos3fv glRasterPos3fv
|
||||
#define xglRasterPos3i glRasterPos3i
|
||||
#define xglRasterPos3iv glRasterPos3iv
|
||||
#define xglRasterPos3s glRasterPos3s
|
||||
#define xglRasterPos3sv glRasterPos3sv
|
||||
#define xglRasterPos4d glRasterPos4d
|
||||
#define xglRasterPos4dv glRasterPos4dv
|
||||
#define xglRasterPos4f glRasterPos4f
|
||||
#define xglRasterPos4fv glRasterPos4fv
|
||||
#define xglRasterPos4i glRasterPos4i
|
||||
#define xglRasterPos4iv glRasterPos4iv
|
||||
#define xglRasterPos4s glRasterPos4s
|
||||
#define xglRasterPos4sv glRasterPos4sv
|
||||
#define xglReadBuffer glReadBuffer
|
||||
#define xglReadPixels glReadPixels
|
||||
#define xglRectd glRectd
|
||||
#define xglRectdv glRectdv
|
||||
#define xglRectf glRectf
|
||||
#define xglRectfv glRectfv
|
||||
#define xglRecti glRecti
|
||||
#define xglRectiv glRectiv
|
||||
#define xglRects glRects
|
||||
#define xglRectsv glRectsv
|
||||
#define xglRenderMode glRenderMode
|
||||
#define xglRotated glRotated
|
||||
#define xglRotatef glRotatef
|
||||
#define xglScaled glScaled
|
||||
#define xglScalef glScalef
|
||||
#define xglScissor glScissor
|
||||
#define xglSelectBuffer glSelectBuffer
|
||||
#define xglShadeModel glShadeModel
|
||||
#define xglStencilFunc glStencilFunc
|
||||
#define xglStencilMask glStencilMask
|
||||
#define xglStencilOp glStencilOp
|
||||
#define xglTexCoord1d glTexCoord1d
|
||||
#define xglTexCoord1dv glTexCoord1dv
|
||||
#define xglTexCoord1f glTexCoord1f
|
||||
#define xglTexCoord1fv glTexCoord1fv
|
||||
#define xglTexCoord1i glTexCoord1i
|
||||
#define xglTexCoord1iv glTexCoord1iv
|
||||
#define xglTexCoord1s glTexCoord1s
|
||||
#define xglTexCoord1sv glTexCoord1sv
|
||||
#define xglTexCoord2d glTexCoord2d
|
||||
#define xglTexCoord2dv glTexCoord2dv
|
||||
#define xglTexCoord2f glTexCoord2f
|
||||
#define xglTexCoord2fv glTexCoord2fv
|
||||
#define xglTexCoord2i glTexCoord2i
|
||||
#define xglTexCoord2iv glTexCoord2iv
|
||||
#define xglTexCoord2s glTexCoord2s
|
||||
#define xglTexCoord2sv glTexCoord2sv
|
||||
#define xglTexCoord3d glTexCoord3d
|
||||
#define xglTexCoord3dv glTexCoord3dv
|
||||
#define xglTexCoord3f glTexCoord3f
|
||||
#define xglTexCoord3fv glTexCoord3fv
|
||||
#define xglTexCoord3i glTexCoord3i
|
||||
#define xglTexCoord3iv glTexCoord3iv
|
||||
#define xglTexCoord3s glTexCoord3s
|
||||
#define xglTexCoord3sv glTexCoord3sv
|
||||
#define xglTexCoord4d glTexCoord4d
|
||||
#define xglTexCoord4dv glTexCoord4dv
|
||||
#define xglTexCoord4f glTexCoord4f
|
||||
#define xglTexCoord4fv glTexCoord4fv
|
||||
#define xglTexCoord4i glTexCoord4i
|
||||
#define xglTexCoord4iv glTexCoord4iv
|
||||
#define xglTexCoord4s glTexCoord4s
|
||||
#define xglTexCoord4sv glTexCoord4sv
|
||||
#ifdef GL_EXT_vertex_array
|
||||
#define xglTexCoordPointerEXT glTexCoordPointerEXT
|
||||
#endif
|
||||
#define xglTexEnvf glTexEnvf
|
||||
#define xglTexEnvfv glTexEnvfv
|
||||
#define xglTexEnvi glTexEnvi
|
||||
#define xglTexEnviv glTexEnviv
|
||||
#define xglTexGend glTexGend
|
||||
#define xglTexGendv glTexGendv
|
||||
#define xglTexGenf glTexGenf
|
||||
#define xglTexGenfv glTexGenfv
|
||||
#define xglTexGeni glTexGeni
|
||||
#define xglTexGeniv glTexGeniv
|
||||
#define xglTexImage1D glTexImage1D
|
||||
#define xglTexImage2D glTexImage2D
|
||||
#define xglTexParameterf glTexParameterf
|
||||
#define xglTexParameterfv glTexParameterfv
|
||||
#define xglTexParameteri glTexParameteri
|
||||
#define xglTexParameteriv glTexParameteriv
|
||||
#define xglTranslated glTranslated
|
||||
#define xglTranslatef glTranslatef
|
||||
#define xglVertex2d glVertex2d
|
||||
#define xglVertex2dv glVertex2dv
|
||||
#define xglVertex2f glVertex2f
|
||||
#define xglVertex2fv glVertex2fv
|
||||
#define xglVertex2i glVertex2i
|
||||
#define xglVertex2iv glVertex2iv
|
||||
#define xglVertex2s glVertex2s
|
||||
#define xglVertex2sv glVertex2sv
|
||||
#define xglVertex3d glVertex3d
|
||||
#define xglVertex3dv glVertex3dv
|
||||
#define xglVertex3f glVertex3f
|
||||
#define xglVertex3fv glVertex3fv
|
||||
#define xglVertex3i glVertex3i
|
||||
#define xglVertex3iv glVertex3iv
|
||||
#define xglVertex3s glVertex3s
|
||||
#define xglVertex3sv glVertex3sv
|
||||
#define xglVertex4d glVertex4d
|
||||
#define xglVertex4dv glVertex4dv
|
||||
#define xglVertex4f glVertex4f
|
||||
#define xglVertex4fv glVertex4fv
|
||||
#define xglVertex4i glVertex4i
|
||||
#define xglVertex4iv glVertex4iv
|
||||
#define xglVertex4s glVertex4s
|
||||
#define xglVertex4sv glVertex4sv
|
||||
#ifdef GL_EXT_vertex_array
|
||||
#define xglVertexPointerEXT glVertexPointerEXT
|
||||
#endif
|
||||
#define xglViewport glViewport
|
||||
|
||||
#ifdef GL_VERSION_1_1
|
||||
#define xglAreTexturesResident glAreTexturesResident
|
||||
#define xglIsTexture glIsTexture
|
||||
#define xglBindTexture glBindTexture
|
||||
#define xglDeleteTextures glDeleteTextures
|
||||
#define xglGenTextures glGenTextures
|
||||
#define xglPrioritizeTextures glPrioritizeTextures
|
||||
#endif
|
||||
|
||||
#ifdef GL_EXT_texture_object
|
||||
#define xglAreTexturesResidentEXT glAreTexturesResidentEXT
|
||||
#define xglIsTextureEXT glIsTextureEXT
|
||||
#define xglBindTextureEXT glBindTextureEXT
|
||||
#define xglDeleteTexturesEXT glDeleteTexturesEXT
|
||||
#define xglGenTexturesEXT glGenTexturesEXT
|
||||
#define xglPrioritizeTexturesEXT glPrioritizeTexturesEXT
|
||||
#endif
|
||||
|
||||
#define xglutAddMenuEntry glutAddMenuEntry
|
||||
#define xglutAttachMenu glutAttachMenu
|
||||
#define xglutCreateMenu glutCreateMenu
|
||||
#define xglutCreateWindow glutCreateWindow
|
||||
#define xglutDisplayFunc glutDisplayFunc
|
||||
#define xglutIdleFunc glutIdleFunc
|
||||
#define xglutInit glutInit
|
||||
#define xglutInitDisplayMode glutInitDisplayMode
|
||||
#define xglutInitWindowPosition glutInitWindowPosition
|
||||
#define xglutInitWindowSize glutInitWindowSize
|
||||
#define xglutKeyboardFunc glutKeyboardFunc
|
||||
#define xglutMainLoopUpdate glutMainLoopUpdate
|
||||
#define xglutPostRedisplay glutPostRedisplay
|
||||
#define xglutPreMainLoop glutPreMainLoop
|
||||
#define xglutReshapeFunc glutReshapeFunc
|
||||
#define xglutSwapBuffers glutSwapBuffers
|
||||
|
||||
#else
|
||||
|
||||
GLboolean xglIsEnabled ( GLenum cap ) ;
|
||||
GLboolean xglIsList ( GLuint list ) ;
|
||||
GLenum xglGetError () ;
|
||||
GLint xglRenderMode ( GLenum mode ) ;
|
||||
GLuint xglGenLists ( GLsizei range ) ;
|
||||
const GLubyte *xglGetString ( GLenum name ) ;
|
||||
|
||||
void xglAccum ( GLenum op, GLfloat value ) ;
|
||||
void xglAlphaFunc ( GLenum func, GLclampf ref ) ;
|
||||
void xglArrayElementEXT ( GLint i ) ;
|
||||
void xglBegin ( GLenum mode ) ;
|
||||
void xglBitmap ( GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, GLubyte *bitmap ) ;
|
||||
void xglBlendColorEXT ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) ;
|
||||
void xglBlendEquationEXT( GLenum mode ) ;
|
||||
void xglBlendFunc ( GLenum sfactor, GLenum dfactor ) ;
|
||||
void xglCallList ( GLuint list ) ;
|
||||
void xglCallLists ( GLsizei n, GLenum type, GLvoid *lists ) ;
|
||||
void xglClear ( GLbitfield mask ) ;
|
||||
void xglClearAccum ( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) ;
|
||||
void xglClearColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) ;
|
||||
void xglClearDepth ( GLclampd depth ) ;
|
||||
void xglClearIndex ( GLfloat c ) ;
|
||||
void xglClearStencil ( GLint s ) ;
|
||||
void xglClipPlane ( GLenum plane, GLdouble *equation ) ;
|
||||
void xglColor3b ( GLbyte red, GLbyte green, GLbyte blue ) ;
|
||||
void xglColor3bv ( GLbyte *v ) ;
|
||||
void xglColor3d ( GLdouble red, GLdouble green, GLdouble blue ) ;
|
||||
void xglColor3dv ( GLdouble *v ) ;
|
||||
void xglColor3f ( GLfloat red, GLfloat green, GLfloat blue ) ;
|
||||
void xglColor3fv ( GLfloat *v ) ;
|
||||
void xglColor3i ( GLint red, GLint green, GLint blue ) ;
|
||||
void xglColor3iv ( GLint *v ) ;
|
||||
void xglColor3s ( GLshort red, GLshort green, GLshort blue ) ;
|
||||
void xglColor3sv ( GLshort *v ) ;
|
||||
void xglColor3ub ( GLubyte red, GLubyte green, GLubyte blue ) ;
|
||||
void xglColor3ubv ( GLubyte *v ) ;
|
||||
void xglColor3ui ( GLuint red, GLuint green, GLuint blue ) ;
|
||||
void xglColor3uiv ( GLuint *v ) ;
|
||||
void xglColor3us ( GLushort red, GLushort green, GLushort blue ) ;
|
||||
void xglColor3usv ( GLushort *v ) ;
|
||||
void xglColor4b ( GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha ) ;
|
||||
void xglColor4bv ( GLbyte *v ) ;
|
||||
void xglColor4d ( GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha ) ;
|
||||
void xglColor4dv ( GLdouble *v ) ;
|
||||
void xglColor4f ( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) ;
|
||||
void xglColor4fv ( GLfloat *v ) ;
|
||||
void xglColor4i ( GLint red, GLint green, GLint blue, GLint alpha ) ;
|
||||
void xglColor4iv ( GLint *v ) ;
|
||||
void xglColor4s ( GLshort red, GLshort green, GLshort blue, GLshort alpha ) ;
|
||||
void xglColor4sv ( GLshort *v ) ;
|
||||
void xglColor4ub ( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha ) ;
|
||||
void xglColor4ubv ( GLubyte *v ) ;
|
||||
void xglColor4ui ( GLuint red, GLuint green, GLuint blue, GLuint alpha ) ;
|
||||
void xglColor4uiv ( GLuint *v ) ;
|
||||
void xglColor4us ( GLushort red, GLushort green, GLushort blue, GLushort alpha ) ;
|
||||
void xglColor4usv ( GLushort *v ) ;
|
||||
void xglColorMask ( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ) ;
|
||||
void xglColorMaterial ( GLenum face, GLenum mode ) ;
|
||||
void xglColorPointerEXT ( GLint size, GLenum type, GLsizei stride, GLsizei count, void *ptr ) ;
|
||||
void xglCopyPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum type ) ;
|
||||
void xglCullFace ( GLenum mode ) ;
|
||||
void xglDeleteLists ( GLuint list, GLsizei range ) ;
|
||||
void xglDepthFunc ( GLenum func ) ;
|
||||
void xglDepthMask ( GLboolean flag ) ;
|
||||
void xglDepthRange ( GLclampd near_val, GLclampd far_val ) ;
|
||||
void xglDisable ( GLenum cap ) ;
|
||||
void xglDrawArraysEXT ( GLenum mode, GLint first, GLsizei count ) ;
|
||||
void xglDrawBuffer ( GLenum mode ) ;
|
||||
void xglDrawPixels ( GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels ) ;
|
||||
void xglEdgeFlag ( GLboolean flag ) ;
|
||||
void xglEdgeFlagPointerEXT( GLsizei stride, GLsizei count, GLboolean *ptr ) ;
|
||||
void xglEdgeFlagv ( GLboolean *flag ) ;
|
||||
void xglEnable ( GLenum cap ) ;
|
||||
void xglEnd () ;
|
||||
void xglEndList () ;
|
||||
void xglEvalCoord1d ( GLdouble u ) ;
|
||||
void xglEvalCoord1dv ( GLdouble *u ) ;
|
||||
void xglEvalCoord1f ( GLfloat u ) ;
|
||||
void xglEvalCoord1fv ( GLfloat *u ) ;
|
||||
void xglEvalCoord2d ( GLdouble u, GLdouble v ) ;
|
||||
void xglEvalCoord2dv ( GLdouble *u ) ;
|
||||
void xglEvalCoord2f ( GLfloat u, GLfloat v ) ;
|
||||
void xglEvalCoord2fv ( GLfloat *u ) ;
|
||||
void xglEvalMesh1 ( GLenum mode, GLint i1, GLint i2 ) ;
|
||||
void xglEvalMesh2 ( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ) ;
|
||||
void xglEvalPoint1 ( GLint i ) ;
|
||||
void xglEvalPoint2 ( GLint i, GLint j ) ;
|
||||
void xglFeedbackBuffer ( GLsizei size, GLenum type, GLfloat *buffer ) ;
|
||||
void xglFinish () ;
|
||||
void xglFlush () ;
|
||||
void xglFogf ( GLenum pname, GLfloat param ) ;
|
||||
void xglFogfv ( GLenum pname, GLfloat *params ) ;
|
||||
void xglFogi ( GLenum pname, GLint param ) ;
|
||||
void xglFogiv ( GLenum pname, GLint *params ) ;
|
||||
void xglFrontFace ( GLenum mode ) ;
|
||||
void xglFrustum ( GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val ) ;
|
||||
void xglGetBooleanv ( GLenum pname, GLboolean *params ) ;
|
||||
void xglGetClipPlane ( GLenum plane, GLdouble *equation ) ;
|
||||
void xglGetDoublev ( GLenum pname, GLdouble *params ) ;
|
||||
void xglGetFloatv ( GLenum pname, GLfloat *params ) ;
|
||||
void xglGetIntegerv ( GLenum pname, GLint *params ) ;
|
||||
void xglGetLightfv ( GLenum light, GLenum pname, GLfloat *params ) ;
|
||||
void xglGetLightiv ( GLenum light, GLenum pname, GLint *params ) ;
|
||||
void xglGetMapdv ( GLenum target, GLenum query, GLdouble *v ) ;
|
||||
void xglGetMapfv ( GLenum target, GLenum query, GLfloat *v ) ;
|
||||
void xglGetMapiv ( GLenum target, GLenum query, GLint *v ) ;
|
||||
void xglGetMaterialfv ( GLenum face, GLenum pname, GLfloat *params ) ;
|
||||
void xglGetMaterialiv ( GLenum face, GLenum pname, GLint *params ) ;
|
||||
void xglGetPixelMapfv ( GLenum map, GLfloat *values ) ;
|
||||
void xglGetPixelMapuiv ( GLenum map, GLuint *values ) ;
|
||||
void xglGetPixelMapusv ( GLenum map, GLushort *values ) ;
|
||||
void xglGetPointervEXT ( GLenum pname, void **params ) ;
|
||||
void xglGetPolygonStipple( GLubyte *mask ) ;
|
||||
void xglGetTexEnvfv ( GLenum target, GLenum pname, GLfloat *params ) ;
|
||||
void xglGetTexEnviv ( GLenum target, GLenum pname, GLint *params ) ;
|
||||
void xglGetTexGendv ( GLenum coord, GLenum pname, GLdouble *params ) ;
|
||||
void xglGetTexGenfv ( GLenum coord, GLenum pname, GLfloat *params ) ;
|
||||
void xglGetTexGeniv ( GLenum coord, GLenum pname, GLint *params ) ;
|
||||
void xglGetTexImage ( GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels ) ;
|
||||
void xglGetTexLevelParameterfv ( GLenum target, GLint level, GLenum pname, GLfloat *params ) ;
|
||||
void xglGetTexLevelParameteriv ( GLenum target, GLint level, GLenum pname, GLint *params ) ;
|
||||
void xglGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params) ;
|
||||
void xglGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) ;
|
||||
void xglHint ( GLenum target, GLenum mode ) ;
|
||||
void xglIndexMask ( GLuint mask ) ;
|
||||
void xglIndexPointerEXT ( GLenum type, GLsizei stride, GLsizei count, void *ptr ) ;
|
||||
void xglIndexd ( GLdouble c ) ;
|
||||
void xglIndexdv ( GLdouble *c ) ;
|
||||
void xglIndexf ( GLfloat c ) ;
|
||||
void xglIndexfv ( GLfloat *c ) ;
|
||||
void xglIndexi ( GLint c ) ;
|
||||
void xglIndexiv ( GLint *c ) ;
|
||||
void xglIndexs ( GLshort c ) ;
|
||||
void xglIndexsv ( GLshort *c ) ;
|
||||
void xglInitNames () ;
|
||||
void xglLightModelf ( GLenum pname, GLfloat param ) ;
|
||||
void xglLightModelfv ( GLenum pname, GLfloat *params ) ;
|
||||
void xglLightModeli ( GLenum pname, GLint param ) ;
|
||||
void xglLightModeliv ( GLenum pname, GLint *params ) ;
|
||||
void xglLightf ( GLenum light, GLenum pname, GLfloat param ) ;
|
||||
void xglLightfv ( GLenum light, GLenum pname, GLfloat *params ) ;
|
||||
void xglLighti ( GLenum light, GLenum pname, GLint param ) ;
|
||||
void xglLightiv ( GLenum light, GLenum pname, GLint *params ) ;
|
||||
void xglLineStipple ( GLint factor, GLushort pattern ) ;
|
||||
void xglLineWidth ( GLfloat width ) ;
|
||||
void xglListBase ( GLuint base ) ;
|
||||
void xglLoadIdentity () ;
|
||||
void xglLoadMatrixd ( GLdouble *m ) ;
|
||||
void xglLoadMatrixf ( GLfloat *m ) ;
|
||||
void xglLoadName ( GLuint name ) ;
|
||||
void xglLogicOp ( GLenum opcode ) ;
|
||||
void xglMap1d ( GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, GLdouble *points ) ;
|
||||
void xglMap1f ( GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, GLfloat *points ) ;
|
||||
void xglMap2d ( GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble *points ) ;
|
||||
void xglMap2f ( GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat *points ) ;
|
||||
void xglMapGrid1d ( GLint un, GLdouble u1, GLdouble u2 ) ;
|
||||
void xglMapGrid1f ( GLint un, GLfloat u1, GLfloat u2 ) ;
|
||||
void xglMapGrid2d ( GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2 ) ;
|
||||
void xglMapGrid2f ( GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2 ) ;
|
||||
void xglMaterialf ( GLenum face, GLenum pname, GLfloat param ) ;
|
||||
void xglMaterialfv ( GLenum face, GLenum pname, GLfloat *params ) ;
|
||||
void xglMateriali ( GLenum face, GLenum pname, GLint param ) ;
|
||||
void xglMaterialiv ( GLenum face, GLenum pname, GLint *params ) ;
|
||||
void xglMatrixMode ( GLenum mode ) ;
|
||||
void xglMultMatrixd ( GLdouble *m ) ;
|
||||
void xglMultMatrixf ( GLfloat *m ) ;
|
||||
void xglNewList ( GLuint list, GLenum mode ) ;
|
||||
void xglNormal3b ( GLbyte nx, GLbyte ny, GLbyte nz ) ;
|
||||
void xglNormal3bv ( GLbyte *v ) ;
|
||||
void xglNormal3d ( GLdouble nx, GLdouble ny, GLdouble nz ) ;
|
||||
void xglNormal3dv ( GLdouble *v ) ;
|
||||
void xglNormal3f ( GLfloat nx, GLfloat ny, GLfloat nz ) ;
|
||||
void xglNormal3fv ( GLfloat *v ) ;
|
||||
void xglNormal3i ( GLint nx, GLint ny, GLint nz ) ;
|
||||
void xglNormal3iv ( GLint *v ) ;
|
||||
void xglNormal3s ( GLshort nx, GLshort ny, GLshort nz ) ;
|
||||
void xglNormal3sv ( GLshort *v ) ;
|
||||
void xglNormalPointerEXT( GLenum type, GLsizei stride, GLsizei count, void *ptr ) ;
|
||||
void xglOrtho ( GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val ) ;
|
||||
void xglPassThrough ( GLfloat token ) ;
|
||||
void xglPixelMapfv ( GLenum map, GLint mapsize, GLfloat *values ) ;
|
||||
void xglPixelMapuiv ( GLenum map, GLint mapsize, GLuint *values ) ;
|
||||
void xglPixelMapusv ( GLenum map, GLint mapsize, GLushort *values ) ;
|
||||
void xglPixelStoref ( GLenum pname, GLfloat param ) ;
|
||||
void xglPixelStorei ( GLenum pname, GLint param ) ;
|
||||
void xglPixelTransferf ( GLenum pname, GLfloat param ) ;
|
||||
void xglPixelTransferi ( GLenum pname, GLint param ) ;
|
||||
void xglPixelZoom ( GLfloat xfactor, GLfloat yfactor ) ;
|
||||
void xglPointSize ( GLfloat size ) ;
|
||||
void xglPolygonMode ( GLenum face, GLenum mode ) ;
|
||||
void xglPolygonOffsetEXT( GLfloat factor, GLfloat bias ) ;
|
||||
void xglPolygonOffset ( GLfloat factor, GLfloat bias ) ;
|
||||
void xglPolygonStipple ( GLubyte *mask ) ;
|
||||
void xglPopAttrib () ;
|
||||
void xglPopMatrix () ;
|
||||
void xglPopName () ;
|
||||
void xglPushAttrib ( GLbitfield mask ) ;
|
||||
void xglPushMatrix () ;
|
||||
void xglPushName ( GLuint name ) ;
|
||||
void xglRasterPos2d ( GLdouble x, GLdouble y ) ;
|
||||
void xglRasterPos2dv ( GLdouble *v ) ;
|
||||
void xglRasterPos2f ( GLfloat x, GLfloat y ) ;
|
||||
void xglRasterPos2fv ( GLfloat *v ) ;
|
||||
void xglRasterPos2i ( GLint x, GLint y ) ;
|
||||
void xglRasterPos2iv ( GLint *v ) ;
|
||||
void xglRasterPos2s ( GLshort x, GLshort y ) ;
|
||||
void xglRasterPos2sv ( GLshort *v ) ;
|
||||
void xglRasterPos3d ( GLdouble x, GLdouble y, GLdouble z ) ;
|
||||
void xglRasterPos3dv ( GLdouble *v ) ;
|
||||
void xglRasterPos3f ( GLfloat x, GLfloat y, GLfloat z ) ;
|
||||
void xglRasterPos3fv ( GLfloat *v ) ;
|
||||
void xglRasterPos3i ( GLint x, GLint y, GLint z ) ;
|
||||
void xglRasterPos3iv ( GLint *v ) ;
|
||||
void xglRasterPos3s ( GLshort x, GLshort y, GLshort z ) ;
|
||||
void xglRasterPos3sv ( GLshort *v ) ;
|
||||
void xglRasterPos4d ( GLdouble x, GLdouble y, GLdouble z, GLdouble w ) ;
|
||||
void xglRasterPos4dv ( GLdouble *v ) ;
|
||||
void xglRasterPos4f ( GLfloat x, GLfloat y, GLfloat z, GLfloat w ) ;
|
||||
void xglRasterPos4fv ( GLfloat *v ) ;
|
||||
void xglRasterPos4i ( GLint x, GLint y, GLint z, GLint w ) ;
|
||||
void xglRasterPos4iv ( GLint *v ) ;
|
||||
void xglRasterPos4s ( GLshort x, GLshort y, GLshort z, GLshort w ) ;
|
||||
void xglRasterPos4sv ( GLshort *v ) ;
|
||||
void xglReadBuffer ( GLenum mode ) ;
|
||||
void xglReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels ) ;
|
||||
void xglRectd ( GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2 ) ;
|
||||
void xglRectdv ( GLdouble *v1, GLdouble *v2 ) ;
|
||||
void xglRectf ( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 ) ;
|
||||
void xglRectfv ( GLfloat *v1, GLfloat *v2 ) ;
|
||||
void xglRecti ( GLint x1, GLint y1, GLint x2, GLint y2 ) ;
|
||||
void xglRectiv ( GLint *v1, GLint *v2 ) ;
|
||||
void xglRects ( GLshort x1, GLshort y1, GLshort x2, GLshort y2 ) ;
|
||||
void xglRectsv ( GLshort *v1, GLshort *v2 ) ;
|
||||
void xglRotated ( GLdouble angle, GLdouble x, GLdouble y, GLdouble z ) ;
|
||||
void xglRotatef ( GLfloat angle, GLfloat x, GLfloat y, GLfloat z ) ;
|
||||
void xglScaled ( GLdouble x, GLdouble y, GLdouble z ) ;
|
||||
void xglScalef ( GLfloat x, GLfloat y, GLfloat z ) ;
|
||||
void xglScissor ( GLint x, GLint y, GLsizei width, GLsizei height) ;
|
||||
void xglSelectBuffer ( GLsizei size, GLuint *buffer ) ;
|
||||
void xglShadeModel ( GLenum mode ) ;
|
||||
void xglStencilFunc ( GLenum func, GLint ref, GLuint mask ) ;
|
||||
void xglStencilMask ( GLuint mask ) ;
|
||||
void xglStencilOp ( GLenum fail, GLenum zfail, GLenum zpass ) ;
|
||||
void xglTexCoord1d ( GLdouble s ) ;
|
||||
void xglTexCoord1dv ( GLdouble *v ) ;
|
||||
void xglTexCoord1f ( GLfloat s ) ;
|
||||
void xglTexCoord1fv ( GLfloat *v ) ;
|
||||
void xglTexCoord1i ( GLint s ) ;
|
||||
void xglTexCoord1iv ( GLint *v ) ;
|
||||
void xglTexCoord1s ( GLshort s ) ;
|
||||
void xglTexCoord1sv ( GLshort *v ) ;
|
||||
void xglTexCoord2d ( GLdouble s, GLdouble t ) ;
|
||||
void xglTexCoord2dv ( GLdouble *v ) ;
|
||||
void xglTexCoord2f ( GLfloat s, GLfloat t ) ;
|
||||
void xglTexCoord2fv ( GLfloat *v ) ;
|
||||
void xglTexCoord2i ( GLint s, GLint t ) ;
|
||||
void xglTexCoord2iv ( GLint *v ) ;
|
||||
void xglTexCoord2s ( GLshort s, GLshort t ) ;
|
||||
void xglTexCoord2sv ( GLshort *v ) ;
|
||||
void xglTexCoord3d ( GLdouble s, GLdouble t, GLdouble r ) ;
|
||||
void xglTexCoord3dv ( GLdouble *v ) ;
|
||||
void xglTexCoord3f ( GLfloat s, GLfloat t, GLfloat r ) ;
|
||||
void xglTexCoord3fv ( GLfloat *v ) ;
|
||||
void xglTexCoord3i ( GLint s, GLint t, GLint r ) ;
|
||||
void xglTexCoord3iv ( GLint *v ) ;
|
||||
void xglTexCoord3s ( GLshort s, GLshort t, GLshort r ) ;
|
||||
void xglTexCoord3sv ( GLshort *v ) ;
|
||||
void xglTexCoord4d ( GLdouble s, GLdouble t, GLdouble r, GLdouble q ) ;
|
||||
void xglTexCoord4dv ( GLdouble *v ) ;
|
||||
void xglTexCoord4f ( GLfloat s, GLfloat t, GLfloat r, GLfloat q ) ;
|
||||
void xglTexCoord4fv ( GLfloat *v ) ;
|
||||
void xglTexCoord4i ( GLint s, GLint t, GLint r, GLint q ) ;
|
||||
void xglTexCoord4iv ( GLint *v ) ;
|
||||
void xglTexCoord4s ( GLshort s, GLshort t, GLshort r, GLshort q ) ;
|
||||
void xglTexCoord4sv ( GLshort *v ) ;
|
||||
void xglTexCoordPointerEXT( GLint size, GLenum type, GLsizei stride, GLsizei count, void *ptr ) ;
|
||||
void xglTexEnvf ( GLenum target, GLenum pname, GLfloat param ) ;
|
||||
void xglTexEnvfv ( GLenum target, GLenum pname, GLfloat *params ) ;
|
||||
void xglTexEnvi ( GLenum target, GLenum pname, GLint param ) ;
|
||||
void xglTexEnviv ( GLenum target, GLenum pname, GLint *params ) ;
|
||||
void xglTexGend ( GLenum coord, GLenum pname, GLdouble param ) ;
|
||||
void xglTexGendv ( GLenum coord, GLenum pname, GLdouble *params ) ;
|
||||
void xglTexGenf ( GLenum coord, GLenum pname, GLfloat param ) ;
|
||||
void xglTexGenfv ( GLenum coord, GLenum pname, GLfloat *params ) ;
|
||||
void xglTexGeni ( GLenum coord, GLenum pname, GLint param ) ;
|
||||
void xglTexGeniv ( GLenum coord, GLenum pname, GLint *params ) ;
|
||||
void xglTexImage1D ( GLenum target, GLint level, GLint components, GLsizei width, GLint border, GLenum format, GLenum type, GLvoid *pixels ) ;
|
||||
void xglTexImage2D ( GLenum target, GLint level, GLint components, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLvoid *pixels ) ;
|
||||
void xglTexParameterf ( GLenum target, GLenum pname, GLfloat param ) ;
|
||||
void xglTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) ;
|
||||
void xglTexParameteri ( GLenum target, GLenum pname, GLint param ) ;
|
||||
void xglTexParameteriv ( GLenum target, GLenum pname, GLint *params ) ;
|
||||
void xglTranslated ( GLdouble x, GLdouble y, GLdouble z ) ;
|
||||
void xglTranslatef ( GLfloat x, GLfloat y, GLfloat z ) ;
|
||||
void xglVertex2d ( GLdouble x, GLdouble y ) ;
|
||||
void xglVertex2dv ( GLdouble *v ) ;
|
||||
void xglVertex2f ( GLfloat x, GLfloat y ) ;
|
||||
void xglVertex2fv ( GLfloat *v ) ;
|
||||
void xglVertex2i ( GLint x, GLint y ) ;
|
||||
void xglVertex2iv ( GLint *v ) ;
|
||||
void xglVertex2s ( GLshort x, GLshort y ) ;
|
||||
void xglVertex2sv ( GLshort *v ) ;
|
||||
void xglVertex3d ( GLdouble x, GLdouble y, GLdouble z ) ;
|
||||
void xglVertex3dv ( GLdouble *v ) ;
|
||||
void xglVertex3f ( GLfloat x, GLfloat y, GLfloat z ) ;
|
||||
void xglVertex3fv ( GLfloat *v ) ;
|
||||
void xglVertex3i ( GLint x, GLint y, GLint z ) ;
|
||||
void xglVertex3iv ( GLint *v ) ;
|
||||
void xglVertex3s ( GLshort x, GLshort y, GLshort z ) ;
|
||||
void xglVertex3sv ( GLshort *v ) ;
|
||||
void xglVertex4d ( GLdouble x, GLdouble y, GLdouble z, GLdouble w ) ;
|
||||
void xglVertex4dv ( GLdouble *v ) ;
|
||||
void xglVertex4f ( GLfloat x, GLfloat y, GLfloat z, GLfloat w ) ;
|
||||
void xglVertex4fv ( GLfloat *v ) ;
|
||||
void xglVertex4i ( GLint x, GLint y, GLint z, GLint w ) ;
|
||||
void xglVertex4iv ( GLint *v ) ;
|
||||
void xglVertex4s ( GLshort x, GLshort y, GLshort z, GLshort w ) ;
|
||||
void xglVertex4sv ( GLshort *v ) ;
|
||||
void xglVertexPointerEXT( GLint size, GLenum type, GLsizei stride, GLsizei count, void *ptr ) ;
|
||||
void xglViewport ( GLint x, GLint y, GLsizei width, GLsizei height ) ;
|
||||
|
||||
void xglutAddMenuEntry ( char *label, int value ) ;
|
||||
void xglutAttachMenu ( int button ) ;
|
||||
int xglutCreateMenu ( void (*)(int) ) ;
|
||||
int xglutCreateWindow ( char *title ) ;
|
||||
void xglutDisplayFunc ( void (*)(void) ) ;
|
||||
void xglutIdleFunc ( void (*)(void) ) ;
|
||||
void xglutInit ( int *argcp, char **argv ) ;
|
||||
void xglutInitDisplayMode ( unsigned int mode ) ;
|
||||
void xglutInitWindowPosition ( int x, int y ) ;
|
||||
void xglutInitWindowSize ( int width, int height ) ;
|
||||
void xglutKeyboardFunc ( void (*)(unsigned char key, int x, int y) ) ;
|
||||
void xglutMainLoopUpdate () ;
|
||||
void xglutPostRedisplay () ;
|
||||
void xglutPreMainLoop () ;
|
||||
void xglutReshapeFunc ( void (*)(int width, int height) ) ;
|
||||
void xglutSwapBuffers () ;
|
||||
|
||||
GLboolean xglAreTexturesResident( GLsizei n, GLuint *textures, GLboolean *residences ) ;
|
||||
GLboolean xglIsTexture ( GLuint texture ) ;
|
||||
void xglBindTexture ( GLenum target, GLuint texture ) ;
|
||||
void xglDeleteTextures ( GLsizei n, GLuint *textures ) ;
|
||||
void xglGenTextures ( GLsizei n, GLuint *textures ) ;
|
||||
void xglPrioritizeTextures ( GLsizei n, GLuint *textures, GLclampf *priorities ) ;
|
||||
|
||||
GLboolean xglAreTexturesResidentEXT ( GLsizei n, GLuint *textures, GLboolean *residences ) ;
|
||||
GLboolean xglIsTextureEXT ( GLuint texture ) ;
|
||||
void xglBindTextureEXT ( GLenum target, GLuint texture ) ;
|
||||
void xglDeleteTexturesEXT ( GLsizei n, GLuint *textures ) ;
|
||||
void xglGenTexturesEXT ( GLsizei n, GLuint *textures ) ;
|
||||
void xglPrioritizeTexturesEXT ( GLsizei n, GLuint *textures, GLclampf *priorities ) ;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _XGL_H */
|
||||
@@ -1,682 +0,0 @@
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#if !defined( WIN32 )
|
||||
# if !defined( HAVE_STL_SGI_PORT ) && !defined( __MWERKS__ )
|
||||
// Avoid malloc with STLport and MSL
|
||||
# include <malloc.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
|
||||
#include "xgl.h"
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
int xglTraceOn = TRUE ;
|
||||
|
||||
FILE *xglTraceFd = NULL;
|
||||
|
||||
struct GLenumLookup
|
||||
{
|
||||
GLenum val ;
|
||||
char *name ;
|
||||
} ;
|
||||
|
||||
static struct GLenumLookup glenum_string [] =
|
||||
{
|
||||
/*
|
||||
Due to ambiguity - these are not in the table...
|
||||
|
||||
GL_NONE = , GL_ZERO = GL_FALSE = GL_POINTS = 0
|
||||
GL_ONE = , GL_TRUE = GL_LINES = 1
|
||||
*/
|
||||
{ GL_2D ,"GL_2D" },
|
||||
{ GL_2_BYTES ,"GL_2_BYTES" },
|
||||
{ GL_3D ,"GL_3D" },
|
||||
{ GL_3D_COLOR ,"GL_3D_COLOR" },
|
||||
{ GL_3D_COLOR_TEXTURE ,"GL_3D_COLOR_TEXTURE" },
|
||||
{ GL_3_BYTES ,"GL_3_BYTES" },
|
||||
{ GL_4D_COLOR_TEXTURE ,"GL_4D_COLOR_TEXTURE" },
|
||||
{ GL_4_BYTES ,"GL_4_BYTES" },
|
||||
{ GL_ACCUM ,"GL_ACCUM" },
|
||||
{ GL_ACCUM_ALPHA_BITS ,"GL_ACCUM_ALPHA_BITS" },
|
||||
{ GL_ACCUM_BLUE_BITS ,"GL_ACCUM_BLUE_BITS" },
|
||||
{ GL_ACCUM_CLEAR_VALUE ,"GL_ACCUM_CLEAR_VALUE" },
|
||||
{ GL_ACCUM_GREEN_BITS ,"GL_ACCUM_GREEN_BITS" },
|
||||
{ GL_ACCUM_RED_BITS ,"GL_ACCUM_RED_BITS" },
|
||||
{ GL_ADD ,"GL_ADD" },
|
||||
{ GL_ALPHA ,"GL_ALPHA" },
|
||||
{ GL_ALPHA_BIAS ,"GL_ALPHA_BIAS" },
|
||||
{ GL_ALPHA_BITS ,"GL_ALPHA_BITS" },
|
||||
{ GL_ALPHA_SCALE ,"GL_ALPHA_SCALE" },
|
||||
{ GL_ALPHA_TEST ,"GL_ALPHA_TEST" },
|
||||
{ GL_ALPHA_TEST_FUNC ,"GL_ALPHA_TEST_FUNC" },
|
||||
{ GL_ALPHA_TEST_REF ,"GL_ALPHA_TEST_REF" },
|
||||
{ GL_ALWAYS ,"GL_ALWAYS" },
|
||||
{ GL_AMBIENT ,"GL_AMBIENT" },
|
||||
{ GL_AMBIENT_AND_DIFFUSE ,"GL_AMBIENT_AND_DIFFUSE" },
|
||||
{ GL_AND ,"GL_AND" },
|
||||
{ GL_AND_INVERTED ,"GL_AND_INVERTED" },
|
||||
{ GL_AND_REVERSE ,"GL_AND_REVERSE" },
|
||||
{ GL_ATTRIB_STACK_DEPTH ,"GL_ATTRIB_STACK_DEPTH" },
|
||||
{ GL_AUTO_NORMAL ,"GL_AUTO_NORMAL" },
|
||||
{ GL_AUX0 ,"GL_AUX0" },
|
||||
{ GL_AUX1 ,"GL_AUX1" },
|
||||
{ GL_AUX2 ,"GL_AUX2" },
|
||||
{ GL_AUX3 ,"GL_AUX3" },
|
||||
{ GL_AUX_BUFFERS ,"GL_AUX_BUFFERS" },
|
||||
{ GL_BACK ,"GL_BACK" },
|
||||
{ GL_BACK_LEFT ,"GL_BACK_LEFT" },
|
||||
{ GL_BACK_RIGHT ,"GL_BACK_RIGHT" },
|
||||
{ GL_BITMAP ,"GL_BITMAP" },
|
||||
{ GL_BITMAP_TOKEN ,"GL_BITMAP_TOKEN" },
|
||||
{ GL_BLEND ,"GL_BLEND" },
|
||||
{ GL_BLEND_DST ,"GL_BLEND_DST" },
|
||||
#ifdef GL_BLEND_COLOR_EXT
|
||||
{ GL_BLEND_COLOR_EXT ,"GL_BLEND_COLOR_EXT" },
|
||||
#endif
|
||||
#ifdef GL_BLEND_EQUATION_EXT
|
||||
{ GL_BLEND_EQUATION_EXT ,"GL_BLEND_EQUATION_EXT" },
|
||||
#endif
|
||||
{ GL_BLEND_SRC ,"GL_BLEND_SRC" },
|
||||
{ GL_BLUE ,"GL_BLUE" },
|
||||
{ GL_BLUE_BIAS ,"GL_BLUE_BIAS" },
|
||||
{ GL_BLUE_BITS ,"GL_BLUE_BITS" },
|
||||
{ GL_BLUE_SCALE ,"GL_BLUE_SCALE" },
|
||||
{ GL_BYTE ,"GL_BYTE" },
|
||||
{ GL_CCW ,"GL_CCW" },
|
||||
{ GL_CLAMP ,"GL_CLAMP" },
|
||||
{ GL_CLEAR ,"GL_CLEAR" },
|
||||
{ GL_CLIP_PLANE0 ,"GL_CLIP_PLANE0" },
|
||||
{ GL_CLIP_PLANE1 ,"GL_CLIP_PLANE1" },
|
||||
{ GL_CLIP_PLANE2 ,"GL_CLIP_PLANE2" },
|
||||
{ GL_CLIP_PLANE3 ,"GL_CLIP_PLANE3" },
|
||||
{ GL_CLIP_PLANE4 ,"GL_CLIP_PLANE4" },
|
||||
{ GL_CLIP_PLANE5 ,"GL_CLIP_PLANE5" },
|
||||
{ GL_COEFF ,"GL_COEFF" },
|
||||
{ GL_COLOR ,"GL_COLOR" },
|
||||
#ifdef GL_COLOR_ARRAY_EXT
|
||||
{ GL_COLOR_ARRAY_COUNT_EXT ,"GL_COLOR_ARRAY_COUNT_EXT" },
|
||||
{ GL_COLOR_ARRAY_EXT ,"GL_COLOR_ARRAY_EXT" },
|
||||
{ GL_COLOR_ARRAY_POINTER_EXT ,"GL_COLOR_ARRAY_POINTER_EXT" },
|
||||
{ GL_COLOR_ARRAY_SIZE_EXT ,"GL_COLOR_ARRAY_SIZE_EXT" },
|
||||
{ GL_COLOR_ARRAY_STRIDE_EXT ,"GL_COLOR_ARRAY_STRIDE_EXT" },
|
||||
{ GL_COLOR_ARRAY_TYPE_EXT ,"GL_COLOR_ARRAY_TYPE_EXT" },
|
||||
#endif
|
||||
{ GL_COLOR_CLEAR_VALUE ,"GL_COLOR_CLEAR_VALUE" },
|
||||
{ GL_COLOR_INDEX ,"GL_COLOR_INDEX" },
|
||||
{ GL_COLOR_INDEXES ,"GL_COLOR_INDEXES" },
|
||||
{ GL_COLOR_MATERIAL ,"GL_COLOR_MATERIAL" },
|
||||
{ GL_COLOR_MATERIAL_FACE ,"GL_COLOR_MATERIAL_FACE" },
|
||||
{ GL_COLOR_MATERIAL_PARAMETER ,"GL_COLOR_MATERIAL_PARAMETER" },
|
||||
{ GL_COLOR_WRITEMASK ,"GL_COLOR_WRITEMASK" },
|
||||
{ GL_COMPILE ,"GL_COMPILE" },
|
||||
{ GL_COMPILE_AND_EXECUTE ,"GL_COMPILE_AND_EXECUTE" },
|
||||
#ifdef GL_CONSTANT_ALPHA_EXT
|
||||
{ GL_CONSTANT_ALPHA_EXT ,"GL_CONSTANT_ALPHA_EXT" },
|
||||
#endif
|
||||
{ GL_CONSTANT_ATTENUATION ,"GL_CONSTANT_ATTENUATION" },
|
||||
#ifdef GL_CONSTANT_COLOR_EXT
|
||||
{ GL_CONSTANT_COLOR_EXT ,"GL_CONSTANT_COLOR_EXT" },
|
||||
#endif
|
||||
{ GL_COPY ,"GL_COPY" },
|
||||
{ GL_COPY_INVERTED ,"GL_COPY_INVERTED" },
|
||||
{ GL_COPY_PIXEL_TOKEN ,"GL_COPY_PIXEL_TOKEN" },
|
||||
{ GL_CULL_FACE ,"GL_CULL_FACE" },
|
||||
{ GL_CULL_FACE_MODE ,"GL_CULL_FACE_MODE" },
|
||||
{ GL_CURRENT_COLOR ,"GL_CURRENT_COLOR" },
|
||||
{ GL_CURRENT_INDEX ,"GL_CURRENT_INDEX" },
|
||||
{ GL_CURRENT_NORMAL ,"GL_CURRENT_NORMAL" },
|
||||
{ GL_CURRENT_RASTER_COLOR ,"GL_CURRENT_RASTER_COLOR" },
|
||||
{ GL_CURRENT_RASTER_DISTANCE ,"GL_CURRENT_RASTER_DISTANCE" },
|
||||
{ GL_CURRENT_RASTER_INDEX ,"GL_CURRENT_RASTER_INDEX" },
|
||||
{ GL_CURRENT_RASTER_POSITION ,"GL_CURRENT_RASTER_POSITION" },
|
||||
{ GL_CURRENT_RASTER_POSITION_VALID,"GL_CURRENT_RASTER_POSITION_VALID" },
|
||||
{ GL_CURRENT_RASTER_TEXTURE_COORDS,"GL_CURRENT_RASTER_TEXTURE_COORDS" },
|
||||
{ GL_CURRENT_TEXTURE_COORDS ,"GL_CURRENT_TEXTURE_COORDS" },
|
||||
{ GL_CW ,"GL_CW" },
|
||||
{ GL_DECAL ,"GL_DECAL" },
|
||||
{ GL_DECR ,"GL_DECR" },
|
||||
{ GL_DEPTH ,"GL_DEPTH" },
|
||||
{ GL_DEPTH_BIAS ,"GL_DEPTH_BIAS" },
|
||||
{ GL_DEPTH_BITS ,"GL_DEPTH_BITS" },
|
||||
{ GL_DEPTH_CLEAR_VALUE ,"GL_DEPTH_CLEAR_VALUE" },
|
||||
{ GL_DEPTH_COMPONENT ,"GL_DEPTH_COMPONENT" },
|
||||
{ GL_DEPTH_FUNC ,"GL_DEPTH_FUNC" },
|
||||
{ GL_DEPTH_RANGE ,"GL_DEPTH_RANGE" },
|
||||
{ GL_DEPTH_SCALE ,"GL_DEPTH_SCALE" },
|
||||
{ GL_DEPTH_TEST ,"GL_DEPTH_TEST" },
|
||||
{ GL_DEPTH_WRITEMASK ,"GL_DEPTH_WRITEMASK" },
|
||||
{ GL_DIFFUSE ,"GL_DIFFUSE" },
|
||||
{ GL_DITHER ,"GL_DITHER" },
|
||||
{ GL_DOMAIN ,"GL_DOMAIN" },
|
||||
{ GL_DONT_CARE ,"GL_DONT_CARE" },
|
||||
{ GL_DOUBLEBUFFER ,"GL_DOUBLEBUFFER" },
|
||||
#ifdef GL_DOUBLE_EXT
|
||||
{ GL_DOUBLE_EXT ,"GL_DOUBLE_EXT" },
|
||||
#endif
|
||||
{ GL_DRAW_BUFFER ,"GL_DRAW_BUFFER" },
|
||||
{ GL_DRAW_PIXEL_TOKEN ,"GL_DRAW_PIXEL_TOKEN" },
|
||||
{ GL_DST_ALPHA ,"GL_DST_ALPHA" },
|
||||
{ GL_DST_COLOR ,"GL_DST_COLOR" },
|
||||
{ GL_EDGE_FLAG ,"GL_EDGE_FLAG" },
|
||||
#ifdef GL_EDGE_FLAG_ARRAY_EXT
|
||||
{ GL_EDGE_FLAG_ARRAY_COUNT_EXT,"GL_EDGE_FLAG_ARRAY_COUNT_EXT" },
|
||||
{ GL_EDGE_FLAG_ARRAY_EXT ,"GL_EDGE_FLAG_ARRAY_EXT" },
|
||||
{ GL_EDGE_FLAG_ARRAY_POINTER_EXT,"GL_EDGE_FLAG_ARRAY_POINTER_EXT" },
|
||||
{ GL_EDGE_FLAG_ARRAY_STRIDE_EXT,"GL_EDGE_FLAG_ARRAY_STRIDE_EXT" },
|
||||
#endif
|
||||
{ GL_EMISSION ,"GL_EMISSION" },
|
||||
{ GL_EQUAL ,"GL_EQUAL" },
|
||||
{ GL_EQUIV ,"GL_EQUIV" },
|
||||
{ GL_EXP ,"GL_EXP" },
|
||||
{ GL_EXP2 ,"GL_EXP2" },
|
||||
{ GL_EXTENSIONS ,"GL_EXTENSIONS" },
|
||||
{ GL_EYE_LINEAR ,"GL_EYE_LINEAR" },
|
||||
{ GL_EYE_PLANE ,"GL_EYE_PLANE" },
|
||||
{ GL_FASTEST ,"GL_FASTEST" },
|
||||
{ GL_FEEDBACK ,"GL_FEEDBACK" },
|
||||
{ GL_FILL ,"GL_FILL" },
|
||||
{ GL_FLAT ,"GL_FLAT" },
|
||||
{ GL_FLOAT ,"GL_FLOAT" },
|
||||
{ GL_FOG ,"GL_FOG" },
|
||||
{ GL_FOG_COLOR ,"GL_FOG_COLOR" },
|
||||
{ GL_FOG_DENSITY ,"GL_FOG_DENSITY" },
|
||||
{ GL_FOG_END ,"GL_FOG_END" },
|
||||
{ GL_FOG_HINT ,"GL_FOG_HINT" },
|
||||
{ GL_FOG_INDEX ,"GL_FOG_INDEX" },
|
||||
{ GL_FOG_MODE ,"GL_FOG_MODE" },
|
||||
{ GL_FOG_START ,"GL_FOG_START" },
|
||||
{ GL_FRONT ,"GL_FRONT" },
|
||||
{ GL_FRONT_AND_BACK ,"GL_FRONT_AND_BACK" },
|
||||
{ GL_FRONT_FACE ,"GL_FRONT_FACE" },
|
||||
{ GL_FRONT_LEFT ,"GL_FRONT_LEFT" },
|
||||
{ GL_FRONT_RIGHT ,"GL_FRONT_RIGHT" },
|
||||
#ifdef GL_FUNC_ADD_EXT
|
||||
{ GL_FUNC_ADD_EXT ,"GL_FUNC_ADD_EXT" },
|
||||
{ GL_FUNC_REVERSE_SUBTRACT_EXT,"GL_FUNC_REVERSE_SUBTRACT_EXT" },
|
||||
{ GL_FUNC_SUBTRACT_EXT ,"GL_FUNC_SUBTRACT_EXT" },
|
||||
#endif
|
||||
{ GL_GEQUAL ,"GL_GEQUAL" },
|
||||
{ GL_GREATER ,"GL_GREATER" },
|
||||
{ GL_GREEN ,"GL_GREEN" },
|
||||
{ GL_GREEN_BIAS ,"GL_GREEN_BIAS" },
|
||||
{ GL_GREEN_BITS ,"GL_GREEN_BITS" },
|
||||
{ GL_GREEN_SCALE ,"GL_GREEN_SCALE" },
|
||||
{ GL_INCR ,"GL_INCR" },
|
||||
#ifdef GL_INDEX_ARRAY_EXT
|
||||
{ GL_INDEX_ARRAY_COUNT_EXT ,"GL_INDEX_ARRAY_COUNT_EXT" },
|
||||
{ GL_INDEX_ARRAY_EXT ,"GL_INDEX_ARRAY_EXT" },
|
||||
{ GL_INDEX_ARRAY_POINTER_EXT ,"GL_INDEX_ARRAY_POINTER_EXT" },
|
||||
{ GL_INDEX_ARRAY_STRIDE_EXT ,"GL_INDEX_ARRAY_STRIDE_EXT" },
|
||||
{ GL_INDEX_ARRAY_TYPE_EXT ,"GL_INDEX_ARRAY_TYPE_EXT" },
|
||||
#endif
|
||||
{ GL_INDEX_BITS ,"GL_INDEX_BITS" },
|
||||
{ GL_INDEX_CLEAR_VALUE ,"GL_INDEX_CLEAR_VALUE" },
|
||||
{ GL_INDEX_MODE ,"GL_INDEX_MODE" },
|
||||
{ GL_INDEX_OFFSET ,"GL_INDEX_OFFSET" },
|
||||
{ GL_INDEX_SHIFT ,"GL_INDEX_SHIFT" },
|
||||
{ GL_INDEX_WRITEMASK ,"GL_INDEX_WRITEMASK" },
|
||||
{ GL_INT ,"GL_INT" },
|
||||
{ GL_INVALID_ENUM ,"GL_INVALID_ENUM" },
|
||||
{ GL_INVALID_OPERATION ,"GL_INVALID_OPERATION" },
|
||||
{ GL_INVALID_VALUE ,"GL_INVALID_VALUE" },
|
||||
{ GL_INVERT ,"GL_INVERT" },
|
||||
{ GL_KEEP ,"GL_KEEP" },
|
||||
{ GL_LEFT ,"GL_LEFT" },
|
||||
{ GL_LEQUAL ,"GL_LEQUAL" },
|
||||
{ GL_LESS ,"GL_LESS" },
|
||||
{ GL_LIGHT0 ,"GL_LIGHT0" },
|
||||
{ GL_LIGHT1 ,"GL_LIGHT1" },
|
||||
{ GL_LIGHT2 ,"GL_LIGHT2" },
|
||||
{ GL_LIGHT3 ,"GL_LIGHT3" },
|
||||
{ GL_LIGHT4 ,"GL_LIGHT4" },
|
||||
{ GL_LIGHT5 ,"GL_LIGHT5" },
|
||||
{ GL_LIGHT6 ,"GL_LIGHT6" },
|
||||
{ GL_LIGHT7 ,"GL_LIGHT7" },
|
||||
{ GL_LIGHTING ,"GL_LIGHTING" },
|
||||
{ GL_LIGHT_MODEL_AMBIENT ,"GL_LIGHT_MODEL_AMBIENT" },
|
||||
{ GL_LIGHT_MODEL_LOCAL_VIEWER ,"GL_LIGHT_MODEL_LOCAL_VIEWER" },
|
||||
{ GL_LIGHT_MODEL_TWO_SIDE ,"GL_LIGHT_MODEL_TWO_SIDE" },
|
||||
{ GL_LINE ,"GL_LINE" },
|
||||
{ GL_LINEAR ,"GL_LINEAR" },
|
||||
{ GL_LINEAR_ATTENUATION ,"GL_LINEAR_ATTENUATION" },
|
||||
{ GL_LINEAR_MIPMAP_LINEAR ,"GL_LINEAR_MIPMAP_LINEAR" },
|
||||
{ GL_LINEAR_MIPMAP_NEAREST ,"GL_LINEAR_MIPMAP_NEAREST" },
|
||||
{ GL_LINE_LOOP ,"GL_LINE_LOOP" },
|
||||
{ GL_LINE_RESET_TOKEN ,"GL_LINE_RESET_TOKEN" },
|
||||
{ GL_LINE_SMOOTH ,"GL_LINE_SMOOTH" },
|
||||
{ GL_LINE_SMOOTH_HINT ,"GL_LINE_SMOOTH_HINT" },
|
||||
{ GL_LINE_STIPPLE ,"GL_LINE_STIPPLE" },
|
||||
{ GL_LINE_STIPPLE_PATTERN ,"GL_LINE_STIPPLE_PATTERN" },
|
||||
{ GL_LINE_STIPPLE_REPEAT ,"GL_LINE_STIPPLE_REPEAT" },
|
||||
{ GL_LINE_STRIP ,"GL_LINE_STRIP" },
|
||||
{ GL_LINE_TOKEN ,"GL_LINE_TOKEN" },
|
||||
{ GL_LINE_WIDTH ,"GL_LINE_WIDTH" },
|
||||
{ GL_LINE_WIDTH_GRANULARITY ,"GL_LINE_WIDTH_GRANULARITY" },
|
||||
{ GL_LINE_WIDTH_RANGE ,"GL_LINE_WIDTH_RANGE" },
|
||||
{ GL_LIST_BASE ,"GL_LIST_BASE" },
|
||||
{ GL_LIST_INDEX ,"GL_LIST_INDEX" },
|
||||
{ GL_LIST_MODE ,"GL_LIST_MODE" },
|
||||
{ GL_LOAD ,"GL_LOAD" },
|
||||
{ GL_LOGIC_OP ,"GL_LOGIC_OP" },
|
||||
{ GL_LOGIC_OP_MODE ,"GL_LOGIC_OP_MODE" },
|
||||
{ GL_LUMINANCE ,"GL_LUMINANCE" },
|
||||
{ GL_LUMINANCE_ALPHA ,"GL_LUMINANCE_ALPHA" },
|
||||
{ GL_MAP1_COLOR_4 ,"GL_MAP1_COLOR_4" },
|
||||
{ GL_MAP1_GRID_DOMAIN ,"GL_MAP1_GRID_DOMAIN" },
|
||||
{ GL_MAP1_GRID_SEGMENTS ,"GL_MAP1_GRID_SEGMENTS" },
|
||||
{ GL_MAP1_INDEX ,"GL_MAP1_INDEX" },
|
||||
{ GL_MAP1_NORMAL ,"GL_MAP1_NORMAL" },
|
||||
{ GL_MAP1_TEXTURE_COORD_1 ,"GL_MAP1_TEXTURE_COORD_1" },
|
||||
{ GL_MAP1_TEXTURE_COORD_2 ,"GL_MAP1_TEXTURE_COORD_2" },
|
||||
{ GL_MAP1_TEXTURE_COORD_3 ,"GL_MAP1_TEXTURE_COORD_3" },
|
||||
{ GL_MAP1_TEXTURE_COORD_4 ,"GL_MAP1_TEXTURE_COORD_4" },
|
||||
{ GL_MAP1_VERTEX_3 ,"GL_MAP1_VERTEX_3" },
|
||||
{ GL_MAP1_VERTEX_4 ,"GL_MAP1_VERTEX_4" },
|
||||
{ GL_MAP2_COLOR_4 ,"GL_MAP2_COLOR_4" },
|
||||
{ GL_MAP2_GRID_DOMAIN ,"GL_MAP2_GRID_DOMAIN" },
|
||||
{ GL_MAP2_GRID_SEGMENTS ,"GL_MAP2_GRID_SEGMENTS" },
|
||||
{ GL_MAP2_INDEX ,"GL_MAP2_INDEX" },
|
||||
{ GL_MAP2_NORMAL ,"GL_MAP2_NORMAL" },
|
||||
{ GL_MAP2_TEXTURE_COORD_1 ,"GL_MAP2_TEXTURE_COORD_1" },
|
||||
{ GL_MAP2_TEXTURE_COORD_2 ,"GL_MAP2_TEXTURE_COORD_2" },
|
||||
{ GL_MAP2_TEXTURE_COORD_3 ,"GL_MAP2_TEXTURE_COORD_3" },
|
||||
{ GL_MAP2_TEXTURE_COORD_4 ,"GL_MAP2_TEXTURE_COORD_4" },
|
||||
{ GL_MAP2_VERTEX_3 ,"GL_MAP2_VERTEX_3" },
|
||||
{ GL_MAP2_VERTEX_4 ,"GL_MAP2_VERTEX_4" },
|
||||
{ GL_MAP_COLOR ,"GL_MAP_COLOR" },
|
||||
{ GL_MAP_STENCIL ,"GL_MAP_STENCIL" },
|
||||
{ GL_MATRIX_MODE ,"GL_MATRIX_MODE" },
|
||||
{ GL_MAX_ATTRIB_STACK_DEPTH ,"GL_MAX_ATTRIB_STACK_DEPTH" },
|
||||
{ GL_MAX_CLIP_PLANES ,"GL_MAX_CLIP_PLANES" },
|
||||
{ GL_MAX_EVAL_ORDER ,"GL_MAX_EVAL_ORDER" },
|
||||
#ifdef GL_MAX_EXT
|
||||
{ GL_MAX_EXT ,"GL_MAX_EXT" },
|
||||
#endif
|
||||
{ GL_MAX_LIGHTS ,"GL_MAX_LIGHTS" },
|
||||
{ GL_MAX_LIST_NESTING ,"GL_MAX_LIST_NESTING" },
|
||||
{ GL_MAX_MODELVIEW_STACK_DEPTH,"GL_MAX_MODELVIEW_STACK_DEPTH" },
|
||||
{ GL_MAX_NAME_STACK_DEPTH ,"GL_MAX_NAME_STACK_DEPTH" },
|
||||
{ GL_MAX_PIXEL_MAP_TABLE ,"GL_MAX_PIXEL_MAP_TABLE" },
|
||||
{ GL_MAX_PROJECTION_STACK_DEPTH,"GL_MAX_PROJECTION_STACK_DEPTH" },
|
||||
{ GL_MAX_TEXTURE_SIZE ,"GL_MAX_TEXTURE_SIZE" },
|
||||
{ GL_MAX_TEXTURE_STACK_DEPTH ,"GL_MAX_TEXTURE_STACK_DEPTH" },
|
||||
{ GL_MAX_VIEWPORT_DIMS ,"GL_MAX_VIEWPORT_DIMS" },
|
||||
#ifdef GL_MIN_EXT
|
||||
{ GL_MIN_EXT ,"GL_MIN_EXT" },
|
||||
#endif
|
||||
{ GL_MODELVIEW ,"GL_MODELVIEW" },
|
||||
{ GL_MODELVIEW_MATRIX ,"GL_MODELVIEW_MATRIX" },
|
||||
{ GL_MODELVIEW_STACK_DEPTH ,"GL_MODELVIEW_STACK_DEPTH" },
|
||||
{ GL_MODULATE ,"GL_MODULATE" },
|
||||
{ GL_MULT ,"GL_MULT" },
|
||||
{ GL_NAME_STACK_DEPTH ,"GL_NAME_STACK_DEPTH" },
|
||||
{ GL_NAND ,"GL_NAND" },
|
||||
{ GL_NEAREST ,"GL_NEAREST" },
|
||||
{ GL_NEAREST_MIPMAP_LINEAR ,"GL_NEAREST_MIPMAP_LINEAR" },
|
||||
{ GL_NEAREST_MIPMAP_NEAREST ,"GL_NEAREST_MIPMAP_NEAREST" },
|
||||
{ GL_NEVER ,"GL_NEVER" },
|
||||
{ GL_NICEST ,"GL_NICEST" },
|
||||
{ GL_NOOP ,"GL_NOOP" },
|
||||
{ GL_NOR ,"GL_NOR" },
|
||||
{ GL_NORMALIZE ,"GL_NORMALIZE" },
|
||||
#ifdef GL_NORMAL_ARRAY_EXT
|
||||
{ GL_NORMAL_ARRAY_COUNT_EXT ,"GL_NORMAL_ARRAY_COUNT_EXT" },
|
||||
{ GL_NORMAL_ARRAY_EXT ,"GL_NORMAL_ARRAY_EXT" },
|
||||
{ GL_NORMAL_ARRAY_POINTER_EXT ,"GL_NORMAL_ARRAY_POINTER_EXT" },
|
||||
{ GL_NORMAL_ARRAY_STRIDE_EXT ,"GL_NORMAL_ARRAY_STRIDE_EXT" },
|
||||
{ GL_NORMAL_ARRAY_TYPE_EXT ,"GL_NORMAL_ARRAY_TYPE_EXT" },
|
||||
#endif
|
||||
{ GL_NOTEQUAL ,"GL_NOTEQUAL" },
|
||||
{ GL_OBJECT_LINEAR ,"GL_OBJECT_LINEAR" },
|
||||
{ GL_OBJECT_PLANE ,"GL_OBJECT_PLANE" },
|
||||
#ifdef GL_ONE_MINUS_CONSTANT_ALPHA_EXT
|
||||
{ GL_ONE_MINUS_CONSTANT_ALPHA_EXT,"GL_ONE_MINUS_CONSTANT_ALPHA_EXT" },
|
||||
{ GL_ONE_MINUS_CONSTANT_COLOR_EXT,"GL_ONE_MINUS_CONSTANT_COLOR_EXT" },
|
||||
#endif
|
||||
{ GL_ONE_MINUS_DST_ALPHA ,"GL_ONE_MINUS_DST_ALPHA" },
|
||||
{ GL_ONE_MINUS_DST_COLOR ,"GL_ONE_MINUS_DST_COLOR" },
|
||||
{ GL_ONE_MINUS_SRC_ALPHA ,"GL_ONE_MINUS_SRC_ALPHA" },
|
||||
{ GL_ONE_MINUS_SRC_COLOR ,"GL_ONE_MINUS_SRC_COLOR" },
|
||||
{ GL_OR ,"GL_OR" },
|
||||
{ GL_ORDER ,"GL_ORDER" },
|
||||
{ GL_OR_INVERTED ,"GL_OR_INVERTED" },
|
||||
{ GL_OR_REVERSE ,"GL_OR_REVERSE" },
|
||||
{ GL_OUT_OF_MEMORY ,"GL_OUT_OF_MEMORY" },
|
||||
{ GL_PACK_ALIGNMENT ,"GL_PACK_ALIGNMENT" },
|
||||
{ GL_PACK_LSB_FIRST ,"GL_PACK_LSB_FIRST" },
|
||||
{ GL_PACK_ROW_LENGTH ,"GL_PACK_ROW_LENGTH" },
|
||||
{ GL_PACK_SKIP_PIXELS ,"GL_PACK_SKIP_PIXELS" },
|
||||
{ GL_PACK_SKIP_ROWS ,"GL_PACK_SKIP_ROWS" },
|
||||
{ GL_PACK_SWAP_BYTES ,"GL_PACK_SWAP_BYTES" },
|
||||
{ GL_PASS_THROUGH_TOKEN ,"GL_PASS_THROUGH_TOKEN" },
|
||||
{ GL_PERSPECTIVE_CORRECTION_HINT,"GL_PERSPECTIVE_CORRECTION_HINT" },
|
||||
{ GL_PIXEL_MAP_A_TO_A ,"GL_PIXEL_MAP_A_TO_A" },
|
||||
{ GL_PIXEL_MAP_A_TO_A_SIZE ,"GL_PIXEL_MAP_A_TO_A_SIZE" },
|
||||
{ GL_PIXEL_MAP_B_TO_B ,"GL_PIXEL_MAP_B_TO_B" },
|
||||
{ GL_PIXEL_MAP_B_TO_B_SIZE ,"GL_PIXEL_MAP_B_TO_B_SIZE" },
|
||||
{ GL_PIXEL_MAP_G_TO_G ,"GL_PIXEL_MAP_G_TO_G" },
|
||||
{ GL_PIXEL_MAP_G_TO_G_SIZE ,"GL_PIXEL_MAP_G_TO_G_SIZE" },
|
||||
{ GL_PIXEL_MAP_I_TO_A ,"GL_PIXEL_MAP_I_TO_A" },
|
||||
{ GL_PIXEL_MAP_I_TO_A_SIZE ,"GL_PIXEL_MAP_I_TO_A_SIZE" },
|
||||
{ GL_PIXEL_MAP_I_TO_B ,"GL_PIXEL_MAP_I_TO_B" },
|
||||
{ GL_PIXEL_MAP_I_TO_B_SIZE ,"GL_PIXEL_MAP_I_TO_B_SIZE" },
|
||||
{ GL_PIXEL_MAP_I_TO_G ,"GL_PIXEL_MAP_I_TO_G" },
|
||||
{ GL_PIXEL_MAP_I_TO_G_SIZE ,"GL_PIXEL_MAP_I_TO_G_SIZE" },
|
||||
{ GL_PIXEL_MAP_I_TO_I ,"GL_PIXEL_MAP_I_TO_I" },
|
||||
{ GL_PIXEL_MAP_I_TO_I_SIZE ,"GL_PIXEL_MAP_I_TO_I_SIZE" },
|
||||
{ GL_PIXEL_MAP_I_TO_R ,"GL_PIXEL_MAP_I_TO_R" },
|
||||
{ GL_PIXEL_MAP_I_TO_R_SIZE ,"GL_PIXEL_MAP_I_TO_R_SIZE" },
|
||||
{ GL_PIXEL_MAP_R_TO_R ,"GL_PIXEL_MAP_R_TO_R" },
|
||||
{ GL_PIXEL_MAP_R_TO_R_SIZE ,"GL_PIXEL_MAP_R_TO_R_SIZE" },
|
||||
{ GL_PIXEL_MAP_S_TO_S ,"GL_PIXEL_MAP_S_TO_S" },
|
||||
{ GL_PIXEL_MAP_S_TO_S_SIZE ,"GL_PIXEL_MAP_S_TO_S_SIZE" },
|
||||
{ GL_POINT ,"GL_POINT" },
|
||||
{ GL_POINT_SIZE ,"GL_POINT_SIZE" },
|
||||
{ GL_POINT_SIZE_GRANULARITY ,"GL_POINT_SIZE_GRANULARITY" },
|
||||
{ GL_POINT_SIZE_RANGE ,"GL_POINT_SIZE_RANGE" },
|
||||
{ GL_POINT_SMOOTH ,"GL_POINT_SMOOTH" },
|
||||
{ GL_POINT_SMOOTH_HINT ,"GL_POINT_SMOOTH_HINT" },
|
||||
{ GL_POINT_TOKEN ,"GL_POINT_TOKEN" },
|
||||
{ GL_POLYGON ,"GL_POLYGON" },
|
||||
{ GL_POLYGON_MODE ,"GL_POLYGON_MODE" },
|
||||
{ GL_POLYGON_SMOOTH ,"GL_POLYGON_SMOOTH" },
|
||||
{ GL_POLYGON_SMOOTH_HINT ,"GL_POLYGON_SMOOTH_HINT" },
|
||||
{ GL_POLYGON_STIPPLE ,"GL_POLYGON_STIPPLE" },
|
||||
#ifdef GL_POLYGON_OFFSET_EXT
|
||||
{ GL_POLYGON_OFFSET_BIAS_EXT ,"GL_POLYGON_OFFSET_BIAS_EXT" },
|
||||
{ GL_POLYGON_OFFSET_EXT ,"GL_POLYGON_OFFSET_EXT" },
|
||||
{ GL_POLYGON_OFFSET_FACTOR_EXT,"GL_POLYGON_OFFSET_FACTOR_EXT" },
|
||||
#endif
|
||||
{ GL_POLYGON_TOKEN ,"GL_POLYGON_TOKEN" },
|
||||
{ GL_POSITION ,"GL_POSITION" },
|
||||
{ GL_PROJECTION ,"GL_PROJECTION" },
|
||||
{ GL_PROJECTION_MATRIX ,"GL_PROJECTION_MATRIX" },
|
||||
{ GL_PROJECTION_STACK_DEPTH ,"GL_PROJECTION_STACK_DEPTH" },
|
||||
{ GL_Q ,"GL_Q" },
|
||||
{ GL_QUADRATIC_ATTENUATION ,"GL_QUADRATIC_ATTENUATION" },
|
||||
{ GL_QUADS ,"GL_QUADS" },
|
||||
{ GL_QUAD_STRIP ,"GL_QUAD_STRIP" },
|
||||
{ GL_R ,"GL_R" },
|
||||
{ GL_READ_BUFFER ,"GL_READ_BUFFER" },
|
||||
{ GL_RED ,"GL_RED" },
|
||||
{ GL_RED_BIAS ,"GL_RED_BIAS" },
|
||||
{ GL_RED_BITS ,"GL_RED_BITS" },
|
||||
{ GL_RED_SCALE ,"GL_RED_SCALE" },
|
||||
{ GL_RENDER ,"GL_RENDER" },
|
||||
{ GL_RENDERER ,"GL_RENDERER" },
|
||||
{ GL_RENDER_MODE ,"GL_RENDER_MODE" },
|
||||
{ GL_REPEAT ,"GL_REPEAT" },
|
||||
{ GL_REPLACE ,"GL_REPLACE" },
|
||||
#ifdef GL_REPLACE_EXT
|
||||
{ GL_REPLACE_EXT ,"GL_REPLACE_EXT" },
|
||||
#endif
|
||||
{ GL_RETURN ,"GL_RETURN" },
|
||||
{ GL_RGB ,"GL_RGB" },
|
||||
{ GL_RGBA ,"GL_RGBA" },
|
||||
{ GL_RGBA_MODE ,"GL_RGBA_MODE" },
|
||||
{ GL_RIGHT ,"GL_RIGHT" },
|
||||
{ GL_S ,"GL_S" },
|
||||
{ GL_SCISSOR_BOX ,"GL_SCISSOR_BOX" },
|
||||
{ GL_SCISSOR_TEST ,"GL_SCISSOR_TEST" },
|
||||
{ GL_SELECT ,"GL_SELECT" },
|
||||
{ GL_SET ,"GL_SET" },
|
||||
{ GL_SHADE_MODEL ,"GL_SHADE_MODEL" },
|
||||
{ GL_SHININESS ,"GL_SHININESS" },
|
||||
{ GL_SHORT ,"GL_SHORT" },
|
||||
{ GL_SMOOTH ,"GL_SMOOTH" },
|
||||
{ GL_SPECULAR ,"GL_SPECULAR" },
|
||||
{ GL_SPHERE_MAP ,"GL_SPHERE_MAP" },
|
||||
{ GL_SPOT_CUTOFF ,"GL_SPOT_CUTOFF" },
|
||||
{ GL_SPOT_DIRECTION ,"GL_SPOT_DIRECTION" },
|
||||
{ GL_SPOT_EXPONENT ,"GL_SPOT_EXPONENT" },
|
||||
{ GL_SRC_ALPHA ,"GL_SRC_ALPHA" },
|
||||
{ GL_SRC_ALPHA_SATURATE ,"GL_SRC_ALPHA_SATURATE" },
|
||||
{ GL_SRC_COLOR ,"GL_SRC_COLOR" },
|
||||
{ GL_STACK_OVERFLOW ,"GL_STACK_OVERFLOW" },
|
||||
{ GL_STACK_UNDERFLOW ,"GL_STACK_UNDERFLOW" },
|
||||
{ GL_STENCIL ,"GL_STENCIL" },
|
||||
{ GL_STENCIL_BITS ,"GL_STENCIL_BITS" },
|
||||
{ GL_STENCIL_CLEAR_VALUE ,"GL_STENCIL_CLEAR_VALUE" },
|
||||
{ GL_STENCIL_FAIL ,"GL_STENCIL_FAIL" },
|
||||
{ GL_STENCIL_FUNC ,"GL_STENCIL_FUNC" },
|
||||
{ GL_STENCIL_INDEX ,"GL_STENCIL_INDEX" },
|
||||
{ GL_STENCIL_PASS_DEPTH_FAIL ,"GL_STENCIL_PASS_DEPTH_FAIL" },
|
||||
{ GL_STENCIL_PASS_DEPTH_PASS ,"GL_STENCIL_PASS_DEPTH_PASS" },
|
||||
{ GL_STENCIL_REF ,"GL_STENCIL_REF" },
|
||||
{ GL_STENCIL_TEST ,"GL_STENCIL_TEST" },
|
||||
{ GL_STENCIL_VALUE_MASK ,"GL_STENCIL_VALUE_MASK" },
|
||||
{ GL_STENCIL_WRITEMASK ,"GL_STENCIL_WRITEMASK" },
|
||||
{ GL_STEREO ,"GL_STEREO" },
|
||||
{ GL_SUBPIXEL_BITS ,"GL_SUBPIXEL_BITS" },
|
||||
{ GL_T ,"GL_T" },
|
||||
{ GL_TEXTURE ,"GL_TEXTURE" },
|
||||
{ GL_TEXTURE_1D ,"GL_TEXTURE_1D" },
|
||||
{ GL_TEXTURE_2D ,"GL_TEXTURE_2D" },
|
||||
{ GL_TEXTURE_BORDER ,"GL_TEXTURE_BORDER" },
|
||||
{ GL_TEXTURE_BORDER_COLOR ,"GL_TEXTURE_BORDER_COLOR" },
|
||||
{ GL_TEXTURE_COMPONENTS ,"GL_TEXTURE_COMPONENTS" },
|
||||
#ifdef GL_TEXTURE_COORD_ARRAY_EXT
|
||||
{ GL_TEXTURE_COORD_ARRAY_COUNT_EXT,"GL_TEXTURE_COORD_ARRAY_COUNT_EXT" },
|
||||
{ GL_TEXTURE_COORD_ARRAY_EXT ,"GL_TEXTURE_COORD_ARRAY_EXT" },
|
||||
{ GL_TEXTURE_COORD_ARRAY_POINTER_EXT,"GL_TEXTURE_COORD_ARRAY_POINTER_EXT" },
|
||||
{ GL_TEXTURE_COORD_ARRAY_SIZE_EXT,"GL_TEXTURE_COORD_ARRAY_SIZE_EXT" },
|
||||
{ GL_TEXTURE_COORD_ARRAY_STRIDE_EXT,"GL_TEXTURE_COORD_ARRAY_STRIDE_EXT" },
|
||||
{ GL_TEXTURE_COORD_ARRAY_TYPE_EXT,"GL_TEXTURE_COORD_ARRAY_TYPE_EXT" },
|
||||
#endif
|
||||
{ GL_TEXTURE_ENV ,"GL_TEXTURE_ENV" },
|
||||
{ GL_TEXTURE_ENV_COLOR ,"GL_TEXTURE_ENV_COLOR" },
|
||||
{ GL_TEXTURE_ENV_MODE ,"GL_TEXTURE_ENV_MODE" },
|
||||
{ GL_TEXTURE_GEN_MODE ,"GL_TEXTURE_GEN_MODE" },
|
||||
{ GL_TEXTURE_GEN_Q ,"GL_TEXTURE_GEN_Q" },
|
||||
{ GL_TEXTURE_GEN_R ,"GL_TEXTURE_GEN_R" },
|
||||
{ GL_TEXTURE_GEN_S ,"GL_TEXTURE_GEN_S" },
|
||||
{ GL_TEXTURE_GEN_T ,"GL_TEXTURE_GEN_T" },
|
||||
{ GL_TEXTURE_HEIGHT ,"GL_TEXTURE_HEIGHT" },
|
||||
{ GL_TEXTURE_MAG_FILTER ,"GL_TEXTURE_MAG_FILTER" },
|
||||
{ GL_TEXTURE_MATRIX ,"GL_TEXTURE_MATRIX" },
|
||||
{ GL_TEXTURE_MIN_FILTER ,"GL_TEXTURE_MIN_FILTER" },
|
||||
{ GL_TEXTURE_STACK_DEPTH ,"GL_TEXTURE_STACK_DEPTH" },
|
||||
{ GL_TEXTURE_WIDTH ,"GL_TEXTURE_WIDTH" },
|
||||
{ GL_TEXTURE_WRAP_S ,"GL_TEXTURE_WRAP_S" },
|
||||
{ GL_TEXTURE_WRAP_T ,"GL_TEXTURE_WRAP_T" },
|
||||
{ GL_TRIANGLES ,"GL_TRIANGLES" },
|
||||
{ GL_TRIANGLE_FAN ,"GL_TRIANGLE_FAN" },
|
||||
{ GL_TRIANGLE_STRIP ,"GL_TRIANGLE_STRIP" },
|
||||
{ GL_UNPACK_ALIGNMENT ,"GL_UNPACK_ALIGNMENT" },
|
||||
{ GL_UNPACK_LSB_FIRST ,"GL_UNPACK_LSB_FIRST" },
|
||||
{ GL_UNPACK_ROW_LENGTH ,"GL_UNPACK_ROW_LENGTH" },
|
||||
{ GL_UNPACK_SKIP_PIXELS ,"GL_UNPACK_SKIP_PIXELS" },
|
||||
{ GL_UNPACK_SKIP_ROWS ,"GL_UNPACK_SKIP_ROWS" },
|
||||
{ GL_UNPACK_SWAP_BYTES ,"GL_UNPACK_SWAP_BYTES" },
|
||||
{ GL_UNSIGNED_BYTE ,"GL_UNSIGNED_BYTE" },
|
||||
{ GL_UNSIGNED_INT ,"GL_UNSIGNED_INT" },
|
||||
{ GL_UNSIGNED_SHORT ,"GL_UNSIGNED_SHORT" },
|
||||
{ GL_VENDOR ,"GL_VENDOR" },
|
||||
{ GL_VERSION ,"GL_VERSION" },
|
||||
#ifdef GL_VERTEX_ARRAY_EXT
|
||||
{ GL_VERTEX_ARRAY_COUNT_EXT ,"GL_VERTEX_ARRAY_COUNT_EXT" },
|
||||
{ GL_VERTEX_ARRAY_EXT ,"GL_VERTEX_ARRAY_EXT" },
|
||||
{ GL_VERTEX_ARRAY_POINTER_EXT ,"GL_VERTEX_ARRAY_POINTER_EXT" },
|
||||
{ GL_VERTEX_ARRAY_SIZE_EXT ,"GL_VERTEX_ARRAY_SIZE_EXT" },
|
||||
{ GL_VERTEX_ARRAY_STRIDE_EXT ,"GL_VERTEX_ARRAY_STRIDE_EXT" },
|
||||
{ GL_VERTEX_ARRAY_TYPE_EXT ,"GL_VERTEX_ARRAY_TYPE_EXT" },
|
||||
#endif
|
||||
{ GL_VIEWPORT ,"GL_VIEWPORT" },
|
||||
{ GL_XOR ,"GL_XOR" },
|
||||
{ GL_ZOOM_X ,"GL_ZOOM_X" },
|
||||
{ GL_ZOOM_Y ,"GL_ZOOM_Y" },
|
||||
|
||||
/* Magic end-marker - do not remove! */
|
||||
{ GL_ZERO, NULL }
|
||||
} ;
|
||||
|
||||
|
||||
int xglTraceIsEnabled ( char *gl_function_name )
|
||||
{
|
||||
static int frameno = 0 ;
|
||||
static int countdown = 0 ;
|
||||
|
||||
if ( strcmp ( gl_function_name, "glutSwapBuffers" ) == 0 )
|
||||
{
|
||||
if ( countdown == 0 )
|
||||
{
|
||||
char s [ 100 ] ;
|
||||
|
||||
fprintf ( stderr, "\nContinue Tracing after frame %d [Yes,No,Countdown,eXit] ?", ++frameno ) ;
|
||||
gets ( s ) ;
|
||||
|
||||
if ( s[0] == 'x' )
|
||||
exit ( 1 ) ;
|
||||
|
||||
xglTraceOn = ( s[0] != 'n' && s[0] != 'c' ) ;
|
||||
|
||||
if ( s[0] == 'c' )
|
||||
{
|
||||
fprintf ( stderr, "\nHow many frames should I wait until I ask again?" ) ;
|
||||
gets ( s ) ;
|
||||
countdown = atoi(s) ;
|
||||
}
|
||||
|
||||
fprintf ( xglTraceFd, "/* Frame %d - tracing %s */\n", frameno, xglTraceOn ? "ON" : "OFF" ) ;
|
||||
}
|
||||
else
|
||||
countdown-- ;
|
||||
}
|
||||
|
||||
return xglTraceOn ;
|
||||
}
|
||||
|
||||
|
||||
int xglExecuteIsEnabled ( char *gl_function_name )
|
||||
{
|
||||
return TRUE ;
|
||||
}
|
||||
|
||||
char *xglExpandGLenum ( GLenum x )
|
||||
{
|
||||
static GLenum last_val = GL_NONE ;
|
||||
static char *last_str = NULL ;
|
||||
char *error_message;
|
||||
int i;
|
||||
|
||||
/* Due to ambiguity - these are output as numbers...
|
||||
|
||||
GL_NONE = , GL_ZERO = GL_FALSE = GL_POINTS = 0
|
||||
GL_ONE = , GL_TRUE = GL_LINES = 1
|
||||
*/
|
||||
|
||||
if ( (int) x == 0 ) return "(GLenum) 0" ;
|
||||
if ( (int) x == 1 ) return "(GLenum) 1" ;
|
||||
|
||||
if ( last_val == x ) return last_str ;
|
||||
|
||||
for ( i = 0 ; glenum_string [i].name != NULL ; i++ )
|
||||
if ( glenum_string [i].val == x )
|
||||
return glenum_string [i].name ;
|
||||
|
||||
/*
|
||||
WARNING - this will leak memory - but it is an error condition,
|
||||
so I suppose it's acceptable.
|
||||
You can't declare the 'error_message' string as a
|
||||
static - or else double errors will go mis-reported.
|
||||
*/
|
||||
|
||||
error_message = (char *)malloc( 100 * sizeof(char) ) ;
|
||||
|
||||
sprintf ( error_message, "(GLenum) 0x%04x /* Illegal? */", (int) x ) ;
|
||||
|
||||
return error_message ;
|
||||
}
|
||||
|
||||
static GLbyte b1 [ 1 ], b2 [ 2 ], b3 [ 3 ], b4 [ 4 ] ;
|
||||
static GLdouble d1 [ 1 ], d2 [ 2 ], d3 [ 3 ], d4 [ 4 ] ;
|
||||
static GLfloat f1 [ 1 ], f2 [ 2 ], f3 [ 3 ], f4 [ 4 ] ;
|
||||
static GLint i1 [ 1 ], i2 [ 2 ], i3 [ 3 ], i4 [ 4 ] ;
|
||||
static GLshort s1 [ 1 ], s2 [ 2 ], s3 [ 3 ], s4 [ 4 ] ;
|
||||
static GLubyte ub1 [ 1 ], ub2 [ 2 ], ub3 [ 3 ], ub4 [ 4 ] ;
|
||||
static GLuint ui1 [ 1 ], ui2 [ 2 ], ui3 [ 3 ], ui4 [ 4 ] ;
|
||||
static GLushort us1 [ 1 ], us2 [ 2 ], us3 [ 3 ], us4 [ 4 ] ;
|
||||
|
||||
static GLdouble md [ 16 ] ;
|
||||
static GLfloat mf [ 16 ] ;
|
||||
|
||||
GLdouble *xglBuild1dv ( GLdouble v ) { d1[0] = v ; return d1 ; }
|
||||
GLfloat *xglBuild1fv ( GLfloat v ) { f1[0] = v ; return f1 ; }
|
||||
GLbyte *xglBuild1bv ( GLbyte v ) { b1[0] = v ; return b1 ; }
|
||||
GLint *xglBuild1iv ( GLint v ) { i1[0] = v ; return i1 ; }
|
||||
GLshort *xglBuild1sv ( GLshort v ) { s1[0] = v ; return s1 ; }
|
||||
GLubyte *xglBuild1ubv ( GLubyte v ) { ub1[0] = v ; return ub1 ; }
|
||||
GLuint *xglBuild1uiv ( GLuint v ) { ui1[0] = v ; return ui1 ; }
|
||||
GLushort *xglBuild1usv ( GLushort v ) { us1[0] = v ; return us1 ; }
|
||||
|
||||
GLdouble *xglBuild2dv ( GLdouble v0, GLdouble v1 ) { d2[0] = v0 ; d2[1] = v1 ; return d2 ; }
|
||||
GLfloat *xglBuild2fv ( GLfloat v0, GLfloat v1 ) { f2[0] = v0 ; f2[1] = v1 ; return f2 ; }
|
||||
GLbyte *xglBuild2bv ( GLbyte v0, GLbyte v1 ) { b2[0] = v0 ; b2[1] = v1 ; return b2 ; }
|
||||
GLint *xglBuild2iv ( GLint v0, GLint v1 ) { i2[0] = v0 ; i2[1] = v1 ; return i2 ; }
|
||||
GLshort *xglBuild2sv ( GLshort v0, GLshort v1 ) { s2[0] = v0 ; s2[1] = v1 ; return s2 ; }
|
||||
GLubyte *xglBuild2ubv ( GLubyte v0, GLubyte v1 ) { ub2[0] = v0 ; ub2[1] = v1 ; return ub2 ; }
|
||||
GLuint *xglBuild2uiv ( GLuint v0, GLuint v1 ) { ui2[0] = v0 ; ui2[1] = v1 ; return ui2 ; }
|
||||
GLushort *xglBuild2usv ( GLushort v0, GLushort v1 ) { us2[0] = v0 ; us2[1] = v1 ; return us2 ; }
|
||||
|
||||
GLdouble *xglBuild3dv ( GLdouble v0, GLdouble v1, GLdouble v2 ) { d3[0] = v0 ; d3[1] = v1 ; d3[2] = v2 ; return d3 ; }
|
||||
GLfloat *xglBuild3fv ( GLfloat v0, GLfloat v1, GLfloat v2 ) { f3[0] = v0 ; f3[1] = v1 ; f3[2] = v2 ; return f3 ; }
|
||||
GLbyte *xglBuild3bv ( GLbyte v0, GLbyte v1, GLbyte v2 ) { b3[0] = v0 ; b3[1] = v1 ; b3[2] = v2 ; return b3 ; }
|
||||
GLint *xglBuild3iv ( GLint v0, GLint v1, GLint v2 ) { i3[0] = v0 ; i3[1] = v1 ; i3[2] = v2 ; return i3 ; }
|
||||
GLshort *xglBuild3sv ( GLshort v0, GLshort v1, GLshort v2 ) { s3[0] = v0 ; s3[1] = v1 ; s3[2] = v2 ; return s3 ; }
|
||||
GLubyte *xglBuild3ubv ( GLubyte v0, GLubyte v1, GLubyte v2 ) { ub3[0] = v0 ; ub3[1] = v1 ; ub3[2] = v2 ; return ub3 ; }
|
||||
GLuint *xglBuild3uiv ( GLuint v0, GLuint v1, GLuint v2 ) { ui3[0] = v0 ; ui3[1] = v1 ; ui3[2] = v2 ; return ui3 ; }
|
||||
GLushort *xglBuild3usv ( GLushort v0, GLushort v1, GLushort v2 ) { us3[0] = v0 ; us3[1] = v1 ; us3[2] = v2 ; return us3 ; }
|
||||
|
||||
|
||||
GLdouble *xglBuild4dv ( GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3 ) { d4[0] = v0 ; d4[1] = v1 ; d4[2] = v2 ; d4[3] = v3 ; return d4 ; }
|
||||
GLfloat *xglBuild4fv ( GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3 ) { f4[0] = v0 ; f4[1] = v1 ; f4[2] = v2 ; f4[3] = v3 ; return f4 ; }
|
||||
GLbyte *xglBuild4bv ( GLbyte v0, GLbyte v1, GLbyte v2, GLbyte v3 ) { b4[0] = v0 ; b4[1] = v1 ; b4[2] = v2 ; b4[3] = v3 ; return b4 ; }
|
||||
GLint *xglBuild4iv ( GLint v0, GLint v1, GLint v2, GLint v3 ) { i4[0] = v0 ; i4[1] = v1 ; i4[2] = v2 ; i4[3] = v3 ; return i4 ; }
|
||||
GLshort *xglBuild4sv ( GLshort v0, GLshort v1, GLshort v2, GLshort v3 ) { s4[0] = v0 ; s4[1] = v1 ; s4[2] = v2 ; s4[3] = v3 ; return s4 ; }
|
||||
GLubyte *xglBuild4ubv ( GLubyte v0, GLubyte v1, GLubyte v2, GLubyte v3 ) { ub4[0] = v0 ; ub4[1] = v1 ; ub4[2] = v2 ; ub4[3] = v3 ; return ub4 ; }
|
||||
GLuint *xglBuild4uiv ( GLuint v0, GLuint v1, GLuint v2, GLuint v3 ) { ui4[0] = v0 ; ui4[1] = v1 ; ui4[2] = v2 ; ui4[3] = v3 ; return ui4 ; }
|
||||
GLushort *xglBuild4usv ( GLushort v0, GLushort v1, GLushort v2, GLushort v3 ) { us4[0] = v0 ; us4[1] = v1 ; us4[2] = v2 ; us4[3] = v3 ; return us4 ; }
|
||||
|
||||
GLdouble *xglBuildMatrixd ( GLdouble m0 , GLdouble m1 , GLdouble m2 , GLdouble m3 ,
|
||||
GLdouble m4 , GLdouble m5 , GLdouble m6 , GLdouble m7 ,
|
||||
GLdouble m8 , GLdouble m9 , GLdouble m10, GLdouble m11,
|
||||
GLdouble m12, GLdouble m13, GLdouble m14, GLdouble m15 )
|
||||
{
|
||||
md[ 0] = m0 ; md[ 1] = m1 ; md[ 2] = m2 ; md[ 3] = m3 ;
|
||||
md[ 4] = m4 ; md[ 5] = m5 ; md[ 6] = m6 ; md[ 7] = m7 ;
|
||||
md[ 8] = m8 ; md[ 9] = m9 ; md[10] = m10 ; md[11] = m11 ;
|
||||
md[12] = m12 ; md[13] = m13 ; md[14] = m14 ; md[15] = m15 ;
|
||||
|
||||
return md ;
|
||||
}
|
||||
|
||||
|
||||
GLfloat *xglBuildMatrixf ( GLfloat m0 , GLfloat m1 , GLfloat m2 , GLfloat m3 ,
|
||||
GLfloat m4 , GLfloat m5 , GLfloat m6 , GLfloat m7 ,
|
||||
GLfloat m8 , GLfloat m9 , GLfloat m10, GLfloat m11,
|
||||
GLfloat m12, GLfloat m13, GLfloat m14, GLfloat m15 )
|
||||
{
|
||||
mf[ 0] = m0 ; mf[ 1] = m1 ; mf[ 2] = m2 ; mf[ 3] = m3 ;
|
||||
mf[ 4] = m4 ; mf[ 5] = m5 ; mf[ 6] = m6 ; mf[ 7] = m7 ;
|
||||
mf[ 8] = m8 ; mf[ 9] = m9 ; mf[10] = m10 ; mf[11] = m11 ;
|
||||
mf[12] = m12 ; mf[13] = m13 ; mf[14] = m14 ; mf[15] = m15 ;
|
||||
|
||||
return mf ;
|
||||
}
|
||||
|
||||
@@ -1,471 +0,0 @@
|
||||
|
||||
ChangeLog file for zlib
|
||||
|
||||
Changes in 1.1.3 (9 July 1998)
|
||||
- fix "an inflate input buffer bug that shows up on rare but persistent
|
||||
occasions" (Mark)
|
||||
- fix gzread and gztell for concatenated .gz files (Didier Le Botlan)
|
||||
- fix gzseek(..., SEEK_SET) in write mode
|
||||
- fix crc check after a gzeek (Frank Faubert)
|
||||
- fix miniunzip when the last entry in a zip file is itself a zip file
|
||||
(J Lillge)
|
||||
- add contrib/asm586 and contrib/asm686 (Brian Raiter)
|
||||
See http://www.muppetlabs.com/~breadbox/software/assembly.html
|
||||
- add support for Delphi 3 in contrib/delphi (Bob Dellaca)
|
||||
- add support for C++Builder 3 and Delphi 3 in contrib/delphi2 (Davide Moretti)
|
||||
- do not exit prematurely in untgz if 0 at start of block (Magnus Holmgren)
|
||||
- use macro EXTERN instead of extern to support DLL for BeOS (Sander Stoks)
|
||||
- added a FAQ file
|
||||
|
||||
- Support gzdopen on Mac with Metrowerks (Jason Linhart)
|
||||
- Do not redefine Byte on Mac (Brad Pettit & Jason Linhart)
|
||||
- define SEEK_END too if SEEK_SET is not defined (Albert Chin-A-Young)
|
||||
- avoid some warnings with Borland C (Tom Tanner)
|
||||
- fix a problem in contrib/minizip/zip.c for 16-bit MSDOS (Gilles Vollant)
|
||||
- emulate utime() for WIN32 in contrib/untgz (Gilles Vollant)
|
||||
- allow several arguments to configure (Tim Mooney, Frodo Looijaard)
|
||||
- use libdir and includedir in Makefile.in (Tim Mooney)
|
||||
- support shared libraries on OSF1 V4 (Tim Mooney)
|
||||
- remove so_locations in "make clean" (Tim Mooney)
|
||||
- fix maketree.c compilation error (Glenn, Mark)
|
||||
- Python interface to zlib now in Python 1.5 (Jeremy Hylton)
|
||||
- new Makefile.riscos (Rich Walker)
|
||||
- initialize static descriptors in trees.c for embedded targets (Nick Smith)
|
||||
- use "foo-gz" in example.c for RISCOS and VMS (Nick Smith)
|
||||
- add the OS/2 files in Makefile.in too (Andrew Zabolotny)
|
||||
- fix fdopen and halloc macros for Microsoft C 6.0 (Tom Lane)
|
||||
- fix maketree.c to allow clean compilation of inffixed.h (Mark)
|
||||
- fix parameter check in deflateCopy (Gunther Nikl)
|
||||
- cleanup trees.c, use compressed_len only in debug mode (Christian Spieler)
|
||||
- Many portability patches by Christian Spieler:
|
||||
. zutil.c, zutil.h: added "const" for zmem*
|
||||
. Make_vms.com: fixed some typos
|
||||
. Make_vms.com: msdos/Makefile.*: removed zutil.h from some dependency lists
|
||||
. msdos/Makefile.msc: remove "default rtl link library" info from obj files
|
||||
. msdos/Makefile.*: use model-dependent name for the built zlib library
|
||||
. msdos/Makefile.emx, nt/Makefile.emx, nt/Makefile.gcc:
|
||||
new makefiles, for emx (DOS/OS2), emx&rsxnt and mingw32 (Windows 9x / NT)
|
||||
- use define instead of typedef for Bytef also for MSC small/medium (Tom Lane)
|
||||
- replace __far with _far for better portability (Christian Spieler, Tom Lane)
|
||||
- fix test for errno.h in configure (Tim Newsham)
|
||||
|
||||
Changes in 1.1.2 (19 March 98)
|
||||
- added contrib/minzip, mini zip and unzip based on zlib (Gilles Vollant)
|
||||
See http://www.winimage.com/zLibDll/unzip.html
|
||||
- preinitialize the inflate tables for fixed codes, to make the code
|
||||
completely thread safe (Mark)
|
||||
- some simplifications and slight speed-up to the inflate code (Mark)
|
||||
- fix gzeof on non-compressed files (Allan Schrum)
|
||||
- add -std1 option in configure for OSF1 to fix gzprintf (Martin Mokrejs)
|
||||
- use default value of 4K for Z_BUFSIZE for 16-bit MSDOS (Tim Wegner + Glenn)
|
||||
- added os2/Makefile.def and os2/zlib.def (Andrew Zabolotny)
|
||||
- add shared lib support for UNIX_SV4.2MP (MATSUURA Takanori)
|
||||
- do not wrap extern "C" around system includes (Tom Lane)
|
||||
- mention zlib binding for TCL in README (Andreas Kupries)
|
||||
- added amiga/Makefile.pup for Amiga powerUP SAS/C PPC (Andreas Kleinert)
|
||||
- allow "make install prefix=..." even after configure (Glenn Randers-Pehrson)
|
||||
- allow "configure --prefix $HOME" (Tim Mooney)
|
||||
- remove warnings in example.c and gzio.c (Glenn Randers-Pehrson)
|
||||
- move Makefile.sas to amiga/Makefile.sas
|
||||
|
||||
Changes in 1.1.1 (27 Feb 98)
|
||||
- fix macros _tr_tally_* in deflate.h for debug mode (Glenn Randers-Pehrson)
|
||||
- remove block truncation heuristic which had very marginal effect for zlib
|
||||
(smaller lit_bufsize than in gzip 1.2.4) and degraded a little the
|
||||
compression ratio on some files. This also allows inlining _tr_tally for
|
||||
matches in deflate_slow.
|
||||
- added msdos/Makefile.w32 for WIN32 Microsoft Visual C++ (Bob Frazier)
|
||||
|
||||
Changes in 1.1.0 (24 Feb 98)
|
||||
- do not return STREAM_END prematurely in inflate (John Bowler)
|
||||
- revert to the zlib 1.0.8 inflate to avoid the gcc 2.8.0 bug (Jeremy Buhler)
|
||||
- compile with -DFASTEST to get compression code optimized for speed only
|
||||
- in minigzip, try mmap'ing the input file first (Miguel Albrecht)
|
||||
- increase size of I/O buffers in minigzip.c and gzio.c (not a big gain
|
||||
on Sun but significant on HP)
|
||||
|
||||
- add a pointer to experimental unzip library in README (Gilles Vollant)
|
||||
- initialize variable gcc in configure (Chris Herborth)
|
||||
|
||||
Changes in 1.0.9 (17 Feb 1998)
|
||||
- added gzputs and gzgets functions
|
||||
- do not clear eof flag in gzseek (Mark Diekhans)
|
||||
- fix gzseek for files in transparent mode (Mark Diekhans)
|
||||
- do not assume that vsprintf returns the number of bytes written (Jens Krinke)
|
||||
- replace EXPORT with ZEXPORT to avoid conflict with other programs
|
||||
- added compress2 in zconf.h, zlib.def, zlib.dnt
|
||||
- new asm code from Gilles Vollant in contrib/asm386
|
||||
- simplify the inflate code (Mark):
|
||||
. Replace ZALLOC's in huft_build() with single ZALLOC in inflate_blocks_new()
|
||||
. ZALLOC the length list in inflate_trees_fixed() instead of using stack
|
||||
. ZALLOC the value area for huft_build() instead of using stack
|
||||
. Simplify Z_FINISH check in inflate()
|
||||
|
||||
- Avoid gcc 2.8.0 comparison bug a little differently than zlib 1.0.8
|
||||
- in inftrees.c, avoid cc -O bug on HP (Farshid Elahi)
|
||||
- in zconf.h move the ZLIB_DLL stuff earlier to avoid problems with
|
||||
the declaration of FAR (Gilles VOllant)
|
||||
- install libz.so* with mode 755 (executable) instead of 644 (Marc Lehmann)
|
||||
- read_buf buf parameter of type Bytef* instead of charf*
|
||||
- zmemcpy parameters are of type Bytef*, not charf* (Joseph Strout)
|
||||
- do not redeclare unlink in minigzip.c for WIN32 (John Bowler)
|
||||
- fix check for presence of directories in "make install" (Ian Willis)
|
||||
|
||||
Changes in 1.0.8 (27 Jan 1998)
|
||||
- fixed offsets in contrib/asm386/gvmat32.asm (Gilles Vollant)
|
||||
- fix gzgetc and gzputc for big endian systems (Markus Oberhumer)
|
||||
- added compress2() to allow setting the compression level
|
||||
- include sys/types.h to get off_t on some systems (Marc Lehmann & QingLong)
|
||||
- use constant arrays for the static trees in trees.c instead of computing
|
||||
them at run time (thanks to Ken Raeburn for this suggestion). To create
|
||||
trees.h, compile with GEN_TREES_H and run "make test".
|
||||
- check return code of example in "make test" and display result
|
||||
- pass minigzip command line options to file_compress
|
||||
- simplifying code of inflateSync to avoid gcc 2.8 bug
|
||||
|
||||
- support CC="gcc -Wall" in configure -s (QingLong)
|
||||
- avoid a flush caused by ftell in gzopen for write mode (Ken Raeburn)
|
||||
- fix test for shared library support to avoid compiler warnings
|
||||
- zlib.lib -> zlib.dll in msdos/zlib.rc (Gilles Vollant)
|
||||
- check for TARGET_OS_MAC in addition to MACOS (Brad Pettit)
|
||||
- do not use fdopen for Metrowerks on Mac (Brad Pettit))
|
||||
- add checks for gzputc and gzputc in example.c
|
||||
- avoid warnings in gzio.c and deflate.c (Andreas Kleinert)
|
||||
- use const for the CRC table (Ken Raeburn)
|
||||
- fixed "make uninstall" for shared libraries
|
||||
- use Tracev instead of Trace in infblock.c
|
||||
- in example.c use correct compressed length for test_sync
|
||||
- suppress +vnocompatwarnings in configure for HPUX (not always supported)
|
||||
|
||||
Changes in 1.0.7 (20 Jan 1998)
|
||||
- fix gzseek which was broken in write mode
|
||||
- return error for gzseek to negative absolute position
|
||||
- fix configure for Linux (Chun-Chung Chen)
|
||||
- increase stack space for MSC (Tim Wegner)
|
||||
- get_crc_table and inflateSyncPoint are EXPORTed (Gilles Vollant)
|
||||
- define EXPORTVA for gzprintf (Gilles Vollant)
|
||||
- added man page zlib.3 (Rick Rodgers)
|
||||
- for contrib/untgz, fix makedir() and improve Makefile
|
||||
|
||||
- check gzseek in write mode in example.c
|
||||
- allocate extra buffer for seeks only if gzseek is actually called
|
||||
- avoid signed/unsigned comparisons (Tim Wegner, Gilles Vollant)
|
||||
- add inflateSyncPoint in zconf.h
|
||||
- fix list of exported functions in nt/zlib.dnt and mdsos/zlib.def
|
||||
|
||||
Changes in 1.0.6 (19 Jan 1998)
|
||||
- add functions gzprintf, gzputc, gzgetc, gztell, gzeof, gzseek, gzrewind and
|
||||
gzsetparams (thanks to Roland Giersig and Kevin Ruland for some of this code)
|
||||
- Fix a deflate bug occuring only with compression level 0 (thanks to
|
||||
Andy Buckler for finding this one).
|
||||
- In minigzip, pass transparently also the first byte for .Z files.
|
||||
- return Z_BUF_ERROR instead of Z_OK if output buffer full in uncompress()
|
||||
- check Z_FINISH in inflate (thanks to Marc Schluper)
|
||||
- Implement deflateCopy (thanks to Adam Costello)
|
||||
- make static libraries by default in configure, add --shared option.
|
||||
- move MSDOS or Windows specific files to directory msdos
|
||||
- suppress the notion of partial flush to simplify the interface
|
||||
(but the symbol Z_PARTIAL_FLUSH is kept for compatibility with 1.0.4)
|
||||
- suppress history buffer provided by application to simplify the interface
|
||||
(this feature was not implemented anyway in 1.0.4)
|
||||
- next_in and avail_in must be initialized before calling inflateInit or
|
||||
inflateInit2
|
||||
- add EXPORT in all exported functions (for Windows DLL)
|
||||
- added Makefile.nt (thanks to Stephen Williams)
|
||||
- added the unsupported "contrib" directory:
|
||||
contrib/asm386/ by Gilles Vollant <info@winimage.com>
|
||||
386 asm code replacing longest_match().
|
||||
contrib/iostream/ by Kevin Ruland <kevin@rodin.wustl.edu>
|
||||
A C++ I/O streams interface to the zlib gz* functions
|
||||
contrib/iostream2/ by Tyge L<>vset <Tyge.Lovset@cmr.no>
|
||||
Another C++ I/O streams interface
|
||||
contrib/untgz/ by "Pedro A. Aranda Guti\irrez" <paag@tid.es>
|
||||
A very simple tar.gz file extractor using zlib
|
||||
contrib/visual-basic.txt by Carlos Rios <c_rios@sonda.cl>
|
||||
How to use compress(), uncompress() and the gz* functions from VB.
|
||||
- pass params -f (filtered data), -h (huffman only), -1 to -9 (compression
|
||||
level) in minigzip (thanks to Tom Lane)
|
||||
|
||||
- use const for rommable constants in deflate
|
||||
- added test for gzseek and gztell in example.c
|
||||
- add undocumented function inflateSyncPoint() (hack for Paul Mackerras)
|
||||
- add undocumented function zError to convert error code to string
|
||||
(for Tim Smithers)
|
||||
- Allow compilation of gzio with -DNO_DEFLATE to avoid the compression code.
|
||||
- Use default memcpy for Symantec MSDOS compiler.
|
||||
- Add EXPORT keyword for check_func (needed for Windows DLL)
|
||||
- add current directory to LD_LIBRARY_PATH for "make test"
|
||||
- create also a link for libz.so.1
|
||||
- added support for FUJITSU UXP/DS (thanks to Toshiaki Nomura)
|
||||
- use $(SHAREDLIB) instead of libz.so in Makefile.in (for HPUX)
|
||||
- added -soname for Linux in configure (Chun-Chung Chen,
|
||||
- assign numbers to the exported functions in zlib.def (for Windows DLL)
|
||||
- add advice in zlib.h for best usage of deflateSetDictionary
|
||||
- work around compiler bug on Atari (cast Z_NULL in call of s->checkfn)
|
||||
- allow compilation with ANSI keywords only enabled for TurboC in large model
|
||||
- avoid "versionString"[0] (Borland bug)
|
||||
- add NEED_DUMMY_RETURN for Borland
|
||||
- use variable z_verbose for tracing in debug mode (L. Peter Deutsch).
|
||||
- allow compilation with CC
|
||||
- defined STDC for OS/2 (David Charlap)
|
||||
- limit external names to 8 chars for MVS (Thomas Lund)
|
||||
- in minigzip.c, use static buffers only for 16-bit systems
|
||||
- fix suffix check for "minigzip -d foo.gz"
|
||||
- do not return an error for the 2nd of two consecutive gzflush() (Felix Lee)
|
||||
- use _fdopen instead of fdopen for MSC >= 6.0 (Thomas Fanslau)
|
||||
- added makelcc.bat for lcc-win32 (Tom St Denis)
|
||||
- in Makefile.dj2, use copy and del instead of install and rm (Frank Donahoe)
|
||||
- Avoid expanded $Id$. Use "rcs -kb" or "cvs admin -kb" to avoid Id expansion.
|
||||
- check for unistd.h in configure (for off_t)
|
||||
- remove useless check parameter in inflate_blocks_free
|
||||
- avoid useless assignment of s->check to itself in inflate_blocks_new
|
||||
- do not flush twice in gzclose (thanks to Ken Raeburn)
|
||||
- rename FOPEN as F_OPEN to avoid clash with /usr/include/sys/file.h
|
||||
- use NO_ERRNO_H instead of enumeration of operating systems with errno.h
|
||||
- work around buggy fclose on pipes for HP/UX
|
||||
- support zlib DLL with BORLAND C++ 5.0 (thanks to Glenn Randers-Pehrson)
|
||||
- fix configure if CC is already equal to gcc
|
||||
|
||||
Changes in 1.0.5 (3 Jan 98)
|
||||
- Fix inflate to terminate gracefully when fed corrupted or invalid data
|
||||
- Use const for rommable constants in inflate
|
||||
- Eliminate memory leaks on error conditions in inflate
|
||||
- Removed some vestigial code in inflate
|
||||
- Update web address in README
|
||||
|
||||
Changes in 1.0.4 (24 Jul 96)
|
||||
- In very rare conditions, deflate(s, Z_FINISH) could fail to produce an EOF
|
||||
bit, so the decompressor could decompress all the correct data but went
|
||||
on to attempt decompressing extra garbage data. This affected minigzip too.
|
||||
- zlibVersion and gzerror return const char* (needed for DLL)
|
||||
- port to RISCOS (no fdopen, no multiple dots, no unlink, no fileno)
|
||||
- use z_error only for DEBUG (avoid problem with DLLs)
|
||||
|
||||
Changes in 1.0.3 (2 Jul 96)
|
||||
- use z_streamp instead of z_stream *, which is now a far pointer in MSDOS
|
||||
small and medium models; this makes the library incompatible with previous
|
||||
versions for these models. (No effect in large model or on other systems.)
|
||||
- return OK instead of BUF_ERROR if previous deflate call returned with
|
||||
avail_out as zero but there is nothing to do
|
||||
- added memcmp for non STDC compilers
|
||||
- define NO_DUMMY_DECL for more Mac compilers (.h files merged incorrectly)
|
||||
- define __32BIT__ if __386__ or i386 is defined (pb. with Watcom and SCO)
|
||||
- better check for 16-bit mode MSC (avoids problem with Symantec)
|
||||
|
||||
Changes in 1.0.2 (23 May 96)
|
||||
- added Windows DLL support
|
||||
- added a function zlibVersion (for the DLL support)
|
||||
- fixed declarations using Bytef in infutil.c (pb with MSDOS medium model)
|
||||
- Bytef is define's instead of typedef'd only for Borland C
|
||||
- avoid reading uninitialized memory in example.c
|
||||
- mention in README that the zlib format is now RFC1950
|
||||
- updated Makefile.dj2
|
||||
- added algorithm.doc
|
||||
|
||||
Changes in 1.0.1 (20 May 96) [1.0 skipped to avoid confusion]
|
||||
- fix array overlay in deflate.c which sometimes caused bad compressed data
|
||||
- fix inflate bug with empty stored block
|
||||
- fix MSDOS medium model which was broken in 0.99
|
||||
- fix deflateParams() which could generated bad compressed data.
|
||||
- Bytef is define'd instead of typedef'ed (work around Borland bug)
|
||||
- added an INDEX file
|
||||
- new makefiles for DJGPP (Makefile.dj2), 32-bit Borland (Makefile.b32),
|
||||
Watcom (Makefile.wat), Amiga SAS/C (Makefile.sas)
|
||||
- speed up adler32 for modern machines without auto-increment
|
||||
- added -ansi for IRIX in configure
|
||||
- static_init_done in trees.c is an int
|
||||
- define unlink as delete for VMS
|
||||
- fix configure for QNX
|
||||
- add configure branch for SCO and HPUX
|
||||
- avoid many warnings (unused variables, dead assignments, etc...)
|
||||
- no fdopen for BeOS
|
||||
- fix the Watcom fix for 32 bit mode (define FAR as empty)
|
||||
- removed redefinition of Byte for MKWERKS
|
||||
- work around an MWKERKS bug (incorrect merge of all .h files)
|
||||
|
||||
Changes in 0.99 (27 Jan 96)
|
||||
- allow preset dictionary shared between compressor and decompressor
|
||||
- allow compression level 0 (no compression)
|
||||
- add deflateParams in zlib.h: allow dynamic change of compression level
|
||||
and compression strategy.
|
||||
- test large buffers and deflateParams in example.c
|
||||
- add optional "configure" to build zlib as a shared library
|
||||
- suppress Makefile.qnx, use configure instead
|
||||
- fixed deflate for 64-bit systems (detected on Cray)
|
||||
- fixed inflate_blocks for 64-bit systems (detected on Alpha)
|
||||
- declare Z_DEFLATED in zlib.h (possible parameter for deflateInit2)
|
||||
- always return Z_BUF_ERROR when deflate() has nothing to do
|
||||
- deflateInit and inflateInit are now macros to allow version checking
|
||||
- prefix all global functions and types with z_ with -DZ_PREFIX
|
||||
- make falloc completely reentrant (inftrees.c)
|
||||
- fixed very unlikely race condition in ct_static_init
|
||||
- free in reverse order of allocation to help memory manager
|
||||
- use zlib-1.0/* instead of zlib/* inside the tar.gz
|
||||
- make zlib warning-free with "gcc -O3 -Wall -Wwrite-strings -Wpointer-arith
|
||||
-Wconversion -Wstrict-prototypes -Wmissing-prototypes"
|
||||
- allow gzread on concatenated .gz files
|
||||
- deflateEnd now returns Z_DATA_ERROR if it was premature
|
||||
- deflate is finally (?) fully deterministic (no matches beyond end of input)
|
||||
- Document Z_SYNC_FLUSH
|
||||
- add uninstall in Makefile
|
||||
- Check for __cpluplus in zlib.h
|
||||
- Better test in ct_align for partial flush
|
||||
- avoid harmless warnings for Borland C++
|
||||
- initialize hash_head in deflate.c
|
||||
- avoid warning on fdopen (gzio.c) for HP cc -Aa
|
||||
- include stdlib.h for STDC compilers
|
||||
- include errno.h for Cray
|
||||
- ignore error if ranlib doesn't exist
|
||||
- call ranlib twice for NeXTSTEP
|
||||
- use exec_prefix instead of prefix for libz.a
|
||||
- renamed ct_* as _tr_* to avoid conflict with applications
|
||||
- clear z->msg in inflateInit2 before any error return
|
||||
- initialize opaque in example.c, gzio.c, deflate.c and inflate.c
|
||||
- fixed typo in zconf.h (_GNUC__ => __GNUC__)
|
||||
- check for WIN32 in zconf.h and zutil.c (avoid farmalloc in 32-bit mode)
|
||||
- fix typo in Make_vms.com (f$trnlnm -> f$getsyi)
|
||||
- in fcalloc, normalize pointer if size > 65520 bytes
|
||||
- don't use special fcalloc for 32 bit Borland C++
|
||||
- use STDC instead of __GO32__ to avoid redeclaring exit, calloc, etc...
|
||||
- use Z_BINARY instead of BINARY
|
||||
- document that gzclose after gzdopen will close the file
|
||||
- allow "a" as mode in gzopen.
|
||||
- fix error checking in gzread
|
||||
- allow skipping .gz extra-field on pipes
|
||||
- added reference to Perl interface in README
|
||||
- put the crc table in FAR data (I dislike more and more the medium model :)
|
||||
- added get_crc_table
|
||||
- added a dimension to all arrays (Borland C can't count).
|
||||
- workaround Borland C bug in declaration of inflate_codes_new & inflate_fast
|
||||
- guard against multiple inclusion of *.h (for precompiled header on Mac)
|
||||
- Watcom C pretends to be Microsoft C small model even in 32 bit mode.
|
||||
- don't use unsized arrays to avoid silly warnings by Visual C++:
|
||||
warning C4746: 'inflate_mask' : unsized array treated as '__far'
|
||||
(what's wrong with far data in far model?).
|
||||
- define enum out of inflate_blocks_state to allow compilation with C++
|
||||
|
||||
Changes in 0.95 (16 Aug 95)
|
||||
- fix MSDOS small and medium model (now easier to adapt to any compiler)
|
||||
- inlined send_bits
|
||||
- fix the final (:-) bug for deflate with flush (output was correct but
|
||||
not completely flushed in rare occasions).
|
||||
- default window size is same for compression and decompression
|
||||
(it's now sufficient to set MAX_WBITS in zconf.h).
|
||||
- voidp -> voidpf and voidnp -> voidp (for consistency with other
|
||||
typedefs and because voidnp was not near in large model).
|
||||
|
||||
Changes in 0.94 (13 Aug 95)
|
||||
- support MSDOS medium model
|
||||
- fix deflate with flush (could sometimes generate bad output)
|
||||
- fix deflateReset (zlib header was incorrectly suppressed)
|
||||
- added support for VMS
|
||||
- allow a compression level in gzopen()
|
||||
- gzflush now calls fflush
|
||||
- For deflate with flush, flush even if no more input is provided.
|
||||
- rename libgz.a as libz.a
|
||||
- avoid complex expression in infcodes.c triggering Turbo C bug
|
||||
- work around a problem with gcc on Alpha (in INSERT_STRING)
|
||||
- don't use inline functions (problem with some gcc versions)
|
||||
- allow renaming of Byte, uInt, etc... with #define.
|
||||
- avoid warning about (unused) pointer before start of array in deflate.c
|
||||
- avoid various warnings in gzio.c, example.c, infblock.c, adler32.c, zutil.c
|
||||
- avoid reserved word 'new' in trees.c
|
||||
|
||||
Changes in 0.93 (25 June 95)
|
||||
- temporarily disable inline functions
|
||||
- make deflate deterministic
|
||||
- give enough lookahead for PARTIAL_FLUSH
|
||||
- Set binary mode for stdin/stdout in minigzip.c for OS/2
|
||||
- don't even use signed char in inflate (not portable enough)
|
||||
- fix inflate memory leak for segmented architectures
|
||||
|
||||
Changes in 0.92 (3 May 95)
|
||||
- don't assume that char is signed (problem on SGI)
|
||||
- Clear bit buffer when starting a stored block
|
||||
- no memcpy on Pyramid
|
||||
- suppressed inftest.c
|
||||
- optimized fill_window, put longest_match inline for gcc
|
||||
- optimized inflate on stored blocks.
|
||||
- untabify all sources to simplify patches
|
||||
|
||||
Changes in 0.91 (2 May 95)
|
||||
- Default MEM_LEVEL is 8 (not 9 for Unix) as documented in zlib.h
|
||||
- Document the memory requirements in zconf.h
|
||||
- added "make install"
|
||||
- fix sync search logic in inflateSync
|
||||
- deflate(Z_FULL_FLUSH) now works even if output buffer too short
|
||||
- after inflateSync, don't scare people with just "lo world"
|
||||
- added support for DJGPP
|
||||
|
||||
Changes in 0.9 (1 May 95)
|
||||
- don't assume that zalloc clears the allocated memory (the TurboC bug
|
||||
was Mark's bug after all :)
|
||||
- let again gzread copy uncompressed data unchanged (was working in 0.71)
|
||||
- deflate(Z_FULL_FLUSH), inflateReset and inflateSync are now fully implemented
|
||||
- added a test of inflateSync in example.c
|
||||
- moved MAX_WBITS to zconf.h because users might want to change that.
|
||||
- document explicitly that zalloc(64K) on MSDOS must return a normalized
|
||||
pointer (zero offset)
|
||||
- added Makefiles for Microsoft C, Turbo C, Borland C++
|
||||
- faster crc32()
|
||||
|
||||
Changes in 0.8 (29 April 95)
|
||||
- added fast inflate (inffast.c)
|
||||
- deflate(Z_FINISH) now returns Z_STREAM_END when done. Warning: this
|
||||
is incompatible with previous versions of zlib which returned Z_OK.
|
||||
- work around a TurboC compiler bug (bad code for b << 0, see infutil.h)
|
||||
(actually that was not a compiler bug, see 0.81 above)
|
||||
- gzread no longer reads one extra byte in certain cases
|
||||
- In gzio destroy(), don't reference a freed structure
|
||||
- avoid many warnings for MSDOS
|
||||
- avoid the ERROR symbol which is used by MS Windows
|
||||
|
||||
Changes in 0.71 (14 April 95)
|
||||
- Fixed more MSDOS compilation problems :( There is still a bug with
|
||||
TurboC large model.
|
||||
|
||||
Changes in 0.7 (14 April 95)
|
||||
- Added full inflate support.
|
||||
- Simplified the crc32() interface. The pre- and post-conditioning
|
||||
(one's complement) is now done inside crc32(). WARNING: this is
|
||||
incompatible with previous versions; see zlib.h for the new usage.
|
||||
|
||||
Changes in 0.61 (12 April 95)
|
||||
- workaround for a bug in TurboC. example and minigzip now work on MSDOS.
|
||||
|
||||
Changes in 0.6 (11 April 95)
|
||||
- added minigzip.c
|
||||
- added gzdopen to reopen a file descriptor as gzFile
|
||||
- added transparent reading of non-gziped files in gzread.
|
||||
- fixed bug in gzread (don't read crc as data)
|
||||
- fixed bug in destroy (gzio.c) (don't return Z_STREAM_END for gzclose).
|
||||
- don't allocate big arrays in the stack (for MSDOS)
|
||||
- fix some MSDOS compilation problems
|
||||
|
||||
Changes in 0.5:
|
||||
- do real compression in deflate.c. Z_PARTIAL_FLUSH is supported but
|
||||
not yet Z_FULL_FLUSH.
|
||||
- support decompression but only in a single step (forced Z_FINISH)
|
||||
- added opaque object for zalloc and zfree.
|
||||
- added deflateReset and inflateReset
|
||||
- added a variable zlib_version for consistency checking.
|
||||
- renamed the 'filter' parameter of deflateInit2 as 'strategy'.
|
||||
Added Z_FILTERED and Z_HUFFMAN_ONLY constants.
|
||||
|
||||
Changes in 0.4:
|
||||
- avoid "zip" everywhere, use zlib instead of ziplib.
|
||||
- suppress Z_BLOCK_FLUSH, interpret Z_PARTIAL_FLUSH as block flush
|
||||
if compression method == 8.
|
||||
- added adler32 and crc32
|
||||
- renamed deflateOptions as deflateInit2, call one or the other but not both
|
||||
- added the method parameter for deflateInit2.
|
||||
- added inflateInit2
|
||||
- simplied considerably deflateInit and inflateInit by not supporting
|
||||
user-provided history buffer. This is supported only in deflateInit2
|
||||
and inflateInit2.
|
||||
|
||||
Changes in 0.3:
|
||||
- prefix all macro names with Z_
|
||||
- use Z_FINISH instead of deflateEnd to finish compression.
|
||||
- added Z_HUFFMAN_ONLY
|
||||
- added gzerror()
|
||||
72
Lib/zlib/FAQ
72
Lib/zlib/FAQ
@@ -1,72 +0,0 @@
|
||||
|
||||
Frequently Asked Questions about zlib
|
||||
|
||||
|
||||
If your question is not there, please check the zlib home page
|
||||
http://www.cdrom.com/pub/infozip/zlib/ which may have more recent information.
|
||||
|
||||
|
||||
1) I need a Windows DLL
|
||||
2) I need a Visual Basic interface to zlib
|
||||
3) compress() returns Z_BUF_ERROR
|
||||
4) deflate or inflate returns Z_BUF_ERROR
|
||||
5) Where is the zlib documentation (man pages, etc...)?
|
||||
6) Why don't you use GNU autoconf, libtool, etc...?
|
||||
7) There is a bug in zlib.
|
||||
8) I get "undefined reference to gzputc"
|
||||
|
||||
|
||||
|
||||
1) I need a Windows DLL
|
||||
|
||||
The zlib sources can be compiled without change to produce a DLL.
|
||||
If you want a precompiled DLL, see http://www.winimage.com/zLibDll
|
||||
|
||||
|
||||
2) I need a Visual Basic interface to zlib
|
||||
|
||||
See http://www.tcfb.com/dowseware/cmp-z-it.zip
|
||||
http://web2.airmail.net/markn/articles/zlibtool/zlibtool.htm
|
||||
and contrib/visual-basic.txt
|
||||
|
||||
3) compress() returns Z_BUF_ERROR
|
||||
|
||||
Make sure that before the call of compress, the length of the
|
||||
compressed buffer is equal to the total size of the compressed buffer
|
||||
and not zero. For Visual Basic, check that this parameter is passed
|
||||
by reference ("as any"), not by value ("as long").
|
||||
|
||||
|
||||
4) deflate or inflate returns Z_BUF_ERROR
|
||||
|
||||
Make sure that before the call avail_in and avail_out are not zero.
|
||||
|
||||
|
||||
5) Where is the zlib documentation (man pages, etc...)?
|
||||
|
||||
It's in zlib.h for the moment. Volunteers to transform this
|
||||
to man pages, please contact jloup@gzip.org. Examples of zlib usage
|
||||
are in the files example.c and minigzip.c.
|
||||
|
||||
|
||||
6) Why don't you use GNU autoconf, libtool, etc...?
|
||||
|
||||
Because we would like to keep zlib as a very small and simple package.
|
||||
zlib is rather portable and doesn't need much configuration.
|
||||
|
||||
|
||||
7) There is a bug in zlib.
|
||||
|
||||
Most of the time, such problems are due to an incorrect usage
|
||||
of zlib. Please try to reproduce the problem with a small
|
||||
program and send us the corresponding source at zlib@quest.jpl.nasa.gov
|
||||
Do not send multi-megabyte data files without prior agreement.
|
||||
|
||||
|
||||
8) I get "undefined reference to gzputc"
|
||||
|
||||
If "make test" produces something like
|
||||
example.o(.text+0x174):
|
||||
check that you don't have old files libz.* in /usr/lib, /usr/local/lib
|
||||
or /usr/X11R6/lib. Remove old versions then do "make install".
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
ChangeLog history of changes
|
||||
INDEX this file
|
||||
FAQ Frequently Asked Questions about zlib
|
||||
Make_vms.com script for Vax/VMS
|
||||
Makefile makefile for Unix (generated by configure)
|
||||
Makefile.in makefile for Unix (template for configure)
|
||||
Makefile.riscos makefile for RISCOS
|
||||
README guess what
|
||||
algorithm.txt description of the (de)compression algorithm
|
||||
configure configure script for Unix
|
||||
descrip.mms makefile for Vax/VMS
|
||||
zlib.3 mini man page for zlib (volunteers to write full
|
||||
man pages from zlib.h welcome. write to jloup@gzip.org)
|
||||
|
||||
amiga/Makefile.sas makefile for Amiga SAS/C
|
||||
amiga/Makefile.pup makefile for Amiga powerUP SAS/C PPC
|
||||
|
||||
msdos/Makefile.w32 makefile for Microsoft Visual C++ 32-bit
|
||||
msdos/Makefile.b32 makefile for Borland C++ 32-bit
|
||||
msdos/Makefile.bor makefile for Borland C/C++ 16-bit
|
||||
msdos/Makefile.dj2 makefile for DJGPP 2.x
|
||||
msdos/Makefile.emx makefile for EMX 0.9c (32-bit DOS/OS2)
|
||||
msdos/Makefile.msc makefile for Microsoft C 16-bit
|
||||
msdos/Makefile.tc makefile for Turbo C
|
||||
msdos/Makefile.wat makefile for Watcom C
|
||||
msdos/zlib.def definition file for Windows DLL
|
||||
msdos/zlib.rc definition file for Windows DLL
|
||||
|
||||
nt/Makefile.nt makefile for Windows NT
|
||||
nt/zlib.dnt definition file for Windows NT DLL
|
||||
nt/Makefile.emx makefile for EMX 0.9c/RSXNT 1.41 (Win32 Intel)
|
||||
nt/Makefile.gcc makefile for Windows NT using GCC (mingw32)
|
||||
|
||||
|
||||
zlib public header files (must be kept):
|
||||
zconf.h
|
||||
zlib.h
|
||||
|
||||
private source files used to build the zlib library:
|
||||
adler32.c
|
||||
compress.c
|
||||
crc32.c
|
||||
deflate.c
|
||||
deflate.h
|
||||
gzio.c
|
||||
infblock.c
|
||||
infblock.h
|
||||
infcodes.c
|
||||
infcodes.h
|
||||
inffast.c
|
||||
inffast.h
|
||||
inflate.c
|
||||
inftrees.c
|
||||
inftrees.h
|
||||
infutil.c
|
||||
infutil.h
|
||||
maketree.c
|
||||
trees.c
|
||||
uncompr.c
|
||||
zutil.c
|
||||
zutil.h
|
||||
|
||||
source files for sample programs:
|
||||
example.c
|
||||
minigzip.c
|
||||
|
||||
unsupported contribution by third parties
|
||||
|
||||
contrib/asm386/ by Gilles Vollant <info@winimage.com>
|
||||
386 asm code replacing longest_match().
|
||||
|
||||
contrib/minizip/ by Gilles Vollant <info@winimage.com>
|
||||
Mini zip and unzip based on zlib
|
||||
See http://www.winimage.com/zLibDll/unzip.html
|
||||
|
||||
contrib/iostream/ by Kevin Ruland <kevin@rodin.wustl.edu>
|
||||
A C++ I/O streams interface to the zlib gz* functions
|
||||
|
||||
contrib/iostream2/ by Tyge L<>vset <Tyge.Lovset@cmr.no>
|
||||
Another C++ I/O streams interface
|
||||
|
||||
contrib/untgz/ by "Pedro A. Aranda Guti\irrez" <paag@tid.es>
|
||||
A very simple tar.gz extractor using zlib
|
||||
|
||||
contrib/visual-basic.txt by Carlos Rios <c_rios@sonda.cl>
|
||||
How to use compress(), uncompress() and the gz* functions from VB.
|
||||
@@ -1,115 +0,0 @@
|
||||
$! make libz under VMS
|
||||
$! written by Martin P.J. Zinser <m.zinser@gsi.de>
|
||||
$!
|
||||
$! Look for the compiler used
|
||||
$!
|
||||
$ ccopt = ""
|
||||
$ if f$getsyi("HW_MODEL").ge.1024
|
||||
$ then
|
||||
$ ccopt = "/prefix=all"+ccopt
|
||||
$ comp = "__decc__=1"
|
||||
$ if f$trnlnm("SYS").eqs."" then define sys sys$library:
|
||||
$ else
|
||||
$ if f$search("SYS$SYSTEM:DECC$COMPILER.EXE").eqs.""
|
||||
$ then
|
||||
$ comp = "__vaxc__=1"
|
||||
$ if f$trnlnm("SYS").eqs."" then define sys sys$library:
|
||||
$ else
|
||||
$ if f$trnlnm("SYS").eqs."" then define sys decc$library_include:
|
||||
$ ccopt = "/decc/prefix=all"+ccopt
|
||||
$ comp = "__decc__=1"
|
||||
$ endif
|
||||
$ endif
|
||||
$!
|
||||
$! Build the thing plain or with mms
|
||||
$!
|
||||
$ write sys$output "Compiling Zlib sources ..."
|
||||
$ if f$search("SYS$SYSTEM:MMS.EXE").eqs.""
|
||||
$ then
|
||||
$ dele example.obj;*,minigzip.obj;*
|
||||
$ CALL MAKE adler32.OBJ "CC ''CCOPT' adler32" -
|
||||
adler32.c zlib.h zconf.h
|
||||
$ CALL MAKE compress.OBJ "CC ''CCOPT' compress" -
|
||||
compress.c zlib.h zconf.h
|
||||
$ CALL MAKE crc32.OBJ "CC ''CCOPT' crc32" -
|
||||
crc32.c zlib.h zconf.h
|
||||
$ CALL MAKE deflate.OBJ "CC ''CCOPT' deflate" -
|
||||
deflate.c deflate.h zutil.h zlib.h zconf.h
|
||||
$ CALL MAKE gzio.OBJ "CC ''CCOPT' gzio" -
|
||||
gzio.c zutil.h zlib.h zconf.h
|
||||
$ CALL MAKE infblock.OBJ "CC ''CCOPT' infblock" -
|
||||
infblock.c zutil.h zlib.h zconf.h infblock.h
|
||||
$ CALL MAKE infcodes.OBJ "CC ''CCOPT' infcodes" -
|
||||
infcodes.c zutil.h zlib.h zconf.h inftrees.h
|
||||
$ CALL MAKE inffast.OBJ "CC ''CCOPT' inffast" -
|
||||
inffast.c zutil.h zlib.h zconf.h inffast.h
|
||||
$ CALL MAKE inflate.OBJ "CC ''CCOPT' inflate" -
|
||||
inflate.c zutil.h zlib.h zconf.h infblock.h
|
||||
$ CALL MAKE inftrees.OBJ "CC ''CCOPT' inftrees" -
|
||||
inftrees.c zutil.h zlib.h zconf.h inftrees.h
|
||||
$ CALL MAKE infutil.OBJ "CC ''CCOPT' infutil" -
|
||||
infutil.c zutil.h zlib.h zconf.h inftrees.h infutil.h
|
||||
$ CALL MAKE trees.OBJ "CC ''CCOPT' trees" -
|
||||
trees.c deflate.h zutil.h zlib.h zconf.h
|
||||
$ CALL MAKE uncompr.OBJ "CC ''CCOPT' uncompr" -
|
||||
uncompr.c zlib.h zconf.h
|
||||
$ CALL MAKE zutil.OBJ "CC ''CCOPT' zutil" -
|
||||
zutil.c zutil.h zlib.h zconf.h
|
||||
$ write sys$output "Building Zlib ..."
|
||||
$ CALL MAKE libz.OLB "lib/crea libz.olb *.obj" *.OBJ
|
||||
$ write sys$output "Building example..."
|
||||
$ CALL MAKE example.OBJ "CC ''CCOPT' example" -
|
||||
example.c zlib.h zconf.h
|
||||
$ call make example.exe "LINK example,libz.olb/lib" example.obj libz.olb
|
||||
$ write sys$output "Building minigzip..."
|
||||
$ CALL MAKE minigzip.OBJ "CC ''CCOPT' minigzip" -
|
||||
minigzip.c zlib.h zconf.h
|
||||
$ call make minigzip.exe -
|
||||
"LINK minigzip,libz.olb/lib,x11vms:xvmsutils.olb/lib" -
|
||||
minigzip.obj libz.olb
|
||||
$ else
|
||||
$ mms/macro=('comp')
|
||||
$ endif
|
||||
$ write sys$output "Zlib build completed"
|
||||
$ exit
|
||||
$!
|
||||
$!
|
||||
$MAKE: SUBROUTINE !SUBROUTINE TO CHECK DEPENDENCIES
|
||||
$ V = 'F$Verify(0)
|
||||
$! P1 = What we are trying to make
|
||||
$! P2 = Command to make it
|
||||
$! P3 - P8 What it depends on
|
||||
$
|
||||
$ If F$Search(P1) .Eqs. "" Then Goto Makeit
|
||||
$ Time = F$CvTime(F$File(P1,"RDT"))
|
||||
$arg=3
|
||||
$Loop:
|
||||
$ Argument = P'arg
|
||||
$ If Argument .Eqs. "" Then Goto Exit
|
||||
$ El=0
|
||||
$Loop2:
|
||||
$ File = F$Element(El," ",Argument)
|
||||
$ If File .Eqs. " " Then Goto Endl
|
||||
$ AFile = ""
|
||||
$Loop3:
|
||||
$ OFile = AFile
|
||||
$ AFile = F$Search(File)
|
||||
$ If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl
|
||||
$ If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit
|
||||
$ Goto Loop3
|
||||
$NextEL:
|
||||
$ El = El + 1
|
||||
$ Goto Loop2
|
||||
$EndL:
|
||||
$ arg=arg+1
|
||||
$ If arg .Le. 8 Then Goto Loop
|
||||
$ Goto Exit
|
||||
$
|
||||
$Makeit:
|
||||
$ VV=F$VERIFY(0)
|
||||
$ write sys$output P2
|
||||
$ 'P2
|
||||
$ VV='F$Verify(VV)
|
||||
$Exit:
|
||||
$ If V Then Set Verify
|
||||
$ENDSUBROUTINE
|
||||
@@ -1,31 +0,0 @@
|
||||
EXTRA_DIST = ChangeLog INDEX Make_vms.com Makefile.riscos README \
|
||||
algorithm.txt descrip.mms example.c maketree.c minigzip.c zlib.3
|
||||
|
||||
lib_LIBRARIES = libz.a
|
||||
|
||||
libz_a_SOURCES = \
|
||||
adler32.c \
|
||||
compress.c \
|
||||
crc32.c \
|
||||
deflate.c \
|
||||
deflate.h \
|
||||
gzio.c \
|
||||
infblock.c \
|
||||
infblock.h \
|
||||
infcodes.c \
|
||||
infcodes.h \
|
||||
inffast.c \
|
||||
inffast.h \
|
||||
inffixed.h \
|
||||
inflate.c \
|
||||
inftrees.c \
|
||||
inftrees.h \
|
||||
infutil.c \
|
||||
infutil.h \
|
||||
trees.c \
|
||||
trees.h \
|
||||
uncompr.c \
|
||||
zconf.h \
|
||||
zlib.h \
|
||||
zutil.c \
|
||||
zutil.h
|
||||
@@ -1,151 +0,0 @@
|
||||
# Project: zlib_1_03
|
||||
# Patched for zlib 1.1.2 rw@shadow.org.uk 19980430
|
||||
# test works out-of-the-box, installs `somewhere' on demand
|
||||
|
||||
# Toolflags:
|
||||
CCflags = -c -depend !Depend -IC: -g -throwback -DRISCOS -fah
|
||||
C++flags = -c -depend !Depend -IC: -throwback
|
||||
Linkflags = -aif -c++ -o $@
|
||||
ObjAsmflags = -throwback -NoCache -depend !Depend
|
||||
CMHGflags =
|
||||
LibFileflags = -c -l -o $@
|
||||
Squeezeflags = -o $@
|
||||
|
||||
# change the line below to where _you_ want the library installed.
|
||||
libdest = lib:zlib
|
||||
|
||||
# Final targets:
|
||||
@.lib: @.o.adler32 @.o.compress @.o.crc32 @.o.deflate @.o.gzio \
|
||||
@.o.infblock @.o.infcodes @.o.inffast @.o.inflate @.o.inftrees @.o.infutil @.o.trees \
|
||||
@.o.uncompr @.o.zutil
|
||||
LibFile $(LibFileflags) @.o.adler32 @.o.compress @.o.crc32 @.o.deflate \
|
||||
@.o.gzio @.o.infblock @.o.infcodes @.o.inffast @.o.inflate @.o.inftrees @.o.infutil \
|
||||
@.o.trees @.o.uncompr @.o.zutil
|
||||
test: @.minigzip @.example @.lib
|
||||
@copy @.lib @.libc A~C~DF~L~N~P~Q~RS~TV
|
||||
@echo running tests: hang on.
|
||||
@/@.minigzip -f -9 libc
|
||||
@/@.minigzip -d libc-gz
|
||||
@/@.minigzip -f -1 libc
|
||||
@/@.minigzip -d libc-gz
|
||||
@/@.minigzip -h -9 libc
|
||||
@/@.minigzip -d libc-gz
|
||||
@/@.minigzip -h -1 libc
|
||||
@/@.minigzip -d libc-gz
|
||||
@/@.minigzip -9 libc
|
||||
@/@.minigzip -d libc-gz
|
||||
@/@.minigzip -1 libc
|
||||
@/@.minigzip -d libc-gz
|
||||
@diff @.lib @.libc
|
||||
@echo that should have reported '@.lib and @.libc identical' if you have diff.
|
||||
@/@.example @.fred @.fred
|
||||
@echo that will have given lots of hello!'s.
|
||||
|
||||
@.minigzip: @.o.minigzip @.lib C:o.Stubs
|
||||
Link $(Linkflags) @.o.minigzip @.lib C:o.Stubs
|
||||
@.example: @.o.example @.lib C:o.Stubs
|
||||
Link $(Linkflags) @.o.example @.lib C:o.Stubs
|
||||
|
||||
install: @.lib
|
||||
cdir $(libdest)
|
||||
cdir $(libdest).h
|
||||
@copy @.h.zlib $(libdest).h.zlib A~C~DF~L~N~P~Q~RS~TV
|
||||
@copy @.h.zconf $(libdest).h.zconf A~C~DF~L~N~P~Q~RS~TV
|
||||
@copy @.lib $(libdest).lib A~C~DF~L~N~P~Q~RS~TV
|
||||
@echo okay, installed zlib in $(libdest)
|
||||
|
||||
clean:; remove @.minigzip
|
||||
remove @.example
|
||||
remove @.libc
|
||||
-wipe @.o.* F~r~cV
|
||||
remove @.fred
|
||||
|
||||
# User-editable dependencies:
|
||||
.c.o:
|
||||
cc $(ccflags) -o $@ $<
|
||||
|
||||
# Static dependencies:
|
||||
|
||||
# Dynamic dependencies:
|
||||
o.example: c.example
|
||||
o.example: h.zlib
|
||||
o.example: h.zconf
|
||||
o.minigzip: c.minigzip
|
||||
o.minigzip: h.zlib
|
||||
o.minigzip: h.zconf
|
||||
o.adler32: c.adler32
|
||||
o.adler32: h.zlib
|
||||
o.adler32: h.zconf
|
||||
o.compress: c.compress
|
||||
o.compress: h.zlib
|
||||
o.compress: h.zconf
|
||||
o.crc32: c.crc32
|
||||
o.crc32: h.zlib
|
||||
o.crc32: h.zconf
|
||||
o.deflate: c.deflate
|
||||
o.deflate: h.deflate
|
||||
o.deflate: h.zutil
|
||||
o.deflate: h.zlib
|
||||
o.deflate: h.zconf
|
||||
o.gzio: c.gzio
|
||||
o.gzio: h.zutil
|
||||
o.gzio: h.zlib
|
||||
o.gzio: h.zconf
|
||||
o.infblock: c.infblock
|
||||
o.infblock: h.zutil
|
||||
o.infblock: h.zlib
|
||||
o.infblock: h.zconf
|
||||
o.infblock: h.infblock
|
||||
o.infblock: h.inftrees
|
||||
o.infblock: h.infcodes
|
||||
o.infblock: h.infutil
|
||||
o.infcodes: c.infcodes
|
||||
o.infcodes: h.zutil
|
||||
o.infcodes: h.zlib
|
||||
o.infcodes: h.zconf
|
||||
o.infcodes: h.inftrees
|
||||
o.infcodes: h.infblock
|
||||
o.infcodes: h.infcodes
|
||||
o.infcodes: h.infutil
|
||||
o.infcodes: h.inffast
|
||||
o.inffast: c.inffast
|
||||
o.inffast: h.zutil
|
||||
o.inffast: h.zlib
|
||||
o.inffast: h.zconf
|
||||
o.inffast: h.inftrees
|
||||
o.inffast: h.infblock
|
||||
o.inffast: h.infcodes
|
||||
o.inffast: h.infutil
|
||||
o.inffast: h.inffast
|
||||
o.inflate: c.inflate
|
||||
o.inflate: h.zutil
|
||||
o.inflate: h.zlib
|
||||
o.inflate: h.zconf
|
||||
o.inflate: h.infblock
|
||||
o.inftrees: c.inftrees
|
||||
o.inftrees: h.zutil
|
||||
o.inftrees: h.zlib
|
||||
o.inftrees: h.zconf
|
||||
o.inftrees: h.inftrees
|
||||
o.inftrees: h.inffixed
|
||||
o.infutil: c.infutil
|
||||
o.infutil: h.zutil
|
||||
o.infutil: h.zlib
|
||||
o.infutil: h.zconf
|
||||
o.infutil: h.infblock
|
||||
o.infutil: h.inftrees
|
||||
o.infutil: h.infcodes
|
||||
o.infutil: h.infutil
|
||||
o.trees: c.trees
|
||||
o.trees: h.deflate
|
||||
o.trees: h.zutil
|
||||
o.trees: h.zlib
|
||||
o.trees: h.zconf
|
||||
o.trees: h.trees
|
||||
o.uncompr: c.uncompr
|
||||
o.uncompr: h.zlib
|
||||
o.uncompr: h.zconf
|
||||
o.zutil: c.zutil
|
||||
o.zutil: h.zutil
|
||||
o.zutil: h.zlib
|
||||
o.zutil: h.zconf
|
||||
148
Lib/zlib/README
148
Lib/zlib/README
@@ -1,148 +0,0 @@
|
||||
zlib 1.1.3 is a general purpose data compression library. All the code
|
||||
is thread safe. The data format used by the zlib library
|
||||
is described by RFCs (Request for Comments) 1950 to 1952 in the files
|
||||
ftp://ds.internic.net/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate
|
||||
format) and rfc1952.txt (gzip format). These documents are also available in
|
||||
other formats from ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html
|
||||
|
||||
All functions of the compression library are documented in the file zlib.h
|
||||
(volunteer to write man pages welcome, contact jloup@gzip.org). A usage
|
||||
example of the library is given in the file example.c which also tests that
|
||||
the library is working correctly. Another example is given in the file
|
||||
minigzip.c. The compression library itself is composed of all source files
|
||||
except example.c and minigzip.c.
|
||||
|
||||
To compile all files and run the test program, follow the instructions
|
||||
given at the top of Makefile. In short "make test; make install"
|
||||
should work for most machines. For Unix: "configure; make test; make install"
|
||||
For MSDOS, use one of the special makefiles such as Makefile.msc.
|
||||
For VMS, use Make_vms.com or descrip.mms.
|
||||
|
||||
Questions about zlib should be sent to <zlib@quest.jpl.nasa.gov>, or to
|
||||
Gilles Vollant <info@winimage.com> for the Windows DLL version.
|
||||
The zlib home page is http://www.cdrom.com/pub/infozip/zlib/
|
||||
The official zlib ftp site is ftp://ftp.cdrom.com/pub/infozip/zlib/
|
||||
Before reporting a problem, please check those sites to verify that
|
||||
you have the latest version of zlib; otherwise get the latest version and
|
||||
check whether the problem still exists or not.
|
||||
|
||||
Mark Nelson <markn@tiny.com> wrote an article about zlib for the Jan. 1997
|
||||
issue of Dr. Dobb's Journal; a copy of the article is available in
|
||||
http://web2.airmail.net/markn/articles/zlibtool/zlibtool.htm
|
||||
|
||||
The changes made in version 1.1.3 are documented in the file ChangeLog.
|
||||
The main changes since 1.1.2 are:
|
||||
|
||||
- fix "an inflate input buffer bug that shows up on rare but persistent
|
||||
occasions" (Mark)
|
||||
- fix gzread and gztell for concatenated .gz files (Didier Le Botlan)
|
||||
- fix gzseek(..., SEEK_SET) in write mode
|
||||
- fix crc check after a gzeek (Frank Faubert)
|
||||
- fix miniunzip when the last entry in a zip file is itself a zip file
|
||||
(J Lillge)
|
||||
- add contrib/asm586 and contrib/asm686 (Brian Raiter)
|
||||
See http://www.muppetlabs.com/~breadbox/software/assembly.html
|
||||
- add support for Delphi 3 in contrib/delphi (Bob Dellaca)
|
||||
- add support for C++Builder 3 and Delphi 3 in contrib/delphi2 (Davide Moretti)
|
||||
- do not exit prematurely in untgz if 0 at start of block (Magnus Holmgren)
|
||||
- use macro EXTERN instead of extern to support DLL for BeOS (Sander Stoks)
|
||||
- added a FAQ file
|
||||
|
||||
plus many changes for portability.
|
||||
|
||||
Unsupported third party contributions are provided in directory "contrib".
|
||||
|
||||
A Java implementation of zlib is available in the Java Development Kit 1.1
|
||||
http://www.javasoft.com/products/JDK/1.1/docs/api/Package-java.util.zip.html
|
||||
See the zlib home page http://www.cdrom.com/pub/infozip/zlib/ for details.
|
||||
|
||||
A Perl interface to zlib written by Paul Marquess <pmarquess@bfsec.bt.co.uk>
|
||||
is in the CPAN (Comprehensive Perl Archive Network) sites, such as:
|
||||
ftp://ftp.cis.ufl.edu/pub/perl/CPAN/modules/by-module/Compress/Compress-Zlib*
|
||||
|
||||
A Python interface to zlib written by A.M. Kuchling <amk@magnet.com>
|
||||
is available in Python 1.5 and later versions, see
|
||||
http://www.python.org/doc/lib/module-zlib.html
|
||||
|
||||
A zlib binding for TCL written by Andreas Kupries <a.kupries@westend.com>
|
||||
is availlable at http://www.westend.com/~kupries/doc/trf/man/man.html
|
||||
|
||||
An experimental package to read and write files in .zip format,
|
||||
written on top of zlib by Gilles Vollant <info@winimage.com>, is
|
||||
available at http://www.winimage.com/zLibDll/unzip.html
|
||||
and also in the contrib/minizip directory of zlib.
|
||||
|
||||
|
||||
Notes for some targets:
|
||||
|
||||
- To build a Windows DLL version, include in a DLL project zlib.def, zlib.rc
|
||||
and all .c files except example.c and minigzip.c; compile with -DZLIB_DLL
|
||||
The zlib DLL support was initially done by Alessandro Iacopetti and is
|
||||
now maintained by Gilles Vollant <info@winimage.com>. Check the zlib DLL
|
||||
home page at http://www.winimage.com/zLibDll
|
||||
|
||||
From Visual Basic, you can call the DLL functions which do not take
|
||||
a structure as argument: compress, uncompress and all gz* functions.
|
||||
See contrib/visual-basic.txt for more information, or get
|
||||
http://www.tcfb.com/dowseware/cmp-z-it.zip
|
||||
|
||||
- For 64-bit Irix, deflate.c must be compiled without any optimization.
|
||||
With -O, one libpng test fails. The test works in 32 bit mode (with
|
||||
the -n32 compiler flag). The compiler bug has been reported to SGI.
|
||||
|
||||
- zlib doesn't work with gcc 2.6.3 on a DEC 3000/300LX under OSF/1 2.1
|
||||
it works when compiled with cc.
|
||||
|
||||
- on Digital Unix 4.0D (formely OSF/1) on AlphaServer, the cc option -std1
|
||||
is necessary to get gzprintf working correctly. This is done by configure.
|
||||
|
||||
- zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works
|
||||
with other compilers. Use "make test" to check your compiler.
|
||||
|
||||
- gzdopen is not supported on RISCOS, BEOS and by some Mac compilers.
|
||||
|
||||
- For Turbo C the small model is supported only with reduced performance to
|
||||
avoid any far allocation; it was tested with -DMAX_WBITS=11 -DMAX_MEM_LEVEL=3
|
||||
|
||||
- For PalmOs, see http://www.cs.uit.no/~perm/PASTA/pilot/software.html
|
||||
Per Harald Myrvang <perm@stud.cs.uit.no>
|
||||
|
||||
|
||||
Acknowledgments:
|
||||
|
||||
The deflate format used by zlib was defined by Phil Katz. The deflate
|
||||
and zlib specifications were written by L. Peter Deutsch. Thanks to all the
|
||||
people who reported problems and suggested various improvements in zlib;
|
||||
they are too numerous to cite here.
|
||||
|
||||
Copyright notice:
|
||||
|
||||
(C) 1995-1998 Jean-loup Gailly and Mark Adler
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
Jean-loup Gailly Mark Adler
|
||||
jloup@gzip.org madler@alumni.caltech.edu
|
||||
|
||||
If you use the zlib library in a product, we would appreciate *not*
|
||||
receiving lengthy legal documents to sign. The sources are provided
|
||||
for free but without warranty of any kind. The library has been
|
||||
entirely written by Jean-loup Gailly and Mark Adler; it does not
|
||||
include third-party code.
|
||||
|
||||
If you redistribute modified sources, we would appreciate that you include
|
||||
in the file ChangeLog history information documenting your changes.
|
||||
@@ -1,48 +0,0 @@
|
||||
/* adler32.c -- compute the Adler-32 checksum of a data stream
|
||||
* Copyright (C) 1995-1998 Mark Adler
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
/* @(#) $Id$ */
|
||||
|
||||
#include "zlib.h"
|
||||
|
||||
#define BASE 65521L /* largest prime smaller than 65536 */
|
||||
#define NMAX 5552
|
||||
/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
|
||||
|
||||
#define DO1(buf,i) {s1 += buf[i]; s2 += s1;}
|
||||
#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1);
|
||||
#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2);
|
||||
#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4);
|
||||
#define DO16(buf) DO8(buf,0); DO8(buf,8);
|
||||
|
||||
/* ========================================================================= */
|
||||
uLong ZEXPORT adler32(adler, buf, len)
|
||||
uLong adler;
|
||||
const Bytef *buf;
|
||||
uInt len;
|
||||
{
|
||||
unsigned long s1 = adler & 0xffff;
|
||||
unsigned long s2 = (adler >> 16) & 0xffff;
|
||||
int k;
|
||||
|
||||
if (buf == Z_NULL) return 1L;
|
||||
|
||||
while (len > 0) {
|
||||
k = len < NMAX ? len : NMAX;
|
||||
len -= k;
|
||||
while (k >= 16) {
|
||||
DO16(buf);
|
||||
buf += 16;
|
||||
k -= 16;
|
||||
}
|
||||
if (k != 0) do {
|
||||
s1 += *buf++;
|
||||
s2 += s1;
|
||||
} while (--k);
|
||||
s1 %= BASE;
|
||||
s2 %= BASE;
|
||||
}
|
||||
return (s2 << 16) | s1;
|
||||
}
|
||||
@@ -1,213 +0,0 @@
|
||||
1. Compression algorithm (deflate)
|
||||
|
||||
The deflation algorithm used by gzip (also zip and zlib) is a variation of
|
||||
LZ77 (Lempel-Ziv 1977, see reference below). It finds duplicated strings in
|
||||
the input data. The second occurrence of a string is replaced by a
|
||||
pointer to the previous string, in the form of a pair (distance,
|
||||
length). Distances are limited to 32K bytes, and lengths are limited
|
||||
to 258 bytes. When a string does not occur anywhere in the previous
|
||||
32K bytes, it is emitted as a sequence of literal bytes. (In this
|
||||
description, `string' must be taken as an arbitrary sequence of bytes,
|
||||
and is not restricted to printable characters.)
|
||||
|
||||
Literals or match lengths are compressed with one Huffman tree, and
|
||||
match distances are compressed with another tree. The trees are stored
|
||||
in a compact form at the start of each block. The blocks can have any
|
||||
size (except that the compressed data for one block must fit in
|
||||
available memory). A block is terminated when deflate() determines that
|
||||
it would be useful to start another block with fresh trees. (This is
|
||||
somewhat similar to the behavior of LZW-based _compress_.)
|
||||
|
||||
Duplicated strings are found using a hash table. All input strings of
|
||||
length 3 are inserted in the hash table. A hash index is computed for
|
||||
the next 3 bytes. If the hash chain for this index is not empty, all
|
||||
strings in the chain are compared with the current input string, and
|
||||
the longest match is selected.
|
||||
|
||||
The hash chains are searched starting with the most recent strings, to
|
||||
favor small distances and thus take advantage of the Huffman encoding.
|
||||
The hash chains are singly linked. There are no deletions from the
|
||||
hash chains, the algorithm simply discards matches that are too old.
|
||||
|
||||
To avoid a worst-case situation, very long hash chains are arbitrarily
|
||||
truncated at a certain length, determined by a runtime option (level
|
||||
parameter of deflateInit). So deflate() does not always find the longest
|
||||
possible match but generally finds a match which is long enough.
|
||||
|
||||
deflate() also defers the selection of matches with a lazy evaluation
|
||||
mechanism. After a match of length N has been found, deflate() searches for
|
||||
a longer match at the next input byte. If a longer match is found, the
|
||||
previous match is truncated to a length of one (thus producing a single
|
||||
literal byte) and the process of lazy evaluation begins again. Otherwise,
|
||||
the original match is kept, and the next match search is attempted only N
|
||||
steps later.
|
||||
|
||||
The lazy match evaluation is also subject to a runtime parameter. If
|
||||
the current match is long enough, deflate() reduces the search for a longer
|
||||
match, thus speeding up the whole process. If compression ratio is more
|
||||
important than speed, deflate() attempts a complete second search even if
|
||||
the first match is already long enough.
|
||||
|
||||
The lazy match evaluation is not performed for the fastest compression
|
||||
modes (level parameter 1 to 3). For these fast modes, new strings
|
||||
are inserted in the hash table only when no match was found, or
|
||||
when the match is not too long. This degrades the compression ratio
|
||||
but saves time since there are both fewer insertions and fewer searches.
|
||||
|
||||
|
||||
2. Decompression algorithm (inflate)
|
||||
|
||||
2.1 Introduction
|
||||
|
||||
The real question is, given a Huffman tree, how to decode fast. The most
|
||||
important realization is that shorter codes are much more common than
|
||||
longer codes, so pay attention to decoding the short codes fast, and let
|
||||
the long codes take longer to decode.
|
||||
|
||||
inflate() sets up a first level table that covers some number of bits of
|
||||
input less than the length of longest code. It gets that many bits from the
|
||||
stream, and looks it up in the table. The table will tell if the next
|
||||
code is that many bits or less and how many, and if it is, it will tell
|
||||
the value, else it will point to the next level table for which inflate()
|
||||
grabs more bits and tries to decode a longer code.
|
||||
|
||||
How many bits to make the first lookup is a tradeoff between the time it
|
||||
takes to decode and the time it takes to build the table. If building the
|
||||
table took no time (and if you had infinite memory), then there would only
|
||||
be a first level table to cover all the way to the longest code. However,
|
||||
building the table ends up taking a lot longer for more bits since short
|
||||
codes are replicated many times in such a table. What inflate() does is
|
||||
simply to make the number of bits in the first table a variable, and set it
|
||||
for the maximum speed.
|
||||
|
||||
inflate() sends new trees relatively often, so it is possibly set for a
|
||||
smaller first level table than an application that has only one tree for
|
||||
all the data. For inflate, which has 286 possible codes for the
|
||||
literal/length tree, the size of the first table is nine bits. Also the
|
||||
distance trees have 30 possible values, and the size of the first table is
|
||||
six bits. Note that for each of those cases, the table ended up one bit
|
||||
longer than the ``average'' code length, i.e. the code length of an
|
||||
approximately flat code which would be a little more than eight bits for
|
||||
286 symbols and a little less than five bits for 30 symbols. It would be
|
||||
interesting to see if optimizing the first level table for other
|
||||
applications gave values within a bit or two of the flat code size.
|
||||
|
||||
|
||||
2.2 More details on the inflate table lookup
|
||||
|
||||
Ok, you want to know what this cleverly obfuscated inflate tree actually
|
||||
looks like. You are correct that it's not a Huffman tree. It is simply a
|
||||
lookup table for the first, let's say, nine bits of a Huffman symbol. The
|
||||
symbol could be as short as one bit or as long as 15 bits. If a particular
|
||||
symbol is shorter than nine bits, then that symbol's translation is duplicated
|
||||
in all those entries that start with that symbol's bits. For example, if the
|
||||
symbol is four bits, then it's duplicated 32 times in a nine-bit table. If a
|
||||
symbol is nine bits long, it appears in the table once.
|
||||
|
||||
If the symbol is longer than nine bits, then that entry in the table points
|
||||
to another similar table for the remaining bits. Again, there are duplicated
|
||||
entries as needed. The idea is that most of the time the symbol will be short
|
||||
and there will only be one table look up. (That's whole idea behind data
|
||||
compression in the first place.) For the less frequent long symbols, there
|
||||
will be two lookups. If you had a compression method with really long
|
||||
symbols, you could have as many levels of lookups as is efficient. For
|
||||
inflate, two is enough.
|
||||
|
||||
So a table entry either points to another table (in which case nine bits in
|
||||
the above example are gobbled), or it contains the translation for the symbol
|
||||
and the number of bits to gobble. Then you start again with the next
|
||||
ungobbled bit.
|
||||
|
||||
You may wonder: why not just have one lookup table for how ever many bits the
|
||||
longest symbol is? The reason is that if you do that, you end up spending
|
||||
more time filling in duplicate symbol entries than you do actually decoding.
|
||||
At least for deflate's output that generates new trees every several 10's of
|
||||
kbytes. You can imagine that filling in a 2^15 entry table for a 15-bit code
|
||||
would take too long if you're only decoding several thousand symbols. At the
|
||||
other extreme, you could make a new table for every bit in the code. In fact,
|
||||
that's essentially a Huffman tree. But then you spend two much time
|
||||
traversing the tree while decoding, even for short symbols.
|
||||
|
||||
So the number of bits for the first lookup table is a trade of the time to
|
||||
fill out the table vs. the time spent looking at the second level and above of
|
||||
the table.
|
||||
|
||||
Here is an example, scaled down:
|
||||
|
||||
The code being decoded, with 10 symbols, from 1 to 6 bits long:
|
||||
|
||||
A: 0
|
||||
B: 10
|
||||
C: 1100
|
||||
D: 11010
|
||||
E: 11011
|
||||
F: 11100
|
||||
G: 11101
|
||||
H: 11110
|
||||
I: 111110
|
||||
J: 111111
|
||||
|
||||
Let's make the first table three bits long (eight entries):
|
||||
|
||||
000: A,1
|
||||
001: A,1
|
||||
010: A,1
|
||||
011: A,1
|
||||
100: B,2
|
||||
101: B,2
|
||||
110: -> table X (gobble 3 bits)
|
||||
111: -> table Y (gobble 3 bits)
|
||||
|
||||
Each entry is what the bits decode to and how many bits that is, i.e. how
|
||||
many bits to gobble. Or the entry points to another table, with the number of
|
||||
bits to gobble implicit in the size of the table.
|
||||
|
||||
Table X is two bits long since the longest code starting with 110 is five bits
|
||||
long:
|
||||
|
||||
00: C,1
|
||||
01: C,1
|
||||
10: D,2
|
||||
11: E,2
|
||||
|
||||
Table Y is three bits long since the longest code starting with 111 is six
|
||||
bits long:
|
||||
|
||||
000: F,2
|
||||
001: F,2
|
||||
010: G,2
|
||||
011: G,2
|
||||
100: H,2
|
||||
101: H,2
|
||||
110: I,3
|
||||
111: J,3
|
||||
|
||||
So what we have here are three tables with a total of 20 entries that had to
|
||||
be constructed. That's compared to 64 entries for a single table. Or
|
||||
compared to 16 entries for a Huffman tree (six two entry tables and one four
|
||||
entry table). Assuming that the code ideally represents the probability of
|
||||
the symbols, it takes on the average 1.25 lookups per symbol. That's compared
|
||||
to one lookup for the single table, or 1.66 lookups per symbol for the
|
||||
Huffman tree.
|
||||
|
||||
There, I think that gives you a picture of what's going on. For inflate, the
|
||||
meaning of a particular symbol is often more than just a letter. It can be a
|
||||
byte (a "literal"), or it can be either a length or a distance which
|
||||
indicates a base value and a number of bits to fetch after the code that is
|
||||
added to the base value. Or it might be the special end-of-block code. The
|
||||
data structures created in inftrees.c try to encode all that information
|
||||
compactly in the tables.
|
||||
|
||||
|
||||
Jean-loup Gailly Mark Adler
|
||||
jloup@gzip.org madler@alumni.caltech.edu
|
||||
|
||||
|
||||
References:
|
||||
|
||||
[LZ77] Ziv J., Lempel A., ``A Universal Algorithm for Sequential Data
|
||||
Compression,'' IEEE Transactions on Information Theory, Vol. 23, No. 3,
|
||||
pp. 337-343.
|
||||
|
||||
``DEFLATE Compressed Data Format Specification'' available in
|
||||
ftp://ds.internic.net/rfc/rfc1951.txt
|
||||
@@ -1,66 +0,0 @@
|
||||
# Amiga powerUP (TM) Makefile
|
||||
# makefile for libpng and SAS C V6.58/7.00 PPC compiler
|
||||
# Copyright (C) 1998 by Andreas R. Kleinert
|
||||
|
||||
CC = scppc
|
||||
CFLAGS = NOSTKCHK NOSINT OPTIMIZE OPTGO OPTPEEP OPTINLOCAL OPTINL \
|
||||
OPTLOOP OPTRDEP=8 OPTDEP=8 OPTCOMP=8
|
||||
LIBNAME = libzip.a
|
||||
AR = ppc-amigaos-ar
|
||||
AR_FLAGS = cr
|
||||
RANLIB = ppc-amigaos-ranlib
|
||||
LDFLAGS = -r -o
|
||||
LDLIBS = LIB:scppc.a
|
||||
LN = ppc-amigaos-ld
|
||||
RM = delete quiet
|
||||
|
||||
OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
|
||||
zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
|
||||
|
||||
TEST_OBJS = example.o minigzip.o
|
||||
|
||||
all: example minigzip
|
||||
|
||||
test: all
|
||||
example
|
||||
echo hello world | minigzip | minigzip -d
|
||||
|
||||
$(LIBNAME): $(OBJS)
|
||||
$(AR) $(AR_FLAGS) $@ $(OBJS)
|
||||
$(RANLIB) $@
|
||||
|
||||
example: example.o $(LIBNAME)
|
||||
$(LN) $(LDFLAGS) example LIB:c_ppc.o example.o $(LIBNAME) $(LDLIBS) LIB:end.o
|
||||
|
||||
minigzip: minigzip.o $(LIBNAME)
|
||||
$(LN) $(LDFLAGS) minigzip LIB:c_ppc.o minigzip.o $(LIBNAME) $(LDLIBS) LIB:end.o
|
||||
|
||||
clean:
|
||||
$(RM) *.o example minigzip $(LIBNAME) foo.gz
|
||||
|
||||
zip:
|
||||
zip -ul9 zlib README ChangeLog Makefile Make????.??? Makefile.?? \
|
||||
descrip.mms *.[ch]
|
||||
|
||||
tgz:
|
||||
cd ..; tar cfz zlib/zlib.tgz zlib/README zlib/ChangeLog zlib/Makefile \
|
||||
zlib/Make????.??? zlib/Makefile.?? zlib/descrip.mms zlib/*.[ch]
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
adler32.o: zutil.h zlib.h zconf.h
|
||||
compress.o: zlib.h zconf.h
|
||||
crc32.o: zutil.h zlib.h zconf.h
|
||||
deflate.o: deflate.h zutil.h zlib.h zconf.h
|
||||
example.o: zlib.h zconf.h
|
||||
gzio.o: zutil.h zlib.h zconf.h
|
||||
infblock.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
|
||||
infcodes.o: zutil.h zlib.h zconf.h inftrees.h infutil.h infcodes.h inffast.h
|
||||
inffast.o: zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h
|
||||
inflate.o: zutil.h zlib.h zconf.h infblock.h
|
||||
inftrees.o: zutil.h zlib.h zconf.h inftrees.h
|
||||
infutil.o: zutil.h zlib.h zconf.h inftrees.h infutil.h
|
||||
minigzip.o: zlib.h zconf.h
|
||||
trees.o: deflate.h zutil.h zlib.h zconf.h
|
||||
uncompr.o: zlib.h zconf.h
|
||||
zutil.o: zutil.h zlib.h zconf.h
|
||||
@@ -1,64 +0,0 @@
|
||||
# SMakefile for zlib
|
||||
# Modified from the standard UNIX Makefile Copyright Jean-loup Gailly
|
||||
# Osma Ahvenlampi <Osma.Ahvenlampi@hut.fi>
|
||||
# Amiga, SAS/C 6.56 & Smake
|
||||
|
||||
CC=sc
|
||||
CFLAGS=OPT
|
||||
#CFLAGS=OPT CPU=68030
|
||||
#CFLAGS=DEBUG=LINE
|
||||
LDFLAGS=LIB z.lib
|
||||
|
||||
SCOPTIONS=OPTSCHED OPTINLINE OPTALIAS OPTTIME OPTINLOCAL STRMERGE \
|
||||
NOICONS PARMS=BOTH NOSTACKCHECK UTILLIB NOVERSION ERRORREXX
|
||||
|
||||
OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
|
||||
zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
|
||||
|
||||
TEST_OBJS = example.o minigzip.o
|
||||
|
||||
all: SCOPTIONS example minigzip
|
||||
|
||||
test: all
|
||||
`cd`/example
|
||||
echo hello world | minigzip | minigzip -d
|
||||
|
||||
install: z.lib
|
||||
copy zlib.h zconf.h INCLUDE: clone
|
||||
copy z.lib LIB: clone
|
||||
|
||||
z.lib: $(OBJS)
|
||||
oml z.lib r $(OBJS)
|
||||
|
||||
example: example.o z.lib
|
||||
$(CC) $(CFLAGS) LINK TO $@ example.o $(LDFLAGS)
|
||||
|
||||
minigzip: minigzip.o z.lib
|
||||
$(CC) $(CFLAGS) LINK TO $@ minigzip.o $(LDFLAGS)
|
||||
|
||||
clean:
|
||||
-delete force quiet *.o example minigzip z.lib foo.gz *.lnk SCOPTIONS
|
||||
|
||||
SCOPTIONS: Smakefile
|
||||
copy to $@ <from <
|
||||
$(SCOPTIONS)
|
||||
<
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
adler32.o: zutil.h zlib.h zconf.h
|
||||
compress.o: zlib.h zconf.h
|
||||
crc32.o: zutil.h zlib.h zconf.h
|
||||
deflate.o: deflate.h zutil.h zlib.h zconf.h
|
||||
example.o: zlib.h zconf.h
|
||||
gzio.o: zutil.h zlib.h zconf.h
|
||||
infblock.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
|
||||
infcodes.o: zutil.h zlib.h zconf.h inftrees.h infutil.h infcodes.h inffast.h
|
||||
inffast.o: zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h
|
||||
inflate.o: zutil.h zlib.h zconf.h infblock.h
|
||||
inftrees.o: zutil.h zlib.h zconf.h inftrees.h
|
||||
infutil.o: zutil.h zlib.h zconf.h inftrees.h infutil.h
|
||||
minigzip.o: zlib.h zconf.h
|
||||
trees.o: deflate.h zutil.h zlib.h zconf.h
|
||||
uncompr.o: zlib.h zconf.h
|
||||
zutil.o: zutil.h zlib.h zconf.h
|
||||
@@ -1,68 +0,0 @@
|
||||
/* compress.c -- compress a memory buffer
|
||||
* Copyright (C) 1995-1998 Jean-loup Gailly.
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
/* @(#) $Id$ */
|
||||
|
||||
#include "zlib.h"
|
||||
|
||||
/* ===========================================================================
|
||||
Compresses the source buffer into the destination buffer. The level
|
||||
parameter has the same meaning as in deflateInit. sourceLen is the byte
|
||||
length of the source buffer. Upon entry, destLen is the total size of the
|
||||
destination buffer, which must be at least 0.1% larger than sourceLen plus
|
||||
12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
|
||||
|
||||
compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
|
||||
memory, Z_BUF_ERROR if there was not enough room in the output buffer,
|
||||
Z_STREAM_ERROR if the level parameter is invalid.
|
||||
*/
|
||||
int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
|
||||
Bytef *dest;
|
||||
uLongf *destLen;
|
||||
const Bytef *source;
|
||||
uLong sourceLen;
|
||||
int level;
|
||||
{
|
||||
z_stream stream;
|
||||
int err;
|
||||
|
||||
stream.next_in = (Bytef*)source;
|
||||
stream.avail_in = (uInt)sourceLen;
|
||||
#ifdef MAXSEG_64K
|
||||
/* Check for source > 64K on 16-bit machine: */
|
||||
if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
|
||||
#endif
|
||||
stream.next_out = dest;
|
||||
stream.avail_out = (uInt)*destLen;
|
||||
if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
|
||||
|
||||
stream.zalloc = (alloc_func)0;
|
||||
stream.zfree = (free_func)0;
|
||||
stream.opaque = (voidpf)0;
|
||||
|
||||
err = deflateInit(&stream, level);
|
||||
if (err != Z_OK) return err;
|
||||
|
||||
err = deflate(&stream, Z_FINISH);
|
||||
if (err != Z_STREAM_END) {
|
||||
deflateEnd(&stream);
|
||||
return err == Z_OK ? Z_BUF_ERROR : err;
|
||||
}
|
||||
*destLen = stream.total_out;
|
||||
|
||||
err = deflateEnd(&stream);
|
||||
return err;
|
||||
}
|
||||
|
||||
/* ===========================================================================
|
||||
*/
|
||||
int ZEXPORT compress (dest, destLen, source, sourceLen)
|
||||
Bytef *dest;
|
||||
uLongf *destLen;
|
||||
const Bytef *source;
|
||||
uLong sourceLen;
|
||||
{
|
||||
return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
|
||||
}
|
||||
214
Lib/zlib/configure
vendored
214
Lib/zlib/configure
vendored
@@ -1,214 +0,0 @@
|
||||
#!/bin/sh
|
||||
# configure script for zlib. This script is needed only if
|
||||
# you wish to build a shared library and your system supports them,
|
||||
# of if you need special compiler, flags or install directory.
|
||||
# Otherwise, you can just use directly "make test; make install"
|
||||
#
|
||||
# To create a shared library, use "configure --shared"; by default a static
|
||||
# library is created. If the primitive shared library support provided here
|
||||
# does not work, use ftp://prep.ai.mit.edu/pub/gnu/libtool-*.tar.gz
|
||||
#
|
||||
# To impose specific compiler or flags or install directory, use for example:
|
||||
# prefix=$HOME CC=cc CFLAGS="-O4" ./configure
|
||||
# or for csh/tcsh users:
|
||||
# (setenv prefix $HOME; setenv CC cc; setenv CFLAGS "-O4"; ./configure)
|
||||
# LDSHARED is the command to be used to create a shared library
|
||||
|
||||
# Incorrect settings of CC or CFLAGS may prevent creating a shared library.
|
||||
# If you have problems, try without defining CC and CFLAGS before reporting
|
||||
# an error.
|
||||
|
||||
LIBS=libz.a
|
||||
SHAREDLIB=libz.so
|
||||
VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`
|
||||
AR=${AR-"ar rc"}
|
||||
RANLIB=${RANLIB-"ranlib"}
|
||||
prefix=${prefix-/usr/local}
|
||||
exec_prefix=${exec_prefix-'${prefix}'}
|
||||
libdir=${libdir-'${exec_prefix}/lib'}
|
||||
includedir=${includedir-'${prefix}/include'}
|
||||
shared_ext='.so'
|
||||
shared=0
|
||||
gcc=0
|
||||
old_cc="$CC"
|
||||
old_cflags="$CFLAGS"
|
||||
|
||||
while test $# -ge 1
|
||||
do
|
||||
case "$1" in
|
||||
-p*=* | --p*=*) prefix=`echo $1 | sed 's/[-a-z_]*=//'`; shift;;
|
||||
-e*=* | --e*=*) exec_prefix=`echo $1 | sed 's/[-a-z_]*=//'`; shift;;
|
||||
-l*=* | --libdir=*) libdir=`echo $1 | sed 's/[-a-z_]*=//'`; shift;;
|
||||
-i*=* | --includedir=*) includedir=`echo $1 | sed 's/[-a-z_]*=//'`;shift;;
|
||||
-p* | --p*) prefix="$2"; shift; shift;;
|
||||
-e* | --e*) exec_prefix="$2"; shift; shift;;
|
||||
-l* | --l*) libdir="$2"; shift; shift;;
|
||||
-i* | --i*) includedir="$2"; shift; shift;;
|
||||
-sh* | --sh*) shared=1; shift;;
|
||||
--src*) shift;;
|
||||
--c*) shift;;
|
||||
*)
|
||||
echo 'usage:'
|
||||
echo ' configure [--shared] [--prefix=PREFIX] [--exec_prefix=EXPREFIX]'
|
||||
echo ' [--libdir=LIBDIR] [--includedir=INCLUDEDIR]'
|
||||
exit 0;;
|
||||
esac
|
||||
done
|
||||
|
||||
test=ztest$$
|
||||
cat > $test.c <<EOF
|
||||
extern int getchar();
|
||||
int hello() {return getchar();}
|
||||
EOF
|
||||
|
||||
test -z "$CC" && echo Checking for gcc...
|
||||
cc=${CC-gcc}
|
||||
cflags=${CFLAGS-"-O3"}
|
||||
# to force the asm version use: CFLAGS="-O3 -DASMV" ./configure
|
||||
case "$cc" in
|
||||
*gcc*) gcc=1;;
|
||||
esac
|
||||
|
||||
if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then
|
||||
CC="$cc"
|
||||
SFLAGS=${CFLAGS-"-fPIC -O3"}
|
||||
CFLAGS="$cflags"
|
||||
case `(uname -s || echo unknown) 2>/dev/null` in
|
||||
Linux | linux) LDSHARED=${LDSHARED-"gcc -shared -Wl,-soname,libz.so.1"};;
|
||||
*) LDSHARED=${LDSHARED-"gcc -shared"};;
|
||||
esac
|
||||
else
|
||||
# find system name and corresponding cc options
|
||||
CC=${CC-cc}
|
||||
case `(uname -sr || echo unknown) 2>/dev/null` in
|
||||
HP-UX*) SFLAGS=${CFLAGS-"-O +z"}
|
||||
CFLAGS=${CFLAGS-"-O"}
|
||||
# LDSHARED=${LDSHARED-"ld -b +vnocompatwarnings"}
|
||||
LDSHARED=${LDSHARED-"ld -b"}
|
||||
shared_ext='.sl'
|
||||
SHAREDLIB='libz.sl';;
|
||||
IRIX*) SFLAGS=${CFLAGS-"-ansi -O2 -rpath ."}
|
||||
CFLAGS=${CFLAGS-"-ansi -O2"}
|
||||
LDSHARED=${LDSHARED-"cc -shared"};;
|
||||
OSF1\ V4*) SFLAGS=${CFLAGS-"-O -std1"}
|
||||
CFLAGS=${CFLAGS-"-O -std1"}
|
||||
LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,$SHAREDLIB -Wl,-msym -Wl,-rpath,$(libdir) -Wl,-set_version,${VER}:1.0"};;
|
||||
OSF1*) SFLAGS=${CFLAGS-"-O -std1"}
|
||||
CFLAGS=${CFLAGS-"-O -std1"}
|
||||
LDSHARED=${LDSHARED-"cc -shared"};;
|
||||
QNX*) SFLAGS=${CFLAGS-"-4 -O"}
|
||||
CFLAGS=${CFLAGS-"-4 -O"}
|
||||
LDSHARED=${LDSHARED-"cc"}
|
||||
RANLIB=${RANLIB-"true"}
|
||||
AR="cc -A";;
|
||||
SCO_SV\ 3.2*) SFLAGS=${CFLAGS-"-O3 -dy -KPIC "}
|
||||
CFLAGS=${CFLAGS-"-O3"}
|
||||
LDSHARED=${LDSHARED-"cc -dy -KPIC -G"};;
|
||||
SunOS\ 5*) SFLAGS=${CFLAGS-"-fast -xcg89 -KPIC -R."}
|
||||
CFLAGS=${CFLAGS-"-fast -xcg89"}
|
||||
LDSHARED=${LDSHARED-"cc -G"};;
|
||||
SunOS\ 4*) SFLAGS=${CFLAGS-"-O2 -PIC"}
|
||||
CFLAGS=${CFLAGS-"-O2"}
|
||||
LDSHARED=${LDSHARED-"ld"};;
|
||||
UNIX_System_V\ 4.2.0)
|
||||
SFLAGS=${CFLAGS-"-KPIC -O"}
|
||||
CFLAGS=${CFLAGS-"-O"}
|
||||
LDSHARED=${LDSHARED-"cc -G"};;
|
||||
UNIX_SV\ 4.2MP)
|
||||
SFLAGS=${CFLAGS-"-Kconform_pic -O"}
|
||||
CFLAGS=${CFLAGS-"-O"}
|
||||
LDSHARED=${LDSHARED-"cc -G"};;
|
||||
# send working options for other systems to support@gzip.org
|
||||
*) SFLAGS=${CFLAGS-"-O"}
|
||||
CFLAGS=${CFLAGS-"-O"}
|
||||
LDSHARED=${LDSHARED-"cc -shared"};;
|
||||
esac
|
||||
fi
|
||||
|
||||
if test $shared -eq 1; then
|
||||
echo Checking for shared library support...
|
||||
# we must test in two steps (cc then ld), required at least on SunOS 4.x
|
||||
if test "`($CC -c $SFLAGS $test.c) 2>&1`" = "" &&
|
||||
test "`($LDSHARED -o $test$shared_ext $test.o) 2>&1`" = ""; then
|
||||
CFLAGS="$SFLAGS"
|
||||
LIBS="$SHAREDLIB.$VER"
|
||||
echo Building shared library $SHAREDLIB.$VER with $CC.
|
||||
elif test -z "$old_cc" -a -z "$old_cflags"; then
|
||||
echo No shared library suppport.
|
||||
shared=0;
|
||||
else
|
||||
echo 'No shared library suppport; try without defining CC and CFLAGS'
|
||||
shared=0;
|
||||
fi
|
||||
fi
|
||||
if test $shared -eq 0; then
|
||||
LDSHARED="$CC"
|
||||
echo Building static library $LIBS version $VER with $CC.
|
||||
fi
|
||||
|
||||
cat > $test.c <<EOF
|
||||
#include <unistd.h>
|
||||
int main() { return 0; }
|
||||
EOF
|
||||
if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
|
||||
CFLAGS="$CFLAGS -DHAVE_UNISTD_H"
|
||||
echo "Checking for unistd.h... Yes."
|
||||
else
|
||||
echo "Checking for unistd.h... No."
|
||||
fi
|
||||
|
||||
cat > $test.c <<EOF
|
||||
#include <errno.h>
|
||||
int main() { return 0; }
|
||||
EOF
|
||||
if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
|
||||
echo "Checking for errno.h... Yes."
|
||||
else
|
||||
echo "Checking for errno.h... No."
|
||||
CFLAGS="$CFLAGS -DNO_ERRNO_H"
|
||||
fi
|
||||
|
||||
cat > $test.c <<EOF
|
||||
#include <sys/types.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/stat.h>
|
||||
caddr_t hello() {
|
||||
return mmap((caddr_t)0, (off_t)0, PROT_READ, MAP_SHARED, 0, (off_t)0);
|
||||
}
|
||||
EOF
|
||||
if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
|
||||
CFLAGS="$CFLAGS -DUSE_MMAP"
|
||||
echo Checking for mmap support... Yes.
|
||||
else
|
||||
echo Checking for mmap support... No.
|
||||
fi
|
||||
|
||||
CPP=${CPP-"$CC -E"}
|
||||
case $CFLAGS in
|
||||
*ASMV*)
|
||||
if test "`nm $test.o | grep _hello`" = ""; then
|
||||
CPP="$CPP -DNO_UNDERLINE"
|
||||
echo Checking for underline in external names... No.
|
||||
else
|
||||
echo Checking for underline in external names... Yes.
|
||||
fi;;
|
||||
esac
|
||||
|
||||
rm -f $test.[co] $test$shared_ext
|
||||
|
||||
# udpate Makefile
|
||||
sed < Makefile.in "
|
||||
/^CC *=/s%=.*%=$CC%
|
||||
/^CFLAGS *=/s%=.*%=$CFLAGS%
|
||||
/^CPP *=/s%=.*%=$CPP%
|
||||
/^LDSHARED *=/s%=.*%=$LDSHARED%
|
||||
/^LIBS *=/s%=.*%=$LIBS%
|
||||
/^SHAREDLIB *=/s%=.*%=$SHAREDLIB%
|
||||
/^AR *=/s%=.*%=$AR%
|
||||
/^RANLIB *=/s%=.*%=$RANLIB%
|
||||
/^VER *=/s%=.*%=$VER%
|
||||
/^prefix *=/s%=.*%=$prefix%
|
||||
/^exec_prefix *=/s%=.*%=$exec_prefix%
|
||||
/^libdir *=/s%=.*%=$libdir%
|
||||
/^includedir *=/s%=.*%=$includedir%
|
||||
" > Makefile
|
||||
@@ -1,34 +0,0 @@
|
||||
All files under this contrib directory are UNSUPPORTED. There were
|
||||
provided by users of zlib and were not tested by the authors of zlib.
|
||||
Use at your own risk. Please contact the authors of the contributions
|
||||
for help about these, not the zlib authors. Thanks.
|
||||
|
||||
|
||||
asm386/ by Gilles Vollant <info@winimage.com>
|
||||
386 asm code replacing longest_match(), for Visual C++ 4.2 and ML 6.11c
|
||||
|
||||
asm586/ and asm686/ by Brian Raiter <breadbox@muppetlabs.com>
|
||||
asm code for Pentium and Pentium Pro
|
||||
See http://www.muppetlabs.com/~breadbox/software/assembly.html
|
||||
|
||||
delphi/ by Bob Dellaca <bobdl@xtra.co.nz>
|
||||
Support for Delphi
|
||||
|
||||
delphi2/ by Davide Moretti <dave@rimini.com>
|
||||
Another support for C++Builder and Delphi
|
||||
|
||||
minizip/ by Gilles Vollant <info@winimage.com>
|
||||
Mini zip and unzip based on zlib
|
||||
See http://www.winimage.com/zLibDll/unzip.html
|
||||
|
||||
iostream/ by Kevin Ruland <kevin@rodin.wustl.edu>
|
||||
A C++ I/O streams interface to the zlib gz* functions
|
||||
|
||||
iostream2/ by Tyge L<>vset <Tyge.Lovset@cmr.no>
|
||||
Another C++ I/O streams interface
|
||||
|
||||
untgz/ by "Pedro A. Aranda Guti\irrez" <paag@tid.es>
|
||||
A very simple tar.gz file extractor using zlib
|
||||
|
||||
visual-basic.txt by Carlos Rios <c_rios@sonda.cl>
|
||||
How to use compress(), uncompress() and the gz* functions from VB.
|
||||
@@ -1,559 +0,0 @@
|
||||
;
|
||||
; gvmat32.asm -- Asm portion of the optimized longest_match for 32 bits x86
|
||||
; Copyright (C) 1995-1996 Jean-loup Gailly and Gilles Vollant.
|
||||
; File written by Gilles Vollant, by modifiying the longest_match
|
||||
; from Jean-loup Gailly in deflate.c
|
||||
; It need wmask == 0x7fff
|
||||
; (assembly code is faster with a fixed wmask)
|
||||
;
|
||||
; For Visual C++ 4.2 and ML 6.11c (version in directory \MASM611C of Win95 DDK)
|
||||
; I compile with : "ml /coff /Zi /c gvmat32.asm"
|
||||
;
|
||||
|
||||
;uInt longest_match_7fff(s, cur_match)
|
||||
; deflate_state *s;
|
||||
; IPos cur_match; /* current match */
|
||||
|
||||
NbStack equ 76
|
||||
cur_match equ dword ptr[esp+NbStack-0]
|
||||
str_s equ dword ptr[esp+NbStack-4]
|
||||
; 5 dword on top (ret,ebp,esi,edi,ebx)
|
||||
adrret equ dword ptr[esp+NbStack-8]
|
||||
pushebp equ dword ptr[esp+NbStack-12]
|
||||
pushedi equ dword ptr[esp+NbStack-16]
|
||||
pushesi equ dword ptr[esp+NbStack-20]
|
||||
pushebx equ dword ptr[esp+NbStack-24]
|
||||
|
||||
chain_length equ dword ptr [esp+NbStack-28]
|
||||
limit equ dword ptr [esp+NbStack-32]
|
||||
best_len equ dword ptr [esp+NbStack-36]
|
||||
window equ dword ptr [esp+NbStack-40]
|
||||
prev equ dword ptr [esp+NbStack-44]
|
||||
scan_start equ word ptr [esp+NbStack-48]
|
||||
wmask equ dword ptr [esp+NbStack-52]
|
||||
match_start_ptr equ dword ptr [esp+NbStack-56]
|
||||
nice_match equ dword ptr [esp+NbStack-60]
|
||||
scan equ dword ptr [esp+NbStack-64]
|
||||
|
||||
windowlen equ dword ptr [esp+NbStack-68]
|
||||
match_start equ dword ptr [esp+NbStack-72]
|
||||
strend equ dword ptr [esp+NbStack-76]
|
||||
NbStackAdd equ (NbStack-24)
|
||||
|
||||
.386p
|
||||
|
||||
name gvmatch
|
||||
.MODEL FLAT
|
||||
|
||||
|
||||
|
||||
; all the +4 offsets are due to the addition of pending_buf_size (in zlib
|
||||
; in the deflate_state structure since the asm code was first written
|
||||
; (if you compile with zlib 1.0.4 or older, remove the +4).
|
||||
; Note : these value are good with a 8 bytes boundary pack structure
|
||||
dep_chain_length equ 70h+4
|
||||
dep_window equ 2ch+4
|
||||
dep_strstart equ 60h+4
|
||||
dep_prev_length equ 6ch+4
|
||||
dep_nice_match equ 84h+4
|
||||
dep_w_size equ 20h+4
|
||||
dep_prev equ 34h+4
|
||||
dep_w_mask equ 28h+4
|
||||
dep_good_match equ 80h+4
|
||||
dep_match_start equ 64h+4
|
||||
dep_lookahead equ 68h+4
|
||||
|
||||
|
||||
_TEXT segment
|
||||
|
||||
IFDEF NOUNDERLINE
|
||||
public longest_match_7fff
|
||||
; public match_init
|
||||
ELSE
|
||||
public _longest_match_7fff
|
||||
; public _match_init
|
||||
ENDIF
|
||||
|
||||
MAX_MATCH equ 258
|
||||
MIN_MATCH equ 3
|
||||
MIN_LOOKAHEAD equ (MAX_MATCH+MIN_MATCH+1)
|
||||
|
||||
|
||||
|
||||
IFDEF NOUNDERLINE
|
||||
;match_init proc near
|
||||
; ret
|
||||
;match_init endp
|
||||
ELSE
|
||||
;_match_init proc near
|
||||
; ret
|
||||
;_match_init endp
|
||||
ENDIF
|
||||
|
||||
|
||||
IFDEF NOUNDERLINE
|
||||
longest_match_7fff proc near
|
||||
ELSE
|
||||
_longest_match_7fff proc near
|
||||
ENDIF
|
||||
|
||||
mov edx,[esp+4]
|
||||
|
||||
|
||||
|
||||
push ebp
|
||||
push edi
|
||||
push esi
|
||||
push ebx
|
||||
|
||||
sub esp,NbStackAdd
|
||||
|
||||
; initialize or check the variables used in match.asm.
|
||||
mov ebp,edx
|
||||
|
||||
; chain_length = s->max_chain_length
|
||||
; if (prev_length>=good_match) chain_length >>= 2
|
||||
mov edx,[ebp+dep_chain_length]
|
||||
mov ebx,[ebp+dep_prev_length]
|
||||
cmp [ebp+dep_good_match],ebx
|
||||
ja noshr
|
||||
shr edx,2
|
||||
noshr:
|
||||
; we increment chain_length because in the asm, the --chain_lenght is in the beginning of the loop
|
||||
inc edx
|
||||
mov edi,[ebp+dep_nice_match]
|
||||
mov chain_length,edx
|
||||
mov eax,[ebp+dep_lookahead]
|
||||
cmp eax,edi
|
||||
; if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;
|
||||
jae nolookaheadnicematch
|
||||
mov edi,eax
|
||||
nolookaheadnicematch:
|
||||
; best_len = s->prev_length
|
||||
mov best_len,ebx
|
||||
|
||||
; window = s->window
|
||||
mov esi,[ebp+dep_window]
|
||||
mov ecx,[ebp+dep_strstart]
|
||||
mov window,esi
|
||||
|
||||
mov nice_match,edi
|
||||
; scan = window + strstart
|
||||
add esi,ecx
|
||||
mov scan,esi
|
||||
; dx = *window
|
||||
mov dx,word ptr [esi]
|
||||
; bx = *(window+best_len-1)
|
||||
mov bx,word ptr [esi+ebx-1]
|
||||
add esi,MAX_MATCH-1
|
||||
; scan_start = *scan
|
||||
mov scan_start,dx
|
||||
; strend = scan + MAX_MATCH-1
|
||||
mov strend,esi
|
||||
; bx = scan_end = *(window+best_len-1)
|
||||
|
||||
; IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
|
||||
; s->strstart - (IPos)MAX_DIST(s) : NIL;
|
||||
|
||||
mov esi,[ebp+dep_w_size]
|
||||
sub esi,MIN_LOOKAHEAD
|
||||
; here esi = MAX_DIST(s)
|
||||
sub ecx,esi
|
||||
ja nodist
|
||||
xor ecx,ecx
|
||||
nodist:
|
||||
mov limit,ecx
|
||||
|
||||
; prev = s->prev
|
||||
mov edx,[ebp+dep_prev]
|
||||
mov prev,edx
|
||||
|
||||
;
|
||||
mov edx,dword ptr [ebp+dep_match_start]
|
||||
mov bp,scan_start
|
||||
mov eax,cur_match
|
||||
mov match_start,edx
|
||||
|
||||
mov edx,window
|
||||
mov edi,edx
|
||||
add edi,best_len
|
||||
mov esi,prev
|
||||
dec edi
|
||||
; windowlen = window + best_len -1
|
||||
mov windowlen,edi
|
||||
|
||||
jmp beginloop2
|
||||
align 4
|
||||
|
||||
; here, in the loop
|
||||
; eax = ax = cur_match
|
||||
; ecx = limit
|
||||
; bx = scan_end
|
||||
; bp = scan_start
|
||||
; edi = windowlen (window + best_len -1)
|
||||
; esi = prev
|
||||
|
||||
|
||||
;// here; chain_length <=16
|
||||
normalbeg0add16:
|
||||
add chain_length,16
|
||||
jz exitloop
|
||||
normalbeg0:
|
||||
cmp word ptr[edi+eax],bx
|
||||
je normalbeg2noroll
|
||||
rcontlabnoroll:
|
||||
; cur_match = prev[cur_match & wmask]
|
||||
and eax,7fffh
|
||||
mov ax,word ptr[esi+eax*2]
|
||||
; if cur_match > limit, go to exitloop
|
||||
cmp ecx,eax
|
||||
jnb exitloop
|
||||
; if --chain_length != 0, go to exitloop
|
||||
dec chain_length
|
||||
jnz normalbeg0
|
||||
jmp exitloop
|
||||
|
||||
normalbeg2noroll:
|
||||
; if (scan_start==*(cur_match+window)) goto normalbeg2
|
||||
cmp bp,word ptr[edx+eax]
|
||||
jne rcontlabnoroll
|
||||
jmp normalbeg2
|
||||
|
||||
contloop3:
|
||||
mov edi,windowlen
|
||||
|
||||
; cur_match = prev[cur_match & wmask]
|
||||
and eax,7fffh
|
||||
mov ax,word ptr[esi+eax*2]
|
||||
; if cur_match > limit, go to exitloop
|
||||
cmp ecx,eax
|
||||
jnbexitloopshort1:
|
||||
jnb exitloop
|
||||
; if --chain_length != 0, go to exitloop
|
||||
|
||||
|
||||
; begin the main loop
|
||||
beginloop2:
|
||||
sub chain_length,16+1
|
||||
; if chain_length <=16, don't use the unrolled loop
|
||||
jna normalbeg0add16
|
||||
|
||||
do16:
|
||||
cmp word ptr[edi+eax],bx
|
||||
je normalbeg2dc0
|
||||
|
||||
maccn MACRO lab
|
||||
and eax,7fffh
|
||||
mov ax,word ptr[esi+eax*2]
|
||||
cmp ecx,eax
|
||||
jnb exitloop
|
||||
cmp word ptr[edi+eax],bx
|
||||
je lab
|
||||
ENDM
|
||||
|
||||
rcontloop0:
|
||||
maccn normalbeg2dc1
|
||||
|
||||
rcontloop1:
|
||||
maccn normalbeg2dc2
|
||||
|
||||
rcontloop2:
|
||||
maccn normalbeg2dc3
|
||||
|
||||
rcontloop3:
|
||||
maccn normalbeg2dc4
|
||||
|
||||
rcontloop4:
|
||||
maccn normalbeg2dc5
|
||||
|
||||
rcontloop5:
|
||||
maccn normalbeg2dc6
|
||||
|
||||
rcontloop6:
|
||||
maccn normalbeg2dc7
|
||||
|
||||
rcontloop7:
|
||||
maccn normalbeg2dc8
|
||||
|
||||
rcontloop8:
|
||||
maccn normalbeg2dc9
|
||||
|
||||
rcontloop9:
|
||||
maccn normalbeg2dc10
|
||||
|
||||
rcontloop10:
|
||||
maccn short normalbeg2dc11
|
||||
|
||||
rcontloop11:
|
||||
maccn short normalbeg2dc12
|
||||
|
||||
rcontloop12:
|
||||
maccn short normalbeg2dc13
|
||||
|
||||
rcontloop13:
|
||||
maccn short normalbeg2dc14
|
||||
|
||||
rcontloop14:
|
||||
maccn short normalbeg2dc15
|
||||
|
||||
rcontloop15:
|
||||
and eax,7fffh
|
||||
mov ax,word ptr[esi+eax*2]
|
||||
cmp ecx,eax
|
||||
jnb exitloop
|
||||
|
||||
sub chain_length,16
|
||||
ja do16
|
||||
jmp normalbeg0add16
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
normbeg MACRO rcontlab,valsub
|
||||
; if we are here, we know that *(match+best_len-1) == scan_end
|
||||
cmp bp,word ptr[edx+eax]
|
||||
; if (match != scan_start) goto rcontlab
|
||||
jne rcontlab
|
||||
; calculate the good chain_length, and we'll compare scan and match string
|
||||
add chain_length,16-valsub
|
||||
jmp iseq
|
||||
ENDM
|
||||
|
||||
|
||||
normalbeg2dc11:
|
||||
normbeg rcontloop11,11
|
||||
|
||||
normalbeg2dc12:
|
||||
normbeg short rcontloop12,12
|
||||
|
||||
normalbeg2dc13:
|
||||
normbeg short rcontloop13,13
|
||||
|
||||
normalbeg2dc14:
|
||||
normbeg short rcontloop14,14
|
||||
|
||||
normalbeg2dc15:
|
||||
normbeg short rcontloop15,15
|
||||
|
||||
normalbeg2dc10:
|
||||
normbeg rcontloop10,10
|
||||
|
||||
normalbeg2dc9:
|
||||
normbeg rcontloop9,9
|
||||
|
||||
normalbeg2dc8:
|
||||
normbeg rcontloop8,8
|
||||
|
||||
normalbeg2dc7:
|
||||
normbeg rcontloop7,7
|
||||
|
||||
normalbeg2dc6:
|
||||
normbeg rcontloop6,6
|
||||
|
||||
normalbeg2dc5:
|
||||
normbeg rcontloop5,5
|
||||
|
||||
normalbeg2dc4:
|
||||
normbeg rcontloop4,4
|
||||
|
||||
normalbeg2dc3:
|
||||
normbeg rcontloop3,3
|
||||
|
||||
normalbeg2dc2:
|
||||
normbeg rcontloop2,2
|
||||
|
||||
normalbeg2dc1:
|
||||
normbeg rcontloop1,1
|
||||
|
||||
normalbeg2dc0:
|
||||
normbeg rcontloop0,0
|
||||
|
||||
|
||||
; we go in normalbeg2 because *(ushf*)(match+best_len-1) == scan_end
|
||||
|
||||
normalbeg2:
|
||||
mov edi,window
|
||||
|
||||
cmp bp,word ptr[edi+eax]
|
||||
jne contloop3 ; if *(ushf*)match != scan_start, continue
|
||||
|
||||
iseq:
|
||||
; if we are here, we know that *(match+best_len-1) == scan_end
|
||||
; and (match == scan_start)
|
||||
|
||||
mov edi,edx
|
||||
mov esi,scan ; esi = scan
|
||||
add edi,eax ; edi = window + cur_match = match
|
||||
|
||||
mov edx,[esi+3] ; compare manually dword at match+3
|
||||
xor edx,[edi+3] ; and scan +3
|
||||
|
||||
jz begincompare ; if equal, go to long compare
|
||||
|
||||
; we will determine the unmatch byte and calculate len (in esi)
|
||||
or dl,dl
|
||||
je eq1rr
|
||||
mov esi,3
|
||||
jmp trfinval
|
||||
eq1rr:
|
||||
or dx,dx
|
||||
je eq1
|
||||
|
||||
mov esi,4
|
||||
jmp trfinval
|
||||
eq1:
|
||||
and edx,0ffffffh
|
||||
jz eq11
|
||||
mov esi,5
|
||||
jmp trfinval
|
||||
eq11:
|
||||
mov esi,6
|
||||
jmp trfinval
|
||||
|
||||
begincompare:
|
||||
; here we now scan and match begin same
|
||||
add edi,6
|
||||
add esi,6
|
||||
mov ecx,(MAX_MATCH-(2+4))/4 ; scan for at most MAX_MATCH bytes
|
||||
repe cmpsd ; loop until mismatch
|
||||
|
||||
je trfin ; go to trfin if not unmatch
|
||||
; we determine the unmatch byte
|
||||
sub esi,4
|
||||
mov edx,[edi-4]
|
||||
xor edx,[esi]
|
||||
|
||||
or dl,dl
|
||||
jnz trfin
|
||||
inc esi
|
||||
|
||||
or dx,dx
|
||||
jnz trfin
|
||||
inc esi
|
||||
|
||||
and edx,0ffffffh
|
||||
jnz trfin
|
||||
inc esi
|
||||
|
||||
trfin:
|
||||
sub esi,scan ; esi = len
|
||||
trfinval:
|
||||
; here we have finised compare, and esi contain len of equal string
|
||||
cmp esi,best_len ; if len > best_len, go newbestlen
|
||||
ja short newbestlen
|
||||
; now we restore edx, ecx and esi, for the big loop
|
||||
mov esi,prev
|
||||
mov ecx,limit
|
||||
mov edx,window
|
||||
jmp contloop3
|
||||
|
||||
newbestlen:
|
||||
mov best_len,esi ; len become best_len
|
||||
|
||||
mov match_start,eax ; save new position as match_start
|
||||
cmp esi,nice_match ; if best_len >= nice_match, exit
|
||||
jae exitloop
|
||||
mov ecx,scan
|
||||
mov edx,window ; restore edx=window
|
||||
add ecx,esi
|
||||
add esi,edx
|
||||
|
||||
dec esi
|
||||
mov windowlen,esi ; windowlen = window + best_len-1
|
||||
mov bx,[ecx-1] ; bx = *(scan+best_len-1) = scan_end
|
||||
|
||||
; now we restore ecx and esi, for the big loop :
|
||||
mov esi,prev
|
||||
mov ecx,limit
|
||||
jmp contloop3
|
||||
|
||||
exitloop:
|
||||
; exit : s->match_start=match_start
|
||||
mov ebx,match_start
|
||||
mov ebp,str_s
|
||||
mov ecx,best_len
|
||||
mov dword ptr [ebp+dep_match_start],ebx
|
||||
mov eax,dword ptr [ebp+dep_lookahead]
|
||||
cmp ecx,eax
|
||||
ja minexlo
|
||||
mov eax,ecx
|
||||
minexlo:
|
||||
; return min(best_len,s->lookahead)
|
||||
|
||||
; restore stack and register ebx,esi,edi,ebp
|
||||
add esp,NbStackAdd
|
||||
|
||||
pop ebx
|
||||
pop esi
|
||||
pop edi
|
||||
pop ebp
|
||||
ret
|
||||
InfoAuthor:
|
||||
; please don't remove this string !
|
||||
; Your are free use gvmat32 in any fre or commercial apps if you don't remove the string in the binary!
|
||||
db 0dh,0ah,"GVMat32 optimised assembly code written 1996-98 by Gilles Vollant",0dh,0ah
|
||||
|
||||
|
||||
|
||||
IFDEF NOUNDERLINE
|
||||
longest_match_7fff endp
|
||||
ELSE
|
||||
_longest_match_7fff endp
|
||||
ENDIF
|
||||
|
||||
|
||||
IFDEF NOUNDERLINE
|
||||
cpudetect32 proc near
|
||||
ELSE
|
||||
_cpudetect32 proc near
|
||||
ENDIF
|
||||
|
||||
|
||||
pushfd ; push original EFLAGS
|
||||
pop eax ; get original EFLAGS
|
||||
mov ecx, eax ; save original EFLAGS
|
||||
xor eax, 40000h ; flip AC bit in EFLAGS
|
||||
push eax ; save new EFLAGS value on stack
|
||||
popfd ; replace current EFLAGS value
|
||||
pushfd ; get new EFLAGS
|
||||
pop eax ; store new EFLAGS in EAX
|
||||
xor eax, ecx ; can<61>t toggle AC bit, processor=80386
|
||||
jz end_cpu_is_386 ; jump if 80386 processor
|
||||
push ecx
|
||||
popfd ; restore AC bit in EFLAGS first
|
||||
|
||||
pushfd
|
||||
pushfd
|
||||
pop ecx
|
||||
|
||||
mov eax, ecx ; get original EFLAGS
|
||||
xor eax, 200000h ; flip ID bit in EFLAGS
|
||||
push eax ; save new EFLAGS value on stack
|
||||
popfd ; replace current EFLAGS value
|
||||
pushfd ; get new EFLAGS
|
||||
pop eax ; store new EFLAGS in EAX
|
||||
popfd ; restore original EFLAGS
|
||||
xor eax, ecx ; can<61>t toggle ID bit,
|
||||
je is_old_486 ; processor=old
|
||||
|
||||
mov eax,1
|
||||
db 0fh,0a2h ;CPUID
|
||||
|
||||
exitcpudetect:
|
||||
ret
|
||||
|
||||
end_cpu_is_386:
|
||||
mov eax,0300h
|
||||
jmp exitcpudetect
|
||||
|
||||
is_old_486:
|
||||
mov eax,0400h
|
||||
jmp exitcpudetect
|
||||
|
||||
IFDEF NOUNDERLINE
|
||||
cpudetect32 endp
|
||||
ELSE
|
||||
_cpudetect32 endp
|
||||
ENDIF
|
||||
|
||||
_TEXT ends
|
||||
end
|
||||
@@ -1,200 +0,0 @@
|
||||
/* gvmat32.c -- C portion of the optimized longest_match for 32 bits x86
|
||||
* Copyright (C) 1995-1996 Jean-loup Gailly and Gilles Vollant.
|
||||
* File written by Gilles Vollant, by modifiying the longest_match
|
||||
* from Jean-loup Gailly in deflate.c
|
||||
* it prepare all parameters and call the assembly longest_match_gvasm
|
||||
* longest_match execute standard C code is wmask != 0x7fff
|
||||
* (assembly code is faster with a fixed wmask)
|
||||
*
|
||||
*/
|
||||
|
||||
#include "deflate.h"
|
||||
|
||||
#undef FAR
|
||||
#include <windows.h>
|
||||
|
||||
#ifdef ASMV
|
||||
#define NIL 0
|
||||
|
||||
#define UNALIGNED_OK
|
||||
|
||||
|
||||
/* if your C compiler don't add underline before function name,
|
||||
define ADD_UNDERLINE_ASMFUNC */
|
||||
#ifdef ADD_UNDERLINE_ASMFUNC
|
||||
#define longest_match_7fff _longest_match_7fff
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
void match_init()
|
||||
{
|
||||
}
|
||||
|
||||
unsigned long cpudetect32();
|
||||
|
||||
uInt longest_match_c(
|
||||
deflate_state *s,
|
||||
IPos cur_match); /* current match */
|
||||
|
||||
|
||||
uInt longest_match_7fff(
|
||||
deflate_state *s,
|
||||
IPos cur_match); /* current match */
|
||||
|
||||
uInt longest_match(
|
||||
deflate_state *s,
|
||||
IPos cur_match) /* current match */
|
||||
{
|
||||
static uInt iIsPPro=2;
|
||||
|
||||
if ((s->w_mask == 0x7fff) && (iIsPPro==0))
|
||||
return longest_match_7fff(s,cur_match);
|
||||
|
||||
if (iIsPPro==2)
|
||||
iIsPPro = (((cpudetect32()/0x100)&0xf)>=6) ? 1 : 0;
|
||||
|
||||
return longest_match_c(s,cur_match);
|
||||
}
|
||||
|
||||
|
||||
|
||||
uInt longest_match_c(s, cur_match)
|
||||
deflate_state *s;
|
||||
IPos cur_match; /* current match */
|
||||
{
|
||||
unsigned chain_length = s->max_chain_length;/* max hash chain length */
|
||||
register Bytef *scan = s->window + s->strstart; /* current string */
|
||||
register Bytef *match; /* matched string */
|
||||
register int len; /* length of current match */
|
||||
int best_len = s->prev_length; /* best match length so far */
|
||||
int nice_match = s->nice_match; /* stop if match long enough */
|
||||
IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
|
||||
s->strstart - (IPos)MAX_DIST(s) : NIL;
|
||||
/* Stop when cur_match becomes <= limit. To simplify the code,
|
||||
* we prevent matches with the string of window index 0.
|
||||
*/
|
||||
Posf *prev = s->prev;
|
||||
uInt wmask = s->w_mask;
|
||||
|
||||
#ifdef UNALIGNED_OK
|
||||
/* Compare two bytes at a time. Note: this is not always beneficial.
|
||||
* Try with and without -DUNALIGNED_OK to check.
|
||||
*/
|
||||
register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;
|
||||
register ush scan_start = *(ushf*)scan;
|
||||
register ush scan_end = *(ushf*)(scan+best_len-1);
|
||||
#else
|
||||
register Bytef *strend = s->window + s->strstart + MAX_MATCH;
|
||||
register Byte scan_end1 = scan[best_len-1];
|
||||
register Byte scan_end = scan[best_len];
|
||||
#endif
|
||||
|
||||
/* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
|
||||
* It is easy to get rid of this optimization if necessary.
|
||||
*/
|
||||
Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
|
||||
|
||||
/* Do not waste too much time if we already have a good match: */
|
||||
if (s->prev_length >= s->good_match) {
|
||||
chain_length >>= 2;
|
||||
}
|
||||
/* Do not look for matches beyond the end of the input. This is necessary
|
||||
* to make deflate deterministic.
|
||||
*/
|
||||
if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;
|
||||
|
||||
Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
|
||||
|
||||
do {
|
||||
Assert(cur_match < s->strstart, "no future");
|
||||
match = s->window + cur_match;
|
||||
|
||||
/* Skip to next match if the match length cannot increase
|
||||
* or if the match length is less than 2:
|
||||
*/
|
||||
#if (defined(UNALIGNED_OK) && MAX_MATCH == 258)
|
||||
/* This code assumes sizeof(unsigned short) == 2. Do not use
|
||||
* UNALIGNED_OK if your compiler uses a different size.
|
||||
*/
|
||||
if (*(ushf*)(match+best_len-1) != scan_end ||
|
||||
*(ushf*)match != scan_start) continue;
|
||||
|
||||
/* It is not necessary to compare scan[2] and match[2] since they are
|
||||
* always equal when the other bytes match, given that the hash keys
|
||||
* are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at
|
||||
* strstart+3, +5, ... up to strstart+257. We check for insufficient
|
||||
* lookahead only every 4th comparison; the 128th check will be made
|
||||
* at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is
|
||||
* necessary to put more guard bytes at the end of the window, or
|
||||
* to check more often for insufficient lookahead.
|
||||
*/
|
||||
Assert(scan[2] == match[2], "scan[2]?");
|
||||
scan++, match++;
|
||||
do {
|
||||
} while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
|
||||
*(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
|
||||
*(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
|
||||
*(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
|
||||
scan < strend);
|
||||
/* The funny "do {}" generates better code on most compilers */
|
||||
|
||||
/* Here, scan <= window+strstart+257 */
|
||||
Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
|
||||
if (*scan == *match) scan++;
|
||||
|
||||
len = (MAX_MATCH - 1) - (int)(strend-scan);
|
||||
scan = strend - (MAX_MATCH-1);
|
||||
|
||||
#else /* UNALIGNED_OK */
|
||||
|
||||
if (match[best_len] != scan_end ||
|
||||
match[best_len-1] != scan_end1 ||
|
||||
*match != *scan ||
|
||||
*++match != scan[1]) continue;
|
||||
|
||||
/* The check at best_len-1 can be removed because it will be made
|
||||
* again later. (This heuristic is not always a win.)
|
||||
* It is not necessary to compare scan[2] and match[2] since they
|
||||
* are always equal when the other bytes match, given that
|
||||
* the hash keys are equal and that HASH_BITS >= 8.
|
||||
*/
|
||||
scan += 2, match++;
|
||||
Assert(*scan == *match, "match[2]?");
|
||||
|
||||
/* We check for insufficient lookahead only every 8th comparison;
|
||||
* the 256th check will be made at strstart+258.
|
||||
*/
|
||||
do {
|
||||
} while (*++scan == *++match && *++scan == *++match &&
|
||||
*++scan == *++match && *++scan == *++match &&
|
||||
*++scan == *++match && *++scan == *++match &&
|
||||
*++scan == *++match && *++scan == *++match &&
|
||||
scan < strend);
|
||||
|
||||
Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
|
||||
|
||||
len = MAX_MATCH - (int)(strend - scan);
|
||||
scan = strend - MAX_MATCH;
|
||||
|
||||
#endif /* UNALIGNED_OK */
|
||||
|
||||
if (len > best_len) {
|
||||
s->match_start = cur_match;
|
||||
best_len = len;
|
||||
if (len >= nice_match) break;
|
||||
#ifdef UNALIGNED_OK
|
||||
scan_end = *(ushf*)(scan+best_len-1);
|
||||
#else
|
||||
scan_end1 = scan[best_len-1];
|
||||
scan_end = scan[best_len];
|
||||
#endif
|
||||
}
|
||||
} while ((cur_match = prev[cur_match & wmask]) > limit
|
||||
&& --chain_length != 0);
|
||||
|
||||
if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
|
||||
return s->lookahead;
|
||||
}
|
||||
|
||||
#endif /* ASMV */
|
||||
@@ -1 +0,0 @@
|
||||
c:\masm611\bin\ml /coff /Zi /c /Flgvmat32.lst gvmat32.asm
|
||||
@@ -1,74 +0,0 @@
|
||||
LIBRARY "zlib"
|
||||
|
||||
DESCRIPTION '"""zlib data compression library"""'
|
||||
|
||||
|
||||
VERSION 1.11
|
||||
|
||||
|
||||
HEAPSIZE 1048576,8192
|
||||
|
||||
EXPORTS
|
||||
adler32 @1
|
||||
compress @2
|
||||
crc32 @3
|
||||
deflate @4
|
||||
deflateCopy @5
|
||||
deflateEnd @6
|
||||
deflateInit2_ @7
|
||||
deflateInit_ @8
|
||||
deflateParams @9
|
||||
deflateReset @10
|
||||
deflateSetDictionary @11
|
||||
gzclose @12
|
||||
gzdopen @13
|
||||
gzerror @14
|
||||
gzflush @15
|
||||
gzopen @16
|
||||
gzread @17
|
||||
gzwrite @18
|
||||
inflate @19
|
||||
inflateEnd @20
|
||||
inflateInit2_ @21
|
||||
inflateInit_ @22
|
||||
inflateReset @23
|
||||
inflateSetDictionary @24
|
||||
inflateSync @25
|
||||
uncompress @26
|
||||
zlibVersion @27
|
||||
gzprintf @28
|
||||
gzputc @29
|
||||
gzgetc @30
|
||||
gzseek @31
|
||||
gzrewind @32
|
||||
gztell @33
|
||||
gzeof @34
|
||||
gzsetparams @35
|
||||
zError @36
|
||||
inflateSyncPoint @37
|
||||
get_crc_table @38
|
||||
compress2 @39
|
||||
gzputs @40
|
||||
gzgets @41
|
||||
|
||||
unzOpen @61
|
||||
unzClose @62
|
||||
unzGetGlobalInfo @63
|
||||
unzGetCurrentFileInfo @64
|
||||
unzGoToFirstFile @65
|
||||
unzGoToNextFile @66
|
||||
unzOpenCurrentFile @67
|
||||
unzReadCurrentFile @68
|
||||
unztell @70
|
||||
unzeof @71
|
||||
unzCloseCurrentFile @72
|
||||
unzGetGlobalComment @73
|
||||
unzStringFileNameCompare @74
|
||||
unzLocateFile @75
|
||||
unzGetLocalExtrafield @76
|
||||
|
||||
zipOpen @80
|
||||
zipOpenNewFileInZip @81
|
||||
zipWriteInFileInZip @82
|
||||
zipCloseFileInZip @83
|
||||
zipClose @84
|
||||
@@ -1,651 +0,0 @@
|
||||
# Microsoft Developer Studio Project File - Name="zlibvc" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 5.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||
# TARGTYPE "Win32 (ALPHA) Dynamic-Link Library" 0x0602
|
||||
|
||||
CFG=zlibvc - Win32 Release
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "zlibvc.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "zlibvc.mak" CFG="zlibvc - Win32 Release"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "zlibvc - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "zlibvc - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "zlibvc - Win32 ReleaseAxp" (based on\
|
||||
"Win32 (ALPHA) Dynamic-Link Library")
|
||||
!MESSAGE "zlibvc - Win32 ReleaseWithoutAsm" (based on\
|
||||
"Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "zlibvc - Win32 ReleaseWithoutCrtdll" (based on\
|
||||
"Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
|
||||
!IF "$(CFG)" == "zlibvc - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir ".\Release"
|
||||
# PROP BASE Intermediate_Dir ".\Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir ".\Release"
|
||||
# PROP Intermediate_Dir ".\Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
CPP=cl.exe
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /D "ASMV" /FAcs /FR /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
MTL=midl.exe
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
RSC=rc.exe
|
||||
# ADD BASE RSC /l 0x40c /d "NDEBUG"
|
||||
# ADD RSC /l 0x40c /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
|
||||
# ADD LINK32 gvmat32.obj kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\Release\zlib.dll"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir ".\Debug"
|
||||
# PROP BASE Intermediate_Dir ".\Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir ".\Debug"
|
||||
# PROP Intermediate_Dir ".\Debug"
|
||||
# PROP Target_Dir ""
|
||||
CPP=cl.exe
|
||||
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
MTL=midl.exe
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
RSC=rc.exe
|
||||
# ADD BASE RSC /l 0x40c /d "_DEBUG"
|
||||
# ADD RSC /l 0x40c /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:".\Debug\zlib.dll"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "zlibvc__"
|
||||
# PROP BASE Intermediate_Dir "zlibvc__"
|
||||
# PROP BASE Ignore_Export_Lib 0
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "zlibvc__"
|
||||
# PROP Intermediate_Dir "zlibvc__"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
MTL=midl.exe
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
CPP=cl.exe
|
||||
# ADD BASE CPP /nologo /MT /Gt0 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /YX /FD /c
|
||||
# ADD CPP /nologo /MT /Gt0 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
RSC=rc.exe
|
||||
# ADD BASE RSC /l 0x40c /d "NDEBUG"
|
||||
# ADD RSC /l 0x40c /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 crtdll.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /map /machine:ALPHA /nodefaultlib /out:".\Release\zlib.dll"
|
||||
# SUBTRACT BASE LINK32 /pdb:none
|
||||
# ADD LINK32 crtdll.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /map /machine:ALPHA /nodefaultlib /out:"zlibvc__\zlib.dll"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "zlibvc_0"
|
||||
# PROP BASE Intermediate_Dir "zlibvc_0"
|
||||
# PROP BASE Ignore_Export_Lib 0
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "zlibvc_0"
|
||||
# PROP Intermediate_Dir "zlibvc_0"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
CPP=cl.exe
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
MTL=midl.exe
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
RSC=rc.exe
|
||||
# ADD BASE RSC /l 0x40c /d "NDEBUG"
|
||||
# ADD RSC /l 0x40c /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\Release\zlib.dll"
|
||||
# SUBTRACT BASE LINK32 /pdb:none
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\zlibvc_0\zlib.dll"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "zlibvc_1"
|
||||
# PROP BASE Intermediate_Dir "zlibvc_1"
|
||||
# PROP BASE Ignore_Export_Lib 0
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "zlibvc_1"
|
||||
# PROP Intermediate_Dir "zlibvc_1"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
CPP=cl.exe
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /D "ASMV" /FAcs /FR /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /D "ASMV" /FAcs /FR /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
MTL=midl.exe
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
RSC=rc.exe
|
||||
# ADD BASE RSC /l 0x40c /d "NDEBUG"
|
||||
# ADD RSC /l 0x40c /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 gvmat32.obj kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\Release\zlib.dll"
|
||||
# SUBTRACT BASE LINK32 /pdb:none
|
||||
# ADD LINK32 gvmat32.obj kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\zlibvc_1\zlib.dll"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "zlibvc - Win32 Release"
|
||||
# Name "zlibvc - Win32 Debug"
|
||||
# Name "zlibvc - Win32 ReleaseAxp"
|
||||
# Name "zlibvc - Win32 ReleaseWithoutAsm"
|
||||
# Name "zlibvc - Win32 ReleaseWithoutCrtdll"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\adler32.c
|
||||
|
||||
!IF "$(CFG)" == "zlibvc - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
|
||||
|
||||
DEP_CPP_ADLER=\
|
||||
".\zconf.h"\
|
||||
".\zlib.h"\
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\compress.c
|
||||
|
||||
!IF "$(CFG)" == "zlibvc - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
|
||||
|
||||
DEP_CPP_COMPR=\
|
||||
".\zconf.h"\
|
||||
".\zlib.h"\
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\crc32.c
|
||||
|
||||
!IF "$(CFG)" == "zlibvc - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
|
||||
|
||||
DEP_CPP_CRC32=\
|
||||
".\zconf.h"\
|
||||
".\zlib.h"\
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\deflate.c
|
||||
|
||||
!IF "$(CFG)" == "zlibvc - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
|
||||
|
||||
DEP_CPP_DEFLA=\
|
||||
".\deflate.h"\
|
||||
".\zconf.h"\
|
||||
".\zlib.h"\
|
||||
".\zutil.h"\
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\gvmat32c.c
|
||||
|
||||
!IF "$(CFG)" == "zlibvc - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\gzio.c
|
||||
|
||||
!IF "$(CFG)" == "zlibvc - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
|
||||
|
||||
DEP_CPP_GZIO_=\
|
||||
".\zconf.h"\
|
||||
".\zlib.h"\
|
||||
".\zutil.h"\
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\infblock.c
|
||||
|
||||
!IF "$(CFG)" == "zlibvc - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
|
||||
|
||||
DEP_CPP_INFBL=\
|
||||
".\infblock.h"\
|
||||
".\infcodes.h"\
|
||||
".\inftrees.h"\
|
||||
".\infutil.h"\
|
||||
".\zconf.h"\
|
||||
".\zlib.h"\
|
||||
".\zutil.h"\
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\infcodes.c
|
||||
|
||||
!IF "$(CFG)" == "zlibvc - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
|
||||
|
||||
DEP_CPP_INFCO=\
|
||||
".\infblock.h"\
|
||||
".\infcodes.h"\
|
||||
".\inffast.h"\
|
||||
".\inftrees.h"\
|
||||
".\infutil.h"\
|
||||
".\zconf.h"\
|
||||
".\zlib.h"\
|
||||
".\zutil.h"\
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\inffast.c
|
||||
|
||||
!IF "$(CFG)" == "zlibvc - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
|
||||
|
||||
DEP_CPP_INFFA=\
|
||||
".\infblock.h"\
|
||||
".\infcodes.h"\
|
||||
".\inffast.h"\
|
||||
".\inftrees.h"\
|
||||
".\infutil.h"\
|
||||
".\zconf.h"\
|
||||
".\zlib.h"\
|
||||
".\zutil.h"\
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\inflate.c
|
||||
|
||||
!IF "$(CFG)" == "zlibvc - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
|
||||
|
||||
DEP_CPP_INFLA=\
|
||||
".\infblock.h"\
|
||||
".\zconf.h"\
|
||||
".\zlib.h"\
|
||||
".\zutil.h"\
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\inftrees.c
|
||||
|
||||
!IF "$(CFG)" == "zlibvc - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
|
||||
|
||||
DEP_CPP_INFTR=\
|
||||
".\inftrees.h"\
|
||||
".\zconf.h"\
|
||||
".\zlib.h"\
|
||||
".\zutil.h"\
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\infutil.c
|
||||
|
||||
!IF "$(CFG)" == "zlibvc - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
|
||||
|
||||
DEP_CPP_INFUT=\
|
||||
".\infblock.h"\
|
||||
".\infcodes.h"\
|
||||
".\inftrees.h"\
|
||||
".\infutil.h"\
|
||||
".\zconf.h"\
|
||||
".\zlib.h"\
|
||||
".\zutil.h"\
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\trees.c
|
||||
|
||||
!IF "$(CFG)" == "zlibvc - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
|
||||
|
||||
DEP_CPP_TREES=\
|
||||
".\deflate.h"\
|
||||
".\zconf.h"\
|
||||
".\zlib.h"\
|
||||
".\zutil.h"\
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\uncompr.c
|
||||
|
||||
!IF "$(CFG)" == "zlibvc - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
|
||||
|
||||
DEP_CPP_UNCOM=\
|
||||
".\zconf.h"\
|
||||
".\zlib.h"\
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\unzip.c
|
||||
|
||||
!IF "$(CFG)" == "zlibvc - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zip.c
|
||||
|
||||
!IF "$(CFG)" == "zlibvc - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zlib.rc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zlibvc.def
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zutil.c
|
||||
|
||||
!IF "$(CFG)" == "zlibvc - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
|
||||
|
||||
DEP_CPP_ZUTIL=\
|
||||
".\zconf.h"\
|
||||
".\zlib.h"\
|
||||
".\zutil.h"\
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\deflate.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\infblock.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\infcodes.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\inffast.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\inftrees.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\infutil.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zconf.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zlib.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zutil.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -1,43 +0,0 @@
|
||||
This is a patched version of zlib modified to use
|
||||
Pentium-optimized assembly code in the deflation algorithm. The files
|
||||
changed/added by this patch are:
|
||||
|
||||
README.586
|
||||
match.S
|
||||
|
||||
The effectiveness of these modifications is a bit marginal, as the the
|
||||
program's bottleneck seems to be mostly L1-cache contention, for which
|
||||
there is no real way to work around without rewriting the basic
|
||||
algorithm. The speedup on average is around 5-10% (which is generally
|
||||
less than the amount of variance between subsequent executions).
|
||||
However, when used at level 9 compression, the cache contention can
|
||||
drop enough for the assembly version to achieve 10-20% speedup (and
|
||||
sometimes more, depending on the amount of overall redundancy in the
|
||||
files). Even here, though, cache contention can still be the limiting
|
||||
factor, depending on the nature of the program using the zlib library.
|
||||
This may also mean that better improvements will be seen on a Pentium
|
||||
with MMX, which suffers much less from L1-cache contention, but I have
|
||||
not yet verified this.
|
||||
|
||||
Note that this code has been tailored for the Pentium in particular,
|
||||
and will not perform well on the Pentium Pro (due to the use of a
|
||||
partial register in the inner loop).
|
||||
|
||||
If you are using an assembler other than GNU as, you will have to
|
||||
translate match.S to use your assembler's syntax. (Have fun.)
|
||||
|
||||
Brian Raiter
|
||||
breadbox@muppetlabs.com
|
||||
April, 1998
|
||||
|
||||
|
||||
Added for zlib 1.1.3:
|
||||
|
||||
The patches come from
|
||||
http://www.muppetlabs.com/~breadbox/software/assembly.html
|
||||
|
||||
To compile zlib with this asm file, copy match.S to the zlib directory
|
||||
then do:
|
||||
|
||||
CFLAGS="-O3 -DASMV" ./configure
|
||||
make OBJA=match.o
|
||||
@@ -1,354 +0,0 @@
|
||||
/* match.s -- Pentium-optimized version of longest_match()
|
||||
* Written for zlib 1.1.2
|
||||
* Copyright (C) 1998 Brian Raiter <breadbox@muppetlabs.com>
|
||||
*
|
||||
* This is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License.
|
||||
*/
|
||||
|
||||
#ifndef NO_UNDERLINE
|
||||
#define match_init _match_init
|
||||
#define longest_match _longest_match
|
||||
#endif
|
||||
|
||||
#define MAX_MATCH (258)
|
||||
#define MIN_MATCH (3)
|
||||
#define MIN_LOOKAHEAD (MAX_MATCH + MIN_MATCH + 1)
|
||||
#define MAX_MATCH_8 ((MAX_MATCH + 7) & ~7)
|
||||
|
||||
/* stack frame offsets */
|
||||
|
||||
#define wmask 0 /* local copy of s->wmask */
|
||||
#define window 4 /* local copy of s->window */
|
||||
#define windowbestlen 8 /* s->window + bestlen */
|
||||
#define chainlenscanend 12 /* high word: current chain len */
|
||||
/* low word: last bytes sought */
|
||||
#define scanstart 16 /* first two bytes of string */
|
||||
#define scanalign 20 /* dword-misalignment of string */
|
||||
#define nicematch 24 /* a good enough match size */
|
||||
#define bestlen 28 /* size of best match so far */
|
||||
#define scan 32 /* ptr to string wanting match */
|
||||
|
||||
#define LocalVarsSize (36)
|
||||
/* saved ebx 36 */
|
||||
/* saved edi 40 */
|
||||
/* saved esi 44 */
|
||||
/* saved ebp 48 */
|
||||
/* return address 52 */
|
||||
#define deflatestate 56 /* the function arguments */
|
||||
#define curmatch 60
|
||||
|
||||
/* Offsets for fields in the deflate_state structure. These numbers
|
||||
* are calculated from the definition of deflate_state, with the
|
||||
* assumption that the compiler will dword-align the fields. (Thus,
|
||||
* changing the definition of deflate_state could easily cause this
|
||||
* program to crash horribly, without so much as a warning at
|
||||
* compile time. Sigh.)
|
||||
*/
|
||||
#define dsWSize 36
|
||||
#define dsWMask 44
|
||||
#define dsWindow 48
|
||||
#define dsPrev 56
|
||||
#define dsMatchLen 88
|
||||
#define dsPrevMatch 92
|
||||
#define dsStrStart 100
|
||||
#define dsMatchStart 104
|
||||
#define dsLookahead 108
|
||||
#define dsPrevLen 112
|
||||
#define dsMaxChainLen 116
|
||||
#define dsGoodMatch 132
|
||||
#define dsNiceMatch 136
|
||||
|
||||
|
||||
.file "match.S"
|
||||
|
||||
.globl match_init, longest_match
|
||||
|
||||
.text
|
||||
|
||||
/* uInt longest_match(deflate_state *deflatestate, IPos curmatch) */
|
||||
|
||||
longest_match:
|
||||
|
||||
/* Save registers that the compiler may be using, and adjust %esp to */
|
||||
/* make room for our stack frame. */
|
||||
|
||||
pushl %ebp
|
||||
pushl %edi
|
||||
pushl %esi
|
||||
pushl %ebx
|
||||
subl $LocalVarsSize, %esp
|
||||
|
||||
/* Retrieve the function arguments. %ecx will hold cur_match */
|
||||
/* throughout the entire function. %edx will hold the pointer to the */
|
||||
/* deflate_state structure during the function's setup (before */
|
||||
/* entering the main loop). */
|
||||
|
||||
movl deflatestate(%esp), %edx
|
||||
movl curmatch(%esp), %ecx
|
||||
|
||||
/* if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; */
|
||||
|
||||
movl dsNiceMatch(%edx), %eax
|
||||
movl dsLookahead(%edx), %ebx
|
||||
cmpl %eax, %ebx
|
||||
jl LookaheadLess
|
||||
movl %eax, %ebx
|
||||
LookaheadLess: movl %ebx, nicematch(%esp)
|
||||
|
||||
/* register Bytef *scan = s->window + s->strstart; */
|
||||
|
||||
movl dsWindow(%edx), %esi
|
||||
movl %esi, window(%esp)
|
||||
movl dsStrStart(%edx), %ebp
|
||||
lea (%esi,%ebp), %edi
|
||||
movl %edi, scan(%esp)
|
||||
|
||||
/* Determine how many bytes the scan ptr is off from being */
|
||||
/* dword-aligned. */
|
||||
|
||||
movl %edi, %eax
|
||||
negl %eax
|
||||
andl $3, %eax
|
||||
movl %eax, scanalign(%esp)
|
||||
|
||||
/* IPos limit = s->strstart > (IPos)MAX_DIST(s) ? */
|
||||
/* s->strstart - (IPos)MAX_DIST(s) : NIL; */
|
||||
|
||||
movl dsWSize(%edx), %eax
|
||||
subl $MIN_LOOKAHEAD, %eax
|
||||
subl %eax, %ebp
|
||||
jg LimitPositive
|
||||
xorl %ebp, %ebp
|
||||
LimitPositive:
|
||||
|
||||
/* unsigned chain_length = s->max_chain_length; */
|
||||
/* if (s->prev_length >= s->good_match) { */
|
||||
/* chain_length >>= 2; */
|
||||
/* } */
|
||||
|
||||
movl dsPrevLen(%edx), %eax
|
||||
movl dsGoodMatch(%edx), %ebx
|
||||
cmpl %ebx, %eax
|
||||
movl dsMaxChainLen(%edx), %ebx
|
||||
jl LastMatchGood
|
||||
shrl $2, %ebx
|
||||
LastMatchGood:
|
||||
|
||||
/* chainlen is decremented once beforehand so that the function can */
|
||||
/* use the sign flag instead of the zero flag for the exit test. */
|
||||
/* It is then shifted into the high word, to make room for the scanend */
|
||||
/* scanend value, which it will always accompany. */
|
||||
|
||||
decl %ebx
|
||||
shll $16, %ebx
|
||||
|
||||
/* int best_len = s->prev_length; */
|
||||
|
||||
movl dsPrevLen(%edx), %eax
|
||||
movl %eax, bestlen(%esp)
|
||||
|
||||
/* Store the sum of s->window + best_len in %esi locally, and in %esi. */
|
||||
|
||||
addl %eax, %esi
|
||||
movl %esi, windowbestlen(%esp)
|
||||
|
||||
/* register ush scan_start = *(ushf*)scan; */
|
||||
/* register ush scan_end = *(ushf*)(scan+best_len-1); */
|
||||
|
||||
movw (%edi), %bx
|
||||
movw %bx, scanstart(%esp)
|
||||
movw -1(%edi,%eax), %bx
|
||||
movl %ebx, chainlenscanend(%esp)
|
||||
|
||||
/* Posf *prev = s->prev; */
|
||||
/* uInt wmask = s->w_mask; */
|
||||
|
||||
movl dsPrev(%edx), %edi
|
||||
movl dsWMask(%edx), %edx
|
||||
mov %edx, wmask(%esp)
|
||||
|
||||
/* Jump into the main loop. */
|
||||
|
||||
jmp LoopEntry
|
||||
|
||||
.balign 16
|
||||
|
||||
/* do {
|
||||
* match = s->window + cur_match;
|
||||
* if (*(ushf*)(match+best_len-1) != scan_end ||
|
||||
* *(ushf*)match != scan_start) continue;
|
||||
* [...]
|
||||
* } while ((cur_match = prev[cur_match & wmask]) > limit
|
||||
* && --chain_length != 0);
|
||||
*
|
||||
* Here is the inner loop of the function. The function will spend the
|
||||
* majority of its time in this loop, and majority of that time will
|
||||
* be spent in the first ten instructions.
|
||||
*
|
||||
* Within this loop:
|
||||
* %ebx = chainlenscanend - i.e., ((chainlen << 16) | scanend)
|
||||
* %ecx = curmatch
|
||||
* %edx = curmatch & wmask
|
||||
* %esi = windowbestlen - i.e., (window + bestlen)
|
||||
* %edi = prev
|
||||
* %ebp = limit
|
||||
*
|
||||
* Two optimization notes on the choice of instructions:
|
||||
*
|
||||
* The first instruction uses a 16-bit address, which costs an extra,
|
||||
* unpairable cycle. This is cheaper than doing a 32-bit access and
|
||||
* zeroing the high word, due to the 3-cycle misalignment penalty which
|
||||
* would occur half the time. This also turns out to be cheaper than
|
||||
* doing two separate 8-bit accesses, as the memory is so rarely in the
|
||||
* L1 cache.
|
||||
*
|
||||
* The window buffer, however, apparently spends a lot of time in the
|
||||
* cache, and so it is faster to retrieve the word at the end of the
|
||||
* match string with two 8-bit loads. The instructions that test the
|
||||
* word at the beginning of the match string, however, are executed
|
||||
* much less frequently, and there it was cheaper to use 16-bit
|
||||
* instructions, which avoided the necessity of saving off and
|
||||
* subsequently reloading one of the other registers.
|
||||
*/
|
||||
LookupLoop:
|
||||
/* 1 U & V */
|
||||
movw (%edi,%edx,2), %cx /* 2 U pipe */
|
||||
movl wmask(%esp), %edx /* 2 V pipe */
|
||||
cmpl %ebp, %ecx /* 3 U pipe */
|
||||
jbe LeaveNow /* 3 V pipe */
|
||||
subl $0x00010000, %ebx /* 4 U pipe */
|
||||
js LeaveNow /* 4 V pipe */
|
||||
LoopEntry: movb -1(%esi,%ecx), %al /* 5 U pipe */
|
||||
andl %ecx, %edx /* 5 V pipe */
|
||||
cmpb %bl, %al /* 6 U pipe */
|
||||
jnz LookupLoop /* 6 V pipe */
|
||||
movb (%esi,%ecx), %ah
|
||||
cmpb %bh, %ah
|
||||
jnz LookupLoop
|
||||
movl window(%esp), %eax
|
||||
movw (%eax,%ecx), %ax
|
||||
cmpw scanstart(%esp), %ax
|
||||
jnz LookupLoop
|
||||
|
||||
/* Store the current value of chainlen. */
|
||||
|
||||
movl %ebx, chainlenscanend(%esp)
|
||||
|
||||
/* Point %edi to the string under scrutiny, and %esi to the string we */
|
||||
/* are hoping to match it up with. In actuality, %esi and %edi are */
|
||||
/* both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and %edx is */
|
||||
/* initialized to -(MAX_MATCH_8 - scanalign). */
|
||||
|
||||
movl window(%esp), %esi
|
||||
movl scan(%esp), %edi
|
||||
addl %ecx, %esi
|
||||
movl scanalign(%esp), %eax
|
||||
movl $(-MAX_MATCH_8), %edx
|
||||
lea MAX_MATCH_8(%edi,%eax), %edi
|
||||
lea MAX_MATCH_8(%esi,%eax), %esi
|
||||
|
||||
/* Test the strings for equality, 8 bytes at a time. At the end,
|
||||
* adjust %edx so that it is offset to the exact byte that mismatched.
|
||||
*
|
||||
* We already know at this point that the first three bytes of the
|
||||
* strings match each other, and they can be safely passed over before
|
||||
* starting the compare loop. So what this code does is skip over 0-3
|
||||
* bytes, as much as necessary in order to dword-align the %edi
|
||||
* pointer. (%esi will still be misaligned three times out of four.)
|
||||
*
|
||||
* It should be confessed that this loop usually does not represent
|
||||
* much of the total running time. Replacing it with a more
|
||||
* straightforward "rep cmpsb" would not drastically degrade
|
||||
* performance.
|
||||
*/
|
||||
LoopCmps:
|
||||
movl (%esi,%edx), %eax
|
||||
movl (%edi,%edx), %ebx
|
||||
xorl %ebx, %eax
|
||||
jnz LeaveLoopCmps
|
||||
movl 4(%esi,%edx), %eax
|
||||
movl 4(%edi,%edx), %ebx
|
||||
xorl %ebx, %eax
|
||||
jnz LeaveLoopCmps4
|
||||
addl $8, %edx
|
||||
jnz LoopCmps
|
||||
jmp LenMaximum
|
||||
LeaveLoopCmps4: addl $4, %edx
|
||||
LeaveLoopCmps: testl $0x0000FFFF, %eax
|
||||
jnz LenLower
|
||||
addl $2, %edx
|
||||
shrl $16, %eax
|
||||
LenLower: subb $1, %al
|
||||
adcl $0, %edx
|
||||
|
||||
/* Calculate the length of the match. If it is longer than MAX_MATCH, */
|
||||
/* then automatically accept it as the best possible match and leave. */
|
||||
|
||||
lea (%edi,%edx), %eax
|
||||
movl scan(%esp), %edi
|
||||
subl %edi, %eax
|
||||
cmpl $MAX_MATCH, %eax
|
||||
jge LenMaximum
|
||||
|
||||
/* If the length of the match is not longer than the best match we */
|
||||
/* have so far, then forget it and return to the lookup loop. */
|
||||
|
||||
movl deflatestate(%esp), %edx
|
||||
movl bestlen(%esp), %ebx
|
||||
cmpl %ebx, %eax
|
||||
jg LongerMatch
|
||||
movl chainlenscanend(%esp), %ebx
|
||||
movl windowbestlen(%esp), %esi
|
||||
movl dsPrev(%edx), %edi
|
||||
movl wmask(%esp), %edx
|
||||
andl %ecx, %edx
|
||||
jmp LookupLoop
|
||||
|
||||
/* s->match_start = cur_match; */
|
||||
/* best_len = len; */
|
||||
/* if (len >= nice_match) break; */
|
||||
/* scan_end = *(ushf*)(scan+best_len-1); */
|
||||
|
||||
LongerMatch: movl nicematch(%esp), %ebx
|
||||
movl %eax, bestlen(%esp)
|
||||
movl %ecx, dsMatchStart(%edx)
|
||||
cmpl %ebx, %eax
|
||||
jge LeaveNow
|
||||
movl window(%esp), %esi
|
||||
addl %eax, %esi
|
||||
movl %esi, windowbestlen(%esp)
|
||||
movl chainlenscanend(%esp), %ebx
|
||||
movw -1(%edi,%eax), %bx
|
||||
movl dsPrev(%edx), %edi
|
||||
movl %ebx, chainlenscanend(%esp)
|
||||
movl wmask(%esp), %edx
|
||||
andl %ecx, %edx
|
||||
jmp LookupLoop
|
||||
|
||||
/* Accept the current string, with the maximum possible length. */
|
||||
|
||||
LenMaximum: movl deflatestate(%esp), %edx
|
||||
movl $MAX_MATCH, bestlen(%esp)
|
||||
movl %ecx, dsMatchStart(%edx)
|
||||
|
||||
/* if ((uInt)best_len <= s->lookahead) return (uInt)best_len; */
|
||||
/* return s->lookahead; */
|
||||
|
||||
LeaveNow:
|
||||
movl deflatestate(%esp), %edx
|
||||
movl bestlen(%esp), %ebx
|
||||
movl dsLookahead(%edx), %eax
|
||||
cmpl %eax, %ebx
|
||||
jg LookaheadRet
|
||||
movl %ebx, %eax
|
||||
LookaheadRet:
|
||||
|
||||
/* Restore the stack and return from whence we came. */
|
||||
|
||||
addl $LocalVarsSize, %esp
|
||||
popl %ebx
|
||||
popl %esi
|
||||
popl %edi
|
||||
popl %ebp
|
||||
match_init: ret
|
||||
@@ -1,34 +0,0 @@
|
||||
This is a patched version of zlib, modified to use
|
||||
Pentium-Pro-optimized assembly code in the deflation algorithm. The
|
||||
files changed/added by this patch are:
|
||||
|
||||
README.686
|
||||
match.S
|
||||
|
||||
The speedup that this patch provides varies, depending on whether the
|
||||
compiler used to build the original version of zlib falls afoul of the
|
||||
PPro's speed traps. My own tests show a speedup of around 10-20% at
|
||||
the default compression level, and 20-30% using -9, against a version
|
||||
compiled using gcc 2.7.2.3. Your mileage may vary.
|
||||
|
||||
Note that this code has been tailored for the PPro/PII in particular,
|
||||
and will not perform particuarly well on a Pentium.
|
||||
|
||||
If you are using an assembler other than GNU as, you will have to
|
||||
translate match.S to use your assembler's syntax. (Have fun.)
|
||||
|
||||
Brian Raiter
|
||||
breadbox@muppetlabs.com
|
||||
April, 1998
|
||||
|
||||
|
||||
Added for zlib 1.1.3:
|
||||
|
||||
The patches come from
|
||||
http://www.muppetlabs.com/~breadbox/software/assembly.html
|
||||
|
||||
To compile zlib with this asm file, copy match.S to the zlib directory
|
||||
then do:
|
||||
|
||||
CFLAGS="-O3 -DASMV" ./configure
|
||||
make OBJA=match.o
|
||||
@@ -1,327 +0,0 @@
|
||||
/* match.s -- Pentium-Pro-optimized version of longest_match()
|
||||
* Written for zlib 1.1.2
|
||||
* Copyright (C) 1998 Brian Raiter <breadbox@muppetlabs.com>
|
||||
*
|
||||
* This is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License.
|
||||
*/
|
||||
|
||||
#ifndef NO_UNDERLINE
|
||||
#define match_init _match_init
|
||||
#define longest_match _longest_match
|
||||
#endif
|
||||
|
||||
#define MAX_MATCH (258)
|
||||
#define MIN_MATCH (3)
|
||||
#define MIN_LOOKAHEAD (MAX_MATCH + MIN_MATCH + 1)
|
||||
#define MAX_MATCH_8 ((MAX_MATCH + 7) & ~7)
|
||||
|
||||
/* stack frame offsets */
|
||||
|
||||
#define chainlenwmask 0 /* high word: current chain len */
|
||||
/* low word: s->wmask */
|
||||
#define window 4 /* local copy of s->window */
|
||||
#define windowbestlen 8 /* s->window + bestlen */
|
||||
#define scanstart 16 /* first two bytes of string */
|
||||
#define scanend 12 /* last two bytes of string */
|
||||
#define scanalign 20 /* dword-misalignment of string */
|
||||
#define nicematch 24 /* a good enough match size */
|
||||
#define bestlen 28 /* size of best match so far */
|
||||
#define scan 32 /* ptr to string wanting match */
|
||||
|
||||
#define LocalVarsSize (36)
|
||||
/* saved ebx 36 */
|
||||
/* saved edi 40 */
|
||||
/* saved esi 44 */
|
||||
/* saved ebp 48 */
|
||||
/* return address 52 */
|
||||
#define deflatestate 56 /* the function arguments */
|
||||
#define curmatch 60
|
||||
|
||||
/* Offsets for fields in the deflate_state structure. These numbers
|
||||
* are calculated from the definition of deflate_state, with the
|
||||
* assumption that the compiler will dword-align the fields. (Thus,
|
||||
* changing the definition of deflate_state could easily cause this
|
||||
* program to crash horribly, without so much as a warning at
|
||||
* compile time. Sigh.)
|
||||
*/
|
||||
#define dsWSize 36
|
||||
#define dsWMask 44
|
||||
#define dsWindow 48
|
||||
#define dsPrev 56
|
||||
#define dsMatchLen 88
|
||||
#define dsPrevMatch 92
|
||||
#define dsStrStart 100
|
||||
#define dsMatchStart 104
|
||||
#define dsLookahead 108
|
||||
#define dsPrevLen 112
|
||||
#define dsMaxChainLen 116
|
||||
#define dsGoodMatch 132
|
||||
#define dsNiceMatch 136
|
||||
|
||||
|
||||
.file "match.S"
|
||||
|
||||
.globl match_init, longest_match
|
||||
|
||||
.text
|
||||
|
||||
/* uInt longest_match(deflate_state *deflatestate, IPos curmatch) */
|
||||
|
||||
longest_match:
|
||||
|
||||
/* Save registers that the compiler may be using, and adjust %esp to */
|
||||
/* make room for our stack frame. */
|
||||
|
||||
pushl %ebp
|
||||
pushl %edi
|
||||
pushl %esi
|
||||
pushl %ebx
|
||||
subl $LocalVarsSize, %esp
|
||||
|
||||
/* Retrieve the function arguments. %ecx will hold cur_match */
|
||||
/* throughout the entire function. %edx will hold the pointer to the */
|
||||
/* deflate_state structure during the function's setup (before */
|
||||
/* entering the main loop). */
|
||||
|
||||
movl deflatestate(%esp), %edx
|
||||
movl curmatch(%esp), %ecx
|
||||
|
||||
/* uInt wmask = s->w_mask; */
|
||||
/* unsigned chain_length = s->max_chain_length; */
|
||||
/* if (s->prev_length >= s->good_match) { */
|
||||
/* chain_length >>= 2; */
|
||||
/* } */
|
||||
|
||||
movl dsPrevLen(%edx), %eax
|
||||
movl dsGoodMatch(%edx), %ebx
|
||||
cmpl %ebx, %eax
|
||||
movl dsWMask(%edx), %eax
|
||||
movl dsMaxChainLen(%edx), %ebx
|
||||
jl LastMatchGood
|
||||
shrl $2, %ebx
|
||||
LastMatchGood:
|
||||
|
||||
/* chainlen is decremented once beforehand so that the function can */
|
||||
/* use the sign flag instead of the zero flag for the exit test. */
|
||||
/* It is then shifted into the high word, to make room for the wmask */
|
||||
/* value, which it will always accompany. */
|
||||
|
||||
decl %ebx
|
||||
shll $16, %ebx
|
||||
orl %eax, %ebx
|
||||
movl %ebx, chainlenwmask(%esp)
|
||||
|
||||
/* if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; */
|
||||
|
||||
movl dsNiceMatch(%edx), %eax
|
||||
movl dsLookahead(%edx), %ebx
|
||||
cmpl %eax, %ebx
|
||||
jl LookaheadLess
|
||||
movl %eax, %ebx
|
||||
LookaheadLess: movl %ebx, nicematch(%esp)
|
||||
|
||||
/* register Bytef *scan = s->window + s->strstart; */
|
||||
|
||||
movl dsWindow(%edx), %esi
|
||||
movl %esi, window(%esp)
|
||||
movl dsStrStart(%edx), %ebp
|
||||
lea (%esi,%ebp), %edi
|
||||
movl %edi, scan(%esp)
|
||||
|
||||
/* Determine how many bytes the scan ptr is off from being */
|
||||
/* dword-aligned. */
|
||||
|
||||
movl %edi, %eax
|
||||
negl %eax
|
||||
andl $3, %eax
|
||||
movl %eax, scanalign(%esp)
|
||||
|
||||
/* IPos limit = s->strstart > (IPos)MAX_DIST(s) ? */
|
||||
/* s->strstart - (IPos)MAX_DIST(s) : NIL; */
|
||||
|
||||
movl dsWSize(%edx), %eax
|
||||
subl $MIN_LOOKAHEAD, %eax
|
||||
subl %eax, %ebp
|
||||
jg LimitPositive
|
||||
xorl %ebp, %ebp
|
||||
LimitPositive:
|
||||
|
||||
/* int best_len = s->prev_length; */
|
||||
|
||||
movl dsPrevLen(%edx), %eax
|
||||
movl %eax, bestlen(%esp)
|
||||
|
||||
/* Store the sum of s->window + best_len in %esi locally, and in %esi. */
|
||||
|
||||
addl %eax, %esi
|
||||
movl %esi, windowbestlen(%esp)
|
||||
|
||||
/* register ush scan_start = *(ushf*)scan; */
|
||||
/* register ush scan_end = *(ushf*)(scan+best_len-1); */
|
||||
/* Posf *prev = s->prev; */
|
||||
|
||||
movzwl (%edi), %ebx
|
||||
movl %ebx, scanstart(%esp)
|
||||
movzwl -1(%edi,%eax), %ebx
|
||||
movl %ebx, scanend(%esp)
|
||||
movl dsPrev(%edx), %edi
|
||||
|
||||
/* Jump into the main loop. */
|
||||
|
||||
movl chainlenwmask(%esp), %edx
|
||||
jmp LoopEntry
|
||||
|
||||
.balign 16
|
||||
|
||||
/* do {
|
||||
* match = s->window + cur_match;
|
||||
* if (*(ushf*)(match+best_len-1) != scan_end ||
|
||||
* *(ushf*)match != scan_start) continue;
|
||||
* [...]
|
||||
* } while ((cur_match = prev[cur_match & wmask]) > limit
|
||||
* && --chain_length != 0);
|
||||
*
|
||||
* Here is the inner loop of the function. The function will spend the
|
||||
* majority of its time in this loop, and majority of that time will
|
||||
* be spent in the first ten instructions.
|
||||
*
|
||||
* Within this loop:
|
||||
* %ebx = scanend
|
||||
* %ecx = curmatch
|
||||
* %edx = chainlenwmask - i.e., ((chainlen << 16) | wmask)
|
||||
* %esi = windowbestlen - i.e., (window + bestlen)
|
||||
* %edi = prev
|
||||
* %ebp = limit
|
||||
*/
|
||||
LookupLoop:
|
||||
andl %edx, %ecx
|
||||
movzwl (%edi,%ecx,2), %ecx
|
||||
cmpl %ebp, %ecx
|
||||
jbe LeaveNow
|
||||
subl $0x00010000, %edx
|
||||
js LeaveNow
|
||||
LoopEntry: movzwl -1(%esi,%ecx), %eax
|
||||
cmpl %ebx, %eax
|
||||
jnz LookupLoop
|
||||
movl window(%esp), %eax
|
||||
movzwl (%eax,%ecx), %eax
|
||||
cmpl scanstart(%esp), %eax
|
||||
jnz LookupLoop
|
||||
|
||||
/* Store the current value of chainlen. */
|
||||
|
||||
movl %edx, chainlenwmask(%esp)
|
||||
|
||||
/* Point %edi to the string under scrutiny, and %esi to the string we */
|
||||
/* are hoping to match it up with. In actuality, %esi and %edi are */
|
||||
/* both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and %edx is */
|
||||
/* initialized to -(MAX_MATCH_8 - scanalign). */
|
||||
|
||||
movl window(%esp), %esi
|
||||
movl scan(%esp), %edi
|
||||
addl %ecx, %esi
|
||||
movl scanalign(%esp), %eax
|
||||
movl $(-MAX_MATCH_8), %edx
|
||||
lea MAX_MATCH_8(%edi,%eax), %edi
|
||||
lea MAX_MATCH_8(%esi,%eax), %esi
|
||||
|
||||
/* Test the strings for equality, 8 bytes at a time. At the end,
|
||||
* adjust %edx so that it is offset to the exact byte that mismatched.
|
||||
*
|
||||
* We already know at this point that the first three bytes of the
|
||||
* strings match each other, and they can be safely passed over before
|
||||
* starting the compare loop. So what this code does is skip over 0-3
|
||||
* bytes, as much as necessary in order to dword-align the %edi
|
||||
* pointer. (%esi will still be misaligned three times out of four.)
|
||||
*
|
||||
* It should be confessed that this loop usually does not represent
|
||||
* much of the total running time. Replacing it with a more
|
||||
* straightforward "rep cmpsb" would not drastically degrade
|
||||
* performance.
|
||||
*/
|
||||
LoopCmps:
|
||||
movl (%esi,%edx), %eax
|
||||
xorl (%edi,%edx), %eax
|
||||
jnz LeaveLoopCmps
|
||||
movl 4(%esi,%edx), %eax
|
||||
xorl 4(%edi,%edx), %eax
|
||||
jnz LeaveLoopCmps4
|
||||
addl $8, %edx
|
||||
jnz LoopCmps
|
||||
jmp LenMaximum
|
||||
LeaveLoopCmps4: addl $4, %edx
|
||||
LeaveLoopCmps: testl $0x0000FFFF, %eax
|
||||
jnz LenLower
|
||||
addl $2, %edx
|
||||
shrl $16, %eax
|
||||
LenLower: subb $1, %al
|
||||
adcl $0, %edx
|
||||
|
||||
/* Calculate the length of the match. If it is longer than MAX_MATCH, */
|
||||
/* then automatically accept it as the best possible match and leave. */
|
||||
|
||||
lea (%edi,%edx), %eax
|
||||
movl scan(%esp), %edi
|
||||
subl %edi, %eax
|
||||
cmpl $MAX_MATCH, %eax
|
||||
jge LenMaximum
|
||||
|
||||
/* If the length of the match is not longer than the best match we */
|
||||
/* have so far, then forget it and return to the lookup loop. */
|
||||
|
||||
movl deflatestate(%esp), %edx
|
||||
movl bestlen(%esp), %ebx
|
||||
cmpl %ebx, %eax
|
||||
jg LongerMatch
|
||||
movl windowbestlen(%esp), %esi
|
||||
movl dsPrev(%edx), %edi
|
||||
movl scanend(%esp), %ebx
|
||||
movl chainlenwmask(%esp), %edx
|
||||
jmp LookupLoop
|
||||
|
||||
/* s->match_start = cur_match; */
|
||||
/* best_len = len; */
|
||||
/* if (len >= nice_match) break; */
|
||||
/* scan_end = *(ushf*)(scan+best_len-1); */
|
||||
|
||||
LongerMatch: movl nicematch(%esp), %ebx
|
||||
movl %eax, bestlen(%esp)
|
||||
movl %ecx, dsMatchStart(%edx)
|
||||
cmpl %ebx, %eax
|
||||
jge LeaveNow
|
||||
movl window(%esp), %esi
|
||||
addl %eax, %esi
|
||||
movl %esi, windowbestlen(%esp)
|
||||
movzwl -1(%edi,%eax), %ebx
|
||||
movl dsPrev(%edx), %edi
|
||||
movl %ebx, scanend(%esp)
|
||||
movl chainlenwmask(%esp), %edx
|
||||
jmp LookupLoop
|
||||
|
||||
/* Accept the current string, with the maximum possible length. */
|
||||
|
||||
LenMaximum: movl deflatestate(%esp), %edx
|
||||
movl $MAX_MATCH, bestlen(%esp)
|
||||
movl %ecx, dsMatchStart(%edx)
|
||||
|
||||
/* if ((uInt)best_len <= s->lookahead) return (uInt)best_len; */
|
||||
/* return s->lookahead; */
|
||||
|
||||
LeaveNow:
|
||||
movl deflatestate(%esp), %edx
|
||||
movl bestlen(%esp), %ebx
|
||||
movl dsLookahead(%edx), %eax
|
||||
cmpl %eax, %ebx
|
||||
jg LookaheadRet
|
||||
movl %ebx, %eax
|
||||
LookaheadRet:
|
||||
|
||||
/* Restore the stack and return from whence we came. */
|
||||
|
||||
addl $LocalVarsSize, %esp
|
||||
popl %ebx
|
||||
popl %esi
|
||||
popl %edi
|
||||
popl %ebp
|
||||
match_init: ret
|
||||
@@ -1,36 +0,0 @@
|
||||
# Makefile for zlib32bd.lib
|
||||
# ------------- Borland C++ 4.5 -------------
|
||||
|
||||
# The (32-bit) zlib32bd.lib made with this makefile is intended for use
|
||||
# in making the (32-bit) DLL, png32bd.dll. It uses the "stdcall" calling
|
||||
# convention.
|
||||
|
||||
CFLAGS= -ps -O2 -C -K -N- -k- -d -3 -r- -w-par -w-aus -WDE
|
||||
CC=f:\bc45\bin\bcc32
|
||||
LIBFLAGS= /C
|
||||
LIB=f:\bc45\bin\tlib
|
||||
ZLIB=zlib32bd.lib
|
||||
|
||||
.autodepend
|
||||
.c.obj:
|
||||
$(CC) -c $(CFLAGS) $<
|
||||
|
||||
OBJ1=adler32.obj compress.obj crc32.obj deflate.obj gzio.obj infblock.obj
|
||||
OBJ2=infcodes.obj inflate.obj inftrees.obj infutil.obj inffast.obj
|
||||
OBJ3=trees.obj uncompr.obj zutil.obj
|
||||
pOBJ1=+adler32.obj+compress.obj+crc32.obj+deflate.obj+gzio.obj+infblock.obj
|
||||
pOBJ2=+infcodes.obj+inflate.obj+inftrees.obj+infutil.obj+inffast.obj
|
||||
pOBJ3=+trees.obj+uncompr.obj+zutil.obj
|
||||
|
||||
all: $(ZLIB)
|
||||
|
||||
$(ZLIB): $(OBJ1) $(OBJ2) $(OBJ3)
|
||||
@if exist $@ del $@
|
||||
$(LIB) @&&|
|
||||
$@ $(LIBFLAGS) &
|
||||
$(pOBJ1) &
|
||||
$(pOBJ2) &
|
||||
$(pOBJ3)
|
||||
|
|
||||
|
||||
# End of makefile for zlib32bd.lib
|
||||
@@ -1,169 +0,0 @@
|
||||
unit zlibdef;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows;
|
||||
|
||||
const
|
||||
ZLIB_VERSION = '1.1.3';
|
||||
|
||||
type
|
||||
voidpf = Pointer;
|
||||
int = Integer;
|
||||
uInt = Cardinal;
|
||||
pBytef = PChar;
|
||||
uLong = Cardinal;
|
||||
|
||||
alloc_func = function(opaque: voidpf; items, size: uInt): voidpf;
|
||||
stdcall;
|
||||
free_func = procedure(opaque, address: voidpf);
|
||||
stdcall;
|
||||
|
||||
internal_state = Pointer;
|
||||
|
||||
z_streamp = ^z_stream;
|
||||
z_stream = packed record
|
||||
next_in: pBytef; // next input byte
|
||||
avail_in: uInt; // number of bytes available at next_in
|
||||
total_in: uLong; // total nb of input bytes read so far
|
||||
|
||||
next_out: pBytef; // next output byte should be put there
|
||||
avail_out: uInt; // remaining free space at next_out
|
||||
total_out: uLong; // total nb of bytes output so far
|
||||
|
||||
msg: PChar; // last error message, NULL if no error
|
||||
state: internal_state; // not visible by applications
|
||||
|
||||
zalloc: alloc_func; // used to allocate the internal state
|
||||
zfree: free_func; // used to free the internal state
|
||||
opaque: voidpf; // private data object passed to zalloc and zfree
|
||||
|
||||
data_type: int; // best guess about the data type: ascii or binary
|
||||
adler: uLong; // adler32 value of the uncompressed data
|
||||
reserved: uLong; // reserved for future use
|
||||
end;
|
||||
|
||||
const
|
||||
Z_NO_FLUSH = 0;
|
||||
Z_SYNC_FLUSH = 2;
|
||||
Z_FULL_FLUSH = 3;
|
||||
Z_FINISH = 4;
|
||||
|
||||
Z_OK = 0;
|
||||
Z_STREAM_END = 1;
|
||||
|
||||
Z_NO_COMPRESSION = 0;
|
||||
Z_BEST_SPEED = 1;
|
||||
Z_BEST_COMPRESSION = 9;
|
||||
Z_DEFAULT_COMPRESSION = -1;
|
||||
|
||||
Z_FILTERED = 1;
|
||||
Z_HUFFMAN_ONLY = 2;
|
||||
Z_DEFAULT_STRATEGY = 0;
|
||||
|
||||
Z_BINARY = 0;
|
||||
Z_ASCII = 1;
|
||||
Z_UNKNOWN = 2;
|
||||
|
||||
Z_DEFLATED = 8;
|
||||
|
||||
MAX_MEM_LEVEL = 9;
|
||||
|
||||
function adler32(adler: uLong; const buf: pBytef; len: uInt): uLong;
|
||||
stdcall;
|
||||
function crc32(crc: uLong; const buf: pBytef; len: uInt): uLong;
|
||||
stdcall;
|
||||
function deflate(strm: z_streamp; flush: int): int;
|
||||
stdcall;
|
||||
function deflateCopy(dest, source: z_streamp): int;
|
||||
stdcall;
|
||||
function deflateEnd(strm: z_streamp): int;
|
||||
stdcall;
|
||||
function deflateInit2_(strm: z_streamp; level, method,
|
||||
windowBits, memLevel, strategy: int;
|
||||
const version: PChar; stream_size: int): int;
|
||||
stdcall;
|
||||
function deflateInit_(strm: z_streamp; level: int;
|
||||
const version: PChar; stream_size: int): int;
|
||||
stdcall;
|
||||
function deflateParams(strm: z_streamp; level, strategy: int): int;
|
||||
stdcall;
|
||||
function deflateReset(strm: z_streamp): int;
|
||||
stdcall;
|
||||
function deflateSetDictionary(strm: z_streamp;
|
||||
const dictionary: pBytef;
|
||||
dictLength: uInt): int;
|
||||
stdcall;
|
||||
function inflate(strm: z_streamp; flush: int): int;
|
||||
stdcall;
|
||||
function inflateEnd(strm: z_streamp): int;
|
||||
stdcall;
|
||||
function inflateInit2_(strm: z_streamp; windowBits: int;
|
||||
const version: PChar; stream_size: int): int;
|
||||
stdcall;
|
||||
function inflateInit_(strm: z_streamp; const version: PChar;
|
||||
stream_size: int): int;
|
||||
stdcall;
|
||||
function inflateReset(strm: z_streamp): int;
|
||||
stdcall;
|
||||
function inflateSetDictionary(strm: z_streamp;
|
||||
const dictionary: pBytef;
|
||||
dictLength: uInt): int;
|
||||
stdcall;
|
||||
function inflateSync(strm: z_streamp): int;
|
||||
stdcall;
|
||||
|
||||
function deflateInit(strm: z_streamp; level: int): int;
|
||||
function deflateInit2(strm: z_streamp; level, method, windowBits,
|
||||
memLevel, strategy: int): int;
|
||||
function inflateInit(strm: z_streamp): int;
|
||||
function inflateInit2(strm: z_streamp; windowBits: int): int;
|
||||
|
||||
implementation
|
||||
|
||||
function deflateInit(strm: z_streamp; level: int): int;
|
||||
begin
|
||||
Result := deflateInit_(strm, level, ZLIB_VERSION, sizeof(z_stream));
|
||||
end;
|
||||
|
||||
function deflateInit2(strm: z_streamp; level, method, windowBits,
|
||||
memLevel, strategy: int): int;
|
||||
begin
|
||||
Result := deflateInit2_(strm, level, method, windowBits, memLevel,
|
||||
strategy, ZLIB_VERSION, sizeof(z_stream));
|
||||
end;
|
||||
|
||||
function inflateInit(strm: z_streamp): int;
|
||||
begin
|
||||
Result := inflateInit_(strm, ZLIB_VERSION, sizeof(z_stream));
|
||||
end;
|
||||
|
||||
function inflateInit2(strm: z_streamp; windowBits: int): int;
|
||||
begin
|
||||
Result := inflateInit2_(strm, windowBits, ZLIB_VERSION,
|
||||
sizeof(z_stream));
|
||||
end;
|
||||
|
||||
const
|
||||
zlibDLL = 'png32bd.dll';
|
||||
|
||||
function adler32; external zlibDLL;
|
||||
function crc32; external zlibDLL;
|
||||
function deflate; external zlibDLL;
|
||||
function deflateCopy; external zlibDLL;
|
||||
function deflateEnd; external zlibDLL;
|
||||
function deflateInit2_; external zlibDLL;
|
||||
function deflateInit_; external zlibDLL;
|
||||
function deflateParams; external zlibDLL;
|
||||
function deflateReset; external zlibDLL;
|
||||
function deflateSetDictionary; external zlibDLL;
|
||||
function inflate; external zlibDLL;
|
||||
function inflateEnd; external zlibDLL;
|
||||
function inflateInit2_; external zlibDLL;
|
||||
function inflateInit_; external zlibDLL;
|
||||
function inflateReset; external zlibDLL;
|
||||
function inflateSetDictionary; external zlibDLL;
|
||||
function inflateSync; external zlibDLL;
|
||||
|
||||
end.
|
||||
@@ -1,224 +0,0 @@
|
||||
# ---------------------------------------------------------------------------
|
||||
!if !$d(BCB)
|
||||
BCB = $(MAKEDIR)\..
|
||||
!endif
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# IDE SECTION
|
||||
# ---------------------------------------------------------------------------
|
||||
# The following section of the project makefile is managed by the BCB IDE.
|
||||
# It is recommended to use the IDE to change any of the values in this
|
||||
# section.
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
VERSION = BCB.03
|
||||
# ---------------------------------------------------------------------------
|
||||
PROJECT = d_zlib.lib
|
||||
OBJFILES = d_zlib.obj adler32.obj deflate.obj infblock.obj infcodes.obj inffast.obj \
|
||||
inflate.obj inftrees.obj infutil.obj trees.obj
|
||||
RESFILES =
|
||||
RESDEPEN = $(RESFILES)
|
||||
LIBFILES =
|
||||
LIBRARIES = VCL35.lib
|
||||
SPARELIBS = VCL35.lib
|
||||
DEFFILE =
|
||||
PACKAGES = VCLX35.bpi VCL35.bpi VCLDB35.bpi VCLDBX35.bpi ibsmp35.bpi bcbsmp35.bpi \
|
||||
dclocx35.bpi QRPT35.bpi TEEUI35.bpi TEEDB35.bpi TEE35.bpi DSS35.bpi \
|
||||
NMFAST35.bpi INETDB35.bpi INET35.bpi VCLMID35.bpi
|
||||
# ---------------------------------------------------------------------------
|
||||
PATHCPP = .;
|
||||
PATHASM = .;
|
||||
PATHPAS = .;
|
||||
PATHRC = .;
|
||||
DEBUGLIBPATH = $(BCB)\lib\debug
|
||||
RELEASELIBPATH = $(BCB)\lib\release
|
||||
# ---------------------------------------------------------------------------
|
||||
CFLAG1 = -O2 -Ve -d -k- -vi
|
||||
CFLAG2 = -I$(BCB)\include;$(BCB)\include\vcl -H=$(BCB)\lib\vcl35.csm
|
||||
CFLAG3 = -ff -pr -5
|
||||
PFLAGS = -U;$(DEBUGLIBPATH) -I$(BCB)\include;$(BCB)\include\vcl -H -W -$I- -v -JPHN -M
|
||||
RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl
|
||||
AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn
|
||||
LFLAGS =
|
||||
IFLAGS = -g -Gn
|
||||
# ---------------------------------------------------------------------------
|
||||
ALLOBJ = c0w32.obj $(OBJFILES)
|
||||
ALLRES = $(RESFILES)
|
||||
ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mt.lib
|
||||
# ---------------------------------------------------------------------------
|
||||
!!ifdef IDEOPTIONS
|
||||
|
||||
[Version Info]
|
||||
IncludeVerInfo=0
|
||||
AutoIncBuild=0
|
||||
MajorVer=1
|
||||
MinorVer=0
|
||||
Release=0
|
||||
Build=0
|
||||
Debug=0
|
||||
PreRelease=0
|
||||
Special=0
|
||||
Private=0
|
||||
DLL=0
|
||||
Locale=1040
|
||||
CodePage=1252
|
||||
|
||||
[Version Info Keys]
|
||||
CompanyName=
|
||||
FileDescription=
|
||||
FileVersion=1.0.0.0
|
||||
InternalName=
|
||||
LegalCopyright=
|
||||
LegalTrademarks=
|
||||
OriginalFilename=
|
||||
ProductName=
|
||||
ProductVersion=1.0.0.0
|
||||
Comments=
|
||||
|
||||
[HistoryLists\hlIncludePath]
|
||||
Count=2
|
||||
Item0=$(BCB)\include
|
||||
Item1=$(BCB)\include;$(BCB)\include\vcl
|
||||
|
||||
[HistoryLists\hlLibraryPath]
|
||||
Count=1
|
||||
Item0=$(BCB)\lib\obj;$(BCB)\lib
|
||||
|
||||
[HistoryLists\hlDebugSourcePath]
|
||||
Count=1
|
||||
Item0=$(BCB)\source\vcl
|
||||
|
||||
[Debugging]
|
||||
DebugSourceDirs=
|
||||
|
||||
[Parameters]
|
||||
RunParams=
|
||||
HostApplication=
|
||||
|
||||
!endif
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
# MAKE SECTION
|
||||
# ---------------------------------------------------------------------------
|
||||
# This section of the project file is not used by the BCB IDE. It is for
|
||||
# the benefit of building from the command-line using the MAKE utility.
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
.autodepend
|
||||
# ---------------------------------------------------------------------------
|
||||
!if !$d(BCC32)
|
||||
BCC32 = bcc32
|
||||
!endif
|
||||
|
||||
!if !$d(DCC32)
|
||||
DCC32 = dcc32
|
||||
!endif
|
||||
|
||||
!if !$d(TASM32)
|
||||
TASM32 = tasm32
|
||||
!endif
|
||||
|
||||
!if !$d(LINKER)
|
||||
LINKER = TLib
|
||||
!endif
|
||||
|
||||
!if !$d(BRCC32)
|
||||
BRCC32 = brcc32
|
||||
!endif
|
||||
# ---------------------------------------------------------------------------
|
||||
!if $d(PATHCPP)
|
||||
.PATH.CPP = $(PATHCPP)
|
||||
.PATH.C = $(PATHCPP)
|
||||
!endif
|
||||
|
||||
!if $d(PATHPAS)
|
||||
.PATH.PAS = $(PATHPAS)
|
||||
!endif
|
||||
|
||||
!if $d(PATHASM)
|
||||
.PATH.ASM = $(PATHASM)
|
||||
!endif
|
||||
|
||||
!if $d(PATHRC)
|
||||
.PATH.RC = $(PATHRC)
|
||||
!endif
|
||||
# ---------------------------------------------------------------------------
|
||||
!ifdef IDEOPTIONS
|
||||
|
||||
[Version Info]
|
||||
IncludeVerInfo=0
|
||||
AutoIncBuild=0
|
||||
MajorVer=1
|
||||
MinorVer=0
|
||||
Release=0
|
||||
Build=0
|
||||
Debug=0
|
||||
PreRelease=0
|
||||
Special=0
|
||||
Private=0
|
||||
DLL=0
|
||||
Locale=1040
|
||||
CodePage=1252
|
||||
|
||||
[Version Info Keys]
|
||||
CompanyName=
|
||||
FileDescription=
|
||||
FileVersion=1.0.0.0
|
||||
InternalName=
|
||||
LegalCopyright=
|
||||
LegalTrademarks=
|
||||
OriginalFilename=
|
||||
ProductName=
|
||||
ProductVersion=1.0.0.0
|
||||
Comments=
|
||||
|
||||
[HistoryLists\hlIncludePath]
|
||||
Count=2
|
||||
Item0=$(BCB)\include;$(BCB)\include\vcl
|
||||
Item1=$(BCB)\include
|
||||
|
||||
[HistoryLists\hlLibraryPath]
|
||||
Count=1
|
||||
Item0=$(BCB)\lib\obj;$(BCB)\lib
|
||||
|
||||
[HistoryLists\hlDebugSourcePath]
|
||||
Count=1
|
||||
Item0=$(BCB)\source\vcl
|
||||
|
||||
[Debugging]
|
||||
DebugSourceDirs=
|
||||
|
||||
[Parameters]
|
||||
RunParams=
|
||||
HostApplication=
|
||||
|
||||
!endif
|
||||
|
||||
$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE)
|
||||
$(BCB)\BIN\$(LINKER) @&&!
|
||||
$(LFLAGS) $(IFLAGS) +
|
||||
$(ALLOBJ), +
|
||||
$(PROJECT),, +
|
||||
$(ALLLIB), +
|
||||
$(DEFFILE), +
|
||||
$(ALLRES)
|
||||
!
|
||||
# ---------------------------------------------------------------------------
|
||||
.pas.hpp:
|
||||
$(BCB)\BIN\$(DCC32) $(PFLAGS) {$< }
|
||||
|
||||
.pas.obj:
|
||||
$(BCB)\BIN\$(DCC32) $(PFLAGS) {$< }
|
||||
|
||||
.cpp.obj:
|
||||
$(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< }
|
||||
|
||||
.c.obj:
|
||||
$(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< }
|
||||
|
||||
.asm.obj:
|
||||
$(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@
|
||||
|
||||
.rc.res:
|
||||
$(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $<
|
||||
# ---------------------------------------------------------------------------
|
||||
@@ -1,17 +0,0 @@
|
||||
#include <condefs.h>
|
||||
#pragma hdrstop
|
||||
//---------------------------------------------------------------------------
|
||||
USEUNIT("adler32.c");
|
||||
USEUNIT("deflate.c");
|
||||
USEUNIT("infblock.c");
|
||||
USEUNIT("infcodes.c");
|
||||
USEUNIT("inffast.c");
|
||||
USEUNIT("inflate.c");
|
||||
USEUNIT("inftrees.c");
|
||||
USEUNIT("infutil.c");
|
||||
USEUNIT("trees.c");
|
||||
//---------------------------------------------------------------------------
|
||||
#define Library
|
||||
|
||||
// To add a file to the library use the Project menu 'Add to Project'.
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
These are files used to compile zlib under Borland C++ Builder 3.
|
||||
|
||||
zlib.bpg is the main project group that can be loaded in the BCB IDE and
|
||||
loads all other *.bpr projects
|
||||
|
||||
zlib.bpr is a project used to create a static zlib.lib library with C calling
|
||||
convention for functions.
|
||||
|
||||
zlib32.bpr creates a zlib32.dll dynamic link library with Windows standard
|
||||
calling convention.
|
||||
|
||||
d_zlib.bpr creates a set of .obj files with register calling convention.
|
||||
These files are used by zlib.pas to create a Delphi unit containing zlib.
|
||||
The d_zlib.lib file generated isn't useful and can be deleted.
|
||||
|
||||
zlib.cpp, zlib32.cpp and d_zlib.cpp are used by the above projects.
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
#------------------------------------------------------------------------------
|
||||
VERSION = BWS.01
|
||||
#------------------------------------------------------------------------------
|
||||
!ifndef ROOT
|
||||
ROOT = $(MAKEDIR)\..
|
||||
!endif
|
||||
#------------------------------------------------------------------------------
|
||||
MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$**
|
||||
DCC = $(ROOT)\bin\dcc32.exe $**
|
||||
BRCC = $(ROOT)\bin\brcc32.exe $**
|
||||
#------------------------------------------------------------------------------
|
||||
PROJECTS = zlib zlib32 d_zlib
|
||||
#------------------------------------------------------------------------------
|
||||
default: $(PROJECTS)
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
zlib: zlib.bpr
|
||||
$(MAKE)
|
||||
|
||||
zlib32: zlib32.bpr
|
||||
$(MAKE)
|
||||
|
||||
d_zlib: d_zlib.bpr
|
||||
$(MAKE)
|
||||
|
||||
|
||||
@@ -1,225 +0,0 @@
|
||||
# ---------------------------------------------------------------------------
|
||||
!if !$d(BCB)
|
||||
BCB = $(MAKEDIR)\..
|
||||
!endif
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# IDE SECTION
|
||||
# ---------------------------------------------------------------------------
|
||||
# The following section of the project makefile is managed by the BCB IDE.
|
||||
# It is recommended to use the IDE to change any of the values in this
|
||||
# section.
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
VERSION = BCB.03
|
||||
# ---------------------------------------------------------------------------
|
||||
PROJECT = zlib.lib
|
||||
OBJFILES = zlib.obj adler32.obj compress.obj crc32.obj deflate.obj gzio.obj infblock.obj \
|
||||
infcodes.obj inffast.obj inflate.obj inftrees.obj infutil.obj trees.obj \
|
||||
uncompr.obj zutil.obj
|
||||
RESFILES =
|
||||
RESDEPEN = $(RESFILES)
|
||||
LIBFILES =
|
||||
LIBRARIES = VCL35.lib
|
||||
SPARELIBS = VCL35.lib
|
||||
DEFFILE =
|
||||
PACKAGES = VCLX35.bpi VCL35.bpi VCLDB35.bpi VCLDBX35.bpi ibsmp35.bpi bcbsmp35.bpi \
|
||||
dclocx35.bpi QRPT35.bpi TEEUI35.bpi TEEDB35.bpi TEE35.bpi DSS35.bpi \
|
||||
NMFAST35.bpi INETDB35.bpi INET35.bpi VCLMID35.bpi
|
||||
# ---------------------------------------------------------------------------
|
||||
PATHCPP = .;
|
||||
PATHASM = .;
|
||||
PATHPAS = .;
|
||||
PATHRC = .;
|
||||
DEBUGLIBPATH = $(BCB)\lib\debug
|
||||
RELEASELIBPATH = $(BCB)\lib\release
|
||||
# ---------------------------------------------------------------------------
|
||||
CFLAG1 = -O2 -Ve -d -k- -vi
|
||||
CFLAG2 = -I$(BCB)\include;$(BCB)\include\vcl -H=$(BCB)\lib\vcl35.csm
|
||||
CFLAG3 = -ff -5
|
||||
PFLAGS = -U;$(DEBUGLIBPATH) -I$(BCB)\include;$(BCB)\include\vcl -H -W -$I- -v -JPHN -M
|
||||
RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl
|
||||
AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn
|
||||
LFLAGS =
|
||||
IFLAGS = -g -Gn
|
||||
# ---------------------------------------------------------------------------
|
||||
ALLOBJ = c0w32.obj $(OBJFILES)
|
||||
ALLRES = $(RESFILES)
|
||||
ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mt.lib
|
||||
# ---------------------------------------------------------------------------
|
||||
!!ifdef IDEOPTIONS
|
||||
|
||||
[Version Info]
|
||||
IncludeVerInfo=0
|
||||
AutoIncBuild=0
|
||||
MajorVer=1
|
||||
MinorVer=0
|
||||
Release=0
|
||||
Build=0
|
||||
Debug=0
|
||||
PreRelease=0
|
||||
Special=0
|
||||
Private=0
|
||||
DLL=0
|
||||
Locale=1040
|
||||
CodePage=1252
|
||||
|
||||
[Version Info Keys]
|
||||
CompanyName=
|
||||
FileDescription=
|
||||
FileVersion=1.0.0.0
|
||||
InternalName=
|
||||
LegalCopyright=
|
||||
LegalTrademarks=
|
||||
OriginalFilename=
|
||||
ProductName=
|
||||
ProductVersion=1.0.0.0
|
||||
Comments=
|
||||
|
||||
[HistoryLists\hlIncludePath]
|
||||
Count=2
|
||||
Item0=$(BCB)\include
|
||||
Item1=$(BCB)\include;$(BCB)\include\vcl
|
||||
|
||||
[HistoryLists\hlLibraryPath]
|
||||
Count=1
|
||||
Item0=$(BCB)\lib\obj;$(BCB)\lib
|
||||
|
||||
[HistoryLists\hlDebugSourcePath]
|
||||
Count=1
|
||||
Item0=$(BCB)\source\vcl
|
||||
|
||||
[Debugging]
|
||||
DebugSourceDirs=
|
||||
|
||||
[Parameters]
|
||||
RunParams=
|
||||
HostApplication=
|
||||
|
||||
!endif
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
# MAKE SECTION
|
||||
# ---------------------------------------------------------------------------
|
||||
# This section of the project file is not used by the BCB IDE. It is for
|
||||
# the benefit of building from the command-line using the MAKE utility.
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
.autodepend
|
||||
# ---------------------------------------------------------------------------
|
||||
!if !$d(BCC32)
|
||||
BCC32 = bcc32
|
||||
!endif
|
||||
|
||||
!if !$d(DCC32)
|
||||
DCC32 = dcc32
|
||||
!endif
|
||||
|
||||
!if !$d(TASM32)
|
||||
TASM32 = tasm32
|
||||
!endif
|
||||
|
||||
!if !$d(LINKER)
|
||||
LINKER = TLib
|
||||
!endif
|
||||
|
||||
!if !$d(BRCC32)
|
||||
BRCC32 = brcc32
|
||||
!endif
|
||||
# ---------------------------------------------------------------------------
|
||||
!if $d(PATHCPP)
|
||||
.PATH.CPP = $(PATHCPP)
|
||||
.PATH.C = $(PATHCPP)
|
||||
!endif
|
||||
|
||||
!if $d(PATHPAS)
|
||||
.PATH.PAS = $(PATHPAS)
|
||||
!endif
|
||||
|
||||
!if $d(PATHASM)
|
||||
.PATH.ASM = $(PATHASM)
|
||||
!endif
|
||||
|
||||
!if $d(PATHRC)
|
||||
.PATH.RC = $(PATHRC)
|
||||
!endif
|
||||
# ---------------------------------------------------------------------------
|
||||
!ifdef IDEOPTIONS
|
||||
|
||||
[Version Info]
|
||||
IncludeVerInfo=0
|
||||
AutoIncBuild=0
|
||||
MajorVer=1
|
||||
MinorVer=0
|
||||
Release=0
|
||||
Build=0
|
||||
Debug=0
|
||||
PreRelease=0
|
||||
Special=0
|
||||
Private=0
|
||||
DLL=0
|
||||
Locale=1040
|
||||
CodePage=1252
|
||||
|
||||
[Version Info Keys]
|
||||
CompanyName=
|
||||
FileDescription=
|
||||
FileVersion=1.0.0.0
|
||||
InternalName=
|
||||
LegalCopyright=
|
||||
LegalTrademarks=
|
||||
OriginalFilename=
|
||||
ProductName=
|
||||
ProductVersion=1.0.0.0
|
||||
Comments=
|
||||
|
||||
[HistoryLists\hlIncludePath]
|
||||
Count=2
|
||||
Item0=$(BCB)\include;$(BCB)\include\vcl
|
||||
Item1=$(BCB)\include
|
||||
|
||||
[HistoryLists\hlLibraryPath]
|
||||
Count=1
|
||||
Item0=$(BCB)\lib\obj;$(BCB)\lib
|
||||
|
||||
[HistoryLists\hlDebugSourcePath]
|
||||
Count=1
|
||||
Item0=$(BCB)\source\vcl
|
||||
|
||||
[Debugging]
|
||||
DebugSourceDirs=
|
||||
|
||||
[Parameters]
|
||||
RunParams=
|
||||
HostApplication=
|
||||
|
||||
!endif
|
||||
|
||||
$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE)
|
||||
$(BCB)\BIN\$(LINKER) @&&!
|
||||
$(LFLAGS) $(IFLAGS) +
|
||||
$(ALLOBJ), +
|
||||
$(PROJECT),, +
|
||||
$(ALLLIB), +
|
||||
$(DEFFILE), +
|
||||
$(ALLRES)
|
||||
!
|
||||
# ---------------------------------------------------------------------------
|
||||
.pas.hpp:
|
||||
$(BCB)\BIN\$(DCC32) $(PFLAGS) {$< }
|
||||
|
||||
.pas.obj:
|
||||
$(BCB)\BIN\$(DCC32) $(PFLAGS) {$< }
|
||||
|
||||
.cpp.obj:
|
||||
$(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< }
|
||||
|
||||
.c.obj:
|
||||
$(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< }
|
||||
|
||||
.asm.obj:
|
||||
$(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@
|
||||
|
||||
.rc.res:
|
||||
$(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $<
|
||||
# ---------------------------------------------------------------------------
|
||||
@@ -1,22 +0,0 @@
|
||||
#include <condefs.h>
|
||||
#pragma hdrstop
|
||||
//---------------------------------------------------------------------------
|
||||
USEUNIT("adler32.c");
|
||||
USEUNIT("compress.c");
|
||||
USEUNIT("crc32.c");
|
||||
USEUNIT("deflate.c");
|
||||
USEUNIT("gzio.c");
|
||||
USEUNIT("infblock.c");
|
||||
USEUNIT("infcodes.c");
|
||||
USEUNIT("inffast.c");
|
||||
USEUNIT("inflate.c");
|
||||
USEUNIT("inftrees.c");
|
||||
USEUNIT("infutil.c");
|
||||
USEUNIT("trees.c");
|
||||
USEUNIT("uncompr.c");
|
||||
USEUNIT("zutil.c");
|
||||
//---------------------------------------------------------------------------
|
||||
#define Library
|
||||
|
||||
// To add a file to the library use the Project menu 'Add to Project'.
|
||||
|
||||
@@ -1,534 +0,0 @@
|
||||
{*******************************************************}
|
||||
{ }
|
||||
{ Delphi Supplemental Components }
|
||||
{ ZLIB Data Compression Interface Unit }
|
||||
{ }
|
||||
{ Copyright (c) 1997 Borland International }
|
||||
{ }
|
||||
{*******************************************************}
|
||||
|
||||
{ Modified for zlib 1.1.3 by Davide Moretti <dave@rimini.com }
|
||||
|
||||
unit zlib;
|
||||
|
||||
interface
|
||||
|
||||
uses Sysutils, Classes;
|
||||
|
||||
type
|
||||
TAlloc = function (AppData: Pointer; Items, Size: Integer): Pointer;
|
||||
TFree = procedure (AppData, Block: Pointer);
|
||||
|
||||
// Internal structure. Ignore.
|
||||
TZStreamRec = packed record
|
||||
next_in: PChar; // next input byte
|
||||
avail_in: Integer; // number of bytes available at next_in
|
||||
total_in: Integer; // total nb of input bytes read so far
|
||||
|
||||
next_out: PChar; // next output byte should be put here
|
||||
avail_out: Integer; // remaining free space at next_out
|
||||
total_out: Integer; // total nb of bytes output so far
|
||||
|
||||
msg: PChar; // last error message, NULL if no error
|
||||
internal: Pointer; // not visible by applications
|
||||
|
||||
zalloc: TAlloc; // used to allocate the internal state
|
||||
zfree: TFree; // used to free the internal state
|
||||
AppData: Pointer; // private data object passed to zalloc and zfree
|
||||
|
||||
data_type: Integer; // best guess about the data type: ascii or binary
|
||||
adler: Integer; // adler32 value of the uncompressed data
|
||||
reserved: Integer; // reserved for future use
|
||||
end;
|
||||
|
||||
// Abstract ancestor class
|
||||
TCustomZlibStream = class(TStream)
|
||||
private
|
||||
FStrm: TStream;
|
||||
FStrmPos: Integer;
|
||||
FOnProgress: TNotifyEvent;
|
||||
FZRec: TZStreamRec;
|
||||
FBuffer: array [Word] of Char;
|
||||
protected
|
||||
procedure Progress(Sender: TObject); dynamic;
|
||||
property OnProgress: TNotifyEvent read FOnProgress write FOnProgress;
|
||||
constructor Create(Strm: TStream);
|
||||
end;
|
||||
|
||||
{ TCompressionStream compresses data on the fly as data is written to it, and
|
||||
stores the compressed data to another stream.
|
||||
|
||||
TCompressionStream is write-only and strictly sequential. Reading from the
|
||||
stream will raise an exception. Using Seek to move the stream pointer
|
||||
will raise an exception.
|
||||
|
||||
Output data is cached internally, written to the output stream only when
|
||||
the internal output buffer is full. All pending output data is flushed
|
||||
when the stream is destroyed.
|
||||
|
||||
The Position property returns the number of uncompressed bytes of
|
||||
data that have been written to the stream so far.
|
||||
|
||||
CompressionRate returns the on-the-fly percentage by which the original
|
||||
data has been compressed: (1 - (CompressedBytes / UncompressedBytes)) * 100
|
||||
If raw data size = 100 and compressed data size = 25, the CompressionRate
|
||||
is 75%
|
||||
|
||||
The OnProgress event is called each time the output buffer is filled and
|
||||
written to the output stream. This is useful for updating a progress
|
||||
indicator when you are writing a large chunk of data to the compression
|
||||
stream in a single call.}
|
||||
|
||||
|
||||
TCompressionLevel = (clNone, clFastest, clDefault, clMax);
|
||||
|
||||
TCompressionStream = class(TCustomZlibStream)
|
||||
private
|
||||
function GetCompressionRate: Single;
|
||||
public
|
||||
constructor Create(CompressionLevel: TCompressionLevel; Dest: TStream);
|
||||
destructor Destroy; override;
|
||||
function Read(var Buffer; Count: Longint): Longint; override;
|
||||
function Write(const Buffer; Count: Longint): Longint; override;
|
||||
function Seek(Offset: Longint; Origin: Word): Longint; override;
|
||||
property CompressionRate: Single read GetCompressionRate;
|
||||
property OnProgress;
|
||||
end;
|
||||
|
||||
{ TDecompressionStream decompresses data on the fly as data is read from it.
|
||||
|
||||
Compressed data comes from a separate source stream. TDecompressionStream
|
||||
is read-only and unidirectional; you can seek forward in the stream, but not
|
||||
backwards. The special case of setting the stream position to zero is
|
||||
allowed. Seeking forward decompresses data until the requested position in
|
||||
the uncompressed data has been reached. Seeking backwards, seeking relative
|
||||
to the end of the stream, requesting the size of the stream, and writing to
|
||||
the stream will raise an exception.
|
||||
|
||||
The Position property returns the number of bytes of uncompressed data that
|
||||
have been read from the stream so far.
|
||||
|
||||
The OnProgress event is called each time the internal input buffer of
|
||||
compressed data is exhausted and the next block is read from the input stream.
|
||||
This is useful for updating a progress indicator when you are reading a
|
||||
large chunk of data from the decompression stream in a single call.}
|
||||
|
||||
TDecompressionStream = class(TCustomZlibStream)
|
||||
public
|
||||
constructor Create(Source: TStream);
|
||||
destructor Destroy; override;
|
||||
function Read(var Buffer; Count: Longint): Longint; override;
|
||||
function Write(const Buffer; Count: Longint): Longint; override;
|
||||
function Seek(Offset: Longint; Origin: Word): Longint; override;
|
||||
property OnProgress;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
{ CompressBuf compresses data, buffer to buffer, in one call.
|
||||
In: InBuf = ptr to compressed data
|
||||
InBytes = number of bytes in InBuf
|
||||
Out: OutBuf = ptr to newly allocated buffer containing decompressed data
|
||||
OutBytes = number of bytes in OutBuf }
|
||||
procedure CompressBuf(const InBuf: Pointer; InBytes: Integer;
|
||||
out OutBuf: Pointer; out OutBytes: Integer);
|
||||
|
||||
|
||||
{ DecompressBuf decompresses data, buffer to buffer, in one call.
|
||||
In: InBuf = ptr to compressed data
|
||||
InBytes = number of bytes in InBuf
|
||||
OutEstimate = zero, or est. size of the decompressed data
|
||||
Out: OutBuf = ptr to newly allocated buffer containing decompressed data
|
||||
OutBytes = number of bytes in OutBuf }
|
||||
procedure DecompressBuf(const InBuf: Pointer; InBytes: Integer;
|
||||
OutEstimate: Integer; out OutBuf: Pointer; out OutBytes: Integer);
|
||||
|
||||
const
|
||||
zlib_version = '1.1.3';
|
||||
|
||||
type
|
||||
EZlibError = class(Exception);
|
||||
ECompressionError = class(EZlibError);
|
||||
EDecompressionError = class(EZlibError);
|
||||
|
||||
function adler32(adler: Integer; buf: PChar; len: Integer): Integer;
|
||||
|
||||
implementation
|
||||
|
||||
const
|
||||
Z_NO_FLUSH = 0;
|
||||
Z_PARTIAL_FLUSH = 1;
|
||||
Z_SYNC_FLUSH = 2;
|
||||
Z_FULL_FLUSH = 3;
|
||||
Z_FINISH = 4;
|
||||
|
||||
Z_OK = 0;
|
||||
Z_STREAM_END = 1;
|
||||
Z_NEED_DICT = 2;
|
||||
Z_ERRNO = (-1);
|
||||
Z_STREAM_ERROR = (-2);
|
||||
Z_DATA_ERROR = (-3);
|
||||
Z_MEM_ERROR = (-4);
|
||||
Z_BUF_ERROR = (-5);
|
||||
Z_VERSION_ERROR = (-6);
|
||||
|
||||
Z_NO_COMPRESSION = 0;
|
||||
Z_BEST_SPEED = 1;
|
||||
Z_BEST_COMPRESSION = 9;
|
||||
Z_DEFAULT_COMPRESSION = (-1);
|
||||
|
||||
Z_FILTERED = 1;
|
||||
Z_HUFFMAN_ONLY = 2;
|
||||
Z_DEFAULT_STRATEGY = 0;
|
||||
|
||||
Z_BINARY = 0;
|
||||
Z_ASCII = 1;
|
||||
Z_UNKNOWN = 2;
|
||||
|
||||
Z_DEFLATED = 8;
|
||||
|
||||
_z_errmsg: array[0..9] of PChar = (
|
||||
'need dictionary', // Z_NEED_DICT (2)
|
||||
'stream end', // Z_STREAM_END (1)
|
||||
'', // Z_OK (0)
|
||||
'file error', // Z_ERRNO (-1)
|
||||
'stream error', // Z_STREAM_ERROR (-2)
|
||||
'data error', // Z_DATA_ERROR (-3)
|
||||
'insufficient memory', // Z_MEM_ERROR (-4)
|
||||
'buffer error', // Z_BUF_ERROR (-5)
|
||||
'incompatible version', // Z_VERSION_ERROR (-6)
|
||||
''
|
||||
);
|
||||
|
||||
{$L deflate.obj}
|
||||
{$L inflate.obj}
|
||||
{$L inftrees.obj}
|
||||
{$L trees.obj}
|
||||
{$L adler32.obj}
|
||||
{$L infblock.obj}
|
||||
{$L infcodes.obj}
|
||||
{$L infutil.obj}
|
||||
{$L inffast.obj}
|
||||
|
||||
procedure _tr_init; external;
|
||||
procedure _tr_tally; external;
|
||||
procedure _tr_flush_block; external;
|
||||
procedure _tr_align; external;
|
||||
procedure _tr_stored_block; external;
|
||||
function adler32; external;
|
||||
procedure inflate_blocks_new; external;
|
||||
procedure inflate_blocks; external;
|
||||
procedure inflate_blocks_reset; external;
|
||||
procedure inflate_blocks_free; external;
|
||||
procedure inflate_set_dictionary; external;
|
||||
procedure inflate_trees_bits; external;
|
||||
procedure inflate_trees_dynamic; external;
|
||||
procedure inflate_trees_fixed; external;
|
||||
procedure inflate_codes_new; external;
|
||||
procedure inflate_codes; external;
|
||||
procedure inflate_codes_free; external;
|
||||
procedure _inflate_mask; external;
|
||||
procedure inflate_flush; external;
|
||||
procedure inflate_fast; external;
|
||||
|
||||
procedure _memset(P: Pointer; B: Byte; count: Integer);cdecl;
|
||||
begin
|
||||
FillChar(P^, count, B);
|
||||
end;
|
||||
|
||||
procedure _memcpy(dest, source: Pointer; count: Integer);cdecl;
|
||||
begin
|
||||
Move(source^, dest^, count);
|
||||
end;
|
||||
|
||||
|
||||
|
||||
// deflate compresses data
|
||||
function deflateInit_(var strm: TZStreamRec; level: Integer; version: PChar;
|
||||
recsize: Integer): Integer; external;
|
||||
function deflate(var strm: TZStreamRec; flush: Integer): Integer; external;
|
||||
function deflateEnd(var strm: TZStreamRec): Integer; external;
|
||||
|
||||
// inflate decompresses data
|
||||
function inflateInit_(var strm: TZStreamRec; version: PChar;
|
||||
recsize: Integer): Integer; external;
|
||||
function inflate(var strm: TZStreamRec; flush: Integer): Integer; external;
|
||||
function inflateEnd(var strm: TZStreamRec): Integer; external;
|
||||
function inflateReset(var strm: TZStreamRec): Integer; external;
|
||||
|
||||
|
||||
function zcalloc(AppData: Pointer; Items, Size: Integer): Pointer;
|
||||
begin
|
||||
GetMem(Result, Items*Size);
|
||||
end;
|
||||
|
||||
procedure zcfree(AppData, Block: Pointer);
|
||||
begin
|
||||
FreeMem(Block);
|
||||
end;
|
||||
|
||||
function zlibCheck(code: Integer): Integer;
|
||||
begin
|
||||
Result := code;
|
||||
if code < 0 then
|
||||
raise EZlibError.Create('error'); //!!
|
||||
end;
|
||||
|
||||
function CCheck(code: Integer): Integer;
|
||||
begin
|
||||
Result := code;
|
||||
if code < 0 then
|
||||
raise ECompressionError.Create('error'); //!!
|
||||
end;
|
||||
|
||||
function DCheck(code: Integer): Integer;
|
||||
begin
|
||||
Result := code;
|
||||
if code < 0 then
|
||||
raise EDecompressionError.Create('error'); //!!
|
||||
end;
|
||||
|
||||
procedure CompressBuf(const InBuf: Pointer; InBytes: Integer;
|
||||
out OutBuf: Pointer; out OutBytes: Integer);
|
||||
var
|
||||
strm: TZStreamRec;
|
||||
P: Pointer;
|
||||
begin
|
||||
FillChar(strm, sizeof(strm), 0);
|
||||
OutBytes := ((InBytes + (InBytes div 10) + 12) + 255) and not 255;
|
||||
GetMem(OutBuf, OutBytes);
|
||||
try
|
||||
strm.next_in := InBuf;
|
||||
strm.avail_in := InBytes;
|
||||
strm.next_out := OutBuf;
|
||||
strm.avail_out := OutBytes;
|
||||
CCheck(deflateInit_(strm, Z_BEST_COMPRESSION, zlib_version, sizeof(strm)));
|
||||
try
|
||||
while CCheck(deflate(strm, Z_FINISH)) <> Z_STREAM_END do
|
||||
begin
|
||||
P := OutBuf;
|
||||
Inc(OutBytes, 256);
|
||||
ReallocMem(OutBuf, OutBytes);
|
||||
strm.next_out := PChar(Integer(OutBuf) + (Integer(strm.next_out) - Integer(P)));
|
||||
strm.avail_out := 256;
|
||||
end;
|
||||
finally
|
||||
CCheck(deflateEnd(strm));
|
||||
end;
|
||||
ReallocMem(OutBuf, strm.total_out);
|
||||
OutBytes := strm.total_out;
|
||||
except
|
||||
FreeMem(OutBuf);
|
||||
raise
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
procedure DecompressBuf(const InBuf: Pointer; InBytes: Integer;
|
||||
OutEstimate: Integer; out OutBuf: Pointer; out OutBytes: Integer);
|
||||
var
|
||||
strm: TZStreamRec;
|
||||
P: Pointer;
|
||||
BufInc: Integer;
|
||||
begin
|
||||
FillChar(strm, sizeof(strm), 0);
|
||||
BufInc := (InBytes + 255) and not 255;
|
||||
if OutEstimate = 0 then
|
||||
OutBytes := BufInc
|
||||
else
|
||||
OutBytes := OutEstimate;
|
||||
GetMem(OutBuf, OutBytes);
|
||||
try
|
||||
strm.next_in := InBuf;
|
||||
strm.avail_in := InBytes;
|
||||
strm.next_out := OutBuf;
|
||||
strm.avail_out := OutBytes;
|
||||
DCheck(inflateInit_(strm, zlib_version, sizeof(strm)));
|
||||
try
|
||||
while DCheck(inflate(strm, Z_FINISH)) <> Z_STREAM_END do
|
||||
begin
|
||||
P := OutBuf;
|
||||
Inc(OutBytes, BufInc);
|
||||
ReallocMem(OutBuf, OutBytes);
|
||||
strm.next_out := PChar(Integer(OutBuf) + (Integer(strm.next_out) - Integer(P)));
|
||||
strm.avail_out := BufInc;
|
||||
end;
|
||||
finally
|
||||
DCheck(inflateEnd(strm));
|
||||
end;
|
||||
ReallocMem(OutBuf, strm.total_out);
|
||||
OutBytes := strm.total_out;
|
||||
except
|
||||
FreeMem(OutBuf);
|
||||
raise
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
// TCustomZlibStream
|
||||
|
||||
constructor TCustomZLibStream.Create(Strm: TStream);
|
||||
begin
|
||||
inherited Create;
|
||||
FStrm := Strm;
|
||||
FStrmPos := Strm.Position;
|
||||
end;
|
||||
|
||||
procedure TCustomZLibStream.Progress(Sender: TObject);
|
||||
begin
|
||||
if Assigned(FOnProgress) then FOnProgress(Sender);
|
||||
end;
|
||||
|
||||
|
||||
// TCompressionStream
|
||||
|
||||
constructor TCompressionStream.Create(CompressionLevel: TCompressionLevel;
|
||||
Dest: TStream);
|
||||
const
|
||||
Levels: array [TCompressionLevel] of ShortInt =
|
||||
(Z_NO_COMPRESSION, Z_BEST_SPEED, Z_DEFAULT_COMPRESSION, Z_BEST_COMPRESSION);
|
||||
begin
|
||||
inherited Create(Dest);
|
||||
FZRec.next_out := FBuffer;
|
||||
FZRec.avail_out := sizeof(FBuffer);
|
||||
CCheck(deflateInit_(FZRec, Levels[CompressionLevel], zlib_version, sizeof(FZRec)));
|
||||
end;
|
||||
|
||||
destructor TCompressionStream.Destroy;
|
||||
begin
|
||||
FZRec.next_in := nil;
|
||||
FZRec.avail_in := 0;
|
||||
try
|
||||
if FStrm.Position <> FStrmPos then FStrm.Position := FStrmPos;
|
||||
while (CCheck(deflate(FZRec, Z_FINISH)) <> Z_STREAM_END)
|
||||
and (FZRec.avail_out = 0) do
|
||||
begin
|
||||
FStrm.WriteBuffer(FBuffer, sizeof(FBuffer));
|
||||
FZRec.next_out := FBuffer;
|
||||
FZRec.avail_out := sizeof(FBuffer);
|
||||
end;
|
||||
if FZRec.avail_out < sizeof(FBuffer) then
|
||||
FStrm.WriteBuffer(FBuffer, sizeof(FBuffer) - FZRec.avail_out);
|
||||
finally
|
||||
deflateEnd(FZRec);
|
||||
end;
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
function TCompressionStream.Read(var Buffer; Count: Longint): Longint;
|
||||
begin
|
||||
raise ECompressionError.Create('Invalid stream operation');
|
||||
end;
|
||||
|
||||
function TCompressionStream.Write(const Buffer; Count: Longint): Longint;
|
||||
begin
|
||||
FZRec.next_in := @Buffer;
|
||||
FZRec.avail_in := Count;
|
||||
if FStrm.Position <> FStrmPos then FStrm.Position := FStrmPos;
|
||||
while (FZRec.avail_in > 0) do
|
||||
begin
|
||||
CCheck(deflate(FZRec, 0));
|
||||
if FZRec.avail_out = 0 then
|
||||
begin
|
||||
FStrm.WriteBuffer(FBuffer, sizeof(FBuffer));
|
||||
FZRec.next_out := FBuffer;
|
||||
FZRec.avail_out := sizeof(FBuffer);
|
||||
FStrmPos := FStrm.Position;
|
||||
Progress(Self);
|
||||
end;
|
||||
end;
|
||||
Result := Count;
|
||||
end;
|
||||
|
||||
function TCompressionStream.Seek(Offset: Longint; Origin: Word): Longint;
|
||||
begin
|
||||
if (Offset = 0) and (Origin = soFromCurrent) then
|
||||
Result := FZRec.total_in
|
||||
else
|
||||
raise ECompressionError.Create('Invalid stream operation');
|
||||
end;
|
||||
|
||||
function TCompressionStream.GetCompressionRate: Single;
|
||||
begin
|
||||
if FZRec.total_in = 0 then
|
||||
Result := 0
|
||||
else
|
||||
Result := (1.0 - (FZRec.total_out / FZRec.total_in)) * 100.0;
|
||||
end;
|
||||
|
||||
|
||||
// TDecompressionStream
|
||||
|
||||
constructor TDecompressionStream.Create(Source: TStream);
|
||||
begin
|
||||
inherited Create(Source);
|
||||
FZRec.next_in := FBuffer;
|
||||
FZRec.avail_in := 0;
|
||||
DCheck(inflateInit_(FZRec, zlib_version, sizeof(FZRec)));
|
||||
end;
|
||||
|
||||
destructor TDecompressionStream.Destroy;
|
||||
begin
|
||||
inflateEnd(FZRec);
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
function TDecompressionStream.Read(var Buffer; Count: Longint): Longint;
|
||||
begin
|
||||
FZRec.next_out := @Buffer;
|
||||
FZRec.avail_out := Count;
|
||||
if FStrm.Position <> FStrmPos then FStrm.Position := FStrmPos;
|
||||
while (FZRec.avail_out > 0) do
|
||||
begin
|
||||
if FZRec.avail_in = 0 then
|
||||
begin
|
||||
FZRec.avail_in := FStrm.Read(FBuffer, sizeof(FBuffer));
|
||||
if FZRec.avail_in = 0 then
|
||||
begin
|
||||
Result := Count - FZRec.avail_out;
|
||||
Exit;
|
||||
end;
|
||||
FZRec.next_in := FBuffer;
|
||||
FStrmPos := FStrm.Position;
|
||||
Progress(Self);
|
||||
end;
|
||||
DCheck(inflate(FZRec, 0));
|
||||
end;
|
||||
Result := Count;
|
||||
end;
|
||||
|
||||
function TDecompressionStream.Write(const Buffer; Count: Longint): Longint;
|
||||
begin
|
||||
raise EDecompressionError.Create('Invalid stream operation');
|
||||
end;
|
||||
|
||||
function TDecompressionStream.Seek(Offset: Longint; Origin: Word): Longint;
|
||||
var
|
||||
I: Integer;
|
||||
Buf: array [0..4095] of Char;
|
||||
begin
|
||||
if (Offset = 0) and (Origin = soFromBeginning) then
|
||||
begin
|
||||
DCheck(inflateReset(FZRec));
|
||||
FZRec.next_in := FBuffer;
|
||||
FZRec.avail_in := 0;
|
||||
FStrm.Position := 0;
|
||||
FStrmPos := 0;
|
||||
end
|
||||
else if ( (Offset >= 0) and (Origin = soFromCurrent)) or
|
||||
( ((Offset - FZRec.total_out) > 0) and (Origin = soFromBeginning)) then
|
||||
begin
|
||||
if Origin = soFromBeginning then Dec(Offset, FZRec.total_out);
|
||||
if Offset > 0 then
|
||||
begin
|
||||
for I := 1 to Offset div sizeof(Buf) do
|
||||
ReadBuffer(Buf, sizeof(Buf));
|
||||
ReadBuffer(Buf, Offset mod sizeof(Buf));
|
||||
end;
|
||||
end
|
||||
else
|
||||
raise EDecompressionError.Create('Invalid stream operation');
|
||||
Result := FZRec.total_out;
|
||||
end;
|
||||
|
||||
end.
|
||||
@@ -1,174 +0,0 @@
|
||||
# ---------------------------------------------------------------------------
|
||||
!if !$d(BCB)
|
||||
BCB = $(MAKEDIR)\..
|
||||
!endif
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# IDE SECTION
|
||||
# ---------------------------------------------------------------------------
|
||||
# The following section of the project makefile is managed by the BCB IDE.
|
||||
# It is recommended to use the IDE to change any of the values in this
|
||||
# section.
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
VERSION = BCB.03
|
||||
# ---------------------------------------------------------------------------
|
||||
PROJECT = zlib32.dll
|
||||
OBJFILES = zlib32.obj adler32.obj compress.obj crc32.obj deflate.obj gzio.obj infblock.obj \
|
||||
infcodes.obj inffast.obj inflate.obj inftrees.obj infutil.obj trees.obj \
|
||||
uncompr.obj zutil.obj
|
||||
RESFILES =
|
||||
RESDEPEN = $(RESFILES)
|
||||
LIBFILES =
|
||||
LIBRARIES =
|
||||
SPARELIBS =
|
||||
DEFFILE =
|
||||
PACKAGES = VCLX35.bpi VCL35.bpi VCLDB35.bpi VCLDBX35.bpi ibsmp35.bpi bcbsmp35.bpi \
|
||||
dclocx35.bpi QRPT35.bpi TEEUI35.bpi TEEDB35.bpi TEE35.bpi DSS35.bpi \
|
||||
NMFAST35.bpi INETDB35.bpi INET35.bpi VCLMID35.bpi
|
||||
# ---------------------------------------------------------------------------
|
||||
PATHCPP = .;
|
||||
PATHASM = .;
|
||||
PATHPAS = .;
|
||||
PATHRC = .;
|
||||
DEBUGLIBPATH = $(BCB)\lib\debug
|
||||
RELEASELIBPATH = $(BCB)\lib\release
|
||||
# ---------------------------------------------------------------------------
|
||||
CFLAG1 = -WD -O2 -Ve -d -k- -vi -c -tWD
|
||||
CFLAG2 = -D_NO_VCL;ZLIB_DLL -I$(BCB)\include
|
||||
CFLAG3 = -ff -5
|
||||
PFLAGS = -D_NO_VCL;ZLIB_DLL -U$(BCB)\lib;$(RELEASELIBPATH) -I$(BCB)\include -$I- -v \
|
||||
-JPHN -M
|
||||
RFLAGS = -D_NO_VCL;ZLIB_DLL -i$(BCB)\include
|
||||
AFLAGS = /i$(BCB)\include /d_NO_VCL /dZLIB_DLL /mx /w2 /zn
|
||||
LFLAGS = -L$(BCB)\lib;$(RELEASELIBPATH) -aa -Tpd -x -Gi
|
||||
IFLAGS = -Gn -g
|
||||
# ---------------------------------------------------------------------------
|
||||
ALLOBJ = c0d32.obj $(OBJFILES)
|
||||
ALLRES = $(RESFILES)
|
||||
ALLLIB = $(LIBFILES) import32.lib cw32mt.lib
|
||||
# ---------------------------------------------------------------------------
|
||||
!ifdef IDEOPTIONS
|
||||
|
||||
[Version Info]
|
||||
IncludeVerInfo=0
|
||||
AutoIncBuild=0
|
||||
MajorVer=1
|
||||
MinorVer=0
|
||||
Release=0
|
||||
Build=0
|
||||
Debug=0
|
||||
PreRelease=0
|
||||
Special=0
|
||||
Private=0
|
||||
DLL=1
|
||||
Locale=1040
|
||||
CodePage=1252
|
||||
|
||||
[Version Info Keys]
|
||||
CompanyName=
|
||||
FileDescription=DLL (GUI)
|
||||
FileVersion=1.0.0.0
|
||||
InternalName=
|
||||
LegalCopyright=
|
||||
LegalTrademarks=
|
||||
OriginalFilename=
|
||||
ProductName=
|
||||
ProductVersion=1.0.0.0
|
||||
Comments=
|
||||
|
||||
[HistoryLists\hlIncludePath]
|
||||
Count=1
|
||||
Item0=$(BCB)\include
|
||||
|
||||
[HistoryLists\hlLibraryPath]
|
||||
Count=1
|
||||
Item0=$(BCB)\lib
|
||||
|
||||
[HistoryLists\hlConditionals]
|
||||
Count=1
|
||||
Item0=_NO_VCL;ZLIB_DLL
|
||||
|
||||
[Debugging]
|
||||
DebugSourceDirs=
|
||||
|
||||
[Parameters]
|
||||
RunParams=
|
||||
HostApplication=
|
||||
|
||||
!endif
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# MAKE SECTION
|
||||
# ---------------------------------------------------------------------------
|
||||
# This section of the project file is not used by the BCB IDE. It is for
|
||||
# the benefit of building from the command-line using the MAKE utility.
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
.autodepend
|
||||
# ---------------------------------------------------------------------------
|
||||
!if !$d(BCC32)
|
||||
BCC32 = bcc32
|
||||
!endif
|
||||
|
||||
!if !$d(DCC32)
|
||||
DCC32 = dcc32
|
||||
!endif
|
||||
|
||||
!if !$d(TASM32)
|
||||
TASM32 = tasm32
|
||||
!endif
|
||||
|
||||
!if !$d(LINKER)
|
||||
LINKER = ilink32
|
||||
!endif
|
||||
|
||||
!if !$d(BRCC32)
|
||||
BRCC32 = brcc32
|
||||
!endif
|
||||
# ---------------------------------------------------------------------------
|
||||
!if $d(PATHCPP)
|
||||
.PATH.CPP = $(PATHCPP)
|
||||
.PATH.C = $(PATHCPP)
|
||||
!endif
|
||||
|
||||
!if $d(PATHPAS)
|
||||
.PATH.PAS = $(PATHPAS)
|
||||
!endif
|
||||
|
||||
!if $d(PATHASM)
|
||||
.PATH.ASM = $(PATHASM)
|
||||
!endif
|
||||
|
||||
!if $d(PATHRC)
|
||||
.PATH.RC = $(PATHRC)
|
||||
!endif
|
||||
# ---------------------------------------------------------------------------
|
||||
$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE)
|
||||
$(BCB)\BIN\$(LINKER) @&&!
|
||||
$(LFLAGS) $(IFLAGS) +
|
||||
$(ALLOBJ), +
|
||||
$(PROJECT),, +
|
||||
$(ALLLIB), +
|
||||
$(DEFFILE), +
|
||||
$(ALLRES)
|
||||
!
|
||||
# ---------------------------------------------------------------------------
|
||||
.pas.hpp:
|
||||
$(BCB)\BIN\$(DCC32) $(PFLAGS) {$< }
|
||||
|
||||
.pas.obj:
|
||||
$(BCB)\BIN\$(DCC32) $(PFLAGS) {$< }
|
||||
|
||||
.cpp.obj:
|
||||
$(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< }
|
||||
|
||||
.c.obj:
|
||||
$(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< }
|
||||
|
||||
.asm.obj:
|
||||
$(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@
|
||||
|
||||
.rc.res:
|
||||
$(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $<
|
||||
# ---------------------------------------------------------------------------
|
||||
@@ -1,42 +0,0 @@
|
||||
|
||||
#include <windows.h>
|
||||
#pragma hdrstop
|
||||
#include <condefs.h>
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Important note about DLL memory management in a VCL DLL:
|
||||
//
|
||||
//
|
||||
//
|
||||
// If your DLL uses VCL and exports any functions that pass VCL String objects
|
||||
// (or structs/classes containing nested Strings) as parameter or function
|
||||
// results, you will need to build both your DLL project and any EXE projects
|
||||
// that use your DLL with the dynamic RTL (the RTL DLL). This will change your
|
||||
// DLL and its calling EXE's to use BORLNDMM.DLL as their memory manager. In
|
||||
// these cases, the file BORLNDMM.DLL should be deployed along with your DLL
|
||||
// and the RTL DLL (CP3240MT.DLL). To avoid the requiring BORLNDMM.DLL in
|
||||
// these situations, pass string information using "char *" or ShortString
|
||||
// parameters and then link with the static RTL.
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
USEUNIT("adler32.c");
|
||||
USEUNIT("compress.c");
|
||||
USEUNIT("crc32.c");
|
||||
USEUNIT("deflate.c");
|
||||
USEUNIT("gzio.c");
|
||||
USEUNIT("infblock.c");
|
||||
USEUNIT("infcodes.c");
|
||||
USEUNIT("inffast.c");
|
||||
USEUNIT("inflate.c");
|
||||
USEUNIT("inftrees.c");
|
||||
USEUNIT("infutil.c");
|
||||
USEUNIT("trees.c");
|
||||
USEUNIT("uncompr.c");
|
||||
USEUNIT("zutil.c");
|
||||
//---------------------------------------------------------------------------
|
||||
#pragma argsused
|
||||
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
|
||||
#include "zfstream.h"
|
||||
|
||||
int main() {
|
||||
|
||||
// Construct a stream object with this filebuffer. Anything sent
|
||||
// to this stream will go to standard out.
|
||||
gzofstream os( 1, ios::out );
|
||||
|
||||
// This text is getting compressed and sent to stdout.
|
||||
// To prove this, run 'test | zcat'.
|
||||
os << "Hello, Mommy" << endl;
|
||||
|
||||
os << setcompressionlevel( Z_NO_COMPRESSION );
|
||||
os << "hello, hello, hi, ho!" << endl;
|
||||
|
||||
setcompressionlevel( os, Z_DEFAULT_COMPRESSION )
|
||||
<< "I'm compressing again" << endl;
|
||||
|
||||
os.close();
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
@@ -1,329 +0,0 @@
|
||||
|
||||
#include <memory.h>
|
||||
#include "zfstream.h"
|
||||
|
||||
gzfilebuf::gzfilebuf() :
|
||||
file(NULL),
|
||||
mode(0),
|
||||
own_file_descriptor(0)
|
||||
{ }
|
||||
|
||||
gzfilebuf::~gzfilebuf() {
|
||||
|
||||
sync();
|
||||
if ( own_file_descriptor )
|
||||
close();
|
||||
|
||||
}
|
||||
|
||||
gzfilebuf *gzfilebuf::open( const char *name,
|
||||
int io_mode ) {
|
||||
|
||||
if ( is_open() )
|
||||
return NULL;
|
||||
|
||||
char char_mode[10];
|
||||
char *p;
|
||||
memset(char_mode,'\0',10);
|
||||
p = char_mode;
|
||||
|
||||
if ( io_mode & ios::in ) {
|
||||
mode = ios::in;
|
||||
*p++ = 'r';
|
||||
} else if ( io_mode & ios::app ) {
|
||||
mode = ios::app;
|
||||
*p++ = 'a';
|
||||
} else {
|
||||
mode = ios::out;
|
||||
*p++ = 'w';
|
||||
}
|
||||
|
||||
if ( io_mode & ios::binary ) {
|
||||
mode |= ios::binary;
|
||||
*p++ = 'b';
|
||||
}
|
||||
|
||||
// Hard code the compression level
|
||||
if ( io_mode & (ios::out|ios::app )) {
|
||||
*p++ = '9';
|
||||
}
|
||||
|
||||
if ( (file = gzopen(name, char_mode)) == NULL )
|
||||
return NULL;
|
||||
|
||||
own_file_descriptor = 1;
|
||||
|
||||
return this;
|
||||
|
||||
}
|
||||
|
||||
gzfilebuf *gzfilebuf::attach( int file_descriptor,
|
||||
int io_mode ) {
|
||||
|
||||
if ( is_open() )
|
||||
return NULL;
|
||||
|
||||
char char_mode[10];
|
||||
char *p;
|
||||
memset(char_mode,'\0',10);
|
||||
p = char_mode;
|
||||
|
||||
if ( io_mode & ios::in ) {
|
||||
mode = ios::in;
|
||||
*p++ = 'r';
|
||||
} else if ( io_mode & ios::app ) {
|
||||
mode = ios::app;
|
||||
*p++ = 'a';
|
||||
} else {
|
||||
mode = ios::out;
|
||||
*p++ = 'w';
|
||||
}
|
||||
|
||||
if ( io_mode & ios::binary ) {
|
||||
mode |= ios::binary;
|
||||
*p++ = 'b';
|
||||
}
|
||||
|
||||
// Hard code the compression level
|
||||
if ( io_mode & (ios::out|ios::app )) {
|
||||
*p++ = '9';
|
||||
}
|
||||
|
||||
if ( (file = gzdopen(file_descriptor, char_mode)) == NULL )
|
||||
return NULL;
|
||||
|
||||
own_file_descriptor = 0;
|
||||
|
||||
return this;
|
||||
|
||||
}
|
||||
|
||||
gzfilebuf *gzfilebuf::close() {
|
||||
|
||||
if ( is_open() ) {
|
||||
|
||||
sync();
|
||||
gzclose( file );
|
||||
file = NULL;
|
||||
|
||||
}
|
||||
|
||||
return this;
|
||||
|
||||
}
|
||||
|
||||
int gzfilebuf::setcompressionlevel( short comp_level ) {
|
||||
|
||||
return gzsetparams(file, comp_level, -2);
|
||||
|
||||
}
|
||||
|
||||
int gzfilebuf::setcompressionstrategy( short comp_strategy ) {
|
||||
|
||||
return gzsetparams(file, -2, comp_strategy);
|
||||
|
||||
}
|
||||
|
||||
|
||||
streampos gzfilebuf::seekoff( streamoff off, ios::seek_dir dir, int which ) {
|
||||
|
||||
return streampos(EOF);
|
||||
|
||||
}
|
||||
|
||||
int gzfilebuf::underflow() {
|
||||
|
||||
// If the file hasn't been opened for reading, error.
|
||||
if ( !is_open() || !(mode & ios::in) )
|
||||
return EOF;
|
||||
|
||||
// if a buffer doesn't exists, allocate one.
|
||||
if ( !base() ) {
|
||||
|
||||
if ( (allocate()) == EOF )
|
||||
return EOF;
|
||||
setp(0,0);
|
||||
|
||||
} else {
|
||||
|
||||
if ( in_avail() )
|
||||
return (unsigned char) *gptr();
|
||||
|
||||
if ( out_waiting() ) {
|
||||
if ( flushbuf() == EOF )
|
||||
return EOF;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Attempt to fill the buffer.
|
||||
|
||||
int result = fillbuf();
|
||||
if ( result == EOF ) {
|
||||
// disable get area
|
||||
setg(0,0,0);
|
||||
return EOF;
|
||||
}
|
||||
|
||||
return (unsigned char) *gptr();
|
||||
|
||||
}
|
||||
|
||||
int gzfilebuf::overflow( int c ) {
|
||||
|
||||
if ( !is_open() || !(mode & ios::out) )
|
||||
return EOF;
|
||||
|
||||
if ( !base() ) {
|
||||
if ( allocate() == EOF )
|
||||
return EOF;
|
||||
setg(0,0,0);
|
||||
} else {
|
||||
if (in_avail()) {
|
||||
return EOF;
|
||||
}
|
||||
if (out_waiting()) {
|
||||
if (flushbuf() == EOF)
|
||||
return EOF;
|
||||
}
|
||||
}
|
||||
|
||||
int bl = blen();
|
||||
setp( base(), base() + bl);
|
||||
|
||||
if ( c != EOF ) {
|
||||
|
||||
*pptr() = c;
|
||||
pbump(1);
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
int gzfilebuf::sync() {
|
||||
|
||||
if ( !is_open() )
|
||||
return EOF;
|
||||
|
||||
if ( out_waiting() )
|
||||
return flushbuf();
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
int gzfilebuf::flushbuf() {
|
||||
|
||||
int n;
|
||||
char *q;
|
||||
|
||||
q = pbase();
|
||||
n = pptr() - q;
|
||||
|
||||
if ( gzwrite( file, q, n) < n )
|
||||
return EOF;
|
||||
|
||||
setp(0,0);
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
int gzfilebuf::fillbuf() {
|
||||
|
||||
int required;
|
||||
char *p;
|
||||
|
||||
p = base();
|
||||
|
||||
required = blen();
|
||||
|
||||
int t = gzread( file, p, required );
|
||||
|
||||
if ( t <= 0) return EOF;
|
||||
|
||||
setg( base(), base(), base()+t);
|
||||
|
||||
return t;
|
||||
|
||||
}
|
||||
|
||||
gzfilestream_common::gzfilestream_common() :
|
||||
ios( gzfilestream_common::rdbuf() )
|
||||
{ }
|
||||
|
||||
gzfilestream_common::~gzfilestream_common()
|
||||
{ }
|
||||
|
||||
void gzfilestream_common::attach( int fd, int io_mode ) {
|
||||
|
||||
if ( !buffer.attach( fd, io_mode) )
|
||||
clear( ios::failbit | ios::badbit );
|
||||
else
|
||||
clear();
|
||||
|
||||
}
|
||||
|
||||
void gzfilestream_common::open( const char *name, int io_mode ) {
|
||||
|
||||
if ( !buffer.open( name, io_mode ) )
|
||||
clear( ios::failbit | ios::badbit );
|
||||
else
|
||||
clear();
|
||||
|
||||
}
|
||||
|
||||
void gzfilestream_common::close() {
|
||||
|
||||
if ( !buffer.close() )
|
||||
clear( ios::failbit | ios::badbit );
|
||||
|
||||
}
|
||||
|
||||
gzfilebuf *gzfilestream_common::rdbuf() {
|
||||
|
||||
return &buffer;
|
||||
|
||||
}
|
||||
|
||||
gzifstream::gzifstream() :
|
||||
ios( gzfilestream_common::rdbuf() )
|
||||
{
|
||||
clear( ios::badbit );
|
||||
}
|
||||
|
||||
gzifstream::gzifstream( const char *name, int io_mode ) :
|
||||
ios( gzfilestream_common::rdbuf() )
|
||||
{
|
||||
gzfilestream_common::open( name, io_mode );
|
||||
}
|
||||
|
||||
gzifstream::gzifstream( int fd, int io_mode ) :
|
||||
ios( gzfilestream_common::rdbuf() )
|
||||
{
|
||||
gzfilestream_common::attach( fd, io_mode );
|
||||
}
|
||||
|
||||
gzifstream::~gzifstream() { }
|
||||
|
||||
gzofstream::gzofstream() :
|
||||
ios( gzfilestream_common::rdbuf() )
|
||||
{
|
||||
clear( ios::badbit );
|
||||
}
|
||||
|
||||
gzofstream::gzofstream( const char *name, int io_mode ) :
|
||||
ios( gzfilestream_common::rdbuf() )
|
||||
{
|
||||
gzfilestream_common::open( name, io_mode );
|
||||
}
|
||||
|
||||
gzofstream::gzofstream( int fd, int io_mode ) :
|
||||
ios( gzfilestream_common::rdbuf() )
|
||||
{
|
||||
gzfilestream_common::attach( fd, io_mode );
|
||||
}
|
||||
|
||||
gzofstream::~gzofstream() { }
|
||||
@@ -1,142 +0,0 @@
|
||||
|
||||
#ifndef _zfstream_h
|
||||
#define _zfstream_h
|
||||
|
||||
#include <fstream.h>
|
||||
#include "zlib.h"
|
||||
|
||||
class gzfilebuf : public streambuf {
|
||||
|
||||
public:
|
||||
|
||||
gzfilebuf( );
|
||||
virtual ~gzfilebuf();
|
||||
|
||||
gzfilebuf *open( const char *name, int io_mode );
|
||||
gzfilebuf *attach( int file_descriptor, int io_mode );
|
||||
gzfilebuf *close();
|
||||
|
||||
int setcompressionlevel( short comp_level );
|
||||
int setcompressionstrategy( short comp_strategy );
|
||||
|
||||
inline int is_open() const { return (file !=NULL); }
|
||||
|
||||
virtual streampos seekoff( streamoff, ios::seek_dir, int );
|
||||
|
||||
virtual int sync();
|
||||
|
||||
protected:
|
||||
|
||||
virtual int underflow();
|
||||
virtual int overflow( int = EOF );
|
||||
|
||||
private:
|
||||
|
||||
gzFile file;
|
||||
short mode;
|
||||
short own_file_descriptor;
|
||||
|
||||
int flushbuf();
|
||||
int fillbuf();
|
||||
|
||||
};
|
||||
|
||||
class gzfilestream_common : virtual public ios {
|
||||
|
||||
friend class gzifstream;
|
||||
friend class gzofstream;
|
||||
friend gzofstream &setcompressionlevel( gzofstream &, int );
|
||||
friend gzofstream &setcompressionstrategy( gzofstream &, int );
|
||||
|
||||
public:
|
||||
virtual ~gzfilestream_common();
|
||||
|
||||
void attach( int fd, int io_mode );
|
||||
void open( const char *name, int io_mode );
|
||||
void close();
|
||||
|
||||
protected:
|
||||
gzfilestream_common();
|
||||
|
||||
private:
|
||||
gzfilebuf *rdbuf();
|
||||
|
||||
gzfilebuf buffer;
|
||||
|
||||
};
|
||||
|
||||
class gzifstream : public gzfilestream_common, public istream {
|
||||
|
||||
public:
|
||||
|
||||
gzifstream();
|
||||
gzifstream( const char *name, int io_mode = ios::in );
|
||||
gzifstream( int fd, int io_mode = ios::in );
|
||||
|
||||
virtual ~gzifstream();
|
||||
|
||||
};
|
||||
|
||||
class gzofstream : public gzfilestream_common, public ostream {
|
||||
|
||||
public:
|
||||
|
||||
gzofstream();
|
||||
gzofstream( const char *name, int io_mode = ios::out );
|
||||
gzofstream( int fd, int io_mode = ios::out );
|
||||
|
||||
virtual ~gzofstream();
|
||||
|
||||
};
|
||||
|
||||
template<class T> class gzomanip {
|
||||
friend gzofstream &operator<<(gzofstream &, const gzomanip<T> &);
|
||||
public:
|
||||
gzomanip(gzofstream &(*f)(gzofstream &, T), T v) : func(f), val(v) { }
|
||||
private:
|
||||
gzofstream &(*func)(gzofstream &, T);
|
||||
T val;
|
||||
};
|
||||
|
||||
template<class T> gzofstream &operator<<(gzofstream &s,
|
||||
const gzomanip<T> &m) {
|
||||
return (*m.func)(s, m.val);
|
||||
|
||||
}
|
||||
|
||||
inline gzofstream &setcompressionlevel( gzofstream &s, int l ) {
|
||||
(s.rdbuf())->setcompressionlevel(l);
|
||||
return s;
|
||||
}
|
||||
|
||||
inline gzofstream &setcompressionstrategy( gzofstream &s, int l ) {
|
||||
(s.rdbuf())->setcompressionstrategy(l);
|
||||
return s;
|
||||
}
|
||||
|
||||
inline gzomanip<int> setcompressionlevel(int l)
|
||||
{
|
||||
return gzomanip<int>(&setcompressionlevel,l);
|
||||
}
|
||||
|
||||
inline gzomanip<int> setcompressionstrategy(int l)
|
||||
{
|
||||
return gzomanip<int>(&setcompressionstrategy,l);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,307 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 1997
|
||||
* Christian Michelsen Research AS
|
||||
* Advanced Computing
|
||||
* Fantoftvegen 38, 5036 BERGEN, Norway
|
||||
* http://www.cmr.no
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Christian Michelsen Research AS makes no
|
||||
* representations about the suitability of this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef ZSTREAM__H
|
||||
#define ZSTREAM__H
|
||||
|
||||
/*
|
||||
* zstream.h - C++ interface to the 'zlib' general purpose compression library
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <strstream.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "zlib.h"
|
||||
|
||||
#if defined(_WIN32)
|
||||
# include <fcntl.h>
|
||||
# include <io.h>
|
||||
# define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY)
|
||||
#else
|
||||
# define SET_BINARY_MODE(file)
|
||||
#endif
|
||||
|
||||
class zstringlen {
|
||||
public:
|
||||
zstringlen(class izstream&);
|
||||
zstringlen(class ozstream&, const char*);
|
||||
size_t value() const { return val.word; }
|
||||
private:
|
||||
struct Val { unsigned char byte; size_t word; } val;
|
||||
};
|
||||
|
||||
// ----------------------------- izstream -----------------------------
|
||||
|
||||
class izstream
|
||||
{
|
||||
public:
|
||||
izstream() : m_fp(0) {}
|
||||
izstream(FILE* fp) : m_fp(0) { open(fp); }
|
||||
izstream(const char* name) : m_fp(0) { open(name); }
|
||||
~izstream() { close(); }
|
||||
|
||||
/* Opens a gzip (.gz) file for reading.
|
||||
* open() can be used to read a file which is not in gzip format;
|
||||
* in this case read() will directly read from the file without
|
||||
* decompression. errno can be checked to distinguish two error
|
||||
* cases (if errno is zero, the zlib error is Z_MEM_ERROR).
|
||||
*/
|
||||
void open(const char* name) {
|
||||
if (m_fp) close();
|
||||
m_fp = ::gzopen(name, "rb");
|
||||
}
|
||||
|
||||
void open(FILE* fp) {
|
||||
SET_BINARY_MODE(fp);
|
||||
if (m_fp) close();
|
||||
m_fp = ::gzdopen(fileno(fp), "rb");
|
||||
}
|
||||
|
||||
/* Flushes all pending input if necessary, closes the compressed file
|
||||
* and deallocates all the (de)compression state. The return value is
|
||||
* the zlib error number (see function error() below).
|
||||
*/
|
||||
int close() {
|
||||
int r = ::gzclose(m_fp);
|
||||
m_fp = 0; return r;
|
||||
}
|
||||
|
||||
/* Binary read the given number of bytes from the compressed file.
|
||||
*/
|
||||
int read(void* buf, size_t len) {
|
||||
return ::gzread(m_fp, buf, len);
|
||||
}
|
||||
|
||||
/* Returns the error message for the last error which occurred on the
|
||||
* given compressed file. errnum is set to zlib error number. If an
|
||||
* error occurred in the file system and not in the compression library,
|
||||
* errnum is set to Z_ERRNO and the application may consult errno
|
||||
* to get the exact error code.
|
||||
*/
|
||||
const char* error(int* errnum) {
|
||||
return ::gzerror(m_fp, errnum);
|
||||
}
|
||||
|
||||
gzFile fp() { return m_fp; }
|
||||
|
||||
private:
|
||||
gzFile m_fp;
|
||||
};
|
||||
|
||||
/*
|
||||
* Binary read the given (array of) object(s) from the compressed file.
|
||||
* If the input file was not in gzip format, read() copies the objects number
|
||||
* of bytes into the buffer.
|
||||
* returns the number of uncompressed bytes actually read
|
||||
* (0 for end of file, -1 for error).
|
||||
*/
|
||||
template <class T, class Items>
|
||||
inline int read(izstream& zs, T* x, Items items) {
|
||||
return ::gzread(zs.fp(), x, items*sizeof(T));
|
||||
}
|
||||
|
||||
/*
|
||||
* Binary input with the '>' operator.
|
||||
*/
|
||||
template <class T>
|
||||
inline izstream& operator>(izstream& zs, T& x) {
|
||||
::gzread(zs.fp(), &x, sizeof(T));
|
||||
return zs;
|
||||
}
|
||||
|
||||
|
||||
inline zstringlen::zstringlen(izstream& zs) {
|
||||
zs > val.byte;
|
||||
if (val.byte == 255) zs > val.word;
|
||||
else val.word = val.byte;
|
||||
}
|
||||
|
||||
/*
|
||||
* Read length of string + the string with the '>' operator.
|
||||
*/
|
||||
inline izstream& operator>(izstream& zs, char* x) {
|
||||
zstringlen len(zs);
|
||||
::gzread(zs.fp(), x, len.value());
|
||||
x[len.value()] = '\0';
|
||||
return zs;
|
||||
}
|
||||
|
||||
inline char* read_string(izstream& zs) {
|
||||
zstringlen len(zs);
|
||||
char* x = new char[len.value()+1];
|
||||
::gzread(zs.fp(), x, len.value());
|
||||
x[len.value()] = '\0';
|
||||
return x;
|
||||
}
|
||||
|
||||
// ----------------------------- ozstream -----------------------------
|
||||
|
||||
class ozstream
|
||||
{
|
||||
public:
|
||||
ozstream() : m_fp(0), m_os(0) {
|
||||
}
|
||||
ozstream(FILE* fp, int level = Z_DEFAULT_COMPRESSION)
|
||||
: m_fp(0), m_os(0) {
|
||||
open(fp, level);
|
||||
}
|
||||
ozstream(const char* name, int level = Z_DEFAULT_COMPRESSION)
|
||||
: m_fp(0), m_os(0) {
|
||||
open(name, level);
|
||||
}
|
||||
~ozstream() {
|
||||
close();
|
||||
}
|
||||
|
||||
/* Opens a gzip (.gz) file for writing.
|
||||
* The compression level parameter should be in 0..9
|
||||
* errno can be checked to distinguish two error cases
|
||||
* (if errno is zero, the zlib error is Z_MEM_ERROR).
|
||||
*/
|
||||
void open(const char* name, int level = Z_DEFAULT_COMPRESSION) {
|
||||
char mode[4] = "wb\0";
|
||||
if (level != Z_DEFAULT_COMPRESSION) mode[2] = '0'+level;
|
||||
if (m_fp) close();
|
||||
m_fp = ::gzopen(name, mode);
|
||||
}
|
||||
|
||||
/* open from a FILE pointer.
|
||||
*/
|
||||
void open(FILE* fp, int level = Z_DEFAULT_COMPRESSION) {
|
||||
SET_BINARY_MODE(fp);
|
||||
char mode[4] = "wb\0";
|
||||
if (level != Z_DEFAULT_COMPRESSION) mode[2] = '0'+level;
|
||||
if (m_fp) close();
|
||||
m_fp = ::gzdopen(fileno(fp), mode);
|
||||
}
|
||||
|
||||
/* Flushes all pending output if necessary, closes the compressed file
|
||||
* and deallocates all the (de)compression state. The return value is
|
||||
* the zlib error number (see function error() below).
|
||||
*/
|
||||
int close() {
|
||||
if (m_os) {
|
||||
::gzwrite(m_fp, m_os->str(), m_os->pcount());
|
||||
delete[] m_os->str(); delete m_os; m_os = 0;
|
||||
}
|
||||
int r = ::gzclose(m_fp); m_fp = 0; return r;
|
||||
}
|
||||
|
||||
/* Binary write the given number of bytes into the compressed file.
|
||||
*/
|
||||
int write(const void* buf, size_t len) {
|
||||
return ::gzwrite(m_fp, (voidp) buf, len);
|
||||
}
|
||||
|
||||
/* Flushes all pending output into the compressed file. The parameter
|
||||
* _flush is as in the deflate() function. The return value is the zlib
|
||||
* error number (see function gzerror below). flush() returns Z_OK if
|
||||
* the flush_ parameter is Z_FINISH and all output could be flushed.
|
||||
* flush() should be called only when strictly necessary because it can
|
||||
* degrade compression.
|
||||
*/
|
||||
int flush(int _flush) {
|
||||
os_flush();
|
||||
return ::gzflush(m_fp, _flush);
|
||||
}
|
||||
|
||||
/* Returns the error message for the last error which occurred on the
|
||||
* given compressed file. errnum is set to zlib error number. If an
|
||||
* error occurred in the file system and not in the compression library,
|
||||
* errnum is set to Z_ERRNO and the application may consult errno
|
||||
* to get the exact error code.
|
||||
*/
|
||||
const char* error(int* errnum) {
|
||||
return ::gzerror(m_fp, errnum);
|
||||
}
|
||||
|
||||
gzFile fp() { return m_fp; }
|
||||
|
||||
ostream& os() {
|
||||
if (m_os == 0) m_os = new ostrstream;
|
||||
return *m_os;
|
||||
}
|
||||
|
||||
void os_flush() {
|
||||
if (m_os && m_os->pcount()>0) {
|
||||
ostrstream* oss = new ostrstream;
|
||||
oss->fill(m_os->fill());
|
||||
oss->flags(m_os->flags());
|
||||
oss->precision(m_os->precision());
|
||||
oss->width(m_os->width());
|
||||
::gzwrite(m_fp, m_os->str(), m_os->pcount());
|
||||
delete[] m_os->str(); delete m_os; m_os = oss;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
gzFile m_fp;
|
||||
ostrstream* m_os;
|
||||
};
|
||||
|
||||
/*
|
||||
* Binary write the given (array of) object(s) into the compressed file.
|
||||
* returns the number of uncompressed bytes actually written
|
||||
* (0 in case of error).
|
||||
*/
|
||||
template <class T, class Items>
|
||||
inline int write(ozstream& zs, const T* x, Items items) {
|
||||
return ::gzwrite(zs.fp(), (voidp) x, items*sizeof(T));
|
||||
}
|
||||
|
||||
/*
|
||||
* Binary output with the '<' operator.
|
||||
*/
|
||||
template <class T>
|
||||
inline ozstream& operator<(ozstream& zs, const T& x) {
|
||||
::gzwrite(zs.fp(), (voidp) &x, sizeof(T));
|
||||
return zs;
|
||||
}
|
||||
|
||||
inline zstringlen::zstringlen(ozstream& zs, const char* x) {
|
||||
val.byte = 255; val.word = ::strlen(x);
|
||||
if (val.word < 255) zs < (val.byte = val.word);
|
||||
else zs < val;
|
||||
}
|
||||
|
||||
/*
|
||||
* Write length of string + the string with the '<' operator.
|
||||
*/
|
||||
inline ozstream& operator<(ozstream& zs, const char* x) {
|
||||
zstringlen len(zs, x);
|
||||
::gzwrite(zs.fp(), (voidp) x, len.value());
|
||||
return zs;
|
||||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
inline ozstream& operator<(ozstream& zs, char* const& x) {
|
||||
return zs < (const char*) x;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Ascii write with the << operator;
|
||||
*/
|
||||
template <class T>
|
||||
inline ostream& operator<<(ozstream& zs, const T& x) {
|
||||
zs.os_flush();
|
||||
return zs.os() << x;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,25 +0,0 @@
|
||||
#include "zstream.h"
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <iomanip.h>
|
||||
|
||||
void main() {
|
||||
char h[256] = "Hello";
|
||||
char* g = "Goodbye";
|
||||
ozstream out("temp.gz");
|
||||
out < "This works well" < h < g;
|
||||
out.close();
|
||||
|
||||
izstream in("temp.gz"); // read it back
|
||||
char *x = read_string(in), *y = new char[256], z[256];
|
||||
in > y > z;
|
||||
in.close();
|
||||
cout << x << endl << y << endl << z << endl;
|
||||
|
||||
out.open("temp.gz"); // try ascii output; zcat temp.gz to see the results
|
||||
out << setw(50) << setfill('#') << setprecision(20) << x << endl << y << endl << z << endl;
|
||||
out << z << endl << y << endl << x << endl;
|
||||
out << 1.1234567890123456789 << endl;
|
||||
|
||||
delete[] x; delete[] y;
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
Change in 0.15: (19 Mar 98)
|
||||
- fix memory leak in minizip.c
|
||||
|
||||
Change in 0.14: (10 Mar 98)
|
||||
- fix bugs in minizip.c sample for zipping big file
|
||||
- fix problem in month in date handling
|
||||
- fix bug in unzlocal_GetCurrentFileInfoInternal in unzip.c for
|
||||
comment handling
|
||||
|
||||
Change in 0.13: (6 Mar 98)
|
||||
- fix bugs in zip.c
|
||||
- add real minizip sample
|
||||
|
||||
Change in 0.12: (4 Mar 98)
|
||||
- add zip.c and zip.h for creates .zip file
|
||||
- fix change_file_date in miniunz.c for Unix (Jean-loup Gailly)
|
||||
- fix miniunz.c for file without specific record for directory
|
||||
|
||||
Change in 0.11: (3 Mar 98)
|
||||
- fix bug in unzGetCurrentFileInfo for get extra field and comment
|
||||
- enhance miniunz sample, remove the bad unztst.c sample
|
||||
|
||||
Change in 0.10: (2 Mar 98)
|
||||
- fix bug in unzReadCurrentFile
|
||||
- rename unzip* to unz* function and structure
|
||||
- remove Windows-like hungary notation variable name
|
||||
- modify some structure in unzip.h
|
||||
- add somes comment in source
|
||||
- remove unzipGetcCurrentFile function
|
||||
- replace ZUNZEXPORT by ZEXPORT
|
||||
- add unzGetLocalExtrafield for get the local extrafield info
|
||||
- add a new sample, miniunz.c
|
||||
|
||||
Change in 0.4: (25 Feb 98)
|
||||
- suppress the type unzipFileInZip.
|
||||
Only on file in the zipfile can be open at the same time
|
||||
- fix somes typo in code
|
||||
- added tm_unz structure in unzip_file_info (date/time in readable format)
|
||||
@@ -1,25 +0,0 @@
|
||||
CC=cc
|
||||
CFLAGS=-O -I../..
|
||||
|
||||
UNZ_OBJS = miniunz.o unzip.o ../../libz.a
|
||||
ZIP_OBJS = minizip.o zip.o ../../libz.a
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
all: miniunz minizip
|
||||
|
||||
miniunz: $(UNZ_OBJS)
|
||||
$(CC) $(CFLAGS) -o $@ $(UNZ_OBJS)
|
||||
|
||||
minizip: $(ZIP_OBJS)
|
||||
$(CC) $(CFLAGS) -o $@ $(ZIP_OBJS)
|
||||
|
||||
test: miniunz minizip
|
||||
./minizip test readme.txt
|
||||
./miniunz -l test.zip
|
||||
mv readme.txt readme.old
|
||||
./miniunz test.zip
|
||||
|
||||
clean:
|
||||
/bin/rm -f *.o *~ minizip miniunz
|
||||
@@ -1,508 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifdef unix
|
||||
# include <unistd.h>
|
||||
# include <utime.h>
|
||||
#else
|
||||
# include <direct.h>
|
||||
# include <io.h>
|
||||
#endif
|
||||
|
||||
#include "unzip.h"
|
||||
|
||||
#define CASESENSITIVITY (0)
|
||||
#define WRITEBUFFERSIZE (8192)
|
||||
|
||||
/*
|
||||
mini unzip, demo of unzip package
|
||||
|
||||
usage :
|
||||
Usage : miniunz [-exvlo] file.zip [file_to_extract]
|
||||
|
||||
list the file in the zipfile, and print the content of FILE_ID.ZIP or README.TXT
|
||||
if it exists
|
||||
*/
|
||||
|
||||
|
||||
/* change_file_date : change the date/time of a file
|
||||
filename : the filename of the file where date/time must be modified
|
||||
dosdate : the new date at the MSDos format (4 bytes)
|
||||
tmu_date : the SAME new date at the tm_unz format */
|
||||
void change_file_date(filename,dosdate,tmu_date)
|
||||
const char *filename;
|
||||
uLong dosdate;
|
||||
tm_unz tmu_date;
|
||||
{
|
||||
#ifdef WIN32
|
||||
HANDLE hFile;
|
||||
FILETIME ftm,ftLocal,ftCreate,ftLastAcc,ftLastWrite;
|
||||
|
||||
hFile = CreateFile(filename,GENERIC_READ | GENERIC_WRITE,
|
||||
0,NULL,OPEN_EXISTING,0,NULL);
|
||||
GetFileTime(hFile,&ftCreate,&ftLastAcc,&ftLastWrite);
|
||||
DosDateTimeToFileTime((WORD)(dosdate>>16),(WORD)dosdate,&ftLocal);
|
||||
LocalFileTimeToFileTime(&ftLocal,&ftm);
|
||||
SetFileTime(hFile,&ftm,&ftLastAcc,&ftm);
|
||||
CloseHandle(hFile);
|
||||
#else
|
||||
#ifdef unix
|
||||
struct utimbuf ut;
|
||||
struct tm newdate;
|
||||
newdate.tm_sec = tmu_date.tm_sec;
|
||||
newdate.tm_min=tmu_date.tm_min;
|
||||
newdate.tm_hour=tmu_date.tm_hour;
|
||||
newdate.tm_mday=tmu_date.tm_mday;
|
||||
newdate.tm_mon=tmu_date.tm_mon;
|
||||
if (tmu_date.tm_year > 1900)
|
||||
newdate.tm_year=tmu_date.tm_year - 1900;
|
||||
else
|
||||
newdate.tm_year=tmu_date.tm_year ;
|
||||
newdate.tm_isdst=-1;
|
||||
|
||||
ut.actime=ut.modtime=mktime(&newdate);
|
||||
utime(filename,&ut);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/* mymkdir and change_file_date are not 100 % portable
|
||||
As I don't know well Unix, I wait feedback for the unix portion */
|
||||
|
||||
int mymkdir(dirname)
|
||||
const char* dirname;
|
||||
{
|
||||
int ret=0;
|
||||
#ifdef WIN32
|
||||
ret = mkdir(dirname);
|
||||
#else
|
||||
#ifdef unix
|
||||
ret = mkdir (dirname,0775);
|
||||
#endif
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
int makedir (newdir)
|
||||
char *newdir;
|
||||
{
|
||||
char *buffer ;
|
||||
char *p;
|
||||
int len = strlen(newdir);
|
||||
|
||||
if (len <= 0)
|
||||
return 0;
|
||||
|
||||
buffer = (char*)malloc(len+1);
|
||||
strcpy(buffer,newdir);
|
||||
|
||||
if (buffer[len-1] == '/') {
|
||||
buffer[len-1] = '\0';
|
||||
}
|
||||
if (mymkdir(buffer) == 0)
|
||||
{
|
||||
free(buffer);
|
||||
return 1;
|
||||
}
|
||||
|
||||
p = buffer+1;
|
||||
while (1)
|
||||
{
|
||||
char hold;
|
||||
|
||||
while(*p && *p != '\\' && *p != '/')
|
||||
p++;
|
||||
hold = *p;
|
||||
*p = 0;
|
||||
if ((mymkdir(buffer) == -1) && (errno == ENOENT))
|
||||
{
|
||||
printf("couldn't create directory %s\n",buffer);
|
||||
free(buffer);
|
||||
return 0;
|
||||
}
|
||||
if (hold == 0)
|
||||
break;
|
||||
*p++ = hold;
|
||||
}
|
||||
free(buffer);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void do_banner()
|
||||
{
|
||||
printf("MiniUnz 0.15, demo of zLib + Unz package written by Gilles Vollant\n");
|
||||
printf("more info at http://wwww.winimage/zLibDll/unzip.htm\n\n");
|
||||
}
|
||||
|
||||
void do_help()
|
||||
{
|
||||
printf("Usage : miniunz [-exvlo] file.zip [file_to_extract]\n\n") ;
|
||||
}
|
||||
|
||||
|
||||
int do_list(uf)
|
||||
unzFile uf;
|
||||
{
|
||||
uLong i;
|
||||
unz_global_info gi;
|
||||
int err;
|
||||
|
||||
err = unzGetGlobalInfo (uf,&gi);
|
||||
if (err!=UNZ_OK)
|
||||
printf("error %d with zipfile in unzGetGlobalInfo \n",err);
|
||||
printf(" Length Method Size Ratio Date Time CRC-32 Name\n");
|
||||
printf(" ------ ------ ---- ----- ---- ---- ------ ----\n");
|
||||
for (i=0;i<gi.number_entry;i++)
|
||||
{
|
||||
char filename_inzip[256];
|
||||
unz_file_info file_info;
|
||||
uLong ratio=0;
|
||||
const char *string_method;
|
||||
err = unzGetCurrentFileInfo(uf,&file_info,filename_inzip,sizeof(filename_inzip),NULL,0,NULL,0);
|
||||
if (err!=UNZ_OK)
|
||||
{
|
||||
printf("error %d with zipfile in unzGetCurrentFileInfo\n",err);
|
||||
break;
|
||||
}
|
||||
if (file_info.uncompressed_size>0)
|
||||
ratio = (file_info.compressed_size*100)/file_info.uncompressed_size;
|
||||
|
||||
if (file_info.compression_method==0)
|
||||
string_method="Stored";
|
||||
else
|
||||
if (file_info.compression_method==Z_DEFLATED)
|
||||
{
|
||||
uInt iLevel=(uInt)((file_info.flag & 0x6)/2);
|
||||
if (iLevel==0)
|
||||
string_method="Defl:N";
|
||||
else if (iLevel==1)
|
||||
string_method="Defl:X";
|
||||
else if ((iLevel==2) || (iLevel==3))
|
||||
string_method="Defl:F"; /* 2:fast , 3 : extra fast*/
|
||||
}
|
||||
else
|
||||
string_method="Unkn. ";
|
||||
|
||||
printf("%7lu %6s %7lu %3lu%% %2.2lu-%2.2lu-%2.2lu %2.2lu:%2.2lu %8.8lx %s\n",
|
||||
file_info.uncompressed_size,string_method,file_info.compressed_size,
|
||||
ratio,
|
||||
(uLong)file_info.tmu_date.tm_mon + 1,
|
||||
(uLong)file_info.tmu_date.tm_mday,
|
||||
(uLong)file_info.tmu_date.tm_year % 100,
|
||||
(uLong)file_info.tmu_date.tm_hour,(uLong)file_info.tmu_date.tm_min,
|
||||
(uLong)file_info.crc,filename_inzip);
|
||||
if ((i+1)<gi.number_entry)
|
||||
{
|
||||
err = unzGoToNextFile(uf);
|
||||
if (err!=UNZ_OK)
|
||||
{
|
||||
printf("error %d with zipfile in unzGoToNextFile\n",err);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int do_extract_currentfile(uf,popt_extract_without_path,popt_overwrite)
|
||||
unzFile uf;
|
||||
const int* popt_extract_without_path;
|
||||
int* popt_overwrite;
|
||||
{
|
||||
char filename_inzip[256];
|
||||
char* filename_withoutpath;
|
||||
char* p;
|
||||
int err=UNZ_OK;
|
||||
FILE *fout=NULL;
|
||||
void* buf;
|
||||
uInt size_buf;
|
||||
|
||||
unz_file_info file_info;
|
||||
uLong ratio=0;
|
||||
err = unzGetCurrentFileInfo(uf,&file_info,filename_inzip,sizeof(filename_inzip),NULL,0,NULL,0);
|
||||
|
||||
if (err!=UNZ_OK)
|
||||
{
|
||||
printf("error %d with zipfile in unzGetCurrentFileInfo\n",err);
|
||||
return err;
|
||||
}
|
||||
|
||||
size_buf = WRITEBUFFERSIZE;
|
||||
buf = (void*)malloc(size_buf);
|
||||
if (buf==NULL)
|
||||
{
|
||||
printf("Error allocating memory\n");
|
||||
return UNZ_INTERNALERROR;
|
||||
}
|
||||
|
||||
p = filename_withoutpath = filename_inzip;
|
||||
while ((*p) != '\0')
|
||||
{
|
||||
if (((*p)=='/') || ((*p)=='\\'))
|
||||
filename_withoutpath = p+1;
|
||||
p++;
|
||||
}
|
||||
|
||||
if ((*filename_withoutpath)=='\0')
|
||||
{
|
||||
if ((*popt_extract_without_path)==0)
|
||||
{
|
||||
printf("creating directory: %s\n",filename_inzip);
|
||||
mymkdir(filename_inzip);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const char* write_filename;
|
||||
int skip=0;
|
||||
|
||||
if ((*popt_extract_without_path)==0)
|
||||
write_filename = filename_inzip;
|
||||
else
|
||||
write_filename = filename_withoutpath;
|
||||
|
||||
err = unzOpenCurrentFile(uf);
|
||||
if (err!=UNZ_OK)
|
||||
{
|
||||
printf("error %d with zipfile in unzOpenCurrentFile\n",err);
|
||||
}
|
||||
|
||||
if (((*popt_overwrite)==0) && (err==UNZ_OK))
|
||||
{
|
||||
char rep;
|
||||
FILE* ftestexist;
|
||||
ftestexist = fopen(write_filename,"rb");
|
||||
if (ftestexist!=NULL)
|
||||
{
|
||||
fclose(ftestexist);
|
||||
do
|
||||
{
|
||||
char answer[128];
|
||||
printf("The file %s exist. Overwrite ? [y]es, [n]o, [A]ll: ",write_filename);
|
||||
scanf("%1s",answer);
|
||||
rep = answer[0] ;
|
||||
if ((rep>='a') && (rep<='z'))
|
||||
rep -= 0x20;
|
||||
}
|
||||
while ((rep!='Y') && (rep!='N') && (rep!='A'));
|
||||
}
|
||||
|
||||
if (rep == 'N')
|
||||
skip = 1;
|
||||
|
||||
if (rep == 'A')
|
||||
*popt_overwrite=1;
|
||||
}
|
||||
|
||||
if ((skip==0) && (err==UNZ_OK))
|
||||
{
|
||||
fout=fopen(write_filename,"wb");
|
||||
|
||||
/* some zipfile don't contain directory alone before file */
|
||||
if ((fout==NULL) && ((*popt_extract_without_path)==0) &&
|
||||
(filename_withoutpath!=(char*)filename_inzip))
|
||||
{
|
||||
char c=*(filename_withoutpath-1);
|
||||
*(filename_withoutpath-1)='\0';
|
||||
makedir(write_filename);
|
||||
*(filename_withoutpath-1)=c;
|
||||
fout=fopen(write_filename,"wb");
|
||||
}
|
||||
|
||||
if (fout==NULL)
|
||||
{
|
||||
printf("error opening %s\n",write_filename);
|
||||
}
|
||||
}
|
||||
|
||||
if (fout!=NULL)
|
||||
{
|
||||
printf(" extracting: %s\n",write_filename);
|
||||
|
||||
do
|
||||
{
|
||||
err = unzReadCurrentFile(uf,buf,size_buf);
|
||||
if (err<0)
|
||||
{
|
||||
printf("error %d with zipfile in unzReadCurrentFile\n",err);
|
||||
break;
|
||||
}
|
||||
if (err>0)
|
||||
if (fwrite(buf,err,1,fout)!=1)
|
||||
{
|
||||
printf("error in writing extracted file\n");
|
||||
err=UNZ_ERRNO;
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (err>0);
|
||||
fclose(fout);
|
||||
if (err==0)
|
||||
change_file_date(write_filename,file_info.dosDate,
|
||||
file_info.tmu_date);
|
||||
}
|
||||
|
||||
if (err==UNZ_OK)
|
||||
{
|
||||
err = unzCloseCurrentFile (uf);
|
||||
if (err!=UNZ_OK)
|
||||
{
|
||||
printf("error %d with zipfile in unzCloseCurrentFile\n",err);
|
||||
}
|
||||
}
|
||||
else
|
||||
unzCloseCurrentFile(uf); /* don't lose the error */
|
||||
}
|
||||
|
||||
free(buf);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
int do_extract(uf,opt_extract_without_path,opt_overwrite)
|
||||
unzFile uf;
|
||||
int opt_extract_without_path;
|
||||
int opt_overwrite;
|
||||
{
|
||||
uLong i;
|
||||
unz_global_info gi;
|
||||
int err;
|
||||
FILE* fout=NULL;
|
||||
|
||||
err = unzGetGlobalInfo (uf,&gi);
|
||||
if (err!=UNZ_OK)
|
||||
printf("error %d with zipfile in unzGetGlobalInfo \n",err);
|
||||
|
||||
for (i=0;i<gi.number_entry;i++)
|
||||
{
|
||||
if (do_extract_currentfile(uf,&opt_extract_without_path,
|
||||
&opt_overwrite) != UNZ_OK)
|
||||
break;
|
||||
|
||||
if ((i+1)<gi.number_entry)
|
||||
{
|
||||
err = unzGoToNextFile(uf);
|
||||
if (err!=UNZ_OK)
|
||||
{
|
||||
printf("error %d with zipfile in unzGoToNextFile\n",err);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int do_extract_onefile(uf,filename,opt_extract_without_path,opt_overwrite)
|
||||
unzFile uf;
|
||||
const char* filename;
|
||||
int opt_extract_without_path;
|
||||
int opt_overwrite;
|
||||
{
|
||||
int err = UNZ_OK;
|
||||
if (unzLocateFile(uf,filename,CASESENSITIVITY)!=UNZ_OK)
|
||||
{
|
||||
printf("file %s not found in the zipfile\n",filename);
|
||||
return 2;
|
||||
}
|
||||
|
||||
if (do_extract_currentfile(uf,&opt_extract_without_path,
|
||||
&opt_overwrite) == UNZ_OK)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int main(argc,argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
const char *zipfilename=NULL;
|
||||
const char *filename_to_extract=NULL;
|
||||
int i;
|
||||
int opt_do_list=0;
|
||||
int opt_do_extract=1;
|
||||
int opt_do_extract_withoutpath=0;
|
||||
int opt_overwrite=0;
|
||||
char filename_try[512];
|
||||
unzFile uf=NULL;
|
||||
|
||||
do_banner();
|
||||
if (argc==1)
|
||||
{
|
||||
do_help();
|
||||
exit(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i=1;i<argc;i++)
|
||||
{
|
||||
if ((*argv[i])=='-')
|
||||
{
|
||||
const char *p=argv[i]+1;
|
||||
|
||||
while ((*p)!='\0')
|
||||
{
|
||||
char c=*(p++);;
|
||||
if ((c=='l') || (c=='L'))
|
||||
opt_do_list = 1;
|
||||
if ((c=='v') || (c=='V'))
|
||||
opt_do_list = 1;
|
||||
if ((c=='x') || (c=='X'))
|
||||
opt_do_extract = 1;
|
||||
if ((c=='e') || (c=='E'))
|
||||
opt_do_extract = opt_do_extract_withoutpath = 1;
|
||||
if ((c=='o') || (c=='O'))
|
||||
opt_overwrite=1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (zipfilename == NULL)
|
||||
zipfilename = argv[i];
|
||||
else if (filename_to_extract==NULL)
|
||||
filename_to_extract = argv[i] ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (zipfilename!=NULL)
|
||||
{
|
||||
strcpy(filename_try,zipfilename);
|
||||
uf = unzOpen(zipfilename);
|
||||
if (uf==NULL)
|
||||
{
|
||||
strcat(filename_try,".zip");
|
||||
uf = unzOpen(filename_try);
|
||||
}
|
||||
}
|
||||
|
||||
if (uf==NULL)
|
||||
{
|
||||
printf("Cannot open %s or %s.zip\n",zipfilename,zipfilename);
|
||||
exit (1);
|
||||
}
|
||||
printf("%s opened\n",filename_try);
|
||||
|
||||
if (opt_do_list==1)
|
||||
return do_list(uf);
|
||||
else if (opt_do_extract==1)
|
||||
{
|
||||
if (filename_to_extract == NULL)
|
||||
return do_extract(uf,opt_do_extract_withoutpath,opt_overwrite);
|
||||
else
|
||||
return do_extract_onefile(uf,filename_to_extract,
|
||||
opt_do_extract_withoutpath,opt_overwrite);
|
||||
}
|
||||
unzCloseCurrentFile(uf);
|
||||
|
||||
return 0; /* to avoid warning */
|
||||
}
|
||||
@@ -1,302 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifdef unix
|
||||
# include <unistd.h>
|
||||
# include <utime.h>
|
||||
# include <sys/types.h>
|
||||
# include <sys/stat.h>
|
||||
#else
|
||||
# include <direct.h>
|
||||
# include <io.h>
|
||||
#endif
|
||||
|
||||
#include "zip.h"
|
||||
|
||||
|
||||
#define WRITEBUFFERSIZE (16384)
|
||||
#define MAXFILENAME (256)
|
||||
|
||||
#ifdef WIN32
|
||||
uLong filetime(f, tmzip, dt)
|
||||
char *f; /* name of file to get info on */
|
||||
tm_zip *tmzip; /* return value: access, modific. and creation times */
|
||||
uLong *dt; /* dostime */
|
||||
{
|
||||
int ret = 0;
|
||||
{
|
||||
FILETIME ftLocal;
|
||||
HANDLE hFind;
|
||||
WIN32_FIND_DATA ff32;
|
||||
|
||||
hFind = FindFirstFile(f,&ff32);
|
||||
if (hFind != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
FileTimeToLocalFileTime(&(ff32.ftLastWriteTime),&ftLocal);
|
||||
FileTimeToDosDateTime(&ftLocal,((LPWORD)dt)+1,((LPWORD)dt)+0);
|
||||
FindClose(hFind);
|
||||
ret = 1;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
#ifdef unix
|
||||
uLong filetime(f, tmzip, dt)
|
||||
char *f; /* name of file to get info on */
|
||||
tm_zip *tmzip; /* return value: access, modific. and creation times */
|
||||
uLong *dt; /* dostime */
|
||||
{
|
||||
int ret=0;
|
||||
struct stat s; /* results of stat() */
|
||||
struct tm* filedate;
|
||||
time_t tm_t=0;
|
||||
|
||||
if (strcmp(f,"-")!=0)
|
||||
{
|
||||
char name[MAXFILENAME];
|
||||
int len = strlen(f);
|
||||
strcpy(name, f);
|
||||
if (name[len - 1] == '/')
|
||||
name[len - 1] = '\0';
|
||||
/* not all systems allow stat'ing a file with / appended */
|
||||
if (stat(name,&s)==0)
|
||||
{
|
||||
tm_t = s.st_mtime;
|
||||
ret = 1;
|
||||
}
|
||||
}
|
||||
filedate = localtime(&tm_t);
|
||||
|
||||
tmzip->tm_sec = filedate->tm_sec;
|
||||
tmzip->tm_min = filedate->tm_min;
|
||||
tmzip->tm_hour = filedate->tm_hour;
|
||||
tmzip->tm_mday = filedate->tm_mday;
|
||||
tmzip->tm_mon = filedate->tm_mon ;
|
||||
tmzip->tm_year = filedate->tm_year;
|
||||
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
uLong filetime(f, tmzip, dt)
|
||||
char *f; /* name of file to get info on */
|
||||
tm_zip *tmzip; /* return value: access, modific. and creation times */
|
||||
uLong *dt; /* dostime */
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
int check_exist_file(filename)
|
||||
const char* filename;
|
||||
{
|
||||
FILE* ftestexist;
|
||||
int ret = 1;
|
||||
ftestexist = fopen(filename,"rb");
|
||||
if (ftestexist==NULL)
|
||||
ret = 0;
|
||||
else
|
||||
fclose(ftestexist);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void do_banner()
|
||||
{
|
||||
printf("MiniZip 0.15, demo of zLib + Zip package written by Gilles Vollant\n");
|
||||
printf("more info at http://wwww.winimage/zLibDll/unzip.htm\n\n");
|
||||
}
|
||||
|
||||
void do_help()
|
||||
{
|
||||
printf("Usage : minizip [-o] file.zip [files_to_add]\n\n") ;
|
||||
}
|
||||
|
||||
int main(argc,argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
int i;
|
||||
int opt_overwrite=0;
|
||||
int opt_compress_level=Z_DEFAULT_COMPRESSION;
|
||||
int zipfilenamearg = 0;
|
||||
char filename_try[MAXFILENAME];
|
||||
int zipok;
|
||||
int err=0;
|
||||
int size_buf=0;
|
||||
void* buf=NULL,
|
||||
|
||||
|
||||
do_banner();
|
||||
if (argc==1)
|
||||
{
|
||||
do_help();
|
||||
exit(0);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i=1;i<argc;i++)
|
||||
{
|
||||
if ((*argv[i])=='-')
|
||||
{
|
||||
const char *p=argv[i]+1;
|
||||
|
||||
while ((*p)!='\0')
|
||||
{
|
||||
char c=*(p++);;
|
||||
if ((c=='o') || (c=='O'))
|
||||
opt_overwrite = 1;
|
||||
if ((c>='0') && (c<='9'))
|
||||
opt_compress_level = c-'0';
|
||||
}
|
||||
}
|
||||
else
|
||||
if (zipfilenamearg == 0)
|
||||
zipfilenamearg = i ;
|
||||
}
|
||||
}
|
||||
|
||||
size_buf = WRITEBUFFERSIZE;
|
||||
buf = (void*)malloc(size_buf);
|
||||
if (buf==NULL)
|
||||
{
|
||||
printf("Error allocating memory\n");
|
||||
return ZIP_INTERNALERROR;
|
||||
}
|
||||
|
||||
if (zipfilenamearg==0)
|
||||
zipok=0;
|
||||
else
|
||||
{
|
||||
int i,len;
|
||||
int dot_found=0;
|
||||
|
||||
zipok = 1 ;
|
||||
strcpy(filename_try,argv[zipfilenamearg]);
|
||||
len=strlen(filename_try);
|
||||
for (i=0;i<len;i++)
|
||||
if (filename_try[i]=='.')
|
||||
dot_found=1;
|
||||
|
||||
if (dot_found==0)
|
||||
strcat(filename_try,".zip");
|
||||
|
||||
if (opt_overwrite==0)
|
||||
if (check_exist_file(filename_try)!=0)
|
||||
{
|
||||
char rep;
|
||||
do
|
||||
{
|
||||
char answer[128];
|
||||
printf("The file %s exist. Overwrite ? [y]es, [n]o : ",filename_try);
|
||||
scanf("%1s",answer);
|
||||
rep = answer[0] ;
|
||||
if ((rep>='a') && (rep<='z'))
|
||||
rep -= 0x20;
|
||||
}
|
||||
while ((rep!='Y') && (rep!='N'));
|
||||
if (rep=='N')
|
||||
zipok = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (zipok==1)
|
||||
{
|
||||
zipFile zf;
|
||||
int errclose;
|
||||
zf = zipOpen(filename_try,0);
|
||||
if (zf == NULL)
|
||||
{
|
||||
printf("error opening %s\n",filename_try);
|
||||
err= ZIP_ERRNO;
|
||||
}
|
||||
else
|
||||
printf("creating %s\n",filename_try);
|
||||
|
||||
for (i=zipfilenamearg+1;(i<argc) && (err==ZIP_OK);i++)
|
||||
{
|
||||
if (((*(argv[i]))!='-') && ((*(argv[i]))!='/'))
|
||||
{
|
||||
FILE * fin;
|
||||
int size_read;
|
||||
const char* filenameinzip = argv[i];
|
||||
zip_fileinfo zi;
|
||||
|
||||
zi.tmz_date.tm_sec = zi.tmz_date.tm_min = zi.tmz_date.tm_hour =
|
||||
zi.tmz_date.tm_mday = zi.tmz_date.tm_min = zi.tmz_date.tm_year = 0;
|
||||
zi.dosDate = 0;
|
||||
zi.internal_fa = 0;
|
||||
zi.external_fa = 0;
|
||||
filetime(filenameinzip,&zi.tmz_date,&zi.dosDate);
|
||||
|
||||
|
||||
err = zipOpenNewFileInZip(zf,filenameinzip,&zi,
|
||||
NULL,0,NULL,0,NULL /* comment*/,
|
||||
(opt_compress_level != 0) ? Z_DEFLATED : 0,
|
||||
opt_compress_level);
|
||||
|
||||
if (err != ZIP_OK)
|
||||
printf("error in opening %s in zipfile\n",filenameinzip);
|
||||
else
|
||||
{
|
||||
fin = fopen(filenameinzip,"rb");
|
||||
if (fin==NULL)
|
||||
{
|
||||
err=ZIP_ERRNO;
|
||||
printf("error in opening %s for reading\n",filenameinzip);
|
||||
}
|
||||
}
|
||||
|
||||
if (err == ZIP_OK)
|
||||
do
|
||||
{
|
||||
err = ZIP_OK;
|
||||
size_read = fread(buf,1,size_buf,fin);
|
||||
if (size_read < size_buf)
|
||||
if (feof(fin)==0)
|
||||
{
|
||||
printf("error in reading %s\n",filenameinzip);
|
||||
err = ZIP_ERRNO;
|
||||
}
|
||||
|
||||
if (size_read>0)
|
||||
{
|
||||
err = zipWriteInFileInZip (zf,buf,size_read);
|
||||
if (err<0)
|
||||
{
|
||||
printf("error in writing %s in the zipfile\n",
|
||||
filenameinzip);
|
||||
}
|
||||
|
||||
}
|
||||
} while ((err == ZIP_OK) && (size_read>0));
|
||||
|
||||
fclose(fin);
|
||||
if (err<0)
|
||||
err=ZIP_ERRNO;
|
||||
else
|
||||
{
|
||||
err = zipCloseFileInZip(zf);
|
||||
if (err!=ZIP_OK)
|
||||
printf("error in closing %s in the zipfile\n",
|
||||
filenameinzip);
|
||||
}
|
||||
}
|
||||
}
|
||||
errclose = zipClose(zf,NULL);
|
||||
if (errclose != ZIP_OK)
|
||||
printf("error in closing %s\n",filename_try);
|
||||
}
|
||||
|
||||
free(buf);
|
||||
exit(0);
|
||||
return 0; /* to avoid warning */
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
|
||||
UnZip 0.15 additionnal library
|
||||
|
||||
|
||||
This unzip package allow extract file from .ZIP file, compatible with
|
||||
PKZip 2.04g, WinZip, InfoZip tools and compatible.
|
||||
|
||||
Multi volume ZipFile (span) are not supported, and old compression used by old
|
||||
PKZip 1.x are not supported.
|
||||
|
||||
See probdesc.zip from PKWare for specification of .ZIP format.
|
||||
|
||||
What is Unzip
|
||||
The Zlib library support the deflate compression and the creation of gzip (.gz)
|
||||
file. Zlib is free and small.
|
||||
The .Zip format, which can contain several compressed files (.gz can containt
|
||||
only one file) is a very popular format. This is why I've written a package for reading file compressed in Zipfile.
|
||||
|
||||
Using Unzip package
|
||||
|
||||
You need source of Zlib (get zlib111.zip and read zlib.h).
|
||||
Get unzlb015.zip and read unzip.h (whith documentation of unzip functions)
|
||||
|
||||
The Unzip package is only two file : unzip.h and unzip.c. But it use the Zlib
|
||||
files.
|
||||
unztst.c is a simple sample program, which list file in a zipfile and display
|
||||
README.TXT or FILE_ID.DIZ (if these files are found).
|
||||
miniunz.c is a mini unzip program.
|
||||
|
||||
I'm also currenlyt writing a zipping portion (zip.h, zip.c and test with minizip.c)
|
||||
|
||||
Please email me for feedback.
|
||||
I hope my source is compatible with Unix system, but I need your help for be sure
|
||||
|
||||
Latest revision : Mar 04th, 1998
|
||||
|
||||
Check http://www.winimage.com/zLibDll/unzip.html for up to date info.
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,15 +0,0 @@
|
||||
unzOpen @61
|
||||
unzClose @62
|
||||
unzGetGlobalInfo @63
|
||||
unzGetCurrentFileInfo @64
|
||||
unzGoToFirstFile @65
|
||||
unzGoToNextFile @66
|
||||
unzOpenCurrentFile @67
|
||||
unzReadCurrentFile @68
|
||||
unztell @70
|
||||
unzeof @71
|
||||
unzCloseCurrentFile @72
|
||||
unzGetGlobalComment @73
|
||||
unzStringFileNameCompare @74
|
||||
unzLocateFile @75
|
||||
unzGetLocalExtrafield @76
|
||||
@@ -1,275 +0,0 @@
|
||||
/* unzip.h -- IO for uncompress .zip files using zlib
|
||||
Version 0.15 beta, Mar 19th, 1998,
|
||||
|
||||
Copyright (C) 1998 Gilles Vollant
|
||||
|
||||
This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g
|
||||
WinZip, InfoZip tools and compatible.
|
||||
Encryption and multi volume ZipFile (span) are not supported.
|
||||
Old compressions used by old PKZip 1.x are not supported
|
||||
|
||||
THIS IS AN ALPHA VERSION. AT THIS STAGE OF DEVELOPPEMENT, SOMES API OR STRUCTURE
|
||||
CAN CHANGE IN FUTURE VERSION !!
|
||||
I WAIT FEEDBACK at mail info@winimage.com
|
||||
Visit also http://www.winimage.com/zLibDll/unzip.htm for evolution
|
||||
|
||||
Condition of use and distribution are the same than zlib :
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
|
||||
*/
|
||||
/* for more info about .ZIP format, see
|
||||
ftp://ftp.cdrom.com/pub/infozip/doc/appnote-970311-iz.zip
|
||||
PkWare has also a specification at :
|
||||
ftp://ftp.pkware.com/probdesc.zip */
|
||||
|
||||
#ifndef _unz_H
|
||||
#define _unz_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef _ZLIB_H
|
||||
#include "zlib.h"
|
||||
#endif
|
||||
|
||||
#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
|
||||
/* like the STRICT of WIN32, we define a pointer that cannot be converted
|
||||
from (void*) without cast */
|
||||
typedef struct TagunzFile__ { int unused; } unzFile__;
|
||||
typedef unzFile__ *unzFile;
|
||||
#else
|
||||
typedef voidp unzFile;
|
||||
#endif
|
||||
|
||||
|
||||
#define UNZ_OK (0)
|
||||
#define UNZ_END_OF_LIST_OF_FILE (-100)
|
||||
#define UNZ_ERRNO (Z_ERRNO)
|
||||
#define UNZ_EOF (0)
|
||||
#define UNZ_PARAMERROR (-102)
|
||||
#define UNZ_BADZIPFILE (-103)
|
||||
#define UNZ_INTERNALERROR (-104)
|
||||
#define UNZ_CRCERROR (-105)
|
||||
|
||||
/* tm_unz contain date/time info */
|
||||
typedef struct tm_unz_s
|
||||
{
|
||||
uInt tm_sec; /* seconds after the minute - [0,59] */
|
||||
uInt tm_min; /* minutes after the hour - [0,59] */
|
||||
uInt tm_hour; /* hours since midnight - [0,23] */
|
||||
uInt tm_mday; /* day of the month - [1,31] */
|
||||
uInt tm_mon; /* months since January - [0,11] */
|
||||
uInt tm_year; /* years - [1980..2044] */
|
||||
} tm_unz;
|
||||
|
||||
/* unz_global_info structure contain global data about the ZIPfile
|
||||
These data comes from the end of central dir */
|
||||
typedef struct unz_global_info_s
|
||||
{
|
||||
uLong number_entry; /* total number of entries in
|
||||
the central dir on this disk */
|
||||
uLong size_comment; /* size of the global comment of the zipfile */
|
||||
} unz_global_info;
|
||||
|
||||
|
||||
/* unz_file_info contain information about a file in the zipfile */
|
||||
typedef struct unz_file_info_s
|
||||
{
|
||||
uLong version; /* version made by 2 bytes */
|
||||
uLong version_needed; /* version needed to extract 2 bytes */
|
||||
uLong flag; /* general purpose bit flag 2 bytes */
|
||||
uLong compression_method; /* compression method 2 bytes */
|
||||
uLong dosDate; /* last mod file date in Dos fmt 4 bytes */
|
||||
uLong crc; /* crc-32 4 bytes */
|
||||
uLong compressed_size; /* compressed size 4 bytes */
|
||||
uLong uncompressed_size; /* uncompressed size 4 bytes */
|
||||
uLong size_filename; /* filename length 2 bytes */
|
||||
uLong size_file_extra; /* extra field length 2 bytes */
|
||||
uLong size_file_comment; /* file comment length 2 bytes */
|
||||
|
||||
uLong disk_num_start; /* disk number start 2 bytes */
|
||||
uLong internal_fa; /* internal file attributes 2 bytes */
|
||||
uLong external_fa; /* external file attributes 4 bytes */
|
||||
|
||||
tm_unz tmu_date;
|
||||
} unz_file_info;
|
||||
|
||||
extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1,
|
||||
const char* fileName2,
|
||||
int iCaseSensitivity));
|
||||
/*
|
||||
Compare two filename (fileName1,fileName2).
|
||||
If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
|
||||
If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
|
||||
or strcasecmp)
|
||||
If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
|
||||
(like 1 on Unix, 2 on Windows)
|
||||
*/
|
||||
|
||||
|
||||
extern unzFile ZEXPORT unzOpen OF((const char *path));
|
||||
/*
|
||||
Open a Zip file. path contain the full pathname (by example,
|
||||
on a Windows NT computer "c:\\zlib\\zlib111.zip" or on an Unix computer
|
||||
"zlib/zlib111.zip".
|
||||
If the zipfile cannot be opened (file don't exist or in not valid), the
|
||||
return value is NULL.
|
||||
Else, the return value is a unzFile Handle, usable with other function
|
||||
of this unzip package.
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzClose OF((unzFile file));
|
||||
/*
|
||||
Close a ZipFile opened with unzipOpen.
|
||||
If there is files inside the .Zip opened with unzOpenCurrentFile (see later),
|
||||
these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
|
||||
return UNZ_OK if there is no problem. */
|
||||
|
||||
extern int ZEXPORT unzGetGlobalInfo OF((unzFile file,
|
||||
unz_global_info *pglobal_info));
|
||||
/*
|
||||
Write info about the ZipFile in the *pglobal_info structure.
|
||||
No preparation of the structure is needed
|
||||
return UNZ_OK if there is no problem. */
|
||||
|
||||
|
||||
extern int ZEXPORT unzGetGlobalComment OF((unzFile file,
|
||||
char *szComment,
|
||||
uLong uSizeBuf));
|
||||
/*
|
||||
Get the global comment string of the ZipFile, in the szComment buffer.
|
||||
uSizeBuf is the size of the szComment buffer.
|
||||
return the number of byte copied or an error code <0
|
||||
*/
|
||||
|
||||
|
||||
/***************************************************************************/
|
||||
/* Unzip package allow you browse the directory of the zipfile */
|
||||
|
||||
extern int ZEXPORT unzGoToFirstFile OF((unzFile file));
|
||||
/*
|
||||
Set the current file of the zipfile to the first file.
|
||||
return UNZ_OK if there is no problem
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzGoToNextFile OF((unzFile file));
|
||||
/*
|
||||
Set the current file of the zipfile to the next file.
|
||||
return UNZ_OK if there is no problem
|
||||
return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzLocateFile OF((unzFile file,
|
||||
const char *szFileName,
|
||||
int iCaseSensitivity));
|
||||
/*
|
||||
Try locate the file szFileName in the zipfile.
|
||||
For the iCaseSensitivity signification, see unzStringFileNameCompare
|
||||
|
||||
return value :
|
||||
UNZ_OK if the file is found. It becomes the current file.
|
||||
UNZ_END_OF_LIST_OF_FILE if the file is not found
|
||||
*/
|
||||
|
||||
|
||||
extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file,
|
||||
unz_file_info *pfile_info,
|
||||
char *szFileName,
|
||||
uLong fileNameBufferSize,
|
||||
void *extraField,
|
||||
uLong extraFieldBufferSize,
|
||||
char *szComment,
|
||||
uLong commentBufferSize));
|
||||
/*
|
||||
Get Info about the current file
|
||||
if pfile_info!=NULL, the *pfile_info structure will contain somes info about
|
||||
the current file
|
||||
if szFileName!=NULL, the filemane string will be copied in szFileName
|
||||
(fileNameBufferSize is the size of the buffer)
|
||||
if extraField!=NULL, the extra field information will be copied in extraField
|
||||
(extraFieldBufferSize is the size of the buffer).
|
||||
This is the Central-header version of the extra field
|
||||
if szComment!=NULL, the comment string of the file will be copied in szComment
|
||||
(commentBufferSize is the size of the buffer)
|
||||
*/
|
||||
|
||||
/***************************************************************************/
|
||||
/* for reading the content of the current zipfile, you can open it, read data
|
||||
from it, and close it (you can close it before reading all the file)
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzOpenCurrentFile OF((unzFile file));
|
||||
/*
|
||||
Open for reading data the current file in the zipfile.
|
||||
If there is no error, the return value is UNZ_OK.
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzCloseCurrentFile OF((unzFile file));
|
||||
/*
|
||||
Close the file in zip opened with unzOpenCurrentFile
|
||||
Return UNZ_CRCERROR if all the file was read but the CRC is not good
|
||||
*/
|
||||
|
||||
|
||||
extern int ZEXPORT unzReadCurrentFile OF((unzFile file,
|
||||
voidp buf,
|
||||
unsigned len));
|
||||
/*
|
||||
Read bytes from the current file (opened by unzOpenCurrentFile)
|
||||
buf contain buffer where data must be copied
|
||||
len the size of buf.
|
||||
|
||||
return the number of byte copied if somes bytes are copied
|
||||
return 0 if the end of file was reached
|
||||
return <0 with error code if there is an error
|
||||
(UNZ_ERRNO for IO error, or zLib error for uncompress error)
|
||||
*/
|
||||
|
||||
extern z_off_t ZEXPORT unztell OF((unzFile file));
|
||||
/*
|
||||
Give the current position in uncompressed data
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzeof OF((unzFile file));
|
||||
/*
|
||||
return 1 if the end of file was reached, 0 elsewhere
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file,
|
||||
voidp buf,
|
||||
unsigned len));
|
||||
/*
|
||||
Read extra field from the current file (opened by unzOpenCurrentFile)
|
||||
This is the local-header version of the extra field (sometimes, there is
|
||||
more info in the local-header version than in the central-header)
|
||||
|
||||
if buf==NULL, it return the size of the local extra field
|
||||
|
||||
if buf!=NULL, len is the size of the buffer, the extra header is copied in
|
||||
buf.
|
||||
the return value is the number of bytes copied in buf, or (if <0)
|
||||
the error code
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _unz_H */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user