Compare commits
2415 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
972156d595 | ||
|
|
09b729b328 | ||
|
|
91cea699bb | ||
|
|
d6be9725c9 | ||
|
|
6a290814ae | ||
|
|
38c4489ef0 | ||
|
|
9a3d76d0ca | ||
|
|
9d89e72a5c | ||
|
|
eb89b33d39 | ||
|
|
23b12e29a2 | ||
|
|
ad0b58fe83 | ||
|
|
f2de719cfe | ||
|
|
3c55fcbc13 | ||
|
|
de57a53027 | ||
|
|
3bc6d7df06 | ||
|
|
d1df256de9 | ||
|
|
7df45744ad | ||
|
|
5a0585359d | ||
|
|
4ac7206c6f | ||
|
|
1f6e0c8fa6 | ||
|
|
95513e73da | ||
|
|
4505b4a30a | ||
|
|
f5cfab17d6 | ||
|
|
46e7c7a920 | ||
|
|
702d90b6fe | ||
|
|
3357fcb24a | ||
|
|
47e47cfdd6 | ||
|
|
3045d2870b | ||
|
|
298b41b523 | ||
|
|
57bab02d57 | ||
|
|
ccdc3ff73f | ||
|
|
8ea66915f2 | ||
| af18db5668 | |||
| 5f59a986e2 | |||
| b7ef8cfb52 | |||
|
|
b7ea9f3fd1 | ||
|
|
3de9b14567 | ||
| c31c70743a | |||
| 7104bb23a9 | |||
| 06f3970b9e | |||
| 5debab0eb0 | |||
| 059578953d | |||
| 3a19ae756f | |||
| 2c96f0541b | |||
| 252a83f614 | |||
| a8d553408d | |||
|
|
db8c1ee9d0 | ||
|
|
e3e5cf6d34 | ||
|
|
b6d285faba | ||
|
|
08cb986d3f | ||
|
|
e641d42a37 | ||
|
|
5139afee6b | ||
|
|
1999c518b6 | ||
|
|
fc1c7a3483 | ||
|
|
eabd612b15 | ||
|
|
40b67629c5 | ||
|
|
da26ee9d09 | ||
|
|
b9cb8440d7 | ||
|
|
866355d930 | ||
|
|
06e2adbeaa | ||
|
|
cb87646dac | ||
|
|
df0c35f0f5 | ||
|
|
fb4b3da7da | ||
|
|
fe892c5e66 | ||
|
|
31c6dc292d | ||
|
|
a5f7ba46f5 | ||
|
|
fe45ee7ed0 | ||
|
|
e52ecfbf5d | ||
|
|
b3250450fe | ||
|
|
dad3b4e8c8 | ||
|
|
264c20159d | ||
|
|
1a60a84cb7 | ||
|
|
c96cd5e1a0 | ||
|
|
0968a93748 | ||
|
|
042ecb4231 | ||
|
|
8ebdbed79c | ||
| 3e1db26a5a | |||
| f9f6c9251a | |||
| 96836647f8 | |||
|
|
bdcbfa90ca | ||
|
|
a348d0ed4f | ||
|
|
b180f32ab3 | ||
|
|
306f3ccd6f | ||
|
|
28b81f9c3b | ||
|
|
65fdb4cffe | ||
|
|
eddc5dd581 | ||
|
|
d19844d69c | ||
|
|
a27b60af75 | ||
|
|
ac11e38fd5 | ||
|
|
a58c735738 | ||
|
|
dcff984d6a | ||
|
|
4c6c911fdc | ||
| f0a513440d | |||
|
|
1bbba6353d | ||
| b1c4ba4ab6 | |||
| b86af8be0b | |||
| 13c63491af | |||
| ebae0113f8 | |||
|
|
86466eaa18 | ||
|
|
1cd76c7513 | ||
|
|
287c0e3b92 | ||
|
|
c096911b97 | ||
|
|
e9a6abd046 | ||
| 22aad3f26b | |||
| 0ac803292e | |||
| 77399bd649 | |||
| 44bedb31d8 | |||
| f5435c74b7 | |||
| e8235bc09a | |||
| 2bc7c627ac | |||
| 71c7dcb9ce | |||
| 927829ed36 | |||
| 22e69f558e | |||
| 0c3ae37f52 | |||
| f14fb60209 | |||
| f6aac1c3b5 | |||
| be89757ef5 | |||
|
|
65c5a092c1 | ||
|
|
aacce8f40c | ||
|
|
bdfef53dbf | ||
|
|
aa521228a5 | ||
|
|
c77228c77b | ||
|
|
aa3623d873 | ||
|
|
ea8ff9284a | ||
|
|
625f4ae4a3 | ||
|
|
23c5f56e32 | ||
|
|
93103f497f | ||
|
|
3de8d1cf6e | ||
|
|
7c8b3ddfed | ||
|
|
ecf9b40841 | ||
|
|
a5f09d5196 | ||
|
|
4c3a751f9b | ||
|
|
ffdb12bc9b | ||
|
|
715aecd7e8 | ||
|
|
017ce5a503 | ||
|
|
604046faf3 | ||
|
|
b258ab0e66 | ||
|
|
51a3e84a97 | ||
|
|
7f1018b145 | ||
|
|
75c515e5f8 | ||
|
|
09895f86fc | ||
|
|
5e3b51ba96 | ||
|
|
9ee8c2c75f | ||
|
|
c0c581a635 | ||
|
|
fce5ff6513 | ||
|
|
f26ce0ba44 | ||
|
|
73d95c770f | ||
|
|
d36ce68582 | ||
|
|
0c1b8ba3c3 | ||
|
|
125fc7a918 | ||
|
|
59ff758441 | ||
|
|
29edcad310 | ||
| cee2d9a296 | |||
| 2dc480bd58 | |||
|
|
8aeac26999 | ||
|
|
faa032f15c | ||
|
|
e286ccc05b | ||
|
|
f44fb1784b | ||
|
|
d8e600db17 | ||
|
|
53f1f3e4a8 | ||
|
|
59ba14bb1d | ||
|
|
11184894e2 | ||
|
|
1915403ff6 | ||
| 8e5df35e84 | |||
| 6e0ed9c90c | |||
| c75851fccb | |||
| d71cc7b9f6 | |||
| 0fbbaa43e9 | |||
| a7ab29bf57 | |||
| 456a46e6bf | |||
| 95d6c86c51 | |||
| 100babf0e0 | |||
| 73817adec0 | |||
| 7faf801d1f | |||
| a83e3a14fe | |||
|
|
ec10840b9e | ||
|
|
f4737c94ee | ||
|
|
3027cf8694 | ||
|
|
766047123a | ||
|
|
130b082121 | ||
|
|
179261a9b6 | ||
| 9f7fb97000 | |||
| 3ba3608c5f | |||
|
|
b73a0e570b | ||
|
|
c65ac3136e | ||
| 9584051449 | |||
|
|
ac7451d11b | ||
|
|
c248e23d93 | ||
|
|
d9f4f71916 | ||
|
|
de83b2a9d9 | ||
|
|
d67db9b39c | ||
| 9903b9fb96 | |||
| b0814fec4e | |||
|
|
bcbee7d9e1 | ||
|
|
57c748b968 | ||
| 4a711bea63 | |||
|
|
22fa466268 | ||
| 0181ec6beb | |||
| 420b1799d9 | |||
| ad85a577a6 | |||
| 0e33224aa2 | |||
|
|
6e535c3aaf | ||
|
|
05fddc7d36 | ||
|
|
15e5aba748 | ||
|
|
a89ec8bc3b | ||
|
|
2d43bf5807 | ||
|
|
d27f8afc45 | ||
|
|
10f30159a9 | ||
|
|
dedb53fb10 | ||
| 54624a62f1 | |||
| 53da2c9940 | |||
| 2f5c1ee87d | |||
| a020815b8b | |||
| 8335a475fc | |||
|
|
b8a678ef1d | ||
| 6227378147 | |||
| 6ee158d26a | |||
|
|
b84b829e35 | ||
| c7c2299cbe | |||
| cd554e7284 | |||
| 7d73223f08 | |||
| d19d7d58aa | |||
| 9152e1c5a7 | |||
| bdb3f57135 | |||
| e415d48872 | |||
| dba3562d78 | |||
| e1c1f5bfd9 | |||
|
|
7dd286e6b8 | ||
|
|
2773b5efb7 | ||
|
|
14e470be81 | ||
|
|
ed23a7a7d2 | ||
|
|
badec36b33 | ||
|
|
6cf98dbe00 | ||
|
|
3771a0833d | ||
|
|
b1da7fafd0 | ||
|
|
ff84d11216 | ||
|
|
3e4db5ee55 | ||
|
|
ba05f39d1e | ||
|
|
77b6e2dcaa | ||
|
|
6463554619 | ||
|
|
960c93c6f7 | ||
|
|
9d9a90c118 | ||
|
|
ca2255201b | ||
|
|
ba468a6052 | ||
|
|
253b6e965c | ||
|
|
cf6fa5ad92 | ||
|
|
62aac7f191 | ||
|
|
71d5865b10 | ||
| 7f007284e6 | |||
|
|
196021cd82 | ||
|
|
f1b9e8249b | ||
|
|
b01e9ebfdb | ||
|
|
aeda8e5c7b | ||
|
|
87de141141 | ||
|
|
aefc6db005 | ||
| 0ab81d2491 | |||
| 85fee539f4 | |||
| 6ab1df59f6 | |||
|
|
a8ef09103d | ||
|
|
7dd6189cc7 | ||
|
|
bd3cde4571 | ||
| 280d8c668e | |||
|
|
9a5aca794e | ||
| 23a61ee0eb | |||
| ece05d227f | |||
| 265d9b456d | |||
|
|
de291cdb60 | ||
|
|
23907fa712 | ||
|
|
a459232eed | ||
|
|
cc6895f6c6 | ||
|
|
de58c13271 | ||
|
|
77d964e574 | ||
|
|
01de9eddd6 | ||
|
|
638cb5b3c2 | ||
|
|
21e6836bb7 | ||
|
|
0075a21504 | ||
|
|
870f6d08af | ||
|
|
3399c2c966 | ||
|
|
ab12636b79 | ||
|
|
ceefd434f1 | ||
|
|
3fab01cdb2 | ||
|
|
2d5f58d5ef | ||
|
|
8de781761f | ||
|
|
2e26c872c4 | ||
|
|
d2be2e7b41 | ||
|
|
46fca87456 | ||
|
|
e12fdad66d | ||
|
|
d21a633ffb | ||
|
|
d343041caa | ||
|
|
fd4ddef49a | ||
|
|
9733fcdb43 | ||
|
|
52cf951fdc | ||
|
|
420dfe1145 | ||
|
|
ee99bb81b9 | ||
|
|
39393e7046 | ||
|
|
49246fcdd5 | ||
|
|
4fda063232 | ||
|
|
471a03a362 | ||
|
|
e35c4f78d2 | ||
|
|
7e1074732b | ||
|
|
be81e4ec74 | ||
|
|
c595699ca7 | ||
|
|
2cdbb3041d | ||
|
|
362e4c37a1 | ||
|
|
bf33a1c097 | ||
|
|
d8a89dcbe6 | ||
|
|
0617743bd1 | ||
|
|
e61268c454 | ||
|
|
a458e9d00d | ||
|
|
2d72cbec41 | ||
|
|
629829e69c | ||
|
|
8a3b6ca3bb | ||
|
|
b16aacc7f3 | ||
|
|
b6aab00c37 | ||
|
|
6cb94cc91b | ||
|
|
bc4c07f4f1 | ||
|
|
60014efb3e | ||
|
|
25817b0854 | ||
|
|
24776434f5 | ||
|
|
7047e014c9 | ||
|
|
fe6e291f59 | ||
|
|
aa82e375c6 | ||
|
|
d526f1a0db | ||
|
|
ddf1981004 | ||
|
|
ed1af3c86c | ||
|
|
16c3870b2e | ||
|
|
0d1f2e6be2 | ||
|
|
19e6dad47b | ||
|
|
6d7b770761 | ||
|
|
2cb560297c | ||
|
|
8821c73a9e | ||
|
|
6410f4b5db | ||
|
|
d3d8c30c2e | ||
|
|
c087a60ed2 | ||
|
|
8152b3ac4c | ||
|
|
edefb7b35f | ||
|
|
3881e732a9 | ||
|
|
992799b91f | ||
|
|
7c9e3e24d7 | ||
|
|
4eca12cde5 | ||
|
|
17e41d3081 | ||
|
|
373cb6526c | ||
|
|
df3975243b | ||
|
|
c9f644bd68 | ||
|
|
4fbdf1946d | ||
|
|
66ef912042 | ||
|
|
2fbc9b274b | ||
|
|
0e83262042 | ||
|
|
41df1b59f1 | ||
|
|
087ace4459 | ||
|
|
2a0e9af32f | ||
|
|
3c57102616 | ||
|
|
6b97790a38 | ||
|
|
6a83cf3e70 | ||
|
|
053fa581b5 | ||
|
|
860224a4d4 | ||
|
|
fd43d93ce5 | ||
|
|
9a9d555f56 | ||
|
|
e4ac80eb60 | ||
|
|
2af02e0d5d | ||
|
|
41ab295654 | ||
|
|
201031fb38 | ||
|
|
9821bbf780 | ||
|
|
ca216b3d97 | ||
|
|
caa7efa117 | ||
|
|
7ca1ce7968 | ||
|
|
fc9b3f9bdd | ||
|
|
c78b56a9e5 | ||
|
|
a57a591f25 | ||
|
|
d69cc76e03 | ||
|
|
8e116b71a1 | ||
|
|
0b5c2a058c | ||
|
|
c0aa9bf6ed | ||
|
|
cf9a4ec79b | ||
|
|
5456f2728e | ||
|
|
4aec9db571 | ||
|
|
bc404a9401 | ||
|
|
533f61249b | ||
|
|
93eadc7040 | ||
|
|
697f0d097f | ||
|
|
263ec1e885 | ||
|
|
cdfb5ab81f | ||
|
|
ed9152a1a3 | ||
|
|
31d8526346 | ||
|
|
ad898517ac | ||
|
|
fbd456ee2b | ||
|
|
caa798bbe1 | ||
|
|
90f82bb33e | ||
|
|
445f634a90 | ||
|
|
7fcec4ef61 | ||
|
|
65a87d5bcb | ||
|
|
fbad9eaf95 | ||
|
|
3131ad3154 | ||
|
|
10cbc9bd11 | ||
|
|
ad95bad8f7 | ||
|
|
378164d359 | ||
|
|
ebc85e54c4 | ||
|
|
49aed1ad97 | ||
|
|
be87fdda3d | ||
|
|
aa5531fc67 | ||
|
|
fd8c6c1d30 | ||
|
|
8c5d506b8a | ||
|
|
b3f47f5835 | ||
|
|
0ae2e2df94 | ||
|
|
fc42f78836 | ||
|
|
cff95276d9 | ||
|
|
2289c91010 | ||
|
|
431cd9f69c | ||
|
|
c984359bb0 | ||
|
|
4f877afeb6 | ||
|
|
6199f090c8 | ||
|
|
6e3824d78b | ||
|
|
ab6e62a523 | ||
|
|
19ffad7692 | ||
|
|
6723dcfab7 | ||
|
|
5919360736 | ||
|
|
2d20088881 | ||
|
|
9c7bae4e16 | ||
|
|
d18f3a9bc9 | ||
|
|
5909c8ba20 | ||
|
|
90e2b939ab | ||
|
|
e34f611be3 | ||
|
|
ee71bbbcb5 | ||
|
|
0b30c0a1bb | ||
|
|
55c3f4800e | ||
|
|
db7a45926b | ||
|
|
da915d36b7 | ||
|
|
0ae9652177 | ||
|
|
d75ef5a05c | ||
|
|
85edabcb42 | ||
|
|
66dbf73049 | ||
|
|
f6b0d662b5 | ||
|
|
48237f1730 | ||
|
|
6c597561bc | ||
|
|
238a9a057b | ||
|
|
ca085c16ef | ||
|
|
c21503bdf8 | ||
|
|
1c480f749a | ||
|
|
fa9199e049 | ||
|
|
b6ea15115c | ||
|
|
53a947167c | ||
|
|
11084d94e6 | ||
|
|
6ded58b510 | ||
|
|
8caec1b57b | ||
|
|
86344bb535 | ||
|
|
0b4c154160 | ||
|
|
e0742978f1 | ||
|
|
49d4116100 | ||
|
|
963a10e15a | ||
|
|
0d3ccd8908 | ||
|
|
fd60f03129 | ||
|
|
06f49fe167 | ||
|
|
cbcdb838f1 | ||
|
|
77dbd766c1 | ||
|
|
1d48c0148e | ||
|
|
50e2064049 | ||
|
|
cfe1ed4df4 | ||
|
|
c6a2f353c3 | ||
|
|
c4d9681327 | ||
|
|
30b5c227e9 | ||
|
|
1fb60d0811 | ||
|
|
c9b3bd9d45 | ||
|
|
c755b5784a | ||
|
|
101b99bc77 | ||
|
|
ed993cd557 | ||
|
|
08f8084a21 | ||
|
|
c3db1c6939 | ||
|
|
8d1c219676 | ||
|
|
f26d79e0ff | ||
|
|
c58712f0f0 | ||
|
|
6a6b7b5769 | ||
|
|
3f40eb3511 | ||
|
|
e3209ae766 | ||
|
|
f8c6b27b69 | ||
|
|
1906a5b9b4 | ||
|
|
ace9a62765 | ||
|
|
4725854459 | ||
|
|
305dacf6ea | ||
|
|
6759b24c57 | ||
|
|
eecd451343 | ||
|
|
b15f6fdf41 | ||
|
|
a55f435a36 | ||
|
|
cb1418a5e1 | ||
|
|
9b7938d815 | ||
|
|
5b91b11b9c | ||
|
|
4bb9af63c6 | ||
|
|
39dfb2bc55 | ||
|
|
aab6eb7615 | ||
|
|
791aa4e16f | ||
|
|
bb226763a0 | ||
|
|
a82a56d788 | ||
|
|
4def69f293 | ||
|
|
891c812cba | ||
|
|
966cbef4fd | ||
|
|
b2731fd668 | ||
|
|
c8a0e2f4c6 | ||
|
|
2ed11343a6 | ||
|
|
ff555cdea6 | ||
|
|
9d04c193d2 | ||
|
|
d433a56288 | ||
|
|
0b2db08aec | ||
|
|
2e2caf5919 | ||
|
|
357f105029 | ||
|
|
4a17663c14 | ||
|
|
18a5822eff | ||
|
|
5ea9e707be | ||
|
|
a23f4844ba | ||
|
|
be9962e21f | ||
|
|
7f99f3a293 | ||
|
|
9b58157579 | ||
|
|
03ea1c1676 | ||
|
|
f09c2e014f | ||
|
|
f93afa00e9 | ||
|
|
657168fa10 | ||
|
|
d1301b26b3 | ||
|
|
5daf8dbb89 | ||
|
|
acac1f2fda | ||
|
|
4b94e52787 | ||
|
|
0bcc4c15c9 | ||
|
|
d0c7c2a5d2 | ||
|
|
835f680238 | ||
|
|
991c41db8f | ||
|
|
eccb5d51f2 | ||
|
|
67ff0d71ed | ||
|
|
56f6a77ead | ||
|
|
7da8d39c06 | ||
|
|
50e870c530 | ||
|
|
ed4df03113 | ||
|
|
bfacef76c5 | ||
|
|
a8f6f3ebc9 | ||
|
|
3baaafe113 | ||
|
|
c735b0bb2c | ||
|
|
c2c39af6bb | ||
|
|
25ae53b165 | ||
|
|
207e4d2a71 | ||
|
|
d642d5508f | ||
|
|
0fb2f83da9 | ||
|
|
0e35eb0c6b | ||
|
|
7750657783 | ||
|
|
6417d3e064 | ||
|
|
51a9903002 | ||
|
|
ade7dc8ded | ||
|
|
6b8821515d | ||
|
|
2bfeeed885 | ||
|
|
85ff5a947e | ||
|
|
5e38c802d8 | ||
|
|
769af57274 | ||
|
|
040362e379 | ||
|
|
41b869d4d6 | ||
|
|
ee4016155e | ||
|
|
1daf36038c | ||
|
|
c2d5e01042 | ||
|
|
910a0e1093 | ||
|
|
8c434cf24f | ||
|
|
ad0db93247 | ||
|
|
3803c55856 | ||
|
|
cd47780252 | ||
|
|
c0ef4c4956 | ||
|
|
73379f0be5 | ||
|
|
cfb2d7bca5 | ||
|
|
b611e4c226 | ||
|
|
1817f7fc07 | ||
|
|
f004a0a980 | ||
|
|
543adbed3a | ||
|
|
76092ddf33 | ||
|
|
068d443d12 | ||
|
|
b6ff38065f | ||
|
|
7b81254069 | ||
|
|
db8198d99d | ||
|
|
96bbc5da3e | ||
|
|
755102d67f | ||
|
|
b41df2eb0d | ||
|
|
c662389d25 | ||
|
|
0c11190cdc | ||
|
|
26f817243b | ||
|
|
1e78879f1e | ||
|
|
2720b68f1b | ||
|
|
a149be43fc | ||
|
|
093c949274 | ||
|
|
861bb4e571 | ||
|
|
ed21b54203 | ||
|
|
3945cfbfd3 | ||
|
|
b332803b6f | ||
|
|
5086f1b2a1 | ||
|
|
53f94f8ed4 | ||
|
|
0c8e5ecc2e | ||
|
|
4b999f1962 | ||
|
|
53002f6f6c | ||
|
|
927b9ef243 | ||
|
|
7daa6a6054 | ||
|
|
6659ae1fc3 | ||
|
|
d729ecb11b | ||
|
|
26ec619a30 | ||
|
|
e292ba487e | ||
|
|
ca7a466f48 | ||
|
|
933120b0b1 | ||
|
|
e1a73469c8 | ||
|
|
c2bb739760 | ||
|
|
91a38b6d4e | ||
|
|
b956493367 | ||
|
|
defe329519 | ||
|
|
8dd0880985 | ||
|
|
0d63d9e125 | ||
|
|
8ae9987dca | ||
|
|
f571466c56 | ||
|
|
8f55767619 | ||
|
|
99866db8cd | ||
|
|
1e2b3f4326 | ||
|
|
e83f7ba2c9 | ||
|
|
b02992f0c1 | ||
|
|
511c977f93 | ||
|
|
b480472a76 | ||
|
|
660e15b2d1 | ||
|
|
1c7885f932 | ||
|
|
a2d1372680 | ||
|
|
928d76dbe8 | ||
|
|
bb4d055fa6 | ||
|
|
ef7b484e5c | ||
|
|
09b327b042 | ||
|
|
060399d9dd | ||
|
|
6aa61efd09 | ||
|
|
ef01931f76 | ||
|
|
adb4e9428a | ||
|
|
29a24b06a3 | ||
|
|
4eddbf774c | ||
|
|
8c4cdbd3c5 | ||
|
|
18f3961189 | ||
|
|
fa805ebd1e | ||
|
|
1972ccefae | ||
|
|
638ce89250 | ||
|
|
75839b75a1 | ||
|
|
d0b2856430 | ||
|
|
b0666ba6b6 | ||
|
|
5ab87a6c38 | ||
|
|
1e399dd8bd | ||
|
|
36db008cb5 | ||
|
|
3f775404d9 | ||
|
|
a5190194a0 | ||
|
|
a63151d3f8 | ||
|
|
4de51eedad | ||
|
|
4f78dfcabc | ||
|
|
9cca9d7566 | ||
|
|
204ae72525 | ||
|
|
f22864c24e | ||
|
|
23df780120 | ||
|
|
db242ed39d | ||
|
|
7336a67dfe | ||
|
|
6a73e85ad1 | ||
|
|
cf720a028a | ||
|
|
b91295a8d2 | ||
|
|
c729ff0050 | ||
|
|
186a4db672 | ||
|
|
70abb127cc | ||
|
|
2a395dd8b4 | ||
|
|
08af3f672b | ||
|
|
5737b690dc | ||
|
|
f140910d3c | ||
|
|
91a1d11c11 | ||
|
|
6af9856d4a | ||
|
|
9290237811 | ||
|
|
72eca0eb1e | ||
|
|
24f1e18846 | ||
|
|
7e81b07cc5 | ||
|
|
d65f6f7009 | ||
|
|
6cdfedc12c | ||
|
|
9e56468d6c | ||
|
|
e8d2d2f6b6 | ||
|
|
0438b62014 | ||
|
|
ffaae26145 | ||
|
|
d395035160 | ||
|
|
457d3884a2 | ||
|
|
e21c21a31a | ||
|
|
291ece0caa | ||
|
|
5152cfd8bd | ||
|
|
de45264c74 | ||
|
|
21ed531c8f | ||
|
|
c8b892d835 | ||
|
|
1512dc5c23 | ||
|
|
ca95f69f25 | ||
|
|
4aaa5377b3 | ||
|
|
fecfd07997 | ||
|
|
075f839810 | ||
|
|
c8c9565a03 | ||
|
|
a615a7d4d2 | ||
|
|
0a8a2ecfb5 | ||
|
|
4b6a98de5f | ||
|
|
831450aacc | ||
|
|
fb31513b00 | ||
|
|
199e9c1907 | ||
|
|
72b7abd1a1 | ||
|
|
f19d8df184 | ||
|
|
369a12704f | ||
|
|
35eb88461d | ||
|
|
98afd590c4 | ||
|
|
adb5107e26 | ||
|
|
c543dcf205 | ||
|
|
a64ad3054b | ||
|
|
036ce9d4db | ||
|
|
1f0bfa8519 | ||
|
|
eb4096ccd1 | ||
|
|
1efb51b1de | ||
|
|
04eb5d326a | ||
|
|
a17f6600ce | ||
|
|
5ff845212e | ||
|
|
0c1cd8720a | ||
|
|
d25ded6d3d | ||
|
|
ee305598c5 | ||
|
|
ca47635d0a | ||
|
|
a953da6e10 | ||
|
|
230ea1ce13 | ||
|
|
25fae1d7da | ||
|
|
bab9a671ef | ||
|
|
8ef86ffe84 | ||
|
|
61cb2ba2de | ||
|
|
c540bcb001 | ||
|
|
4c156d8a32 | ||
|
|
5d958f894f | ||
|
|
957f4181c0 | ||
|
|
96940bcd57 | ||
|
|
5b2ae44f78 | ||
|
|
ab0a67f7af | ||
|
|
5a645f22a8 | ||
|
|
ff56906879 | ||
|
|
74caf0e21f | ||
|
|
274212e760 | ||
|
|
0bf3f4c52a | ||
|
|
39fea0a5b9 | ||
|
|
3919b46a4d | ||
|
|
3fb8cb760c | ||
|
|
1ead18e447 | ||
|
|
9ab3cf37ce | ||
|
|
47c1f10835 | ||
|
|
bb364f9cc8 | ||
|
|
342171fa9e | ||
|
|
0491126758 | ||
|
|
a8b1dd7809 | ||
|
|
0f940cc58a | ||
|
|
f4ffbc6072 | ||
|
|
c9f65d5ae6 | ||
|
|
2fe8fb192f | ||
|
|
2487445f5f | ||
|
|
a73c217bf6 | ||
|
|
f94e915e33 | ||
|
|
f6c5d09978 | ||
|
|
80c4685324 | ||
|
|
bba63ef665 | ||
|
|
accaae9b2c | ||
|
|
0949f5b342 | ||
|
|
de89517711 | ||
|
|
35abd4867a | ||
|
|
f87b9a3d2d | ||
|
|
02b46221dd | ||
|
|
0c99f4f4b7 | ||
|
|
e93c1c9f28 | ||
|
|
3ab668c366 | ||
|
|
1ae162d673 | ||
|
|
61a29c4291 | ||
|
|
6f88dc8713 | ||
|
|
d4ddfeb2c0 | ||
|
|
5a46076652 | ||
|
|
3f2ab5b34b | ||
|
|
2ae897db7b | ||
|
|
13d8a6969a | ||
|
|
68bd32bedb | ||
|
|
7a60d6d33f | ||
|
|
636264c1c6 | ||
|
|
3dd49be938 | ||
|
|
8979450631 | ||
|
|
60a2ce010a | ||
|
|
7f2d47d84c | ||
|
|
002fecdd9e | ||
|
|
174e3c15af | ||
|
|
81d26afebe | ||
|
|
6acebc04b6 | ||
|
|
fa6c4a2580 | ||
|
|
9f8e6353e5 | ||
|
|
4c4c045f87 | ||
|
|
602233213e | ||
|
|
f119e63750 | ||
|
|
58a2b0008e | ||
|
|
972a791882 | ||
|
|
abd6043a2f | ||
|
|
4498750810 | ||
|
|
cc1ae59c9b | ||
|
|
65f97ea344 | ||
|
|
14fc51e8aa | ||
|
|
1eea0f5680 | ||
|
|
cdbc4bfb13 | ||
|
|
b33f504e8f | ||
|
|
a65ff8a1aa | ||
|
|
23491b7f46 | ||
|
|
224a0f6e90 | ||
|
|
71634240a0 | ||
|
|
4d3a0887b4 | ||
|
|
d4cdd59eaa | ||
|
|
d5210e9bdd | ||
|
|
a87ec6840f | ||
|
|
1ff24e3f2f | ||
|
|
1fc399a5c1 | ||
|
|
9330d92639 | ||
|
|
becf700bc2 | ||
|
|
9233fdb359 | ||
|
|
0e537f1085 | ||
|
|
0bd011affd | ||
|
|
4bee3cff2e | ||
|
|
5c0927e108 | ||
|
|
c468f4efa5 | ||
|
|
9e1d244cbe | ||
|
|
57b2fe851c | ||
|
|
57794c6690 | ||
|
|
e894c9e1b5 | ||
|
|
700641afb8 | ||
|
|
5691dca9f4 | ||
|
|
ddbdca6cdb | ||
|
|
dd59d50944 | ||
|
|
a6d0ee24c3 | ||
|
|
a282e942bf | ||
|
|
e35528ae79 | ||
|
|
e257c999b8 | ||
|
|
f18dab92bf | ||
|
|
078adc7ed7 | ||
|
|
e6c98c3c55 | ||
|
|
c89aaf7a87 | ||
|
|
2c685f34e0 | ||
|
|
8cb7ba7951 | ||
|
|
2fe79d0b76 | ||
|
|
4668b84158 | ||
|
|
88f990e122 | ||
|
|
974452d4dd | ||
|
|
758d788bbe | ||
|
|
0bb56e0e04 | ||
|
|
41bd5f2fc6 | ||
|
|
8fa95abae4 | ||
|
|
0a55e63413 | ||
|
|
0468fca72b | ||
|
|
192db70960 | ||
|
|
c82a5dd3e3 | ||
|
|
e4d46a2146 | ||
|
|
8d0a1f71bf | ||
|
|
fecaba7ff1 | ||
|
|
36d29dedd5 | ||
|
|
a4d01f8a83 | ||
|
|
af6c39fb9b | ||
|
|
7cd4002083 | ||
|
|
0bb4bb9d51 | ||
|
|
11c15db517 | ||
|
|
d6c5a1280e | ||
|
|
99c3099c32 | ||
|
|
2ea10eeb75 | ||
|
|
3e4fa99098 | ||
|
|
c25e2eb0cf | ||
|
|
c21cdd3154 | ||
|
|
3e46876a73 | ||
|
|
80b03d929d | ||
|
|
472a91708a | ||
|
|
51de979ed9 | ||
|
|
94715d8e54 | ||
|
|
4d4057d8a2 | ||
|
|
6b6d114a21 | ||
|
|
59ff5cbd87 | ||
|
|
9a664b4984 | ||
|
|
9b7d357ca1 | ||
|
|
34a8901eb8 | ||
|
|
3fb6c995e0 | ||
|
|
de5a9a3e8b | ||
|
|
c89bc85009 | ||
|
|
54c0eb9aa6 | ||
|
|
9f9f893123 | ||
|
|
71533c8a83 | ||
|
|
b73089ce3e | ||
|
|
aca5862db1 | ||
|
|
9cd53f1cc0 | ||
|
|
84662ec4b3 | ||
|
|
eccb2d685c | ||
|
|
668fa5cf2a | ||
|
|
194e51aff0 | ||
|
|
c5fae8a617 | ||
|
|
8ab7667da4 | ||
|
|
94da86cbee | ||
|
|
e7db2d3588 | ||
|
|
f65e531ee4 | ||
|
|
4005bba437 | ||
|
|
95d1f25b28 | ||
|
|
35cf8beb33 | ||
|
|
aa712e7e73 | ||
|
|
6f374faca5 | ||
|
|
9701e9dfd2 | ||
|
|
c6459e8ec1 | ||
|
|
26d359a30c | ||
|
|
5cbbfc69e7 | ||
|
|
706873142e | ||
|
|
21168577a5 | ||
|
|
0a61519eea | ||
|
|
5acd97c7e0 | ||
|
|
1adb3b60be | ||
|
|
cb98b586fd | ||
|
|
3b0ee3f234 | ||
|
|
1c3c4d73ef | ||
|
|
67c012b3fc | ||
|
|
ed007ca416 | ||
|
|
9221586f37 | ||
|
|
e379e0936e | ||
|
|
2f622b3a51 | ||
|
|
ba19c83fd6 | ||
|
|
01015cc0e2 | ||
|
|
2a7bc122c1 | ||
|
|
f9d1614e6d | ||
|
|
8a0b9de41a | ||
|
|
db087efac4 | ||
|
|
41e69065b9 | ||
|
|
c9ba1ad75d | ||
|
|
03a8d06668 | ||
|
|
e2758c6759 | ||
|
|
a03f679e88 | ||
|
|
c40c9f7ed0 | ||
|
|
fb50da9dad | ||
|
|
92b61c816d | ||
|
|
b4fb061802 | ||
|
|
ef99a7a3dc | ||
|
|
39b1aee2e1 | ||
|
|
fd4c2b74f3 | ||
|
|
a9f89a7290 | ||
|
|
e8f944d3ca | ||
|
|
0aa01a2dce | ||
|
|
b4d9ac91ba | ||
|
|
1062293981 | ||
|
|
79853dc9bc | ||
|
|
5a70f42ab6 | ||
|
|
9874865a6f | ||
|
|
b4d909d415 | ||
|
|
7643f2b25e | ||
|
|
fa00de707c | ||
|
|
1e1db53986 | ||
|
|
c30f014a89 | ||
|
|
eaa29370f4 | ||
|
|
ebdac755af | ||
|
|
32aabfab40 | ||
|
|
cd107a5ac3 | ||
|
|
81bdb22b0c | ||
|
|
f29ba928cc | ||
|
|
8b69d04fff | ||
|
|
0c9b539a35 | ||
|
|
c24d15b2db | ||
|
|
b1eba81b9d | ||
|
|
3f9ef4ac46 | ||
|
|
f379b3eecb | ||
|
|
ee8602a486 | ||
|
|
79285c3664 | ||
|
|
79bfef9aab | ||
|
|
349a158056 | ||
|
|
2c57ee566b | ||
|
|
34c14b1cab | ||
|
|
c4bce95897 | ||
|
|
41f823ae4c | ||
|
|
0811b47a71 | ||
|
|
5c00743626 | ||
|
|
cedeabb357 | ||
|
|
4311136125 | ||
|
|
490e0de548 | ||
|
|
a209c3ae12 | ||
|
|
85b8fbe72b | ||
|
|
b477504754 | ||
|
|
7207cf2e37 | ||
|
|
b1855cdcf2 | ||
|
|
af01bda509 | ||
|
|
0bb27bb0b1 | ||
|
|
b02c260ecb | ||
|
|
3fbb50397c | ||
|
|
0f3423cd75 | ||
|
|
a80eb6545a | ||
|
|
2602861f23 | ||
|
|
fc34180cca | ||
|
|
ff542f0b27 | ||
|
|
c83a90e2f1 | ||
|
|
47aad344c3 | ||
|
|
5320333614 | ||
|
|
e1d867b686 | ||
|
|
0812293b47 | ||
|
|
8b00ebde78 | ||
|
|
d134121b09 | ||
|
|
8b4492ed1c | ||
|
|
62841e2935 | ||
|
|
1992529666 | ||
|
|
65e54c23e3 | ||
|
|
febb4403ff | ||
|
|
823e42c3e3 | ||
|
|
b1c2329954 | ||
|
|
9e21d55e37 | ||
|
|
ca3fe9fdab | ||
|
|
5cdc54a699 | ||
|
|
391372193c | ||
|
|
586776e98b | ||
|
|
de346b24e8 | ||
|
|
230dd159df | ||
|
|
f2e991439e | ||
|
|
0c3983b25a | ||
|
|
8c9e62b299 | ||
|
|
bc0a39238e | ||
|
|
49532259e5 | ||
|
|
05341dfeb0 | ||
|
|
833183a9e1 | ||
|
|
f71ec49525 | ||
|
|
1dfd43ac27 | ||
|
|
cb54d96eec | ||
|
|
46581e701a | ||
|
|
92fa3189ab | ||
|
|
90cde23c19 | ||
|
|
1c928cf61a | ||
|
|
200b9d7339 | ||
|
|
203937456e | ||
|
|
98233fa144 | ||
|
|
4857d5d554 | ||
|
|
ce1a2793f9 | ||
|
|
d4b72e81b2 | ||
|
|
f78fb05676 | ||
|
|
8a0901c4cb | ||
|
|
35d86581e5 | ||
|
|
7db039347a | ||
|
|
8a266a478e | ||
|
|
fde9a258d0 | ||
|
|
e68cf3bf89 | ||
|
|
4ca68d42a0 | ||
|
|
86b5fa5102 | ||
|
|
a7590083f1 | ||
|
|
7b6c90125c | ||
|
|
ad0c787900 | ||
|
|
121d8aba4d | ||
|
|
9df7ce09aa | ||
|
|
5cddf6dce8 | ||
|
|
4806f7c308 | ||
|
|
7f24c2b3ca | ||
|
|
78183bddff | ||
|
|
27a2afc1e7 | ||
|
|
8a73de51f1 | ||
|
|
30be017762 | ||
|
|
12d9a08f0d | ||
|
|
c78308f469 | ||
|
|
e09714ab53 | ||
|
|
4ee157f5ce | ||
|
|
1f28a4b83e | ||
|
|
68011701bd | ||
|
|
55d926cbaa | ||
|
|
63a49a4b90 | ||
|
|
ae2159c371 | ||
|
|
195190912f | ||
|
|
e81a0fd9c1 | ||
|
|
43e574558f | ||
|
|
88e57eee69 | ||
|
|
27c0e801f2 | ||
|
|
6811647e20 | ||
|
|
cc64313b80 | ||
|
|
f984dbba70 | ||
|
|
e2bdf44720 | ||
|
|
a18a007361 | ||
|
|
a6bd3f4a22 | ||
|
|
ee48228aa0 | ||
|
|
e187d30348 | ||
|
|
e3dafb45b4 | ||
|
|
bc434254ea | ||
|
|
164789226c | ||
|
|
593e3221fc | ||
|
|
1f198f75d7 | ||
|
|
40592de32d | ||
|
|
4c3e216cbd | ||
|
|
2e84a3f594 | ||
|
|
13ded5339f | ||
|
|
426cddbb30 | ||
|
|
65de5d71a9 | ||
|
|
940bbe18b6 | ||
|
|
58c4a9b5f4 | ||
|
|
ca5e8b2c2d | ||
|
|
7b70f548e4 | ||
|
|
35cc7fbeb8 | ||
|
|
55c6f3f507 | ||
|
|
9602f63a72 | ||
|
|
a9a45cddc4 | ||
|
|
10375d2629 | ||
|
|
cd05a95afc | ||
|
|
3a44cd477b | ||
|
|
86b061078b | ||
|
|
4dece73bf0 | ||
|
|
4a8ceeebff | ||
|
|
d477a9ed82 | ||
|
|
862fb8354d | ||
|
|
c484bc1dc8 | ||
|
|
1abfde0e03 | ||
|
|
3977443581 | ||
|
|
b9d027bfe2 | ||
|
|
a99a4b2a05 | ||
|
|
c4ea2a195c | ||
|
|
c0bb1ba1b1 | ||
|
|
d69519f86a | ||
|
|
aaefc6f838 | ||
|
|
989934b37c | ||
|
|
ed651fafef | ||
|
|
f985ecba0d | ||
|
|
ae561b8f12 | ||
|
|
fcc2c77af2 | ||
|
|
1a8cf59d04 | ||
|
|
89f0baab63 | ||
|
|
914d02825f | ||
|
|
f614d0015a | ||
|
|
3ca141ab81 | ||
|
|
7588db2691 | ||
|
|
ece4c9d565 | ||
|
|
9b43de2cb3 | ||
|
|
b67a7fca8c | ||
|
|
d810ebe67b | ||
|
|
6d1095db1e | ||
|
|
530bd5d486 | ||
|
|
3b08b34ceb | ||
|
|
93bb4036ce | ||
|
|
2a9322a117 | ||
|
|
8a8f27951b | ||
|
|
1d45d57e40 | ||
|
|
3a69da5f86 | ||
|
|
2ad6214ef0 | ||
|
|
51ffecc181 | ||
|
|
1ea07af9da | ||
|
|
e376fd97ac | ||
|
|
d2897e946f | ||
|
|
1e56737131 | ||
|
|
06617e7fdf | ||
|
|
01b152d6d9 | ||
|
|
b984fa41df | ||
|
|
04d2db3c44 | ||
|
|
b7b7b3e63f | ||
|
|
dcc683b4ae | ||
|
|
eff1369cab | ||
|
|
7ee78ffb82 | ||
|
|
e3d0bb59ab | ||
|
|
ea1971bd21 | ||
|
|
f9ccc501f8 | ||
|
|
159b8f71b7 | ||
|
|
db5c83c918 | ||
|
|
1341e4aa02 | ||
|
|
3dd7649ae7 | ||
|
|
000a9d36be | ||
|
|
0cd71233e0 | ||
|
|
70712c015e | ||
|
|
f789fee254 | ||
|
|
2a2f25bf29 | ||
|
|
0d9095d116 | ||
|
|
3eb22ca4d1 | ||
|
|
afd132adc9 | ||
|
|
5df8be8e7a | ||
|
|
b1408f61b4 | ||
|
|
c356e9997e | ||
|
|
51e66a47d8 | ||
|
|
49cab1c73c | ||
|
|
832f7f99fd | ||
|
|
d83af38877 | ||
|
|
cb7a3b0299 | ||
|
|
02081e4b62 | ||
|
|
76356eed97 | ||
|
|
85f6d866e6 | ||
|
|
255ae85b1e | ||
|
|
902e0e27e0 | ||
|
|
bd6944ea49 | ||
|
|
044cd57720 | ||
|
|
6cdcbc06d5 | ||
|
|
bb9fb905a1 | ||
|
|
4691eeae9f | ||
|
|
42c2ae9786 | ||
|
|
ebffaa4250 | ||
|
|
6c9aa8a9ca | ||
|
|
66bc7580c7 | ||
|
|
253c293213 | ||
|
|
ef0a265086 | ||
|
|
48331843ea | ||
|
|
8a5484202c | ||
|
|
5da4a0bd56 | ||
|
|
c63a0cfddc | ||
|
|
898d9f97f6 | ||
|
|
b956c8735e | ||
|
|
a97a80178e | ||
|
|
6dea092dec | ||
|
|
123cf7fe37 | ||
|
|
48a4ff2307 | ||
|
|
e582fc2a6f | ||
|
|
d75138be00 | ||
|
|
170457b73f | ||
|
|
084f96981b | ||
|
|
9aa4fb0dc6 | ||
|
|
a4ac03c188 | ||
|
|
cf7f7d0ef1 | ||
|
|
b61266eb51 | ||
|
|
25bd2bd8fa | ||
|
|
f66e550c80 | ||
|
|
545ac12f3d | ||
|
|
9fdd167da4 | ||
|
|
afc8f3defa | ||
|
|
434119ab89 | ||
|
|
a9d15dd3e4 | ||
|
|
97c7d358ea | ||
|
|
4e37b49261 | ||
|
|
f3d5a9dc61 | ||
|
|
a0e986b1f9 | ||
|
|
9c01ceb576 | ||
|
|
cf3b75c687 | ||
|
|
86a226680b | ||
|
|
03ff167d4d | ||
|
|
49a93d54be | ||
|
|
db0be09803 | ||
|
|
35305f8f7c | ||
|
|
66b369c62c | ||
|
|
82932c0d6b | ||
|
|
83b3a3df74 | ||
|
|
881431bf7e | ||
|
|
5971d0532c | ||
|
|
ecb1c96fc5 | ||
|
|
2e8d1eda1b | ||
|
|
ef60bcc0a6 | ||
|
|
cf04da3ebe | ||
|
|
9902a435cd | ||
|
|
d0d7b43342 | ||
|
|
daa14edc0d | ||
|
|
08c8ee9f52 | ||
|
|
e8777fd906 | ||
|
|
55c7e24c74 | ||
|
|
69bf8e4f71 | ||
|
|
ec84a2cfa5 | ||
|
|
93ae43f577 | ||
|
|
e785381d4d | ||
|
|
aba3746220 | ||
|
|
dc1da4a881 | ||
|
|
cc17b27a2b | ||
|
|
e3f68488ee | ||
|
|
6d8d7a88b2 | ||
|
|
3b82f9106d | ||
|
|
6edbcbf9a3 | ||
|
|
35b203fdb1 | ||
|
|
fa0fe45103 | ||
|
|
67c2d2fa54 | ||
|
|
25e9d7317c | ||
|
|
6e0f3b3bda | ||
|
|
25d26d76fd | ||
|
|
b19820774e | ||
|
|
a77c2973b3 | ||
|
|
d34ab6de9f | ||
|
|
b08dff6011 | ||
|
|
1e5f9dfa14 | ||
|
|
419dadf528 | ||
|
|
c2da8cb535 | ||
|
|
900a273d3d | ||
|
|
30fa6d8e03 | ||
|
|
d490669430 | ||
|
|
230b7775fe | ||
|
|
ef257bcc1b | ||
|
|
f011d59d67 | ||
|
|
4a5ca363b5 | ||
|
|
c02833ced6 | ||
|
|
cb13f32a7c | ||
|
|
fb53eb09cf | ||
|
|
0cb22acbda | ||
|
|
f7c1307878 | ||
|
|
423be1545c | ||
|
|
5582aae6d6 | ||
|
|
aff45df1af | ||
|
|
2a839c735e | ||
|
|
314d09adf7 | ||
|
|
674cd6fd48 | ||
|
|
bed9e48c12 | ||
|
|
f5a1e58f59 | ||
|
|
350b60661a | ||
|
|
455b809b17 | ||
|
|
e969b5e11b | ||
|
|
7db58ddc19 | ||
|
|
c50ec2b4e2 | ||
|
|
20a04a068d | ||
|
|
22049c1ec3 | ||
|
|
827daf1fca | ||
|
|
196de8bc40 | ||
|
|
2b09bfde6d | ||
|
|
46cee00ad8 | ||
|
|
afb8067c4f | ||
|
|
020277a38f | ||
|
|
dc8ee363db | ||
|
|
b1a60476c0 | ||
|
|
aba392e630 | ||
|
|
f0740680cd | ||
|
|
c51cd5fe91 | ||
|
|
4e86b0d53f | ||
|
|
c4928b2df9 | ||
|
|
2cde22ee10 | ||
|
|
7457cbe62f | ||
|
|
16e0e9370e | ||
|
|
9db2311b22 | ||
|
|
8200e91073 | ||
|
|
cd9b4b46f4 | ||
|
|
b2c2dc72bc | ||
|
|
0039e02339 | ||
|
|
8171eb0b3d | ||
|
|
dca25a1b39 | ||
|
|
abab24b785 | ||
|
|
77172e23f7 | ||
|
|
3bbd454578 | ||
|
|
8e5cad159f | ||
|
|
53ad9d83b9 | ||
|
|
8a925dcf90 | ||
|
|
28f2a169da | ||
|
|
14e641cb8c | ||
|
|
7a9e3651fd | ||
|
|
294112db54 | ||
|
|
f56c4001d5 | ||
|
|
9caa53e8d9 | ||
|
|
15e58909b6 | ||
|
|
878ba523ac | ||
|
|
6bcf58bab8 | ||
|
|
0dc9e0996a | ||
|
|
6f4e3dd910 | ||
|
|
c8d0edc06a | ||
|
|
03a7d0e8ae | ||
|
|
5f1ab506c8 | ||
|
|
898cce256f | ||
|
|
ba8af817fc | ||
|
|
db8c7af0b8 | ||
|
|
97980446a4 | ||
|
|
aca0749d71 | ||
|
|
f19a4bf1c4 | ||
|
|
693842c855 | ||
|
|
b87af1c325 | ||
|
|
98af1ee195 | ||
|
|
6567e50a6f | ||
|
|
f4814901af | ||
|
|
493ea15714 | ||
|
|
c90cdadcfb | ||
|
|
b6f25271a9 | ||
|
|
81b63473c0 | ||
|
|
685b44e22d | ||
|
|
25a790a631 | ||
|
|
813ba29677 | ||
|
|
09a652926f | ||
|
|
61ad5f9b94 | ||
|
|
dd4b0b7646 | ||
|
|
a1e64f6afd | ||
|
|
e94953a396 | ||
|
|
3c9012886f | ||
|
|
8c8e44d0ae | ||
|
|
77fa5b4116 | ||
|
|
c192577b58 | ||
|
|
beac6b15c9 | ||
|
|
00dcbb9dc6 | ||
|
|
bac0222eec | ||
|
|
2bc8ac55ce | ||
|
|
659dd75c78 | ||
|
|
36f9c1155a | ||
|
|
344c18cf73 | ||
|
|
0908191386 | ||
|
|
083d30afbb | ||
|
|
dc75514afc | ||
|
|
7193ee9890 | ||
|
|
8aa9382e58 | ||
|
|
0b920bb1cd | ||
|
|
7b9d99251f | ||
|
|
0e8d574ebd | ||
|
|
cba6e667da | ||
|
|
b9b9cb8a62 | ||
|
|
c6e6aa8850 | ||
|
|
55ccdba0f6 | ||
|
|
4cf101caae | ||
|
|
5518fe9be1 | ||
|
|
32f3d9842d | ||
|
|
8f860a27d1 | ||
|
|
4f294c247f | ||
|
|
d6e6ee3043 | ||
|
|
287fee89cb | ||
|
|
7840456b77 | ||
|
|
2635038e5c | ||
|
|
3c9575aadc | ||
|
|
ad4dda469f | ||
|
|
58153774b1 | ||
|
|
b6cbf7203b | ||
|
|
43d1edf88c | ||
|
|
f7d5c8ff8d | ||
|
|
05480c229a | ||
|
|
c7b2b11ec2 | ||
|
|
341f8682f2 | ||
|
|
3beb81a5d0 | ||
|
|
9ef5859996 | ||
|
|
a909eaa9b1 | ||
|
|
dce5e09683 | ||
|
|
ab73ac3b6f | ||
|
|
07bfb4f4e4 | ||
|
|
b2d1109737 | ||
|
|
fa59fc6eb4 | ||
|
|
0203ea37bf | ||
|
|
95702f970b | ||
|
|
0a70e23d1d | ||
|
|
b096b323d1 | ||
|
|
914cdb5997 | ||
|
|
06aab2c6ed | ||
|
|
dee29bbd3c | ||
|
|
d5322973fa | ||
|
|
4fc9428808 | ||
|
|
dc1cc91df1 | ||
|
|
e912f6ac38 | ||
|
|
b0aea49465 | ||
|
|
6e86430130 | ||
|
|
0874fa9321 | ||
|
|
e50070e3b3 | ||
|
|
7b2d6c3c98 | ||
|
|
9c7dcbfec3 | ||
|
|
04229f0581 | ||
|
|
9b8f37bb27 | ||
|
|
16895b67ce | ||
|
|
410699874c | ||
|
|
dbcca28c19 | ||
|
|
efca30b081 | ||
|
|
561acfb618 | ||
|
|
5d8d5e0c3a | ||
|
|
d23c3d110e | ||
|
|
361f377493 | ||
|
|
b6f3b7e7f6 | ||
|
|
f0f34dd8d9 | ||
|
|
7aab862a06 | ||
|
|
4fe0dfa9aa | ||
|
|
d824b54d82 | ||
|
|
a53d925844 | ||
|
|
7ff2db1dd6 | ||
|
|
691030d5ce | ||
|
|
11904c0435 | ||
|
|
372b873413 | ||
|
|
9639af49d2 | ||
|
|
7bef45ad3b | ||
|
|
a7285dfabc | ||
|
|
6bf3c91a0a | ||
|
|
cc26fb5ec4 | ||
|
|
cbf7d8f735 | ||
|
|
d1cfc50811 | ||
|
|
5e1e763506 | ||
|
|
46ec37365e | ||
|
|
d87559f9b9 | ||
|
|
9ed280d1ec | ||
|
|
41ae712b50 | ||
|
|
6b5c8751da | ||
|
|
7a4149a3f5 | ||
|
|
4c0cc2719e | ||
|
|
cfc1fe2ead | ||
|
|
504abf4b34 | ||
|
|
3ff6f21b51 | ||
|
|
6208131459 | ||
|
|
c22564335f | ||
|
|
4ee146c00a | ||
|
|
371624e0ec | ||
|
|
f3e1b1c226 | ||
|
|
8ccfb29765 | ||
|
|
8173242e01 | ||
|
|
f0ab18377d | ||
|
|
afeb246328 | ||
|
|
fd2b22474f | ||
|
|
aaaad89244 | ||
|
|
a575be430d | ||
|
|
8f0846e68c | ||
|
|
998af6f111 | ||
|
|
0e6dcf027f | ||
|
|
40fb96b838 | ||
|
|
16493465f9 | ||
|
|
efcfaf4b96 | ||
|
|
51d9144e9f | ||
|
|
09569d399f | ||
|
|
515e8d075f | ||
|
|
3c6274b8be | ||
|
|
ac780f36a0 | ||
|
|
c9bfb13cdb | ||
|
|
9e01a83636 | ||
|
|
7f7822aebd | ||
|
|
5b832396f5 | ||
|
|
40bfed28cd | ||
|
|
98c93e76d7 | ||
|
|
de1bcaa69a | ||
|
|
a1eefc013e | ||
|
|
ebbc730fc3 | ||
|
|
f42b90806a | ||
|
|
e6b1a30a26 | ||
|
|
2419ab589d | ||
|
|
7fddd8358d | ||
|
|
8145b458d6 | ||
|
|
613ff40936 | ||
|
|
b0d7ce8d09 | ||
|
|
ddde360e3e | ||
|
|
cb2e3a98a2 | ||
|
|
431a5a556d | ||
|
|
e743f940d4 | ||
|
|
b653422883 | ||
|
|
26de8dd299 | ||
|
|
9235536f38 | ||
|
|
470a185909 | ||
|
|
a3f2df124c | ||
|
|
e0ac271e5a | ||
|
|
ada0b4ca04 | ||
|
|
591201c1a0 | ||
|
|
c521f2a138 | ||
|
|
b0eaf0bc27 | ||
|
|
7bc944c8a9 | ||
|
|
40ccb7ed54 | ||
|
|
98ddbffe6e | ||
|
|
e2570d9b1b | ||
|
|
36189370a5 | ||
|
|
677d80b781 | ||
|
|
68de328ac1 | ||
|
|
a7072a5e1c | ||
|
|
3736ce3f55 | ||
|
|
1786291e32 | ||
|
|
274fcf8d1f | ||
|
|
8eece1c00c | ||
|
|
6e385a1b01 | ||
|
|
9cf2c02c47 | ||
|
|
de96892970 | ||
|
|
45d3ef7b3c | ||
|
|
ef92583c3a | ||
|
|
d2b56f60da | ||
|
|
87c576584d | ||
|
|
e63b85a50b | ||
|
|
74c5cd7668 | ||
|
|
db12229ce3 | ||
|
|
123a968be3 | ||
|
|
adbc4e4ea7 | ||
|
|
62aba4396e | ||
|
|
d55eab30fa | ||
|
|
82d576c9ca | ||
|
|
b0572bfd1e | ||
|
|
2d1c8849d8 | ||
|
|
df9928711b | ||
|
|
12e167f672 | ||
|
|
3cc13b29f0 | ||
|
|
250fb23dc0 | ||
|
|
300773cdca | ||
|
|
08bf4dec4f | ||
|
|
e9ecba9fc7 | ||
|
|
a665ae3de1 | ||
|
|
3306687363 | ||
|
|
af73996d51 | ||
|
|
831faf58f3 | ||
|
|
c811aa21aa | ||
|
|
13bda81ee0 | ||
|
|
72cc01ff48 | ||
|
|
159ca9c8c7 | ||
|
|
4ee139b0be | ||
|
|
5b8b623765 | ||
|
|
1f89845bb2 | ||
|
|
421f324baa | ||
|
|
e4283176ae | ||
|
|
6513d20744 | ||
|
|
906a81a1c7 | ||
|
|
e2701da5a9 | ||
|
|
e87d29171f | ||
|
|
454589debd | ||
|
|
0ac9b6d4cf | ||
|
|
387e1835d1 | ||
|
|
311f145bc7 | ||
|
|
06b6e5624a | ||
|
|
c554aef0e1 | ||
|
|
93b9873a56 | ||
|
|
1e273f640e | ||
|
|
9e12630d75 | ||
|
|
d37b7ebc0b | ||
|
|
67f039540c | ||
|
|
865e21b884 | ||
|
|
fac5fbfdbf | ||
|
|
ad73a4f50c | ||
|
|
9b6d66c787 | ||
|
|
b7aed08e65 | ||
|
|
85cca7096f | ||
|
|
6aa26565e6 | ||
|
|
a42ab504a0 | ||
|
|
62c666566e | ||
|
|
13a0d5fa5e | ||
|
|
2a2a19e542 | ||
|
|
ce4fd0c0fb | ||
|
|
6c3b981cd6 | ||
|
|
467a01024e | ||
|
|
2065c9982b | ||
|
|
354da24f5b | ||
|
|
d299a6422b | ||
|
|
33b131766f | ||
|
|
40c8a7062c | ||
|
|
d7b10963c2 | ||
|
|
d269f5fb90 | ||
|
|
2c5c5c06ea | ||
|
|
3eb65448a6 | ||
|
|
7763fd67c7 | ||
|
|
a5a8c57fe7 | ||
|
|
eaa37fd21c | ||
|
|
23311d9819 | ||
|
|
b7eb096088 | ||
|
|
7c3cfbde1a | ||
|
|
9375cc8e1f | ||
|
|
42a522f0e8 | ||
|
|
207e88d3c4 | ||
|
|
d29833c5aa | ||
|
|
6b902492ae | ||
|
|
2bda06bbb5 | ||
|
|
2e209097b6 | ||
|
|
e6ebac015d | ||
|
|
5cc29a6c7e | ||
|
|
ad5ecf906b | ||
|
|
18ad0b52d3 | ||
|
|
9e4e26e0c8 | ||
|
|
99d9144556 | ||
|
|
7ae6f8740d | ||
|
|
9560b6dea8 | ||
|
|
43a4725423 | ||
|
|
2440ffae49 | ||
|
|
344e9221ec | ||
|
|
45badf4c05 | ||
|
|
e7252adc1e | ||
|
|
eca25a6cab | ||
|
|
c6cfdbffe4 | ||
|
|
0b00cf70b6 | ||
|
|
bf6f0216d5 | ||
|
|
b3c3a1cb1e | ||
|
|
b1847ae244 | ||
|
|
1f2054c89c | ||
|
|
4448836263 | ||
|
|
36fb30dfef | ||
|
|
a4c30acd9d | ||
|
|
e8ddc0f46e | ||
|
|
13ef7f1f38 | ||
|
|
2297e26660 | ||
|
|
a0bb199f69 | ||
|
|
a37514163b | ||
|
|
a5741a465f | ||
|
|
3e3d627b25 | ||
|
|
a78608ec86 | ||
|
|
c81f201c8c | ||
|
|
5d6c2aae0a | ||
|
|
d8466ce31f | ||
|
|
1c359afad4 | ||
|
|
0f4eda33eb | ||
|
|
cb86231930 | ||
|
|
36fa521a0e | ||
|
|
1d0e0e217d | ||
|
|
50ca7f7f8f | ||
|
|
6fb1789ba4 | ||
|
|
959026c29a | ||
|
|
3211be5d14 | ||
|
|
a2647a4181 | ||
|
|
d743c5c6f3 | ||
|
|
c9d500e9fd | ||
|
|
de231a713e | ||
|
|
60a71efca8 | ||
|
|
292f98dc29 | ||
|
|
2a736d0c2e | ||
|
|
b337d3f8e5 | ||
|
|
205855b8ee | ||
|
|
b9f5e50421 | ||
|
|
02440068fc | ||
|
|
4b9420d7d7 | ||
|
|
3e7c270f6c | ||
|
|
9a21d1a2fd | ||
|
|
c8cfcab5db | ||
|
|
551374c228 | ||
|
|
a3e4dcafe0 | ||
|
|
66b8f17a29 | ||
|
|
b1eb16e5ff | ||
|
|
5a377144b0 | ||
|
|
78fc74633a | ||
|
|
484b2f43d6 | ||
|
|
5998a4b2af | ||
|
|
f8c56494c9 | ||
|
|
a7ed430587 | ||
|
|
3f6f7672c2 | ||
|
|
5824aab560 | ||
|
|
9acaece9cc | ||
|
|
bee1f38e01 | ||
|
|
4e95b347a7 | ||
|
|
46624d640e | ||
|
|
f7ef192c02 | ||
|
|
58654acf08 | ||
|
|
905e94f058 | ||
|
|
c8f70b8154 | ||
|
|
ac9a7f47bd | ||
|
|
d5482f6e75 | ||
|
|
6e614336d6 | ||
|
|
c3c97e66b1 | ||
|
|
5d4ef90b2c | ||
|
|
16f2eb25f4 | ||
|
|
ce41c63f41 | ||
|
|
e1f30da613 | ||
|
|
56770462c2 | ||
|
|
8da0925650 | ||
|
|
a9d31d3169 | ||
|
|
5bf3967f26 | ||
|
|
0fc71a1154 | ||
|
|
912b4e0cb7 | ||
|
|
42a2c1a03a | ||
|
|
e8846c3930 | ||
|
|
83fc90c8c3 | ||
|
|
b43f3b6bfc | ||
|
|
4eb7340395 | ||
|
|
4989de6acc | ||
|
|
256c37f7fa | ||
|
|
42bbd56673 | ||
|
|
e1dc59bd16 | ||
|
|
9ce3961b8e | ||
|
|
4523163411 | ||
|
|
a719ab7780 | ||
|
|
453be3b530 | ||
|
|
0f92964a2f | ||
|
|
25397ef756 | ||
|
|
ebec792700 | ||
|
|
c7859a538c | ||
|
|
3b386ad39f | ||
|
|
dff0434eaf | ||
|
|
253b4b3fe5 | ||
|
|
20eced94e7 | ||
|
|
da597227ac | ||
|
|
170b420d07 | ||
|
|
4510dddae4 | ||
|
|
49fe8e24b2 | ||
|
|
fb96391106 | ||
|
|
c80138ac71 | ||
|
|
a022f412b5 | ||
|
|
05bbf81f93 | ||
|
|
b9cea27497 | ||
|
|
5d47cafa5b | ||
|
|
e9651ae962 | ||
|
|
6dec907191 | ||
|
|
dafc8f1062 | ||
|
|
ee1cabf06c | ||
|
|
541b5c5c38 | ||
|
|
008cc7c1a7 | ||
|
|
eb057107c5 | ||
|
|
cf975bbc22 | ||
|
|
c297701987 | ||
|
|
149153f8ca | ||
|
|
9f0364df60 | ||
|
|
df0ba02a38 | ||
|
|
9212eab21f | ||
|
|
d7c70a41e5 | ||
|
|
1c4065cd10 | ||
|
|
34a58c8d82 | ||
|
|
3a5d923bf1 | ||
|
|
7b9bddad1b | ||
|
|
f389ad2655 | ||
|
|
a06e5c383d | ||
|
|
c4bb6abc2b | ||
|
|
6c2c2f3c34 | ||
|
|
fe343bb002 | ||
|
|
3badab8b70 | ||
|
|
1c2dd749eb | ||
|
|
dbde088d98 | ||
|
|
62d44dc9ef | ||
|
|
81f6039a7f | ||
|
|
e8e2f6f6b9 | ||
|
|
88e7725c13 | ||
|
|
5bf75abb30 | ||
|
|
122a32b928 | ||
|
|
220eafe705 | ||
|
|
f6f20e1269 | ||
|
|
7978f9d2f3 | ||
|
|
63deb069bb | ||
|
|
f6655c171b | ||
|
|
5e5d5ab1f6 | ||
|
|
0824146978 | ||
|
|
03bb1e5750 | ||
|
|
91a83fe265 | ||
|
|
0b364d00bc | ||
|
|
0d984b36ef | ||
|
|
40b4e71db2 | ||
|
|
7f343ed574 | ||
|
|
eb1627049f | ||
|
|
c0074d3aa9 | ||
|
|
13be76efe5 | ||
|
|
8fc07701bc | ||
|
|
fb24016c30 | ||
|
|
f248bffc9e | ||
|
|
1b7d95df29 | ||
|
|
af424b4e43 | ||
|
|
16d0609fad | ||
|
|
068944de36 | ||
|
|
77267ca28b | ||
|
|
5e2c84b119 | ||
|
|
e0701109ca | ||
|
|
103dc9e80a | ||
|
|
6ed6e31e80 | ||
|
|
e37a6ef219 | ||
|
|
53b6f99fb0 | ||
|
|
4234aa2c4a | ||
|
|
069f6ed574 | ||
|
|
373df14150 | ||
|
|
f08922e848 | ||
|
|
ffe7e9166e | ||
|
|
6ce51040a2 | ||
|
|
34dd221af7 | ||
|
|
dc2194efa7 | ||
|
|
ac66d329c7 | ||
|
|
09c18bc918 | ||
|
|
89df7fc91d | ||
|
|
a46b8b84d4 | ||
|
|
b05c989298 | ||
|
|
98725c443e | ||
|
|
7f47f4174d | ||
|
|
6955228f39 | ||
|
|
693bd970e7 | ||
|
|
7e8ed05df4 | ||
|
|
0f7365e6af | ||
|
|
09f03783ea | ||
|
|
84e730cbd8 | ||
|
|
4aca722796 | ||
|
|
28b533cf87 | ||
|
|
2a556de6d2 | ||
|
|
feaa082ea8 | ||
|
|
117bac1e2d | ||
|
|
6c66933f90 | ||
|
|
ee1b608bcf | ||
|
|
d26290a017 | ||
|
|
739f2d7536 | ||
|
|
16d01fba85 | ||
|
|
f531dba2d2 | ||
|
|
5aff633a0b | ||
|
|
ea19830de1 | ||
|
|
ecc8a52f82 | ||
|
|
17a0731f28 | ||
|
|
ca0bed1400 | ||
|
|
3404e8e4e5 | ||
|
|
8a0c10fcb9 | ||
|
|
2639ae9b17 | ||
|
|
8d24932c80 | ||
|
|
4fcd34137c | ||
|
|
20101b3bab | ||
|
|
e41c0b1a2d | ||
|
|
f8a8ea0a79 | ||
|
|
f6e558f5d4 | ||
|
|
9bb7552df5 | ||
|
|
ba759ef03e | ||
|
|
470ab03b86 | ||
|
|
9a14560daf | ||
|
|
8b0dbff312 | ||
|
|
8cedace2f5 | ||
|
|
d4e41fd1f6 | ||
|
|
0574bb5a63 | ||
|
|
835232d504 | ||
|
|
60549b67be | ||
|
|
1ecdac623a | ||
|
|
78a0260993 | ||
|
|
dd19f8cd07 | ||
|
|
bcaf746508 | ||
|
|
652618e458 | ||
|
|
4ff8fdba57 | ||
|
|
78ce6f86f7 | ||
|
|
590ff06418 | ||
|
|
4b30979086 | ||
|
|
12e9303297 | ||
|
|
1cee6fe95e | ||
|
|
ae9fa7fdf6 | ||
|
|
b4345d7598 | ||
|
|
a5dfadeb70 | ||
|
|
8427d774b6 | ||
|
|
895850b8cf | ||
|
|
8c925134f9 | ||
|
|
f3ce085913 | ||
|
|
8182a9d972 | ||
|
|
1f8dbed029 | ||
|
|
e920c1e1df | ||
|
|
5859ad686b | ||
|
|
e698d818c6 | ||
|
|
68db8ed0b9 | ||
|
|
f6f814cb02 | ||
|
|
dc47875fc7 | ||
|
|
0cfdb11450 | ||
|
|
368f77ceea | ||
|
|
397575951e | ||
|
|
3de6a807ce | ||
|
|
42399159da | ||
|
|
fc8f0b9ee2 | ||
|
|
7011e7c680 | ||
|
|
86139e8bf2 | ||
|
|
b4bea1bfcb | ||
|
|
545054c608 | ||
|
|
9fd2d72ce8 | ||
|
|
01fcee7d71 | ||
|
|
4d3c887d6b | ||
|
|
4392e004f8 | ||
|
|
37325bd7c5 | ||
|
|
34a2864e27 | ||
|
|
9a37f63263 | ||
|
|
630f566d3f | ||
|
|
03f64ac97a | ||
|
|
71dbe2d023 | ||
|
|
97eb470bee | ||
|
|
7920d48156 | ||
|
|
b5ae3961bb | ||
|
|
06a0260c3c | ||
|
|
2488cc6442 | ||
|
|
9e4312453d | ||
|
|
4690e8b015 | ||
|
|
23284ee7bd | ||
|
|
b17e3adb60 | ||
|
|
5c591816cb | ||
|
|
5e602d3dab | ||
|
|
0ad4e16985 | ||
|
|
47b58b2ebb | ||
|
|
65be30daed | ||
|
|
429639f938 | ||
|
|
098412be83 | ||
|
|
9313bc9a6f | ||
|
|
180358ffb4 | ||
|
|
06700d05d1 | ||
|
|
869a223d43 | ||
|
|
635a8f772c | ||
|
|
f044bd10ef | ||
|
|
8379b08845 | ||
|
|
67fa273d00 | ||
|
|
b9f53528ee | ||
|
|
6e47e2996f | ||
|
|
a3db59df6f | ||
|
|
dbfb70134c | ||
|
|
831edb6614 | ||
|
|
53866b1ebb | ||
|
|
71435d15cf | ||
|
|
d24348c636 | ||
|
|
6ef440c03b | ||
|
|
f1faf0d327 | ||
|
|
1f20814fe8 | ||
|
|
377f4e7e31 | ||
|
|
f200f53a0b | ||
|
|
5eb6f6e922 | ||
|
|
e2d45ae24c | ||
|
|
d2dbe5b2ae | ||
|
|
2fc2748c5a | ||
|
|
2793cb097b | ||
|
|
b24f63f996 | ||
|
|
a1a12bbc34 | ||
|
|
01b5238d50 | ||
|
|
a187743e75 | ||
|
|
24cb4e60fc | ||
|
|
3f22092d45 | ||
|
|
2f3c9c04cc | ||
|
|
74c06cfc43 | ||
|
|
8003edc357 | ||
|
|
6ebe0cdf82 | ||
|
|
aa6ff4c8be | ||
|
|
8e0253ac3d | ||
|
|
e10916476a | ||
|
|
c0c8d25799 | ||
|
|
9dc7c1f081 | ||
|
|
373aecf3cd | ||
|
|
bfeecdbf62 | ||
|
|
c0dfa2f3f1 | ||
|
|
5c7d64b981 | ||
|
|
6011237232 | ||
|
|
25dc0fc376 | ||
|
|
fe07e7c984 | ||
|
|
3985311b2e | ||
|
|
26ebfa1ce1 | ||
|
|
b3a0a2d86f | ||
|
|
e8d30bba65 | ||
|
|
33c9d427fd | ||
|
|
498d7d8a4c | ||
|
|
491efeead9 | ||
|
|
762665cec1 | ||
|
|
e3354a8556 | ||
|
|
6cd2d1218e | ||
|
|
4b496e29bd | ||
|
|
13b5dd4a82 | ||
|
|
fc01683584 | ||
|
|
45e4cce8c2 | ||
|
|
79d62892ad | ||
|
|
ac310cbe09 | ||
|
|
50539c12f5 | ||
|
|
76708e9bf4 | ||
|
|
921bacd244 | ||
|
|
f2c3cbab00 | ||
|
|
24a5f48921 | ||
|
|
d78ae27865 | ||
|
|
ddc3f62290 | ||
|
|
08f731bae0 | ||
|
|
08e4312998 | ||
|
|
c7050eea55 | ||
|
|
81399e75ad | ||
|
|
6189062d12 | ||
|
|
988b95f150 | ||
|
|
ff26d9a4ff | ||
|
|
2ac57865cb | ||
|
|
86e323da6b | ||
|
|
81056ac999 | ||
|
|
575d055f90 | ||
|
|
d6af53bec0 | ||
|
|
d1c117ec80 | ||
|
|
32c757b12c | ||
|
|
ee1134da9d | ||
|
|
ac6e455f16 | ||
|
|
ad1f2f2d78 | ||
|
|
0c03a6a50f | ||
|
|
c8372f31f8 | ||
|
|
5946b9d41d | ||
|
|
21725c107d | ||
|
|
3eed5d3bdb | ||
|
|
15210b3e06 | ||
|
|
556faf0d3a | ||
|
|
82dee9dbc3 | ||
|
|
3cb1096425 | ||
|
|
4383596e9d | ||
|
|
e68d8eb1ff | ||
|
|
4c0a9db684 | ||
|
|
6dd606eabf | ||
|
|
4269db3991 | ||
|
|
f50f1bf7d6 | ||
|
|
6657c0e58e | ||
|
|
582c0ed74d | ||
|
|
707fbb966d | ||
|
|
1b2189c205 | ||
|
|
a89bcc465b | ||
|
|
e2730c3e2f | ||
|
|
029d91baa9 | ||
|
|
cedc0404e1 | ||
|
|
137495002d | ||
|
|
28663f45d6 | ||
|
|
bb830fc0d3 | ||
|
|
f19304bf22 | ||
|
|
1d14529942 | ||
|
|
5b40436aaf | ||
|
|
d78494cd6e | ||
|
|
330374be9e | ||
|
|
90285c46a2 | ||
|
|
6c0fcd575e | ||
|
|
3cc5e1add4 | ||
|
|
2144b289de | ||
|
|
f60593cc35 | ||
|
|
6bc21b6992 | ||
|
|
11193f5fa4 | ||
|
|
8214e5e284 | ||
|
|
ad5771aa28 | ||
|
|
042b5bf606 | ||
|
|
7b7091e905 | ||
|
|
ae947059e6 | ||
|
|
d59c49aecb | ||
|
|
6312d7238b | ||
|
|
0964b221e7 | ||
|
|
482afb8a6f | ||
|
|
423db7d35a | ||
|
|
eeab8e0680 | ||
|
|
1b2c01db1b | ||
|
|
19b790eb53 | ||
|
|
4d7c317700 | ||
|
|
f838e3c204 | ||
|
|
360de619c0 | ||
|
|
1bf6d23f34 | ||
|
|
f0a158d8c1 | ||
|
|
2758519ed2 | ||
|
|
65764218f7 | ||
|
|
a8cf207549 | ||
|
|
eec65ac664 | ||
|
|
4fe558f44f | ||
|
|
1ce7983ee3 | ||
|
|
c1b4cc24e4 | ||
|
|
61db813ff6 | ||
|
|
ac34bfd42b | ||
|
|
8fea317779 | ||
|
|
6704520919 | ||
|
|
fcd2a802a8 | ||
|
|
13d50be356 | ||
|
|
6faa2a636c | ||
|
|
e216edf294 | ||
|
|
769302d3d6 | ||
|
|
c046958745 | ||
|
|
ba9990cc00 | ||
|
|
60d52d68da | ||
|
|
a0147a8c32 | ||
|
|
7b87ff5b11 | ||
|
|
d7490d374d | ||
|
|
b697b67d53 | ||
|
|
be6490f4b3 | ||
|
|
a6e357da22 | ||
|
|
a0eaaa5c9f | ||
|
|
1207fcc6f0 | ||
|
|
cccfe8e0ce | ||
|
|
826b9590f2 | ||
|
|
4c10a31440 | ||
|
|
7bd7946346 | ||
|
|
78186ee5f5 | ||
|
|
49165ef796 | ||
|
|
31adc0a3c4 | ||
|
|
a09a8d4f3e | ||
|
|
277ff6f2ce | ||
|
|
f448dfe063 | ||
|
|
4b6b1bc47a | ||
|
|
a98b9ca8dc | ||
|
|
cbc9586c13 | ||
|
|
b641afc78a | ||
|
|
e7e6508854 | ||
|
|
354d88f883 | ||
|
|
a53514d4a9 | ||
|
|
8c69c6cd7f | ||
|
|
f28acecb78 | ||
|
|
8afc228c48 | ||
|
|
1bb7c4d78a | ||
|
|
2f892aca91 | ||
|
|
332842295a | ||
|
|
035c5a369c | ||
|
|
36e12d5bd8 | ||
|
|
0a42d36ac6 | ||
|
|
ed0b81c25c | ||
|
|
fc29251444 | ||
|
|
463be393c2 | ||
|
|
495970a17c | ||
|
|
7bfa47476c | ||
|
|
ec27911a7f | ||
|
|
2fd1f18803 | ||
|
|
6bbcab3ec4 | ||
|
|
cc6fed4c51 | ||
|
|
8579c59b3f | ||
|
|
40f440b8cd | ||
|
|
ebbd319ac0 | ||
|
|
8bca982581 | ||
|
|
5d78cefaf2 | ||
|
|
8d06457241 | ||
|
|
a31e9b0400 | ||
|
|
fc7438181b | ||
|
|
43b589c1cc | ||
|
|
b48b037fbe | ||
|
|
007104d60e | ||
|
|
b16fc7e7bf | ||
|
|
7f98ba962a | ||
|
|
24764ff47a | ||
|
|
a8111c5027 | ||
|
|
51ff10d7c0 | ||
|
|
451a6890d6 | ||
|
|
ac14a989b3 | ||
|
|
2a8961cdac | ||
|
|
1f11a57141 | ||
|
|
5f15ec05b2 | ||
|
|
456a125e00 | ||
|
|
b0159ad168 | ||
|
|
bcdaf033b5 | ||
|
|
77d5243f4a | ||
|
|
38ece51b25 | ||
|
|
987d3e6d85 | ||
|
|
6d0e53c2ca | ||
|
|
9ba760e603 | ||
|
|
dcc81d73e8 | ||
|
|
b09bcf6779 | ||
|
|
b90c2d7026 | ||
|
|
9ba65d2ea8 | ||
|
|
f5bce90216 | ||
|
|
7570df267f | ||
|
|
5fa734b708 | ||
|
|
869a181025 | ||
|
|
8630337c80 | ||
|
|
6244867b11 | ||
|
|
5706670029 | ||
|
|
ce386974bc | ||
|
|
bfc9c5c3a8 | ||
|
|
c5c25e7abc | ||
|
|
23204787d5 | ||
|
|
7c5e1d1b29 | ||
|
|
713454aca7 | ||
|
|
b7bf2733d6 | ||
|
|
d4188dcd5c | ||
|
|
d3e991a7b6 | ||
|
|
5c63cac05a | ||
|
|
6e25ad8b0a | ||
|
|
a1636b85b7 | ||
|
|
d5a0af826a | ||
|
|
72335b7642 | ||
|
|
7c334e2670 | ||
|
|
ae9222a72b | ||
|
|
4f962b4798 | ||
|
|
b8eddf00d8 | ||
|
|
0194fe55dc | ||
|
|
5a98cd3e92 | ||
|
|
0aceb25535 | ||
|
|
b6bb75963b | ||
|
|
86e1b9d770 | ||
|
|
f78d8e74fd | ||
|
|
51d46f8e46 | ||
|
|
09958abda8 | ||
|
|
75b2153b9a | ||
|
|
ca86603cd6 | ||
|
|
029e809780 | ||
|
|
1137ba9b32 | ||
|
|
4b34ff6903 | ||
|
|
ec56479675 | ||
|
|
57a88ce708 | ||
|
|
4ae9c03147 | ||
|
|
cfd28b671a | ||
|
|
a2a0562a9c | ||
|
|
99a13341bd | ||
|
|
3bf54e9b2b | ||
|
|
4e837dcfb3 | ||
|
|
4ac5eb7832 | ||
|
|
83ef7119f6 | ||
|
|
93f3bf5bda | ||
|
|
603ed23ebd | ||
|
|
50335291ae | ||
|
|
c37401f23f | ||
|
|
f9317dc039 | ||
|
|
b65ebdffac | ||
|
|
72e866db48 | ||
|
|
5d870f020d | ||
|
|
d17590fcf4 | ||
|
|
84d404aba3 | ||
|
|
8e918c407a | ||
|
|
1b7de33a68 | ||
|
|
b528d52ea8 | ||
|
|
d11b88cfc5 | ||
|
|
a033e6fcae | ||
|
|
4bddc57477 | ||
|
|
0164957abb | ||
|
|
30798fc3e1 | ||
|
|
f51eea4b32 | ||
|
|
a131085a5b | ||
|
|
94edf4fa12 | ||
|
|
86e8eff905 | ||
|
|
1718924b10 | ||
|
|
0f353411d7 | ||
|
|
5b0efc542f | ||
|
|
aacbfc41cc | ||
|
|
ee3b5fb5ea | ||
|
|
74177b215d | ||
|
|
e24ed988d6 | ||
|
|
55129194a3 | ||
|
|
d106968d77 | ||
|
|
87a9a2ecef | ||
|
|
86a23c1fbd | ||
|
|
8a304627a3 | ||
|
|
e85f78a20b | ||
|
|
b412fb7ad5 | ||
|
|
cfb108afc7 | ||
|
|
5230a36c2e | ||
|
|
7de730afe4 | ||
|
|
32f43d7571 | ||
|
|
8005ac2c64 | ||
|
|
05f8a5c550 | ||
|
|
8b459cfbb3 | ||
|
|
fa3adedf63 | ||
|
|
e0792d72d7 | ||
|
|
5c17d5e02f | ||
|
|
1f1f8d2207 | ||
|
|
bc314bda91 | ||
|
|
86378ff645 | ||
|
|
5f7c37bb84 | ||
|
|
32713a6b5a | ||
|
|
27fc7ab1f3 | ||
|
|
c78250332d | ||
|
|
76fbf21026 | ||
|
|
66a8efba53 | ||
|
|
9b599bac1d | ||
|
|
1a31d158ad | ||
|
|
512058ca98 | ||
|
|
9fdb773cdb | ||
|
|
485a037563 | ||
|
|
65ef539739 | ||
|
|
c1bfcc9119 | ||
|
|
1164052eea | ||
|
|
836a0957fb | ||
|
|
c28e35bd3e | ||
|
|
98d1cf7064 | ||
|
|
1c8c8aa4d8 | ||
|
|
48c6bb79f4 | ||
|
|
2fd5eb2569 | ||
|
|
78806e1b2e | ||
|
|
c114df82ec | ||
|
|
25f2145956 | ||
|
|
94a81c840a | ||
|
|
c39eb33b74 | ||
|
|
b464da5d73 | ||
|
|
987b87e2ad | ||
|
|
a774cc832f | ||
|
|
b0d37b81c4 | ||
|
|
cdd6743e88 | ||
|
|
4ed3a0cf3a | ||
|
|
0a04f49d2b | ||
|
|
fc7dced1fa | ||
|
|
c3f649557e | ||
|
|
9fd4c2a20d | ||
|
|
de93803ab0 | ||
|
|
d8b42a755d | ||
|
|
4d686f1616 | ||
|
|
4865e3f4f9 | ||
|
|
2ff73172b4 | ||
|
|
8dfc7699a6 | ||
|
|
63e2d73d1b | ||
|
|
f2b87f5fb7 | ||
|
|
62203ec287 | ||
|
|
bc0e36f402 | ||
|
|
5b52c5aa02 | ||
|
|
2521cc6bdf | ||
|
|
b4cf88a04f | ||
|
|
a3ffc0f7ad | ||
|
|
98493805fd | ||
|
|
9192dbecc9 | ||
|
|
8e5a82fd49 | ||
|
|
1dd6f5573a | ||
|
|
a16308efdb | ||
|
|
5fd3f34273 | ||
|
|
14ca3ea017 | ||
|
|
0ea82663e0 | ||
|
|
407316e451 | ||
|
|
a6957b7847 | ||
|
|
8451a86f0a | ||
|
|
bde2109b7c | ||
|
|
45db6482e8 | ||
|
|
ef95bf1bb9 | ||
|
|
436d6012a3 | ||
|
|
c33102ea6b | ||
|
|
4b2310a7ee | ||
|
|
12ef495cac | ||
|
|
a5094f7d7f | ||
|
|
b42c66ed10 | ||
|
|
19ff96081c | ||
|
|
ec30f25d0c | ||
|
|
61348227a7 | ||
|
|
a0602c06a3 | ||
|
|
e595328986 | ||
|
|
f250bfaa13 | ||
|
|
c3e73f0793 | ||
|
|
4683d6b713 | ||
|
|
365495b530 | ||
|
|
4432f197c1 | ||
|
|
cb176df60f | ||
|
|
7685e98304 | ||
|
|
83d1f45578 | ||
|
|
2ba76cfec6 | ||
|
|
9944688d2b | ||
|
|
d89e33fc92 | ||
|
|
1749530ec1 | ||
|
|
bef0e3eb63 | ||
|
|
3efbb8f133 | ||
|
|
23e97af1b4 | ||
|
|
da25ecf758 | ||
|
|
5df6b80093 | ||
|
|
0937d6c367 | ||
|
|
88ac328e6b | ||
|
|
a34d34bc1f | ||
|
|
44231405cf | ||
|
|
cf95efbad1 | ||
|
|
4206784d82 | ||
|
|
1f9ce647cf | ||
|
|
27d53256e4 | ||
|
|
91655261a1 | ||
|
|
4f063f2925 | ||
|
|
2a8fabf4ad | ||
|
|
ecf1a36d48 | ||
|
|
35a108b911 | ||
|
|
851dc95566 | ||
|
|
adf0b6fb26 | ||
|
|
eedff09bfd | ||
|
|
72fc754948 | ||
|
|
e6cb76a2e2 | ||
|
|
18924ea563 | ||
|
|
cbd276e4ce | ||
|
|
bf7397b64e | ||
|
|
f3c98fdca2 | ||
|
|
975efeac31 | ||
|
|
5af8c345be | ||
|
|
6b867ec05c | ||
|
|
2a67e38d88 | ||
|
|
dd6569d342 | ||
|
|
7c4cd0e6b0 | ||
|
|
4cb358d999 | ||
|
|
a4af231978 | ||
|
|
1ce69592d2 | ||
|
|
3922d45719 | ||
|
|
c460974814 | ||
|
|
8c88a0219b | ||
|
|
d3b3c9d36d | ||
|
|
1a326acada | ||
|
|
e3bfaaa2d0 | ||
|
|
1ba0936619 | ||
|
|
1597e701a0 | ||
|
|
cf4f92dc21 | ||
|
|
97c169b93a | ||
|
|
1e9a3c1423 | ||
|
|
56b99ca816 | ||
|
|
5af2471a9a | ||
|
|
b706112487 | ||
|
|
6686e9ae9f | ||
|
|
e306663455 | ||
|
|
ff835e0e35 | ||
|
|
df60646f98 | ||
|
|
b5e7af96c9 | ||
|
|
1b56fdb33c | ||
|
|
f08f2bd88c | ||
|
|
49284caf2a | ||
|
|
d845891a50 | ||
|
|
c9da61022b | ||
|
|
c6fec6866f | ||
|
|
064cb7583a | ||
|
|
391fd926ff | ||
|
|
ebba20a65d | ||
|
|
728f0f0c49 | ||
|
|
5e57818431 | ||
|
|
ad9ba944d1 | ||
|
|
b14a86ca5c | ||
|
|
8a03d497b8 | ||
|
|
bdd4f5857f | ||
|
|
f029b0e0b1 | ||
|
|
448f4305e2 | ||
|
|
c5001b0a5f | ||
|
|
d70e7ff3b6 | ||
|
|
157e82e76a | ||
|
|
cb2ee95cf9 | ||
|
|
4876a324ab | ||
|
|
4b02d003db | ||
|
|
8f82633fa2 | ||
|
|
15b0595013 | ||
|
|
d6598cc7cd | ||
|
|
f28a0a5258 | ||
|
|
ffb97108c9 | ||
|
|
0985235ba0 | ||
|
|
7c9fe576a8 | ||
|
|
35b471ad94 | ||
|
|
3bcfb76e45 | ||
|
|
c7f1b547cb | ||
|
|
cca24d06d8 | ||
|
|
144de8a7b3 | ||
|
|
c107dbe1d0 | ||
|
|
2db33d5c8c | ||
|
|
310876dcec | ||
|
|
82ce09234b | ||
|
|
2fe20e5aaf | ||
|
|
477b616fe8 |
43
.gitignore
vendored
Normal file
43
.gitignore
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
cscope.*
|
||||
*.swap
|
||||
.*.sw[po]
|
||||
.sw[po]
|
||||
*~
|
||||
*.orig
|
||||
*.diff
|
||||
*.patch
|
||||
*.rej
|
||||
*.[1-9].gz
|
||||
*.o
|
||||
*.[psS]o
|
||||
*.pico
|
||||
lib*.so*
|
||||
*.a
|
||||
*.so.*
|
||||
*.d
|
||||
.depend
|
||||
nbsdsrc/*
|
||||
TAGS
|
||||
tags
|
||||
GPATH
|
||||
GRTAGS
|
||||
GSYMS
|
||||
GTAGS
|
||||
\#*#
|
||||
CVS
|
||||
!/.gitignore
|
||||
.gitignore
|
||||
.svn
|
||||
minix-port.patch
|
||||
*.worldstone.log
|
||||
.worldstone*
|
||||
usr.bin/mdocml/man/*.7
|
||||
etc/passwd
|
||||
etc/pwd.db
|
||||
etc/spwd.db
|
||||
releasetools/image
|
||||
releasetools/kernel
|
||||
releasetools/revision
|
||||
share/zoneinfo/builddir
|
||||
lib/libc/compat__*
|
||||
.gdbinit
|
||||
17
.gitreview
Normal file
17
.gitreview
Normal file
@@ -0,0 +1,17 @@
|
||||
# MINIX 3 code review setup.
|
||||
#
|
||||
# This gerrit code review configuration is meant for performing per commit
|
||||
# internal code reviews. If you are an external contributor please read and
|
||||
# apply http://wiki.minix3.org/en/HowToContribute
|
||||
#
|
||||
# Consider reading http://wiki.openstack.org/GerritWorkflow to learn how
|
||||
# to install git review on a Linux setup. On Minix you can use pkgin to
|
||||
# install git-review.
|
||||
#
|
||||
[gerrit]
|
||||
# The git-minix host is to be configured in your .ssh/config
|
||||
#
|
||||
host=git-minix
|
||||
port=2222
|
||||
project=minix
|
||||
defaultbranch=master
|
||||
588
Makefile
588
Makefile
@@ -1,71 +1,545 @@
|
||||
# Master Makefile to compile everything in /usr/src except the system.
|
||||
# $NetBSD: Makefile,v 1.299 2012/08/17 16:22:27 joerg Exp $
|
||||
|
||||
MAKE = exec make -$(MAKEFLAGS)
|
||||
#
|
||||
# This is the top-level makefile for building NetBSD. For an outline of
|
||||
# how to build a snapshot or release, as well as other release engineering
|
||||
# information, see http://www.NetBSD.org/developers/releng/index.html
|
||||
#
|
||||
# Not everything you can set or do is documented in this makefile. In
|
||||
# particular, you should review the files in /usr/share/mk (especially
|
||||
# bsd.README) for general information on building programs and writing
|
||||
# Makefiles within this structure, and see the comments in src/etc/Makefile
|
||||
# for further information on installation and release set options.
|
||||
#
|
||||
# Variables listed below can be set on the make command line (highest
|
||||
# priority), in /etc/mk.conf (middle priority), or in the environment
|
||||
# (lowest priority).
|
||||
#
|
||||
# Variables:
|
||||
# DESTDIR is the target directory for installation of the compiled
|
||||
# software. It defaults to /. Note that programs are built against
|
||||
# libraries installed in DESTDIR.
|
||||
# MKMAN, if `no', will prevent building of manual pages.
|
||||
# MKOBJDIRS, if not `no', will build object directories at
|
||||
# an appropriate point in a build.
|
||||
# MKSHARE, if `no', will prevent building and installing
|
||||
# anything in /usr/share.
|
||||
# MKUPDATE, if not `no', will avoid a `make cleandir' at the start of
|
||||
# `make build', as well as having the effects listed in
|
||||
# /usr/share/mk/bsd.README.
|
||||
# NOCLEANDIR, if defined, will avoid a `make cleandir' at the start
|
||||
# of the `make build'.
|
||||
# NOINCLUDES will avoid the `make includes' usually done by `make build'.
|
||||
#
|
||||
# See mk.conf(5) for more details.
|
||||
#
|
||||
#
|
||||
# Targets:
|
||||
# build:
|
||||
# Builds a full release of NetBSD in DESTDIR, except for the
|
||||
# /etc configuration files.
|
||||
# If BUILD_DONE is set, this is an empty target.
|
||||
# distribution:
|
||||
# Builds a full release of NetBSD in DESTDIR, including the /etc
|
||||
# configuration files.
|
||||
# buildworld:
|
||||
# As per `make distribution', except that it ensures that DESTDIR
|
||||
# is not the root directory.
|
||||
# installworld:
|
||||
# Install the distribution from DESTDIR to INSTALLWORLDDIR (which
|
||||
# defaults to the root directory). Ensures that INSTALLWORLDDIR
|
||||
# is not the root directory if cross compiling.
|
||||
# release:
|
||||
# Does a `make distribution', and then tars up the DESTDIR files
|
||||
# into ${RELEASEDIR}/${RELEASEMACHINEDIR}, in release(7) format.
|
||||
# (See etc/Makefile for more information on this.)
|
||||
# regression-tests:
|
||||
# Runs the regression tests in "regress" on this host.
|
||||
# sets:
|
||||
# Populate ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets
|
||||
# from ${DESTDIR}
|
||||
# sourcesets:
|
||||
# Populate ${RELEASEDIR}/source/sets from ${NETBSDSRCDIR}
|
||||
# syspkgs:
|
||||
# Populate ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/syspkgs
|
||||
# from ${DESTDIR}
|
||||
# iso-image:
|
||||
# Create CD-ROM image in RELEASEDIR/iso.
|
||||
# RELEASEDIR must already have been populated by `make release'
|
||||
# or equivalent.
|
||||
# iso-image-source:
|
||||
# Create CD-ROM image with source in RELEASEDIR/iso.
|
||||
# RELEASEDIR must already have been populated by
|
||||
# `make release sourcesets' or equivalent.
|
||||
# live-image:
|
||||
# Create bootable live image for emulators or USB stick etc.
|
||||
# in RELEASEDIR/liveimage.
|
||||
# RELEASEDIR must already have been populated by `make release'
|
||||
# or equivalent.
|
||||
# install-image:
|
||||
# Create bootable installation image for USB stick etc.
|
||||
# in RELEASEDIR/installimage.
|
||||
# RELEASEDIR must already have been populated by `make release'
|
||||
# or equivalent.
|
||||
#
|
||||
# Targets invoked by `make build,' in order:
|
||||
# cleandir: cleans the tree.
|
||||
# do-top-obj: creates the top level object directory.
|
||||
# do-tools-obj: creates object directories for the host toolchain.
|
||||
# do-tools: builds host toolchain.
|
||||
# obj: creates object directories.
|
||||
# do-distrib-dirs: creates the distribution directories.
|
||||
# includes: installs include files.
|
||||
# do-tools-compat: builds the "libnbcompat" library; needed for some
|
||||
# random host tool programs in the source tree.
|
||||
# do-lib: builds and installs prerequisites from lib
|
||||
# if ${MKCOMPAT} != "no".
|
||||
# do-compat-lib: builds and installs prerequisites from compat/lib
|
||||
# if ${MKCOMPAT} != "no".
|
||||
# do-build: builds and installs the entire system.
|
||||
# do-x11: builds and installs X11 if ${MKX11} != "no"; either
|
||||
# X11R7 from src/external/mit/xorg if ${X11FLAVOUR} == "Xorg"
|
||||
# or X11R6 from src/x11
|
||||
# do-extsrc: builds and installs extsrc if ${MKEXTSRC} != "no".
|
||||
# do-obsolete: installs the obsolete sets (for the postinstall-* targets).
|
||||
#
|
||||
|
||||
usage:
|
||||
@echo ""
|
||||
@echo "Master Makefile for MINIX commands and utilities."
|
||||
@echo "Root privileges are required for some actions."
|
||||
@echo ""
|
||||
@echo "Usage:"
|
||||
@echo " make world # Compile everything (libraries & commands)"
|
||||
@echo " make includes # Install include files from src/"
|
||||
@echo " make libraries # Compile and install libraries"
|
||||
@echo " make cmds # Compile all, commands, but don't install"
|
||||
@echo " make install # Compile and install commands"
|
||||
@echo " make depend # Generate required .depend files"
|
||||
@echo " make clean # Remove all compiler results"
|
||||
@echo ""
|
||||
@echo "Run 'make' in tools/ to create a new MINIX configuration."
|
||||
@echo ""
|
||||
.if ${.MAKEFLAGS:M${.CURDIR}/share/mk} == ""
|
||||
.MAKEFLAGS: -m ${.CURDIR}/share/mk
|
||||
.endif
|
||||
|
||||
# world has to be able to make a new system, even if there
|
||||
# is no complete old system. it has to install commands, for which
|
||||
# it has to install libraries, for which it has to install includes,
|
||||
# for which it has to install /etc (for users and ownerships).
|
||||
# etcfiles also creates a directory hierarchy in its
|
||||
# 'make install' target.
|
||||
#
|
||||
# etcfiles has to be done first.
|
||||
world: includes depend libraries cmds install postinstall
|
||||
#
|
||||
# If _SRC_TOP_OBJ_ gets set here, we will end up with a directory that may
|
||||
# not be the top level objdir, because "make obj" can happen in the *middle*
|
||||
# of "make build" (long after <bsd.own.mk> is calculated it). So, pre-set
|
||||
# _SRC_TOP_OBJ_ here so it will not be added to ${.MAKEOVERRIDES}.
|
||||
#
|
||||
_SRC_TOP_OBJ_=
|
||||
|
||||
includes:
|
||||
cd include && $(MAKE) install gcc
|
||||
.include <bsd.own.mk>
|
||||
|
||||
libraries:
|
||||
cd lib && $(MAKE) all install
|
||||
#
|
||||
# Sanity check: make sure that "make build" is not invoked simultaneously
|
||||
# with a standard recursive target.
|
||||
#
|
||||
|
||||
cmds:
|
||||
if [ -f commands/Makefile ] ; then cd commands && $(MAKE) all; fi
|
||||
.if make(build) || make(release) || make(snapshot)
|
||||
.for targ in ${TARGETS:Nobj:Ncleandir}
|
||||
.if make(${targ}) && !target(.BEGIN)
|
||||
.BEGIN:
|
||||
@echo 'BUILD ABORTED: "make build" and "make ${targ}" are mutually exclusive.'
|
||||
@false
|
||||
.endif
|
||||
.endfor
|
||||
.endif
|
||||
|
||||
install::
|
||||
if [ -f commands/Makefile ] ; then cd commands && $(MAKE) install; fi
|
||||
#
|
||||
# _SUBDIR is used to set SUBDIR, after removing directories that have
|
||||
# BUILD_${dir}=no, or that have no ${dir}/Makefile.
|
||||
#
|
||||
_SUBDIR= tools lib .WAIT include gnu external crypto/external bin games
|
||||
_SUBDIR+= libexec sbin usr.bin
|
||||
_SUBDIR+= commands man
|
||||
_SUBDIR+= common drivers kernel servers
|
||||
_SUBDIR+= usr.sbin share rescue sys etc tests compat .WAIT distrib regress
|
||||
|
||||
depend::
|
||||
mkdep kernel
|
||||
mkdep servers
|
||||
mkdep drivers
|
||||
cd kernel && $(MAKE) $@
|
||||
cd servers && $(MAKE) $@
|
||||
cd drivers && $(MAKE) $@
|
||||
.for dir in ${_SUBDIR}
|
||||
.if "${dir}" == ".WAIT" \
|
||||
|| (${BUILD_${dir}:Uyes} != "no" && exists(${dir}/Makefile))
|
||||
SUBDIR+= ${dir}
|
||||
.endif
|
||||
.endfor
|
||||
|
||||
.if exists(regress)
|
||||
regression-tests: .PHONY .MAKE
|
||||
@echo Running regression tests...
|
||||
${MAKEDIRTARGET} regress regress
|
||||
.endif
|
||||
|
||||
.if ${MKUNPRIVED} != "no"
|
||||
NOPOSTINSTALL= # defined
|
||||
.endif
|
||||
|
||||
afterinstall: .PHONY .MAKE
|
||||
.if ${MKMAN} != "no"
|
||||
.if !defined(__MINIX)
|
||||
${MAKEDIRTARGET} share/man makedb
|
||||
.else
|
||||
${MAKEDIRTARGET} man makedb
|
||||
.endif # !defined(__MINIX)
|
||||
.endif
|
||||
.if !defined(__MINIX)
|
||||
.if (${MKUNPRIVED} != "no" && ${MKINFO} != "no")
|
||||
${MAKEDIRTARGET} gnu/usr.bin/texinfo/install-info infodir-meta
|
||||
.endif
|
||||
.endif # !defined(__MINIX)
|
||||
.if !defined(NOPOSTINSTALL)
|
||||
${MAKEDIRTARGET} . postinstall-check
|
||||
.endif
|
||||
|
||||
_POSTINSTALL= ${.CURDIR}/usr.sbin/postinstall/postinstall
|
||||
_POSTINSTALL_ENV= \
|
||||
AWK=${TOOL_AWK:Q} \
|
||||
DB=${TOOL_DB:Q} \
|
||||
HOST_SH=${HOST_SH:Q} \
|
||||
MAKE=${MAKE:Q} \
|
||||
PWD_MKDB=${TOOL_PWD_MKDB:Q} \
|
||||
STAT=${TOOL_STAT:Q}
|
||||
|
||||
postinstall-check: .PHONY
|
||||
@echo " === Post installation checks ==="
|
||||
${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} -d ${DESTDIR}/ check; if [ $$? -gt 1 ]; then exit 1; fi
|
||||
@echo " ================================"
|
||||
|
||||
postinstall-fix: .NOTMAIN .PHONY
|
||||
@echo " === Post installation fixes ==="
|
||||
${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} -d ${DESTDIR}/ fix
|
||||
@echo " ==============================="
|
||||
|
||||
postinstall-fix-obsolete: .NOTMAIN .PHONY
|
||||
@echo " === Removing obsolete files ==="
|
||||
${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} -d ${DESTDIR}/ fix obsolete
|
||||
@echo " ==============================="
|
||||
|
||||
|
||||
clean::
|
||||
cd lib && $(MAKE) $@
|
||||
test ! -f commands/Makefile || { cd commands && $(MAKE) $@; }
|
||||
#
|
||||
# Targets (in order!) called by "make build".
|
||||
#
|
||||
.if defined(HAVE_GCC)
|
||||
.if ${HAVE_GCC} == "4"
|
||||
LIBGCC_EXT=4
|
||||
BUILD_CC_LIB_BASEDIR= gnu/lib
|
||||
BUILD_CC_LIB_BASETARGET= gnu-lib
|
||||
.else
|
||||
LIBGCC_EXT=
|
||||
BUILD_CC_LIB_BASEDIR= external/gpl3/gcc/lib
|
||||
BUILD_CC_LIB_BASETARGET= external-gpl3-gcc-lib
|
||||
.endif
|
||||
.endif
|
||||
|
||||
etcfiles::
|
||||
cd etc && $(MAKE) install
|
||||
BUILDTARGETS+= check-tools
|
||||
.if ${MKUPDATE} == "no" && !defined(NOCLEANDIR)
|
||||
BUILDTARGETS+= cleandir
|
||||
.endif
|
||||
.if ${MKOBJDIRS} != "no"
|
||||
BUILDTARGETS+= do-top-obj
|
||||
.endif
|
||||
.if ${USETOOLS} == "yes" # {
|
||||
.if ${MKOBJDIRS} != "no"
|
||||
BUILDTARGETS+= do-tools-obj
|
||||
.endif
|
||||
BUILDTARGETS+= do-tools
|
||||
.endif # USETOOLS # }
|
||||
.if ${MKOBJDIRS} != "no"
|
||||
BUILDTARGETS+= obj
|
||||
.endif
|
||||
BUILDTARGETS+= clean_METALOG
|
||||
.if !defined(NODISTRIBDIRS)
|
||||
BUILDTARGETS+= do-distrib-dirs
|
||||
.endif
|
||||
.if !defined(NOINCLUDES)
|
||||
BUILDTARGETS+= includes
|
||||
.endif
|
||||
BUILDTARGETS+= do-lib
|
||||
.if !defined(__MINIX)
|
||||
# LSC Not used in MINIX3
|
||||
BUILDTARGETS+= do-compat-lib
|
||||
.endif # !defined(__MINIX)
|
||||
BUILDTARGETS+= do-build
|
||||
.if ${MKX11} != "no"
|
||||
BUILDTARGETS+= do-x11
|
||||
.endif
|
||||
.if ${MKEXTSRC} != "no"
|
||||
BUILDTARGETS+= do-extsrc
|
||||
.endif
|
||||
BUILDTARGETS+= do-obsolete
|
||||
|
||||
clean::
|
||||
cd test && $(MAKE) $@
|
||||
#
|
||||
# Enforce proper ordering of some rules.
|
||||
#
|
||||
|
||||
all install clean::
|
||||
cd boot && $(MAKE) $@
|
||||
cd man && $(MAKE) $@ # First manpages, then commands
|
||||
test ! -f commands/Makefile || { cd commands && $(MAKE) $@; }
|
||||
cd tools && $(MAKE) $@
|
||||
cd servers && $(MAKE) $@
|
||||
.ORDER: ${BUILDTARGETS}
|
||||
includes-lib: .PHONY includes-include includes-sys
|
||||
includes-gnu: .PHONY includes-lib
|
||||
|
||||
postinstall:
|
||||
cd etc && $(MAKE) $@
|
||||
#
|
||||
# Build the system and install into DESTDIR.
|
||||
#
|
||||
|
||||
START_TIME!= date
|
||||
|
||||
.if defined(__MINIX)
|
||||
world: build .PHONY .MAKE
|
||||
${MAKEDIRTARGET} . etcfiles
|
||||
@echo "WARNING: "
|
||||
@echo "WARNING: The 'world' target is obsolete, please use 'build' instead."
|
||||
@echo "WARNING: "
|
||||
|
||||
etcfiles: .PHONY .MAKE
|
||||
${MAKEDIRTARGET} etc install-etc-files-safe DESTDIR=${DESTDIR:U/}
|
||||
|
||||
etcforce: .PHONY .MAKE
|
||||
${MAKEDIRTARGET} etc install-etc-files DESTDIR=${DESTDIR:U/}
|
||||
|
||||
.endif # defined(__MINIX)
|
||||
|
||||
build: .PHONY .MAKE
|
||||
.if defined(BUILD_DONE)
|
||||
@echo "Build already installed into ${DESTDIR}"
|
||||
.else
|
||||
@echo "Build started at: ${START_TIME}"
|
||||
.for tgt in ${BUILDTARGETS}
|
||||
${MAKEDIRTARGET} . ${tgt}
|
||||
.endfor
|
||||
${MAKEDIRTARGET} etc install-etc-release
|
||||
.if defined(__MINIX)
|
||||
${MAKEDIRTARGET} releasetools do-hdboot
|
||||
.endif # defined(__MINIX)
|
||||
@echo "Build started at: ${START_TIME}"
|
||||
@printf "Build finished at: " && date
|
||||
.endif
|
||||
|
||||
#
|
||||
# Build a full distribution, but not a release (i.e. no sets into
|
||||
# ${RELEASEDIR}). "buildworld" enforces a build to ${DESTDIR} != /
|
||||
#
|
||||
|
||||
distribution buildworld: .PHONY .MAKE
|
||||
.if make(buildworld) && \
|
||||
(!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
|
||||
@echo "Won't make ${.TARGET} with DESTDIR=/"
|
||||
@false
|
||||
.endif
|
||||
${MAKEDIRTARGET} . build NOPOSTINSTALL=1
|
||||
${MAKEDIRTARGET} etc distribution INSTALL_DONE=1
|
||||
.if defined(DESTDIR) && ${DESTDIR} != "" && ${DESTDIR} != "/" && ${CHECKFLIST:Uyes} == "yes"
|
||||
${MAKEDIRTARGET} . postinstall-fix-obsolete
|
||||
${MAKEDIRTARGET} distrib/sets checkflist
|
||||
.endif
|
||||
@echo "make ${.TARGET} started at: ${START_TIME}"
|
||||
@printf "make ${.TARGET} finished at: " && date
|
||||
|
||||
#
|
||||
# Install the distribution from $DESTDIR to $INSTALLWORLDDIR (defaults to `/')
|
||||
# If installing to /, ensures that the host's operating system is NetBSD and
|
||||
# the host's `uname -m` == ${MACHINE}.
|
||||
#
|
||||
|
||||
HOST_UNAME_S!= uname -s
|
||||
.if ${HOST_OSTYPE:C/\-.*//} != "Minix"
|
||||
HOST_UNAME_M!= uname -m
|
||||
.else
|
||||
HOST_UNAME_M:= ${MACHINE}
|
||||
.endif
|
||||
|
||||
installworld: .PHONY .MAKE
|
||||
.if (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
|
||||
@echo "Can't make ${.TARGET} to DESTDIR=/"
|
||||
@false
|
||||
.endif
|
||||
.if !defined(INSTALLWORLDDIR) || \
|
||||
${INSTALLWORLDDIR} == "" || ${INSTALLWORLDDIR} == "/"
|
||||
.if (${HOST_UNAME_S} != "Minix")
|
||||
@echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_S} to Minix with INSTALLWORLDDIR=/"
|
||||
@false
|
||||
.endif
|
||||
.if (${HOST_UNAME_M} != ${MACHINE})
|
||||
@echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_M} to ${MACHINE} with INSTALLWORLDDIR=/"
|
||||
@false
|
||||
.endif
|
||||
.endif
|
||||
${MAKEDIRTARGET} distrib/sets installsets \
|
||||
INSTALLDIR=${INSTALLWORLDDIR:U/} INSTALLSETS=${INSTALLSETS:Q}
|
||||
${MAKEDIRTARGET} . postinstall-check DESTDIR=${INSTALLWORLDDIR}
|
||||
@echo "make ${.TARGET} started at: ${START_TIME}"
|
||||
@printf "make ${.TARGET} finished at: " && date
|
||||
|
||||
#
|
||||
# Install modules from $DESTDIR to $INSTALLMODULESDIR
|
||||
#
|
||||
installmodules: .PHONY .MAKE
|
||||
.if (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
|
||||
@echo "Can't make ${.TARGET} to DESTDIR=/"
|
||||
@false
|
||||
.endif
|
||||
.if !defined(INSTALLMODULESDIR) || \
|
||||
${INSTALLMODULESDIR} == "" || ${INSTALLMODULESDIR} == "/"
|
||||
.if (${HOST_UNAME_S} != "NetBSD")
|
||||
@echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_S} to NetBSD with INSTALLMODULESDIR=/"
|
||||
@false
|
||||
.endif
|
||||
.if (${HOST_UNAME_M} != ${MACHINE})
|
||||
@echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_M} to ${MACHINE} with INSTALLMODULESDIR=/"
|
||||
@false
|
||||
.endif
|
||||
.endif
|
||||
${MAKEDIRTARGET} sys/modules install DESTDIR=${INSTALLMODULESDIR:U/}
|
||||
@echo "make ${.TARGET} started at: ${START_TIME}"
|
||||
@printf "make ${.TARGET} finished at: " && date
|
||||
|
||||
#
|
||||
# Create sets from $DESTDIR or $NETBSDSRCDIR into $RELEASEDIR
|
||||
#
|
||||
|
||||
.for tgt in sets sourcesets syspkgs
|
||||
${tgt}: .PHONY .MAKE
|
||||
${MAKEDIRTARGET} distrib/sets ${tgt}
|
||||
.endfor
|
||||
|
||||
#
|
||||
# Build a release or snapshot (implies "make distribution"). Note that
|
||||
# in this case, the set lists will be checked before the tar files
|
||||
# are made.
|
||||
#
|
||||
|
||||
release snapshot: .PHONY .MAKE
|
||||
${MAKEDIRTARGET} . distribution
|
||||
${MAKEDIRTARGET} etc release DISTRIBUTION_DONE=1
|
||||
@echo "make ${.TARGET} started at: ${START_TIME}"
|
||||
@printf "make ${.TARGET} finished at: " && date
|
||||
|
||||
#
|
||||
# Create a CD-ROM image.
|
||||
#
|
||||
|
||||
iso-image: .PHONY
|
||||
${MAKEDIRTARGET} distrib iso_image
|
||||
${MAKEDIRTARGET} etc iso-image
|
||||
@echo "make ${.TARGET} started at: ${START_TIME}"
|
||||
@printf "make ${.TARGET} finished at: " && date
|
||||
|
||||
iso-image-source: .PHONY
|
||||
${MAKEDIRTARGET} distrib iso_image CDSOURCE=true
|
||||
${MAKEDIRTARGET} etc iso-image
|
||||
@echo "make ${.TARGET} started at: ${START_TIME}"
|
||||
@printf "make ${.TARGET} finished at: " && date
|
||||
|
||||
#
|
||||
# Create bootable live images.
|
||||
#
|
||||
|
||||
live-image: .PHONY
|
||||
${MAKEDIRTARGET} etc live-image
|
||||
@echo "make ${.TARGET} started at: ${START_TIME}"
|
||||
@printf "make ${.TARGET} finished at: " && date
|
||||
|
||||
#
|
||||
# Create bootable installation images.
|
||||
#
|
||||
|
||||
install-image: .PHONY
|
||||
${MAKEDIRTARGET} etc install-image
|
||||
@echo "make ${.TARGET} started at: ${START_TIME}"
|
||||
@printf "make ${.TARGET} finished at: " && date
|
||||
|
||||
#
|
||||
# Special components of the "make build" process.
|
||||
#
|
||||
|
||||
check-tools: .PHONY
|
||||
.if ${TOOLCHAIN_MISSING} != "no" && !defined(EXTERNAL_TOOLCHAIN)
|
||||
@echo '*** WARNING: Building on MACHINE=${MACHINE} with missing toolchain.'
|
||||
@echo '*** May result in a failed build or corrupt binaries!'
|
||||
.elif defined(EXTERNAL_TOOLCHAIN)
|
||||
@echo '*** Using external toolchain rooted at ${EXTERNAL_TOOLCHAIN}.'
|
||||
.endif
|
||||
.if defined(NBUILDJOBS)
|
||||
@echo '*** WARNING: NBUILDJOBS is obsolete; use -j directly instead!'
|
||||
.endif
|
||||
|
||||
# Delete or sanitise a leftover METALOG from a previous build.
|
||||
clean_METALOG: .PHONY .MAKE
|
||||
.if ${MKUPDATE} != "no"
|
||||
${MAKEDIRTARGET} distrib/sets clean_METALOG
|
||||
.endif
|
||||
|
||||
do-distrib-dirs: .PHONY .MAKE
|
||||
.if !defined(DESTDIR) || ${DESTDIR} == ""
|
||||
${MAKEDIRTARGET} etc distrib-dirs DESTDIR=/
|
||||
.else
|
||||
${MAKEDIRTARGET} etc distrib-dirs DESTDIR=${DESTDIR}
|
||||
.endif
|
||||
|
||||
.for targ in cleandir obj includes
|
||||
do-${targ}: .PHONY ${targ}
|
||||
@true
|
||||
.endfor
|
||||
|
||||
.for dir in tools tools/compat
|
||||
do-${dir:S/\//-/g}: .PHONY .MAKE
|
||||
.for targ in dependall install
|
||||
${MAKEDIRTARGET} ${dir} ${targ}
|
||||
.endfor
|
||||
.endfor
|
||||
|
||||
do-lib: .PHONY .MAKE
|
||||
${MAKEDIRTARGET} lib build_install
|
||||
|
||||
do-compat-lib: .PHONY .MAKE
|
||||
${MAKEDIRTARGET} compat build_install BOOTSTRAP_SUBDIRS="../../../lib"
|
||||
|
||||
do-top-obj: .PHONY .MAKE
|
||||
${MAKEDIRTARGET} . obj NOSUBDIR=
|
||||
|
||||
do-tools-obj: .PHONY .MAKE
|
||||
${MAKEDIRTARGET} tools obj
|
||||
|
||||
do-build: .PHONY .MAKE
|
||||
.for targ in dependall install
|
||||
${MAKEDIRTARGET} . ${targ} BUILD_tools=no BUILD_lib=no
|
||||
.endfor
|
||||
|
||||
do-x11: .PHONY .MAKE
|
||||
.if ${MKX11} != "no"
|
||||
.if ${X11FLAVOUR} == "Xorg"
|
||||
${MAKEDIRTARGET} external/mit/xorg build
|
||||
.else
|
||||
${MAKEDIRTARGET} x11 build
|
||||
.endif
|
||||
.else
|
||||
@echo "MKX11 is not enabled"
|
||||
@false
|
||||
.endif
|
||||
|
||||
do-extsrc: .PHONY .MAKE
|
||||
.if ${MKEXTSRC} != "no"
|
||||
${MAKEDIRTARGET} extsrc build
|
||||
.else
|
||||
@echo "MKEXTSRC is not enabled"
|
||||
@false
|
||||
.endif
|
||||
|
||||
do-obsolete: .PHONY .MAKE
|
||||
${MAKEDIRTARGET} etc install-obsolete-lists
|
||||
|
||||
#
|
||||
# Speedup stubs for some subtrees that don't need to run these rules.
|
||||
# (Tells <bsd.subdir.mk> not to recurse for them.)
|
||||
#
|
||||
|
||||
.for dir in bin etc distrib games libexec regress sbin usr.bin usr.sbin tools
|
||||
includes-${dir}: .PHONY
|
||||
@true
|
||||
.endfor
|
||||
.for dir in etc distrib regress
|
||||
install-${dir}: .PHONY
|
||||
@true
|
||||
.endfor
|
||||
|
||||
#
|
||||
# XXX this needs to change when distrib Makefiles are recursion compliant
|
||||
# XXX many distrib subdirs need "cd etc && make snap_pre snap_kern" first...
|
||||
#
|
||||
dependall-distrib depend-distrib all-distrib: .PHONY
|
||||
@true
|
||||
|
||||
.include <bsd.sys.mk>
|
||||
.include <bsd.obj.mk>
|
||||
.include <bsd.kernobj.mk>
|
||||
.include <bsd.subdir.mk>
|
||||
|
||||
#
|
||||
# Display current make(1) parameters
|
||||
#
|
||||
params: .PHONY .MAKE
|
||||
${MAKEDIRTARGET} etc params
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/perl -w
|
||||
#!/usr/pkg/bin/perl -w
|
||||
|
||||
use strict;
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#!/bin/sh
|
||||
export CC=cc
|
||||
export MINIX=1
|
||||
if perl -e 'exit 0'
|
||||
then perl -w Run
|
||||
else echo "perl not installed. please install perl to run unixbench." >&2
|
||||
exit 1
|
||||
fi
|
||||
./Run
|
||||
|
||||
@@ -932,9 +932,9 @@ SPDP dtime()
|
||||
return q;
|
||||
}
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/times.h>
|
||||
#include <minix/sysinfo.h>
|
||||
#include <time.h>
|
||||
|
||||
struct tms tms;
|
||||
@@ -945,7 +945,7 @@ SPDP dtime(void)
|
||||
int secs, msecs;
|
||||
u32_t system_hz;
|
||||
times(&tms);
|
||||
getsysinfo_up(PM_PROC_NR, SIU_SYSTEMHZ, sizeof(system_hz), &system_hz);
|
||||
system_hz = (u32_t) sysconf(_SC_CLK_TCK);
|
||||
secs = tms.tms_utime / system_hz;
|
||||
q = secs;
|
||||
tms.tms_utime -= secs * system_hz;
|
||||
|
||||
7
bin/Makefile
Normal file
7
bin/Makefile
Normal file
@@ -0,0 +1,7 @@
|
||||
# $NetBSD: Makefile,v 1.22 2007/12/31 15:31:24 ad Exp $
|
||||
# @(#)Makefile 8.1 (Berkeley) 5/31/93
|
||||
|
||||
SUBDIR= cat date echo ed expr kill ln ls \
|
||||
mkdir pax pwd rm rmdir sync test
|
||||
|
||||
.include <bsd.subdir.mk>
|
||||
11
bin/Makefile.inc
Normal file
11
bin/Makefile.inc
Normal file
@@ -0,0 +1,11 @@
|
||||
# $NetBSD: Makefile.inc,v 1.17 2012/03/21 05:47:53 matt Exp $
|
||||
# @(#)Makefile.inc 8.1 (Berkeley) 5/31/93
|
||||
|
||||
.include <bsd.own.mk> # for MKDYNAMICROOT definition
|
||||
|
||||
WARNS?= 5
|
||||
BINDIR?= /bin
|
||||
|
||||
.if (${MKDYNAMICROOT} == "no")
|
||||
LDSTATIC?= -static
|
||||
.endif
|
||||
6
bin/cat/Makefile
Normal file
6
bin/cat/Makefile
Normal file
@@ -0,0 +1,6 @@
|
||||
# $NetBSD: Makefile,v 1.12 2003/05/18 07:57:31 lukem Exp $
|
||||
# @(#)Makefile 8.1 (Berkeley) 5/31/93
|
||||
|
||||
PROG= cat
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
209
bin/cat/cat.1
Normal file
209
bin/cat/cat.1
Normal file
@@ -0,0 +1,209 @@
|
||||
.\" $NetBSD: cat.1,v 1.32 2006/09/23 11:24:44 wiz Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1989, 1990, 1993
|
||||
.\" The Regents of the University of California. All rights reserved.
|
||||
.\"
|
||||
.\" This code is derived from software contributed to Berkeley by
|
||||
.\" the Institute of Electrical and Electronics Engineers, Inc.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\" 3. Neither the name of the University nor the names of its contributors
|
||||
.\" may be used to endorse or promote products derived from this software
|
||||
.\" without specific prior written permission.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)cat.1 8.3 (Berkeley) 5/2/95
|
||||
.\"
|
||||
.Dd September 23, 2006
|
||||
.Dt CAT 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm cat
|
||||
.Nd concatenate and print files
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Op Fl beflnstuv
|
||||
.Op Fl
|
||||
.Op Ar
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
utility reads files sequentially, writing them to the standard output.
|
||||
The
|
||||
.Ar file
|
||||
operands are processed in command line order.
|
||||
A single dash represents the standard input,
|
||||
and may appear multiple times in the
|
||||
.Ar file
|
||||
list.
|
||||
.Pp
|
||||
The word
|
||||
.Dq concatenate
|
||||
is just a verbose synonym for
|
||||
.Dq catenate .
|
||||
.Pp
|
||||
The options are as follows:
|
||||
.Bl -tag -width Ds
|
||||
.It Fl b
|
||||
Implies the
|
||||
.Fl n
|
||||
option but doesn't number blank lines.
|
||||
.It Fl e
|
||||
Implies the
|
||||
.Fl v
|
||||
option, and displays a dollar sign
|
||||
.Pq Ql \&$
|
||||
at the end of each line
|
||||
as well.
|
||||
.It Fl f
|
||||
Only attempt to display regular files.
|
||||
.It Fl l
|
||||
Set an exclusive advisory lock on the standard output file descriptor.
|
||||
This lock is set using
|
||||
.Xr fcntl 2
|
||||
with the
|
||||
.Dv F_SETLKW
|
||||
command.
|
||||
If the output file is already locked,
|
||||
.Nm
|
||||
will block until the lock is acquired.
|
||||
.It Fl n
|
||||
Number the output lines, starting at 1.
|
||||
.It Fl s
|
||||
Squeeze multiple adjacent empty lines, causing the output to be
|
||||
single spaced.
|
||||
.It Fl t
|
||||
Implies the
|
||||
.Fl v
|
||||
option, and displays tab characters as
|
||||
.Ql ^I
|
||||
as well.
|
||||
.It Fl u
|
||||
The
|
||||
.Fl u
|
||||
option guarantees that the output is unbuffered.
|
||||
.It Fl v
|
||||
Displays non-printing characters so they are visible.
|
||||
Control characters print as
|
||||
.Ql ^X
|
||||
for control-X; the delete
|
||||
character (octal 0177) prints as
|
||||
.Ql ^? .
|
||||
Non-ascii characters (with the high bit set) are printed as
|
||||
.Ql M-
|
||||
(for meta) followed by the character for the low 7 bits.
|
||||
.El
|
||||
.Sh EXIT STATUS
|
||||
The
|
||||
.Nm
|
||||
utility exits 0 on success, and \*[Gt]0 if an error occurs.
|
||||
.Sh EXAMPLES
|
||||
The command:
|
||||
.Bd -literal -offset indent
|
||||
.Ic cat file1
|
||||
.Ed
|
||||
.Pp
|
||||
will print the contents of
|
||||
.Ar file1
|
||||
to the standard output.
|
||||
.Pp
|
||||
The command:
|
||||
.Bd -literal -offset indent
|
||||
.Ic cat file1 file2 \*[Gt] file3
|
||||
.Ed
|
||||
.Pp
|
||||
will sequentially print the contents of
|
||||
.Ar file1
|
||||
and
|
||||
.Ar file2
|
||||
to the file
|
||||
.Ar file3 ,
|
||||
truncating
|
||||
.Ar file3
|
||||
if it already exists.
|
||||
See the manual page for your shell (i.e.,
|
||||
.Xr sh 1 )
|
||||
for more information on redirection.
|
||||
.Pp
|
||||
The command:
|
||||
.Bd -literal -offset indent
|
||||
.Ic cat file1 - file2 - file3
|
||||
.Ed
|
||||
.Pp
|
||||
will print the contents of
|
||||
.Ar file1 ,
|
||||
print data it receives from the standard input until it receives an
|
||||
.Dv EOF
|
||||
.Pq Sq ^D
|
||||
character, print the contents of
|
||||
.Ar file2 ,
|
||||
read and output contents of the standard input again, then finally output
|
||||
the contents of
|
||||
.Ar file3 .
|
||||
Note that if the standard input referred to a file, the second dash
|
||||
on the command-line would have no effect, since the entire contents of the file
|
||||
would have already been read and printed by
|
||||
.Nm
|
||||
when it encountered the first
|
||||
.Ql \&-
|
||||
operand.
|
||||
.Sh SEE ALSO
|
||||
.Xr head 1 ,
|
||||
.Xr hexdump 1 ,
|
||||
.Xr lpr 1 ,
|
||||
.Xr more 1 ,
|
||||
.Xr pr 1 ,
|
||||
.Xr tail 1 ,
|
||||
.Xr view 1 ,
|
||||
.Xr vis 1 ,
|
||||
.Xr fcntl 2
|
||||
.Rs
|
||||
.%A Rob Pike
|
||||
.%T "UNIX Style, or cat -v Considered Harmful"
|
||||
.%J "USENIX Summer Conference Proceedings"
|
||||
.%D 1983
|
||||
.Re
|
||||
.Sh STANDARDS
|
||||
The
|
||||
.Nm
|
||||
utility is expected to conform to the
|
||||
.St -p1003.2-92
|
||||
specification.
|
||||
.Pp
|
||||
The flags
|
||||
.Op Fl belnstv
|
||||
are extensions to the specification.
|
||||
.Sh HISTORY
|
||||
A
|
||||
.Nm
|
||||
utility appeared in
|
||||
.At v1 .
|
||||
Dennis Ritchie designed and wrote the first man page.
|
||||
It appears to have been
|
||||
.Xr cat 1 .
|
||||
.Sh BUGS
|
||||
Because of the shell language mechanism used to perform output
|
||||
redirection, the command
|
||||
.Dq Li cat file1 file2 \*[Gt] file1
|
||||
will cause the original data in file1 to be destroyed!
|
||||
This is performed by the shell before
|
||||
.Nm
|
||||
is run.
|
||||
316
bin/cat/cat.c
Normal file
316
bin/cat/cat.c
Normal file
@@ -0,0 +1,316 @@
|
||||
/* $NetBSD: cat.c,v 1.47 2008/07/20 00:52:39 lukem Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* Kevin Fall.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if HAVE_NBTOOL_CONFIG_H
|
||||
#include "nbtool_config.h"
|
||||
#endif
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#if !defined(lint)
|
||||
__COPYRIGHT(
|
||||
"@(#) Copyright (c) 1989, 1993\
|
||||
The Regents of the University of California. All rights reserved.");
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)cat.c 8.2 (Berkeley) 4/27/95";
|
||||
#else
|
||||
__RCSID("$NetBSD: cat.c,v 1.47 2008/07/20 00:52:39 lukem Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <locale.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int bflag, eflag, fflag, lflag, nflag, sflag, tflag, vflag;
|
||||
int rval;
|
||||
const char *filename;
|
||||
|
||||
int main(int, char *[]);
|
||||
void cook_args(char *argv[]);
|
||||
void cook_buf(FILE *);
|
||||
void raw_args(char *argv[]);
|
||||
void raw_cat(int);
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
int ch;
|
||||
struct flock stdout_lock;
|
||||
|
||||
setprogname(argv[0]);
|
||||
(void)setlocale(LC_ALL, "");
|
||||
|
||||
while ((ch = getopt(argc, argv, "beflnstuv")) != -1)
|
||||
switch (ch) {
|
||||
case 'b':
|
||||
bflag = nflag = 1; /* -b implies -n */
|
||||
break;
|
||||
case 'e':
|
||||
eflag = vflag = 1; /* -e implies -v */
|
||||
break;
|
||||
case 'f':
|
||||
fflag = 1;
|
||||
break;
|
||||
case 'l':
|
||||
lflag = 1;
|
||||
break;
|
||||
case 'n':
|
||||
nflag = 1;
|
||||
break;
|
||||
case 's':
|
||||
sflag = 1;
|
||||
break;
|
||||
case 't':
|
||||
tflag = vflag = 1; /* -t implies -v */
|
||||
break;
|
||||
case 'u':
|
||||
setbuf(stdout, NULL);
|
||||
break;
|
||||
case 'v':
|
||||
vflag = 1;
|
||||
break;
|
||||
default:
|
||||
case '?':
|
||||
(void)fprintf(stderr,
|
||||
"usage: cat [-beflnstuv] [-] [file ...]\n");
|
||||
exit(EXIT_FAILURE);
|
||||
/* NOTREACHED */
|
||||
}
|
||||
argv += optind;
|
||||
|
||||
if (lflag) {
|
||||
stdout_lock.l_len = 0;
|
||||
stdout_lock.l_start = 0;
|
||||
stdout_lock.l_type = F_WRLCK;
|
||||
stdout_lock.l_whence = SEEK_SET;
|
||||
if (fcntl(STDOUT_FILENO, F_SETLKW, &stdout_lock) == -1)
|
||||
err(EXIT_FAILURE, "stdout");
|
||||
}
|
||||
|
||||
if (bflag || eflag || nflag || sflag || tflag || vflag)
|
||||
cook_args(argv);
|
||||
else
|
||||
raw_args(argv);
|
||||
if (fclose(stdout))
|
||||
err(EXIT_FAILURE, "stdout");
|
||||
return (rval);
|
||||
}
|
||||
|
||||
void
|
||||
cook_args(char **argv)
|
||||
{
|
||||
FILE *fp;
|
||||
|
||||
fp = stdin;
|
||||
filename = "stdin";
|
||||
do {
|
||||
if (*argv) {
|
||||
if (!strcmp(*argv, "-"))
|
||||
fp = stdin;
|
||||
else if ((fp = fopen(*argv,
|
||||
fflag ? "rf" : "r")) == NULL) {
|
||||
warn("%s", *argv);
|
||||
rval = EXIT_FAILURE;
|
||||
++argv;
|
||||
continue;
|
||||
}
|
||||
filename = *argv++;
|
||||
}
|
||||
cook_buf(fp);
|
||||
if (fp != stdin)
|
||||
(void)fclose(fp);
|
||||
else
|
||||
clearerr(fp);
|
||||
} while (*argv);
|
||||
}
|
||||
|
||||
void
|
||||
cook_buf(FILE *fp)
|
||||
{
|
||||
int ch, gobble, line, prev;
|
||||
|
||||
line = gobble = 0;
|
||||
for (prev = '\n'; (ch = getc(fp)) != EOF; prev = ch) {
|
||||
if (prev == '\n') {
|
||||
if (ch == '\n') {
|
||||
if (sflag) {
|
||||
if (!gobble && nflag && !bflag)
|
||||
(void)fprintf(stdout,
|
||||
"%6d\t\n", ++line);
|
||||
else if (!gobble && putchar(ch) == EOF)
|
||||
break;
|
||||
gobble = 1;
|
||||
continue;
|
||||
}
|
||||
if (nflag) {
|
||||
if (!bflag) {
|
||||
(void)fprintf(stdout,
|
||||
"%6d\t", ++line);
|
||||
if (ferror(stdout))
|
||||
break;
|
||||
} else if (eflag) {
|
||||
(void)fprintf(stdout,
|
||||
"%6s\t", "");
|
||||
if (ferror(stdout))
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (nflag) {
|
||||
(void)fprintf(stdout, "%6d\t", ++line);
|
||||
if (ferror(stdout))
|
||||
break;
|
||||
}
|
||||
}
|
||||
gobble = 0;
|
||||
if (ch == '\n') {
|
||||
if (eflag)
|
||||
if (putchar('$') == EOF)
|
||||
break;
|
||||
} else if (ch == '\t') {
|
||||
if (tflag) {
|
||||
if (putchar('^') == EOF || putchar('I') == EOF)
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
} else if (vflag) {
|
||||
if (!isascii(ch)) {
|
||||
if (putchar('M') == EOF || putchar('-') == EOF)
|
||||
break;
|
||||
ch = toascii(ch);
|
||||
}
|
||||
if (iscntrl(ch)) {
|
||||
if (putchar('^') == EOF ||
|
||||
putchar(ch == '\177' ? '?' :
|
||||
ch | 0100) == EOF)
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (putchar(ch) == EOF)
|
||||
break;
|
||||
}
|
||||
if (ferror(fp)) {
|
||||
warn("%s", filename);
|
||||
rval = EXIT_FAILURE;
|
||||
clearerr(fp);
|
||||
}
|
||||
if (ferror(stdout))
|
||||
err(EXIT_FAILURE, "stdout");
|
||||
}
|
||||
|
||||
void
|
||||
raw_args(char **argv)
|
||||
{
|
||||
int fd;
|
||||
|
||||
fd = fileno(stdin);
|
||||
filename = "stdin";
|
||||
do {
|
||||
if (*argv) {
|
||||
if (!strcmp(*argv, "-"))
|
||||
fd = fileno(stdin);
|
||||
else if (fflag) {
|
||||
struct stat st;
|
||||
fd = open(*argv, O_RDONLY|O_NONBLOCK, 0);
|
||||
if (fd < 0)
|
||||
goto skip;
|
||||
|
||||
if (fstat(fd, &st) == -1) {
|
||||
close(fd);
|
||||
goto skip;
|
||||
}
|
||||
if (!S_ISREG(st.st_mode)) {
|
||||
close(fd);
|
||||
warnx("%s: not a regular file", *argv);
|
||||
goto skipnomsg;
|
||||
}
|
||||
}
|
||||
else if ((fd = open(*argv, O_RDONLY, 0)) < 0) {
|
||||
skip:
|
||||
warn("%s", *argv);
|
||||
skipnomsg:
|
||||
rval = EXIT_FAILURE;
|
||||
++argv;
|
||||
continue;
|
||||
}
|
||||
filename = *argv++;
|
||||
}
|
||||
raw_cat(fd);
|
||||
if (fd != fileno(stdin))
|
||||
(void)close(fd);
|
||||
} while (*argv);
|
||||
}
|
||||
|
||||
void
|
||||
raw_cat(int rfd)
|
||||
{
|
||||
static char *buf;
|
||||
static char fb_buf[BUFSIZ];
|
||||
static size_t bsize;
|
||||
|
||||
ssize_t nr, nw, off;
|
||||
int wfd;
|
||||
|
||||
wfd = fileno(stdout);
|
||||
if (buf == NULL) {
|
||||
struct stat sbuf;
|
||||
|
||||
if (fstat(wfd, &sbuf) == 0 &&
|
||||
sbuf.st_blksize > sizeof(fb_buf)) {
|
||||
bsize = sbuf.st_blksize;
|
||||
buf = malloc(bsize);
|
||||
}
|
||||
if (buf == NULL) {
|
||||
bsize = sizeof(fb_buf);
|
||||
buf = fb_buf;
|
||||
}
|
||||
}
|
||||
while ((nr = read(rfd, buf, bsize)) > 0)
|
||||
for (off = 0; nr; nr -= nw, off += nw)
|
||||
if ((nw = write(wfd, buf + off, (size_t)nr)) < 0)
|
||||
err(EXIT_FAILURE, "stdout");
|
||||
if (nr < 0) {
|
||||
warn("%s", filename);
|
||||
rval = EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
15
bin/date/Makefile
Normal file
15
bin/date/Makefile
Normal file
@@ -0,0 +1,15 @@
|
||||
# $NetBSD: Makefile,v 1.15 2011/08/14 10:53:16 christos Exp $
|
||||
# @(#)Makefile 8.1 (Berkeley) 5/31/93
|
||||
|
||||
PROG= date
|
||||
SRCS= date.c netdate.c
|
||||
DPADD+= ${LIBUTIL}
|
||||
LDADD+= -lutil
|
||||
CPPFLAGS+=-I${.CURDIR}
|
||||
|
||||
TZDIR= /usr/share/zoneinfo
|
||||
CPPFLAGS+= -DHAVE_ADJTIME=0 -DTZDIR=\"$(TZDIR)\"
|
||||
|
||||
COPTS.date.c = -Wno-format-nonliteral
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
244
bin/date/date.1
Normal file
244
bin/date/date.1
Normal file
@@ -0,0 +1,244 @@
|
||||
.\" $NetBSD: date.1,v 1.41 2010/02/04 22:56:11 wiz Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1980, 1990, 1993
|
||||
.\" The Regents of the University of California. All rights reserved.
|
||||
.\"
|
||||
.\" This code is derived from software contributed to Berkeley by
|
||||
.\" the Institute of Electrical and Electronics Engineers, Inc.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\" 3. Neither the name of the University nor the names of its contributors
|
||||
.\" may be used to endorse or promote products derived from this software
|
||||
.\" without specific prior written permission.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)date.1 8.3 (Berkeley) 4/28/95
|
||||
.\"
|
||||
.Dd November 15, 2006
|
||||
.Dt DATE 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm date
|
||||
.Nd display or set date and time
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Op Fl ajnu
|
||||
.Op Fl d Ar date
|
||||
.Op Fl r Ar seconds
|
||||
.Op Cm + Ns Ar format
|
||||
.Sm off
|
||||
.Oo Oo Oo Oo Oo Oo
|
||||
.Ar CC Oc
|
||||
.Ar yy Oc
|
||||
.Ar mm Oc
|
||||
.Ar dd Oc
|
||||
.Ar HH Oc Ar MM Oo
|
||||
.Li \&. Ar SS Oc Oc
|
||||
.Sm on
|
||||
.Sh DESCRIPTION
|
||||
.Nm
|
||||
displays the current date and time when invoked without arguments.
|
||||
Providing arguments will format the date and time in a user-defined
|
||||
way or set the date.
|
||||
Only the superuser may set the date.
|
||||
.Pp
|
||||
The options are as follows:
|
||||
.Bl -tag -width Ds
|
||||
.It Fl a
|
||||
Use
|
||||
.Xr adjtime 2
|
||||
to change the local system time slowly,
|
||||
maintaining it as a monotonically increasing function.
|
||||
.Fl a
|
||||
implies
|
||||
.Fl n .
|
||||
.It Fl d Ar date
|
||||
Parse the provided human-described date and time and display the result without
|
||||
actually changing the system clock.
|
||||
(See
|
||||
.Xr parsedate 3
|
||||
for examples.)
|
||||
.It Fl j
|
||||
Parse the provided canonical representation of date and time (described below)
|
||||
and display the result without actually changing the system clock.
|
||||
.It Fl n
|
||||
The utility
|
||||
.Xr timed 8
|
||||
is used to synchronize the clocks on groups of machines.
|
||||
By default, if
|
||||
timed
|
||||
is running,
|
||||
.Nm
|
||||
will set the time on all of the machines in the local group.
|
||||
The
|
||||
.Fl n
|
||||
option stops
|
||||
.Nm
|
||||
from setting the time for other than the current machine.
|
||||
.It Fl r Ar seconds
|
||||
Print out the date and time that is
|
||||
.Ar seconds
|
||||
from the Epoch.
|
||||
.It Fl u
|
||||
Display or set the date in
|
||||
.Tn UTC
|
||||
(universal) time.
|
||||
.El
|
||||
.Pp
|
||||
An operand with a leading plus
|
||||
.Pq Cm +
|
||||
sign signals a user-defined format
|
||||
string which specifies the format in which to display the date and time.
|
||||
The format string may contain any of the conversion specifications described
|
||||
in the
|
||||
.Xr strftime 3
|
||||
manual page, as well as any arbitrary text.
|
||||
A \*[Lt]newline\*[Gt] character is always output after the characters
|
||||
specified by the format string.
|
||||
The format string for the default display is:
|
||||
.Bd -literal -offset indent
|
||||
%a %b %e %H:%M:%S %Z %Y
|
||||
.Ed
|
||||
.Pp
|
||||
If an operand does not have a leading plus sign, it is interpreted as
|
||||
a value for setting the system's notion of the current date and time.
|
||||
The canonical representation for setting the date and time is:
|
||||
.Pp
|
||||
.Bl -tag -width Ds -compact -offset indent
|
||||
.It Ar CC
|
||||
The first two digits of the year (the century).
|
||||
.It Ar yy
|
||||
The second two digits of the year.
|
||||
If
|
||||
.Ar yy
|
||||
is specified, but
|
||||
.Ar CC
|
||||
is not, a value for
|
||||
.Ar yy
|
||||
between 69 and 99 results in a
|
||||
.Ar CC
|
||||
value of 19.
|
||||
Otherwise, a
|
||||
.Ar CC
|
||||
value of 20 is used.
|
||||
.It Ar mm
|
||||
The month of the year, from 01 to 12.
|
||||
.It Ar dd
|
||||
The day of the month, from 01 to 31.
|
||||
.It Ar HH
|
||||
The hour of the day, from 00 to 23.
|
||||
.It Ar MM
|
||||
The minute of the hour, from 00 to 59.
|
||||
.It Ar SS
|
||||
The second of the minute, from 00 to 61.
|
||||
.El
|
||||
.Pp
|
||||
Everything but the minutes is optional.
|
||||
.Pp
|
||||
Time changes for Daylight Saving and Standard time and leap seconds
|
||||
and years are handled automatically.
|
||||
.Sh ENVIRONMENT
|
||||
The following environment variables affect the execution of
|
||||
.Nm :
|
||||
.Bl -tag -width iTZ
|
||||
.It Ev TZ
|
||||
The timezone to use when displaying dates.
|
||||
See
|
||||
.Xr environ 7
|
||||
for more information.
|
||||
.El
|
||||
.Sh FILES
|
||||
.Bl -tag -width /var/log/messages -compact
|
||||
.It Pa /etc/localtime
|
||||
Symlink pointing to system's default timezone information file in
|
||||
.Pa /usr/share/zoneinfo
|
||||
directory.
|
||||
.It Pa /var/log/wtmp
|
||||
A record of date resets and time changes.
|
||||
.It Pa /var/log/messages
|
||||
A record of the user setting the time.
|
||||
.El
|
||||
.Sh EXAMPLES
|
||||
The command:
|
||||
.Bd -literal -offset indent
|
||||
date '+DATE: %m/%d/%y%nTIME: %H:%M:%S'
|
||||
.Ed
|
||||
.Pp
|
||||
will display:
|
||||
.Bd -literal -offset indent
|
||||
DATE: 11/21/87
|
||||
TIME: 13:36:16
|
||||
.Ed
|
||||
.Pp
|
||||
The command:
|
||||
.Bd -literal -offset indent
|
||||
date 8506131627
|
||||
.Ed
|
||||
.Pp
|
||||
sets the date to
|
||||
.Dq Li "June 13, 1985, 4:27 PM" .
|
||||
.Pp
|
||||
The command:
|
||||
.Bd -literal -offset indent
|
||||
date 1432
|
||||
.Ed
|
||||
.Pp
|
||||
sets the time to
|
||||
.Li "2:32 PM" ,
|
||||
without modifying the date.
|
||||
.Sh DIAGNOSTICS
|
||||
Exit status is 0 on success, 1 if unable to set the date, and 2
|
||||
if able to set the local date, but unable to set it globally.
|
||||
.Pp
|
||||
Occasionally, when
|
||||
.Xr timed 8
|
||||
synchronizes the time on many hosts, the setting of a new time value may
|
||||
require more than a few seconds.
|
||||
On these occasions,
|
||||
.Nm
|
||||
prints:
|
||||
.Ql Network time being set .
|
||||
The message
|
||||
.Ql Communication error with timed
|
||||
occurs when the communication
|
||||
between
|
||||
.Nm
|
||||
and
|
||||
timed
|
||||
fails.
|
||||
.Sh SEE ALSO
|
||||
.Xr adjtime 2 ,
|
||||
.Xr gettimeofday 2 ,
|
||||
.Xr settimeofday 2 ,
|
||||
.Xr parsedate 3 ,
|
||||
.Xr strftime 3 ,
|
||||
.Xr utmp 5 ,
|
||||
.Xr timed 8
|
||||
.Rs
|
||||
.%T "TSP: The Time Synchronization Protocol for UNIX 4.3BSD"
|
||||
.%A R. Gusella
|
||||
.%A S. Zatti
|
||||
.Re
|
||||
.Sh STANDARDS
|
||||
The
|
||||
.Nm
|
||||
utility is expected to be compatible with
|
||||
.St -p1003.2 .
|
||||
350
bin/date/date.c
Normal file
350
bin/date/date.c
Normal file
@@ -0,0 +1,350 @@
|
||||
/* $NetBSD: date.c,v 1.60 2011/08/27 12:55:09 joerg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1985, 1987, 1988, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__COPYRIGHT(
|
||||
"@(#) Copyright (c) 1985, 1987, 1988, 1993\
|
||||
The Regents of the University of California. All rights reserved.");
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)date.c 8.2 (Berkeley) 4/28/95";
|
||||
#else
|
||||
__RCSID("$NetBSD: date.c,v 1.60 2011/08/27 12:55:09 joerg Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#include <err.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <locale.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <syslog.h>
|
||||
#include <time.h>
|
||||
#include <tzfile.h>
|
||||
#include <unistd.h>
|
||||
#include <util.h>
|
||||
|
||||
#include "extern.h"
|
||||
|
||||
static time_t tval;
|
||||
static int aflag, jflag, rflag, nflag;
|
||||
|
||||
__dead static void badformat(void);
|
||||
__dead static void badtime(void);
|
||||
__dead static void badvalue(const char *);
|
||||
static void setthetime(const char *);
|
||||
__dead static void usage(void);
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
char *buf;
|
||||
size_t bufsiz;
|
||||
const char *format;
|
||||
int ch;
|
||||
long long val;
|
||||
struct tm *tm;
|
||||
|
||||
setprogname(argv[0]);
|
||||
(void)setlocale(LC_ALL, "");
|
||||
|
||||
while ((ch = getopt(argc, argv, "ad:jnr:u")) != -1) {
|
||||
switch (ch) {
|
||||
case 'a': /* adjust time slowly */
|
||||
aflag = 1;
|
||||
nflag = 1;
|
||||
break;
|
||||
case 'd':
|
||||
#ifndef __minix
|
||||
rflag = 1;
|
||||
tval = parsedate(optarg, NULL, NULL);
|
||||
if (tval == -1)
|
||||
#endif
|
||||
badarg: errx(EXIT_FAILURE,
|
||||
"Cannot parse `%s'", optarg);
|
||||
break;
|
||||
case 'j': /* don't set time */
|
||||
jflag = 1;
|
||||
break;
|
||||
case 'n': /* don't set network */
|
||||
nflag = 1;
|
||||
break;
|
||||
case 'r': /* user specified seconds */
|
||||
errno = 0;
|
||||
val = strtoll(optarg, &buf, 0);
|
||||
if (optarg[0] == '\0' || *buf != '\0')
|
||||
goto badarg;
|
||||
if (errno == ERANGE && (val == LLONG_MAX ||
|
||||
val == LLONG_MIN))
|
||||
err(EXIT_FAILURE, "Bad number `%s'", optarg);
|
||||
rflag = 1;
|
||||
tval = (time_t)val;
|
||||
break;
|
||||
case 'u': /* do everything in UTC */
|
||||
(void)setenv("TZ", "UTC0", 1);
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
}
|
||||
}
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
|
||||
if (!rflag && time(&tval) == -1)
|
||||
err(EXIT_FAILURE, "time");
|
||||
|
||||
|
||||
/* allow the operands in any order */
|
||||
if (*argv && **argv == '+') {
|
||||
format = *argv;
|
||||
++argv;
|
||||
} else
|
||||
format = "+%a %b %e %H:%M:%S %Z %Y";
|
||||
|
||||
if (*argv) {
|
||||
setthetime(*argv);
|
||||
++argv;
|
||||
}
|
||||
|
||||
if (*argv && **argv == '+')
|
||||
format = *argv;
|
||||
|
||||
if ((buf = malloc(bufsiz = 1024)) == NULL)
|
||||
goto bad;
|
||||
|
||||
if ((tm = localtime(&tval)) == NULL)
|
||||
err(EXIT_FAILURE, "localtime %lld failed", (long long)tval);
|
||||
|
||||
while (strftime(buf, bufsiz, format, tm) == 0)
|
||||
if ((buf = realloc(buf, bufsiz <<= 1)) == NULL)
|
||||
goto bad;
|
||||
|
||||
(void)printf("%s\n", buf + 1);
|
||||
free(buf);
|
||||
return 0;
|
||||
bad:
|
||||
err(EXIT_FAILURE, "Cannot allocate format buffer");
|
||||
}
|
||||
|
||||
static void
|
||||
badformat(void)
|
||||
{
|
||||
warnx("illegal time format");
|
||||
usage();
|
||||
}
|
||||
|
||||
static void
|
||||
badtime(void)
|
||||
{
|
||||
errx(EXIT_FAILURE, "illegal time");
|
||||
/* NOTREACHED */
|
||||
}
|
||||
|
||||
static void
|
||||
badvalue(const char *param)
|
||||
{
|
||||
warnx("invalid %s supplied", param);
|
||||
usage();
|
||||
}
|
||||
|
||||
#define ATOI2(s) ((s) += 2, ((s)[-2] - '0') * 10 + ((s)[-1] - '0'))
|
||||
|
||||
static void
|
||||
setthetime(const char *p)
|
||||
{
|
||||
struct timeval tv;
|
||||
time_t new_time;
|
||||
struct tm *lt;
|
||||
const char *dot, *t;
|
||||
size_t len;
|
||||
int yearset;
|
||||
|
||||
for (t = p, dot = NULL; *t; ++t) {
|
||||
if (isdigit((unsigned char)*t))
|
||||
continue;
|
||||
if (*t == '.' && dot == NULL) {
|
||||
dot = t;
|
||||
continue;
|
||||
}
|
||||
badformat();
|
||||
}
|
||||
|
||||
if ((lt = localtime(&tval)) == NULL)
|
||||
err(EXIT_FAILURE, "localtime %lld failed", (long long)tval);
|
||||
|
||||
lt->tm_isdst = -1; /* Divine correct DST */
|
||||
|
||||
if (dot != NULL) { /* .ss */
|
||||
len = strlen(dot);
|
||||
if (len != 3)
|
||||
badformat();
|
||||
++dot;
|
||||
lt->tm_sec = ATOI2(dot);
|
||||
if (lt->tm_sec > 61)
|
||||
badvalue("seconds");
|
||||
} else {
|
||||
len = 0;
|
||||
lt->tm_sec = 0;
|
||||
}
|
||||
|
||||
yearset = 0;
|
||||
switch (strlen(p) - len) {
|
||||
case 12: /* cc */
|
||||
lt->tm_year = ATOI2(p) * 100 - TM_YEAR_BASE;
|
||||
if (lt->tm_year < 0)
|
||||
badtime();
|
||||
yearset = 1;
|
||||
/* FALLTHROUGH */
|
||||
case 10: /* yy */
|
||||
if (yearset) {
|
||||
lt->tm_year += ATOI2(p);
|
||||
} else {
|
||||
yearset = ATOI2(p);
|
||||
if (yearset < 69)
|
||||
lt->tm_year = yearset + 2000 - TM_YEAR_BASE;
|
||||
else
|
||||
lt->tm_year = yearset + 1900 - TM_YEAR_BASE;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
case 8: /* mm */
|
||||
lt->tm_mon = ATOI2(p);
|
||||
if (lt->tm_mon > 12 || lt->tm_mon == 0)
|
||||
badvalue("month");
|
||||
--lt->tm_mon; /* time struct is 0 - 11 */
|
||||
/* FALLTHROUGH */
|
||||
case 6: /* dd */
|
||||
lt->tm_mday = ATOI2(p);
|
||||
switch (lt->tm_mon) {
|
||||
case 0:
|
||||
case 2:
|
||||
case 4:
|
||||
case 6:
|
||||
case 7:
|
||||
case 9:
|
||||
case 11:
|
||||
if (lt->tm_mday > 31 || lt->tm_mday == 0)
|
||||
badvalue("day of month");
|
||||
break;
|
||||
case 3:
|
||||
case 5:
|
||||
case 8:
|
||||
case 10:
|
||||
if (lt->tm_mday > 30 || lt->tm_mday == 0)
|
||||
badvalue("day of month");
|
||||
break;
|
||||
case 1:
|
||||
if (lt->tm_mday > 29 || lt->tm_mday == 0 ||
|
||||
(lt->tm_mday == 29 &&
|
||||
!isleap(lt->tm_year + TM_YEAR_BASE)))
|
||||
badvalue("day of month");
|
||||
break;
|
||||
default:
|
||||
badvalue("month");
|
||||
break;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
case 4: /* hh */
|
||||
lt->tm_hour = ATOI2(p);
|
||||
if (lt->tm_hour > 23)
|
||||
badvalue("hour");
|
||||
/* FALLTHROUGH */
|
||||
case 2: /* mm */
|
||||
lt->tm_min = ATOI2(p);
|
||||
if (lt->tm_min > 59)
|
||||
badvalue("minute");
|
||||
break;
|
||||
case 0: /* was just .sss */
|
||||
if (len != 0)
|
||||
break;
|
||||
/* FALLTHROUGH */
|
||||
default:
|
||||
badformat();
|
||||
}
|
||||
|
||||
/* convert broken-down time to UTC clock time */
|
||||
if ((new_time = mktime(lt)) == -1)
|
||||
badtime();
|
||||
|
||||
/* if jflag is set, don't actually change the time, just return */
|
||||
if (jflag) {
|
||||
tval = new_time;
|
||||
return;
|
||||
}
|
||||
|
||||
/* set the time */
|
||||
if (nflag || netsettime(new_time)) {
|
||||
logwtmp("|", "date", "");
|
||||
#if HAVE_ADJTIME
|
||||
if (aflag) {
|
||||
tv.tv_sec = new_time - tval;
|
||||
tv.tv_usec = 0;
|
||||
if (adjtime(&tv, NULL))
|
||||
err(EXIT_FAILURE, "adjtime");
|
||||
}
|
||||
#else
|
||||
if (aflag) {
|
||||
err(EXIT_FAILURE, "no adjtime");
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
tval = new_time;
|
||||
tv.tv_sec = tval;
|
||||
tv.tv_usec = 0;
|
||||
if (settimeofday(&tv, NULL))
|
||||
err(EXIT_FAILURE, "settimeofday");
|
||||
}
|
||||
logwtmp("{", "date", "");
|
||||
}
|
||||
|
||||
if ((p = getlogin()) == NULL)
|
||||
p = "???";
|
||||
syslog(LOG_AUTH | LOG_NOTICE, "date set by %s", p);
|
||||
}
|
||||
|
||||
static void
|
||||
usage(void)
|
||||
{
|
||||
(void)fprintf(stderr,
|
||||
"Usage: %s [-ajnu] [-d date] [-r seconds] [+format]",
|
||||
getprogname());
|
||||
(void)fprintf(stderr, " [[[[[[CC]yy]mm]dd]HH]MM[.SS]]\n");
|
||||
exit(EXIT_FAILURE);
|
||||
/* NOTREACHED */
|
||||
}
|
||||
39
bin/date/extern.h
Normal file
39
bin/date/extern.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/* $NetBSD: extern.h,v 1.8 2006/11/17 22:11:28 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)extern.h 8.1 (Berkeley) 5/31/93
|
||||
*/
|
||||
|
||||
#ifndef _EXTERN_H_
|
||||
#define _EXTERN_H_
|
||||
|
||||
int netsettime(time_t);
|
||||
|
||||
#endif /* !_EXTERN_H_ */
|
||||
200
bin/date/netdate.c
Normal file
200
bin/date/netdate.c
Normal file
@@ -0,0 +1,200 @@
|
||||
/* $NetBSD: netdate.c,v 1.30 2011/01/29 02:16:52 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)netdate.c 8.2 (Berkeley) 4/28/95";
|
||||
#else
|
||||
__RCSID("$NetBSD: netdate.c,v 1.30 2011/01/29 02:16:52 christos Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
#define TSPTYPES
|
||||
#include <protocols/timed.h>
|
||||
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <poll.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "extern.h"
|
||||
|
||||
#define WAITACK 2000 /* milliseconds */
|
||||
#define WAITDATEACK 5000 /* milliseconds */
|
||||
|
||||
static const char *
|
||||
tsp_type_to_string(const struct tsp *msg)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
i = msg->tsp_type;
|
||||
return i < TSPTYPENUMBER ? tsptype[i] : "unknown";
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the date in the machines controlled by timedaemons by communicating the
|
||||
* new date to the local timedaemon. If the timedaemon is in the master state,
|
||||
* it performs the correction on all slaves. If it is in the slave state, it
|
||||
* notifies the master that a correction is needed.
|
||||
* Returns 0 on success. Returns > 0 on failure.
|
||||
*/
|
||||
int
|
||||
netsettime(time_t tval)
|
||||
{
|
||||
struct sockaddr_in dest;
|
||||
struct tsp msg;
|
||||
char hostname[MAXHOSTNAMELEN];
|
||||
struct servent *sp;
|
||||
struct pollfd ready;
|
||||
int found, s, timed_ack, waittime;
|
||||
|
||||
if ((sp = getservbyname("timed", "udp")) == NULL) {
|
||||
warnx("udp/timed: unknown service");
|
||||
return 2;
|
||||
}
|
||||
|
||||
(void)memset(&dest, 0, sizeof(dest));
|
||||
#ifdef BSD4_4
|
||||
dest.sin_len = sizeof(dest);
|
||||
#endif
|
||||
dest.sin_family = AF_INET;
|
||||
dest.sin_port = sp->s_port;
|
||||
dest.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||
s = socket(AF_INET, SOCK_DGRAM, 0);
|
||||
if (s == -1) {
|
||||
if (errno != EAFNOSUPPORT)
|
||||
warn("timed");
|
||||
return 2;
|
||||
}
|
||||
|
||||
#ifdef IP_PORTRANGE
|
||||
{
|
||||
static const int on = IP_PORTRANGE_LOW;
|
||||
|
||||
if (setsockopt(s, IPPROTO_IP, IP_PORTRANGE, &on,
|
||||
sizeof(on)) == -1) {
|
||||
warn("setsockopt");
|
||||
goto bad;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
msg.tsp_type = TSP_SETDATE;
|
||||
msg.tsp_vers = TSPVERSION;
|
||||
if (gethostname(hostname, sizeof(hostname)) == -1) {
|
||||
warn("gethostname");
|
||||
goto bad;
|
||||
}
|
||||
(void)strlcpy(msg.tsp_name, hostname, sizeof(msg.tsp_name));
|
||||
msg.tsp_seq = htons((in_port_t)0);
|
||||
msg.tsp_time.tv_sec = htonl((in_addr_t)tval); /* XXX: y2038 */
|
||||
msg.tsp_time.tv_usec = htonl((in_addr_t)0);
|
||||
if (connect(s, (const void *)&dest, sizeof(dest)) == -1) {
|
||||
warn("connect");
|
||||
goto bad;
|
||||
}
|
||||
if (send(s, &msg, sizeof(msg), 0) == -1) {
|
||||
if (errno != ECONNREFUSED)
|
||||
warn("send");
|
||||
goto bad;
|
||||
}
|
||||
|
||||
timed_ack = -1;
|
||||
waittime = WAITACK;
|
||||
ready.fd = s;
|
||||
ready.events = POLLIN;
|
||||
loop:
|
||||
found = poll(&ready, 1, waittime);
|
||||
|
||||
{
|
||||
socklen_t len;
|
||||
int error;
|
||||
|
||||
len = sizeof(error);
|
||||
if (getsockopt(s, SOL_SOCKET, SO_ERROR, &error, &len) == -1) {
|
||||
warn("getsockopt");
|
||||
goto bad;
|
||||
}
|
||||
if (error) {
|
||||
if (error != ECONNREFUSED) {
|
||||
errno = error;
|
||||
warn("send (delayed error)");
|
||||
}
|
||||
goto bad;
|
||||
}
|
||||
}
|
||||
|
||||
if (found > 0 && ready.revents & POLLIN) {
|
||||
ssize_t ret;
|
||||
|
||||
if ((ret = recv(s, &msg, sizeof(msg), 0)) == -1) {
|
||||
if (errno != ECONNREFUSED)
|
||||
warn("recv");
|
||||
goto bad;
|
||||
} else if ((size_t)ret < sizeof(msg)) {
|
||||
warnx("recv: incomplete packet");
|
||||
goto bad;
|
||||
}
|
||||
|
||||
msg.tsp_seq = ntohs(msg.tsp_seq);
|
||||
msg.tsp_time.tv_sec = ntohl(msg.tsp_time.tv_sec);
|
||||
msg.tsp_time.tv_usec = ntohl(msg.tsp_time.tv_usec);
|
||||
switch (msg.tsp_type) {
|
||||
case TSP_ACK:
|
||||
timed_ack = TSP_ACK;
|
||||
waittime = WAITDATEACK;
|
||||
goto loop;
|
||||
case TSP_DATEACK:
|
||||
(void)close(s);
|
||||
return 0;
|
||||
default:
|
||||
warnx("wrong ack received from timed: %s",
|
||||
tsp_type_to_string(&msg));
|
||||
timed_ack = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (timed_ack == -1)
|
||||
warnx("can't reach time daemon, time set locally");
|
||||
|
||||
bad:
|
||||
(void)close(s);
|
||||
return 2;
|
||||
}
|
||||
6
bin/echo/Makefile
Normal file
6
bin/echo/Makefile
Normal file
@@ -0,0 +1,6 @@
|
||||
# $NetBSD: Makefile,v 1.8 1997/07/20 22:36:53 christos Exp $
|
||||
# @(#)Makefile 8.1 (Berkeley) 5/31/93
|
||||
|
||||
PROG= echo
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
68
bin/echo/echo.1
Normal file
68
bin/echo/echo.1
Normal file
@@ -0,0 +1,68 @@
|
||||
.\" $NetBSD: echo.1,v 1.13 2003/08/07 09:05:12 agc Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1990, 1993
|
||||
.\" The Regents of the University of California. All rights reserved.
|
||||
.\"
|
||||
.\" This code is derived from software contributed to Berkeley by
|
||||
.\" the Institute of Electrical and Electronics Engineers, Inc.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\" 3. Neither the name of the University nor the names of its contributors
|
||||
.\" may be used to endorse or promote products derived from this software
|
||||
.\" without specific prior written permission.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)echo.1 8.1 (Berkeley) 7/22/93
|
||||
.\"
|
||||
.Dd July 22, 1993
|
||||
.Dt ECHO 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm echo
|
||||
.Nd write arguments to the standard output
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Op Fl n
|
||||
.Op Ar string ...
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
utility writes any specified operands, separated by single blank (`` '')
|
||||
characters and followed by a newline (``\en'') character, to the standard
|
||||
output.
|
||||
.Pp
|
||||
The following option is available:
|
||||
.Bl -tag -width flag
|
||||
.It Fl n
|
||||
Do not print the trailing newline character.
|
||||
.El
|
||||
.Sh EXIT STATUS
|
||||
The
|
||||
.Nm
|
||||
utility exits 0 on success, and \*[Gt]0 if an error occurs.
|
||||
.Sh SEE ALSO
|
||||
.Xr printf 1
|
||||
.Sh STANDARDS
|
||||
The
|
||||
.Nm
|
||||
utility is expected to be
|
||||
.St -p1003.2
|
||||
compatible.
|
||||
83
bin/echo/echo.c
Normal file
83
bin/echo/echo.c
Normal file
@@ -0,0 +1,83 @@
|
||||
/* $NetBSD: echo.c,v 1.18 2008/09/18 05:42:08 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__COPYRIGHT(
|
||||
"@(#) Copyright (c) 1989, 1993\
|
||||
The Regents of the University of California. All rights reserved.");
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)echo.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: echo.c,v 1.18 2008/09/18 05:42:08 dholland Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <locale.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
int main(int, char *[]);
|
||||
|
||||
/* ARGSUSED */
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
int nflag;
|
||||
|
||||
setprogname(argv[0]);
|
||||
(void)setlocale(LC_ALL, "");
|
||||
|
||||
/* This utility may NOT do getopt(3) option parsing. */
|
||||
if (*++argv && !strcmp(*argv, "-n")) {
|
||||
++argv;
|
||||
nflag = 1;
|
||||
}
|
||||
else
|
||||
nflag = 0;
|
||||
|
||||
while (*argv) {
|
||||
(void)printf("%s", *argv);
|
||||
if (*++argv)
|
||||
(void)putchar(' ');
|
||||
}
|
||||
if (nflag == 0)
|
||||
(void)putchar('\n');
|
||||
fflush(stdout);
|
||||
if (ferror(stdout))
|
||||
exit(1);
|
||||
exit(0);
|
||||
/* NOTREACHED */
|
||||
}
|
||||
20
bin/ed/Makefile
Normal file
20
bin/ed/Makefile
Normal file
@@ -0,0 +1,20 @@
|
||||
# $NetBSD: Makefile,v 1.36 2009/07/26 01:58:20 dholland Exp $
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
PROG= ed
|
||||
CPPFLAGS+=-DBACKWARDS
|
||||
|
||||
.if (${MKCRYPTO} != "no")
|
||||
CPPFLAGS+=-DDES
|
||||
.endif
|
||||
|
||||
SRCS= buf.c cbc.c glbl.c io.c main.c re.c sub.c undo.c
|
||||
|
||||
LDADD+= -lcrypt
|
||||
DPADD+= ${LIBCRYPT}
|
||||
|
||||
#LINKS= ${BINDIR}/ed ${BINDIR}/red
|
||||
#MLINKS= ed.1 red.1
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
103
bin/ed/POSIX
Normal file
103
bin/ed/POSIX
Normal file
@@ -0,0 +1,103 @@
|
||||
$NetBSD: POSIX,v 1.10 1999/11/18 19:16:34 kristerw Exp $
|
||||
|
||||
This version of ed(1) is not strictly POSIX compliant, as described in
|
||||
the POSIX 1003.2 document. The following is a summary of the omissions,
|
||||
extensions and possible deviations from POSIX 1003.2.
|
||||
|
||||
OMISSIONS
|
||||
---------
|
||||
1) Locale(3) is not supported yet.
|
||||
|
||||
2) For backwards compatibility, the POSIX rule that says a range of
|
||||
addresses cannot be used where only a single address is expected has
|
||||
been relaxed.
|
||||
|
||||
3) To support the BSD `s' command (see extension [1] below),
|
||||
substitution patterns cannot be delimited by numbers or the characters
|
||||
`r', `g' and `p'. In contrast, POSIX specifies any character expect
|
||||
space or newline can used as a delimiter.
|
||||
|
||||
EXTENSIONS
|
||||
----------
|
||||
1) BSD commands have been implemented wherever they do not conflict with
|
||||
the POSIX standard. The BSD-ism's included are:
|
||||
i) `s' (i.e., s[n][rgp]*) to repeat a previous substitution,
|
||||
ii) `W' for appending text to an existing file,
|
||||
iii) `wq' for exiting after a write,
|
||||
iv) `z' for scrolling through the buffer, and
|
||||
v) BSD line addressing syntax (i.e., `^' and `%') is recognized.
|
||||
|
||||
2) If crypt(3) is available, files can be read and written using DES
|
||||
encryption. The `x' command prompts the user to enter a key used for
|
||||
encrypting/ decrypting subsequent reads and writes. If only a newline
|
||||
is entered as the key, then encryption is disabled. Otherwise, a key
|
||||
is read in the same manner as a password entry. The key remains in
|
||||
effect until encryption is disabled. For more information on the
|
||||
encryption algorithm, see the bdes(1) man page. Encryption/decryption
|
||||
should be fully compatible with SunOS des(1).
|
||||
|
||||
3) The POSIX interactive global commands `G' and `V' are extended to
|
||||
support multiple commands, including `a', `i' and `c'. The command
|
||||
format is the same as for the global commands `g' and `v', i.e., one
|
||||
command per line with each line, except for the last, ending in a
|
||||
backslash (\).
|
||||
|
||||
4) An extension to the POSIX file commands `E', `e', `r', `W' and `w' is
|
||||
that <file> arguments are processed for backslash escapes, i.e., any
|
||||
character preceded by a backslash is interpreted literally. If the
|
||||
first unescaped character of a <file> argument is a bang (!), then the
|
||||
rest of the line is interpreted as a shell command, and no escape
|
||||
processing is performed by ed.
|
||||
|
||||
5) For SunOS ed(1) compatibility, ed runs in restricted mode if invoked
|
||||
as red. This limits editing of files in the local directory only and
|
||||
prohibits shell commands.
|
||||
|
||||
DEVIATIONS
|
||||
----------
|
||||
1) Though ed is not a stream editor, it can be used to edit binary files.
|
||||
To assist in binary editing, when a file containing at least one ASCII
|
||||
NUL character is written, a newline is not appended if it did not
|
||||
already contain one upon reading. In particular, reading /dev/null
|
||||
prior to writing prevents appending a newline to a binary file.
|
||||
|
||||
For example, to create a file with ed containing a single NUL character:
|
||||
$ ed file
|
||||
a
|
||||
^@
|
||||
.
|
||||
r /dev/null
|
||||
wq
|
||||
|
||||
Similarly, to remove a newline from the end of binary `file':
|
||||
$ ed file
|
||||
r /dev/null
|
||||
wq
|
||||
|
||||
2) Since the behavior of `u' (undo) within a `g' (global) command list is
|
||||
not specified by POSIX, it follows the behavior of the SunOS ed:
|
||||
undo forces a global command list to be executed only once, rather than
|
||||
for each line matching a global pattern. In addtion, each instance of
|
||||
`u' within a global command undoes all previous commands (including
|
||||
undo's) in the command list. This seems the best way, since the
|
||||
alternatives are either too complicated to implement or too confusing
|
||||
to use.
|
||||
|
||||
The global/undo combination is useful for masking errors that
|
||||
would otherwise cause a script to fail. For instance, an ed script
|
||||
to remove any occurrences of either `censor1' or `censor2' might be
|
||||
written as:
|
||||
ed - file <<EOF
|
||||
1g/.*/u\
|
||||
,s/censor1//g\
|
||||
,s/censor2//g
|
||||
...
|
||||
|
||||
3) The `m' (move) command within a `g' command list also follows the SunOS
|
||||
ed implementation: any moved lines are removed from the global command's
|
||||
`active' list.
|
||||
|
||||
4) If ed is invoked with a name argument prefixed by a bang (!), then the
|
||||
remainder of the argument is interpreted as a shell command. To invoke
|
||||
ed on a file whose name starts with bang, prefix the name with a
|
||||
backslash.
|
||||
24
bin/ed/README
Normal file
24
bin/ed/README
Normal file
@@ -0,0 +1,24 @@
|
||||
$NetBSD: README,v 1.9 1995/03/21 09:04:33 cgd Exp $
|
||||
|
||||
ed is an 8-bit-clean, POSIX-compliant line editor. It should work with
|
||||
any regular expression package that conforms to the POSIX interface
|
||||
standard, such as GNU regex(3).
|
||||
|
||||
If reliable signals are supported (e.g., POSIX sigaction(2)), it should
|
||||
compile with little trouble. Otherwise, the macros SPL1() and SPL0()
|
||||
should be redefined to disable interrupts.
|
||||
|
||||
The following compiler directives are recognized:
|
||||
DES - to add encryption support (requires crypt(3))
|
||||
NO_REALLOC_NULL - if realloc(3) does not accept a NULL pointer
|
||||
BACKWARDS - for backwards compatibility
|
||||
NEED_INSQUE - if insque(3) is missing
|
||||
|
||||
The file `POSIX' describes extensions to and deviations from the POSIX
|
||||
standard.
|
||||
|
||||
The ./test directory contains regression tests for ed. The README
|
||||
file in that directory explains how to run these.
|
||||
|
||||
For a description of the ed algorithm, see Kernighan and Plauger's book
|
||||
"Software Tools in Pascal," Addison-Wesley, 1981.
|
||||
319
bin/ed/buf.c
Normal file
319
bin/ed/buf.c
Normal file
@@ -0,0 +1,319 @@
|
||||
/* $NetBSD: buf.c,v 1.26 2006/03/17 14:37:14 rumble Exp $ */
|
||||
|
||||
/* buf.c: This file contains the scratch-file buffer routines for the
|
||||
ed line editor. */
|
||||
/*-
|
||||
* Copyright (c) 1993 Andrew Moore, Talke Studio.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char *rcsid = "@(#)buf.c,v 1.4 1994/02/01 00:34:35 alm Exp";
|
||||
#else
|
||||
__RCSID("$NetBSD: buf.c,v 1.26 2006/03/17 14:37:14 rumble Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/file.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <paths.h>
|
||||
#include <stdio.h>
|
||||
#include <err.h>
|
||||
|
||||
#include "ed.h"
|
||||
|
||||
|
||||
FILE *sfp; /* scratch file pointer */
|
||||
off_t sfseek; /* scratch file position */
|
||||
int seek_write; /* seek before writing */
|
||||
line_t buffer_head; /* incore buffer */
|
||||
|
||||
/* get_sbuf_line: get a line of text from the scratch file; return pointer
|
||||
to the text */
|
||||
char *
|
||||
get_sbuf_line(line_t *lp)
|
||||
{
|
||||
static char *sfbuf = NULL; /* buffer */
|
||||
static int sfbufsz = 0; /* buffer size */
|
||||
|
||||
int len, ct;
|
||||
|
||||
if (lp == &buffer_head)
|
||||
return NULL;
|
||||
seek_write = 1; /* force seek on write */
|
||||
/* out of position */
|
||||
if (sfseek != lp->seek) {
|
||||
sfseek = lp->seek;
|
||||
if (fseek(sfp, sfseek, SEEK_SET) < 0) {
|
||||
fprintf(stderr, "%s\n", strerror(errno));
|
||||
sprintf(errmsg, "cannot seek temp file");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
len = lp->len;
|
||||
REALLOC(sfbuf, sfbufsz, len + 1, NULL);
|
||||
if ((ct = fread(sfbuf, sizeof(char), len, sfp)) < 0 || ct != len) {
|
||||
fprintf(stderr, "%s\n", strerror(errno));
|
||||
sprintf(errmsg, "cannot read temp file");
|
||||
return NULL;
|
||||
}
|
||||
sfseek += len; /* update file position */
|
||||
sfbuf[len] = '\0';
|
||||
return sfbuf;
|
||||
}
|
||||
|
||||
|
||||
/* put_sbuf_line: write a line of text to the scratch file and add a line node
|
||||
to the editor buffer; return a pointer to the end of the text */
|
||||
char *
|
||||
put_sbuf_line(char *cs)
|
||||
{
|
||||
line_t *lp;
|
||||
int len, ct;
|
||||
char *s;
|
||||
|
||||
if ((lp = (line_t *) malloc(sizeof(line_t))) == NULL) {
|
||||
fprintf(stderr, "%s\n", strerror(errno));
|
||||
sprintf(errmsg, "out of memory");
|
||||
return NULL;
|
||||
}
|
||||
/* assert: cs is '\n' terminated */
|
||||
for (s = cs; *s != '\n'; s++)
|
||||
;
|
||||
if (s - cs >= LINECHARS) {
|
||||
sprintf(errmsg, "line too long");
|
||||
free(lp);
|
||||
return NULL;
|
||||
}
|
||||
len = s - cs;
|
||||
/* out of position */
|
||||
if (seek_write) {
|
||||
if (fseek(sfp, 0L, SEEK_END) < 0) {
|
||||
fprintf(stderr, "%s\n", strerror(errno));
|
||||
sprintf(errmsg, "cannot seek temp file");
|
||||
free(lp);
|
||||
return NULL;
|
||||
}
|
||||
sfseek = ftell(sfp);
|
||||
seek_write = 0;
|
||||
}
|
||||
/* assert: SPL1() */
|
||||
if ((ct = fwrite(cs, sizeof(char), len, sfp)) < 0 || ct != len) {
|
||||
sfseek = -1;
|
||||
fprintf(stderr, "%s\n", strerror(errno));
|
||||
sprintf(errmsg, "cannot write temp file");
|
||||
free(lp);
|
||||
return NULL;
|
||||
}
|
||||
lp->len = len;
|
||||
lp->seek = sfseek;
|
||||
add_line_node(lp);
|
||||
sfseek += len; /* update file position */
|
||||
return ++s;
|
||||
}
|
||||
|
||||
|
||||
/* add_line_node: add a line node in the editor buffer after the current line */
|
||||
void
|
||||
add_line_node(line_t *lp)
|
||||
{
|
||||
line_t *cp;
|
||||
|
||||
cp = get_addressed_line_node(current_addr); /* this get_addressed_line_node last! */
|
||||
INSQUE(lp, cp);
|
||||
addr_last++;
|
||||
current_addr++;
|
||||
}
|
||||
|
||||
|
||||
/* get_line_node_addr: return line number of pointer */
|
||||
long
|
||||
get_line_node_addr(line_t *lp)
|
||||
{
|
||||
line_t *cp = &buffer_head;
|
||||
long n = 0;
|
||||
|
||||
while (cp != lp && (cp = cp->q_forw) != &buffer_head)
|
||||
n++;
|
||||
if (n && cp == &buffer_head) {
|
||||
sprintf(errmsg, "invalid address");
|
||||
return ERR;
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
|
||||
/* get_addressed_line_node: return pointer to a line node in the editor buffer */
|
||||
line_t *
|
||||
get_addressed_line_node(long n)
|
||||
{
|
||||
static line_t *lp = &buffer_head;
|
||||
static long on = 0;
|
||||
|
||||
SPL1();
|
||||
if (n > on) {
|
||||
if (n <= (on + addr_last) >> 1) {
|
||||
for (; on < n; on++)
|
||||
lp = lp->q_forw;
|
||||
} else {
|
||||
lp = buffer_head.q_back;
|
||||
for (on = addr_last; on > n; on--)
|
||||
lp = lp->q_back;
|
||||
}
|
||||
} else {
|
||||
if (n >= on >> 1) {
|
||||
for (; on > n; on--)
|
||||
lp = lp->q_back;
|
||||
} else {
|
||||
lp = &buffer_head;
|
||||
for (on = 0; on < n; on++)
|
||||
lp = lp->q_forw;
|
||||
}
|
||||
}
|
||||
SPL0();
|
||||
return lp;
|
||||
}
|
||||
|
||||
|
||||
char *sfn = NULL; /* scratch file name */
|
||||
|
||||
/* open_sbuf: open scratch file */
|
||||
int
|
||||
open_sbuf(void)
|
||||
{
|
||||
int u, fd;
|
||||
const char *tmp;
|
||||
size_t s;
|
||||
|
||||
isbinary = newline_added = 0;
|
||||
fd = -1;
|
||||
u = umask(077);
|
||||
|
||||
if ((tmp = getenv("TMPDIR")) == NULL)
|
||||
tmp = _PATH_TMP;
|
||||
|
||||
if ((s = strlen(tmp)) == 0 || tmp[s - 1] == '/')
|
||||
(void)asprintf(&sfn, "%sed.XXXXXX", tmp);
|
||||
else
|
||||
(void)asprintf(&sfn, "%s/ed.XXXXXX", tmp);
|
||||
if (sfn == NULL) {
|
||||
warn(NULL);
|
||||
sprintf(errmsg, "could not allocate memory");
|
||||
umask(u);
|
||||
return ERR;
|
||||
}
|
||||
|
||||
|
||||
if ((fd = mkstemp(sfn)) == -1 || (sfp = fdopen(fd, "w+")) == NULL) {
|
||||
if (fd != -1)
|
||||
close(fd);
|
||||
warn("%s", sfn);
|
||||
sprintf(errmsg, "cannot open temp file");
|
||||
umask(u);
|
||||
return ERR;
|
||||
}
|
||||
umask(u);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* close_sbuf: close scratch file */
|
||||
int
|
||||
close_sbuf(void)
|
||||
{
|
||||
if (sfp) {
|
||||
if (fclose(sfp) < 0) {
|
||||
fprintf(stderr, "%s: %s\n", sfn, strerror(errno));
|
||||
sprintf(errmsg, "cannot close temp file");
|
||||
return ERR;
|
||||
}
|
||||
sfp = NULL;
|
||||
if (sfn) {
|
||||
unlink(sfn);
|
||||
free(sfn);
|
||||
sfn = NULL;
|
||||
}
|
||||
}
|
||||
sfseek = seek_write = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* quit: remove_lines scratch file and exit */
|
||||
void
|
||||
quit(int n)
|
||||
{
|
||||
if (sfp) {
|
||||
fclose(sfp);
|
||||
if (sfn) {
|
||||
unlink(sfn);
|
||||
free(sfn);
|
||||
sfn = NULL;
|
||||
}
|
||||
}
|
||||
exit(n);
|
||||
/* NOTREACHED */
|
||||
}
|
||||
|
||||
|
||||
unsigned char ctab[256]; /* character translation table */
|
||||
|
||||
/* init_buffers: open scratch buffer; initialize line queue */
|
||||
void
|
||||
init_buffers(void)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
/* Read stdin one character at a time to avoid i/o contention
|
||||
with shell escapes invoked by nonterminal input, e.g.,
|
||||
ed - <<EOF
|
||||
!cat
|
||||
hello, world
|
||||
EOF */
|
||||
setbuffer(stdin, stdinbuf, 1);
|
||||
if (open_sbuf() < 0)
|
||||
quit(2);
|
||||
REQUE(&buffer_head, &buffer_head);
|
||||
for (i = 0; i < 256; i++)
|
||||
ctab[i] = i;
|
||||
}
|
||||
|
||||
|
||||
/* translit_text: translate characters in a string */
|
||||
char *
|
||||
translit_text(char *s, int len, int from, int to)
|
||||
{
|
||||
static int i = 0;
|
||||
|
||||
unsigned char *us;
|
||||
|
||||
ctab[i] = i; /* restore table to initial state */
|
||||
ctab[i = from] = to;
|
||||
for (us = (unsigned char *) s; len-- > 0; us++)
|
||||
*us = ctab[*us];
|
||||
return s;
|
||||
}
|
||||
460
bin/ed/cbc.c
Normal file
460
bin/ed/cbc.c
Normal file
@@ -0,0 +1,460 @@
|
||||
/* $NetBSD: cbc.c,v 1.22 2010/06/09 19:20:18 riz Exp $ */
|
||||
|
||||
/* cbc.c: This file contains the encryption routines for the ed line editor */
|
||||
/*-
|
||||
* Copyright (c) 1993 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)bdes.c 5.5 (Berkeley) 6/27/91
|
||||
*/
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1993 Andrew Moore, Talke Studio.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)bdes.c 5.5 (Berkeley) 6/27/91
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char *rcsid = "@(#)cbc.c,v 1.2 1994/02/01 00:34:36 alm Exp";
|
||||
#else
|
||||
__RCSID("$NetBSD: cbc.c,v 1.22 2010/06/09 19:20:18 riz Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <pwd.h>
|
||||
#ifdef DES
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
#include "ed.h"
|
||||
|
||||
|
||||
/*
|
||||
* Define a divisor for rand() that yields a uniform distribution in the
|
||||
* range 0-255.
|
||||
*/
|
||||
#define RAND_DIV (((unsigned) RAND_MAX + 1) >> 8)
|
||||
|
||||
/*
|
||||
* BSD and System V systems offer special library calls that do
|
||||
* block move_liness and fills, so if possible we take advantage of them
|
||||
*/
|
||||
#define MEMCPY(dest,src,len) memcpy((dest),(src),(len))
|
||||
#define MEMZERO(dest,len) memset((dest), 0, (len))
|
||||
|
||||
/* Hide the calls to the primitive encryption routines. */
|
||||
#define DES_KEY(buf) \
|
||||
if (des_setkey(buf)) \
|
||||
des_error("des_setkey");
|
||||
#define DES_XFORM(buf) \
|
||||
if (des_cipher(buf, buf, 0L, (inverse ? -1 : 1))) \
|
||||
des_error("des_cipher");
|
||||
|
||||
/*
|
||||
* read/write - no error checking
|
||||
*/
|
||||
#define READ(buf, n, fp) fread(buf, sizeof(char), n, fp)
|
||||
#define WRITE(buf, n, fp) fwrite(buf, sizeof(char), n, fp)
|
||||
|
||||
/*
|
||||
* some things to make references easier
|
||||
*/
|
||||
typedef char Desbuf[8];
|
||||
#define CHAR(x,i) (x[i])
|
||||
#define UCHAR(x,i) (x[i])
|
||||
#define BUFFER(x) (x)
|
||||
#define UBUFFER(x) (x)
|
||||
|
||||
#ifdef DES
|
||||
/*
|
||||
* global variables and related macros
|
||||
*/
|
||||
|
||||
static Desbuf ivec; /* initialization vector */
|
||||
static Desbuf pvec; /* padding vector */
|
||||
static char bits[] = { /* used to extract bits from a char */
|
||||
'\200', '\100', '\040', '\020', '\010', '\004', '\002', '\001'
|
||||
};
|
||||
static int pflag; /* 1 to preserve parity bits */
|
||||
|
||||
static char des_buf[8]; /* shared buffer for get_des_char/put_des_char */
|
||||
static int des_ct = 0; /* count for get_des_char/put_des_char */
|
||||
static int des_n = 0; /* index for put_des_char/get_des_char */
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef DES
|
||||
static void des_error(const char *);
|
||||
static int hex_to_binary(int, int);
|
||||
static void expand_des_key(char *, char *);
|
||||
static void set_des_key(char *);
|
||||
static int cbc_decode(char *, FILE *);
|
||||
static int cbc_encode(char *, int, FILE *);
|
||||
#endif
|
||||
|
||||
|
||||
/* init_des_cipher: initialize DES */
|
||||
void
|
||||
init_des_cipher(void)
|
||||
{
|
||||
#ifdef DES
|
||||
int i;
|
||||
|
||||
des_ct = des_n = 0;
|
||||
|
||||
/* initialize the initialization vector */
|
||||
MEMZERO(ivec, 8);
|
||||
|
||||
/* intialize the padding vector */
|
||||
srand((unsigned) time((time_t *) 0));
|
||||
for (i = 0; i < 8; i++)
|
||||
CHAR(pvec, i) = (char) (rand()/RAND_DIV);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/* get_des_char: return next char in an encrypted file */
|
||||
int
|
||||
get_des_char(FILE *fp)
|
||||
{
|
||||
#ifdef DES
|
||||
if (des_n >= des_ct) {
|
||||
des_n = 0;
|
||||
des_ct = cbc_decode(des_buf, fp);
|
||||
}
|
||||
return (des_ct > 0) ? (unsigned char) des_buf[des_n++] : EOF;
|
||||
#else
|
||||
return EOF;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/* put_des_char: write a char to an encrypted file; return char written */
|
||||
int
|
||||
put_des_char(int c, FILE *fp)
|
||||
{
|
||||
#ifdef DES
|
||||
if (des_n == sizeof des_buf) {
|
||||
des_ct = cbc_encode(des_buf, des_n, fp);
|
||||
des_n = 0;
|
||||
}
|
||||
return (des_ct >= 0) ? (unsigned char) (des_buf[des_n++] = c) : EOF;
|
||||
#else
|
||||
return EOF;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/* flush_des_file: flush an encrypted file's output; return status */
|
||||
int
|
||||
flush_des_file(FILE *fp)
|
||||
{
|
||||
#ifdef DES
|
||||
if (des_n == sizeof des_buf) {
|
||||
des_ct = cbc_encode(des_buf, des_n, fp);
|
||||
des_n = 0;
|
||||
}
|
||||
return (des_ct >= 0 && cbc_encode(des_buf, des_n, fp) >= 0) ? 0 : EOF;
|
||||
#else
|
||||
return EOF;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef DES
|
||||
/*
|
||||
* get keyword from tty or stdin
|
||||
*/
|
||||
int
|
||||
get_keyword(void)
|
||||
{
|
||||
char *p; /* used to obtain the key */
|
||||
Desbuf msgbuf; /* I/O buffer */
|
||||
|
||||
/*
|
||||
* get the key
|
||||
*/
|
||||
if (*(p = getpass("Enter key: "))) {
|
||||
|
||||
/*
|
||||
* copy it, nul-padded, into the key area
|
||||
*/
|
||||
expand_des_key(BUFFER(msgbuf), p);
|
||||
MEMZERO(p, _PASSWORD_LEN);
|
||||
set_des_key(msgbuf);
|
||||
MEMZERO(msgbuf, sizeof msgbuf);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* print a warning message and, possibly, terminate
|
||||
*/
|
||||
static void
|
||||
des_error(const char *s /* the message */)
|
||||
{
|
||||
(void)sprintf(errmsg, "%s", s ? s : strerror(errno));
|
||||
}
|
||||
|
||||
/*
|
||||
* map a hex character to an integer
|
||||
*/
|
||||
static int
|
||||
hex_to_binary(int c /* char to be converted */,
|
||||
int radix /* base (2 to 16) */)
|
||||
{
|
||||
switch(c) {
|
||||
case '0': return(0x0);
|
||||
case '1': return(0x1);
|
||||
case '2': return(radix > 2 ? 0x2 : -1);
|
||||
case '3': return(radix > 3 ? 0x3 : -1);
|
||||
case '4': return(radix > 4 ? 0x4 : -1);
|
||||
case '5': return(radix > 5 ? 0x5 : -1);
|
||||
case '6': return(radix > 6 ? 0x6 : -1);
|
||||
case '7': return(radix > 7 ? 0x7 : -1);
|
||||
case '8': return(radix > 8 ? 0x8 : -1);
|
||||
case '9': return(radix > 9 ? 0x9 : -1);
|
||||
case 'A': case 'a': return(radix > 10 ? 0xa : -1);
|
||||
case 'B': case 'b': return(radix > 11 ? 0xb : -1);
|
||||
case 'C': case 'c': return(radix > 12 ? 0xc : -1);
|
||||
case 'D': case 'd': return(radix > 13 ? 0xd : -1);
|
||||
case 'E': case 'e': return(radix > 14 ? 0xe : -1);
|
||||
case 'F': case 'f': return(radix > 15 ? 0xf : -1);
|
||||
}
|
||||
/*
|
||||
* invalid character
|
||||
*/
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* convert the key to a bit pattern
|
||||
*/
|
||||
static void
|
||||
expand_des_key(char *obuf /* bit pattern */, char *inbuf /* the key itself */)
|
||||
{
|
||||
int i, j; /* counter in a for loop */
|
||||
int nbuf[64]; /* used for hex/key translation */
|
||||
|
||||
/*
|
||||
* leading '0x' or '0X' == hex key
|
||||
*/
|
||||
if (inbuf[0] == '0' && (inbuf[1] == 'x' || inbuf[1] == 'X')) {
|
||||
inbuf = &inbuf[2];
|
||||
/*
|
||||
* now translate it, bombing on any illegal hex digit
|
||||
*/
|
||||
for (i = 0; inbuf[i] && i < 16; i++)
|
||||
if ((nbuf[i] = hex_to_binary((int) inbuf[i], 16)) == -1)
|
||||
des_error("bad hex digit in key");
|
||||
while (i < 16)
|
||||
nbuf[i++] = 0;
|
||||
for (i = 0; i < 8; i++)
|
||||
obuf[i] =
|
||||
((nbuf[2*i]&0xf)<<4) | (nbuf[2*i+1]&0xf);
|
||||
/* preserve parity bits */
|
||||
pflag = 1;
|
||||
return;
|
||||
}
|
||||
/*
|
||||
* leading '0b' or '0B' == binary key
|
||||
*/
|
||||
if (inbuf[0] == '0' && (inbuf[1] == 'b' || inbuf[1] == 'B')) {
|
||||
inbuf = &inbuf[2];
|
||||
/*
|
||||
* now translate it, bombing on any illegal binary digit
|
||||
*/
|
||||
for (i = 0; inbuf[i] && i < 16; i++)
|
||||
if ((nbuf[i] = hex_to_binary((int) inbuf[i], 2)) == -1)
|
||||
des_error("bad binary digit in key");
|
||||
while (i < 64)
|
||||
nbuf[i++] = 0;
|
||||
for (i = 0; i < 8; i++)
|
||||
for (j = 0; j < 8; j++)
|
||||
obuf[i] = (obuf[i]<<1)|nbuf[8*i+j];
|
||||
/* preserve parity bits */
|
||||
pflag = 1;
|
||||
return;
|
||||
}
|
||||
/*
|
||||
* no special leader -- ASCII
|
||||
*/
|
||||
(void)strncpy(obuf, inbuf, 8);
|
||||
}
|
||||
|
||||
/*****************
|
||||
* DES FUNCTIONS *
|
||||
*****************/
|
||||
/*
|
||||
* This sets the DES key and (if you're using the deszip version)
|
||||
* the direction of the transformation. This uses the Sun
|
||||
* to map the 64-bit key onto the 56 bits that the key schedule
|
||||
* generation routines use: the old way, which just uses the user-
|
||||
* supplied 64 bits as is, and the new way, which resets the parity
|
||||
* bit to be the same as the low-order bit in each character. The
|
||||
* new way generates a greater variety of key schedules, since many
|
||||
* systems set the parity (high) bit of each character to 0, and the
|
||||
* DES ignores the low order bit of each character.
|
||||
*/
|
||||
static void
|
||||
set_des_key(Desbuf buf /* key block */)
|
||||
{
|
||||
int i, j; /* counter in a for loop */
|
||||
int par; /* parity counter */
|
||||
|
||||
/*
|
||||
* if the parity is not preserved, flip it
|
||||
*/
|
||||
if (!pflag) {
|
||||
for (i = 0; i < 8; i++) {
|
||||
par = 0;
|
||||
for (j = 1; j < 8; j++)
|
||||
if ((bits[j]&UCHAR(buf, i)) != 0)
|
||||
par++;
|
||||
if ((par&01) == 01)
|
||||
UCHAR(buf, i) = UCHAR(buf, i)&0177;
|
||||
else
|
||||
UCHAR(buf, i) = (UCHAR(buf, i)&0177)|0200;
|
||||
}
|
||||
}
|
||||
|
||||
DES_KEY(UBUFFER(buf));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* This encrypts using the Cipher Block Chaining mode of DES
|
||||
*/
|
||||
static int
|
||||
cbc_encode(char *msgbuf, int n, FILE *fp)
|
||||
{
|
||||
int inverse = 0; /* 0 to encrypt, 1 to decrypt */
|
||||
|
||||
/*
|
||||
* do the transformation
|
||||
*/
|
||||
if (n == 8) {
|
||||
for (n = 0; n < 8; n++)
|
||||
CHAR(msgbuf, n) ^= CHAR(ivec, n);
|
||||
DES_XFORM(UBUFFER(msgbuf));
|
||||
MEMCPY(BUFFER(ivec), BUFFER(msgbuf), 8);
|
||||
return WRITE(BUFFER(msgbuf), 8, fp);
|
||||
}
|
||||
/*
|
||||
* at EOF or last block -- in either case, the last byte contains
|
||||
* the character representation of the number of bytes in it
|
||||
*/
|
||||
/*
|
||||
MEMZERO(msgbuf + n, 8 - n);
|
||||
*/
|
||||
/*
|
||||
* Pad the last block randomly
|
||||
*/
|
||||
(void)MEMCPY(BUFFER(msgbuf + n), BUFFER(pvec), 8 - n);
|
||||
CHAR(msgbuf, 7) = n;
|
||||
for (n = 0; n < 8; n++)
|
||||
CHAR(msgbuf, n) ^= CHAR(ivec, n);
|
||||
DES_XFORM(UBUFFER(msgbuf));
|
||||
return WRITE(BUFFER(msgbuf), 8, fp);
|
||||
}
|
||||
|
||||
/*
|
||||
* This decrypts using the Cipher Block Chaining mode of DES
|
||||
*/
|
||||
static int
|
||||
cbc_decode(char *msgbuf /* I/O buffer */,
|
||||
FILE *fp /* input file descriptor */)
|
||||
{
|
||||
Desbuf inbuf; /* temp buffer for initialization vector */
|
||||
int n; /* number of bytes actually read */
|
||||
int c; /* used to test for EOF */
|
||||
int inverse = 1; /* 0 to encrypt, 1 to decrypt */
|
||||
|
||||
if ((n = READ(BUFFER(msgbuf), 8, fp)) == 8) {
|
||||
/*
|
||||
* do the transformation
|
||||
*/
|
||||
MEMCPY(BUFFER(inbuf), BUFFER(msgbuf), 8);
|
||||
DES_XFORM(UBUFFER(msgbuf));
|
||||
for (c = 0; c < 8; c++)
|
||||
UCHAR(msgbuf, c) ^= UCHAR(ivec, c);
|
||||
MEMCPY(BUFFER(ivec), BUFFER(inbuf), 8);
|
||||
/*
|
||||
* if the last one, handle it specially
|
||||
*/
|
||||
if ((c = fgetc(fp)) == EOF) {
|
||||
n = CHAR(msgbuf, 7);
|
||||
if (n < 0 || n > 7) {
|
||||
des_error("decryption failed (block corrupted)");
|
||||
return EOF;
|
||||
}
|
||||
} else
|
||||
(void)ungetc(c, fp);
|
||||
return n;
|
||||
}
|
||||
if (n > 0)
|
||||
des_error("decryption failed (incomplete block)");
|
||||
else if (n < 0)
|
||||
des_error("cannot read file");
|
||||
return EOF;
|
||||
}
|
||||
#endif /* DES */
|
||||
972
bin/ed/ed.1
Normal file
972
bin/ed/ed.1
Normal file
@@ -0,0 +1,972 @@
|
||||
.\" $NetBSD: ed.1,v 1.30 2010/05/14 02:09:58 joerg Exp $
|
||||
.\" $OpenBSD: ed.1,v 1.42 2003/07/27 13:25:43 jmc Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1993 Andrew Moore, Talke Studio.
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd January 23, 2002
|
||||
.Dt ED 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm ed
|
||||
.Nd text editor
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Op Fl
|
||||
.Op Fl Esx
|
||||
.Op Fl p Ar string
|
||||
.Op Ar file
|
||||
.Sh DESCRIPTION
|
||||
.Nm
|
||||
is a line-oriented text editor.
|
||||
It is used to create, display, modify, and otherwise manipulate text files.
|
||||
If invoked with a
|
||||
.Ar file
|
||||
argument, then a copy of
|
||||
.Ar file
|
||||
is read into the editor's buffer.
|
||||
Changes are made to this copy and not directly to
|
||||
.Ar file
|
||||
itself.
|
||||
Upon quitting
|
||||
.Nm ,
|
||||
any changes not explicitly saved with a
|
||||
.Ic w
|
||||
command are lost.
|
||||
.Pp
|
||||
Editing is done in two distinct modes:
|
||||
.Em command
|
||||
and
|
||||
.Em input .
|
||||
When first invoked,
|
||||
.Nm
|
||||
is in command mode.
|
||||
In this mode, commands are read from the standard input and
|
||||
executed to manipulate the contents of the editor buffer.
|
||||
.Pp
|
||||
A typical command might look like:
|
||||
.Bd -literal -offset indent
|
||||
,s/old/new/g
|
||||
.Ed
|
||||
.Pp
|
||||
which replaces all occurrences of the string
|
||||
.Pa old
|
||||
with
|
||||
.Pa new .
|
||||
.Pp
|
||||
When an input command, such as
|
||||
.Ic a
|
||||
(append),
|
||||
.Ic i
|
||||
(insert),
|
||||
or
|
||||
.Ic c
|
||||
(change) is given,
|
||||
.Nm
|
||||
enters input mode.
|
||||
This is the primary means of adding text to a file.
|
||||
In this mode, no commands are available;
|
||||
instead, the standard input is written directly to the editor buffer.
|
||||
Lines consist of text up to and including a newline character.
|
||||
Input mode is terminated by entering a single period
|
||||
.Pq Ql \&.
|
||||
on a line.
|
||||
.Pp
|
||||
All
|
||||
.Nm
|
||||
commands operate on whole lines or ranges of lines; e.g.,
|
||||
the
|
||||
.Ic d
|
||||
command deletes lines; the
|
||||
.Ic m
|
||||
command moves lines, and so on.
|
||||
It is possible to modify only a portion of a line by means of replacement,
|
||||
as in the example above.
|
||||
However, even here, the
|
||||
.Ic s
|
||||
command is applied to whole lines at a time.
|
||||
.Pp
|
||||
In general,
|
||||
.Nm
|
||||
commands consist of zero or more line addresses, followed by a single
|
||||
character command and possibly additional parameters; i.e.,
|
||||
commands have the structure:
|
||||
.Bd -literal -offset indent
|
||||
[address [,address]]command[parameters]
|
||||
.Ed
|
||||
.Pp
|
||||
The address(es) indicate the line or range of lines to be affected by the
|
||||
command.
|
||||
If fewer addresses are given than the command accepts, then
|
||||
default addresses are supplied.
|
||||
.Pp
|
||||
The options are as follows:
|
||||
.Bl -tag -width Ds
|
||||
.It Fl
|
||||
Same as the
|
||||
.Fl s
|
||||
option (deprecated).
|
||||
.It Fl E
|
||||
Enables the use of extended regular expressions instead of the basic
|
||||
regular expressions that are normally used.
|
||||
.It Fl p Ar string
|
||||
Specifies a command prompt.
|
||||
This may be toggled on and off with the
|
||||
.Ic P
|
||||
command.
|
||||
.It Fl s
|
||||
Suppress diagnostics.
|
||||
This should be used if
|
||||
.Nm
|
||||
standard input is from a script.
|
||||
.It Fl x
|
||||
Prompt for an encryption key to be used in subsequent reads and writes
|
||||
(see the
|
||||
.Ic x
|
||||
command).
|
||||
.It Ar file
|
||||
Specifies the name of a file to read.
|
||||
If
|
||||
.Ar file
|
||||
is prefixed with a
|
||||
bang
|
||||
.Pq Ql \&! ,
|
||||
then it is interpreted as a shell command.
|
||||
In this case, what is read is the standard output of
|
||||
.Ar file
|
||||
executed via
|
||||
.Xr sh 1 .
|
||||
To read a file whose name begins with a bang, prefix the
|
||||
name with a backslash
|
||||
.Pq Ql \e .
|
||||
The default filename is set to
|
||||
.Ar file
|
||||
only if it is not prefixed with a bang.
|
||||
.El
|
||||
.Ss LINE ADDRESSING
|
||||
An address represents the number of a line in the buffer.
|
||||
.Nm
|
||||
maintains a
|
||||
.Em current address
|
||||
which is typically supplied to commands as the default address
|
||||
when none is specified.
|
||||
When a file is first read, the current address is set to the last line
|
||||
of the file.
|
||||
In general, the current address is set to the last line affected by a command.
|
||||
.Pp
|
||||
A line address is
|
||||
constructed from one of the bases in the list below, optionally followed
|
||||
by a numeric offset.
|
||||
The offset may include any combination of digits, operators (i.e.,
|
||||
.Sq + ,
|
||||
.Sq - ,
|
||||
and
|
||||
.Sq ^ ) ,
|
||||
and whitespace.
|
||||
Addresses are read from left to right, and their values are computed
|
||||
relative to the current address.
|
||||
.Pp
|
||||
One exception to the rule that addresses represent line numbers is the
|
||||
address
|
||||
.Em 0
|
||||
(zero).
|
||||
This means
|
||||
.Dq before the first line ,
|
||||
and is legal wherever it makes sense.
|
||||
.Pp
|
||||
An address range is two addresses separated either by a comma or semi-colon.
|
||||
The value of the first address in a range cannot exceed the
|
||||
value of the second.
|
||||
If only one address is given in a range,
|
||||
then the second address is set to the given address.
|
||||
If an
|
||||
.Em n Ns No -tuple
|
||||
of addresses is given where
|
||||
.Em n \*[Gt] 2 ,
|
||||
then the corresponding range is determined by the last two addresses in the
|
||||
.Em n Ns No -tuple.
|
||||
If only one address is expected, then the last address is used.
|
||||
.Pp
|
||||
Each address in a comma-delimited range is interpreted relative to the
|
||||
current address.
|
||||
In a semi-colon-delimited range, the first address is
|
||||
used to set the current address, and the second address is interpreted
|
||||
relative to the first.
|
||||
.Pp
|
||||
The following address symbols are recognized:
|
||||
.Bl -tag -width Ds
|
||||
.It Em \&.
|
||||
The current line (address) in the buffer.
|
||||
.It Em $
|
||||
The last line in the buffer.
|
||||
.It Em n
|
||||
The
|
||||
.Em n Ns No th
|
||||
line in the buffer where
|
||||
.Em n
|
||||
is a number in the range
|
||||
.Em [0,$] .
|
||||
.It Em - No or Em ^
|
||||
The previous line.
|
||||
This is equivalent to
|
||||
.Em -1
|
||||
and may be repeated with cumulative effect.
|
||||
.It Em -n No or Em ^n
|
||||
The
|
||||
.Em n Ns No th
|
||||
previous line, where
|
||||
.Em n
|
||||
is a non-negative number.
|
||||
.It Em +
|
||||
The next line.
|
||||
This is equivalent to
|
||||
.Em +1
|
||||
and may be repeated with cumulative effect.
|
||||
.It Em +n
|
||||
The
|
||||
.Em n Ns No th
|
||||
next line, where
|
||||
.Em n
|
||||
is a non-negative number.
|
||||
.It Em whitespace Em n
|
||||
.Em whitespace
|
||||
followed by a number
|
||||
.Em n
|
||||
is interpreted as
|
||||
.Sq Em +n .
|
||||
.It Em \&, No or Em %
|
||||
The first through last lines in the buffer.
|
||||
This is equivalent to the address range
|
||||
.Em 1,$ .
|
||||
.It Em \&;
|
||||
The current through last lines in the buffer.
|
||||
This is equivalent to the address range
|
||||
.Em .,$ .
|
||||
.It Em / Ns Ar re Ns Em /
|
||||
The next line containing the regular expression
|
||||
.Ar re .
|
||||
The search wraps to the beginning of the buffer and continues down to the
|
||||
current line, if necessary.
|
||||
.Em //
|
||||
repeats the last search.
|
||||
.It Em \&? Ns Ar re Ns Em \&?
|
||||
The previous line containing the regular expression
|
||||
.Ar re .
|
||||
The search wraps to the end of the buffer and continues up to the
|
||||
current line, if necessary.
|
||||
.Em ??
|
||||
repeats the last search.
|
||||
.It Em \&\' Ns Ar lc
|
||||
The line previously marked by a
|
||||
.Ic k
|
||||
(mark) command, where
|
||||
.Ar lc
|
||||
is a lower case letter.
|
||||
.El
|
||||
.Ss REGULAR EXPRESSIONS
|
||||
Regular expressions are patterns used in selecting text.
|
||||
For example, the
|
||||
.Nm
|
||||
command
|
||||
.Bd -literal -offset indent
|
||||
g/string/
|
||||
.Ed
|
||||
.Pp
|
||||
prints all lines containing
|
||||
.Em string .
|
||||
Regular expressions are also used by the
|
||||
.Ic s
|
||||
command for selecting old text to be replaced with new.
|
||||
.Pp
|
||||
In addition to specifying string literals, regular expressions can
|
||||
represent classes of strings.
|
||||
Strings thus represented are said to be matched by the
|
||||
corresponding regular expression.
|
||||
If it is possible for a regular expression to match several strings in
|
||||
a line, then the leftmost longest match is the one selected.
|
||||
.Pp
|
||||
The following symbols are used in constructing regular expressions:
|
||||
.Bl -tag -width Dsasdfsd
|
||||
.It Em c
|
||||
Any character
|
||||
.Em c
|
||||
not listed below, including
|
||||
.Sq { ,
|
||||
.Sq } ,
|
||||
.Sq \&( ,
|
||||
.Sq \&) ,
|
||||
.Sq \*[Lt] ,
|
||||
and
|
||||
.Sq \*[Gt]
|
||||
matches itself.
|
||||
.It Em \ec
|
||||
Any backslash-escaped character
|
||||
.Em c ,
|
||||
except for
|
||||
.Sq { ,
|
||||
.Sq } ,
|
||||
.Sq \&( ,
|
||||
.Sq \&) ,
|
||||
.Sq \*[Lt] ,
|
||||
and
|
||||
.Sq \*[Gt]
|
||||
matches itself.
|
||||
.It Em \&.
|
||||
Matches any single character.
|
||||
.It Em [char-class]
|
||||
Matches any single character in the character class
|
||||
.Em char-class .
|
||||
See
|
||||
.Sx CHARACTER CLASSES
|
||||
below for further information.
|
||||
.It Em [^char-class]
|
||||
Matches any single character, other than newline, not in the
|
||||
character class
|
||||
.Em char-class .
|
||||
.It Em ^
|
||||
If
|
||||
.Em ^
|
||||
is the first character of a regular expression, then it
|
||||
anchors the regular expression to the beginning of a line.
|
||||
Otherwise, it matches itself.
|
||||
.It Em $
|
||||
If
|
||||
.Em $
|
||||
is the last character of a regular expression,
|
||||
it anchors the regular expression to the end of a line.
|
||||
Otherwise, it matches itself.
|
||||
.It Em \e\*[Lt]
|
||||
Anchors the single character regular expression or subexpression
|
||||
immediately following it to the beginning of a word.
|
||||
(This may not be available.)
|
||||
.It Em \e\*[Gt]
|
||||
Anchors the single character regular expression or subexpression
|
||||
immediately following it to the end of a word.
|
||||
(This may not be available.)
|
||||
.It Em \e( Ns Ar re Ns Em \e)
|
||||
Defines a subexpression
|
||||
.Ar re .
|
||||
Subexpressions may be nested.
|
||||
A subsequent backreference of the form
|
||||
.Em \en ,
|
||||
where
|
||||
.Em n
|
||||
is a number in the range [1,9], expands to the text matched by the
|
||||
.Em n Ns No th
|
||||
subexpression.
|
||||
For example, the regular expression
|
||||
.Em \e(.*\e)\e1
|
||||
matches any string consisting of identical adjacent substrings.
|
||||
Subexpressions are ordered relative to their left delimiter.
|
||||
.It Em *
|
||||
Matches the single character regular expression or subexpression
|
||||
immediately preceding it zero or more times.
|
||||
If
|
||||
.Em *
|
||||
is the first character of a regular expression or subexpression,
|
||||
then it matches itself.
|
||||
The
|
||||
.Em *
|
||||
operator sometimes yields unexpected results.
|
||||
For example, the regular expression
|
||||
.Em b*
|
||||
matches the beginning of the string
|
||||
.Em abbb
|
||||
(as opposed to the substring
|
||||
.Em bbb ) ,
|
||||
since a null match is the only leftmost match.
|
||||
.Sm off
|
||||
.It Em \e{ No n,m Em \e}\ \e{ No n, Em \e}\ \& Em \e{ No n Em \e}
|
||||
.Sm on
|
||||
Matches the single character regular expression or subexpression
|
||||
immediately preceding it at least
|
||||
.Em n
|
||||
and at most
|
||||
.Em m
|
||||
times.
|
||||
If
|
||||
.Em m
|
||||
is omitted, then it matches at least
|
||||
.Em n
|
||||
times.
|
||||
If the comma is also omitted, then it matches exactly
|
||||
.Em n
|
||||
times.
|
||||
.El
|
||||
.Pp
|
||||
Additional regular expression operators may be defined depending on the
|
||||
particular
|
||||
.Xr regex 3
|
||||
implementation.
|
||||
.Ss CHARACTER CLASSES
|
||||
A character class specifies a set of characters. It is written within
|
||||
square brackets
|
||||
.Pq []
|
||||
and in its most basic form contains just the characters in the set.
|
||||
.Pp
|
||||
To include a
|
||||
.Sq \&]
|
||||
in a character class, it must be the first character.
|
||||
A range of characters may be specified by separating the end characters
|
||||
of the range with a
|
||||
.Sq \&- ,
|
||||
e.g.,
|
||||
.Sq a-z
|
||||
specifies the lower case characters.
|
||||
.Pp
|
||||
The following literals can also be used within character classes as
|
||||
shorthand for particular sets of characters:
|
||||
.Bl -tag -offset indent -compact -width [:blahblah:]
|
||||
.It [:alnum:]
|
||||
Alphanumeric characters.
|
||||
.It [:cntrl:]
|
||||
Control characters.
|
||||
.It [:lower:]
|
||||
Lowercase alphabetic characters.
|
||||
.It [:space:]
|
||||
Whitespace (space, tab, newline, form feed, etc.)
|
||||
.It [:alpha:]
|
||||
Alphabetic characters.
|
||||
.It [:digit:]
|
||||
Numeric characters (digits).
|
||||
.It [:print:]
|
||||
Printable characters.
|
||||
.It [:upper:]
|
||||
Uppercase alphabetic characters.
|
||||
.It [:blank:]
|
||||
Blank characters (space and tab).
|
||||
.It [:graph:]
|
||||
Graphical characters (printing nonblank characters).
|
||||
.It [:punct:]
|
||||
Punctuation characters.
|
||||
.It [:xdigit:]
|
||||
Hexadecimal digits.
|
||||
.El
|
||||
If
|
||||
.Sq \&-
|
||||
appears as the first or last character of a character class, then
|
||||
it matches itself.
|
||||
All other characters in a character class match themselves.
|
||||
.Pp
|
||||
Patterns in
|
||||
a character class
|
||||
of the form
|
||||
.Em [.col-elm.]
|
||||
or
|
||||
.Em [=col-elm=]
|
||||
where
|
||||
.Em col-elm
|
||||
is a
|
||||
.Em collating element
|
||||
are interpreted according to
|
||||
.Xr locale 5
|
||||
(not currently supported).
|
||||
See
|
||||
.Xr regex 3
|
||||
for an explanation of these constructs.
|
||||
.Ss COMMANDS
|
||||
All
|
||||
.Nm
|
||||
commands are single characters, though some require additional parameters.
|
||||
If a command's parameters extend over several lines, then
|
||||
each line except for the last must be terminated with a backslash
|
||||
.Pq Ql \e .
|
||||
.Pp
|
||||
In general, at most one command is allowed per line.
|
||||
However, most commands accept a print suffix, which is any of
|
||||
.Ic p
|
||||
(print),
|
||||
.Ic l
|
||||
(list),
|
||||
or
|
||||
.Ic n
|
||||
(enumerate), to print the last line affected by the command.
|
||||
.Pp
|
||||
An interrupt (typically ^C) has the effect of aborting the current command
|
||||
and returning the editor to command mode.
|
||||
.Pp
|
||||
.Nm
|
||||
recognizes the following commands.
|
||||
The commands are shown together with
|
||||
the default address or address range supplied if none is
|
||||
specified (in parentheses), and other possible arguments on the right.
|
||||
.Bl -tag -width Dxxs
|
||||
.It (.) Ns Ic a
|
||||
Appends text to the buffer after the addressed line.
|
||||
Text is entered in input mode.
|
||||
The current address is set to last line entered.
|
||||
.It (.,.) Ns Ic c
|
||||
Changes lines in the buffer.
|
||||
The addressed lines are deleted from the buffer,
|
||||
and text is appended in their place.
|
||||
Text is entered in input mode.
|
||||
The current address is set to last line entered.
|
||||
.It (.,.) Ns Ic d
|
||||
Deletes the addressed lines from the buffer.
|
||||
If there is a line after the deleted range, then the current address is set
|
||||
to this line.
|
||||
Otherwise the current address is set to the line before the deleted range.
|
||||
.It Ic e Ar file
|
||||
Edits
|
||||
.Ar file ,
|
||||
and sets the default filename.
|
||||
If
|
||||
.Ar file
|
||||
is not specified, then the default filename is used.
|
||||
Any lines in the buffer are deleted before the new file is read.
|
||||
The current address is set to the last line read.
|
||||
.It Ic e Ar !command
|
||||
Edits the standard output of
|
||||
.Ar command ,
|
||||
(see
|
||||
.Ic \&! Ar command
|
||||
below).
|
||||
The default filename is unchanged.
|
||||
Any lines in the buffer are deleted before the output of
|
||||
.Em command
|
||||
is read.
|
||||
The current address is set to the last line read.
|
||||
.It Ic E Ar file
|
||||
Edits
|
||||
.Ar file
|
||||
unconditionally.
|
||||
This is similar to the
|
||||
.Ic e
|
||||
command, except that unwritten changes are discarded without warning.
|
||||
The current address is set to the last line read.
|
||||
.It Ic f Ar file
|
||||
Sets the default filename to
|
||||
.Ar file .
|
||||
If
|
||||
.Ar file
|
||||
is not specified, then the default unescaped filename is printed.
|
||||
.It (1,$) Ns Ic g Ns Ar /re/command-list
|
||||
Applies
|
||||
.Ar command-list
|
||||
to each of the addressed lines matching a regular expression
|
||||
.Ar re .
|
||||
The current address is set to the line currently matched before
|
||||
.Ar command-list
|
||||
is executed.
|
||||
At the end of the
|
||||
.Ic g
|
||||
command, the current address is set to the last line affected by
|
||||
.Ar command-list .
|
||||
.Pp
|
||||
Each command in
|
||||
.Ar command-list
|
||||
must be on a separate line,
|
||||
and every line except for the last must be terminated by a backslash
|
||||
.Pq Sq \e .
|
||||
Any commands are allowed, except for
|
||||
.Ic g ,
|
||||
.Ic G ,
|
||||
.Ic v ,
|
||||
and
|
||||
.Ic V .
|
||||
A newline alone in
|
||||
.Ar command-list
|
||||
is equivalent to a
|
||||
.Ic p
|
||||
command.
|
||||
.It (1,$) Ns Ic G Ns Ar /re/
|
||||
Interactively edits the addressed lines matching a regular expression
|
||||
.Ar re .
|
||||
For each matching line, the line is printed, the current address is set,
|
||||
and the user is prompted to enter a
|
||||
.Ar command-list .
|
||||
At the end of the
|
||||
.Ic G
|
||||
command, the current address is set to the last line affected by (the last)
|
||||
.Ar command-list .
|
||||
.Pp
|
||||
The format of
|
||||
.Ar command-list
|
||||
is the same as that of the
|
||||
.Ic g
|
||||
command.
|
||||
A newline alone acts as a null command list.
|
||||
A single
|
||||
.Sq \*[Am]
|
||||
repeats the last non-null command list.
|
||||
.It Ic H
|
||||
Toggles the printing of error explanations.
|
||||
By default, explanations are not printed.
|
||||
It is recommended that
|
||||
.Nm
|
||||
scripts begin with this command to aid in debugging.
|
||||
.It Ic h
|
||||
Prints an explanation of the last error.
|
||||
.It (.) Ns Ic i
|
||||
Inserts text in the buffer before the current line.
|
||||
Text is entered in input mode.
|
||||
The current address is set to the last line entered.
|
||||
.It (.,.+1) Ns Ic j
|
||||
Joins the addressed lines.
|
||||
The addressed lines are deleted from the buffer and replaced by a single
|
||||
line containing their joined text.
|
||||
The current address is set to the resultant line.
|
||||
.It (.) Ns Ic k Ns Ar lc
|
||||
Marks a line with a lower case letter
|
||||
.Ar lc .
|
||||
The line can then be addressed as
|
||||
.Ar \&'lc
|
||||
(i.e., a single quote followed by
|
||||
.Ar lc )
|
||||
in subsequent commands.
|
||||
The mark is not cleared until the line is deleted or otherwise modified.
|
||||
.It (.,.) Ns Ic l
|
||||
Prints the addressed lines unambiguously.
|
||||
If a single line fills more than one screen (as might be the case
|
||||
when viewing a binary file, for instance), a
|
||||
.Dq --More--
|
||||
prompt is printed on the last line.
|
||||
.Nm
|
||||
waits until the RETURN key is pressed before displaying the next screen.
|
||||
The current address is set to the last line printed.
|
||||
.It (.,.) Ns Ic m Ns No (.)
|
||||
Moves lines in the buffer.
|
||||
The addressed lines are moved to after the
|
||||
right-hand destination address, which may be the address
|
||||
.Em 0
|
||||
(zero).
|
||||
The current address is set to the last line moved.
|
||||
.It (.,.) Ns Ic n
|
||||
Prints the addressed lines along with their line numbers.
|
||||
The current address is set to the last line printed.
|
||||
.It (.,.) Ns Ic p
|
||||
Prints the addressed lines.
|
||||
The current address is set to the last line printed.
|
||||
.It Ic P
|
||||
Toggles the command prompt on and off.
|
||||
Unless a prompt was specified with the command-line option
|
||||
.Fl p Ar string ,
|
||||
the command prompt is by default turned off.
|
||||
.It Ic q
|
||||
Quits
|
||||
.Nm .
|
||||
.It Ic Q
|
||||
Quits
|
||||
.Nm
|
||||
unconditionally.
|
||||
This is similar to the
|
||||
.Ic q
|
||||
command, except that unwritten changes are discarded without warning.
|
||||
.It ($) Ns Ic r Ar file
|
||||
Reads
|
||||
.Ar file
|
||||
to after the addressed line.
|
||||
If
|
||||
.Ar file
|
||||
is not specified, then the default filename is used.
|
||||
If there was no default filename prior to the command,
|
||||
then the default filename is set to
|
||||
.Ar file .
|
||||
Otherwise, the default filename is unchanged.
|
||||
The current address is set to the last line read.
|
||||
.It ($) Ns Ic r Ar !command
|
||||
Reads to after the addressed line the standard output of
|
||||
.Ar command ,
|
||||
(see the
|
||||
.Ic \&!
|
||||
command below).
|
||||
The default filename is unchanged.
|
||||
The current address is set to the last line read.
|
||||
.Sm off
|
||||
.It (.,.) Ic s Ar /re/replacement/ , \ (.,.) \
|
||||
Ic s Ar /re/replacement/ Em g , Ar \ (.,.) \
|
||||
Ic s Ar /re/replacement/ Em n
|
||||
.Sm on
|
||||
Replaces text in the addressed lines matching a regular expression
|
||||
.Ar re
|
||||
with
|
||||
.Ar replacement .
|
||||
By default, only the first match in each line is replaced.
|
||||
If the
|
||||
.Em g
|
||||
(global) suffix is given, then every match to be replaced.
|
||||
The
|
||||
.Em n
|
||||
suffix, where
|
||||
.Em n
|
||||
is a positive number, causes only the
|
||||
.Em n Ns No th
|
||||
match to be replaced.
|
||||
It is an error if no substitutions are performed on any of the addressed
|
||||
lines.
|
||||
The current address is set the last line affected.
|
||||
.Pp
|
||||
.Ar re
|
||||
and
|
||||
.Ar replacement
|
||||
may be delimited by any character other than space and newline
|
||||
(see the
|
||||
.Ic s
|
||||
command below).
|
||||
If one or two of the last delimiters is omitted, then the last line
|
||||
affected is printed as though the print suffix
|
||||
.Em p
|
||||
were specified.
|
||||
.Pp
|
||||
An unescaped
|
||||
.Ql \*[Am]
|
||||
in
|
||||
.Ar replacement
|
||||
is replaced by the currently matched text.
|
||||
The character sequence
|
||||
.Em \em ,
|
||||
where
|
||||
.Em m
|
||||
is a number in the range [1,9], is replaced by the
|
||||
.Em m Ns No th
|
||||
backreference expression of the matched text.
|
||||
If
|
||||
.Ar replacement
|
||||
consists of a single
|
||||
.Ql % ,
|
||||
then
|
||||
.Ar replacement
|
||||
from the last substitution is used.
|
||||
Newlines may be embedded in
|
||||
.Ar replacement
|
||||
if they are escaped with a backslash
|
||||
.Pq Ql \e .
|
||||
.It (.,.) Ns Ic s
|
||||
Repeats the last substitution.
|
||||
This form of the
|
||||
.Ic s
|
||||
command accepts a count suffix
|
||||
.Em n ,
|
||||
or any combination of the characters
|
||||
.Em r ,
|
||||
.Em g ,
|
||||
and
|
||||
.Em p .
|
||||
If a count suffix
|
||||
.Em n
|
||||
is given, then only the
|
||||
.Em n Ns No th
|
||||
match is replaced.
|
||||
The
|
||||
.Em r
|
||||
suffix causes
|
||||
the regular expression of the last search to be used instead of
|
||||
that of the last substitution.
|
||||
The
|
||||
.Em g
|
||||
suffix toggles the global suffix of the last substitution.
|
||||
The
|
||||
.Em p
|
||||
suffix toggles the print suffix of the last substitution.
|
||||
The current address is set to the last line affected.
|
||||
.It (.,.) Ns Ic t Ns No (.)
|
||||
Copies (i.e., transfers) the addressed lines to after the right-hand
|
||||
destination address, which may be the address
|
||||
.Em 0
|
||||
(zero).
|
||||
The current address is set to the last line copied.
|
||||
.It Ic u
|
||||
Undoes the last command and restores the current address
|
||||
to what it was before the command.
|
||||
The global commands
|
||||
.Ic g ,
|
||||
.Ic G ,
|
||||
.Ic v ,
|
||||
and
|
||||
.Ic V
|
||||
are treated as a single command by undo.
|
||||
.Ic u
|
||||
is its own inverse.
|
||||
.It (1,$) Ns Ic v Ns Ar /re/command-list
|
||||
Applies
|
||||
.Ar command-list
|
||||
to each of the addressed lines not matching a regular expression
|
||||
.Ar re .
|
||||
This is similar to the
|
||||
.Ic g
|
||||
command.
|
||||
.It (1,$) Ns Ic V Ns Ar /re/
|
||||
Interactively edits the addressed lines not matching a regular expression
|
||||
.Ar re .
|
||||
This is similar to the
|
||||
.Ic G
|
||||
command.
|
||||
.It (1,$) Ns Ic w Ar file
|
||||
Writes the addressed lines to
|
||||
.Ar file .
|
||||
Any previous contents of
|
||||
.Ar file
|
||||
are lost without warning.
|
||||
If there is no default filename, then the default filename is set to
|
||||
.Ar file ,
|
||||
otherwise it is unchanged.
|
||||
If no filename is specified, then the default filename is used.
|
||||
The current address is unchanged.
|
||||
.It (1,$) Ns Ic wq Ar file
|
||||
Writes the addressed lines to
|
||||
.Ar file ,
|
||||
and then executes a
|
||||
.Ic q
|
||||
command.
|
||||
.It (1,$) Ns Ic w Ar !command
|
||||
Writes the addressed lines to the standard input of
|
||||
.Ar command ,
|
||||
(see the
|
||||
.Ic \&!
|
||||
command below).
|
||||
The default filename and current address are unchanged.
|
||||
.It (1,$) Ns Ic W Ar file
|
||||
Appends the addressed lines to the end of
|
||||
.Ar file .
|
||||
This is similar to the
|
||||
.Ic w
|
||||
command, except that the previous contents of file are not clobbered.
|
||||
The current address is unchanged.
|
||||
.It Ic x
|
||||
Prompts for an encryption key which is used in subsequent reads and writes.
|
||||
If a newline alone is entered as the key, then encryption is turned off.
|
||||
Otherwise, echoing is disabled while a key is read.
|
||||
Encryption/decryption is done using the
|
||||
.Xr bdes 1
|
||||
algorithm.
|
||||
.It (.+1) Ns Ic z Ns Ar n
|
||||
Scrolls
|
||||
.Ar n
|
||||
lines at a time starting at addressed line.
|
||||
If
|
||||
.Ar n
|
||||
is not specified, then the current window size is used.
|
||||
The current address is set to the last line printed.
|
||||
.It ($) Ns Ic =
|
||||
Prints the line number of the addressed line.
|
||||
.It (.+1) Ns Ic newline
|
||||
Prints the addressed line, and sets the current address to that line.
|
||||
.It Ic \&! Ns Ar command
|
||||
Executes
|
||||
.Ar command
|
||||
via
|
||||
.Xr sh 1 .
|
||||
If the first character of
|
||||
.Ar command
|
||||
is
|
||||
.Ic \&! ,
|
||||
then it is replaced by text of the previous
|
||||
.Ic !command .
|
||||
.Nm
|
||||
does not process
|
||||
.Ar command
|
||||
for
|
||||
.Sq \e
|
||||
(backslash) escapes.
|
||||
However, an unescaped
|
||||
.Sq %
|
||||
is replaced by the default filename.
|
||||
When the shell returns from execution, a
|
||||
.Sq \&!
|
||||
is printed to the standard output.
|
||||
The current line is unchanged.
|
||||
.El
|
||||
.Sh LIMITATIONS
|
||||
.Nm
|
||||
processes
|
||||
.Em file
|
||||
arguments for backslash escapes, i.e., in a filename,
|
||||
any characters preceded by a backslash
|
||||
.Pq Ql \e
|
||||
are interpreted literally.
|
||||
.Pp
|
||||
If a text (non-binary) file is not terminated by a newline character,
|
||||
then
|
||||
.Nm
|
||||
appends one on reading/writing it.
|
||||
In the case of a binary file,
|
||||
.Nm
|
||||
does not append a newline on reading/writing.
|
||||
.Sh ENVIRONMENT
|
||||
.Bl -tag -width iTMPDIR
|
||||
.It Ev TMPDIR
|
||||
The location used to store temporary files.
|
||||
.El
|
||||
.Sh FILES
|
||||
.Bl -tag -width /tmp/ed.* -compact
|
||||
.It Pa /tmp/ed.*
|
||||
buffer file
|
||||
.It Pa ed.hup
|
||||
where
|
||||
.Nm
|
||||
attempts to write the buffer if the terminal hangs up
|
||||
.El
|
||||
.Sh DIAGNOSTICS
|
||||
When an error occurs,
|
||||
.Nm
|
||||
prints a
|
||||
.Dq \&?
|
||||
and either returns to command mode or exits if its input is from a script.
|
||||
An explanation of the last error can be printed with the
|
||||
.Ic h
|
||||
(help) command.
|
||||
.Pp
|
||||
Since the
|
||||
.Ic g
|
||||
(global) command masks any errors from failed searches and substitutions,
|
||||
it can be used to perform conditional operations in scripts; e.g.,
|
||||
.Bd -literal -offset indent
|
||||
g/old/s//new/
|
||||
.Ed
|
||||
.Pp
|
||||
replaces any occurrences of
|
||||
.Em old
|
||||
with
|
||||
.Em new .
|
||||
.Pp
|
||||
If the
|
||||
.Ic u
|
||||
(undo) command occurs in a global command list, then
|
||||
the command list is executed only once.
|
||||
.Pp
|
||||
If diagnostics are not disabled, attempting to quit
|
||||
.Nm
|
||||
or edit another file before writing a modified buffer results in an error.
|
||||
If the command is entered a second time, it succeeds,
|
||||
but any changes to the buffer are lost.
|
||||
.Sh SEE ALSO
|
||||
.Xr bdes 1 ,
|
||||
.Xr sed 1 ,
|
||||
.Xr sh 1 ,
|
||||
.Xr vi 1 ,
|
||||
.Xr regex 3
|
||||
.Pp
|
||||
USD:09-10
|
||||
.Rs
|
||||
.%A B. W. Kernighan
|
||||
.%A P. J. Plauger
|
||||
.%B Software Tools in Pascal
|
||||
.%I Addison-Wesley
|
||||
.%D 1981
|
||||
.Re
|
||||
.Sh HISTORY
|
||||
An
|
||||
.Nm
|
||||
command appeared in
|
||||
.At v1 .
|
||||
293
bin/ed/ed.h
Normal file
293
bin/ed/ed.h
Normal file
@@ -0,0 +1,293 @@
|
||||
/* $NetBSD: ed.h,v 1.35 2011/08/29 14:51:18 joerg Exp $ */
|
||||
|
||||
/* ed.h: type and constant definitions for the ed editor. */
|
||||
/*
|
||||
* Copyright (c) 1993 Andrew Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)ed.h,v 1.5 1994/02/01 00:34:39 alm Exp
|
||||
*/
|
||||
#include <sys/types.h>
|
||||
#if defined(BSD) && BSD >= 199103 || defined(__386BSD__)
|
||||
# include <sys/param.h> /* for MAXPATHLEN */
|
||||
#endif
|
||||
#include <errno.h>
|
||||
#if defined(sun) || defined(__NetBSD__) || defined(__APPLE__) || \
|
||||
defined(__minix)
|
||||
# include <limits.h>
|
||||
#endif
|
||||
#include <regex.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define ERR (-2)
|
||||
#define EMOD (-3)
|
||||
#define FATAL (-4)
|
||||
|
||||
#ifndef MAXPATHLEN
|
||||
# define MAXPATHLEN 255 /* _POSIX_PATH_MAX */
|
||||
#endif
|
||||
|
||||
#define MINBUFSZ 512 /* minimum buffer size - must be > 0 */
|
||||
#define SE_MAX 30 /* max subexpressions in a regular expression */
|
||||
#ifdef INT_MAX
|
||||
# define LINECHARS INT_MAX /* max chars per line */
|
||||
#else
|
||||
# define LINECHARS MAXINT /* max chars per line */
|
||||
#endif
|
||||
|
||||
/* gflags */
|
||||
#define GLB 001 /* global command */
|
||||
#define GPR 002 /* print after command */
|
||||
#define GLS 004 /* list after command */
|
||||
#define GNP 010 /* enumerate after command */
|
||||
#define GSG 020 /* global substitute */
|
||||
|
||||
typedef regex_t pattern_t;
|
||||
|
||||
/* Line node */
|
||||
typedef struct line {
|
||||
struct line *q_forw;
|
||||
struct line *q_back;
|
||||
off_t seek; /* address of line in scratch buffer */
|
||||
int len; /* length of line */
|
||||
} line_t;
|
||||
|
||||
|
||||
typedef struct undo {
|
||||
|
||||
/* type of undo nodes */
|
||||
#define UADD 0
|
||||
#define UDEL 1
|
||||
#define UMOV 2
|
||||
#define VMOV 3
|
||||
|
||||
int type; /* command type */
|
||||
line_t *h; /* head of list */
|
||||
line_t *t; /* tail of list */
|
||||
} undo_t;
|
||||
|
||||
#ifndef max
|
||||
# define max(a,b) ((a) > (b) ? (a) : (b))
|
||||
#endif
|
||||
#ifndef min
|
||||
# define min(a,b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#define INC_MOD(l, k) ((l) + 1 > (k) ? 0 : (l) + 1)
|
||||
#define DEC_MOD(l, k) ((l) - 1 < 0 ? (k) : (l) - 1)
|
||||
|
||||
/* SPL1: disable some interrupts (requires reliable signals) */
|
||||
#define SPL1() mutex++
|
||||
|
||||
/* SPL0: enable all interrupts; check sigflags (requires reliable signals) */
|
||||
#define SPL0() \
|
||||
if (--mutex == 0) { \
|
||||
if (sigflags & (1 << (SIGHUP - 1))) handle_hup(SIGHUP); \
|
||||
if (sigflags & (1 << (SIGINT - 1))) handle_int(SIGINT); \
|
||||
}
|
||||
|
||||
/* STRTOL: convert a string to long */
|
||||
#define STRTOL(i, p) { \
|
||||
errno = 0 ; \
|
||||
if (((i = strtol(p, &p, 10)) == LONG_MIN || i == LONG_MAX) && \
|
||||
errno == ERANGE) { \
|
||||
sprintf(errmsg, "number out of range"); \
|
||||
i = 0; \
|
||||
return ERR; \
|
||||
} \
|
||||
}
|
||||
|
||||
#if defined(sun) || defined(NO_REALLOC_NULL)
|
||||
/* REALLOC: assure at least a minimum size for buffer b */
|
||||
#define REALLOC(b,n,i,err) \
|
||||
if ((i) > (n)) { \
|
||||
int ti = (n); \
|
||||
char *ts; \
|
||||
SPL1(); \
|
||||
if ((b) != NULL) { \
|
||||
if ((ts = (char *) realloc((b), ti += max((i), MINBUFSZ))) == NULL) { \
|
||||
fprintf(stderr, "%s\n", strerror(errno)); \
|
||||
sprintf(errmsg, "out of memory"); \
|
||||
SPL0(); \
|
||||
return err; \
|
||||
} \
|
||||
} else { \
|
||||
if ((ts = (char *) malloc(ti += max((i), MINBUFSZ))) == NULL) { \
|
||||
fprintf(stderr, "%s\n", strerror(errno)); \
|
||||
sprintf(errmsg, "out of memory"); \
|
||||
SPL0(); \
|
||||
return err; \
|
||||
} \
|
||||
} \
|
||||
(n) = ti; \
|
||||
(b) = ts; \
|
||||
SPL0(); \
|
||||
}
|
||||
#else /* NO_REALLOC_NULL */
|
||||
/* REALLOC: assure at least a minimum size for buffer b */
|
||||
#define REALLOC(b,n,i,err) \
|
||||
if ((i) > (n)) { \
|
||||
int ti = (n); \
|
||||
char *ts; \
|
||||
SPL1(); \
|
||||
if ((ts = (char *) realloc((b), ti += max((i), MINBUFSZ))) == NULL) { \
|
||||
fprintf(stderr, "%s\n", strerror(errno)); \
|
||||
sprintf(errmsg, "out of memory"); \
|
||||
SPL0(); \
|
||||
return err; \
|
||||
} \
|
||||
(n) = ti; \
|
||||
(b) = ts; \
|
||||
SPL0(); \
|
||||
}
|
||||
#endif /* NO_REALLOC_NULL */
|
||||
|
||||
/* REQUE: link pred before succ */
|
||||
#define REQUE(pred, succ) (pred)->q_forw = (succ), (succ)->q_back = (pred)
|
||||
|
||||
/* INSQUE: insert elem in circular queue after pred */
|
||||
#define INSQUE(elem, pred) \
|
||||
{ \
|
||||
REQUE((elem), (pred)->q_forw); \
|
||||
REQUE((pred), elem); \
|
||||
}
|
||||
|
||||
/* remque: remove_lines elem from circular queue */
|
||||
#define REMQUE(elem) REQUE((elem)->q_back, (elem)->q_forw);
|
||||
|
||||
/* NUL_TO_NEWLINE: overwrite ASCII NULs with newlines */
|
||||
#define NUL_TO_NEWLINE(s, l) translit_text(s, l, '\0', '\n')
|
||||
|
||||
/* NEWLINE_TO_NUL: overwrite newlines with ASCII NULs */
|
||||
#define NEWLINE_TO_NUL(s, l) translit_text(s, l, '\n', '\0')
|
||||
|
||||
#if defined(sun) && !defined(__SVR4)
|
||||
# define strerror(n) sys_errlist[n]
|
||||
#endif
|
||||
|
||||
/* Local Function Declarations */
|
||||
void add_line_node(line_t *);
|
||||
int append_lines(long);
|
||||
int apply_subst_template(char *, regmatch_t *, int, int);
|
||||
int build_active_list(int);
|
||||
int check_addr_range(long, long);
|
||||
void clear_active_list(void);
|
||||
void clear_undo_stack(void);
|
||||
int close_sbuf(void);
|
||||
int copy_lines(long);
|
||||
int delete_lines(long, long);
|
||||
int display_lines(long, long, int);
|
||||
line_t *dup_line_node(line_t *);
|
||||
int exec_command(void);
|
||||
long exec_global(int, int);
|
||||
int extract_addr_range(void);
|
||||
char *extract_pattern(int);
|
||||
int extract_subst_tail(int *, long *);
|
||||
char *extract_subst_template(void);
|
||||
int filter_lines(long, long, char *);
|
||||
int flush_des_file(FILE *);
|
||||
line_t *get_addressed_line_node(long);
|
||||
pattern_t *get_compiled_pattern(void);
|
||||
int get_des_char(FILE *);
|
||||
char *get_extended_line(int *, int);
|
||||
char *get_filename(void);
|
||||
int get_keyword(void);
|
||||
long get_line_node_addr(line_t *);
|
||||
long get_matching_node_addr(pattern_t *, int);
|
||||
long get_marked_node_addr(int);
|
||||
char *get_sbuf_line(line_t *);
|
||||
int get_shell_command(void);
|
||||
int get_stream_line(FILE *);
|
||||
int get_tty_line(void);
|
||||
__dead void handle_hup(int);
|
||||
__dead void handle_int(int);
|
||||
void handle_winch(int);
|
||||
int has_trailing_escape(char *, char *);
|
||||
void init_buffers(void);
|
||||
void init_des_cipher(void);
|
||||
int is_legal_filename(char *);
|
||||
int join_lines(long, long);
|
||||
int mark_line_node(line_t *, int);
|
||||
int move_lines(long);
|
||||
line_t *next_active_node(void);
|
||||
long next_addr(void);
|
||||
int open_sbuf(void);
|
||||
char *parse_char_class(char *);
|
||||
int pop_undo_stack(void);
|
||||
undo_t *push_undo_stack(int, long, long);
|
||||
int put_des_char(int, FILE *);
|
||||
char *put_sbuf_line(char *);
|
||||
int put_stream_line(FILE *, char *, int);
|
||||
int put_tty_line(char *, int, long, int);
|
||||
__dead void quit(int);
|
||||
long read_file(char *, long);
|
||||
long read_stream(FILE *, long);
|
||||
int search_and_replace(pattern_t *, int, int);
|
||||
int set_active_node(line_t *);
|
||||
void signal_hup(int);
|
||||
void signal_int(int);
|
||||
char *strip_escapes(const char *);
|
||||
int substitute_matching_text(pattern_t *, line_t *, int, int);
|
||||
char *translit_text(char *, int, int, int);
|
||||
void unmark_line_node(line_t *);
|
||||
void unset_active_nodes(line_t *, line_t *);
|
||||
long write_file(const char *, const char *, long, long);
|
||||
long write_stream(FILE *, long, long);
|
||||
|
||||
/* global buffers */
|
||||
extern char stdinbuf[];
|
||||
extern char *ibuf;
|
||||
extern char *ibufp;
|
||||
extern int ibufsz;
|
||||
|
||||
/* global flags */
|
||||
extern int isbinary;
|
||||
extern int isglobal;
|
||||
extern int modified;
|
||||
extern int mutex;
|
||||
extern int sigflags;
|
||||
|
||||
/* global vars */
|
||||
extern long addr_last;
|
||||
extern long current_addr;
|
||||
extern long first_addr;
|
||||
extern int lineno;
|
||||
extern long second_addr;
|
||||
extern long rows;
|
||||
extern int cols;
|
||||
extern int scripted;
|
||||
extern int ere;
|
||||
extern int des;
|
||||
extern int newline_added; /* io.c */
|
||||
extern int patlock;
|
||||
extern char errmsg[]; /* re.c */
|
||||
extern long u_current_addr; /* undo.c */
|
||||
extern long u_addr_last; /* undo.c */
|
||||
#if defined(sun) && !defined(__SVR4)
|
||||
extern char *sys_errlist[];
|
||||
#endif
|
||||
227
bin/ed/glbl.c
Normal file
227
bin/ed/glbl.c
Normal file
@@ -0,0 +1,227 @@
|
||||
/* $NetBSD: glbl.c,v 1.6 2005/06/26 19:10:49 christos Exp $ */
|
||||
|
||||
/* glob.c: This file contains the global command routines for the ed line
|
||||
editor */
|
||||
/*-
|
||||
* Copyright (c) 1993 Andrew Moore, Talke Studio.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char *rcsid = "@(#)glob.c,v 1.1 1994/02/01 00:34:40 alm Exp";
|
||||
#else
|
||||
__RCSID("$NetBSD: glbl.c,v 1.6 2005/06/26 19:10:49 christos Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
#include "ed.h"
|
||||
|
||||
|
||||
/* build_active_list: add line matching a pattern to the global-active list */
|
||||
int
|
||||
build_active_list(int isgcmd)
|
||||
{
|
||||
pattern_t *pat;
|
||||
line_t *lp;
|
||||
long n;
|
||||
char *s;
|
||||
char delimiter;
|
||||
|
||||
if ((delimiter = *ibufp) == ' ' || delimiter == '\n') {
|
||||
sprintf(errmsg, "invalid pattern delimiter");
|
||||
return ERR;
|
||||
} else if ((pat = get_compiled_pattern()) == NULL)
|
||||
return ERR;
|
||||
else if (*ibufp == delimiter)
|
||||
ibufp++;
|
||||
clear_active_list();
|
||||
lp = get_addressed_line_node(first_addr);
|
||||
for (n = first_addr; n <= second_addr; n++, lp = lp->q_forw) {
|
||||
if ((s = get_sbuf_line(lp)) == NULL)
|
||||
return ERR;
|
||||
if (isbinary)
|
||||
NUL_TO_NEWLINE(s, lp->len);
|
||||
if (!regexec(pat, s, 0, NULL, 0) == isgcmd &&
|
||||
set_active_node(lp) < 0)
|
||||
return ERR;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* exec_global: apply command list in the command buffer to the active
|
||||
lines in a range; return command status */
|
||||
long
|
||||
exec_global(int interact, int gflag)
|
||||
{
|
||||
static char *ocmd = NULL;
|
||||
static int ocmdsz = 0;
|
||||
|
||||
line_t *lp = NULL;
|
||||
int status;
|
||||
int n;
|
||||
char *cmd = NULL;
|
||||
#ifdef BACKWARDS
|
||||
char cmdp[] = "p\n";
|
||||
|
||||
if (!interact) {
|
||||
if (!strcmp(ibufp, "\n"))
|
||||
cmd = cmdp; /* null cmd-list == `p' */
|
||||
else if ((cmd = get_extended_line(&n, 0)) == NULL)
|
||||
return ERR;
|
||||
}
|
||||
#else
|
||||
if (!interact && (cmd = get_extended_line(&n, 0)) == NULL)
|
||||
return ERR;
|
||||
#endif
|
||||
clear_undo_stack();
|
||||
while ((lp = next_active_node()) != NULL) {
|
||||
if ((current_addr = get_line_node_addr(lp)) < 0)
|
||||
return ERR;
|
||||
if (interact) {
|
||||
/* print current_addr; get a command in global syntax */
|
||||
if (display_lines(current_addr, current_addr, gflag) < 0)
|
||||
return ERR;
|
||||
while ((n = get_tty_line()) > 0 &&
|
||||
ibuf[n - 1] != '\n')
|
||||
clearerr(stdin);
|
||||
if (n < 0)
|
||||
return ERR;
|
||||
else if (n == 0) {
|
||||
sprintf(errmsg, "unexpected end-of-file");
|
||||
return ERR;
|
||||
} else if (n == 1 && !strcmp(ibuf, "\n"))
|
||||
continue;
|
||||
else if (n == 2 && !strcmp(ibuf, "&\n")) {
|
||||
if (cmd == NULL) {
|
||||
sprintf(errmsg, "no previous command");
|
||||
return ERR;
|
||||
} else cmd = ocmd;
|
||||
} else if ((cmd = get_extended_line(&n, 0)) == NULL)
|
||||
return ERR;
|
||||
else {
|
||||
REALLOC(ocmd, ocmdsz, n + 1, ERR);
|
||||
memcpy(ocmd, cmd, n + 1);
|
||||
cmd = ocmd;
|
||||
}
|
||||
|
||||
}
|
||||
ibufp = cmd;
|
||||
for (; *ibufp;)
|
||||
if ((status = extract_addr_range()) < 0 ||
|
||||
(status = exec_command()) < 0 ||
|
||||
(status > 0 && (status = display_lines(
|
||||
current_addr, current_addr, status))) < 0)
|
||||
return status;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
line_t **active_list; /* list of lines active in a global command */
|
||||
long active_last; /* index of last active line in active_list */
|
||||
long active_size; /* size of active_list */
|
||||
long active_ptr; /* active_list index (non-decreasing) */
|
||||
long active_ndx; /* active_list index (modulo active_last) */
|
||||
|
||||
/* set_active_node: add a line node to the global-active list */
|
||||
int
|
||||
set_active_node(line_t *lp)
|
||||
{
|
||||
if (active_last + 1 > active_size) {
|
||||
int ti = active_size;
|
||||
line_t **ts;
|
||||
SPL1();
|
||||
#if defined(sun) || defined(NO_REALLOC_NULL)
|
||||
if (active_list != NULL) {
|
||||
#endif
|
||||
if ((ts = (line_t **) realloc(active_list,
|
||||
(ti += MINBUFSZ) * sizeof(line_t **))) == NULL) {
|
||||
fprintf(stderr, "%s\n", strerror(errno));
|
||||
sprintf(errmsg, "out of memory");
|
||||
SPL0();
|
||||
return ERR;
|
||||
}
|
||||
#if defined(sun) || defined(NO_REALLOC_NULL)
|
||||
} else {
|
||||
if ((ts = (line_t **) malloc((ti += MINBUFSZ) *
|
||||
sizeof(line_t **))) == NULL) {
|
||||
fprintf(stderr, "%s\n", strerror(errno));
|
||||
sprintf(errmsg, "out of memory");
|
||||
SPL0();
|
||||
return ERR;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
active_size = ti;
|
||||
active_list = ts;
|
||||
SPL0();
|
||||
}
|
||||
active_list[active_last++] = lp;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* unset_active_nodes: remove a range of lines from the global-active list */
|
||||
void
|
||||
unset_active_nodes(line_t *np, line_t *mp)
|
||||
{
|
||||
line_t *lp;
|
||||
long i;
|
||||
|
||||
for (lp = np; lp != mp; lp = lp->q_forw)
|
||||
for (i = 0; i < active_last; i++)
|
||||
if (active_list[active_ndx] == lp) {
|
||||
active_list[active_ndx] = NULL;
|
||||
active_ndx = INC_MOD(active_ndx, active_last - 1);
|
||||
break;
|
||||
} else active_ndx = INC_MOD(active_ndx, active_last - 1);
|
||||
}
|
||||
|
||||
|
||||
/* next_active_node: return the next global-active line node */
|
||||
line_t *
|
||||
next_active_node(void)
|
||||
{
|
||||
while (active_ptr < active_last && active_list[active_ptr] == NULL)
|
||||
active_ptr++;
|
||||
return (active_ptr < active_last) ? active_list[active_ptr++] : NULL;
|
||||
}
|
||||
|
||||
|
||||
/* clear_active_list: clear the global-active list */
|
||||
void
|
||||
clear_active_list(void)
|
||||
{
|
||||
SPL1();
|
||||
active_size = active_last = active_ptr = active_ndx = 0;
|
||||
free(active_list);
|
||||
active_list = NULL;
|
||||
SPL0();
|
||||
}
|
||||
358
bin/ed/io.c
Normal file
358
bin/ed/io.c
Normal file
@@ -0,0 +1,358 @@
|
||||
/* $NetBSD: io.c,v 1.9 2011/05/23 23:13:10 joerg Exp $ */
|
||||
|
||||
/* io.c: This file contains the i/o routines for the ed line editor */
|
||||
/*-
|
||||
* Copyright (c) 1993 Andrew Moore, Talke Studio.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char *rcsid = "@(#)io.c,v 1.1 1994/02/01 00:34:41 alm Exp";
|
||||
#else
|
||||
__RCSID("$NetBSD: io.c,v 1.9 2011/05/23 23:13:10 joerg Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include "ed.h"
|
||||
|
||||
|
||||
/* read_file: read a named file/pipe into the buffer; return line count */
|
||||
long
|
||||
read_file(char *fn, long n)
|
||||
{
|
||||
FILE *fp;
|
||||
long size;
|
||||
|
||||
|
||||
fp = (*fn == '!') ? popen(fn + 1, "r") : fopen(strip_escapes(fn), "r");
|
||||
if (fp == NULL) {
|
||||
fprintf(stderr, "%s: %s\n", fn, strerror(errno));
|
||||
sprintf(errmsg, "cannot open input file");
|
||||
return ERR;
|
||||
} else if ((size = read_stream(fp, n)) < 0)
|
||||
return ERR;
|
||||
else if (((*fn == '!') ? pclose(fp) : fclose(fp)) < 0) {
|
||||
fprintf(stderr, "%s: %s\n", fn, strerror(errno));
|
||||
sprintf(errmsg, "cannot close input file");
|
||||
return ERR;
|
||||
}
|
||||
if (!scripted)
|
||||
fprintf(stderr, "%lu\n", size);
|
||||
return current_addr - n;
|
||||
}
|
||||
|
||||
|
||||
char *sbuf; /* file i/o buffer */
|
||||
int sbufsz; /* file i/o buffer size */
|
||||
int newline_added; /* if set, newline appended to input file */
|
||||
|
||||
/* read_stream: read a stream into the editor buffer; return status */
|
||||
long
|
||||
read_stream(FILE *fp, long n)
|
||||
{
|
||||
line_t *lp = get_addressed_line_node(n);
|
||||
undo_t *up = NULL;
|
||||
unsigned long size = 0;
|
||||
int o_newline_added = newline_added;
|
||||
int o_isbinary = isbinary;
|
||||
int appended = (n == addr_last);
|
||||
int len;
|
||||
|
||||
isbinary = newline_added = 0;
|
||||
if (des)
|
||||
init_des_cipher();
|
||||
for (current_addr = n; (len = get_stream_line(fp)) > 0; size += len) {
|
||||
SPL1();
|
||||
if (put_sbuf_line(sbuf) == NULL) {
|
||||
SPL0();
|
||||
return ERR;
|
||||
}
|
||||
lp = lp->q_forw;
|
||||
if (up)
|
||||
up->t = lp;
|
||||
else if ((up = push_undo_stack(UADD, current_addr,
|
||||
current_addr)) == NULL) {
|
||||
SPL0();
|
||||
return ERR;
|
||||
}
|
||||
SPL0();
|
||||
}
|
||||
if (len < 0)
|
||||
return ERR;
|
||||
if (appended && size && o_isbinary && o_newline_added)
|
||||
fputs("newline inserted\n", stderr);
|
||||
else if (newline_added && (!appended || (!isbinary && !o_isbinary)))
|
||||
fputs("newline appended\n", stderr);
|
||||
if (isbinary && newline_added && !appended)
|
||||
size += 1;
|
||||
if (!size)
|
||||
newline_added = 1;
|
||||
newline_added = appended ? newline_added : o_newline_added;
|
||||
isbinary = isbinary | o_isbinary;
|
||||
if (des)
|
||||
size += 8 - size % 8; /* adjust DES size */
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
/* get_stream_line: read a line of text from a stream; return line length */
|
||||
int
|
||||
get_stream_line(FILE *fp)
|
||||
{
|
||||
int c;
|
||||
int i = 0;
|
||||
|
||||
while (((c = des ? get_des_char(fp) : getc(fp)) != EOF || (!feof(fp) &&
|
||||
!ferror(fp))) && c != '\n') {
|
||||
REALLOC(sbuf, sbufsz, i + 1, ERR);
|
||||
if (!(sbuf[i++] = c))
|
||||
isbinary = 1;
|
||||
}
|
||||
REALLOC(sbuf, sbufsz, i + 2, ERR);
|
||||
if (c == '\n')
|
||||
sbuf[i++] = c;
|
||||
else if (ferror(fp)) {
|
||||
fprintf(stderr, "%s\n", strerror(errno));
|
||||
sprintf(errmsg, "cannot read input file");
|
||||
return ERR;
|
||||
} else if (i) {
|
||||
sbuf[i++] = '\n';
|
||||
newline_added = 1;
|
||||
}
|
||||
sbuf[i] = '\0';
|
||||
return (isbinary && newline_added && i) ? --i : i;
|
||||
}
|
||||
|
||||
|
||||
/* write_file: write a range of lines to a named file/pipe; return line count */
|
||||
long
|
||||
write_file(const char *fn, const char *mode, long n, long m)
|
||||
{
|
||||
FILE *fp;
|
||||
long size;
|
||||
|
||||
fp = (*fn == '!') ? popen(fn+1, "w") : fopen(strip_escapes(fn), mode);
|
||||
if (fp == NULL) {
|
||||
fprintf(stderr, "%s: %s\n", fn, strerror(errno));
|
||||
sprintf(errmsg, "cannot open output file");
|
||||
return ERR;
|
||||
} else if ((size = write_stream(fp, n, m)) < 0)
|
||||
return ERR;
|
||||
else if (((*fn == '!') ? pclose(fp) : fclose(fp)) < 0) {
|
||||
fprintf(stderr, "%s: %s\n", fn, strerror(errno));
|
||||
sprintf(errmsg, "cannot close output file");
|
||||
return ERR;
|
||||
}
|
||||
if (!scripted)
|
||||
fprintf(stderr, "%lu\n", size);
|
||||
return n ? m - n + 1 : 0;
|
||||
}
|
||||
|
||||
|
||||
/* write_stream: write a range of lines to a stream; return status */
|
||||
long
|
||||
write_stream(FILE *fp, long n, long m)
|
||||
{
|
||||
line_t *lp = get_addressed_line_node(n);
|
||||
unsigned long size = 0;
|
||||
char *s;
|
||||
int len;
|
||||
|
||||
if (des)
|
||||
init_des_cipher();
|
||||
for (; n && n <= m; n++, lp = lp->q_forw) {
|
||||
if ((s = get_sbuf_line(lp)) == NULL)
|
||||
return ERR;
|
||||
len = lp->len;
|
||||
if (n != addr_last || !isbinary || !newline_added)
|
||||
s[len++] = '\n';
|
||||
if (put_stream_line(fp, s, len) < 0)
|
||||
return ERR;
|
||||
size += len;
|
||||
}
|
||||
if (des) {
|
||||
flush_des_file(fp); /* flush buffer */
|
||||
size += 8 - size % 8; /* adjust DES size */
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
/* put_stream_line: write a line of text to a stream; return status */
|
||||
int
|
||||
put_stream_line(FILE *fp, char *s, int len)
|
||||
{
|
||||
while (len--)
|
||||
if ((des ? put_des_char(*s++, fp) : fputc(*s++, fp)) < 0) {
|
||||
fprintf(stderr, "%s\n", strerror(errno));
|
||||
sprintf(errmsg, "cannot write file");
|
||||
return ERR;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* get_extended_line: get a an extended line from stdin */
|
||||
char *
|
||||
get_extended_line(int *sizep, int nonl)
|
||||
{
|
||||
static char *cvbuf = NULL; /* buffer */
|
||||
static int cvbufsz = 0; /* buffer size */
|
||||
|
||||
int l, n;
|
||||
char *t = ibufp;
|
||||
|
||||
while (*t++ != '\n')
|
||||
;
|
||||
if ((l = t - ibufp) < 2 || !has_trailing_escape(ibufp, ibufp + l - 1)) {
|
||||
*sizep = l;
|
||||
return ibufp;
|
||||
}
|
||||
*sizep = -1;
|
||||
REALLOC(cvbuf, cvbufsz, l, NULL);
|
||||
memcpy(cvbuf, ibufp, l);
|
||||
*(cvbuf + --l - 1) = '\n'; /* strip trailing esc */
|
||||
if (nonl) l--; /* strip newline */
|
||||
for (;;) {
|
||||
if ((n = get_tty_line()) < 0)
|
||||
return NULL;
|
||||
else if (n == 0 || ibuf[n - 1] != '\n') {
|
||||
sprintf(errmsg, "unexpected end-of-file");
|
||||
return NULL;
|
||||
}
|
||||
REALLOC(cvbuf, cvbufsz, l + n, NULL);
|
||||
memcpy(cvbuf + l, ibuf, n);
|
||||
l += n;
|
||||
if (n < 2 || !has_trailing_escape(cvbuf, cvbuf + l - 1))
|
||||
break;
|
||||
*(cvbuf + --l - 1) = '\n'; /* strip trailing esc */
|
||||
if (nonl) l--; /* strip newline */
|
||||
}
|
||||
REALLOC(cvbuf, cvbufsz, l + 1, NULL);
|
||||
cvbuf[l] = '\0';
|
||||
*sizep = l;
|
||||
return cvbuf;
|
||||
}
|
||||
|
||||
|
||||
/* get_tty_line: read a line of text from stdin; return line length */
|
||||
int
|
||||
get_tty_line(void)
|
||||
{
|
||||
int oi = 0;
|
||||
int i = 0;
|
||||
int c;
|
||||
|
||||
for (;;)
|
||||
switch (c = getchar()) {
|
||||
default:
|
||||
oi = 0;
|
||||
REALLOC(ibuf, ibufsz, i + 2, ERR);
|
||||
if (!(ibuf[i++] = c)) isbinary = 1;
|
||||
if (c != '\n')
|
||||
continue;
|
||||
lineno++;
|
||||
ibuf[i] = '\0';
|
||||
ibufp = ibuf;
|
||||
return i;
|
||||
case EOF:
|
||||
if (ferror(stdin)) {
|
||||
fprintf(stderr, "stdin: %s\n", strerror(errno));
|
||||
sprintf(errmsg, "cannot read stdin");
|
||||
clearerr(stdin);
|
||||
ibufp = NULL;
|
||||
return ERR;
|
||||
} else {
|
||||
clearerr(stdin);
|
||||
if (i != oi) {
|
||||
oi = i;
|
||||
continue;
|
||||
} else if (i)
|
||||
ibuf[i] = '\0';
|
||||
ibufp = ibuf;
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#define ESCAPES "\a\b\f\n\r\t\v\\"
|
||||
#define ESCCHARS "abfnrtv\\"
|
||||
|
||||
/* put_tty_line: print text to stdout */
|
||||
int
|
||||
put_tty_line(char *s, int l, long n, int gflag)
|
||||
{
|
||||
int col = 0;
|
||||
char *cp;
|
||||
#ifndef BACKWARDS
|
||||
int lc = 0;
|
||||
#endif
|
||||
|
||||
if (gflag & GNP) {
|
||||
printf("%ld\t", n);
|
||||
col = 8;
|
||||
}
|
||||
for (; l--; s++) {
|
||||
if ((gflag & GLS) && ++col > cols) {
|
||||
fputs("\\\n", stdout);
|
||||
col = 1;
|
||||
#ifndef BACKWARDS
|
||||
if (!scripted && !isglobal && ++lc > rows) {
|
||||
lc = 0;
|
||||
fputs("Press <RETURN> to continue... ", stdout);
|
||||
fflush(stdout);
|
||||
if (get_tty_line() < 0)
|
||||
return ERR;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if (gflag & GLS) {
|
||||
if (31 < *s && *s < 127 && *s != '\\')
|
||||
putchar(*s);
|
||||
else {
|
||||
putchar('\\');
|
||||
col++;
|
||||
if (*s && (cp = strchr(ESCAPES, *s)) != NULL)
|
||||
putchar(ESCCHARS[cp - ESCAPES]);
|
||||
else {
|
||||
putchar((((unsigned char) *s & 0300) >> 6) + '0');
|
||||
putchar((((unsigned char) *s & 070) >> 3) + '0');
|
||||
putchar(((unsigned char) *s & 07) + '0');
|
||||
col += 2;
|
||||
}
|
||||
}
|
||||
|
||||
} else
|
||||
putchar(*s);
|
||||
}
|
||||
#ifndef BACKWARDS
|
||||
if (gflag & GLS)
|
||||
putchar('$');
|
||||
#endif
|
||||
putchar('\n');
|
||||
return 0;
|
||||
}
|
||||
1425
bin/ed/main.c
Normal file
1425
bin/ed/main.c
Normal file
File diff suppressed because it is too large
Load Diff
135
bin/ed/re.c
Normal file
135
bin/ed/re.c
Normal file
@@ -0,0 +1,135 @@
|
||||
/* $NetBSD: re.c,v 1.19 2005/02/17 16:29:26 xtraeme Exp $ */
|
||||
|
||||
/* re.c: This file contains the regular expression interface routines for
|
||||
the ed line editor. */
|
||||
/*-
|
||||
* Copyright (c) 1993 Andrew Moore, Talke Studio.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char *rcsid = "@(#)re.c,v 1.6 1994/02/01 00:34:43 alm Exp";
|
||||
#else
|
||||
__RCSID("$NetBSD: re.c,v 1.19 2005/02/17 16:29:26 xtraeme Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include "ed.h"
|
||||
|
||||
|
||||
char errmsg[MAXPATHLEN + 40] = "";
|
||||
|
||||
/* get_compiled_pattern: return pointer to compiled pattern from command
|
||||
buffer */
|
||||
pattern_t *
|
||||
get_compiled_pattern(void)
|
||||
{
|
||||
static pattern_t *expr = NULL;
|
||||
|
||||
char *exps;
|
||||
char delimiter;
|
||||
int n;
|
||||
|
||||
if ((delimiter = *ibufp) == ' ') {
|
||||
sprintf(errmsg, "invalid pattern delimiter");
|
||||
return NULL;
|
||||
} else if (delimiter == '\n' || *++ibufp == '\n' || *ibufp == delimiter) {
|
||||
if (!expr) sprintf(errmsg, "no previous pattern");
|
||||
return expr;
|
||||
} else if ((exps = extract_pattern(delimiter)) == NULL)
|
||||
return NULL;
|
||||
/* buffer alloc'd && not reserved */
|
||||
if (expr && !patlock)
|
||||
regfree(expr);
|
||||
else if ((expr = (pattern_t *) malloc(sizeof(pattern_t))) == NULL) {
|
||||
fprintf(stderr, "%s\n", strerror(errno));
|
||||
sprintf(errmsg, "out of memory");
|
||||
return NULL;
|
||||
}
|
||||
patlock = 0;
|
||||
if ((n = regcomp(expr, exps, ere)) != 0) {
|
||||
regerror(n, expr, errmsg, sizeof errmsg);
|
||||
free(expr);
|
||||
return expr = NULL;
|
||||
}
|
||||
return expr;
|
||||
}
|
||||
|
||||
|
||||
/* extract_pattern: copy a pattern string from the command buffer; return
|
||||
pointer to the copy */
|
||||
char *
|
||||
extract_pattern(int delimiter)
|
||||
{
|
||||
static char *lhbuf = NULL; /* buffer */
|
||||
static int lhbufsz = 0; /* buffer size */
|
||||
|
||||
char *nd;
|
||||
int len;
|
||||
|
||||
for (nd = ibufp; *nd != delimiter && *nd != '\n'; nd++)
|
||||
switch (*nd) {
|
||||
default:
|
||||
break;
|
||||
case '[':
|
||||
if ((nd = parse_char_class(++nd)) == NULL) {
|
||||
sprintf(errmsg, "unbalanced brackets ([])");
|
||||
return NULL;
|
||||
}
|
||||
break;
|
||||
case '\\':
|
||||
if (*++nd == '\n') {
|
||||
sprintf(errmsg, "trailing backslash (\\)");
|
||||
return NULL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
len = nd - ibufp;
|
||||
REALLOC(lhbuf, lhbufsz, len + 1, NULL);
|
||||
memcpy(lhbuf, ibufp, len);
|
||||
lhbuf[len] = '\0';
|
||||
ibufp = nd;
|
||||
return (isbinary) ? NUL_TO_NEWLINE(lhbuf, len) : lhbuf;
|
||||
}
|
||||
|
||||
|
||||
/* parse_char_class: expand a POSIX character class */
|
||||
char *
|
||||
parse_char_class(char *s)
|
||||
{
|
||||
int c, d;
|
||||
|
||||
if (*s == '^')
|
||||
s++;
|
||||
if (*s == ']')
|
||||
s++;
|
||||
for (; *s != ']' && *s != '\n'; s++)
|
||||
if (*s == '[' && ((d = *(s+1)) == '.' || d == ':' || d == '='))
|
||||
for (s++, c = *++s; *s != ']' || c != d; s++)
|
||||
if ((c = *s) == '\n')
|
||||
return NULL;
|
||||
return (*s == ']') ? s : NULL;
|
||||
}
|
||||
260
bin/ed/sub.c
Normal file
260
bin/ed/sub.c
Normal file
@@ -0,0 +1,260 @@
|
||||
/* $NetBSD: sub.c,v 1.6 2005/02/17 16:29:26 xtraeme Exp $ */
|
||||
|
||||
/* sub.c: This file contains the substitution routines for the ed
|
||||
line editor */
|
||||
/*-
|
||||
* Copyright (c) 1993 Andrew Moore, Talke Studio.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char *rcsid = "@(#)sub.c,v 1.1 1994/02/01 00:34:44 alm Exp";
|
||||
#else
|
||||
__RCSID("$NetBSD: sub.c,v 1.6 2005/02/17 16:29:26 xtraeme Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include "ed.h"
|
||||
|
||||
|
||||
char *rhbuf; /* rhs substitution buffer */
|
||||
int rhbufsz; /* rhs substitution buffer size */
|
||||
int rhbufi; /* rhs substitution buffer index */
|
||||
|
||||
/* extract_subst_tail: extract substitution tail from the command buffer */
|
||||
int
|
||||
extract_subst_tail(int *flagp, long *np)
|
||||
{
|
||||
char delimiter;
|
||||
|
||||
*flagp = *np = 0;
|
||||
if ((delimiter = *ibufp) == '\n') {
|
||||
rhbufi = 0;
|
||||
*flagp = GPR;
|
||||
return 0;
|
||||
} else if (extract_subst_template() == NULL)
|
||||
return ERR;
|
||||
else if (*ibufp == '\n') {
|
||||
*flagp = GPR;
|
||||
return 0;
|
||||
} else if (*ibufp == delimiter)
|
||||
ibufp++;
|
||||
if ('1' <= *ibufp && *ibufp <= '9') {
|
||||
STRTOL(*np, ibufp);
|
||||
return 0;
|
||||
} else if (*ibufp == 'g') {
|
||||
ibufp++;
|
||||
*flagp = GSG;
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* extract_subst_template: return pointer to copy of substitution template
|
||||
in the command buffer */
|
||||
char *
|
||||
extract_subst_template(void)
|
||||
{
|
||||
int n = 0;
|
||||
int i = 0;
|
||||
char c;
|
||||
char delimiter = *ibufp++;
|
||||
|
||||
if (*ibufp == '%' && *(ibufp + 1) == delimiter) {
|
||||
ibufp++;
|
||||
if (!rhbuf) sprintf(errmsg, "no previous substitution");
|
||||
return rhbuf;
|
||||
}
|
||||
while (*ibufp != delimiter) {
|
||||
REALLOC(rhbuf, rhbufsz, i + 2, NULL);
|
||||
if ((c = rhbuf[i++] = *ibufp++) == '\n' && *ibufp == '\0') {
|
||||
i--, ibufp--;
|
||||
break;
|
||||
} else if (c != '\\')
|
||||
;
|
||||
else if ((rhbuf[i++] = *ibufp++) != '\n')
|
||||
;
|
||||
else if (!isglobal) {
|
||||
while ((n = get_tty_line()) == 0 ||
|
||||
(n > 0 && ibuf[n - 1] != '\n'))
|
||||
clearerr(stdin);
|
||||
if (n < 0)
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
REALLOC(rhbuf, rhbufsz, i + 1, NULL);
|
||||
rhbuf[rhbufi = i] = '\0';
|
||||
return rhbuf;
|
||||
}
|
||||
|
||||
|
||||
char *rbuf; /* substitute_matching_text buffer */
|
||||
int rbufsz; /* substitute_matching_text buffer size */
|
||||
|
||||
/* search_and_replace: for each line in a range, change text matching a pattern
|
||||
according to a substitution template; return status */
|
||||
int
|
||||
search_and_replace(pattern_t *pat, int gflag, int kth)
|
||||
{
|
||||
undo_t *up;
|
||||
char *txt;
|
||||
char *eot;
|
||||
long lc;
|
||||
long xa = current_addr;
|
||||
int nsubs = 0;
|
||||
line_t *lp;
|
||||
int len;
|
||||
|
||||
current_addr = first_addr - 1;
|
||||
for (lc = 0; lc <= second_addr - first_addr; lc++) {
|
||||
lp = get_addressed_line_node(++current_addr);
|
||||
if ((len = substitute_matching_text(pat, lp, gflag, kth)) < 0)
|
||||
return ERR;
|
||||
else if (len) {
|
||||
up = NULL;
|
||||
if (delete_lines(current_addr, current_addr) < 0)
|
||||
return ERR;
|
||||
txt = rbuf;
|
||||
eot = rbuf + len;
|
||||
SPL1();
|
||||
do {
|
||||
if ((txt = put_sbuf_line(txt)) == NULL) {
|
||||
SPL0();
|
||||
return ERR;
|
||||
} else if (up)
|
||||
up->t = get_addressed_line_node(current_addr);
|
||||
else if ((up = push_undo_stack(UADD,
|
||||
current_addr, current_addr)) == NULL) {
|
||||
SPL0();
|
||||
return ERR;
|
||||
}
|
||||
} while (txt != eot);
|
||||
SPL0();
|
||||
nsubs++;
|
||||
xa = current_addr;
|
||||
}
|
||||
}
|
||||
current_addr = xa;
|
||||
if (nsubs == 0 && !(gflag & GLB)) {
|
||||
sprintf(errmsg, "no match");
|
||||
return ERR;
|
||||
} else if ((gflag & (GPR | GLS | GNP)) &&
|
||||
display_lines(current_addr, current_addr, gflag) < 0)
|
||||
return ERR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* substitute_matching_text: replace text matched by a pattern according to
|
||||
a substitution template; return pointer to the modified text */
|
||||
int
|
||||
substitute_matching_text(pattern_t *pat, line_t *lp, int gflag, int kth)
|
||||
{
|
||||
int off = 0;
|
||||
int changed = 0;
|
||||
int matchno = 0;
|
||||
int i = 0;
|
||||
regmatch_t rm[SE_MAX];
|
||||
char *txt;
|
||||
char *eot;
|
||||
|
||||
if ((txt = get_sbuf_line(lp)) == NULL)
|
||||
return ERR;
|
||||
if (isbinary)
|
||||
NUL_TO_NEWLINE(txt, lp->len);
|
||||
eot = txt + lp->len;
|
||||
if (!regexec(pat, txt, SE_MAX, rm, 0)) {
|
||||
do {
|
||||
if (!kth || kth == ++matchno) {
|
||||
changed++;
|
||||
i = rm[0].rm_so;
|
||||
REALLOC(rbuf, rbufsz, off + i, ERR);
|
||||
if (isbinary)
|
||||
NEWLINE_TO_NUL(txt, rm[0].rm_eo);
|
||||
memcpy(rbuf + off, txt, i);
|
||||
off += i;
|
||||
if ((off = apply_subst_template(txt, rm, off,
|
||||
pat->re_nsub)) < 0)
|
||||
return ERR;
|
||||
} else {
|
||||
i = rm[0].rm_eo;
|
||||
REALLOC(rbuf, rbufsz, off + i, ERR);
|
||||
if (isbinary)
|
||||
NEWLINE_TO_NUL(txt, i);
|
||||
memcpy(rbuf + off, txt, i);
|
||||
off += i;
|
||||
}
|
||||
txt += rm[0].rm_eo;
|
||||
} while (*txt && (!changed || ((gflag & GSG) && rm[0].rm_eo))
|
||||
&& !regexec(pat, txt, SE_MAX, rm, REG_NOTBOL));
|
||||
i = eot - txt;
|
||||
REALLOC(rbuf, rbufsz, off + i + 2, ERR);
|
||||
if (i > 0 && !rm[0].rm_eo && (gflag & GSG)) {
|
||||
sprintf(errmsg, "infinite substitution loop");
|
||||
return ERR;
|
||||
}
|
||||
if (isbinary)
|
||||
NEWLINE_TO_NUL(txt, i);
|
||||
memcpy(rbuf + off, txt, i);
|
||||
memcpy(rbuf + off + i, "\n", 2);
|
||||
}
|
||||
return changed ? off + i + 1 : 0;
|
||||
}
|
||||
|
||||
|
||||
/* apply_subst_template: modify text according to a substitution template;
|
||||
return offset to end of modified text */
|
||||
int
|
||||
apply_subst_template(char *boln, regmatch_t *rm, int off, int re_nsub)
|
||||
{
|
||||
int j = 0;
|
||||
int k = 0;
|
||||
int n;
|
||||
char *sub = rhbuf;
|
||||
|
||||
for (; sub - rhbuf < rhbufi; sub++)
|
||||
if (*sub == '&') {
|
||||
j = rm[0].rm_so;
|
||||
k = rm[0].rm_eo;
|
||||
REALLOC(rbuf, rbufsz, off + k - j, ERR);
|
||||
while (j < k)
|
||||
rbuf[off++] = boln[j++];
|
||||
} else if (*sub == '\\' && '1' <= *++sub && *sub <= '9' &&
|
||||
(n = *sub - '0') <= re_nsub) {
|
||||
j = rm[n].rm_so;
|
||||
k = rm[n].rm_eo;
|
||||
REALLOC(rbuf, rbufsz, off + k - j, ERR);
|
||||
while (j < k)
|
||||
rbuf[off++] = boln[j++];
|
||||
} else {
|
||||
REALLOC(rbuf, rbufsz, off + 1, ERR);
|
||||
rbuf[off++] = *sub;
|
||||
}
|
||||
REALLOC(rbuf, rbufsz, off + 1, ERR);
|
||||
rbuf[off] = '\0';
|
||||
return off;
|
||||
}
|
||||
1
bin/ed/test/=.err
Normal file
1
bin/ed/test/=.err
Normal file
@@ -0,0 +1 @@
|
||||
1,$=
|
||||
28
bin/ed/test/Makefile
Normal file
28
bin/ed/test/Makefile
Normal file
@@ -0,0 +1,28 @@
|
||||
# $NetBSD: Makefile,v 1.12 2003/10/26 03:50:07 lukem Exp $
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
ED?= ../obj/ed
|
||||
|
||||
all: check
|
||||
@:
|
||||
|
||||
check: build test
|
||||
@if grep -h '\*\*\*' errs.o scripts.o; then :; else \
|
||||
echo "tests completed successfully."; \
|
||||
fi
|
||||
|
||||
build: mkscripts.sh
|
||||
@if [ -f errs.o ]; then :; else \
|
||||
echo "building test scripts for $(ED) ..."; \
|
||||
${HOST_SH} ${.CURDIR}/mkscripts.sh $(ED); \
|
||||
fi
|
||||
|
||||
test: build ckscripts.sh
|
||||
@echo testing $(ED) ...
|
||||
@${HOST_SH} ckscripts.sh $(ED)
|
||||
|
||||
clean:
|
||||
rm -f *.ed *.red *.[oz] *~
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
32
bin/ed/test/README
Normal file
32
bin/ed/test/README
Normal file
@@ -0,0 +1,32 @@
|
||||
$NetBSD: README,v 1.8 1995/03/21 09:05:18 cgd Exp $
|
||||
|
||||
The files in this directory with suffixes `.t', `.d', `.r' and `.err' are
|
||||
used for testing ed. To run the tests, set the ED variable in the Makefile
|
||||
for the path name of the program to be tested (e.g., /bin/ed), and type
|
||||
`make'. The tests do not exhaustively verify POSIX compliance nor do
|
||||
they verify correct 8-bit or long line support.
|
||||
|
||||
The test file suffixes have the following meanings:
|
||||
.t Template - a list of ed commands from which an ed script is
|
||||
constructed
|
||||
.d Data - read by an ed script
|
||||
.r Result - the expected output after processing data via an ed
|
||||
script.
|
||||
.err Error - invalid ed commands that should generate an error
|
||||
|
||||
The output of the tests is written to the two files err.o and scripts.o.
|
||||
At the end of the tests, these files are grep'ed for error messages,
|
||||
which look like:
|
||||
*** The script u.ed exited abnormally ***
|
||||
or:
|
||||
*** Output u.o of script u.ed is incorrect ***
|
||||
|
||||
The POSIX requirement that an address range not be used where at most
|
||||
a single address is expected has been relaxed in this version of ed.
|
||||
Therefore, the following scripts which test for compliance with this
|
||||
POSIX rule exit abnormally:
|
||||
=-err.ed
|
||||
a1-err.ed
|
||||
i1-err.ed
|
||||
k1-err.ed
|
||||
r1-err.ed
|
||||
17
bin/ed/test/TODO
Normal file
17
bin/ed/test/TODO
Normal file
@@ -0,0 +1,17 @@
|
||||
$NetBSD: TODO,v 1.3 1995/03/21 09:05:20 cgd Exp $
|
||||
|
||||
Some missing tests:
|
||||
0) g/./s^@^@ - okay: NULs in commands
|
||||
1) g/./s/^@/ - okay: NULs in patterns
|
||||
2) a
|
||||
hello^V^Jworld
|
||||
. - okay: embedded newlines in insert mode
|
||||
3) ed "" - error: invalid filename
|
||||
4) red .. - error: restricted
|
||||
5) red / - error: restricted
|
||||
5) red !xx - error: restricted
|
||||
6) ed -x - verify: 8-bit clean
|
||||
7) ed - verify: long-line support
|
||||
8) ed - verify: interactive/help mode
|
||||
9) G/pat/ - verify: global interactive command
|
||||
10) V/pat/ - verify: global interactive command
|
||||
8
bin/ed/test/a.r
Normal file
8
bin/ed/test/a.r
Normal file
@@ -0,0 +1,8 @@
|
||||
hello world
|
||||
line 1
|
||||
hello world!
|
||||
line 2
|
||||
line 3
|
||||
line 4
|
||||
line5
|
||||
hello world!!
|
||||
9
bin/ed/test/a.t
Normal file
9
bin/ed/test/a.t
Normal file
@@ -0,0 +1,9 @@
|
||||
0a
|
||||
hello world
|
||||
.
|
||||
2a
|
||||
hello world!
|
||||
.
|
||||
$a
|
||||
hello world!!
|
||||
.
|
||||
3
bin/ed/test/a1.err
Normal file
3
bin/ed/test/a1.err
Normal file
@@ -0,0 +1,3 @@
|
||||
1,$a
|
||||
hello world
|
||||
.
|
||||
3
bin/ed/test/a2.err
Normal file
3
bin/ed/test/a2.err
Normal file
@@ -0,0 +1,3 @@
|
||||
aa
|
||||
hello world
|
||||
.
|
||||
2
bin/ed/test/addr.r
Normal file
2
bin/ed/test/addr.r
Normal file
@@ -0,0 +1,2 @@
|
||||
line 2
|
||||
line9
|
||||
5
bin/ed/test/addr.t
Normal file
5
bin/ed/test/addr.t
Normal file
@@ -0,0 +1,5 @@
|
||||
1 d
|
||||
1 1 d
|
||||
1,2,d
|
||||
1;+ + ,d
|
||||
1,2;., + 2d
|
||||
1
bin/ed/test/addr1.err
Normal file
1
bin/ed/test/addr1.err
Normal file
@@ -0,0 +1 @@
|
||||
100
|
||||
1
bin/ed/test/addr2.err
Normal file
1
bin/ed/test/addr2.err
Normal file
@@ -0,0 +1 @@
|
||||
-100
|
||||
BIN
bin/ed/test/ascii.r
Normal file
BIN
bin/ed/test/ascii.r
Normal file
Binary file not shown.
1
bin/ed/test/bang1.err
Normal file
1
bin/ed/test/bang1.err
Normal file
@@ -0,0 +1 @@
|
||||
.!date
|
||||
1
bin/ed/test/bang1.r
Normal file
1
bin/ed/test/bang1.r
Normal file
@@ -0,0 +1 @@
|
||||
okay
|
||||
5
bin/ed/test/bang1.t
Normal file
5
bin/ed/test/bang1.t
Normal file
@@ -0,0 +1,5 @@
|
||||
!read one
|
||||
hello, world
|
||||
a
|
||||
okay
|
||||
.
|
||||
1
bin/ed/test/bang2.err
Normal file
1
bin/ed/test/bang2.err
Normal file
@@ -0,0 +1 @@
|
||||
!!
|
||||
4
bin/ed/test/c.r
Normal file
4
bin/ed/test/c.r
Normal file
@@ -0,0 +1,4 @@
|
||||
at the top
|
||||
between top/middle
|
||||
in the middle
|
||||
at the bottom
|
||||
12
bin/ed/test/c.t
Normal file
12
bin/ed/test/c.t
Normal file
@@ -0,0 +1,12 @@
|
||||
1c
|
||||
at the top
|
||||
.
|
||||
4c
|
||||
in the middle
|
||||
.
|
||||
$c
|
||||
at the bottom
|
||||
.
|
||||
2,3c
|
||||
between top/middle
|
||||
.
|
||||
3
bin/ed/test/c1.err
Normal file
3
bin/ed/test/c1.err
Normal file
@@ -0,0 +1,3 @@
|
||||
cc
|
||||
hello world
|
||||
.
|
||||
3
bin/ed/test/c2.err
Normal file
3
bin/ed/test/c2.err
Normal file
@@ -0,0 +1,3 @@
|
||||
0c
|
||||
hello world
|
||||
.
|
||||
37
bin/ed/test/ckscripts.sh
Executable file
37
bin/ed/test/ckscripts.sh
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/bin/sh -
|
||||
# $NetBSD: ckscripts.sh,v 1.9 1995/04/23 10:07:34 cgd Exp $
|
||||
#
|
||||
# This script runs the .ed scripts generated by mkscripts.sh
|
||||
# and compares their output against the .r files, which contain
|
||||
# the correct output
|
||||
|
||||
PATH="/bin:/usr/bin:/usr/local/bin/:."
|
||||
ED=$1
|
||||
[ ! -x $ED ] && { echo "$ED: cannot execute"; exit 1; }
|
||||
|
||||
# Run the *.red scripts first, since these don't generate output;
|
||||
# they exit with non-zero status
|
||||
for i in *.red; do
|
||||
echo $i
|
||||
if $i; then
|
||||
echo "*** The script $i exited abnormally ***"
|
||||
fi
|
||||
done >errs.o 2>&1
|
||||
|
||||
# Run the remainding scripts; they exit with zero status
|
||||
for i in *.ed; do
|
||||
# base=`expr $i : '\([^.]*\)'`
|
||||
# base=`echo $i | sed 's/\..*//'`
|
||||
base=`$ED - \!"echo $i" <<-EOF
|
||||
s/\..*
|
||||
EOF`
|
||||
if $base.ed; then
|
||||
if cmp -s $base.o $base.r; then :; else
|
||||
echo "*** Output $base.o of script $i is incorrect ***"
|
||||
fi
|
||||
else
|
||||
echo "*** The script $i exited abnormally ***"
|
||||
fi
|
||||
done >scripts.o 2>&1
|
||||
|
||||
grep -h '\*\*\*' errs.o scripts.o
|
||||
1
bin/ed/test/d.err
Normal file
1
bin/ed/test/d.err
Normal file
@@ -0,0 +1 @@
|
||||
dd
|
||||
1
bin/ed/test/d.r
Normal file
1
bin/ed/test/d.r
Normal file
@@ -0,0 +1 @@
|
||||
line 2
|
||||
3
bin/ed/test/d.t
Normal file
3
bin/ed/test/d.t
Normal file
@@ -0,0 +1,3 @@
|
||||
1d
|
||||
2;+1d
|
||||
$d
|
||||
1
bin/ed/test/e1.err
Normal file
1
bin/ed/test/e1.err
Normal file
@@ -0,0 +1 @@
|
||||
ee e1.err
|
||||
1
bin/ed/test/e1.r
Normal file
1
bin/ed/test/e1.r
Normal file
@@ -0,0 +1 @@
|
||||
E e1.t
|
||||
1
bin/ed/test/e1.t
Normal file
1
bin/ed/test/e1.t
Normal file
@@ -0,0 +1 @@
|
||||
E e1.t
|
||||
1
bin/ed/test/e2.err
Normal file
1
bin/ed/test/e2.err
Normal file
@@ -0,0 +1 @@
|
||||
.e e2.err
|
||||
1
bin/ed/test/e2.r
Normal file
1
bin/ed/test/e2.r
Normal file
@@ -0,0 +1 @@
|
||||
hello world-
|
||||
1
bin/ed/test/e2.t
Normal file
1
bin/ed/test/e2.t
Normal file
@@ -0,0 +1 @@
|
||||
E !echo hello world-
|
||||
1
bin/ed/test/e3.err
Normal file
1
bin/ed/test/e3.err
Normal file
@@ -0,0 +1 @@
|
||||
ee.err
|
||||
1
bin/ed/test/e3.r
Normal file
1
bin/ed/test/e3.r
Normal file
@@ -0,0 +1 @@
|
||||
E !echo hello world-
|
||||
1
bin/ed/test/e3.t
Normal file
1
bin/ed/test/e3.t
Normal file
@@ -0,0 +1 @@
|
||||
E
|
||||
1
bin/ed/test/e4.r
Normal file
1
bin/ed/test/e4.r
Normal file
@@ -0,0 +1 @@
|
||||
E !echo hello world-
|
||||
1
bin/ed/test/e4.t
Normal file
1
bin/ed/test/e4.t
Normal file
@@ -0,0 +1 @@
|
||||
e
|
||||
1
bin/ed/test/f1.err
Normal file
1
bin/ed/test/f1.err
Normal file
@@ -0,0 +1 @@
|
||||
.f f1.err
|
||||
1
bin/ed/test/f2.err
Normal file
1
bin/ed/test/f2.err
Normal file
@@ -0,0 +1 @@
|
||||
ff1.err
|
||||
1
bin/ed/test/g1.err
Normal file
1
bin/ed/test/g1.err
Normal file
@@ -0,0 +1 @@
|
||||
g/./s //x/
|
||||
15
bin/ed/test/g1.r
Normal file
15
bin/ed/test/g1.r
Normal file
@@ -0,0 +1,15 @@
|
||||
line5
|
||||
help! world
|
||||
order
|
||||
line 4
|
||||
help! world
|
||||
order
|
||||
line 3
|
||||
help! world
|
||||
order
|
||||
line 2
|
||||
help! world
|
||||
order
|
||||
line 1
|
||||
help! world
|
||||
order
|
||||
6
bin/ed/test/g1.t
Normal file
6
bin/ed/test/g1.t
Normal file
@@ -0,0 +1,6 @@
|
||||
g/./m0
|
||||
g/./s/$/\
|
||||
hello world
|
||||
g/hello /s/lo/p!/\
|
||||
a\
|
||||
order
|
||||
1
bin/ed/test/g2.err
Normal file
1
bin/ed/test/g2.err
Normal file
@@ -0,0 +1 @@
|
||||
g//s/./x/
|
||||
1
bin/ed/test/g2.r
Normal file
1
bin/ed/test/g2.r
Normal file
@@ -0,0 +1 @@
|
||||
hello world
|
||||
2
bin/ed/test/g2.t
Normal file
2
bin/ed/test/g2.t
Normal file
@@ -0,0 +1,2 @@
|
||||
g/[2-4]/-1,+1c\
|
||||
hello world
|
||||
1
bin/ed/test/g3.err
Normal file
1
bin/ed/test/g3.err
Normal file
@@ -0,0 +1 @@
|
||||
g
|
||||
5
bin/ed/test/g3.r
Normal file
5
bin/ed/test/g3.r
Normal file
@@ -0,0 +1,5 @@
|
||||
linc 3
|
||||
xine 1
|
||||
xine 2
|
||||
xinc 4
|
||||
xinc5
|
||||
4
bin/ed/test/g3.t
Normal file
4
bin/ed/test/g3.t
Normal file
@@ -0,0 +1,4 @@
|
||||
g/./s//x/\
|
||||
3m0
|
||||
g/./s/e/c/\
|
||||
2,3m1
|
||||
7
bin/ed/test/g4.r
Normal file
7
bin/ed/test/g4.r
Normal file
@@ -0,0 +1,7 @@
|
||||
hello
|
||||
zine 1
|
||||
line 2
|
||||
line 3
|
||||
line 4
|
||||
line5
|
||||
world
|
||||
13
bin/ed/test/g4.t
Normal file
13
bin/ed/test/g4.t
Normal file
@@ -0,0 +1,13 @@
|
||||
g/./s/./x/\
|
||||
u\
|
||||
s/./y/\
|
||||
u\
|
||||
s/./z/\
|
||||
u
|
||||
u
|
||||
0a
|
||||
hello
|
||||
.
|
||||
$a
|
||||
world
|
||||
.
|
||||
9
bin/ed/test/g5.r
Normal file
9
bin/ed/test/g5.r
Normal file
@@ -0,0 +1,9 @@
|
||||
line 1
|
||||
line 2
|
||||
line 3
|
||||
line 2
|
||||
line 3
|
||||
line 1
|
||||
line 3
|
||||
line 1
|
||||
line 2
|
||||
2
bin/ed/test/g5.t
Normal file
2
bin/ed/test/g5.t
Normal file
@@ -0,0 +1,2 @@
|
||||
g/./1,3t$\
|
||||
1d
|
||||
1
bin/ed/test/h.err
Normal file
1
bin/ed/test/h.err
Normal file
@@ -0,0 +1 @@
|
||||
.h
|
||||
8
bin/ed/test/i.r
Normal file
8
bin/ed/test/i.r
Normal file
@@ -0,0 +1,8 @@
|
||||
hello world
|
||||
hello world!
|
||||
line 1
|
||||
line 2
|
||||
line 3
|
||||
line 4
|
||||
hello world!!
|
||||
line5
|
||||
9
bin/ed/test/i.t
Normal file
9
bin/ed/test/i.t
Normal file
@@ -0,0 +1,9 @@
|
||||
1i
|
||||
hello world
|
||||
.
|
||||
2i
|
||||
hello world!
|
||||
.
|
||||
$i
|
||||
hello world!!
|
||||
.
|
||||
3
bin/ed/test/i1.err
Normal file
3
bin/ed/test/i1.err
Normal file
@@ -0,0 +1,3 @@
|
||||
1,$i
|
||||
hello world
|
||||
.
|
||||
3
bin/ed/test/i2.err
Normal file
3
bin/ed/test/i2.err
Normal file
@@ -0,0 +1,3 @@
|
||||
ii
|
||||
hello world
|
||||
.
|
||||
3
bin/ed/test/i3.err
Normal file
3
bin/ed/test/i3.err
Normal file
@@ -0,0 +1,3 @@
|
||||
0i
|
||||
hello world
|
||||
.
|
||||
4
bin/ed/test/j.r
Normal file
4
bin/ed/test/j.r
Normal file
@@ -0,0 +1,4 @@
|
||||
line 1
|
||||
line 2line 3
|
||||
line 4
|
||||
line5
|
||||
2
bin/ed/test/j.t
Normal file
2
bin/ed/test/j.t
Normal file
@@ -0,0 +1,2 @@
|
||||
1,1j
|
||||
2,3j
|
||||
5
bin/ed/test/k.r
Normal file
5
bin/ed/test/k.r
Normal file
@@ -0,0 +1,5 @@
|
||||
line 3
|
||||
hello world
|
||||
line 4
|
||||
line5
|
||||
line 2
|
||||
10
bin/ed/test/k.t
Normal file
10
bin/ed/test/k.t
Normal file
@@ -0,0 +1,10 @@
|
||||
2ka
|
||||
1d
|
||||
'am$
|
||||
1ka
|
||||
0a
|
||||
hello world
|
||||
.
|
||||
'ad
|
||||
u
|
||||
'am0
|
||||
1
bin/ed/test/k1.err
Normal file
1
bin/ed/test/k1.err
Normal file
@@ -0,0 +1 @@
|
||||
1,$ka
|
||||
1
bin/ed/test/k2.err
Normal file
1
bin/ed/test/k2.err
Normal file
@@ -0,0 +1 @@
|
||||
kA
|
||||
1
bin/ed/test/k3.err
Normal file
1
bin/ed/test/k3.err
Normal file
@@ -0,0 +1 @@
|
||||
0ka
|
||||
6
bin/ed/test/k4.err
Normal file
6
bin/ed/test/k4.err
Normal file
@@ -0,0 +1,6 @@
|
||||
a
|
||||
hello
|
||||
.
|
||||
.ka
|
||||
'ad
|
||||
'ap
|
||||
4
bin/ed/test/m.err
Normal file
4
bin/ed/test/m.err
Normal file
@@ -0,0 +1,4 @@
|
||||
a
|
||||
hello world
|
||||
.
|
||||
1,$m1
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user