mirror of
https://github.com/GnoConsortium/gno.git
synced 2024-06-11 09:29:27 +00:00
Compare commits
669 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 |
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 $*;
|
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
|
||||
|
|
108
NOTES/TO.DO
108
NOTES/TO.DO
|
@ -1,108 +0,0 @@
|
|||
*******
|
||||
* soon
|
||||
*
|
||||
* $Id: TO.DO,v 1.2 1997/08/08 05:09:51 gdr Exp $
|
||||
*
|
||||
*******
|
||||
|
||||
Use result of _setModeEmulation(3) in appropriate calls. These include
|
||||
chmod -
|
||||
fchmod -
|
||||
creat - done
|
||||
open - done
|
||||
stat - unnecessary
|
||||
fstat - unnecessary
|
||||
lstat - unnecessary
|
||||
|
||||
specifying 'chmod +x' (effectively) on a file of type TXT or SRC should
|
||||
change that file to be type SRC and auxtype EXEC.
|
||||
|
||||
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.
|
||||
|
||||
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)
|
||||
|
||||
Fix filename mapping code:
|
||||
|
||||
--- inclusion start
|
||||
> A#38: The first thing to watch for is known compiler and library bugs.
|
||||
> [...]
|
||||
> validity of pathnames
|
||||
> [...]
|
||||
> - use dynamic directory delimiters. The ':' character is
|
||||
> always considered to be a directory separator. The '/'
|
||||
> character is considered to be a directory separator unless
|
||||
> ':' is present, in which case it is part of the file name.
|
||||
> This is the closest to GS/OS, but also has some problems
|
||||
> with POSIX compliance. For example, the PATH environment
|
||||
> variable is _supposed_ to a list of pathnames delimited
|
||||
> by the ':' character.
|
||||
|
||||
GS/OS behaves a little differently than this paragraph describes. The
|
||||
first ':' or '/' encountered when scanning the pathname from left to
|
||||
right is assumed to be the separator. If a '/' occurs first, then any
|
||||
':'s appearing later are illegal. The paragraph suggests that the '/'
|
||||
will be considered part of the file name if a ':' appears later. (Your
|
||||
point about POSIX compliance is still valid, though.)
|
||||
|
||||
--- inclusion end
|
||||
|
||||
*******
|
||||
* defer
|
||||
*******
|
||||
|
||||
libc/sys/syscall.c:
|
||||
for unlink, if file is open, then register a call to unlink
|
||||
(non-recursive) the file via atexit(3)
|
||||
|
||||
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,10 +1,65 @@
|
|||
*******
|
||||
* soon
|
||||
*
|
||||
* $Id: TO.DO,v 1.2 1997/08/08 05:09:51 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 -
|
||||
|
@ -14,9 +69,6 @@ Use result of _setModeEmulation(3) in appropriate calls. These include
|
|||
fstat - unnecessary
|
||||
lstat - unnecessary
|
||||
|
||||
specifying 'chmod +x' (effectively) on a file of type TXT or SRC should
|
||||
change that file to be type SRC and auxtype EXEC.
|
||||
|
||||
check up on the type of nlink_t, used in stat(2)
|
||||
|
||||
Write a test that handles:
|
||||
|
@ -43,38 +95,35 @@ libc/sys/exec.c:
|
|||
are '#!', then the shell should be exec'd instead. (currently,
|
||||
shell scripts cannot be exec'd)
|
||||
|
||||
Fix filename mapping code:
|
||||
|
||||
--- inclusion start
|
||||
> A#38: The first thing to watch for is known compiler and library bugs.
|
||||
> [...]
|
||||
> validity of pathnames
|
||||
> [...]
|
||||
> - use dynamic directory delimiters. The ':' character is
|
||||
> always considered to be a directory separator. The '/'
|
||||
> character is considered to be a directory separator unless
|
||||
> ':' is present, in which case it is part of the file name.
|
||||
> This is the closest to GS/OS, but also has some problems
|
||||
> with POSIX compliance. For example, the PATH environment
|
||||
> variable is _supposed_ to a list of pathnames delimited
|
||||
> by the ':' character.
|
||||
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
|
||||
|
||||
GS/OS behaves a little differently than this paragraph describes. The
|
||||
first ':' or '/' encountered when scanning the pathname from left to
|
||||
right is assumed to be the separator. If a '/' occurs first, then any
|
||||
':'s appearing later are illegal. The paragraph suggests that the '/'
|
||||
will be considered part of the file name if a ':' appears later. (Your
|
||||
point about POSIX compliance is still valid, though.)
|
||||
|
||||
--- inclusion end
|
||||
|
||||
*******
|
||||
* defer
|
||||
*******
|
||||
|
||||
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)
|
||||
[not practical?]
|
||||
|
||||
libc/gen/environ.c:
|
||||
Review routines. Force them to use GSString routines, reduce
|
||||
|
@ -96,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
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
System calls new in v2.0.6
|
||||
==========================
|
||||
|
||||
select $4303
|
||||
InstallNetDriver $4403
|
||||
socket $4503
|
||||
bind $4603
|
||||
connect $4703
|
||||
listen $4703
|
||||
accept $4903
|
||||
recvfrom $4A03
|
||||
sendto $4B03
|
||||
recv $4C03
|
||||
send $4D03
|
||||
getpeername $4E03
|
||||
getsockname $4F03
|
||||
getsockopt $5003
|
||||
setsockopt $5103
|
||||
shutdown $5203
|
||||
setreuid $5303
|
||||
setregid $5403
|
595
NOTES/status.bin
595
NOTES/status.bin
|
@ -1,14 +1,42 @@
|
|||
Version: $Id: status.bin,v 1.2 1997/09/05 05:07:37 gdr Exp $
|
||||
*************************************************************************
|
||||
* *
|
||||
*** 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")
|
||||
-------------------------------------
|
||||
dave Dave Tribby
|
||||
dt Derek Taubert
|
||||
evan Evan Day
|
||||
gdr Devin Reade
|
||||
lb Leslie Barstow
|
||||
matt Matt Ackeret
|
||||
tl Tilghman Lesher
|
||||
%%%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
|
||||
----------
|
||||
|
@ -17,340 +45,379 @@ Program - Name of the program.
|
|||
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. "gen" means that it's generated by the
|
||||
installation scripts.
|
||||
a directory.
|
||||
Man - Is the documentation complete? This includes the man
|
||||
page, describe entry, rVersion fork, and any
|
||||
required auxillary documentation.
|
||||
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 'makerelease' and 'makeinstall' targets complete?
|
||||
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.
|
||||
|
||||
(Pkg) or Archive Install In
|
||||
Program [Note] 204 Req Owner Source Man Compile Test Target Target Archive
|
||||
---------------------------------------------------------------------------------------------------------------
|
||||
*/system Y Y - dir - - - - - -
|
||||
*/system/Desk.Accs Y Y - dir - - - - - -
|
||||
*/system/Desk.Accs/gnosnooper Y Y dt /gno.disk2/system.shk
|
||||
*/system/Desk.Accs/gsi Y Y /gno.disk2/system.shk
|
||||
*/system/Desk.Accs/suspda Y Y /gno.disk2/system.shk
|
||||
*/system/Drivers Y Y - dir - - - - - -
|
||||
*/system/Drivers/fileport Y Y dt prop /gno.disk2/system.shk
|
||||
*/system/Drivers/fileport.data Y Y dt prop /gno.disk2/system.shk
|
||||
*/system/Drivers/nullport Y Y dt prop /gno.disk2/system.shk
|
||||
*/system/System.Setup Y Y - dir - - - - - -
|
||||
*/system/System.Setup/sim Y Y dt prop /gno.disk2/system.shk
|
||||
/ Y gdr dir - - - - Y /gno.disk1/installbin
|
||||
/HFSinclude Y gdr dir - - - - Y /gno.disk1/installbin
|
||||
/bin Y Y gdr dir - - - - Y /gno.disk1/installbin
|
||||
/bin/aroff Y Y
|
||||
/bin/binprint Y
|
||||
/bin/cat Y Y dave
|
||||
/bin/center Y
|
||||
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
|
||||
/bin/cmp Y Y evan
|
||||
/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 dt
|
||||
/bin/conv Y # should be replaced by /usr/bin/udl
|
||||
/bin/cp Y Y
|
||||
/bin/csh
|
||||
/bin/date Y Y tl
|
||||
/bin/date Y Y mober Y # uploaded to mail distrib on trenco
|
||||
/bin/dd
|
||||
/bin/df Y evan
|
||||
/bin/df N Y evan Y T Y Y Y RI
|
||||
/bin/domainname
|
||||
/bin/du Y Y evan
|
||||
/bin/echo Y dt
|
||||
/bin/ed
|
||||
/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 Y gdr
|
||||
/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 prop
|
||||
/bin/head Y Y dave
|
||||
/bin/hostname Y dt
|
||||
/bin/info Y lb (rename to something else)
|
||||
/bin/kill Y
|
||||
/bin/less Y Y
|
||||
/bin/ln N
|
||||
/bin/ls Y Y
|
||||
/bin/make Y O
|
||||
/bin/makemake Y O
|
||||
/bin/mkdir Y Y dt
|
||||
/bin/more Y Y matt
|
||||
/bin/mv Y dt
|
||||
/bin/nroff Y Y gdr Y
|
||||
/bin/passwd Y Y
|
||||
/bin/pax N
|
||||
/bin/ps Y (replace functionality of /usr/bin/eps)
|
||||
/bin/purge Y Y
|
||||
/bin/pwd Y
|
||||
/bin/rcp Y dt
|
||||
/bin/rm Y dt
|
||||
/bin/rmail
|
||||
/bin/rmdir Y gdr Y
|
||||
/bin/sh Y gdr
|
||||
/bin/shutdown Y
|
||||
/bin/sleep Y Y
|
||||
/bin/split Y Y
|
||||
/bin/strings Y Y lb
|
||||
/bin/stty Y Y
|
||||
/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 Y
|
||||
/bin/tail Y Y dave
|
||||
/bin/tar Y Y
|
||||
/bin/tee Y Y gdr Y
|
||||
/bin/test Y gdr Y
|
||||
/bin/time Y Y
|
||||
/bin/touch Y Y dt
|
||||
/bin/tr Y Y dave
|
||||
/bin/true Y gdr
|
||||
/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/uniq Y Y
|
||||
/bin/upper Y
|
||||
/bin/vi Y Y
|
||||
/bin/wc Y Y dave
|
||||
/bin/who Y Y dt
|
||||
/dev Y Y gdr dir - - - - Y /gno.disk1/installbin
|
||||
/dev/modem Y Y dt prop Y /gno.disk2/dev.shk
|
||||
/dev/null Y dt prop Y /gno.disk2/dev.shk
|
||||
/dev/printer Y Y dt prop Y /gno.disk2/dev.shk
|
||||
/doc Y gdr dir - - - - Y /gno.disk1/installbin
|
||||
/etc Y Y gdr dir - - - - Y /gno.disk1/installbin
|
||||
/etc/cronlog (cron)
|
||||
/etc/crontab (cron)
|
||||
/etc/freeze.cnf (freeze)
|
||||
/etc/gettytab Y Y Y /gno.disk2/etc.shk
|
||||
/etc/group Y Y gdr Y - /gno.disk2/etc.shk
|
||||
/etc/inittab (initd) Y Y Y /gno.disk2/etc.shk
|
||||
/etc/motd Y Y gdr Y - - /gno.disk2/etc.shk
|
||||
/etc/namespace Y Y gdr gen Y /gno.disk1/installbin
|
||||
/etc/passwd Y Y gdr Y - /gno.disk2/etc.shk
|
||||
/etc/rchost (mu)
|
||||
/etc/syslog (syslog)
|
||||
/etc/termcap Y Y
|
||||
/etc/tmtermrc (tmterm)
|
||||
/etc/tty.config Y Y gdr Y - /gno.disk2/etc.shk
|
||||
/etc/ttys Y Y Y -
|
||||
/etc/utmp (mu)
|
||||
/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
|
||||
/initrc (single-user) Y Y gdr Y - /gno.disk1/initrc
|
||||
/installbin Y Y gdr - /gno.disk1/installbin
|
||||
/kern Y Y dt prop
|
||||
/lib Y Y gdr dir - - - - Y /gno.disk1/installbin
|
||||
/lib/lbsd Y N -
|
||||
/lib/lcrypt Y Y gdr Y
|
||||
/lib/libc Y Y gdr Y
|
||||
/lib/libcurses Y
|
||||
/lib/libgno Y N -
|
||||
/lib/libutil Y gdr Y
|
||||
/lib/lregexp Y Y
|
||||
/lib/lstring Y (replaced by libc?)
|
||||
/lib/ltermcap Y Y
|
||||
/lib/orcalib Y Y gdr
|
||||
/libexec/atrun
|
||||
/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 Y dt
|
||||
/libexec/ftpd N Y dt
|
||||
/libexec/rexecd
|
||||
/libexec/rlogind
|
||||
/libexec/rshd
|
||||
/libexec/talkd Y dt
|
||||
/libexec/talkd N Y dt
|
||||
/libexec/telnetd
|
||||
/libexec/uucpd
|
||||
/sbin/dump Y dt
|
||||
/sbin/dump N Y dt
|
||||
/sbin/dumpfs
|
||||
/sbin/fsck
|
||||
/sbin/init Y Y
|
||||
/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 Y gdr
|
||||
/sbin/renram5 N Y gdr Y T Y Y Y RI
|
||||
/startinst Y
|
||||
/usr Y Y gdr dir - - - - Y /gno.disk1/installbin
|
||||
/usr/bin Y Y gdr dir - - - - Y /gno.disk1/installbin
|
||||
/usr/bin/DAY Y
|
||||
/usr/bin/GOTHIC Y
|
||||
/usr/bin/SSCII Y
|
||||
/usr/bin/See Y
|
||||
/usr/bin/apply N
|
||||
/usr/bin/apropos (man) Y gdr Y
|
||||
/usr/bin/ar N
|
||||
/usr/bin/at
|
||||
/usr/bin/aw30 Y
|
||||
/usr/bin/awk Y
|
||||
/usr/bin/bang Y
|
||||
/usr/bin/banner Y
|
||||
/usr/bin/basename Y gdr
|
||||
/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
|
||||
/usr/bin/calendar
|
||||
/usr/bin/catrez Y
|
||||
/usr/bin/cclean Y gdr
|
||||
/usr/bin/cjpeg N (add on)
|
||||
/usr/bin/cksum Y
|
||||
/usr/bin/cmpl Y Y
|
||||
/usr/bin/coff Y
|
||||
/usr/bin/col
|
||||
/usr/bin/column
|
||||
/usr/bin/compile Y Y
|
||||
/usr/bin/copycat Y Y
|
||||
/usr/bin/cpp gdr
|
||||
/usr/bin/ctags Y dt
|
||||
/usr/bin/cut Y dave
|
||||
/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 Y gdr
|
||||
/usr/bin/dirname Y gdr
|
||||
/usr/bin/dmake Y gdr
|
||||
/usr/bin/env Y gdr
|
||||
/usr/bin/eps Y N (replace with updated /bin/ps)
|
||||
/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 gdr
|
||||
/usr/bin/find N . gdr # sr working on GS-specific implementation
|
||||
/usr/bin/finger
|
||||
/usr/bin/flex Y N
|
||||
/usr/bin/fmt Y gdr Y
|
||||
/usr/bin/fold Y
|
||||
/usr/bin/ftp Y dt
|
||||
/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
|
||||
/usr/bin/gunzip Y
|
||||
/usr/bin/gzip Y
|
||||
/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 -
|
||||
/usr/bin/help Y Y gdr Y T - Y Y RI
|
||||
/usr/bin/hexdump
|
||||
/usr/bin/install Y gdr Y
|
||||
/usr/bin/install N Y gdr Y T Y Y Y RI
|
||||
/usr/bin/join
|
||||
/usr/bin/last Y dt
|
||||
/usr/bin/launch Y Y
|
||||
/usr/bin/link Y
|
||||
/usr/bin/locate gdr
|
||||
/usr/bin/logger Y
|
||||
/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 (lpr) Y dt
|
||||
/usr/bin/lpr (lpr) Y Y dt
|
||||
/usr/bin/lprm (lpr) Y dt
|
||||
/usr/bin/lseg Y Y dave
|
||||
/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 gdr
|
||||
/usr/bin/man Y Y gdr Y
|
||||
/usr/bin/news Y N (waiting on NNTP/UUCP)
|
||||
/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 (formerly zsh) Y lb
|
||||
/usr/bin/patch Y gdr
|
||||
/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 Y gdr
|
||||
/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 Y dt
|
||||
/usr/bin/rot13 Y lb
|
||||
/usr/bin/rsh Y dt
|
||||
/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
|
||||
/usr/bin/sed
|
||||
/usr/bin/sendmail N (waiting on NNTP/UUCP)
|
||||
/usr/bin/setvers Y 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 gdr Y (supercedes msort/dsort)
|
||||
/usr/bin/sum Y Y
|
||||
/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 Y dt
|
||||
/usr/bin/telnet Y dt
|
||||
/usr/bin/talk N Y dt
|
||||
/usr/bin/telnet N Y dt
|
||||
/usr/bin/tftp
|
||||
/usr/bin/tset
|
||||
/usr/bin/tsort Y
|
||||
/usr/bin/tsort Y . . Y . . . Y
|
||||
/usr/bin/tty
|
||||
/usr/bin/uname
|
||||
/usr/bin/unshar Y Y
|
||||
/usr/bin/unzip Y
|
||||
/usr/bin/uptime Y Y
|
||||
/usr/bin/uudecode
|
||||
/usr/bin/uuencode
|
||||
/usr/bin/wall Y dt
|
||||
/usr/bin/whatis (man) Y gdr Y
|
||||
/usr/bin/whereis Y gdr Y
|
||||
/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/whois Y dt
|
||||
/usr/bin/write Y lb
|
||||
/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/yes Y
|
||||
/usr/bin/zsh Y lb (renamed to nosh)
|
||||
/usr/games Y Y gdr dir - - - - Y /gno.disk1/installbin
|
||||
/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 /gno.disk1/installbin
|
||||
/usr/lib Y Y gdr dir - - - - Y /gno.disk1/installbin
|
||||
/usr/lib/lflex Y
|
||||
/usr/lib/tmac Y gdr dir - - - - Y /gno.disk1/installbin
|
||||
/usr/lib/tmac/tmac.an (nroff) Y
|
||||
/usr/lib/tmac/tmac.s (nroff) Y
|
||||
/usr/orca/bin/describe (describe) Y gdr Y
|
||||
/usr/orca/bin/descc (describe) Y gdr Y
|
||||
/usr/orca/bin/descu (describe) Y gdr Y
|
||||
/usr/orca/bin/occ Y sonk
|
||||
/usr/orca/bin/rc Y sonk
|
||||
/usr/orca/bin/udl Y gdr Y
|
||||
/usr/man Y Y gdr dir - - - - Y /gno.disk1/installbin
|
||||
/usr/man/cat1 Y Y gdr dir - - - - Y /gno.disk1/installbin
|
||||
/usr/man/cat2 Y Y gdr dir - - - - Y /gno.disk1/installbin
|
||||
/usr/man/cat3 Y Y gdr dir - - - - Y /gno.disk1/installbin
|
||||
/usr/man/cat4 Y Y gdr dir - - - - Y /gno.disk1/installbin
|
||||
/usr/man/cat5 Y Y gdr dir - - - - Y /gno.disk1/installbin
|
||||
/usr/man/cat6 Y Y gdr dir - - - - Y /gno.disk1/installbin
|
||||
/usr/man/cat7 Y Y gdr dir - - - - Y /gno.disk1/installbin
|
||||
/usr/man/cat8 Y Y gdr dir - - - - Y /gno.disk1/installbin
|
||||
/usr/man/man1 Y Y gdr dir - - - - Y /gno.disk3/usr.man.shk
|
||||
/usr/man/man1/intro.1 Y Y gdr - Y /gno.disk3/usr.man.shk
|
||||
/usr/man/man2 Y Y gdr dir - - - - Y /gno.disk3/usr.man.shk
|
||||
/usr/man/man2/* [A] Y Y gdr - Y /gno.disk3/usr.man.shk
|
||||
/usr/man/man3 Y Y gdr dir - - - - Y /gno.disk3/usr.man.shk
|
||||
/usr/man/man3/* [A] Y Y gdr - Y /gno.disk3/usr.man.shk
|
||||
/usr/man/man4 Y Y gdr dir - - - - Y /gno.disk3/usr.man.shk
|
||||
/usr/man/man4/* [A] Y Y gdr - Y /gno.disk3/usr.man.shk
|
||||
/usr/man/man5 Y Y gdr dir - - - - Y /gno.disk3/usr.man.shk
|
||||
/usr/man/man5/* [A] Y Y gdr - Y /gno.disk3/usr.man.shk
|
||||
/usr/man/man6 Y Y gdr dir - - - - Y /gno.disk3/usr.man.shk
|
||||
/usr/man/man6/intro.6 Y Y gdr - Y /gno.disk3/usr.man.shk
|
||||
/usr/man/man7 Y Y gdr dir - - - - Y /gno.disk3/usr.man.shk
|
||||
/usr/man/man7/* [A] Y Y gdr - Y /gno.disk3/usr.man.shk
|
||||
/usr/man/man8 Y Y gdr dir - - - - Y /gno.disk3/usr.man.shk
|
||||
/usr/man/man8/intro.8 Y Y gdr - Y /gno.disk3/usr.man.shk
|
||||
/usr/sbin Y Y gdr dir - - - - Y /gno.disk3/usr.man.shk
|
||||
/usr/sbin/catman (man) Y gdr Y
|
||||
/usr/sbin/cron Y Y
|
||||
/usr/sbin/getty Y Y
|
||||
/usr/sbin/inetd Y dt
|
||||
/usr/sbin/initd Y
|
||||
/usr/sbin/login Y Y dt
|
||||
/usr/sbin/lpc (lpr) Y dt
|
||||
/usr/sbin/lpd (lpr) Y Y dt
|
||||
/usr/sbin/lptest (lpr) Y dt
|
||||
/usr/sbin/makewhatis (man) Y gdr 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/nogetty Y
|
||||
/usr/sbin/runover 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 - - - - - /gno.disk1/installbin
|
||||
/var/adm Y gdr dir - - - - Y /gno.disk1/installbin
|
||||
/var/spool Y gdr dir - - - - Y /gno.disk1/installbin
|
||||
/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) See the status.man for a complete list of
|
||||
these files.
|
||||
|
||||
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
|
||||
|
|
411
NOTES/status.lib
411
NOTES/status.lib
|
@ -1,4 +1,4 @@
|
|||
$Id: status.lib,v 1.2 1997/08/08 05:06:45 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,20 +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
|
||||
|
@ -111,20 +141,45 @@ 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
|
||||
|
@ -135,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
|
||||
|
@ -145,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
|
||||
|
@ -152,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
|
||||
|
@ -168,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
|
||||
|
@ -176,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
|
||||
|
@ -194,30 +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
|
||||
|
@ -227,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
|
||||
|
@ -240,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
|
||||
|
@ -262,30 +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
|
||||
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.asm C 3 sys/syslog.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
|
||||
|
@ -295,114 +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.
|
||||
|
||||
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/psignal.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 N libc/gen/siglist.c
|
||||
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 Y libc/stdio/fdopen.c
|
||||
0 0 0 Y N libc/stdio/fgetln.c
|
||||
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
|
||||
ms 7
|
||||
man 7
|
||||
cron 8
|
||||
runover 8 (obsolete?)
|
||||
dialup 8
|
||||
|
||||
PUT IN NEXT RELEASE
|
||||
-------------------
|
||||
fcntl (sys/fcntl.h)
|
||||
|
||||
|
||||
The following have their macro version in ctype.h (except isblank()),
|
||||
but should have library versions as well:
|
||||
|
||||
isalnum
|
||||
isalpha
|
||||
isascii
|
||||
isblank
|
||||
iscntrl
|
||||
iscsym
|
||||
iscsymf
|
||||
isdigit
|
||||
isgraph
|
||||
islower
|
||||
isodigit
|
||||
isprint
|
||||
ispunct
|
||||
isspace
|
||||
isupper
|
||||
isxdigit
|
||||
These are unimplemented kernel traps.
|
||||
|
||||
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
|
|
@ -2,8 +2,11 @@
|
|||
# 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
|
||||
PROG= cat
|
||||
|
||||
.INCLUDE : <gno.prog.mk>
|
||||
.INCLUDE : /src/gno/prog.mk
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)cat.1 8.3 (Berkeley) 5/2/95
|
||||
.\" $Id: cat.1,v 1.1 1997/09/17 05:29:24 gdr Exp $
|
||||
.\" $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
|
||||
|
@ -102,6 +102,10 @@ 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.
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: cat.c,v 1.1 1997/09/17 05:29:24 gdr Exp $
|
||||
* $Id: cat.c,v 1.3 1997/10/03 03:59:41 gdr Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -85,14 +85,12 @@ void raw_cat __P((int));
|
|||
|
||||
/* Interface to check on how much stack space a C program uses. */
|
||||
#if defined(__GNO__) && defined(__STACK_CHECK__)
|
||||
#ifndef _STDLIB_H_
|
||||
#include <stdlib.h>
|
||||
#ifndef _GNO_GNO_H_
|
||||
#include <gno/gno.h>
|
||||
#endif
|
||||
extern void begin_stack_check(void);
|
||||
extern int end_stack_check(void);
|
||||
static void report_stack(void)
|
||||
{
|
||||
fprintf(stderr,"\n ==> %d stack bytes used <== \n", end_stack_check());
|
||||
fprintf(stderr,"\n ==> %d stack bytes used <== \n", _endStackCheck());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -111,7 +109,7 @@ main(int argc,
|
|||
int ch;
|
||||
|
||||
#if defined(__GNO__) && defined(__STACK_CHECK__)
|
||||
begin_stack_check();
|
||||
_beginStackCheck();
|
||||
atexit(report_stack);
|
||||
#endif
|
||||
#ifndef __GNO__
|
||||
|
|
|
@ -3,7 +3,7 @@ Version: 2.0 (August 1997)
|
|||
Shell: GNO
|
||||
Author: Dave Tribby (from FreeBSD code)
|
||||
Contact: tribby@cup.hp.com
|
||||
Where: /bin/cat
|
||||
FTP: ground.isca.uiowa.edu apple2.caltech.edu trenco.myrias.com
|
||||
Where: /bin
|
||||
FTP: ground.icaen.uiowa.edu apple2.caltech.edu ftp.gno.org
|
||||
|
||||
Concatenate and list files.
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
# 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"
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
# gsh script to run tests and collect results
|
||||
# Written by Dave Tribby * August 1997
|
||||
|
||||
# Name of gsh script containing test cases
|
||||
set command="dotests"
|
||||
# Sometimes the file type is modified by editing; make it executable
|
||||
chtyp -l exec $command
|
||||
|
||||
# Filenames for raw and modified results
|
||||
set raw_file="/tmp/rawlist"
|
||||
set result_file="test.list"
|
||||
|
||||
# Location of tr command that knows how to handle classes
|
||||
set trcmd="/src/usr.bin/tr/tr"
|
||||
|
||||
# --- Begin the tests ---
|
||||
|
||||
echo -n "Executing test script \"$command\" from directory "
|
||||
pwd
|
||||
|
||||
# Create a new gsh invocation and record all I/O
|
||||
echo "$command ; exit" | script $raw_file
|
||||
|
||||
# Cleanup control chars using either of the following...
|
||||
echo "Done with tests. Removing control characters from results file"
|
||||
$trcmd -c -ds '[:print:]\r' '\r' < $raw_file > $result_file
|
||||
|
||||
echo "Tests results have been saved as \"$result_file\""
|
|
@ -1,89 +0,0 @@
|
|||
Script started on: Mon Sep 01 15:01:21 1997
|
||||
[61] test=> dotests ; exit
|
||||
Testing command ../cat beginning at Mon Sep 1 15:01:31 1997
|
||||
Copying a single text file (file1.mixed) using filename input
|
||||
==> 474 stack bytes used <==
|
||||
Completion status = 0
|
||||
Checking results against control file file1.mixed (no differences expected)
|
||||
Completion status = 0
|
||||
|
||||
Copying a single text file (file1.mixed) using stdin
|
||||
==> 474 stack bytes used <==
|
||||
Completion status = 0
|
||||
Checking results against control file file1.mixed (no differences expected)
|
||||
Completion status = 0
|
||||
|
||||
Display a single text file (file1.mixed) with -b option
|
||||
==> 820 stack bytes used <==
|
||||
Completion status = 0
|
||||
Checking results against control file file1.bopt (no differences expected)
|
||||
Completion status = 0
|
||||
|
||||
Display a single text file (file1.mixed) with -n option
|
||||
==> 820 stack bytes used <==
|
||||
Completion status = 0
|
||||
Checking results against control file file1.nopt (no differences expected)
|
||||
Completion status = 0
|
||||
|
||||
Display a single text file (file1.mixed) with -t option
|
||||
==> 596 stack bytes used <==
|
||||
Completion status = 0
|
||||
Checking results against control file file1.topt (no differences expected)
|
||||
Completion status = 0
|
||||
|
||||
Display a single text file (file1.mixed) with -e option
|
||||
==> 596 stack bytes used <==
|
||||
Completion status = 0
|
||||
Checking results against control file file1.eopt (no differences expected)
|
||||
Completion status = 0
|
||||
|
||||
Combine two files (file1.mixed, file1.nopt) with stdin in the middle
|
||||
==> 474 stack bytes used <==
|
||||
Completion status = 0
|
||||
Checking results against control file file1.combo (no differences expected)
|
||||
Completion status = 0
|
||||
|
||||
Copying a single binary file (file2.bin1) using filename input
|
||||
==> 474 stack bytes used <==
|
||||
Completion status = 0
|
||||
Checking results against control file file2.bin1 (no differences expected)
|
||||
Completion status = 0
|
||||
|
||||
Copying a single binary file (file2.bin1) using stdin
|
||||
==> 474 stack bytes used <==
|
||||
Completion status = 0
|
||||
Checking results against control file file2.bin1 (no differences expected)
|
||||
Completion status = 0
|
||||
|
||||
Display a single binary file (file2.bin1) with -v option
|
||||
==> 596 stack bytes used <==
|
||||
Completion status = 0
|
||||
Checking results against control file file2.vopt (no differences expected)
|
||||
Completion status = 0
|
||||
|
||||
Display a single binary file (file2.bin1) with -t option
|
||||
==> 596 stack bytes used <==
|
||||
Completion status = 0
|
||||
Checking results against control file file2.topt (no differences expected)
|
||||
Completion status = 0
|
||||
|
||||
Copying a single binary file (../cat) through a pipe
|
||||
==> 373 stack bytes used <==
|
||||
==> 474 stack bytes used <==
|
||||
Completion status = 0
|
||||
Checking results against control file ../cat (no differences expected)
|
||||
Completion status = 0
|
||||
|
||||
***** Error Messages *****
|
||||
|
||||
Expected error: illegal option
|
||||
cat: illegal option -- x
|
||||
usage: cat [-benstuv] [-] [file ...]
|
||||
==> 1819 stack bytes used <==
|
||||
Error completion status = 1 (expected: 1)
|
||||
|
||||
Expected error: badname: no such file or directory
|
||||
cat: badname: no such file or directory
|
||||
==> 1853 stack bytes used <==
|
||||
Error completion status = 1 (expected: 1)
|
||||
Script done on: Mon Sep 01 15:03:02 1997
|
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
|
92
bin/gsh/M/stdio.mac
Normal file
92
bin/gsh/M/stdio.mac
Normal file
|
@ -0,0 +1,92 @@
|
|||
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 Write &a1
|
||||
&lab gsos $2013,&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 lock &a1
|
||||
&lab lda #1
|
||||
tsb &a1
|
||||
beq *+6
|
||||
cop $7F
|
||||
bra *-7
|
||||
MEND
|
||||
MACRO
|
||||
&lab key
|
||||
&lab dc i2'0'
|
||||
MEND
|
||||
macro
|
||||
&lab Read &a1
|
||||
&lab gsos $2012,&a1
|
||||
mend
|
||||
macro
|
||||
&lab Flush &a1
|
||||
&lab gsos $2015,&a1
|
||||
mend
|
355
bin/gsh/M/sv.mac
Normal file
355
bin/gsh/M/sv.mac
Normal file
|
@ -0,0 +1,355 @@
|
|||
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 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 sub4 &arg1,&arg2,&dest
|
||||
&lab anop
|
||||
lclc &ch
|
||||
&ch amid &arg2,1,1
|
||||
sec
|
||||
lda &arg1
|
||||
sbc &arg2
|
||||
sta &dest
|
||||
lda &arg1+2
|
||||
aif "&ch"="#",.a
|
||||
sbc &arg2+2
|
||||
ago .b
|
||||
.a
|
||||
sbc &arg2|-16
|
||||
.b
|
||||
sta &dest+2
|
||||
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 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 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 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 jmi &loc
|
||||
&lab bpl *+5
|
||||
jmp &loc
|
||||
mend
|
||||
MACRO
|
||||
&lab tool &a1
|
||||
&lab ldx #&a1
|
||||
jsl $e10000
|
||||
mend
|
||||
MACRO
|
||||
&lab jcc &loc
|
||||
&lab bcs *+5
|
||||
jmp &loc
|
||||
mend
|
264
bin/gsh/M/term.mac
Normal file
264
bin/gsh/M/term.mac
Normal file
|
@ -0,0 +1,264 @@
|
|||
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 tputs &a1
|
||||
&lab ph4 &a1(3)
|
||||
ph2 &a1(2)
|
||||
ph4 &a1(1)
|
||||
case on
|
||||
jsl tputs
|
||||
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 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 Str &string
|
||||
&lab dc i1'L:&string'
|
||||
dc c"&string"
|
||||
mend
|
||||
macro
|
||||
&lab Set_Variable &a1
|
||||
&lab p16 $106,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab p16 &a1,&a2
|
||||
&lab jsl $E100A8
|
||||
dc i2'&a1'
|
||||
dc i4'&a2'
|
||||
mend
|
||||
macro
|
||||
&lab EXPORT &a1
|
||||
&lab p16 $116,&a1
|
||||
mend
|
||||
MACRO
|
||||
&lab ioctl &a1
|
||||
&lab ph4 &a1(3)
|
||||
ph4 &a1(2)
|
||||
ph2 &a1(1)
|
||||
case on
|
||||
jsl ioctl
|
||||
case off
|
||||
MEND
|
151
bin/gsh/Makefile
Normal file
151
bin/gsh/Makefile
Normal file
|
@ -0,0 +1,151 @@
|
|||
#
|
||||
# makefile for building gsh. This is for use with dmake.
|
||||
#
|
||||
# $Id: Makefile,v 1.9 1999/01/15 06:50:35 gdr-ftp Exp $
|
||||
#
|
||||
# Devin Reade, February 1998.
|
||||
#
|
||||
|
||||
PROG = gsh
|
||||
MAIN = main
|
||||
MAINSRC = main.asm
|
||||
SRCS = $(MAINSRC) \
|
||||
shell.asm \
|
||||
history.asm \
|
||||
prompt.asm \
|
||||
cmd.asm \
|
||||
expand.asm \
|
||||
invoke.asm \
|
||||
shellutil.asm \
|
||||
builtin.asm \
|
||||
hash.asm \
|
||||
alias.asm \
|
||||
dir.asm \
|
||||
shellvar.asm \
|
||||
jobs.asm \
|
||||
sv.asm \
|
||||
stdio.asm \
|
||||
orca.asm \
|
||||
edit.asm \
|
||||
term.asm \
|
||||
bufpool.asm \
|
||||
mmdebug.asm
|
||||
|
||||
# Note: STACK variable does not control size of stack/direct-page segment
|
||||
# since this is assembly language. Edit stack segment in main.asm
|
||||
# to change this size.
|
||||
|
||||
# This is a problem. gsh was written to use the old termcap library.
|
||||
# Not only do we no longer build this library, but we don't even have the
|
||||
# sources for it. This needs to be changed. For the moment, use the
|
||||
# ltermcap library from GNO v2.0.4.
|
||||
#
|
||||
# LDADD = -ltermcap
|
||||
LDLIBS += -l/usr/lib/libtermcap.204
|
||||
|
||||
# For debugging: produce a link map
|
||||
## LDFLAGS += -M
|
||||
|
||||
# Make sure our macro files get built before trying to assemble source files.
|
||||
# LOCAL_SETUP = macros
|
||||
|
||||
CUSTOM_RELEASE = TRUE
|
||||
|
||||
.INCLUDE : /src/gno/prog.mk
|
||||
|
||||
# We give a custom implicit rule for *.o files so that we don't get
|
||||
# duplicate "dummy" symbols in the link step.
|
||||
%.o: %.asm
|
||||
$(AS) -o $@ $(ASFLAGS) $(__OFLAG) $<
|
||||
-$(RM) -f $(OBJ_DIR)$*.root
|
||||
|
||||
LOCAL_MACRO_SRC = gsh.mac
|
||||
MACRO_SRC = \
|
||||
$(LOCAL_MACRO_SRC)
|
||||
|
||||
# Everything should be in gsh.mac. If useful, the following could be added
|
||||
# /usr/ainclude/m16.gno \
|
||||
# $(ORCA_DIST)/libraries/orcainclude/m16.orca \
|
||||
# $(ORCA_DIST)/libraries/orcainclude/m16.gs.os \
|
||||
# $(ORCA_DIST)/libraries/orcainclude/m16.tools \
|
||||
# $(ORCA_DIST)/libraries/orcainclude/m16.shell \
|
||||
# $(ORCA_DIST)/libraries/ainclude/m16.pascal \
|
||||
# $(ORCA_DIST)/libraries/ainclude/m16.debug
|
||||
|
||||
MACROS = \
|
||||
$(OBJ_DIR)main.mac \
|
||||
$(OBJ_DIR)alias.mac \
|
||||
$(OBJ_DIR)bufpool.mac \
|
||||
$(OBJ_DIR)builtin.mac \
|
||||
$(OBJ_DIR)cmd.mac \
|
||||
$(OBJ_DIR)dir.mac \
|
||||
$(OBJ_DIR)edit.mac \
|
||||
$(OBJ_DIR)expand.mac \
|
||||
$(OBJ_DIR)hash.mac \
|
||||
$(OBJ_DIR)history.mac \
|
||||
$(OBJ_DIR)invoke.mac \
|
||||
$(OBJ_DIR)jobs.mac \
|
||||
$(OBJ_DIR)mmdebug.mac \
|
||||
$(OBJ_DIR)orca.mac \
|
||||
$(OBJ_DIR)prompt.mac \
|
||||
$(OBJ_DIR)shell.mac \
|
||||
$(OBJ_DIR)shellutil.mac \
|
||||
$(OBJ_DIR)shellvar.mac \
|
||||
$(OBJ_DIR)stdio.mac \
|
||||
$(OBJ_DIR)sv.mac \
|
||||
$(OBJ_DIR)term.mac
|
||||
|
||||
MANPAGES_1 = \
|
||||
man/alias.1 \
|
||||
man/cd.1 \
|
||||
man/clear.1 \
|
||||
man/exit.1 \
|
||||
man/gsh.1
|
||||
|
||||
macros: $(MACROS)
|
||||
|
||||
$(OBJ_DIR)%.mac: %.asm
|
||||
@echo making $@
|
||||
@$(MACGEN) $(MACGEN_FLAGS) $*.asm $@ $(MACRO_SRC)
|
||||
|
||||
$(MACROS): $(LOCAL_MACRO_SRC)
|
||||
|
||||
$(OBJ_DIR)alias.mac: $(MACRO_SRC)
|
||||
$(MACGEN) $(MACGEN_FLAGS) alias.asm $@ $(MACRO_SRC)
|
||||
|
||||
# Place files where they will subsequently be archived in a binary
|
||||
# distribution.
|
||||
release: $(OBJ_DIR)$(PROG) $(MANPAGES_1) $(DESC)
|
||||
$(INSTALL) -d $(RELBIN) $(RELMAN)/man1 $(DESC_DIR)
|
||||
$(INSTALL) $(OBJ_DIR)$(PROG) $(RELBIN)
|
||||
$(INSTALL) $(MANPAGES_1) $(RELMAN)/man1
|
||||
$(DESCU) -o $(DESC_SRC) $(DESC_SRC) $(DESC)
|
||||
|
||||
# Install files into a live system. This doesn't update the describe
|
||||
# database.
|
||||
install: $(OBJ_DIR)$(PROG) $(MANPAGES_1)
|
||||
$(INSTALL) -d $(BINDIR) $(MANDIR)/man1
|
||||
$(INSTALL) $(OBJ_DIR)$(PROG) $(BINDIR)
|
||||
$(INSTALL) $(MANPAGES_1) $(MANDIR)/man1
|
||||
|
||||
$(ODIR)alias.o: $(OBJ_DIR)alias.mac
|
||||
$(ODIR)bufpool.o: $(OBJ_DIR)bufpool.mac
|
||||
$(ODIR)builtin.o: $(OBJ_DIR)builtin.mac
|
||||
$(ODIR)cmd.o: $(OBJ_DIR)cmd.mac
|
||||
$(ODIR)dir.o: $(OBJ_DIR)dir.mac
|
||||
$(ODIR)edit.o: $(OBJ_DIR)edit.mac
|
||||
$(ODIR)expand.o: $(OBJ_DIR)expand.mac
|
||||
$(ODIR)hash.o: $(OBJ_DIR)hash.mac
|
||||
$(ODIR)history.o: $(OBJ_DIR)history.mac
|
||||
$(ODIR)invoke.o: $(OBJ_DIR)invoke.mac
|
||||
$(ODIR)jobs.o: $(OBJ_DIR)jobs.mac
|
||||
$(ODIR)main.o: $(OBJ_DIR)main.mac
|
||||
$(ODIR)mmdebug.o: $(OBJ_DIR)mmdebug.mac
|
||||
$(ODIR)orca.o: $(OBJ_DIR)orca.mac
|
||||
$(ODIR)prompt.o: $(OBJ_DIR)prompt.mac
|
||||
$(ODIR)shell.o: $(OBJ_DIR)shell.mac
|
||||
$(ODIR)shellutil.o: $(OBJ_DIR)shellutil.mac
|
||||
$(ODIR)shellvar.o: $(OBJ_DIR)shellvar.mac
|
||||
$(ODIR)stdio.o: $(OBJ_DIR)stdio.mac
|
||||
$(ODIR)sv.o: $(OBJ_DIR)sv.mac
|
||||
$(ODIR)term.o: $(OBJ_DIR)term.mac
|
56
bin/gsh/To.Do
Normal file
56
bin/gsh/To.Do
Normal file
|
@ -0,0 +1,56 @@
|
|||
Last updated: Nov. 26, 1999 By: Dave Tribby
|
||||
|
||||
For more bug reports, see http://www.gno.org/~gno/bugs.html
|
||||
|
||||
Completed items are reported in file UpdateLog.
|
||||
|
||||
|
||||
Determine why gsh gets SIGTTIN (background read attempted signal) when
|
||||
it executes a very quickly executing child program. Currently gsh
|
||||
quits in order to avoid waiting forever, but that may not always be a
|
||||
good strategy.
|
||||
|
||||
Rather than have each built-in command always be either forked or
|
||||
non-forked, check dynamically and only fork when it's really necessary
|
||||
(background or piped). Something like this:
|
||||
If process is in background (&) or piped (|), then fork.
|
||||
Otherwise: if redirecting I/O, then
|
||||
copy file descriptor(s)
|
||||
open new stdin, stdout, and/or stderr
|
||||
Execute process.
|
||||
If I/O was redirected, then
|
||||
close redirected file(s)
|
||||
reconnect stdin, stdout, and/or stderr
|
||||
Note: routine "command" sets srcfile and dstfile.
|
||||
|
||||
Identify limits built into gsh and how they can be changed; for example,
|
||||
command line cannot expand to > 1024 characters.
|
||||
|
||||
When a background process finishes and there's text in the input buffer,
|
||||
the next keypress correctly reprints the edit line but the key itself does
|
||||
not get put in the buffer.
|
||||
|
||||
Gsh requires the v2.0.4 ltermcap to link. A new version of the termcap
|
||||
library is proposed for GNO v2.0.6, and gsh may require updates.
|
||||
|
||||
job control monitor for defunct processes when waiting.
|
||||
|
||||
job control needs to save tty information.
|
||||
|
||||
Allow ~user construct (call routines to get user's home directory)
|
||||
|
||||
recursive aliases.
|
||||
|
||||
In expandvars (expand.asm):
|
||||
Add error checking if out buf gets too big (> 1024)
|
||||
Get rid of fixed buffers
|
||||
|
||||
[ -- below this line...probably never will be done -- ]
|
||||
|
||||
write new memory management.
|
||||
|
||||
coolish handling of setdebug by editor.
|
||||
|
||||
echo should use octal and hex \12 is dec, \012 is octal, \x12 is hex.
|
||||
|
||||
write history expansion.
|
666
bin/gsh/UpdateLog
Normal file
666
bin/gsh/UpdateLog
Normal file
|
@ -0,0 +1,666 @@
|
|||
GSH 2.0 UPDATES
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
Nov 26 99 [dmt] Cleanup tests directory and update its Makefile.
|
||||
|
||||
Nov 22 99 [dmt] Add environment variable flags $ECHOX and $KEEPQUOTE
|
||||
that modify the behavior of gsh. [shellvar.asm, cmd.asm]
|
||||
If set, $ECHOX causes gsh to echo a single expanded command.
|
||||
(In previous versions of gsh 2.0, this was temporary code
|
||||
that was executed whenever $ECHO was set.)
|
||||
If set, $KEEPQUOTE tells gsh to use the user's original
|
||||
single and double quotes, rather than removing them and
|
||||
adding double quotes as needed. This resolves PR#50 and,
|
||||
if a child program re-parses its parameters, also resolves
|
||||
PR#34 (gsh messes up nested quotes).
|
||||
|
||||
Nov 18 99 [dmt] Fix PR#123: command line parsing ended if a ";"
|
||||
delimited a null command (echo "Test 1" ; ; echo "Test2"
|
||||
would only echo the first string). Modified cmd.asm
|
||||
|
||||
Sep 6 99 [dmt] Add comments to ioctl calls in edit.asm.
|
||||
|
||||
Sep 1 99 [dmt] Added signal handler for SIGTTIN (signal #21, background
|
||||
read attempted from control terminal) that prints a message
|
||||
and quits the shell. This was needed because gsh will sometimes
|
||||
receive such a signal, go into the "suspended" state, and never
|
||||
return to "running" state.
|
||||
|
||||
Feb 11 99 [dmt] Changes to this point checked-in to master archive.
|
||||
Released as version 2.0d10 (displays as 2.0d?)
|
||||
|
||||
Feb 2 99 [dmt] Changed maxline_size from 1024 to 4096.
|
||||
Recode copy loop in expandalias to be more efficient.
|
||||
|
||||
Feb 1 99 [dmt] Change names of alloc1024 and free1024 to allocmaxline
|
||||
and freemaxline (many .asm files) in anticipation of changing
|
||||
the maximum line size from 1024. Reviewed all uses of 1024
|
||||
constants, and changed appropriately to use new bufpool.asm
|
||||
location maxline_size.
|
||||
While reviewing 1024 constants, determined that shell.asm was
|
||||
using "buffer" for reads with max len of 1024, when it really
|
||||
had a size of 256. Changed "buffer" to "cmdline" and "1024"
|
||||
to "cmdbuflen". Removed definitions of buffer and wordbuf
|
||||
(each ds 256) from global data area, since they were unused.
|
||||
|
||||
Jan 30 99 [dmt] Add check for output buffer overflow when globbing, and
|
||||
print error message (PR#110). Code restructured to use
|
||||
base address and offset, so that offset could easily be checked
|
||||
against limit. Also moved allocation/deallocation of two buffers
|
||||
outside a loop. (expand.asm)
|
||||
Add check for overflow when expanding variables (expand.asm)
|
||||
and allow command processor to recognize error (cmd.asm).
|
||||
Modify alias expansion not to treat "." as escaped character,
|
||||
to truly eat leading blanks (per comments), and to check for
|
||||
buffer overflow (alias.cmd). (Also tightened up the code.)
|
||||
|
||||
Jan 13 99 [dmt] Changes to this point checked-in to master archive.
|
||||
Released as version 2.0d9
|
||||
|
||||
Jan 12 99 [dmt] Add debug routine DB~CHKBNK, which causes BRK B0 if
|
||||
program bank is not the same as data bank (mmdebug.asm).
|
||||
Modify lock and unlock macros to call DB~CHKBNK (gsh.mac).
|
||||
Needed to change branch instructions to jump macros in several
|
||||
files because the code got larger.
|
||||
|
||||
Jan 11 99 [dmt] Lock/unlock hashmutex in dispose_hash (hash.asm).
|
||||
|
||||
Jan 3 99 [dmt] Allow five digits rather than four when printing process
|
||||
id number in the ps command (builtin.asm).
|
||||
|
||||
Jan 1 99 [dmt] Piping the output of a command to a non-executable
|
||||
file caused gsh to hang. Instead of going directly to done
|
||||
after printing "Not executable" error message, go to chkpipe
|
||||
in invoke.asm.
|
||||
|
||||
Dec 31 98 [dmt] Changes to this point checked-in to master archive.
|
||||
Released as version 2.0d8
|
||||
|
||||
Dec 30 98 [dmt] Added mutual exclusion to ~NEW and ~DISPOSE macros. Lack
|
||||
of mutex could cause one fork to modify a memory table while
|
||||
another fork was searching it, leaving one or both processes
|
||||
in an infinite loop. This caused some recoding in nullfree
|
||||
(shellutil.mac), since we have to unlock the mutex after
|
||||
calling ~DISPOSE but before returning to the caller.
|
||||
|
||||
Dec 29 98 [dmt] For some sizes of the hash table, the hash command
|
||||
would sometimes print an entry more than once. Made 2 changes
|
||||
to sv_colprint (in sv.asm): 1) Ensure the number of columns is
|
||||
never > number of entries. This is only a problem when there are
|
||||
fewer than 6 files hashed. 2) Never look beyond the number of
|
||||
entries stored in offtbl. Results could be affected by the
|
||||
previous call to sv_colprint.
|
||||
|
||||
Dec 28 98 [dmt] Review code for mutual exclusion requirements.
|
||||
= Change jsl to builtin subroutine near "foundit" in builtin.asm
|
||||
into stack setup followed by rts, so that mutex is not required
|
||||
to protect the setup and execution of the invocation.
|
||||
= Add AliasMutex to protect data used by alias and unalias
|
||||
commands (alias.asm)
|
||||
= Remove pwdmutex from pwd command (builtin.asm).
|
||||
= Remove mutex from dotods routine (dir.asm).
|
||||
= Add DirMutex (for DirData) to dirs, pushd, and popd commands
|
||||
(dir.asm).
|
||||
= Add offtblmutex to sv_colprint routine (sv.asm).
|
||||
= Change ErrorGS and SetGS calls so that parameter blocks are
|
||||
on the stack for ShellExec (cmd.asm).
|
||||
= Add lock/unlock of hashmutex to search routine so that the
|
||||
hash function is protected. (hash.asm)
|
||||
|
||||
Dec 27 98 [dmt] Running a process in the background from inside a
|
||||
script (not 'source', but executing the script as a command)
|
||||
caused the script to wait for that background process to end.
|
||||
Caused the script to run without waiting by checking for
|
||||
background processing near beginning of "infork" (invoke.asm).
|
||||
Because the parent process is the script, not gsh, when control
|
||||
returns to gsh the script has terminated and the parent process
|
||||
ID is 1 (null process). gsh cannot use its normal job control
|
||||
commands, except "kill <pid>" (not "kill %<job>") works.
|
||||
|
||||
Dec 26 98 [dmt] Make gsh globbing work more like csh: if none of the
|
||||
requested patterns are found, print "No match" and exit.
|
||||
|
||||
Dec 23 98 [dmt] At startup, if /etc/glogin, $HOME/glogin, or $HOME/gshrc
|
||||
does not exist, skip "file not found" error message. (PR#100)
|
||||
|
||||
Dec 21 98 [dmt] Changes to this point checked-in to master archive.
|
||||
Released as version 2.0d7
|
||||
|
||||
Dec 20 98 [dmt] For calls to system(), if input pointer is null or
|
||||
lower level routines detect an error, return -1. This change
|
||||
caused change to internal routine execute(): return -1 rather
|
||||
than 0 when an error is detected.
|
||||
Detect when non-forked builtin or directory name as command
|
||||
is combined with piped I/O, and ensure that situation is
|
||||
properly cleaned up. (Formerly, "clear | cat > /tmp/list"
|
||||
would cause a nasty crash.)
|
||||
|
||||
Dec 18 98 [dmt] In execute() (cmd.asm), when child process isn't active
|
||||
and has no entry in the pid list, assume that pchild() has
|
||||
already set $status rather than forcing $status to 0.
|
||||
|
||||
Dec 17 98 [dmt] argv and argc parameters were reversed in PrintHistory().
|
||||
This didn't make a difference until argc was checked for != 0.
|
||||
|
||||
Dec 16 98 [dmt] Added waitstatus address parameters to command() and
|
||||
invoke() so completion status can be reported from unforked
|
||||
builtin commands. Added code in execute() to set status
|
||||
reported from unforked builtin commands.
|
||||
Reviewed all built-in commands to ensure they report 0 for
|
||||
no error and 1 for error.
|
||||
Fixed memory corruption error when edit command had no
|
||||
parameters (it called free1024 with random address).
|
||||
Added usage strings for tset, hash, commands, and history.
|
||||
|
||||
Dec 13 98 [dmt] Resolved (or at least closed the window of opportunity
|
||||
on) defects reported in Oct. 6 and 10 entries. When a process
|
||||
terminated quickly [kill(pid,0) returned -1], that child's
|
||||
termination could interfere with detecting the next child's
|
||||
termination. Solution: Modify removejentry() (jobs.asm) to
|
||||
return 1 if entry is in list (indicating we expected status
|
||||
from it) and 0 if it isn't. Modify execute (cmd.asm) to get
|
||||
status via wait() if and only if removejobentry() returns 1.
|
||||
Previously, the following exec file often resulted in a hang:
|
||||
# Create exec file
|
||||
set tmpcmd=/tmp/testcmds
|
||||
echo "echo Sourcing $tmpcmd" > $tmpcmd
|
||||
echo "/bin/ps -l" >> $tmpcmd
|
||||
chtyp -l exec $tmpcmd
|
||||
# Source that file; usually doesn't return
|
||||
source $tmpcmd
|
||||
|
||||
Dec 5 98 [dmt] If either glogin file rehashed (for login shells only),
|
||||
that hash table's memory pointer was overwritten but not
|
||||
deallocated in shell (shell.asm). Fixed by adding a call to
|
||||
dispose_hash before calling hashpath.
|
||||
|
||||
Nov 29 98 [dmt] Fix memory leak: deallocate name returned by hash
|
||||
search in invoke (invoke.asm) and which (builtin.asm).
|
||||
Deallocate path string in invoke by passing it as a new
|
||||
parameter to argfree, so that it is deallocated only after
|
||||
the child process is done with it.
|
||||
|
||||
Nov 28 98 [dmt] When allocating memory for return string containing
|
||||
full path in search (hash.asm), add lengths of path + name + 1
|
||||
rather than path + 33.
|
||||
|
||||
Nov 18 98 [dmt] Fix memory leak: when null command was encountered,
|
||||
the empty command line and argv array were not deallocated.
|
||||
|
||||
Nov 12 98 [dmt] prefix command without parameters should not try to
|
||||
deallocate PRecPath, since it was not used. Causes corruption
|
||||
when PRecPath contains a value; fixed by jumping to done
|
||||
rather than finish. Also, jump into "allloop" earlier and
|
||||
avoid 9 lines of duplicate code.
|
||||
|
||||
Nov 2 98 [dmt] Changes to this point checked-in to master archive.
|
||||
Released as version 2.0d6
|
||||
|
||||
Oct 29 98 [dmt] Defect introduced into 2.0d5 fixed: when background job
|
||||
completed, GetCmdLine thought there was an error on stdin. It
|
||||
printed a bogus error message and then quit.
|
||||
|
||||
Oct 26 98 [dmt] Changes to this point checked-in to master archive.
|
||||
Released as version 2.0d5
|
||||
|
||||
Oct 10 98 [dmt] Found race condition: when forked process completes
|
||||
quickly, the parent process may not ever receive its completion
|
||||
signal. Fix: ensure process exists by calling kill(pid,0)
|
||||
and checking status before calling pwait (cmd.asm).
|
||||
Change calls to set and reset handler for signal 17 (SIGSTOP)
|
||||
to do it for signal 18 (SIGTSTP) (17 can't be caught; 18 is).
|
||||
|
||||
Oct 7 98 [dmt] Check for directory stack full in pushd, and report
|
||||
new error message: 'pushd: Directory stack full'. (Previously,
|
||||
50 pushds would cause a crash.)
|
||||
Check for parameter in pushd "+n" <=0, and report a new error
|
||||
message: 'pushd: Invalid number'. (Previously, tried to chdir
|
||||
to the parameter.)
|
||||
|
||||
Oct 6 98 [dmt] Before calling pwait (to wait for child process) in
|
||||
cmd.asm, enable the child status signal handler; change it
|
||||
back to its previous state after the pwait call. This partially
|
||||
fixes the problem of the shell waiting forever when a shell
|
||||
exec file sources another exec file that contains a command
|
||||
that causes a fork.
|
||||
command() checked for argv==0 before calling invoke(), but
|
||||
invoke() also checks. Move invoke()'s error message ("specify
|
||||
a command before redirecting.") into command().
|
||||
|
||||
Sep 27 98 [dmt] Add quotes around null parameters on the command line
|
||||
so they are parsed by the target command (PR#84)
|
||||
|
||||
Sep 25 98 [dmt] If a command appends to stdout (echo test >>&/tmp/err),
|
||||
then stdin gets closed. This was due to errappend being
|
||||
defined as pipefds+2 rather than pipefds+4 in cmd.asm.
|
||||
|
||||
Sep 23 98 [dmt] If there is an error reading stdin, gsh would go into
|
||||
an infinite loop of beeping and requesting more input. Changed
|
||||
getchar (in stdio.asm) and GetCmdLine (in edit.asm) to report
|
||||
the error and terminate.
|
||||
|
||||
Sep 9 98 [dmt] Output piped to an unfound command caused gsh to
|
||||
terminate. This was due to an interface change to getpgrp(2):
|
||||
it now returns the process group of the caller. To get the
|
||||
process group number of the parameter pid, the call has to
|
||||
be made to _getpgrp(2). This change was made in invoke.asm to
|
||||
fix the bug. Additional updates were made in jobs.asm.
|
||||
|
||||
Sep 7 98 [dmt] Changes to this point checked-in to master archive.
|
||||
Released as version 2.0d4
|
||||
|
||||
Sep 7 98 [dmt] In "gettoken" (cmd.asm), decrement buf (pointer to
|
||||
command line) when EOL is reached; otherwise if the character
|
||||
following the command in the buffer is non-zero, the garbage
|
||||
after the real command will be interpreted as another command.
|
||||
Test case: "> /tmp/list" would cause "not found" error message.
|
||||
|
||||
Sep 6 98 [dmt] Added startup protocol as requested by Devin Reed
|
||||
(PR#78) and Steve Reeves (PR#85, PR#86):
|
||||
For login shells (command line starts with '-'),
|
||||
If $PATH doesn't start with ':' or contain a space,
|
||||
change all ":" to " ".
|
||||
source /etc/glogin
|
||||
source $HOME/glogin
|
||||
($HOME/gshrc is sourced afterward for both login and non-login).
|
||||
In rehash built-in command, don't the print number of hashed
|
||||
until all initialization is completed.
|
||||
Restored commented-out PushVariablesGS at start of "shell" in
|
||||
shell.asm to keep subshells from changing parent's environment.
|
||||
|
||||
Aug 4 98 [dmt] Fixed defects in wordmatch (edit.asm) related to
|
||||
recognizing commands versus filenames during tab and ctrl-D
|
||||
filename completion. Suppose there is a file "filename" in the
|
||||
current directory and you enter one of the following:
|
||||
command >& filen
|
||||
command >filen
|
||||
and press tab. Instead of getting filename completion, you
|
||||
would get a beep. In the first case, gsh thought the "&"
|
||||
was putting the command in the background and filen was the
|
||||
beginning of a command name rather than a filename. In the
|
||||
second, gsh included the ">" in the filename match pattern.
|
||||
|
||||
Aug 3 98 [dmt] Entabbed all the asm files (saved >36,000 bytes).
|
||||
|
||||
Aug 3 98 [dmt] Changes to this point checked-in to master archive.
|
||||
Released as version 2.0d3
|
||||
|
||||
Aug 2 98 [dmt] Remove alloc256/free256 and associated data. Replace
|
||||
with fixed 64-byte buffer for command filename (hash.asm)
|
||||
and allocation of 261-byte buffer via ~NEW for shell
|
||||
variable name (shellvar.asm).
|
||||
|
||||
Aug 1 98 [dmt] Updated and expanded mmdebug.asm routines that perform
|
||||
error checking on memory management calls. Added macros ~NEW
|
||||
and ~DISPOSE that invoke either the real or debug routines.
|
||||
Fixed call to read $TERM variable's length (PR#81).
|
||||
Replace call to allocate256 in AppendHome (shell.asm) with
|
||||
code that allocates space for $HOME plus the string parameter.
|
||||
|
||||
Jul 28 98 [dmt] In expandvars (expand.asm), use echoFlag=0 (not 1)
|
||||
for ReadLine. The characters are echoed as they are typed
|
||||
and do not need to be reprinted on stdout.
|
||||
|
||||
Jul 27 98 [dmt] Added error checking to the various flavors of prefix:
|
||||
- Verify 2nd parameter is a valid directory before setting.
|
||||
- Verify 1st parameter < 32 before displaying or setting.
|
||||
|
||||
Jul 26 98 [dmt] Removed last of old shell calls and calls to and code for
|
||||
p-string routines (p2cstr, c2pstr, c2pstr2, putp, errputp).
|
||||
Removed old shell macros and "str" from gsh.mac. In removing
|
||||
putp calls, found instances in pwd & prefix commands and prompt
|
||||
handler where current directory name was assumed to be < 256
|
||||
characters; recoded to use new routine getpfxstr.
|
||||
|
||||
Jul 21 98 [dmt] Changed invoke.asm to use RedirectGS instead of redirect.
|
||||
Changed popd (in dir.asm) to get length of prefix 0 before
|
||||
allocating its string, rather than assuming path is <= 256
|
||||
characters. This allows directory stack to use very long names.
|
||||
|
||||
Jul 20 98 [dmt] Changed expand.asm to use InitWildcardGS and
|
||||
NextWildcardGS instead of their obsolete counterparts.
|
||||
|
||||
Jul 20 98 [dmt] Changes up to this point checked-in to master archive.
|
||||
Released as version 2.0d3
|
||||
|
||||
Jul 19 98 [dmt] Changed edit.asm to use ReadIndexedGS, InitWildcardGS,
|
||||
NextWildcardGS, instead of their obsolete counterparts.
|
||||
|
||||
Jul 18 98 [dmt] Changed Set_Variable, Export, UnsetVariable in cmd.asm,
|
||||
shellvar.asm, jobs.asm, and term.asm to use new shell interface
|
||||
(SetGS, ExportGS, UnsetVariableGS).
|
||||
In InitTerm (term.asm), do not set TERM to gnocon if it is
|
||||
already set.
|
||||
|
||||
Jul 17 98 [dmt] Changed final Read_Variable call (in edit.asm) to use
|
||||
getenv instead. Changed ReadVariableGS calls in hash.asm
|
||||
and builtin.asm to also use getenv.
|
||||
|
||||
Jul 16 98 [dmt] Changed Read_Variable calls in history.asm and prompt.asm
|
||||
to use getenv instead.
|
||||
|
||||
Jul 15 98 [dmt] Changed getenv (shellutil.asm) to use ReadVariableGS
|
||||
instead of Read_Variable to get value. getenv's input parameter
|
||||
is now a pointer to a GS/OS string (not a C-string), and it
|
||||
returns a pointer to a GS/OS result buffer with a terminating
|
||||
null byte added. This interface change affected calls to
|
||||
getenv in orca.asm and term.asm.
|
||||
|
||||
Jul 14 98 [dmt] Changed expandvars (expand.asm) to use ReadVariableGS
|
||||
to get the value of an environment variable, allowing values
|
||||
over 256 characters in length.
|
||||
|
||||
Jul 13 98 [dmt] Rewrote shellvar.asm to use newer shell calls to access
|
||||
environment variables, so that they can be > 256 characters.
|
||||
Combined set and setenv into the same routine, with different
|
||||
entry points.
|
||||
|
||||
Jul 12 98 [dmt] In rehash command (hash.asm), read the PATH environment
|
||||
variable with ReadVariableGS instead of Read_Variable, allowing
|
||||
detection of true length and total length > 256 (PR # 9).
|
||||
|
||||
Jul 9 98 [dmt] Removed the df command (from builtin.asm).
|
||||
Defined macro incad to increment a 4-byte address, checking
|
||||
for overflow; replaced instances of "inc ptr" with "incad ptr".
|
||||
|
||||
Jul 8 98 [dmt] Changed column offset table to use a 1-word rather
|
||||
than 1-byte entry. This resolves PR#14 (hash wouldn't
|
||||
print beyond first 256 filenames).
|
||||
|
||||
Jul 7 98 [dmt] Fixed defect in unalias (alias.asm) where the double
|
||||
quote portion of the scanner would look for a terminating
|
||||
single quote. This resolves PR#69.
|
||||
|
||||
Jul 5 98 [dmt] Changed default order for copying files in $PATH dirs
|
||||
into executable list, so earlier paths files are found first.
|
||||
Added environment variable flag $OLDPATHMODE to make gsh
|
||||
behave in the old (backwards order) way when necessary.
|
||||
Discard duplicate filenames when hashing.
|
||||
Fix PR#73: directory in $PATH with escaped space (\ ) is
|
||||
not searched. Needed to remove the "\" before sending
|
||||
pathname to ExpandPathGS.
|
||||
|
||||
Jun 29 98 [dmt] Changes up to this point checked-in to master archive.
|
||||
Released as version 2.0d2
|
||||
|
||||
Jun 28 98 [dmt] Added InitVar routine to shellvar.asm to read values
|
||||
of all environment variables tracked in vardata.
|
||||
|
||||
Jun 25 98 [dmt] Added 2.0 versions of shell calls to gsh.mac (e.g.
|
||||
ErrorGS, ReadVariableGS). Replaced old calls with new ones
|
||||
for the following: ERROR to ErrorGS in builtin.asm, cmd.asm
|
||||
dir.asm, shellvar.asm; Push[Pop]Variables to Push[Pop]VariabesGS
|
||||
in invoke.asm, shellvar.asm, shell.asm; ReadVariable to
|
||||
ReadVariableGS in builtin.asm and dir.asm.
|
||||
|
||||
Jun 23 98 [dmt] Made clear built-in a non-forked command.
|
||||
|
||||
Jun 21 98 [dmt] Added loop to execute(), in cmd.asm, to extract a single
|
||||
command from the input line before sending it to command(). It
|
||||
removes leading blanks and tabs and terminates the string at
|
||||
the first ";" or "#". After command() has finished, execute()
|
||||
loops again if the previous command was terminated with a ";".
|
||||
This change fixed both problems in bug report #12:
|
||||
a) All commands separated by ";" were evaluated before any
|
||||
were executed, so the following wouldn't work:
|
||||
set t_num=1 ; echo "Test number $t_num"
|
||||
b) Odd things randomly happened when tab was the first
|
||||
character of multiple consecutive lines.
|
||||
|
||||
Jun 20 98 [dmt] Changed pointer arithmetic from dec or inc to adc or sbc
|
||||
to allow for boundary condition in shell.asm.
|
||||
In ShellExec (cmd.asm), save status from call to execute and
|
||||
pass back to caller in Accumulator.
|
||||
Modify table of builtins so that source is unforked; this
|
||||
fixes bug reports #7 and #8: prefix does not work from a
|
||||
sourced file.
|
||||
|
||||
Jun 18 98 [dmt] In cmd.asm, modified system() to check for null pointer,
|
||||
since that is documented in the ORCA/C manual as legal.
|
||||
|
||||
Jun 15 98 [dmt] Fixed bug report #3: when wildcards were expanded, if
|
||||
nothing was found gsh printed "No match." and terminated, even
|
||||
if there were more arguments to parse. Now gsh prints a message
|
||||
"No match: <pattern> ignored" to stderr for each <pattern> that
|
||||
does not match any filename. These changes were in expand.asm.
|
||||
Changed mutual exclusion in cmd.asm and shellvar.asm to use
|
||||
lock/unlock/key macros. That should be all of 'em.
|
||||
|
||||
Jun 14 98 [dmt] Fixed bug report #47: when ~ is parsed and next character
|
||||
is a delimiter ("/" or ":") and first character of $HOME does
|
||||
not match that delimiter, replace the delimiters in $HOME to
|
||||
match the user's value. Changed three "ora addr" to "ora addr+2"
|
||||
(alias.asm: ora ptr; edit.asm and history.asm: ora cdcap).
|
||||
Changed mutual exclusion in expand.asm to use lock/unlock macros.
|
||||
|
||||
Jun 13 98 [dmt] Wrote script to test built-in commands; found many that
|
||||
returned status=227. Updated exit, setdebug, ps, hash, commands,
|
||||
history, dirs, pushd, popd, jobs, fg, bg, and stop to return
|
||||
status of 0 (modified "return" to add "2:#0").
|
||||
|
||||
Jun 12 98 [dmt] Squeezed about 80 bytes out of orca.o (edit built-in),
|
||||
mainly by removing "invalid path name" error msg, since I
|
||||
couldn't force ExpandPath to report the error and the editor
|
||||
handles it fine. Also tightened "whileloop" by using Y-reg
|
||||
to index off of two pointers. Added lots of comments.
|
||||
|
||||
Jun 10 98 [dmt] The boolean shell environment variables (echo, pushdsilent,
|
||||
etc.) would not work if they were set using UPPER CASE names.
|
||||
Added routine cmpdcstr in shellutil.asm to downshift characters
|
||||
while comparing two c strings, then called it from updatevars
|
||||
in shellvar.asm to compare env variable names.
|
||||
|
||||
Jun 9 98 [dmt] Modified echo command (in builtin.asm) so it doesn't append
|
||||
a blank to the end of everything it prints. Added comments to code.
|
||||
|
||||
Jun 8 98 [dmt] Added breakpoint option to setdebug (in builtin.asm) to
|
||||
allow turning on conditional brk instructions for debugging.
|
||||
Made "check4debug" a global word that reflects the current debug
|
||||
state, and added "breakpoint" macro (in gsh.mac) to generate code.
|
||||
Changed "2.0.4" to "2.0.6" within gnostr (in shell.asm).
|
||||
|
||||
Jun 6 98 [dmt] All the macros were extracted, compared, and collated in
|
||||
alphabetical order into the file gsh.mac. Six macros used by
|
||||
other macros had to be moved to the end of the file.
|
||||
|
||||
Added direct-page/stack data segment (size 2K) to main.asm.
|
||||
It is initialized to be filled with "?" characters, so that
|
||||
it can be examined to see how much space is being used.
|
||||
|
||||
Jun 5 98 [dmt] Determined that the current sources have only two
|
||||
differences from the gsh distributed with GNO/2.0.4:
|
||||
In main.asm between (argloop and cmd3) the code
|
||||
ph4 #1024
|
||||
jsl ~NEW
|
||||
formerly was
|
||||
pea 1024
|
||||
jsl ~NEW
|
||||
|
||||
In jobs.asm (after dokill) the error check after
|
||||
kill (pid,signum)
|
||||
was not present.
|
||||
|
||||
Jun 1 98 [dmt] Changed to execvp to _execve in invoke.asm. gsh works!
|
||||
|
||||
24 Apr 98 [gdr] Fitted gsh sources into into GNO builds. While gsh
|
||||
assembles and links (abeit using the v2.0.4 termcap library),
|
||||
it does not currently run -- it just crashes. The changes
|
||||
that were made includes:
|
||||
- 'keep' lines were eliminated
|
||||
- the 'mcopy' now takes the macro from the /obj/gno/bin/gsh
|
||||
directory. This is in anticipation of having the macro
|
||||
files generated from a single source file; there is a large
|
||||
amount of duplication. For the moment, the makefile merely
|
||||
copies the old macro files from the "M" directory to the
|
||||
/obj/gno/bin/gsh directory.
|
||||
- start each file with a dummy routine so that the source
|
||||
code winds up in the *.o rather than the *.root file.
|
||||
- added the 'setcom 60' directive; there were many source
|
||||
lines that were otherwise getting truncated.
|
||||
|
||||
18 Nov 97 - [gdr] initial checkin into v2.0.6 repository. No changes
|
||||
were made to the sources.
|
||||
|
||||
GSH 1.1 UPDATES
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
(unknown) - Removed two references to $E0C000 in shell.asm (signal
|
||||
handlers). Bad Timmy!
|
||||
2/25/92 d01 - fixed a problem with the command-line aborting after certain
|
||||
built-ins are run.
|
||||
4/03/92 d02 - .ttya and .ttyb are displayed as 'ta' and 'tb' respectively in
|
||||
'ps'.
|
||||
- "USER" field has been renamed to "MMID" in 'ps'.
|
||||
d03 - removed all the extra newlines around 'There are stopped jobs'
|
||||
message.
|
||||
- 'exit' in a shell script aborts the script, instead of quitting
|
||||
gsh itself.
|
||||
- when getting a 'There are stopped jobs' message, a second
|
||||
attempt to exit the shell will result in all jobs being killed
|
||||
and the shell will exit. No commands may appear between the
|
||||
two attempts to exit. This is basically just like csh behaviour.
|
||||
d04 - motd pathname has been changed to '31:etc:motd' where 31 is the
|
||||
location of GNO, not the user directory. eventually motd will
|
||||
be removed from gsh and will be handled by login or something
|
||||
similar.
|
||||
4/07/92 d05 - ^D and TAB expansion now properly works on */ boot prefix.
|
||||
4/13/92 d06 - started work on new string vector library.
|
||||
- started new builtin - 'hash' to display all hashed files.
|
||||
Extremely preliminary.
|
||||
4/14/92 d07 - 'hash' now uses string vectors to build the hash list for
|
||||
displaying
|
||||
- fixed a problem if no files were hashed.
|
||||
- sv_alloc now makes sure there is an extra null at the end
|
||||
of the allocated string vector.
|
||||
4/20/92 d08 - 'which' puts the filename after the path for commands in
|
||||
the current directory.
|
||||
d09 - wrote a string vector function for printing the string
|
||||
vectors in columns like 'ls'. 'hash' now calls this.
|
||||
4/21/92 d10 - wrote routine for sorting string vectors...'hash' now sorts the
|
||||
list...
|
||||
4/23/92 d11 - full directory stack support!! pushd, popd, and dirs!!
|
||||
d12 - 'ps' displays 'nu' for the .null driver under TT field.
|
||||
4/25/92 d13 - Added '-l' option to 'kill'.
|
||||
6/22/92 d14 - Began writing custom stdio for the shell using GS/OS output.
|
||||
6/23/92 - minor optimization to alias hashing.
|
||||
- finished stdout and stderr for gsh.
|
||||
d15 - history file is no longer deleted on gsh start-up
|
||||
- fixed '~' printer used in 'dirs'. /usr2/ was displayed as
|
||||
~2 if $home was /usr. Looked real dumb :) and was incorrect.
|
||||
- optimizations to job control
|
||||
d16 - echo flushes the stdio when finished.
|
||||
6/24/92 - fixed bug in system() call vector..make should work better
|
||||
now :)
|
||||
- added a newline after 'pwd'.
|
||||
- wrote 'edit' built-in.
|
||||
6/26/92 d17 - began work on stdin for gsh. Uses GS/OS, ioctl(), etc...
|
||||
- began rewriting editor. Now uses key translation tables and
|
||||
command jump tables.
|
||||
- editor now accepts multiple character commands.
|
||||
6/27/92 - further work on editor
|
||||
- started work on termcap support in gsh. most command-line
|
||||
editing uses termcap now.
|
||||
6/28/92 - continued work on editor and termcap
|
||||
- 'clear' and 'echo' builtins now use termcap.
|
||||
- prompt now uses termcap.
|
||||
- hacked up a quick 'tset' builtin.
|
||||
- wrote keybinding function, termcap arrow keys now bound!
|
||||
- beta test release sent out
|
||||
6/29/92 d18 - if alias 'precmd' is defined, it is executed before drawing
|
||||
each prompt.
|
||||
- if $pushdsilent is set, then directory stack not displayed
|
||||
after 'pushd' and 'popd'.
|
||||
- termcap optimizations for history mechanism in editor.
|
||||
- termcap optimizations for kill-line and kill-end-of-line.
|
||||
- fixed bug in overwrite mode of editor...required too many
|
||||
returns to end line -> rts's weren't being pulled off the
|
||||
stack :)
|
||||
6/30/92 - fixed a bug in the 'which' command when displaying files in cwd.
|
||||
- the cursor is now left on when running applications.
|
||||
- added '-c' option to gsh command-line
|
||||
- wrote 'source' built-in
|
||||
7/04/92 - fixed two bugs in prompt display code.
|
||||
7/17/92 - fixed puts to not choke on NULL strings.
|
||||
7/21/92 - Temporarily added Push/PopVariables to the code
|
||||
- ospeed is now set so that padding can be done by termcap.
|
||||
This fixed the dropped characters on my Xerox terminal when
|
||||
doing screen clears.
|
||||
- fixed a bug in 'tset'. Was doing a jsr instead of jsl. oops.
|
||||
- set term can be in gshrc w/o manually doing a tset now.
|
||||
- 'ps' now scans job list to find names of 'forked' processes.
|
||||
- 'ps' nows displays tty numbers, since the ttyname is set
|
||||
in 31/etc/ttys and not necessarily second-guessed by gsh.
|
||||
7/25/92 - fixed cursor off problems.
|
||||
8/26/92 d19 - larger number of builtins can be redirected or piped.
|
||||
- Open-Apple is now mapped to meta (ESC).
|
||||
- The editor tells gnocon to translate arrows into VT100 codes.
|
||||
- fixed editor bug clearing entire line.
|
||||
- wrote 'bindkey' built-in.
|
||||
8/27/92 d20 - faster built-in searching.
|
||||
- wrote 'setenv' builtin.
|
||||
8/28/92 - termcap optimizations to word completion
|
||||
- word completion now matches variables if word starts with '$'.
|
||||
8/29/92 - only executuables are expanded if the word is a command. All
|
||||
files are expanded for arguments.
|
||||
8/30/92 - words to complete no longer need to be separated with spaces,
|
||||
';','|', and '&' are now also recognized.
|
||||
9/01/92 - 'cd' no longer reports bad pathname syntax if $home not set.
|
||||
- 'pid' parsing now does syntax checking :)
|
||||
- kill won't allow killing process 0
|
||||
- changed 'jobs' invocation from method 0 to method 1.
|
||||
- word completion will not occur if the word contains an '=',
|
||||
single quote or double quote.
|
||||
9/03/92 - fixed memory trashing problem in 'source'
|
||||
9/04/92 - 'ps' only displays processes with the users uid. Be sure to
|
||||
use login, or you'll be the kernel's uid and get to see all
|
||||
of the kernel's processes as your own.
|
||||
9/10/92 - forgot to 'clc' when alias not found in 'alias foo'.
|
||||
9/20/92 - fixed open-apple mapping
|
||||
- changed keyboard mapping
|
||||
- tab expands directories as the command
|
||||
- set problem with '-f' fixed
|
||||
9/21/92 - fixed 'cd' with no arguments.
|
||||
- fixed 'set foo' and 'setenv foo'.
|
||||
- fixed bug again in 'cd'.
|
||||
- 'set' and 'setenv' list exported variable names in upper case
|
||||
- fixed a probelm in puts when passed a null pointer.
|
||||
- fixed pointer bug in '~' compactor
|
||||
- wrote 256 byte buffer pool
|
||||
9/22/92 - fixed parsing bug when parsing two or more command-lines
|
||||
simultaneously.
|
||||
- wrote 1024 byte buffer pool.
|
||||
- word completion now matches built-ins
|
||||
- wordmatching ignores matches if the suffix is contained in
|
||||
the $fignore variable.
|
||||
10/31/92 d21 - fixed bug in piping mechanism.
|
||||
11/04/92 - fixed hashing problems.
|
||||
11/17/92 - new builtin 'commands' lists all built-in commands. Try aliasing
|
||||
help to this for beginning users.
|
||||
01/17/93 b01 - fixed prefix not printing correctly if zero length prefix.
|
||||
- word completion will expand to proper case.
|
||||
01/20/93 b02 - removed motd printing from gsh
|
||||
02/08/93 - fixed job control setting of terminal when background job
|
||||
completes.
|
||||
02/09/93 - ^C & ^Z printing removed from the shell. The kernel will do
|
||||
this now.
|
||||
02/17/93 b03 - gshrc is now read as '@:gshrc'
|
||||
03/02/93 - 'set' automatically detects changing $term and auto-peforms a
|
||||
tset. manually typing 'tset' is no longer required though it is
|
||||
still included.
|
||||
- prompts can now contain \n,\r,\t,\b.
|
||||
03/10/93 - updated automatic variable setting code. works faster now.
|
||||
- optimized low-level string routines
|
||||
03/25/93 - fixed NULL commands aborting entire command-lines.
|
||||
04/04/93 - history commands can now be greater than 256 characters, though
|
||||
when being read, they are clipped to 1024.
|
||||
- the history file location has been moved to '@:history'
|
||||
- if $ignoreeof is set, then EOF (^D) will not quit the shell.
|
||||
- %U and %u will start and end underlining in prompts.
|
||||
04/22/93 b04 - 'df' displays device numbers
|
||||
- gsh now takes commands as command-line input. ie.,
|
||||
'gsh echo hello, world' will start gsh then gsh will run echo.
|
||||
- fixed a nasty shell script bug that basically rendered it
|
||||
useless.
|
||||
- fixed memory trashing in shell scripts.
|
||||
- fixed memory trashing in histories.
|
||||
04/26/94 b05 - which no longers displays the command-name first.
|
913
bin/gsh/alias.asm
Normal file
913
bin/gsh/alias.asm
Normal file
|
@ -0,0 +1,913 @@
|
|||
**************************************************************************
|
||||
*
|
||||
* The GNO Shell Project
|
||||
*
|
||||
* Developed by:
|
||||
* Jawaid Bazyar
|
||||
* Tim Meekins
|
||||
*
|
||||
* $Id: alias.asm,v 1.9 1999/02/08 17:26:49 tribby Exp $
|
||||
*
|
||||
**************************************************************************
|
||||
*
|
||||
* ALIAS.ASM
|
||||
* By Tim Meekins
|
||||
* Modified by Dave Tribby for GNO 2.0.6
|
||||
*
|
||||
* Note: text set up for tabs at col 16, 22, 41, 49, 57, 65
|
||||
* | | | | | |
|
||||
* ^ ^ ^ ^ ^ ^
|
||||
**************************************************************************
|
||||
*
|
||||
* Interfaces defined in this file:
|
||||
*
|
||||
* alias subroutine (4:argv,2:argc)
|
||||
* Returns with status=0 in Accumulator
|
||||
*
|
||||
* unalias subroutine (4:argv,2:argc)
|
||||
* return 2:status
|
||||
*
|
||||
* initalias jsr/rts with no parameters
|
||||
*
|
||||
* expandalias subroutine (4:cmd)
|
||||
* return 4:buf
|
||||
*
|
||||
* addalias subroutine (4:aliasname,4:aliasval)
|
||||
* return
|
||||
*
|
||||
* removealias subroutine (4:aliasname)
|
||||
* return
|
||||
*
|
||||
* findalias subroutine (4:aliasname),space
|
||||
* return 4:value
|
||||
*
|
||||
* startalias jsl/rtl with no parameters
|
||||
*
|
||||
* nextalias subroutine (4:p)
|
||||
* return 2:hashvalz
|
||||
*
|
||||
*
|
||||
**************************************************************************
|
||||
|
||||
mcopy /obj/gno/bin/gsh/alias.mac
|
||||
|
||||
dummyalias start ; ends up in root
|
||||
end
|
||||
|
||||
setcom 60
|
||||
|
||||
VTABSIZE gequ 17
|
||||
|
||||
**************************************************************************
|
||||
*
|
||||
* ALIAS: builtin command
|
||||
* syntax: alias [name [def]]
|
||||
*
|
||||
* set aliases
|
||||
*
|
||||
**************************************************************************
|
||||
|
||||
alias START
|
||||
|
||||
using AliasData
|
||||
|
||||
arg equ 1
|
||||
space equ arg+4
|
||||
argc equ space+3
|
||||
argv equ argc+2
|
||||
end equ argv+4
|
||||
|
||||
; subroutine (4:argv,2:argc),space
|
||||
|
||||
tsc
|
||||
sec
|
||||
sbc #space-1
|
||||
tcs
|
||||
phd
|
||||
tcd
|
||||
|
||||
lock AliasMutex
|
||||
lda argc How many arguments were provided?
|
||||
dec a
|
||||
beq showall None -- show all alias names.
|
||||
dec a
|
||||
beq showone One -- show a single name.
|
||||
jmp setalias More -- set an alias.
|
||||
|
||||
;
|
||||
; Show all aliases
|
||||
;
|
||||
showall jsl startalias
|
||||
showloop jsl nextalias
|
||||
sta arg
|
||||
stx arg+2
|
||||
ora arg+2
|
||||
beq noshow
|
||||
ldy #6
|
||||
lda [arg],y
|
||||
tax
|
||||
ldy #4
|
||||
lda [arg],y
|
||||
jsr puts
|
||||
lda #':'
|
||||
jsr putchar
|
||||
lda #' '
|
||||
jsr putchar
|
||||
ldy #10
|
||||
lda [arg],y
|
||||
tax
|
||||
ldy #8
|
||||
lda [arg],y
|
||||
jsr puts
|
||||
jsr newline
|
||||
bra showloop
|
||||
|
||||
noshow jmp exit
|
||||
|
||||
;
|
||||
; Show a single alias
|
||||
;
|
||||
showone ldy #4+2
|
||||
lda [argv],y
|
||||
tax
|
||||
pha ;for findalias
|
||||
ldy #4
|
||||
lda [argv],y
|
||||
pha
|
||||
jsr puts Print name.
|
||||
lda #':' Print ": ".
|
||||
jsr putchar
|
||||
lda #' '
|
||||
jsr putchar
|
||||
jsl findalias
|
||||
sta arg
|
||||
stx arg+2
|
||||
ora arg+2
|
||||
beq notthere
|
||||
lda arg
|
||||
jsr puts Print alias value.
|
||||
jsr newline Print newline.
|
||||
jmp exit All done.
|
||||
|
||||
notthere ldx #^noalias Print message:
|
||||
lda #noalias 'Alias not defined'
|
||||
jsr puts
|
||||
jmp exit
|
||||
|
||||
;
|
||||
; Set an alias name
|
||||
;
|
||||
setalias ldy #4+2 ;put alias name on stack
|
||||
lda [argv],y
|
||||
pha
|
||||
ldy #4
|
||||
lda [argv],y
|
||||
pha
|
||||
|
||||
ph4 #2
|
||||
~NEW
|
||||
sta arg
|
||||
stx arg+2
|
||||
lda #0
|
||||
sta [arg]
|
||||
|
||||
add2 argv,#8,argv
|
||||
|
||||
dec2 argc
|
||||
|
||||
buildalias lda argc
|
||||
beq setit
|
||||
|
||||
pei (arg+2)
|
||||
pei (arg)
|
||||
pei (arg+2)
|
||||
pei (arg)
|
||||
ldy #2
|
||||
lda [argv],y
|
||||
pha
|
||||
lda [argv]
|
||||
pha
|
||||
jsr catcstr
|
||||
stx arg+2
|
||||
sta arg
|
||||
jsl nullfree
|
||||
|
||||
pei (arg+2)
|
||||
pei (arg)
|
||||
pei (arg+2)
|
||||
pei (arg)
|
||||
ph4 #spacestr
|
||||
jsr catcstr
|
||||
stx arg+2
|
||||
sta arg
|
||||
jsl nullfree
|
||||
|
||||
dec argc
|
||||
add2 argv,#4,argv
|
||||
bra buildalias
|
||||
|
||||
setit pei (arg+2)
|
||||
pei (arg)
|
||||
jsl addalias
|
||||
pei (arg+2)
|
||||
pei (arg)
|
||||
jsl nullfree
|
||||
|
||||
exit unlock AliasMutex
|
||||
lda space
|
||||
sta end-3
|
||||
lda space+1
|
||||
sta end-2
|
||||
pld
|
||||
tsc
|
||||
clc
|
||||
adc #end-4
|
||||
tcs
|
||||
|
||||
lda #0 Return status always 0.
|
||||
|
||||
rtl
|
||||
|
||||
noalias dc c'Alias not defined',h'0d00'
|
||||
spacestr dc c' ',h'00'
|
||||
|
||||
END
|
||||
|
||||
**************************************************************************
|
||||
*
|
||||
* UNALIAS: builtin command
|
||||
* syntax: unalias [var ...]
|
||||
*
|
||||
* removes each alias listed
|
||||
*
|
||||
**************************************************************************
|
||||
|
||||
unalias START
|
||||
|
||||
using AliasData
|
||||
|
||||
status equ 0
|
||||
space equ status+2
|
||||
|
||||
subroutine (4:argv,2:argc),space
|
||||
|
||||
lock AliasMutex
|
||||
|
||||
stz status
|
||||
|
||||
lda argc
|
||||
dec a
|
||||
bne loop
|
||||
|
||||
ldx #^Usage
|
||||
lda #USage
|
||||
jsr errputs
|
||||
inc status Return status = 1.
|
||||
bra done
|
||||
|
||||
loop add2 argv,#4,argv
|
||||
dec argc
|
||||
beq done
|
||||
|
||||
ldy #2
|
||||
lda [argv],y
|
||||
pha
|
||||
lda [argv]
|
||||
pha
|
||||
jsl removealias
|
||||
|
||||
bra loop
|
||||
|
||||
done unlock AliasMutex
|
||||
return 2:status
|
||||
|
||||
Usage dc c'Usage: unalias name ...',h'0d00'
|
||||
|
||||
END
|
||||
|
||||
;=========================================================================
|
||||
;
|
||||
; Init alias table
|
||||
;
|
||||
;=========================================================================
|
||||
|
||||
initalias START
|
||||
|
||||
using AliasData
|
||||
|
||||
; Set all entries in AliasTable to 0
|
||||
|
||||
lda #0
|
||||
ldy #VTABSIZE
|
||||
tax
|
||||
yahaha sta AliasTable,x
|
||||
inx2
|
||||
sta AliasTable,x
|
||||
inx2
|
||||
dey
|
||||
bne yahaha
|
||||
|
||||
rts
|
||||
|
||||
END
|
||||
|
||||
;=========================================================================
|
||||
;
|
||||
; Expand alias
|
||||
;
|
||||
;=========================================================================
|
||||
|
||||
expandalias START
|
||||
|
||||
outbuf equ 0
|
||||
sub equ outbuf+4
|
||||
word equ sub+4
|
||||
buf equ word+4
|
||||
bufend equ buf+4
|
||||
inquote equ bufend+2
|
||||
bsflag equ inquote+2
|
||||
space equ bsflag+2
|
||||
|
||||
subroutine (4:cmd),space
|
||||
|
||||
ph4 maxline_size Allocate result buffer.
|
||||
~NEW
|
||||
stx buf+2
|
||||
sta buf
|
||||
stx outbuf+2 Initialize "next
|
||||
sta outbuf output char" pointer.
|
||||
clc Calculate end of buffer-1;
|
||||
adc maxline_size note: it's allocated to be in one
|
||||
dec a bank, so only need low-order word.
|
||||
sta bufend
|
||||
|
||||
jsl allocmaxline Allocate buffer for word that
|
||||
stx word+2 might be an alias.
|
||||
sta word
|
||||
|
||||
lda #0
|
||||
sta [buf] In case we're called with empty string.
|
||||
sta [word]
|
||||
;
|
||||
; Eat leading space and tabs (just in case expanding a variable added them!)
|
||||
;
|
||||
bra eatleader
|
||||
bump_cmd inc cmd
|
||||
eatleader lda [cmd]
|
||||
and #$FF
|
||||
jeq stringend
|
||||
cmp #' '
|
||||
beq bump_cmd
|
||||
cmp #9
|
||||
beq bump_cmd
|
||||
;
|
||||
; Parse the leading word
|
||||
;
|
||||
short a
|
||||
ldy #0
|
||||
bra makeword1 First time, already checked 0, ' ', 9
|
||||
makeword lda [cmd],y
|
||||
if2 @a,eq,#0,gotword
|
||||
if2 @a,eq,#' ',gotword
|
||||
if2 @a,eq,#9,gotword
|
||||
makeword1 if2 @a,eq,#';',gotword
|
||||
if2 @a,eq,#'&',gotword
|
||||
if2 @a,eq,#'|',gotword
|
||||
if2 @a,eq,#'>',gotword
|
||||
if2 @a,eq,#'<',gotword
|
||||
if2 @a,eq,#13,gotword
|
||||
if2 @a,eq,#10,gotword
|
||||
sta [word],y
|
||||
iny
|
||||
bra makeword
|
||||
;
|
||||
; We have a word. See if it's an alias.
|
||||
;
|
||||
gotword lda #0
|
||||
sta [word],y
|
||||
long a
|
||||
cpy #0 Check for 0 length.
|
||||
beq copyrest
|
||||
phy
|
||||
pei (word+2)
|
||||
pei (word)
|
||||
jsl findalias
|
||||
sta sub
|
||||
stx sub+2
|
||||
ply
|
||||
ora sub+2
|
||||
beq copyrest
|
||||
;
|
||||
; Yes, this is an alias. Copy it into the output buffer.
|
||||
;
|
||||
add2 @y,cmd,cmd Add length to cmd pointer.
|
||||
|
||||
pei (sub+2) Make sure that
|
||||
pei (sub) substituted string
|
||||
jsr cstrlen will fit into buffer.
|
||||
sec
|
||||
adc outbuf
|
||||
jge overflow
|
||||
cmp bufend
|
||||
jge overflow
|
||||
|
||||
ldy #0
|
||||
short a
|
||||
lda [sub]
|
||||
putalias sta [outbuf]
|
||||
inc outbuf
|
||||
iny
|
||||
lda [sub],y
|
||||
bne putalias
|
||||
long a
|
||||
;
|
||||
; That alias is expanded. Copy until we reach the next command.
|
||||
;
|
||||
copyrest stz inquote Clear the "in quotes" flag
|
||||
stz bsflag and "backslashed" flag.
|
||||
|
||||
next anop
|
||||
lda outbuf Check for output overflow.
|
||||
cmp bufend
|
||||
jcs overflow
|
||||
lda [cmd] Transfer the character.
|
||||
and #$00FF
|
||||
cmp #13 If carriage-return,
|
||||
bne go8bits
|
||||
lda #0 treat like end-of-string.
|
||||
go8bits short a
|
||||
sta [outbuf]
|
||||
long a
|
||||
inc cmd Bump pointers.
|
||||
inc outbuf
|
||||
|
||||
if2 @a,eq,#0,done
|
||||
;
|
||||
; If that was a backslashed character, don't check for special chars.
|
||||
;
|
||||
ldx bsflag
|
||||
beq testq
|
||||
stz bsflag
|
||||
bra next
|
||||
|
||||
testq if2 @a,eq,#"'",singquoter
|
||||
if2 @a,eq,#'"',doubquoter
|
||||
;
|
||||
; Remaining characters aren't special if we are in a quoted string
|
||||
;
|
||||
ldx inquote
|
||||
bne next
|
||||
if2 @a,eq,#';',nextalias
|
||||
if2 @a,eq,#'&',nextalias
|
||||
if2 @a,eq,#'|',nextalias
|
||||
if2 @a,ne,#'\',next
|
||||
;
|
||||
; "\" found
|
||||
;
|
||||
backstabber sta bsflag
|
||||
bra next
|
||||
|
||||
;
|
||||
; "'" found
|
||||
;
|
||||
singquoter bit inquote Check "in quotes" flag.
|
||||
bvs next In double quotes. Keep looking.
|
||||
lda inquote Toggle single quote
|
||||
eor #$8000
|
||||
sta inquote
|
||||
bra next
|
||||
;
|
||||
; '"' found
|
||||
;
|
||||
doubquoter bit inquote Check "in quotes" flag.
|
||||
bmi next In single quotes. Keep looking.
|
||||
lda inquote Toggle single quote
|
||||
eor #$4000
|
||||
sta inquote
|
||||
bra next
|
||||
|
||||
;
|
||||
; ";", "|", or "&" found: it's another command
|
||||
;
|
||||
nextalias jmp eatleader
|
||||
|
||||
;
|
||||
; Terminate string and exit
|
||||
;
|
||||
stringend short a
|
||||
sta [outbuf]
|
||||
long a
|
||||
;
|
||||
; All done: clean up and return to caller
|
||||
;
|
||||
done ldx word+2
|
||||
lda word
|
||||
jsl freemaxline
|
||||
|
||||
return 4:buf
|
||||
|
||||
|
||||
;
|
||||
; Report overflow error
|
||||
;
|
||||
overflow anop
|
||||
pei (buf+2) Free the output buffer.
|
||||
pei (buf)
|
||||
jsl nullfree
|
||||
stz buf
|
||||
stz buf+2
|
||||
|
||||
ldx #^ovferr Report overflow error.
|
||||
lda #ovferr
|
||||
jsr errputs
|
||||
|
||||
bra done
|
||||
|
||||
ovferr dc c'gsh: Alias overflowed line limit',h'0d00'
|
||||
|
||||
END
|
||||
|
||||
;=========================================================================
|
||||
;
|
||||
; Add alias to table
|
||||
;
|
||||
;=========================================================================
|
||||
|
||||
addalias START
|
||||
|
||||
using AliasData
|
||||
|
||||
tmp equ 0
|
||||
ptr equ tmp+4
|
||||
hashval equ ptr+4
|
||||
space equ hashval+4
|
||||
|
||||
subroutine (4:aliasname,4:aliasval),space
|
||||
|
||||
pei (aliasname+2)
|
||||
pei (aliasname)
|
||||
jsl hashalias
|
||||
sta hashval
|
||||
|
||||
tax
|
||||
lda AliasTable,x
|
||||
sta ptr
|
||||
lda AliasTable+2,x
|
||||
sta ptr+2
|
||||
|
||||
search lda ptr
|
||||
ora ptr+2
|
||||
beq notfound
|
||||
ldy #4
|
||||
lda [ptr],y
|
||||
tax
|
||||
ldy #4+2
|
||||
lda [ptr],y
|
||||
pha
|
||||
phx
|
||||
pei (aliasname+2)
|
||||
pei (aliasname)
|
||||
jsr cmpcstr
|
||||
jeq replace
|
||||
ldy #2
|
||||
lda [ptr]
|
||||
tax
|
||||
lda [ptr],y
|
||||
sta ptr+2
|
||||
stx ptr
|
||||
bra search
|
||||
|
||||
replace ldy #8+2
|
||||
lda [ptr],y
|
||||
pha
|
||||
ldy #8
|
||||
lda [ptr],y
|
||||
pha
|
||||
jsl nullfree
|
||||
pei (aliasval+2)
|
||||
pei (aliasval)
|
||||
jsr cstrlen
|
||||
inc a
|
||||
pea 0
|
||||
pha
|
||||
~NEW
|
||||
sta tmp
|
||||
stx tmp+2
|
||||
ldy #8
|
||||
sta [ptr],y
|
||||
ldy #8+2
|
||||
txa
|
||||
sta [ptr],y
|
||||
pei (aliasval+2)
|
||||
pei (aliasval)
|
||||
pei (tmp+2)
|
||||
pei (tmp)
|
||||
jsr copycstr
|
||||
jmp done
|
||||
|
||||
notfound ph4 #4*3
|
||||
~NEW
|
||||
sta ptr
|
||||
stx ptr+2
|
||||
ldy #2
|
||||
ldx hashval
|
||||
lda AliasTable,x
|
||||
sta [ptr]
|
||||
lda AliasTable+2,x
|
||||
sta [ptr],y
|
||||
pei (aliasname+2)
|
||||
pei (aliasname)
|
||||
jsr cstrlen
|
||||
inc a
|
||||
pea 0
|
||||
pha
|
||||
~NEW
|
||||
sta tmp
|
||||
stx tmp+2
|
||||
ldy #4
|
||||
sta [ptr],y
|
||||
ldy #4+2
|
||||
txa
|
||||
sta [ptr],y
|
||||
pei (aliasname+2)
|
||||
pei (aliasname)
|
||||
pei (tmp+2)
|
||||
pei (tmp)
|
||||
jsr copycstr
|
||||
pei (aliasval+2)
|
||||
pei (aliasval)
|
||||
jsr cstrlen
|
||||
inc a
|
||||
pea 0
|
||||
pha
|
||||
~NEW
|
||||
sta tmp
|
||||
stx tmp+2
|
||||
ldy #8
|
||||
sta [ptr],y
|
||||
ldy #8+2
|
||||
txa
|
||||
sta [ptr],y
|
||||
pei (aliasval+2)
|
||||
pei (aliasval)
|
||||
pei (tmp+2)
|
||||
pei (tmp)
|
||||
jsr copycstr
|
||||
ldx hashval
|
||||
lda ptr
|
||||
sta AliasTable,x
|
||||
lda ptr+2
|
||||
sta AliasTable+2,x
|
||||
|
||||
done return
|
||||
|
||||
END
|
||||
|
||||
;=========================================================================
|
||||
;
|
||||
; Remove an alias
|
||||
;
|
||||
;=========================================================================
|
||||
|
||||
removealias START
|
||||
|
||||
using AliasData
|
||||
|
||||
oldptr equ 0
|
||||
ptr equ oldptr+4
|
||||
space equ ptr+4
|
||||
|
||||
subroutine (4:aliasname),space
|
||||
|
||||
pei (aliasname+2)
|
||||
pei (aliasname)
|
||||
jsl hashalias
|
||||
tax
|
||||
lda AliasTable,x
|
||||
sta ptr
|
||||
lda AliasTable+2,x
|
||||
sta ptr+2
|
||||
lda #^Aliastable
|
||||
sta oldptr+2
|
||||
clc
|
||||
txa
|
||||
adc #AliasTable
|
||||
sta oldptr
|
||||
|
||||
searchloop ora2 ptr,ptr+2,@a
|
||||
beq done
|
||||
|
||||
ldy #4+2
|
||||
lda [ptr],y
|
||||
pha
|
||||
ldy #4
|
||||
lda [ptr],y
|
||||
pha
|
||||
pei (aliasname+2)
|
||||
pei (aliasname)
|
||||
jsr cmpcstr
|
||||
beq foundit
|
||||
mv4 ptr,oldptr
|
||||
ldy #2
|
||||
lda [ptr],y
|
||||
tax
|
||||
lda [ptr]
|
||||
sta ptr
|
||||
stx ptr+2
|
||||
bra searchloop
|
||||
|
||||
foundit ldy #2
|
||||
lda [ptr],y
|
||||
sta [oldptr],y
|
||||
lda [ptr]
|
||||
sta [oldptr]
|
||||
ldy #4+2
|
||||
lda [ptr],y
|
||||
pha
|
||||
ldy #4
|
||||
lda [ptr],y
|
||||
pha
|
||||
jsl nullfree
|
||||
ldy #8+2
|
||||
lda [ptr],y
|
||||
pha
|
||||
ldy #8
|
||||
lda [ptr],y
|
||||
pha
|
||||
jsl nullfree
|
||||
pei (ptr+2)
|
||||
pei (ptr)
|
||||
jsl nullfree
|
||||
|
||||
done return
|
||||
|
||||
END
|
||||
|
||||
;=========================================================================
|
||||
;
|
||||
; Find an alias
|
||||
;
|
||||
;=========================================================================
|
||||
|
||||
findalias START
|
||||
|
||||
using AliasData
|
||||
|
||||
ptr equ 0
|
||||
value equ ptr+4
|
||||
space equ value+4
|
||||
|
||||
subroutine (4:aliasname),space
|
||||
|
||||
stz value
|
||||
stz value+2
|
||||
|
||||
pei (aliasname+2)
|
||||
pei (aliasname)
|
||||
jsl hashalias
|
||||
tax
|
||||
lda AliasTable,x
|
||||
sta ptr
|
||||
lda AliasTable+2,x
|
||||
sta ptr+2
|
||||
|
||||
searchloop ora2 ptr,ptr+2,@a
|
||||
beq done
|
||||
|
||||
ldy #4+2
|
||||
lda [ptr],y
|
||||
pha
|
||||
ldy #4
|
||||
lda [ptr],y
|
||||
pha
|
||||
pei (aliasname+2)
|
||||
pei (aliasname)
|
||||
jsr cmpcstr
|
||||
beq foundit
|
||||
ldy #2
|
||||
lda [ptr],y
|
||||
tax
|
||||
lda [ptr]
|
||||
sta ptr
|
||||
stx ptr+2
|
||||
bra searchloop
|
||||
|
||||
foundit ldy #8
|
||||
lda [ptr],y
|
||||
sta value
|
||||
ldy #8+2
|
||||
lda [ptr],y
|
||||
sta value+2
|
||||
|
||||
done return 4:value
|
||||
|
||||
END
|
||||
|
||||
;=========================================================================
|
||||
;
|
||||
; Start alias
|
||||
;
|
||||
;=========================================================================
|
||||
|
||||
startalias START
|
||||
|
||||
using AliasData
|
||||
|
||||
stz AliasNum
|
||||
mv4 AliasTable,AliasPtr
|
||||
rtl
|
||||
|
||||
END
|
||||
|
||||
;=========================================================================
|
||||
;
|
||||
; Next alias
|
||||
;
|
||||
;=========================================================================
|
||||
|
||||
nextalias START
|
||||
|
||||
using AliasData
|
||||
|
||||
value equ 0
|
||||
space equ value+4
|
||||
|
||||
subroutine (0:fubar),space
|
||||
|
||||
stz value
|
||||
stz value+2
|
||||
puke if2 AliasNum,cs,#VTABSIZE,done
|
||||
|
||||
ora2 AliasPtr,AliasPtr+2,@a
|
||||
bne flush
|
||||
inc AliasNum
|
||||
lda AliasNum
|
||||
asl2 a
|
||||
tax
|
||||
lda AliasTable,x
|
||||
sta AliasPtr
|
||||
lda AliasTable+2,x
|
||||
sta AliasPtr+2
|
||||
bra puke
|
||||
|
||||
flush mv4 AliasPtr,value
|
||||
ldy #2
|
||||
lda [value]
|
||||
sta AliasPtr
|
||||
lda [value],y
|
||||
sta AliasPtr+2
|
||||
|
||||
done return 4:value
|
||||
|
||||
END
|
||||
|
||||
;=========================================================================
|
||||
;
|
||||
; Hash an alias
|
||||
;
|
||||
;=========================================================================
|
||||
|
||||
hashalias PRIVATE
|
||||
|
||||
hashval equ 0
|
||||
space equ hashval+2
|
||||
|
||||
subroutine (4:p),space
|
||||
|
||||
lda #11
|
||||
sta hashval
|
||||
|
||||
ldy #0
|
||||
loop asl hashval
|
||||
lda [p],y
|
||||
and #$FF
|
||||
beq done
|
||||
clc
|
||||
adc hashval
|
||||
sta hashval
|
||||
iny
|
||||
bra loop
|
||||
done UDivide (hashval,#VTABSIZE),(@a,@a)
|
||||
|
||||
asl2 a ;Make it an index.
|
||||
sta hashval
|
||||
|
||||
return 2:hashval
|
||||
|
||||
END
|
||||
|
||||
;=========================================================================
|
||||
;
|
||||
; Alias data
|
||||
;
|
||||
;=========================================================================
|
||||
|
||||
AliasData DATA
|
||||
|
||||
AliasNum dc i2'0'
|
||||
AliasPtr dc i4'0'
|
||||
AliasMutex key
|
||||
|
||||
AliasTable ds VTABSIZE*4
|
||||
|
||||
END
|
136
bin/gsh/bufpool.asm
Normal file
136
bin/gsh/bufpool.asm
Normal file
|
@ -0,0 +1,136 @@
|
|||
**************************************************************************
|
||||
*
|
||||
* The GNO Shell Project
|
||||
*
|
||||
* Developed by:
|
||||
* Jawaid Bazyar
|
||||
* Tim Meekins
|
||||
*
|
||||
* $Id: bufpool.asm,v 1.7 1999/02/08 17:26:50 tribby Exp $
|
||||
*
|
||||
**************************************************************************
|
||||
*
|
||||
* BUFPOOL
|
||||
* By Tim Meekins
|
||||
* Modified by Dave Tribby for GNO 2.0.6
|
||||
*
|
||||
* This is the buffer pool
|
||||
*
|
||||
* Note: text set up for tabs at col 16, 22, 41, 49, 57, 65
|
||||
* | | | | | |
|
||||
* ^ ^ ^ ^ ^ ^
|
||||
**************************************************************************
|
||||
*
|
||||
* Interfaces defined in this file:
|
||||
* The alloc routine is a jsl without any stack params.
|
||||
* Pointer to requested buffer is returned in X/A registers.
|
||||
* allocmaxline
|
||||
* The free routine takes the address from the X/A registers
|
||||
* freemaxline
|
||||
*
|
||||
* bufpool data:
|
||||
* pmaxline dc i4'0'
|
||||
* pmaxlinemutex key
|
||||
*
|
||||
**************************************************************************
|
||||
|
||||
mcopy /obj/gno/bin/gsh/bufpool.mac
|
||||
|
||||
dummybufpool start ; ends up in .root
|
||||
end
|
||||
|
||||
setcom 60
|
||||
|
||||
**************************************************************************
|
||||
*
|
||||
* Get a buffer of size maxline_size
|
||||
*
|
||||
**************************************************************************
|
||||
|
||||
allocmaxline START
|
||||
|
||||
using bufpool
|
||||
|
||||
lock pmaxlinemutex
|
||||
|
||||
lda pmaxline If pool pointer
|
||||
ora pmaxline+2 isn't NULL,
|
||||
beq allocbuf
|
||||
|
||||
phd
|
||||
ph4 pmaxline Push pool pointer on stack.
|
||||
tsc
|
||||
tcd
|
||||
lda [1] Replace pool pointer with
|
||||
sta pmaxline the address it points to.
|
||||
ldy #2
|
||||
lda [1],y
|
||||
sta pmaxline+2
|
||||
unlock pmaxlinemutex
|
||||
pla
|
||||
plx
|
||||
pld
|
||||
rtl Return to caller.
|
||||
|
||||
;
|
||||
; No memory in free pool; must allocate a new block.
|
||||
;
|
||||
allocbuf unlock pmaxlinemutex
|
||||
ph4 maxline_size
|
||||
~NEW
|
||||
rtl
|
||||
|
||||
;
|
||||
; Constant indicating # of bytes in a maxline buffer
|
||||
;
|
||||
maxline_size entry Make this easily seen.
|
||||
dc i4'4096'
|
||||
|
||||
END
|
||||
|
||||
**************************************************************************
|
||||
*
|
||||
* Free a buffer of size maxline_size, putting it into the free pool
|
||||
*
|
||||
**************************************************************************
|
||||
|
||||
freemaxline START
|
||||
|
||||
using bufpool
|
||||
|
||||
phd
|
||||
phx
|
||||
pha
|
||||
tsc
|
||||
tcd
|
||||
lock pmaxlinemutex
|
||||
lda pmaxline Move current head of pool list
|
||||
sta [1] into the buffer being freed.
|
||||
ldy #2
|
||||
lda pmaxline+2
|
||||
sta [1],y
|
||||
lda 1 Put address of buffer being freed
|
||||
sta pmaxline into the pool list head.
|
||||
lda 3
|
||||
sta pmaxline+2
|
||||
unlock pmaxlinemutex
|
||||
pla
|
||||
plx
|
||||
pld
|
||||
rtl Return to caller.
|
||||
|
||||
END
|
||||
|
||||
**************************************************************************
|
||||
*
|
||||
* Buffer pool data
|
||||
*
|
||||
**************************************************************************
|
||||
|
||||
bufpool DATA
|
||||
|
||||
pmaxline dc i4'0' Head of free pool list.
|
||||
|
||||
pmaxlinemutex key Mutual exclusion when modifying list.
|
||||
|
||||
END
|
1969
bin/gsh/builtin.asm
Normal file
1969
bin/gsh/builtin.asm
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user