mirror of
https://github.com/GnoConsortium/gno.git
synced 2024-06-02 12:41:27 +00:00
Compare commits
783 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
2b1afe29bf | ||
|
44d6501ffd | ||
|
44ab20dfb9 | ||
|
8e8cb4800f | ||
|
4d5d42f859 | ||
|
7666e5ed8b | ||
|
faef86c362 | ||
|
b5dc0fa710 | ||
|
0e5947fff1 | ||
|
7be95f5f1b | ||
|
54a632e410 | ||
|
be00396c26 | ||
|
a5d25d1c6e | ||
|
38ea34b864 | ||
|
ab2be98bb1 | ||
|
f325d45831 | ||
|
80b1baffa8 | ||
|
d6e93b6a9c | ||
|
67c6566841 | ||
|
a353321531 | ||
|
0df1477cf9 | ||
|
e55fb1c59f | ||
|
2ea55d1d9b | ||
|
ffe0029aa6 | ||
|
cafd46ab01 | ||
|
c0e86cdeba | ||
|
61afe2ce33 | ||
|
616bf9ab72 | ||
|
32bc13f2d1 | ||
|
66bcd2e6cb | ||
|
7edb4eac39 | ||
|
769328325f | ||
|
74f2b97322 | ||
|
9aa13dba8f | ||
|
829bd4787a | ||
|
881bc1fec3 | ||
|
bd69a0e25b | ||
|
accedc8b02 | ||
|
8cdc379e42 | ||
|
111932c451 | ||
|
3e7ce1a5aa | ||
|
670d10a58d | ||
|
f8d08a8168 | ||
|
bd2d8af56a | ||
|
efe58b60ff | ||
|
26a4bcf0c5 | ||
|
aebfb72b92 | ||
|
8bfb9c1e14 | ||
|
0e2145d3a6 | ||
|
e0806f3cbb | ||
|
46661a883e | ||
|
e81f8d35e3 | ||
|
cbbc695df3 | ||
|
2b9eca4ba0 | ||
|
1039b17280 | ||
|
07e0f96d2a | ||
|
c1c6594ed0 | ||
|
9c06493506 | ||
|
0ce301a14a | ||
|
f50f8a7dde | ||
|
a51e90fa81 | ||
|
b6e3bbc037 | ||
|
2fd48bf635 | ||
|
5eed4a4a87 | ||
|
3f5e869b65 | ||
|
4d7cc8e5b6 | ||
|
61fdf9319e | ||
|
85dd2b5e50 | ||
|
bdeb2998e1 | ||
|
b88cc47e7f | ||
|
4a6af88951 | ||
|
d21ca86166 | ||
|
5951e66bf1 | ||
|
97a871e3dc | ||
|
75d157ff30 | ||
|
57d250378b | ||
|
8d36865dc2 | ||
|
330e74b7e9 | ||
|
5ffbafc1b5 | ||
|
68d2224e5b | ||
|
d9d4770f9f | ||
|
ba2ef9169c | ||
|
62c04cd62d | ||
|
355ed669c5 | ||
|
05d82736bc | ||
|
e776384122 | ||
|
765f0298d7 | ||
|
135cfc6169 | ||
|
b29f3e7037 | ||
|
32a9a4f966 | ||
|
860eae42c8 | ||
|
7764fc40c2 | ||
|
5de7c76601 | ||
|
3d3af63fa7 | ||
|
38886e1037 | ||
|
f422765df7 | ||
|
8533bbfd16 | ||
|
f2f24b8623 | ||
|
5c5d7e8ed2 | ||
|
5768f6ef99 | ||
|
433ce0b614 | ||
|
7cfb0be8e5 | ||
|
2f523024cd | ||
|
8979bdf2d8 | ||
|
5573e0e240 | ||
|
15ad1533e2 | ||
|
11aa6241ea | ||
|
4007bf88c5 | ||
|
1fc31412c8 | ||
|
d3b64a9887 | ||
|
1f8c740278 | ||
|
36c45596c9 | ||
|
00cd830bd0 | ||
|
fc1083b2b0 | ||
|
8cea45f4f0 | ||
|
d49f72c8b0 | ||
|
d1c781eaf4 | ||
|
1fb579993f | ||
|
25acdd5de9 | ||
|
96970e3e76 | ||
|
a10d56e871 | ||
|
41372644be | ||
|
e586eeefeb | ||
|
d4ee658beb | ||
|
ad04b0113e | ||
|
85d56e8a3c | ||
|
48ce3af1e2 | ||
|
c77b46a12d | ||
|
2b00b1d41a | ||
|
66eeae13e0 | ||
|
d964ac088f | ||
|
63c3c2629c | ||
|
df675b5803 | ||
|
28c606e490 | ||
|
39f181121d | ||
|
d073b63fc1 | ||
|
9818323355 | ||
|
508f00afb5 | ||
|
bd0308e3b2 | ||
|
3443e714c6 | ||
|
a2225ddb83 | ||
|
25b2576666 | ||
|
a803274121 | ||
|
49196eea67 | ||
|
273780523c | ||
|
edee25c942 | ||
|
f880e0c973 | ||
|
6b44130571 | ||
|
8621395051 | ||
|
6d572535da | ||
|
6269a8ca25 | ||
|
bc56eb46eb | ||
|
f790e8d53c | ||
|
412340be8b | ||
|
2604b42f9a | ||
|
7de2321a08 | ||
|
e7f2691599 | ||
|
7ec020a057 | ||
|
fd0aff2031 | ||
|
d5ac497f92 | ||
|
9fac710f39 | ||
|
4879056d84 | ||
|
2a358f71bc | ||
|
b629f70366 | ||
|
1d0c7e0be2 | ||
|
bf00017f17 | ||
|
0fa42147e3 | ||
|
c2d4a9371b | ||
|
a9c8ba111c | ||
|
b84b251619 | ||
|
6eebdb8e3a | ||
|
fd73dca790 | ||
|
963a33c4bf | ||
|
0c8ae50cfc | ||
|
7199e83868 | ||
|
96955b85a3 | ||
|
3061aa26a4 | ||
|
c4af1317ee | ||
|
1dc5497309 | ||
|
2e0ebb5392 | ||
|
d534981038 | ||
|
615d7ab922 | ||
|
ed7f658d4e | ||
|
4957db0caf | ||
|
3689484d24 | ||
|
b40c451852 | ||
|
5a9733461b | ||
|
546377ce0d | ||
|
01902c1b91 | ||
|
f5e621f814 | ||
|
afc1676d9f | ||
|
b7010abc60 | ||
|
4e1bec2062 | ||
|
c6c45722d8 | ||
|
442d75ce87 | ||
|
23e61fe09c | ||
|
40d932969c | ||
|
560e9a67ad | ||
|
4bd91df5de | ||
|
a43a7e27fd | ||
|
999f6066fb | ||
|
94012d9889 | ||
|
cd8bfae836 | ||
|
6cdf1b9893 | ||
|
c39b230a61 | ||
|
102c443527 | ||
|
92eced2bba | ||
|
69723f10b6 | ||
|
49801ffa31 | ||
|
750cc1d6da | ||
|
769c8a8027 | ||
|
d4f470ef7d | ||
|
5e602d499d | ||
|
068fd5bb72 | ||
|
1f9c2a058b | ||
|
e014797a8e | ||
|
519805dbb4 | ||
|
2a2c7d8648 | ||
|
91c2c09f56 | ||
|
9170dd1a63 | ||
|
7c77098c01 | ||
|
f00cfed6ba | ||
|
d36d59e158 | ||
|
3b6e40c95f | ||
|
0a5e437e26 | ||
|
f6ad5e32aa | ||
|
d2efd0151f | ||
|
cf2e1b8db9 | ||
|
39b959d34c | ||
|
f0419b78c8 | ||
|
731eb90c1e | ||
|
61474a874f | ||
|
eacedc7aca | ||
|
5533c5ed3c | ||
|
f07edb38f2 | ||
|
5af9e3b875 | ||
|
32ccee5a06 | ||
|
2f6263d18a | ||
|
eb014e0fc2 | ||
|
038d5d04cf | ||
|
0ed60a2fe1 | ||
|
97bbd0ba97 | ||
|
f796d6adab | ||
|
ddac971a82 | ||
|
82f60994d2 | ||
|
2c52584063 | ||
|
d8638d7f83 | ||
|
16efada45b | ||
|
49214ecab2 | ||
|
768c413e7c | ||
|
df1aab9de6 | ||
|
e2c6df7488 | ||
|
e8bcb53ed7 | ||
|
e2adcb9b2b | ||
|
f589b65333 | ||
|
2495ce287f | ||
|
af6a5191a8 | ||
|
6a7127aa10 | ||
|
04e5cb4232 | ||
|
d6d81225de | ||
|
e8879227c8 | ||
|
50a2dce1b5 | ||
|
ff4949a278 | ||
|
6f8d3ed148 | ||
|
efd645f1ca | ||
|
b9be5b37c2 | ||
|
b8915c9cd4 | ||
|
f91ed7c806 | ||
|
49c374ec7c | ||
|
2553a92197 | ||
|
e72e1c891f | ||
|
ade81f0a94 | ||
|
e51b60e6cf | ||
|
861f178146 | ||
|
2a99711c42 | ||
|
027b934919 | ||
|
98f457ebec | ||
|
45dd3d2857 | ||
|
8f71ef8237 | ||
|
08a66d465e | ||
|
7d184b3391 | ||
|
ddb82cb2e0 | ||
|
0b6d503134 | ||
|
d522fa44b8 | ||
|
109c7880bf | ||
|
f6f777413b | ||
|
b1128f4c89 | ||
|
ef3c68dfac | ||
|
48574decdd | ||
|
db224b5b07 | ||
|
aa8b92ae3a | ||
|
9b6b8bb59a | ||
|
1157a5530f | ||
|
92ee492794 | ||
|
04ed2e0e19 | ||
|
70c2382176 | ||
|
2105f032fc | ||
|
62215a070f | ||
|
23b1d7acd2 | ||
|
774f9b72ff | ||
|
798d7a250c | ||
|
8c9a14c01e | ||
|
e9cd1d1fb9 | ||
|
95aaac5172 | ||
|
923ca66cd6 | ||
|
e2b5e2e1ef | ||
|
a26d64bf05 | ||
|
9a65f3585a | ||
|
cadd7ef99a | ||
|
227a5d4165 | ||
|
13962cbe8c | ||
|
c910d74666 | ||
|
6d45309184 | ||
|
ece4e91a5e | ||
|
e846cb8f9a | ||
|
63160f6291 | ||
|
fdf0d8d918 | ||
|
35a4a5a916 | ||
|
7f83841bab | ||
|
7a381ec9a6 | ||
|
a67838992c | ||
|
451e159fb7 | ||
|
31e9970070 | ||
|
784e3de7cd | ||
|
d00f2dadaa | ||
|
ace3b43bec | ||
|
03cff8f7cc | ||
|
8b1eeb2e86 | ||
|
a3eaea8456 | ||
|
4ddaf23478 | ||
|
4dffe7ddc2 | ||
|
06a5a0d916 | ||
|
e44027ef07 | ||
|
531859db70 | ||
|
e42c4e0794 | ||
|
7c0cc1c3d4 | ||
|
4028b2d317 | ||
|
9103cfa195 | ||
|
9cdea96615 | ||
|
343bb80e9e | ||
|
7c5d013345 | ||
|
0628df79bb | ||
|
cffe806766 | ||
|
7242272eb4 | ||
|
8e00576fbd | ||
|
7027be9e4b | ||
|
6822a8d18f | ||
|
9416f9d55c | ||
|
9359f799f6 | ||
|
59c00c1820 | ||
|
31f7aea798 | ||
|
a231c66c6b | ||
|
10a6b1846a | ||
|
70d9199214 | ||
|
8ecdfc40b1 | ||
|
55dc07fbcf | ||
|
b36acdb112 | ||
|
3d887aa334 | ||
|
79cc150685 | ||
|
7e3c77c4a2 | ||
|
3c8936e8bc | ||
|
bb39be07cc | ||
|
3ad387440c | ||
|
27924b88c4 | ||
|
8543be29f7 | ||
|
e58b811b55 | ||
|
872341978d | ||
|
5cf814279c | ||
|
29f6c45c73 | ||
|
caf78f9f1c | ||
|
22fa70695a | ||
|
d124889572 | ||
|
b3a92e5811 | ||
|
0fd1522dd5 | ||
|
150b2eb2e2 | ||
|
7eb6be5172 | ||
|
6bafc3a9b4 | ||
|
2188b17ab9 | ||
|
bc7e61f040 | ||
|
d08a55f17e | ||
|
3424f81f7c | ||
|
307e87bf3e | ||
|
2c9b8b7381 | ||
|
d9b5117780 | ||
|
99bb125e6e | ||
|
829e7d0929 | ||
|
6bd94b0884 | ||
|
e0a16a3570 | ||
|
ed01d173df | ||
|
804e124f69 | ||
|
50bbda4498 | ||
|
6f61169e81 | ||
|
16f471c5eb | ||
|
888214a8bd | ||
|
de6388b9b9 | ||
|
c0e682c624 | ||
|
ba28616f66 | ||
|
82771a5ee8 | ||
|
6bfb3527a9 | ||
|
c8e574bab7 | ||
|
f3bea84880 | ||
|
17aad04201 | ||
|
8a732d9bc6 | ||
|
a4b9acdd70 | ||
|
5e645be936 | ||
|
716edaa21b | ||
|
e712a9ff58 | ||
|
4b239cd6da | ||
|
c3959c4d16 | ||
|
6bae989841 | ||
|
bd5fc8b991 | ||
|
1259e1599f | ||
|
c4ecb61d8b | ||
|
3036f145f1 | ||
|
1d35e22c64 | ||
|
509f84b6f9 | ||
|
b6b44f7d83 | ||
|
4f4a589bf7 | ||
|
988e0fb1dc | ||
|
a7b5aa5c8a | ||
|
4079986d8b | ||
|
e51733b21a | ||
|
7a0a150111 | ||
|
272fd7918a | ||
|
f53219715c | ||
|
320f77f2b4 | ||
|
61adaadfbe | ||
|
2d3f7dce1a | ||
|
676fccce0c | ||
|
ebe6b4168b | ||
|
12ab1893b4 | ||
|
b1fefe20fb | ||
|
2159dfd5c6 | ||
|
8ac226b323 | ||
|
42bf1ff204 | ||
|
91db35f9e3 | ||
|
28a204b58d | ||
|
f8ce91e7b0 | ||
|
ec41fa4eca | ||
|
e8799c7146 | ||
|
d4266d7ec0 | ||
|
0e9776a3d3 | ||
|
8d67873c2b | ||
|
aaf4e446cd | ||
|
a6a93e984a | ||
|
3883c24d20 | ||
|
950a9aa0f8 | ||
|
951ec8e48d | ||
|
d352e8757c | ||
|
767546b525 | ||
|
c7b1d54b03 | ||
|
715fc5ab81 | ||
|
bb09eed7f6 | ||
|
3e68d4bd15 | ||
|
75831c8124 | ||
|
418ae96ccb | ||
|
0cea80dacc | ||
|
44382837b2 | ||
|
94f675832e | ||
|
1c46c03e78 | ||
|
f5e4958c4e | ||
|
6ca306ec57 | ||
|
a029903025 | ||
|
871932548b | ||
|
9f794ac7d0 | ||
|
9e8a7cb703 | ||
|
75febf71c3 | ||
|
51b2bbcf92 | ||
|
be853ae490 | ||
|
c3f0249dc8 | ||
|
9c1ef2e905 | ||
|
8ec58c91e3 | ||
|
12a86e690f | ||
|
737a2b2acb | ||
|
4cdec01660 | ||
|
1e28540ab0 | ||
|
07177f48d1 | ||
|
b998993162 | ||
|
5aa367e6ff | ||
|
97ab3c7a62 | ||
|
6b8ea553ee | ||
|
4aafacd78b | ||
|
007531d795 | ||
|
3a0978f855 | ||
|
2a490753dc | ||
|
a0525b81fd | ||
|
b294c85eb2 | ||
|
5132e3d0b4 | ||
|
5b6c4960d5 | ||
|
7861f65bbb | ||
|
0e5599af83 | ||
|
c1f439e0a7 | ||
|
7276456260 | ||
|
d34f9db837 | ||
|
be57edaf08 | ||
|
6065babc81 | ||
|
b72fd53882 | ||
|
79ab0e7f2b | ||
|
619c3191d1 | ||
|
9553efb5cf | ||
|
3773fe3366 | ||
|
10327349c4 | ||
|
e7bb29a749 | ||
|
492cb296f2 | ||
|
ed43cf427a | ||
|
7da4e89117 | ||
|
fae3756359 | ||
|
2823a7ab61 | ||
|
b37ae6415c | ||
|
17de7accde | ||
|
ce32f61b41 | ||
|
56e2923d4c | ||
|
30c2697ed0 | ||
|
753315d345 | ||
|
c2951e680e | ||
|
71090e862f | ||
|
1f1b3ada37 | ||
|
99e3b1cd28 | ||
|
dabc2c9205 | ||
|
8590ffb646 | ||
|
a3f1e8a401 | ||
|
ebebdd3a04 | ||
|
11f6208435 | ||
|
8e355814f7 | ||
|
657ead2d08 | ||
|
9a6d867e7f | ||
|
072c984053 | ||
|
37a13feeb9 | ||
|
2ef4d75aa5 | ||
|
f61bb88c0d | ||
|
0e441fea76 | ||
|
13a3dc63c3 | ||
|
68e30dd46a | ||
|
88223ca717 | ||
|
2b38da3926 | ||
|
fd08c34074 | ||
|
9f917c3089 | ||
|
63235a6c30 | ||
|
81acf39ec5 | ||
|
ef1b203392 | ||
|
4c3a20638e | ||
|
293fc61f14 | ||
|
c6e102e916 | ||
|
14a1927519 | ||
|
998b53c1c9 | ||
|
0a72bc2794 | ||
|
e7015008c4 | ||
|
fbcef9625a | ||
|
e04dacb065 | ||
|
b9c3d5d27d | ||
|
24b9cda931 | ||
|
b5b9abc713 | ||
|
51ae0e883d | ||
|
10f5957592 | ||
|
70949ed9a3 | ||
|
fd453f99d5 | ||
|
86fc467fac | ||
|
280300e2f8 | ||
|
b7b8ffe87b | ||
|
a5c3c955aa | ||
|
4f8059fffa | ||
|
d54f8f999d | ||
|
e4e2dd505c | ||
|
6ec822da35 | ||
|
3f66072e30 | ||
|
75e4ffde40 | ||
|
2d9725fc31 | ||
|
45975acfd7 | ||
|
c4fc6763d1 | ||
|
90573468cb | ||
|
5578ed663d | ||
|
c22bcee941 | ||
|
dd0de285c3 | ||
|
e713312837 | ||
|
8056066083 | ||
|
1c00c49e7b | ||
|
68bf96eb2a | ||
|
cbf28ecef3 | ||
|
a669d1f0ac | ||
|
6848d48a2e | ||
|
f163b4f2a5 | ||
|
ce58eb7e53 | ||
|
3da53eec64 | ||
|
53b34aa122 | ||
|
b711225944 | ||
|
942e883d2f | ||
|
1f728a69a6 | ||
|
1ebcbc2ede | ||
|
6fbd0e2248 | ||
|
91ac68c447 | ||
|
e47488e5d3 | ||
|
dbeebca188 | ||
|
5166f52a4b | ||
|
ad2b55ba3a | ||
|
74ecabee33 | ||
|
1ce49dd801 | ||
|
0c2b571d25 | ||
|
c6ff8aa083 | ||
|
9fed90450c | ||
|
fe19a1dddc | ||
|
c6b6448216 | ||
|
d5a9505472 | ||
|
995c2aba83 | ||
|
c7a0146f19 | ||
|
22929ce3a8 | ||
|
822244497a | ||
|
a7573f4d82 | ||
|
425cdbf614 | ||
|
595a3dfaea | ||
|
2ad717bf06 | ||
|
b48ee15e6c | ||
|
c457aa46ae | ||
|
713b0b5892 | ||
|
d1faeee771 | ||
|
e62ed561aa | ||
|
b28de25362 | ||
|
a0f5373eac | ||
|
2c2de538ee | ||
|
bf5292af8e | ||
|
9d2240afa3 | ||
|
55003d4505 | ||
|
d52e9de6e8 | ||
|
efd2ee3d99 | ||
|
b68786be45 | ||
|
b0623660ef | ||
|
7b312c57e5 | ||
|
9dd49d2e54 | ||
|
9354bb33ac | ||
|
2a0f0ad491 | ||
|
b0e785a02a | ||
|
0da71455c3 | ||
|
6fcd3ab994 | ||
|
014dce9114 | ||
|
d81c685a83 | ||
|
cd3d0ca342 | ||
|
7b916c3c8d | ||
|
5fc597eb5e | ||
|
3cec7d7d1f | ||
|
1b7f428ceb | ||
|
6fd352e14a | ||
|
2274ba187d | ||
|
1799a93f23 | ||
|
21d1bfc485 | ||
|
fbbabf2a0c | ||
|
f75f7a7b79 | ||
|
6300bcee3a | ||
|
c9344f452b | ||
|
8774b23e30 | ||
|
f8cc5f9ba2 | ||
|
b00e9eb797 | ||
|
4da093616e | ||
|
a5ad3a71b7 | ||
|
63754dce1c | ||
|
3b166416a3 | ||
|
0deb52e606 | ||
|
aa9e477a31 | ||
|
a521e64042 | ||
|
c45d52b90d | ||
|
c0f36cb502 | ||
|
b703ce4bd7 | ||
|
8d7491e9ef | ||
|
4c8dcc2b1c | ||
|
42d8290c4a | ||
|
d686ae9f02 | ||
|
6f96d148e5 | ||
|
a60a9fc3a2 | ||
|
645cb5834d | ||
|
8a461e09b4 | ||
|
a739102c3a | ||
|
5ea6ce9244 | ||
|
712ad8b00d | ||
|
5fd930582d | ||
|
f6efe9ae26 | ||
|
cd0695c010 | ||
|
09da0614d3 | ||
|
d671eaa752 | ||
|
7a88871b21 | ||
|
124ca8d9b7 | ||
|
5d0fd14e43 | ||
|
39aff4d07f | ||
|
a54e2a8e91 | ||
|
db4bce6e93 | ||
|
314f3fcee0 | ||
|
91a111f2c1 | ||
|
c3d9c3b245 | ||
|
7050dc895b | ||
|
6471a77b16 | ||
|
fc58ca13eb | ||
|
92d0985f19 | ||
|
de72cff25b | ||
|
228ac9913d | ||
|
997c35962d | ||
|
ffae6366ab | ||
|
e9b7d50bfc | ||
|
a5c0ecf161 | ||
|
82170164bc | ||
|
6e22587191 | ||
|
c52fcd3475 | ||
|
a071932b06 | ||
|
a402a7f7fa | ||
|
f6a8741209 | ||
|
8f24a49223 | ||
|
b94726dc62 | ||
|
1554cedb32 | ||
|
740fda6275 | ||
|
4539811926 | ||
|
e64c17d8cb | ||
|
45e13e9ddb | ||
|
02b72767b3 | ||
|
a689e9398c | ||
|
c1a44d4166 | ||
|
39e6f0d5ee | ||
|
fef1481080 | ||
|
64cc71f1af | ||
|
590e077340 | ||
|
fb3ab1728f | ||
|
0acddc1899 | ||
|
c1fa42d03c | ||
|
0cd26df27a | ||
|
2ff5e0d02e | ||
|
e97849195e | ||
|
82cd20e3c4 | ||
|
3f4a6ce10a | ||
|
9b28500b58 | ||
|
eb65e1bf12 | ||
|
4fead8bdd0 | ||
|
b1b7a26b51 | ||
|
7fad7d2bd6 | ||
|
2dafe3f23e | ||
|
24747d92a2 | ||
|
93e9864555 | ||
|
05cc2bfd4c | ||
|
123ac5dd20 | ||
|
5c7af603fd | ||
|
ca13d459c1 | ||
|
4fe75a5912 | ||
|
8a35779079 | ||
|
1fd1b2b9dd | ||
|
9002791e1c | ||
|
42ccbe7f76 | ||
|
f4e07c47c7 | ||
|
3b74d54927 | ||
|
1f006da069 | ||
|
6a8369544e | ||
|
353efc72a2 | ||
|
5c4edbc8bf | ||
|
b0cfaf1892 | ||
|
397a3206ab | ||
|
c91fd8439c | ||
|
86337db335 | ||
|
316b9588e8 | ||
|
54c0bfff3a | ||
|
3ebed65a1d | ||
|
7e092ea691 | ||
|
59a20690fa | ||
|
e7714c1ecb | ||
|
b08bb195e2 | ||
|
4bbf412f5a | ||
|
f0707a835e | ||
|
143032a94c | ||
|
8c5cc88bbb | ||
|
62becc2887 | ||
|
d85acdda0e | ||
|
44802413cf | ||
|
945f94e0e0 | ||
|
51bdc8eddb | ||
|
bc4d7f5de5 | ||
|
6b10135a2c | ||
|
8f991e5d98 | ||
|
9b450f3e72 | ||
|
c2791150e8 | ||
|
e0139fb829 | ||
|
10ea6a13be | ||
|
bc0a3deceb | ||
|
649a34d2fd | ||
|
a4ebb50d01 | ||
|
b6857812c9 | ||
|
da9cc85bc1 | ||
|
c6828d9ec1 | ||
|
796a6ac638 | ||
|
de9483865e | ||
|
d9405536ea | ||
|
5b657fd55a |
112
Makefile
Normal file
112
Makefile
Normal file
|
@ -0,0 +1,112 @@
|
|||
#
|
||||
# This file is intended for use with dmake. There are constructs in
|
||||
# here that (as yet) make it unsuitable to be used on the GS.
|
||||
#
|
||||
# $Id: Makefile,v 1.6 2012/08/26 02:54:57 gdr Exp $
|
||||
#
|
||||
|
||||
.INCLUDE: /src/gno/paths.mk
|
||||
|
||||
INSTALL *= /usr/bin/install
|
||||
CHTYP *= /bin/chtyp
|
||||
|
||||
headerInstall .USESHELL:
|
||||
$(CHTYP) -lasm $(SRC_DIR)/gno/ainclude/m*
|
||||
$(CHTYP) -lrez $(SRC_DIR)/gno/rinclude/*.rez
|
||||
$(CHTYP) -lcc $(SRC_DIR)/gno/include/*.h
|
||||
$(CHTYP) -lcc $(SRC_DIR)/gno/include/arpa/*.h
|
||||
$(CHTYP) -lcc $(SRC_DIR)/gno/include/gno/*.h
|
||||
$(CHTYP) -lcc $(SRC_DIR)/gno/include/machine/*.h
|
||||
$(CHTYP) -lcc $(SRC_DIR)/gno/include/net/*.h
|
||||
$(CHTYP) -lcc $(SRC_DIR)/gno/include/netinet/*.h
|
||||
$(CHTYP) -lcc $(SRC_DIR)/gno/include/protocols/*.h
|
||||
$(CHTYP) -lcc $(SRC_DIR)/gno/include/rpc/*.h
|
||||
$(CHTYP) -lcc $(SRC_DIR)/gno/include/sys/*.h
|
||||
$(CHTYP) -lcc $(SRC_DIR)/gno/orcacdefs/*.h
|
||||
$(INSTALL) $(SRC_DIR)/gno/ainclude/m* /usr/ainclude
|
||||
$(INSTALL) $(SRC_DIR)/gno/rinclude/*.rez /usr/rinclude
|
||||
$(INSTALL) $(SRC_DIR)/gno/include/*.h /usr/include
|
||||
$(INSTALL) $(SRC_DIR)/gno/include/arpa/*.h /usr/include/arpa
|
||||
$(INSTALL) $(SRC_DIR)/gno/include/gno/*.h /usr/include/gno
|
||||
$(INSTALL) $(SRC_DIR)/gno/include/machine/*.h /usr/include/machine
|
||||
$(INSTALL) $(SRC_DIR)/gno/include/net/*.h /usr/include/net
|
||||
$(INSTALL) $(SRC_DIR)/gno/include/netinet/*.h /usr/include/netinet
|
||||
$(INSTALL) $(SRC_DIR)/gno/include/protocols/*.h /usr/include/protocols
|
||||
$(INSTALL) $(SRC_DIR)/gno/include/rpc/*.h /usr/include/rpc
|
||||
$(INSTALL) $(SRC_DIR)/gno/include/sys/*.h /usr/include/sys
|
||||
$(INSTALL) $(SRC_DIR)/gno/orcacdefs/*.h /lib/orcacdefs
|
||||
|
||||
#
|
||||
# The remaining macros, targets, and recipies were used before trenco
|
||||
# was fully serving the GNO stuff.
|
||||
#
|
||||
XFER = xfer
|
||||
TMP = /tmp/gnobuild
|
||||
UDL = /usr/local/bin/udl
|
||||
NULIB = /usr/local/bin/nulib
|
||||
|
||||
XFER_LIST= \
|
||||
$(XFER)/HFSinclude.shk \
|
||||
$(XFER)/NOTES.shk \
|
||||
$(XFER)/bin.shk \
|
||||
$(XFER)/build.tools.shk \
|
||||
$(XFER)/include.shk \
|
||||
$(XFER)/lib.shk \
|
||||
$(XFER)/orcacdefs.shk \
|
||||
$(XFER)/root.shk \
|
||||
$(XFER)/sbin.shk \
|
||||
$(XFER)/usr.bin.shk \
|
||||
$(XFER)/usr.orcabin.shk \
|
||||
$(XFER)/usr.man.shk \
|
||||
$(XFER)/usr.sbin.shk \
|
||||
$(XFER)/verbatim.shk
|
||||
|
||||
NOT_YET= \
|
||||
$(XFER)/libexec.shk \
|
||||
$(XFER)/sys.shk \
|
||||
$(XFER)/usr.sbin.shk
|
||||
|
||||
srcxfer: $(XFER_LIST)
|
||||
|
||||
ROOTFILES = Makefile binconst.mk binrelease.mk binrules.mk paths.mk prog.mk
|
||||
|
||||
$(XFER)/root.shk: $(ROOTFILES)
|
||||
@echo "making $@"; \
|
||||
$(RM) -f $@; \
|
||||
[ -d $(XFER) ] || mkdir -p $(XFER); \
|
||||
if [ -d $(TMP) ]; then \
|
||||
echo "$(TMP) exists. Aborted"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
cwd=`pwd`; \
|
||||
mkdir -p $(TMP); \
|
||||
cp -r -p $(ROOTFILES) $(TMP); \
|
||||
$(RM) -rf `find $(TMP) -name CVS -print `; \
|
||||
$(UDL) -gR $(TMP); \
|
||||
(cd $(TMP); $(NULIB) -cf $$cwd/$@ $(ROOTFILES) ); \
|
||||
$(RM) -rf $(TMP)
|
||||
|
||||
# make sure the filename fits
|
||||
$(XFER)/usr.orcabin.shk: $(XFER)/usr.orca.bin.shk
|
||||
mv $< $@
|
||||
|
||||
# .PHONY: $(XFER_LIST)
|
||||
|
||||
$(XFER)/%.shk:
|
||||
@echo "making $@"; \
|
||||
$(RM) -f $@; \
|
||||
[ -d $(XFER) ] || mkdir -p $(XFER); \
|
||||
if [ -d $(TMP) ]; then \
|
||||
echo "$(TMP) exists. Aborted"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
mkdir -p $(TMP); \
|
||||
cp -r -p $* $(TMP); \
|
||||
$(RM) -rf `find $(TMP) -name CVS -print `; \
|
||||
$(UDL) -gR $(TMP); \
|
||||
(cd $(TMP); $(NULIB) -cf $*.shk $*); \
|
||||
mv $(TMP)/$*.shk $(XFER); \
|
||||
$(RM) -rf $(TMP)
|
||||
|
||||
|
||||
# /bin/true $*;
|
23
NOTES/INSTALL
Normal file
23
NOTES/INSTALL
Normal file
|
@ -0,0 +1,23 @@
|
|||
$Id: INSTALL,v 1.1 1997/08/08 05:11:14 gdr Exp $
|
||||
|
||||
Installing the Binaries-Only Version
|
||||
====================================
|
||||
|
||||
Make a copy of your disks.
|
||||
|
||||
Make a copy of the GNO distribution disks and keep the originals in
|
||||
a safe place. Never modify the original disks; only modify copies.
|
||||
|
||||
Define your destination directories.
|
||||
|
||||
Using any text editor, edit the file /gno.disk1/installbin. In
|
||||
that file you will find the shell variables VOL1, VOL2, VOL3
|
||||
and VOL4. You should change the values of these variables
|
||||
to volume or directory names that exist at your site.
|
||||
|
||||
While the distributed script used the same directory for
|
||||
all of VOL1 (/), VOL2 (/usr), and VOL3 (/home), I recommend
|
||||
placing them on different partitions if possible, especially
|
||||
the first two. This is because, as you add more things to
|
||||
GNO, the / and /usr partitions will (likely) eventually use
|
||||
up most of a 32Meg ProDOS partition.
|
21
NOTES/MANIFEST
Normal file
21
NOTES/MANIFEST
Normal file
|
@ -0,0 +1,21 @@
|
|||
INSTALL Explains how to install the binary distribution. (Obsolete.)
|
||||
MANIFEST This file.
|
||||
README.beta Out of date notes. (Obsolete.)
|
||||
README.src Out of date notes. (Obsolete.)
|
||||
archives Shows the breakdown of how the GNO binary distribution
|
||||
is currently shipped.
|
||||
devel Directory containing notes intended for developers working
|
||||
on the base distribution.
|
||||
deviations Lists the ways in which GNO is known to deviate from
|
||||
the POSIX specification and/or the BSD implementations
|
||||
on which components of GNO are based.
|
||||
headers These are some notes on how headers have changed from
|
||||
v2.0.4 to v2.0.6
|
||||
notes.960227 Notes to Derek. Should be moved/updated. (Obsolete.)
|
||||
status.bin This lists the status of the various programs in the base
|
||||
distribution.
|
||||
status.lib This lists the status of the routines in the libraries of
|
||||
the base distribution.
|
||||
status.usrman This lists the status of the files in the src/gno/usr.man
|
||||
directory hierarchy.
|
||||
update.usrman This is a script to help keep status.usrman current.
|
|
@ -1,7 +1,7 @@
|
|||
$Id: README.beta,v 1.1 1997/03/11 08:08:06 gdr Exp $
|
||||
$Id: README.beta,v 1.2 1999/07/03 14:46:37 gdr-ftp Exp $
|
||||
|
||||
This is the README file for release beta 970304. It probably needs more
|
||||
detail. Mail to gno-beta@myrias.com with questions, comments, bitches,
|
||||
detail. Mail to gno-beta@gno.org with questions, comments, bitches,
|
||||
queries, complaints.
|
||||
|
||||
I suggest you don't mix these files up with those from other versions of
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
$Id: README.src,v 1.1 1997/03/11 08:08:06 gdr Exp $
|
||||
$Id: README.src,v 1.2 1999/07/03 14:46:37 gdr-ftp Exp $
|
||||
|
||||
Have a look in the NOTES directory, especially the files "status"
|
||||
and "notes.*". There are notes in there on changed header files --
|
||||
|
@ -26,6 +26,6 @@ THEY WERE COMPILED, since struct FILE has changed. See the comments in
|
|||
the NOTES/README.beta and orcacdefs/defaults.h files.
|
||||
|
||||
Also as a reminder, the gno-beta mailing list has been set up. To
|
||||
join it, send email to <majordomo@myrias.com> with the following text
|
||||
join it, send email to <majordomo@gno.org> with the following text
|
||||
and nothing else in the body of the message:
|
||||
subscribe gno-beta
|
||||
|
|
90
NOTES/TO.DO
90
NOTES/TO.DO
|
@ -1,90 +0,0 @@
|
|||
*******
|
||||
* soon
|
||||
*
|
||||
* $Id: TO.DO,v 1.1 1997/02/28 05:42:26 gdr Exp $
|
||||
*
|
||||
*******
|
||||
|
||||
Use result of _setModeEmulation(3) in appropriate calls. These include
|
||||
chmod -
|
||||
creat - done
|
||||
open - done
|
||||
stat - unnecessary
|
||||
fstat - unnecessary
|
||||
lstat - unnecessary
|
||||
|
||||
check up on the type of nlink_t, used in stat(2)
|
||||
|
||||
Write a test that handles:
|
||||
- negative process numbers
|
||||
- process numbers exceeding INT_MAX and UINT_MAX
|
||||
the easiest way to do this is to repeatedly exec a program that prints
|
||||
it's process number. Keep doing so until either the number wraps or
|
||||
the machine crashes.
|
||||
|
||||
libc/sys/exec.c:
|
||||
buildCmd should single-quote strings containing whitespace.
|
||||
If the string already has single quotes, then backspace them.
|
||||
|
||||
buildPath should only return files of type S16, EXEC, or EXE.
|
||||
|
||||
buildPath should use the mapPath facility.
|
||||
|
||||
These functions should operate closer to GS/OS when possible.
|
||||
Also need to reduce stack requirements.
|
||||
|
||||
*******
|
||||
* remove from / replace in Orcalib
|
||||
*******
|
||||
|
||||
strerror orcalib/string.asm
|
||||
perror orcalib/stdio.a
|
||||
sys_errlist orcalib/stdio.a problem
|
||||
sys_nerr orcalib/vars.a problem
|
||||
|
||||
*******
|
||||
* defer
|
||||
*******
|
||||
|
||||
libc/stdio/perror.c:
|
||||
use BSDish implementation for perror(3) to avoid stdio.
|
||||
|
||||
libc/sys/syscall.c:
|
||||
for unlink, if file is open, then register a call to unlink
|
||||
(non-recursive) the file via atexit(3)
|
||||
|
||||
libc/sys/trap.asm:
|
||||
Insert conchecks in trap functions to check to see if GNO
|
||||
is active and at the right version level. If not, they
|
||||
should abort.
|
||||
|
||||
libc/gen/environ.c:
|
||||
Review routines. Force them to use GSString routines, reduce
|
||||
stack usage (depend on dynamic allocation for parm blocks).
|
||||
|
||||
libc/gen/err.c:
|
||||
Use syslogd if not on a tty.
|
||||
|
||||
libc/gen/tty.c:
|
||||
review these routines
|
||||
|
||||
do intro man pages:
|
||||
1 done
|
||||
2 review DEFINITIONS section
|
||||
3 done
|
||||
4 done
|
||||
5 done
|
||||
6 done
|
||||
7 done
|
||||
8 done
|
||||
|
||||
various man pages:
|
||||
add note under COMPATIBILITY as to whether the routines
|
||||
are thread-safe. If they write any globals or static
|
||||
variables, they are not.
|
||||
|
||||
Verify that the setdebug(2) macros in gno/gno.h are correct.
|
||||
|
||||
Add implementations for execle; the final
|
||||
envp can't appear in the prototype, but it can be found since it is
|
||||
the last argument after the first NULL pointer.
|
24
NOTES/archives
Normal file
24
NOTES/archives
Normal file
|
@ -0,0 +1,24 @@
|
|||
$Id: archives,v 1.1 1999/01/09 21:28:35 gdr-ftp Exp $
|
||||
|
||||
A GNO "release" is shipped (so to speak) as a set of NuFX (*.shk) archives.
|
||||
This is the breakdown of each NuFX archive:
|
||||
|
||||
gnoboot.shk /gno.boot (entire volume)
|
||||
gno.01.shk /kern
|
||||
/initrc
|
||||
/lib
|
||||
gno.02.shk /bin (utils a-f)
|
||||
gno.03.shk /bin (utils g-m)
|
||||
gno.04.shk /bin (utils n-s)
|
||||
gno.05.shk /bin (utils t-z)
|
||||
gno.06.shk /usr/bin (utils a-f)
|
||||
gno.07.shk /usr/bin (utils g-m)
|
||||
gno.08.shk /usr/bin (utils n-s)
|
||||
gno.09.shk /usr/bin (utils t-z)
|
||||
gno.10.shk /usr/include
|
||||
gno.11.shk /usr/man/man1
|
||||
gno.12.shk /usr/man/man2
|
||||
gno.13.shk /usr/man/man3
|
||||
gno.14.shk /usr/man/man[45678]
|
||||
gno.15.shk /usr (remaining files)
|
||||
gno.16.shk / (remaining files)
|
7
NOTES/devel/MANIFEST
Normal file
7
NOTES/devel/MANIFEST
Normal file
|
@ -0,0 +1,7 @@
|
|||
MANIFEST This file.
|
||||
TO.DO A list of things that still have to be done for GNO. These
|
||||
really belong in the bugs database at http://www.gno.org
|
||||
as either bugs or feature requests.
|
||||
adding.utils Discusses stuff necessary to add utils to the base
|
||||
distribution.
|
||||
doing.builds Explains how to create the base builds.
|
|
@ -1,12 +1,68 @@
|
|||
*******
|
||||
* soon
|
||||
*
|
||||
* $Id: TO.DO,v 1.1 1997/02/28 05:42:26 gdr Exp $
|
||||
* $Id: TO.DO,v 1.8 1998/10/31 19:14:49 gdr-ftp Exp $
|
||||
*
|
||||
*******
|
||||
|
||||
When building the binary release, include all the system stuff like
|
||||
GNOSnooper, et al.
|
||||
|
||||
We need a namespace(5) manual page. Here is a "bugs" entry for it:
|
||||
Apropos of building a bootable system, I've also encountered another
|
||||
bug. One cannot use a "partition" defined in /etc/namespace as the
|
||||
home directory for any user. For example, one cannot use "/root" as
|
||||
root's home directory unless it is a real volume. The symptoms of
|
||||
this are:
|
||||
1. You will get a error about "Device not found"
|
||||
2. The user's gshrc file will not have been sourced.
|
||||
|
||||
Make the source *.shk archive on trenco use proper file types.
|
||||
|
||||
The header files <curses.h>, <sys/termios.h>, and <sys/ioctl.compat.h>
|
||||
have conflicting definitions for FLUSHO.
|
||||
|
||||
newuser, newuserv:
|
||||
- update to use /home vice /user or maybe a conf file
|
||||
- check out behavior of 'adduser', see if there's anything
|
||||
missing
|
||||
|
||||
vfscanf.c:
|
||||
After a reasonable time, disable the assert calls.
|
||||
|
||||
Finish index in kernel reference manual.
|
||||
|
||||
in stack(3) man page, the user shouldn't have to allow for extra
|
||||
bytes for _assertStack(3). Determine what is necessary. If the
|
||||
number of bytes left is less than this value, then print out
|
||||
an abbreviated error message rather than calling errx.
|
||||
|
||||
Add implementations for Tilghman:
|
||||
strftime(3)
|
||||
|
||||
Create a src/gno/build.tools/mklink script for duplicating binary
|
||||
files at user install time. Current packages that need this:
|
||||
compress/zcat
|
||||
sum/cksum
|
||||
|
||||
As a group:
|
||||
Update utmp.5, libutil (logout, logwtmp), last(1), login(1), who(1),
|
||||
w(1), init(8), _PATH_UTMP (<utmp.h> and FAQ), rwho(1), users(1)
|
||||
|
||||
Add to relevent util man pages:
|
||||
.SH ATTRIBUTIONS
|
||||
This command was ported from FreeBSD source code
|
||||
for distribution with GNO/ME 2.0.6.
|
||||
|
||||
stdio:
|
||||
- add %b modifier to fprintf implementation (ORCA/C compatibility)
|
||||
|
||||
stdlib/cvt.c:
|
||||
- handle modes 0 and 1 correctly.
|
||||
|
||||
Use result of _setModeEmulation(3) in appropriate calls. These include
|
||||
chmod -
|
||||
fchmod -
|
||||
creat - done
|
||||
open - done
|
||||
stat - unnecessary
|
||||
|
@ -33,30 +89,41 @@ libc/sys/exec.c:
|
|||
These functions should operate closer to GS/OS when possible.
|
||||
Also need to reduce stack requirements.
|
||||
|
||||
*******
|
||||
* remove from / replace in Orcalib
|
||||
*******
|
||||
For the exec* functions, there should be a test for whether
|
||||
or not the file is of type SRC and auxtype EXEC. If that
|
||||
is the case, and if the first two characters of the file
|
||||
are '#!', then the shell should be exec'd instead. (currently,
|
||||
shell scripts cannot be exec'd)
|
||||
|
||||
|
||||
NEED TO WRITE OR DUPLICATE MAN PAGES FOR
|
||||
----------------------------------------
|
||||
login libc(3)
|
||||
login_tty
|
||||
regexp libc(3)
|
||||
termcap libc(3)
|
||||
queue 3
|
||||
tty 4
|
||||
grp 5
|
||||
passwd 5
|
||||
termcap 5
|
||||
ms 7
|
||||
man 7
|
||||
cron 8
|
||||
runover 8 (obsolete?) No, needed for single user mode.
|
||||
dialup 8
|
||||
|
||||
strerror orcalib/string.asm
|
||||
perror orcalib/stdio.a
|
||||
sys_errlist orcalib/stdio.a problem
|
||||
sys_nerr orcalib/vars.a problem
|
||||
|
||||
*******
|
||||
* defer
|
||||
*******
|
||||
|
||||
libc/stdio/perror.c:
|
||||
use BSDish implementation for perror(3) to avoid stdio.
|
||||
investigate using dynamic libraries (RTLs)
|
||||
|
||||
libc/sys/syscall.c:
|
||||
for unlink, if file is open, then register a call to unlink
|
||||
(non-recursive) the file via atexit(3)
|
||||
|
||||
libc/sys/trap.asm:
|
||||
Insert conchecks in trap functions to check to see if GNO
|
||||
is active and at the right version level. If not, they
|
||||
should abort.
|
||||
[not practical?]
|
||||
|
||||
libc/gen/environ.c:
|
||||
Review routines. Force them to use GSString routines, reduce
|
||||
|
@ -78,6 +145,8 @@ do intro man pages:
|
|||
7 done
|
||||
8 done
|
||||
|
||||
Add locale implementation to libc.
|
||||
|
||||
various man pages:
|
||||
add note under COMPATIBILITY as to whether the routines
|
||||
are thread-safe. If they write any globals or static
|
||||
|
|
95
NOTES/devel/adding.utils
Normal file
95
NOTES/devel/adding.utils
Normal file
|
@ -0,0 +1,95 @@
|
|||
$Id: adding.utils,v 1.1 1999/01/09 21:19:58 gdr-ftp Exp $
|
||||
|
||||
General
|
||||
-------
|
||||
|
||||
You should read this file if you are contemplating adding utilities
|
||||
to the base GNO distribution.
|
||||
|
||||
The first question is whether or not your utility belongs with the
|
||||
base distribution. The criteria are loose, but if it is a commonly
|
||||
used utility among the majority of GNO users, or if it is required
|
||||
for building GNO itself, it may be incorporated into the base
|
||||
distribution. If you think your utility matches these criteria,
|
||||
contact Devin Reade <gdr@trenco.gno.org>.
|
||||
|
||||
Source Code
|
||||
-----------
|
||||
|
||||
There is no restriction to which source language you use. If you have
|
||||
successfully written a program written in something other than ORCA/C
|
||||
or ORCA/M, please share your observations with the GNO development group
|
||||
regarding using these other languages.
|
||||
|
||||
[talk about hierarchy in the src directory]
|
||||
|
||||
It should be clear from the *source* exactly from where the original code
|
||||
came. In the case of GNO base distribution utilities ported from BSD,
|
||||
changes should be reviewed by the GNO development team.
|
||||
|
||||
Mandetory Makefile Targets
|
||||
--------------------------
|
||||
|
||||
|
||||
Documentation Requirements
|
||||
--------------------------
|
||||
|
||||
For utilities that become part of the GNO base distribution, there
|
||||
are three *required* documentation files:
|
||||
|
||||
1. A manual page. Ensure that it is using a format understood
|
||||
by the GNO version of nroff. BSD manual pages do not
|
||||
usually fall into this category. Some utilities have both
|
||||
a GNO and a BSD man page. In this case, the BSD man page
|
||||
has a suffix of (for example) ".1" while the GNO version
|
||||
has a suffix of ".1G". In either case, the suffix of the
|
||||
manual page after installation should be ".1". See the
|
||||
ftp(1) source for an example.
|
||||
2. A describe(1) entry.
|
||||
3. A rez source file containing an rVersion entry. This
|
||||
will become (part of) the program's resource fork.
|
||||
This file may contain other resources as well. Some
|
||||
common ones include rComment and rProgInfo entries.
|
||||
|
||||
The GNO FAQ has information on where samples of these documentation
|
||||
files may be found.
|
||||
|
||||
Other documentation files can be included as necessary. These include
|
||||
but are not limited to READMEs, ChangeLogs, and reference manuals.
|
||||
|
||||
The README or other documentation should contain the following information:
|
||||
1. Who wrote or ported the program.
|
||||
2. How the maintainer may be contacted.
|
||||
3. A list of what features have been tested.
|
||||
4. The copying status; is it freeware, public domain, shareware,
|
||||
copyleft, or something else?
|
||||
|
||||
There should be a detailed record of what changes have been made for
|
||||
the various versions. Small projects can have this information in the
|
||||
README file; large projects should use a separate ChangeLog.
|
||||
|
||||
|
||||
RCS/CVS Identifiers
|
||||
-------------------
|
||||
|
||||
When you're working on your utils please include, in comments near the
|
||||
top of each file, the character sequence "[Dollar sign]Id[Dollar sign]"
|
||||
(minus the quotes, and with [Dollar sign] repaced by '$'). This is an
|
||||
RCS identifer. (RCS is the Revision Control System. CVS, the Concurrent
|
||||
Versions System, depends on RCS.) Adding in the RCS identifier will
|
||||
cause the version number associated with each file in the repository to
|
||||
be displayed (and automatically updated) in each file.
|
||||
|
||||
You should *not* add a RCS identifier to your describe(1) entry file.
|
||||
These files are cat'd together later when creating the database,
|
||||
and the RCS identifiers do not belong in the database.
|
||||
|
||||
Note that some sources (notably some BSD files) already have such a string.
|
||||
In these cases, you need not add another. An expanded string looks
|
||||
something like this:
|
||||
|
||||
$Id: adding.utils,v 1.1 1999/01/09 21:19:58 gdr-ftp Exp $
|
||||
|
||||
When the sources are released, a 'cvs export' will be done which will
|
||||
keep the version number intact, even if someone at a remote site decides
|
||||
to import it into their own repository.
|
102
NOTES/devel/doing.builds
Normal file
102
NOTES/devel/doing.builds
Normal file
|
@ -0,0 +1,102 @@
|
|||
$Id: doing.builds,v 1.2 1999/01/27 06:27:59 gdr-ftp Exp $
|
||||
|
||||
This file describes how to build the GNO base distribution. It is critical
|
||||
that things be done in the sequence given here, as there are dependencies.
|
||||
|
||||
The default target in each Makefile is 'build'; it causes the program or
|
||||
library to be built in the /obj hierarchy. Each Makefile also has a
|
||||
'release' target, which caused built or verbatim files to be copied into
|
||||
the /dist hierarchy.. Both of these must be made before you proceed to the
|
||||
next step.
|
||||
|
||||
All Makefiles also have an 'install' target, but that is only used for
|
||||
installing into a live system. Caveat Emptor.
|
||||
|
||||
- The first thing is to ensure that your system header files match those
|
||||
in the distribution. This is done by the following commands:
|
||||
|
||||
cd /src/gno
|
||||
dmake headerInstall
|
||||
|
||||
- Next, the libraries have to be built in the following sequence. Each
|
||||
of them should get a 'dmake build' followed by a 'dmake release':
|
||||
|
||||
/src/lib/orcalibs/Source/ORCALib
|
||||
/src/lib/orcalibs/Source/SysFloat
|
||||
/src/lib/orcalibs/Source/SysFPEFloat
|
||||
/src/gno/lib/lsaneglue
|
||||
/src/gno/lib/libc (build top level last, or there won't be rez fork)
|
||||
/src/gno/lib/libcontrib
|
||||
/src/gno/lib/libcrypt
|
||||
/src/gno/lib/libcurses
|
||||
/src/gno/lib/libedit (not yet building)
|
||||
/src/gno/lib/libsim (not yet building)
|
||||
/src/gno/lib/libtermcap
|
||||
/src/gno/lib/libutil
|
||||
/src/gno/lib/liby
|
||||
/src/gno/lib/netdb
|
||||
|
||||
- Now you want to build each of the (finished) programs in the following
|
||||
directory hierarchies. The sequence doesn't really matter. You need
|
||||
to do both 'dmake build' and 'dmake release'.
|
||||
|
||||
/src/gno/bin
|
||||
/src/gno/usr.bin
|
||||
/src/gno/usr.orca.bin
|
||||
/src/gno/usr.sbin
|
||||
/src/gno/sbin
|
||||
|
||||
Note that not all checked in programs are necessarily finished, and
|
||||
therefore suitable for the 'build' and 'release' targets. When in doubt,
|
||||
check the file /src/gno/NOTES/status.bin.
|
||||
|
||||
(need to add text about the sys and kern directories)
|
||||
|
||||
- when the builds are closer to a sane state the /dist hierarchy
|
||||
will be used to directly make a distribution. However for now,
|
||||
we make use of another hierarchy, /gno into which we copy the
|
||||
/dist hierarchy. The /gno hierarchy is then topped up with files
|
||||
from a v2.0.4 distribution.
|
||||
|
||||
- so, once the 'release' target has been made in all the relevent source
|
||||
directories, the following must occur:
|
||||
|
||||
- start with all of the following volumes empty. They may either be
|
||||
physical volumes, or empty directories specified via the namespace
|
||||
facility:
|
||||
/gno
|
||||
/gno-hfs (MUST be an HFS volume)
|
||||
/gno.boot
|
||||
Both /gno-hfs and /gno.boot may be no larger than 800k (ie: the
|
||||
results will fit onto an 800k floppy)
|
||||
|
||||
- make sure the three volumes above are online. Since I use a
|
||||
floppy for /gno-hfs, I keep forgetting that ...
|
||||
|
||||
- copy the entire contents of /dist to /gno
|
||||
|
||||
- run the /src/gno/build.tools/fudgeinstall script
|
||||
|
||||
- run the /src/gno/build.tools/mkboot script
|
||||
|
||||
- run the /src/gno/build.tools/mkdisk1 script
|
||||
|
||||
- go to the /gno directory. Using gshk, archive all the
|
||||
directories you find there (such as gno.01, gno.02, etc).
|
||||
You should create the files gno.01.shk, gno.02.shk, and so
|
||||
forth.
|
||||
*** Don't include the upper directory name in the archive. ***
|
||||
When creating gno.16.shk, leave out the /install directory.
|
||||
|
||||
- go to the /gno-hfs partition. Archive up all contents of that
|
||||
partition to create the gnohfs.shk archive. The gnohfs.shk
|
||||
file should be placed with the gno.??.shk files from the
|
||||
previous step.
|
||||
*** Don't include the upper directory name in the archive. ***
|
||||
|
||||
- go to the /gno.boot partition and use gshk to archive all
|
||||
all the files in that partition. Name the resulting archive
|
||||
file gnoboot.shk, and place it with the other archive files.
|
||||
*** Don't include the upper directory name in the archive. ***
|
||||
|
||||
- run the /src/gno/build.tools/mkdisk2 script
|
|
@ -1,9 +1,10 @@
|
|||
$Id: headers,v 1.1 1997/02/28 05:42:26 gdr Exp $
|
||||
$Id: headers,v 1.2 1999/01/09 21:28:35 gdr-ftp Exp $
|
||||
|
||||
A hash prefix indicates that it has passed the compile test. An "[Orca]"
|
||||
indicates that the file is modified from an Orca/C header rather than
|
||||
from either BSD or custom sources.
|
||||
|
||||
This file is probably out of date; feel free to submit corrections.
|
||||
|
||||
# curses.h changed hash type from u_int to u_long
|
||||
# db.h various macros have changed.
|
||||
|
@ -17,7 +18,7 @@ from either BSD or custom sources.
|
|||
# glob.h
|
||||
# gno/conf.h
|
||||
# gno/gno.h
|
||||
gno/kerntool.h INCOMPLETE CHANGES -- OBSOLETE?
|
||||
gno/kerntool.h INCOMPLETE CHANGES
|
||||
# gno/kvm.h
|
||||
# gno/proc.h
|
||||
# gno/sim.h
|
||||
|
@ -44,7 +45,7 @@ from either BSD or custom sources.
|
|||
# sgtty.h
|
||||
# signal.h
|
||||
# stddef.h
|
||||
# stdio.h [Orca] *** critical that __ORCAC_VERSION is correct
|
||||
# stdio.h *** upgraded to BSD 4.4 (incompatible downward)
|
||||
# stdlib.h
|
||||
# string.h * check need for "const" in non-BSD, non-ORCA routines
|
||||
# sys/cdefs.h
|
||||
|
|
439
NOTES/status.bin
Normal file
439
NOTES/status.bin
Normal file
|
@ -0,0 +1,439 @@
|
|||
*************************************************************************
|
||||
* *
|
||||
*** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ****
|
||||
* *
|
||||
* Please do not edit this file. This is the one file in the GNO *
|
||||
* base distribution that I explicitly don't want anyone else to edit; *
|
||||
* it reflects the status of the builds on the machine from which *
|
||||
* current versions of GNO are distributed. If you have comments *
|
||||
* to make on this file, please either send them to the developers' *
|
||||
* mailing list or to me directly. Thank you. *
|
||||
* *
|
||||
* Devin Reade, 10 April 1998. *
|
||||
* *
|
||||
* $Id: status.bin,v 1.22 2012/08/26 02:54:58 gdr Exp $ *
|
||||
* *
|
||||
*************************************************************************
|
||||
|
||||
This file lists the status of the various files in the GNO base distribution.
|
||||
It really needs a wide screen to be viewed properly. I'm using 132 columns.
|
||||
|
||||
You will see text that's delimited by three percent characters ("%%%").
|
||||
These are notations that are used for converting this file to an html
|
||||
report. The report is generated automatically.
|
||||
|
||||
Person Working on Component ("Owner")
|
||||
-------------------------------------
|
||||
%%%NAMES-START%%%
|
||||
dave Dave Tribby <tribby@cup.hp.com>
|
||||
dt Derek Taubert <taubert@geeks.org>
|
||||
evan Evan Day <day@ENGR.ORST.EDU>
|
||||
gdr Devin Reade <gdr@trenco.gno.org>
|
||||
lb Leslie Barstow <phoenix@faerealm.faerealm.com>
|
||||
ma Marlin Allred <Marlin.Allred@unisys.com> (not on gno-devel)
|
||||
matt Matt Ackeret <mattack@vax.area.com>
|
||||
mober Scott Moberly <smoberly@s-cwis.unomaha.edu> (not on gno-devel)
|
||||
sonk Soenke Behrens <sbehrens@bigfoot.com>
|
||||
sr Steve Reeves <stever@gate.net>
|
||||
tl Tilghman Lesher <lesherjt@vuse.vanderbilt.edu>
|
||||
%%%NAMES-END%%%
|
||||
|
||||
Column Key
|
||||
----------
|
||||
Program - Name of the program.
|
||||
204 - 'Y' if it was part of the base v2.0.4 distribution.
|
||||
Req - Is it required for v2.0.6?
|
||||
Owner - Who is responsible for it.
|
||||
Source - Has the source been located/written? "dir" means it's
|
||||
a directory.
|
||||
Man - Is the documentation complete? This includes the man
|
||||
page, describe entry, rVersion fork, and any
|
||||
required auxillary documentation. The label
|
||||
'P' means it's present, 'T' means it's been
|
||||
tested (reviewed). '[G]' indicates that it is
|
||||
missing the GNO version of the man page (but
|
||||
has the BSD version)
|
||||
Compiled - Has it been cleanly recompiled with new headers/libs?
|
||||
Tested - Has it been tested?
|
||||
Archived - Has it been entered in the CVS repository? (gdr to coord)
|
||||
Installed - Are 'release', 'install', and 'dist' targets complete?
|
||||
('R', 'I', and 'D', respectively). The 'release' target
|
||||
places all necessary files into the /dist (distribution)
|
||||
hierarchy. The 'I' target installs onto a live file system.
|
||||
The 'dist' target archives files from the /dist hierarchy
|
||||
and places them in NuFX archives (no bigger than 780k)
|
||||
suitable for distribution.
|
||||
|
||||
Archive Install (Pkg) or
|
||||
Program 204 Req Owner Source Man Compile Test Target Target [Note] Comments
|
||||
--------------------------------------------------------------------------------------------------------------------------
|
||||
%%%STATUS-TABLE-START%%%
|
||||
*/system Y Y - dir - - - - -
|
||||
*/system/Desk.Accs Y Y - dir - - - - -
|
||||
*/system/Desk.Accs/gnosnooper Y Y dt
|
||||
*/system/Desk.Accs/gsi Y # Superceded by TMTerm?
|
||||
*/system/Desk.Accs/tmterm N Y dave
|
||||
*/system/Desk.Accs/suspda Y Y dave Y . . . Y
|
||||
*/system/Drivers Y Y - dir - - - - -
|
||||
*/system/Drivers/fileport Y Y dt
|
||||
*/system/Drivers/fileport.data Y Y dt
|
||||
*/system/Drivers/nullport Y Y dt
|
||||
*/system/System.Setup Y Y - dir - - - - -
|
||||
*/system/System.Setup/gnobug Y Y gdr . . . . . .
|
||||
*/system/System.Setup/sim Y Y dt
|
||||
/ Y Y gdr dir - - - - -
|
||||
/HFSinclude N Y gdr dir - - - - -
|
||||
/bin Y Y gdr dir - - - - -
|
||||
/bin/aroff Y Y gdr Y T Y Y Y RI
|
||||
/bin/binprint Y Y dt Y T Y Y Y RI
|
||||
/bin/cat Y Y dave Y T Y Y Y RI
|
||||
/bin/center Y Y gdr Y T Y Y Y RI
|
||||
/bin/chmod Y lb
|
||||
/bin/chtyp Y Y evan Y T Y Y Y RI
|
||||
/bin/cmp Y Y evan Y T Y Y Y RI
|
||||
/bin/compress Y Y evan
|
||||
/bin/conv Y # should be replaced by /usr/bin/udl
|
||||
/bin/cp Y Y
|
||||
/bin/csh
|
||||
/bin/date Y Y mober Y # uploaded to mail distrib on trenco
|
||||
/bin/dd
|
||||
/bin/df N Y evan Y T Y Y Y RI
|
||||
/bin/domainname
|
||||
/bin/du Y Y evan Y
|
||||
/bin/echo N Y dt
|
||||
/bin/ed N . mober . . . . . . # avail separately (trenco)
|
||||
/bin/edit Y Y . Y
|
||||
/bin/egrep Y Y evan
|
||||
/bin/expr
|
||||
/bin/false N Y gdr Y T Y Y Y RI
|
||||
/bin/fgrep Y Y evan
|
||||
/bin/freeze Y Y
|
||||
/bin/grep Y Y evan
|
||||
/bin/gsh Y Y dave Y Y Y Y # still uses old termcap
|
||||
/bin/head Y Y dave Y T Y Y Y RI
|
||||
/bin/hostname N Y dt
|
||||
/bin/info Y . lb # rename to something else
|
||||
/bin/kill N Y dave Y T Y Y Y RI
|
||||
/bin/less Y Y sr Y . . . Y
|
||||
/bin/ln N N
|
||||
/bin/ls Y Y . Y . . . Y
|
||||
/bin/make Y Y . Y . . . Y
|
||||
/bin/makemake Y Y . Y . . . Y
|
||||
/bin/mkdir Y Y dt Y . . . Y
|
||||
/bin/more Y Y matt Y
|
||||
/bin/mv Y Y
|
||||
/bin/passwd Y Y . Y . . . Y
|
||||
/bin/pax N N
|
||||
/bin/ps N Y . Y . . . Y # formerly eps
|
||||
/bin/purge Y Y . Y . . . Y
|
||||
/bin/pwd N Y dave Y T Y Y Y RI
|
||||
/bin/rcp N Y dt Y T Y . Y RI
|
||||
/bin/rm Y Y tribby Y T Y Y Y RI
|
||||
/bin/rmail N N
|
||||
/bin/rmdir N Y gdr Y T Y Y Y RI
|
||||
/bin/sh N Y gdr
|
||||
/bin/shutdown Y Y
|
||||
/bin/sleep Y Y dave Y T Y Y Y RI
|
||||
/bin/split Y Y dave Y T Y Y Y RI
|
||||
/bin/strings Y Y lb Y
|
||||
/bin/stty Y Y . Y . . . Y
|
||||
/bin/su Y Y
|
||||
/bin/sync N Y
|
||||
/bin/tail Y Y dave Y T Y Y Y RI
|
||||
/bin/tar Y Y tl Y
|
||||
/bin/tee Y Y gdr Y T Y Y Y RI
|
||||
/bin/test N Y gdr Y T Y Y Y RI
|
||||
/bin/time Y Y dave Y . . . Y
|
||||
/bin/touch Y Y dt Y . . . Y
|
||||
/bin/tr Y Y dave Y T Y Y Y RI
|
||||
/bin/true N Y gdr Y T Y Y Y RI
|
||||
/bin/uncompress Y Y
|
||||
/bin/uname N Y sr Y T Y Y Y RI
|
||||
/bin/uniq Y Y dave Y T Y Y Y RI
|
||||
/bin/upper Y Y . Y . . . Y
|
||||
/bin/vi Y Y . Y . . . Y
|
||||
/bin/wc Y Y dave Y T Y Y Y RI
|
||||
/bin/yes Y dave Y T Y Y Y RI
|
||||
/dev Y Y gdr dir - - - -
|
||||
/dev/modem Y Y dt
|
||||
/dev/null N Y dt
|
||||
/dev/printer Y Y dt
|
||||
/doc N Y gdr dir - - - -
|
||||
/etc Y Y gdr dir - - - -
|
||||
/etc/cronlog . . sr . . . . . . (cron)
|
||||
/etc/crontab . . sr . . . . . . (cron)
|
||||
/etc/freeze.cnf . . . . . . . . . (freeze)
|
||||
/etc/gettytab Y Y . Y
|
||||
/etc/group Y Y gdr Y . -
|
||||
/etc/inittab Y Y . Y . . . . . (initd)
|
||||
/etc/motd Y Y gdr Y . - -
|
||||
/etc/namespace Y Y gdr Y . . . . Y
|
||||
/etc/passwd Y Y gdr Y . -
|
||||
/etc/rchost . . . . . . . . . (mu)
|
||||
/etc/syslog.conf . . . . . . . . . (syslog)
|
||||
/etc/termcap Y Y evan
|
||||
/etc/tmtermrc . . . . . . . . . (tmterm)
|
||||
/etc/tty.config Y Y gdr Y . -
|
||||
/etc/ttys Y Y Y . -
|
||||
/etc/utmp . . . . . . . . . (mu)
|
||||
/gshrc Y Y
|
||||
/home/root N Y gdr dir - - - -
|
||||
/initrc Y Y gdr Y . - # single-user
|
||||
/installbin Y Y gdr . . -
|
||||
/kern Y Y dt
|
||||
/lib Y Y gdr dir - - - - Y
|
||||
/lib/lbsd Y N - - - - - - - [B]
|
||||
/lib/lcrypt Y N - - - - - - - [B]
|
||||
/lib/libc Y Y gdr Y . Y . Y
|
||||
/lib/libgno Y N - - - - - - - [B]
|
||||
/lib/lsaneglue N Y sonk Y T Y Y Y RI
|
||||
/lib/lstring Y # replaced by libc?
|
||||
/lib/orcalib Y Y gdr Y T Y Y Y
|
||||
/lib/sysfloat N Y gdr Y T Y Y Y
|
||||
/libexec/atrun . . sr
|
||||
/libexec/fingerd
|
||||
/libexec/ftpd N Y dt
|
||||
/libexec/rexecd
|
||||
/libexec/rlogind
|
||||
/libexec/rshd
|
||||
/libexec/talkd N Y dt
|
||||
/libexec/telnetd
|
||||
/libexec/uucpd
|
||||
/sbin/dump N Y dt
|
||||
/sbin/dumpfs
|
||||
/sbin/fsck
|
||||
/sbin/init Y Y . . . . . . . (initd)
|
||||
/sbin/initd Y Y . . . . . . . (initd)
|
||||
/sbin/mkso N Y gdr Y T Y Y Y RI
|
||||
/sbin/newfs
|
||||
/sbin/ping
|
||||
/sbin/renram5 N Y gdr Y T Y Y Y RI
|
||||
/startinst Y
|
||||
/usr Y Y gdr dir - - - - Y
|
||||
/usr/bin Y Y gdr dir - - - - Y
|
||||
/usr/bin/alarm Y . . Y . . . Y
|
||||
/usr/bin/apply N N
|
||||
/usr/bin/apropos N Y gdr Y T Y Y Y RI (man)
|
||||
/usr/bin/ar N N
|
||||
/usr/bin/asml N Y gdr Y T Y Y Y RI (compile)
|
||||
/usr/bin/assemble N Y gdr Y T Y Y Y RI (compile)
|
||||
/usr/bin/at . . sr
|
||||
/usr/bin/aw30 Y . . Y . . . Y
|
||||
/usr/bin/awk N Y dave Y T T T Y RI
|
||||
/usr/bin/bang N Y
|
||||
/usr/bin/banner Y . . Y . . . Y
|
||||
/usr/bin/basename N Y mober Y T Y Y Y RI
|
||||
/usr/bin/biff
|
||||
/usr/bin/bison Y N
|
||||
/usr/bin/cal Y . . Y . . . Y
|
||||
/usr/bin/catrez N Y dave Y T Y Y Y RI
|
||||
/usr/bin/cclean N Y sonk
|
||||
/usr/bin/cksum N Y dave Y Y Y Y Y RI
|
||||
/usr/bin/cmpl Y Y gdr Y T Y Y Y RI (compile)
|
||||
/usr/bin/coff N Y
|
||||
/usr/bin/col N . mober . . . . . . # avail separately (trenco)
|
||||
/usr/bin/colcrt N Y sr Y T Y Y Y RI
|
||||
/usr/bin/column N . mober
|
||||
/usr/bin/compile Y Y gdr Y T Y Y Y RI
|
||||
/usr/bin/copycat Y Y tl
|
||||
/usr/bin/cpp N Y gdr Y Y
|
||||
/usr/bin/ctags N Y dt Y T Y Y Y RI
|
||||
/usr/bin/cut N Y dave Y T Y Y Y RI
|
||||
/usr/bin/day Y
|
||||
/usr/bin/describe N Y gdr Y T Y Y Y RI (describe)
|
||||
/usr/bin/dhrystone Y N
|
||||
/usr/bin/diff N Y gdr
|
||||
/usr/bin/dirname N Y mober Y T Y Y Y RI
|
||||
/usr/bin/dmake N Y gdr
|
||||
/usr/bin/env N Y gdr
|
||||
/usr/bin/ffdir Y
|
||||
/usr/bin/file
|
||||
/usr/bin/find N . gdr # sr working on GS-specific implementation
|
||||
/usr/bin/finger
|
||||
/usr/bin/flex Y N
|
||||
/usr/bin/fmt N Y gdr Y T Y Y Y RI
|
||||
/usr/bin/fold Y . . Y . . . Y
|
||||
/usr/bin/ftp N Y dt Y . Y . Y RI
|
||||
/usr/bin/getopt
|
||||
/usr/bin/getvers Y Y dave Y T Y Y Y RI
|
||||
/usr/bin/gothic Y
|
||||
/usr/bin/gunzip N Y
|
||||
/usr/bin/gzip N Y
|
||||
/usr/bin/hear Y
|
||||
/usr/bin/help Y Y gdr Y T - Y Y RI
|
||||
/usr/bin/hexdump
|
||||
/usr/bin/install N Y gdr Y T Y Y Y RI
|
||||
/usr/bin/join
|
||||
/usr/bin/last N Y dt Y T Y Y Y RI
|
||||
/usr/bin/launch Y Y tl Y
|
||||
/usr/bin/link (ie: ld) Y Y gdr Y T Y Y Y RI
|
||||
/usr/bin/locate N . gdr
|
||||
/usr/bin/logger N Y gdr Y T Y Y Y RI
|
||||
/usr/bin/logname
|
||||
/usr/bin/lpq Y Y dt . . . . . . (lpr)
|
||||
/usr/bin/lpr Y Y dt . . . . . . (lpr)
|
||||
/usr/bin/lprm Y Y dt . . . . . . (lpr)
|
||||
/usr/bin/lseg Y Y dave Y T Y Y Y RI
|
||||
/usr/bin/mkdep
|
||||
/usr/bin/makedmake N . gdr
|
||||
/usr/bin/man Y Y gdr Y T Y Y Y RI
|
||||
/usr/bin/news Y N # waiting on NNTP
|
||||
/usr/bin/nm
|
||||
/usr/bin/nosh N Y lb # formerly zsh
|
||||
/usr/bin/nroff Y Y gdr Y T Y Y Y RI # using old termcap
|
||||
/usr/bin/patch N Y gdr
|
||||
/usr/bin/pman Y
|
||||
/usr/bin/pr
|
||||
/usr/bin/printenv N Y gdr
|
||||
/usr/bin/printf
|
||||
/usr/bin/qtime Y
|
||||
/usr/bin/rb Y Y
|
||||
/usr/bin/removerez N Y gdr Y T Y Y Y RI
|
||||
/usr/bin/reset Y
|
||||
/usr/bin/rlogin N Y dt Y T Y . Y RI
|
||||
/usr/bin/rot13 N Y lb
|
||||
/usr/bin/rsh N Y dt Y T Y . Y RI
|
||||
/usr/bin/rx Y Y
|
||||
/usr/bin/rz Y Y
|
||||
/usr/bin/sb Y
|
||||
/usr/bin/script Y Y dave
|
||||
/usr/bin/sed N Y dave Y Y Y Y Y RI
|
||||
/usr/bin/see Y
|
||||
/usr/bin/sendmail N N # waiting on SMTP
|
||||
/usr/bin/setvers Y Y dave
|
||||
/usr/bin/shar
|
||||
/usr/bin/size
|
||||
/usr/bin/sort Y Y gdr Y # supercedes msort/dsort?
|
||||
/usr/bin/sscii Y
|
||||
/usr/bin/sum Y Y dave Y Y Y Y Y RI (cksum)
|
||||
/usr/bin/sx Y Y
|
||||
/usr/bin/sz Y Y
|
||||
/usr/bin/talk N Y dt
|
||||
/usr/bin/telnet N Y dt
|
||||
/usr/bin/tftp
|
||||
/usr/bin/tset
|
||||
/usr/bin/tsort Y . . Y . . . Y
|
||||
/usr/bin/tty
|
||||
/usr/bin/unshar Y Y
|
||||
/usr/bin/unzip Y
|
||||
/usr/bin/uptime Y Y
|
||||
/usr/bin/uudecode
|
||||
/usr/bin/uuencode
|
||||
/usr/bin/wall N Y dt Y T Y Y Y RI
|
||||
/usr/bin/whatis N Y gdr Y T Y Y Y RI (man)
|
||||
/usr/bin/whereis N Y gdr Y T Y Y Y RI
|
||||
/usr/bin/which
|
||||
/usr/bin/who Y Y dt Y T Y Y Y RI
|
||||
/usr/bin/whois N Y dt Y T Y . Y RI
|
||||
/usr/bin/write N Y lb Y
|
||||
/usr/bin/xargs
|
||||
/usr/bin/yankit Y Y
|
||||
/usr/bin/zsh N Y lb # renamed to nosh
|
||||
/usr/games Y Y gdr dir - - - - Y
|
||||
/usr/games/calendar N Y ma Y T Y Y Y RI
|
||||
/usr/games/wump Y
|
||||
/usr/include Y Y gdr dir - - - - Y
|
||||
/usr/lib Y Y gdr dir - - - - Y
|
||||
/usr/lib/libcontrib N Y gdr Y . Y Y Y RI
|
||||
/usr/lib/libcurses Y Y evan
|
||||
/usr/lib/libedit N Y gdr
|
||||
/usr/lib/libflex Y
|
||||
/usr/lib/libnetdb N Y dt Y Y Y RI
|
||||
/usr/lib/libregexp Y N - - - - - - - [B]
|
||||
/usr/lib/libtermcap Y Y evan
|
||||
/usr/lib/libutil N Y gdr Y . Y . Y RI
|
||||
/usr/lib/liby N Y gdr Y . Y . Y RI
|
||||
/usr/lib/tmac Y Y gdr dir - - - - Y
|
||||
/usr/lib/tmac/tmac.an Y . . . . . . . . (nroff)
|
||||
/usr/lib/tmac/tmac.s Y . . . . . . . . (nroff)
|
||||
/usr/orca/bin/occ N Y sonk
|
||||
/usr/orca/bin/rc N Y sonk
|
||||
/usr/orca/bin/udl N Y sonk Y T Y Y Y RI
|
||||
/usr/man Y Y gdr dir - - - - Y
|
||||
/usr/man/cat1 Y Y gdr dir - - - - Y
|
||||
/usr/man/cat2 Y Y gdr dir - - - - Y
|
||||
/usr/man/cat3 Y Y gdr dir - - - - Y
|
||||
/usr/man/cat4 Y Y gdr dir - - - - Y
|
||||
/usr/man/cat5 Y Y gdr dir - - - - Y
|
||||
/usr/man/cat6 Y Y gdr dir - - - - Y
|
||||
/usr/man/cat7 Y Y gdr dir - - - - Y
|
||||
/usr/man/cat8 Y Y gdr dir - - - - Y
|
||||
/usr/man/man1 Y Y gdr dir - - - - Y
|
||||
/usr/man/man1/intro.1 Y Y gdr . . - . . Y
|
||||
/usr/man/man2 Y Y gdr dir - - - - Y
|
||||
/usr/man/man2/* Y Y gdr . . - . . Y [A]
|
||||
/usr/man/man3 Y Y gdr dir - - - - Y
|
||||
/usr/man/man3/* Y Y gdr . . - . . Y [A]
|
||||
/usr/man/man4 Y Y gdr dir - - - - Y
|
||||
/usr/man/man4/* Y Y gdr . . - . . Y [A]
|
||||
/usr/man/man5 Y Y gdr dir - - - - Y
|
||||
/usr/man/man5/* Y Y gdr . . - . . Y [A]
|
||||
/usr/man/man6 Y Y gdr dir - - - - Y
|
||||
/usr/man/man6/intro.6 Y Y gdr . . - . . Y
|
||||
/usr/man/man7 Y Y gdr dir - - - - Y
|
||||
/usr/man/man7/* Y Y gdr . . - . . Y [A]
|
||||
/usr/man/man8 Y Y gdr dir - - - - Y
|
||||
/usr/man/man8/intro.8 Y Y gdr . . - . . Y
|
||||
/usr/sbin Y Y gdr dir - - - - Y
|
||||
/usr/sbin/catman N Y gdr Y T Y Y Y RI (man)
|
||||
/usr/sbin/cron Y Y sr Y . . . Y
|
||||
/usr/sbin/descc N Y gdr Y T Y Y Y RI (describe)
|
||||
/usr/sbin/descu N Y gdr Y T Y Y Y RI (describe)
|
||||
/usr/sbin/getty Y Y gdr Y T Y Y Y RI
|
||||
/usr/sbin/inetd N Y dt Y [G]
|
||||
/usr/sbin/login Y Y dt Y T Y Y Y RI
|
||||
/usr/sbin/lpc Y Y dt . . . . . . (lpr)
|
||||
/usr/sbin/lpd Y Y dt . . . . . . (lpr)
|
||||
/usr/sbin/lptest N Y dt . . . . . . (lpr)
|
||||
/usr/sbin/makewhatis N Y gdr Y T Y Y Y RI (man)
|
||||
/usr/sbin/mctrl Y
|
||||
/usr/sbin/mktmp
|
||||
/usr/sbin/newuser N Y gdr Y T Y Y Y .
|
||||
/usr/sbin/newuserv N Y gdr Y T Y Y Y . (newuser)
|
||||
/usr/sbin/nogetty Y Y . Y . . . Y
|
||||
/usr/sbin/runover Y Y
|
||||
/usr/sbin/syslogd Y Y gdr Y . Y . Y . # still alpha; needs work
|
||||
/usr/sbin/uptimed Y
|
||||
/usr/spool Y N - dir - - - - -
|
||||
/var/adm Y Y gdr dir - - - - Y
|
||||
/var/adm/utmp Y Y . . . . . . . (initd)
|
||||
/var/adm/wtmp Y Y . . . . . . . (initd)
|
||||
/var/run N Y . dir - - - -
|
||||
/var/spool Y Y gdr dir - - - - Y
|
||||
/var/spool/uucppublic N Y gdr dir - - - -
|
||||
%%%STATUS-TABLE-END%%%
|
||||
|
||||
|
||||
NOTES:
|
||||
A)
|
||||
%%%NOTE-START-A%%%
|
||||
See the status.man for a complete list of these files.
|
||||
%%%NOTE-END-A%%%
|
||||
B)
|
||||
%%%NOTE-START-B%%%
|
||||
The functions from these libraries now appear in libc.
|
||||
%%%NOTE-END-B%%%
|
||||
|
||||
The following are add-on utils, that are not part of the base GNO
|
||||
distribution:
|
||||
|
||||
/usr/local/bin/cjpeg
|
||||
/usr/local/bin/djpeg
|
||||
/usr/local/bin/drwm
|
||||
/usr/local/bin/jive
|
||||
/usr/local/bin/valspeak
|
||||
/usr/local/bin/ssplay
|
||||
/usr/lang/bin/xlisp
|
||||
|
||||
The following are the files as the user sees them "shipped":
|
||||
|
||||
/gno.disk1/kern
|
||||
/gno.disk1/gsh
|
||||
/gno.disk1/installbin
|
||||
/gno.disk1/mkso
|
||||
/gno.disk1/dev/null
|
||||
/gno.disk1/usr/bin/install
|
||||
/gno.disk1/usr/bin/yankit
|
||||
/gno.disk2/dev.shk
|
||||
/gno.disk2/include.shk
|
||||
/gno.disk3/usr.man.shk
|
415
NOTES/status.lib
415
NOTES/status.lib
|
@ -1,4 +1,4 @@
|
|||
$Id: status.lib,v 1.1 1997/02/28 05:42:27 gdr Exp $
|
||||
$Id: status.lib,v 1.9 2012/08/26 02:54:58 gdr Exp $
|
||||
|
||||
Key for Code Status column:
|
||||
R == reviewed
|
||||
|
@ -10,6 +10,9 @@ resides. If it is blank, it is not yet written. "2U" indicates
|
|||
undocumented system calls in undocumented.2. If these should be documented,
|
||||
Derek, please write a man page for them or tell me what should be in there.
|
||||
|
||||
Letters in square brackets ("[]") following function names indicate
|
||||
that you should read the respective note following this table.
|
||||
|
||||
function file code man header
|
||||
status page
|
||||
======================================================================
|
||||
|
@ -23,16 +26,30 @@ GOchange libc/gno/gsstring.c T 3 gno/gno.h
|
|||
GOfree libc/gno/gsstring.c T 3 gno/gno.h
|
||||
GOinit libc/gno/gsstring.c T 3 gno/gno.h
|
||||
InstallNetDriver libc/sys/trap.asm C 2U gno/gno.h
|
||||
LC_CopyFile libcontrib/copyfile.c T contrib.h
|
||||
LC_CopyFileGS libcontrib/copyfile.c T contrib.h
|
||||
LC_ExpandPath libcontrib/expandpath.c T contrib.h
|
||||
LC_ExpandPathGS libcontrib/expandpath.c T contrib.h
|
||||
LC_StringArrayAdd libcontrib/strarray.c T contrib.h
|
||||
LC_StringArrayDelete libcontrib/strarray.c T contrib.h
|
||||
LC_StringArrayClear libcontrib/strarray.c T contrib.h
|
||||
LC_StringArrayCat libcontrib/strarray.c T contrib.h
|
||||
LC_StringArrayNew libcontrib/strarray.c T contrib.h
|
||||
LC_xmalloc libcontrib/xalloc.c T contrib.h
|
||||
LC_xrealloc libcontrib/xalloc.c T contrib.h
|
||||
LC_xstrdup libcontrib/xalloc.c T contrib.h
|
||||
SetGNOQuitRec libc/sys/trap.asm C 2U gno/gno.h
|
||||
WriteGString libc/gno/gnomisc.c
|
||||
WriteGString libc/gno/gnomisc.c C
|
||||
__C2GS libc/gno/gsstring.c C 3 gno/gno.h
|
||||
__C2GSMALLOC libc/gno/gsstring.c T 3 gno/gno.h
|
||||
__GS2C libc/gno/gsstring.c C 3 gno/gno.h
|
||||
__GS2CMALLOC libc/gno/gsstring.c C 3 gno/gno.h
|
||||
__prognameGS libc/gno/gnomisc.c T 3 gno/gno.h
|
||||
_assertStack libc/gno/stack2.c T 3 gno/gno.h
|
||||
_beginStackCheck libc/gno/stack.asm T 3 gno/gno.h
|
||||
_endStackCheck libc/gno/stack.asm T 3 gno/gno.h
|
||||
_errnoText [var] libc/stdio/perror.c T na na
|
||||
_getMinStack libc/gno/stack.asm T 3 gno/gno.h
|
||||
_getModeEmulation libc/sys/map.c T 3 gno/gno.h
|
||||
_mapErr libc/gno/map.c T 3 gno/gno.h
|
||||
_mapMode2GS libc/gno/map.c T 3 gno/gno.h
|
||||
|
@ -48,6 +65,8 @@ buildPath libc/sys/exec.c C 3 gno/gno.h
|
|||
environInit libc/gen/environ.c T 3 stdlib.h
|
||||
environPop libc/gen/environ.c T 3 stdlib.h
|
||||
environPush libc/gen/environ.c T 3 stdlib.h
|
||||
fsetbinary (macro) T 3 stdio.h
|
||||
fsettext (macro) T 3 stdio.h
|
||||
isRootPath libc/sys/exec.c C 3 gno/gno.h
|
||||
kernStatus (inline) T 2 gno/gno.h
|
||||
kernVersion (inline) T 2 gno/gno.h
|
||||
|
@ -57,20 +76,29 @@ rexit libc/sys/syscall.c C 3 stdlib.h
|
|||
setdebug libc/sys/trap.asm T 2 gno/gno.h
|
||||
setsystemvector libc/sys/trap.asm C 2U gno/gno.h
|
||||
settpgrp libc/sys/trap.asm C 2 gno/gno.h
|
||||
sprintmt libc/gno/sprintmt.c T 3 gno/gno.h
|
||||
syslogmt libc/gen/syslog.c T 3 sys/syslog.h
|
||||
tcnewpgrp libc/sys/trap.asm C 2 gno/gno.h
|
||||
tctpgrp libc/sys/trap.asm C 2 gno/gno.h
|
||||
vsprintmt libc/gno/sprintmt.c T 3 gno/gno.h
|
||||
vsyslogmt libc/gen/syslog.c T 3 sys/syslog.h
|
||||
~GNO_COMMAND libc/gno/gnocmd.asm C 3 na
|
||||
~GNO_FREEARG libc/gno/parsearg.asm C 3 na
|
||||
~GNO_PARSEARG libc/gno/parsearg.asm C 3 na
|
||||
|
||||
|
||||
|
||||
BSD-ish
|
||||
-------
|
||||
__crypt_f libc/gen/crypta.asm C na na
|
||||
__crypt_rotate libc/gen/crypta.asm C na na
|
||||
__crypt_transpose libc/gen/crypta.asm C na na
|
||||
__mb_cur_max [var] libc/locale/table.c C stdlib.h
|
||||
__srget libc/stdio/rget.c C na stdio.h
|
||||
__svfscanf libc/stdio/vfscanf C na stdio.h
|
||||
__swbuf libc/stdio/wbuf.c C na stdio.h
|
||||
_execve libc/sys/trap.asm C 2 unistd.h
|
||||
_getlogin libc/gen/getlogin.c T na unistd.h
|
||||
_getpgrp libc/sys/trap.asm C 2 unistd.h
|
||||
_longjmp libc/gen/setjmp.asm C 3 setjmp.h
|
||||
_setjmp libc/gen/setjmp.asm C 3 setjmp.h
|
||||
|
@ -78,19 +106,22 @@ accept libc/sys/trap.asm C 2 sys/socket.h
|
|||
access libc/sys/syscall.c C 2 unistd.h
|
||||
alarm libc/sys/trap.asm C 2 unistd.h
|
||||
alarm10 libc/sys/trap.asm C 2 unistd.h
|
||||
alphasort libc/gen/scandir.c T 3 dirent.h
|
||||
alphacasesort libc/gen/scandir.c T 3 dirent.h
|
||||
alphasort libc/gen/scandir.c T 3 dirent.h
|
||||
basename libc/gen/basename.c T 3 unistd.h
|
||||
bcopy libc/gen/bmem.c C 3 string.h
|
||||
bind libc/sys/trap.asm C 2 sys/socket.h
|
||||
bzero libc/gen/bmem.c C 3 string.h
|
||||
chdir libc/sys/syscall.c C 3 unistd.h
|
||||
chmod libc/sys/syscall.c C 2 sys/stat.h
|
||||
clearerr libc/stdio/clrerr.c C 3 stdio.h
|
||||
close libc/sys/syscall.c C 2 unistd.h
|
||||
closedir libc/gen/dirent.c T 3 dirent.h
|
||||
closelog libc/gen/syslog.asm C 3 sys/syslog.h
|
||||
closelog libc/gen/syslog.c C 3 sys/syslog.h
|
||||
connect libc/sys/trap.asm C 2 sys/socket.h
|
||||
creat libc/sys/syscall.c T 2 sys/fcntl.h
|
||||
crypt libc/gen/crypt.c C 3 unistd.h
|
||||
ctermid libc/stdio/ stdio.h
|
||||
dirfd (macro) T 3 dirent.h
|
||||
dirname libc/gen/basename.c T 3 unistd.h
|
||||
dup libc/sys/trap.asm C 2 unistd.h
|
||||
|
@ -109,13 +140,46 @@ execv libc/sys/exec.c T 3 unistd.h
|
|||
execve libc/sys/exec.c T 3 unistd.h
|
||||
execvp libc/sys/exec.c T 3 unistd.h
|
||||
fchdir libc/sys/syscall.c C 3 unistd.hf
|
||||
fchmod libc/sys/syscall.c C 2 sys/stat.h
|
||||
fclose libc/stdio/fclose.c T(1) 3 stdio.h
|
||||
fcntl libc/sys/syscall.c T 2 sys/fcntl.h
|
||||
fdopen libc/stdio/fdopen.c T 3 stdio.h
|
||||
feof libc/stdio/feof.c C 3 stdio.h
|
||||
ferror libc/stdio/ferror.c C 3 stdio.h
|
||||
fflush libc/stdio/fflush.c C 3 stdio.h
|
||||
fgetc libc/stdio/fgetc.c C 3 stdio.h
|
||||
fgetln libc/stdio/fgetln.c C 3 stdio.h
|
||||
fgetpos libc/stdio/fgetpos.c C 3 stdio.h
|
||||
fgets libc/stdio/fgets.c C 3 stdio.h
|
||||
fileno libc/stdio/fileno.c C 3 stdio.h
|
||||
fnmatch libc/gen/fnmatch.c T 3 fnmatch.h
|
||||
fopen libc/stdio/fopen.c C 3 stdio.h
|
||||
fork libc/sys/trap.asm C 2 unistd.h
|
||||
fork2 libc/sys/trap.asm C 2 unistd.h
|
||||
forkpty [A] libutil/pty.c libutil.h
|
||||
fprintf libc/stdio/fprintf.c C 3 stdio.h
|
||||
fpurge libc/stdio/fpurge.c C 3 stdio.h
|
||||
fputc libc/stdio/fputc.c C 3 stdio.h
|
||||
fputs libc/stdio/fputs.c C 3 stdio.h
|
||||
fread libc/stdio/fread.c T(1) 3 stdio.h
|
||||
freopen libc/stdio/freopen.c C 3 stdio.h
|
||||
fscanf libc/stdio/fscanf.c C 3 stdio.h
|
||||
fseek libc/stdio/fseek.c C 3 stdio.h
|
||||
fsetpos libc/stdio/fsetpos.c C 3 stdio.h
|
||||
fstat libc/sys/trap.asm C 2 sys/stat.h
|
||||
fstatfs libc/sys/syscall.c C 2 sys/mount.h
|
||||
fsync libc/sys/syscall.c C 2 unistd.h
|
||||
ftell libc/stdio/ftell.c C 3 stdio.h
|
||||
ftruncate libc/sys/syscall.c C 2 unistd.h
|
||||
fts_children libc/gen/fts.c R 3 fts.h
|
||||
fts_close libc/gen/fts.c R 3 fts.h
|
||||
fts_open libc/gen/fts.c R 3 fts.h
|
||||
fts_read libc/gen/fts.c R 3 fts.h
|
||||
fts_set libc/gen/fts.c R 3 fts.h
|
||||
funopen libc/stdio/funopen.c T 3 stdio.h
|
||||
fwrite libc/stdio/fvwrite.c T(1) 3 stdio.h
|
||||
getc libc/stdio/getc.c C 3 stdio.h
|
||||
getchar libc/stdio/getchar.c C 3 stdio.h
|
||||
getcwd libc/gen/getcwd.c T 3 unistd.h
|
||||
getdtablesize libc/sys/syscall.c C 2 unistd.h
|
||||
getegid libc/sys/trap.asm C 2 unistd.h
|
||||
|
@ -126,6 +190,7 @@ getgrent libc/gen/getgrent.c T 3 grp.h
|
|||
getgrgid libc/gen/getgrent.c T 3 grp.h
|
||||
getgrnam libc/gen/getgrent.c T 3 grp.h
|
||||
gethostname libc/gen/hostname.c C 3 unistd.h
|
||||
getlogin libc/gen/getlogin.c T 2 unistd.h
|
||||
getopt libc/stdlib/getopt.c C 3 stdlib.h
|
||||
getopt_restart libc/stdlib/getopt.c C 3 stdlib.h
|
||||
getpass libc/gen/getpass.c C 3 unistd.h
|
||||
|
@ -136,6 +201,7 @@ getppid libc/sys/trap.asm C 2 unistd.h
|
|||
getpwent libc/gen/getpwent.c T 3 pwd.h
|
||||
getpwnam libc/gen/getpwent.c T 3 pwd.h
|
||||
getpwuid libc/gen/getpwent.c T 3 pwd.h
|
||||
gets libc/stdio/gets.c C 3 stdio.h
|
||||
getsockname libc/sys/trap.asm C 2 sys/socket.h
|
||||
getsockopt 2 sys/socket.h
|
||||
getsubopt libc/stdlib/getsubopt.c C 3 stdlib.h
|
||||
|
@ -143,6 +209,7 @@ gettimeofday libc/sys/syscall.c C 2 sys/time.h
|
|||
getttyent libc/gen/getttyent.c C 3 ttyent.h
|
||||
getttynam libc/gen/getttyent.c C 3 ttyent.h
|
||||
getuid libc/sys/trap.asm C 2 unistd.h
|
||||
getw libc/stdio/getw.c C 3 stdio.h
|
||||
getwd libc/gen/getcwd.c T 3 unistd.h
|
||||
group_from_gid libc/gen/pwcache.c C 3 na
|
||||
gtty libc/gen/compat.c C 3 sgtty.h
|
||||
|
@ -159,6 +226,11 @@ kvmgetproc libc/sys/trap.asm C 2U gno/gno.h
|
|||
kvmnextproc libc/sys/trap.asm C 2U gno/gno.h
|
||||
kvmsetproc libc/sys/trap.asm C 2U gno/gno.h
|
||||
listen libc/sys/trap.asm C 2 sys/socket.h
|
||||
localeconv (locale.h)
|
||||
login libutil/login.c C na libutil.h
|
||||
login_tty libutil/logintty.c C na libutil.h
|
||||
logout [B] libutil/logout.c na libutil.h
|
||||
logwtmp [B, C] libutil/logwtmp.c na libutil.h
|
||||
longjmp libc/gen/setjmp.asm C 3 setjmp.h
|
||||
lseek libc/sys/syscall.c C 2 unistd.h
|
||||
lstat libc/sys/trap.asm C 2 sys/stat.h
|
||||
|
@ -167,7 +239,8 @@ mkstemp libc/stdio/mktemp.c C 3 unistd.h
|
|||
mktemp libc/stdio/mktemp.c C 3 unistd.h
|
||||
open libc/sys/syscall.c C 2 sys/fcntl.h
|
||||
opendir libc/gen/dirent.c T 3 dirent.h
|
||||
openlog libc/gen/syslog.asm C 3 sys/syslog.h
|
||||
openlog libc/gen/syslog.c C 3 sys/syslog.h
|
||||
openpty [A] libutil/pty.c libutil.h
|
||||
optarg [var] libc/stdlib/getopt.c C 3 stdlib.h
|
||||
opterr [var] libc/stdlib/getopt.c C 3 stdlib.h
|
||||
optind [var] libc/stdlib/getopt.c C 3 stdlib.h
|
||||
|
@ -185,29 +258,47 @@ pipe libc/sys/trap.asm C 2 unistd.h
|
|||
popen libc/gen/popen.c C 3 stdio.h
|
||||
preceive libc/sys/trap.asm C 2 sys/ports.h
|
||||
preset libc/sys/trap.asm C 2 sys/ports.h
|
||||
printf libc/stdio/printf.c C 3 stdio.h
|
||||
procreceive libc/sys/trap.asm C 2 gno/gno.h
|
||||
procrecvclr libc/sys/trap.asm C 2 gno/gno.h
|
||||
procrecvtim libc/sys/trap.asm C 2 gno/gno.h
|
||||
procsend libc/sys/trap.asm C 2 gno/gno.h
|
||||
psend libc/sys/trap.asm C 2 sys/ports.h
|
||||
psignal libc/gen/psignal.c R 3 signal.h
|
||||
putc libc/stdio/putc.c C 3 stdio.h
|
||||
putchar libc/stdio/putchar.c C 3 stdio.h
|
||||
putenv libc/gen/environ.c T 3 stdlib.h
|
||||
puts libc/stdio/puts.c C 3 stdio.h
|
||||
putw libc/stdio/putw.c C 3 stdio.h
|
||||
raise libc/sys/syscall.c C 3 signal.h
|
||||
read libc/sys/syscall.c C 2 unistd.h
|
||||
readdir libc/gen/dirent.c T 3 dirent.h
|
||||
readv libc/sys/syscall.c C 2 sys/uio.h
|
||||
recv libc/sys/trap.asm C 2 sys/socket.h
|
||||
recvfrom libc/sys/trap.asm C 2 sys/socket.h
|
||||
recvmsg ( missing from kernel ) 2 sys/socket.h
|
||||
regcomp libc/regex/regcomp.c T 3 regex.h
|
||||
regerror libc/regex/regerror.c T 3 regex.h
|
||||
regexec libc/regex/regexec.c T 3 regex.h
|
||||
regfree libc/regex/regfree.c T 3 regex.h
|
||||
remove libc/stdio/remove.c C 3 stdio.h
|
||||
rename libc/sys/syscall.c T 2 stdio.h
|
||||
rewind libc/stdio/rewind.c T(1) 3 stdio.h
|
||||
rewinddir libc/gen/dirent.c T 3 dirent.h
|
||||
rindex libc/string/str.c C 3 string.h
|
||||
rmdir libc/sys/syscall.c T 2 unistd.h
|
||||
scandir libc/gen/scandir.c T 3 dirent.h
|
||||
scanf libc/stdio/scanf.c C 3 stdio.h
|
||||
scount libc/sys/trap.asm C 2 gno/gno.h
|
||||
screate libc/sys/trap.asm C 2 gno/gno.h
|
||||
screate libc/sys/trap.asm T 2 gno/gno.h
|
||||
sdelete libc/sys/trap.asm C 2 gno/gno.h
|
||||
seekdir libc/gen/dirent.c T 3 dirent.h
|
||||
select libc/sys/trap.asm C 2 unistd.h
|
||||
send libc/sys/trap.asm C 2 sys/socket.h
|
||||
sendmsg ( missing from kernel ) 2 sys/socket.h
|
||||
sendto libc/sys/trap.asm C 2 sys/socket.h
|
||||
setbuf libc/stdio/setbuf.c C 3 stdio.h
|
||||
setbuffer libc/stdio/setbuffer.c C 3 stdio.h
|
||||
setegid libc/sys/trap.asm C 2 unistd.h
|
||||
setenv libc/gen/environ.c T 3 stdlib.h
|
||||
seteuid libc/sys/trap.asm C 2 unistd.h
|
||||
|
@ -217,10 +308,14 @@ setgroupent libc/gen/getgrent.c T 3 grp.h
|
|||
sethostname libc/gen/hostname.c C 3 unistd.h
|
||||
setjmp libc/gen/setjmp.asm C 3 setjmp.h
|
||||
setkey libc/gen/crypt.c C 3 unistd.h
|
||||
setlogmask libc/gen/syslog.asm C 3 sys/syslog.h
|
||||
setlinebuf libc/stdio/setbuffer.c C 3 stdio.h
|
||||
setlocale (locale.h)
|
||||
setlogin libc/gen/getlogin.c T 2 unistd.h
|
||||
setlogmask libc/gen/syslog.c C 3 sys/syslog.h
|
||||
setpassent libc/gen/getpwent.c 3 pwd.h
|
||||
setpgid libc/sys/trap.asm C 2 unistd.h
|
||||
setpgrp libc/sys/trap.asm C 2 unistd.h
|
||||
setproctitle [A] libutil/setproc.c libutil.h
|
||||
setpwent libc/gen/getpwent.c T 3 pwd.h
|
||||
setregid libc/sys/trap.asm C 2 unistd.h
|
||||
setreuid libc/sys/trap.asm C 2 unistd.h
|
||||
|
@ -230,17 +325,22 @@ setsockopt libc/sys/trap.asm C 2 sys/socket.h
|
|||
settimeofday 2 sys/time.h
|
||||
setttyent libc/gen/getttyent.c C 3 ttyent.h
|
||||
setuid libc/sys/trap.asm C 2 unistd.h
|
||||
setvbuf libc/stdio/setvbuf.c C 3 stdio.h
|
||||
shutdown libc/sys/trap.asm C 2 sys/socket.h
|
||||
sigblock libc/sys/trap.asm C 2 signal.h
|
||||
siglongjmp 3 setjmp.h
|
||||
sigmask (macro) C 2 sys/signal.h
|
||||
signal libc/sys/trap.asm C 2 sys/signal.h
|
||||
sigpause libc/sys/trap.asm C 2 signal.h
|
||||
sigprocmask libc/sys/syscall.c signal.h
|
||||
sigsetjmp 3 setjmp.h
|
||||
sigsetmask libc/sys/trap.asm C 2 signal.h
|
||||
sleep libc/gen/sleep.c T 3 unistd.h
|
||||
snprintf libc/stdio/snprintf.c C 3 stdio.h
|
||||
socket libc/sys/trap.asm C 2 sys/socket.h
|
||||
ssignal libc/sys/trap.asm C 2 gno/gno.h
|
||||
sprintf libc/stdio/sprintf.c C 3 stdio.h
|
||||
sscanf libc/stdio/sscanf.c C 3 stdio.h
|
||||
ssignal libc/sys/trap.asm T 2 gno/gno.h
|
||||
stat libc/sys/trap.asm C 2 sys/stat.h
|
||||
statfs libc/sys/syscall.c C 2 sys/mount.h
|
||||
strcasecmp libc/str/case.c T 3 string.h
|
||||
|
@ -252,28 +352,41 @@ strncasecmp libc/str/case.c C 3 string.h
|
|||
strsep libc/string/str.c C 3 string.h
|
||||
stty libc/gen/compat.c C 3 sgtty.h
|
||||
suboptarg [var] libc/stdlib/getsubopt.c C 3 stdlib.h
|
||||
swait libc/sys/trap.asm C 2 gno/gno.h
|
||||
sys_errlist @@ [var] libc/stdio/perror.c T 3 stdio.h
|
||||
sys_nerr @@ [var] libc/stdio/perror.c T 3 stdio.h
|
||||
syslog libc/gen/syslog.asm C 3 sys/syslog.h
|
||||
swab libc/string/swab.c C 3 string.h
|
||||
swait libc/sys/trap.asm T 2 gno/gno.h
|
||||
sys_errlist [var] libc/stdio/perror.c T 3 stdio.h
|
||||
sys_nerr [var] libc/stdio/perror.c T 3 stdio.h
|
||||
sys_siglist [var] libc/gen/siglist.c R 3 signal.h
|
||||
sys_signame [var] libc/gen/siglist.c R 3 signal.h
|
||||
syslog libc/gen/syslog.c C 3 sys/syslog.h
|
||||
telldir libc/gen/dirent.c T 3 dirent.h
|
||||
tempnam libc/stdio/tempnam.c C 3 stdio.h
|
||||
times libc/sys/trap.asm C 2 sys/times.h
|
||||
tmpfile orcalib/stdio.asm T 3 stdio.h
|
||||
tmpnam orcalib/stdio.asm T 3 stdio.h
|
||||
tmpfile libc/stdio/tmpfile.c T(1) 3 stdio.h
|
||||
tmpnam libc/stdio/tmpnam.c C 3 stdio.h
|
||||
truncate libc/sys/syscall.c C 2 unistd.h
|
||||
ttyname libc/gen/tty.c C 3 unistd.h
|
||||
ttyslot libc/gen/tty.c C 3 unistd.h
|
||||
umask libc/sys/syscall.c C 2 sys/stat.h
|
||||
ungetc libc/stdio/ungetc.c C 3 stdio.h
|
||||
unlink libc/sys/syscall.c T 2 unistd.h
|
||||
unsetenv libc/gen/environ.c T 3 stdlib.h
|
||||
unvis libc/gen/unvis.c C 3 vis.h
|
||||
user_from_uid libc/gen/pwcache.c C 3 na
|
||||
utime libc/gen/utime.c T 3 sys/time.h
|
||||
utimes libc/gen/utime.c T 2 utime.h
|
||||
verr libc/gen/err.c T 3 err.h
|
||||
verrx libc/gen/err.c T 3 err.h
|
||||
vfork libc/sys/trap.asm C 2 unistd.h
|
||||
vsyslog libc/gen/syslog.asm C 3 sys/syslog.h
|
||||
vfprintf libc/stdio/vfprintf.c C 3 stdio.h
|
||||
vfscanf libc/stdio/vfscanf.c C 3 stdio.h
|
||||
vis libc/gen/vis.c C 3 vis.h
|
||||
vprintf libc/stdio/vprintf.c C 3 stdio.h
|
||||
vscanf libc/stdio/fscanf.c C 3 stdio.h
|
||||
vsnprintf libc/stdio/vsnprintf.c C 3 stdio.h
|
||||
vsprintf libc/stdio/vsprintf.c C 3 stdio.h
|
||||
vsscanf libc/stdio/vsscanf.c C 3 stdio.h
|
||||
vsyslog libc/gen/syslog.c C 3 sys/syslog.h
|
||||
vwarn libc/gen/err.c T 3 err.h
|
||||
vwarnx libc/gen/err.c T 3 err.h
|
||||
wait libc/sys/trap.asm C 2 sys/wait.h
|
||||
|
@ -283,102 +396,232 @@ waitpid libc/sys/syscall.c C 2 sys/wait.h
|
|||
warn libc/gen/err.c T 3 err.h
|
||||
warnx libc/gen/err.c T 3 err.h
|
||||
write libc/sys/syscall.c C 2 unistd.h
|
||||
writev libc/sys/syscall.c T 2 sys/uio.h
|
||||
zopen libc/stdio/ stdio.h
|
||||
|
||||
login libutil/login.c C libutil.h
|
||||
login_tty libutil/logintty.c C libutil.h
|
||||
Notes:
|
||||
[var] symbol is a variable, not a function
|
||||
[A] function needs to be modified before use
|
||||
[B] these sets of routines rely on a modified utmp/wtmp file
|
||||
structure. Therefore a large list of routines and programs
|
||||
have to be updated all at once (see the TO.DO file).
|
||||
[C] logwtmp() is a stub at the moment. It can be called, but
|
||||
will not modify the utmp/wtmp files.
|
||||
|
||||
@@ -- The sys_errlist and sys_nerr variables are currently renamed
|
||||
to _gno_sys_errlist and _gno_sys_nerr until problems with OrcaLib
|
||||
can be resolved. _Don't_ access any of these four variables
|
||||
directly; go through strerror().
|
||||
Library Sources Currently Compiling:
|
||||
-----------------------------------
|
||||
|
||||
Files Currently Compiling:
|
||||
-------------------------
|
||||
- This list is exclusive of modified or standard ORCA libraries
|
||||
- Where the filename appears with no other information, the
|
||||
file is present but not yet part of the build.
|
||||
|
||||
DATA OPTIMIZE DEBUG MEMORY SEGMENT TESTING NAME
|
||||
BANK MODEL COMPLETE
|
||||
==============================================================
|
||||
0 0 0 Y Y libc/gen/basename.c
|
||||
0 0 0 Y N libc/gen/bmem.c
|
||||
0 0 0 Y N libc/gen/compat.c
|
||||
0 0 0 N N libc/gen/crypt.c
|
||||
78 0 0 Y Y libc/gen/basename.c
|
||||
78 0 0 Y N libc/gen/bmem.c
|
||||
78 0 0 Y N libc/gen/compat.c
|
||||
78 0 0 N N libc/gen/crypt.c
|
||||
na na N N libc/gen/crypta.asm
|
||||
0 0 0 Y Y libc/gen/dirent.c
|
||||
78 0 0 Y Y libc/gen/dirent.c
|
||||
8 0 0 Y Y libc/gen/err.c
|
||||
0 0 0 Y Y libc/gen/fnmatch.c
|
||||
0 0 0 Y Y libc/gen/getcwd.c
|
||||
0 0 0 Y Y libc/gen/getgrent.c
|
||||
0 0 0 Y N libc/gen/getpass.c
|
||||
0 0 0 Y Y libc/gen/getpwent.c
|
||||
0 0 0 Y N libc/gen/getttyent.c
|
||||
0 0 0 Y N libc/gen/hostname.c
|
||||
0 0 0 Y N libc/gen/oldlog.c
|
||||
0 0 0 Y N libc/gen/popen.c
|
||||
0 0 0 Y N libc/gen/pwcache.c
|
||||
0 0 0 Y Y libc/gen/scandir.c
|
||||
78 0 0 Y Y libc/gen/fnmatch.c
|
||||
78 0 0 Y Y libc/gen/fts.c
|
||||
78 0 0 Y Y libc/gen/getcwd.c
|
||||
78 0 0 Y Y libc/gen/getgrent.c
|
||||
78 0 0 Y N libc/gen/getlogin.c
|
||||
78 0 0 Y N libc/gen/getpass.c
|
||||
78 0 0 Y Y libc/gen/getpwent.c
|
||||
78 0 0 Y N libc/gen/getttyent.c
|
||||
78 0 0 Y N libc/gen/hostname.c
|
||||
78 0 0 Y N libc/gen/oldlog.c
|
||||
78 0 0 Y N libc/gen/popen.c
|
||||
78 0 0 Y N libc/gen/psignal.c
|
||||
78 0 0 Y N libc/gen/pwcache.c
|
||||
78 0 0 Y Y libc/gen/scandir.c
|
||||
na na N N libc/gen/setjmp.asm
|
||||
0 0 0 Y Y libc/gen/sleep.c
|
||||
na na Y N libc/gen/syslog.asm
|
||||
0 0 0 Y N libc/gen/tty.c
|
||||
0 0 0 Y Y libc/gen/utime.c
|
||||
78 0 0 Y N libc/gen/siglist.c
|
||||
78 0 0 Y Y libc/gen/sleep.c
|
||||
78 0 0 Y N libc/gen/syslog.c
|
||||
na na Y N libc/gen/syslog2.asm [superceded by syslog.c]
|
||||
78 0 0 Y N libc/gen/tty.c
|
||||
78 0 0 Y Y libc/gen/utime.c
|
||||
-1 0 0 Y N libc/gen/vis.c
|
||||
|
||||
na na N N libc/gno/gnocmd.asm
|
||||
0* 0 0 (1) Y Y libc/gno/gnomisc.c
|
||||
0 (79) 0 0 (1) Y Y libc/gno/gsstring.c
|
||||
0 0 (25) 0 (1) Y N libc/gno/map.c
|
||||
78 0 0 (1) Y Y libc/gno/gnomisc.c
|
||||
78 (79) 0 0 (1) Y Y libc/gno/gsstring.c
|
||||
78 0 0 (1) Y N libc/gno/map.c
|
||||
na na N N libc/gno/parsearg.asm
|
||||
na na Y Y libc/gno/stack.asm
|
||||
78 0 0 Y Y libc/gno/stack2.c
|
||||
78 0 1 Y libc/gno/vsprintmt.c
|
||||
|
||||
0 0 0 Y N libc/locale/table.c [stub]
|
||||
78 0 0 Y N libc/locale/table.c [stub]
|
||||
|
||||
0 0 0 Y N libc/stdio/mktemp.c
|
||||
1 0 0 0 Y Y libc/stdio/perror.c
|
||||
0 0 0 Y N libc/stdio/tempnam.c
|
||||
78 0 0 Y N libc/stdio/clrerr.c
|
||||
78 0 0 Y N libc/stdio/fclose.c
|
||||
78 0 0 Y N libc/stdio/fdopen.c
|
||||
78 0 0 Y N libc/stdio/feof.c
|
||||
78 0 0 Y N libc/stdio/ferror.c
|
||||
78 0 0 Y N libc/stdio/fflush.c
|
||||
78 0 0 Y N libc/stdio/fgetc.c
|
||||
78 0 0 Y N libc/stdio/fgetln.c
|
||||
78 0 0 Y N libc/stdio/fgetpos.c
|
||||
78 0 0 Y N libc/stdio/fgets.c
|
||||
78 0 0 Y N libc/stdio/fileno.c
|
||||
78 0 0 Y N libc/stdio/findfp.c
|
||||
78 0 0 Y N libc/stdio/flags.c
|
||||
78 0 0 Y N libc/stdio/fopen.c
|
||||
78 0 0 Y N libc/stdio/fprintf.c
|
||||
78 0 0 Y N libc/stdio/fpurge.c
|
||||
78 0 0 Y N libc/stdio/fputc.c
|
||||
78 0 0 Y N libc/stdio/fputs.c
|
||||
78 0 0 Y N libc/stdio/fread.c
|
||||
78 0 0 Y N libc/stdio/freopen.c
|
||||
78 0 0 Y N libc/stdio/fscanf.c
|
||||
78 0 0 Y N libc/stdio/fseek.c
|
||||
78 0 0 Y N libc/stdio/fsetpos.c
|
||||
78 0 0 Y N libc/stdio/ftell.c
|
||||
78 0 0 Y N libc/stdio/funopen.c
|
||||
78 0 0 Y N libc/stdio/fvwrite.c
|
||||
78 0 0 Y N libc/stdio/fwalk.c
|
||||
78 0 0 Y N libc/stdio/fwrite.c
|
||||
78 0 0 Y N libc/stdio/getc.c
|
||||
78 0 0 Y N libc/stdio/getchar.c
|
||||
78 0 0 Y N libc/stdio/gets.c
|
||||
78 0 0 Y N libc/stdio/getw.c
|
||||
78 0 0 Y N libc/stdio/makebuf.c
|
||||
78 0 0 Y N libc/stdio/mktemp.c
|
||||
78 0 0 Y N libc/stdio/perror.c
|
||||
78 0 0 Y N libc/stdio/printf.c
|
||||
78 0 0 Y N libc/stdio/putc.c
|
||||
78 0 0 Y N libc/stdio/putchar.c
|
||||
78 0 0 Y N libc/stdio/puts.c
|
||||
78 0 0 Y N libc/stdio/putw.c
|
||||
78 0 0 Y N libc/stdio/refill.c
|
||||
78 0 0 Y N libc/stdio/remove.c
|
||||
78 0 0 Y N libc/stdio/rewind.c
|
||||
78 0 0 Y N libc/stdio/rget.c
|
||||
78 0 0 Y N libc/stdio/scanf.c
|
||||
78 0 0 Y N libc/stdio/setbuf.c
|
||||
78 0 0 Y N libc/stdio/setbuffer.c
|
||||
78 0 0 Y N libc/stdio/setvbuf.c
|
||||
78 0 0 Y N libc/stdio/snprintf.c
|
||||
78 0 0 Y N libc/stdio/sprintf.c
|
||||
78 0 0 Y N libc/stdio/sscanf.c
|
||||
78 0 0 Y N libc/stdio/stdio.c
|
||||
78 0 0 Y N libc/stdio/tempnam.c
|
||||
78 0 0 Y N libc/stdio/tmpfile.c
|
||||
78 0 0 Y N libc/stdio/tmpnam.c
|
||||
78 0 0 Y N libc/stdio/ungetc.c
|
||||
78 0 0 Y N libc/stdio/vfprintf.c
|
||||
78 0 0 Y N libc/stdio/vfscanf.c
|
||||
78 0 0 Y N libc/stdio/vprintf.c
|
||||
78 0 0 Y N libc/stdio/vscanf.c
|
||||
78 0 0 Y N libc/stdio/vsnprintf.c
|
||||
78 0 0 Y N libc/stdio/vsprintf.c
|
||||
78 0 0 Y N libc/stdio/vsscanf.c
|
||||
78 0 0 Y N libc/stdio/wbuf.c
|
||||
78 0 0 Y N libc/stdio/wsetup.c
|
||||
|
||||
1 0 0 0 Y Y libc/stdlib/environ.c
|
||||
0 0 0 Y N libc/stdlib/getopt.c
|
||||
0 0 0 Y N libc/stdlib/getsubopt.c
|
||||
78 0 0 Y N libc/stdlib/cvt.c
|
||||
1 78 0 0 Y Y libc/stdlib/environ.c
|
||||
na na Y Y libc/stdlib/fpspecnum.asm
|
||||
78 0 0 Y N libc/stdlib/getopt.c
|
||||
78 0 0 Y N libc/stdlib/getsubopt.c
|
||||
|
||||
0 0 0 Y N libc/string/case.c
|
||||
0 0 0 Y N libc/string/str.c
|
||||
libc/stdtime/asctime.c
|
||||
libc/stdtime/difftime.c
|
||||
libc/stdtime/localtime.c
|
||||
libc/stdtime/strftime.c
|
||||
|
||||
0+8 0 0 Y libc/sys/exec.c
|
||||
0+8 0 0 Y libc/sys/syscall.c
|
||||
78 0 0 Y N libc/string/case.c
|
||||
78 0 0 Y N libc/string/str.c
|
||||
78 0 0 Y Y libc/string/strerror.c
|
||||
78 0 0 Y N libc/string/swab.c
|
||||
|
||||
78 0 0 Y libc/sys/exec.c
|
||||
78 0 0 Y libc/sys/syscall.c
|
||||
na na Y N libc/sys/trap.asm
|
||||
|
||||
0 0 0 Y N libutil/login.c
|
||||
0 0 0 Y N libutil/logintty.c
|
||||
libutil/logout.c
|
||||
0 0 0 Y N libutil/logwtmp.c
|
||||
libutil/pty.c
|
||||
libutil/setproc.c
|
||||
|
||||
NOTES: () tested at a previous level
|
||||
|
||||
|
||||
NEED TO WRITE OR DUPLICATE MAN PAGES FOR
|
||||
----------------------------------------
|
||||
login libc(3)
|
||||
login_tty
|
||||
regexp libc(3)
|
||||
termcap libc(3)
|
||||
queue 3
|
||||
tty 4
|
||||
grp 5
|
||||
passwd 5
|
||||
termcap 5
|
||||
environ 7
|
||||
ms 7
|
||||
man 7
|
||||
cron 8
|
||||
runover 8 (obsolete?)
|
||||
dialup 8
|
||||
These are unimplemented kernel traps.
|
||||
|
||||
PUT IN NEXT RELEASE
|
||||
-------------------
|
||||
fts_children (libc/gen/fts.c) 3
|
||||
fts_close (libc/gen/fts.c) 3
|
||||
fts_open (libc/gen/fts.c) 3
|
||||
fts_read (libc/gen/fts.c) 3
|
||||
fts_set (libc/gen/fts.c) 3
|
||||
chmod (libc/sys/syscall.c) 2
|
||||
fchmod (libc/sys/syscall.c)
|
||||
fcntl (sys/fcntl.h)
|
||||
fdopen
|
||||
sys_siglist [var]
|
||||
kernel trap needed can be implemented comments
|
||||
as a library call
|
||||
===================================================================
|
||||
acct no
|
||||
adjtim low pri yes
|
||||
brk no
|
||||
chflags no
|
||||
chroot no
|
||||
fcntl yes not completely
|
||||
fpathconf not now
|
||||
getdirentries low pri yes
|
||||
getdtablesize yes not completely
|
||||
getfh no
|
||||
getfsstat low pri yes
|
||||
getgroups yes not completely
|
||||
getitimer yes no
|
||||
getlogin yes not completely
|
||||
getpriority low pri no
|
||||
getrlimit no no
|
||||
getrusage low pri no
|
||||
getsockopt yes no
|
||||
gettimeofday low pri yes
|
||||
ktrace not now
|
||||
link no
|
||||
madvise no
|
||||
mincore no
|
||||
mkfifo yes no
|
||||
mknod no
|
||||
mlock no
|
||||
mmap no
|
||||
mount not now a dynamic namespace facility?
|
||||
mprotect no
|
||||
msync no
|
||||
munlock no
|
||||
munmap no
|
||||
nfssvc not now
|
||||
pathconf not now
|
||||
profil no
|
||||
ptrace not now
|
||||
readlink not now symlinks
|
||||
revoke no
|
||||
rtprio no
|
||||
semctl low pri
|
||||
semget low pri
|
||||
semop low pri
|
||||
setgroups yes not completely
|
||||
setitimer yes no
|
||||
setlogin yes not completely
|
||||
setpriority low pri no
|
||||
setrlimit no no
|
||||
setsid low pri maybe
|
||||
settimeofday low pri yes I've got code from Tilghman
|
||||
shmat not now maybe shared mem
|
||||
shmctl not now maybe shared mem
|
||||
shmdt not now maybe shared mem
|
||||
shmget not now maybe shared mem
|
||||
sigaction low pri (?) maybe
|
||||
sigalstack no
|
||||
sigpending low pri no
|
||||
sigreturn no
|
||||
sigstack no
|
||||
sigsuspend no
|
||||
socketpair low pri
|
||||
swapon no
|
||||
symlink not now no symlinks
|
||||
sync low pri not completely
|
||||
syscall no
|
||||
umask low pri unclear semantics
|
||||
|
|
194
NOTES/status.usrman
Normal file
194
NOTES/status.usrman
Normal file
|
@ -0,0 +1,194 @@
|
|||
#
|
||||
# $Id: status.usrman,v 1.1 1999/01/09 21:28:35 gdr-ftp Exp $
|
||||
#
|
||||
# This file shows a listing of all the man pages in /src/gno/usr.man
|
||||
# and what their status is. The formatting should be checked on both
|
||||
# a linux machine (that being what creates the online version of the
|
||||
# documentation, and under GNO on the GS using nroff.
|
||||
#
|
||||
# In each of the fields, the following characters have the following
|
||||
# meanings:
|
||||
# 'y' means that the condition has been checked and found to
|
||||
# be satisfactory.
|
||||
# 'n' means that something is known to be wrong with meeting
|
||||
# the condition, and it has not yet been fixed. There
|
||||
# shouldn't be many if any of these; problems should be
|
||||
# fixed as they are located.
|
||||
# '.' is a space holder to ease in the translation of this file
|
||||
# to HTML format, and indicates a condition that has not yet
|
||||
# been checked.
|
||||
# '-' in the mkso column indicates that no mkso entries are
|
||||
# needed for this particular man page (ie: that the column
|
||||
# is irrelevent).
|
||||
#
|
||||
# Verifying the man page can be done on both machines using the following
|
||||
# command:
|
||||
# nroff -man filename | more
|
||||
#
|
||||
# This file can be checked for consistency with the update.usrman script
|
||||
# in the /src/gno/NOTES directory.
|
||||
#
|
||||
# Devin Reade, April 1998.
|
||||
#
|
||||
### Do not remove this line. ###
|
||||
#
|
||||
# formatting formatting mkso entries
|
||||
# man page checked (linux) checked (IIgs) exist
|
||||
# ----------------------------------------------------------------
|
||||
man1/intro.1 . y -
|
||||
man2/accept.2 . y -
|
||||
man2/access.2 . y -
|
||||
man2/alarm.2 . y y
|
||||
man2/bind.2 . y -
|
||||
man2/chdir.2 . y y
|
||||
man2/chmod.2 . y y
|
||||
man2/close.2 . y -
|
||||
man2/connect.2 . y -
|
||||
man2/creat.2 . y -
|
||||
man2/dup.2 . y y
|
||||
man2/execve.2 . y y
|
||||
man2/fcntl.2 . . .
|
||||
man2/fork.2 . y y
|
||||
man2/fsync.2 . y -
|
||||
man2/getdtablesize.2 . y -
|
||||
man2/getgid.2 . y y
|
||||
man2/getlogin.2 . . .
|
||||
man2/getpeername.2 . y -
|
||||
man2/getpgrp.2 . y y
|
||||
man2/getpid.2 . y y
|
||||
man2/getsockname.2 . . .
|
||||
man2/getsockopt.2 . . .
|
||||
man2/gettimeofday.2 . . .
|
||||
man2/getuid.2 . . .
|
||||
man2/intro.2 . . -
|
||||
man2/ioctl.2 . . .
|
||||
man2/jobcontrol.2 . . .
|
||||
man2/kernStatus.2 . . .
|
||||
man2/kill.2 . . .
|
||||
man2/listen.2 . . .
|
||||
man2/lseek.2 . . .
|
||||
man2/mkdir.2 . . .
|
||||
man2/open.2 . . .
|
||||
man2/pipe.2 . . .
|
||||
man2/ports.2 . . .
|
||||
man2/procsend.2 . . .
|
||||
man2/read.2 . . .
|
||||
man2/recv.2 . . .
|
||||
man2/rename.2 . . .
|
||||
man2/rmdir.2 . . .
|
||||
man2/select.2 . . .
|
||||
man2/semaphore.2 . . .
|
||||
man2/send.2 . . .
|
||||
man2/setdebug.2 . . .
|
||||
man2/setpgid.2 . . .
|
||||
man2/setregid.2 . . .
|
||||
man2/setreuid.2 . . .
|
||||
man2/setruid.2 . . .
|
||||
man2/setuid.2 . . .
|
||||
man2/shutdown.2 . . .
|
||||
man2/sigblock.2 . . .
|
||||
man2/signal.2 . . .
|
||||
man2/sigpause.2 . . .
|
||||
man2/sigsetmask.2 . . .
|
||||
man2/socket.2 . . .
|
||||
man2/stat.2 . . .
|
||||
man2/statfs.2 . . .
|
||||
man2/times.2 . . .
|
||||
man2/truncate.2 . . .
|
||||
man2/umask.2 . . .
|
||||
man2/undocumented.2 . . .
|
||||
man2/unlink.2 . . .
|
||||
man2/utimes.2 . . .
|
||||
man2/wait.2 . . .
|
||||
man2/write.2 . . .
|
||||
man3/GSString.3 . . .
|
||||
man3/basename.3 . . .
|
||||
man3/bcopy.3 . . .
|
||||
man3/buildCmd.3 . . .
|
||||
man3/buildEnv.3 . . .
|
||||
man3/buildPath.3 . . .
|
||||
man3/bzero.3 . . .
|
||||
man3/clearerr.3 . . .
|
||||
man3/crypt.3 . . .
|
||||
man3/directory.3 . . .
|
||||
man3/ecvt.3 . . .
|
||||
man3/err.3 . . .
|
||||
man3/exec.3 . . .
|
||||
man3/execl.3 . . .
|
||||
man3/exit.3 . . .
|
||||
man3/fclose.3 . . .
|
||||
man3/fflush.3 . . .
|
||||
man3/fgetln.3 . . .
|
||||
man3/fgets.3 . . .
|
||||
man3/fnmatch.3 . . .
|
||||
man3/fopen.3 . y .
|
||||
man3/fputs.3 . . .
|
||||
man3/fread.3 . . .
|
||||
man3/fseek.3 . . .
|
||||
man3/fsettext.3 . . .
|
||||
man3/fts.3 . . .
|
||||
man3/funopen.3 . . .
|
||||
man3/getc.3 . . .
|
||||
man3/getcwd.3 . . .
|
||||
man3/getenv.3 . . .
|
||||
man3/getgrent.3 . . .
|
||||
man3/gethostname.3 . . .
|
||||
man3/getopt.3 . . .
|
||||
man3/getpass.3 . . .
|
||||
man3/getpwent.3 . . .
|
||||
man3/getsubopt.3 . . .
|
||||
man3/getttyent.3 . . .
|
||||
man3/index.3 . . .
|
||||
man3/intro.3 . . -
|
||||
man3/isRootPath.3 . . .
|
||||
man3/isblank.3 . . .
|
||||
man3/isinf.3 . . .
|
||||
man3/mapErr.3 . . .
|
||||
man3/mapMode.3 . . .
|
||||
man3/mapPath.3 . . .
|
||||
man3/mktemp.3 . . .
|
||||
man3/needsgno.3 . . .
|
||||
man3/parsearg.3 . . .
|
||||
man3/pause.3 . . .
|
||||
man3/popen.3 . . .
|
||||
man3/printf.3 . . .
|
||||
man3/progname.3 . . .
|
||||
man3/psignal.3 . . .
|
||||
man3/putc.3 . . .
|
||||
man3/pwcache.3 . . .
|
||||
man3/queue.3 . . .
|
||||
man3/raise.3 . . .
|
||||
man3/regex.3 . . .
|
||||
man3/remove.3 . . .
|
||||
man3/scandir.3 . . .
|
||||
man3/scanf.3 . . .
|
||||
man3/setbuf.3 . . .
|
||||
man3/setjmp.3 . . .
|
||||
man3/sleep.3 . . .
|
||||
man3/sprintmt.3 . . .
|
||||
man3/stack.3 . . .
|
||||
man3/stdio.3 . . .
|
||||
man3/strcasecmp.3 . . .
|
||||
man3/strdup.3 . . .
|
||||
man3/strerror.3 . . .
|
||||
man3/strsep.3 . . .
|
||||
man3/stty.3 . . .
|
||||
man3/syslog.3 . . .
|
||||
man3/tmpnam.3 . . .
|
||||
man3/ttyname.3 . . .
|
||||
man3/uname.3 . . .
|
||||
man3/ungetc.3 . . .
|
||||
man3/unvis.3 . . .
|
||||
man3/utime.3 . . .
|
||||
man3/vis.3 . . .
|
||||
man4/intro.4 . . -
|
||||
man4/tty.4 . . .
|
||||
man5/intro.5 . . -
|
||||
man5/utmp.5 . . .
|
||||
man6/intro.6 . . -
|
||||
man7/environ.7 . . .
|
||||
man7/intro.7 . . -
|
||||
man7/re.format.7 . . .
|
||||
man8/init.8 . . .
|
||||
man8/intro.8 . . -
|
||||
man8/syslogd.8 . . .
|
72
NOTES/update.usrman
Executable file
72
NOTES/update.usrman
Executable file
|
@ -0,0 +1,72 @@
|
|||
#! /usr/bin/perl
|
||||
#
|
||||
# This script is used to verify that the status.usrman file is current,
|
||||
# at least with respect to which manpages are checked into the src/gno/usr.man
|
||||
# directory hierarchy.
|
||||
#
|
||||
# Usage: update.usrman < status.usrman > output
|
||||
#
|
||||
# In other words, it doesn't update the status.usrman file directly; the
|
||||
# output file would then have to be copied back to the original name, assuming
|
||||
# that it is satisfactory.
|
||||
|
||||
#
|
||||
# Read the input file for existing entries. Don't modify these.
|
||||
#
|
||||
while (<>) {
|
||||
chomp;
|
||||
if (m,^(man\S+)(.*),) {
|
||||
$entries{$1} = $2;
|
||||
} else {
|
||||
$header .= $_ . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Now get the list of checked in files. We do this by parsing the CVS/Entries
|
||||
# files directly.
|
||||
#
|
||||
|
||||
@chapters = ( '1', '2', '3', '4', '5', '6', '7', '8' );
|
||||
foreach $c (@chapters) {
|
||||
|
||||
$file = "../usr.man/man$c/CVS/Entries";
|
||||
open(fp, "< $file") || die("couldn't open $file: $!");
|
||||
while (<fp>) {
|
||||
if (m,^/([^/]+\.$c)/,) {
|
||||
$page = "man$c/$1";
|
||||
$cvs{$page} = '';
|
||||
}
|
||||
}
|
||||
close(fp);
|
||||
}
|
||||
|
||||
#
|
||||
# Do some conchecks
|
||||
#
|
||||
@keylist_old = sort(keys(%entries));
|
||||
for $k (@keylist_old) {
|
||||
defined($cvs{$k}) ||
|
||||
printf(stderr "Warning: page in input file but not checked in: %s\n",
|
||||
$k);
|
||||
}
|
||||
|
||||
#
|
||||
# Do some updates
|
||||
#
|
||||
@keylist_new = sort(keys(%cvs));
|
||||
for $k (@keylist_new) {
|
||||
defined($entries{$k}) || ($entries{$k} = "\t\t.\t\t.\t\t.");
|
||||
}
|
||||
|
||||
#
|
||||
# Now print out the result.
|
||||
#
|
||||
print $header;
|
||||
@keylist = sort(keys(%entries));
|
||||
foreach $k (@keylist) {
|
||||
if ($entries{$k} =~ m,^\s*$,) {
|
||||
$entries{$k} = "\t\t.\t\t.\t\t.";
|
||||
}
|
||||
printf("%s%s\n", $k, $entries{$k});
|
||||
}
|
349
ainclude/m16.gno
Executable file
349
ainclude/m16.gno
Executable file
|
@ -0,0 +1,349 @@
|
|||
*************************************************************************
|
||||
*
|
||||
* GNO/ME system call macros for Orca/M.
|
||||
* Copyright (C) 1991-1998 by Procyon, Inc.
|
||||
*
|
||||
* $Id: m16.gno,v 1.1 1998/03/08 17:18:11 gdr-ftp Exp $
|
||||
*
|
||||
*************************************************************************
|
||||
|
||||
;
|
||||
; assembly mutual exclusion macros
|
||||
;
|
||||
MACRO
|
||||
&lab lock &a1
|
||||
&lab lda #1
|
||||
tsb &a1
|
||||
beq *+6
|
||||
cop $7F
|
||||
bra *-7
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab unlock &a1
|
||||
&lab stz &a1
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab key
|
||||
&lab dc i2'0'
|
||||
MEND
|
||||
;
|
||||
; GNO system calls
|
||||
;
|
||||
|
||||
MACRO
|
||||
&lab kernVersion &a1
|
||||
&lab pha
|
||||
ldx #$403
|
||||
jsl $E10008
|
||||
pl2 &a1
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab kernStatus &a1
|
||||
&lab pha
|
||||
ldx #$603
|
||||
jsl $E10008
|
||||
pl2 &a1
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab kill &a1
|
||||
&lab ph2 &a1(2)
|
||||
ph2 &a1(1)
|
||||
case on
|
||||
jsl kill
|
||||
case off
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab fork &a1
|
||||
&lab ph4 &a1
|
||||
case on
|
||||
jsl fork
|
||||
case off
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab exec &a1
|
||||
&lab ph4 &a1(2)
|
||||
ph4 &a1(1)
|
||||
case on
|
||||
jsl exec
|
||||
case off
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab swait &a1
|
||||
&lab ph2 &a1
|
||||
case on
|
||||
jsl swait
|
||||
case off
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab ssignal &a1
|
||||
&lab ph2 &a1
|
||||
case on
|
||||
jsl ssignal
|
||||
case off
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab screate &a1
|
||||
&lab ph2 &a1
|
||||
case on
|
||||
jsl screate
|
||||
case off
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab sdelete &a1
|
||||
&lab ph2 &a1
|
||||
case on
|
||||
jsl sdelete
|
||||
case off
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab signal &a1
|
||||
&lab ph4 &a1(2)
|
||||
ph2 &a1(1)
|
||||
case on
|
||||
jsl signal
|
||||
case off
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab wait &a1
|
||||
&lab ph4 &a1
|
||||
case on
|
||||
jsl wait
|
||||
case off
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab tcnewpgrp &a1
|
||||
&lab ph2 &a1
|
||||
case on
|
||||
jsl tcnewpgrp
|
||||
case off
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab settpgrp &a1
|
||||
&lab ph2 &a1
|
||||
case on
|
||||
jsl settpgrp
|
||||
case off
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab tctpgrp &a1
|
||||
&lab ph2 &a1(2)
|
||||
ph2 &a1(1)
|
||||
case on
|
||||
jsl tctpgrp
|
||||
case off
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab sigsetmask &a1
|
||||
&lab ph4 &a1
|
||||
case on
|
||||
jsl sigsetmask
|
||||
case off
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab sigblock &a1
|
||||
&lab ph4 &a1
|
||||
case on
|
||||
jsl sigblock
|
||||
case off
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab execve &a1
|
||||
&lab ph4 &a1(2)
|
||||
ph4 &a1(1)
|
||||
case on
|
||||
jsl execve
|
||||
case off
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab alarm &a1
|
||||
&lab ph4 &a1
|
||||
case on
|
||||
jsl alarm
|
||||
case off
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab setdebug &a1
|
||||
&lab ph2 &a1
|
||||
case on
|
||||
jsl setdebug
|
||||
case off
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab setsystemvector &a1
|
||||
&lab ph4 &a1
|
||||
case on
|
||||
jsl setsystemvector
|
||||
case off
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab sigpause &a1
|
||||
&lab ph4 &a1
|
||||
case on
|
||||
jsl sigpause
|
||||
case off
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab getpid
|
||||
&lab case on
|
||||
jsl getpid
|
||||
case off
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab kvm_open
|
||||
&lab case on
|
||||
jsl kvm_open
|
||||
case off
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab kvm_close &a1
|
||||
&lab ph4 &a1
|
||||
case on
|
||||
jsl kvm_close
|
||||
case off
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab kvmgetproc &a1
|
||||
&lab ph2 &a1(2)
|
||||
ph4 &a1(1)
|
||||
case on
|
||||
jsl kvmgetproc
|
||||
case off
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab kvmnextproc &a1
|
||||
&lab ph4 &a1
|
||||
case on
|
||||
jsl kvmnextproc
|
||||
case off
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab kvmsetproc &a1
|
||||
&lab ph4 &a1
|
||||
case on
|
||||
jsl kvmsetproc
|
||||
case off
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab getpgrp &a1
|
||||
&lab ph2 &a1
|
||||
case on
|
||||
jsl getpgrp
|
||||
case off
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab pipe &a1
|
||||
&lab ph4 &a1
|
||||
case on
|
||||
jsl pipe
|
||||
case off
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab dup2 &a1
|
||||
&lab ph2 &a1(2)
|
||||
ph2 &a1(1)
|
||||
case on
|
||||
jsl dup2
|
||||
case off
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab ioctl &a1
|
||||
&lab ph4 &a1(3)
|
||||
ph4 &a1(2)
|
||||
ph2 &a1(1)
|
||||
case on
|
||||
jsl ioctl
|
||||
case off
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab tgetent &a1
|
||||
&lab ph4 &a1(2)
|
||||
ph4 &a1(1)
|
||||
case on
|
||||
jsl tgetent
|
||||
case off
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab tgetstr &a1
|
||||
&lab ph4 &a1(2)
|
||||
ph4 &a1(1)
|
||||
case on
|
||||
jsl tgetstr
|
||||
case off
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab tgetnum &a1
|
||||
&lab ph4 &a1
|
||||
case on
|
||||
jsl tgetnum
|
||||
case off
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab tgetflag &a1
|
||||
&lab ph4 &a1
|
||||
case on
|
||||
jsl tgetflag
|
||||
case off
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab tgoto &a1
|
||||
&lab ph2 &a1(3)
|
||||
ph2 &a1(2)
|
||||
ph4 &a1(1)
|
||||
case on
|
||||
jsl tgoto
|
||||
case off
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab tputs &a1
|
||||
&lab ph4 &a1(3)
|
||||
ph2 &a1(2)
|
||||
ph4 &a1(1)
|
||||
case on
|
||||
jsl tputs
|
||||
case off
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
&lab getuid
|
||||
&lab case on
|
||||
jsl getuid
|
||||
case off
|
||||
MEND
|
11
bin/aroff/Makefile
Normal file
11
bin/aroff/Makefile
Normal file
|
@ -0,0 +1,11 @@
|
|||
#
|
||||
# $Id: Makefile,v 1.2 1999/01/15 08:36:31 gdr-ftp Exp $
|
||||
#
|
||||
|
||||
PROG = aroff
|
||||
SRCS = aroff.c print.c
|
||||
|
||||
.INCLUDE : /src/gno/prog.mk
|
||||
|
||||
aroff.o:: aroff.h
|
||||
print.o:: aroff.h
|
31
bin/aroff/aroff.1
Normal file
31
bin/aroff/aroff.1
Normal file
|
@ -0,0 +1,31 @@
|
|||
.\"
|
||||
.\" $Id: aroff.1,v 1.1 1999/01/15 08:36:31 gdr-ftp Exp $
|
||||
.\"
|
||||
.TH AROFF 1 "15 January 1998" GNO "Commands and Applications"
|
||||
.SH NAME
|
||||
.BR aroff
|
||||
\- print Appleworks GS formatted manual pages
|
||||
.SH SYNOPSIS
|
||||
.BR aroff
|
||||
.RI [ -b ]
|
||||
.IR filename " ..."
|
||||
.SH DESCRIPTION
|
||||
.BR aroff
|
||||
is used to print out documents that are in Appleworks GS word processor
|
||||
format. It is intended primarily for manual pages that have been so
|
||||
formatted.
|
||||
.LP
|
||||
Early versions of GNO used
|
||||
.BR aroff
|
||||
formatted manual pages. The use of this format has been superceded by
|
||||
.BR nroff (1);
|
||||
.BR aroff
|
||||
should be avoided in new documentation.
|
||||
.SH OPTIONS
|
||||
.IP \fB-b\fR
|
||||
Do not use boldface text.
|
||||
.SH HISTORY
|
||||
.BR aroff
|
||||
appeared in GNO v1.0.
|
||||
.SH SEE ALSO
|
||||
.BR nroff (1).
|
180
bin/aroff/aroff.c
Normal file
180
bin/aroff/aroff.c
Normal file
|
@ -0,0 +1,180 @@
|
|||
/*
|
||||
|
||||
awgs.c
|
||||
|
||||
Main loop driver code and awgs wordproc file read routines
|
||||
|
||||
$Id: aroff.c,v 1.4 1999/01/15 15:46:08 gdr-ftp Exp $
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <gsos.h>
|
||||
#include <shell.h>
|
||||
#include <orca.h>
|
||||
#include <gno/gno.h>
|
||||
#include "aroff.h"
|
||||
|
||||
int noboldflag = 0;
|
||||
saveArray *docSaveArray;
|
||||
Ruler *docRulers;
|
||||
textBlock **docTextBlocks; /* an array of textBlockPtrs */
|
||||
word docSACount, numRulers, numBlocks;
|
||||
|
||||
void fileError(char *s)
|
||||
{
|
||||
int err;
|
||||
int cl[2];
|
||||
|
||||
if (err = toolerror()) {
|
||||
fprintf(stderr,"%s\n",s);
|
||||
ERROR(&err);
|
||||
cl[0] = 1;
|
||||
cl[1] = 0;
|
||||
CloseGS(cl);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
void readAWGS(char *file)
|
||||
{
|
||||
int ref,err,z; /* refnum, err temp, and loop variable */
|
||||
long recBlockSize; /* size of the upcoming text block */
|
||||
int cl[2]; /* pBlock for GS/OS CloseGS call */
|
||||
static GSString255 f; /* converted cstring(file) -> GSString */
|
||||
static OpenRecGS o; /* pBlock for GS/OS Open call */
|
||||
static SetPositionRecGS p;
|
||||
static IORecGS i;
|
||||
|
||||
f.length = strlen(file);
|
||||
strcpy(f.text,file);
|
||||
o.pCount = 7;
|
||||
o.pathname = &f;
|
||||
o.requestAccess = readEnable;
|
||||
o.resourceNumber = 0;
|
||||
OpenGS(&o);
|
||||
if (err = toolerror()) {
|
||||
fprintf(stderr,"aroff: could not open AWGS file %s\n",file);
|
||||
ERROR(&err);
|
||||
exit(1);
|
||||
}
|
||||
ref = o.refNum;
|
||||
if ((o.fileType != 0x50) || (o.auxType != 0x8010l)) {
|
||||
cl[0] = 1;
|
||||
cl[1] = ref;
|
||||
CloseGS(cl);
|
||||
fprintf(stderr,"aroff: file (%s) is not an AWGS file\n",file);
|
||||
exit(1);
|
||||
}
|
||||
p.pCount = 3;
|
||||
p.refNum = ref;
|
||||
p.base = startPlus;
|
||||
p.displacement = 668l;
|
||||
SetMarkGS(&p);
|
||||
fileError("SetMarkGS");
|
||||
|
||||
i.pCount = 4;
|
||||
i.refNum = ref;
|
||||
i.dataBuffer = (void *) &docSACount;
|
||||
i.requestCount = 2l;
|
||||
ReadGS(&i);
|
||||
fileError("ReadGS (docSACount)");
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr,"Number of SaveArray entries: %d\n",docSACount);
|
||||
#endif
|
||||
|
||||
docSaveArray = calloc((size_t) docSACount, sizeof(saveArray));
|
||||
i.dataBuffer = (void *) docSaveArray;
|
||||
i.requestCount = sizeof(saveArray) * docSACount;
|
||||
ReadGS(&i);
|
||||
fileError("ReadGS (docSaveArray)");
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr," saNum textBlock rulerNum\n");
|
||||
fprintf(stderr," ----- --------- --------\n");
|
||||
for (z = 0; z < docSACount; z++) {
|
||||
fprintf(stderr," [%3d] %5d %5d\n",
|
||||
z+1, docSaveArray[z].textBlock,docSaveArray[z].rulerNum);
|
||||
}
|
||||
#endif
|
||||
|
||||
numRulers = numBlocks = 0;
|
||||
for (z = 0; z < docSACount; z++) {
|
||||
if (docSaveArray[z].rulerNum+1 > numRulers) {
|
||||
numRulers = docSaveArray[z].rulerNum+1;
|
||||
}
|
||||
if (docSaveArray[z].textBlock+1 > numBlocks) {
|
||||
numBlocks = docSaveArray[z].textBlock+1;
|
||||
}
|
||||
}
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr,"Number of Rulers: %d\n",numRulers);
|
||||
fprintf(stderr,"Number of Blocks: %d\n",numBlocks);
|
||||
#endif
|
||||
|
||||
docRulers = calloc((size_t) numRulers, sizeof(Ruler));
|
||||
i.dataBuffer = (void *) docRulers;
|
||||
i.requestCount = sizeof(Ruler) * numRulers;
|
||||
ReadGS(&i);
|
||||
fileError("ReadGS (docRulers)");
|
||||
|
||||
docTextBlocks = calloc((size_t) numBlocks, sizeof(textBlockPtr));
|
||||
for (z = 0; z < numBlocks; z++) {
|
||||
i.requestCount = 4l;
|
||||
i.dataBuffer = (void *) &recBlockSize;
|
||||
ReadGS(&i);
|
||||
fileError("ReadGS (recBlockSize)");
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr,"block %d size %8ld : ",z,recBlockSize);
|
||||
#endif
|
||||
docTextBlocks[z] = malloc(recBlockSize);
|
||||
i.requestCount = recBlockSize;
|
||||
i.dataBuffer = (void *) docTextBlocks[z];
|
||||
ReadGS(&i);
|
||||
fileError("ReadGS (textBlock)");
|
||||
}
|
||||
|
||||
cl[0] = 1;
|
||||
cl[1] = ref;
|
||||
CloseGS(cl);
|
||||
}
|
||||
|
||||
void usage(void)
|
||||
{
|
||||
fprintf(stderr,"aroff [-b] file1 [file ...]\n"
|
||||
"-b don't do any boldfacing (useful for GNO Ref. Manuals)\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int i,z;
|
||||
extern void printAWGS(void);
|
||||
|
||||
__REPORT_STACK(); /* show stack usage on exit if __CHECK_STACK__ defined */
|
||||
if (argc == 1) {
|
||||
usage();
|
||||
}
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (*argv[i] == '-') {
|
||||
if (argv[i][1] == 'b') {
|
||||
noboldflag = 1;
|
||||
continue;
|
||||
} else {
|
||||
usage();
|
||||
}
|
||||
}
|
||||
readAWGS(argv[i]);
|
||||
printAWGS();
|
||||
free(docSaveArray);
|
||||
free(docRulers);
|
||||
for (z = 0; z < numBlocks; z++) {
|
||||
free(docTextBlocks[z]);
|
||||
}
|
||||
free(docTextBlocks);
|
||||
}
|
||||
}
|
12
bin/aroff/aroff.desc
Normal file
12
bin/aroff/aroff.desc
Normal file
|
@ -0,0 +1,12 @@
|
|||
Name: aroff
|
||||
Version: 2.0
|
||||
Shell: GNO, ORCA
|
||||
Author: Jawaid Bazyar. Maintained by Devin Reade.
|
||||
Contact: gdr@trenco.gno.org
|
||||
Where: /bin
|
||||
FTP: ftp.gno.org
|
||||
|
||||
Aroff (Apple ROFF) prints out documents that are in Appleworks GS word
|
||||
processor format. It is intended primarily for use with manual pages that
|
||||
have been so formatted. New manual pages should be written for nroff rather
|
||||
than for aroff.
|
57
bin/aroff/aroff.h
Normal file
57
bin/aroff/aroff.h
Normal file
|
@ -0,0 +1,57 @@
|
|||
/*
|
||||
This file contains the data structures that are
|
||||
used in AWGS Word Processor files.
|
||||
|
||||
Data structures gleaned from DTS File Type Note TN.50.8010
|
||||
*/
|
||||
|
||||
/* #define DEBUG */
|
||||
|
||||
typedef struct pgraph {
|
||||
word firstFont;
|
||||
byte firstStyle;
|
||||
byte firstSize;
|
||||
byte firstColor;
|
||||
word reserved;
|
||||
} pgraph, *pgraphPtr;
|
||||
|
||||
typedef struct textBlock {
|
||||
word blockSize;
|
||||
word blockUsed;
|
||||
pgraphPtr pgraphs;
|
||||
} textBlock, *textBlockPtr;
|
||||
|
||||
typedef struct tabRec {
|
||||
word tabLocation;
|
||||
word tabType;
|
||||
} tabRec, *tabRecPtr;
|
||||
|
||||
#define rsFULL 0x80
|
||||
#define rsRIGHT 0x40
|
||||
#define rsCENTER 0x20
|
||||
#define rsLEFT 0x10
|
||||
#define rsNOBREAK 0x08
|
||||
#define rsTRIPLE 0x04
|
||||
#define rsDOUBLE 0x02
|
||||
#define rsSINGLE 0x01
|
||||
|
||||
typedef struct Ruler {
|
||||
word numParagraphs;
|
||||
word statusBits;
|
||||
word leftMargin;
|
||||
word indentMargin;
|
||||
word rightMargin;
|
||||
word numTabs;
|
||||
tabRec tabRecs[10];
|
||||
} Ruler, *RulerPtr;
|
||||
|
||||
typedef struct SaveArrEntry {
|
||||
word textBlock; /* Text block number */
|
||||
word offset; /* offset + text block = paragraph */
|
||||
word attributes; /* 0 = normal text, 1 = page break paragrf */
|
||||
word rulerNum; /* #of ruler associated with this paragrf */
|
||||
word pixelHeight; /* height of paragraph in pixels */
|
||||
word numLines; /* # of lines in this paragraph */
|
||||
} saveArray, *saveArrayPtr;
|
||||
|
||||
extern int noboldflag;
|
19
bin/aroff/aroff.rez
Normal file
19
bin/aroff/aroff.rez
Normal file
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* $Id: aroff.rez,v 1.1 1999/01/15 08:36:31 gdr-ftp Exp $
|
||||
*/
|
||||
|
||||
#include "Types.Rez"
|
||||
#include "builddate.rez"
|
||||
|
||||
resource rVersion (0x1, purgeable3, nocrossbank) {
|
||||
|
||||
{ 2, 0, 0, /* version 1.1.0 */
|
||||
release, /* development|alpha|beta|final|release */
|
||||
0 /* non-final release number */
|
||||
},
|
||||
verUS,
|
||||
"aroff",
|
||||
"Apple ROFF.\n"
|
||||
"Print Appleworks GS format manual pages.\n"
|
||||
BUILD_DATE
|
||||
};
|
170
bin/aroff/print.c
Normal file
170
bin/aroff/print.c
Normal file
|
@ -0,0 +1,170 @@
|
|||
/*
|
||||
print.c
|
||||
|
||||
the code that formats each individual paragraph is here.
|
||||
|
||||
$Id: print.c,v 1.3 1999/01/15 15:45:04 gdr-ftp Exp $
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <types.h>
|
||||
#include <texttool.h>
|
||||
#include "aroff.h"
|
||||
|
||||
extern saveArray *docSaveArray;
|
||||
extern Ruler *docRulers;
|
||||
extern textBlock **docTextBlocks; /* an array of textBlockPtrs */
|
||||
extern word docSACount, numRulers, numBlocks;
|
||||
|
||||
/*
|
||||
1 2
|
||||
01234567890123456 7890
|
||||
This is a bloody ^car
|
||||
z = 16;
|
||||
|
||||
This is a bloody
|
||||
^car
|
||||
|
||||
col=4 (width - z - 1)
|
||||
printcol=3
|
||||
*/
|
||||
|
||||
/* 100 lines should be more than enough */
|
||||
char paraBuf[100][80];
|
||||
|
||||
|
||||
/* given a paragraph, and a pointer to it's ruler, format the
|
||||
paragraph according to the ruler. */
|
||||
void printPara(RulerPtr ruler, pgraphPtr pptr)
|
||||
{
|
||||
char *txt;
|
||||
int width,z;
|
||||
int curLine, col, printcol, numctrl;
|
||||
int i,left,style;
|
||||
|
||||
curLine = col = printcol = 0;
|
||||
txt = ((char *)pptr) + sizeof(pgraph);
|
||||
|
||||
calcLine:
|
||||
/* width determines how long this line is in characters; thus, where
|
||||
the break for word wrap will occur */
|
||||
if (curLine == 0) {
|
||||
width = (ruler->rightMargin - ruler->indentMargin)/8;
|
||||
} else {
|
||||
width = (ruler->rightMargin - ruler->leftMargin)/8;
|
||||
}
|
||||
|
||||
while (*txt != 0x0d) {
|
||||
switch (*txt) {
|
||||
case 1: txt+=3; break;
|
||||
case 2:
|
||||
style = *(++txt);
|
||||
if (noboldflag) { /* turn off boldfacing */
|
||||
++txt;
|
||||
break;
|
||||
}
|
||||
if (style & 3) {
|
||||
paraBuf[curLine][col++] = 15;
|
||||
} else {
|
||||
paraBuf[curLine][col++] = 14;
|
||||
}
|
||||
txt++;
|
||||
break;
|
||||
case 3: txt+=2; break;
|
||||
case 4: txt+=2; break;
|
||||
case 5:
|
||||
case 6:
|
||||
case 7: break;
|
||||
|
||||
default:
|
||||
if (printcol == width) {
|
||||
numctrl = 0;
|
||||
for (z = col - 1; z > 0; z--) {
|
||||
if (paraBuf[curLine][z] == ' ') {
|
||||
if (z != col - 1) {
|
||||
memcpy(¶Buf[curLine+1][0],¶Buf[curLine][z+1],
|
||||
(size_t) (col - z - 1));
|
||||
}
|
||||
paraBuf[curLine][z] = 0;
|
||||
curLine++; printcol -= (z + 1 + numctrl);
|
||||
col -= (z + 1);
|
||||
goto calcLine;
|
||||
} else if (paraBuf[curLine][z] < ' ') {
|
||||
numctrl++;
|
||||
}
|
||||
}
|
||||
curLine++; col = printcol = 0;
|
||||
/* one big word... don't break line */
|
||||
goto calcLine;
|
||||
}
|
||||
paraBuf[curLine][col] = *(txt++);
|
||||
printcol++; col++;
|
||||
}
|
||||
}
|
||||
paraBuf[curLine][col] = 0;
|
||||
for (z = 0; z <= curLine; z++) {
|
||||
if (z == 0) {
|
||||
width = (ruler->rightMargin - ruler->indentMargin)/8;
|
||||
left = (ruler->indentMargin)/8;
|
||||
} else {
|
||||
width = (ruler->rightMargin - ruler->leftMargin)/8;
|
||||
left = (ruler->leftMargin)/8;
|
||||
}
|
||||
for (i = 0; i < left; i++) {
|
||||
putchar(' ');
|
||||
}
|
||||
printf("%s\n",paraBuf[z]);
|
||||
}
|
||||
}
|
||||
|
||||
/* this is an obsolete routine that prints a paragraph with no
|
||||
formatting at all */
|
||||
#ifdef NOTDEFINED
|
||||
void printPara(RulerPtr ruler, pgraphPtr pptr)
|
||||
{
|
||||
char *txt;
|
||||
|
||||
txt = ((char *)pptr) + sizeof(pgraph);
|
||||
while (*txt != 0x0D) {
|
||||
switch (*txt) {
|
||||
case 1: txt+=2; break;
|
||||
case 2: txt++; break;
|
||||
case 3: txt++; break;
|
||||
case 4: txt++; break;
|
||||
case 5:
|
||||
case 6:
|
||||
case 7: break;
|
||||
|
||||
default: putchar(*txt);
|
||||
}
|
||||
txt++;
|
||||
}
|
||||
putchar('\n');
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* go through each textBlock, sending each paragraph in turn to printPara. */
|
||||
|
||||
void printAWGS(void)
|
||||
{
|
||||
int z;
|
||||
pgraphPtr pptr;
|
||||
char *txt;
|
||||
char x;
|
||||
|
||||
for (z = 0; z < docSACount; z++) {
|
||||
pptr = (pgraphPtr) (((byte *)docTextBlocks[docSaveArray[z].textBlock])
|
||||
+ docSaveArray[z].offset);
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "[%d] offset %d paragraph : %08lX", z,
|
||||
docSaveArray[z].offset, pptr);
|
||||
fprintf(stderr, " textBlock: %08lX\n",
|
||||
docTextBlocks[docSaveArray[z].textBlock]);
|
||||
#endif
|
||||
printPara(&docRulers[docSaveArray[z].rulerNum],pptr);
|
||||
}
|
||||
}
|
10
bin/binprint/Makefile
Normal file
10
bin/binprint/Makefile
Normal file
|
@ -0,0 +1,10 @@
|
|||
#
|
||||
# $Id: Makefile,v 1.2 1999/01/16 18:35:57 gdr-ftp Exp $
|
||||
#
|
||||
|
||||
PROG = binprint
|
||||
SRCS = binprint.c doline.asm
|
||||
OPTIMIZE= -1
|
||||
|
||||
.INCLUDE : /src/gno/prog.mk
|
||||
|
55
bin/binprint/binprint.1
Normal file
55
bin/binprint/binprint.1
Normal file
|
@ -0,0 +1,55 @@
|
|||
.\"
|
||||
.\" $Id: binprint.1,v 1.1 1999/01/16 18:35:57 gdr-ftp Exp $
|
||||
.\"
|
||||
.TH BINPRINT 1 "15 January 1998" GNO "Commands and Applications"
|
||||
.SH NAME
|
||||
.BR binprint
|
||||
\- print Appleworks GS formatted manual pages
|
||||
.SH SYNOPSIS
|
||||
.BR binprint
|
||||
[
|
||||
.BI -c cols
|
||||
] [
|
||||
.B -V
|
||||
]
|
||||
.RI [ filename "] ..."
|
||||
.SH DESCRIPTION
|
||||
.BR binprint
|
||||
displays files in hex-dump format.
|
||||
.LP
|
||||
For each file,
|
||||
.BR binprint
|
||||
will print out the
|
||||
.IR filename ,
|
||||
followed by one line of output for each 16 bytes of input data.
|
||||
Each line consists of the file offset (in hexadecimal) of the first displayed
|
||||
byte in the line, a colon, up to 16 bytes of data in hexadecimal format,
|
||||
followed by the same 16 bytes shown in ASCII format:
|
||||
.in 0in
|
||||
.nf
|
||||
|
||||
binprint.c
|
||||
0: 2F 2A 20 0D 20 20 20 20 42 49 4E 50 52 49 4E 54 /* . BINPRINT
|
||||
10: 2E 43 0D 0D 20 20 20 20 44 69 73 70 6C 61 79 73 .C.. Displays
|
||||
20: 20 66 69 6C 65 73 20 69 6E 20 68 65 78 2D 64 75 files in hex-du
|
||||
|
||||
.fi
|
||||
.LP
|
||||
Where there is no printable ASCII equivalent of a given byte, a period is
|
||||
printed in its place.
|
||||
.LP
|
||||
If no
|
||||
.IR filename s
|
||||
are given,
|
||||
.BR binprint
|
||||
reads from stdin.
|
||||
.SH OPTIONS
|
||||
.IP "\fB-c\fR \fIcols\fR"
|
||||
Specify the number of columns (one byte per column) to display per line.
|
||||
The default as shown in the example above is 16.
|
||||
Values less than 8 are silently ignored (the default is used).
|
||||
.IP \fB-V\fR
|
||||
Print version number and exit.
|
||||
.SH HISTORY
|
||||
.BR binprint
|
||||
appeared in GNO v2.0.1.
|
107
bin/binprint/binprint.c
Normal file
107
bin/binprint/binprint.c
Normal file
|
@ -0,0 +1,107 @@
|
|||
/*
|
||||
BINPRINT.C
|
||||
|
||||
Displays files in hex-dump format (with ascii subdisplay if desired)
|
||||
|
||||
v1.3 Incorporated sources into GNO base build. Reformatted sources,
|
||||
prototyped functions, added calls to fflush(3). (Devin Reade)
|
||||
v1.2 Optimized and fixed input from terminal bug (Phil Vandry)
|
||||
v1.1 Added stacksize directive (Jawaid Bazyar)
|
||||
v1.0 Original version by Derek Taubert
|
||||
|
||||
$Id: binprint.c,v 1.3 1999/01/16 18:35:57 gdr-ftp Exp $
|
||||
*/
|
||||
|
||||
#define VERSION "1.3"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <gno/gno.h> /* for stack checking routines */
|
||||
|
||||
unsigned int doline(char *dest, char *source, unsigned int actual,
|
||||
unsigned int cols);
|
||||
static void printGood(long off, unsigned char *buf, int real, int form);
|
||||
|
||||
unsigned char *buffer2;
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
int duh;
|
||||
int a;
|
||||
int c, errflg = 0, columns = 16;
|
||||
size_t pos = 0;
|
||||
unsigned char *buffer;
|
||||
|
||||
__REPORT_STACK();
|
||||
while ((c = getopt(argc,argv, "Vc:")) != EOF)
|
||||
switch (c) {
|
||||
case 'c' :
|
||||
columns = atoi(optarg);
|
||||
break;
|
||||
case 'V' :
|
||||
fprintf(stdout, "binprint v%s for GNO/ME\n", VERSION);
|
||||
exit(0);
|
||||
default :
|
||||
errflg++;
|
||||
}
|
||||
if (errflg) {
|
||||
fprintf(stderr,"usage: binprint [-c<columns>] files...\n");
|
||||
exit(2);
|
||||
}
|
||||
argv += optind;
|
||||
if (columns < 8) columns = 8;
|
||||
if ((buffer2 = (unsigned char *)malloc((size_t)(columns*4)+1)) == NULL) {
|
||||
fprintf(stderr,"Cannot allocate buffer space\n");
|
||||
exit(1);
|
||||
}
|
||||
buffer = (unsigned char *)(buffer2+(columns*3));
|
||||
if (optind == argc) {
|
||||
duh = STDIN_FILENO;
|
||||
goto action;
|
||||
}
|
||||
for (;optind<argc;optind++) {
|
||||
if ((duh = open(*argv,O_RDONLY|O_BINARY)) == -1) {
|
||||
fprintf(stderr,"error opening %s\n",*argv);
|
||||
exit(1);
|
||||
}
|
||||
printf("\n%s\n",*argv);
|
||||
fflush(stdout); /* we write to STDOUT_FILENO directly */
|
||||
action:
|
||||
while ((a = (int)read(duh, buffer,
|
||||
(size_t)(columns * sizeof(unsigned char)))) != 0) {
|
||||
printGood(pos,buffer,a,columns);
|
||||
pos += a;
|
||||
}
|
||||
close(duh);
|
||||
}
|
||||
free(buffer);
|
||||
free(buffer2);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
static void
|
||||
printGood(long off, unsigned char *buf, int real, int form)
|
||||
{
|
||||
if (!real) return;
|
||||
#if 0
|
||||
printf("%8lX: ",off);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
|
||||
/* The following is a hack required because of buffering by the stdio
|
||||
libraries. I wish it was not necesary... */
|
||||
|
||||
{
|
||||
static char puthere[11];
|
||||
int howmany;
|
||||
|
||||
howmany = sprintf(puthere,"%8lX: ",off);
|
||||
write(STDOUT_FILENO, puthere, (size_t)howmany);
|
||||
}
|
||||
|
||||
write(STDOUT_FILENO, buffer2, (size_t)doline(buffer2,buf,form,real));
|
||||
}
|
10
bin/binprint/binprint.desc
Normal file
10
bin/binprint/binprint.desc
Normal file
|
@ -0,0 +1,10 @@
|
|||
Name: binprint
|
||||
Version: 1.3
|
||||
Shell: GNO, ORCA
|
||||
Author: Derek Taubert.
|
||||
Contact: taubert@geeks.org
|
||||
Where: /bin
|
||||
FTP: ftp.gno.org
|
||||
|
||||
binprint displays files in hex-dump format. It also provides an ASCII
|
||||
subdisplay if it is so desired.
|
18
bin/binprint/binprint.rez
Normal file
18
bin/binprint/binprint.rez
Normal file
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
* $Id: binprint.rez,v 1.1 1999/01/16 18:35:57 gdr-ftp Exp $
|
||||
*/
|
||||
|
||||
#include "Types.Rez"
|
||||
#include "builddate.rez"
|
||||
|
||||
resource rVersion (0x1, purgeable3, nocrossbank) {
|
||||
|
||||
{ 1, 3, 0, /* version */
|
||||
release, /* development|alpha|beta|final|release */
|
||||
0 /* non-final release number */
|
||||
},
|
||||
verUS,
|
||||
"binprint",
|
||||
"Displays data in hex-dump format.\n"
|
||||
BUILD_DATE
|
||||
};
|
129
bin/binprint/doline.asm
Normal file
129
bin/binprint/doline.asm
Normal file
|
@ -0,0 +1,129 @@
|
|||
*
|
||||
* $Id: doline.asm,v 1.2 1999/01/16 18:35:57 gdr-ftp Exp $
|
||||
*
|
||||
dummy start ; ends up in .root
|
||||
end
|
||||
|
||||
setcom 60
|
||||
|
||||
case on
|
||||
|
||||
doline start
|
||||
pha
|
||||
tsc
|
||||
phd
|
||||
tcd
|
||||
phb
|
||||
phk
|
||||
plb
|
||||
|
||||
counter equ 1
|
||||
RTLs equ 3
|
||||
dest equ 6
|
||||
source equ 10
|
||||
cols equ 14
|
||||
actual equ 16
|
||||
PREVIOUS equ 18
|
||||
|
||||
pei actual
|
||||
stz counter
|
||||
ldy #0
|
||||
loop anop
|
||||
lda [source],y
|
||||
jsr puthex
|
||||
iny
|
||||
dec cols
|
||||
dec actual
|
||||
bne loop
|
||||
ldy counter
|
||||
loop2 lda cols
|
||||
beq done
|
||||
lda #$2020
|
||||
sta [dest],y
|
||||
iny
|
||||
sta [dest],y
|
||||
iny
|
||||
iny
|
||||
dec cols
|
||||
bra loop2
|
||||
|
||||
done anop
|
||||
pla
|
||||
sta actual
|
||||
tya
|
||||
clc
|
||||
inc a
|
||||
adc actual
|
||||
sta counter
|
||||
ldy actual
|
||||
chrloop dey
|
||||
cpy #$ffff
|
||||
beq endloop
|
||||
lda [source],y
|
||||
and #$ff
|
||||
cmp #$7f
|
||||
bcs noprint
|
||||
cmp #$20
|
||||
bcs printable
|
||||
noprint lda #'.'
|
||||
printable sep #$20
|
||||
sta [source],y
|
||||
rep #$20
|
||||
bra chrloop
|
||||
endloop ldy actual
|
||||
dey
|
||||
lda [source],y
|
||||
and #$00ff
|
||||
ora #$0d00
|
||||
sta [source],y
|
||||
|
||||
ldy counter
|
||||
plb
|
||||
lda 4
|
||||
sta PREVIOUS-2
|
||||
lda 3
|
||||
sta PREVIOUS-3
|
||||
pld
|
||||
tsc
|
||||
clc
|
||||
adc #PREVIOUS-4
|
||||
tcs
|
||||
tya
|
||||
rtl
|
||||
end
|
||||
|
||||
puthex private
|
||||
counter equ 1
|
||||
RTLs equ 3
|
||||
dest equ 6
|
||||
source equ 10
|
||||
cols equ 14
|
||||
phy
|
||||
ldy counter
|
||||
pha
|
||||
lsr a
|
||||
lsr a
|
||||
lsr a
|
||||
lsr a
|
||||
and #$f
|
||||
tax
|
||||
lda hexdigits,x
|
||||
sta [<dest],y
|
||||
iny
|
||||
pla
|
||||
and #$f
|
||||
tax
|
||||
lda hexdigits,x
|
||||
and #$00ff
|
||||
ora #$2000
|
||||
sta [<dest],y
|
||||
iny
|
||||
iny
|
||||
sty counter
|
||||
ply
|
||||
rts
|
||||
end
|
||||
|
||||
hexdigits privdata
|
||||
dc c'0123456789ABCDEF'
|
||||
end
|
12
bin/cat/Makefile
Normal file
12
bin/cat/Makefile
Normal file
|
@ -0,0 +1,12 @@
|
|||
#
|
||||
# This makefile is intended for use with dmake(1) on Apple IIGS
|
||||
#
|
||||
# Created by Dave Tribby, July 1997
|
||||
#
|
||||
# $Id: Makefile,v 1.2 1997/09/26 06:15:13 gdr Exp $
|
||||
#
|
||||
|
||||
# Program name
|
||||
PROG= cat
|
||||
|
||||
.INCLUDE : /src/gno/prog.mk
|
117
bin/cat/cat.1
Normal file
117
bin/cat/cat.1
Normal file
|
@ -0,0 +1,117 @@
|
|||
.\" 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. 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.
|
||||
.\"
|
||||
.\" @(#)cat.1 8.3 (Berkeley) 5/2/95
|
||||
.\" $Id: cat.1,v 1.2 1997/10/03 04:00:10 gdr Exp $
|
||||
.\"
|
||||
.TH CAT 1 "August 1997" "GNO" "Commands and Applications"
|
||||
.SH NAME
|
||||
.BR cat
|
||||
\- concatenate and print files
|
||||
.SH SYNOPSIS
|
||||
.BR cat " [" -benstuv ]
|
||||
.IR file \0...
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
.BR cat
|
||||
utility reads files sequentially, writing them to the standard output.
|
||||
The
|
||||
.IR file
|
||||
operands are processed in command line order.
|
||||
A single dash represents the standard input.
|
||||
.LP
|
||||
.SS OPTIONS
|
||||
.IP \fB-b\fR
|
||||
Implies the
|
||||
.B "-n"
|
||||
option but doesn't number blank lines.
|
||||
.IP \fB-e\fR
|
||||
Implies the
|
||||
.B "-v"
|
||||
option, and displays a dollar sign (\fB$\fR)
|
||||
at the end of each line
|
||||
as well.
|
||||
.IP \fB-n\fR
|
||||
Number the output lines, starting at 1.
|
||||
.IP \fB-s\fR
|
||||
Squeeze multiple adjacent empty lines, causing the output to be
|
||||
single spaced.
|
||||
.IP \fB-t\fR
|
||||
Implies the
|
||||
.B -v
|
||||
option, and displays tab characters as
|
||||
.B ^I
|
||||
as well.
|
||||
.IP \fB-u\fR
|
||||
The
|
||||
.B -u
|
||||
option guarantees that the output is unbuffered.
|
||||
.IP \fB-v\fR
|
||||
Displays non-printing characters so they are visible.
|
||||
Control characters print as
|
||||
.B ^X
|
||||
for control-X; the delete
|
||||
character (octal 0177) prints as
|
||||
.B ^?
|
||||
Non-ascii characters (with the high bit set) are printed as
|
||||
.B M-
|
||||
(for meta) followed by the character for the low 7 bits.
|
||||
.RE
|
||||
.LP
|
||||
The
|
||||
.BR cat
|
||||
utility exits 0 on success, and >0 if an error occurs.
|
||||
.SH WARNINGS
|
||||
Because of the shell language mechanism used to perform output
|
||||
redirection, the command
|
||||
.IP
|
||||
.B "cat file1 file2 > file1"
|
||||
.PP
|
||||
will cause the original data in file1 to be destroyed!
|
||||
Instead use
|
||||
.IP
|
||||
.B "cat file2 >> file1"
|
||||
.SH VERSION
|
||||
This manual page documents
|
||||
.BR cat
|
||||
version 2.0.
|
||||
.SH ATTRIBUTIONS
|
||||
This command was ported from FreeBSD source code
|
||||
for distribution with GNO/ME 2.0.6.
|
||||
.SH SEE ALSO
|
||||
.BR head (1),
|
||||
.BR more (1),
|
||||
.BR pr (1),
|
||||
.BR tail (1),
|
||||
.BR vis (1)
|
323
bin/cat/cat.c
Normal file
323
bin/cat/cat.c
Normal file
|
@ -0,0 +1,323 @@
|
|||
/*
|
||||
* 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. 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.
|
||||
*
|
||||
* $Id: cat.c,v 1.3 1997/10/03 03:59:41 gdr Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
* Modified for GNO (Apple IIGS) by Dave Tribby, July 1997
|
||||
*
|
||||
* Constructs unacceptable to compiler are replaced using #ifndef __ORCAC__
|
||||
*
|
||||
* Changes not related to compiler are replaced using #ifndef __GNO__
|
||||
*
|
||||
* Added prototyped headers, surrounded by #ifndef __STDC__
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __GNO__
|
||||
#ifndef lint
|
||||
static char const copyright[] =
|
||||
"@(#) Copyright (c) 1989, 1993\n\
|
||||
The Regents of the University of California. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
static char const sccsid[] = "@(#)cat.c 8.2 (Berkeley) 4/27/95";
|
||||
#endif /* not lint */
|
||||
#endif
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#ifndef __GNO__
|
||||
#include <locale.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int bflag, eflag, nflag, sflag, tflag, vflag;
|
||||
int rval;
|
||||
char *filename;
|
||||
|
||||
void cook_args __P((char *argv[]));
|
||||
void cook_buf __P((FILE *));
|
||||
void raw_args __P((char *argv[]));
|
||||
void raw_cat __P((int));
|
||||
|
||||
/* Interface to check on how much stack space a C program uses. */
|
||||
#if defined(__GNO__) && defined(__STACK_CHECK__)
|
||||
#ifndef _GNO_GNO_H_
|
||||
#include <gno/gno.h>
|
||||
#endif
|
||||
static void report_stack(void)
|
||||
{
|
||||
fprintf(stderr,"\n ==> %d stack bytes used <== \n", _endStackCheck());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
int
|
||||
#ifndef __STDC__
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
#else
|
||||
main(int argc,
|
||||
char *argv[])
|
||||
#endif
|
||||
{
|
||||
extern int optind;
|
||||
int ch;
|
||||
|
||||
#if defined(__GNO__) && defined(__STACK_CHECK__)
|
||||
_beginStackCheck();
|
||||
atexit(report_stack);
|
||||
#endif
|
||||
#ifndef __GNO__
|
||||
setlocale(LC_CTYPE, "");
|
||||
#endif
|
||||
|
||||
while ((ch = getopt(argc, argv, "benstuv")) != -1)
|
||||
switch (ch) {
|
||||
case 'b':
|
||||
bflag = nflag = 1; /* -b implies -n */
|
||||
break;
|
||||
case 'e':
|
||||
eflag = vflag = 1; /* -e implies -v */
|
||||
break;
|
||||
case 'n':
|
||||
nflag = 1;
|
||||
break;
|
||||
case 's':
|
||||
sflag = 1;
|
||||
break;
|
||||
case 't':
|
||||
tflag = vflag = 1; /* -t implies -v */
|
||||
break;
|
||||
case 'u':
|
||||
setbuf(stdout, (char *)NULL);
|
||||
break;
|
||||
case 'v':
|
||||
vflag = 1;
|
||||
break;
|
||||
default:
|
||||
(void)fprintf(stderr,
|
||||
"usage: cat [-benstuv] [-] [file ...]\n");
|
||||
exit(1);
|
||||
}
|
||||
#ifndef __ORCAC__
|
||||
argv += optind;
|
||||
#else
|
||||
argv = argv + optind;
|
||||
#endif
|
||||
|
||||
if (bflag || eflag || nflag || sflag || tflag || vflag)
|
||||
cook_args(argv);
|
||||
else
|
||||
raw_args(argv);
|
||||
if (fclose(stdout))
|
||||
err(1, "stdout");
|
||||
exit(rval);
|
||||
}
|
||||
|
||||
void
|
||||
#ifndef __STDC__
|
||||
cook_args(argv)
|
||||
char **argv;
|
||||
#else
|
||||
cook_args(char *argv[])
|
||||
#endif
|
||||
{
|
||||
register FILE *fp;
|
||||
|
||||
fp = stdin;
|
||||
filename = "stdin";
|
||||
do {
|
||||
if (*argv) {
|
||||
if (!strcmp(*argv, "-"))
|
||||
fp = stdin;
|
||||
else if ((fp = fopen(*argv, "r")) == NULL) {
|
||||
warn("%s", *argv);
|
||||
rval = 1;
|
||||
++argv;
|
||||
continue;
|
||||
}
|
||||
filename = *argv++;
|
||||
}
|
||||
cook_buf(fp);
|
||||
if (fp != stdin)
|
||||
(void)fclose(fp);
|
||||
} while (*argv);
|
||||
}
|
||||
|
||||
void
|
||||
#ifndef __STDC__
|
||||
cook_buf(fp)
|
||||
register FILE *fp;
|
||||
#else
|
||||
cook_buf(register FILE *fp)
|
||||
#endif
|
||||
{
|
||||
register 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 && putchar(ch) == EOF)
|
||||
break;
|
||||
gobble = 1;
|
||||
continue;
|
||||
}
|
||||
if (nflag && !bflag) {
|
||||
(void)fprintf(stdout, "%6d\t", ++line);
|
||||
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) && !isprint(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 = 1;
|
||||
clearerr(fp);
|
||||
}
|
||||
if (ferror(stdout))
|
||||
err(1, "stdout");
|
||||
}
|
||||
|
||||
void
|
||||
#ifndef __STDC__
|
||||
raw_args(argv)
|
||||
char **argv;
|
||||
#else
|
||||
raw_args(char *argv[])
|
||||
#endif
|
||||
{
|
||||
register int fd;
|
||||
|
||||
fd = fileno(stdin);
|
||||
filename = "stdin";
|
||||
do {
|
||||
if (*argv) {
|
||||
if (!strcmp(*argv, "-"))
|
||||
fd = fileno(stdin);
|
||||
#ifndef __GNO__
|
||||
else if ((fd = open(*argv, O_RDONLY, 0)) < 0) {
|
||||
#else /* GNO: 3rd parameter legal only when creating */
|
||||
else if ((fd = open(*argv, O_RDONLY)) < 0) {
|
||||
#endif
|
||||
warn("%s", *argv);
|
||||
rval = 1;
|
||||
++argv;
|
||||
continue;
|
||||
}
|
||||
filename = *argv++;
|
||||
}
|
||||
raw_cat(fd);
|
||||
if (fd != fileno(stdin))
|
||||
(void)close(fd);
|
||||
} while (*argv);
|
||||
}
|
||||
|
||||
void
|
||||
#ifndef __STDC__
|
||||
raw_cat(rfd)
|
||||
register int rfd;
|
||||
#else
|
||||
raw_cat(register int rfd)
|
||||
#endif
|
||||
{
|
||||
register int nr, nw, off, wfd;
|
||||
static int bsize;
|
||||
static char *buf;
|
||||
struct stat sbuf;
|
||||
|
||||
wfd = fileno(stdout);
|
||||
if (buf == NULL) {
|
||||
if (fstat(wfd, &sbuf))
|
||||
err(1, "%s", filename);
|
||||
bsize = MAX(sbuf.st_blksize, 1024);
|
||||
if ((buf = malloc((u_int)bsize)) == NULL)
|
||||
err(1, NULL);
|
||||
}
|
||||
while ((nr = read(rfd, buf, bsize)) > 0)
|
||||
for (off = 0; nr; nr -= nw, off += nw)
|
||||
if ((nw = write(wfd, buf + off, nr)) < 0)
|
||||
err(1, "stdout");
|
||||
if (nr < 0) {
|
||||
warn("%s", filename);
|
||||
rval = 1;
|
||||
}
|
||||
}
|
9
bin/cat/cat.desc
Normal file
9
bin/cat/cat.desc
Normal file
|
@ -0,0 +1,9 @@
|
|||
Name: cat
|
||||
Version: 2.0 (August 1997)
|
||||
Shell: GNO
|
||||
Author: Dave Tribby (from FreeBSD code)
|
||||
Contact: tribby@cup.hp.com
|
||||
Where: /bin
|
||||
FTP: ground.icaen.uiowa.edu apple2.caltech.edu ftp.gno.org
|
||||
|
||||
Concatenate and list files.
|
29
bin/cat/cat.rez
Normal file
29
bin/cat/cat.rez
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* Resources for version and comment
|
||||
*/
|
||||
#define PROG "cat"
|
||||
#define DESC "Concatenate and list files."
|
||||
|
||||
#include "Types.rez"
|
||||
|
||||
/*
|
||||
* Version
|
||||
*/
|
||||
resource rVersion (1, purgeable3) {
|
||||
{ 2, 0, 0, /* Version 2.0.0 */
|
||||
release, /* development|alpha|beta|final|release */
|
||||
0 }, /* non-final release number */
|
||||
verUS, /* Country */
|
||||
PROG, /* Program name */
|
||||
DESC " Released with GNO/ME."
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Comment
|
||||
*/
|
||||
resource rComment (1, purgeable3) {
|
||||
PROG " v2.0 (August 1997)\n"
|
||||
"GNO utility: " DESC "\n"
|
||||
"Ported from FreeBSD code by Dave Tribby."
|
||||
};
|
150
bin/cat/tests/dotests
Normal file
150
bin/cat/tests/dotests
Normal file
|
@ -0,0 +1,150 @@
|
|||
# Tests for cat command; invoked by command file "fulltests"
|
||||
# Written by Dave Tribby (August 1997)
|
||||
# $Id: dotests,v 1.2 1997/10/03 03:58:54 gdr Exp $
|
||||
|
||||
# Location of the cat command to be tested
|
||||
set testcmd="../cat"
|
||||
|
||||
# Record starting time
|
||||
echo -n "Testing command $testcmd beginning at"
|
||||
date
|
||||
|
||||
set src="file1.mixed"
|
||||
set cmp="file1.mixed"
|
||||
set dest="/tmp/$cmp"
|
||||
echo "Copying a single text file ($src) using filename input"
|
||||
$testcmd $src > $dest
|
||||
echo " Completion status = $status"
|
||||
echo "Checking results against control file $cmp (no differences expected)"
|
||||
cmp $cmp $dest
|
||||
echo " Completion status = $status"
|
||||
echo ""
|
||||
|
||||
set dest="/tmp/${cmp}A"
|
||||
echo "Copying a single text file ($src) using stdin"
|
||||
$testcmd < $src > $dest
|
||||
echo " Completion status = $status"
|
||||
echo "Checking results against control file $cmp (no differences expected)"
|
||||
cmp $cmp $dest
|
||||
echo " Completion status = $status"
|
||||
echo ""
|
||||
|
||||
set cmp="file1.bopt"
|
||||
set dest="/tmp/${cmp}"
|
||||
echo "Display a single text file ($src) with -b option"
|
||||
$testcmd -b $src > $dest
|
||||
echo " Completion status = $status"
|
||||
echo "Checking results against control file $cmp (no differences expected)"
|
||||
cmp $cmp $dest
|
||||
echo " Completion status = $status"
|
||||
echo ""
|
||||
|
||||
set cmp="file1.nopt"
|
||||
set dest="/tmp/${cmp}"
|
||||
echo "Display a single text file ($src) with -n option"
|
||||
$testcmd -n $src > $dest
|
||||
echo " Completion status = $status"
|
||||
echo "Checking results against control file $cmp (no differences expected)"
|
||||
cmp $cmp $dest
|
||||
echo " Completion status = $status"
|
||||
echo ""
|
||||
|
||||
set cmp="file1.topt"
|
||||
set dest="/tmp/${cmp}"
|
||||
echo "Display a single text file ($src) with -t option"
|
||||
$testcmd -t $src > $dest
|
||||
echo " Completion status = $status"
|
||||
echo "Checking results against control file $cmp (no differences expected)"
|
||||
cmp $cmp $dest
|
||||
echo " Completion status = $status"
|
||||
echo ""
|
||||
|
||||
set cmp="file1.eopt"
|
||||
set dest="/tmp/${cmp}"
|
||||
echo "Display a single text file ($src) with -e option"
|
||||
$testcmd -e $src > $dest
|
||||
echo " Completion status = $status"
|
||||
echo "Checking results against control file $cmp (no differences expected)"
|
||||
cmp $cmp $dest
|
||||
echo " Completion status = $status"
|
||||
echo ""
|
||||
|
||||
set src2=file1.nopt
|
||||
set cmp="file1.combo"
|
||||
set dest="/tmp/${cmp}"
|
||||
echo "Combine two files ($src, $src2) with stdin in the middle"
|
||||
set msg="===== stdin in between file1.mixed and $file1.nopt ====="
|
||||
echo $msg | $testcmd $src - $src2 > $dest
|
||||
echo " Completion status = $status"
|
||||
echo "Checking results against control file $cmp (no differences expected)"
|
||||
cmp $cmp $dest
|
||||
echo " Completion status = $status"
|
||||
echo ""
|
||||
|
||||
|
||||
set src="file2.bin1"
|
||||
set cmp="file2.bin1"
|
||||
set dest="/tmp/$cmp"
|
||||
echo "Copying a single binary file ($src) using filename input"
|
||||
$testcmd $src > $dest
|
||||
echo " Completion status = $status"
|
||||
echo "Checking results against control file $cmp (no differences expected)"
|
||||
cmp $cmp $dest
|
||||
echo " Completion status = $status"
|
||||
echo ""
|
||||
|
||||
set dest="/tmp/${cmp}A"
|
||||
echo "Copying a single binary file ($src) using stdin"
|
||||
$testcmd < $src > $dest
|
||||
echo " Completion status = $status"
|
||||
echo "Checking results against control file $cmp (no differences expected)"
|
||||
cmp $cmp $dest
|
||||
echo " Completion status = $status"
|
||||
echo ""
|
||||
|
||||
set cmp="file2.vopt"
|
||||
set dest="/tmp/${cmp}"
|
||||
echo "Display a single binary file ($src) with -v option"
|
||||
$testcmd -v $src > $dest
|
||||
echo " Completion status = $status"
|
||||
echo "Checking results against control file $cmp (no differences expected)"
|
||||
cmp $cmp $dest
|
||||
echo " Completion status = $status"
|
||||
echo ""
|
||||
|
||||
set cmp="file2.topt"
|
||||
set dest="/tmp/${cmp}"
|
||||
echo "Display a single binary file ($src) with -t option"
|
||||
$testcmd -t $src > $dest
|
||||
echo " Completion status = $status"
|
||||
echo "Checking results against control file $cmp (no differences expected)"
|
||||
cmp $cmp $dest
|
||||
echo " Completion status = $status"
|
||||
echo ""
|
||||
|
||||
set src="$testcmd"
|
||||
set cmp="$testcmd"
|
||||
set dest="/tmp/cat"
|
||||
echo "Copying a single binary file ($src) through a pipe"
|
||||
$testcmd $src | $testcmd > $dest
|
||||
echo " Completion status = $status"
|
||||
echo "Checking results against control file $cmp (no differences expected)"
|
||||
cmp $cmp $dest
|
||||
echo " Completion status = $status"
|
||||
echo ""
|
||||
|
||||
|
||||
echo "***** Error Messages *****"
|
||||
|
||||
set dest="/tmp/err.cond"
|
||||
|
||||
echo ""
|
||||
echo "Expected error: illegal option"
|
||||
$testcmd -x $src > $dest
|
||||
echo " Error completion status = $status (expected: 1)"
|
||||
|
||||
echo ""
|
||||
set src="badname"
|
||||
echo "Expected error: $src: no such file or directory"
|
||||
$testcmd $src > $dest
|
||||
echo " Error completion status = $status (expected: 1)"
|
19
bin/cat/tests/file1.bopt
Normal file
19
bin/cat/tests/file1.bopt
Normal file
|
@ -0,0 +1,19 @@
|
|||
1 # Create the test environment for tr
|
||||
|
||||
2 # Compile and load flags passed to occ
|
||||
3 # -v: verbose
|
||||
4 # -I: add directory to header path
|
||||
5 CFLAGS += -v -I /usr/include
|
||||
6 LDFLAGS += -v
|
||||
|
||||
7 # Default target, "all," generates the files
|
||||
8 all: file2.bin1 genbin
|
||||
|
||||
9 # Files depend upon program
|
||||
10 file2.bin1: genbin
|
||||
11 ./genbin
|
||||
|
||||
12 # Remove intermediate files
|
||||
13 clean:
|
||||
14 $(RM) -f *.o
|
||||
15 $(RM) -f *.root
|
39
bin/cat/tests/file1.combo
Normal file
39
bin/cat/tests/file1.combo
Normal file
|
@ -0,0 +1,39 @@
|
|||
# Create the test environment for tr
|
||||
|
||||
# Compile and load flags passed to occ
|
||||
# -v: verbose
|
||||
# -I: add directory to header path
|
||||
CFLAGS += -v -I /usr/include
|
||||
LDFLAGS += -v
|
||||
|
||||
# Default target, "all," generates the files
|
||||
all: file2.bin1 genbin
|
||||
|
||||
# Files depend upon program
|
||||
file2.bin1: genbin
|
||||
./genbin
|
||||
|
||||
# Remove intermediate files
|
||||
clean:
|
||||
$(RM) -f *.o
|
||||
$(RM) -f *.root
|
||||
===== stdin in between file1.mixed and .nopt =====
|
||||
1 # Create the test environment for tr
|
||||
2
|
||||
3 # Compile and load flags passed to occ
|
||||
4 # -v: verbose
|
||||
5 # -I: add directory to header path
|
||||
6 CFLAGS += -v -I /usr/include
|
||||
7 LDFLAGS += -v
|
||||
8
|
||||
9 # Default target, "all," generates the files
|
||||
10 all: file2.bin1 genbin
|
||||
11
|
||||
12 # Files depend upon program
|
||||
13 file2.bin1: genbin
|
||||
14 ./genbin
|
||||
15
|
||||
16 # Remove intermediate files
|
||||
17 clean:
|
||||
18 $(RM) -f *.o
|
||||
19 $(RM) -f *.root
|
19
bin/cat/tests/file1.eopt
Normal file
19
bin/cat/tests/file1.eopt
Normal file
|
@ -0,0 +1,19 @@
|
|||
# Create the test environment for tr$
|
||||
$
|
||||
# Compile and load flags passed to occ$
|
||||
# -v: verbose$
|
||||
# -I: add directory to header path$
|
||||
CFLAGS += -v -I /usr/include$
|
||||
LDFLAGS += -v$
|
||||
$
|
||||
# Default target, "all," generates the files$
|
||||
all: file2.bin1 genbin$
|
||||
$
|
||||
# Files depend upon program$
|
||||
file2.bin1: genbin$
|
||||
./genbin$
|
||||
$
|
||||
# Remove intermediate files$
|
||||
clean:$
|
||||
$(RM) -f *.o$
|
||||
$(RM) -f *.root$
|
19
bin/cat/tests/file1.mixed
Normal file
19
bin/cat/tests/file1.mixed
Normal file
|
@ -0,0 +1,19 @@
|
|||
# Create the test environment for tr
|
||||
|
||||
# Compile and load flags passed to occ
|
||||
# -v: verbose
|
||||
# -I: add directory to header path
|
||||
CFLAGS += -v -I /usr/include
|
||||
LDFLAGS += -v
|
||||
|
||||
# Default target, "all," generates the files
|
||||
all: file2.bin1 genbin
|
||||
|
||||
# Files depend upon program
|
||||
file2.bin1: genbin
|
||||
./genbin
|
||||
|
||||
# Remove intermediate files
|
||||
clean:
|
||||
$(RM) -f *.o
|
||||
$(RM) -f *.root
|
19
bin/cat/tests/file1.nopt
Normal file
19
bin/cat/tests/file1.nopt
Normal file
|
@ -0,0 +1,19 @@
|
|||
1 # Create the test environment for tr
|
||||
2
|
||||
3 # Compile and load flags passed to occ
|
||||
4 # -v: verbose
|
||||
5 # -I: add directory to header path
|
||||
6 CFLAGS += -v -I /usr/include
|
||||
7 LDFLAGS += -v
|
||||
8
|
||||
9 # Default target, "all," generates the files
|
||||
10 all: file2.bin1 genbin
|
||||
11
|
||||
12 # Files depend upon program
|
||||
13 file2.bin1: genbin
|
||||
14 ./genbin
|
||||
15
|
||||
16 # Remove intermediate files
|
||||
17 clean:
|
||||
18 $(RM) -f *.o
|
||||
19 $(RM) -f *.root
|
19
bin/cat/tests/file1.topt
Normal file
19
bin/cat/tests/file1.topt
Normal file
|
@ -0,0 +1,19 @@
|
|||
# Create the test environment for tr
|
||||
|
||||
# Compile and load flags passed to occ
|
||||
# -v: verbose
|
||||
# -I: add directory to header path
|
||||
CFLAGS^I+= -v -I /usr/include
|
||||
LDFLAGS^I+= -v
|
||||
|
||||
# Default target, "all," generates the files
|
||||
all: file2.bin1 genbin
|
||||
|
||||
# Files depend upon program
|
||||
file2.bin1: genbin
|
||||
^I./genbin
|
||||
|
||||
# Remove intermediate files
|
||||
clean:
|
||||
^I$(RM) -f *.o
|
||||
^I$(RM) -f *.root
|
BIN
bin/cat/tests/file2.bin1
Normal file
BIN
bin/cat/tests/file2.bin1
Normal file
Binary file not shown.
3
bin/cat/tests/file2.topt
Normal file
3
bin/cat/tests/file2.topt
Normal file
|
@ -0,0 +1,3 @@
|
|||
^@^A^B^C^D^E^F^G^H^I
|
||||
^K^L
|
||||
^N^O^P^Q^R^S^T^U^V^W^X^Y^Z^[^\^]^^^_
|
3
bin/cat/tests/file2.vopt
Normal file
3
bin/cat/tests/file2.vopt
Normal file
|
@ -0,0 +1,3 @@
|
|||
^@^A^B^C^D^E^F^G^H
|
||||
^K^L
|
||||
^N^O^P^Q^R^S^T^U^V^W^X^Y^Z^[^\^]^^^_
|
18
bin/cat/tests/file4.text
Normal file
18
bin/cat/tests/file4.text
Normal file
|
@ -0,0 +1,18 @@
|
|||
This is a text file
|
||||
|
||||
|
||||
that contains multiple blank lines
|
||||
|
||||
|
||||
|
||||
to check out the "cat" command's ability
|
||||
|
||||
|
||||
|
||||
|
||||
to remove extra lines (using the -r command).
|
||||
|
||||
|
||||
|
||||
|
||||
===== END OF FILE =====
|
11
bin/center/Makefile
Normal file
11
bin/center/Makefile
Normal file
|
@ -0,0 +1,11 @@
|
|||
#
|
||||
# $Id: Makefile,v 1.2 1999/02/16 06:04:11 gdr-ftp Exp $
|
||||
#
|
||||
|
||||
PROG = center
|
||||
SRCS = center.c
|
||||
STACK = 768
|
||||
# observed stack: 676 bytes
|
||||
|
||||
.INCLUDE : /src/gno/prog.mk
|
||||
|
29
bin/center/center.1
Normal file
29
bin/center/center.1
Normal file
|
@ -0,0 +1,29 @@
|
|||
.\"
|
||||
.\" $Id: center.1,v 1.1 1999/02/16 06:04:11 gdr-ftp Exp $
|
||||
.\"
|
||||
.TH CENTER 1 "15 February 1999" GNO "Commands and Applications"
|
||||
.SH NAME
|
||||
.BR center
|
||||
\- print centered text to stdout
|
||||
.SH SYNOPSIS
|
||||
.BR center
|
||||
.I columns
|
||||
.I file
|
||||
.SH DESCRIPTION
|
||||
.BR center
|
||||
is a simple utility for centering text on a screen.
|
||||
.I columns
|
||||
is the number of columns that are considered to be the width of a full screen.
|
||||
The default and maximum widths are both 80 columns.
|
||||
Text is read from the input file
|
||||
.I file
|
||||
and printed to stdout.
|
||||
.SH BUGS
|
||||
.B center
|
||||
should be able to read from stdin.
|
||||
.LP
|
||||
.B center
|
||||
would be more useful if it took arbitrary screen widths into account,
|
||||
including over 80 columns. Less than about 5 or 10 is probably unnecessary.
|
||||
.SH AUTHOR
|
||||
Marek Pawlowski.
|
124
bin/center/center.c
Normal file
124
bin/center/center.c
Normal file
|
@ -0,0 +1,124 @@
|
|||
|
||||
/* "center", (c) 1992 Marek Pawlowski. v1.0
|
||||
Takes input from stdin, center's it, and puts it to
|
||||
stdout.
|
||||
|
||||
v1.1 compiled for GNO Base Distribution. Devin Reade, 15 February 1999
|
||||
|
||||
Usage: center [Columns] [File]
|
||||
|
||||
Columns The number of columns are to be considered
|
||||
"full-screen" for centering. Default 80.
|
||||
File Stream to read input from. Default stdin.
|
||||
|
||||
This utility is in the public domain, along with
|
||||
source code. Munge at will. Contact author for
|
||||
redistribution rights, or inclusion in package.
|
||||
Credit to Marek Pawlowski must be retained in
|
||||
modified source code.
|
||||
|
||||
I'd like to see what you did to my source code, when
|
||||
you change it. Correspond with the author (Marek
|
||||
Pawlowski) at the following Email addresses:
|
||||
|
||||
marekp@pnet91.cts.com
|
||||
marekp@cerf.net
|
||||
|
||||
$Id: center.c,v 1.2 1999/02/16 06:04:11 gdr-ftp Exp $
|
||||
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <gno/gno.h>
|
||||
|
||||
#define VERSION "1.1"
|
||||
|
||||
static void center(FILE *stream, int t);
|
||||
|
||||
char input[81];
|
||||
char output[81];
|
||||
|
||||
static void usage(const char *file);
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
int t, i, x, s, fflag, len, c;
|
||||
FILE *in;
|
||||
|
||||
__REPORT_STACK();
|
||||
if (argc > 3) {
|
||||
usage(argv[0]);
|
||||
}
|
||||
|
||||
s = 1;
|
||||
|
||||
if(argc > 1) {
|
||||
len = strlen(argv[1]);
|
||||
for(x = 0 ; x <= (strlen(argv[1])-1) ; x++) {
|
||||
s = isdigit(argv[1][x]);
|
||||
t = atoi(argv[1]);
|
||||
if (t>80) {
|
||||
t = 80;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else if (argc == 1)
|
||||
t = 80;
|
||||
|
||||
fflag = 0;
|
||||
|
||||
if (argc == 3) {
|
||||
in = fopen(argv[2], "r");
|
||||
if (!in) {
|
||||
fprintf(stderr, "%s: cannot open %s\n", argv[1], argv[2]);
|
||||
exit(1);
|
||||
}
|
||||
fflag = 1;
|
||||
}
|
||||
|
||||
if(s != 0) {
|
||||
if(fflag == 1)
|
||||
center(in, t);
|
||||
else
|
||||
center(stdin, t);
|
||||
} else {
|
||||
usage(argv[0]);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Function to call on other subroutines to result in a completely
|
||||
centered line! */
|
||||
|
||||
static void
|
||||
center(FILE *stream, int t)
|
||||
{
|
||||
int x, i, j;
|
||||
|
||||
while(feof(stream) == 0) {
|
||||
fgets(input, 80, stream);
|
||||
|
||||
i = (t - strlen(input)) / 2;
|
||||
|
||||
for (j = 0; j<i; j++) {
|
||||
output[j] = ' ';
|
||||
}
|
||||
|
||||
for(x = 0 ; x <= strlen(input) ; x++)
|
||||
output[i+x] = input[x];
|
||||
if(feof(stream) == 0)
|
||||
fputs(output, stdout);
|
||||
}
|
||||
}
|
||||
|
||||
/* Function to display the usage of the utility */
|
||||
static void
|
||||
usage(const char *file)
|
||||
{
|
||||
fprintf(stderr, "Usage: %s [columns] [file]\n", file);
|
||||
exit(1);
|
||||
}
|
9
bin/center/center.desc
Normal file
9
bin/center/center.desc
Normal file
|
@ -0,0 +1,9 @@
|
|||
Name: center
|
||||
Version: 1.1
|
||||
Shell: GNO
|
||||
Author: Marek Pawlowski. Maintained by Devin Reade.
|
||||
Contact: gdr@trenco.gno.org
|
||||
Where: /bin
|
||||
FTP: ftp.gno.org
|
||||
|
||||
Take text from a file (or stdin), center it, and print it to stdout.
|
18
bin/center/center.rez
Normal file
18
bin/center/center.rez
Normal file
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
* $Id: center.rez,v 1.1 1999/02/16 06:04:12 gdr-ftp Exp $
|
||||
*/
|
||||
|
||||
#include "Types.Rez"
|
||||
#include "builddate.rez"
|
||||
|
||||
resource rVersion (0x1, purgeable3, nocrossbank) {
|
||||
|
||||
{ 1, 1, 0, /* version */
|
||||
release, /* development|alpha|beta|final|release */
|
||||
0 /* non-final release number */
|
||||
},
|
||||
verUS,
|
||||
"center",
|
||||
"Center text to stdout.\n"
|
||||
BUILD_DATE
|
||||
};
|
27
bin/chtyp/Makefile
Normal file
27
bin/chtyp/Makefile
Normal file
|
@ -0,0 +1,27 @@
|
|||
#
|
||||
# This makefile is intended for use with dmake(1) on Apple IIGS
|
||||
#
|
||||
# Created by Dave Tribby, August 1997
|
||||
# Modified by Evan Day, September 1997
|
||||
#
|
||||
# $Id: Makefile,v 1.2 1998/02/19 02:03:15 gdr-ftp Exp $
|
||||
|
||||
PROG = chtyp
|
||||
SRCS = chtyp.c ftypes.c
|
||||
|
||||
# If optimization wasn't set on the command line use 79, since
|
||||
# chtyp has been tested to work at that level.
|
||||
OPTIMIZE*= 79
|
||||
|
||||
# Current implementation is using 960 bytes give or take
|
||||
STACK = 1024
|
||||
|
||||
.INCLUDE : /src/gno/prog.mk
|
||||
|
||||
#
|
||||
# Additional dependancies.
|
||||
#
|
||||
ftypes.o: ftypes.h
|
||||
chtyp.o: ftypes.h
|
||||
|
||||
|
72
bin/chtyp/chtyp.1
Normal file
72
bin/chtyp/chtyp.1
Normal file
|
@ -0,0 +1,72 @@
|
|||
.\"
|
||||
.\" $Id: chtyp.1,v 1.1 1997/10/03 05:06:50 gdr Exp $
|
||||
.\"
|
||||
.TH CHTYP 1 "28 September 1997" GNO "Commands and Applications"
|
||||
.SH NAME
|
||||
.BR chtyp
|
||||
\- change GS/OS file type information
|
||||
.SH SYNOPSIS
|
||||
.BR chtyp
|
||||
[ [
|
||||
.IR -t " " ftype
|
||||
] [
|
||||
.IR -a " " atype
|
||||
] ] | [
|
||||
.IR -l " " lang
|
||||
]
|
||||
.IR file ...
|
||||
.SH DESCRIPTION
|
||||
Set GS/OS file type information for the specified
|
||||
.IR files
|
||||
.LP
|
||||
File types may be specified either as a number (decimal,
|
||||
hexadecimal with a leading 0x, or octal with a leading 0)
|
||||
or by a three letter abbreviation. Abbreviations are from
|
||||
the official File Type Notes Index.
|
||||
.LP
|
||||
Auxilary types may only be specified as a number (decimal,
|
||||
hexadecimal, or octal).
|
||||
.LP
|
||||
If a file type is specified with no aux type, or vice versa,
|
||||
only the specified parameter is changed - the other is left
|
||||
as is.
|
||||
.LP
|
||||
The language option sets the file type and aux type appropriate
|
||||
for a source file of the specified language. See below for a
|
||||
list of valid languages.
|
||||
.SH OPTIONS
|
||||
The following options are available:
|
||||
.IP "\fB-t\fR \fIftype\fR"
|
||||
Set the file type of the indicated files to the specified
|
||||
.IR ftype "."
|
||||
The file type may be specified as a number (in decimal, as a
|
||||
hexadecimal number with a leading 0x, or as an octal number
|
||||
with a leading 0) or by one of the official three letter
|
||||
abbreviations listed in the File Type Notes Index. Types set
|
||||
by abbreviation may not have their auxilary file types set
|
||||
due to the large variety of assigned auxilary types for each
|
||||
file type.
|
||||
.IP "\fB-a\fR \fIatype\fR"
|
||||
Set the auxilary file type of the indicated files to the
|
||||
.IR atype
|
||||
specified. The auxilary type may only be specified as a
|
||||
number.
|
||||
.IP "\fB-l\fR \fIlang\fR"
|
||||
Set the file type and auxilary file type to that of a source
|
||||
file of the selected
|
||||
.IR lang "."
|
||||
The
|
||||
.IR -l
|
||||
flag may not be used with the
|
||||
.IR -t
|
||||
or
|
||||
.IR -a
|
||||
flags.
|
||||
.IP
|
||||
Valid language types are: APWTXT, ASM, PASCAL, EXEC, CC, LINKER,
|
||||
DESKTOP, REZ, TMLPASCAL, DISASM, SDEASM, SDECMD, PS.
|
||||
.SH HISTORY
|
||||
.BR chtyp
|
||||
was originally written by Greg Thompson. Jawaid Bazyar rewrote it
|
||||
later for GNO/ME, and it has since been rewritten from scratch for
|
||||
GNO/ME v2.0.6 by Evan Day <day@engr.orst.edu>.
|
145
bin/chtyp/chtyp.c
Normal file
145
bin/chtyp/chtyp.c
Normal file
|
@ -0,0 +1,145 @@
|
|||
/*
|
||||
* chtyp
|
||||
*
|
||||
* Sets the file/aux type for GS/OS files.
|
||||
*
|
||||
* $Id: chtyp.c,v 1.1 1997/10/03 05:06:50 gdr Exp $
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <gsos.h>
|
||||
|
||||
#include "ftypes.h"
|
||||
|
||||
void usage(void);
|
||||
void version(void);
|
||||
|
||||
#ifdef __STACK_CHECK__
|
||||
#include <gno/gno.h>
|
||||
|
||||
static void cleanup(void)
|
||||
{
|
||||
(void) fprintf(stderr, "Stack Usage: %d.\n", _endStackCheck());
|
||||
}
|
||||
#endif
|
||||
|
||||
static GSString255 path;
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
char *ftype = NULL;
|
||||
char *atype = NULL;
|
||||
char *lang = NULL;
|
||||
char *left = NULL;
|
||||
int filet = -1;
|
||||
long auxt = -1;
|
||||
int ch;
|
||||
FileInfoRecGS finfo = {4, &path};
|
||||
|
||||
#ifdef __STACK_CHECK__
|
||||
atexit(cleanup);
|
||||
_beginStackCheck();
|
||||
#endif
|
||||
|
||||
while((ch = getopt(argc, argv, "t:a:l:vV")) != -1)
|
||||
switch(ch) {
|
||||
case 't':
|
||||
if(lang) {
|
||||
(void) fprintf(stderr,
|
||||
"chtyp: -t cannot be used with -l\n");
|
||||
usage();
|
||||
}
|
||||
ftype = optarg;
|
||||
break;
|
||||
case 'a':
|
||||
if(lang) {
|
||||
(void) fprintf(stderr,
|
||||
"chtyp: -a cannot be used with -l\n");
|
||||
usage();
|
||||
}
|
||||
atype = optarg;
|
||||
break;
|
||||
case 'l':
|
||||
if(ftype || atype) {
|
||||
(void) fprintf(stderr,
|
||||
"chtyp: -l cannot be used with %s%s\n",
|
||||
ftype ? "-t" : "-a",
|
||||
ftype && atype ? " or -a." : ".");
|
||||
usage();
|
||||
}
|
||||
lang = optarg;
|
||||
break;
|
||||
case 'v':
|
||||
case 'V':
|
||||
version();
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
break;
|
||||
}
|
||||
|
||||
argc -= optind;
|
||||
argv = argv + optind;
|
||||
|
||||
if(argc == 0) {
|
||||
(void) fprintf(stderr, "chtyp: no files specified\n");
|
||||
usage();
|
||||
}
|
||||
|
||||
if(lang) {
|
||||
if(find_lang(lang, &filet, &auxt) == -1) {
|
||||
(void) fprintf(stderr, "chtyp: unknown language argument \"%s\".\n",
|
||||
lang);
|
||||
usage();
|
||||
}
|
||||
}
|
||||
|
||||
if(ftype) {
|
||||
filet = (int) strtol(ftype, &left, 0);
|
||||
if(errno == ERANGE || *left)
|
||||
if(find_type(ftype, &filet, &auxt) == -1) {
|
||||
(void) fprintf(stderr,
|
||||
"chtyp: invalid argument to -t option.\n");
|
||||
usage();
|
||||
}
|
||||
}
|
||||
|
||||
if(atype) {
|
||||
errno = 0; /* be sure to reset errno! */
|
||||
auxt = strtol(atype, (char **) NULL, 0);
|
||||
if(errno == ERANGE) {
|
||||
(void) fprintf(stderr, "chtyp: invalid argument to -a option.\n");
|
||||
usage();
|
||||
}
|
||||
}
|
||||
|
||||
ch = 0;
|
||||
while(argc) {
|
||||
strcpy(path.text, argv[ch]);
|
||||
path.length = strlen(argv[ch++]);
|
||||
GetFileInfoGS(&finfo);
|
||||
if(filet != -1)
|
||||
finfo.fileType = filet;
|
||||
if(auxt != -1)
|
||||
finfo.auxType = auxt;
|
||||
SetFileInfoGS(&finfo);
|
||||
argc--;
|
||||
}
|
||||
}
|
||||
|
||||
static void usage(void)
|
||||
{
|
||||
(void) fprintf(stderr,
|
||||
"Usage: chtyp { [-t type] [-a auxtype] } | { [-l lang] } file ...\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
static void version(void)
|
||||
{
|
||||
(void) fprintf(stderr,
|
||||
"V 2.0.0 Copyright 1997 by Evan Day, day@engr.orst.edu\n");
|
||||
usage();
|
||||
}
|
9
bin/chtyp/chtyp.desc
Normal file
9
bin/chtyp/chtyp.desc
Normal file
|
@ -0,0 +1,9 @@
|
|||
Name: chtyp
|
||||
Version: 2.0.0 (28 Sep 97)
|
||||
Shell: GNO/ME
|
||||
Author: Evan Day
|
||||
Contact: day@engr.orst.edu
|
||||
Where: /bin
|
||||
FTP: ftp.gno.org
|
||||
|
||||
Set GS/OS file types.
|
34
bin/chtyp/chtyp.rez
Normal file
34
bin/chtyp/chtyp.rez
Normal file
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* $Id: chtyp.rez,v 1.2 1997/10/05 16:41:46 gdr Exp $
|
||||
*/
|
||||
|
||||
#include "Types.Rez"
|
||||
#include "proginfo.rez"
|
||||
|
||||
resource rVersion (0x1, purgeable3, nocrossbank) {
|
||||
|
||||
{ 2, 0, 0, /* version 2.0.0 */
|
||||
release, /* development|alpha|beta|final|release */
|
||||
0 /* non-final release number */
|
||||
},
|
||||
verUS, /* country code -- only some are avail */
|
||||
"chtyp", /* name */
|
||||
/* _Very_ brief descrition. Check "file info" */
|
||||
/* shown in the Finder to see if it's too long */
|
||||
/* Note that \n is used to separate lines here. */
|
||||
"Change GS/OS file type information.\n"
|
||||
"Requires GNO/ME Shell.\n"
|
||||
"Evan Day <day@engr.orst.edu>"
|
||||
};
|
||||
|
||||
resource rProgramInfo (0x1, purgeable3, nocrossbank) {
|
||||
{ 6, 0, 1,
|
||||
release,
|
||||
0
|
||||
},
|
||||
80000, /* These are rough... the library isn't */
|
||||
80000, /* final yet. */
|
||||
1024,
|
||||
progRequiresGNO+progAppleTalkOK+progAllowsCDAs,
|
||||
piCompatible*ProgShellGSH+piSpecialFeatures*ProgShellGSH
|
||||
};
|
171
bin/chtyp/ftypes.c
Normal file
171
bin/chtyp/ftypes.c
Normal file
|
@ -0,0 +1,171 @@
|
|||
/*
|
||||
* ftypes.c
|
||||
*
|
||||
* data/routines to change an official Apple 3-letter filetype abbrevation
|
||||
* into a full filetype/auxtype pair (or back, I suppose)
|
||||
*
|
||||
* also data/routines to change a language type (as specified in chtyp.1)
|
||||
* into a filetype/auxtype pair.
|
||||
*
|
||||
* $Id: ftypes.c,v 1.1 1997/10/03 05:06:50 gdr Exp $
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
static struct type_list {
|
||||
char *name;
|
||||
int file_type;
|
||||
long aux_type;
|
||||
} types[] = {
|
||||
{ "non", 0x00, 0x0000 }, /* common abbrev for $00 */
|
||||
{ "unk", 0x00, 0x0000 }, /* official abbrev for $00 */
|
||||
{ "bad", 0x01, 0x0000 },
|
||||
{ "pcd", 0x02, 0x0000 },
|
||||
{ "ptx", 0x03, 0x0000 },
|
||||
{ "txt", 0x04, 0x0000 },
|
||||
{ "pda", 0x05, 0x0000 },
|
||||
{ "bin", 0x06, 0x0000 },
|
||||
{ "fnt", 0x07, 0x0000 },
|
||||
{ "fot", 0x08, 0x0000 },
|
||||
{ "ba3", 0x09, 0x0000 },
|
||||
{ "da3", 0x0a, 0x0000 },
|
||||
{ "wpf", 0x0b, 0x0000 },
|
||||
{ "sos", 0x0c, 0x0000 },
|
||||
{ "dir", 0x0f, 0x0000 },
|
||||
{ "rpd", 0x10, 0x0000 },
|
||||
{ "rpi", 0x11, 0x0000 },
|
||||
{ "afd", 0x12, 0x0000 },
|
||||
{ "afm", 0x13, 0x0000 },
|
||||
{ "afr", 0x14, 0x0000 },
|
||||
{ "scl", 0x15, 0x0000 },
|
||||
{ "pfs", 0x16, 0x0000 },
|
||||
{ "adb", 0x19, 0x0000 },
|
||||
{ "awp", 0x1a, 0x0000 },
|
||||
{ "asp", 0x1b, 0x0000 },
|
||||
{ "tdm", 0x20, 0x0000 },
|
||||
{ "8sc", 0x2a, 0x0000 },
|
||||
{ "8ob", 0x2b, 0x0000 },
|
||||
{ "8ic", 0x2c, 0x0000 },
|
||||
{ "8ld", 0x2d, 0x0000 },
|
||||
{ "p8c", 0x2e, 0x0000 },
|
||||
{ "ptp", 0x2e, 0x8001 }, /* Point-to-point drivers */
|
||||
{ "ftd", 0x42, 0x0000 },
|
||||
{ "gwp", 0x50, 0x0000 },
|
||||
{ "gss", 0x51, 0x0000 },
|
||||
{ "gdb", 0x52, 0x0000 },
|
||||
{ "drw", 0x53, 0x0000 },
|
||||
{ "gdp", 0x54, 0x0000 },
|
||||
{ "hmd", 0x55, 0x0000 },
|
||||
{ "edu", 0x56, 0x0000 },
|
||||
{ "stn", 0x57, 0x0000 },
|
||||
{ "hlp", 0x58, 0x0000 },
|
||||
{ "com", 0x59, 0x0000 },
|
||||
{ "cfg", 0x5a, 0x0000 },
|
||||
{ "anm", 0x5b, 0x0000 },
|
||||
{ "mum", 0x5c, 0x0000 },
|
||||
{ "ent", 0x5d, 0x0000 },
|
||||
{ "dvu", 0x5e, 0x0000 },
|
||||
{ "bio", 0x6b, 0x0000 },
|
||||
{ "tdr", 0x6d, 0x0000 },
|
||||
{ "pre", 0x6e, 0x0000 },
|
||||
{ "hdv", 0x6f, 0x0000 },
|
||||
{ "wp", 0xa0, 0x0000 },
|
||||
{ "gsb", 0xab, 0x0000 },
|
||||
{ "tdf", 0xac, 0x0000 },
|
||||
{ "bdf", 0xad, 0x0000 },
|
||||
{ "src", 0xb0, 0x0000 },
|
||||
{ "obj", 0xb1, 0x0000 },
|
||||
{ "lib", 0xb2, 0x0000 },
|
||||
{ "s16", 0xb3, 0x0000 },
|
||||
{ "rtl", 0xb4, 0x0000 },
|
||||
{ "exe", 0xb5, 0x0000 },
|
||||
{ "pif", 0xb6, 0x0000 },
|
||||
{ "tif", 0xb7, 0x0000 },
|
||||
{ "nda", 0xb8, 0x0000 },
|
||||
{ "cda", 0xb9, 0x0000 },
|
||||
{ "tol", 0xba, 0x0000 },
|
||||
{ "dvr", 0xbb, 0x0000 },
|
||||
{ "ldf", 0xbc, 0x0000 },
|
||||
{ "fst", 0xbd, 0x0000 },
|
||||
{ "doc", 0xbf, 0x0000 },
|
||||
{ "pnt", 0xc0, 0x0000 },
|
||||
{ "pic", 0xc1, 0x0000 },
|
||||
{ "ani", 0xc2, 0x0000 },
|
||||
{ "pal", 0xc3, 0x0000 },
|
||||
{ "oog", 0xc5, 0x0000 },
|
||||
{ "scr", 0xc6, 0x0000 },
|
||||
{ "cdv", 0xc7, 0x0000 },
|
||||
{ "fon", 0xc8, 0x0000 },
|
||||
{ "fnd", 0xc9, 0x0000 },
|
||||
{ "icn", 0xca, 0x0000 },
|
||||
{ "mus", 0xd5, 0x0000 },
|
||||
{ "ins", 0xd6, 0x0000 },
|
||||
{ "mdi", 0xd7, 0x0000 },
|
||||
{ "snd", 0xd8, 0x0000 },
|
||||
{ "dbm", 0xdb, 0x0000 },
|
||||
{ "lbr", 0xe0, 0x0000 },
|
||||
{ "atk", 0xe2, 0x0000 },
|
||||
{ "r16", 0xee, 0x0000 },
|
||||
{ "pas", 0xef, 0x0000 },
|
||||
{ "cmd", 0xf0, 0x0000 },
|
||||
{ "os" , 0xf9, 0x0000 },
|
||||
{ "int", 0xfa, 0x0000 },
|
||||
{ "ivr", 0xfb, 0x0000 },
|
||||
{ "bas", 0xfc, 0x0000 },
|
||||
{ "var", 0xfd, 0x0000 },
|
||||
{ "rel", 0xfe, 0x0000 },
|
||||
{ "sys", 0xff, 0x0000 }
|
||||
};
|
||||
|
||||
#define NUM_TYPES 98
|
||||
|
||||
static struct lang_list {
|
||||
char *name;
|
||||
int file_type;
|
||||
long aux_type;
|
||||
} langs[] = {
|
||||
{ "apwtxt", 0xb0, 0x0001},
|
||||
{ "asm", 0xb0, 0x0003},
|
||||
{ "pascal", 0xb0, 0x0005},
|
||||
{ "exec", 0xb0, 0x0006},
|
||||
{ "cc", 0xb0, 0x0008},
|
||||
{ "linker", 0xb0, 0x0009},
|
||||
{ "apwc", 0xb0, 0x000a},
|
||||
{ "desktop", 0xb0, 0x000c},
|
||||
{ "rez", 0xb0, 0x0015},
|
||||
{ "tmlpascal", 0xb0, 0x001e},
|
||||
{ "disasm", 0xb0, 0x0115},
|
||||
{ "sdeasm", 0xb0, 0x0503},
|
||||
{ "sdecmd", 0xb0, 0x0506},
|
||||
{ "ps", 0xb0, 0x0719},
|
||||
};
|
||||
|
||||
#define NUM_LANGS 14
|
||||
|
||||
int find_type(char *type_str, int *f, long *a)
|
||||
{
|
||||
int i;
|
||||
|
||||
for(i = 0; i < NUM_TYPES; i++)
|
||||
if(!stricmp(type_str, types[i].name)) {
|
||||
*f = types[i].file_type;
|
||||
*a = types[i].aux_type;
|
||||
return(0);
|
||||
}
|
||||
|
||||
return(-1);
|
||||
}
|
||||
|
||||
int find_lang(char *lang_str, int *f, long *a)
|
||||
{
|
||||
int i;
|
||||
|
||||
for(i = 0; i < NUM_LANGS; i++)
|
||||
if(!stricmp(lang_str, langs[i].name)) {
|
||||
*f = langs[i].file_type;
|
||||
*a = langs[i].aux_type;
|
||||
return(0);
|
||||
}
|
||||
|
||||
return(-1);
|
||||
}
|
6
bin/chtyp/ftypes.h
Normal file
6
bin/chtyp/ftypes.h
Normal file
|
@ -0,0 +1,6 @@
|
|||
/*
|
||||
* $Id: ftypes.h,v 1.1 1997/10/03 05:06:50 gdr Exp $
|
||||
*/
|
||||
|
||||
extern int find_type(char *, int *, long *);
|
||||
extern int find_lang(char *, int *, long *);
|
27
bin/cmp/Makefile
Normal file
27
bin/cmp/Makefile
Normal file
|
@ -0,0 +1,27 @@
|
|||
#
|
||||
# This makefile is intended for use with dmake(1) on Apple IIGS
|
||||
#
|
||||
# Created by Dave Tribby, August 1997
|
||||
# Modified by Evan Day, September 1997
|
||||
#
|
||||
# $Id: Makefile,v 1.3 1998/02/19 02:05:06 gdr-ftp Exp $
|
||||
|
||||
PROG= cmp
|
||||
SRCS= cmp.c misc.c rcmp.c special.c
|
||||
|
||||
# If optimization wasn't set on the command line use 79, since
|
||||
# cmp has been tested to work at that level.
|
||||
OPTIMIZE *= 79
|
||||
|
||||
# Current implementation is using ~1050 bytes give or take
|
||||
STACK = 1280
|
||||
|
||||
.INCLUDE : /src/gno/prog.mk
|
||||
|
||||
#
|
||||
# Additional dependancies
|
||||
#
|
||||
cmp.o: extern.h
|
||||
misc.o: extern.h
|
||||
rcmp.o: extern.h
|
||||
special.o: extern.h
|
114
bin/cmp/cmp.1
Normal file
114
bin/cmp/cmp.1
Normal file
|
@ -0,0 +1,114 @@
|
|||
.\" Copyright (c) 1987, 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. 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.
|
||||
.\"
|
||||
.\" @(#)cmp.1 8.1 (Berkeley) 6/6/93
|
||||
.\" $Id: cmp.1,v 1.1 1997/10/03 05:13:22 gdr Exp $
|
||||
.\"
|
||||
.TH CMP 1 "28 September 1997" GNO "Commands and Applications"
|
||||
.SH NAME
|
||||
.BR cmp
|
||||
\- compare two files
|
||||
.SH SYNOPSIS
|
||||
.BR cmp " [" -l " | " -s "] ["
|
||||
.BR -r
|
||||
]
|
||||
.IR file1
|
||||
.IR file2
|
||||
[
|
||||
.IR skip1
|
||||
[
|
||||
.IR skip2
|
||||
] ]
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
.BR cmp
|
||||
utility compares two files of any type and writes the results
|
||||
to the standard output.
|
||||
By default,
|
||||
.BR cmp
|
||||
is silent if the files are the same; if they differ, the byte
|
||||
and line number at which the first difference occurred is reported.
|
||||
Also by default,
|
||||
.BR cmp
|
||||
also considers the resource forks of the files, and will make note
|
||||
if only one of the files has a resource fork.
|
||||
.PP
|
||||
Bytes and lines are numbered beginning with one.
|
||||
.PP
|
||||
The following options are available:
|
||||
.IP \fB-l\fR
|
||||
Print the byte number (decimal) and the differing
|
||||
byte values (octal) for each difference.
|
||||
.IP \fB-s\fR
|
||||
Print nothing for differing files; return exit
|
||||
status only.
|
||||
.IP \fB-r\fR
|
||||
Ignore resource forks when comparing.
|
||||
.PP
|
||||
The optional arguments
|
||||
.IR skip1
|
||||
and
|
||||
.IR skip2
|
||||
are the byte offsets from the beginning of
|
||||
.IR file1
|
||||
and
|
||||
.IR file2 ,
|
||||
respectively, where the comparison will begin.
|
||||
The offset is decimal by default, but may be expressed as an hexadecimal
|
||||
or octal value by preceding it with a leading ``0x'' or ``0''.
|
||||
.PP
|
||||
The
|
||||
.BR cmp
|
||||
utility exits with one of the following values:
|
||||
.IP \fB0\fR
|
||||
The files are identical.
|
||||
.IP \fB1\fR
|
||||
The files are different; this includes the case
|
||||
where one file is identical to the first part of
|
||||
the other.
|
||||
In the latter case, if the
|
||||
.IR -s
|
||||
option has not been specified,
|
||||
.BR cmp
|
||||
writes to standard output that EOF was reached in the shorter
|
||||
file (before any differences were found).
|
||||
.IP \fB>1\fR
|
||||
An error occurred.
|
||||
.SH SEE ALSO
|
||||
.BR diff(1),
|
||||
.BR diff3(1)
|
||||
.SH HISTORY
|
||||
The
|
||||
.BR cmp
|
||||
command for GNO/ME v2.0.6 is based on FreeBSD source code.
|
243
bin/cmp/cmp.c
Normal file
243
bin/cmp/cmp.c
Normal file
|
@ -0,0 +1,243 @@
|
|||
/*
|
||||
* Copyright (c) 1987, 1990, 1993, 1994
|
||||
* 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. 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* cmp for GNO/ME v2.0.6
|
||||
*
|
||||
* $Id: cmp.c,v 1.1 1997/10/03 05:13:22 gdr Exp $
|
||||
*/
|
||||
|
||||
#ifndef __GNO__
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
"@(#) Copyright (c) 1987, 1990, 1993, 1994\n\
|
||||
The Regents of the University of California. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
#endif
|
||||
|
||||
#ifndef __GNO__
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)cmp.c 8.3 (Berkeley) 4/2/94";
|
||||
#endif /* not lint */
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <err.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "extern.h"
|
||||
|
||||
int lflag, sflag;
|
||||
#ifdef __GNO__
|
||||
int rflag;
|
||||
#endif
|
||||
|
||||
static void usage __P((void));
|
||||
|
||||
#ifdef __STACK_CHECK__
|
||||
#include <gno/gno.h>
|
||||
|
||||
static void cleanup(void)
|
||||
{
|
||||
(void) fprintf(stderr, "%d\n", _endStackCheck());
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
#ifndef __STDC__
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
#else
|
||||
main(int argc, char *argv[])
|
||||
#endif
|
||||
{
|
||||
struct stat sb1, sb2;
|
||||
off_t skip1, skip2;
|
||||
int ch, fd1, fd2, special;
|
||||
char *file1, *file2;
|
||||
|
||||
#ifdef __STACK_CHECK__
|
||||
atexit(cleanup);
|
||||
_beginStackCheck();
|
||||
#endif
|
||||
|
||||
#ifdef __GNO__
|
||||
while ((ch = getopt(argc, argv, "-lsr")) != -1)
|
||||
#else
|
||||
while ((ch = getopt(argc, argv, "-ls")) != -1)
|
||||
#endif
|
||||
switch (ch) {
|
||||
case 'l': /* print all differences */
|
||||
lflag = 1;
|
||||
break;
|
||||
case 's': /* silent run */
|
||||
sflag = 1;
|
||||
break;
|
||||
#ifdef __GNO__
|
||||
case 'r':
|
||||
rflag = 1; /* ignore resource fork */
|
||||
break;
|
||||
#endif
|
||||
case '-': /* stdin (must be after options) */
|
||||
--optind;
|
||||
goto endargs;
|
||||
case '?':
|
||||
default:
|
||||
usage();
|
||||
}
|
||||
endargs:
|
||||
#ifndef __ORCAC__
|
||||
argv += optind;
|
||||
#else
|
||||
argv = argv + optind;
|
||||
#endif
|
||||
argc -= optind;
|
||||
|
||||
if (lflag && sflag)
|
||||
errx(ERR_EXIT, "only one of -l and -s may be specified");
|
||||
|
||||
if (argc < 2 || argc > 4)
|
||||
usage();
|
||||
|
||||
/* Backward compatibility -- handle "-" meaning stdin. */
|
||||
special = 0;
|
||||
if (strcmp(file1 = argv[0], "-") == 0) {
|
||||
special = 1;
|
||||
fd1 = 0;
|
||||
file1 = "stdin";
|
||||
}
|
||||
#ifndef __GNO__
|
||||
else if ((fd1 = open(file1, O_RDONLY, 0)) < 0) {
|
||||
#else
|
||||
/* open() for GNO/ME requires 3rd arg iff creating file */
|
||||
else if ((fd1 = open(file1, O_RDONLY)) < 0) {
|
||||
#endif
|
||||
if (!sflag)
|
||||
err(ERR_EXIT, "%s", file1);
|
||||
else
|
||||
exit(1);
|
||||
}
|
||||
if (strcmp(file2 = argv[1], "-") == 0) {
|
||||
if (special)
|
||||
errx(ERR_EXIT,
|
||||
"standard input may only be specified once");
|
||||
special = 1;
|
||||
fd2 = 0;
|
||||
file2 = "stdin";
|
||||
}
|
||||
#ifndef __GNO__
|
||||
else if ((fd2 = open(file2, O_RDONLY, 0)) < 0) {
|
||||
#else
|
||||
else if ((fd2 = open(file2, O_RDONLY)) < 0) {
|
||||
#endif
|
||||
if (!sflag)
|
||||
err(ERR_EXIT, "%s", file2);
|
||||
else
|
||||
exit(1);
|
||||
}
|
||||
|
||||
skip1 = argc > 2 ? strtol(argv[2], NULL, 10) : 0;
|
||||
skip2 = argc == 4 ? strtol(argv[3], NULL, 10) : 0;
|
||||
|
||||
#ifndef __GNO__
|
||||
if (!special) {
|
||||
if (fstat(fd1, &sb1)) {
|
||||
if (!sflag)
|
||||
err(ERR_EXIT, "%s", file1);
|
||||
else
|
||||
exit(1);
|
||||
}
|
||||
if (!S_ISREG(sb1.st_mode))
|
||||
special = 1;
|
||||
else {
|
||||
if (fstat(fd2, &sb2)) {
|
||||
if (!sflag)
|
||||
err(ERR_EXIT, "%s", file2);
|
||||
else
|
||||
exit(1);
|
||||
}
|
||||
if (!S_ISREG(sb2.st_mode))
|
||||
special = 1;
|
||||
}
|
||||
}
|
||||
#else
|
||||
special = 1; /* GNO doesn't have mmap.h, so treat every file as
|
||||
a special file and process byte by byte */
|
||||
#endif
|
||||
if (special)
|
||||
#ifdef __GNO__
|
||||
{
|
||||
#endif
|
||||
c_special(fd1, file1, skip1, fd2, file2, skip2);
|
||||
#ifdef __GNO__
|
||||
close(fd1);
|
||||
close(fd2);
|
||||
}
|
||||
|
||||
if (rflag != 1) {
|
||||
rflag = 2;
|
||||
rcmp(&fd1, &fd2, file1, file2);
|
||||
close(fd1);
|
||||
close(fd2);
|
||||
}
|
||||
#else
|
||||
else
|
||||
c_regular(fd1, file1, skip1, sb1.st_size,
|
||||
fd2, file2, skip2, sb2.st_size);
|
||||
#endif
|
||||
/* exit(0); */
|
||||
}
|
||||
|
||||
static void
|
||||
#ifndef __STDC__
|
||||
usage()
|
||||
#else
|
||||
usage(void)
|
||||
#endif
|
||||
{
|
||||
|
||||
(void)fprintf(stderr,
|
||||
#ifndef __GNO__
|
||||
"usage: cmp [-l | -s] file1 file2 [skip1 [skip2]]\n");
|
||||
#else
|
||||
"usage: cmp [-l | -s] [-r] file1 file2 [skip1 [skip2]]\n");
|
||||
#endif
|
||||
exit(ERR_EXIT);
|
||||
}
|
10
bin/cmp/cmp.desc
Normal file
10
bin/cmp/cmp.desc
Normal file
|
@ -0,0 +1,10 @@
|
|||
Name: cmp
|
||||
Version: 2.0 (4 Aug 97)
|
||||
Shell: GNO/ME
|
||||
Author: Evan Day (from FreeBSD source)
|
||||
Contact: day@engr.orst.edu
|
||||
Where: /bin
|
||||
FTP: ftp.gno.org
|
||||
|
||||
cmp compares and reports differences in the dataforks and resource forks
|
||||
of two files.
|
33
bin/cmp/cmp.rez
Normal file
33
bin/cmp/cmp.rez
Normal file
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* $Id: cmp.rez,v 1.3 1997/10/30 02:28:49 gdr Exp $
|
||||
*/
|
||||
#include "Types.Rez"
|
||||
#include "proginfo.rez"
|
||||
|
||||
resource rVersion (0x1, purgeable3, nocrossbank) {
|
||||
|
||||
{ 2, 0, 0, /* version */
|
||||
release, /* development|alpha|beta|final|release */
|
||||
0 /* non-final release number */
|
||||
},
|
||||
verUS, /* country code -- only some are avail */
|
||||
"cmp", /* name */
|
||||
/* _Very_ brief descrition. Check "file info" */
|
||||
/* shown in the Finder to see if it's too long */
|
||||
/* Note that \n is used to separate lines here. */
|
||||
"Compares two files on disk.\n"
|
||||
"Requires GNO/ME Shell.\n"
|
||||
"Evan Day <day@engr.orst.edu>"
|
||||
};
|
||||
|
||||
resource rProgramInfo (0x1, purgeable3, nocrossbank) {
|
||||
{ 6, 0, 1,
|
||||
release,
|
||||
0
|
||||
},
|
||||
80000, /* Rough estimates - the library isn't */
|
||||
80000, /* final yet. */
|
||||
1280,
|
||||
progRequiresGNO+progAppleTalkOK+progAllowsCDAs,
|
||||
piCompatible*ProgShellGSH+piSpecialFeatures*ProgShellGSH
|
||||
};
|
51
bin/cmp/extern.h
Normal file
51
bin/cmp/extern.h
Normal file
|
@ -0,0 +1,51 @@
|
|||
/*-
|
||||
* Copyright (c) 1991, 1993, 1994
|
||||
* 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. 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.
|
||||
*
|
||||
* @(#)extern.h 8.3 (Berkeley) 4/2/94
|
||||
*/
|
||||
|
||||
#define OK_EXIT 0
|
||||
#define DIFF_EXIT 1
|
||||
#define ERR_EXIT 2 /* error exit code */
|
||||
|
||||
void c_regular __P((int, char *, off_t, off_t, int, char *, off_t, off_t));
|
||||
void c_special __P((int, char *, off_t, int, char *, off_t));
|
||||
void diffmsg __P((char *, char *, off_t, off_t));
|
||||
void eofmsg __P((char *));
|
||||
#ifdef __GNO__
|
||||
void rcmp __P((int *, int *, char *, char *));
|
||||
#endif
|
||||
|
||||
extern int lflag, sflag;
|
||||
#ifdef __GNO__
|
||||
extern int rflag;
|
||||
#endif
|
85
bin/cmp/misc.c
Normal file
85
bin/cmp/misc.c
Normal file
|
@ -0,0 +1,85 @@
|
|||
/*-
|
||||
* Copyright (c) 1991, 1993, 1994
|
||||
* 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. 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* part of cmp for GNO/ME v2.0.6
|
||||
*
|
||||
* $Id: misc.c,v 1.1 1997/10/03 05:13:23 gdr Exp $
|
||||
*/
|
||||
|
||||
#ifndef __GNO__
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)misc.c 8.3 (Berkeley) 4/2/94";
|
||||
#endif /* not lint */
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <err.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "extern.h"
|
||||
|
||||
void
|
||||
#ifndef __STDC__
|
||||
eofmsg(file)
|
||||
char *file;
|
||||
#else
|
||||
eofmsg(char *file)
|
||||
#endif
|
||||
{
|
||||
if (!sflag)
|
||||
warnx("EOF on %s", file);
|
||||
exit(DIFF_EXIT);
|
||||
}
|
||||
|
||||
void
|
||||
#ifndef __STDC__
|
||||
diffmsg(file1, file2, byte, line)
|
||||
char *file1, *file2;
|
||||
off_t byte, line;
|
||||
#else
|
||||
diffmsg(char *file1, char *file2, off_t byte, off_t line)
|
||||
#endif
|
||||
{
|
||||
if (!sflag)
|
||||
#ifndef __ORCAC__
|
||||
(void)printf("%s %s differ: char %qd, line %qd\n",
|
||||
file1, file2, byte, line);
|
||||
#else
|
||||
(void)printf("[%s] %s differ: %s char %ld, line %ld\n",
|
||||
(rflag==2) ? "resfork" : "datafork", file1, file2, byte, line);
|
||||
#endif
|
||||
exit(DIFF_EXIT);
|
||||
}
|
52
bin/cmp/rcmp.c
Normal file
52
bin/cmp/rcmp.c
Normal file
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* rcmp.c
|
||||
*
|
||||
* Opens the resource forks of two files and sets the file descriptors to
|
||||
* the open forks (if present).
|
||||
*
|
||||
* Catches files with no resource fork.
|
||||
*
|
||||
* Part of cmp for GNO/ME v2.0.6
|
||||
*
|
||||
* $Id: rcmp.c,v 1.1 1997/10/03 05:13:23 gdr Exp $
|
||||
*/
|
||||
|
||||
#include <gsos.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include "extern.h"
|
||||
|
||||
static GSString255 path;
|
||||
|
||||
void rcmp(int *fd1, int *fd2, char *file1, char *file2)
|
||||
{
|
||||
OpenRecGS ropen = {4, 0, &path, readEnable, 1};
|
||||
|
||||
strcpy(path.text, file1);
|
||||
path.length = strlen(file1);
|
||||
OpenGS(&ropen);
|
||||
*fd1 = ropen.refNum;
|
||||
|
||||
strcpy(path.text, file2);
|
||||
path.length = strlen(file2);
|
||||
OpenGS(&ropen);
|
||||
*fd2 = ropen.refNum;
|
||||
|
||||
if(*fd1 == 0)
|
||||
if(*fd2 == 0)
|
||||
return;
|
||||
else {
|
||||
(void) printf("%s has a resource fork, %s does not.\n",
|
||||
file2, file1);
|
||||
return;
|
||||
}
|
||||
else if(*fd2 == 0) {
|
||||
(void) printf("%s has a resource fork, %s does not.\n", file1,
|
||||
file2);
|
||||
return;
|
||||
}
|
||||
|
||||
c_special(*fd1, file1, 0, *fd2, file2, 0);
|
||||
}
|
156
bin/cmp/regular.c
Normal file
156
bin/cmp/regular.c
Normal file
|
@ -0,0 +1,156 @@
|
|||
/*-
|
||||
* Copyright (c) 1991, 1993, 1994
|
||||
* 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. 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.
|
||||
*
|
||||
* $Id: regular.c,v 1.1 1997/10/03 05:13:23 gdr Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)regular.c 8.3 (Berkeley) 4/2/94";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
#ifndef __GNO__
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <err.h>
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "extern.h"
|
||||
|
||||
#define ROUNDPAGE(i) ((i) & ~pagemask)
|
||||
|
||||
void
|
||||
#ifndef __STDC__
|
||||
c_regular(fd1, file1, skip1, len1, fd2, file2, skip2, len2)
|
||||
int fd1, fd2;
|
||||
char *file1, *file2;
|
||||
off_t skip1, len1, skip2, len2;
|
||||
#else
|
||||
c_regular(int fd1, char *file1, off_t skip1, off_t len1, int fd2, char *file2,
|
||||
off_t skip2, off_t len2)
|
||||
#endif
|
||||
{
|
||||
#ifndef __GNO__
|
||||
u_char ch, *p1, *p2;
|
||||
#else
|
||||
u_char ch, p1, p2;
|
||||
#endif
|
||||
off_t byte, length, line;
|
||||
int dfound;
|
||||
off_t pagemask, off1, off2;
|
||||
|
||||
if (sflag && len1 != len2)
|
||||
exit(1);
|
||||
|
||||
if (skip1 > len1)
|
||||
eofmsg(file1);
|
||||
len1 -= skip1;
|
||||
if (skip2 > len2)
|
||||
eofmsg(file2);
|
||||
len2 -= skip2;
|
||||
|
||||
pagemask = (off_t)getpagesize() - 1;
|
||||
off1 = ROUNDPAGE(skip1);
|
||||
off2 = ROUNDPAGE(skip2);
|
||||
|
||||
length = MIN(len1, len2);
|
||||
#ifndef __ORCAC__
|
||||
if (length > SIZE_T_MAX)
|
||||
return (c_special(fd1, file1, skip1, fd2, file2, skip2));
|
||||
#else
|
||||
if (length > SIZE_T_MAX) {
|
||||
c_special(fd1, file1, skip1, fd2, file2, skip2);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef __GNO__
|
||||
if ((p1 = (u_char *)mmap(NULL,
|
||||
(size_t)length, PROT_READ, MAP_SHARED, fd1, off1)) == (u_char *)MAP_FAILED)
|
||||
err(ERR_EXIT, "%s", file1);
|
||||
|
||||
madvise(p1, length, MADV_SEQUENTIAL);
|
||||
if ((p2 = (u_char *)mmap(NULL,
|
||||
(size_t)length, PROT_READ, MAP_SHARED, fd2, off2)) == (u_char *)MAP_FAILED)
|
||||
err(ERR_EXIT, "%s", file2);
|
||||
madvise(p2, length, MADV_SEQUENTIAL);
|
||||
|
||||
dfound = 0;
|
||||
p1 += skip1 - off1;
|
||||
p2 += skip2 - off2;
|
||||
for (byte = line = 1; length--; ++p1, ++p2, ++byte) {
|
||||
if ((ch = *p1) != *p2)
|
||||
if (lflag) {
|
||||
dfound = 1;
|
||||
(void)printf("%6qd %3o %3o\n", byte, ch, *p2);
|
||||
} else
|
||||
diffmsg(file1, file2, byte, line);
|
||||
/* NOTREACHED */
|
||||
if (ch == '\n')
|
||||
++line;
|
||||
}
|
||||
|
||||
if (len1 != len2)
|
||||
eofmsg (len1 > len2 ? file2 : file1);
|
||||
if (dfound)
|
||||
exit(DIFF_EXIT);
|
||||
#else
|
||||
dfound = 0;
|
||||
lseek(fd1, skip1, SEEK_SET);
|
||||
lseek(fd2, skip2, SEEK_SET);
|
||||
for (byte = line = 1; length--; ++byte) {
|
||||
read(fd1, (void *) &p1, 1);
|
||||
read(fd2, (void *) &p2, 1);
|
||||
if (p1 != p2)
|
||||
if (lflag) {
|
||||
dfound = 1;
|
||||
(void)printf("%6qd %3o %3o\n", byte, ch, p2);
|
||||
} else
|
||||
diffmsg(file1, file2, byte, line);
|
||||
/* NOTREACHED */
|
||||
if (p1 == '\n')
|
||||
++line;
|
||||
}
|
||||
|
||||
if (len1 != len2)
|
||||
eofmsg (len1 > len2 ? file2 : file1);
|
||||
if (dfound)
|
||||
exit(DIFF_EXIT);
|
||||
#endif
|
||||
|
||||
}
|
116
bin/cmp/special.c
Normal file
116
bin/cmp/special.c
Normal file
|
@ -0,0 +1,116 @@
|
|||
/*-
|
||||
* Copyright (c) 1991, 1993, 1994
|
||||
* 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. 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Part of cmp for GNO/ME v2.0.6
|
||||
*
|
||||
* $Id: special.c,v 1.1 1997/10/03 05:13:23 gdr Exp $
|
||||
*/
|
||||
|
||||
#ifndef __GNO__
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)special.c 8.3 (Berkeley) 4/2/94";
|
||||
#endif /* not lint */
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <err.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "extern.h"
|
||||
|
||||
void
|
||||
#ifndef __STDC__
|
||||
c_special(fd1, file1, skip1, fd2, file2, skip2)
|
||||
int fd1, fd2;
|
||||
char *file1, *file2;
|
||||
off_t skip1, skip2;
|
||||
#else
|
||||
c_special(int fd1, char *file1, off_t skip1, int fd2, char *file2, off_t skip2)
|
||||
#endif
|
||||
{
|
||||
int ch1, ch2;
|
||||
off_t byte, line;
|
||||
FILE *fp1, *fp2;
|
||||
int dfound;
|
||||
|
||||
if ((fp1 = fdopen(fd1, "r")) == NULL)
|
||||
err(ERR_EXIT, "%s", file1);
|
||||
if ((fp2 = fdopen(fd2, "r")) == NULL)
|
||||
err(ERR_EXIT, "%s", file2);
|
||||
|
||||
dfound = 0;
|
||||
while (skip1--)
|
||||
if (getc(fp1) == EOF)
|
||||
goto eof;
|
||||
while (skip2--)
|
||||
if (getc(fp2) == EOF)
|
||||
goto eof;
|
||||
|
||||
for (byte = line = 1;; ++byte) {
|
||||
ch1 = getc(fp1);
|
||||
ch2 = getc(fp2);
|
||||
if (ch1 == EOF || ch2 == EOF)
|
||||
break;
|
||||
if (ch1 != ch2) {
|
||||
if (lflag) {
|
||||
dfound = 1;
|
||||
#ifndef __GNO__
|
||||
(void)printf("%6qd %3o %3o\n", byte, ch1, ch2);
|
||||
#else
|
||||
(void)printf("%c%6ld %3o %3o\n", (rflag==2)? 'R' : 'D', byte, ch1, ch2);
|
||||
#endif
|
||||
} else
|
||||
diffmsg(file1, file2, byte, line);
|
||||
/* NOTREACHED */
|
||||
}
|
||||
if (ch1 == '\n')
|
||||
++line;
|
||||
}
|
||||
|
||||
eof: if (ferror(fp1))
|
||||
err(ERR_EXIT, "%s", file1);
|
||||
if (ferror(fp2))
|
||||
err(ERR_EXIT, "%s", file2);
|
||||
if (feof(fp1)) {
|
||||
if (!feof(fp2))
|
||||
eofmsg(file1);
|
||||
} else
|
||||
if (feof(fp2))
|
||||
eofmsg(file2);
|
||||
if (dfound)
|
||||
exit(DIFF_EXIT);
|
||||
}
|
6
bin/date/NOTES
Normal file
6
bin/date/NOTES
Normal file
|
@ -0,0 +1,6 @@
|
|||
date.asm is 41% faster and one third of the size of date.c, the
|
||||
original. Also uses 60% less stack space. Assembly can really make a
|
||||
hell of a difference.
|
||||
|
||||
Will work under GNO or ORCA. Also fixes two small problems with the
|
||||
original date utility.
|
34
bin/date/README
Normal file
34
bin/date/README
Normal file
|
@ -0,0 +1,34 @@
|
|||
date
|
||||
====
|
||||
|
||||
I wrote this just so I could see how much smaller than asm version would be
|
||||
as compared to the C version. It turned out to be a great deal smaller, and
|
||||
faster too - even with its additional options which I added later.
|
||||
|
||||
-V Version info.
|
||||
|
||||
-u continuously update the date on the screen. Killing the process will
|
||||
force a "clean" exit.
|
||||
|
||||
mkfs
|
||||
====
|
||||
|
||||
Basically FormatGS and EraseDiskGS in one. I was tired of using an old "Init"
|
||||
program from ORCA 1.x, so I wrote a GNO one. This one supports specifying
|
||||
the file system by name in addition to the options the old Init used to
|
||||
support.
|
||||
|
||||
See the manpage for details.
|
||||
|
||||
cal
|
||||
===
|
||||
|
||||
Yeah, I did it again. I wrote a program that already existed. (notice that all
|
||||
the files in this archive are this type of program). So what, it didn't take
|
||||
long!
|
||||
|
||||
I didn't rewrite this one from scratch. I just added a few lines to the "cal"
|
||||
that came with GNO (1.0) so that it would print a calendar for the current
|
||||
month if no month is specified. This is how UNIX cal behaves.
|
||||
|
||||
This is the very first thing I did when I got ORCA/C (Finally!) last week.
|
274
bin/date/date.asm
Normal file
274
bin/date/date.asm
Normal file
|
@ -0,0 +1,274 @@
|
|||
* asm version of date utility
|
||||
|
||||
* Phillip Vandry, May 1993
|
||||
|
||||
mcopy date.mac
|
||||
keep date
|
||||
copy 13/asmdefs/gno/e16.ioctl
|
||||
|
||||
cline gequ 0
|
||||
|
||||
main start
|
||||
phk
|
||||
plb
|
||||
sty cline
|
||||
stx cline+2
|
||||
stz uflag
|
||||
ldy #8
|
||||
lpp15 lda [cline],y
|
||||
and #$ff
|
||||
beq ok
|
||||
iny
|
||||
cmp #$20
|
||||
bne lpp15
|
||||
lpp20 lda [cline],y
|
||||
and #$ff
|
||||
beq ok
|
||||
iny
|
||||
cmp #$20
|
||||
beq lpp20
|
||||
cmp #$22
|
||||
beq lpp20
|
||||
cmp #'-'
|
||||
bne showusg
|
||||
lda [cline],y
|
||||
and #$ff
|
||||
cmp #'V'
|
||||
beq showvers
|
||||
cmp #'c'
|
||||
beq updateflag
|
||||
showusg ~ErrWriteCString #usage
|
||||
bra getoutPASS
|
||||
showvers ~WriteCString #versstr
|
||||
getoutPASS brl getout
|
||||
updateflag inc uflag
|
||||
ok anop
|
||||
lda #2 ; SIGINT
|
||||
jsr handle
|
||||
lda #15 ; SIGTERM
|
||||
jsr handle
|
||||
|
||||
pha
|
||||
pea 2 ; stdout
|
||||
pea TIOCGETP|-16
|
||||
pea TIOCGETP
|
||||
pea sgttyb|-16
|
||||
pea sgttyb
|
||||
pea errno|-16
|
||||
pea errno
|
||||
ldx #$2603
|
||||
jsl $e10008
|
||||
pla
|
||||
|
||||
lda sgttyb+4
|
||||
sta oldflags
|
||||
and #$ffef
|
||||
sta sgttyb+4
|
||||
|
||||
jsr csetp
|
||||
|
||||
lda oldflags
|
||||
sta sgttyb+4
|
||||
|
||||
refresh anop
|
||||
pha
|
||||
pha
|
||||
pha
|
||||
pha
|
||||
~ReadTimeHex
|
||||
lda #year+3
|
||||
sta cline
|
||||
lda 4,s
|
||||
and #$ff
|
||||
clc
|
||||
adc #1900
|
||||
ldx #4
|
||||
jsr insert
|
||||
lda 1,s
|
||||
and #$ff
|
||||
ldx #2
|
||||
jsr insert
|
||||
jsr unpad
|
||||
pla
|
||||
xba
|
||||
and #$ff
|
||||
ldx #2
|
||||
jsr insert
|
||||
jsr unpad
|
||||
pla
|
||||
and #$ff
|
||||
ldx #2
|
||||
jsr insert
|
||||
jsr unpad
|
||||
lda 1,s
|
||||
and #$ff
|
||||
inc a
|
||||
ldx #2
|
||||
jsr insert
|
||||
phk
|
||||
plb
|
||||
pla
|
||||
jsr lookup
|
||||
lda months,x
|
||||
sta month
|
||||
lda months+1,x
|
||||
sta month+1
|
||||
pla
|
||||
jsr lookup
|
||||
lda weekdays-3,x
|
||||
sta weekday
|
||||
lda weekdays-2,x
|
||||
sta weekday+1
|
||||
WriteGS ramit
|
||||
lda uflag
|
||||
beq exitall
|
||||
pea 1
|
||||
case on
|
||||
jsl sleep
|
||||
case off
|
||||
brl refresh
|
||||
exitall WriteGS justnewl
|
||||
jsr csetp
|
||||
getout QuitGS qtrec
|
||||
|
||||
csetp anop
|
||||
pha
|
||||
pea 2
|
||||
pea TIOCSETP|-16
|
||||
pea TIOCSETP
|
||||
pea sgttyb|-16
|
||||
pea sgttyb
|
||||
pea errno|-16
|
||||
pea errno
|
||||
ldx #$2603
|
||||
jsl $e10008
|
||||
pla
|
||||
rts
|
||||
|
||||
uflag ds 2
|
||||
|
||||
handler anop
|
||||
phb
|
||||
plx
|
||||
ply
|
||||
pla
|
||||
pla
|
||||
phy
|
||||
phx
|
||||
plb
|
||||
lda #1
|
||||
case on
|
||||
sta >ringring
|
||||
case off
|
||||
lda #0
|
||||
sta >uflag
|
||||
rtl
|
||||
|
||||
handle anop
|
||||
pha
|
||||
pha
|
||||
pha
|
||||
pea handler|-16
|
||||
pea handler
|
||||
pea errno|-16
|
||||
pea errno
|
||||
ldx #$1603
|
||||
jsl $e10008
|
||||
pla
|
||||
pla
|
||||
rts
|
||||
|
||||
lookup xba
|
||||
and #$ff
|
||||
pha
|
||||
asl a
|
||||
asl a
|
||||
sec
|
||||
sbc 1,s
|
||||
tax
|
||||
pla
|
||||
rts
|
||||
|
||||
unpad ldx cline
|
||||
phk
|
||||
plb
|
||||
short m
|
||||
lda |0,x
|
||||
cmp #$20
|
||||
bne allok
|
||||
lda #'0'
|
||||
sta |0,x
|
||||
allok long m
|
||||
rts
|
||||
|
||||
insert pha ; thenum
|
||||
pea 0
|
||||
plb
|
||||
phk
|
||||
lda cline
|
||||
dec a
|
||||
dec a
|
||||
dec a
|
||||
sta cline
|
||||
pha
|
||||
phx
|
||||
pea 0
|
||||
~Int2Dec *,*,*,*
|
||||
rts
|
||||
|
||||
string anop
|
||||
|
||||
qtrec dc i'2'
|
||||
dc a4'0'
|
||||
dc i'$4000'
|
||||
|
||||
ramit dc i'4'
|
||||
dc i'2'
|
||||
dc a4'strbeg'
|
||||
dc i4'strend-strbeg'
|
||||
ds 4
|
||||
|
||||
sgttyb ds 6
|
||||
oldflags ds 2
|
||||
|
||||
strbeg anop
|
||||
|
||||
weekday dc c'xxx '
|
||||
month dc c'xxx '
|
||||
day dc c'xx '
|
||||
hour dc c'xx:'
|
||||
minute dc c'xx:'
|
||||
second dc c'xx '
|
||||
year dc c'xxxx'
|
||||
|
||||
dc h'0d'
|
||||
|
||||
strend anop
|
||||
|
||||
justnewl dc i'4'
|
||||
dc i'2'
|
||||
dc a4'justnewl1'
|
||||
dc i4'1'
|
||||
ds 4
|
||||
justnewl1 dc h'0a'
|
||||
|
||||
weekdays dc c'SunMonTueWedThuFriSat'
|
||||
months dc c'JanFebMarAprMayJunJulAugSepOctNovDec'
|
||||
|
||||
versstr dc c'date utility, asm version 1.1'
|
||||
dc h'0d 0a'
|
||||
usage dc c'usage: date [-cV]',h'0d 0a'
|
||||
dc h'0'
|
||||
end
|
||||
|
||||
errno data
|
||||
ds 2
|
||||
end
|
||||
|
||||
copy modsleep.asm
|
||||
|
||||
dpstk data ~Direct
|
||||
kind $12
|
||||
ds 512
|
||||
end
|
||||
|
|
@ -1,16 +1,15 @@
|
|||
macro
|
||||
&lab ~DisposeHandle &p1
|
||||
&lab ph4 &p1
|
||||
ldx #$1002
|
||||
&l ~Int2Dec &p1,&p2,&p3,&p4
|
||||
&l ph2 &p1
|
||||
ph4 &p2
|
||||
ph2 &p3
|
||||
ph2 &p4
|
||||
ldx #$260B
|
||||
jsl $E10000
|
||||
mend
|
||||
macro
|
||||
&lab ~NewHandle &p1,&p2,&p3,&p4
|
||||
&lab ph4 &p1
|
||||
ph2 &p2
|
||||
ph2 &p2
|
||||
ph4 &p4
|
||||
ldx #$0902
|
||||
&l ~ReadTimeHex
|
||||
&l ldx #$0D03
|
||||
jsl $E10000
|
||||
mend
|
||||
macro
|
||||
|
@ -56,7 +55,6 @@
|
|||
pha
|
||||
ago .e
|
||||
.c
|
||||
&n1 amid &n1,2,l:&n1-1
|
||||
pei &n1
|
||||
ago .e
|
||||
.d
|
||||
|
@ -101,7 +99,6 @@
|
|||
ago .e
|
||||
.c
|
||||
aif "&c"<>"<",.c1
|
||||
&n1 amid &n1,2,l:&n1-1
|
||||
pei &n1+2
|
||||
pei &n1
|
||||
ago .e
|
||||
|
@ -144,3 +141,33 @@
|
|||
longi off
|
||||
.c
|
||||
mend
|
||||
macro
|
||||
&l quitgs &p
|
||||
&l jsl $E100A8
|
||||
dc i2'$2029'
|
||||
dc i4'&p'
|
||||
mend
|
||||
macro
|
||||
&l writegs &p
|
||||
&l jsl $E100A8
|
||||
dc i2'$2013'
|
||||
dc i4'&p'
|
||||
mend
|
||||
macro
|
||||
&l ~ErrWriteCString &p1
|
||||
&l ph4 &p1
|
||||
ldx #$210C
|
||||
jsl $E10000
|
||||
mend
|
||||
macro
|
||||
&l ~WriteCString &p1
|
||||
&l ph4 &p1
|
||||
ldx #$200C
|
||||
jsl $E10000
|
||||
mend
|
||||
macro
|
||||
&l ~WriteString &p1
|
||||
&l ph4 &p1
|
||||
ldx #$1C0C
|
||||
jsl $E10000
|
||||
mend
|
174
bin/date/modsleep.asm
Normal file
174
bin/date/modsleep.asm
Normal file
|
@ -0,0 +1,174 @@
|
|||
* Modified sleep routine based on sleep in libgno
|
||||
|
||||
* It was necesary to disassemble this routine and reassemble it so that
|
||||
* date.asm can use its private variables. It needs to do this to make
|
||||
* date abort when it is in the middle of a sleep()
|
||||
|
||||
* Phillip Vandry, May 1993
|
||||
|
||||
case on
|
||||
|
||||
sleep start
|
||||
tsc
|
||||
sec
|
||||
sbc #$0014
|
||||
tcs
|
||||
phd
|
||||
tcd
|
||||
ldx $07
|
||||
phx
|
||||
tsx
|
||||
stx $07
|
||||
pea sleephandler|-16
|
||||
pea sleephandler
|
||||
pea 14
|
||||
jsl signal
|
||||
tay
|
||||
lda $07
|
||||
tcs
|
||||
pla
|
||||
sta $07
|
||||
tya
|
||||
phx
|
||||
pha
|
||||
lda $01,s
|
||||
sta $0d
|
||||
lda $03,s
|
||||
sta $0f
|
||||
pla
|
||||
pla
|
||||
ldx $07
|
||||
phx
|
||||
tsx
|
||||
stx $07
|
||||
pea $0000
|
||||
pea $2000
|
||||
jsl sigblock
|
||||
tay
|
||||
lda $07
|
||||
tcs
|
||||
pla
|
||||
sta $07
|
||||
tya
|
||||
phx
|
||||
pha
|
||||
lda $01,s
|
||||
sta $11
|
||||
lda $03,s
|
||||
sta $13
|
||||
pla
|
||||
pla
|
||||
lda #$0000
|
||||
sta ringring
|
||||
ldx $07
|
||||
phx
|
||||
tsx
|
||||
stx $07
|
||||
lda $18
|
||||
ldx #$0000
|
||||
phx
|
||||
pha
|
||||
jsl alarm
|
||||
tay
|
||||
lda $07
|
||||
tcs
|
||||
pla
|
||||
sta $07
|
||||
tya
|
||||
checkrr anop
|
||||
lda ringring
|
||||
tax
|
||||
beq theeor
|
||||
lda #$0001
|
||||
theeor eor #$0001
|
||||
bne nojump
|
||||
brl afterbrl
|
||||
nojump ldx $07
|
||||
phx
|
||||
tsx
|
||||
stx $07
|
||||
pei $13
|
||||
pei $11
|
||||
pla
|
||||
and #$dfff
|
||||
pha
|
||||
jsl sigpause
|
||||
tay
|
||||
lda $07
|
||||
tcs
|
||||
pla
|
||||
sta $07
|
||||
tya
|
||||
brl checkrr
|
||||
afterbrl ldx $07
|
||||
phx
|
||||
tsx
|
||||
stx $07
|
||||
ldx $0f
|
||||
lda $0d
|
||||
phx
|
||||
pha
|
||||
lda #$000e
|
||||
pha
|
||||
jsl signal
|
||||
tay
|
||||
lda $07
|
||||
tcs
|
||||
pla
|
||||
sta $07
|
||||
tya
|
||||
ldx $07
|
||||
phx
|
||||
tsx
|
||||
stx $07
|
||||
ldx $13
|
||||
lda $11
|
||||
phx
|
||||
pha
|
||||
jsl sigsetmask
|
||||
tay
|
||||
lda $07
|
||||
tcs
|
||||
pla
|
||||
sta $07
|
||||
tya
|
||||
lda $16
|
||||
sta $18
|
||||
lda $15
|
||||
sta $17
|
||||
ldy $05
|
||||
pld
|
||||
tsc
|
||||
clc
|
||||
adc #$0016
|
||||
tcs
|
||||
tya
|
||||
rtl
|
||||
end
|
||||
|
||||
sleephandler start
|
||||
tsc
|
||||
sec
|
||||
sbc #$0006
|
||||
tcs
|
||||
phd
|
||||
tcd
|
||||
lda #$0001
|
||||
sta ringring
|
||||
lda $08
|
||||
sta $0c
|
||||
lda $07
|
||||
sta $0b
|
||||
pld
|
||||
tsc
|
||||
clc
|
||||
adc #$000a
|
||||
tcs
|
||||
rtl
|
||||
end
|
||||
|
||||
ringring data
|
||||
ds 2
|
||||
end
|
||||
|
||||
case off
|
25
bin/df/Makefile
Normal file
25
bin/df/Makefile
Normal file
|
@ -0,0 +1,25 @@
|
|||
#
|
||||
# This makefile is intended for use with dmake(1) on Apple IIGS
|
||||
#
|
||||
# Created by Dave Tribby, August 1997
|
||||
# Modified by Evan Day, September 1997
|
||||
#
|
||||
# $Id: Makefile,v 1.2 1998/02/19 02:12:18 gdr-ftp Exp $
|
||||
|
||||
PROG= df
|
||||
SRCS= df.c gnodf.c
|
||||
|
||||
# If optimization wasn't set on the command line use 79, since
|
||||
# df has been tested to work at that level.
|
||||
OPTIMIZE *= 79
|
||||
|
||||
# Current implementation is using 960 bytes give or take
|
||||
STACK = 1024
|
||||
|
||||
.INCLUDE : /src/gno/prog.mk
|
||||
|
||||
#
|
||||
# Additional dependancies
|
||||
#
|
||||
df.o: df.h
|
||||
gnodf.o: df.h
|
104
bin/df/df.1
Normal file
104
bin/df/df.1
Normal file
|
@ -0,0 +1,104 @@
|
|||
.\" Copyright (c) 1989, 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. 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.
|
||||
.\"
|
||||
.\" @(#)df.1 8.3 (Berkeley) 5/8/95
|
||||
.\"
|
||||
.\" $Id: df.1,v 1.1 1997/10/03 05:42:18 gdr Exp $
|
||||
.\"
|
||||
.TH DF 1 "04 August 1997" GNO "Commands and Applications"
|
||||
.SH NAME
|
||||
.BR df
|
||||
\- display free disk space and disk usage statistics
|
||||
.SH SYNOPSIS
|
||||
.BR df " [" -k "] [" -t
|
||||
.IR "FST list"
|
||||
]
|
||||
.IR devnum
|
||||
|
|
||||
.IR vol
|
||||
|
|
||||
.IR file ...
|
||||
.SH DESCRIPTION
|
||||
displays statistics about the amount of free disk space on the
|
||||
specified device number
|
||||
.IR devnum
|
||||
(.d##), on the specified volume
|
||||
.IR vol
|
||||
or on the volume of which
|
||||
.IR file
|
||||
is a part. More than one device number, volume, or file may be
|
||||
listed, and types can be mixed in the argument list.
|
||||
.LP
|
||||
Values are displayed in 512-byte per block block counts.
|
||||
If neither a file or a filesystem operand is specified,
|
||||
statistics for all mounted filesystems are displayed.
|
||||
Devices without valid media (e.g. a 3.5" disk drive with
|
||||
no disk in the drive) are not included in the output.
|
||||
.SH OPTIONS
|
||||
The following options are available:
|
||||
.IP \fB-k\fR
|
||||
Use 1024-byte (1-Kbyte) blocks rather than the default. Note
|
||||
that this overrides the
|
||||
.BR BLOCKSIZE
|
||||
specification from the environment.
|
||||
.IP "\fB-t\fR \fIfst1,...,fstN\fR"
|
||||
Only print out statistics for filesystems of the specified types.
|
||||
More than one type may be specified in a comma separated list.
|
||||
The list of filesystem types can be prefixed with
|
||||
.IR no
|
||||
to specify the filesystem types for which action should
|
||||
not be taken.
|
||||
.LP
|
||||
For example, the
|
||||
.BR df
|
||||
command:
|
||||
.nf
|
||||
df -t nohfs,msdos
|
||||
.fi
|
||||
lists all filesystems except those of type
|
||||
.IR HFS
|
||||
and
|
||||
.IR MS-DOS
|
||||
.LP
|
||||
Acceptable filesystem types are as follows:
|
||||
.IP
|
||||
prodos, dos33, dos32, pascal, mfs, hfs, lisa, cpm,
|
||||
msdos, highsierra, iso9660, appleshare.
|
||||
.SH ENVIRONMENT VARIABLES
|
||||
.IP \fBBLOCKSIZE\fR
|
||||
If the environment variable
|
||||
.BR BLOCKSIZE
|
||||
is set, the block counts will be displayed in units of that size block.
|
||||
.SH HISTORY
|
||||
.BR df
|
||||
for GNO/ME was originally built-in to gsh(1). The implementation of
|
||||
.BR df
|
||||
is based on FreeBSD source code and distributed with GNO/ME v2.0.6
|
510
bin/df/df.c
Normal file
510
bin/df/df.c
Normal file
|
@ -0,0 +1,510 @@
|
|||
/*
|
||||
* Copyright (c) 1980, 1990, 1993, 1994
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
* (c) UNIX System Laboratories, Inc.
|
||||
* All or some portions of this file are derived from material licensed
|
||||
* to the University of California by American Telephone and Telegraph
|
||||
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
|
||||
* the permission of UNIX System Laboratories, 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. 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.
|
||||
*
|
||||
* $Id: df.c,v 1.1 1997/10/03 05:42:18 gdr Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
* df for GNO/ME v2.0.6
|
||||
* $ID$
|
||||
*/
|
||||
|
||||
#ifndef __GNO__
|
||||
#ifndef lint
|
||||
static char const copyright[] =
|
||||
"@(#) Copyright (c) 1980, 1990, 1993, 1994\n\
|
||||
The Regents of the University of California. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
#endif
|
||||
|
||||
#ifndef __GNO__
|
||||
#ifndef lint
|
||||
static char const sccsid[] = "@(#)df.c 8.9 (Berkeley) 5/8/95";
|
||||
#endif /* not lint */
|
||||
#endif
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/stat.h>
|
||||
#ifndef __GNO__
|
||||
#include <sys/mount.h>
|
||||
#include <ufs/ufs/ufsmount.h>
|
||||
#else
|
||||
#include "df.h"
|
||||
#endif
|
||||
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#ifndef __GNO__
|
||||
int checkvfsname __P((const char *, char **));
|
||||
char **makevfslist __P((char *));
|
||||
#else
|
||||
void makevfslist __P((char *));
|
||||
#endif
|
||||
#ifndef __GNO__
|
||||
long regetmntinfo __P((struct statfs **, long, char **));
|
||||
int bread __P((off_t, void *, int));
|
||||
char *getmntpt __P((char *));
|
||||
#endif
|
||||
void prtstat __P((struct statfs *, int));
|
||||
#ifndef __GNO__
|
||||
void ufs_df __P((char *, int));
|
||||
#endif
|
||||
void usage __P((void));
|
||||
|
||||
int iflag, nflag;
|
||||
struct ufs_args mdev;
|
||||
|
||||
#ifdef __STACK_CHECK__
|
||||
#include <gno/gno.h>
|
||||
|
||||
static void cleanup(void)
|
||||
{
|
||||
(void) fprintf(stderr, "Stack Usage: %d\n", _endStackCheck());
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
The #ifdef's get quite messy, as there are certain filesystem things that
|
||||
GNO/ME doesn't handle the same as UNIX. A lot of code is #ifdef'd out, but
|
||||
left here with the thought that in the future some of it may be useful as
|
||||
new libraries or FSTs are created.
|
||||
|
||||
The files gnodf.c contains a couple of UNIX library functions I've recreated
|
||||
well enough to work for this applications, but I wouldn't even think of
|
||||
adding to a library...
|
||||
|
||||
In particular, I muck with the statfs structure. DO NOT CALL statfs() or
|
||||
fstatfs() with this structure. It may work and may cause a crash. This
|
||||
structure is strictly for use with df(1) and the hacked functions in gnodf.c
|
||||
which fill in fields with GS/OS calls, not kernel calls.
|
||||
*/
|
||||
|
||||
int
|
||||
#ifndef __STDC__
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
#else
|
||||
main(int argc, char *argv[])
|
||||
#endif
|
||||
{
|
||||
struct stat stbuf;
|
||||
struct statfs statfsbuf, *mntbuf;
|
||||
long mntsize;
|
||||
int ch, err, i, maxwidth, width;
|
||||
#ifndef __GNO__
|
||||
char *mntpt, **vfslist;
|
||||
|
||||
vfslist = NULL;
|
||||
#else
|
||||
char *mntpt;
|
||||
#endif
|
||||
|
||||
#ifdef __STACK_CHECK__
|
||||
atexit(cleanup);
|
||||
_beginStackCheck();
|
||||
#endif
|
||||
|
||||
#ifndef __GNO__
|
||||
while ((ch = getopt(argc, argv, "iknt:")) != -1)
|
||||
#else
|
||||
while ((ch = getopt(argc, argv, "kt:")) != -1)
|
||||
#endif
|
||||
switch (ch) {
|
||||
#ifndef __GNO__
|
||||
case 'i':
|
||||
iflag = 1;
|
||||
break;
|
||||
#endif
|
||||
case 'k':
|
||||
putenv("BLOCKSIZE=1k");
|
||||
break;
|
||||
#ifndef __GNO__
|
||||
case 'n':
|
||||
nflag = 1;
|
||||
break;
|
||||
#endif
|
||||
case 't':
|
||||
#ifndef __GNO__
|
||||
if (vfslist != NULL)
|
||||
#else
|
||||
if (vfslist[14])
|
||||
#endif
|
||||
errx(1, "only one -t option may be specified.");
|
||||
#ifndef __GNO__
|
||||
vfslist = makevfslist(optarg);
|
||||
#else
|
||||
makevfslist(optarg);
|
||||
#endif
|
||||
break;
|
||||
case '?':
|
||||
default:
|
||||
usage();
|
||||
}
|
||||
argc -= optind;
|
||||
#ifndef __ORCAC__
|
||||
argv += optind;
|
||||
#else
|
||||
argv = argv + optind;
|
||||
#endif
|
||||
|
||||
mntsize = getmntinfo(&mntbuf, MNT_NOWAIT);
|
||||
maxwidth = 0;
|
||||
for (i = 0; i < mntsize; i++) {
|
||||
width = strlen(mntbuf[i].f_mntfromname);
|
||||
if (width > maxwidth)
|
||||
maxwidth = width;
|
||||
}
|
||||
|
||||
if (!*argv) {
|
||||
#ifndef __GNO__
|
||||
mntsize = regetmntinfo(&mntbuf, mntsize, vfslist);
|
||||
if (vfslist != NULL) {
|
||||
maxwidth = 0;
|
||||
for (i = 0; i < mntsize; i++) {
|
||||
width = strlen(mntbuf[i].f_mntfromname);
|
||||
if (width > maxwidth)
|
||||
maxwidth = width;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
for (i = 0; i < mntsize; i++)
|
||||
prtstat(&mntbuf[i], maxwidth);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
for (; *argv; argv++) {
|
||||
if (stat(*argv, &stbuf) < 0) {
|
||||
err = errno;
|
||||
#ifndef __GNO__
|
||||
if ((mntpt = getmntpt(*argv)) == 0) {
|
||||
warn("%s", *argv);
|
||||
continue;
|
||||
}
|
||||
#else
|
||||
warn("%s", *argv);
|
||||
continue;
|
||||
#endif
|
||||
#ifndef __GNO__
|
||||
} else if ((stbuf.st_mode & S_IFMT) == S_IFCHR) {
|
||||
ufs_df(*argv, maxwidth);
|
||||
continue;
|
||||
} else if ((stbuf.st_mode & S_IFMT) == S_IFBLK) {
|
||||
if ((mntpt = getmntpt(*argv)) == 0) {
|
||||
mntpt = mktemp(strdup("/tmp/df.XXXXXX"));
|
||||
mdev.fspec = *argv;
|
||||
if (mkdir(mntpt, DEFFILEMODE) != 0) {
|
||||
warn("%s", mntpt);
|
||||
continue;
|
||||
}
|
||||
if (mount("ufs", mntpt, MNT_RDONLY,
|
||||
&mdev) != 0) {
|
||||
ufs_df(*argv, maxwidth);
|
||||
(void)rmdir(mntpt);
|
||||
continue;
|
||||
} else if (statfs(mntpt, &statfsbuf) == 0) {
|
||||
statfsbuf.f_mntonname[0] = '\0';
|
||||
prtstat(&statfsbuf, maxwidth);
|
||||
} else
|
||||
warn("%s", *argv);
|
||||
(void)unmount(mntpt, 0);
|
||||
(void)rmdir(mntpt);
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
} else
|
||||
mntpt = *argv;
|
||||
/*
|
||||
* Statfs does not take a `wait' flag, so we cannot
|
||||
* implement nflag here.
|
||||
*/
|
||||
|
||||
#ifndef __GNO__
|
||||
if (statfs(mntpt, &statfsbuf) < 0) {
|
||||
warn("%s", mntpt);
|
||||
continue;
|
||||
}
|
||||
#else
|
||||
strcpy(statfsbuf.f_mntonname, mntpt);
|
||||
if (nameinfo(&statfsbuf) < 0) {
|
||||
warn("%s", statfsbuf.f_mntonname);
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (argc == 1)
|
||||
maxwidth = strlen(statfsbuf.f_mntfromname) + 1;
|
||||
prtstat(&statfsbuf, maxwidth);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
#ifndef __GNO__
|
||||
char *
|
||||
#ifndef __STDC__
|
||||
getmntpt(name)
|
||||
char *name;
|
||||
#else
|
||||
getmntpt(char *name)
|
||||
#endif
|
||||
{
|
||||
long mntsize, i;
|
||||
struct statfs *mntbuf;
|
||||
|
||||
mntsize = getmntinfo(&mntbuf, MNT_NOWAIT);
|
||||
for (i = 0; i < mntsize; i++) {
|
||||
if (!strcmp(mntbuf[i].f_mntfromname, name))
|
||||
return (mntbuf[i].f_mntonname);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef __GNO__
|
||||
/*
|
||||
* Make a pass over the filesystem info in ``mntbuf'' filtering out
|
||||
* filesystem types not in vfslist and possibly re-stating to get
|
||||
* current (not cached) info. Returns the new count of valid statfs bufs.
|
||||
*/
|
||||
long
|
||||
#ifndef __STDC__
|
||||
regetmntinfo(mntbufp, mntsize, vfslist)
|
||||
struct statfs **mntbufp;
|
||||
long mntsize;
|
||||
char **vfslist;
|
||||
#else
|
||||
regetmntinfo(struct fsinfo **mntbufp, long mntsize, char **vfslist)
|
||||
#endif
|
||||
{
|
||||
int i, j;
|
||||
struct statfs *mntbuf;
|
||||
|
||||
if (vfslist == NULL)
|
||||
return (nflag ? mntsize : getmntinfo(mntbufp, MNT_WAIT));
|
||||
|
||||
mntbuf = *mntbufp;
|
||||
for (j = 0, i = 0; i < mntsize; i++) {
|
||||
if (checkvfsname(mntbuf[i].f_fstypename, vfslist))
|
||||
continue;
|
||||
if (!nflag)
|
||||
(void)statfs(mntbuf[i].f_mntonname,&mntbuf[j]);
|
||||
else if (i != j)
|
||||
mntbuf[j] = mntbuf[i];
|
||||
j++;
|
||||
}
|
||||
return (j);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Convert statfs returned filesystem size into BLOCKSIZE units.
|
||||
* Attempts to avoid overflow for large filesystems.
|
||||
*/
|
||||
#define fsbtoblk(num, fsbs, bs) \
|
||||
(((fsbs) != 0 && (fsbs) < (bs)) ? \
|
||||
(num) / ((bs) / (fsbs)) : (num) * ((fsbs) / (bs)))
|
||||
|
||||
/*
|
||||
* Print out status about a filesystem.
|
||||
*/
|
||||
void
|
||||
#ifndef __STDC__
|
||||
prtstat(sfsp, maxwidth)
|
||||
struct statfs *sfsp;
|
||||
int maxwidth;
|
||||
#else
|
||||
prtstat(struct statfs *sfsp, int maxwidth)
|
||||
#endif
|
||||
{
|
||||
static long blocksize;
|
||||
static int headerlen, timesthrough;
|
||||
static char *header;
|
||||
long used, availblks, inodes;
|
||||
|
||||
if (maxwidth < 11)
|
||||
maxwidth = 11;
|
||||
if (++timesthrough == 1) {
|
||||
header = getbsize(&headerlen, &blocksize);
|
||||
#ifdef __GNO__
|
||||
(void)printf("Dev# ");
|
||||
#endif
|
||||
(void)printf("%-*.*s %s Used Avail Capacity",
|
||||
maxwidth, maxwidth, "Filesystem", header);
|
||||
if (iflag)
|
||||
(void)printf(" iused ifree %%iused");
|
||||
#ifdef __GNO__
|
||||
(void)printf("%12s", "FST");
|
||||
#endif
|
||||
(void)printf(" Mounted on\n");
|
||||
}
|
||||
#ifdef __GNO__
|
||||
if(!vfslist[sfsp->f_type])
|
||||
return;
|
||||
(void)printf(".d%-2ld ", (sfsp->f_fsid).lo);
|
||||
#endif
|
||||
(void)printf("%-*.*s", maxwidth, maxwidth, sfsp->f_mntfromname);
|
||||
used = sfsp->f_blocks - sfsp->f_bfree;
|
||||
availblks = sfsp->f_bavail + used;
|
||||
(void)printf(" %*ld %7ld %7ld", headerlen,
|
||||
fsbtoblk(sfsp->f_blocks, sfsp->f_bsize, blocksize),
|
||||
fsbtoblk(used, sfsp->f_bsize, blocksize),
|
||||
fsbtoblk(sfsp->f_bavail, sfsp->f_bsize, blocksize));
|
||||
(void)printf(" %5.0f%%",
|
||||
availblks == 0 ? 100.0 : (double)used / (double)availblks * 100.0);
|
||||
if (iflag) {
|
||||
inodes = sfsp->f_files;
|
||||
used = inodes - sfsp->f_ffree;
|
||||
(void)printf(" %7ld %7ld %5.0f%% ", used, sfsp->f_ffree,
|
||||
inodes == 0 ? 100.0 : (double)used / (double)inodes * 100.0);
|
||||
} else
|
||||
(void)printf(" ");
|
||||
#ifdef __GNO__
|
||||
(void)printf("%12s", fs_name[sfsp->f_type]);
|
||||
#endif
|
||||
(void)printf(" %s\n", sfsp->f_mntonname);
|
||||
}
|
||||
|
||||
#ifndef __GNO__
|
||||
/*
|
||||
* This code constitutes the pre-system call Berkeley df code for extracting
|
||||
* information from filesystem superblocks.
|
||||
*/
|
||||
#include <ufs/ufs/dinode.h>
|
||||
#include <ufs/ffs/fs.h>
|
||||
#include <errno.h>
|
||||
#include <fstab.h>
|
||||
|
||||
union {
|
||||
struct fs iu_fs;
|
||||
char dummy[SBSIZE];
|
||||
} sb;
|
||||
#define sblock sb.iu_fs
|
||||
|
||||
int rfd;
|
||||
|
||||
void
|
||||
#ifndef __STDC__
|
||||
ufs_df(file, maxwidth)
|
||||
char *file;
|
||||
int maxwidth;
|
||||
#else
|
||||
ufs_df(char *file, int maxwidth)
|
||||
#endif
|
||||
{
|
||||
struct statfs statfsbuf;
|
||||
struct statfs *sfsp;
|
||||
char *mntpt;
|
||||
static int synced;
|
||||
|
||||
if (synced++ == 0)
|
||||
sync();
|
||||
|
||||
if ((rfd = open(file, O_RDONLY)) < 0) {
|
||||
warn("%s", file);
|
||||
return;
|
||||
}
|
||||
if (bread((off_t)SBOFF, &sblock, SBSIZE) == 0) {
|
||||
(void)close(rfd);
|
||||
return;
|
||||
}
|
||||
sfsp = &statfsbuf;
|
||||
sfsp->f_type = 1;
|
||||
strcpy(sfsp->f_fstypename, "ufs");
|
||||
sfsp->f_flags = 0;
|
||||
sfsp->f_bsize = sblock.fs_fsize;
|
||||
sfsp->f_iosize = sblock.fs_bsize;
|
||||
sfsp->f_blocks = sblock.fs_dsize;
|
||||
sfsp->f_bfree = sblock.fs_cstotal.cs_nbfree * sblock.fs_frag +
|
||||
sblock.fs_cstotal.cs_nffree;
|
||||
sfsp->f_bavail = freespace(&sblock, sblock.fs_minfree);
|
||||
sfsp->f_files = sblock.fs_ncg * sblock.fs_ipg;
|
||||
sfsp->f_ffree = sblock.fs_cstotal.cs_nifree;
|
||||
sfsp->f_fsid.val[0] = 0;
|
||||
sfsp->f_fsid.val[1] = 0;
|
||||
if ((mntpt = getmntpt(file)) == 0)
|
||||
mntpt = "";
|
||||
memmove(&sfsp->f_mntonname[0], mntpt, MNAMELEN);
|
||||
memmove(&sfsp->f_mntfromname[0], file, MNAMELEN);
|
||||
prtstat(sfsp, maxwidth);
|
||||
(void)close(rfd);
|
||||
}
|
||||
|
||||
int
|
||||
#ifndef __STDC__
|
||||
bread(off, buf, cnt)
|
||||
off_t off;
|
||||
void *buf;
|
||||
int cnt;
|
||||
#else
|
||||
bread(off_t off, void *buf, int cnt)
|
||||
#endif
|
||||
{
|
||||
int nr;
|
||||
|
||||
(void)lseek(rfd, off, SEEK_SET);
|
||||
if ((nr = read(rfd, buf, cnt)) != cnt) {
|
||||
/* Probably a dismounted disk if errno == EIO. */
|
||||
if (errno != EIO)
|
||||
(void)fprintf(stderr, "\ndf: %qd: %s\n",
|
||||
off, strerror(nr > 0 ? EIO : errno));
|
||||
return (0);
|
||||
}
|
||||
return (1);
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
#ifndef __STDC__
|
||||
usage()
|
||||
#else
|
||||
usage(void)
|
||||
#endif
|
||||
{
|
||||
(void)fprintf(stderr,
|
||||
#ifndef __GNO__
|
||||
"usage: df [-ikn] [-t type] [file | filesystem ...]\n");
|
||||
#else
|
||||
"usage: df [-k] [-t type] [devnum | volume | file ...]\n");
|
||||
#endif
|
||||
exit(1);
|
||||
}
|
9
bin/df/df.desc
Normal file
9
bin/df/df.desc
Normal file
|
@ -0,0 +1,9 @@
|
|||
Name: df
|
||||
Version: 1.0 (28 Sep 97)
|
||||
Shell: GNO/ME
|
||||
Author: Evan Day (from FreeBSD source)
|
||||
Contact: day@engr.orst.edu
|
||||
Where: /bin
|
||||
FTP: ftp.gno.org
|
||||
|
||||
Displays free disk space and disk usage statistics for GS/OS block devices.
|
61
bin/df/df.h
Normal file
61
bin/df/df.h
Normal file
|
@ -0,0 +1,61 @@
|
|||
/*
|
||||
* df.h
|
||||
*
|
||||
* Bastardized sys/mount.h with local constants and functions to provide
|
||||
* functions not available in the gno libraries.
|
||||
*
|
||||
* $Id: df.h,v 1.1 1997/10/03 05:42:18 gdr Exp $
|
||||
*/
|
||||
|
||||
#ifndef _SYS_TYPES_H_
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
typedef quad_t fsid_t; /* formerly an equivalent struct */
|
||||
|
||||
struct statfs {
|
||||
long f_type; /* FST type (see below) */
|
||||
long f_bsize; /* fundamental file system block size */
|
||||
long f_blocks; /* total blocks in file system */
|
||||
long f_bfree; /* free blocks */
|
||||
long f_bavail; /* free blocks available to non-superuser */
|
||||
long f_files; /* total file nodes in file system */
|
||||
long f_ffree; /* free file nodes in fs */
|
||||
fsid_t f_fsid; /* file system id (GS/OS device number) */
|
||||
long f_spare[7]; /* reserved */
|
||||
char f_mntfromname[32]; /* device name */
|
||||
char f_mntonname[32]; /* volume name */
|
||||
};
|
||||
|
||||
#define MOUNT_PRODOS 0x0001 /* ProDOS or SOS */
|
||||
#define MOUNT_DOS_33 0x0002 /* DOS 3.3 */
|
||||
#define MOUNT_DOS_32 0x0003 /* DOS 3.1 or 3.2 */
|
||||
#define MOUNT_PASCAL 0x0004 /* Apple II Pascal */
|
||||
#define MOUNT_MFS 0x0005 /* Macintosh (MFS) */
|
||||
#define MOUNT_HFS 0x0006 /* Macintosh (HFS) */
|
||||
#define MOUNT_LISA 0x0007 /* Lisa */
|
||||
#define MOUNT_CPM 0x0008 /* Apple CP/M */
|
||||
#define MOUNT_MSDOS 0x000A /* MS/DOS */
|
||||
#define MOUNT_HISHS 0x000B /* High Sierra */
|
||||
#define MOUNT_CD9660 0x000C /* ISO 9660 (CD-ROM) */
|
||||
#define MOUNT_APLSHAR 0x000D /* AppleShare */
|
||||
|
||||
#ifndef _SYS_CDEFS_H_
|
||||
#include <sys/cdefs.h>
|
||||
#endif
|
||||
|
||||
/* This constant is used in the one non-#ifdef'd getmntinfo() call */
|
||||
|
||||
#define MNT_NOWAIT 0
|
||||
|
||||
/* "Helper" functions to fill in the statfs structure where statfs() fails */
|
||||
|
||||
int nameinfo(struct statfs *);
|
||||
void devinfo(struct statfs *);
|
||||
long getmntinfo(struct statfs **, char);
|
||||
char *getbsize(int *, long *);
|
||||
|
||||
/* Data structures */
|
||||
|
||||
extern char *fs_name[];
|
||||
extern char vfslist[];
|
33
bin/df/df.rez
Normal file
33
bin/df/df.rez
Normal file
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* $Id: df.rez,v 1.3 1997/10/05 16:42:03 gdr Exp $
|
||||
*/
|
||||
#include "Types.Rez"
|
||||
#include "proginfo.rez"
|
||||
|
||||
resource rVersion (0x1, purgeable3, nocrossbank) {
|
||||
|
||||
{ 1, 0, 0, /* version 1.0.0 */
|
||||
release, /* development|alpha|beta|final|release */
|
||||
0 /* non-final release number */
|
||||
},
|
||||
verUS, /* country code -- only some are avail */
|
||||
"df", /* name */
|
||||
/* _Very_ brief descrition. Check "file info" */
|
||||
/* shown in the Finder to see if it's too long */
|
||||
/* Note that \n is used to separate lines here. */
|
||||
"Display free disk space.\n"
|
||||
"Requires GNO/ME Shell.\n"
|
||||
"Evan Day <day@engr.orst.edu>"
|
||||
};
|
||||
|
||||
resource rProgramInfo (0x1, purgeable3, nocrossbank) {
|
||||
{ 6, 0, 1,
|
||||
release,
|
||||
0
|
||||
},
|
||||
80000, /* Overestimate, but the library */
|
||||
80000, /* isn't final yet. */
|
||||
1024,
|
||||
progRequiresGNO+progAppleTalkOK+progAllowsCDAs,
|
||||
piCompatible*ProgShellGSH+piSpecialFeatures*ProgShellGSH
|
||||
};
|
268
bin/df/gnodf.c
Normal file
268
bin/df/gnodf.c
Normal file
|
@ -0,0 +1,268 @@
|
|||
/*
|
||||
* gnodf.c
|
||||
*
|
||||
* Provide missing library functions to make df(1) work right
|
||||
* $ID$
|
||||
*/
|
||||
|
||||
#include <gsos.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "df.h"
|
||||
|
||||
/* Array of FST names */
|
||||
|
||||
char *fs_name[] = {
|
||||
"",
|
||||
"ProDOS",
|
||||
"DOS 3.3",
|
||||
"DOS 3.2",
|
||||
"Pascal",
|
||||
"MFS",
|
||||
"HFS",
|
||||
"LISA",
|
||||
"CP/M",
|
||||
"",
|
||||
"MS-DOS",
|
||||
"High Sierra",
|
||||
"ISO 9660",
|
||||
"AppleShare"
|
||||
};
|
||||
|
||||
/* vfsname is an array of fsts accepted by the -t flag */
|
||||
|
||||
static char *vfsname[15] = {
|
||||
"",
|
||||
"prodos",
|
||||
"dos33",
|
||||
"dos32",
|
||||
"pascal",
|
||||
"mfs",
|
||||
"hfs",
|
||||
"lisa",
|
||||
"cpm",
|
||||
"",
|
||||
"msdos",
|
||||
"highsierra",
|
||||
"iso9660",
|
||||
"appleshare"
|
||||
};
|
||||
|
||||
/* Each member of the vfslist array reflects if the FST is included in the
|
||||
* output (as affected by the -t flag).
|
||||
* 1 = display
|
||||
* 0 = don't display
|
||||
*/
|
||||
|
||||
char vfslist[15] = {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0};
|
||||
|
||||
/* getbsize()
|
||||
*
|
||||
* in: pointer to int, pointer to long
|
||||
* out: pointer to char
|
||||
*
|
||||
* getbsize() returns a string indicative of the current value of the
|
||||
* BLOCKSIZE environment variable. If BLOCKSIZE is 1k or 1024, " kbytes"
|
||||
* is returned. Otherwise, " blocks" is returned. If BLOCKSIZE is NULL,
|
||||
* a standard 512 byte blocksize is returned. len is the strlen of the
|
||||
* returned string, always 7 in this case.
|
||||
*
|
||||
* BLOCKSIZE may be a plain number, in which case the number represents the
|
||||
* number of bytes in a block. It may also be #k, where # represents the
|
||||
* number of kilobytes in a block.
|
||||
*/
|
||||
|
||||
char *getbsize(int *len, long *blocksize)
|
||||
{
|
||||
char *size;
|
||||
char *p;
|
||||
|
||||
size = getenv("BLOCKSIZE");
|
||||
if(size == NULL)
|
||||
*blocksize = 512;
|
||||
else {
|
||||
*blocksize = strtol(size, &p, 0);
|
||||
if(*p == 'k')
|
||||
*blocksize *= 1024;
|
||||
}
|
||||
|
||||
*len = 7;
|
||||
|
||||
if(*blocksize != 1024)
|
||||
return(" blocks");
|
||||
else
|
||||
return(" kbytes");
|
||||
}
|
||||
|
||||
/* makevfslist()
|
||||
*
|
||||
* in: string containing a comma separated list of FSTs.
|
||||
* (see manpage for the exact list of recognized strings)
|
||||
*
|
||||
* global: char vfslist[14]
|
||||
*
|
||||
* vfslist is a character array. Each entry determines if the FST number
|
||||
* is to be displayed in the df list or not.
|
||||
*
|
||||
* makevfslist() parses the input string for valid FST names. If the name
|
||||
* is specified, the FST is either included or excluded from the list.
|
||||
* If the string starts with "no", all FSTs are included except those present
|
||||
* in the string. Otherwise, only the FSTs specified are included.
|
||||
*/
|
||||
|
||||
void makevfslist(char *list)
|
||||
{
|
||||
int def, include, i;
|
||||
char *p, *str;
|
||||
|
||||
def = 0;
|
||||
include = 1;
|
||||
p = list;
|
||||
|
||||
if(*list == 'n') {
|
||||
p += 2;
|
||||
include = 0;
|
||||
def = 1;
|
||||
}
|
||||
|
||||
for(i = 1; i < 14; i++)
|
||||
vfslist[i] = def;
|
||||
|
||||
str = strtok(p, ",");
|
||||
do {
|
||||
for(i=1; i < 14; i++) {
|
||||
if(!strcmp(str, vfsname[i])) {
|
||||
vfslist[i] = include;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} while((str = strtok(NULL, NULL)) != NULL);
|
||||
|
||||
/* Mark that makevfslist() has been run */
|
||||
|
||||
vfslist[14] = 0xFF;
|
||||
}
|
||||
|
||||
/* nameinfo()
|
||||
*
|
||||
* in: customize statfs structure pointer
|
||||
*
|
||||
* out: 0 = success, -1 = failure
|
||||
*
|
||||
* nameinfo() check the f_mntonname field of the statfs structure and calls
|
||||
* the GetDevNumber and DInfo GS/OS calls to fill in the f_mntfromname field
|
||||
* and the f_type field of the statfs structure.
|
||||
*/
|
||||
|
||||
static ResultBuf32 devName = {35};
|
||||
static DInfoRecGS dInfo = {3, 0, &devName};
|
||||
|
||||
int nameinfo(struct statfs *sbuf)
|
||||
{
|
||||
GSString255 dName = {strlen(sbuf->f_mntonname)};
|
||||
DevNumRecGS dNum = {2, (GSString32 *) &dName};
|
||||
|
||||
strcpy(&dName.text[0], sbuf->f_mntonname);
|
||||
GetDevNumberGS(&dNum);
|
||||
if(_toolErr)
|
||||
return(-1);
|
||||
|
||||
dInfo.devNum = dNum.devNum;
|
||||
DInfoGS(&dInfo);
|
||||
if(_toolErr)
|
||||
return(-1);
|
||||
|
||||
devName.bufString.text[devName.bufString.length] = '\0';
|
||||
strcpy(sbuf->f_mntfromname, devName.bufString.text);
|
||||
(sbuf->f_fsid).lo = (long) dNum.devNum;
|
||||
devinfo(sbuf);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
/* devinfo()
|
||||
*
|
||||
* in: customized statfs structure pointer
|
||||
*
|
||||
* devinfo() takes the f_mntfromname field of the statfs structure and fills
|
||||
* in the fields used by df with the results of the GSOS Volume call.
|
||||
* Devices with no valid media (i.e. a 3.5" drive with no disk) are filled
|
||||
* with blank values and excluded from the resulting output.
|
||||
*/
|
||||
|
||||
static ResultBuf255 vRes = {259};
|
||||
|
||||
void devinfo(struct statfs *sbuf)
|
||||
{
|
||||
GSString32 dname = {strlen(sbuf->f_mntfromname)};
|
||||
VolumeRecGS vInfo = {6, &dname, &vRes};
|
||||
|
||||
strcpy(dname.text, sbuf->f_mntfromname);
|
||||
VolumeGS(&vInfo);
|
||||
if(_toolErr) {
|
||||
strcpy(sbuf->f_mntonname, "");
|
||||
sbuf->f_bsize = 0;
|
||||
sbuf->f_blocks = 0;
|
||||
sbuf->f_bfree = sbuf->f_bavail = 0;
|
||||
sbuf->f_type = 0;
|
||||
} else {
|
||||
vRes.bufString.text[vRes.bufString.length] = '\0';
|
||||
strcpy(sbuf->f_mntonname, vRes.bufString.text);
|
||||
sbuf->f_bsize = vInfo.blockSize;
|
||||
sbuf->f_blocks = vInfo.totalBlocks;
|
||||
sbuf->f_bfree = sbuf->f_bavail = vInfo.freeBlocks;
|
||||
sbuf->f_type = vInfo.fileSysID;
|
||||
}
|
||||
}
|
||||
|
||||
/* getmntinfo()
|
||||
*
|
||||
* in: struct statfs **, char
|
||||
*
|
||||
* out: number of block devices currently online.
|
||||
*
|
||||
* getmntinfo() first finds out how many devices are online and how many of
|
||||
* them are block devices by repeated calls to DInfo. Then it dynamically
|
||||
* creates and array of statfs structures and for each block devices fills in
|
||||
* an entry in the array, returning the total number of block devices present.
|
||||
*/
|
||||
|
||||
long getmntinfo(struct statfs **mntlist, char flags)
|
||||
{
|
||||
int n, b, i, j;
|
||||
|
||||
/* First find out how many devices exist, and how many are block
|
||||
devices */
|
||||
|
||||
b = n = 0;
|
||||
|
||||
while(1) {
|
||||
dInfo.devNum = n+1;
|
||||
DInfoGS(&dInfo);
|
||||
if(_toolErr)
|
||||
break;
|
||||
if(dInfo.characteristics & 0x80)
|
||||
b++;
|
||||
n++;
|
||||
}
|
||||
|
||||
/* Prepare the mntlist array */
|
||||
|
||||
if((*mntlist = (struct statfs *) malloc(sizeof(struct statfs)*b)) == NULL)
|
||||
return(0L);
|
||||
|
||||
/* Copy the device names of each block device to the array */
|
||||
|
||||
for(j=0,i=1;i<=n;i++) {
|
||||
dInfo.devNum = i;
|
||||
DInfoGS(&dInfo);
|
||||
if(dInfo.characteristics & 0x80) {
|
||||
devName.bufString.text[devName.bufString.length] = '\0';
|
||||
strcpy((*mntlist)[j].f_mntfromname, devName.bufString.text);
|
||||
(*mntlist)[j].f_fsid.lo = (long) dInfo.devNum;
|
||||
devinfo(&(*mntlist)[j++]);
|
||||
}
|
||||
}
|
||||
|
||||
return((long) b);
|
||||
}
|
2
bin/du/Makefile
Normal file
2
bin/du/Makefile
Normal file
|
@ -0,0 +1,2 @@
|
|||
du: du.c
|
||||
cmpl +O du.c keep=du
|
222
bin/du/du.c
Normal file
222
bin/du/du.c
Normal file
|
@ -0,0 +1,222 @@
|
|||
#pragma stacksize 2048
|
||||
|
||||
/* IIGS History:
|
||||
*
|
||||
* v1.0 (Summer sometime)
|
||||
* Original port by Derek Taubert
|
||||
* v1.1 (11/30/91 jb)
|
||||
* Applied stacksize directive
|
||||
* v1.2 (1/21/92 jb)
|
||||
* Recompiled under C 1.3 and with new libraries
|
||||
* ANSI-fied the source
|
||||
* v1.4 (6/16/93 jb) Recompiled under C 2.0.1a3 & with new libs
|
||||
* Modified '/' to ':' to support HFS
|
||||
* Fully optimized
|
||||
*
|
||||
* $Id: du.c,v 1.1 1998/04/10 18:13:27 gdr-ftp Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* Chris Newcomb.
|
||||
*
|
||||
* Redistribution and use in source and binary forms are permitted
|
||||
* provided that: (1) source distributions retain this entire copyright
|
||||
* notice and comment, and (2) distributions including binaries display
|
||||
* the following acknowledgement: ``This product includes software
|
||||
* developed by the University of California, Berkeley and its contributors''
|
||||
* in the documentation or other materials provided with the distribution
|
||||
* and in all advertising materials mentioning features or use of this
|
||||
* software. 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 ``AS IS'' AND WITHOUT ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
char copyright[] =
|
||||
"@(#) Copyright (c) 1989 The Regents of the University of California.\n\
|
||||
All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)du.c 5.6 (Berkeley) 6/1/90";
|
||||
#endif /* not lint */
|
||||
|
||||
#define _SYSV_SOURCE
|
||||
#include <sys/param.h>
|
||||
#include <sys/stat.h>
|
||||
#include <dirent.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <getopt.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
#pragma lint -1
|
||||
|
||||
typedef struct _ID {
|
||||
dev_t dev;
|
||||
ino_t inode;
|
||||
} ID;
|
||||
|
||||
ID *files;
|
||||
dev_t device;
|
||||
int crossmounts, kvalue, listdirs, listfiles, maxfiles, numfiles;
|
||||
char path[MAXPATHLEN + 1];
|
||||
char fixpath[MAXPATHLEN + 1];
|
||||
|
||||
/* Prototypes */
|
||||
void du(char *arg);
|
||||
u_long descend(char *endp);
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int ch;
|
||||
char top[MAXPATHLEN + 1];
|
||||
|
||||
listdirs = crossmounts = 1;
|
||||
while ((ch = getopt(argc, argv, "aksx")) != EOF)
|
||||
switch(ch) {
|
||||
case 'a':
|
||||
listfiles = 1;
|
||||
break;
|
||||
case 'k':
|
||||
kvalue = 1;
|
||||
break;
|
||||
case 's':
|
||||
listfiles = listdirs = 0;
|
||||
break;
|
||||
case 'x':
|
||||
crossmounts = 0;
|
||||
break;
|
||||
case '?':
|
||||
default:
|
||||
(void)fprintf(stderr,
|
||||
"usage: du [-aksx] [name ...]\n");
|
||||
exit(1);
|
||||
}
|
||||
argv += optind;
|
||||
|
||||
files = (ID *)malloc((size_t)(sizeof(ID) * (maxfiles = 128)));
|
||||
(void)getwd(top);
|
||||
if (!*argv) {
|
||||
du(top);
|
||||
if (chdir(top)) {
|
||||
(void)fprintf(stderr, "chdir du: %s: %s\n",top,
|
||||
strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
} else {
|
||||
for (;;) {
|
||||
du(*argv);
|
||||
if (chdir(top)) {
|
||||
(void)fprintf(stderr, "chdir du: %s: %s\n",
|
||||
top, strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
if (!*++argv)
|
||||
break;
|
||||
}
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
|
||||
struct stat info;
|
||||
|
||||
void du(char *arg)
|
||||
{
|
||||
extern int errno;
|
||||
u_long total;
|
||||
|
||||
if (lstat(arg, &info)) {
|
||||
(void)fprintf(stderr, "lstat1 du: %s: %s\n", arg, strerror(errno));
|
||||
return;
|
||||
}
|
||||
if ((info.st_mode&S_IFMT) != S_IFDIR) {
|
||||
(void)printf("%-8.8ld %s\n", kvalue ?
|
||||
howmany(info.st_blocks, 2) : info.st_blocks, arg);
|
||||
return;
|
||||
}
|
||||
device = info.st_dev;
|
||||
(void)strcpy(path, arg);
|
||||
total = descend(path);
|
||||
if (!listfiles && !listdirs)
|
||||
(void)printf("%-8.8lu %s\n",
|
||||
kvalue ? howmany(total, 2) : total, path);
|
||||
}
|
||||
|
||||
u_long descend(char *endp)
|
||||
{
|
||||
extern int errno;
|
||||
register DIR *dir;
|
||||
register ID *fp;
|
||||
register struct dirent *dp;
|
||||
u_long total;
|
||||
|
||||
if (info.st_nlink > 1) {
|
||||
for (fp = files + numfiles - 1; fp >= files; --fp)
|
||||
if (info.st_ino == fp->inode &&
|
||||
info.st_dev == fp->dev)
|
||||
return(0L);
|
||||
if (numfiles == maxfiles)
|
||||
files = (ID *)realloc((char *)files,
|
||||
(u_int)(sizeof(ID) * (maxfiles += 128)));
|
||||
files[numfiles].inode = info.st_ino;
|
||||
files[numfiles].dev = info.st_dev;
|
||||
++numfiles;
|
||||
}
|
||||
total = info.st_blocks;
|
||||
if ((info.st_mode&S_IFMT) == S_IFDIR) {
|
||||
if (info.st_dev != device && !crossmounts)
|
||||
return(0L);
|
||||
if (!(dir = opendir(endp)) || chdir(endp)) {
|
||||
(void)fprintf(stderr, "opendir du: %s: %s\n",
|
||||
path, strerror(errno));
|
||||
return(total);
|
||||
}
|
||||
for (; *endp; ++endp);
|
||||
#ifdef __ORCAC__
|
||||
/* IIGS uses ':'s as separators */
|
||||
if (endp[-1] != ':')
|
||||
{ *endp++ = ':'; *endp = 0; }
|
||||
#else
|
||||
if (endp[-1] != '/')
|
||||
*endp++ = '/';
|
||||
#endif
|
||||
while (dp = readdir(dir)) {
|
||||
/* if (dp->d_name[0] == '.' && (!dp->d_name[1] ||
|
||||
dp->d_name[1] == '.' && !dp->d_name[2]))
|
||||
continue; unix only, we have no links */
|
||||
/* Specify 0: for HFS filenames with slashes */
|
||||
bcopy(dp->d_name, endp, dp->d_namlen + 1);
|
||||
strcpy(fixpath,"0:");
|
||||
strcat(fixpath,dp->d_name);
|
||||
if (lstat(fixpath /*dp->d_name*/, &info)) {
|
||||
(void)fprintf(stderr, "lstat du: %s: %s\n", path,
|
||||
strerror(errno));
|
||||
continue;
|
||||
}
|
||||
total += descend(endp);
|
||||
}
|
||||
closedir(dir);
|
||||
if (chdir("..")) {
|
||||
(void)fprintf(stderr, "chdir du: ..: %s\n", strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
*--endp = '\0';
|
||||
if (listdirs)
|
||||
(void)printf("%-8.8lu %s\n",
|
||||
kvalue ? howmany(total, 2) : total, path);
|
||||
}
|
||||
else if (listfiles)
|
||||
(void)printf("%-8.8lu %s\n",
|
||||
kvalue ? howmany(total, 2) : total, path);
|
||||
return(total);
|
||||
}
|
111
bin/edit/edit.c
Normal file
111
bin/edit/edit.c
Normal file
|
@ -0,0 +1,111 @@
|
|||
/*
|
||||
|
||||
parsing code for 'edit'
|
||||
|
||||
1.2(jb) 10/27/91
|
||||
Added support for a '$editor' variable. edit now checks this var so
|
||||
users can select different editors without copying files around.
|
||||
1.1(jb) 10/9/91
|
||||
Removed a lot of yucky code, added error checking to make sure there
|
||||
is one and only one filename specified before 'edit' does anything.
|
||||
1.0(jb) Ick! Nasty! Unnecessary code everywhere! Ick!
|
||||
|
||||
*/
|
||||
|
||||
#pragma stacksize 1024
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <types.h>
|
||||
#include <gsos.h>
|
||||
#include <shell.h>
|
||||
#include <orca.h>
|
||||
#include <stddef.h>
|
||||
#include <texttool.h>
|
||||
#include <gno/gno.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
char *invoke;
|
||||
|
||||
doError(char *err)
|
||||
{
|
||||
printf("%s: %s\n",invoke,err);
|
||||
exit(2);
|
||||
}
|
||||
|
||||
char sfile[65], dfile[65], parms[256], istring[256];
|
||||
Get_LInfoPB gl;
|
||||
|
||||
ExpandPathRecGS ep;
|
||||
|
||||
main (int argc,char *argv[])
|
||||
{
|
||||
int pid,wpid;
|
||||
union wait status;
|
||||
GSString255Ptr inPath;
|
||||
ResultBuf255Ptr outPath;
|
||||
int i;
|
||||
char *editname, *editinvoke, *nm, *spc;
|
||||
|
||||
invoke = argv[0];
|
||||
if (argc < 2) doError("no filename specified");
|
||||
else if (argc > 2) doError("only one filename allowed");
|
||||
|
||||
sfile[1] = 0;
|
||||
strcat(sfile+1,argv[1]);
|
||||
sfile[0] = strlen(sfile+1);
|
||||
|
||||
dfile[0] = parms[0] = istring[0] = 0;
|
||||
gl.pflags = 0x8000000l;
|
||||
gl.mflags = 0l;
|
||||
gl.kflag = 0;
|
||||
gl.sfile = sfile;
|
||||
gl.dfile = dfile;
|
||||
gl.parms = parms;
|
||||
gl.istring = istring;
|
||||
|
||||
gl.merr = 8; gl.merrf = 0;
|
||||
gl.org = 0l;
|
||||
|
||||
inPath = malloc((size_t) (sfile[0] + 2));
|
||||
inPath->length = sfile[0];
|
||||
memcpy(inPath->text,sfile+1,(size_t) sfile[0]);
|
||||
outPath = malloc(sizeof(ResultBuf255));
|
||||
outPath->bufSize = 255;
|
||||
ep.pCount = 3;
|
||||
ep.inputPath = inPath;
|
||||
ep.outputPath = outPath;
|
||||
ep.flags = 0;
|
||||
ExpandPathGS(&ep);
|
||||
if (toolerror()) { printf("edit: error %04X\n",toolerror()); exit(-1); }
|
||||
sfile[0] = outPath->bufString.length;
|
||||
memcpy(sfile+1,outPath->bufString.text,sfile[0]);
|
||||
free(inPath);
|
||||
free(outPath);
|
||||
|
||||
/* hmm. These could well be considered bugs in Rose */
|
||||
for (i = 1; i <= sfile[0]; i++) {
|
||||
if (sfile[i] == ':') sfile[i] = '/';
|
||||
}
|
||||
SET_LINFO(&gl);
|
||||
editname = getenv("editor");
|
||||
if (editname == NULL) editinvoke = editname="4/editor";
|
||||
else {
|
||||
nm = malloc(strlen(editname)+1); strcpy(nm,editname);
|
||||
spc = strchr(nm, ' ');
|
||||
if (spc == NULL) { editname = editinvoke = nm; }
|
||||
else {
|
||||
editinvoke = malloc(strlen(nm)+1); strcpy(editinvoke,nm);
|
||||
*spc = 0; editname = nm;
|
||||
}
|
||||
}
|
||||
if ((pid = exec(editname,editinvoke)) >= 0) {
|
||||
waitlp2:
|
||||
wpid = wait(&status);
|
||||
if ((wpid != pid) || (status.w_stopval == WSTOPPED)) goto waitlp2;
|
||||
}
|
||||
else perror("edit: ");
|
||||
exit(status.w_retcode);
|
||||
}
|
477
bin/gsh/M/alias.mac
Normal file
477
bin/gsh/M/alias.mac
Normal file
|
@ -0,0 +1,477 @@
|
|||
MACRO
|
||||
&lab long &stat
|
||||
&lab anop
|
||||
lcla &t
|
||||
lcla &len
|
||||
lclc &ch
|
||||
&t seta 0
|
||||
&len seta l:&stat
|
||||
.a
|
||||
aif &len=0,.b
|
||||
&ch amid &stat,&len,1
|
||||
aif ("&ch"="x").or.("&ch"="y").or.("&ch"="i"),.i
|
||||
aif ("&ch"="a").or.("&ch"="m"),.m
|
||||
.c
|
||||
&len seta &len-1
|
||||
ago ^a
|
||||
.i
|
||||
longi on
|
||||
&t seta &t+16
|
||||
ago ^c
|
||||
.m
|
||||
longa on
|
||||
&t seta &t+32
|
||||
ago ^c
|
||||
.b
|
||||
aif &t=0,.d
|
||||
rep #&t
|
||||
.d
|
||||
mend
|
||||
MACRO
|
||||
&lab short &stat
|
||||
&lab anop
|
||||
lcla &t
|
||||
lcla &len
|
||||
lclc &ch
|
||||
&t seta 0
|
||||
&len seta l:&stat
|
||||
.a
|
||||
aif &len=0,.b
|
||||
&ch amid &stat,&len,1
|
||||
aif ("&ch"="x").or.("&ch"="y").or.("&ch"="i"),.i
|
||||
aif ("&ch"="a").or.("&ch"="m"),.m
|
||||
.c
|
||||
&len seta &len-1
|
||||
ago ^a
|
||||
.i
|
||||
longi off
|
||||
&t seta &t+16
|
||||
ago ^c
|
||||
.m
|
||||
longa off
|
||||
&t seta &t+32
|
||||
ago ^c
|
||||
.b
|
||||
aif &t=0,.d
|
||||
sep #&t
|
||||
.d
|
||||
mend
|
||||
MACRO
|
||||
&lab if2 &var,&rel,&val,&label
|
||||
&lab ago .skip
|
||||
ble
|
||||
bgt
|
||||
.skip
|
||||
lclc &char1
|
||||
lclc &char2
|
||||
&char1 amid &var,1,1
|
||||
&char2 amid &var,2,1
|
||||
aif "&char1"="@",.index
|
||||
lda &var
|
||||
.cmp
|
||||
cmp &val
|
||||
ago .branch
|
||||
.index
|
||||
aif "&char2"="x",.x1
|
||||
aif "&char2"="X",.x1
|
||||
aif "&char2"="y",.y1
|
||||
aif "&char2"="Y",.y1
|
||||
ago ^cmp
|
||||
.x1
|
||||
cpx &val
|
||||
ago .branch
|
||||
.y1
|
||||
cpy &val
|
||||
.branch
|
||||
&char1 amid &rel,1,1
|
||||
aif "&char1"="@",.done
|
||||
b&rel &label
|
||||
.done
|
||||
mend
|
||||
MACRO
|
||||
&lab bgt &loc
|
||||
&lab beq *+4
|
||||
bcs &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab ble &loc
|
||||
&lab bcc &loc
|
||||
beq &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab WriteCString &a1
|
||||
&lab ph4 &a1
|
||||
Tool $200c
|
||||
mend
|
||||
MACRO
|
||||
&lab jeq &loc
|
||||
&lab bne *+5
|
||||
jmp &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab tool &a1
|
||||
&lab ldx #&a1
|
||||
jsl $e10000
|
||||
mend
|
||||
MACRO
|
||||
&lab ph4 &parm
|
||||
lclc &char
|
||||
lclc &char1
|
||||
lclc &char2
|
||||
&lab anop
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="@",.at
|
||||
aif s:longa=1,.chk1
|
||||
rep #%00100000
|
||||
.chk1
|
||||
aif "&char"<>"{",.chk2
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
ldy #2
|
||||
lda (&parm),y
|
||||
pha
|
||||
lda (&parm)
|
||||
pha
|
||||
ago .shorten
|
||||
.chk2
|
||||
aif "&char"<>"[",.absolute
|
||||
ldy #2
|
||||
lda &parm,y
|
||||
pha
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.absolute
|
||||
lda &parm+2
|
||||
pha
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.at
|
||||
&char1 amid &parm,2,1
|
||||
&char2 setc &char1
|
||||
ph&char1
|
||||
aif l:&parm<3,.chk2a
|
||||
&char2 amid &parm,3,1
|
||||
.chk2a
|
||||
ph&char2
|
||||
ago .shorten
|
||||
.immediate
|
||||
&parm amid &parm,2,l:&parm-1
|
||||
pea +(&parm)|-16
|
||||
pea &parm
|
||||
ago .done
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing closing '}'",16
|
||||
mend
|
||||
macro
|
||||
&lab MV4 &src,&adr
|
||||
&lab lcla &count
|
||||
lda &src
|
||||
&count seta 1
|
||||
.loop1
|
||||
sta &adr(&count)
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.part2
|
||||
ago ^loop1
|
||||
.part2
|
||||
lda &src+2
|
||||
&count seta 1
|
||||
.loop2
|
||||
sta &adr(&count)+2
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.done
|
||||
ago ^loop2
|
||||
.done
|
||||
mend
|
||||
MACRO
|
||||
&lab subroutine &parms,&work
|
||||
&lab anop
|
||||
aif c:&work,.a
|
||||
lclc &work
|
||||
&work setc 0
|
||||
.a
|
||||
gbla &totallen
|
||||
gbla &worklen
|
||||
&worklen seta &work
|
||||
&totallen seta 0
|
||||
aif c:&parms=0,.e
|
||||
lclc &len
|
||||
lclc &p
|
||||
lcla &i
|
||||
&i seta c:&parms
|
||||
.b
|
||||
&p setc &parms(&i)
|
||||
&len amid &p,2,1
|
||||
aif "&len"=":",.c
|
||||
&len amid &p,1,2
|
||||
&p amid &p,4,l:&p-3
|
||||
ago .d
|
||||
.c
|
||||
&len amid &p,1,1
|
||||
&p amid &p,3,l:&p-2
|
||||
.d
|
||||
&p equ &totallen+3+&work
|
||||
&totallen seta &totallen+&len
|
||||
&i seta &i-1
|
||||
aif &i,^b
|
||||
.e
|
||||
tsc
|
||||
sec
|
||||
sbc #&work
|
||||
tcs
|
||||
inc a
|
||||
phd
|
||||
tcd
|
||||
phb
|
||||
phk
|
||||
plb
|
||||
mend
|
||||
MACRO
|
||||
&lab return &r
|
||||
&lab anop
|
||||
lclc &len
|
||||
aif c:&r,.a
|
||||
lclc &r
|
||||
&r setc 0
|
||||
&len setc 0
|
||||
ago .h
|
||||
.a
|
||||
&len amid &r,2,1
|
||||
aif "&len"=":",.b
|
||||
&len amid &r,1,2
|
||||
&r amid &r,4,l:&r-3
|
||||
ago .c
|
||||
.b
|
||||
&len amid &r,1,1
|
||||
&r amid &r,3,l:&r-2
|
||||
.c
|
||||
aif &len<>2,.d
|
||||
ldy &r
|
||||
ago .h
|
||||
.d
|
||||
aif &len<>4,.e
|
||||
ldx &r+2
|
||||
ldy &r
|
||||
ago .h
|
||||
.e
|
||||
aif &len<>10,.g
|
||||
ldy #&r
|
||||
ldx #^&r
|
||||
ago .h
|
||||
.g
|
||||
mnote 'Not a valid return length',16
|
||||
mexit
|
||||
.h
|
||||
aif &totallen=0,.i
|
||||
lda &worklen+1
|
||||
sta &worklen+&totallen+1
|
||||
lda &worklen
|
||||
sta &worklen+&totallen
|
||||
.i
|
||||
plb
|
||||
pld
|
||||
tsc
|
||||
clc
|
||||
adc #&worklen+&totallen
|
||||
tcs
|
||||
aif &len=0,.j
|
||||
tya
|
||||
.j
|
||||
rtl
|
||||
mend
|
||||
MACRO
|
||||
&lab dec2 &a
|
||||
&lab dec &a
|
||||
dec &a
|
||||
mend
|
||||
MACRO
|
||||
&lab add2 &arg1,&arg2,&dest
|
||||
lclc &char
|
||||
&lab clc
|
||||
&char amid &arg1,1,1
|
||||
aif "&char"="@",.at1
|
||||
lda &arg1
|
||||
ago .add
|
||||
.at1
|
||||
&char amid &arg1,2,1
|
||||
aif "&char"="x",.x1
|
||||
aif "&char"="X",.x1
|
||||
aif "&char"="y",.y1
|
||||
aif "&char"="Y",.y1
|
||||
ago .add
|
||||
.x1
|
||||
txa
|
||||
ago .add
|
||||
.y1
|
||||
tya
|
||||
.add
|
||||
adc &arg2
|
||||
&char amid &dest,1,1
|
||||
aif "&char"="@",.at2
|
||||
sta &dest
|
||||
ago .b
|
||||
.at2
|
||||
&char amid &dest,2,1
|
||||
aif "&char"="x",.x2
|
||||
aif "&char"="X",.x2
|
||||
aif "&char"="y",.y2
|
||||
aif "&char"="Y",.y2
|
||||
ago .b
|
||||
.x2
|
||||
tax
|
||||
ago .b
|
||||
.y2
|
||||
tay
|
||||
.b
|
||||
mend
|
||||
MACRO
|
||||
&lab iny2
|
||||
&lab iny
|
||||
iny
|
||||
mend
|
||||
MACRO
|
||||
&lab ora2 &arg1,&arg2,&dest
|
||||
&lab anop
|
||||
lclc &char
|
||||
&char amid &arg1,1,1
|
||||
aif "&char"="@",.at1
|
||||
lda &arg1
|
||||
ago .add
|
||||
.at1
|
||||
&char amid &arg1,2,1
|
||||
aif "&char"="x",.x1
|
||||
aif "&char"="X",.x1
|
||||
aif "&char"="y",.y1
|
||||
aif "&char"="Y",.y1
|
||||
ago .add
|
||||
.x1
|
||||
txa
|
||||
ago .add
|
||||
.y1
|
||||
tya
|
||||
.add
|
||||
ora &arg2
|
||||
&char amid &dest,1,1
|
||||
aif "&char"="@",.at2
|
||||
sta &dest
|
||||
ago .b
|
||||
.at2
|
||||
&char amid &dest,2,1
|
||||
aif "&char"="x",.x2
|
||||
aif "&char"="X",.x2
|
||||
aif "&char"="y",.y2
|
||||
aif "&char"="Y",.y2
|
||||
ago .b
|
||||
.x2
|
||||
tax
|
||||
ago .b
|
||||
.y2
|
||||
tay
|
||||
.b
|
||||
mend
|
||||
MACRO
|
||||
&lab asl2 &a
|
||||
&lab asl &a
|
||||
asl &a
|
||||
mend
|
||||
MACRO
|
||||
&lab UDivide &a1,&a2
|
||||
&lab pha
|
||||
pha
|
||||
ph2 &a1(1)
|
||||
ph2 &a1(2)
|
||||
Tool $0b0b
|
||||
pl2 &a2(1)
|
||||
pl2 &a2(2)
|
||||
mend
|
||||
MACRO
|
||||
&lab ph2 &parm
|
||||
lclc &char
|
||||
&lab anop
|
||||
aif c:&parm=0,.done
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="@",.at
|
||||
aif s:longa=1,.chk
|
||||
rep #%00100000
|
||||
.chk
|
||||
aif "&char"<>"{",.absolute
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
lda (&parm)
|
||||
pha
|
||||
ago .shorten
|
||||
.absolute
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.immediate
|
||||
&parm amid &parm,2,l:&parm-1
|
||||
pea &parm
|
||||
ago .done
|
||||
.at
|
||||
&char amid &parm,2,1
|
||||
ph&char
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing closing '}'",16
|
||||
mend
|
||||
MACRO
|
||||
&lab pl2 &parm
|
||||
lclc &char
|
||||
&lab anop
|
||||
aif s:longa=1,.start
|
||||
rep #%00100000
|
||||
.start
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="@",.at
|
||||
aif "&char"<>"{",.absolute
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
pla
|
||||
sta (&parm)
|
||||
ago .shorten
|
||||
.absolute
|
||||
pla
|
||||
sta &parm
|
||||
ago .shorten
|
||||
.at
|
||||
&char amid &parm,2,1
|
||||
pl&char
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing Closing '}'",16
|
||||
mend
|
||||
MACRO
|
||||
&lab inx2
|
||||
&lab inx
|
||||
inx
|
||||
mend
|
||||
MACRO
|
||||
&lab dey2
|
||||
&lab dey
|
||||
dey
|
||||
mend
|
||||
macro
|
||||
&lab ErrWriteCString &a1
|
||||
&lab ph4 &a1
|
||||
Tool $210c
|
||||
mend
|
84
bin/gsh/M/bufpool.mac
Normal file
84
bin/gsh/M/bufpool.mac
Normal file
|
@ -0,0 +1,84 @@
|
|||
MACRO
|
||||
&lab ph4 &parm
|
||||
lclc &char
|
||||
lclc &char1
|
||||
lclc &char2
|
||||
&lab anop
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="@",.at
|
||||
aif s:longa=1,.chk1
|
||||
rep #%00100000
|
||||
.chk1
|
||||
aif "&char"<>"{",.chk2
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
ldy #2
|
||||
lda (&parm),y
|
||||
pha
|
||||
lda (&parm)
|
||||
pha
|
||||
ago .shorten
|
||||
.chk2
|
||||
aif "&char"<>"[",.absolute
|
||||
ldy #2
|
||||
lda &parm,y
|
||||
pha
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.absolute
|
||||
lda &parm+2
|
||||
pha
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.at
|
||||
&char1 amid &parm,2,1
|
||||
&char2 setc &char1
|
||||
ph&char1
|
||||
aif l:&parm<3,.chk2a
|
||||
&char2 amid &parm,3,1
|
||||
.chk2a
|
||||
ph&char2
|
||||
ago .shorten
|
||||
.immediate
|
||||
&parm amid &parm,2,l:&parm-1
|
||||
pea +(&parm)|-16
|
||||
pea &parm
|
||||
ago .done
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing closing '}'",16
|
||||
mend
|
||||
MACRO
|
||||
&lab unlock &a1
|
||||
&lab stz &a1
|
||||
MEND
|
||||
MACRO
|
||||
&lab key
|
||||
&lab dc i2'0'
|
||||
MEND
|
||||
MACRO
|
||||
&lab lock &a1
|
||||
&lab lda #1
|
||||
tsb &a1
|
||||
beq *+6
|
||||
cop $7F
|
||||
bra *-7
|
||||
MEND
|
||||
MACRO
|
||||
&lab WriteCString &a1
|
||||
&lab ph4 &a1
|
||||
Tool $200c
|
||||
mend
|
||||
MACRO
|
||||
&lab tool &a1
|
||||
&lab ldx #&a1
|
||||
jsl $e10000
|
||||
mend
|
774
bin/gsh/M/builtin.mac
Normal file
774
bin/gsh/M/builtin.mac
Normal file
|
@ -0,0 +1,774 @@
|
|||
MACRO
|
||||
&lab long &stat
|
||||
&lab anop
|
||||
lcla &t
|
||||
lcla &len
|
||||
lclc &ch
|
||||
&t seta 0
|
||||
&len seta l:&stat
|
||||
.a
|
||||
aif &len=0,.b
|
||||
&ch amid &stat,&len,1
|
||||
aif ("&ch"="x").or.("&ch"="y").or.("&ch"="i"),.i
|
||||
aif ("&ch"="a").or.("&ch"="m"),.m
|
||||
.c
|
||||
&len seta &len-1
|
||||
ago ^a
|
||||
.i
|
||||
longi on
|
||||
&t seta &t+16
|
||||
ago ^c
|
||||
.m
|
||||
longa on
|
||||
&t seta &t+32
|
||||
ago ^c
|
||||
.b
|
||||
aif &t=0,.d
|
||||
rep #&t
|
||||
.d
|
||||
mend
|
||||
MACRO
|
||||
&lab short &stat
|
||||
&lab anop
|
||||
lcla &t
|
||||
lcla &len
|
||||
lclc &ch
|
||||
&t seta 0
|
||||
&len seta l:&stat
|
||||
.a
|
||||
aif &len=0,.b
|
||||
&ch amid &stat,&len,1
|
||||
aif ("&ch"="x").or.("&ch"="y").or.("&ch"="i"),.i
|
||||
aif ("&ch"="a").or.("&ch"="m"),.m
|
||||
.c
|
||||
&len seta &len-1
|
||||
ago ^a
|
||||
.i
|
||||
longi off
|
||||
&t seta &t+16
|
||||
ago ^c
|
||||
.m
|
||||
longa off
|
||||
&t seta &t+32
|
||||
ago ^c
|
||||
.b
|
||||
aif &t=0,.d
|
||||
sep #&t
|
||||
.d
|
||||
mend
|
||||
MACRO
|
||||
&lab if2 &var,&rel,&val,&label
|
||||
&lab ago .skip
|
||||
ble
|
||||
bgt
|
||||
.skip
|
||||
lclc &char1
|
||||
lclc &char2
|
||||
&char1 amid &var,1,1
|
||||
&char2 amid &var,2,1
|
||||
aif "&char1"="@",.index
|
||||
lda &var
|
||||
.cmp
|
||||
cmp &val
|
||||
ago .branch
|
||||
.index
|
||||
aif "&char2"="x",.x1
|
||||
aif "&char2"="X",.x1
|
||||
aif "&char2"="y",.y1
|
||||
aif "&char2"="Y",.y1
|
||||
ago ^cmp
|
||||
.x1
|
||||
cpx &val
|
||||
ago .branch
|
||||
.y1
|
||||
cpy &val
|
||||
.branch
|
||||
&char1 amid &rel,1,1
|
||||
aif "&char1"="@",.done
|
||||
b&rel &label
|
||||
.done
|
||||
mend
|
||||
MACRO
|
||||
&lab bgt &loc
|
||||
&lab beq *+4
|
||||
bcs &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab ble &loc
|
||||
&lab bcc &loc
|
||||
beq &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab sub2 &arg1,&arg2,&dest
|
||||
lclc &char
|
||||
&lab sec
|
||||
&char amid &arg1,1,1
|
||||
aif "&char"="@",.at1
|
||||
lda &arg1
|
||||
ago .sub
|
||||
.at1
|
||||
&char amid &arg1,2,1
|
||||
aif "&char"="x",.x1
|
||||
aif "&char"="X",.x1
|
||||
aif "&char"="y",.y1
|
||||
aif "&char"="Y",.y1
|
||||
ago .sub
|
||||
.x1
|
||||
txa
|
||||
ago .sub
|
||||
.y1
|
||||
tya
|
||||
.sub
|
||||
sbc &arg2
|
||||
&char amid &dest,1,1
|
||||
aif "&char"="@",.at2
|
||||
sta &dest
|
||||
ago .b
|
||||
.at2
|
||||
&char amid &dest,2,1
|
||||
aif "&char"="x",.x2
|
||||
aif "&char"="X",.x2
|
||||
aif "&char"="y",.y2
|
||||
aif "&char"="Y",.y2
|
||||
ago .b
|
||||
.x2
|
||||
tax
|
||||
ago .b
|
||||
.y2
|
||||
tay
|
||||
.b
|
||||
mend
|
||||
MACRO
|
||||
&lab jeq &loc
|
||||
&lab bne *+5
|
||||
jmp &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab ph4 &parm
|
||||
lclc &char
|
||||
lclc &char1
|
||||
lclc &char2
|
||||
&lab anop
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="@",.at
|
||||
aif s:longa=1,.chk1
|
||||
rep #%00100000
|
||||
.chk1
|
||||
aif "&char"<>"{",.chk2
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
ldy #2
|
||||
lda (&parm),y
|
||||
pha
|
||||
lda (&parm)
|
||||
pha
|
||||
ago .shorten
|
||||
.chk2
|
||||
aif "&char"<>"[",.absolute
|
||||
ldy #2
|
||||
lda &parm,y
|
||||
pha
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.absolute
|
||||
lda &parm+2
|
||||
pha
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.at
|
||||
&char1 amid &parm,2,1
|
||||
&char2 setc &char1
|
||||
ph&char1
|
||||
aif l:&parm<3,.chk2a
|
||||
&char2 amid &parm,3,1
|
||||
.chk2a
|
||||
ph&char2
|
||||
ago .shorten
|
||||
.immediate
|
||||
&parm amid &parm,2,l:&parm-1
|
||||
pea +(&parm)|-16
|
||||
pea &parm
|
||||
ago .done
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing closing '}'",16
|
||||
mend
|
||||
MACRO
|
||||
&lab MV2 &src,&adr
|
||||
&lab lcla &count
|
||||
lda &src
|
||||
&count seta 1
|
||||
.loop
|
||||
sta &adr(&count)
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.done
|
||||
ago ^loop
|
||||
.done
|
||||
mend
|
||||
macro
|
||||
&lab jcs &loc
|
||||
&lab bcc *+5
|
||||
jmp &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab LD2 &val,&adr
|
||||
&lab lcla &count
|
||||
lda #&val
|
||||
&count seta 1
|
||||
.loop
|
||||
sta &adr(&count)
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.done
|
||||
ago ^loop
|
||||
.done
|
||||
mend
|
||||
MACRO
|
||||
&lab ora2 &arg1,&arg2,&dest
|
||||
&lab anop
|
||||
lclc &char
|
||||
&char amid &arg1,1,1
|
||||
aif "&char"="@",.at1
|
||||
lda &arg1
|
||||
ago .add
|
||||
.at1
|
||||
&char amid &arg1,2,1
|
||||
aif "&char"="x",.x1
|
||||
aif "&char"="X",.x1
|
||||
aif "&char"="y",.y1
|
||||
aif "&char"="Y",.y1
|
||||
ago .add
|
||||
.x1
|
||||
txa
|
||||
ago .add
|
||||
.y1
|
||||
tya
|
||||
.add
|
||||
ora &arg2
|
||||
&char amid &dest,1,1
|
||||
aif "&char"="@",.at2
|
||||
sta &dest
|
||||
ago .b
|
||||
.at2
|
||||
&char amid &dest,2,1
|
||||
aif "&char"="x",.x2
|
||||
aif "&char"="X",.x2
|
||||
aif "&char"="y",.y2
|
||||
aif "&char"="Y",.y2
|
||||
ago .b
|
||||
.x2
|
||||
tax
|
||||
ago .b
|
||||
.y2
|
||||
tay
|
||||
.b
|
||||
mend
|
||||
MACRO
|
||||
&lab subroutine &parms,&work
|
||||
&lab anop
|
||||
aif c:&work,.a
|
||||
lclc &work
|
||||
&work setc 0
|
||||
.a
|
||||
gbla &totallen
|
||||
gbla &worklen
|
||||
&worklen seta &work
|
||||
&totallen seta 0
|
||||
aif c:&parms=0,.e
|
||||
lclc &len
|
||||
lclc &p
|
||||
lcla &i
|
||||
&i seta c:&parms
|
||||
.b
|
||||
&p setc &parms(&i)
|
||||
&len amid &p,2,1
|
||||
aif "&len"=":",.c
|
||||
&len amid &p,1,2
|
||||
&p amid &p,4,l:&p-3
|
||||
ago .d
|
||||
.c
|
||||
&len amid &p,1,1
|
||||
&p amid &p,3,l:&p-2
|
||||
.d
|
||||
&p equ &totallen+3+&work
|
||||
&totallen seta &totallen+&len
|
||||
&i seta &i-1
|
||||
aif &i,^b
|
||||
.e
|
||||
tsc
|
||||
sec
|
||||
sbc #&work
|
||||
tcs
|
||||
inc a
|
||||
phd
|
||||
tcd
|
||||
phb
|
||||
phk
|
||||
plb
|
||||
mend
|
||||
MACRO
|
||||
&lab return &r
|
||||
&lab anop
|
||||
lclc &len
|
||||
aif c:&r,.a
|
||||
lclc &r
|
||||
&r setc 0
|
||||
&len setc 0
|
||||
ago .h
|
||||
.a
|
||||
&len amid &r,2,1
|
||||
aif "&len"=":",.b
|
||||
&len amid &r,1,2
|
||||
&r amid &r,4,l:&r-3
|
||||
ago .c
|
||||
.b
|
||||
&len amid &r,1,1
|
||||
&r amid &r,3,l:&r-2
|
||||
.c
|
||||
aif &len<>2,.d
|
||||
ldy &r
|
||||
ago .h
|
||||
.d
|
||||
aif &len<>4,.e
|
||||
ldx &r+2
|
||||
ldy &r
|
||||
ago .h
|
||||
.e
|
||||
aif &len<>10,.g
|
||||
ldy #&r
|
||||
ldx #^&r
|
||||
ago .h
|
||||
.g
|
||||
mnote 'Not a valid return length',16
|
||||
mexit
|
||||
.h
|
||||
aif &totallen=0,.i
|
||||
lda &worklen+1
|
||||
sta &worklen+&totallen+1
|
||||
lda &worklen
|
||||
sta &worklen+&totallen
|
||||
.i
|
||||
plb
|
||||
pld
|
||||
tsc
|
||||
clc
|
||||
adc #&worklen+&totallen
|
||||
tcs
|
||||
aif &len=0,.j
|
||||
tya
|
||||
.j
|
||||
rtl
|
||||
mend
|
||||
MACRO
|
||||
&lab READ_VARIABLE &a1
|
||||
&lab p16 $10B,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab Str &string
|
||||
&lab dc i1'L:&string'
|
||||
dc c"&string"
|
||||
mend
|
||||
MACRO
|
||||
&lab add2 &arg1,&arg2,&dest
|
||||
lclc &char
|
||||
&lab clc
|
||||
&char amid &arg1,1,1
|
||||
aif "&char"="@",.at1
|
||||
lda &arg1
|
||||
ago .add
|
||||
.at1
|
||||
&char amid &arg1,2,1
|
||||
aif "&char"="x",.x1
|
||||
aif "&char"="X",.x1
|
||||
aif "&char"="y",.y1
|
||||
aif "&char"="Y",.y1
|
||||
ago .add
|
||||
.x1
|
||||
txa
|
||||
ago .add
|
||||
.y1
|
||||
tya
|
||||
.add
|
||||
adc &arg2
|
||||
&char amid &dest,1,1
|
||||
aif "&char"="@",.at2
|
||||
sta &dest
|
||||
ago .b
|
||||
.at2
|
||||
&char amid &dest,2,1
|
||||
aif "&char"="x",.x2
|
||||
aif "&char"="X",.x2
|
||||
aif "&char"="y",.y2
|
||||
aif "&char"="Y",.y2
|
||||
ago .b
|
||||
.x2
|
||||
tax
|
||||
ago .b
|
||||
.y2
|
||||
tay
|
||||
.b
|
||||
mend
|
||||
MACRO
|
||||
&lab iny2
|
||||
&lab iny
|
||||
iny
|
||||
mend
|
||||
MACRO
|
||||
&lab Dec2Int &a1,&a2
|
||||
&lab pha
|
||||
ph4 &a1(1)
|
||||
ph2 &a1(2)
|
||||
ph2 &a1(3)
|
||||
Tool $280b
|
||||
pl2 &a2
|
||||
mend
|
||||
MACRO
|
||||
&lab p16 &a1,&a2
|
||||
&lab jsl $E100A8
|
||||
dc i2'&a1'
|
||||
dc i4'&a2'
|
||||
mend
|
||||
MACRO
|
||||
&lab ph2 &parm
|
||||
lclc &char
|
||||
&lab anop
|
||||
aif c:&parm=0,.done
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="@",.at
|
||||
aif s:longa=1,.chk
|
||||
rep #%00100000
|
||||
.chk
|
||||
aif "&char"<>"{",.absolute
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
lda (&parm)
|
||||
pha
|
||||
ago .shorten
|
||||
.absolute
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.immediate
|
||||
&parm amid &parm,2,l:&parm-1
|
||||
pea &parm
|
||||
ago .done
|
||||
.at
|
||||
&char amid &parm,2,1
|
||||
ph&char
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing closing '}'",16
|
||||
mend
|
||||
MACRO
|
||||
&lab pl2 &parm
|
||||
lclc &char
|
||||
&lab anop
|
||||
aif s:longa=1,.start
|
||||
rep #%00100000
|
||||
.start
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="@",.at
|
||||
aif "&char"<>"{",.absolute
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
pla
|
||||
sta (&parm)
|
||||
ago .shorten
|
||||
.absolute
|
||||
pla
|
||||
sta &parm
|
||||
ago .shorten
|
||||
.at
|
||||
&char amid &parm,2,1
|
||||
pl&char
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing Closing '}'",16
|
||||
mend
|
||||
MACRO
|
||||
&lab Int2Dec &a1
|
||||
&lab ph2 &a1(1)
|
||||
ph4 &a1(2)
|
||||
ph2 &a1(3)
|
||||
ph2 &a1(4)
|
||||
Tool $260b
|
||||
mend
|
||||
MACRO
|
||||
&lab GetPrefix &a1
|
||||
&lab gsos $200A,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab ERROR &a1
|
||||
&lab p16 $105,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab asl2 &a
|
||||
&lab asl &a
|
||||
asl &a
|
||||
mend
|
||||
MACRO
|
||||
&lab LD4 &val,&adr
|
||||
&lab lcla &count
|
||||
lda #<&val
|
||||
&count seta 1
|
||||
.loop1
|
||||
sta &adr(&count)
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.part2
|
||||
ago ^loop1
|
||||
.part2
|
||||
lda #+(&val)|-16
|
||||
&count seta 1
|
||||
.loop2
|
||||
sta &adr(&count)+2
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.done
|
||||
ago ^loop2
|
||||
.done
|
||||
mend
|
||||
macro
|
||||
&lab inc2 &a
|
||||
&lab inc &a
|
||||
inc &a
|
||||
mend
|
||||
MACRO
|
||||
&lab gsos &a1,&a2
|
||||
&lab jsl $E100A8
|
||||
dc i2'&a1'
|
||||
dc i4'&a2'
|
||||
mend
|
||||
MACRO
|
||||
&lab jne &loc
|
||||
&lab beq *+5
|
||||
jmp &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab SetPrefix &a1
|
||||
&lab gsos $2009,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab GetFileInfo &a1
|
||||
&lab gsos $2006,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab dey2
|
||||
&lab dey
|
||||
dey
|
||||
mend
|
||||
macro
|
||||
&lab GetBootVol &a1
|
||||
&lab gsos $2028,&a1
|
||||
mend
|
||||
macro
|
||||
&lab Volume &a1
|
||||
&lab gsos $2008,&a1
|
||||
mend
|
||||
macro
|
||||
&lab DInfo &a1
|
||||
&lab gsos $202C,&a1
|
||||
mend
|
||||
macro
|
||||
&lab Long2Dec &a1
|
||||
&lab ph4 &a1(1)
|
||||
ph4 &a1(2)
|
||||
ph2 &a1(3)
|
||||
ph2 &a1(4)
|
||||
Tool $270b
|
||||
mend
|
||||
macro
|
||||
&lab LongMul &a1,&a2
|
||||
&lab pha
|
||||
pha
|
||||
pha
|
||||
pha
|
||||
ph4 &a1(1)
|
||||
ph4 &a1(2)
|
||||
Tool $0c0b
|
||||
pl4 &a2(1)
|
||||
pl4 &a2(2)
|
||||
mend
|
||||
macro
|
||||
&lab LongDivide &a1,&a2
|
||||
&lab pha
|
||||
pha
|
||||
pha
|
||||
pha
|
||||
ph4 &a1(1)
|
||||
ph4 &a1(2)
|
||||
Tool $0d0b
|
||||
pl4 &a2(1)
|
||||
pl4 &a2(2)
|
||||
mend
|
||||
macro
|
||||
&lab pl4 &parm
|
||||
lclc &char
|
||||
lclc &char1
|
||||
lclc &char2
|
||||
&lab anop
|
||||
aif s:longa=1,.start
|
||||
rep #%00100000
|
||||
.start
|
||||
&char amid &parm,1,1
|
||||
aif "&char"<>"{",.chk
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
pla
|
||||
sta (&parm)
|
||||
ldy #2
|
||||
pla
|
||||
sta (&parm),y
|
||||
ago .shorten
|
||||
.chk
|
||||
aif "&char"<>"[",.chk2
|
||||
pla
|
||||
sta &parm
|
||||
ldy #2
|
||||
pla
|
||||
sta &parm,y
|
||||
ago .shorten
|
||||
.chk2
|
||||
aif "&char"<>"@",.absolute
|
||||
&char1 amid &parm,2,1
|
||||
&char2 setc &char1
|
||||
pl&char1
|
||||
aif l:&parm<3,.chk2a
|
||||
&char2 amid &parm,3,1
|
||||
.chk2a
|
||||
pl&char2
|
||||
ago .shorten
|
||||
.absolute
|
||||
pla
|
||||
sta &parm
|
||||
pla
|
||||
sta &parm+2
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing closing '}'",16
|
||||
mend
|
||||
MACRO
|
||||
&lab setdebug &a1
|
||||
&lab ph2 &a1
|
||||
case on
|
||||
jsl setdebug
|
||||
case off
|
||||
MEND
|
||||
MACRO
|
||||
&lab kvm_open
|
||||
&lab case on
|
||||
jsl kvm_open
|
||||
case off
|
||||
MEND
|
||||
MACRO
|
||||
&lab kvm_close &a1
|
||||
&lab ph4 &a1
|
||||
case on
|
||||
jsl kvm_close
|
||||
case off
|
||||
MEND
|
||||
MACRO
|
||||
&lab kvmnextproc &a1
|
||||
&lab ph4 &a1
|
||||
case on
|
||||
jsl kvmnextproc
|
||||
case off
|
||||
MEND
|
||||
macro
|
||||
&lab Int2Hex &a1
|
||||
&lab ph2 &a1(1)
|
||||
ph4 &a1(2)
|
||||
ph2 &a1(3)
|
||||
Tool $220b
|
||||
mend
|
||||
MACRO
|
||||
&lab kvmgetproc &a1
|
||||
&lab ph2 &a1(2)
|
||||
ph4 &a1(1)
|
||||
case on
|
||||
jsl kvmgetproc
|
||||
case off
|
||||
MEND
|
||||
MACRO
|
||||
&lab unlock &a1
|
||||
&lab stz &a1
|
||||
MEND
|
||||
MACRO
|
||||
&lab key
|
||||
&lab dc i2'0'
|
||||
MEND
|
||||
MACRO
|
||||
&lab lock &a1
|
||||
&lab lda #1
|
||||
tsb &a1
|
||||
beq *+6
|
||||
cop $7F
|
||||
bra *-7
|
||||
MEND
|
||||
MACRO
|
||||
&lab jcc &loc
|
||||
&lab bcs *+5
|
||||
jmp &loc
|
||||
mend
|
||||
macro
|
||||
&lab MV4 &src,&adr
|
||||
&lab lcla &count
|
||||
lda &src
|
||||
&count seta 1
|
||||
.loop1
|
||||
sta &adr(&count)
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.part2
|
||||
ago ^loop1
|
||||
.part2
|
||||
lda &src+2
|
||||
&count seta 1
|
||||
.loop2
|
||||
sta &adr(&count)+2
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.done
|
||||
ago ^loop2
|
||||
.done
|
||||
mend
|
||||
MACRO
|
||||
&lab tool &a1
|
||||
&lab ldx #&a1
|
||||
jsl $e10000
|
||||
mend
|
||||
MACRO
|
||||
&lab getuid
|
||||
&lab case on
|
||||
jsl getuid
|
||||
case off
|
||||
MEND
|
||||
macro
|
||||
&lab UDivide &a1,&a2
|
||||
&lab pha
|
||||
pha
|
||||
ph2 &a1(1)
|
||||
ph2 &a1(2)
|
||||
Tool $0b0b
|
||||
pl2 &a2(1)
|
||||
pl2 &a2(2)
|
||||
mend
|
497
bin/gsh/M/cmd.mac
Normal file
497
bin/gsh/M/cmd.mac
Normal file
|
@ -0,0 +1,497 @@
|
|||
MACRO
|
||||
&lab long &stat
|
||||
&lab anop
|
||||
lcla &t
|
||||
lcla &len
|
||||
lclc &ch
|
||||
&t seta 0
|
||||
&len seta l:&stat
|
||||
.a
|
||||
aif &len=0,.b
|
||||
&ch amid &stat,&len,1
|
||||
aif ("&ch"="x").or.("&ch"="y").or.("&ch"="i"),.i
|
||||
aif ("&ch"="a").or.("&ch"="m"),.m
|
||||
.c
|
||||
&len seta &len-1
|
||||
ago ^a
|
||||
.i
|
||||
longi on
|
||||
&t seta &t+16
|
||||
ago ^c
|
||||
.m
|
||||
longa on
|
||||
&t seta &t+32
|
||||
ago ^c
|
||||
.b
|
||||
aif &t=0,.d
|
||||
rep #&t
|
||||
.d
|
||||
mend
|
||||
MACRO
|
||||
&lab short &stat
|
||||
&lab anop
|
||||
lcla &t
|
||||
lcla &len
|
||||
lclc &ch
|
||||
&t seta 0
|
||||
&len seta l:&stat
|
||||
.a
|
||||
aif &len=0,.b
|
||||
&ch amid &stat,&len,1
|
||||
aif ("&ch"="x").or.("&ch"="y").or.("&ch"="i"),.i
|
||||
aif ("&ch"="a").or.("&ch"="m"),.m
|
||||
.c
|
||||
&len seta &len-1
|
||||
ago ^a
|
||||
.i
|
||||
longi off
|
||||
&t seta &t+16
|
||||
ago ^c
|
||||
.m
|
||||
longa off
|
||||
&t seta &t+32
|
||||
ago ^c
|
||||
.b
|
||||
aif &t=0,.d
|
||||
sep #&t
|
||||
.d
|
||||
mend
|
||||
MACRO
|
||||
&lab if2 &var,&rel,&val,&label
|
||||
&lab ago .skip
|
||||
ble
|
||||
bgt
|
||||
.skip
|
||||
lclc &char1
|
||||
lclc &char2
|
||||
&char1 amid &var,1,1
|
||||
&char2 amid &var,2,1
|
||||
aif "&char1"="@",.index
|
||||
lda &var
|
||||
.cmp
|
||||
cmp &val
|
||||
ago .branch
|
||||
.index
|
||||
aif "&char2"="x",.x1
|
||||
aif "&char2"="X",.x1
|
||||
aif "&char2"="y",.y1
|
||||
aif "&char2"="Y",.y1
|
||||
ago ^cmp
|
||||
.x1
|
||||
cpx &val
|
||||
ago .branch
|
||||
.y1
|
||||
cpy &val
|
||||
.branch
|
||||
&char1 amid &rel,1,1
|
||||
aif "&char1"="@",.done
|
||||
b&rel &label
|
||||
.done
|
||||
mend
|
||||
MACRO
|
||||
&lab bgt &loc
|
||||
&lab beq *+4
|
||||
bcs &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab ble &loc
|
||||
&lab bcc &loc
|
||||
beq &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab jeq &loc
|
||||
&lab bne *+5
|
||||
jmp &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab ph2 &parm
|
||||
lclc &char
|
||||
&lab anop
|
||||
aif c:&parm=0,.done
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="@",.at
|
||||
aif s:longa=1,.chk
|
||||
rep #%00100000
|
||||
.chk
|
||||
aif "&char"<>"{",.absolute
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
lda (&parm)
|
||||
pha
|
||||
ago .shorten
|
||||
.absolute
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.immediate
|
||||
&parm amid &parm,2,l:&parm-1
|
||||
pea &parm
|
||||
ago .done
|
||||
.at
|
||||
&char amid &parm,2,1
|
||||
ph&char
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing closing '}'",16
|
||||
mend
|
||||
MACRO
|
||||
&lab ph4 &parm
|
||||
lclc &char
|
||||
lclc &char1
|
||||
lclc &char2
|
||||
&lab anop
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="@",.at
|
||||
aif s:longa=1,.chk1
|
||||
rep #%00100000
|
||||
.chk1
|
||||
aif "&char"<>"{",.chk2
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
ldy #2
|
||||
lda (&parm),y
|
||||
pha
|
||||
lda (&parm)
|
||||
pha
|
||||
ago .shorten
|
||||
.chk2
|
||||
aif "&char"<>"[",.absolute
|
||||
ldy #2
|
||||
lda &parm,y
|
||||
pha
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.absolute
|
||||
lda &parm+2
|
||||
pha
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.at
|
||||
&char1 amid &parm,2,1
|
||||
&char2 setc &char1
|
||||
ph&char1
|
||||
aif l:&parm<3,.chk2a
|
||||
&char2 amid &parm,3,1
|
||||
.chk2a
|
||||
ph&char2
|
||||
ago .shorten
|
||||
.immediate
|
||||
&parm amid &parm,2,l:&parm-1
|
||||
pea +(&parm)|-16
|
||||
pea &parm
|
||||
ago .done
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing closing '}'",16
|
||||
mend
|
||||
macro
|
||||
&lab MV4 &src,&adr
|
||||
&lab lcla &count
|
||||
lda &src
|
||||
&count seta 1
|
||||
.loop1
|
||||
sta &adr(&count)
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.part2
|
||||
ago ^loop1
|
||||
.part2
|
||||
lda &src+2
|
||||
&count seta 1
|
||||
.loop2
|
||||
sta &adr(&count)+2
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.done
|
||||
ago ^loop2
|
||||
.done
|
||||
mend
|
||||
MACRO
|
||||
&lab subroutine &parms,&work
|
||||
&lab anop
|
||||
aif c:&work,.a
|
||||
lclc &work
|
||||
&work setc 0
|
||||
.a
|
||||
gbla &totallen
|
||||
gbla &worklen
|
||||
&worklen seta &work
|
||||
&totallen seta 0
|
||||
aif c:&parms=0,.e
|
||||
lclc &len
|
||||
lclc &p
|
||||
lcla &i
|
||||
&i seta c:&parms
|
||||
.b
|
||||
&p setc &parms(&i)
|
||||
&len amid &p,2,1
|
||||
aif "&len"=":",.c
|
||||
&len amid &p,1,2
|
||||
&p amid &p,4,l:&p-3
|
||||
ago .d
|
||||
.c
|
||||
&len amid &p,1,1
|
||||
&p amid &p,3,l:&p-2
|
||||
.d
|
||||
&p equ &totallen+3+&work
|
||||
&totallen seta &totallen+&len
|
||||
&i seta &i-1
|
||||
aif &i,^b
|
||||
.e
|
||||
tsc
|
||||
sec
|
||||
sbc #&work
|
||||
tcs
|
||||
inc a
|
||||
phd
|
||||
tcd
|
||||
phb
|
||||
phk
|
||||
plb
|
||||
mend
|
||||
MACRO
|
||||
&lab return &r
|
||||
&lab anop
|
||||
lclc &len
|
||||
aif c:&r,.a
|
||||
lclc &r
|
||||
&r setc 0
|
||||
&len setc 0
|
||||
ago .h
|
||||
.a
|
||||
&len amid &r,2,1
|
||||
aif "&len"=":",.b
|
||||
&len amid &r,1,2
|
||||
&r amid &r,4,l:&r-3
|
||||
ago .c
|
||||
.b
|
||||
&len amid &r,1,1
|
||||
&r amid &r,3,l:&r-2
|
||||
.c
|
||||
aif &len<>2,.d
|
||||
ldy &r
|
||||
ago .h
|
||||
.d
|
||||
aif &len<>4,.e
|
||||
ldx &r+2
|
||||
ldy &r
|
||||
ago .h
|
||||
.e
|
||||
aif &len<>10,.g
|
||||
ldy #&r
|
||||
ldx #^&r
|
||||
ago .h
|
||||
.g
|
||||
mnote 'Not a valid return length',16
|
||||
mexit
|
||||
.h
|
||||
aif &totallen=0,.i
|
||||
lda &worklen+1
|
||||
sta &worklen+&totallen+1
|
||||
lda &worklen
|
||||
sta &worklen+&totallen
|
||||
.i
|
||||
plb
|
||||
pld
|
||||
tsc
|
||||
clc
|
||||
adc #&worklen+&totallen
|
||||
tcs
|
||||
aif &len=0,.j
|
||||
tya
|
||||
.j
|
||||
rtl
|
||||
mend
|
||||
MACRO
|
||||
&lab add2 &arg1,&arg2,&dest
|
||||
lclc &char
|
||||
&lab clc
|
||||
&char amid &arg1,1,1
|
||||
aif "&char"="@",.at1
|
||||
lda &arg1
|
||||
ago .add
|
||||
.at1
|
||||
&char amid &arg1,2,1
|
||||
aif "&char"="x",.x1
|
||||
aif "&char"="X",.x1
|
||||
aif "&char"="y",.y1
|
||||
aif "&char"="Y",.y1
|
||||
ago .add
|
||||
.x1
|
||||
txa
|
||||
ago .add
|
||||
.y1
|
||||
tya
|
||||
.add
|
||||
adc &arg2
|
||||
&char amid &dest,1,1
|
||||
aif "&char"="@",.at2
|
||||
sta &dest
|
||||
ago .b
|
||||
.at2
|
||||
&char amid &dest,2,1
|
||||
aif "&char"="x",.x2
|
||||
aif "&char"="X",.x2
|
||||
aif "&char"="y",.y2
|
||||
aif "&char"="Y",.y2
|
||||
ago .b
|
||||
.x2
|
||||
tax
|
||||
ago .b
|
||||
.y2
|
||||
tay
|
||||
.b
|
||||
mend
|
||||
MACRO
|
||||
&lab iny2
|
||||
&lab iny
|
||||
iny
|
||||
mend
|
||||
MACRO
|
||||
&lab Int2Dec &a1
|
||||
&lab ph2 &a1(1)
|
||||
ph4 &a1(2)
|
||||
ph2 &a1(3)
|
||||
ph2 &a1(4)
|
||||
Tool $260b
|
||||
mend
|
||||
MACRO
|
||||
&lab ERROR &a1
|
||||
&lab p16 $105,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab p16 &a1,&a2
|
||||
&lab jsl $E100A8
|
||||
dc i2'&a1'
|
||||
dc i4'&a2'
|
||||
mend
|
||||
MACRO
|
||||
&lab LD2 &val,&adr
|
||||
&lab lcla &count
|
||||
lda #&val
|
||||
&count seta 1
|
||||
.loop
|
||||
sta &adr(&count)
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.done
|
||||
ago ^loop
|
||||
.done
|
||||
mend
|
||||
MACRO
|
||||
&lab and2 &arg1,&arg2,&dest
|
||||
&lab anop
|
||||
lclc &char
|
||||
&char amid &arg1,1,1
|
||||
aif "&char"="@",.at1
|
||||
lda &arg1
|
||||
ago .add
|
||||
.at1
|
||||
&char amid &arg1,2,1
|
||||
aif "&char"="x",.x1
|
||||
aif "&char"="X",.x1
|
||||
aif "&char"="y",.y1
|
||||
aif "&char"="Y",.y1
|
||||
ago .add
|
||||
.x1
|
||||
txa
|
||||
ago .add
|
||||
.y1
|
||||
tya
|
||||
.add
|
||||
and &arg2
|
||||
&char amid &dest,1,1
|
||||
aif "&char"="@",.at2
|
||||
sta &dest
|
||||
ago .b
|
||||
.at2
|
||||
&char amid &dest,2,1
|
||||
aif "&char"="x",.x2
|
||||
aif "&char"="X",.x2
|
||||
aif "&char"="y",.y2
|
||||
aif "&char"="Y",.y2
|
||||
ago .b
|
||||
.x2
|
||||
tax
|
||||
ago .b
|
||||
.y2
|
||||
tay
|
||||
.b
|
||||
mend
|
||||
MACRO
|
||||
&lab asl2 &a
|
||||
&lab asl &a
|
||||
asl &a
|
||||
mend
|
||||
MACRO
|
||||
&lab LD4 &val,&adr
|
||||
&lab lcla &count
|
||||
lda #<&val
|
||||
&count seta 1
|
||||
.loop1
|
||||
sta &adr(&count)
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.part2
|
||||
ago ^loop1
|
||||
.part2
|
||||
lda #+(&val)|-16
|
||||
&count seta 1
|
||||
.loop2
|
||||
sta &adr(&count)+2
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.done
|
||||
ago ^loop2
|
||||
.done
|
||||
mend
|
||||
MACRO
|
||||
&lab jcc &loc
|
||||
&lab bcs *+5
|
||||
jmp &loc
|
||||
mend
|
||||
macro
|
||||
&lab Set_Variable &a1
|
||||
&lab p16 $106,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab wait &a1
|
||||
&lab ph4 &a1
|
||||
case on
|
||||
jsl wait
|
||||
case off
|
||||
MEND
|
||||
MACRO
|
||||
&lab pipe &a1
|
||||
&lab ph4 &a1
|
||||
case on
|
||||
jsl pipe
|
||||
case off
|
||||
MEND
|
||||
MACRO
|
||||
&lab signal &a1
|
||||
&lab ph4 &a1(2)
|
||||
ph2 &a1(1)
|
||||
case on
|
||||
jsl signal
|
||||
case off
|
||||
MEND
|
||||
MACRO
|
||||
&lab tool &a1
|
||||
&lab ldx #&a1
|
||||
jsl $e10000
|
||||
mend
|
||||
macro
|
||||
&lab ErrWriteCString &a1
|
||||
&lab ph4 &a1
|
||||
Tool $210c
|
||||
mend
|
474
bin/gsh/M/dir.mac
Normal file
474
bin/gsh/M/dir.mac
Normal file
|
@ -0,0 +1,474 @@
|
|||
MACRO
|
||||
&lab ph4 &parm
|
||||
lclc &char
|
||||
lclc &char1
|
||||
lclc &char2
|
||||
&lab anop
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="@",.at
|
||||
aif s:longa=1,.chk1
|
||||
rep #%00100000
|
||||
.chk1
|
||||
aif "&char"<>"{",.chk2
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
ldy #2
|
||||
lda (&parm),y
|
||||
pha
|
||||
lda (&parm)
|
||||
pha
|
||||
ago .shorten
|
||||
.chk2
|
||||
aif "&char"<>"[",.absolute
|
||||
ldy #2
|
||||
lda &parm,y
|
||||
pha
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.absolute
|
||||
lda &parm+2
|
||||
pha
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.at
|
||||
&char1 amid &parm,2,1
|
||||
&char2 setc &char1
|
||||
ph&char1
|
||||
aif l:&parm<3,.chk2a
|
||||
&char2 amid &parm,3,1
|
||||
.chk2a
|
||||
ph&char2
|
||||
ago .shorten
|
||||
.immediate
|
||||
&parm amid &parm,2,l:&parm-1
|
||||
pea +(&parm)|-16
|
||||
pea &parm
|
||||
ago .done
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing closing '}'",16
|
||||
mend
|
||||
MACRO
|
||||
&lab READ_VARIABLE &a1
|
||||
&lab p16 $10B,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab Str &string
|
||||
&lab dc i1'L:&string'
|
||||
dc c"&string"
|
||||
mend
|
||||
MACRO
|
||||
&lab p16 &a1,&a2
|
||||
&lab jsl $E100A8
|
||||
dc i2'&a1'
|
||||
dc i4'&a2'
|
||||
mend
|
||||
MACRO
|
||||
&lab long &stat
|
||||
&lab anop
|
||||
lcla &t
|
||||
lcla &len
|
||||
lclc &ch
|
||||
&t seta 0
|
||||
&len seta l:&stat
|
||||
.a
|
||||
aif &len=0,.b
|
||||
&ch amid &stat,&len,1
|
||||
aif ("&ch"="x").or.("&ch"="y").or.("&ch"="i"),.i
|
||||
aif ("&ch"="a").or.("&ch"="m"),.m
|
||||
.c
|
||||
&len seta &len-1
|
||||
ago ^a
|
||||
.i
|
||||
longi on
|
||||
&t seta &t+16
|
||||
ago ^c
|
||||
.m
|
||||
longa on
|
||||
&t seta &t+32
|
||||
ago ^c
|
||||
.b
|
||||
aif &t=0,.d
|
||||
rep #&t
|
||||
.d
|
||||
mend
|
||||
MACRO
|
||||
&lab short &stat
|
||||
&lab anop
|
||||
lcla &t
|
||||
lcla &len
|
||||
lclc &ch
|
||||
&t seta 0
|
||||
&len seta l:&stat
|
||||
.a
|
||||
aif &len=0,.b
|
||||
&ch amid &stat,&len,1
|
||||
aif ("&ch"="x").or.("&ch"="y").or.("&ch"="i"),.i
|
||||
aif ("&ch"="a").or.("&ch"="m"),.m
|
||||
.c
|
||||
&len seta &len-1
|
||||
ago ^a
|
||||
.i
|
||||
longi off
|
||||
&t seta &t+16
|
||||
ago ^c
|
||||
.m
|
||||
longa off
|
||||
&t seta &t+32
|
||||
ago ^c
|
||||
.b
|
||||
aif &t=0,.d
|
||||
sep #&t
|
||||
.d
|
||||
mend
|
||||
MACRO
|
||||
&lab subroutine &parms,&work
|
||||
&lab anop
|
||||
aif c:&work,.a
|
||||
lclc &work
|
||||
&work setc 0
|
||||
.a
|
||||
gbla &totallen
|
||||
gbla &worklen
|
||||
&worklen seta &work
|
||||
&totallen seta 0
|
||||
aif c:&parms=0,.e
|
||||
lclc &len
|
||||
lclc &p
|
||||
lcla &i
|
||||
&i seta c:&parms
|
||||
.b
|
||||
&p setc &parms(&i)
|
||||
&len amid &p,2,1
|
||||
aif "&len"=":",.c
|
||||
&len amid &p,1,2
|
||||
&p amid &p,4,l:&p-3
|
||||
ago .d
|
||||
.c
|
||||
&len amid &p,1,1
|
||||
&p amid &p,3,l:&p-2
|
||||
.d
|
||||
&p equ &totallen+3+&work
|
||||
&totallen seta &totallen+&len
|
||||
&i seta &i-1
|
||||
aif &i,^b
|
||||
.e
|
||||
tsc
|
||||
sec
|
||||
sbc #&work
|
||||
tcs
|
||||
inc a
|
||||
phd
|
||||
tcd
|
||||
phb
|
||||
phk
|
||||
plb
|
||||
mend
|
||||
MACRO
|
||||
&lab return &r
|
||||
&lab anop
|
||||
lclc &len
|
||||
aif c:&r,.a
|
||||
lclc &r
|
||||
&r setc 0
|
||||
&len setc 0
|
||||
ago .h
|
||||
.a
|
||||
&len amid &r,2,1
|
||||
aif "&len"=":",.b
|
||||
&len amid &r,1,2
|
||||
&r amid &r,4,l:&r-3
|
||||
ago .c
|
||||
.b
|
||||
&len amid &r,1,1
|
||||
&r amid &r,3,l:&r-2
|
||||
.c
|
||||
aif &len<>2,.d
|
||||
ldy &r
|
||||
ago .h
|
||||
.d
|
||||
aif &len<>4,.e
|
||||
ldx &r+2
|
||||
ldy &r
|
||||
ago .h
|
||||
.e
|
||||
aif &len<>10,.g
|
||||
ldy #&r
|
||||
ldx #^&r
|
||||
ago .h
|
||||
.g
|
||||
mnote 'Not a valid return length',16
|
||||
mexit
|
||||
.h
|
||||
aif &totallen=0,.i
|
||||
lda &worklen+1
|
||||
sta &worklen+&totallen+1
|
||||
lda &worklen
|
||||
sta &worklen+&totallen
|
||||
.i
|
||||
plb
|
||||
pld
|
||||
tsc
|
||||
clc
|
||||
adc #&worklen+&totallen
|
||||
tcs
|
||||
aif &len=0,.j
|
||||
tya
|
||||
.j
|
||||
rtl
|
||||
mend
|
||||
macro
|
||||
&lab inc2 &a
|
||||
&lab inc &a
|
||||
inc &a
|
||||
mend
|
||||
MACRO
|
||||
&lab if2 &var,&rel,&val,&label
|
||||
&lab ago .skip
|
||||
ble
|
||||
bgt
|
||||
.skip
|
||||
lclc &char1
|
||||
lclc &char2
|
||||
&char1 amid &var,1,1
|
||||
&char2 amid &var,2,1
|
||||
aif "&char1"="@",.index
|
||||
lda &var
|
||||
.cmp
|
||||
cmp &val
|
||||
ago .branch
|
||||
.index
|
||||
aif "&char2"="x",.x1
|
||||
aif "&char2"="X",.x1
|
||||
aif "&char2"="y",.y1
|
||||
aif "&char2"="Y",.y1
|
||||
ago ^cmp
|
||||
.x1
|
||||
cpx &val
|
||||
ago .branch
|
||||
.y1
|
||||
cpy &val
|
||||
.branch
|
||||
&char1 amid &rel,1,1
|
||||
aif "&char1"="@",.done
|
||||
b&rel &label
|
||||
.done
|
||||
mend
|
||||
MACRO
|
||||
&lab bgt &loc
|
||||
&lab beq *+4
|
||||
bcs &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab ble &loc
|
||||
&lab bcc &loc
|
||||
beq &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab sub2 &arg1,&arg2,&dest
|
||||
lclc &char
|
||||
&lab sec
|
||||
&char amid &arg1,1,1
|
||||
aif "&char"="@",.at1
|
||||
lda &arg1
|
||||
ago .sub
|
||||
.at1
|
||||
&char amid &arg1,2,1
|
||||
aif "&char"="x",.x1
|
||||
aif "&char"="X",.x1
|
||||
aif "&char"="y",.y1
|
||||
aif "&char"="Y",.y1
|
||||
ago .sub
|
||||
.x1
|
||||
txa
|
||||
ago .sub
|
||||
.y1
|
||||
tya
|
||||
.sub
|
||||
sbc &arg2
|
||||
&char amid &dest,1,1
|
||||
aif "&char"="@",.at2
|
||||
sta &dest
|
||||
ago .b
|
||||
.at2
|
||||
&char amid &dest,2,1
|
||||
aif "&char"="x",.x2
|
||||
aif "&char"="X",.x2
|
||||
aif "&char"="y",.y2
|
||||
aif "&char"="Y",.y2
|
||||
ago .b
|
||||
.x2
|
||||
tax
|
||||
ago .b
|
||||
.y2
|
||||
tay
|
||||
.b
|
||||
mend
|
||||
MACRO
|
||||
&lab WriteCString &a1
|
||||
&lab ph4 &a1
|
||||
Tool $200c
|
||||
mend
|
||||
MACRO
|
||||
&lab tool &a1
|
||||
&lab ldx #&a1
|
||||
jsl $e10000
|
||||
mend
|
||||
MACRO
|
||||
&lab add4 &arg1,&arg2,&dest
|
||||
&lab anop
|
||||
lclc &ch
|
||||
&ch amid &arg2,1,1
|
||||
clc
|
||||
lda &arg1
|
||||
adc &arg2
|
||||
sta &dest
|
||||
lda &arg1+2
|
||||
aif "&ch"="#",.a
|
||||
adc &arg2+2
|
||||
ago .b
|
||||
.a
|
||||
adc &arg2|-16
|
||||
.b
|
||||
sta &dest+2
|
||||
mend
|
||||
MACRO
|
||||
&lab GetPrefix &a1
|
||||
&lab gsos $200A,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab gsos &a1,&a2
|
||||
&lab jsl $E100A8
|
||||
dc i2'&a1'
|
||||
dc i4'&a2'
|
||||
mend
|
||||
MACRO
|
||||
&lab unlock &a1
|
||||
&lab stz &a1
|
||||
MEND
|
||||
MACRO
|
||||
&lab key
|
||||
&lab dc i2'0'
|
||||
MEND
|
||||
MACRO
|
||||
&lab lock &a1
|
||||
&lab lda #1
|
||||
tsb &a1
|
||||
beq *+6
|
||||
cop $7F
|
||||
bra *-7
|
||||
MEND
|
||||
macro
|
||||
&lab ErrWriteCString &a1
|
||||
&lab ph4 &a1
|
||||
Tool $210c
|
||||
mend
|
||||
MACRO
|
||||
&lab GetFileInfo &a1
|
||||
&lab gsos $2006,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab ERROR &a1
|
||||
&lab p16 $105,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab SetPrefix &a1
|
||||
&lab gsos $2009,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab Dec2Int &a1,&a2
|
||||
&lab pha
|
||||
ph4 &a1(1)
|
||||
ph2 &a1(2)
|
||||
ph2 &a1(3)
|
||||
Tool $280b
|
||||
pl2 &a2
|
||||
mend
|
||||
MACRO
|
||||
&lab ph2 &parm
|
||||
lclc &char
|
||||
&lab anop
|
||||
aif c:&parm=0,.done
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="@",.at
|
||||
aif s:longa=1,.chk
|
||||
rep #%00100000
|
||||
.chk
|
||||
aif "&char"<>"{",.absolute
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
lda (&parm)
|
||||
pha
|
||||
ago .shorten
|
||||
.absolute
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.immediate
|
||||
&parm amid &parm,2,l:&parm-1
|
||||
pea &parm
|
||||
ago .done
|
||||
.at
|
||||
&char amid &parm,2,1
|
||||
ph&char
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing closing '}'",16
|
||||
mend
|
||||
MACRO
|
||||
&lab pl2 &parm
|
||||
lclc &char
|
||||
&lab anop
|
||||
aif s:longa=1,.start
|
||||
rep #%00100000
|
||||
.start
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="@",.at
|
||||
aif "&char"<>"{",.absolute
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
pla
|
||||
sta (&parm)
|
||||
ago .shorten
|
||||
.absolute
|
||||
pla
|
||||
sta &parm
|
||||
ago .shorten
|
||||
.at
|
||||
&char amid &parm,2,1
|
||||
pl&char
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing Closing '}'",16
|
||||
mend
|
||||
MACRO
|
||||
&lab jeq &loc
|
||||
&lab bne *+5
|
||||
jmp &loc
|
||||
mend
|
||||
macro
|
||||
&lab inx4
|
||||
&lab inx
|
||||
inx
|
||||
inx
|
||||
inx
|
||||
mend
|
551
bin/gsh/M/edit.mac
Normal file
551
bin/gsh/M/edit.mac
Normal file
|
@ -0,0 +1,551 @@
|
|||
MACRO
|
||||
&lab long &stat
|
||||
&lab anop
|
||||
lcla &t
|
||||
lcla &len
|
||||
lclc &ch
|
||||
&t seta 0
|
||||
&len seta l:&stat
|
||||
.a
|
||||
aif &len=0,.b
|
||||
&ch amid &stat,&len,1
|
||||
aif ("&ch"="x").or.("&ch"="y").or.("&ch"="i"),.i
|
||||
aif ("&ch"="a").or.("&ch"="m"),.m
|
||||
.c
|
||||
&len seta &len-1
|
||||
ago ^a
|
||||
.i
|
||||
longi on
|
||||
&t seta &t+16
|
||||
ago ^c
|
||||
.m
|
||||
longa on
|
||||
&t seta &t+32
|
||||
ago ^c
|
||||
.b
|
||||
aif &t=0,.d
|
||||
rep #&t
|
||||
.d
|
||||
mend
|
||||
MACRO
|
||||
&lab short &stat
|
||||
&lab anop
|
||||
lcla &t
|
||||
lcla &len
|
||||
lclc &ch
|
||||
&t seta 0
|
||||
&len seta l:&stat
|
||||
.a
|
||||
aif &len=0,.b
|
||||
&ch amid &stat,&len,1
|
||||
aif ("&ch"="x").or.("&ch"="y").or.("&ch"="i"),.i
|
||||
aif ("&ch"="a").or.("&ch"="m"),.m
|
||||
.c
|
||||
&len seta &len-1
|
||||
ago ^a
|
||||
.i
|
||||
longi off
|
||||
&t seta &t+16
|
||||
ago ^c
|
||||
.m
|
||||
longa off
|
||||
&t seta &t+32
|
||||
ago ^c
|
||||
.b
|
||||
aif &t=0,.d
|
||||
sep #&t
|
||||
.d
|
||||
mend
|
||||
MACRO
|
||||
&lab if2 &var,&rel,&val,&label
|
||||
&lab ago .skip
|
||||
ble
|
||||
bgt
|
||||
.skip
|
||||
lclc &char1
|
||||
lclc &char2
|
||||
&char1 amid &var,1,1
|
||||
&char2 amid &var,2,1
|
||||
aif "&char1"="@",.index
|
||||
lda &var
|
||||
.cmp
|
||||
cmp &val
|
||||
ago .branch
|
||||
.index
|
||||
aif "&char2"="x",.x1
|
||||
aif "&char2"="X",.x1
|
||||
aif "&char2"="y",.y1
|
||||
aif "&char2"="Y",.y1
|
||||
ago ^cmp
|
||||
.x1
|
||||
cpx &val
|
||||
ago .branch
|
||||
.y1
|
||||
cpy &val
|
||||
.branch
|
||||
&char1 amid &rel,1,1
|
||||
aif "&char1"="@",.done
|
||||
b&rel &label
|
||||
.done
|
||||
mend
|
||||
MACRO
|
||||
&lab bgt &loc
|
||||
&lab beq *+4
|
||||
bcs &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab ble &loc
|
||||
&lab bcc &loc
|
||||
beq &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab sub2 &arg1,&arg2,&dest
|
||||
lclc &char
|
||||
&lab sec
|
||||
&char amid &arg1,1,1
|
||||
aif "&char"="@",.at1
|
||||
lda &arg1
|
||||
ago .sub
|
||||
.at1
|
||||
&char amid &arg1,2,1
|
||||
aif "&char"="x",.x1
|
||||
aif "&char"="X",.x1
|
||||
aif "&char"="y",.y1
|
||||
aif "&char"="Y",.y1
|
||||
ago .sub
|
||||
.x1
|
||||
txa
|
||||
ago .sub
|
||||
.y1
|
||||
tya
|
||||
.sub
|
||||
sbc &arg2
|
||||
&char amid &dest,1,1
|
||||
aif "&char"="@",.at2
|
||||
sta &dest
|
||||
ago .b
|
||||
.at2
|
||||
&char amid &dest,2,1
|
||||
aif "&char"="x",.x2
|
||||
aif "&char"="X",.x2
|
||||
aif "&char"="y",.y2
|
||||
aif "&char"="Y",.y2
|
||||
ago .b
|
||||
.x2
|
||||
tax
|
||||
ago .b
|
||||
.y2
|
||||
tay
|
||||
.b
|
||||
mend
|
||||
MACRO
|
||||
&lab jeq &loc
|
||||
&lab bne *+5
|
||||
jmp &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab ph4 &parm
|
||||
lclc &char
|
||||
lclc &char1
|
||||
lclc &char2
|
||||
&lab anop
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="@",.at
|
||||
aif s:longa=1,.chk1
|
||||
rep #%00100000
|
||||
.chk1
|
||||
aif "&char"<>"{",.chk2
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
ldy #2
|
||||
lda (&parm),y
|
||||
pha
|
||||
lda (&parm)
|
||||
pha
|
||||
ago .shorten
|
||||
.chk2
|
||||
aif "&char"<>"[",.absolute
|
||||
ldy #2
|
||||
lda &parm,y
|
||||
pha
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.absolute
|
||||
lda &parm+2
|
||||
pha
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.at
|
||||
&char1 amid &parm,2,1
|
||||
&char2 setc &char1
|
||||
ph&char1
|
||||
aif l:&parm<3,.chk2a
|
||||
&char2 amid &parm,3,1
|
||||
.chk2a
|
||||
ph&char2
|
||||
ago .shorten
|
||||
.immediate
|
||||
&parm amid &parm,2,l:&parm-1
|
||||
pea +(&parm)|-16
|
||||
pea &parm
|
||||
ago .done
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing closing '}'",16
|
||||
mend
|
||||
MACRO
|
||||
&lab eor2 &arg1,&arg2,&dest
|
||||
&lab anop
|
||||
lclc &char
|
||||
&char amid &arg1,1,1
|
||||
aif "&char"="@",.at1
|
||||
lda &arg1
|
||||
ago .add
|
||||
.at1
|
||||
&char amid &arg1,2,1
|
||||
aif "&char"="x",.x1
|
||||
aif "&char"="X",.x1
|
||||
aif "&char"="y",.y1
|
||||
aif "&char"="Y",.y1
|
||||
ago .add
|
||||
.x1
|
||||
txa
|
||||
ago .add
|
||||
.y1
|
||||
tya
|
||||
.add
|
||||
eor &arg2
|
||||
&char amid &dest,1,1
|
||||
aif "&char"="@",.at2
|
||||
sta &dest
|
||||
ago .b
|
||||
.at2
|
||||
&char amid &dest,2,1
|
||||
aif "&char"="x",.x2
|
||||
aif "&char"="X",.x2
|
||||
aif "&char"="y",.y2
|
||||
aif "&char"="Y",.y2
|
||||
ago .b
|
||||
.x2
|
||||
tax
|
||||
ago .b
|
||||
.y2
|
||||
tay
|
||||
.b
|
||||
mend
|
||||
macro
|
||||
&lab MV4 &src,&adr
|
||||
&lab lcla &count
|
||||
lda &src
|
||||
&count seta 1
|
||||
.loop1
|
||||
sta &adr(&count)
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.part2
|
||||
ago ^loop1
|
||||
.part2
|
||||
lda &src+2
|
||||
&count seta 1
|
||||
.loop2
|
||||
sta &adr(&count)+2
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.done
|
||||
ago ^loop2
|
||||
.done
|
||||
mend
|
||||
MACRO
|
||||
&lab INIT_WILDCARD &a1
|
||||
&lab p16 $109,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab NEXT_WILDCARD &a1
|
||||
&lab p16 $10A,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab p16 &a1,&a2
|
||||
&lab jsl $E100A8
|
||||
dc i2'&a1'
|
||||
dc i4'&a2'
|
||||
mend
|
||||
MACRO
|
||||
&lab GetFileInfo &a1
|
||||
&lab gsos $2006,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab gsos &a1,&a2
|
||||
&lab jsl $E100A8
|
||||
dc i2'&a1'
|
||||
dc i4'&a2'
|
||||
mend
|
||||
MACRO
|
||||
&lab ioctl &a1
|
||||
&lab ph4 &a1(3)
|
||||
ph4 &a1(2)
|
||||
ph2 &a1(1)
|
||||
case on
|
||||
jsl ioctl
|
||||
case off
|
||||
MEND
|
||||
MACRO
|
||||
&lab ph2 &parm
|
||||
lclc &char
|
||||
&lab anop
|
||||
aif c:&parm=0,.done
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="@",.at
|
||||
aif s:longa=1,.chk
|
||||
rep #%00100000
|
||||
.chk
|
||||
aif "&char"<>"{",.absolute
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
lda (&parm)
|
||||
pha
|
||||
ago .shorten
|
||||
.absolute
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.immediate
|
||||
&parm amid &parm,2,l:&parm-1
|
||||
pea &parm
|
||||
ago .done
|
||||
.at
|
||||
&char amid &parm,2,1
|
||||
ph&char
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing closing '}'",16
|
||||
mend
|
||||
MACRO
|
||||
&lab subroutine &parms,&work
|
||||
&lab anop
|
||||
aif c:&work,.a
|
||||
lclc &work
|
||||
&work setc 0
|
||||
.a
|
||||
gbla &totallen
|
||||
gbla &worklen
|
||||
&worklen seta &work
|
||||
&totallen seta 0
|
||||
aif c:&parms=0,.e
|
||||
lclc &len
|
||||
lclc &p
|
||||
lcla &i
|
||||
&i seta c:&parms
|
||||
.b
|
||||
&p setc &parms(&i)
|
||||
&len amid &p,2,1
|
||||
aif "&len"=":",.c
|
||||
&len amid &p,1,2
|
||||
&p amid &p,4,l:&p-3
|
||||
ago .d
|
||||
.c
|
||||
&len amid &p,1,1
|
||||
&p amid &p,3,l:&p-2
|
||||
.d
|
||||
&p equ &totallen+3+&work
|
||||
&totallen seta &totallen+&len
|
||||
&i seta &i-1
|
||||
aif &i,^b
|
||||
.e
|
||||
tsc
|
||||
sec
|
||||
sbc #&work
|
||||
tcs
|
||||
inc a
|
||||
phd
|
||||
tcd
|
||||
phb
|
||||
phk
|
||||
plb
|
||||
mend
|
||||
MACRO
|
||||
&lab return &r
|
||||
&lab anop
|
||||
lclc &len
|
||||
aif c:&r,.a
|
||||
lclc &r
|
||||
&r setc 0
|
||||
&len setc 0
|
||||
ago .h
|
||||
.a
|
||||
&len amid &r,2,1
|
||||
aif "&len"=":",.b
|
||||
&len amid &r,1,2
|
||||
&r amid &r,4,l:&r-3
|
||||
ago .c
|
||||
.b
|
||||
&len amid &r,1,1
|
||||
&r amid &r,3,l:&r-2
|
||||
.c
|
||||
aif &len<>2,.d
|
||||
ldy &r
|
||||
ago .h
|
||||
.d
|
||||
aif &len<>4,.e
|
||||
ldx &r+2
|
||||
ldy &r
|
||||
ago .h
|
||||
.e
|
||||
aif &len<>10,.g
|
||||
ldy #&r
|
||||
ldx #^&r
|
||||
ago .h
|
||||
.g
|
||||
mnote 'Not a valid return length',16
|
||||
mexit
|
||||
.h
|
||||
aif &totallen=0,.i
|
||||
lda &worklen+1
|
||||
sta &worklen+&totallen+1
|
||||
lda &worklen
|
||||
sta &worklen+&totallen
|
||||
.i
|
||||
plb
|
||||
pld
|
||||
tsc
|
||||
clc
|
||||
adc #&worklen+&totallen
|
||||
tcs
|
||||
aif &len=0,.j
|
||||
tya
|
||||
.j
|
||||
rtl
|
||||
mend
|
||||
MACRO
|
||||
&lab add4 &arg1,&arg2,&dest
|
||||
&lab anop
|
||||
lclc &ch
|
||||
&ch amid &arg2,1,1
|
||||
clc
|
||||
lda &arg1
|
||||
adc &arg2
|
||||
sta &dest
|
||||
lda &arg1+2
|
||||
aif "&ch"="#",.a
|
||||
adc &arg2+2
|
||||
ago .b
|
||||
.a
|
||||
adc &arg2|-16
|
||||
.b
|
||||
sta &dest+2
|
||||
mend
|
||||
MACRO
|
||||
&lab LD4 &val,&adr
|
||||
&lab lcla &count
|
||||
lda #<&val
|
||||
&count seta 1
|
||||
.loop1
|
||||
sta &adr(&count)
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.part2
|
||||
ago ^loop1
|
||||
.part2
|
||||
lda #+(&val)|-16
|
||||
&count seta 1
|
||||
.loop2
|
||||
sta &adr(&count)+2
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.done
|
||||
ago ^loop2
|
||||
.done
|
||||
mend
|
||||
MACRO
|
||||
&lab tputs &a1
|
||||
&lab ph4 &a1(3)
|
||||
ph2 &a1(2)
|
||||
ph4 &a1(1)
|
||||
case on
|
||||
jsl tputs
|
||||
case off
|
||||
MEND
|
||||
MACRO
|
||||
&lab add2 &arg1,&arg2,&dest
|
||||
lclc &char
|
||||
&lab clc
|
||||
&char amid &arg1,1,1
|
||||
aif "&char"="@",.at1
|
||||
lda &arg1
|
||||
ago .add
|
||||
.at1
|
||||
&char amid &arg1,2,1
|
||||
aif "&char"="x",.x1
|
||||
aif "&char"="X",.x1
|
||||
aif "&char"="y",.y1
|
||||
aif "&char"="Y",.y1
|
||||
ago .add
|
||||
.x1
|
||||
txa
|
||||
ago .add
|
||||
.y1
|
||||
tya
|
||||
.add
|
||||
adc &arg2
|
||||
&char amid &dest,1,1
|
||||
aif "&char"="@",.at2
|
||||
sta &dest
|
||||
ago .b
|
||||
.at2
|
||||
&char amid &dest,2,1
|
||||
aif "&char"="x",.x2
|
||||
aif "&char"="X",.x2
|
||||
aif "&char"="y",.y2
|
||||
aif "&char"="Y",.y2
|
||||
ago .b
|
||||
.x2
|
||||
tax
|
||||
ago .b
|
||||
.y2
|
||||
tay
|
||||
.b
|
||||
mend
|
||||
MACRO
|
||||
&lab jne &loc
|
||||
&lab beq *+5
|
||||
jmp &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab LD2 &val,&adr
|
||||
&lab lcla &count
|
||||
lda #&val
|
||||
&count seta 1
|
||||
.loop
|
||||
sta &adr(&count)
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.done
|
||||
ago ^loop
|
||||
.done
|
||||
mend
|
||||
MACRO
|
||||
&lab READ_INDEXED &a1
|
||||
&lab p16 $108,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab jcc &loc
|
||||
&lab bcs *+5
|
||||
jmp &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab READ_VARIABLE &a1
|
||||
&lab p16 $10B,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab Str &string
|
||||
&lab dc i1'L:&string'
|
||||
dc c"&string"
|
||||
mend
|
435
bin/gsh/M/expand.mac
Normal file
435
bin/gsh/M/expand.mac
Normal file
|
@ -0,0 +1,435 @@
|
|||
MACRO
|
||||
&lab if2 &var,&rel,&val,&label
|
||||
&lab ago .skip
|
||||
ble
|
||||
bgt
|
||||
.skip
|
||||
lclc &char1
|
||||
lclc &char2
|
||||
&char1 amid &var,1,1
|
||||
&char2 amid &var,2,1
|
||||
aif "&char1"="@",.index
|
||||
lda &var
|
||||
.cmp
|
||||
cmp &val
|
||||
ago .branch
|
||||
.index
|
||||
aif "&char2"="x",.x1
|
||||
aif "&char2"="X",.x1
|
||||
aif "&char2"="y",.y1
|
||||
aif "&char2"="Y",.y1
|
||||
ago ^cmp
|
||||
.x1
|
||||
cpx &val
|
||||
ago .branch
|
||||
.y1
|
||||
cpy &val
|
||||
.branch
|
||||
&char1 amid &rel,1,1
|
||||
aif "&char1"="@",.done
|
||||
b&rel &label
|
||||
.done
|
||||
mend
|
||||
MACRO
|
||||
&lab bgt &loc
|
||||
&lab beq *+4
|
||||
bcs &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab ble &loc
|
||||
&lab bcc &loc
|
||||
beq &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab subroutine &parms,&work
|
||||
&lab anop
|
||||
aif c:&work,.a
|
||||
lclc &work
|
||||
&work setc 0
|
||||
.a
|
||||
gbla &totallen
|
||||
gbla &worklen
|
||||
&worklen seta &work
|
||||
&totallen seta 0
|
||||
aif c:&parms=0,.e
|
||||
lclc &len
|
||||
lclc &p
|
||||
lcla &i
|
||||
&i seta c:&parms
|
||||
.b
|
||||
&p setc &parms(&i)
|
||||
&len amid &p,2,1
|
||||
aif "&len"=":",.c
|
||||
&len amid &p,1,2
|
||||
&p amid &p,4,l:&p-3
|
||||
ago .d
|
||||
.c
|
||||
&len amid &p,1,1
|
||||
&p amid &p,3,l:&p-2
|
||||
.d
|
||||
&p equ &totallen+3+&work
|
||||
&totallen seta &totallen+&len
|
||||
&i seta &i-1
|
||||
aif &i,^b
|
||||
.e
|
||||
tsc
|
||||
sec
|
||||
sbc #&work
|
||||
tcs
|
||||
inc a
|
||||
phd
|
||||
tcd
|
||||
phb
|
||||
phk
|
||||
plb
|
||||
mend
|
||||
MACRO
|
||||
&lab return &r
|
||||
&lab anop
|
||||
lclc &len
|
||||
aif c:&r,.a
|
||||
lclc &r
|
||||
&r setc 0
|
||||
&len setc 0
|
||||
ago .h
|
||||
.a
|
||||
&len amid &r,2,1
|
||||
aif "&len"=":",.b
|
||||
&len amid &r,1,2
|
||||
&r amid &r,4,l:&r-3
|
||||
ago .c
|
||||
.b
|
||||
&len amid &r,1,1
|
||||
&r amid &r,3,l:&r-2
|
||||
.c
|
||||
aif &len<>2,.d
|
||||
ldy &r
|
||||
ago .h
|
||||
.d
|
||||
aif &len<>4,.e
|
||||
ldx &r+2
|
||||
ldy &r
|
||||
ago .h
|
||||
.e
|
||||
aif &len<>10,.g
|
||||
ldy #&r
|
||||
ldx #^&r
|
||||
ago .h
|
||||
.g
|
||||
mnote 'Not a valid return length',16
|
||||
mexit
|
||||
.h
|
||||
aif &totallen=0,.i
|
||||
lda &worklen+1
|
||||
sta &worklen+&totallen+1
|
||||
lda &worklen
|
||||
sta &worklen+&totallen
|
||||
.i
|
||||
plb
|
||||
pld
|
||||
tsc
|
||||
clc
|
||||
adc #&worklen+&totallen
|
||||
tcs
|
||||
aif &len=0,.j
|
||||
tya
|
||||
.j
|
||||
rtl
|
||||
mend
|
||||
MACRO
|
||||
&lab MV4 &src,&adr
|
||||
&lab lcla &count
|
||||
lda &src
|
||||
&count seta 1
|
||||
.loop1
|
||||
sta &adr(&count)
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.part2
|
||||
ago ^loop1
|
||||
.part2
|
||||
lda &src+2
|
||||
&count seta 1
|
||||
.loop2
|
||||
sta &adr(&count)+2
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.done
|
||||
ago ^loop2
|
||||
.done
|
||||
mend
|
||||
MACRO
|
||||
&lab ph4 &parm
|
||||
lclc &char
|
||||
lclc &char1
|
||||
lclc &char2
|
||||
&lab anop
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="@",.at
|
||||
aif s:longa=1,.chk1
|
||||
rep #%00100000
|
||||
.chk1
|
||||
aif "&char"<>"{",.chk2
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
ldy #2
|
||||
lda (&parm),y
|
||||
pha
|
||||
lda (&parm)
|
||||
pha
|
||||
ago .shorten
|
||||
.chk2
|
||||
aif "&char"<>"[",.absolute
|
||||
ldy #2
|
||||
lda &parm,y
|
||||
pha
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.absolute
|
||||
lda &parm+2
|
||||
pha
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.at
|
||||
&char1 amid &parm,2,1
|
||||
&char2 setc &char1
|
||||
ph&char1
|
||||
aif l:&parm<3,.chk2a
|
||||
&char2 amid &parm,3,1
|
||||
.chk2a
|
||||
ph&char2
|
||||
ago .shorten
|
||||
.immediate
|
||||
&parm amid &parm,2,l:&parm-1
|
||||
pea +(&parm)|-16
|
||||
pea &parm
|
||||
ago .done
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing closing '}'",16
|
||||
mend
|
||||
MACRO
|
||||
&lab WriteCString &a1
|
||||
&lab ph4 &a1
|
||||
Tool $200c
|
||||
mend
|
||||
MACRO
|
||||
&lab tool &a1
|
||||
&lab ldx #&a1
|
||||
jsl $e10000
|
||||
mend
|
||||
MACRO
|
||||
&lab jeq &loc
|
||||
&lab bne *+5
|
||||
jmp &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab p16 &a1,&a2
|
||||
&lab jsl $E100A8
|
||||
dc i2'&a1'
|
||||
dc i4'&a2'
|
||||
mend
|
||||
MACRO
|
||||
&lab READ_VARIABLE &a1
|
||||
&lab p16 $10B,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab Str &string
|
||||
&lab dc i1'L:&string'
|
||||
dc c"&string"
|
||||
mend
|
||||
MACRO
|
||||
&lab long &stat
|
||||
&lab anop
|
||||
lcla &t
|
||||
lcla &len
|
||||
lclc &ch
|
||||
&t seta 0
|
||||
&len seta l:&stat
|
||||
.a
|
||||
aif &len=0,.b
|
||||
&ch amid &stat,&len,1
|
||||
aif ("&ch"="x").or.("&ch"="y").or.("&ch"="i"),.i
|
||||
aif ("&ch"="a").or.("&ch"="m"),.m
|
||||
.c
|
||||
&len seta &len-1
|
||||
ago ^a
|
||||
.i
|
||||
longi on
|
||||
&t seta &t+16
|
||||
ago ^c
|
||||
.m
|
||||
longa on
|
||||
&t seta &t+32
|
||||
ago ^c
|
||||
.b
|
||||
aif &t=0,.d
|
||||
rep #&t
|
||||
.d
|
||||
mend
|
||||
MACRO
|
||||
&lab short &stat
|
||||
&lab anop
|
||||
lcla &t
|
||||
lcla &len
|
||||
lclc &ch
|
||||
&t seta 0
|
||||
&len seta l:&stat
|
||||
.a
|
||||
aif &len=0,.b
|
||||
&ch amid &stat,&len,1
|
||||
aif ("&ch"="x").or.("&ch"="y").or.("&ch"="i"),.i
|
||||
aif ("&ch"="a").or.("&ch"="m"),.m
|
||||
.c
|
||||
&len seta &len-1
|
||||
ago ^a
|
||||
.i
|
||||
longi off
|
||||
&t seta &t+16
|
||||
ago ^c
|
||||
.m
|
||||
longa off
|
||||
&t seta &t+32
|
||||
ago ^c
|
||||
.b
|
||||
aif &t=0,.d
|
||||
sep #&t
|
||||
.d
|
||||
mend
|
||||
MACRO
|
||||
&lab INIT_WILDCARD &a1
|
||||
&lab p16 $109,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab NEXT_WILDCARD &a1
|
||||
&lab p16 $10A,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab sub2 &arg1,&arg2,&dest
|
||||
lclc &char
|
||||
&lab sec
|
||||
&char amid &arg1,1,1
|
||||
aif "&char"="@",.at1
|
||||
lda &arg1
|
||||
ago .sub
|
||||
.at1
|
||||
&char amid &arg1,2,1
|
||||
aif "&char"="x",.x1
|
||||
aif "&char"="X",.x1
|
||||
aif "&char"="y",.y1
|
||||
aif "&char"="Y",.y1
|
||||
ago .sub
|
||||
.x1
|
||||
txa
|
||||
ago .sub
|
||||
.y1
|
||||
tya
|
||||
.sub
|
||||
sbc &arg2
|
||||
&char amid &dest,1,1
|
||||
aif "&char"="@",.at2
|
||||
sta &dest
|
||||
ago .b
|
||||
.at2
|
||||
&char amid &dest,2,1
|
||||
aif "&char"="x",.x2
|
||||
aif "&char"="X",.x2
|
||||
aif "&char"="y",.y2
|
||||
aif "&char"="Y",.y2
|
||||
ago .b
|
||||
.x2
|
||||
tax
|
||||
ago .b
|
||||
.y2
|
||||
tay
|
||||
.b
|
||||
mend
|
||||
MACRO
|
||||
&lab dec2 &a
|
||||
&lab dec &a
|
||||
dec &a
|
||||
mend
|
||||
macro
|
||||
&lab ReadLine &a1,&a2
|
||||
&lab pha
|
||||
ph4 &a1(1)
|
||||
ph2 &a1(2)
|
||||
ph2 &a1(3)
|
||||
ph2 &a1(4)
|
||||
Tool $240c
|
||||
pl2 &a2
|
||||
mend
|
||||
MACRO
|
||||
&lab ph2 &parm
|
||||
lclc &char
|
||||
&lab anop
|
||||
aif c:&parm=0,.done
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="@",.at
|
||||
aif s:longa=1,.chk
|
||||
rep #%00100000
|
||||
.chk
|
||||
aif "&char"<>"{",.absolute
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
lda (&parm)
|
||||
pha
|
||||
ago .shorten
|
||||
.absolute
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.immediate
|
||||
&parm amid &parm,2,l:&parm-1
|
||||
pea &parm
|
||||
ago .done
|
||||
.at
|
||||
&char amid &parm,2,1
|
||||
ph&char
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing closing '}'",16
|
||||
mend
|
||||
MACRO
|
||||
&lab pl2 &parm
|
||||
lclc &char
|
||||
&lab anop
|
||||
aif s:longa=1,.start
|
||||
rep #%00100000
|
||||
.start
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="@",.at
|
||||
aif "&char"<>"{",.absolute
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
pla
|
||||
sta (&parm)
|
||||
ago .shorten
|
||||
.absolute
|
||||
pla
|
||||
sta &parm
|
||||
ago .shorten
|
||||
.at
|
||||
&char amid &parm,2,1
|
||||
pl&char
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing Closing '}'",16
|
||||
mend
|
571
bin/gsh/M/hash.mac
Normal file
571
bin/gsh/M/hash.mac
Normal file
|
@ -0,0 +1,571 @@
|
|||
MACRO
|
||||
&lab UDivide &a1,&a2
|
||||
&lab pha
|
||||
pha
|
||||
ph2 &a1(1)
|
||||
ph2 &a1(2)
|
||||
Tool $0b0b
|
||||
pl2 &a2(1)
|
||||
pl2 &a2(2)
|
||||
mend
|
||||
MACRO
|
||||
&lab subroutine &parms,&work
|
||||
&lab anop
|
||||
aif c:&work,.a
|
||||
lclc &work
|
||||
&work setc 0
|
||||
.a
|
||||
gbla &totallen
|
||||
gbla &worklen
|
||||
&worklen seta &work
|
||||
&totallen seta 0
|
||||
aif c:&parms=0,.e
|
||||
lclc &len
|
||||
lclc &p
|
||||
lcla &i
|
||||
&i seta c:&parms
|
||||
.b
|
||||
&p setc &parms(&i)
|
||||
&len amid &p,2,1
|
||||
aif "&len"=":",.c
|
||||
&len amid &p,1,2
|
||||
&p amid &p,4,l:&p-3
|
||||
ago .d
|
||||
.c
|
||||
&len amid &p,1,1
|
||||
&p amid &p,3,l:&p-2
|
||||
.d
|
||||
&p equ &totallen+3+&work
|
||||
&totallen seta &totallen+&len
|
||||
&i seta &i-1
|
||||
aif &i,^b
|
||||
.e
|
||||
tsc
|
||||
sec
|
||||
sbc #&work
|
||||
tcs
|
||||
inc a
|
||||
phd
|
||||
tcd
|
||||
phb
|
||||
phk
|
||||
plb
|
||||
mend
|
||||
MACRO
|
||||
&lab return &r
|
||||
&lab anop
|
||||
lclc &len
|
||||
aif c:&r,.a
|
||||
lclc &r
|
||||
&r setc 0
|
||||
&len setc 0
|
||||
ago .h
|
||||
.a
|
||||
&len amid &r,2,1
|
||||
aif "&len"=":",.b
|
||||
&len amid &r,1,2
|
||||
&r amid &r,4,l:&r-3
|
||||
ago .c
|
||||
.b
|
||||
&len amid &r,1,1
|
||||
&r amid &r,3,l:&r-2
|
||||
.c
|
||||
aif &len<>2,.d
|
||||
ldy &r
|
||||
ago .h
|
||||
.d
|
||||
aif &len<>4,.e
|
||||
ldx &r+2
|
||||
ldy &r
|
||||
ago .h
|
||||
.e
|
||||
aif &len<>10,.g
|
||||
ldy #&r
|
||||
ldx #^&r
|
||||
ago .h
|
||||
.g
|
||||
mnote 'Not a valid return length',16
|
||||
mexit
|
||||
.h
|
||||
aif &totallen=0,.i
|
||||
lda &worklen+1
|
||||
sta &worklen+&totallen+1
|
||||
lda &worklen
|
||||
sta &worklen+&totallen
|
||||
.i
|
||||
plb
|
||||
pld
|
||||
tsc
|
||||
clc
|
||||
adc #&worklen+&totallen
|
||||
tcs
|
||||
aif &len=0,.j
|
||||
tya
|
||||
.j
|
||||
rtl
|
||||
mend
|
||||
MACRO
|
||||
&lab tool &a1
|
||||
&lab ldx #&a1
|
||||
jsl $e10000
|
||||
mend
|
||||
MACRO
|
||||
&lab ph2 &parm
|
||||
lclc &char
|
||||
&lab anop
|
||||
aif c:&parm=0,.done
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="@",.at
|
||||
aif s:longa=1,.chk
|
||||
rep #%00100000
|
||||
.chk
|
||||
aif "&char"<>"{",.absolute
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
lda (&parm)
|
||||
pha
|
||||
ago .shorten
|
||||
.absolute
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.immediate
|
||||
&parm amid &parm,2,l:&parm-1
|
||||
pea &parm
|
||||
ago .done
|
||||
.at
|
||||
&char amid &parm,2,1
|
||||
ph&char
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing closing '}'",16
|
||||
mend
|
||||
MACRO
|
||||
&lab ph4 &parm
|
||||
lclc &char
|
||||
lclc &char1
|
||||
lclc &char2
|
||||
&lab anop
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="@",.at
|
||||
aif s:longa=1,.chk1
|
||||
rep #%00100000
|
||||
.chk1
|
||||
aif "&char"<>"{",.chk2
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
ldy #2
|
||||
lda (&parm),y
|
||||
pha
|
||||
lda (&parm)
|
||||
pha
|
||||
ago .shorten
|
||||
.chk2
|
||||
aif "&char"<>"[",.absolute
|
||||
ldy #2
|
||||
lda &parm,y
|
||||
pha
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.absolute
|
||||
lda &parm+2
|
||||
pha
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.at
|
||||
&char1 amid &parm,2,1
|
||||
&char2 setc &char1
|
||||
ph&char1
|
||||
aif l:&parm<3,.chk2a
|
||||
&char2 amid &parm,3,1
|
||||
.chk2a
|
||||
ph&char2
|
||||
ago .shorten
|
||||
.immediate
|
||||
&parm amid &parm,2,l:&parm-1
|
||||
pea +(&parm)|-16
|
||||
pea &parm
|
||||
ago .done
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing closing '}'",16
|
||||
mend
|
||||
MACRO
|
||||
&lab pl2 &parm
|
||||
lclc &char
|
||||
&lab anop
|
||||
aif s:longa=1,.start
|
||||
rep #%00100000
|
||||
.start
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="@",.at
|
||||
aif "&char"<>"{",.absolute
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
pla
|
||||
sta (&parm)
|
||||
ago .shorten
|
||||
.absolute
|
||||
pla
|
||||
sta &parm
|
||||
ago .shorten
|
||||
.at
|
||||
&char amid &parm,2,1
|
||||
pl&char
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing Closing '}'",16
|
||||
mend
|
||||
MACRO
|
||||
&lab asl2 &a
|
||||
&lab asl &a
|
||||
asl &a
|
||||
mend
|
||||
MACRO
|
||||
&lab asl3 &a
|
||||
&lab asl &a
|
||||
asl &a
|
||||
asl &a
|
||||
mend
|
||||
MACRO
|
||||
&lab asl4 &a
|
||||
&lab asl &a
|
||||
asl &a
|
||||
asl &a
|
||||
asl &a
|
||||
mend
|
||||
MACRO
|
||||
&lab iny2
|
||||
&lab iny
|
||||
iny
|
||||
mend
|
||||
MACRO
|
||||
&lab MV2 &src,&adr
|
||||
&lab lcla &count
|
||||
lda &src
|
||||
&count seta 1
|
||||
.loop
|
||||
sta &adr(&count)
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.done
|
||||
ago ^loop
|
||||
.done
|
||||
mend
|
||||
MACRO
|
||||
&lab MV4 &src,&adr
|
||||
&lab lcla &count
|
||||
lda &src
|
||||
&count seta 1
|
||||
.loop1
|
||||
sta &adr(&count)
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.part2
|
||||
ago ^loop1
|
||||
.part2
|
||||
lda &src+2
|
||||
&count seta 1
|
||||
.loop2
|
||||
sta &adr(&count)+2
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.done
|
||||
ago ^loop2
|
||||
.done
|
||||
mend
|
||||
MACRO
|
||||
&lab Open &a1
|
||||
&lab gsos $2010,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab Close &a1
|
||||
&lab gsos $2014,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab GetDirEntry &a1
|
||||
&lab gsos $201C,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab gsos &a1,&a2
|
||||
&lab jsl $E100A8
|
||||
dc i2'&a1'
|
||||
dc i4'&a2'
|
||||
mend
|
||||
MACRO
|
||||
&lab LD2 &val,&adr
|
||||
&lab lcla &count
|
||||
lda #&val
|
||||
&count seta 1
|
||||
.loop
|
||||
sta &adr(&count)
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.done
|
||||
ago ^loop
|
||||
.done
|
||||
mend
|
||||
MACRO
|
||||
&lab add2 &arg1,&arg2,&dest
|
||||
lclc &char
|
||||
&lab clc
|
||||
&char amid &arg1,1,1
|
||||
aif "&char"="@",.at1
|
||||
lda &arg1
|
||||
ago .add
|
||||
.at1
|
||||
&char amid &arg1,2,1
|
||||
aif "&char"="x",.x1
|
||||
aif "&char"="X",.x1
|
||||
aif "&char"="y",.y1
|
||||
aif "&char"="Y",.y1
|
||||
ago .add
|
||||
.x1
|
||||
txa
|
||||
ago .add
|
||||
.y1
|
||||
tya
|
||||
.add
|
||||
adc &arg2
|
||||
&char amid &dest,1,1
|
||||
aif "&char"="@",.at2
|
||||
sta &dest
|
||||
ago .b
|
||||
.at2
|
||||
&char amid &dest,2,1
|
||||
aif "&char"="x",.x2
|
||||
aif "&char"="X",.x2
|
||||
aif "&char"="y",.y2
|
||||
aif "&char"="Y",.y2
|
||||
ago .b
|
||||
.x2
|
||||
tax
|
||||
ago .b
|
||||
.y2
|
||||
tay
|
||||
.b
|
||||
mend
|
||||
MACRO
|
||||
&lab ora2 &arg1,&arg2,&dest
|
||||
&lab anop
|
||||
lclc &char
|
||||
&char amid &arg1,1,1
|
||||
aif "&char"="@",.at1
|
||||
lda &arg1
|
||||
ago .add
|
||||
.at1
|
||||
&char amid &arg1,2,1
|
||||
aif "&char"="x",.x1
|
||||
aif "&char"="X",.x1
|
||||
aif "&char"="y",.y1
|
||||
aif "&char"="Y",.y1
|
||||
ago .add
|
||||
.x1
|
||||
txa
|
||||
ago .add
|
||||
.y1
|
||||
tya
|
||||
.add
|
||||
ora &arg2
|
||||
&char amid &dest,1,1
|
||||
aif "&char"="@",.at2
|
||||
sta &dest
|
||||
ago .b
|
||||
.at2
|
||||
&char amid &dest,2,1
|
||||
aif "&char"="x",.x2
|
||||
aif "&char"="X",.x2
|
||||
aif "&char"="y",.y2
|
||||
aif "&char"="Y",.y2
|
||||
ago .b
|
||||
.x2
|
||||
tax
|
||||
ago .b
|
||||
.y2
|
||||
tay
|
||||
.b
|
||||
mend
|
||||
MACRO
|
||||
&lab if2 &var,&rel,&val,&label
|
||||
&lab ago .skip
|
||||
ble
|
||||
bgt
|
||||
.skip
|
||||
lclc &char1
|
||||
lclc &char2
|
||||
&char1 amid &var,1,1
|
||||
&char2 amid &var,2,1
|
||||
aif "&char1"="@",.index
|
||||
lda &var
|
||||
.cmp
|
||||
cmp &val
|
||||
ago .branch
|
||||
.index
|
||||
aif "&char2"="x",.x1
|
||||
aif "&char2"="X",.x1
|
||||
aif "&char2"="y",.y1
|
||||
aif "&char2"="Y",.y1
|
||||
ago ^cmp
|
||||
.x1
|
||||
cpx &val
|
||||
ago .branch
|
||||
.y1
|
||||
cpy &val
|
||||
.branch
|
||||
&char1 amid &rel,1,1
|
||||
aif "&char1"="@",.done
|
||||
b&rel &label
|
||||
.done
|
||||
mend
|
||||
MACRO
|
||||
&lab bgt &loc
|
||||
&lab beq *+4
|
||||
bcs &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab ble &loc
|
||||
&lab bcc &loc
|
||||
beq &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab jge &loc
|
||||
&lab bcc *+5
|
||||
jmp &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab Int2Dec &a1
|
||||
&lab ph2 &a1(1)
|
||||
ph4 &a1(2)
|
||||
ph2 &a1(3)
|
||||
ph2 &a1(4)
|
||||
Tool $260b
|
||||
mend
|
||||
MACRO
|
||||
&lab WriteCString &a1
|
||||
&lab ph4 &a1
|
||||
Tool $200c
|
||||
mend
|
||||
MACRO
|
||||
&lab long &stat
|
||||
&lab anop
|
||||
lcla &t
|
||||
lcla &len
|
||||
lclc &ch
|
||||
&t seta 0
|
||||
&len seta l:&stat
|
||||
.a
|
||||
aif &len=0,.b
|
||||
&ch amid &stat,&len,1
|
||||
aif ("&ch"="x").or.("&ch"="y").or.("&ch"="i"),.i
|
||||
aif ("&ch"="a").or.("&ch"="m"),.m
|
||||
.c
|
||||
&len seta &len-1
|
||||
ago ^a
|
||||
.i
|
||||
longi on
|
||||
&t seta &t+16
|
||||
ago ^c
|
||||
.m
|
||||
longa on
|
||||
&t seta &t+32
|
||||
ago ^c
|
||||
.b
|
||||
aif &t=0,.d
|
||||
rep #&t
|
||||
.d
|
||||
mend
|
||||
MACRO
|
||||
&lab short &stat
|
||||
&lab anop
|
||||
lcla &t
|
||||
lcla &len
|
||||
lclc &ch
|
||||
&t seta 0
|
||||
&len seta l:&stat
|
||||
.a
|
||||
aif &len=0,.b
|
||||
&ch amid &stat,&len,1
|
||||
aif ("&ch"="x").or.("&ch"="y").or.("&ch"="i"),.i
|
||||
aif ("&ch"="a").or.("&ch"="m"),.m
|
||||
.c
|
||||
&len seta &len-1
|
||||
ago ^a
|
||||
.i
|
||||
longi off
|
||||
&t seta &t+16
|
||||
ago ^c
|
||||
.m
|
||||
longa off
|
||||
&t seta &t+32
|
||||
ago ^c
|
||||
.b
|
||||
aif &t=0,.d
|
||||
sep #&t
|
||||
.d
|
||||
mend
|
||||
MACRO
|
||||
&lab lsr2 &a
|
||||
&lab lsr &a
|
||||
lsr &a
|
||||
mend
|
||||
MACRO
|
||||
&lab jeq &loc
|
||||
&lab bne *+5
|
||||
jmp &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab jne &loc
|
||||
&lab beq *+5
|
||||
jmp &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab iny4
|
||||
&lab iny
|
||||
iny
|
||||
iny
|
||||
iny
|
||||
mend
|
||||
macro
|
||||
&lab inc2 &a
|
||||
&lab inc &a
|
||||
inc &a
|
||||
mend
|
||||
macro
|
||||
&lab READ_VARIABLE &a1
|
||||
&lab p16 $10B,&a1
|
||||
mend
|
||||
macro
|
||||
&lab p16 &a1,&a2
|
||||
&lab jsl $E100A8
|
||||
dc i2'&a1'
|
||||
dc i4'&a2'
|
||||
mend
|
||||
macro
|
||||
&lab Str &string
|
||||
&lab dc i1'L:&string'
|
||||
dc c"&string"
|
||||
mend
|
||||
macro
|
||||
&lab ExpandPath &a1
|
||||
&lab gsos $200E,&a1
|
||||
mend
|
||||
macro
|
||||
&lab ErrWriteLine &a1
|
||||
&lab ph4 &a1
|
||||
Tool $1b0c
|
||||
mend
|
592
bin/gsh/M/history.mac
Normal file
592
bin/gsh/M/history.mac
Normal file
|
@ -0,0 +1,592 @@
|
|||
MACRO
|
||||
&lab long &stat
|
||||
&lab anop
|
||||
lcla &t
|
||||
lcla &len
|
||||
lclc &ch
|
||||
&t seta 0
|
||||
&len seta l:&stat
|
||||
.a
|
||||
aif &len=0,.b
|
||||
&ch amid &stat,&len,1
|
||||
aif ("&ch"="x").or.("&ch"="y").or.("&ch"="i"),.i
|
||||
aif ("&ch"="a").or.("&ch"="m"),.m
|
||||
.c
|
||||
&len seta &len-1
|
||||
ago ^a
|
||||
.i
|
||||
longi on
|
||||
&t seta &t+16
|
||||
ago ^c
|
||||
.m
|
||||
longa on
|
||||
&t seta &t+32
|
||||
ago ^c
|
||||
.b
|
||||
aif &t=0,.d
|
||||
rep #&t
|
||||
.d
|
||||
mend
|
||||
MACRO
|
||||
&lab short &stat
|
||||
&lab anop
|
||||
lcla &t
|
||||
lcla &len
|
||||
lclc &ch
|
||||
&t seta 0
|
||||
&len seta l:&stat
|
||||
.a
|
||||
aif &len=0,.b
|
||||
&ch amid &stat,&len,1
|
||||
aif ("&ch"="x").or.("&ch"="y").or.("&ch"="i"),.i
|
||||
aif ("&ch"="a").or.("&ch"="m"),.m
|
||||
.c
|
||||
&len seta &len-1
|
||||
ago ^a
|
||||
.i
|
||||
longi off
|
||||
&t seta &t+16
|
||||
ago ^c
|
||||
.m
|
||||
longa off
|
||||
&t seta &t+32
|
||||
ago ^c
|
||||
.b
|
||||
aif &t=0,.d
|
||||
sep #&t
|
||||
.d
|
||||
mend
|
||||
MACRO
|
||||
&lab if2 &var,&rel,&val,&label
|
||||
&lab ago .skip
|
||||
ble
|
||||
bgt
|
||||
.skip
|
||||
lclc &char1
|
||||
lclc &char2
|
||||
&char1 amid &var,1,1
|
||||
&char2 amid &var,2,1
|
||||
aif "&char1"="@",.index
|
||||
lda &var
|
||||
.cmp
|
||||
cmp &val
|
||||
ago .branch
|
||||
.index
|
||||
aif "&char2"="x",.x1
|
||||
aif "&char2"="X",.x1
|
||||
aif "&char2"="y",.y1
|
||||
aif "&char2"="Y",.y1
|
||||
ago ^cmp
|
||||
.x1
|
||||
cpx &val
|
||||
ago .branch
|
||||
.y1
|
||||
cpy &val
|
||||
.branch
|
||||
&char1 amid &rel,1,1
|
||||
aif "&char1"="@",.done
|
||||
b&rel &label
|
||||
.done
|
||||
mend
|
||||
MACRO
|
||||
&lab bgt &loc
|
||||
&lab beq *+4
|
||||
bcs &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab ble &loc
|
||||
&lab bcc &loc
|
||||
beq &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab add2 &arg1,&arg2,&dest
|
||||
lclc &char
|
||||
&lab clc
|
||||
&char amid &arg1,1,1
|
||||
aif "&char"="@",.at1
|
||||
lda &arg1
|
||||
ago .add
|
||||
.at1
|
||||
&char amid &arg1,2,1
|
||||
aif "&char"="x",.x1
|
||||
aif "&char"="X",.x1
|
||||
aif "&char"="y",.y1
|
||||
aif "&char"="Y",.y1
|
||||
ago .add
|
||||
.x1
|
||||
txa
|
||||
ago .add
|
||||
.y1
|
||||
tya
|
||||
.add
|
||||
adc &arg2
|
||||
&char amid &dest,1,1
|
||||
aif "&char"="@",.at2
|
||||
sta &dest
|
||||
ago .b
|
||||
.at2
|
||||
&char amid &dest,2,1
|
||||
aif "&char"="x",.x2
|
||||
aif "&char"="X",.x2
|
||||
aif "&char"="y",.y2
|
||||
aif "&char"="Y",.y2
|
||||
ago .b
|
||||
.x2
|
||||
tax
|
||||
ago .b
|
||||
.y2
|
||||
tay
|
||||
.b
|
||||
mend
|
||||
MACRO
|
||||
&lab MV4 &src,&adr
|
||||
&lab lcla &count
|
||||
lda &src
|
||||
&count seta 1
|
||||
.loop1
|
||||
sta &adr(&count)
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.part2
|
||||
ago ^loop1
|
||||
.part2
|
||||
lda &src+2
|
||||
&count seta 1
|
||||
.loop2
|
||||
sta &adr(&count)+2
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.done
|
||||
ago ^loop2
|
||||
.done
|
||||
mend
|
||||
MACRO
|
||||
&lab iny2
|
||||
&lab iny
|
||||
iny
|
||||
mend
|
||||
MACRO
|
||||
&lab ora2 &arg1,&arg2,&dest
|
||||
&lab anop
|
||||
lclc &char
|
||||
&char amid &arg1,1,1
|
||||
aif "&char"="@",.at1
|
||||
lda &arg1
|
||||
ago .add
|
||||
.at1
|
||||
&char amid &arg1,2,1
|
||||
aif "&char"="x",.x1
|
||||
aif "&char"="X",.x1
|
||||
aif "&char"="y",.y1
|
||||
aif "&char"="Y",.y1
|
||||
ago .add
|
||||
.x1
|
||||
txa
|
||||
ago .add
|
||||
.y1
|
||||
tya
|
||||
.add
|
||||
ora &arg2
|
||||
&char amid &dest,1,1
|
||||
aif "&char"="@",.at2
|
||||
sta &dest
|
||||
ago .b
|
||||
.at2
|
||||
&char amid &dest,2,1
|
||||
aif "&char"="x",.x2
|
||||
aif "&char"="X",.x2
|
||||
aif "&char"="y",.y2
|
||||
aif "&char"="Y",.y2
|
||||
ago .b
|
||||
.x2
|
||||
tax
|
||||
ago .b
|
||||
.y2
|
||||
tay
|
||||
.b
|
||||
mend
|
||||
MACRO
|
||||
&lab jeq &loc
|
||||
&lab bne *+5
|
||||
jmp &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab Dec2Int &a1,&a2
|
||||
&lab pha
|
||||
ph4 &a1(1)
|
||||
ph2 &a1(2)
|
||||
ph2 &a1(3)
|
||||
Tool $280b
|
||||
pl2 &a2
|
||||
mend
|
||||
MACRO
|
||||
&lab READ_VARIABLE &a1
|
||||
&lab p16 $10B,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab tool &a1
|
||||
&lab ldx #&a1
|
||||
jsl $e10000
|
||||
mend
|
||||
MACRO
|
||||
&lab p16 &a1,&a2
|
||||
&lab jsl $E100A8
|
||||
dc i2'&a1'
|
||||
dc i4'&a2'
|
||||
mend
|
||||
MACRO
|
||||
&lab ph2 &parm
|
||||
lclc &char
|
||||
&lab anop
|
||||
aif c:&parm=0,.done
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="@",.at
|
||||
aif s:longa=1,.chk
|
||||
rep #%00100000
|
||||
.chk
|
||||
aif "&char"<>"{",.absolute
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
lda (&parm)
|
||||
pha
|
||||
ago .shorten
|
||||
.absolute
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.immediate
|
||||
&parm amid &parm,2,l:&parm-1
|
||||
pea &parm
|
||||
ago .done
|
||||
.at
|
||||
&char amid &parm,2,1
|
||||
ph&char
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing closing '}'",16
|
||||
mend
|
||||
MACRO
|
||||
&lab ph4 &parm
|
||||
lclc &char
|
||||
lclc &char1
|
||||
lclc &char2
|
||||
&lab anop
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="@",.at
|
||||
aif s:longa=1,.chk1
|
||||
rep #%00100000
|
||||
.chk1
|
||||
aif "&char"<>"{",.chk2
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
ldy #2
|
||||
lda (&parm),y
|
||||
pha
|
||||
lda (&parm)
|
||||
pha
|
||||
ago .shorten
|
||||
.chk2
|
||||
aif "&char"<>"[",.absolute
|
||||
ldy #2
|
||||
lda &parm,y
|
||||
pha
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.absolute
|
||||
lda &parm+2
|
||||
pha
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.at
|
||||
&char1 amid &parm,2,1
|
||||
&char2 setc &char1
|
||||
ph&char1
|
||||
aif l:&parm<3,.chk2a
|
||||
&char2 amid &parm,3,1
|
||||
.chk2a
|
||||
ph&char2
|
||||
ago .shorten
|
||||
.immediate
|
||||
&parm amid &parm,2,l:&parm-1
|
||||
pea +(&parm)|-16
|
||||
pea &parm
|
||||
ago .done
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing closing '}'",16
|
||||
mend
|
||||
MACRO
|
||||
&lab pl2 &parm
|
||||
lclc &char
|
||||
&lab anop
|
||||
aif s:longa=1,.start
|
||||
rep #%00100000
|
||||
.start
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="@",.at
|
||||
aif "&char"<>"{",.absolute
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
pla
|
||||
sta (&parm)
|
||||
ago .shorten
|
||||
.absolute
|
||||
pla
|
||||
sta &parm
|
||||
ago .shorten
|
||||
.at
|
||||
&char amid &parm,2,1
|
||||
pl&char
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing Closing '}'",16
|
||||
mend
|
||||
MACRO
|
||||
&lab Str &string
|
||||
&lab dc i1'L:&string'
|
||||
dc c"&string"
|
||||
mend
|
||||
MACRO
|
||||
&lab Create &a1
|
||||
&lab gsos $2001,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab Open &a1
|
||||
&lab gsos $2010,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab Write &a1
|
||||
&lab gsos $2013,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab Close &a1
|
||||
&lab gsos $2014,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab gsos &a1,&a2
|
||||
&lab jsl $E100A8
|
||||
dc i2'&a1'
|
||||
dc i4'&a2'
|
||||
mend
|
||||
MACRO
|
||||
&lab GSStr &string
|
||||
&lab dc i2'L:&string'
|
||||
dc c"&string"
|
||||
mend
|
||||
MACRO
|
||||
&lab MV2 &src,&adr
|
||||
&lab lcla &count
|
||||
lda &src
|
||||
&count seta 1
|
||||
.loop
|
||||
sta &adr(&count)
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.done
|
||||
ago ^loop
|
||||
.done
|
||||
mend
|
||||
MACRO
|
||||
&lab add4 &arg1,&arg2,&dest
|
||||
&lab anop
|
||||
lclc &ch
|
||||
&ch amid &arg2,1,1
|
||||
clc
|
||||
lda &arg1
|
||||
adc &arg2
|
||||
sta &dest
|
||||
lda &arg1+2
|
||||
aif "&ch"="#",.a
|
||||
adc &arg2+2
|
||||
ago .b
|
||||
.a
|
||||
adc &arg2|-16
|
||||
.b
|
||||
sta &dest+2
|
||||
mend
|
||||
MACRO
|
||||
&lab Destroy &a1
|
||||
&lab gsos $2002,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab NewLine &a1
|
||||
&lab gsos $2011,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab Read &a1
|
||||
&lab gsos $2012,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab jcs &loc
|
||||
&lab bcc *+5
|
||||
jmp &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab Int2Dec &a1
|
||||
&lab ph2 &a1(1)
|
||||
ph4 &a1(2)
|
||||
ph2 &a1(3)
|
||||
ph2 &a1(4)
|
||||
Tool $260b
|
||||
mend
|
||||
MACRO
|
||||
&lab sub2 &arg1,&arg2,&dest
|
||||
lclc &char
|
||||
&lab sec
|
||||
&char amid &arg1,1,1
|
||||
aif "&char"="@",.at1
|
||||
lda &arg1
|
||||
ago .sub
|
||||
.at1
|
||||
&char amid &arg1,2,1
|
||||
aif "&char"="x",.x1
|
||||
aif "&char"="X",.x1
|
||||
aif "&char"="y",.y1
|
||||
aif "&char"="Y",.y1
|
||||
ago .sub
|
||||
.x1
|
||||
txa
|
||||
ago .sub
|
||||
.y1
|
||||
tya
|
||||
.sub
|
||||
sbc &arg2
|
||||
&char amid &dest,1,1
|
||||
aif "&char"="@",.at2
|
||||
sta &dest
|
||||
ago .b
|
||||
.at2
|
||||
&char amid &dest,2,1
|
||||
aif "&char"="x",.x2
|
||||
aif "&char"="X",.x2
|
||||
aif "&char"="y",.y2
|
||||
aif "&char"="Y",.y2
|
||||
ago .b
|
||||
.x2
|
||||
tax
|
||||
ago .b
|
||||
.y2
|
||||
tay
|
||||
.b
|
||||
mend
|
||||
MACRO
|
||||
&lab subroutine &parms,&work
|
||||
&lab anop
|
||||
aif c:&work,.a
|
||||
lclc &work
|
||||
&work setc 0
|
||||
.a
|
||||
gbla &totallen
|
||||
gbla &worklen
|
||||
&worklen seta &work
|
||||
&totallen seta 0
|
||||
aif c:&parms=0,.e
|
||||
lclc &len
|
||||
lclc &p
|
||||
lcla &i
|
||||
&i seta c:&parms
|
||||
.b
|
||||
&p setc &parms(&i)
|
||||
&len amid &p,2,1
|
||||
aif "&len"=":",.c
|
||||
&len amid &p,1,2
|
||||
&p amid &p,4,l:&p-3
|
||||
ago .d
|
||||
.c
|
||||
&len amid &p,1,1
|
||||
&p amid &p,3,l:&p-2
|
||||
.d
|
||||
&p equ &totallen+3+&work
|
||||
&totallen seta &totallen+&len
|
||||
&i seta &i-1
|
||||
aif &i,^b
|
||||
.e
|
||||
tsc
|
||||
sec
|
||||
sbc #&work
|
||||
tcs
|
||||
inc a
|
||||
phd
|
||||
tcd
|
||||
phb
|
||||
phk
|
||||
plb
|
||||
mend
|
||||
MACRO
|
||||
&lab return &r
|
||||
&lab anop
|
||||
lclc &len
|
||||
aif c:&r,.a
|
||||
lclc &r
|
||||
&r setc 0
|
||||
&len setc 0
|
||||
ago .h
|
||||
.a
|
||||
&len amid &r,2,1
|
||||
aif "&len"=":",.b
|
||||
&len amid &r,1,2
|
||||
&r amid &r,4,l:&r-3
|
||||
ago .c
|
||||
.b
|
||||
&len amid &r,1,1
|
||||
&r amid &r,3,l:&r-2
|
||||
.c
|
||||
aif &len<>2,.d
|
||||
ldy &r
|
||||
ago .h
|
||||
.d
|
||||
aif &len<>4,.e
|
||||
ldx &r+2
|
||||
ldy &r
|
||||
ago .h
|
||||
.e
|
||||
aif &len<>10,.g
|
||||
ldy #&r
|
||||
ldx #^&r
|
||||
ago .h
|
||||
.g
|
||||
mnote 'Not a valid return length',16
|
||||
mexit
|
||||
.h
|
||||
aif &totallen=0,.i
|
||||
lda &worklen+1
|
||||
sta &worklen+&totallen+1
|
||||
lda &worklen
|
||||
sta &worklen+&totallen
|
||||
.i
|
||||
plb
|
||||
pld
|
||||
tsc
|
||||
clc
|
||||
adc #&worklen+&totallen
|
||||
tcs
|
||||
aif &len=0,.j
|
||||
tya
|
||||
.j
|
||||
rtl
|
||||
mend
|
||||
MACRO
|
||||
&lab tputs &a1
|
||||
&lab ph4 &a1(3)
|
||||
ph2 &a1(2)
|
||||
ph4 &a1(1)
|
||||
case on
|
||||
jsl tputs
|
||||
case off
|
||||
MEND
|
588
bin/gsh/M/invoke.mac
Normal file
588
bin/gsh/M/invoke.mac
Normal file
|
@ -0,0 +1,588 @@
|
|||
MACRO
|
||||
&lab if2 &var,&rel,&val,&label
|
||||
&lab ago .skip
|
||||
ble
|
||||
bgt
|
||||
.skip
|
||||
lclc &char1
|
||||
lclc &char2
|
||||
&char1 amid &var,1,1
|
||||
&char2 amid &var,2,1
|
||||
aif "&char1"="@",.index
|
||||
lda &var
|
||||
.cmp
|
||||
cmp &val
|
||||
ago .branch
|
||||
.index
|
||||
aif "&char2"="x",.x1
|
||||
aif "&char2"="X",.x1
|
||||
aif "&char2"="y",.y1
|
||||
aif "&char2"="Y",.y1
|
||||
ago ^cmp
|
||||
.x1
|
||||
cpx &val
|
||||
ago .branch
|
||||
.y1
|
||||
cpy &val
|
||||
.branch
|
||||
&char1 amid &rel,1,1
|
||||
aif "&char1"="@",.done
|
||||
b&rel &label
|
||||
.done
|
||||
mend
|
||||
MACRO
|
||||
&lab bgt &loc
|
||||
&lab beq *+4
|
||||
bcs &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab ble &loc
|
||||
&lab bcc &loc
|
||||
beq &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab SetInGlobals &a1
|
||||
&lab ph2 &a1(1)
|
||||
ph2 &a1(2)
|
||||
Tool $090c
|
||||
mend
|
||||
MACRO
|
||||
&lab jeq &loc
|
||||
&lab bne *+5
|
||||
jmp &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab tool &a1
|
||||
&lab ldx #&a1
|
||||
jsl $e10000
|
||||
mend
|
||||
MACRO
|
||||
&lab ph2 &parm
|
||||
lclc &char
|
||||
&lab anop
|
||||
aif c:&parm=0,.done
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="@",.at
|
||||
aif s:longa=1,.chk
|
||||
rep #%00100000
|
||||
.chk
|
||||
aif "&char"<>"{",.absolute
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
lda (&parm)
|
||||
pha
|
||||
ago .shorten
|
||||
.absolute
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.immediate
|
||||
&parm amid &parm,2,l:&parm-1
|
||||
pea &parm
|
||||
ago .done
|
||||
.at
|
||||
&char amid &parm,2,1
|
||||
ph&char
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing closing '}'",16
|
||||
mend
|
||||
MACRO
|
||||
&lab ph4 &parm
|
||||
lclc &char
|
||||
lclc &char1
|
||||
lclc &char2
|
||||
&lab anop
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="@",.at
|
||||
aif s:longa=1,.chk1
|
||||
rep #%00100000
|
||||
.chk1
|
||||
aif "&char"<>"{",.chk2
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
ldy #2
|
||||
lda (&parm),y
|
||||
pha
|
||||
lda (&parm)
|
||||
pha
|
||||
ago .shorten
|
||||
.chk2
|
||||
aif "&char"<>"[",.absolute
|
||||
ldy #2
|
||||
lda &parm,y
|
||||
pha
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.absolute
|
||||
lda &parm+2
|
||||
pha
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.at
|
||||
&char1 amid &parm,2,1
|
||||
&char2 setc &char1
|
||||
ph&char1
|
||||
aif l:&parm<3,.chk2a
|
||||
&char2 amid &parm,3,1
|
||||
.chk2a
|
||||
ph&char2
|
||||
ago .shorten
|
||||
.immediate
|
||||
&parm amid &parm,2,l:&parm-1
|
||||
pea +(&parm)|-16
|
||||
pea &parm
|
||||
ago .done
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing closing '}'",16
|
||||
mend
|
||||
MACRO
|
||||
&lab GSStr &string
|
||||
&lab dc i2'L:&string'
|
||||
dc c"&string"
|
||||
mend
|
||||
MACRO
|
||||
&lab MV2 &src,&adr
|
||||
&lab lcla &count
|
||||
lda &src
|
||||
&count seta 1
|
||||
.loop
|
||||
sta &adr(&count)
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.done
|
||||
ago ^loop
|
||||
.done
|
||||
mend
|
||||
MACRO
|
||||
&lab Open &a1
|
||||
&lab gsos $2010,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab Close &a1
|
||||
&lab gsos $2014,&a1
|
||||
mend
|
||||
macro
|
||||
&lab MV4 &src,&adr
|
||||
&lab lcla &count
|
||||
lda &src
|
||||
&count seta 1
|
||||
.loop1
|
||||
sta &adr(&count)
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.part2
|
||||
ago ^loop1
|
||||
.part2
|
||||
lda &src+2
|
||||
&count seta 1
|
||||
.loop2
|
||||
sta &adr(&count)+2
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.done
|
||||
ago ^loop2
|
||||
.done
|
||||
mend
|
||||
macro
|
||||
&lab jcs &loc
|
||||
&lab bcc *+5
|
||||
jmp &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab LD2 &val,&adr
|
||||
&lab lcla &count
|
||||
lda #&val
|
||||
&count seta 1
|
||||
.loop
|
||||
sta &adr(&count)
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.done
|
||||
ago ^loop
|
||||
.done
|
||||
mend
|
||||
MACRO
|
||||
&lab tcnewpgrp &a1
|
||||
&lab ph2 &a1
|
||||
case on
|
||||
jsl tcnewpgrp
|
||||
case off
|
||||
MEND
|
||||
MACRO
|
||||
&lab settpgrp &a1
|
||||
&lab ph2 &a1
|
||||
case on
|
||||
jsl settpgrp
|
||||
case off
|
||||
MEND
|
||||
MACRO
|
||||
&lab ora2 &arg1,&arg2,&dest
|
||||
&lab anop
|
||||
lclc &char
|
||||
&char amid &arg1,1,1
|
||||
aif "&char"="@",.at1
|
||||
lda &arg1
|
||||
ago .add
|
||||
.at1
|
||||
&char amid &arg1,2,1
|
||||
aif "&char"="x",.x1
|
||||
aif "&char"="X",.x1
|
||||
aif "&char"="y",.y1
|
||||
aif "&char"="Y",.y1
|
||||
ago .add
|
||||
.x1
|
||||
txa
|
||||
ago .add
|
||||
.y1
|
||||
tya
|
||||
.add
|
||||
ora &arg2
|
||||
&char amid &dest,1,1
|
||||
aif "&char"="@",.at2
|
||||
sta &dest
|
||||
ago .b
|
||||
.at2
|
||||
&char amid &dest,2,1
|
||||
aif "&char"="x",.x2
|
||||
aif "&char"="X",.x2
|
||||
aif "&char"="y",.y2
|
||||
aif "&char"="Y",.y2
|
||||
ago .b
|
||||
.x2
|
||||
tax
|
||||
ago .b
|
||||
.y2
|
||||
tay
|
||||
.b
|
||||
mend
|
||||
MACRO
|
||||
&lab subroutine &parms,&work
|
||||
&lab anop
|
||||
aif c:&work,.a
|
||||
lclc &work
|
||||
&work setc 0
|
||||
.a
|
||||
gbla &totallen
|
||||
gbla &worklen
|
||||
&worklen seta &work
|
||||
&totallen seta 0
|
||||
aif c:&parms=0,.e
|
||||
lclc &len
|
||||
lclc &p
|
||||
lcla &i
|
||||
&i seta c:&parms
|
||||
.b
|
||||
&p setc &parms(&i)
|
||||
&len amid &p,2,1
|
||||
aif "&len"=":",.c
|
||||
&len amid &p,1,2
|
||||
&p amid &p,4,l:&p-3
|
||||
ago .d
|
||||
.c
|
||||
&len amid &p,1,1
|
||||
&p amid &p,3,l:&p-2
|
||||
.d
|
||||
&p equ &totallen+3+&work
|
||||
&totallen seta &totallen+&len
|
||||
&i seta &i-1
|
||||
aif &i,^b
|
||||
.e
|
||||
tsc
|
||||
sec
|
||||
sbc #&work
|
||||
tcs
|
||||
inc a
|
||||
phd
|
||||
tcd
|
||||
phb
|
||||
phk
|
||||
plb
|
||||
mend
|
||||
MACRO
|
||||
&lab return &r
|
||||
&lab anop
|
||||
lclc &len
|
||||
aif c:&r,.a
|
||||
lclc &r
|
||||
&r setc 0
|
||||
&len setc 0
|
||||
ago .h
|
||||
.a
|
||||
&len amid &r,2,1
|
||||
aif "&len"=":",.b
|
||||
&len amid &r,1,2
|
||||
&r amid &r,4,l:&r-3
|
||||
ago .c
|
||||
.b
|
||||
&len amid &r,1,1
|
||||
&r amid &r,3,l:&r-2
|
||||
.c
|
||||
aif &len<>2,.d
|
||||
ldy &r
|
||||
ago .h
|
||||
.d
|
||||
aif &len<>4,.e
|
||||
ldx &r+2
|
||||
ldy &r
|
||||
ago .h
|
||||
.e
|
||||
aif &len<>10,.g
|
||||
ldy #&r
|
||||
ldx #^&r
|
||||
ago .h
|
||||
.g
|
||||
mnote 'Not a valid return length',16
|
||||
mexit
|
||||
.h
|
||||
aif &totallen=0,.i
|
||||
lda &worklen+1
|
||||
sta &worklen+&totallen+1
|
||||
lda &worklen
|
||||
sta &worklen+&totallen
|
||||
.i
|
||||
plb
|
||||
pld
|
||||
tsc
|
||||
clc
|
||||
adc #&worklen+&totallen
|
||||
tcs
|
||||
aif &len=0,.j
|
||||
tya
|
||||
.j
|
||||
rtl
|
||||
mend
|
||||
MACRO
|
||||
&lab jne &loc
|
||||
&lab beq *+5
|
||||
jmp &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab gsos &a1,&a2
|
||||
&lab jsl $E100A8
|
||||
dc i2'&a1'
|
||||
dc i4'&a2'
|
||||
mend
|
||||
MACRO
|
||||
&lab PopVariables &a1
|
||||
&lab p16 $117,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab PushVariables &a1
|
||||
&lab p16 $118,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab p16 &a1,&a2
|
||||
&lab jsl $E100A8
|
||||
dc i2'&a1'
|
||||
dc i4'&a2'
|
||||
mend
|
||||
MACRO
|
||||
&lab SetPrefix &a1
|
||||
&lab gsos $2009,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab GetFileInfo &a1
|
||||
&lab gsos $2006,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab unlock &a1
|
||||
&lab stz &a1
|
||||
MEND
|
||||
MACRO
|
||||
&lab key
|
||||
&lab dc i2'0'
|
||||
MEND
|
||||
MACRO
|
||||
&lab lock &a1
|
||||
&lab lda #1
|
||||
tsb &a1
|
||||
beq *+6
|
||||
cop $7F
|
||||
bra *-7
|
||||
MEND
|
||||
macro
|
||||
&lab REDIRECT &a1
|
||||
&lab p16 $110,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab fork &a1
|
||||
&lab ph4 &a1
|
||||
case on
|
||||
jsl fork
|
||||
case off
|
||||
MEND
|
||||
macro
|
||||
&lab SetInputDevice &a1
|
||||
&lab ph2 &a1(1)
|
||||
ph4 &a1(2)
|
||||
Tool $0f0c
|
||||
mend
|
||||
macro
|
||||
&lab SetOutputDevice &a1
|
||||
&lab ph2 &a1(1)
|
||||
ph4 &a1(2)
|
||||
Tool $100c
|
||||
mend
|
||||
MACRO
|
||||
&lab tctpgrp &a1
|
||||
&lab ph2 &a1(2)
|
||||
ph2 &a1(1)
|
||||
case on
|
||||
jsl tctpgrp
|
||||
case off
|
||||
MEND
|
||||
MACRO
|
||||
&lab dup2 &a1
|
||||
&lab ph2 &a1(2)
|
||||
ph2 &a1(1)
|
||||
case on
|
||||
jsl dup2
|
||||
case off
|
||||
MEND
|
||||
MACRO
|
||||
&lab swait &a1
|
||||
&lab ph2 &a1
|
||||
case on
|
||||
jsl swait
|
||||
case off
|
||||
MEND
|
||||
MACRO
|
||||
&lab ssignal &a1
|
||||
&lab ph2 &a1
|
||||
case on
|
||||
jsl ssignal
|
||||
case off
|
||||
MEND
|
||||
MACRO
|
||||
&lab screate &a1
|
||||
&lab ph2 &a1
|
||||
case on
|
||||
jsl screate
|
||||
case off
|
||||
MEND
|
||||
MACRO
|
||||
&lab sdelete &a1
|
||||
&lab ph2 &a1
|
||||
case on
|
||||
jsl sdelete
|
||||
case off
|
||||
MEND
|
||||
macro
|
||||
&lab NewHandle &a1,&a2
|
||||
&lab pha
|
||||
pha
|
||||
ph4 &a1(1)
|
||||
ph2 &a1(2)
|
||||
ph2 &a1(3)
|
||||
ph4 &a1(4)
|
||||
tool $0902
|
||||
pl4 &a2
|
||||
mend
|
||||
macro
|
||||
&lab FindHandle &a1,&a2
|
||||
&lab pha
|
||||
pha
|
||||
ph4 &a1
|
||||
tool $1a02
|
||||
pl4 &a2
|
||||
mend
|
||||
macro
|
||||
&lab PtrToHand &a1
|
||||
&lab ph4 &a1(1)
|
||||
ph4 &a1(2)
|
||||
ph4 &a1(3)
|
||||
tool $2802
|
||||
mend
|
||||
macro
|
||||
&lab pl4 &parm
|
||||
lclc &char
|
||||
lclc &char1
|
||||
lclc &char2
|
||||
&lab anop
|
||||
aif s:longa=1,.start
|
||||
rep #%00100000
|
||||
.start
|
||||
&char amid &parm,1,1
|
||||
aif "&char"<>"{",.chk
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
pla
|
||||
sta (&parm)
|
||||
ldy #2
|
||||
pla
|
||||
sta (&parm),y
|
||||
ago .shorten
|
||||
.chk
|
||||
aif "&char"<>"[",.chk2
|
||||
pla
|
||||
sta &parm
|
||||
ldy #2
|
||||
pla
|
||||
sta &parm,y
|
||||
ago .shorten
|
||||
.chk2
|
||||
aif "&char"<>"@",.absolute
|
||||
&char1 amid &parm,2,1
|
||||
&char2 setc &char1
|
||||
pl&char1
|
||||
aif l:&parm<3,.chk2a
|
||||
&char2 amid &parm,3,1
|
||||
.chk2a
|
||||
pl&char2
|
||||
ago .shorten
|
||||
.absolute
|
||||
pla
|
||||
sta &parm
|
||||
pla
|
||||
sta &parm+2
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing closing '}'",16
|
||||
mend
|
||||
MACRO
|
||||
&lab kill &a1
|
||||
&lab ph2 &a1(2)
|
||||
ph2 &a1(1)
|
||||
case on
|
||||
jsl kill
|
||||
case off
|
||||
MEND
|
||||
MACRO
|
||||
&lab getpgrp &a1
|
||||
&lab ph2 &a1
|
||||
case on
|
||||
jsl getpgrp
|
||||
case off
|
||||
MEND
|
||||
MACRO
|
||||
&lab sigpause &a1
|
||||
&lab ph4 &a1
|
||||
case on
|
||||
jsl sigpause
|
||||
case off
|
||||
MEND
|
||||
MACRO
|
||||
&lab signal &a1
|
||||
&lab ph4 &a1(2)
|
||||
ph2 &a1(1)
|
||||
case on
|
||||
jsl signal
|
||||
case off
|
||||
MEND
|
527
bin/gsh/M/jobs.mac
Normal file
527
bin/gsh/M/jobs.mac
Normal file
|
@ -0,0 +1,527 @@
|
|||
MACRO
|
||||
&lab if2 &var,&rel,&val,&label
|
||||
&lab ago .skip
|
||||
ble
|
||||
bgt
|
||||
.skip
|
||||
lclc &char1
|
||||
lclc &char2
|
||||
&char1 amid &var,1,1
|
||||
&char2 amid &var,2,1
|
||||
aif "&char1"="@",.index
|
||||
lda &var
|
||||
.cmp
|
||||
cmp &val
|
||||
ago .branch
|
||||
.index
|
||||
aif "&char2"="x",.x1
|
||||
aif "&char2"="X",.x1
|
||||
aif "&char2"="y",.y1
|
||||
aif "&char2"="Y",.y1
|
||||
ago ^cmp
|
||||
.x1
|
||||
cpx &val
|
||||
ago .branch
|
||||
.y1
|
||||
cpy &val
|
||||
.branch
|
||||
&char1 amid &rel,1,1
|
||||
aif "&char1"="@",.done
|
||||
b&rel &label
|
||||
.done
|
||||
mend
|
||||
MACRO
|
||||
&lab bgt &loc
|
||||
&lab beq *+4
|
||||
bcs &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab ble &loc
|
||||
&lab bcc &loc
|
||||
beq &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab jeq &loc
|
||||
&lab bne *+5
|
||||
jmp &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab ph4 &parm
|
||||
lclc &char
|
||||
lclc &char1
|
||||
lclc &char2
|
||||
&lab anop
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="@",.at
|
||||
aif s:longa=1,.chk1
|
||||
rep #%00100000
|
||||
.chk1
|
||||
aif "&char"<>"{",.chk2
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
ldy #2
|
||||
lda (&parm),y
|
||||
pha
|
||||
lda (&parm)
|
||||
pha
|
||||
ago .shorten
|
||||
.chk2
|
||||
aif "&char"<>"[",.absolute
|
||||
ldy #2
|
||||
lda &parm,y
|
||||
pha
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.absolute
|
||||
lda &parm+2
|
||||
pha
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.at
|
||||
&char1 amid &parm,2,1
|
||||
&char2 setc &char1
|
||||
ph&char1
|
||||
aif l:&parm<3,.chk2a
|
||||
&char2 amid &parm,3,1
|
||||
.chk2a
|
||||
ph&char2
|
||||
ago .shorten
|
||||
.immediate
|
||||
&parm amid &parm,2,l:&parm-1
|
||||
pea +(&parm)|-16
|
||||
pea &parm
|
||||
ago .done
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing closing '}'",16
|
||||
mend
|
||||
MACRO
|
||||
&lab MV2 &src,&adr
|
||||
&lab lcla &count
|
||||
lda &src
|
||||
&count seta 1
|
||||
.loop
|
||||
sta &adr(&count)
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.done
|
||||
ago ^loop
|
||||
.done
|
||||
mend
|
||||
macro
|
||||
&lab MV4 &src,&adr
|
||||
&lab lcla &count
|
||||
lda &src
|
||||
&count seta 1
|
||||
.loop1
|
||||
sta &adr(&count)
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.part2
|
||||
ago ^loop1
|
||||
.part2
|
||||
lda &src+2
|
||||
&count seta 1
|
||||
.loop2
|
||||
sta &adr(&count)+2
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.done
|
||||
ago ^loop2
|
||||
.done
|
||||
mend
|
||||
MACRO
|
||||
&lab LD2 &val,&adr
|
||||
&lab lcla &count
|
||||
lda #&val
|
||||
&count seta 1
|
||||
.loop
|
||||
sta &adr(&count)
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.done
|
||||
ago ^loop
|
||||
.done
|
||||
mend
|
||||
MACRO
|
||||
&lab getpid
|
||||
&lab case on
|
||||
jsl getpid
|
||||
case off
|
||||
MEND
|
||||
MACRO
|
||||
&lab ora2 &arg1,&arg2,&dest
|
||||
&lab anop
|
||||
lclc &char
|
||||
&char amid &arg1,1,1
|
||||
aif "&char"="@",.at1
|
||||
lda &arg1
|
||||
ago .add
|
||||
.at1
|
||||
&char amid &arg1,2,1
|
||||
aif "&char"="x",.x1
|
||||
aif "&char"="X",.x1
|
||||
aif "&char"="y",.y1
|
||||
aif "&char"="Y",.y1
|
||||
ago .add
|
||||
.x1
|
||||
txa
|
||||
ago .add
|
||||
.y1
|
||||
tya
|
||||
.add
|
||||
ora &arg2
|
||||
&char amid &dest,1,1
|
||||
aif "&char"="@",.at2
|
||||
sta &dest
|
||||
ago .b
|
||||
.at2
|
||||
&char amid &dest,2,1
|
||||
aif "&char"="x",.x2
|
||||
aif "&char"="X",.x2
|
||||
aif "&char"="y",.y2
|
||||
aif "&char"="Y",.y2
|
||||
ago .b
|
||||
.x2
|
||||
tax
|
||||
ago .b
|
||||
.y2
|
||||
tay
|
||||
.b
|
||||
mend
|
||||
MACRO
|
||||
&lab subroutine &parms,&work
|
||||
&lab anop
|
||||
aif c:&work,.a
|
||||
lclc &work
|
||||
&work setc 0
|
||||
.a
|
||||
gbla &totallen
|
||||
gbla &worklen
|
||||
&worklen seta &work
|
||||
&totallen seta 0
|
||||
aif c:&parms=0,.e
|
||||
lclc &len
|
||||
lclc &p
|
||||
lcla &i
|
||||
&i seta c:&parms
|
||||
.b
|
||||
&p setc &parms(&i)
|
||||
&len amid &p,2,1
|
||||
aif "&len"=":",.c
|
||||
&len amid &p,1,2
|
||||
&p amid &p,4,l:&p-3
|
||||
ago .d
|
||||
.c
|
||||
&len amid &p,1,1
|
||||
&p amid &p,3,l:&p-2
|
||||
.d
|
||||
&p equ &totallen+3+&work
|
||||
&totallen seta &totallen+&len
|
||||
&i seta &i-1
|
||||
aif &i,^b
|
||||
.e
|
||||
tsc
|
||||
sec
|
||||
sbc #&work
|
||||
tcs
|
||||
inc a
|
||||
phd
|
||||
tcd
|
||||
phb
|
||||
phk
|
||||
plb
|
||||
mend
|
||||
MACRO
|
||||
&lab return &r
|
||||
&lab anop
|
||||
lclc &len
|
||||
aif c:&r,.a
|
||||
lclc &r
|
||||
&r setc 0
|
||||
&len setc 0
|
||||
ago .h
|
||||
.a
|
||||
&len amid &r,2,1
|
||||
aif "&len"=":",.b
|
||||
&len amid &r,1,2
|
||||
&r amid &r,4,l:&r-3
|
||||
ago .c
|
||||
.b
|
||||
&len amid &r,1,1
|
||||
&r amid &r,3,l:&r-2
|
||||
.c
|
||||
aif &len<>2,.d
|
||||
ldy &r
|
||||
ago .h
|
||||
.d
|
||||
aif &len<>4,.e
|
||||
ldx &r+2
|
||||
ldy &r
|
||||
ago .h
|
||||
.e
|
||||
aif &len<>10,.g
|
||||
ldy #&r
|
||||
ldx #^&r
|
||||
ago .h
|
||||
.g
|
||||
mnote 'Not a valid return length',16
|
||||
mexit
|
||||
.h
|
||||
aif &totallen=0,.i
|
||||
lda &worklen+1
|
||||
sta &worklen+&totallen+1
|
||||
lda &worklen
|
||||
sta &worklen+&totallen
|
||||
.i
|
||||
plb
|
||||
pld
|
||||
tsc
|
||||
clc
|
||||
adc #&worklen+&totallen
|
||||
tcs
|
||||
aif &len=0,.j
|
||||
tya
|
||||
.j
|
||||
rtl
|
||||
mend
|
||||
MACRO
|
||||
&lab Str &string
|
||||
&lab dc i1'L:&string'
|
||||
dc c"&string"
|
||||
mend
|
||||
MACRO
|
||||
&lab add2 &arg1,&arg2,&dest
|
||||
lclc &char
|
||||
&lab clc
|
||||
&char amid &arg1,1,1
|
||||
aif "&char"="@",.at1
|
||||
lda &arg1
|
||||
ago .add
|
||||
.at1
|
||||
&char amid &arg1,2,1
|
||||
aif "&char"="x",.x1
|
||||
aif "&char"="X",.x1
|
||||
aif "&char"="y",.y1
|
||||
aif "&char"="Y",.y1
|
||||
ago .add
|
||||
.x1
|
||||
txa
|
||||
ago .add
|
||||
.y1
|
||||
tya
|
||||
.add
|
||||
adc &arg2
|
||||
&char amid &dest,1,1
|
||||
aif "&char"="@",.at2
|
||||
sta &dest
|
||||
ago .b
|
||||
.at2
|
||||
&char amid &dest,2,1
|
||||
aif "&char"="x",.x2
|
||||
aif "&char"="X",.x2
|
||||
aif "&char"="y",.y2
|
||||
aif "&char"="Y",.y2
|
||||
ago .b
|
||||
.x2
|
||||
tax
|
||||
ago .b
|
||||
.y2
|
||||
tay
|
||||
.b
|
||||
mend
|
||||
MACRO
|
||||
&lab Dec2Int &a1,&a2
|
||||
&lab pha
|
||||
ph4 &a1(1)
|
||||
ph2 &a1(2)
|
||||
ph2 &a1(3)
|
||||
Tool $280b
|
||||
pl2 &a2
|
||||
mend
|
||||
MACRO
|
||||
&lab ph2 &parm
|
||||
lclc &char
|
||||
&lab anop
|
||||
aif c:&parm=0,.done
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="@",.at
|
||||
aif s:longa=1,.chk
|
||||
rep #%00100000
|
||||
.chk
|
||||
aif "&char"<>"{",.absolute
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
lda (&parm)
|
||||
pha
|
||||
ago .shorten
|
||||
.absolute
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.immediate
|
||||
&parm amid &parm,2,l:&parm-1
|
||||
pea &parm
|
||||
ago .done
|
||||
.at
|
||||
&char amid &parm,2,1
|
||||
ph&char
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing closing '}'",16
|
||||
mend
|
||||
MACRO
|
||||
&lab pl2 &parm
|
||||
lclc &char
|
||||
&lab anop
|
||||
aif s:longa=1,.start
|
||||
rep #%00100000
|
||||
.start
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="@",.at
|
||||
aif "&char"<>"{",.absolute
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
pla
|
||||
sta (&parm)
|
||||
ago .shorten
|
||||
.absolute
|
||||
pla
|
||||
sta &parm
|
||||
ago .shorten
|
||||
.at
|
||||
&char amid &parm,2,1
|
||||
pl&char
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing Closing '}'",16
|
||||
mend
|
||||
MACRO
|
||||
&lab Int2Dec &a1
|
||||
&lab ph2 &a1(1)
|
||||
ph4 &a1(2)
|
||||
ph2 &a1(3)
|
||||
ph2 &a1(4)
|
||||
Tool $260b
|
||||
mend
|
||||
MACRO
|
||||
&lab LD4 &val,&adr
|
||||
&lab lcla &count
|
||||
lda #<&val
|
||||
&count seta 1
|
||||
.loop1
|
||||
sta &adr(&count)
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.part2
|
||||
ago ^loop1
|
||||
.part2
|
||||
lda #+(&val)|-16
|
||||
&count seta 1
|
||||
.loop2
|
||||
sta &adr(&count)+2
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.done
|
||||
ago ^loop2
|
||||
.done
|
||||
mend
|
||||
macro
|
||||
&lab Set_Variable &a1
|
||||
&lab p16 $106,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab wait &a1
|
||||
&lab ph4 &a1
|
||||
case on
|
||||
jsl wait
|
||||
case off
|
||||
MEND
|
||||
MACRO
|
||||
&lab p16 &a1,&a2
|
||||
&lab jsl $E100A8
|
||||
dc i2'&a1'
|
||||
dc i4'&a2'
|
||||
mend
|
||||
MACRO
|
||||
&lab jne &loc
|
||||
&lab beq *+5
|
||||
jmp &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab dey2
|
||||
&lab dey
|
||||
dey
|
||||
mend
|
||||
MACRO
|
||||
&lab kill &a1
|
||||
&lab ph2 &a1(2)
|
||||
ph2 &a1(1)
|
||||
case on
|
||||
jsl kill
|
||||
case off
|
||||
MEND
|
||||
MACRO
|
||||
&lab sigsetmask &a1
|
||||
&lab ph4 &a1
|
||||
case on
|
||||
jsl sigsetmask
|
||||
case off
|
||||
MEND
|
||||
MACRO
|
||||
&lab sigblock &a1
|
||||
&lab ph4 &a1
|
||||
case on
|
||||
jsl sigblock
|
||||
case off
|
||||
MEND
|
||||
MACRO
|
||||
&lab tctpgrp &a1
|
||||
&lab ph2 &a1(2)
|
||||
ph2 &a1(1)
|
||||
case on
|
||||
jsl tctpgrp
|
||||
case off
|
||||
MEND
|
||||
MACRO
|
||||
&lab sigpause &a1
|
||||
&lab ph4 &a1
|
||||
case on
|
||||
jsl sigpause
|
||||
case off
|
||||
MEND
|
||||
MACRO
|
||||
&lab getpgrp &a1
|
||||
&lab ph2 &a1
|
||||
case on
|
||||
jsl getpgrp
|
||||
case off
|
||||
MEND
|
||||
MACRO
|
||||
&lab tool &a1
|
||||
&lab ldx #&a1
|
||||
jsl $e10000
|
||||
mend
|
||||
macro
|
||||
&lab jcs &loc
|
||||
&lab bcc *+5
|
||||
jmp &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab jcc &loc
|
||||
&lab bcs *+5
|
||||
jmp &loc
|
||||
mend
|
297
bin/gsh/M/main.mac
Normal file
297
bin/gsh/M/main.mac
Normal file
|
@ -0,0 +1,297 @@
|
|||
MACRO
|
||||
&lab jeq &loc
|
||||
&lab bne *+5
|
||||
jmp &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab subroutine &parms,&work
|
||||
&lab anop
|
||||
aif c:&work,.a
|
||||
lclc &work
|
||||
&work setc 0
|
||||
.a
|
||||
gbla &totallen
|
||||
gbla &worklen
|
||||
&worklen seta &work
|
||||
&totallen seta 0
|
||||
aif c:&parms=0,.e
|
||||
lclc &len
|
||||
lclc &p
|
||||
lcla &i
|
||||
&i seta c:&parms
|
||||
.b
|
||||
&p setc &parms(&i)
|
||||
&len amid &p,2,1
|
||||
aif "&len"=":",.c
|
||||
&len amid &p,1,2
|
||||
&p amid &p,4,l:&p-3
|
||||
ago .d
|
||||
.c
|
||||
&len amid &p,1,1
|
||||
&p amid &p,3,l:&p-2
|
||||
.d
|
||||
&p equ &totallen+3+&work
|
||||
&totallen seta &totallen+&len
|
||||
&i seta &i-1
|
||||
aif &i,^b
|
||||
.e
|
||||
tsc
|
||||
sec
|
||||
sbc #&work
|
||||
tcs
|
||||
inc a
|
||||
phd
|
||||
tcd
|
||||
phb
|
||||
phk
|
||||
plb
|
||||
mend
|
||||
MACRO
|
||||
&lab return &r
|
||||
&lab anop
|
||||
lclc &len
|
||||
aif c:&r,.a
|
||||
lclc &r
|
||||
&r setc 0
|
||||
&len setc 0
|
||||
ago .h
|
||||
.a
|
||||
&len amid &r,2,1
|
||||
aif "&len"=":",.b
|
||||
&len amid &r,1,2
|
||||
&r amid &r,4,l:&r-3
|
||||
ago .c
|
||||
.b
|
||||
&len amid &r,1,1
|
||||
&r amid &r,3,l:&r-2
|
||||
.c
|
||||
aif &len<>2,.d
|
||||
ldy &r
|
||||
ago .h
|
||||
.d
|
||||
aif &len<>4,.e
|
||||
ldx &r+2
|
||||
ldy &r
|
||||
ago .h
|
||||
.e
|
||||
aif &len<>10,.g
|
||||
ldy #&r
|
||||
ldx #^&r
|
||||
ago .h
|
||||
.g
|
||||
mnote 'Not a valid return length',16
|
||||
mexit
|
||||
.h
|
||||
aif &totallen=0,.i
|
||||
lda &worklen+1
|
||||
sta &worklen+&totallen+1
|
||||
lda &worklen
|
||||
sta &worklen+&totallen
|
||||
.i
|
||||
plb
|
||||
pld
|
||||
tsc
|
||||
clc
|
||||
adc #&worklen+&totallen
|
||||
tcs
|
||||
aif &len=0,.j
|
||||
tya
|
||||
.j
|
||||
rtl
|
||||
mend
|
||||
MACRO
|
||||
&lab add2 &arg1,&arg2,&dest
|
||||
lclc &char
|
||||
&lab clc
|
||||
&char amid &arg1,1,1
|
||||
aif "&char"="@",.at1
|
||||
lda &arg1
|
||||
ago .add
|
||||
.at1
|
||||
&char amid &arg1,2,1
|
||||
aif "&char"="x",.x1
|
||||
aif "&char"="X",.x1
|
||||
aif "&char"="y",.y1
|
||||
aif "&char"="Y",.y1
|
||||
ago .add
|
||||
.x1
|
||||
txa
|
||||
ago .add
|
||||
.y1
|
||||
tya
|
||||
.add
|
||||
adc &arg2
|
||||
&char amid &dest,1,1
|
||||
aif "&char"="@",.at2
|
||||
sta &dest
|
||||
ago .b
|
||||
.at2
|
||||
&char amid &dest,2,1
|
||||
aif "&char"="x",.x2
|
||||
aif "&char"="X",.x2
|
||||
aif "&char"="y",.y2
|
||||
aif "&char"="Y",.y2
|
||||
ago .b
|
||||
.x2
|
||||
tax
|
||||
ago .b
|
||||
.y2
|
||||
tay
|
||||
.b
|
||||
mend
|
||||
macro
|
||||
&lab ErrWriteCString &a1
|
||||
&lab ph4 &a1
|
||||
Tool $210c
|
||||
mend
|
||||
MACRO
|
||||
&lab kernStatus &a1
|
||||
&lab pha
|
||||
ldx #$603
|
||||
jsl $E10008
|
||||
pl2 &a1
|
||||
MEND
|
||||
MACRO
|
||||
&lab pl2 &parm
|
||||
lclc &char
|
||||
&lab anop
|
||||
aif s:longa=1,.start
|
||||
rep #%00100000
|
||||
.start
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="@",.at
|
||||
aif "&char"<>"{",.absolute
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
pla
|
||||
sta (&parm)
|
||||
ago .shorten
|
||||
.absolute
|
||||
pla
|
||||
sta &parm
|
||||
ago .shorten
|
||||
.at
|
||||
&char amid &parm,2,1
|
||||
pl&char
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing Closing '}'",16
|
||||
mend
|
||||
MACRO
|
||||
&lab tool &a1
|
||||
&lab ldx #&a1
|
||||
jsl $e10000
|
||||
mend
|
||||
MACRO
|
||||
&lab ph4 &parm
|
||||
lclc &char
|
||||
lclc &char1
|
||||
lclc &char2
|
||||
&lab anop
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="@",.at
|
||||
aif s:longa=1,.chk1
|
||||
rep #%00100000
|
||||
.chk1
|
||||
aif "&char"<>"{",.chk2
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
ldy #2
|
||||
lda (&parm),y
|
||||
pha
|
||||
lda (&parm)
|
||||
pha
|
||||
ago .shorten
|
||||
.chk2
|
||||
aif "&char"<>"[",.absolute
|
||||
ldy #2
|
||||
lda &parm,y
|
||||
pha
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.absolute
|
||||
lda &parm+2
|
||||
pha
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.at
|
||||
&char1 amid &parm,2,1
|
||||
&char2 setc &char1
|
||||
ph&char1
|
||||
aif l:&parm<3,.chk2a
|
||||
&char2 amid &parm,3,1
|
||||
.chk2a
|
||||
ph&char2
|
||||
ago .shorten
|
||||
.immediate
|
||||
&parm amid &parm,2,l:&parm-1
|
||||
pea +(&parm)|-16
|
||||
pea &parm
|
||||
ago .done
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing closing '}'",16
|
||||
mend
|
||||
MACRO
|
||||
&lab MV2 &src,&adr
|
||||
&lab lcla &count
|
||||
lda &src
|
||||
&count seta 1
|
||||
.loop
|
||||
sta &adr(&count)
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.done
|
||||
ago ^loop
|
||||
.done
|
||||
mend
|
||||
macro
|
||||
&lab MV4 &src,&adr
|
||||
&lab lcla &count
|
||||
lda &src
|
||||
&count seta 1
|
||||
.loop1
|
||||
sta &adr(&count)
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.part2
|
||||
ago ^loop1
|
||||
.part2
|
||||
lda &src+2
|
||||
&count seta 1
|
||||
.loop2
|
||||
sta &adr(&count)+2
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.done
|
||||
ago ^loop2
|
||||
.done
|
||||
mend
|
||||
MACRO
|
||||
&lab add4 &arg1,&arg2,&dest
|
||||
&lab anop
|
||||
lclc &ch
|
||||
&ch amid &arg2,1,1
|
||||
clc
|
||||
lda &arg1
|
||||
adc &arg2
|
||||
sta &dest
|
||||
lda &arg1+2
|
||||
aif "&ch"="#",.a
|
||||
adc &arg2+2
|
||||
ago .b
|
||||
.a
|
||||
adc &arg2|-16
|
||||
.b
|
||||
sta &dest+2
|
||||
mend
|
304
bin/gsh/M/orca.mac
Normal file
304
bin/gsh/M/orca.mac
Normal file
|
@ -0,0 +1,304 @@
|
|||
MACRO
|
||||
&lab ph2 &parm
|
||||
lclc &char
|
||||
&lab anop
|
||||
aif c:&parm=0,.done
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="@",.at
|
||||
aif s:longa=1,.chk
|
||||
rep #%00100000
|
||||
.chk
|
||||
aif "&char"<>"{",.absolute
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
lda (&parm)
|
||||
pha
|
||||
ago .shorten
|
||||
.absolute
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.immediate
|
||||
&parm amid &parm,2,l:&parm-1
|
||||
pea &parm
|
||||
ago .done
|
||||
.at
|
||||
&char amid &parm,2,1
|
||||
ph&char
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing closing '}'",16
|
||||
mend
|
||||
MACRO
|
||||
&lab ph4 &parm
|
||||
lclc &char
|
||||
lclc &char1
|
||||
lclc &char2
|
||||
&lab anop
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="@",.at
|
||||
aif s:longa=1,.chk1
|
||||
rep #%00100000
|
||||
.chk1
|
||||
aif "&char"<>"{",.chk2
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
ldy #2
|
||||
lda (&parm),y
|
||||
pha
|
||||
lda (&parm)
|
||||
pha
|
||||
ago .shorten
|
||||
.chk2
|
||||
aif "&char"<>"[",.absolute
|
||||
ldy #2
|
||||
lda &parm,y
|
||||
pha
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.absolute
|
||||
lda &parm+2
|
||||
pha
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.at
|
||||
&char1 amid &parm,2,1
|
||||
&char2 setc &char1
|
||||
ph&char1
|
||||
aif l:&parm<3,.chk2a
|
||||
&char2 amid &parm,3,1
|
||||
.chk2a
|
||||
ph&char2
|
||||
ago .shorten
|
||||
.immediate
|
||||
&parm amid &parm,2,l:&parm-1
|
||||
pea +(&parm)|-16
|
||||
pea &parm
|
||||
ago .done
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing closing '}'",16
|
||||
mend
|
||||
macro
|
||||
&lab MV4 &src,&adr
|
||||
&lab lcla &count
|
||||
lda &src
|
||||
&count seta 1
|
||||
.loop1
|
||||
sta &adr(&count)
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.part2
|
||||
ago ^loop1
|
||||
.part2
|
||||
lda &src+2
|
||||
&count seta 1
|
||||
.loop2
|
||||
sta &adr(&count)+2
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.done
|
||||
ago ^loop2
|
||||
.done
|
||||
mend
|
||||
MACRO
|
||||
&lab subroutine &parms,&work
|
||||
&lab anop
|
||||
aif c:&work,.a
|
||||
lclc &work
|
||||
&work setc 0
|
||||
.a
|
||||
gbla &totallen
|
||||
gbla &worklen
|
||||
&worklen seta &work
|
||||
&totallen seta 0
|
||||
aif c:&parms=0,.e
|
||||
lclc &len
|
||||
lclc &p
|
||||
lcla &i
|
||||
&i seta c:&parms
|
||||
.b
|
||||
&p setc &parms(&i)
|
||||
&len amid &p,2,1
|
||||
aif "&len"=":",.c
|
||||
&len amid &p,1,2
|
||||
&p amid &p,4,l:&p-3
|
||||
ago .d
|
||||
.c
|
||||
&len amid &p,1,1
|
||||
&p amid &p,3,l:&p-2
|
||||
.d
|
||||
&p equ &totallen+3+&work
|
||||
&totallen seta &totallen+&len
|
||||
&i seta &i-1
|
||||
aif &i,^b
|
||||
.e
|
||||
tsc
|
||||
sec
|
||||
sbc #&work
|
||||
tcs
|
||||
inc a
|
||||
phd
|
||||
tcd
|
||||
phb
|
||||
phk
|
||||
plb
|
||||
mend
|
||||
MACRO
|
||||
&lab return &r
|
||||
&lab anop
|
||||
lclc &len
|
||||
aif c:&r,.a
|
||||
lclc &r
|
||||
&r setc 0
|
||||
&len setc 0
|
||||
ago .h
|
||||
.a
|
||||
&len amid &r,2,1
|
||||
aif "&len"=":",.b
|
||||
&len amid &r,1,2
|
||||
&r amid &r,4,l:&r-3
|
||||
ago .c
|
||||
.b
|
||||
&len amid &r,1,1
|
||||
&r amid &r,3,l:&r-2
|
||||
.c
|
||||
aif &len<>2,.d
|
||||
ldy &r
|
||||
ago .h
|
||||
.d
|
||||
aif &len<>4,.e
|
||||
ldx &r+2
|
||||
ldy &r
|
||||
ago .h
|
||||
.e
|
||||
aif &len<>10,.g
|
||||
ldy #&r
|
||||
ldx #^&r
|
||||
ago .h
|
||||
.g
|
||||
mnote 'Not a valid return length',16
|
||||
mexit
|
||||
.h
|
||||
aif &totallen=0,.i
|
||||
lda &worklen+1
|
||||
sta &worklen+&totallen+1
|
||||
lda &worklen
|
||||
sta &worklen+&totallen
|
||||
.i
|
||||
plb
|
||||
pld
|
||||
tsc
|
||||
clc
|
||||
adc #&worklen+&totallen
|
||||
tcs
|
||||
aif &len=0,.j
|
||||
tya
|
||||
.j
|
||||
rtl
|
||||
mend
|
||||
MACRO
|
||||
&lab long &stat
|
||||
&lab anop
|
||||
lcla &t
|
||||
lcla &len
|
||||
lclc &ch
|
||||
&t seta 0
|
||||
&len seta l:&stat
|
||||
.a
|
||||
aif &len=0,.b
|
||||
&ch amid &stat,&len,1
|
||||
aif ("&ch"="x").or.("&ch"="y").or.("&ch"="i"),.i
|
||||
aif ("&ch"="a").or.("&ch"="m"),.m
|
||||
.c
|
||||
&len seta &len-1
|
||||
ago ^a
|
||||
.i
|
||||
longi on
|
||||
&t seta &t+16
|
||||
ago ^c
|
||||
.m
|
||||
longa on
|
||||
&t seta &t+32
|
||||
ago ^c
|
||||
.b
|
||||
aif &t=0,.d
|
||||
rep #&t
|
||||
.d
|
||||
mend
|
||||
MACRO
|
||||
&lab short &stat
|
||||
&lab anop
|
||||
lcla &t
|
||||
lcla &len
|
||||
lclc &ch
|
||||
&t seta 0
|
||||
&len seta l:&stat
|
||||
.a
|
||||
aif &len=0,.b
|
||||
&ch amid &stat,&len,1
|
||||
aif ("&ch"="x").or.("&ch"="y").or.("&ch"="i"),.i
|
||||
aif ("&ch"="a").or.("&ch"="m"),.m
|
||||
.c
|
||||
&len seta &len-1
|
||||
ago ^a
|
||||
.i
|
||||
longi off
|
||||
&t seta &t+16
|
||||
ago ^c
|
||||
.m
|
||||
longa off
|
||||
&t seta &t+32
|
||||
ago ^c
|
||||
.b
|
||||
aif &t=0,.d
|
||||
sep #&t
|
||||
.d
|
||||
mend
|
||||
MACRO
|
||||
&lab Str &string
|
||||
&lab dc i1'L:&string'
|
||||
dc c"&string"
|
||||
mend
|
||||
MACRO
|
||||
&lab iny2
|
||||
&lab iny
|
||||
iny
|
||||
mend
|
||||
MACRO
|
||||
&lab jcc &loc
|
||||
&lab bcs *+5
|
||||
jmp &loc
|
||||
mend
|
||||
macro
|
||||
&lab ExpandPath &a1
|
||||
&lab gsos $200E,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab gsos &a1,&a2
|
||||
&lab jsl $E100A8
|
||||
dc i2'&a1'
|
||||
dc i4'&a2'
|
||||
mend
|
||||
macro
|
||||
&lab SET_LINFOGS &a1
|
||||
&lab p16 $142,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab p16 &a1,&a2
|
||||
&lab jsl $E100A8
|
||||
dc i2'&a1'
|
||||
dc i4'&a2'
|
||||
mend
|
374
bin/gsh/M/prompt.mac
Normal file
374
bin/gsh/M/prompt.mac
Normal file
|
@ -0,0 +1,374 @@
|
|||
MACRO
|
||||
&lab subroutine &parms,&work
|
||||
&lab anop
|
||||
aif c:&work,.a
|
||||
lclc &work
|
||||
&work setc 0
|
||||
.a
|
||||
gbla &totallen
|
||||
gbla &worklen
|
||||
&worklen seta &work
|
||||
&totallen seta 0
|
||||
aif c:&parms=0,.e
|
||||
lclc &len
|
||||
lclc &p
|
||||
lcla &i
|
||||
&i seta c:&parms
|
||||
.b
|
||||
&p setc &parms(&i)
|
||||
&len amid &p,2,1
|
||||
aif "&len"=":",.c
|
||||
&len amid &p,1,2
|
||||
&p amid &p,4,l:&p-3
|
||||
ago .d
|
||||
.c
|
||||
&len amid &p,1,1
|
||||
&p amid &p,3,l:&p-2
|
||||
.d
|
||||
&p equ &totallen+3+&work
|
||||
&totallen seta &totallen+&len
|
||||
&i seta &i-1
|
||||
aif &i,^b
|
||||
.e
|
||||
tsc
|
||||
sec
|
||||
sbc #&work
|
||||
tcs
|
||||
inc a
|
||||
phd
|
||||
tcd
|
||||
phb
|
||||
phk
|
||||
plb
|
||||
mend
|
||||
MACRO
|
||||
&lab return &r
|
||||
&lab anop
|
||||
lclc &len
|
||||
aif c:&r,.a
|
||||
lclc &r
|
||||
&r setc 0
|
||||
&len setc 0
|
||||
ago .h
|
||||
.a
|
||||
&len amid &r,2,1
|
||||
aif "&len"=":",.b
|
||||
&len amid &r,1,2
|
||||
&r amid &r,4,l:&r-3
|
||||
ago .c
|
||||
.b
|
||||
&len amid &r,1,1
|
||||
&r amid &r,3,l:&r-2
|
||||
.c
|
||||
aif &len<>2,.d
|
||||
ldy &r
|
||||
ago .h
|
||||
.d
|
||||
aif &len<>4,.e
|
||||
ldx &r+2
|
||||
ldy &r
|
||||
ago .h
|
||||
.e
|
||||
aif &len<>10,.g
|
||||
ldy #&r
|
||||
ldx #^&r
|
||||
ago .h
|
||||
.g
|
||||
mnote 'Not a valid return length',16
|
||||
mexit
|
||||
.h
|
||||
aif &totallen=0,.i
|
||||
lda &worklen+1
|
||||
sta &worklen+&totallen+1
|
||||
lda &worklen
|
||||
sta &worklen+&totallen
|
||||
.i
|
||||
plb
|
||||
pld
|
||||
tsc
|
||||
clc
|
||||
adc #&worklen+&totallen
|
||||
tcs
|
||||
aif &len=0,.j
|
||||
tya
|
||||
.j
|
||||
rtl
|
||||
mend
|
||||
MACRO
|
||||
&lab WriteCString &a1
|
||||
&lab ph4 &a1
|
||||
Tool $200c
|
||||
mend
|
||||
MACRO
|
||||
&lab tool &a1
|
||||
&lab ldx #&a1
|
||||
jsl $e10000
|
||||
mend
|
||||
MACRO
|
||||
&lab ph4 &parm
|
||||
lclc &char
|
||||
lclc &char1
|
||||
lclc &char2
|
||||
&lab anop
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="@",.at
|
||||
aif s:longa=1,.chk1
|
||||
rep #%00100000
|
||||
.chk1
|
||||
aif "&char"<>"{",.chk2
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
ldy #2
|
||||
lda (&parm),y
|
||||
pha
|
||||
lda (&parm)
|
||||
pha
|
||||
ago .shorten
|
||||
.chk2
|
||||
aif "&char"<>"[",.absolute
|
||||
ldy #2
|
||||
lda &parm,y
|
||||
pha
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.absolute
|
||||
lda &parm+2
|
||||
pha
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.at
|
||||
&char1 amid &parm,2,1
|
||||
&char2 setc &char1
|
||||
ph&char1
|
||||
aif l:&parm<3,.chk2a
|
||||
&char2 amid &parm,3,1
|
||||
.chk2a
|
||||
ph&char2
|
||||
ago .shorten
|
||||
.immediate
|
||||
&parm amid &parm,2,l:&parm-1
|
||||
pea +(&parm)|-16
|
||||
pea &parm
|
||||
ago .done
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing closing '}'",16
|
||||
mend
|
||||
MACRO
|
||||
&lab gsos &a1,&a2
|
||||
&lab jsl $E100A8
|
||||
dc i2'&a1'
|
||||
dc i4'&a2'
|
||||
mend
|
||||
MACRO
|
||||
&lab WriteChar &a1
|
||||
&lab ph2 &a1
|
||||
Tool $180c
|
||||
mend
|
||||
MACRO
|
||||
&lab Int2Dec &a1
|
||||
&lab ph2 &a1(1)
|
||||
ph4 &a1(2)
|
||||
ph2 &a1(3)
|
||||
ph2 &a1(4)
|
||||
Tool $260b
|
||||
mend
|
||||
MACRO
|
||||
&lab ph2 &parm
|
||||
lclc &char
|
||||
&lab anop
|
||||
aif c:&parm=0,.done
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="@",.at
|
||||
aif s:longa=1,.chk
|
||||
rep #%00100000
|
||||
.chk
|
||||
aif "&char"<>"{",.absolute
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
lda (&parm)
|
||||
pha
|
||||
ago .shorten
|
||||
.absolute
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.immediate
|
||||
&parm amid &parm,2,l:&parm-1
|
||||
pea &parm
|
||||
ago .done
|
||||
.at
|
||||
&char amid &parm,2,1
|
||||
ph&char
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing closing '}'",16
|
||||
mend
|
||||
MACRO
|
||||
&lab ReadTimeHex &a1
|
||||
&lab pha
|
||||
pha
|
||||
pha
|
||||
pha
|
||||
tool $0d03
|
||||
pl2 &a1(1)
|
||||
pl2 &a1(2)
|
||||
pl2 &a1(3)
|
||||
pl2 &a1(4)
|
||||
mend
|
||||
MACRO
|
||||
&lab pl2 &parm
|
||||
lclc &char
|
||||
&lab anop
|
||||
aif s:longa=1,.start
|
||||
rep #%00100000
|
||||
.start
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="@",.at
|
||||
aif "&char"<>"{",.absolute
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
pla
|
||||
sta (&parm)
|
||||
ago .shorten
|
||||
.absolute
|
||||
pla
|
||||
sta &parm
|
||||
ago .shorten
|
||||
.at
|
||||
&char amid &parm,2,1
|
||||
pl&char
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing Closing '}'",16
|
||||
mend
|
||||
MACRO
|
||||
&lab sub2 &arg1,&arg2,&dest
|
||||
lclc &char
|
||||
&lab sec
|
||||
&char amid &arg1,1,1
|
||||
aif "&char"="@",.at1
|
||||
lda &arg1
|
||||
ago .sub
|
||||
.at1
|
||||
&char amid &arg1,2,1
|
||||
aif "&char"="x",.x1
|
||||
aif "&char"="X",.x1
|
||||
aif "&char"="y",.y1
|
||||
aif "&char"="Y",.y1
|
||||
ago .sub
|
||||
.x1
|
||||
txa
|
||||
ago .sub
|
||||
.y1
|
||||
tya
|
||||
.sub
|
||||
sbc &arg2
|
||||
&char amid &dest,1,1
|
||||
aif "&char"="@",.at2
|
||||
sta &dest
|
||||
ago .b
|
||||
.at2
|
||||
&char amid &dest,2,1
|
||||
aif "&char"="x",.x2
|
||||
aif "&char"="X",.x2
|
||||
aif "&char"="y",.y2
|
||||
aif "&char"="Y",.y2
|
||||
ago .b
|
||||
.x2
|
||||
tax
|
||||
ago .b
|
||||
.y2
|
||||
tay
|
||||
.b
|
||||
mend
|
||||
MACRO
|
||||
&lab if2 &var,&rel,&val,&label
|
||||
&lab ago .skip
|
||||
ble
|
||||
bgt
|
||||
.skip
|
||||
lclc &char1
|
||||
lclc &char2
|
||||
&char1 amid &var,1,1
|
||||
&char2 amid &var,2,1
|
||||
aif "&char1"="@",.index
|
||||
lda &var
|
||||
.cmp
|
||||
cmp &val
|
||||
ago .branch
|
||||
.index
|
||||
aif "&char2"="x",.x1
|
||||
aif "&char2"="X",.x1
|
||||
aif "&char2"="y",.y1
|
||||
aif "&char2"="Y",.y1
|
||||
ago ^cmp
|
||||
.x1
|
||||
cpx &val
|
||||
ago .branch
|
||||
.y1
|
||||
cpy &val
|
||||
.branch
|
||||
&char1 amid &rel,1,1
|
||||
aif "&char1"="@",.done
|
||||
b&rel &label
|
||||
.done
|
||||
mend
|
||||
MACRO
|
||||
&lab bgt &loc
|
||||
&lab beq *+4
|
||||
bcs &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab ble &loc
|
||||
&lab bcc &loc
|
||||
beq &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab GetPrefix &a1
|
||||
&lab gsos $200A,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab jeq &loc
|
||||
&lab bne *+5
|
||||
jmp &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab READ_VARIABLE &a1
|
||||
&lab p16 $10B,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab p16 &a1,&a2
|
||||
&lab jsl $E100A8
|
||||
dc i2'&a1'
|
||||
dc i4'&a2'
|
||||
mend
|
||||
MACRO
|
||||
&lab Str &string
|
||||
&lab dc i1'L:&string'
|
||||
dc c"&string"
|
||||
mend
|
||||
MACRO
|
||||
&lab WriteString &a1
|
||||
&lab ph4 &a1
|
||||
Tool $1c0c
|
||||
mend
|
405
bin/gsh/M/shell.mac
Normal file
405
bin/gsh/M/shell.mac
Normal file
|
@ -0,0 +1,405 @@
|
|||
MACRO
|
||||
&lab Quit &a1
|
||||
&lab gsos $2029,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab gsos &a1,&a2
|
||||
&lab jsl $E100A8
|
||||
dc i2'&a1'
|
||||
dc i4'&a2'
|
||||
mend
|
||||
MACRO
|
||||
&lab WriteCString &a1
|
||||
&lab ph4 &a1
|
||||
Tool $200c
|
||||
mend
|
||||
MACRO
|
||||
&lab tool &a1
|
||||
&lab ldx #&a1
|
||||
jsl $e10000
|
||||
mend
|
||||
MACRO
|
||||
&lab ph2 &parm
|
||||
lclc &char
|
||||
&lab anop
|
||||
aif c:&parm=0,.done
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="@",.at
|
||||
aif s:longa=1,.chk
|
||||
rep #%00100000
|
||||
.chk
|
||||
aif "&char"<>"{",.absolute
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
lda (&parm)
|
||||
pha
|
||||
ago .shorten
|
||||
.absolute
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.immediate
|
||||
&parm amid &parm,2,l:&parm-1
|
||||
pea &parm
|
||||
ago .done
|
||||
.at
|
||||
&char amid &parm,2,1
|
||||
ph&char
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing closing '}'",16
|
||||
mend
|
||||
MACRO
|
||||
&lab ph4 &parm
|
||||
lclc &char
|
||||
lclc &char1
|
||||
lclc &char2
|
||||
&lab anop
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="@",.at
|
||||
aif s:longa=1,.chk1
|
||||
rep #%00100000
|
||||
.chk1
|
||||
aif "&char"<>"{",.chk2
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
ldy #2
|
||||
lda (&parm),y
|
||||
pha
|
||||
lda (&parm)
|
||||
pha
|
||||
ago .shorten
|
||||
.chk2
|
||||
aif "&char"<>"[",.absolute
|
||||
ldy #2
|
||||
lda &parm,y
|
||||
pha
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.absolute
|
||||
lda &parm+2
|
||||
pha
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.at
|
||||
&char1 amid &parm,2,1
|
||||
&char2 setc &char1
|
||||
ph&char1
|
||||
aif l:&parm<3,.chk2a
|
||||
&char2 amid &parm,3,1
|
||||
.chk2a
|
||||
ph&char2
|
||||
ago .shorten
|
||||
.immediate
|
||||
&parm amid &parm,2,l:&parm-1
|
||||
pea +(&parm)|-16
|
||||
pea &parm
|
||||
ago .done
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing closing '}'",16
|
||||
mend
|
||||
MACRO
|
||||
&lab GSStr &string
|
||||
&lab dc i2'L:&string'
|
||||
dc c"&string"
|
||||
mend
|
||||
MACRO
|
||||
&lab MV2 &src,&adr
|
||||
&lab lcla &count
|
||||
lda &src
|
||||
&count seta 1
|
||||
.loop
|
||||
sta &adr(&count)
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.done
|
||||
ago ^loop
|
||||
.done
|
||||
mend
|
||||
MACRO
|
||||
&lab Open &a1
|
||||
&lab gsos $2010,&a1
|
||||
mend
|
||||
macro
|
||||
&lab MV4 &src,&adr
|
||||
&lab lcla &count
|
||||
lda &src
|
||||
&count seta 1
|
||||
.loop1
|
||||
sta &adr(&count)
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.part2
|
||||
ago ^loop1
|
||||
.part2
|
||||
lda &src+2
|
||||
&count seta 1
|
||||
.loop2
|
||||
sta &adr(&count)+2
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.done
|
||||
ago ^loop2
|
||||
.done
|
||||
mend
|
||||
MACRO
|
||||
&lab signal &a1
|
||||
&lab ph4 &a1(2)
|
||||
ph2 &a1(1)
|
||||
case on
|
||||
jsl signal
|
||||
case off
|
||||
MEND
|
||||
MACRO
|
||||
&lab setsystemvector &a1
|
||||
&lab ph4 &a1
|
||||
case on
|
||||
jsl setsystemvector
|
||||
case off
|
||||
MEND
|
||||
MACRO
|
||||
&lab tcnewpgrp &a1
|
||||
&lab ph2 &a1
|
||||
case on
|
||||
jsl tcnewpgrp
|
||||
case off
|
||||
MEND
|
||||
MACRO
|
||||
&lab settpgrp &a1
|
||||
&lab ph2 &a1
|
||||
case on
|
||||
jsl settpgrp
|
||||
case off
|
||||
MEND
|
||||
MACRO
|
||||
&lab getpid
|
||||
&lab case on
|
||||
jsl getpid
|
||||
case off
|
||||
MEND
|
||||
MACRO
|
||||
&lab ora2 &arg1,&arg2,&dest
|
||||
&lab anop
|
||||
lclc &char
|
||||
&char amid &arg1,1,1
|
||||
aif "&char"="@",.at1
|
||||
lda &arg1
|
||||
ago .add
|
||||
.at1
|
||||
&char amid &arg1,2,1
|
||||
aif "&char"="x",.x1
|
||||
aif "&char"="X",.x1
|
||||
aif "&char"="y",.y1
|
||||
aif "&char"="Y",.y1
|
||||
ago .add
|
||||
.x1
|
||||
txa
|
||||
ago .add
|
||||
.y1
|
||||
tya
|
||||
.add
|
||||
ora &arg2
|
||||
&char amid &dest,1,1
|
||||
aif "&char"="@",.at2
|
||||
sta &dest
|
||||
ago .b
|
||||
.at2
|
||||
&char amid &dest,2,1
|
||||
aif "&char"="x",.x2
|
||||
aif "&char"="X",.x2
|
||||
aif "&char"="y",.y2
|
||||
aif "&char"="Y",.y2
|
||||
ago .b
|
||||
.x2
|
||||
tax
|
||||
ago .b
|
||||
.y2
|
||||
tay
|
||||
.b
|
||||
mend
|
||||
MACRO
|
||||
&lab subroutine &parms,&work
|
||||
&lab anop
|
||||
aif c:&work,.a
|
||||
lclc &work
|
||||
&work setc 0
|
||||
.a
|
||||
gbla &totallen
|
||||
gbla &worklen
|
||||
&worklen seta &work
|
||||
&totallen seta 0
|
||||
aif c:&parms=0,.e
|
||||
lclc &len
|
||||
lclc &p
|
||||
lcla &i
|
||||
&i seta c:&parms
|
||||
.b
|
||||
&p setc &parms(&i)
|
||||
&len amid &p,2,1
|
||||
aif "&len"=":",.c
|
||||
&len amid &p,1,2
|
||||
&p amid &p,4,l:&p-3
|
||||
ago .d
|
||||
.c
|
||||
&len amid &p,1,1
|
||||
&p amid &p,3,l:&p-2
|
||||
.d
|
||||
&p equ &totallen+3+&work
|
||||
&totallen seta &totallen+&len
|
||||
&i seta &i-1
|
||||
aif &i,^b
|
||||
.e
|
||||
tsc
|
||||
sec
|
||||
sbc #&work
|
||||
tcs
|
||||
inc a
|
||||
phd
|
||||
tcd
|
||||
phb
|
||||
phk
|
||||
plb
|
||||
mend
|
||||
MACRO
|
||||
&lab return &r
|
||||
&lab anop
|
||||
lclc &len
|
||||
aif c:&r,.a
|
||||
lclc &r
|
||||
&r setc 0
|
||||
&len setc 0
|
||||
ago .h
|
||||
.a
|
||||
&len amid &r,2,1
|
||||
aif "&len"=":",.b
|
||||
&len amid &r,1,2
|
||||
&r amid &r,4,l:&r-3
|
||||
ago .c
|
||||
.b
|
||||
&len amid &r,1,1
|
||||
&r amid &r,3,l:&r-2
|
||||
.c
|
||||
aif &len<>2,.d
|
||||
ldy &r
|
||||
ago .h
|
||||
.d
|
||||
aif &len<>4,.e
|
||||
ldx &r+2
|
||||
ldy &r
|
||||
ago .h
|
||||
.e
|
||||
aif &len<>10,.g
|
||||
ldy #&r
|
||||
ldx #^&r
|
||||
ago .h
|
||||
.g
|
||||
mnote 'Not a valid return length',16
|
||||
mexit
|
||||
.h
|
||||
aif &totallen=0,.i
|
||||
lda &worklen+1
|
||||
sta &worklen+&totallen+1
|
||||
lda &worklen
|
||||
sta &worklen+&totallen
|
||||
.i
|
||||
plb
|
||||
pld
|
||||
tsc
|
||||
clc
|
||||
adc #&worklen+&totallen
|
||||
tcs
|
||||
aif &len=0,.j
|
||||
tya
|
||||
.j
|
||||
rtl
|
||||
mend
|
||||
macro
|
||||
&lab ErrWriteCString &a1
|
||||
&lab ph4 &a1
|
||||
Tool $210c
|
||||
mend
|
||||
MACRO
|
||||
&lab PopVariables &a1
|
||||
&lab p16 $117,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab p16 &a1,&a2
|
||||
&lab jsl $E100A8
|
||||
dc i2'&a1'
|
||||
dc i4'&a2'
|
||||
mend
|
||||
MACRO
|
||||
&lab long &stat
|
||||
&lab anop
|
||||
lcla &t
|
||||
lcla &len
|
||||
lclc &ch
|
||||
&t seta 0
|
||||
&len seta l:&stat
|
||||
.a
|
||||
aif &len=0,.b
|
||||
&ch amid &stat,&len,1
|
||||
aif ("&ch"="x").or.("&ch"="y").or.("&ch"="i"),.i
|
||||
aif ("&ch"="a").or.("&ch"="m"),.m
|
||||
.c
|
||||
&len seta &len-1
|
||||
ago ^a
|
||||
.i
|
||||
longi on
|
||||
&t seta &t+16
|
||||
ago ^c
|
||||
.m
|
||||
longa on
|
||||
&t seta &t+32
|
||||
ago ^c
|
||||
.b
|
||||
aif &t=0,.d
|
||||
rep #&t
|
||||
.d
|
||||
mend
|
||||
MACRO
|
||||
&lab short &stat
|
||||
&lab anop
|
||||
lcla &t
|
||||
lcla &len
|
||||
lclc &ch
|
||||
&t seta 0
|
||||
&len seta l:&stat
|
||||
.a
|
||||
aif &len=0,.b
|
||||
&ch amid &stat,&len,1
|
||||
aif ("&ch"="x").or.("&ch"="y").or.("&ch"="i"),.i
|
||||
aif ("&ch"="a").or.("&ch"="m"),.m
|
||||
.c
|
||||
&len seta &len-1
|
||||
ago ^a
|
||||
.i
|
||||
longi off
|
||||
&t seta &t+16
|
||||
ago ^c
|
||||
.m
|
||||
longa off
|
||||
&t seta &t+32
|
||||
ago ^c
|
||||
.b
|
||||
aif &t=0,.d
|
||||
sep #&t
|
||||
.d
|
||||
mend
|
||||
macro
|
||||
&l dosin &adr
|
||||
&l dc i"l:~&sysname&syscnt"
|
||||
~&sysname&syscnt dc c"&adr"
|
||||
mend
|
185
bin/gsh/M/shellutil.mac
Normal file
185
bin/gsh/M/shellutil.mac
Normal file
|
@ -0,0 +1,185 @@
|
|||
MACRO
|
||||
&lab subroutine &parms,&work
|
||||
&lab anop
|
||||
aif c:&work,.a
|
||||
lclc &work
|
||||
&work setc 0
|
||||
.a
|
||||
gbla &totallen
|
||||
gbla &worklen
|
||||
&worklen seta &work
|
||||
&totallen seta 0
|
||||
aif c:&parms=0,.e
|
||||
lclc &len
|
||||
lclc &p
|
||||
lcla &i
|
||||
&i seta c:&parms
|
||||
.b
|
||||
&p setc &parms(&i)
|
||||
&len amid &p,2,1
|
||||
aif "&len"=":",.c
|
||||
&len amid &p,1,2
|
||||
&p amid &p,4,l:&p-3
|
||||
ago .d
|
||||
.c
|
||||
&len amid &p,1,1
|
||||
&p amid &p,3,l:&p-2
|
||||
.d
|
||||
&p equ &totallen+3+&work
|
||||
&totallen seta &totallen+&len
|
||||
&i seta &i-1
|
||||
aif &i,^b
|
||||
.e
|
||||
tsc
|
||||
sec
|
||||
sbc #&work
|
||||
tcs
|
||||
inc a
|
||||
phd
|
||||
tcd
|
||||
phb
|
||||
phk
|
||||
plb
|
||||
mend
|
||||
MACRO
|
||||
&lab return &r
|
||||
&lab anop
|
||||
lclc &len
|
||||
aif c:&r,.a
|
||||
lclc &r
|
||||
&r setc 0
|
||||
&len setc 0
|
||||
ago .h
|
||||
.a
|
||||
&len amid &r,2,1
|
||||
aif "&len"=":",.b
|
||||
&len amid &r,1,2
|
||||
&r amid &r,4,l:&r-3
|
||||
ago .c
|
||||
.b
|
||||
&len amid &r,1,1
|
||||
&r amid &r,3,l:&r-2
|
||||
.c
|
||||
aif &len<>2,.d
|
||||
ldy &r
|
||||
ago .h
|
||||
.d
|
||||
aif &len<>4,.e
|
||||
ldx &r+2
|
||||
ldy &r
|
||||
ago .h
|
||||
.e
|
||||
aif &len<>10,.g
|
||||
ldy #&r
|
||||
ldx #^&r
|
||||
ago .h
|
||||
.g
|
||||
mnote 'Not a valid return length',16
|
||||
mexit
|
||||
.h
|
||||
aif &totallen=0,.i
|
||||
lda &worklen+1
|
||||
sta &worklen+&totallen+1
|
||||
lda &worklen
|
||||
sta &worklen+&totallen
|
||||
.i
|
||||
plb
|
||||
pld
|
||||
tsc
|
||||
clc
|
||||
adc #&worklen+&totallen
|
||||
tcs
|
||||
aif &len=0,.j
|
||||
tya
|
||||
.j
|
||||
rtl
|
||||
mend
|
||||
MACRO
|
||||
&lab long &stat
|
||||
&lab anop
|
||||
lcla &t
|
||||
lcla &len
|
||||
lclc &ch
|
||||
&t seta 0
|
||||
&len seta l:&stat
|
||||
.a
|
||||
aif &len=0,.b
|
||||
&ch amid &stat,&len,1
|
||||
aif ("&ch"="x").or.("&ch"="y").or.("&ch"="i"),.i
|
||||
aif ("&ch"="a").or.("&ch"="m"),.m
|
||||
.c
|
||||
&len seta &len-1
|
||||
ago ^a
|
||||
.i
|
||||
longi on
|
||||
&t seta &t+16
|
||||
ago ^c
|
||||
.m
|
||||
longa on
|
||||
&t seta &t+32
|
||||
ago ^c
|
||||
.b
|
||||
aif &t=0,.d
|
||||
rep #&t
|
||||
.d
|
||||
mend
|
||||
MACRO
|
||||
&lab short &stat
|
||||
&lab anop
|
||||
lcla &t
|
||||
lcla &len
|
||||
lclc &ch
|
||||
&t seta 0
|
||||
&len seta l:&stat
|
||||
.a
|
||||
aif &len=0,.b
|
||||
&ch amid &stat,&len,1
|
||||
aif ("&ch"="x").or.("&ch"="y").or.("&ch"="i"),.i
|
||||
aif ("&ch"="a").or.("&ch"="m"),.m
|
||||
.c
|
||||
&len seta &len-1
|
||||
ago ^a
|
||||
.i
|
||||
longi off
|
||||
&t seta &t+16
|
||||
ago ^c
|
||||
.m
|
||||
longa off
|
||||
&t seta &t+32
|
||||
ago ^c
|
||||
.b
|
||||
aif &t=0,.d
|
||||
sep #&t
|
||||
.d
|
||||
mend
|
||||
MACRO
|
||||
&lab jeq &loc
|
||||
&lab bne *+5
|
||||
jmp &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab READ_VARIABLE &a1
|
||||
&lab p16 $10B,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab p16 &a1,&a2
|
||||
&lab jsl $E100A8
|
||||
dc i2'&a1'
|
||||
dc i4'&a2'
|
||||
mend
|
||||
MACRO
|
||||
&lab unlock &a1
|
||||
&lab stz &a1
|
||||
MEND
|
||||
MACRO
|
||||
&lab key
|
||||
&lab dc i2'0'
|
||||
MEND
|
||||
MACRO
|
||||
&lab lock &a1
|
||||
&lab lda #1
|
||||
tsb &a1
|
||||
beq *+6
|
||||
cop $7F
|
||||
bra *-7
|
||||
MEND
|
338
bin/gsh/M/shellvar.mac
Normal file
338
bin/gsh/M/shellvar.mac
Normal file
|
@ -0,0 +1,338 @@
|
|||
MACRO
|
||||
&lab gsos &a1,&a2
|
||||
&lab jsl $E100A8
|
||||
dc i2'&a1'
|
||||
dc i4'&a2'
|
||||
mend
|
||||
MACRO
|
||||
&lab long &stat
|
||||
&lab anop
|
||||
lcla &t
|
||||
lcla &len
|
||||
lclc &ch
|
||||
&t seta 0
|
||||
&len seta l:&stat
|
||||
.a
|
||||
aif &len=0,.b
|
||||
&ch amid &stat,&len,1
|
||||
aif ("&ch"="x").or.("&ch"="y").or.("&ch"="i"),.i
|
||||
aif ("&ch"="a").or.("&ch"="m"),.m
|
||||
.c
|
||||
&len seta &len-1
|
||||
ago ^a
|
||||
.i
|
||||
longi on
|
||||
&t seta &t+16
|
||||
ago ^c
|
||||
.m
|
||||
longa on
|
||||
&t seta &t+32
|
||||
ago ^c
|
||||
.b
|
||||
aif &t=0,.d
|
||||
rep #&t
|
||||
.d
|
||||
mend
|
||||
MACRO
|
||||
&lab short &stat
|
||||
&lab anop
|
||||
lcla &t
|
||||
lcla &len
|
||||
lclc &ch
|
||||
&t seta 0
|
||||
&len seta l:&stat
|
||||
.a
|
||||
aif &len=0,.b
|
||||
&ch amid &stat,&len,1
|
||||
aif ("&ch"="x").or.("&ch"="y").or.("&ch"="i"),.i
|
||||
aif ("&ch"="a").or.("&ch"="m"),.m
|
||||
.c
|
||||
&len seta &len-1
|
||||
ago ^a
|
||||
.i
|
||||
longi off
|
||||
&t seta &t+16
|
||||
ago ^c
|
||||
.m
|
||||
longa off
|
||||
&t seta &t+32
|
||||
ago ^c
|
||||
.b
|
||||
aif &t=0,.d
|
||||
sep #&t
|
||||
.d
|
||||
mend
|
||||
MACRO
|
||||
&lab ph4 &parm
|
||||
lclc &char
|
||||
lclc &char1
|
||||
lclc &char2
|
||||
&lab anop
|
||||
&char amid &parm,1,1
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="@",.at
|
||||
aif s:longa=1,.chk1
|
||||
rep #%00100000
|
||||
.chk1
|
||||
aif "&char"<>"{",.chk2
|
||||
&char amid &parm,l:&parm,1
|
||||
aif "&char"<>"}",.error
|
||||
&parm amid &parm,2,l:&parm-2
|
||||
ldy #2
|
||||
lda (&parm),y
|
||||
pha
|
||||
lda (&parm)
|
||||
pha
|
||||
ago .shorten
|
||||
.chk2
|
||||
aif "&char"<>"[",.absolute
|
||||
ldy #2
|
||||
lda &parm,y
|
||||
pha
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.absolute
|
||||
lda &parm+2
|
||||
pha
|
||||
lda &parm
|
||||
pha
|
||||
ago .shorten
|
||||
.at
|
||||
&char1 amid &parm,2,1
|
||||
&char2 setc &char1
|
||||
ph&char1
|
||||
aif l:&parm<3,.chk2a
|
||||
&char2 amid &parm,3,1
|
||||
.chk2a
|
||||
ph&char2
|
||||
ago .shorten
|
||||
.immediate
|
||||
&parm amid &parm,2,l:&parm-1
|
||||
pea +(&parm)|-16
|
||||
pea &parm
|
||||
ago .done
|
||||
.shorten
|
||||
aif s:longa=1,.done
|
||||
sep #%00100000
|
||||
.done
|
||||
mexit
|
||||
.error
|
||||
mnote "Missing closing '}'",16
|
||||
mend
|
||||
macro
|
||||
&lab MV4 &src,&adr
|
||||
&lab lcla &count
|
||||
lda &src
|
||||
&count seta 1
|
||||
.loop1
|
||||
sta &adr(&count)
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.part2
|
||||
ago ^loop1
|
||||
.part2
|
||||
lda &src+2
|
||||
&count seta 1
|
||||
.loop2
|
||||
sta &adr(&count)+2
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.done
|
||||
ago ^loop2
|
||||
.done
|
||||
mend
|
||||
MACRO
|
||||
&lab LD2 &val,&adr
|
||||
&lab lcla &count
|
||||
lda #&val
|
||||
&count seta 1
|
||||
.loop
|
||||
sta &adr(&count)
|
||||
&count seta &count+1
|
||||
aif &count>c:&adr,.done
|
||||
ago ^loop
|
||||
.done
|
||||
mend
|
||||
MACRO
|
||||
&lab subroutine &parms,&work
|
||||
&lab anop
|
||||
aif c:&work,.a
|
||||
lclc &work
|
||||
&work setc 0
|
||||
.a
|
||||
gbla &totallen
|
||||
gbla &worklen
|
||||
&worklen seta &work
|
||||
&totallen seta 0
|
||||
aif c:&parms=0,.e
|
||||
lclc &len
|
||||
lclc &p
|
||||
lcla &i
|
||||
&i seta c:&parms
|
||||
.b
|
||||
&p setc &parms(&i)
|
||||
&len amid &p,2,1
|
||||
aif "&len"=":",.c
|
||||
&len amid &p,1,2
|
||||
&p amid &p,4,l:&p-3
|
||||
ago .d
|
||||
.c
|
||||
&len amid &p,1,1
|
||||
&p amid &p,3,l:&p-2
|
||||
.d
|
||||
&p equ &totallen+3+&work
|
||||
&totallen seta &totallen+&len
|
||||
&i seta &i-1
|
||||
aif &i,^b
|
||||
.e
|
||||
tsc
|
||||
sec
|
||||
sbc #&work
|
||||
tcs
|
||||
inc a
|
||||
phd
|
||||
tcd
|
||||
phb
|
||||
phk
|
||||
plb
|
||||
mend
|
||||
MACRO
|
||||
&lab return &r
|
||||
&lab anop
|
||||
lclc &len
|
||||
aif c:&r,.a
|
||||
lclc &r
|
||||
&r setc 0
|
||||
&len setc 0
|
||||
ago .h
|
||||
.a
|
||||
&len amid &r,2,1
|
||||
aif "&len"=":",.b
|
||||
&len amid &r,1,2
|
||||
&r amid &r,4,l:&r-3
|
||||
ago .c
|
||||
.b
|
||||
&len amid &r,1,1
|
||||
&r amid &r,3,l:&r-2
|
||||
.c
|
||||
aif &len<>2,.d
|
||||
ldy &r
|
||||
ago .h
|
||||
.d
|
||||
aif &len<>4,.e
|
||||
ldx &r+2
|
||||
ldy &r
|
||||
ago .h
|
||||
.e
|
||||
aif &len<>10,.g
|
||||
ldy #&r
|
||||
ldx #^&r
|
||||
ago .h
|
||||
.g
|
||||
mnote 'Not a valid return length',16
|
||||
mexit
|
||||
.h
|
||||
aif &totallen=0,.i
|
||||
lda &worklen+1
|
||||
sta &worklen+&totallen+1
|
||||
lda &worklen
|
||||
sta &worklen+&totallen
|
||||
.i
|
||||
plb
|
||||
pld
|
||||
tsc
|
||||
clc
|
||||
adc #&worklen+&totallen
|
||||
tcs
|
||||
aif &len=0,.j
|
||||
tya
|
||||
.j
|
||||
rtl
|
||||
mend
|
||||
MACRO
|
||||
&lab PopVariables &a1
|
||||
&lab p16 $117,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab PushVariables &a1
|
||||
&lab p16 $118,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab p16 &a1,&a2
|
||||
&lab jsl $E100A8
|
||||
dc i2'&a1'
|
||||
dc i4'&a2'
|
||||
mend
|
||||
MACRO
|
||||
&lab jeq &loc
|
||||
&lab bne *+5
|
||||
jmp &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab READ_VARIABLE &a1
|
||||
&lab p16 $10B,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab add2 &arg1,&arg2,&dest
|
||||
lclc &char
|
||||
&lab clc
|
||||
&char amid &arg1,1,1
|
||||
aif "&char"="@",.at1
|
||||
lda &arg1
|
||||
ago .add
|
||||
.at1
|
||||
&char amid &arg1,2,1
|
||||
aif "&char"="x",.x1
|
||||
aif "&char"="X",.x1
|
||||
aif "&char"="y",.y1
|
||||
aif "&char"="Y",.y1
|
||||
ago .add
|
||||
.x1
|
||||
txa
|
||||
ago .add
|
||||
.y1
|
||||
tya
|
||||
.add
|
||||
adc &arg2
|
||||
&char amid &dest,1,1
|
||||
aif "&char"="@",.at2
|
||||
sta &dest
|
||||
ago .b
|
||||
.at2
|
||||
&char amid &dest,2,1
|
||||
aif "&char"="x",.x2
|
||||
aif "&char"="X",.x2
|
||||
aif "&char"="y",.y2
|
||||
aif "&char"="Y",.y2
|
||||
ago .b
|
||||
.x2
|
||||
tax
|
||||
ago .b
|
||||
.y2
|
||||
tay
|
||||
.b
|
||||
mend
|
||||
MACRO
|
||||
&lab iny2
|
||||
&lab iny
|
||||
iny
|
||||
mend
|
||||
MACRO
|
||||
&lab ERROR &a1
|
||||
&lab p16 $105,&a1
|
||||
mend
|
||||
macro
|
||||
&lab Set_Variable &a1
|
||||
&lab p16 $106,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab READ_INDEXED &a1
|
||||
&lab p16 $108,&a1
|
||||
mend
|
||||
macro
|
||||
&lab UnsetVariable &a1
|
||||
&lab p16 $115,&a1
|
||||
mend
|
||||
macro
|
||||
&lab EXPORT &a1
|
||||
&lab p16 $116,&a1
|
||||
mend
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user