mirror of
https://github.com/GnoConsortium/gno.git
synced 2024-06-11 09:29:27 +00:00
Compare commits
516 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 |
44
Makefile
44
Makefile
|
@ -2,7 +2,43 @@
|
|||
# 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.4 1997/11/01 19:49:27 gdr Exp $
|
||||
# $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
|
||||
|
@ -32,7 +68,7 @@ NOT_YET= \
|
|||
|
||||
srcxfer: $(XFER_LIST)
|
||||
|
||||
ROOTFILES = Makefile binconst.mk binrules.mk paths.mk prog.mk
|
||||
ROOTFILES = Makefile binconst.mk binrelease.mk binrules.mk paths.mk prog.mk
|
||||
|
||||
$(XFER)/root.shk: $(ROOTFILES)
|
||||
@echo "making $@"; \
|
||||
|
@ -44,10 +80,10 @@ $(XFER)/root.shk: $(ROOTFILES)
|
|||
fi; \
|
||||
cwd=`pwd`; \
|
||||
mkdir -p $(TMP); \
|
||||
cp -r -p $< $(TMP); \
|
||||
cp -r -p $(ROOTFILES) $(TMP); \
|
||||
$(RM) -rf `find $(TMP) -name CVS -print `; \
|
||||
$(UDL) -gR $(TMP); \
|
||||
(cd $(TMP); $(NULIB) -cf $$cwd/$@ $< ); \
|
||||
(cd $(TMP); $(NULIB) -cf $$cwd/$@ $(ROOTFILES) ); \
|
||||
$(RM) -rf $(TMP)
|
||||
|
||||
# make sure the filename fits
|
||||
|
|
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
|
||||
|
|
148
NOTES/TO.DO
148
NOTES/TO.DO
|
@ -1,148 +0,0 @@
|
|||
*******
|
||||
* soon
|
||||
*
|
||||
* $Id: TO.DO,v 1.5 1997/11/01 19:34:29 gdr Exp $
|
||||
*
|
||||
*******
|
||||
|
||||
Verify if cp or gshk is corrupting the "fudgeinstall" script.
|
||||
|
||||
Add implementations for Tilghman:
|
||||
strftime(3)
|
||||
|
||||
Incorporate Tilghman's setttimeofday(2) routine.
|
||||
|
||||
Update funopen, fropen, fwopen, fsettext man pages:
|
||||
If a user wants binary mode, he has to call fsetbinary
|
||||
on the resulting file pointer; this info is not carried
|
||||
over from the previous file pointer.
|
||||
|
||||
Create a src/gno/build.tools/dupfile script for duplicating binary
|
||||
files at user install time. Current packages that need this:
|
||||
compress
|
||||
|
||||
Complete mkso util
|
||||
|
||||
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.
|
||||
|
||||
Use __STACK_CHECK__ macro for stack checking code.
|
||||
|
||||
stdio:
|
||||
- add %b modifier to fprintf implementation (ORCA/C compatibility)
|
||||
|
||||
stdlib/cvt.c:
|
||||
- handle modes 0 and 1 correctly.
|
||||
|
||||
Use result of _setModeEmulation(3) in appropriate calls. These include
|
||||
chmod -
|
||||
fchmod -
|
||||
creat - done
|
||||
open - done
|
||||
stat - unnecessary
|
||||
fstat - unnecessary
|
||||
lstat - unnecessary
|
||||
|
||||
clean up <gno/kerntool.h> -- some require errno args, some don't
|
||||
|
||||
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)
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
*******
|
||||
* defer
|
||||
*******
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
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
|
||||
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.
|
||||
|
||||
|
||||
man(1) implementation: create a database in the user's home directory
|
||||
that contains a list of all man pages and their locations, based
|
||||
on MANPATH. Keep a magic number the file to see if MANPATH has
|
||||
changed. *maybe* check the date of the file against the
|
||||
modification date of the respective directories and generate a
|
||||
warning if the db is out-of-date.
|
||||
|
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,27 +1,49 @@
|
|||
*******
|
||||
* soon
|
||||
*
|
||||
* $Id: TO.DO,v 1.5 1997/11/01 19:34:29 gdr Exp $
|
||||
* $Id: TO.DO,v 1.8 1998/10/31 19:14:49 gdr-ftp Exp $
|
||||
*
|
||||
*******
|
||||
|
||||
Verify if cp or gshk is corrupting the "fudgeinstall" script.
|
||||
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)
|
||||
|
||||
Incorporate Tilghman's setttimeofday(2) routine.
|
||||
|
||||
Update funopen, fropen, fwopen, fsettext man pages:
|
||||
If a user wants binary mode, he has to call fsetbinary
|
||||
on the resulting file pointer; this info is not carried
|
||||
over from the previous file pointer.
|
||||
|
||||
Create a src/gno/build.tools/dupfile script for duplicating binary
|
||||
Create a src/gno/build.tools/mklink script for duplicating binary
|
||||
files at user install time. Current packages that need this:
|
||||
compress
|
||||
|
||||
Complete mkso util
|
||||
compress/zcat
|
||||
sum/cksum
|
||||
|
||||
As a group:
|
||||
Update utmp.5, libutil (logout, logwtmp), last(1), login(1), who(1),
|
||||
|
@ -32,8 +54,6 @@ Add to relevent util man pages:
|
|||
This command was ported from FreeBSD source code
|
||||
for distribution with GNO/ME 2.0.6.
|
||||
|
||||
Use __STACK_CHECK__ macro for stack checking code.
|
||||
|
||||
stdio:
|
||||
- add %b modifier to fprintf implementation (ORCA/C compatibility)
|
||||
|
||||
|
@ -49,8 +69,6 @@ Use result of _setModeEmulation(3) in appropriate calls. These include
|
|||
fstat - unnecessary
|
||||
lstat - unnecessary
|
||||
|
||||
clean up <gno/kerntool.h> -- some require errno args, some don't
|
||||
|
||||
check up on the type of nlink_t, used in stat(2)
|
||||
|
||||
Write a test that handles:
|
||||
|
@ -92,7 +110,7 @@ NEED TO WRITE OR DUPLICATE MAN PAGES FOR
|
|||
ms 7
|
||||
man 7
|
||||
cron 8
|
||||
runover 8 (obsolete?) No, needed for single user mode.
|
||||
runover 8 (obsolete?) No, needed for single user mode.
|
||||
dialup 8
|
||||
|
||||
|
||||
|
@ -100,6 +118,8 @@ NEED TO WRITE OR DUPLICATE MAN PAGES FOR
|
|||
* 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)
|
||||
|
@ -137,12 +157,3 @@ 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.
|
||||
|
||||
|
||||
man(1) implementation: create a database in the user's home directory
|
||||
that contains a list of all man pages and their locations, based
|
||||
on MANPATH. Keep a magic number the file to see if MANPATH has
|
||||
changed. *maybe* check the date of the file against the
|
||||
modification date of the respective directories and generate a
|
||||
warning if the db is out-of-date.
|
||||
|
||||
|
|
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
|
591
NOTES/status.bin
591
NOTES/status.bin
|
@ -1,17 +1,42 @@
|
|||
This file lists the status of the various files in the GNO base distribution.
|
||||
*************************************************************************
|
||||
* *
|
||||
*** 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 $ *
|
||||
* *
|
||||
*************************************************************************
|
||||
|
||||
Version: $Id: status.bin,v 1.6 1997/11/01 19:36:19 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
|
||||
sonk Soenke Behrens
|
||||
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
|
||||
----------
|
||||
|
@ -20,353 +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. The label
|
||||
'P' means it's present, 'T' means it's been
|
||||
tested (reviewed).
|
||||
tested (reviewed). '[G]' indicates that it is
|
||||
missing the GNO version of the man page (but
|
||||
has the BSD version)
|
||||
Compiled - Has it been cleanly recompiled with new headers/libs?
|
||||
Tested - Has it been tested?
|
||||
Archived - Has it been entered in the CVS repository? (gdr to coord)
|
||||
Installed - Are 'release' and 'makeinstall' targets complete?
|
||||
('R' and 'I', respectively)
|
||||
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 Y T Y Y Y R
|
||||
/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 Y T Y Y Y R
|
||||
/bin/cmp Y Y evan Y T Y Y Y R
|
||||
/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 Y T Y Y Y R
|
||||
/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 Y T Y Y Y R
|
||||
/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 Y T Y Y Y R
|
||||
/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/passwd Y Y
|
||||
/bin/pax N
|
||||
/bin/ps Y (replace functionality of /usr/bin/eps)
|
||||
/bin/purge Y Y
|
||||
/bin/pwd Y dave Y T Y Y Y R
|
||||
/bin/rcp Y dt
|
||||
/bin/rm Y dt
|
||||
/bin/rmail
|
||||
/bin/rmdir Y gdr Y T Y Y Y R
|
||||
/bin/sh Y gdr
|
||||
/bin/shutdown Y
|
||||
/bin/sleep Y Y dave Y T Y Y Y R
|
||||
/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 Y T Y Y Y R
|
||||
/bin/tar Y Y tl
|
||||
/bin/tee Y Y gdr Y T Y Y Y R
|
||||
/bin/test Y gdr Y T Y Y Y R
|
||||
/bin/time Y Y
|
||||
/bin/touch Y Y dt
|
||||
/bin/tr Y Y dave Y T Y Y Y R
|
||||
/bin/true Y gdr Y T Y Y Y R
|
||||
/bin/sync N Y
|
||||
/bin/tail Y Y dave Y T Y Y Y RI
|
||||
/bin/tar Y Y tl Y
|
||||
/bin/tee Y Y gdr Y T Y Y Y RI
|
||||
/bin/test N Y gdr Y T Y Y Y RI
|
||||
/bin/time Y Y dave Y . . . Y
|
||||
/bin/touch Y Y dt Y . . . Y
|
||||
/bin/tr Y Y dave Y T Y Y Y RI
|
||||
/bin/true N Y gdr Y T Y Y Y RI
|
||||
/bin/uncompress Y Y
|
||||
/bin/uname Y
|
||||
/bin/uniq Y Y
|
||||
/bin/upper Y
|
||||
/bin/vi Y Y
|
||||
/bin/wc Y Y dave Y T Y Y Y R
|
||||
/bin/yes Y dave Y T Y Y Y R
|
||||
/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.conf (syslog)
|
||||
/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 - /gno.disk2/etc.shk
|
||||
/etc/ttys Y Y Y -
|
||||
/etc/utmp (mu)
|
||||
/etc/tmtermrc . . . . . . . . . (tmterm)
|
||||
/etc/tty.config Y Y gdr Y . -
|
||||
/etc/ttys Y Y Y . -
|
||||
/etc/utmp . . . . . . . . . (mu)
|
||||
/gshrc Y Y
|
||||
/home/root Y gdr dir - - - -
|
||||
/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 N (now in libc)
|
||||
/lib/libc Y Y gdr Y
|
||||
/lib/libgno Y N -
|
||||
/lib/lsaneglue Y sonk Y T Y Y Y
|
||||
/lib/lstring Y (replaced by libc?)
|
||||
/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 Y gdr Y T Y Y Y
|
||||
/libexec/atrun
|
||||
/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 (initd) Y Y
|
||||
/sbin/initd (initd) 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 dave Y T Y Y Y R
|
||||
/usr/bin/cclean Y
|
||||
/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/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 gdr Y Y
|
||||
/usr/bin/ctags Y dt
|
||||
/usr/bin/cut Y dave Y T Y Y Y R
|
||||
/usr/bin/describe (describe) Y gdr Y T Y Y Y R
|
||||
/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 T Y Y Y R
|
||||
/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 T - Y Y R
|
||||
/usr/bin/help Y Y gdr Y T - Y Y RI
|
||||
/usr/bin/hexdump
|
||||
/usr/bin/install Y gdr Y T Y Y Y R
|
||||
/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 tl
|
||||
/usr/bin/link (ie: ld) Y 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 Y T Y Y Y R
|
||||
/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/nroff Y Y gdr Y T Y Y Y R
|
||||
/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 dave
|
||||
/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/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 T Y Y Y R
|
||||
/usr/bin/wall N Y dt Y T Y Y Y RI
|
||||
/usr/bin/whatis N Y gdr Y T Y Y Y RI (man)
|
||||
/usr/bin/whereis N Y gdr Y T Y Y Y RI
|
||||
/usr/bin/which
|
||||
/usr/bin/who Y Y dt Y Y
|
||||
/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/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/libflex 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/libregexp Y Y
|
||||
/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 Y gdr 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/occ Y sonk
|
||||
/usr/orca/bin/rc Y sonk
|
||||
/usr/orca/bin/udl Y sonk 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/descc (describe) Y gdr Y T Y Y Y R
|
||||
/usr/sbin/descu (describe) Y gdr Y T Y Y Y R
|
||||
/usr/sbin/getty Y Y
|
||||
/usr/sbin/inetd Y dt
|
||||
/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/lib/libutil N Y gdr Y . Y . Y RI
|
||||
/usr/lib/liby N Y gdr Y . Y . Y RI
|
||||
/usr/lib/tmac Y Y gdr dir - - - - Y
|
||||
/usr/lib/tmac/tmac.an Y . . . . . . . . (nroff)
|
||||
/usr/lib/tmac/tmac.s Y . . . . . . . . (nroff)
|
||||
/usr/orca/bin/occ N Y sonk
|
||||
/usr/orca/bin/rc N Y sonk
|
||||
/usr/orca/bin/udl N Y sonk Y T Y Y Y RI
|
||||
/usr/man Y Y gdr dir - - - - Y
|
||||
/usr/man/cat1 Y Y gdr dir - - - - Y
|
||||
/usr/man/cat2 Y Y gdr dir - - - - Y
|
||||
/usr/man/cat3 Y Y gdr dir - - - - Y
|
||||
/usr/man/cat4 Y Y gdr dir - - - - Y
|
||||
/usr/man/cat5 Y Y gdr dir - - - - Y
|
||||
/usr/man/cat6 Y Y gdr dir - - - - Y
|
||||
/usr/man/cat7 Y Y gdr dir - - - - Y
|
||||
/usr/man/cat8 Y Y gdr dir - - - - Y
|
||||
/usr/man/man1 Y Y gdr dir - - - - Y
|
||||
/usr/man/man1/intro.1 Y Y gdr . . - . . Y
|
||||
/usr/man/man2 Y Y gdr dir - - - - Y
|
||||
/usr/man/man2/* Y Y gdr . . - . . Y [A]
|
||||
/usr/man/man3 Y Y gdr dir - - - - Y
|
||||
/usr/man/man3/* Y Y gdr . . - . . Y [A]
|
||||
/usr/man/man4 Y Y gdr dir - - - - Y
|
||||
/usr/man/man4/* Y Y gdr . . - . . Y [A]
|
||||
/usr/man/man5 Y Y gdr dir - - - - Y
|
||||
/usr/man/man5/* Y Y gdr . . - . . Y [A]
|
||||
/usr/man/man6 Y Y gdr dir - - - - Y
|
||||
/usr/man/man6/intro.6 Y Y gdr . . - . . Y
|
||||
/usr/man/man7 Y Y gdr dir - - - - Y
|
||||
/usr/man/man7/* Y Y gdr . . - . . Y [A]
|
||||
/usr/man/man8 Y Y gdr dir - - - - Y
|
||||
/usr/man/man8/intro.8 Y Y gdr . . - . . Y
|
||||
/usr/sbin Y Y gdr dir - - - - Y
|
||||
/usr/sbin/catman N Y gdr Y T Y Y Y RI (man)
|
||||
/usr/sbin/cron Y Y sr Y . . . Y
|
||||
/usr/sbin/descc N Y gdr Y T Y Y Y RI (describe)
|
||||
/usr/sbin/descu N Y gdr Y T Y Y Y RI (describe)
|
||||
/usr/sbin/getty Y Y gdr Y T Y Y Y RI
|
||||
/usr/sbin/inetd N Y dt Y [G]
|
||||
/usr/sbin/login Y Y dt Y T Y Y Y RI
|
||||
/usr/sbin/lpc Y Y dt . . . . . . (lpr)
|
||||
/usr/sbin/lpd Y Y dt . . . . . . (lpr)
|
||||
/usr/sbin/lptest N Y dt . . . . . . (lpr)
|
||||
/usr/sbin/makewhatis N Y gdr Y T Y Y Y RI (man)
|
||||
/usr/sbin/mctrl Y
|
||||
/usr/sbin/mktmp
|
||||
/usr/sbin/newuser (maybe replace with adduser?) (update to use /home vice /user, or maybe a conf file)
|
||||
/usr/sbin/newuserv (maybe replace with adduser?) (update to use /home vice /user, or maybe a conf file)
|
||||
/usr/sbin/nogetty Y
|
||||
/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/adm/utmp (initd)
|
||||
/var/adm/wtmp (initd)
|
||||
/var/run dir - - - -
|
||||
/var/spool Y gdr dir - - - - Y /gno.disk1/installbin
|
||||
/var/spool/uucppublic Y gdr dir - - - -
|
||||
/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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
$Id: status.lib,v 1.5 1997/11/03 03:15:58 gdr Exp $
|
||||
$Id: status.lib,v 1.9 2012/08/26 02:54:58 gdr Exp $
|
||||
|
||||
Key for Code Status column:
|
||||
R == reviewed
|
||||
|
@ -45,9 +45,11 @@ __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
|
||||
|
@ -74,8 +76,12 @@ 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
|
||||
|
@ -111,7 +117,7 @@ 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
|
||||
|
@ -233,7 +239,7 @@ 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
|
||||
|
@ -267,9 +273,14 @@ 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
|
||||
|
@ -300,7 +311,7 @@ setkey libc/gen/crypt.c C 3 unistd.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.asm C 3 sys/syslog.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
|
||||
|
@ -341,12 +352,13 @@ 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
|
||||
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
|
||||
|
@ -359,6 +371,7 @@ 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
|
||||
|
@ -367,12 +380,13 @@ verrx libc/gen/err.c T 3 err.h
|
|||
vfork libc/sys/trap.asm C 2 unistd.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.asm C 3 sys/syslog.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
|
||||
|
@ -382,10 +396,11 @@ 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
|
||||
|
||||
Notes:
|
||||
[var] symbol is a variable, not a fuction
|
||||
[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
|
||||
|
@ -427,9 +442,11 @@ BANK MODEL COMPLETE
|
|||
na na N N libc/gen/setjmp.asm
|
||||
78 0 0 Y N libc/gen/siglist.c
|
||||
78 0 0 Y Y libc/gen/sleep.c
|
||||
na na Y N libc/gen/syslog.asm
|
||||
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
|
||||
78 0 0 (1) Y Y libc/gno/gnomisc.c
|
||||
|
@ -437,6 +454,8 @@ BANK MODEL COMPLETE
|
|||
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
|
||||
|
||||
78 0 0 Y N libc/locale/table.c [stub]
|
||||
|
||||
|
@ -520,6 +539,7 @@ BANK MODEL COMPLETE
|
|||
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
|
||||
|
|
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
|
|
@ -4,6 +4,6 @@ Shell: GNO
|
|||
Author: Dave Tribby (from FreeBSD code)
|
||||
Contact: tribby@cup.hp.com
|
||||
Where: /bin
|
||||
FTP: ground.isca.uiowa.edu apple2.caltech.edu trenco.myrias.com
|
||||
FTP: ground.icaen.uiowa.edu apple2.caltech.edu ftp.gno.org
|
||||
|
||||
Concatenate and list files.
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
# gsh script to run tests and collect results
|
||||
# Written by Dave Tribby * August 1997
|
||||
# $Id: fulltests,v 1.3 1997/10/03 03:58:54 gdr Exp $
|
||||
|
||||
# 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/gno/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\""
|
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
|
||||
};
|
|
@ -4,29 +4,24 @@
|
|||
# Created by Dave Tribby, August 1997
|
||||
# Modified by Evan Day, September 1997
|
||||
#
|
||||
# $Id: Makefile,v 1.1 1997/10/03 05:06:50 gdr Exp $
|
||||
# $Id: Makefile,v 1.2 1998/02/19 02:03:15 gdr-ftp Exp $
|
||||
|
||||
# Program name
|
||||
PROG= chtyp
|
||||
# Source files
|
||||
SRCS= chtyp.c ftypes.c
|
||||
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.
|
||||
.IF $(OPTIMIZE) == $(NULL)
|
||||
OPTIMIZE=79
|
||||
.END
|
||||
OPTIMIZE*= 79
|
||||
|
||||
# Current implementation is using 960 bytes give or take
|
||||
STACK = 1024
|
||||
|
||||
# Installation point
|
||||
BINDIR = /bin
|
||||
|
||||
.INCLUDE : /src/gno/prog.mk
|
||||
|
||||
#
|
||||
# Additional dependancies
|
||||
# Additional dependancies.
|
||||
#
|
||||
chtyp.o:: ftypes.h
|
||||
ftypes.o:: ftypes.h
|
||||
ftypes.o: ftypes.h
|
||||
chtyp.o: ftypes.h
|
||||
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
Name: df
|
||||
Name: chtyp
|
||||
Version: 2.0.0 (28 Sep 97)
|
||||
Shell: GNO/ME
|
||||
Author: Evan Day
|
||||
Contact: day@engr.orst.edu
|
||||
Where: /bin
|
||||
FTP:
|
||||
FTP: ftp.gno.org
|
||||
|
||||
Set GS/OS file types.
|
||||
|
|
|
@ -4,31 +4,24 @@
|
|||
# Created by Dave Tribby, August 1997
|
||||
# Modified by Evan Day, September 1997
|
||||
#
|
||||
# $Id: Makefile,v 1.2 1997/10/05 16:41:59 gdr Exp $
|
||||
# $Id: Makefile,v 1.3 1998/02/19 02:05:06 gdr-ftp Exp $
|
||||
|
||||
# Program name
|
||||
PROG= cmp
|
||||
# Source files
|
||||
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.
|
||||
.IF $(OPTIMIZE) == $(NULL)
|
||||
OPTIMIZE=79
|
||||
.END
|
||||
OPTIMIZE *= 79
|
||||
|
||||
# Current implementation is using ~1050 bytes give or take
|
||||
STACK = 1280
|
||||
|
||||
# Installation point
|
||||
BINDIR = /bin
|
||||
|
||||
.INCLUDE : /src/gno/prog.mk
|
||||
|
||||
#
|
||||
# Additional dependancies
|
||||
#
|
||||
cmp.o:: extern.h
|
||||
misc.o:: extern.h
|
||||
rcmp.o:: extern.h
|
||||
special.o:: extern.h
|
||||
cmp.o: extern.h
|
||||
misc.o: extern.h
|
||||
rcmp.o: extern.h
|
||||
special.o: extern.h
|
||||
|
|
|
@ -4,7 +4,7 @@ Shell: GNO/ME
|
|||
Author: Evan Day (from FreeBSD source)
|
||||
Contact: day@engr.orst.edu
|
||||
Where: /bin
|
||||
FTP:
|
||||
FTP: ftp.gno.org
|
||||
|
||||
cmp compares and reports differences in the dataforks and resource forks
|
||||
of two files.
|
||||
|
|
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
|
|
@ -4,29 +4,22 @@
|
|||
# Created by Dave Tribby, August 1997
|
||||
# Modified by Evan Day, September 1997
|
||||
#
|
||||
# $Id: Makefile,v 1.1 1997/10/03 05:42:18 gdr Exp $
|
||||
# $Id: Makefile,v 1.2 1998/02/19 02:12:18 gdr-ftp Exp $
|
||||
|
||||
# Program name
|
||||
PROG= df
|
||||
# Source files
|
||||
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.
|
||||
.IF $(OPTIMIZE) == $(NULL)
|
||||
OPTIMIZE=79
|
||||
.END
|
||||
OPTIMIZE *= 79
|
||||
|
||||
# Current implementation is using 960 bytes give or take
|
||||
STACK = 1024
|
||||
|
||||
# Installation point
|
||||
BINDIR = /bin
|
||||
|
||||
.INCLUDE : /src/gno/prog.mk
|
||||
|
||||
#
|
||||
# Additional dependancies
|
||||
#
|
||||
tr.o:: df.h
|
||||
str.o:: df.h
|
||||
df.o: df.h
|
||||
gnodf.o: df.h
|
||||
|
|
|
@ -4,6 +4,6 @@ Shell: GNO/ME
|
|||
Author: Evan Day (from FreeBSD source)
|
||||
Contact: day@engr.orst.edu
|
||||
Where: /bin
|
||||
FTP:
|
||||
FTP: ftp.gno.org
|
||||
|
||||
Displays free disk space and disk usage statistics for GS/OS block devices.
|
||||
|
|
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);
|
||||
}
|
196
bin/gsh/Makefile
196
bin/gsh/Makefile
|
@ -1,87 +1,151 @@
|
|||
#
|
||||
# GNO Shell Makefile
|
||||
# by T Meekins
|
||||
# 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.
|
||||
#
|
||||
|
||||
o/main.root: main.asm
|
||||
purge ; compile main.asm keep=o/main
|
||||
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
|
||||
|
||||
o/shell.root: shell.asm m/shell.mac
|
||||
purge ; compile shell.asm keep=o/shell
|
||||
# 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.
|
||||
|
||||
o/history.root: history.asm m/history.mac
|
||||
purge ; compile history.asm keep=o/history
|
||||
# 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
|
||||
|
||||
o/prompt.root: prompt.asm m/prompt.mac
|
||||
purge ; compile prompt.asm keep=o/prompt
|
||||
# For debugging: produce a link map
|
||||
## LDFLAGS += -M
|
||||
|
||||
o/cmd.root: cmd.asm m/cmd.mac
|
||||
purge ; compile cmd.asm keep=o/cmd
|
||||
# Make sure our macro files get built before trying to assemble source files.
|
||||
# LOCAL_SETUP = macros
|
||||
|
||||
o/expand.root: expand.asm m/expand.mac
|
||||
purge ; compile expand.asm keep=o/expand
|
||||
CUSTOM_RELEASE = TRUE
|
||||
|
||||
o/invoke.root: invoke.asm m/invoke.mac
|
||||
purge ; compile invoke.asm keep=o/invoke
|
||||
.INCLUDE : /src/gno/prog.mk
|
||||
|
||||
o/shellutil.root: shellutil.asm m/shellutil.mac
|
||||
purge ; compile shellutil.asm keep=o/shellutil
|
||||
# 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
|
||||
|
||||
o/builtin.root: builtin.asm m/builtin.mac
|
||||
purge ; compile builtin.asm keep=o/builtin
|
||||
LOCAL_MACRO_SRC = gsh.mac
|
||||
MACRO_SRC = \
|
||||
$(LOCAL_MACRO_SRC)
|
||||
|
||||
o/hash.root: hash.asm m/hash.mac
|
||||
purge ; compile hash.asm keep=o/hash
|
||||
# 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
|
||||
|
||||
o/alias.root: alias.asm m/alias.mac
|
||||
purge ; compile alias.asm keep=o/alias
|
||||
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
|
||||
|
||||
o/dir.root: dir.asm m/dir.mac
|
||||
purge ; compile dir.asm keep=o/dir
|
||||
MANPAGES_1 = \
|
||||
man/alias.1 \
|
||||
man/cd.1 \
|
||||
man/clear.1 \
|
||||
man/exit.1 \
|
||||
man/gsh.1
|
||||
|
||||
o/shellvar.root: shellvar.asm m/shellvar.mac
|
||||
purge ; compile shellvar.asm keep=o/shellvar
|
||||
macros: $(MACROS)
|
||||
|
||||
o/jobs.root: jobs.asm m/jobs.mac
|
||||
purge ; compile jobs.asm keep=o/jobs
|
||||
$(OBJ_DIR)%.mac: %.asm
|
||||
@echo making $@
|
||||
@$(MACGEN) $(MACGEN_FLAGS) $*.asm $@ $(MACRO_SRC)
|
||||
|
||||
o/sv.root: sv.asm m/sv.mac
|
||||
purge ; compile sv.asm keep=o/sv
|
||||
$(MACROS): $(LOCAL_MACRO_SRC)
|
||||
|
||||
o/stdio.root: stdio.asm m/stdio.mac
|
||||
purge ; compile stdio.asm keep=o/stdio
|
||||
$(OBJ_DIR)alias.mac: $(MACRO_SRC)
|
||||
$(MACGEN) $(MACGEN_FLAGS) alias.asm $@ $(MACRO_SRC)
|
||||
|
||||
o/orca.root: orca.asm m/orca.mac
|
||||
purge ; compile orca.asm keep=o/orca
|
||||
# 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)
|
||||
|
||||
o/edit.root: edit.asm m/edit.mac
|
||||
purge ; compile edit.asm keep=o/edit
|
||||
# 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
|
||||
|
||||
o/term.root: term.asm m/term.mac
|
||||
purge ; compile term.asm keep=o/term
|
||||
|
||||
o/bufpool.root: bufpool.asm m/bufpool.mac
|
||||
purge ; compile bufpool.asm keep=o/bufpool
|
||||
|
||||
shell: o/main.root \
|
||||
o/shell.root \
|
||||
o/history.root \
|
||||
o/prompt.root \
|
||||
o/cmd.root \
|
||||
o/expand.root \
|
||||
o/invoke.root \
|
||||
o/shellutil.root \
|
||||
o/builtin.root \
|
||||
o/hash.root \
|
||||
o/alias.root \
|
||||
o/shellvar.root \
|
||||
o/jobs.root \
|
||||
o/dir.root \
|
||||
o/sv.root \
|
||||
o/stdio.root \
|
||||
o/orca.root \
|
||||
o/edit.root \
|
||||
o/term.root \
|
||||
o/bufpool.root \
|
||||
direct.root
|
||||
pwd ; purge ; compile link.script keep=gsh
|
||||
$(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
|
||||
|
|
|
@ -1,44 +1,56 @@
|
|||
Need to modify Tim's mutex code to be:
|
||||
Last updated: Nov. 26, 1999 By: Dave Tribby
|
||||
|
||||
t lda #1
|
||||
tsb mutex
|
||||
beq go
|
||||
cop $7F
|
||||
bra t
|
||||
go ; execute code here
|
||||
------------------------------------
|
||||
For more bug reports, see http://www.gno.org/~gno/bugs.html
|
||||
|
||||
coolish handling of setdebug by editor.
|
||||
Completed items are reported in file UpdateLog.
|
||||
|
||||
When building the EXE hash table, duplicate entries oughta should be ignored.
|
||||
|
||||
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.
|
||||
|
||||
running a process in the background from inside a script (not 'source',
|
||||
but executing the script as a command) causes the shell to wait for that
|
||||
background process to end - not exactly what we want.
|
||||
|
||||
recursive aliases.
|
||||
|
||||
multiple files for 'edit'.
|
||||
|
||||
'df' lists a bunch appleshare shit.
|
||||
|
||||
change updatevars to do a read_variable for better performance (and
|
||||
for correctness!)
|
||||
|
||||
-a in ps (and any other redeemable switches)
|
||||
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.
|
||||
|
||||
usage for alias and hash
|
||||
|
||||
job control needs to save tty information.
|
||||
|
||||
echo should use octal and hex \12 is dec, \012 is octal, \x12 is hex.
|
||||
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.
|
||||
|
|
|
@ -1,5 +1,511 @@
|
|||
GSH 1.1 UPDATES...
|
||||
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
|
||||
|
@ -43,7 +549,8 @@ GSH 1.1 UPDATES...
|
|||
~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 :)
|
||||
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...
|
||||
|
@ -106,7 +613,7 @@ GSH 1.1 UPDATES...
|
|||
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.
|
||||
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
|
||||
|
@ -138,21 +645,22 @@ GSH 1.1 UPDATES...
|
|||
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.
|
||||
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.
|
||||
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.
|
||||
'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.
|
||||
|
|
|
@ -6,15 +6,55 @@
|
|||
* 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
|
||||
*
|
||||
*
|
||||
**************************************************************************
|
||||
|
||||
keep o/alias
|
||||
mcopy m/alias.mac
|
||||
mcopy /obj/gno/bin/gsh/alias.mac
|
||||
|
||||
dummyalias start ; ends up in root
|
||||
end
|
||||
|
||||
setcom 60
|
||||
|
||||
VTABSIZE gequ 17
|
||||
|
||||
|
@ -29,6 +69,8 @@ VTABSIZE gequ 17
|
|||
|
||||
alias START
|
||||
|
||||
using AliasData
|
||||
|
||||
arg equ 1
|
||||
space equ arg+4
|
||||
argc equ space+3
|
||||
|
@ -44,13 +86,17 @@ end equ argv+4
|
|||
phd
|
||||
tcd
|
||||
|
||||
lda argc
|
||||
lock AliasMutex
|
||||
lda argc How many arguments were provided?
|
||||
dec a
|
||||
beq showall
|
||||
beq showall None -- show all alias names.
|
||||
dec a
|
||||
beq showone
|
||||
jmp setalias
|
||||
beq showone One -- show a single name.
|
||||
jmp setalias More -- set an alias.
|
||||
|
||||
;
|
||||
; Show all aliases
|
||||
;
|
||||
showall jsl startalias
|
||||
showloop jsl nextalias
|
||||
sta arg
|
||||
|
@ -78,6 +124,9 @@ showloop jsl nextalias
|
|||
|
||||
noshow jmp exit
|
||||
|
||||
;
|
||||
; Show a single alias
|
||||
;
|
||||
showone ldy #4+2
|
||||
lda [argv],y
|
||||
tax
|
||||
|
@ -85,8 +134,8 @@ showone ldy #4+2
|
|||
ldy #4
|
||||
lda [argv],y
|
||||
pha
|
||||
jsr puts
|
||||
lda #':'
|
||||
jsr puts Print name.
|
||||
lda #':' Print ": ".
|
||||
jsr putchar
|
||||
lda #' '
|
||||
jsr putchar
|
||||
|
@ -96,14 +145,18 @@ showone ldy #4+2
|
|||
ora arg+2
|
||||
beq notthere
|
||||
lda arg
|
||||
jsr puts
|
||||
jsr newline
|
||||
jmp exit
|
||||
notthere ldx #^noalias
|
||||
lda #noalias
|
||||
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
|
||||
|
@ -112,7 +165,7 @@ setalias ldy #4+2 ;put alias name on stack
|
|||
pha
|
||||
|
||||
ph4 #2
|
||||
jsl ~NEW
|
||||
~NEW
|
||||
sta arg
|
||||
stx arg+2
|
||||
lda #0
|
||||
|
@ -120,9 +173,9 @@ setalias ldy #4+2 ;put alias name on stack
|
|||
|
||||
add2 argv,#8,argv
|
||||
|
||||
dec2 argc
|
||||
dec2 argc
|
||||
|
||||
buildalias lda argc
|
||||
buildalias lda argc
|
||||
beq setit
|
||||
|
||||
pei (arg+2)
|
||||
|
@ -134,7 +187,7 @@ buildalias lda argc
|
|||
pha
|
||||
lda [argv]
|
||||
pha
|
||||
jsr catcstr
|
||||
jsr catcstr
|
||||
stx arg+2
|
||||
sta arg
|
||||
jsl nullfree
|
||||
|
@ -144,7 +197,7 @@ buildalias lda argc
|
|||
pei (arg+2)
|
||||
pei (arg)
|
||||
ph4 #spacestr
|
||||
jsr catcstr
|
||||
jsr catcstr
|
||||
stx arg+2
|
||||
sta arg
|
||||
jsl nullfree
|
||||
|
@ -160,7 +213,8 @@ setit pei (arg+2)
|
|||
pei (arg)
|
||||
jsl nullfree
|
||||
|
||||
exit lda space
|
||||
exit unlock AliasMutex
|
||||
lda space
|
||||
sta end-3
|
||||
lda space+1
|
||||
sta end-2
|
||||
|
@ -170,7 +224,7 @@ exit lda space
|
|||
adc #end-4
|
||||
tcs
|
||||
|
||||
lda #0
|
||||
lda #0 Return status always 0.
|
||||
|
||||
rtl
|
||||
|
||||
|
@ -190,16 +244,16 @@ spacestr dc c' ',h'00'
|
|||
|
||||
unalias START
|
||||
|
||||
space equ 1
|
||||
argc equ space+3
|
||||
argv equ argc+2
|
||||
end equ argv+4
|
||||
using AliasData
|
||||
|
||||
; subroutine (4:argv,2:argc),space
|
||||
status equ 0
|
||||
space equ status+2
|
||||
|
||||
tsc
|
||||
phd
|
||||
tcd
|
||||
subroutine (4:argv,2:argc),space
|
||||
|
||||
lock AliasMutex
|
||||
|
||||
stz status
|
||||
|
||||
lda argc
|
||||
dec a
|
||||
|
@ -208,6 +262,7 @@ end equ argv+4
|
|||
ldx #^Usage
|
||||
lda #USage
|
||||
jsr errputs
|
||||
inc status Return status = 1.
|
||||
bra done
|
||||
|
||||
loop add2 argv,#4,argv
|
||||
|
@ -223,19 +278,8 @@ loop add2 argv,#4,argv
|
|||
|
||||
bra loop
|
||||
|
||||
done lda space
|
||||
sta end-3
|
||||
lda space+1
|
||||
sta end-2
|
||||
pld
|
||||
tsc
|
||||
clc
|
||||
adc #end-4
|
||||
tcs
|
||||
|
||||
lda #0
|
||||
|
||||
rtl
|
||||
done unlock AliasMutex
|
||||
return 2:status
|
||||
|
||||
Usage dc c'Usage: unalias name ...',h'0d00'
|
||||
|
||||
|
@ -251,9 +295,11 @@ initalias START
|
|||
|
||||
using AliasData
|
||||
|
||||
; Set all entries in AliasTable to 0
|
||||
|
||||
lda #0
|
||||
ldy #VTABSIZE
|
||||
tax #0
|
||||
tax
|
||||
yahaha sta AliasTable,x
|
||||
inx2
|
||||
sta AliasTable,x
|
||||
|
@ -263,7 +309,7 @@ yahaha sta AliasTable,x
|
|||
|
||||
rts
|
||||
|
||||
END
|
||||
END
|
||||
|
||||
;=========================================================================
|
||||
;
|
||||
|
@ -272,145 +318,213 @@ yahaha sta AliasTable,x
|
|||
;=========================================================================
|
||||
|
||||
expandalias START
|
||||
|
||||
|
||||
outbuf equ 0
|
||||
sub equ outbuf+4
|
||||
word equ sub+4
|
||||
buf equ word+4
|
||||
space equ buf+4
|
||||
bufend equ buf+4
|
||||
inquote equ bufend+2
|
||||
bsflag equ inquote+2
|
||||
space equ bsflag+2
|
||||
|
||||
subroutine (4:cmd),space
|
||||
|
||||
ph4 #1024
|
||||
jsl ~NEW
|
||||
ph4 maxline_size Allocate result buffer.
|
||||
~NEW
|
||||
stx buf+2
|
||||
sta buf
|
||||
stx outbuf+2
|
||||
sta outbuf
|
||||
jsl alloc1024
|
||||
stx word+2
|
||||
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 [buf] In case we're called with empty string.
|
||||
sta [word]
|
||||
;
|
||||
; eat leading spaces
|
||||
; 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 done
|
||||
jeq stringend
|
||||
cmp #' '
|
||||
bne getword
|
||||
inc cmd
|
||||
sta [outbuf]
|
||||
inc outbuf
|
||||
bra eatleader
|
||||
beq bump_cmd
|
||||
cmp #9
|
||||
beq bump_cmd
|
||||
;
|
||||
; find the leading word
|
||||
; Parse the leading word
|
||||
;
|
||||
getword short a
|
||||
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,#';',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,#9,gotword
|
||||
if2 @a,eq,#10,gotword
|
||||
sta [word],y
|
||||
iny
|
||||
bra makeword
|
||||
;
|
||||
; we got a word, now check if it's an alias
|
||||
; We have a word. See if it's an alias.
|
||||
;
|
||||
gotword lda #0
|
||||
sta [word],y
|
||||
long a
|
||||
add2 @y,cmd,cmd
|
||||
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 noalias
|
||||
beq copyrest
|
||||
;
|
||||
; expand it, if you hadn't figured it out for yourself by now.
|
||||
; Yes, this is an alias. Copy it into the output buffer.
|
||||
;
|
||||
pla
|
||||
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
|
||||
putalias lda [sub],y
|
||||
and #$FF
|
||||
beq next
|
||||
sta [outbuf]
|
||||
short a
|
||||
lda [sub]
|
||||
putalias sta [outbuf]
|
||||
inc outbuf
|
||||
iny
|
||||
bra putalias
|
||||
lda [sub],y
|
||||
bne putalias
|
||||
long a
|
||||
;
|
||||
; no alias, so just copy the original string
|
||||
; That alias is expanded. Copy until we reach the next command.
|
||||
;
|
||||
noalias plx
|
||||
beq next
|
||||
ldy #0
|
||||
noalias2 lda [word],y
|
||||
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
|
||||
iny
|
||||
dex
|
||||
bne noalias2
|
||||
|
||||
if2 @a,eq,#0,done
|
||||
;
|
||||
; the alias is expanded, now copy until we reach the next command
|
||||
; If that was a backslashed character, don't check for special chars.
|
||||
;
|
||||
next lda [cmd]
|
||||
inc cmd
|
||||
sta [outbuf]
|
||||
inc outbuf
|
||||
and #$FF
|
||||
beq done
|
||||
if2 @a,eq,#13,nextalias
|
||||
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,eq,#'\',backstabber
|
||||
if2 @a,eq,#"'",singquoter
|
||||
if2 @a,eq,#'"',doubquoter
|
||||
if2 @a,ne,#'\',next
|
||||
;
|
||||
; "\" found
|
||||
;
|
||||
backstabber sta bsflag
|
||||
bra next
|
||||
backstabber lda [cmd]
|
||||
inc cmd
|
||||
sta [outbuf]
|
||||
inc outbuf
|
||||
and #$FF
|
||||
beq done
|
||||
|
||||
;
|
||||
; "'" 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
|
||||
singquoter lda [cmd]
|
||||
inc cmd
|
||||
sta [outbuf]
|
||||
inc outbuf
|
||||
and #$FF
|
||||
beq done
|
||||
if2 @a,ne,#"'",singquoter
|
||||
;
|
||||
; '"' 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
|
||||
doubquoter lda [cmd]
|
||||
inc cmd
|
||||
sta [outbuf]
|
||||
inc outbuf
|
||||
and #$FF
|
||||
beq done
|
||||
if2 @a,ne,#"'",singquoter
|
||||
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 free1024
|
||||
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
|
||||
|
||||
;=========================================================================
|
||||
|
@ -420,7 +534,7 @@ done ldx word+2
|
|||
;=========================================================================
|
||||
|
||||
addalias START
|
||||
|
||||
|
||||
using AliasData
|
||||
|
||||
tmp equ 0
|
||||
|
@ -442,7 +556,7 @@ space equ hashval+4
|
|||
sta ptr+2
|
||||
|
||||
search lda ptr
|
||||
ora ptr
|
||||
ora ptr+2
|
||||
beq notfound
|
||||
ldy #4
|
||||
lda [ptr],y
|
||||
|
@ -471,12 +585,12 @@ replace ldy #8+2
|
|||
pha
|
||||
jsl nullfree
|
||||
pei (aliasval+2)
|
||||
pei (aliasval)
|
||||
pei (aliasval)
|
||||
jsr cstrlen
|
||||
inc a
|
||||
pea 0
|
||||
pha
|
||||
jsl ~NEW
|
||||
~NEW
|
||||
sta tmp
|
||||
stx tmp+2
|
||||
ldy #8
|
||||
|
@ -489,10 +603,10 @@ replace ldy #8+2
|
|||
pei (tmp+2)
|
||||
pei (tmp)
|
||||
jsr copycstr
|
||||
bra done
|
||||
jmp done
|
||||
|
||||
notfound ph4 #4*3
|
||||
jsl ~NEW
|
||||
~NEW
|
||||
sta ptr
|
||||
stx ptr+2
|
||||
ldy #2
|
||||
|
@ -502,12 +616,12 @@ notfound ph4 #4*3
|
|||
lda AliasTable+2,x
|
||||
sta [ptr],y
|
||||
pei (aliasname+2)
|
||||
pei (aliasname)
|
||||
pei (aliasname)
|
||||
jsr cstrlen
|
||||
inc a
|
||||
pea 0
|
||||
pha
|
||||
jsl ~NEW
|
||||
~NEW
|
||||
sta tmp
|
||||
stx tmp+2
|
||||
ldy #4
|
||||
|
@ -521,12 +635,12 @@ notfound ph4 #4*3
|
|||
pei (tmp)
|
||||
jsr copycstr
|
||||
pei (aliasval+2)
|
||||
pei (aliasval)
|
||||
pei (aliasval)
|
||||
jsr cstrlen
|
||||
inc a
|
||||
pea 0
|
||||
pha
|
||||
jsl ~NEW
|
||||
~NEW
|
||||
sta tmp
|
||||
stx tmp+2
|
||||
ldy #8
|
||||
|
@ -544,7 +658,7 @@ notfound ph4 #4*3
|
|||
sta AliasTable,x
|
||||
lda ptr+2
|
||||
sta AliasTable+2,x
|
||||
|
||||
|
||||
done return
|
||||
|
||||
END
|
||||
|
@ -580,8 +694,8 @@ space equ ptr+4
|
|||
adc #AliasTable
|
||||
sta oldptr
|
||||
|
||||
searchloop ora2 ptr,ptr+2,@a
|
||||
beq done
|
||||
searchloop ora2 ptr,ptr+2,@a
|
||||
beq done
|
||||
|
||||
ldy #4+2
|
||||
lda [ptr],y
|
||||
|
@ -624,7 +738,7 @@ foundit ldy #2
|
|||
pei (ptr+2)
|
||||
pei (ptr)
|
||||
jsl nullfree
|
||||
|
||||
|
||||
done return
|
||||
|
||||
END
|
||||
|
@ -657,8 +771,8 @@ space equ value+4
|
|||
lda AliasTable+2,x
|
||||
sta ptr+2
|
||||
|
||||
searchloop ora2 ptr,ptr+2,@a
|
||||
beq done
|
||||
searchloop ora2 ptr,ptr+2,@a
|
||||
beq done
|
||||
|
||||
ldy #4+2
|
||||
lda [ptr],y
|
||||
|
@ -753,34 +867,34 @@ done return 4:value
|
|||
;
|
||||
;=========================================================================
|
||||
|
||||
hashalias PRIVATE
|
||||
hashalias PRIVATE
|
||||
|
||||
hashval equ 0
|
||||
space equ hashval+2
|
||||
hashval equ 0
|
||||
space equ hashval+2
|
||||
|
||||
subroutine (4:p),space
|
||||
subroutine (4:p),space
|
||||
|
||||
lda #11
|
||||
sta hashval
|
||||
|
||||
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)
|
||||
|
||||
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
|
||||
|
||||
asl2 a ;Make it an index.
|
||||
sta hashval
|
||||
return 2:hashval
|
||||
|
||||
return 2:hashval
|
||||
|
||||
END
|
||||
END
|
||||
|
||||
;=========================================================================
|
||||
;
|
||||
|
@ -792,7 +906,8 @@ AliasData DATA
|
|||
|
||||
AliasNum dc i2'0'
|
||||
AliasPtr dc i4'0'
|
||||
AliasMutex key
|
||||
|
||||
AliasTable ds VTABSIZE*4
|
||||
AliasTable ds VTABSIZE*4
|
||||
|
||||
END
|
||||
END
|
||||
|
|
|
@ -6,134 +6,95 @@
|
|||
* 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
|
||||
*
|
||||
**************************************************************************
|
||||
|
||||
keep o/bufpool
|
||||
mcopy m/bufpool.mac
|
||||
mcopy /obj/gno/bin/gsh/bufpool.mac
|
||||
|
||||
dummybufpool start ; ends up in .root
|
||||
end
|
||||
|
||||
setcom 60
|
||||
|
||||
**************************************************************************
|
||||
*
|
||||
* get a buffer of size 256
|
||||
* Get a buffer of size maxline_size
|
||||
*
|
||||
**************************************************************************
|
||||
|
||||
alloc256 START
|
||||
|
||||
using bufpool
|
||||
|
||||
lock pool256mutex
|
||||
|
||||
lda pool256
|
||||
ora pool256+2
|
||||
beq allocbuf
|
||||
|
||||
phd
|
||||
ph4 pool256
|
||||
tsc
|
||||
tcd
|
||||
lda [1]
|
||||
sta pool256
|
||||
ldy #2
|
||||
lda [1],y
|
||||
sta pool256+2
|
||||
unlock pool256mutex
|
||||
pla
|
||||
plx
|
||||
pld
|
||||
rtl
|
||||
|
||||
allocbuf unlock pool256mutex
|
||||
ph4 #256
|
||||
jsl ~NEW
|
||||
rtl
|
||||
allocmaxline START
|
||||
|
||||
END
|
||||
|
||||
**************************************************************************
|
||||
*
|
||||
* free a buffer of size 256
|
||||
*
|
||||
**************************************************************************
|
||||
|
||||
free256 START
|
||||
|
||||
using bufpool
|
||||
|
||||
phd
|
||||
phx
|
||||
pha
|
||||
tsc
|
||||
tcd
|
||||
lock pool256mutex
|
||||
lda pool256
|
||||
sta [1]
|
||||
ldy #2
|
||||
lda pool256+2
|
||||
sta [1],y
|
||||
lda 1
|
||||
sta pool256
|
||||
lda 3
|
||||
sta pool256+2
|
||||
unlock pool256mutex
|
||||
pla
|
||||
plx
|
||||
pld
|
||||
rtl
|
||||
|
||||
END
|
||||
|
||||
**************************************************************************
|
||||
*
|
||||
* get a buffer of size 1024
|
||||
*
|
||||
**************************************************************************
|
||||
|
||||
alloc1024 START
|
||||
|
||||
using bufpool
|
||||
|
||||
lock pool1024mutex
|
||||
lock pmaxlinemutex
|
||||
|
||||
lda pool1024
|
||||
ora pool1024+2
|
||||
lda pmaxline If pool pointer
|
||||
ora pmaxline+2 isn't NULL,
|
||||
beq allocbuf
|
||||
|
||||
phd
|
||||
ph4 pool1024
|
||||
ph4 pmaxline Push pool pointer on stack.
|
||||
tsc
|
||||
tcd
|
||||
lda [1]
|
||||
sta pool1024
|
||||
lda [1] Replace pool pointer with
|
||||
sta pmaxline the address it points to.
|
||||
ldy #2
|
||||
lda [1],y
|
||||
sta pool1024+2
|
||||
unlock pool1024mutex
|
||||
pla
|
||||
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
|
||||
|
||||
allocbuf unlock pool1024mutex
|
||||
ph4 #1024
|
||||
jsl ~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 1024
|
||||
* Free a buffer of size maxline_size, putting it into the free pool
|
||||
*
|
||||
**************************************************************************
|
||||
|
||||
free1024 START
|
||||
freemaxline START
|
||||
|
||||
using bufpool
|
||||
|
||||
|
@ -142,35 +103,34 @@ free1024 START
|
|||
pha
|
||||
tsc
|
||||
tcd
|
||||
lock pool1024mutex
|
||||
lda pool1024
|
||||
sta [1]
|
||||
lock pmaxlinemutex
|
||||
lda pmaxline Move current head of pool list
|
||||
sta [1] into the buffer being freed.
|
||||
ldy #2
|
||||
lda pool1024+2
|
||||
lda pmaxline+2
|
||||
sta [1],y
|
||||
lda 1
|
||||
sta pool1024
|
||||
lda 1 Put address of buffer being freed
|
||||
sta pmaxline into the pool list head.
|
||||
lda 3
|
||||
sta pool1024+2
|
||||
unlock pool1024mutex
|
||||
sta pmaxline+2
|
||||
unlock pmaxlinemutex
|
||||
pla
|
||||
plx
|
||||
pld
|
||||
rtl
|
||||
rtl Return to caller.
|
||||
|
||||
END
|
||||
|
||||
**************************************************************************
|
||||
*
|
||||
* buffer pool data
|
||||
* Buffer pool data
|
||||
*
|
||||
**************************************************************************
|
||||
|
||||
bufpool DATA
|
||||
|
||||
pool256 dc i4'0'
|
||||
pool256mutex key
|
||||
pool1024 dc i4'0'
|
||||
pool1024mutex key
|
||||
|
||||
pmaxline dc i4'0' Head of free pool list.
|
||||
|
||||
pmaxlinemutex key Mutual exclusion when modifying list.
|
||||
|
||||
END
|
||||
|
|
1414
bin/gsh/builtin.asm
1414
bin/gsh/builtin.asm
File diff suppressed because it is too large
Load Diff
2119
bin/gsh/cmd.asm
2119
bin/gsh/cmd.asm
File diff suppressed because it is too large
Load Diff
597
bin/gsh/dir.asm
597
bin/gsh/dir.asm
|
@ -6,20 +6,47 @@
|
|||
* Jawaid Bazyar
|
||||
* Tim Meekins
|
||||
*
|
||||
* $Id: dir.asm,v 1.9 1998/12/31 18:29:12 tribby Exp $
|
||||
*
|
||||
**************************************************************************
|
||||
*
|
||||
* DIR.ASM
|
||||
* By Tim Meekins
|
||||
* Modified by Dave Tribby for GNO 2.0.6
|
||||
*
|
||||
* Directory stack management
|
||||
*
|
||||
* Note: text set up for tabs at col 16, 22, 41, 49, 57, 65
|
||||
* | | | | | |
|
||||
* ^ ^ ^ ^ ^ ^
|
||||
**************************************************************************
|
||||
*
|
||||
* Interfaces defined in this file:
|
||||
*
|
||||
* InitDStack
|
||||
*
|
||||
* dirs built-in command
|
||||
*
|
||||
* pushd built-in command
|
||||
*
|
||||
* popd built-in command
|
||||
*
|
||||
* path2tilde
|
||||
*
|
||||
* getpfxstr
|
||||
*
|
||||
**************************************************************************
|
||||
|
||||
keep o/dir
|
||||
mcopy m/dir.mac
|
||||
mcopy /obj/gno/bin/gsh/dir.mac
|
||||
|
||||
dummydir start ; ends up in .root
|
||||
end
|
||||
|
||||
setcom 60
|
||||
|
||||
MAXD gequ 50
|
||||
|
||||
|
||||
**************************************************************************
|
||||
*
|
||||
* Initialize directory stack
|
||||
|
@ -36,7 +63,7 @@ InitDStack START
|
|||
|
||||
rts
|
||||
|
||||
END
|
||||
END
|
||||
|
||||
**************************************************************************
|
||||
*
|
||||
|
@ -52,15 +79,20 @@ dirs START
|
|||
using DirData
|
||||
|
||||
arg equ 0
|
||||
space equ arg+4
|
||||
status equ arg+4
|
||||
space equ status+2
|
||||
|
||||
subroutine (4:argv,2:argc),space
|
||||
|
||||
lock DirMutex
|
||||
|
||||
stz status
|
||||
lda argc
|
||||
dec a
|
||||
beq showshort
|
||||
dec a
|
||||
bne using
|
||||
|
||||
ldy #4
|
||||
lda [argv],y
|
||||
sta arg
|
||||
|
@ -79,18 +111,20 @@ space equ arg+4
|
|||
using ldx #^usingstr
|
||||
lda #usingstr
|
||||
jsr errputs
|
||||
inc status Return status = 1.
|
||||
bra exit
|
||||
|
||||
showlong jsl dotods
|
||||
showlong jsl dotods Set top of stack to current directory.
|
||||
pea 0
|
||||
jsl showdir
|
||||
bra exit
|
||||
|
||||
showshort jsl dotods
|
||||
showshort jsl dotods Set top of stack to current directory.
|
||||
pea 1
|
||||
jsl showdir
|
||||
|
||||
exit return
|
||||
exit unlock DirMutex
|
||||
return 2:status
|
||||
|
||||
usingstr dc c'usage: dirs [-l]',h'0d00'
|
||||
|
||||
|
@ -113,50 +147,59 @@ pushd START
|
|||
count equ 0
|
||||
p equ count+2
|
||||
arg equ p+4
|
||||
space equ arg+4
|
||||
status equ arg+4
|
||||
space equ status+2
|
||||
|
||||
subroutine (4:argv,2:argc),space
|
||||
|
||||
lda argc
|
||||
dec a
|
||||
beq xchange
|
||||
dec a
|
||||
bne usage
|
||||
lock DirMutex
|
||||
stz status
|
||||
lda argc Get number of arguments.
|
||||
dec a If no parameters,
|
||||
beq xchange exchange top two dirs on stack.
|
||||
dec a If > 1 parameter,
|
||||
bne usage print usage string.
|
||||
|
||||
ldy #4
|
||||
lda [argv],y
|
||||
sta arg
|
||||
ldy #4 Move parameter pointer from
|
||||
lda [argv],y argv array to direct
|
||||
sta arg page variable "arg".
|
||||
ldy #6
|
||||
lda [argv],y
|
||||
sta arg+2
|
||||
lda [arg]
|
||||
and #$FF
|
||||
cmp #'+'
|
||||
beq rotate
|
||||
jmp godir
|
||||
|
||||
lda [arg] If first character
|
||||
and #$FF of parameter is
|
||||
cmp #'+' "+",
|
||||
beq rotate do the rotate;
|
||||
jmp godir else push the directory.
|
||||
|
||||
;
|
||||
; More than one parameter provided; print usage string and exit.
|
||||
;
|
||||
usage ldx #^usagestr
|
||||
lda #usagestr
|
||||
jsr errputs
|
||||
jmp exit
|
||||
jmp prerrmsg
|
||||
|
||||
xchange lda tods
|
||||
bne xgoodie
|
||||
ldx #^err1
|
||||
lda #err1
|
||||
jsr errputs
|
||||
jmp exit
|
||||
xgoodie jsl dotods
|
||||
;
|
||||
; Either no parameter or "+" provided; exchange directory stack entries.
|
||||
;
|
||||
xchange lda tods Get index to top of dir stack.
|
||||
bne xgoodie If 0,
|
||||
ldx #^err1 print error message
|
||||
lda #err1 "No other directory"
|
||||
jmp prerrmsg
|
||||
|
||||
xgoodie jsl dotods Set top of stack to current directory.
|
||||
lda tods
|
||||
dec a
|
||||
asl a
|
||||
asl a
|
||||
tax
|
||||
tax X = offset to tos-1.
|
||||
lda tods
|
||||
asl a
|
||||
asl a
|
||||
tay
|
||||
lda dirstack,x
|
||||
tay Y = offset to tos.
|
||||
lda dirstack,x Swap tos-1 and tos.
|
||||
pha
|
||||
lda dirstack,y
|
||||
sta dirstack,x
|
||||
|
@ -168,29 +211,36 @@ xgoodie jsl dotods
|
|||
sta dirstack+2,x
|
||||
pla
|
||||
sta dirstack+2,y
|
||||
jmp gototop
|
||||
|
||||
jmp gototop chdir to the new tos.
|
||||
|
||||
;
|
||||
; Parameter = +n; do the rotate
|
||||
;
|
||||
rotate add4 arg,#1,p
|
||||
pei (p+2)
|
||||
pei (p)
|
||||
jsr cstrlen
|
||||
tax
|
||||
Dec2Int (p,@x,#0),@a
|
||||
sta count
|
||||
cmp #0
|
||||
beq godir
|
||||
lda tods
|
||||
beq roterr
|
||||
lda count
|
||||
cmp tods
|
||||
Dec2Int (p,@x,#0),@a Convert parameter to decimal
|
||||
sta count and store in count.
|
||||
cmp #0 If parameter is 0
|
||||
beq badnum or negative,
|
||||
bmi badnum report "invalid number".
|
||||
cmp tods If count >= tos,
|
||||
beq rotloop
|
||||
bcc rotloop
|
||||
|
||||
roterr ldx #^err2
|
||||
lda #err2
|
||||
jsr errputs
|
||||
jmp exit
|
||||
roterr ldx #^err2 Print error message:
|
||||
lda #err2 Directory stack not that deep
|
||||
jmp prerrmsg
|
||||
|
||||
badnum ldx #^errbadnum Print error message:
|
||||
lda #errbadnum Invalid number
|
||||
jmp prerrmsg
|
||||
|
||||
;
|
||||
; Loop to rotate entries in directory stack
|
||||
;
|
||||
rotloop lda tods
|
||||
dec a
|
||||
asl a
|
||||
|
@ -217,25 +267,9 @@ nextrot pla
|
|||
sta dirstack+2
|
||||
dec count
|
||||
bne rotloop
|
||||
bra gototop
|
||||
|
||||
godir jsl dotods
|
||||
pei (arg+2)
|
||||
pei (arg)
|
||||
jsl gotodir
|
||||
bne exit
|
||||
|
||||
inc tods
|
||||
lda tods
|
||||
asl a
|
||||
asl a
|
||||
tay
|
||||
lda #0
|
||||
sta dirstack,y
|
||||
sta dirstack+2,y
|
||||
jsl dotods
|
||||
bra done
|
||||
|
||||
;
|
||||
; chdir to the top-of-stack directory
|
||||
;
|
||||
gototop lda tods
|
||||
asl a
|
||||
asl a
|
||||
|
@ -245,17 +279,52 @@ gototop lda tods
|
|||
lda dirstack,y
|
||||
pha
|
||||
jsl gotodir
|
||||
bra done All done.
|
||||
|
||||
done lda varpushdsil
|
||||
|
||||
;
|
||||
; Parameter = directory name; add it to the stack
|
||||
;
|
||||
godir anop
|
||||
lda tods
|
||||
cmp #MAXD-1 If index >= maximum,
|
||||
bcc stackok
|
||||
ldx #^errfull print error message.
|
||||
lda #errfull
|
||||
prerrmsg jsr errputs
|
||||
inc status Return status = 1.
|
||||
bra exit
|
||||
stackok anop
|
||||
jsl dotods Set top of stack to current directory.
|
||||
pei (arg+2)
|
||||
pei (arg)
|
||||
jsl gotodir chdir to the parameter directory.
|
||||
bne exit
|
||||
|
||||
inc tods Bump the top of stack pointer.
|
||||
lda tods
|
||||
asl a
|
||||
asl a
|
||||
tay
|
||||
lda #0
|
||||
sta dirstack,y
|
||||
sta dirstack+2,y
|
||||
jsl dotods Set top of stack to current directory.
|
||||
|
||||
done lda varpushdsil If $PUSHDSILENT not defined,
|
||||
bne exit
|
||||
pea 1
|
||||
jsl showdir
|
||||
jsl showdir show the directory stack.
|
||||
|
||||
exit return
|
||||
exit unlock DirMutex
|
||||
return 2:status
|
||||
|
||||
usagestr dc c'usage: pushd [+n | dir]',h'0d00'
|
||||
err1 dc c'pushd: No other directory',h'0d00'
|
||||
err2 dc c'pushd: Directory stack not that deep',h'0d00'
|
||||
errfull dc c'pushd: Directory stack full',h'0d00'
|
||||
errbadnum dc c'pushd: Invalid number',h'0d00'
|
||||
|
||||
|
||||
END
|
||||
|
||||
|
@ -275,10 +344,13 @@ popd START
|
|||
|
||||
count equ 0
|
||||
arg equ count+2
|
||||
space equ arg+4
|
||||
status equ arg+4
|
||||
space equ status+2
|
||||
|
||||
subroutine (4:argv,2:argc),space
|
||||
|
||||
lock DirMutex
|
||||
stz status
|
||||
lda argc
|
||||
dec a
|
||||
jeq noarg
|
||||
|
@ -298,6 +370,7 @@ space equ arg+4
|
|||
using ldx #^usingstr
|
||||
lda #usingstr
|
||||
jsr errputs
|
||||
inc status Return status = 1.
|
||||
jmp exit
|
||||
|
||||
plus add4 arg,#1,arg
|
||||
|
@ -319,9 +392,10 @@ plus add4 arg,#1,arg
|
|||
pluserr ldx #^err2
|
||||
lda #err2
|
||||
jsr errputs
|
||||
inc status Return status = 1.
|
||||
bra exit
|
||||
|
||||
doplus jsl dotods
|
||||
doplus jsl dotods Set top of stack to current directory.
|
||||
sub2 tods,count,@a
|
||||
asl a
|
||||
asl a
|
||||
|
@ -350,6 +424,7 @@ noarg lda tods
|
|||
ldx #^err1
|
||||
lda #err1
|
||||
jsr errputs
|
||||
inc status Return status = 1.
|
||||
bra exit
|
||||
|
||||
noarg0 lda tods
|
||||
|
@ -379,7 +454,8 @@ gototop lda tods
|
|||
pea 1
|
||||
jsl showdir
|
||||
|
||||
exit return
|
||||
exit unlock DirMutex
|
||||
return 2:status
|
||||
|
||||
usingstr dc c'Usage: popd [+n]',h'0d00'
|
||||
err1 dc c'popd: Directory stack empty',h'0d00'
|
||||
|
@ -402,7 +478,7 @@ space equ retval+2
|
|||
|
||||
stz retval
|
||||
|
||||
pei (dir+2)
|
||||
pei (dir+2)
|
||||
pei (dir)
|
||||
jsr c2gsstr
|
||||
sta PRecPath
|
||||
|
@ -414,8 +490,8 @@ space equ retval+2
|
|||
|
||||
GetFileInfo GRec
|
||||
bcc ok
|
||||
ohshit sta Err
|
||||
Error Err
|
||||
ohshit sta ErrError
|
||||
ErrorGS Err
|
||||
inc retval
|
||||
bra done
|
||||
|
||||
|
@ -441,20 +517,25 @@ done ph4 PRecPath
|
|||
|
||||
mutex key
|
||||
|
||||
PRec dc i'2'
|
||||
PRecNum dc i'0'
|
||||
PRecPath ds 4
|
||||
; Parameter block for GS/OS SetPrefix call
|
||||
PRec dc i'2' pCount
|
||||
PRecNum dc i'0' prefixNum (0 = current directory)
|
||||
PRecPath ds 4 Pointer to input prefix path
|
||||
|
||||
GRec dc i'3'
|
||||
GRecPath ds 4
|
||||
GRecAcc ds 2
|
||||
GRecFT ds 2
|
||||
; Parameter block for GS/OS GetFileInfo call
|
||||
GRec dc i'3' pCount
|
||||
GRecPath ds 4 Pointer to input pathname
|
||||
GRecAcc ds 2 access (result)
|
||||
GRecFT ds 2 fileType (result)
|
||||
|
||||
; Parameter block for shell ErrorGS call (p 393 in ORCA/M manual)
|
||||
Err dc i2'1' pCount
|
||||
ErrError ds 2 Error number
|
||||
|
||||
Err ds 2
|
||||
dirErr dc c': Not a directory',h'0d00'
|
||||
|
||||
|
||||
END
|
||||
|
||||
|
||||
**************************************************************************
|
||||
*
|
||||
* Display the directory stack
|
||||
|
@ -470,35 +551,39 @@ space equ idx+2
|
|||
|
||||
subroutine (2:flag),space
|
||||
|
||||
lda tods
|
||||
asl a
|
||||
asl a
|
||||
lda tods Get directory stack index.
|
||||
asl a Multiply by four to
|
||||
asl a get byte offset (idx).
|
||||
sta idx
|
||||
|
||||
loop lda flag
|
||||
loop lda flag If parameter == 1,
|
||||
beq long
|
||||
|
||||
ldy idx
|
||||
lda dirstack+2,y
|
||||
lda dirstack+2,y print entry
|
||||
pha
|
||||
lda dirstack,y
|
||||
pha
|
||||
jsl path2tilde
|
||||
phx
|
||||
jsl path2tilde but first substitute "~"
|
||||
phx for home directory.
|
||||
pha
|
||||
jsr puts
|
||||
jsl nullfree
|
||||
bra next
|
||||
long ldy idx
|
||||
lda dirstack+2,y
|
||||
bra next
|
||||
|
||||
long ldy idx else,
|
||||
lda dirstack+2,y print full entry.
|
||||
tax
|
||||
lda dirstack,y
|
||||
jsr puts
|
||||
next lda #' '
|
||||
|
||||
next lda #' ' Print a space.
|
||||
jsr putchar
|
||||
lda idx
|
||||
|
||||
lda idx If idx != 0,
|
||||
beq done
|
||||
sub2 idx,#4,idx
|
||||
bra loop
|
||||
sub2 idx,#4,idx idx = idx -4
|
||||
bra loop handle next entry.
|
||||
|
||||
done jsr newline
|
||||
|
||||
|
@ -522,60 +607,62 @@ space equ idx+2
|
|||
|
||||
subroutine (0:dummy),space
|
||||
|
||||
lda tods
|
||||
asl a
|
||||
asl a
|
||||
sta idx
|
||||
tay
|
||||
lda dirstack,y
|
||||
ora dirstack+2,y
|
||||
lda tods Get index number.
|
||||
asl a Multiply index by four
|
||||
asl a to get byte offset.
|
||||
sta idx Store in idx
|
||||
tay and Y-register.
|
||||
lda dirstack,y If there is an address
|
||||
ora dirstack+2,y in this position,
|
||||
beq setit
|
||||
|
||||
lda dirstack+2,y
|
||||
pha
|
||||
lda dirstack,y
|
||||
pha
|
||||
jsl nullfree
|
||||
jsl nullfree free it.
|
||||
|
||||
setit lock mutex
|
||||
jsl alloc256
|
||||
sta gppath
|
||||
stx gppath+2
|
||||
sta p
|
||||
stx P+2
|
||||
lda #254
|
||||
sta [p]
|
||||
GetPrefix gpparm
|
||||
ldy #2
|
||||
lda [p],y
|
||||
xba
|
||||
sta [p],y
|
||||
add4 p,#3,p
|
||||
pei (p+2)
|
||||
pei (p)
|
||||
jsr p2cstr
|
||||
setit pea 0
|
||||
jsl getpfxstr Get value of prefix 0.
|
||||
sta p
|
||||
stx p+2
|
||||
ldx gppath+2
|
||||
lda gppath
|
||||
jsl free256
|
||||
|
||||
unlock mutex
|
||||
ora p+2 If NULL pointer returned,
|
||||
beq done an error was reported.
|
||||
|
||||
ldy idx
|
||||
lda p
|
||||
sta dirstack,y
|
||||
ldy #2 If length of returned
|
||||
lda [p],y GS/OS string is 0,
|
||||
bne ok an error was reported.
|
||||
|
||||
ph4 p Free the buffer.
|
||||
jsl nullfree
|
||||
|
||||
bra done
|
||||
|
||||
;
|
||||
; Move text in GS/OS result buffer to beginning of buffer
|
||||
; (overwritting the two length words).
|
||||
;
|
||||
ok clc Source is result
|
||||
lda p buffer plus
|
||||
adc #4 four bytes.
|
||||
tay
|
||||
lda p+2
|
||||
adc #0
|
||||
pha
|
||||
phy
|
||||
pei (p+2) Destination is first
|
||||
pei (p) byte of buffer.
|
||||
jsr copycstr
|
||||
|
||||
ldy idx Store address of string
|
||||
lda p in current position
|
||||
sta dirstack,y of directory stack.
|
||||
lda p+2
|
||||
sta dirstack+2,y
|
||||
|
||||
return
|
||||
done return
|
||||
|
||||
mutex key
|
||||
|
||||
gpparm dc i2'2'
|
||||
dc i2'0'
|
||||
gppath dc i4'0'
|
||||
|
||||
END
|
||||
|
||||
**************************************************************************
|
||||
|
@ -588,6 +675,7 @@ DirData DATA
|
|||
|
||||
dirstack ds MAXD*4
|
||||
tods dc i'0'
|
||||
DirMutex key
|
||||
|
||||
END
|
||||
|
||||
|
@ -598,7 +686,7 @@ tods dc i'0'
|
|||
**************************************************************************
|
||||
|
||||
path2tilde START
|
||||
|
||||
|
||||
ptr equ 0
|
||||
newpath equ ptr+4
|
||||
home equ newpath+4
|
||||
|
@ -606,92 +694,215 @@ space equ home+4
|
|||
|
||||
subroutine (4:path),space
|
||||
|
||||
pei (path+2)
|
||||
pei (path)
|
||||
jsr cstrlen
|
||||
inc2 a
|
||||
pea 0
|
||||
pei (path+2) Get length of
|
||||
pei (path) path string
|
||||
jsr cstrlen parameter.
|
||||
inc2 a Add 2, and allocate
|
||||
pea 0 memory for result string.
|
||||
pha
|
||||
jsl ~NEW
|
||||
~NEW
|
||||
sta newpath
|
||||
stx newpath+2
|
||||
sta ptr
|
||||
stx ptr+2
|
||||
|
||||
jsl alloc256
|
||||
ph4 #homename Get $HOME environment variable.
|
||||
jsl getenv
|
||||
sta home
|
||||
stx home+2
|
||||
sta varparm+4
|
||||
stx varparm+6
|
||||
Read_Variable varparm
|
||||
ora home+2 If buffer wasn't allocated
|
||||
jeq notfound2 cannot search for $HOME.
|
||||
|
||||
ldy #0
|
||||
lda [home]
|
||||
and #$FF
|
||||
beq copyrest
|
||||
tax
|
||||
checkhome lda [path],y
|
||||
and #$FF
|
||||
beq notfound2
|
||||
jsr tolower
|
||||
jsr toslash
|
||||
pha
|
||||
iny
|
||||
ldy #2 Get result length word.
|
||||
lda [home],y
|
||||
and #$FF
|
||||
jsr tolower
|
||||
jsr toslash
|
||||
cmp 1,s
|
||||
bne notfound
|
||||
pla
|
||||
dex
|
||||
bne checkhome
|
||||
cmp #'/'
|
||||
beq notfound2 If 0, just copy the rest.
|
||||
tax Use X to count down HOME chars.
|
||||
ldy #0 path index is based from 0.
|
||||
checkhome lda [path],y
|
||||
and #$FF Isolate character in parameter,
|
||||
beq notfound2 checking for end of string,
|
||||
jsr tolower converting to lower-case
|
||||
jsr toslash and changing ":" to "/".
|
||||
pha Hold on stack for comparison.
|
||||
iny4 $home has 4 bytes of length info
|
||||
lda [home],y that need to be indexed over.
|
||||
dey2 Take back 3 of the offset,
|
||||
dey nudging Y ahead by 1.
|
||||
and #$FF Isolate $home character,
|
||||
jsr tolower converting to lower-case
|
||||
jsr toslash and changing ":" to "/".
|
||||
cmp 1,s If the parameter character !=,
|
||||
bne notfound there is no match.
|
||||
pla Pop the parameter character off stack.
|
||||
dex Decrement $home length counter.
|
||||
bne checkhome If more, stay in loop.
|
||||
|
||||
;
|
||||
; First part of parameter matched $HOME
|
||||
;
|
||||
cmp #'/' This char = "/"?
|
||||
beq found yes -- it's a match.
|
||||
lda [path],y If the following character
|
||||
and #$FF is zero (end of string),
|
||||
beq found
|
||||
lda [path],y
|
||||
and #$FF
|
||||
beq found
|
||||
jsr toslash
|
||||
jsr toslash '/', or ':', we have a match.
|
||||
cmp #'/'
|
||||
bne notfound2
|
||||
|
||||
found lda #'~'
|
||||
sta [ptr]
|
||||
inc ptr
|
||||
bra copyrest
|
||||
found lda #'~' Store '~' as first character
|
||||
sta [ptr] in result buffer, and bump
|
||||
incad ptr result pointer.
|
||||
bra copyrest
|
||||
|
||||
notfound pla
|
||||
notfound2 ldy #0
|
||||
;
|
||||
; First part of parameter does not match $HOME
|
||||
;
|
||||
notfound pla Get rid of comparison value on stack.
|
||||
notfound2 ldy #0 Not found: copy from beginning.
|
||||
|
||||
;
|
||||
; Copy remainder of parameter (Y-reg marks start) to destination string
|
||||
;
|
||||
copyrest short a
|
||||
copyloop lda [path],y
|
||||
beq endcopy
|
||||
cmp #':'
|
||||
bne copyput
|
||||
lda #'/'
|
||||
copyput sta [ptr]
|
||||
copyput sta [ptr]
|
||||
long a
|
||||
inc ptr
|
||||
incad ptr
|
||||
short a
|
||||
iny
|
||||
bra copyloop
|
||||
endcopy sta [ptr]
|
||||
long a
|
||||
dec ptr
|
||||
lda [ptr]
|
||||
dec ptr If final character
|
||||
lda [ptr] was "/",
|
||||
cmp #'/'
|
||||
bne skipshorten
|
||||
lda #0
|
||||
lda #0 obliterate it.
|
||||
sta [ptr]
|
||||
|
||||
skipshorten ldx home+2
|
||||
lda home
|
||||
jsl free256
|
||||
skipshorten pei (home+2) Free memory allocated
|
||||
pei (home) for the value of $HOME.
|
||||
jsl nullfree
|
||||
|
||||
return 4:newpath
|
||||
|
||||
varparm dc i4'homename'
|
||||
ds 4
|
||||
|
||||
homename str 'home'
|
||||
homename gsstr 'home' Env variable name
|
||||
|
||||
END
|
||||
|
||||
|
||||
**************************************************************************
|
||||
*
|
||||
* Return pointer to current directory (\0) GS/OS string in a/x
|
||||
*
|
||||
**************************************************************************
|
||||
|
||||
getpfxstr START
|
||||
|
||||
p equ 0
|
||||
space equ p+4
|
||||
|
||||
subroutine (2:pnum),space
|
||||
|
||||
lock mutex
|
||||
|
||||
; Use dummy GS/OS result buf to get length of pathname
|
||||
;
|
||||
lda pnum Put prefix num into
|
||||
cmp #$FFFF If it's $FFFF,
|
||||
beq doboot use GetBootVol, not GetPrefix.
|
||||
|
||||
sta gpnum Store prefix num in parameter block.
|
||||
ld4 TempResultBuf,gppath
|
||||
GetPrefix gpparm
|
||||
bra chklen
|
||||
|
||||
doboot ld4 TempResultBuf,gbpath
|
||||
GetBootVol gbparm
|
||||
|
||||
chklen lda TempRBlen Use that length
|
||||
clc plus five (for
|
||||
adc #5 len words and terminator)
|
||||
pea 0 to allocate memory
|
||||
pha that holds the string.
|
||||
~NEW
|
||||
sta p Store result in
|
||||
stx p+2 direct page pointer.
|
||||
|
||||
ora p+2 If memory was not available,
|
||||
bne memok
|
||||
lda #0201 report memory error and
|
||||
bra rpterr return NULL to user.
|
||||
|
||||
|
||||
memok lda TempRBlen Store result buf
|
||||
inc2 a length at start
|
||||
inc2 a of buffer.
|
||||
sta [p]
|
||||
|
||||
tay Store a null byte
|
||||
short a at the end of the
|
||||
lda #0 string so it can
|
||||
sta [p],y be used as a c-string.
|
||||
long a
|
||||
;
|
||||
; Get the prefix string into the newly allocated buffer.
|
||||
;
|
||||
lda pnum Prefix number tells
|
||||
cmp #$FFFF whether to use
|
||||
beq doboot2 GetPrefix or GetBootVol.
|
||||
|
||||
mv4 p,gppath
|
||||
GetPrefix gpparm
|
||||
bcs rpterr
|
||||
bra done
|
||||
|
||||
doboot2 mv4 p,gbpath
|
||||
GetBootVol gbparm
|
||||
bcc done If there was an error,
|
||||
|
||||
rpterr sta errError Save the value
|
||||
ErrorGS err and report it.
|
||||
ldy #2 Set length of returned
|
||||
lda #0 string to 0 so caller
|
||||
sta [p],y can detect error condition.
|
||||
|
||||
done unlock mutex
|
||||
|
||||
;
|
||||
; Return pointer to caller. (Caller has responsibility to deallocate.)
|
||||
;
|
||||
return 4:p
|
||||
|
||||
mutex key
|
||||
|
||||
;
|
||||
; Parameter block for GetPrefix GS/OS call
|
||||
;
|
||||
gpparm dc i2'2' pCount
|
||||
gpnum dc i2'0' prefixNum (from parameter)
|
||||
gppath dc i4'0' prefix returned to this GS/OS buffer.
|
||||
|
||||
;
|
||||
; Parameter block for GetBootVol GS/OS call
|
||||
;
|
||||
gbparm dc i2'1' pCount
|
||||
gbpath dc i4'0' prefix returned to this GS/OS buffer.
|
||||
|
||||
;
|
||||
; GS/OS result buffer for getting the full length of the prefix string
|
||||
;
|
||||
TempResultBuf dc i2'5' Only five bytes total.
|
||||
TempRBlen ds 2 String's length returned here.
|
||||
ds 1 Only 1 byte for value.
|
||||
|
||||
;
|
||||
; Parameter block for shell ErrorGS call (p 393 in ORCA/M manual)
|
||||
;
|
||||
err dc i2'1' pCount
|
||||
errError ds 2 Error number
|
||||
|
||||
END
|
||||
|
|
1070
bin/gsh/edit.asm
1070
bin/gsh/edit.asm
File diff suppressed because it is too large
Load Diff
1048
bin/gsh/expand.asm
1048
bin/gsh/expand.asm
File diff suppressed because it is too large
Load Diff
9
bin/gsh/gsh.desc
Normal file
9
bin/gsh/gsh.desc
Normal file
|
@ -0,0 +1,9 @@
|
|||
Name: gsh
|
||||
Version: 2.0 (14 January 1999)
|
||||
Shell: GNO
|
||||
Author: Tim Meekins; updated by Dave Tribby
|
||||
Contact: tribby@cup.hp.com
|
||||
Where: /bin
|
||||
FTP: ftp.gno.org
|
||||
|
||||
The GNO Shell.
|
1986
bin/gsh/gsh.mac
Normal file
1986
bin/gsh/gsh.mac
Normal file
File diff suppressed because it is too large
Load Diff
35
bin/gsh/gsh.rez
Normal file
35
bin/gsh/gsh.rez
Normal file
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* Resources for version and comment
|
||||
*
|
||||
* $Id: gsh.rez,v 1.13 1999/11/30 17:53:27 tribby Exp $
|
||||
*/
|
||||
|
||||
#define PROG "gsh"
|
||||
#define DESC "GNO/Shell\n"
|
||||
|
||||
#include "Types.rez"
|
||||
#include "builddate.rez"
|
||||
|
||||
/*
|
||||
* Version
|
||||
*/
|
||||
resource rVersion (1, purgeable3) {
|
||||
{ 2, 0, 0, /* Version 2.0.0 */
|
||||
alpha, /* development|alpha|beta|final|release */
|
||||
1 }, /* non-final release number */
|
||||
verUS, /* Country */
|
||||
PROG, /* Program name */
|
||||
DESC
|
||||
BUILD_DATE
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Comment
|
||||
*/
|
||||
resource rComment (1, purgeable3) {
|
||||
PROG " v2.0\n"
|
||||
DESC
|
||||
"Written by Tim Meekins. Updated by Dave Tribby\n"
|
||||
BUILD_DATE
|
||||
};
|
1434
bin/gsh/hash.asm
1434
bin/gsh/hash.asm
File diff suppressed because it is too large
Load Diff
|
@ -6,10 +6,13 @@
|
|||
* Jawaid Bazyar
|
||||
* Tim Meekins
|
||||
*
|
||||
* $Id: history.asm,v 1.8 1999/02/08 17:26:50 tribby Exp $
|
||||
*
|
||||
**************************************************************************
|
||||
*
|
||||
* HISTORY.ASM
|
||||
* By Tim Meekins
|
||||
* Modified by Dave Tribby for GNO 2.0.6
|
||||
*
|
||||
* Routines for dealing with history buffers.
|
||||
*
|
||||
|
@ -20,15 +23,42 @@
|
|||
* Where historyRec is:
|
||||
*
|
||||
* [+0] NextHistory: pointer to historyRec
|
||||
* [+4] HistoryCmd: string of characters
|
||||
* [+4] HistoryCmd: string of characters
|
||||
*
|
||||
* Note: text set up for tabs at col 16, 22, 41, 49, 57, 65
|
||||
* | | | | | |
|
||||
* ^ ^ ^ ^ ^ ^
|
||||
**************************************************************************
|
||||
*
|
||||
* Interfaces defined in this file:
|
||||
*
|
||||
* InsertHistory
|
||||
*
|
||||
* PrevHistory
|
||||
*
|
||||
* NextHistory
|
||||
*
|
||||
* SaveHistory
|
||||
*
|
||||
* ReadHistory
|
||||
*
|
||||
* InitHistory
|
||||
*
|
||||
* PrintHistory
|
||||
*
|
||||
**************************************************************************
|
||||
|
||||
keep o/history
|
||||
mcopy m/history.mac
|
||||
mcopy /obj/gno/bin/gsh/history.mac
|
||||
|
||||
histNext gequ 0
|
||||
histCmd gequ 4
|
||||
dummyhistory start ; ends up in .root
|
||||
end
|
||||
|
||||
setcom 60
|
||||
|
||||
histNext gequ 0
|
||||
histCmd gequ 4
|
||||
|
||||
cmdbuflen gequ 1024
|
||||
|
||||
;=========================================================================
|
||||
;
|
||||
|
@ -36,41 +66,42 @@ histCmd gequ 4
|
|||
;
|
||||
;=========================================================================
|
||||
|
||||
InsertHistory START
|
||||
|
||||
using HistoryData
|
||||
using global
|
||||
InsertHistory START
|
||||
|
||||
using HistoryData
|
||||
using global
|
||||
|
||||
ptr2 equ 0
|
||||
ptr equ ptr2+4
|
||||
len equ ptr+4
|
||||
space equ len+2
|
||||
histvalptr equ len+2
|
||||
space equ histvalptr+4
|
||||
|
||||
subroutine (4:cmd),space
|
||||
|
||||
pei (cmd+2)
|
||||
pei (cmd)
|
||||
jsr cstrlen
|
||||
sta len
|
||||
pea 0
|
||||
sta len
|
||||
pea 0
|
||||
clc
|
||||
adc #4+1
|
||||
pha
|
||||
jsl ~NEW
|
||||
sta ptr
|
||||
stx ptr+2
|
||||
ora ptr+2
|
||||
beq putdone
|
||||
pha
|
||||
~NEW
|
||||
sta ptr
|
||||
stx ptr+2
|
||||
ora ptr+2
|
||||
beq putdone
|
||||
|
||||
inc lasthist
|
||||
inc numhist
|
||||
inc lasthist
|
||||
inc numhist
|
||||
|
||||
lda historyptr ;Set up linked list pointers
|
||||
sta [ptr]
|
||||
ldy #histNext+2
|
||||
lda historyptr+2
|
||||
sta [ptr],y
|
||||
mv4 ptr,historyptr
|
||||
lda historyptr ;Set up linked list pointers
|
||||
sta [ptr]
|
||||
ldy #histNext+2
|
||||
lda historyptr+2
|
||||
sta [ptr],y
|
||||
mv4 ptr,historyptr
|
||||
|
||||
pei (cmd+2)
|
||||
pei (cmd)
|
||||
|
@ -85,67 +116,90 @@ space equ len+2
|
|||
;
|
||||
putdone anop
|
||||
|
||||
Read_Variable RVParm
|
||||
lda buffer
|
||||
and #$FF
|
||||
beq alldone
|
||||
Dec2Int (#buffer+1,@a,#0),@a
|
||||
sta size
|
||||
beq alldone
|
||||
;
|
||||
; Get value of $HISTORY environment variable
|
||||
;
|
||||
ph4 #historyStr
|
||||
jsl getenv
|
||||
sta histvalptr Save pointer to GS/OS result buffer.
|
||||
stx histvalptr+2
|
||||
ora histvalptr+2 If buffer wasn't allocated,
|
||||
jeq goback all done.
|
||||
;
|
||||
; Call Dec2Int to convert value of string into an integer
|
||||
;
|
||||
pha Reserve room on stack for result.
|
||||
lda histvalptr Get pointer to $HISTORY value.
|
||||
ldx histvalptr+2
|
||||
clc Add 4 to address to skip
|
||||
adc #4 over length words.
|
||||
bcc pushaddr
|
||||
inx
|
||||
pushaddr phx Push address onto stack.
|
||||
pha
|
||||
ldy #2
|
||||
lda [histvalptr],y
|
||||
pha Push length.
|
||||
pea 0 Push signedFlag = 0 (unsigned)
|
||||
Tool $280b Dec2Int.
|
||||
pla Get result.
|
||||
sta size
|
||||
beq alldone
|
||||
;
|
||||
; Follow linked list until we reach size histories
|
||||
;
|
||||
mv4 historyptr,ptr
|
||||
ldy #histNext+2
|
||||
follow lda [ptr]
|
||||
tax
|
||||
ora [ptr],y
|
||||
beq alldone ;not enough
|
||||
dec size
|
||||
beq prune
|
||||
lda [ptr],y
|
||||
sta ptr+2
|
||||
stx ptr
|
||||
bra follow
|
||||
mv4 historyptr,ptr
|
||||
ldy #histNext+2
|
||||
follow lda [ptr]
|
||||
tax
|
||||
ora [ptr],y
|
||||
beq alldone ;not enough
|
||||
dec size
|
||||
beq prune
|
||||
lda [ptr],y
|
||||
sta ptr+2
|
||||
stx ptr
|
||||
bra follow
|
||||
;
|
||||
; we have enough, start pruning
|
||||
;
|
||||
prune lda [ptr]
|
||||
sta ptr2
|
||||
lda [ptr],y
|
||||
sta ptr2+2
|
||||
lda #0
|
||||
sta [ptr]
|
||||
sta [ptr],y ;terminate last history
|
||||
prune lda [ptr]
|
||||
sta ptr2
|
||||
lda [ptr],y
|
||||
sta ptr2+2
|
||||
lda #0
|
||||
sta [ptr]
|
||||
sta [ptr],y ;terminate last history
|
||||
;
|
||||
; Dispose remaining
|
||||
;
|
||||
dispose lda ptr2
|
||||
dispose lda ptr2
|
||||
ora ptr2+2
|
||||
beq alldone
|
||||
dec numhist
|
||||
lda [ptr2]
|
||||
sta ptr
|
||||
lda [ptr2],y
|
||||
sta ptr+2
|
||||
pei (ptr2+2)
|
||||
pei (ptr2)
|
||||
jsl nullfree
|
||||
lda ptr
|
||||
sta ptr2
|
||||
lda ptr+2
|
||||
sta ptr2+2
|
||||
ldy #histNext+2
|
||||
bra dispose
|
||||
lda [ptr2]
|
||||
sta ptr
|
||||
lda [ptr2],y
|
||||
sta ptr+2
|
||||
pei (ptr2+2)
|
||||
pei (ptr2)
|
||||
jsl nullfree
|
||||
lda ptr
|
||||
sta ptr2
|
||||
lda ptr+2
|
||||
sta ptr2+2
|
||||
ldy #histNext+2
|
||||
bra dispose
|
||||
|
||||
alldone return
|
||||
alldone pei (histvalptr+2)
|
||||
pei (histvalptr)
|
||||
jsl nullfree
|
||||
|
||||
RVParm dc a4'historyStr'
|
||||
dc a4'buffer'
|
||||
goback return
|
||||
|
||||
size ds 2
|
||||
size ds 2
|
||||
|
||||
END
|
||||
END
|
||||
|
||||
;=========================================================================
|
||||
;
|
||||
|
@ -154,23 +208,23 @@ size ds 2
|
|||
;
|
||||
;=========================================================================
|
||||
|
||||
PrevHistory START
|
||||
PrevHistory START
|
||||
|
||||
using HistoryData
|
||||
using global
|
||||
using HistoryData
|
||||
using global
|
||||
using termdata
|
||||
|
||||
ora2 historyptr,historyptr+2,@a ;If no history, then skip
|
||||
jeq ctl5a
|
||||
ora2 historyptr,historyptr+2,@a ;If no history, then skip
|
||||
jeq ctl5a
|
||||
|
||||
ldx cmdloc ;Move cursor to beginning of line
|
||||
ldx cmdloc ;Move cursor to beginning of line
|
||||
jsr moveleft
|
||||
|
||||
lda cdcap
|
||||
ora cdcap
|
||||
beq ctl5b0
|
||||
tputs (cdcap,#0,#outc)
|
||||
bra ctl5g
|
||||
bra ctl5g
|
||||
|
||||
ctl5b0 ldx cmdlen ;clear line
|
||||
ctl5b dex
|
||||
|
@ -183,47 +237,47 @@ ctl5b dex
|
|||
ctl5c ldx cmdlen
|
||||
jsr moveleft
|
||||
|
||||
ctl5g ora2 currenthist,currenthist+2,@a
|
||||
bne ctl5i ;If not set up for current hist then
|
||||
lda historyptr+2 ;Set up at start.
|
||||
ldx historyptr
|
||||
ldy #2
|
||||
bra ctl5j
|
||||
ctl5g ora2 currenthist,currenthist+2,@a
|
||||
bne ctl5i ;If not set up for current hist then
|
||||
lda historyptr+2 ;Set up at start.
|
||||
ldx historyptr
|
||||
ldy #2
|
||||
bra ctl5j
|
||||
|
||||
ctl5i mv4 currenthist,0 ;Otherwise move to previous history
|
||||
stz cmdlen
|
||||
stz cmdloc
|
||||
ldy #HistNext+2
|
||||
lda [0]
|
||||
tax
|
||||
lda [0],y
|
||||
ctl5i mv4 currenthist,0 ;Otherwise move to previous history
|
||||
stz cmdlen
|
||||
stz cmdloc
|
||||
ldy #HistNext+2
|
||||
lda [0]
|
||||
tax
|
||||
lda [0],y
|
||||
|
||||
ctl5j sta 0+2 ;Save some pointers
|
||||
stx 0
|
||||
sta currenthist+2
|
||||
stx currenthist
|
||||
ora 0 ;If ptr is 0 then at end, quit
|
||||
beq ctl5a
|
||||
ctl5j sta 0+2 ;Save some pointers
|
||||
stx 0
|
||||
sta currenthist+2
|
||||
stx currenthist
|
||||
ora 0 ;If ptr is 0 then at end, quit
|
||||
beq ctl5a
|
||||
|
||||
ldx #0 ;Display and store command
|
||||
iny2
|
||||
ctl5h lda [0],y
|
||||
ldx #0 ;Display and store command
|
||||
iny2
|
||||
ctl5h lda [0],y
|
||||
and #$FF
|
||||
sta cmdline,x
|
||||
sta cmdline,x
|
||||
beq ctl5ha
|
||||
inx
|
||||
iny
|
||||
bra ctl5h
|
||||
ctl5ha stx cmdlen
|
||||
inx
|
||||
iny
|
||||
bra ctl5h
|
||||
ctl5ha stx cmdlen
|
||||
stx cmdloc
|
||||
|
||||
ldx #^cmdline
|
||||
lda #cmdline
|
||||
jsr puts
|
||||
|
||||
ctl5a rts
|
||||
ctl5a rts
|
||||
|
||||
END
|
||||
END
|
||||
|
||||
;=========================================================================
|
||||
;
|
||||
|
@ -232,37 +286,37 @@ ctl5a rts
|
|||
;
|
||||
;=========================================================================
|
||||
|
||||
NextHistory START
|
||||
NextHistory START
|
||||
|
||||
using HistoryData
|
||||
using global
|
||||
using HistoryData
|
||||
using global
|
||||
using termdata
|
||||
|
||||
ora2 historyptr,historyptr+2,@a ;No hist, then skip
|
||||
jeq ctl6a
|
||||
ora2 historyptr,historyptr+2,@a ;No hist, then skip
|
||||
jeq ctl6a
|
||||
|
||||
stz 4 ;Walk through linked list searching
|
||||
stz 4+2 ; for hist prior to last hist.
|
||||
mv4 historyptr,0
|
||||
ctl6i if2 0,ne,currenthist,ctl6j
|
||||
if2 0+2,eq,currenthist+2,ctl6k
|
||||
ctl6j mv4 0,4
|
||||
ldy #HistNext+2
|
||||
lda [0]
|
||||
tax
|
||||
lda [0],y
|
||||
sta 0+2
|
||||
stx 0
|
||||
bra ctl6i
|
||||
stz 4 ;Walk through linked list searching
|
||||
stz 4+2 ; for hist prior to last hist.
|
||||
mv4 historyptr,0
|
||||
ctl6i if2 0,ne,currenthist,ctl6j
|
||||
if2 0+2,eq,currenthist+2,ctl6k
|
||||
ctl6j mv4 0,4
|
||||
ldy #HistNext+2
|
||||
lda [0]
|
||||
tax
|
||||
lda [0],y
|
||||
sta 0+2
|
||||
stx 0
|
||||
bra ctl6i
|
||||
|
||||
ctl6k ldx cmdloc ;Move cursor to left
|
||||
ctl6k ldx cmdloc ;Move cursor to left
|
||||
jsr moveleft
|
||||
|
||||
lda cdcap
|
||||
ora cdcap
|
||||
beq ctl6b0
|
||||
tputs (cdcap,#0,#outc)
|
||||
bra ctl6g
|
||||
bra ctl6g
|
||||
|
||||
ctl6b0 ldx cmdlen ;clear line
|
||||
ctl6b dex
|
||||
|
@ -275,21 +329,21 @@ ctl6b dex
|
|||
ctl6c ldx cmdlen
|
||||
jsr moveleft
|
||||
|
||||
ctl6g stz cmdlen ;Get hist info.
|
||||
stz cmdloc
|
||||
mv4 4,currenthist
|
||||
ora2 4,4+2,@a
|
||||
beq ctl6a ;Whoops, back to end, quit
|
||||
ctl6g stz cmdlen ;Get hist info.
|
||||
stz cmdloc
|
||||
mv4 4,currenthist
|
||||
ora2 4,4+2,@a
|
||||
beq ctl6a ;Whoops, back to end, quit
|
||||
|
||||
ldx #0 ;Output the new command
|
||||
ldy #4
|
||||
ctl6h lda [4],y
|
||||
ldx #0 ;Output the new command
|
||||
ldy #4
|
||||
ctl6h lda [4],y
|
||||
and #$ff
|
||||
sta cmdline,x
|
||||
sta cmdline,x
|
||||
beq ctl6ha
|
||||
iny
|
||||
inx
|
||||
bra ctl6h
|
||||
iny
|
||||
inx
|
||||
bra ctl6h
|
||||
ctl6ha stx cmdlen
|
||||
stx cmdloc
|
||||
|
||||
|
@ -297,9 +351,9 @@ ctl6ha stx cmdlen
|
|||
lda #cmdline
|
||||
jsr puts
|
||||
|
||||
ctl6a rts
|
||||
ctl6a rts
|
||||
|
||||
END
|
||||
END
|
||||
|
||||
;=========================================================================
|
||||
;
|
||||
|
@ -307,10 +361,15 @@ ctl6a rts
|
|||
;
|
||||
;=========================================================================
|
||||
|
||||
SaveHistory START
|
||||
SaveHistory START
|
||||
|
||||
using HistoryData
|
||||
using global
|
||||
using HistoryData
|
||||
using global
|
||||
|
||||
svhisvalptr equ 0
|
||||
space equ svhisvalptr+4
|
||||
|
||||
subroutine ,space
|
||||
|
||||
lda historyFN
|
||||
sta DestroyParm+2
|
||||
|
@ -320,39 +379,60 @@ SaveHistory START
|
|||
sta DestroyParm+4
|
||||
sta CreateParm+4
|
||||
sta OpenParm+6
|
||||
|
||||
Read_Variable RVParm
|
||||
lda buffer
|
||||
and #$FF
|
||||
jeq done
|
||||
Dec2Int (#buffer+1,@a,#0),size
|
||||
lda size
|
||||
jeq done
|
||||
;
|
||||
; Get value of $SAVEHISTORY environment variable
|
||||
;
|
||||
ph4 #savehistStr
|
||||
jsl getenv
|
||||
sta svhisvalptr Save pointer to GS/OS result buffer.
|
||||
stx svhisvalptr+2
|
||||
ora svhisvalptr+2 If buffer wasn't allocated,
|
||||
jeq goback all done.
|
||||
;
|
||||
; Call Dec2Int to convert value of string into an integer
|
||||
;
|
||||
pha Reserve room on stack for result.
|
||||
lda svhisvalptr Get pointer to $HISTORY value.
|
||||
ldx svhisvalptr+2
|
||||
clc Add 4 to address to skip
|
||||
adc #4 over length words.
|
||||
bcc pushaddr
|
||||
inx
|
||||
pushaddr phx Push address onto stack.
|
||||
pha
|
||||
ldy #2
|
||||
lda [svhisvalptr],y
|
||||
pha Push length.
|
||||
pea 0 Push signedFlag = 0 (unsigned)
|
||||
Tool $280b Dec2Int
|
||||
pla Get result.
|
||||
sta size
|
||||
jeq done
|
||||
;
|
||||
; Create and write history to file
|
||||
;
|
||||
Destroy DestroyParm
|
||||
Create CreateParm
|
||||
jcs done
|
||||
Open OpenParm
|
||||
bcs done
|
||||
mv2 OpenRef,(WriteRef,WriteCRRef,CloseRef)
|
||||
Destroy DestroyParm
|
||||
Create CreateParm
|
||||
jcs done
|
||||
Open OpenParm
|
||||
bcs done
|
||||
mv2 OpenRef,(WriteRef,WriteCRRef,CloseRef)
|
||||
|
||||
loop1 mv4 historyptr,0
|
||||
mv2 size,count
|
||||
ldy #histNext+2
|
||||
loop2 lda 0
|
||||
ora 0+2
|
||||
beq next
|
||||
lda [0]
|
||||
tax
|
||||
dec count
|
||||
beq write
|
||||
lda [0],y
|
||||
sta 0+2
|
||||
stx 0
|
||||
bra loop2
|
||||
write clc
|
||||
loop1 mv4 historyptr,0
|
||||
mv2 size,count
|
||||
ldy #histNext+2
|
||||
loop2 lda 0
|
||||
ora 0+2
|
||||
beq next
|
||||
lda [0]
|
||||
tax
|
||||
dec count
|
||||
beq write
|
||||
lda [0],y
|
||||
sta 0+2
|
||||
stx 0
|
||||
bra loop2
|
||||
write clc
|
||||
lda 0
|
||||
adc #4
|
||||
tax
|
||||
|
@ -363,53 +443,55 @@ write clc
|
|||
pha
|
||||
phx
|
||||
jsr cstrlen
|
||||
sta WriteReq
|
||||
Write WriteParm
|
||||
bcs doneclose
|
||||
Write WriteCR
|
||||
bcs doneclose
|
||||
next dec size
|
||||
bne loop1
|
||||
sta WriteReq
|
||||
Write WriteParm
|
||||
bcs doneclose
|
||||
Write WriteCR
|
||||
bcs doneclose
|
||||
next dec size
|
||||
bne loop1
|
||||
|
||||
doneclose Close CloseParm
|
||||
doneclose Close CloseParm
|
||||
|
||||
done rts
|
||||
done pei (svhisvalptr+2) Free $SAVEHISTORY value buffer
|
||||
pei (svhisvalptr)
|
||||
jsl nullfree
|
||||
|
||||
RVParm dc a4'savehistStr'
|
||||
dc a4'buffer'
|
||||
goback return
|
||||
|
||||
DestroyParm dc i2'1'
|
||||
dc a4'historyFN'
|
||||
|
||||
CreateParm dc i2'3'
|
||||
dc a4'historyFN'
|
||||
dc i2'$C3'
|
||||
dc i2'0'
|
||||
DestroyParm dc i2'1'
|
||||
dc a4'historyFN'
|
||||
|
||||
OpenParm dc i2'2'
|
||||
OpenRef ds 2
|
||||
dc a4'historyFN'
|
||||
CreateParm dc i2'3'
|
||||
dc a4'historyFN'
|
||||
dc i2'$C3'
|
||||
dc i2'0'
|
||||
|
||||
WriteParm dc i2'4'
|
||||
WriteRef ds 2
|
||||
WriteBuf dc a4'buffer'
|
||||
WriteReq ds 4
|
||||
ds 4
|
||||
OpenParm dc i2'2'
|
||||
OpenRef ds 2
|
||||
dc a4'historyFN'
|
||||
|
||||
WriteCR dc i2'4'
|
||||
WriteCRRef ds 2
|
||||
dc a4'CRBuf'
|
||||
dc i4'1'
|
||||
ds 4
|
||||
CRBuf dc i1'13'
|
||||
WriteParm dc i2'4'
|
||||
WriteRef ds 2
|
||||
WriteBuf dc a4'cmdline'
|
||||
WriteReq ds 4
|
||||
ds 4
|
||||
|
||||
CloseParm dc i2'1'
|
||||
CloseRef ds 2
|
||||
WriteCR dc i2'4'
|
||||
WriteCRRef ds 2
|
||||
dc a4'CRBuf'
|
||||
dc i4'1'
|
||||
ds 4
|
||||
CRBuf dc i1'13'
|
||||
|
||||
size ds 2
|
||||
count ds 2
|
||||
CloseParm dc i2'1'
|
||||
CloseRef ds 2
|
||||
|
||||
END
|
||||
size ds 2
|
||||
count ds 2
|
||||
|
||||
END
|
||||
|
||||
;=========================================================================
|
||||
;
|
||||
|
@ -417,65 +499,65 @@ count ds 2
|
|||
;
|
||||
;=========================================================================
|
||||
|
||||
ReadHistory START
|
||||
ReadHistory START
|
||||
|
||||
using HistoryData
|
||||
using global
|
||||
using HistoryData
|
||||
using global
|
||||
|
||||
lda historyFN
|
||||
sta OpenParm+4
|
||||
lda historyFN+2
|
||||
lda historyFN+2
|
||||
sta OpenParm+6
|
||||
|
||||
lda #0
|
||||
sta historyptr
|
||||
sta historyptr+2
|
||||
|
||||
Open OpenParm
|
||||
bcs done
|
||||
mv2 OpenRef,(ReadRef,NLRef,CloseRef)
|
||||
NewLine NLParm
|
||||
bcs doneclose
|
||||
|
||||
loop anop
|
||||
Read ReadParm
|
||||
bcs doneclose
|
||||
ldy ReadTrans
|
||||
beq doneclose
|
||||
dey
|
||||
lda #0
|
||||
sta buffer,y
|
||||
ph4 #buffer
|
||||
jsl InsertHistory
|
||||
bra loop
|
||||
sta historyptr
|
||||
sta historyptr+2
|
||||
|
||||
doneclose Close CloseParm
|
||||
Open OpenParm
|
||||
bcs done
|
||||
mv2 OpenRef,(ReadRef,NLRef,CloseRef)
|
||||
NewLine NLParm
|
||||
bcs doneclose
|
||||
|
||||
done rts
|
||||
loop anop
|
||||
Read ReadParm
|
||||
bcs doneclose
|
||||
ldy ReadTrans
|
||||
beq doneclose
|
||||
dey
|
||||
lda #0
|
||||
sta cmdline,y
|
||||
ph4 #cmdline
|
||||
jsl InsertHistory
|
||||
bra loop
|
||||
|
||||
OpenParm dc i2'2'
|
||||
OpenRef ds 2
|
||||
dc a4'historyFN'
|
||||
doneclose Close CloseParm
|
||||
|
||||
NLParm dc i2'4'
|
||||
NLRef ds 2
|
||||
dc i2'$7F'
|
||||
dc i2'1'
|
||||
dc a4'NLTable'
|
||||
NLTable dc i1'13'
|
||||
done rts
|
||||
|
||||
ReadParm dc i2'4'
|
||||
ReadRef ds 2
|
||||
dc a4'buffer'
|
||||
dc i4'1024'
|
||||
ReadTrans ds 4
|
||||
OpenParm dc i2'2'
|
||||
OpenRef ds 2
|
||||
dc a4'historyFN'
|
||||
|
||||
CloseParm dc i2'1'
|
||||
CloseRef ds 2
|
||||
NLParm dc i2'4'
|
||||
NLRef ds 2
|
||||
dc i2'$7F'
|
||||
dc i2'1'
|
||||
dc a4'NLTable'
|
||||
NLTable dc i1'13'
|
||||
|
||||
size ds 2
|
||||
ReadParm dc i2'4'
|
||||
ReadRef ds 2
|
||||
dc a4'cmdline'
|
||||
dc i4'cmdbuflen'
|
||||
ReadTrans ds 4
|
||||
|
||||
END
|
||||
CloseParm dc i2'1'
|
||||
CloseRef ds 2
|
||||
|
||||
size ds 2
|
||||
|
||||
END
|
||||
|
||||
;=========================================================================
|
||||
;
|
||||
|
@ -485,74 +567,89 @@ size ds 2
|
|||
InitHistory START
|
||||
using HistoryData
|
||||
|
||||
ph4 #histName
|
||||
jsl AppendHome
|
||||
stx historyFN+2
|
||||
sta historyFN
|
||||
ph4 #histName Create string
|
||||
jsl AppendHome $HOME/history
|
||||
stx historyFN+2 Store pointer to it
|
||||
sta historyFN in historyFN
|
||||
rts
|
||||
END
|
||||
|
||||
;=========================================================================
|
||||
;
|
||||
; Print History
|
||||
; Print History (this is the history command)
|
||||
;
|
||||
;=========================================================================
|
||||
|
||||
PrintHistory START
|
||||
PrintHistory START
|
||||
|
||||
using HistoryData
|
||||
using global
|
||||
using HistoryData
|
||||
using global
|
||||
|
||||
ptr equ 0
|
||||
space equ ptr+4
|
||||
ptr equ 0
|
||||
status equ ptr+4
|
||||
space equ status+2
|
||||
|
||||
subroutine (2:argc,4:argv),space
|
||||
subroutine (4:argv,2:argc),space
|
||||
|
||||
lda historyptr
|
||||
ora historyptr+2
|
||||
beq done
|
||||
stz status
|
||||
|
||||
lda numhist
|
||||
sta num
|
||||
loop1 mv4 historyptr,ptr
|
||||
lda num
|
||||
bmi done
|
||||
sta count
|
||||
loop2 lda count
|
||||
beq print
|
||||
ldy #histNext+2
|
||||
lda [ptr]
|
||||
tax
|
||||
lda [ptr],y
|
||||
sta ptr+2
|
||||
stx ptr
|
||||
ora ptr
|
||||
beq next
|
||||
dec count
|
||||
bra loop2
|
||||
lda argc
|
||||
dec a
|
||||
beq chkptr
|
||||
|
||||
print sub2 lasthist,num,@a
|
||||
Int2Dec (@a,#numbstr,#4,#0)
|
||||
ldx #^usage
|
||||
lda #usage
|
||||
jsr errputs
|
||||
inc status Return status = 1.
|
||||
bra done
|
||||
|
||||
chkptr lda historyptr
|
||||
ora historyptr+2
|
||||
beq done
|
||||
|
||||
lda numhist
|
||||
sta num
|
||||
loop1 mv4 historyptr,ptr
|
||||
lda num
|
||||
bmi done
|
||||
sta count
|
||||
loop2 lda count
|
||||
beq print
|
||||
ldy #histNext+2
|
||||
lda [ptr]
|
||||
tax
|
||||
lda [ptr],y
|
||||
sta ptr+2
|
||||
stx ptr
|
||||
ora ptr
|
||||
beq next
|
||||
dec count
|
||||
bra loop2
|
||||
|
||||
print sub2 lasthist,num,@a
|
||||
Int2Dec (@a,#numbstr,#4,#0)
|
||||
ldx #^numbstr
|
||||
lda #numbstr
|
||||
jsr puts
|
||||
clc
|
||||
ldx ptr+2
|
||||
lda ptr
|
||||
adc #4
|
||||
ok jsr puts
|
||||
clc
|
||||
ldx ptr+2
|
||||
lda ptr
|
||||
adc #4
|
||||
ok jsr puts
|
||||
jsr newline
|
||||
|
||||
next dec num
|
||||
bra loop1
|
||||
next dec num
|
||||
bra loop1
|
||||
|
||||
done return
|
||||
done return 2:status
|
||||
|
||||
numbstr dc c'0000: ',h'00'
|
||||
num ds 2
|
||||
count ds 2
|
||||
numbstr dc c'0000: ',h'00'
|
||||
num ds 2
|
||||
count ds 2
|
||||
|
||||
END
|
||||
usage dc c'Usage: history',h'0d00'
|
||||
|
||||
END
|
||||
|
||||
;=========================================================================
|
||||
;
|
||||
|
@ -560,15 +657,15 @@ count ds 2
|
|||
;
|
||||
;=========================================================================
|
||||
|
||||
HistoryData DATA
|
||||
HistoryData DATA
|
||||
|
||||
lasthist dc i2'0'
|
||||
numhist dc i2'0'
|
||||
currenthist ds 4
|
||||
historyptr dc i4'0'
|
||||
historyStr str 'HISTORY'
|
||||
savehistStr str 'SAVEHIST'
|
||||
histName dc c'/history',i1'0'
|
||||
lasthist dc i2'0'
|
||||
numhist dc i2'0'
|
||||
currenthist ds 4
|
||||
historyptr dc i4'0'
|
||||
historyStr gsstr 'HISTORY'
|
||||
savehistStr gsstr 'SAVEHIST'
|
||||
histName dc c'/history',i1'0'
|
||||
historyFN ds 4
|
||||
|
||||
END
|
||||
END
|
||||
|
|
File diff suppressed because it is too large
Load Diff
585
bin/gsh/jobs.asm
585
bin/gsh/jobs.asm
File diff suppressed because it is too large
Load Diff
|
@ -1,22 +0,0 @@
|
|||
o/main
|
||||
o/shell
|
||||
o/history
|
||||
o/prompt
|
||||
o/cmd
|
||||
o/expand
|
||||
o/invoke
|
||||
o/shellutil
|
||||
o/builtin
|
||||
o/hash
|
||||
o/alias
|
||||
o/dir
|
||||
o/shellvar
|
||||
o/jobs
|
||||
o/sv
|
||||
o/stdio
|
||||
o/orca
|
||||
o/edit
|
||||
o/term
|
||||
o/bufpool
|
||||
direct
|
||||
keep=gsh
|
|
@ -6,22 +6,61 @@
|
|||
* Jawaid Bazyar
|
||||
* Tim Meekins
|
||||
*
|
||||
* $Id: main.asm,v 1.9 1999/02/08 17:26:51 tribby Exp $
|
||||
*
|
||||
**************************************************************************
|
||||
*
|
||||
* MAIN.ASM
|
||||
* By Tim Meekins
|
||||
* Modified by Dave Tribby for GNO 2.0.6
|
||||
*
|
||||
* Startup portion of shell
|
||||
*
|
||||
* Note: text set up for tabs at col 16, 22, 41, 49, 57, 65
|
||||
* | | | | | |
|
||||
* ^ ^ ^ ^ ^ ^
|
||||
**************************************************************************
|
||||
|
||||
keep o/main
|
||||
mcopy m/main.mac
|
||||
mcopy /obj/gno/bin/gsh/main.mac
|
||||
|
||||
setcom 60
|
||||
|
||||
**************************************************************************
|
||||
|
||||
; Segment for direct-page and stack
|
||||
|
||||
stack data STACK ; ends up in main.root
|
||||
kind $12
|
||||
|
||||
; Define direct-page/stack and fill it with question marks it can be
|
||||
; examined for how much is used.
|
||||
|
||||
dc 128c'??' ; 256 bytes
|
||||
dc 128c'??' ; 512 bytes total
|
||||
dc 128c'????' ; 1024 bytes total
|
||||
dc 128c'????????' ; 2048 bytes total
|
||||
|
||||
end
|
||||
|
||||
**************************************************************************
|
||||
|
||||
init START
|
||||
|
||||
; Call the code to emulate C program startup:
|
||||
; store Accumulator in ~USER_ID, X- and Y- registers as ~COMMANDLINE
|
||||
; start up memory manager (~MM_INIT)
|
||||
; parse commandline (via ~GNO_PARSEARG) and push argc and arvg on stack
|
||||
|
||||
jml ~GNO_COMMAND
|
||||
|
||||
; Control continues with the entry point "MAIN". When MAIN returns to
|
||||
; ~GNO_COMMAND via rtl, it frees argv and argc before doing its own rtl.
|
||||
|
||||
END
|
||||
|
||||
MAIN START
|
||||
|
||||
MAIN START
|
||||
|
||||
using global
|
||||
|
||||
p equ 0
|
||||
|
@ -40,41 +79,44 @@ ok stz FastFlag
|
|||
stz CmdFlag
|
||||
stz ExecFlag
|
||||
|
||||
argloop dec argc
|
||||
jeq start
|
||||
; Parse gsh's command-line arguments.
|
||||
|
||||
argloop dec argc Decrement argument count.
|
||||
jeq go_start If none left, ready to start working.
|
||||
clc
|
||||
lda argv
|
||||
adc #4
|
||||
lda argv Point to next
|
||||
adc #4 argument pointer.
|
||||
sta argv
|
||||
ldy #2
|
||||
lda [argv]
|
||||
sta arg
|
||||
lda [argv] Set arg to point to
|
||||
sta arg the argument text.
|
||||
lda [argv],y
|
||||
sta arg+2
|
||||
lda [arg]
|
||||
and #$FF
|
||||
cmp #'-'
|
||||
beq intoption
|
||||
lda [arg] Get first character
|
||||
and #$FF of argument.
|
||||
cmp #'-' If it's a "-",
|
||||
beq intoption handle as an option.
|
||||
|
||||
; parse remaining args as a command to run
|
||||
|
||||
; Parse remaining args as a command to run (in ExecCmd)
|
||||
|
||||
inc ExecFlag
|
||||
inc FastFlag
|
||||
ph4 #1024
|
||||
jsl ~NEW
|
||||
ph4 maxline_size
|
||||
~NEW
|
||||
sta ExecCmd
|
||||
sta p
|
||||
stx ExecCmd+2
|
||||
stx p+2
|
||||
|
||||
cmd3 ldy #0
|
||||
cmd0 lda [arg],y
|
||||
cmd0 lda [arg],y
|
||||
and #$ff
|
||||
beq cmd1
|
||||
sta [p],y
|
||||
iny
|
||||
bra cmd0
|
||||
cmd1 lda #' '
|
||||
cmd1 lda #' '
|
||||
sta [p],y
|
||||
sec ;inc a
|
||||
tya
|
||||
|
@ -84,7 +126,7 @@ cmd1 lda #' '
|
|||
beq cmd2
|
||||
clc
|
||||
lda argv
|
||||
adc #4
|
||||
adc #4
|
||||
sta argv
|
||||
ldy #2
|
||||
lda [argv]
|
||||
|
@ -94,7 +136,10 @@ cmd1 lda #' '
|
|||
bra cmd3
|
||||
cmd2 lda #0
|
||||
sta [p]
|
||||
bra start
|
||||
go_start bra start
|
||||
|
||||
|
||||
; Parse an argument as an option (first character is "-")
|
||||
|
||||
intoption ldy #1
|
||||
optloop lda [arg],y
|
||||
|
@ -105,9 +150,12 @@ optloop lda [arg],y
|
|||
cmp #'c'
|
||||
beq parsec
|
||||
|
||||
; Option is not recognized.
|
||||
showusage ErrWriteCString #usage
|
||||
bra done
|
||||
|
||||
|
||||
; Option = "-f": Skip history, gshrc
|
||||
optf inc FastFlag
|
||||
|
||||
nextopt iny
|
||||
|
@ -117,7 +165,8 @@ nextarg cpy #1
|
|||
beq showusage
|
||||
jmp argloop
|
||||
|
||||
parsec clc
|
||||
; Option = "-c": execute shell commands found in file named by next argument
|
||||
parsec clc
|
||||
lda argv
|
||||
adc #4
|
||||
sta argv
|
||||
|
@ -128,6 +177,9 @@ parsec clc
|
|||
mv4 argv,CmdArgV
|
||||
mv2 argc,CmdArgC
|
||||
|
||||
;
|
||||
; When preliminary setup is complete, control transfers to here!
|
||||
;
|
||||
start case on
|
||||
jsl shell
|
||||
case off
|
||||
|
|
45
bin/gsh/man/alias.1
Normal file
45
bin/gsh/man/alias.1
Normal file
|
@ -0,0 +1,45 @@
|
|||
.TH ALIAS 1 "31 August 1996" GNO "Commands and Applications"
|
||||
.SH NAME
|
||||
.LP
|
||||
alias - define alternate command name (gsh builtin)
|
||||
.SH SYNOPSIS
|
||||
.LP
|
||||
.B alias
|
||||
[ name command ]
|
||||
.SH DESCRIPTION
|
||||
.LP
|
||||
The shell maintains a list of aliases that you can create, display,
|
||||
and modify using the
|
||||
.B alias
|
||||
and
|
||||
.B unalias
|
||||
commands.
|
||||
The shell checks the first word in each command to see if it matches
|
||||
the name of an existing alias.
|
||||
If it does, the command is reprocessed
|
||||
with the alias definition replacing its name; the history
|
||||
substitution mechanism is made available as though that command
|
||||
were the previous input line.
|
||||
This allows history substitutions,
|
||||
escaped with a backslash in the definition, to be replaced with
|
||||
actual command-line arguments when the alias is used.
|
||||
If no
|
||||
history substitution is called for, the arguments remain unchanged.
|
||||
.LP
|
||||
Aliases can be nested.
|
||||
That is, an alias definition can contain
|
||||
the name of another alias.
|
||||
Nested aliases are expanded before any
|
||||
history substitutions is applied.
|
||||
This is useful in pipelines such as
|
||||
.IP
|
||||
alias lm "ls \-l | more"
|
||||
.LP
|
||||
which when called, pipes the output of
|
||||
.BR ls (1)
|
||||
through
|
||||
.BR more (1).
|
||||
.LP
|
||||
Except for the first word, the name of the alias may not appear in its
|
||||
definition, nor in any alias referred to by its definition.
|
||||
Such loops are detected, and cause an error message.
|
26
bin/gsh/man/cd.1
Normal file
26
bin/gsh/man/cd.1
Normal file
|
@ -0,0 +1,26 @@
|
|||
.TH CD 1 "31 August 1996" GNO "Commands and Applications"
|
||||
.SH NAME
|
||||
.LP
|
||||
cd \- change working directory (gsh builtin)
|
||||
.SH SYNOPSIS
|
||||
.LP
|
||||
.B cd
|
||||
[
|
||||
.I directory
|
||||
]
|
||||
.SH DESCRIPTION
|
||||
.LP
|
||||
.I directory
|
||||
becomes the new working directory.
|
||||
If
|
||||
.B cd
|
||||
is used without arguments, it returns you
|
||||
to your $HOME directory.
|
||||
.LP
|
||||
Because a new process is created to execute each command,
|
||||
.B cd
|
||||
would be ineffective if it were written as a normal command. It is therefore
|
||||
recognized and executed by the shells.
|
||||
.SH "SEE ALSO"
|
||||
.LP
|
||||
.BR pwd (1)
|
18
bin/gsh/man/clear.1
Normal file
18
bin/gsh/man/clear.1
Normal file
|
@ -0,0 +1,18 @@
|
|||
.TH CLEAR 1 "31 August 1996" GNO "Commands and Applications"
|
||||
.SH NAME
|
||||
.LP
|
||||
clear \- clear the terminal screen (gsh builtin)
|
||||
.SH SYNOPSIS
|
||||
.LP
|
||||
.B clear
|
||||
.SH DESCRIPTION
|
||||
.LP
|
||||
.B clear
|
||||
clears your screen if this is possible.
|
||||
It looks in the environment for the terminal type and then in
|
||||
.B 31/etc/termcap
|
||||
to figure out how to clear the screen.
|
||||
.SH FILES
|
||||
.LP
|
||||
.B 31/etc/termcap
|
||||
terminal capability data base
|
17
bin/gsh/man/exit.1
Normal file
17
bin/gsh/man/exit.1
Normal file
|
@ -0,0 +1,17 @@
|
|||
.TH EXIT 1 "31 August 1996" GNO "Commands and Applications"
|
||||
.SH NAME
|
||||
.LP
|
||||
exit \- terminate process (gsh builtin)
|
||||
.SH SYNOPSIS
|
||||
.LP
|
||||
exit
|
||||
.SH DESCRIPTION
|
||||
.LP
|
||||
.B exit
|
||||
causes the current shell to terminate.
|
||||
.LP
|
||||
If you receive the message
|
||||
.B "You have stopped jobs."
|
||||
You have attempted to exit the shell with stopped jobs under job control.
|
||||
An immediate second attempt to exit will succeed, terminating
|
||||
the stopped jobs.
|
92
bin/gsh/man/gsh.1
Normal file
92
bin/gsh/man/gsh.1
Normal file
|
@ -0,0 +1,92 @@
|
|||
.\"
|
||||
.\" $Id: gsh.1,v 1.1 1998/06/04 03:11:28 gdr-ftp Exp $
|
||||
.\"
|
||||
.TH GSH 1 "2 June 1998" GNO "Commands and Applications"
|
||||
.SH NAME
|
||||
gsh \- GNO Shell
|
||||
.SH SYNOPSIS
|
||||
.B gsh
|
||||
[
|
||||
.B -f
|
||||
] [
|
||||
.BI -c " commands"
|
||||
] [
|
||||
.I scriptfile
|
||||
]
|
||||
.SH DESCRIPTION
|
||||
.BR gsh
|
||||
is the GNO Shell, so named because it was the first (and currently only)
|
||||
shell to be made GNO-compatible.
|
||||
It is the program which acts as the interface between the user and the
|
||||
GNO kernel and various programs.
|
||||
For a more complete description of
|
||||
.BR gsh ,
|
||||
see the
|
||||
.IR "GNO Shell User's Manual" .
|
||||
.LP
|
||||
If
|
||||
.IR scriptfile
|
||||
is specified, it is assumed to be a
|
||||
.BR gsh
|
||||
shell script contained in a file of type SRC and auxtype EXEC.
|
||||
The script is executed and then
|
||||
.BR gsh
|
||||
exits.
|
||||
.LP
|
||||
If
|
||||
.BR -c " commands"
|
||||
is specified,
|
||||
.IR commands
|
||||
is assumed to be a series of
|
||||
.BR gsh
|
||||
commands which are then executed as if they had been contained in a
|
||||
.IR scriptfile .
|
||||
See the section on BUGS, below.
|
||||
.LP
|
||||
If neither
|
||||
.IR scriptfile
|
||||
nor the
|
||||
.BR -c
|
||||
flag is specified, then
|
||||
.BR gsh
|
||||
starts up in interactive mode. In this case,
|
||||
.BR gsh
|
||||
will execute commands entered by the user until it gets the
|
||||
.BR exit (1)
|
||||
command, an EOF, or gets killed by another process.
|
||||
.LP
|
||||
The
|
||||
.BR -f
|
||||
flag indicates that on startup,
|
||||
.BR gsh
|
||||
should not attempt to parse the
|
||||
.BR gshrc
|
||||
file or do other initializations. This is intended to give a fast startup
|
||||
in situations where these initializations are not required, however see
|
||||
the section on BUGS, below.
|
||||
.SH BUGS
|
||||
The
|
||||
.BR -c
|
||||
flag does not work as advertised and may crash your machine if it is used.
|
||||
.LP
|
||||
Empirical tests are inconclusive as to whether or not the
|
||||
.BR -f
|
||||
flag really does speed up the starting of
|
||||
.BR gsh .
|
||||
.LP
|
||||
Unfortunately, there are currently
|
||||
.I many
|
||||
other bugs in
|
||||
.BR gsh .
|
||||
For more information, see the GNO bug tracking system at
|
||||
.BR http://www.gno.org/~gno/bugs.html .
|
||||
.SH AUTHOR
|
||||
.BR gsh
|
||||
was written by Tim Meekins. It is currently maintained by Dave Tribby.
|
||||
.SH "SEE ALSO"
|
||||
.BR alias (1),
|
||||
.BR cd (1),
|
||||
.BR clear (1),
|
||||
.BR exit (1),
|
||||
the
|
||||
.IR "GNO Shell User's Manual" .
|
|
@ -1,41 +1,182 @@
|
|||
mcopy mdb.mac
|
||||
**************************************************************************
|
||||
*
|
||||
* The GNO Shell Project
|
||||
*
|
||||
* Developed by:
|
||||
* Jawaid Bazyar
|
||||
* Tim Meekins
|
||||
*
|
||||
* $Id: mmdebug.asm,v 1.6 1999/01/14 17:44:25 tribby Exp $
|
||||
*
|
||||
**************************************************************************
|
||||
*
|
||||
* MMDEBUG.ASM
|
||||
* By Tim Meekins
|
||||
* Rewritten by Dave Tribby for GNO 2.0.6
|
||||
*
|
||||
* Alternate routines for ~NEW and ~DISPOSE with extra debugging
|
||||
*
|
||||
* Note: text set up for tabs at col 16, 22, 41, 49, 57, 65
|
||||
* | | | | | |
|
||||
* ^ ^ ^ ^ ^ ^
|
||||
**************************************************************************
|
||||
*
|
||||
* Interfaces defined in this file:
|
||||
*
|
||||
*
|
||||
**************************************************************************
|
||||
|
||||
~NEW START
|
||||
hand equ 0
|
||||
ptr equ 4
|
||||
_~NEW name
|
||||
mcopy /obj/gno/bin/gsh/mmdebug.mac
|
||||
|
||||
subroutine (4:size),8
|
||||
dummymmdebug start ; ends up in .root
|
||||
end
|
||||
|
||||
NewHandle (size,~USER_ID,#$C018,#0),hand
|
||||
lda [hand]
|
||||
setcom 60
|
||||
|
||||
DB~NEW START
|
||||
|
||||
hand equ 0 Handle allocated by memory manager
|
||||
ptr equ hand+4 Pointer dereference of handle
|
||||
space equ ptr+4
|
||||
|
||||
subroutine (4:size),space
|
||||
|
||||
lda size If size is 0,
|
||||
ora size+2
|
||||
bne newh
|
||||
brk $A1 allocation error #1.
|
||||
bra foul
|
||||
;
|
||||
; Allocate memory block of requested size using NewHandle
|
||||
;
|
||||
newh anop
|
||||
|
||||
pha Reserve space for
|
||||
pha returned handle address.
|
||||
ph4 size Amount of memory to allocate.
|
||||
lda ~USER_ID Add the "auxID" tag
|
||||
eor #$0D00 to the user ID so we
|
||||
pha can identify our allocations.
|
||||
pea $C018
|
||||
pea 0
|
||||
pea 0
|
||||
tool $0902 NewHandle (size,~USER_ID,#$C018,#0)
|
||||
plx Store handle at "hand",
|
||||
stx hand preserving contents of
|
||||
plx possible error code
|
||||
stx hand+2 in accumulator.
|
||||
|
||||
bcc deref If there is a MM error,
|
||||
brk $A2 allocation error #2.
|
||||
foul stz ptr
|
||||
stz ptr+2
|
||||
bra goback
|
||||
|
||||
deref lda [hand] Dereference the handle.
|
||||
sta ptr
|
||||
ldy #2
|
||||
lda [hand],y
|
||||
sta ptr+2
|
||||
return 4:ptr
|
||||
|
||||
*;
|
||||
*; Fill memory with recognizable pattern
|
||||
*;
|
||||
* lda #"~~"
|
||||
* ldy size
|
||||
*dec_index dey
|
||||
* dey
|
||||
* bmi full
|
||||
* sta [ptr],y
|
||||
* bra dec_index
|
||||
*
|
||||
*full short a In case size was odd,
|
||||
* sta [ptr] be sure the first byte
|
||||
* long a gets the pattern.
|
||||
|
||||
goback return 4:ptr Return pointer to caller.
|
||||
|
||||
END
|
||||
|
||||
~DISPOSE START
|
||||
|
||||
DB~DISPOSE START
|
||||
hand equ 0
|
||||
checkptr equ 4
|
||||
_~DISPOSE name
|
||||
space equ checkptr+4
|
||||
|
||||
subroutine (4:ptr),8
|
||||
subroutine (4:ptr),space
|
||||
;
|
||||
; First check: is address > $007FFFFF?
|
||||
;
|
||||
lda ptr+2
|
||||
and #$FF80
|
||||
beq findit
|
||||
lda ptr
|
||||
ldx ptr+2
|
||||
brk $D1 Deallocate error #1.
|
||||
bra goback
|
||||
|
||||
FindHandle ptr,hand
|
||||
lda [hand]
|
||||
sta checkptr
|
||||
;
|
||||
; Second check: is there a valid handle to this pointer?
|
||||
;
|
||||
findit FindHandle ptr,hand
|
||||
|
||||
lda hand Error if FindHandle
|
||||
ora hand+2 returned 0.
|
||||
bne ckptr
|
||||
brk $D2 Deallocate error #2.
|
||||
bra goback
|
||||
|
||||
ckptr lda [hand] Dereference the
|
||||
sta checkptr found handle.
|
||||
ldy #2
|
||||
lda [hand],y
|
||||
sta checkptr+2
|
||||
eor ptr+2
|
||||
eor ptr
|
||||
eor checkptr
|
||||
|
||||
cmp ptr+2 If the pointer isn't
|
||||
bne errD3 the first byte
|
||||
lda checkptr of the handle,
|
||||
cmp ptr there is a problem.
|
||||
beq chkid
|
||||
errD3 brk $D3
|
||||
bra goback
|
||||
|
||||
chkid ldy #6 Get User ID word
|
||||
lda [hand],y from handle header.
|
||||
eor #$0D00 Remove aux ID of $0D00.
|
||||
cmp ~USER_ID
|
||||
beq okay
|
||||
lda [hand],y
|
||||
brk $D4 Deallocate error #4.
|
||||
bra goback
|
||||
|
||||
brk $55
|
||||
okay DisposeHandle hand Deallocate the memory.
|
||||
bcc goback
|
||||
brk $D5 Deallocate error #5.
|
||||
|
||||
goback return
|
||||
|
||||
END
|
||||
|
||||
|
||||
DB~CHKBNK START
|
||||
|
||||
; Verify that data bank = program bank
|
||||
; Call with jsr DB~CHKBNK
|
||||
php Save Status Flags.
|
||||
short m Go to 8-bit mode.
|
||||
pha Save Accumulator.
|
||||
phk Put Program Bank reg on stack.
|
||||
phb Copy Data Bank register
|
||||
pla into Accumulator.
|
||||
cmp 1,s Compare DBR (in acc) to PBR (stack)
|
||||
beq cleanup If not equal,
|
||||
brk $B0 complain.
|
||||
;
|
||||
; Ready to return to the caller
|
||||
;
|
||||
cleanup pla Remove Program Bank reg from stack.
|
||||
pla Restore original Accumulator and
|
||||
plp Status Flags (including 8/16 bit mode)
|
||||
rts
|
||||
|
||||
okay DisposeHandle hand
|
||||
return
|
||||
END
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
Removed two references to $E0C000 in shell.asm (signal handlers).
|
||||
Bad Timmy!
|
337
bin/gsh/orca.asm
337
bin/gsh/orca.asm
|
@ -6,24 +6,40 @@
|
|||
* Jawaid Bazyar
|
||||
* Tim Meekins
|
||||
*
|
||||
* $Id: orca.asm,v 1.9 1999/02/08 17:26:51 tribby Exp $
|
||||
*
|
||||
**************************************************************************
|
||||
*
|
||||
* ORCA.ASM
|
||||
* By Tim Meekins
|
||||
* Modified by Dave Tribby for GNO 2.0.6
|
||||
*
|
||||
* Builtin commands for Orca compiling/editing, etc.
|
||||
* Builtin command for ORCA editor
|
||||
*
|
||||
* Note: text set up for tabs at col 16, 22, 41, 49, 57, 65
|
||||
* | | | | | |
|
||||
* ^ ^ ^ ^ ^ ^
|
||||
**************************************************************************
|
||||
*
|
||||
* Interfaces defined in this file:
|
||||
*
|
||||
* edit subroutine (4:argv,2:argc) builtin command
|
||||
*
|
||||
**************************************************************************
|
||||
|
||||
keep o/orca
|
||||
mcopy m/orca.mac
|
||||
mcopy /obj/gno/bin/gsh/orca.mac
|
||||
|
||||
dummyorca start ; ends up in .root
|
||||
end
|
||||
|
||||
setcom 60
|
||||
|
||||
**************************************************************************
|
||||
*
|
||||
* EDIT: builtin command
|
||||
* syntax: edit pathname...
|
||||
*
|
||||
* Invokes an editor and edits a file or files.
|
||||
* Invokes the ORCA editor and edits a file or files.
|
||||
*
|
||||
**************************************************************************
|
||||
|
||||
|
@ -34,9 +50,9 @@ strPtr equ 0
|
|||
inLoopPtr equ strPtr+4
|
||||
argLoopPtr equ inLoopPtr+4
|
||||
sLen equ argLoopPtr+4
|
||||
k equ sLen+2
|
||||
j equ k+2
|
||||
editcommand equ j+2
|
||||
pathLen equ sLen+2
|
||||
pnum equ pathLen+2
|
||||
editcommand equ pnum+2
|
||||
retval equ editcommand+4
|
||||
sFile equ retval+2 GSString255Ptr
|
||||
inPath equ sFile+4
|
||||
|
@ -45,51 +61,55 @@ space equ outPath+4
|
|||
|
||||
subroutine (4:argv,2:argc),space
|
||||
|
||||
stz retval
|
||||
stz sLen
|
||||
|
||||
lda #1
|
||||
sta j
|
||||
|
||||
lda argc make sure there are two or
|
||||
cmp #2 more parameters, otherwise we
|
||||
bcs enoughparms
|
||||
|
||||
ldx #^enofile
|
||||
lda #enofile
|
||||
lda argc Make sure there are two or
|
||||
cmp #2 more parameters.
|
||||
bcs enoughparms Otherwise,
|
||||
ldx #^enofile report error:
|
||||
lda #enofile no filename specified
|
||||
jsr errputs
|
||||
lda #1
|
||||
lda #1
|
||||
sta retval
|
||||
jmp goaway
|
||||
jmp donedealloc
|
||||
|
||||
|
||||
; Allocate memory for sFile, inPath, and outPath
|
||||
|
||||
enoughparms anop
|
||||
jsl alloc1024
|
||||
jsl allocmaxline
|
||||
sta sFile
|
||||
stx sFile+2
|
||||
ora sFile+2
|
||||
beq memerr1
|
||||
beq memerr1
|
||||
|
||||
jsl alloc1024
|
||||
jsl allocmaxline
|
||||
sta inPath
|
||||
stx inPath+2
|
||||
ora inPath+2
|
||||
beq memerr1
|
||||
beq memerr1
|
||||
|
||||
jsl alloc1024
|
||||
jsl allocmaxline
|
||||
sta outPath
|
||||
stx outPath+2
|
||||
ora outPath+2
|
||||
bne noerr1
|
||||
bne noerr1
|
||||
|
||||
memerr1 ldx #^enomem
|
||||
lda #enomem
|
||||
memerr1 ldx #^enomem Report error:
|
||||
lda #enomem out of memory
|
||||
jsr errputs
|
||||
lda #-1
|
||||
sta retval
|
||||
lda #-1
|
||||
seterr sta retval
|
||||
jmp goaway
|
||||
|
||||
; Parameters were provided, and memory has been allocated.
|
||||
; Ready to start processing the filename(s).
|
||||
noerr1 anop
|
||||
lda sFile
|
||||
stz retval Zero return status
|
||||
stz sLen and length of source names.
|
||||
|
||||
lda #1 Initialize parameter
|
||||
sta pnum number to 1.
|
||||
|
||||
lda sFile strPtr = sFile + 2
|
||||
clc
|
||||
adc #2
|
||||
sta strPtr
|
||||
|
@ -97,90 +117,84 @@ noerr1 anop
|
|||
adc #0
|
||||
sta strPtr+2
|
||||
|
||||
doloop lda j
|
||||
cmp #2
|
||||
bcc nodelimit
|
||||
short m
|
||||
lda #10 ; newline
|
||||
sta [strPtr]
|
||||
bra nodelimit Skip delimiter for 1st file.
|
||||
|
||||
; Loop for getting name, converting it to a full path, and
|
||||
; appending it to sFile
|
||||
|
||||
doloop short m Between parameters:
|
||||
lda #10 Store newline as delimiter
|
||||
sta [strPtr] character in strPtr.
|
||||
long m
|
||||
inc sLen
|
||||
inc strPtr
|
||||
bne nodelimit
|
||||
inc strPtr+2
|
||||
inc sLen Bump string length
|
||||
incad strPtr and pointer.
|
||||
|
||||
nodelimit anop
|
||||
lda j
|
||||
asl a ; get the proper argv pointer
|
||||
asl a
|
||||
tay
|
||||
lda [argv],y
|
||||
sta argLoopPtr
|
||||
iny2
|
||||
lda pnum Get parameter number
|
||||
asl a and turn it into an
|
||||
asl a index to the proper
|
||||
tay argv pointer.
|
||||
lda [argv],y Store address in
|
||||
sta argLoopPtr direct page variable
|
||||
iny2 argLoopPtr.
|
||||
lda [argv],y
|
||||
sta argLoopPtr+2
|
||||
|
||||
lda inPath get text field of inPath
|
||||
clc
|
||||
lda inPath Get address of text field
|
||||
clc in inPath.
|
||||
adc #2
|
||||
sta inLoopPtr
|
||||
sta inLoopPtr
|
||||
lda inPath+2
|
||||
adc #0
|
||||
sta inLoopPtr+2
|
||||
|
||||
stz k
|
||||
; Move argument into inPath, counting characters
|
||||
|
||||
whileloop lda [argLoopPtr]
|
||||
and #$00FF
|
||||
beq donewhile
|
||||
ldy #0
|
||||
|
||||
short m
|
||||
sta [inLoopPtr]
|
||||
long m
|
||||
inc argLoopPtr
|
||||
bne noinc2
|
||||
inc argLoopPtr+2
|
||||
noinc2 inc inLoopPtr
|
||||
bne noinc3
|
||||
inc inLoopPtr+2
|
||||
noinc3 inc k
|
||||
lda k
|
||||
cmp #255
|
||||
bcc whileloop
|
||||
ldx #^einval
|
||||
lda #einval
|
||||
whileloop lda [argLoopPtr],y Get next character of name.
|
||||
and #$00FF If it's the terminating null,
|
||||
beq donewhile done copying.
|
||||
|
||||
sta [inLoopPtr],y Store character (and null byte)
|
||||
iny
|
||||
cpy #255 If < 255,
|
||||
bcc whileloop stay in loop.
|
||||
|
||||
ldx #^einval Print error:
|
||||
lda #einval invalid argument (filename too long)
|
||||
jsr errputs
|
||||
lda #2
|
||||
sta retval
|
||||
jmp goaway
|
||||
donewhile lda k
|
||||
lda #2
|
||||
bra seterr
|
||||
|
||||
donewhile tya Set length of GS/OS string inPath.
|
||||
sta [inPath]
|
||||
lda #1024
|
||||
lda #1024 Set max len of result buffer outPath.
|
||||
sta [outPath]
|
||||
|
||||
; Set up GS/OS ExpandPath parameter buffer and make call.
|
||||
|
||||
mv4 inPath,ep_inputPath
|
||||
mv4 outPath,ep_outputPath
|
||||
ExpandPath ep Expand the pathname.
|
||||
|
||||
ExpandPath ep
|
||||
bcc noeperror
|
||||
ldx #^err3
|
||||
lda #err3
|
||||
jsr errputs
|
||||
lda #-1
|
||||
sta retval
|
||||
jmp goaway
|
||||
; Note: The GS/OS reference says ExpandPath can detect invalid pathname
|
||||
; syntax error, but I can't get this to happen (even with names like
|
||||
; "::/^" and " "). Ignore errors and let the editor report them.
|
||||
|
||||
noeperror anop
|
||||
ldy #2
|
||||
ldy #2 Get length of result string
|
||||
lda [outPath],y
|
||||
sta k
|
||||
sta pathLen and store in pathLen.
|
||||
clc
|
||||
adc sLen
|
||||
cmp #MAXPARMBUF
|
||||
bcs doloopend
|
||||
adc sLen If accumulated length is
|
||||
cmp #MAXPARMBUF beyond the maximum,
|
||||
bcs doloopend don't add this name.
|
||||
|
||||
pei (k)
|
||||
pei (outPath+2)
|
||||
lda outPath
|
||||
sta sLen Store accumulated length in sLen.
|
||||
|
||||
pei (pathLen) Append outPath string
|
||||
pei (outPath+2) to the end of sFile's text.
|
||||
lda outPath
|
||||
clc
|
||||
adc #4
|
||||
pha
|
||||
|
@ -188,99 +202,118 @@ noeperror anop
|
|||
pei (strPtr)
|
||||
jsl rmemcpy
|
||||
|
||||
lda sLen
|
||||
lda strPtr Add pathLen to strPtr.
|
||||
clc
|
||||
adc k
|
||||
sta sLen
|
||||
lda strPtr
|
||||
clc
|
||||
adc k
|
||||
adc pathLen
|
||||
sta strPtr
|
||||
lda strPtr+2
|
||||
adc #0
|
||||
sta strPtr+2
|
||||
doloopend inc j
|
||||
lda j
|
||||
cmp argc
|
||||
jcc doloop
|
||||
|
||||
lda sLen
|
||||
sta [sFile]
|
||||
mv4 sFile,gl_sFile
|
||||
doloopend inc pnum pnum++
|
||||
lda pnum if pnum < argc,
|
||||
cmp argc
|
||||
jcc doloop continue processing filenames.
|
||||
|
||||
Set_LInfoGS gl ;now set up the environment
|
||||
; All of the arguments have been processed.
|
||||
|
||||
ph4 #editorvar
|
||||
jsl getenv
|
||||
lda sLen Save length in
|
||||
sta [sFile] GS/OS buffer.
|
||||
|
||||
; Set up shell SetLInfo parameter buffer and make call.
|
||||
|
||||
mv4 sFile,gl_sFile
|
||||
SetLInfoGS gl Set the edit environment.
|
||||
|
||||
ph4 #editorvar Get value of environment
|
||||
jsl getenv variable "editor".
|
||||
sta editcommand
|
||||
stx editcommand+2
|
||||
ora editcommand+2
|
||||
bne goteditvar
|
||||
ora editcommand+2
|
||||
bne goteditvar If $editor is not defined,
|
||||
ph4 #defedit use default value.
|
||||
bra execit
|
||||
|
||||
ph4 #defedit
|
||||
jsr p2cstr
|
||||
sta editcommand
|
||||
stx editcommand+2
|
||||
|
||||
goteditvar anop
|
||||
pei (editcommand+2)
|
||||
pei (editcommand)
|
||||
ph2 #0 ;tells execute we're called by system
|
||||
goteditvar anop Add 4 to value returned by getenv
|
||||
ldx editcommand+2 to get address of text portion.
|
||||
clc
|
||||
lda editcommand
|
||||
adc #4
|
||||
bcc nobump
|
||||
inx
|
||||
nobump anop
|
||||
phx Push address onto stack.
|
||||
pha
|
||||
execit ph2 #0 Tells execute we're called by system
|
||||
jsl execute
|
||||
sta retval
|
||||
sta retval
|
||||
|
||||
pei (editcommand+2)
|
||||
lda editcommand If getenv allocated it,
|
||||
ora editcommand+2
|
||||
beq goaway
|
||||
|
||||
pei (editcommand+2) free the "editcommand" string.
|
||||
pei (editcommand)
|
||||
jsl nullfree
|
||||
jsl nullfree
|
||||
|
||||
goaway lda sFile
|
||||
|
||||
; See which GS/OS buffers need to be deallocated
|
||||
|
||||
goaway lda sFile
|
||||
ora sFile+2
|
||||
beq donedealloc
|
||||
ldx sFile+2
|
||||
lda sFile
|
||||
jsl free1024
|
||||
jsl freemaxline
|
||||
|
||||
lda inPath
|
||||
ora inPath+2
|
||||
beq donedealloc
|
||||
lda inPath
|
||||
ora inPath+2
|
||||
beq donedealloc
|
||||
ldx inPath+2
|
||||
lda inPath
|
||||
jsl free1024
|
||||
jsl freemaxline
|
||||
|
||||
lda outPath
|
||||
ora outPath+2
|
||||
beq donedealloc
|
||||
lda outPath
|
||||
ora outPath+2
|
||||
beq donedealloc
|
||||
ldx outPath+2
|
||||
lda outPath
|
||||
jsl free1024
|
||||
jsl freemaxline
|
||||
|
||||
donedealloc return 2:retval
|
||||
|
||||
ep dc i2'2'
|
||||
ep_inputPath dc i4'0'
|
||||
ep_outputPath dc i4'0'
|
||||
; Return to caller with status set to value in retval
|
||||
|
||||
donedealloc return 2:retval
|
||||
|
||||
|
||||
; Parameter block for GS/OS ExpandPath call (p. 140 in GS/OS Reference)
|
||||
ep dc i2'2' pCount
|
||||
ep_inputPath dc i4'0' input pointer (GS/OS string)
|
||||
ep_outputPath dc i4'0' output pointer (GS/OS result buf)
|
||||
|
||||
; Error messages
|
||||
enofile dc c'edit: no filename specified',h'0D00'
|
||||
enomem dc c'edit: out of memory',h'0D00'
|
||||
einval dc c'edit: invalid argument (filename too long)',h'0D00'
|
||||
err3 dc c'edit: invalid path name',h'0d00'
|
||||
|
||||
; Parameter block for shell SetLInfo call (p. 433 in ORCA/M book)
|
||||
gl anop
|
||||
dc i2'11'
|
||||
gl_sfile dc i4'0'
|
||||
dc i4'nullparm'
|
||||
dc i4'nullparm'
|
||||
dc i4'nullparm'
|
||||
dc i1'8'
|
||||
dc i1'0'
|
||||
dc i1'0'
|
||||
dc i1'0'
|
||||
dc i4'0'
|
||||
dc i4'$8000000'
|
||||
dc i4'0'
|
||||
dc i2'11' pCount
|
||||
gl_sfile dc i4'0' source file name (GS/OS string)
|
||||
dc i4'nullparm' output file name (compile/link)
|
||||
dc i4'nullparm' names in NAMES parameter list (compile)
|
||||
dc i4'nullparm' compiler commands (compiler)
|
||||
dc i1'0' max err level allowed (compile/link)
|
||||
dc i1'0' max err level found (compile/link)
|
||||
dc i1'0' operations flags (compile/link)
|
||||
dc i1'0' keep flag (compile)
|
||||
dc i4'0' minus flags (see ASML command descr)
|
||||
dc i4'$08000000' plus flags [+E] (see ASML)
|
||||
dc i4'0' origin (link)
|
||||
|
||||
nullparm dc i2'0'
|
||||
|
||||
editorvar dc c'editor',h'00'
|
||||
defedit str '4:editor'
|
||||
editorvar gsstr 'editor' Name of editor environment variable
|
||||
|
||||
defedit dc c'4:editor',h'00' Default value for editor
|
||||
END
|
||||
|
|
|
@ -6,359 +6,387 @@
|
|||
* Jawaid Bazyar
|
||||
* Tim Meekins
|
||||
*
|
||||
* $Id: prompt.asm,v 1.6 1998/09/08 16:53:12 tribby Exp $
|
||||
*
|
||||
**************************************************************************
|
||||
*
|
||||
* PROMPT.ASM
|
||||
* By Tim Meekins
|
||||
* Modified by Dave Tribby for GNO 2.0.6
|
||||
*
|
||||
* This displays the command-line prompt
|
||||
*
|
||||
* Note: text set up for tabs at col 16, 22, 41, 49, 57, 65
|
||||
* | | | | | |
|
||||
* ^ ^ ^ ^ ^ ^
|
||||
**************************************************************************
|
||||
|
||||
keep o/prompt
|
||||
mcopy m/prompt.mac
|
||||
mcopy /obj/gno/bin/gsh/prompt.mac
|
||||
|
||||
WritePrompt START
|
||||
dummyprompt start ; ends up in .root
|
||||
end
|
||||
|
||||
using HistoryData
|
||||
setcom 60
|
||||
|
||||
WritePrompt START
|
||||
|
||||
using HistoryData
|
||||
|
||||
|
||||
prompt equ 0
|
||||
hour equ prompt+4
|
||||
minute equ hour+2
|
||||
offset equ minute+2
|
||||
promptgsbuf equ prompt+4
|
||||
usergsbuf equ promptgsbuf+4
|
||||
hour equ usergsbuf+4
|
||||
minute equ hour+2
|
||||
offset equ minute+2
|
||||
pfx equ offset+2
|
||||
space equ pfx+4
|
||||
space equ pfx+4
|
||||
|
||||
year equ hour
|
||||
monday equ minute
|
||||
precmd equ prompt
|
||||
year equ hour
|
||||
monday equ minute
|
||||
precmd equ prompt
|
||||
|
||||
subroutine (0:dummy),space
|
||||
subroutine (0:dummy),space
|
||||
|
||||
ph4 #precmdstr
|
||||
ph4 #precmdstr If "precmd" alias is defined,
|
||||
jsl findalias
|
||||
sta precmd
|
||||
stx precmd+2
|
||||
ora precmd+2
|
||||
beq getvar
|
||||
|
||||
pei (precmd+2)
|
||||
pei (precmd+2) execute it before parsing prompt.
|
||||
pei (precmd)
|
||||
ph2 #0
|
||||
jsl execute
|
||||
|
||||
getvar Read_Variable promptparm
|
||||
;
|
||||
; Get value of $PROMPT environment variable
|
||||
;
|
||||
getvar ph4 #promptname
|
||||
jsl getenv
|
||||
|
||||
php
|
||||
sei ;interrupt free environment
|
||||
|
||||
lda promptbuf
|
||||
and #$FF
|
||||
bne parseprompt
|
||||
php Turn off interrupts: mutex
|
||||
sei won't do what we want!
|
||||
|
||||
sta promptgsbuf Save pointer to GS/OS result buffer.
|
||||
stx promptgsbuf+2 If there is no memory to hold it,
|
||||
ora promptgsbuf+2 it's undefined, or it has a
|
||||
bne parseprompt length of 0,
|
||||
ldx #^dfltPrompt
|
||||
lda #dfltPrompt
|
||||
jsr puts
|
||||
jsr puts print the default prompt
|
||||
bra donemark2 and exit.
|
||||
|
||||
bra donemark2
|
||||
|
||||
precmdstr dc c'precmd',h'00'
|
||||
|
||||
parseprompt anop
|
||||
|
||||
ph4 #promptbuf
|
||||
jsr p2cstr
|
||||
phx ;for disposal
|
||||
pha
|
||||
stx prompt+2
|
||||
;
|
||||
; Prompt string begins in result buffer after the two length words
|
||||
;
|
||||
parseprompt anop
|
||||
clc
|
||||
lda promptgsbuf
|
||||
adc #4
|
||||
sta prompt
|
||||
lda promptgsbuf+2
|
||||
adc #0
|
||||
sta prompt+2
|
||||
|
||||
promptloop lda [prompt]
|
||||
inc prompt
|
||||
and #$FF
|
||||
beq done
|
||||
cmp #'%'
|
||||
beq special
|
||||
cmp #'!'
|
||||
jeq phist
|
||||
promptloop lda [prompt]
|
||||
incad prompt
|
||||
and #$FF
|
||||
beq done
|
||||
cmp #'%'
|
||||
beq special
|
||||
cmp #'!'
|
||||
jeq phist
|
||||
cmp #'\'
|
||||
jeq quoteit
|
||||
_putchar jsr putchar
|
||||
bra promptloop
|
||||
_putchar jsr putchar
|
||||
bra promptloop
|
||||
|
||||
done jsr standend
|
||||
done jsr standend
|
||||
jsr cursoron
|
||||
|
||||
donemark2 anop
|
||||
plp Restore interrupts.
|
||||
|
||||
pei (promptgsbuf+2) Free $PROMPT value buffer
|
||||
pei (promptgsbuf)
|
||||
jsl nullfree
|
||||
donemark2 plp
|
||||
|
||||
jsr flush
|
||||
return
|
||||
return
|
||||
;
|
||||
; Previous character was a "%". Handle special character flags
|
||||
;
|
||||
special lda [prompt] Get character following "%".
|
||||
incad prompt
|
||||
and #$FF
|
||||
beq done If end of string, all done.
|
||||
cmp #'%' If another "%",
|
||||
beq _putchar print the "%"
|
||||
cmp #'h' If 'h'
|
||||
beq phist
|
||||
cmp #'!' or '!',
|
||||
beq phist print history number.
|
||||
cmp #'t' If 't'
|
||||
beq ptime
|
||||
cmp #'@' or '@',
|
||||
beq ptime print time (am/pm format)
|
||||
cmp #'S' If 'S',
|
||||
jeq pstandout turn inverse mode on.
|
||||
cmp #'s' If 's',
|
||||
jeq pstandend turn inverse mode off.
|
||||
cmp #'U' If 'U',
|
||||
jeq punderline turn underline mode on.
|
||||
cmp #'u' If 'u',
|
||||
jeq punderend turn underline mode off
|
||||
cmp #'d' If 'd'
|
||||
jeq pcwd
|
||||
cmp #'/' or '/',
|
||||
jeq pcwd print working directory.
|
||||
cmp #'c' If 'c'
|
||||
jeq pcwdend
|
||||
cmp #'C' or 'C'
|
||||
jeq pcwdend
|
||||
cmp #'.' or '.',
|
||||
jeq pcwdend print final part of wrk dir.
|
||||
cmp #'n' If 'n',
|
||||
jeq puser print $USER
|
||||
cmp #'W' If 'W',
|
||||
jeq pdate1 print date (mm/dd/yy)
|
||||
cmp #'D' If 'D',
|
||||
jeq pdate2 print date (yy-mm-dd)
|
||||
cmp #'~' If '~',
|
||||
jeq ptilde print wrk dir with ~ subs.
|
||||
jmp promptloop If none of these characters, ignore it.
|
||||
|
||||
special lda [prompt]
|
||||
inc prompt
|
||||
and #$FF
|
||||
beq done
|
||||
cmp #'%'
|
||||
beq _putchar
|
||||
cmp #'h'
|
||||
beq phist
|
||||
cmp #'!'
|
||||
beq phist
|
||||
cmp #'t'
|
||||
beq ptime
|
||||
cmp #'@'
|
||||
beq ptime
|
||||
cmp #'S'
|
||||
jeq pstandout
|
||||
cmp #'s'
|
||||
jeq pstandend
|
||||
cmp #'U'
|
||||
jeq punderline
|
||||
cmp #'u'
|
||||
jeq punderend
|
||||
cmp #'d'
|
||||
jeq pcwd
|
||||
cmp #'/'
|
||||
jeq pcwd
|
||||
cmp #'c'
|
||||
jeq pcwdend
|
||||
cmp #'C'
|
||||
jeq pcwdend
|
||||
cmp #'.'
|
||||
jeq pcwdend
|
||||
cmp #'n'
|
||||
jeq puser
|
||||
cmp #'W'
|
||||
jeq pdate1
|
||||
cmp #'D'
|
||||
jeq pdate2
|
||||
cmp #'~'
|
||||
jeq ptilde
|
||||
|
||||
jmp promptloop
|
||||
;
|
||||
; Put history number
|
||||
;
|
||||
phist lda lasthist
|
||||
inc a
|
||||
jsr WriteNum
|
||||
jmp promptloop
|
||||
phist lda lasthist
|
||||
inc a
|
||||
jsr WriteNum
|
||||
jmp promptloop
|
||||
|
||||
;
|
||||
; Print current time
|
||||
;
|
||||
ptime ReadTimeHex (minute,hour,@a,@a)
|
||||
lda hour
|
||||
and #$FF
|
||||
if2 @a,cc,#13,ptime2
|
||||
sub2 @a,#12,@a
|
||||
ptime2 if2 @a,ne,#0,ptime2b
|
||||
ptime ReadTimeHex (minute,hour,@a,@a)
|
||||
lda hour
|
||||
and #$FF
|
||||
if2 @a,cc,#13,ptime2
|
||||
sub2 @a,#12,@a
|
||||
ptime2 if2 @a,ne,#0,ptime2b
|
||||
lda #12
|
||||
ptime2b jsr WriteNum
|
||||
ptime2b jsr WriteNum
|
||||
lda #':'
|
||||
jsr putchar
|
||||
lda minute
|
||||
xba
|
||||
and #$FF
|
||||
pha
|
||||
cmp #10
|
||||
bcs ptime2a
|
||||
lda minute
|
||||
xba
|
||||
and #$FF
|
||||
pha
|
||||
cmp #10
|
||||
bcs ptime2a
|
||||
lda #'0'
|
||||
jsr putchar
|
||||
ptime2a pla
|
||||
jsr WriteNum
|
||||
lda hour
|
||||
and #$FF
|
||||
if2 @a,cs,#12,ptime3
|
||||
ptime5 lda #'a'
|
||||
bra ptime4
|
||||
ptime3 lda #'p'
|
||||
ptime4 jsr putchar
|
||||
ptime2a pla
|
||||
jsr WriteNum
|
||||
lda hour
|
||||
and #$FF
|
||||
if2 @a,cs,#12,ptime3
|
||||
ptime5 lda #'a'
|
||||
bra ptime4
|
||||
ptime3 lda #'p'
|
||||
ptime4 jsr putchar
|
||||
lda #'m'
|
||||
jmp _putchar
|
||||
|
||||
;
|
||||
; Set Stand Out
|
||||
; Set Stand Out (turn on inverse mode)
|
||||
;
|
||||
pstandout jsr standout
|
||||
pstandout jsr standout
|
||||
jmp promptloop
|
||||
;
|
||||
; UnSet Stand Out
|
||||
; UnSet Stand Out (turn off inverse mode)
|
||||
;
|
||||
pstandend jsr standend
|
||||
pstandend jsr standend
|
||||
jmp promptloop
|
||||
;
|
||||
; Set Underline
|
||||
;
|
||||
punderline jsr underline
|
||||
punderline jsr underline
|
||||
jmp promptloop
|
||||
;
|
||||
; UnSet Underline
|
||||
;
|
||||
punderend jsr underend
|
||||
punderend jsr underend
|
||||
jmp promptloop
|
||||
;
|
||||
;
|
||||
; Current working directory
|
||||
;
|
||||
pcwd jsl alloc1024
|
||||
pcwd anop
|
||||
pea 0
|
||||
jsl getpfxstr Get value of prefix 0.
|
||||
sta pfx
|
||||
stx pfx+2
|
||||
sta GPpfx
|
||||
stx GPpfx+2
|
||||
lda #1024
|
||||
sta [pfx]
|
||||
|
||||
GetPrefix GPParm
|
||||
ldy #2
|
||||
lda [pfx],y
|
||||
clc
|
||||
adc #3
|
||||
sta offset
|
||||
ldy #4
|
||||
pcwd1 lda [pfx],y
|
||||
and #$FF
|
||||
jsr toslash
|
||||
phy
|
||||
jsr putchar
|
||||
ply
|
||||
iny
|
||||
cpy offset
|
||||
bcc pcwd1
|
||||
ldx pfx+2
|
||||
lda pfx
|
||||
jsl free1024
|
||||
jmp promptloop
|
||||
ora pfx+2 If NULL pointer returned,
|
||||
jeq promptloop an error was reported.
|
||||
|
||||
ldy #4 Text starts at byte 4.
|
||||
pcwd1 lda [pfx],y Get next
|
||||
and #$FF character.
|
||||
beq freepfx Done when at end of string.
|
||||
jsr toslash Convert to slash.
|
||||
phy Hold index on stack
|
||||
jsr putchar while printing character.
|
||||
ply
|
||||
iny Bump index
|
||||
bra pcwd1 and stay in loop.
|
||||
|
||||
freepfx ph4 pfx Free the current directory buffer.
|
||||
jsl nullfree
|
||||
jmp promptloop
|
||||
|
||||
;
|
||||
; Current tail of working directory
|
||||
; Tail of current working directory
|
||||
;
|
||||
pcwdend anop
|
||||
jsl alloc1024
|
||||
pcwdend anop
|
||||
pea 0
|
||||
jsl getpfxstr Get value of prefix 0.
|
||||
sta pfx
|
||||
stx pfx+2
|
||||
sta GPpfx
|
||||
stx GPpfx+2
|
||||
lda #1024
|
||||
sta [pfx]
|
||||
|
||||
GetPrefix GPParm
|
||||
ldy #2
|
||||
lda [pfx],y
|
||||
clc
|
||||
adc #3
|
||||
ora pfx+2 If NULL pointer returned,
|
||||
jeq promptloop an error was reported.
|
||||
|
||||
ldy #2 Get string's length word
|
||||
lda [pfx],y from bytes 2 & 3.
|
||||
clc Add 3 to get offset
|
||||
adc #3 from beginning of buffer.
|
||||
sta offset
|
||||
tay
|
||||
pcwdend1 dey
|
||||
bmi pcwdend2
|
||||
lda [pfx],y
|
||||
and #$FF
|
||||
cmp #':'
|
||||
bne pcwdend1
|
||||
pcwdend2 iny
|
||||
cpy offset
|
||||
beq pcwdend3
|
||||
lda [pfx],y
|
||||
and #$FF
|
||||
cmp #':'
|
||||
beq pcwdend3
|
||||
phy
|
||||
pcwdend1 dey If we've backed up to the beginning,
|
||||
bmi pcwdend2 we can't go any further!
|
||||
lda [pfx],y Get next character.
|
||||
and #$FF
|
||||
cmp #':' If it's not ':',
|
||||
bne pcwdend1 keep searching backward.
|
||||
pcwdend2 iny
|
||||
cpy offset
|
||||
jeq freepfx Free the current directory buffer.
|
||||
lda [pfx],y
|
||||
and #$FF
|
||||
cmp #':'
|
||||
jeq freepfx Free the current directory buffer.
|
||||
phy
|
||||
jsr putchar
|
||||
ply
|
||||
bra pcwdend2
|
||||
pcwdend3 ldx pfx+2
|
||||
lda pfx
|
||||
jsl free1024
|
||||
jmp promptloop
|
||||
ply
|
||||
bra pcwdend2
|
||||
|
||||
;
|
||||
; Current working directory substituting '~' if necessary
|
||||
;
|
||||
ptilde anop
|
||||
jsl alloc1024
|
||||
ptilde anop
|
||||
pea 0
|
||||
jsl getpfxstr Get value of prefix 0.
|
||||
sta pfx
|
||||
stx pfx+2
|
||||
sta GPpfx
|
||||
stx GPpfx+2
|
||||
lda #1024
|
||||
sta [pfx]
|
||||
|
||||
GetPrefix GPParm
|
||||
ldy #2
|
||||
lda [pfx],y
|
||||
clc
|
||||
adc #4
|
||||
tay
|
||||
lda #0
|
||||
sta [pfx],y
|
||||
pei (pfx+2)
|
||||
lda pfx
|
||||
clc
|
||||
adc #4
|
||||
ora pfx+2 If NULL pointer returned,
|
||||
jeq promptloop an error was reported.
|
||||
lda pfx Otherwise, restore low-order address.
|
||||
|
||||
clc Add 4 to start of buffer
|
||||
adc #4 so it can be treated like
|
||||
bcc pushad a c-string.
|
||||
inx
|
||||
pushad phx
|
||||
pha
|
||||
jsl path2tilde
|
||||
phx
|
||||
pha
|
||||
jsr puts
|
||||
jsl ~DISPOSE
|
||||
ldx pfx+2
|
||||
lda pfx
|
||||
jsl free1024
|
||||
jmp promptloop
|
||||
;
|
||||
jsl path2tilde Convert $HOME to "~"
|
||||
phx Push addr onto stack
|
||||
pha for nullfree.
|
||||
jsr puts Print tilde string.
|
||||
jsl nullfree Free the converted string.
|
||||
|
||||
jmp freepfx Free the current directory buffer.
|
||||
|
||||
;
|
||||
; Write user name
|
||||
;
|
||||
puser Read_Variable userparm
|
||||
ldx #^buf2
|
||||
lda #buf2
|
||||
jsr putp
|
||||
jmp promptloop
|
||||
puser ph4 #username Get value of $USER
|
||||
jsl getenv
|
||||
sta usergsbuf If buffer wasn't allocated
|
||||
stx usergsbuf+2
|
||||
ora usergsbuf+2
|
||||
beq goploop ignore it.
|
||||
|
||||
clc
|
||||
lda usergsbuf Text begins after
|
||||
adc #4 four bytes of
|
||||
bcc printit length words.
|
||||
inx
|
||||
printit jsr puts
|
||||
|
||||
pei (usergsbuf+2) Free $USER value buffer
|
||||
pei (usergsbuf)
|
||||
jsl nullfree
|
||||
|
||||
goploop jmp promptloop
|
||||
|
||||
;
|
||||
; Write date as mm/dd/yy
|
||||
;
|
||||
pdate1 ReadTimeHex (@a,year,monday,@a)
|
||||
lda monday
|
||||
and #$FF00
|
||||
xba
|
||||
inc a
|
||||
jsr WriteNum
|
||||
pdate1 ReadTimeHex (@a,year,monday,@a)
|
||||
lda monday
|
||||
and #$FF00
|
||||
xba
|
||||
inc a
|
||||
jsr WriteNum
|
||||
lda #'/'
|
||||
jsr putchar
|
||||
lda monday
|
||||
and #$FF
|
||||
inc a
|
||||
jsr WriteNum
|
||||
lda monday
|
||||
and #$FF
|
||||
inc a
|
||||
jsr WriteNum
|
||||
lda #'/'
|
||||
jsr putchar
|
||||
lda year
|
||||
and #$FF00
|
||||
xba
|
||||
jsr WriteNum
|
||||
jmp promptloop
|
||||
lda year
|
||||
and #$FF00
|
||||
xba
|
||||
jsr WriteNum
|
||||
jmp promptloop
|
||||
|
||||
;
|
||||
; Write date as yy-mm-dd
|
||||
;
|
||||
pdate2 ReadTimeHex (@a,year,monday,@a)
|
||||
lda year
|
||||
and #$FF00
|
||||
xba
|
||||
jsr WriteNum
|
||||
pdate2 ReadTimeHex (@a,year,monday,@a)
|
||||
lda year
|
||||
and #$FF00
|
||||
xba
|
||||
jsr WriteNum
|
||||
lda #'-'
|
||||
jsr putchar
|
||||
lda monday
|
||||
and #$FF00
|
||||
xba
|
||||
inc a
|
||||
jsr WriteNum
|
||||
lda monday
|
||||
and #$FF00
|
||||
xba
|
||||
inc a
|
||||
jsr WriteNum
|
||||
lda #'-'
|
||||
jsr putchar
|
||||
lda monday
|
||||
and #$FF
|
||||
inc a
|
||||
jsr WriteNum
|
||||
jmp promptloop
|
||||
lda monday
|
||||
and #$FF
|
||||
inc a
|
||||
jsr WriteNum
|
||||
jmp promptloop
|
||||
|
||||
;
|
||||
; check for \ quote
|
||||
;
|
||||
quoteit lda [prompt]
|
||||
inc prompt
|
||||
and #$FF
|
||||
jeq done
|
||||
quoteit lda [prompt]
|
||||
incad prompt
|
||||
and #$FF
|
||||
jeq done
|
||||
cmp #'n'
|
||||
beq newline
|
||||
cmp #'r'
|
||||
|
@ -374,42 +402,44 @@ tab lda #9
|
|||
jmp _putchar
|
||||
backspace lda #8
|
||||
jmp _putchar
|
||||
;
|
||||
;
|
||||
; Write a number between 0 and 9,999
|
||||
;
|
||||
WriteNum cmp #10
|
||||
bcs write1
|
||||
adc #'0'
|
||||
WriteNum cmp #10
|
||||
bcs write1
|
||||
adc #'0'
|
||||
jmp putchar
|
||||
write1 cmp #100
|
||||
bcs write2
|
||||
Int2Dec (@a,#num+2,#2,#0)
|
||||
|
||||
write1 cmp #100
|
||||
bcs write2
|
||||
Int2Dec (@a,#num+2,#2,#0)
|
||||
ldx #^num+2
|
||||
lda #num+2
|
||||
jmp puts
|
||||
write2 cmp #1000
|
||||
bcs write3
|
||||
Int2Dec (@a,#num+1,#3,#0)
|
||||
|
||||
write2 cmp #1000
|
||||
bcs write3
|
||||
Int2Dec (@a,#num+1,#3,#0)
|
||||
ldx #^num+1
|
||||
lda #num+1
|
||||
jmp puts
|
||||
write3 Int2Dec (@a,#num,#4,#0)
|
||||
|
||||
write3 Int2Dec (@a,#num,#4,#0)
|
||||
ldx #^num
|
||||
lda #num
|
||||
jmp puts
|
||||
|
||||
GPParm dc i2'2'
|
||||
dc i2'0'
|
||||
GPpfx dc a4'0'
|
||||
promptparm dc a4'promptname'
|
||||
dc a4'promptbuf'
|
||||
promptname str 'prompt'
|
||||
dfltPrompt dc c'% ',h'00'
|
||||
num dc c'0000',h'00'
|
||||
promptbuf ds 256
|
||||
userparm dc a4'user'
|
||||
dc a4'buf2'
|
||||
user str 'user'
|
||||
buf2 ds 256
|
||||
|
||||
END
|
||||
; Name of alias to execute before prompt
|
||||
precmdstr dc c'precmd',h'00'
|
||||
|
||||
; Names of environment variables
|
||||
promptname gsstr 'prompt'
|
||||
username gsstr 'user'
|
||||
|
||||
; Default prompt
|
||||
dfltPrompt dc c'% ',h'00'
|
||||
|
||||
num dc c'0000',h'00'
|
||||
|
||||
END
|
||||
|
|
|
@ -6,51 +6,88 @@
|
|||
* Jawaid Bazyar
|
||||
* Tim Meekins
|
||||
*
|
||||
* $Id: shell.asm,v 1.11 1999/11/30 17:53:27 tribby Exp $
|
||||
*
|
||||
**************************************************************************
|
||||
*
|
||||
* SHELL.ASM
|
||||
* By Tim Meekins
|
||||
* Modified by Dave Tribby for GNO 2.0.6
|
||||
*
|
||||
* This is the main routines for the shell.
|
||||
*
|
||||
* Note: text set up for tabs at col 16, 22, 41, 49, 57, 65
|
||||
* | | | | | |
|
||||
* ^ ^ ^ ^ ^ ^
|
||||
**************************************************************************
|
||||
*
|
||||
* Interfaces defined in this file:
|
||||
*
|
||||
* shell subroutine (0:dummy)
|
||||
* NOTE: gnoloop is an entry defined in shell.
|
||||
*
|
||||
* AppendHome subroutine (4:str)
|
||||
* return 4:outPtr
|
||||
*
|
||||
* Dogshrc jsr with no parameters
|
||||
*
|
||||
* signal2 subroutine (4:fubar)
|
||||
*
|
||||
* signal18 subroutine (4:fubar)
|
||||
*
|
||||
* signal21 subroutine (4:fubar)
|
||||
*
|
||||
**************************************************************************
|
||||
|
||||
keep o/shell
|
||||
mcopy m/shell.mac
|
||||
mcopy /obj/gno/bin/gsh/shell.mac
|
||||
|
||||
dummyshell start ; ends up in .root
|
||||
end
|
||||
|
||||
setcom 60
|
||||
|
||||
SIGINT gequ 2
|
||||
SIGTSTP gequ 18
|
||||
SIGCHLD gequ 20
|
||||
SIGTTIN gequ 21
|
||||
|
||||
cmdbuflen gequ 1024
|
||||
cmdbuflen gequ 1024
|
||||
|
||||
case on
|
||||
shell start
|
||||
case off
|
||||
**************************************************************************
|
||||
*
|
||||
* shell: entry point for acting upon commands
|
||||
*
|
||||
**************************************************************************
|
||||
case on
|
||||
shell start
|
||||
case off
|
||||
|
||||
using global
|
||||
using global
|
||||
using pdata
|
||||
using HistoryData
|
||||
using termdata
|
||||
|
||||
p equ 0
|
||||
space equ p+4
|
||||
using termdata
|
||||
|
||||
p equ 0 General pointer
|
||||
cflag equ p+4 Flag: set when path converted
|
||||
space equ cflag+2
|
||||
|
||||
subroutine (0:dummy),space
|
||||
|
||||
tsc
|
||||
sta cmdcontext
|
||||
tdc
|
||||
sta cmddp
|
||||
tsc Save stack pointer
|
||||
sta cmdcontext in cmdcontext
|
||||
tdc and direct page reg
|
||||
sta cmddp in cmddp.
|
||||
|
||||
* PushVariables 0
|
||||
PushVariablesGS NullPB Save environment variables.
|
||||
|
||||
Open ttyopen
|
||||
bcc settty
|
||||
Open ttyopen Open tty,
|
||||
bcc settty checking for error.
|
||||
ErrWriteCString #ttyerr
|
||||
jmp quit
|
||||
|
||||
ttyerr dc c'gsh: Failed opening tty.',h'0d00'
|
||||
|
||||
|
||||
settty mv2 ttyref,gshtty
|
||||
tcnewpgrp gshtty
|
||||
settpgrp gshtty
|
||||
|
@ -59,124 +96,250 @@ settty mv2 ttyref,gshtty
|
|||
|
||||
jsr InitTerm
|
||||
|
||||
lda FastFlag
|
||||
bne fastskip1
|
||||
lda gshpid ; only print the copyright msg
|
||||
cmp #2 ; if not using login
|
||||
lda FastFlag If FastFlag is set,
|
||||
bne fastskip1 skip copyright message.
|
||||
lda gshpid Only print the copyright msg
|
||||
cmp #2 if not using login
|
||||
bne fastskip1
|
||||
ldx #^gnostr
|
||||
lda #gnostr
|
||||
jsr puts
|
||||
fastskip1 anop
|
||||
|
||||
;
|
||||
; Set up signal handlers
|
||||
;
|
||||
signal (#SIGINT,#signal2)
|
||||
signal (#SIGTSTP,#signal18)
|
||||
signal (#SIGCHLD,#pchild)
|
||||
signal (#SIGTTIN,#signal21)
|
||||
;
|
||||
; Set entry point for users calling system
|
||||
;
|
||||
setsystemvector #system
|
||||
|
||||
;
|
||||
; Initialize some stuff
|
||||
;
|
||||
lda FastFlag
|
||||
jsr initalias Set all AliasTable entries to 0.
|
||||
jsr InitDStack Zero out directory stack.
|
||||
jsr InitVars Set value of all env var flags.
|
||||
;
|
||||
; Check for login shell (argv[0] starts with '-')
|
||||
;
|
||||
mv4 ~COMMANDLINE,p Copy commandline addr to dir page.
|
||||
ldy #8 Skip over shell identifier
|
||||
lda [p],y to get first char of
|
||||
and #$FF command name.
|
||||
cmp #'-' If not '-',
|
||||
bne nologin_init skip over login initialization.
|
||||
|
||||
; Change ":" to " " in $PATH if it doesn't start with ":" or contain a " "
|
||||
|
||||
ph4 #pathname Get $PATH environment variable string
|
||||
jsl getenv
|
||||
sta p Save address of allocated buffer.
|
||||
stx p+2 in direct page variable
|
||||
ora p+2 If null,
|
||||
beq nopathconv no need to convert
|
||||
|
||||
stz cflag Initialize conversion flag = false.
|
||||
ldy #4 Index over GS/OS length fields.
|
||||
short m Use 8-bit mode.
|
||||
lda [p],y
|
||||
beq endpathconv If null string, or
|
||||
cmp #':' if first character is ':',
|
||||
beq endpathconv don't do the conversion.
|
||||
|
||||
bumpit iny
|
||||
lda [p],y
|
||||
beq endpathconv If at end of string, all done.
|
||||
cmp #' ' If $PATH contains a space,
|
||||
bne chkcolon
|
||||
stz cflag abort the conversion.
|
||||
bra endpathconv
|
||||
chkcolon cmp #':' If next character is ':',
|
||||
bne bumpit
|
||||
lda #' ' change it to ' ', and
|
||||
sta [p],y
|
||||
sta cflag set conversion flag = true.
|
||||
bra bumpit
|
||||
|
||||
endpathconv long m Back to 16-bit mode.
|
||||
lda cflag If there was no conversion,
|
||||
beq freepath skip the setting of $PATH.
|
||||
|
||||
clc Address of $PATH as a GS/OS
|
||||
lda p output string is 2 bytes
|
||||
adc #2 beyond the input string
|
||||
sta SetValue starting address.
|
||||
lda p+2
|
||||
adc #0
|
||||
sta SetValue+2
|
||||
SetGS SetPB Set $PATH to the converted value.
|
||||
|
||||
freepath ph4 p Free the $PATH C string.
|
||||
jsl nullfree
|
||||
|
||||
nopathconv anop
|
||||
|
||||
; Read and execute /etc/glogin
|
||||
ph4 #etcglogin path = "/etc/glogin"
|
||||
lda #0
|
||||
pha argc = 0
|
||||
pha argv = NULL
|
||||
pha
|
||||
lda #$8000
|
||||
pha jobflag = $8000
|
||||
jsl ShellExec
|
||||
|
||||
; Read and execute $HOME/glogin
|
||||
jsr Doglogin
|
||||
|
||||
;
|
||||
; Initialization that is not specific to login shells
|
||||
;
|
||||
nologin_init anop
|
||||
lda FastFlag If fast startup flag isn't set,
|
||||
bne fastskip2
|
||||
jsr InitHistory
|
||||
jsr ReadHistory ;Read in history from disk
|
||||
fastskip2 jsr initalias ;initialize alias
|
||||
jsr InitDStack ;initialize directory stack
|
||||
lda FastFlag
|
||||
bne fastskip3
|
||||
jsr DoLogin ;Read gshrc
|
||||
jsr InitHistory Init: historyFN->"$HOME/history",
|
||||
jsr ReadHistory read in history from disk,
|
||||
jsr Dogshrc and read $HOME/gshrc.
|
||||
jsr newline
|
||||
fastskip3 anop
|
||||
fastskip2 anop
|
||||
lda didReadTerm
|
||||
bne didit
|
||||
jsr readterm
|
||||
didit jsl hashpath ;hash $path
|
||||
didit anop
|
||||
jsr dispose_hash Remove old table (if set in
|
||||
jsl hashpath login files) and hash $PATH.
|
||||
ld2 1,done_init Set initialization done flag.
|
||||
|
||||
;
|
||||
; Check for command-line arguments -c and -e
|
||||
;
|
||||
lda CmdFlag
|
||||
beq cmdskip
|
||||
|
||||
;
|
||||
; The -c flag is set: execute remaining arguments as a command file and exit.
|
||||
;
|
||||
mv4 CmdArgV,p
|
||||
ldy #2
|
||||
lda [p],y
|
||||
pha
|
||||
lda [p]
|
||||
pha
|
||||
ph2 CmdArgc
|
||||
pei (p+2)
|
||||
ph2 CmdArgc argc
|
||||
pei (p+2) argv
|
||||
pei (p)
|
||||
pea 0
|
||||
pea 0 jobflag = 0
|
||||
jsl ShellExec
|
||||
jmp done1
|
||||
|
||||
cmdskip lda ExecFlag
|
||||
beq execskip
|
||||
|
||||
ph4 ExecCmd
|
||||
ph2 #0
|
||||
jsl Execute
|
||||
jmp done1
|
||||
;
|
||||
; The -e flag is set: execute remaining arguments as a command and exit.
|
||||
;
|
||||
ph4 ExecCmd cmdline
|
||||
ph2 #0 jobflag = 0
|
||||
jsl execute
|
||||
jmp done1
|
||||
|
||||
execskip anop
|
||||
;
|
||||
; Parameter block for shell SetGS calls (p 427 in ORCA/M manual)
|
||||
;
|
||||
SetPB dc i2'3' pCount
|
||||
dc i4'pathname' Name (pointer to GS/OS string)
|
||||
SetValue ds 4 Value (pointer to GS/OS string)
|
||||
dc i2'1' Export flag
|
||||
|
||||
pathname gsstr 'path' GS/OS string
|
||||
|
||||
|
||||
etcglogin dc c'/etc/glogin',h'00'
|
||||
|
||||
execskip anop
|
||||
|
||||
****************************************************************
|
||||
*
|
||||
* Main loop for reading and executing commands
|
||||
*
|
||||
****************************************************************
|
||||
|
||||
stz lastabort
|
||||
|
||||
gnoloop entry
|
||||
gnoloop entry
|
||||
|
||||
phk
|
||||
plb
|
||||
;
|
||||
; Set the fundamental registers.
|
||||
;
|
||||
phk Copy Program Bank register
|
||||
plb into Data Bank register.
|
||||
lda cmdcontext Set Stack Pointer and
|
||||
tcs Direct Page register
|
||||
lda cmddp to values saved when
|
||||
tcd entering shell.
|
||||
|
||||
lda cmdcontext ;dare you to make a mistake
|
||||
tcs
|
||||
lda cmddp
|
||||
tcd
|
||||
|
||||
jsl WritePrompt
|
||||
jsr GetCmdLine
|
||||
bcs done
|
||||
jsl WritePrompt Print prompt.
|
||||
jsr GetCmdLine Get response.
|
||||
bcs done
|
||||
jsr newline
|
||||
lda cmdlen
|
||||
beq gnoloop
|
||||
jsr cursoron
|
||||
|
||||
lda cmdlen Check for empty string.
|
||||
beq gnoloop
|
||||
jsr cursoron
|
||||
jsr newlineX
|
||||
jsr flush
|
||||
ph4 #cmdline
|
||||
ph2 #0
|
||||
jsl execute
|
||||
lda exitamundo
|
||||
|
||||
ph4 #cmdline execute(cmdline,0)
|
||||
ph2 #0 jobflag = 0
|
||||
jsl execute
|
||||
|
||||
lda exit_requested
|
||||
bne done1
|
||||
jsr newlineX
|
||||
jsr newlineX
|
||||
stz lastabort
|
||||
bra gnoloop
|
||||
bra gnoloop
|
||||
|
||||
;
|
||||
; shut down gsh
|
||||
;
|
||||
done jsr newline
|
||||
done jsr newline
|
||||
jsr newlineX
|
||||
done1 ora2 pjoblist,pjoblist+2,@a
|
||||
done1 ora2 pjoblist,pjoblist+2,@a
|
||||
beq done2
|
||||
lda lastabort
|
||||
lda lastabort
|
||||
bne donekiller
|
||||
inc lastabort
|
||||
stz exitamundo
|
||||
ldx #^stopstr
|
||||
lda #stopstr
|
||||
stz exit_requested
|
||||
ldx #^stopstr Print message:
|
||||
lda #stopstr "There are stopped jobs"
|
||||
jsr puts
|
||||
jsr newlineX
|
||||
bra gnoloop
|
||||
bra gnoloop Continue getting commands.
|
||||
|
||||
donekiller jsl jobkiller
|
||||
done2 lda FastFlag
|
||||
bne fastskip5
|
||||
jsr SaveHistory
|
||||
fastskip5 jsr dispose_hash
|
||||
jsl SaveHistory
|
||||
fastskip5 jsr dispose_hash
|
||||
|
||||
quit PopVariables 0
|
||||
Quit QuitParm
|
||||
QuitParm dc i'0'
|
||||
quit PopVariablesGS NullPB
|
||||
Quit QuitParm
|
||||
|
||||
gnostr dc h'0d',c'GNO/Shell 2.0.4',h'0d'
|
||||
dc c'Copyright 1991-1993, Procyon, Inc. & Tim Meekins. '
|
||||
dc c'ALL RIGHTS RESERVED',h'0d'
|
||||
dc h'0d00'
|
||||
QuitParm dc i'0'
|
||||
|
||||
; Null parameter block used for shell calls PushVariables
|
||||
; (ORCA/M manual p.420) and PopVariablesGS (p. 419)
|
||||
NullPB dc i2'0' pCount
|
||||
|
||||
gnostr dc h'0d',c'GNO/Shell 2.0.6',h'0d'
|
||||
dc c'Copyright 1991-1993, Procyon, Inc. & Tim Meekins. '
|
||||
dc c'ALL RIGHTS RESERVED',h'0d'
|
||||
dc h'0d00'
|
||||
stopstr dc c'gsh: There are stopped jobs.',h'0d00'
|
||||
|
||||
ttyopen dc i2'2'
|
||||
|
@ -188,142 +351,222 @@ exitstr dc c'000000',h'0d00'
|
|||
|
||||
lastabort ds 2
|
||||
|
||||
END
|
||||
END
|
||||
|
||||
;=========================================================================
|
||||
;
|
||||
; Interpret the login file (gshrc).
|
||||
; If $HOME is set, we presume the gshrc file is there. If not,
|
||||
; If $HOME is set, we presume the gshrc file is there. If not,
|
||||
; or if an error occurs getting the $HOME variable, we use
|
||||
; @:gshrc.
|
||||
;
|
||||
;=========================================================================
|
||||
|
||||
Dogshrc START
|
||||
|
||||
* Appends a C string to the value of the $HOME variable. If $HOME is
|
||||
* not set, then it appends the C string to the string '@/'. Returns
|
||||
* a pointer to a GC string. Call DisposeHome/AX to deallocate the
|
||||
* string.
|
||||
ph4 #gshrcName
|
||||
bra doit
|
||||
|
||||
; Alternate entry point: execute $HOME/glogin
|
||||
|
||||
Doglogin ENTRY
|
||||
ph4 #gloginName
|
||||
|
||||
doit jsl AppendHome
|
||||
phx Save pointer to GS/OS input
|
||||
pha string for later.
|
||||
|
||||
clc Adjust the pointer
|
||||
adc #2 to skip the length word
|
||||
bcc no_ovf so it's a C string.
|
||||
inx
|
||||
no_ovf phx
|
||||
pha
|
||||
|
||||
* ShellExec subroutine (4:path,2:argc,4:argv,2:jobflag)
|
||||
; (ptr to $HOME/gshrc is on stack)
|
||||
lda #0
|
||||
pha argc = 0
|
||||
pha argv = NULL
|
||||
pha
|
||||
lda #$8000
|
||||
pha jobflag = $8000
|
||||
jsl ShellExec
|
||||
|
||||
; Dispose $HOME/gshrc string
|
||||
pla Get address of
|
||||
plx GS/OS input string.
|
||||
sec Subtract two bytes to get
|
||||
sbc #2 addr of original output buffer.
|
||||
bcs no_undf
|
||||
dex
|
||||
no_undf phx
|
||||
pha
|
||||
jsl nullfree
|
||||
rts
|
||||
|
||||
gshrcName dc c'/gshrc',h'00'
|
||||
gloginName dc c'/glogin',h'00'
|
||||
|
||||
DisposeHome START
|
||||
dec a
|
||||
dec a
|
||||
jsl free256
|
||||
rtl
|
||||
END
|
||||
|
||||
|
||||
;=========================================================================
|
||||
;
|
||||
; Append a C string to the value of the $HOME variable. If $HOME is
|
||||
; not set, then it appends the C string to the string '@/'. Returns
|
||||
; a pointer to a GS/OS input string.
|
||||
;
|
||||
;=========================================================================
|
||||
|
||||
AppendHome START
|
||||
outPtr equ 0
|
||||
len equ 4
|
||||
subroutine (4:str),6
|
||||
|
||||
jsl alloc256
|
||||
stx outPtr1+2
|
||||
sta outPtr1
|
||||
stx outPtr+2
|
||||
sta outPtr
|
||||
outPtr equ 0 Pointer into allocated memory
|
||||
str_len equ outPtr+4 Length of string parameter
|
||||
buf_len equ str_len+2 Size of GS/OS buffer
|
||||
space equ buf_len+2
|
||||
|
||||
pei (str+2)
|
||||
pei (str)
|
||||
jsr cstrlen
|
||||
sta len
|
||||
subroutine (4:str),space
|
||||
|
||||
lda #256
|
||||
sta [outPtr]
|
||||
lock mutex
|
||||
;
|
||||
; Get the variable's length using ReadVariableGS
|
||||
;
|
||||
ld4 TempResultBuf,RVresult Use temporary result buf.
|
||||
ReadVariableGS ReadVar Get length.
|
||||
|
||||
GSOS $014B,rvbl ;ReadVariable
|
||||
bcs doAtSign
|
||||
;
|
||||
; Allocate memory for value string
|
||||
;
|
||||
pei (str+2) Get length of
|
||||
pei (str) string to be
|
||||
jsr cstrlen appended.
|
||||
sta str_len
|
||||
|
||||
ldy #2
|
||||
lda [outPtr],y
|
||||
beq doAtSign ; $HOME not defined?
|
||||
clc
|
||||
adc #4 ; turn into a cstring
|
||||
tay
|
||||
short m
|
||||
lda #0
|
||||
lda TempRBlen Get length of value.
|
||||
bne notnull If 0,
|
||||
inc a increment because "@" will be used.
|
||||
notnull inc2 a Add 4 bytes for result buf len words.
|
||||
inc2 a
|
||||
clc Add length of string parameter.
|
||||
adc str_len
|
||||
sta buf_len Save result buf length.
|
||||
inc a Add 1 more for terminating null byte.
|
||||
pea 0
|
||||
pha
|
||||
~NEW Request the memory.
|
||||
sta RVresult Store address in ReadVariable
|
||||
stx RVresult+2 parameter block and
|
||||
sta outPtr direct page pointer.
|
||||
stx outPtr+2
|
||||
ora outPtr+2 If address == NULL,
|
||||
beq exit return NULL to user.
|
||||
|
||||
lda buf_len Store result buffer length
|
||||
sta [outPtr] at beginning of buf.
|
||||
;
|
||||
; Read the full value into the allocated memory
|
||||
;
|
||||
ReadVariableGS ReadVar ReadVariable $HOME
|
||||
bcs doAtSign If error, use @/
|
||||
|
||||
ldy #2 Get length of
|
||||
lda [outPtr],y GS/OS string.
|
||||
beq doAtSign If $HOME not defined, use "@".
|
||||
clc
|
||||
adc #4 Turn into a c-string
|
||||
tay by storing a 0 byte
|
||||
short m after the last $HOME
|
||||
lda #0 character.
|
||||
sta [outPtr],y
|
||||
long m
|
||||
bra doAppend
|
||||
|
||||
;
|
||||
; $HOME is null string or not defined. Use @
|
||||
;
|
||||
doAtSign lda atSign
|
||||
ldy #4
|
||||
sta [outPtr],y
|
||||
lda #1
|
||||
ldy #2
|
||||
ldy #4
|
||||
sta [outPtr],y
|
||||
lda #1 Set GS/OS buffer
|
||||
ldy #2 string length word
|
||||
sta [outPtr],y to 1.
|
||||
|
||||
doAppend anop
|
||||
ldy #0
|
||||
doAppend anop
|
||||
ldy #4 Start index beyond length words.
|
||||
short m
|
||||
lp lda [outPtr],y
|
||||
beq noSep
|
||||
beq noSep
|
||||
cmp #':'
|
||||
beq foundSep
|
||||
cmp #'/'
|
||||
beq foundSep
|
||||
iny
|
||||
iny
|
||||
bra lp
|
||||
noSep lda #':'
|
||||
|
||||
foundSep sta [str]
|
||||
noSep lda #':' No separator found; use ":".
|
||||
|
||||
foundSep sta [str] Store sep at start of appended string.
|
||||
long m
|
||||
|
||||
pei (str+2)
|
||||
pei (str)
|
||||
pei (outPtr+2)
|
||||
ldx outPtr+2
|
||||
lda outPtr
|
||||
clc
|
||||
adc #4
|
||||
bcc pushptr
|
||||
inx
|
||||
pushptr phx
|
||||
pha
|
||||
case on
|
||||
jsl strcat
|
||||
case off
|
||||
|
||||
inc outPtr
|
||||
inc outPtr
|
||||
lda [outPtr]
|
||||
clc
|
||||
adc len
|
||||
sta [outPtr] ; adjust GS/OS string length
|
||||
clc Add 2 bytes to address of
|
||||
lda outPtr GS/OS output buffer to
|
||||
adc #2 get address of GS/OS
|
||||
bcc no_ovf input string.
|
||||
inc outPtr+2
|
||||
no_ovf sta outPtr
|
||||
|
||||
lda [outPtr] Adjust string length
|
||||
clc to include appended
|
||||
adc str_len string (parameter).
|
||||
sta [outPtr]
|
||||
;
|
||||
; NOTE: The returned value points to a GS/OS string, two bytes offset
|
||||
; from the allocated memory for a GS/OS result buffer. When the
|
||||
; memory is deallocated, the address must be adjusted back.
|
||||
;
|
||||
exit unlock mutex
|
||||
return 4:outPtr
|
||||
|
||||
atSign dc c'@',i1'0'
|
||||
rvbl dc i2'3'
|
||||
dc a4'in'
|
||||
outPtr1 dc a4'0'
|
||||
dc i2'0' ; value of 'Export' flag
|
||||
mutex key
|
||||
|
||||
in dosin 'HOME'
|
||||
atSign dc c'@',i1'0'
|
||||
|
||||
;
|
||||
; Parameter block for Shell call ReadVariable (p 423 in ORCA/M reference)
|
||||
;
|
||||
ReadVar anop
|
||||
dc i2'3' pCount
|
||||
dc a4'home' address of variable's name
|
||||
RVresult ds 4 GS/OS Output buffer ptr
|
||||
ds 2 export flag (returned)
|
||||
;
|
||||
; GS/OS result buffer for getting the full length of the HOME env var.
|
||||
;
|
||||
TempResultBuf dc i2'5' Only five bytes total.
|
||||
TempRBlen ds 2 Value's length returned here.
|
||||
ds 1 Only 1 byte for value.
|
||||
;
|
||||
; "HOME" as a GS/OS string
|
||||
;
|
||||
home gsstr 'HOME'
|
||||
|
||||
END
|
||||
|
||||
DoLogin START
|
||||
|
||||
ph4 #gshrcName
|
||||
jsl AppendHome
|
||||
phx ; saved pointer for later
|
||||
pha
|
||||
phx
|
||||
inc a
|
||||
inc a ; adjust to the C string
|
||||
pha
|
||||
|
||||
lda #0
|
||||
pha
|
||||
pha
|
||||
pha
|
||||
pea 0
|
||||
jsl shellexec
|
||||
|
||||
pla
|
||||
plx
|
||||
jsl DisposeHome
|
||||
rts
|
||||
|
||||
gshrcName dc c'/gshrc',h'00'
|
||||
|
||||
END
|
||||
|
||||
;=========================================================================
|
||||
;
|
||||
|
@ -331,25 +574,23 @@ gshrcName dc c'/gshrc',h'00'
|
|||
;
|
||||
;=========================================================================
|
||||
|
||||
global DATA
|
||||
global DATA
|
||||
|
||||
ID ds 2
|
||||
GSOSDP ds 2
|
||||
cmdloc ds 2
|
||||
cmdlen ds 2
|
||||
cmdline ds cmdbuflen
|
||||
buffer ds 256
|
||||
ID ds 2
|
||||
GSOSDP ds 2
|
||||
cmdloc ds 2
|
||||
cmdlen ds 2
|
||||
cmdline ds cmdbuflen
|
||||
wordlen ds 2
|
||||
wordpbuf ds 1
|
||||
wordbuf ds 256
|
||||
nummatch ds 2
|
||||
matchbuf ds 512*4
|
||||
cmdcontext ds 2
|
||||
cmdcontext ds 2
|
||||
cmddp ds 2
|
||||
gshtty ds 2
|
||||
gshpid ds 2
|
||||
exitamundo dc i'0' ;!=0 if exit
|
||||
gshpid ds 2
|
||||
exit_requested dc i'0' ;!=0 if exit
|
||||
signalled dc i'0'
|
||||
done_init dc i2'0' 0 until init is complete
|
||||
|
||||
FastFlag dc i'0'
|
||||
CmdFlag dc i'0'
|
||||
|
@ -358,7 +599,7 @@ CmdArgC ds 2
|
|||
ExecFlag dc i'0'
|
||||
ExecCmd ds 4
|
||||
|
||||
END
|
||||
END
|
||||
|
||||
;=========================================================================
|
||||
;
|
||||
|
@ -399,3 +640,31 @@ signal18 START
|
|||
msg dc c'^Z',h'0d0a00'
|
||||
|
||||
END
|
||||
|
||||
;=========================================================================
|
||||
;
|
||||
; SIGTTIN handler
|
||||
;
|
||||
;=========================================================================
|
||||
|
||||
;
|
||||
; Work-around for kernel problem: if background read error signal
|
||||
; is received, gsh will hang forever. Instead, quit.
|
||||
;
|
||||
|
||||
signal21 START
|
||||
|
||||
using global
|
||||
|
||||
subroutine (4:fubar),0
|
||||
|
||||
WriteCString #bg_msg Print message.
|
||||
|
||||
Quit QuitParm
|
||||
|
||||
QuitParm dc i'0'
|
||||
; return
|
||||
|
||||
bg_msg dc c'gsh: SIGTTIN received!!',h'0d0a00'
|
||||
|
||||
END
|
||||
|
|
File diff suppressed because it is too large
Load Diff
1225
bin/gsh/shellvar.asm
1225
bin/gsh/shellvar.asm
File diff suppressed because it is too large
Load Diff
|
@ -6,10 +6,13 @@
|
|||
* Jawaid Bazyar
|
||||
* Tim Meekins
|
||||
*
|
||||
* $Id: stdio.asm,v 1.6 1998/10/26 17:04:51 tribby Exp $
|
||||
*
|
||||
**************************************************************************
|
||||
*
|
||||
* STDIO.ASM
|
||||
* By Tim Meekins
|
||||
* Modified by Dave Tribby for GNO 2.0.6
|
||||
*
|
||||
* This is the custom stdio for the shell
|
||||
*
|
||||
|
@ -17,10 +20,17 @@
|
|||
* stderr buffer size: 256 bytes
|
||||
* stdin buffer size: 128 bytes
|
||||
*
|
||||
* Note: text set up for tabs at col 16, 22, 41, 49, 57, 65
|
||||
* | | | | | |
|
||||
* ^ ^ ^ ^ ^ ^
|
||||
**************************************************************************
|
||||
|
||||
keep o/stdio
|
||||
mcopy m/stdio.mac
|
||||
mcopy /obj/gno/bin/gsh/stdio.mac
|
||||
|
||||
dummystdio start ; ends up in .root
|
||||
end
|
||||
|
||||
setcom 60
|
||||
|
||||
**************************************************************************
|
||||
*
|
||||
|
@ -33,23 +43,24 @@ putchar START
|
|||
|
||||
using stdout
|
||||
|
||||
tay ;lock destroys Acc
|
||||
lock mutex
|
||||
tya
|
||||
and #$FF
|
||||
ldx index
|
||||
sta stream,x ;we're still in long mode, note extra
|
||||
inx ; length of stream by one :)
|
||||
cmp #13
|
||||
beq _flush
|
||||
cpx #512
|
||||
bcc done
|
||||
_flush stx index
|
||||
Write WriteParm
|
||||
ldx #0
|
||||
done stx index
|
||||
unlock mutex
|
||||
rts
|
||||
tay Note: lock destroys Acc
|
||||
lock mutex Wait for others to leave, and lock.
|
||||
tya
|
||||
and #$FF Isolate the single character.
|
||||
ldx index Get num of chars already in stream.
|
||||
sta stream,x Store this char + null byte.
|
||||
inx Bump length of stream by one.
|
||||
cmp #13 If character was newline,
|
||||
beq _flush go write the stream.
|
||||
cpx #512 If length < 512,
|
||||
bcc done all done.
|
||||
_flush stx index Save current length.
|
||||
Write WriteParm Write the stream.
|
||||
ldx #0 Set new length to 0.
|
||||
|
||||
done stx index Save stream length in global.
|
||||
unlock mutex Allow others through.
|
||||
rts Return to caller.
|
||||
|
||||
END
|
||||
|
||||
|
@ -64,101 +75,49 @@ puts START
|
|||
|
||||
using stdout
|
||||
|
||||
tay ;lock destroys Acc
|
||||
lock mutex
|
||||
sty getchar+1
|
||||
tay Note: lock destroys Acc
|
||||
lock mutex Wait for others to leave, and lock.
|
||||
sty getchar+1 Save low-order bytes of address.
|
||||
txa
|
||||
|
||||
short a
|
||||
sta getchar+3
|
||||
ora getchar+2
|
||||
ora getchar+1
|
||||
beq exit
|
||||
short a SWITCH TO SINGLE-BYTE MEMORY MODE.
|
||||
sta getchar+3 Store high-order byte of address.
|
||||
ora getchar+2 If string address
|
||||
ora getchar+1 is 00/0000,
|
||||
beq exit don't do the write.
|
||||
|
||||
ldy index
|
||||
ldx #0
|
||||
ldy index Get current number of chars in stream.
|
||||
ldx #0 Clear source string offset.
|
||||
|
||||
getchar lda >$FFFFFF,x
|
||||
beq done
|
||||
sta stream,y
|
||||
iny
|
||||
inx
|
||||
cmp #13
|
||||
beq _flush
|
||||
cpy #512
|
||||
bcc getchar
|
||||
getchar lda >$FFFFFF,x Get next character from string.
|
||||
beq done Done when we see a null byte.
|
||||
sta stream,y Store in output stream.
|
||||
iny Bump the stream and
|
||||
inx string pointers.
|
||||
cmp #13 If newline was encountered,
|
||||
beq _flush go write & flush the stream.
|
||||
cpy #512 If stream length < 512,
|
||||
bcc getchar continue copying characters.
|
||||
|
||||
_flush sty index
|
||||
phx
|
||||
long a
|
||||
Write WriteParm
|
||||
Flush flushparm
|
||||
short a
|
||||
plx
|
||||
ldy #0
|
||||
bra getchar
|
||||
_flush sty index Save length of stream.
|
||||
phx Hold source string offset on stack.
|
||||
long a SWITCH TO FULL-WORD MEMORY MODE.
|
||||
Write WriteParm Write the stream to stdout
|
||||
Flush flushparm and flush it.
|
||||
short a SWITCH TO SINGLE-BYTE MEMORY MODE.
|
||||
plx Restore source string offset to X-reg.
|
||||
ldy #0 Set stream length to 0.
|
||||
bra getchar Continue copying characters.
|
||||
|
||||
done sty index
|
||||
exit long a
|
||||
unlock mutex
|
||||
rts
|
||||
; Arrive here when null character is encountered.
|
||||
done sty index Save stream length in global.
|
||||
|
||||
END
|
||||
exit long a SWITCH TO FULL-WORD MEMORY MODE.
|
||||
unlock mutex Allow others through.
|
||||
rts Return to caller.
|
||||
|
||||
**************************************************************************
|
||||
*
|
||||
* putp - output a p string to standard out
|
||||
* On entry: A/X = pointer to string
|
||||
*
|
||||
**************************************************************************
|
||||
END
|
||||
|
||||
putp START
|
||||
|
||||
using stdout
|
||||
|
||||
tay ;lock destroys Acc
|
||||
lock mutex
|
||||
sty getchar+1
|
||||
sty cmpchar+1
|
||||
txa
|
||||
|
||||
short a
|
||||
sta getchar+3
|
||||
sta cmpchar+3
|
||||
|
||||
ldy index
|
||||
ldx #1
|
||||
bra next
|
||||
|
||||
getchar lda >$FFFFFF,x
|
||||
sta stream,y
|
||||
iny
|
||||
inx
|
||||
cmp #13
|
||||
beq _flush
|
||||
next txa
|
||||
cmpchar cmp >$FFFFFF
|
||||
beq check2
|
||||
bcs done
|
||||
check2 cpy #512
|
||||
bcc getchar
|
||||
|
||||
_flush sty index
|
||||
phx
|
||||
long a
|
||||
Write WriteParm
|
||||
Flush flushparm
|
||||
short a
|
||||
plx
|
||||
ldy #0
|
||||
bra next
|
||||
|
||||
done sty index
|
||||
long a
|
||||
unlock mutex
|
||||
rts
|
||||
|
||||
END
|
||||
|
||||
**************************************************************************
|
||||
*
|
||||
|
@ -170,12 +129,12 @@ flush START
|
|||
|
||||
using stdout
|
||||
|
||||
lock mutex
|
||||
lock mutex
|
||||
lda index
|
||||
beq skip
|
||||
Write WriteParm
|
||||
Write WriteParm
|
||||
Flush flushparm
|
||||
stz index
|
||||
stz index
|
||||
skip unlock mutex
|
||||
|
||||
rts
|
||||
|
@ -216,9 +175,9 @@ errputchar START
|
|||
|
||||
using stderr
|
||||
|
||||
tay ;lock destroys Acc
|
||||
tay ;lock destroys Acc
|
||||
lock errmutex
|
||||
tya
|
||||
tya
|
||||
and #$FF
|
||||
ldx errindex
|
||||
sta errstream,x
|
||||
|
@ -228,7 +187,7 @@ errputchar START
|
|||
cpx #256
|
||||
bcc done
|
||||
_flush stx errindex
|
||||
Write errWriteParm
|
||||
Write errWriteParm
|
||||
ldx #0
|
||||
done stx errindex
|
||||
unlock errmutex
|
||||
|
@ -247,16 +206,16 @@ errputs START
|
|||
|
||||
using stderr
|
||||
|
||||
tay ;lock destroys Acc
|
||||
tay ;lock destroys Acc
|
||||
lock errmutex
|
||||
sty getchar+1
|
||||
sty getchar+1
|
||||
txa
|
||||
|
||||
short a
|
||||
sta getchar+3
|
||||
|
||||
ldy errindex
|
||||
ldx #0
|
||||
ldx #0
|
||||
|
||||
getchar lda >$FFFFFF,x
|
||||
beq done
|
||||
|
@ -271,71 +230,18 @@ getchar lda >$FFFFFF,x
|
|||
_flush sty errindex
|
||||
phx
|
||||
long a
|
||||
Write errWriteParm
|
||||
Write errWriteParm
|
||||
short a
|
||||
plx
|
||||
ldy #0
|
||||
bra getchar
|
||||
bra getchar
|
||||
|
||||
done sty errindex
|
||||
long a
|
||||
unlock errmutex
|
||||
rts
|
||||
|
||||
END
|
||||
|
||||
**************************************************************************
|
||||
*
|
||||
* errputp - output a p string to standard error
|
||||
* On entry: A/X = pointer to string
|
||||
*
|
||||
**************************************************************************
|
||||
|
||||
errputp START
|
||||
|
||||
using stderr
|
||||
|
||||
tay ;lock destroys Acc
|
||||
lock errmutex
|
||||
sty getchar+1
|
||||
sty cmpchar+1
|
||||
txa
|
||||
|
||||
short a
|
||||
sta getchar+3
|
||||
sta cmpchar+3
|
||||
|
||||
ldy errindex
|
||||
ldx #1
|
||||
|
||||
getchar lda >$FFFFFF,x
|
||||
sta errstream,y
|
||||
iny
|
||||
inx
|
||||
cmp #13
|
||||
beq _flush
|
||||
next txa
|
||||
cmpchar cmp >$FFFFFF
|
||||
beq check2
|
||||
bcs done
|
||||
check2 cpy #256
|
||||
bcc getchar
|
||||
|
||||
_flush sty errindex
|
||||
phx
|
||||
long a
|
||||
Write errWriteParm
|
||||
short a
|
||||
plx
|
||||
ldy #0
|
||||
bra next
|
||||
|
||||
done sty errindex
|
||||
long a
|
||||
unlock errmutex
|
||||
rts
|
||||
|
||||
END
|
||||
END
|
||||
|
||||
**************************************************************************
|
||||
*
|
||||
|
@ -347,9 +253,9 @@ errflush START
|
|||
|
||||
using stderr
|
||||
|
||||
lock errmutex
|
||||
Write errWriteParm
|
||||
stz errindex
|
||||
lock errmutex
|
||||
Write errWriteParm
|
||||
stz errindex
|
||||
unlock errmutex
|
||||
|
||||
rts
|
||||
|
@ -394,8 +300,12 @@ getchar START
|
|||
|
||||
readloop Read inReadParm
|
||||
bcc okread
|
||||
ldy #-1 ;return EOF on ALL errors
|
||||
jmp done2
|
||||
ldy #-1 Return EOF if error code
|
||||
cmp #$4C is "EOF encountered".
|
||||
beq go_done2
|
||||
ora #$FF00 For all other errors,
|
||||
tay hi-byte is $FF, low-byte is error.
|
||||
go_done2 jmp done2
|
||||
|
||||
okread stz inindex
|
||||
lda insize
|
||||
|
|
246
bin/gsh/sv.asm
246
bin/gsh/sv.asm
|
@ -6,18 +6,45 @@
|
|||
* Jawaid Bazyar
|
||||
* Tim Meekins
|
||||
*
|
||||
* $Id: sv.asm,v 1.7 1998/12/31 18:29:14 tribby Exp $
|
||||
*
|
||||
**************************************************************************
|
||||
*
|
||||
* SV.ASM
|
||||
* By Tim Meekins
|
||||
* Modified by Dave Tribby for GNO 2.0.6
|
||||
*
|
||||
* String Vector routines.
|
||||
*
|
||||
* Note: text set up for tabs at col 16, 22, 41, 49, 57, 65
|
||||
* | | | | | |
|
||||
* ^ ^ ^ ^ ^ ^
|
||||
**************************************************************************
|
||||
*
|
||||
* Interfaces defined in this file:
|
||||
*
|
||||
* sv_alloc subroutine (2:size)
|
||||
* return 4:ptr
|
||||
*
|
||||
* sv_add subroutine (4:vect,4:string,2:allocflag)
|
||||
*
|
||||
* sv_dispose subroutine (4:vect)
|
||||
*
|
||||
* sv_colprint subroutine (4:sv)
|
||||
*
|
||||
* sv_sort subroutine (4:sv)
|
||||
*
|
||||
* _qsort subroutine (4:sv,2:left,2:right)
|
||||
*
|
||||
**************************************************************************
|
||||
|
||||
keep o/sv
|
||||
mcopy m/sv.mac
|
||||
|
||||
mcopy /obj/gno/bin/gsh/sv.mac
|
||||
|
||||
dummysv start ; ends up in .root
|
||||
end
|
||||
|
||||
setcom 60
|
||||
|
||||
**************************************************************************
|
||||
*
|
||||
* Allocate a string vector array
|
||||
|
@ -25,7 +52,7 @@
|
|||
**************************************************************************
|
||||
|
||||
sv_alloc START
|
||||
|
||||
|
||||
ptr equ 0
|
||||
space equ ptr+4
|
||||
|
||||
|
@ -34,33 +61,31 @@ space equ ptr+4
|
|||
lda size
|
||||
inc a ;for size and count
|
||||
inc a ;at least one null entry
|
||||
asl a
|
||||
asl a Multiply by 4 (bytes/entry).
|
||||
asl a
|
||||
pea 0
|
||||
pha
|
||||
jsl ~NEW
|
||||
sta ptr
|
||||
stx ptr+2
|
||||
~NEW Allocate the memory
|
||||
sta ptr and save address in
|
||||
stx ptr+2 direct page variable.
|
||||
|
||||
ldy #2
|
||||
lda size
|
||||
sta [ptr],y
|
||||
lda #0
|
||||
ldy #2 Store number of entries
|
||||
lda size as the value of the
|
||||
sta [ptr],y first entry's high byte
|
||||
lda #0 and zero as the low byte.
|
||||
sta [ptr]
|
||||
ldy #4
|
||||
|
||||
ldx size
|
||||
ldy #4 Set Y to index to 2nd entry.
|
||||
ldx size X = num of entries following.
|
||||
|
||||
init sta [ptr],y
|
||||
iny
|
||||
iny
|
||||
init sta [ptr],y Set all entries
|
||||
iny2 to 0x00000000.
|
||||
sta [ptr],y
|
||||
iny
|
||||
iny
|
||||
iny2
|
||||
dex
|
||||
bpl init ;not bne so that extra null at end
|
||||
|
||||
add4 ptr,#4,ptr
|
||||
add4 ptr,#4,ptr Set ptr to point at second entry.
|
||||
|
||||
return 4:ptr
|
||||
|
||||
|
@ -73,59 +98,61 @@ init sta [ptr],y
|
|||
**************************************************************************
|
||||
|
||||
sv_add START
|
||||
|
||||
|
||||
p equ 0
|
||||
base equ p+4
|
||||
space equ base+4
|
||||
|
||||
subroutine (4:vect,4:string,2:allocflag),space
|
||||
|
||||
sub4 vect,#4,base
|
||||
sub4 vect,#4,base base points to entry # 0.
|
||||
|
||||
ldy #2
|
||||
lda [base],y
|
||||
cmp [base]
|
||||
beq exit ;ack, the vector is full!
|
||||
lda [base],y If number of entries in table
|
||||
cmp [base] == number in use,
|
||||
beq exit the vector is full!
|
||||
;
|
||||
; 1 = allocate memory, 0 = use string as is...
|
||||
;
|
||||
lda allocflag
|
||||
lda allocflag If "allocate memory" flag is set,
|
||||
beq asis
|
||||
|
||||
pei (string+2)
|
||||
pei (string)
|
||||
pei (string+2) Determine length of
|
||||
pei (string) new string.
|
||||
jsr cstrlen
|
||||
inc a
|
||||
pea 0
|
||||
pha
|
||||
jsl ~NEW
|
||||
sta p
|
||||
~NEW Allocate memory for it.
|
||||
sta p Store address in p/p+1.
|
||||
stx p+2
|
||||
|
||||
pei (string+2)
|
||||
pei (string)
|
||||
pei (string+2) Copy the string into
|
||||
pei (string) the new memory.
|
||||
phx
|
||||
pha
|
||||
jsr copycstr
|
||||
bra doit
|
||||
bra doit else
|
||||
|
||||
asis mv4 string,p
|
||||
asis mv4 string,p Just copy address to p/p+1.
|
||||
|
||||
;
|
||||
; p contains address of string to be added to the vector.
|
||||
;
|
||||
doit lda [base]
|
||||
tax
|
||||
tax X = number of entries in use.
|
||||
asl a
|
||||
asl a
|
||||
tay
|
||||
lda p
|
||||
tay Y = offset to next avail entry.
|
||||
lda p Set entry to address of added string.
|
||||
sta [vect],y
|
||||
iny
|
||||
iny
|
||||
iny2
|
||||
lda p+2
|
||||
sta [vect],y
|
||||
|
||||
txa
|
||||
inc a
|
||||
sta [base]
|
||||
sta [base] Bump the number of entries in use.
|
||||
|
||||
exit return
|
||||
|
||||
|
@ -144,27 +171,27 @@ space equ p+4
|
|||
|
||||
subroutine (4:vect),space
|
||||
|
||||
sub4 vect,#4,p
|
||||
sub4 vect,#4,p p points to head of vector
|
||||
|
||||
loop lda [p]
|
||||
beq done
|
||||
lda [p] Get number of entries in use.
|
||||
beq done Done if zero.
|
||||
|
||||
loop asl a
|
||||
asl a
|
||||
asl a
|
||||
tay
|
||||
tay Y points to last used entry.
|
||||
lda [vect],y
|
||||
tax
|
||||
iny
|
||||
iny
|
||||
iny2
|
||||
lda [vect],y
|
||||
pha
|
||||
phx
|
||||
jsl nullfree
|
||||
jsl nullfree Free memory used by this entry.
|
||||
lda [p]
|
||||
dec a
|
||||
sta [p]
|
||||
bra loop
|
||||
sta [p] Number used = number used - 1.
|
||||
bne loop If more to do, stay in loop.
|
||||
|
||||
done pei (p+2)
|
||||
done pei (p+2) Free the vector itself.
|
||||
pei (p)
|
||||
jsl nullfree
|
||||
|
||||
|
@ -188,35 +215,32 @@ space equ maxlen+2
|
|||
|
||||
subroutine (4:sv),space
|
||||
|
||||
sub4 sv,#4,base
|
||||
sub4 sv,#4,base base = ptr to entry 0.
|
||||
;
|
||||
; Find the maximum string length
|
||||
;
|
||||
lda #1
|
||||
sta maxlen
|
||||
|
||||
ldy #0
|
||||
lda #0
|
||||
lda #0 Keep track of entry number in Acc.
|
||||
lenloop pha
|
||||
asl a
|
||||
asl a
|
||||
tay Y = offset to entry number.
|
||||
lda [sv],y
|
||||
tax
|
||||
iny
|
||||
iny
|
||||
iny2
|
||||
lda [sv],y
|
||||
iny
|
||||
iny
|
||||
phy
|
||||
pha
|
||||
phx
|
||||
jsr cstrlen
|
||||
cmp maxlen
|
||||
jsr cstrlen Get length of entry's string.
|
||||
cmp maxlen If > maxlen,
|
||||
bcc nextlen
|
||||
sta maxlen
|
||||
nextlen ply
|
||||
pla
|
||||
inc a
|
||||
cmp [base]
|
||||
bcc lenloop
|
||||
sta maxlen set maxlen to this length.
|
||||
nextlen pla
|
||||
inc a Bump entry number.
|
||||
cmp [base] If not done,
|
||||
bcc lenloop stay in loop.
|
||||
;
|
||||
; add one for a space
|
||||
;
|
||||
|
@ -226,19 +250,26 @@ nextlen ply
|
|||
; a divide..
|
||||
;
|
||||
ldx #0
|
||||
txa
|
||||
dex
|
||||
lda maxlen
|
||||
clc
|
||||
colloop inx
|
||||
adc maxlen
|
||||
cmp #80
|
||||
bcc colloop
|
||||
cpx #6+1
|
||||
bcc okcol
|
||||
ldx #6 ;limit of 6 columns
|
||||
|
||||
cpx #6+1 Make sure there
|
||||
bcc okcol are no more
|
||||
ldx #6 than 6 columns.
|
||||
okcol stx numcol
|
||||
lda [base]
|
||||
cmp numcol Ensure number of columns
|
||||
bcs okcol2 <= number of entries
|
||||
tax
|
||||
stx numcol
|
||||
okcol2 anop
|
||||
|
||||
;
|
||||
; recalculate the width
|
||||
; recalculate the width based upon columns/80
|
||||
;
|
||||
UDivide (#80,@x),(maxlen,@a)
|
||||
;
|
||||
|
@ -250,29 +281,30 @@ okcol stx numcol
|
|||
beq foocol
|
||||
inc numrow
|
||||
foocol anop
|
||||
|
||||
;
|
||||
; find the index for each column...
|
||||
;
|
||||
;
|
||||
lock offtblmutex
|
||||
lda #0
|
||||
tax
|
||||
clc
|
||||
mkidxloop sta offtbl,x
|
||||
inx
|
||||
inx2
|
||||
adc numrow
|
||||
cmp [base]
|
||||
bcc mkidxloop
|
||||
|
||||
stx numcol Double numcol since it's compared
|
||||
ldx #0 against X to end the loop.
|
||||
;
|
||||
; well....I think we can print now (yay!)
|
||||
; Ready to print...
|
||||
;
|
||||
ldx #0
|
||||
printloop lda offtbl,x
|
||||
and #$FF
|
||||
cmp [base]
|
||||
bcs nextprint0
|
||||
inc a
|
||||
short a
|
||||
sta offtbl,x
|
||||
long a
|
||||
phx
|
||||
dec a
|
||||
asl a
|
||||
|
@ -280,8 +312,7 @@ printloop lda offtbl,x
|
|||
tay
|
||||
lda [sv],y
|
||||
tax
|
||||
iny
|
||||
iny
|
||||
iny2
|
||||
lda [sv],y
|
||||
pha
|
||||
phx
|
||||
|
@ -298,7 +329,7 @@ tabit cmp maxlen
|
|||
inc a
|
||||
bra tabit
|
||||
nextprint plx
|
||||
inx
|
||||
inx2
|
||||
cpx numcol
|
||||
bcc printloop
|
||||
nextprint0 jsr newline
|
||||
|
@ -306,10 +337,16 @@ nextprint0 jsr newline
|
|||
dec numrow
|
||||
bne printloop
|
||||
|
||||
doneprint return
|
||||
unlock offtblmutex
|
||||
|
||||
offtbl ds 7
|
||||
return
|
||||
|
||||
;
|
||||
; Offset table: one entry for each column
|
||||
;
|
||||
offtbl ds 14
|
||||
|
||||
offtblmutex key
|
||||
END
|
||||
|
||||
**************************************************************************
|
||||
|
@ -337,6 +374,8 @@ space equ 0
|
|||
|
||||
END
|
||||
|
||||
**************************************************************************
|
||||
|
||||
_qsort PRIVATE
|
||||
|
||||
vleft equ 0
|
||||
|
@ -366,8 +405,7 @@ space equ idx1+2
|
|||
tay
|
||||
lda [sv],y
|
||||
sta ptr1
|
||||
iny
|
||||
iny
|
||||
iny2
|
||||
lda [sv],y
|
||||
sta ptr1+2
|
||||
add2 left,right,@a
|
||||
|
@ -379,8 +417,7 @@ space equ idx1+2
|
|||
sta ptr2
|
||||
lda ptr1
|
||||
sta [sv],y
|
||||
iny
|
||||
iny
|
||||
iny2
|
||||
lda [sv],y
|
||||
sta ptr2+2
|
||||
lda ptr1+2
|
||||
|
@ -388,8 +425,7 @@ space equ idx1+2
|
|||
ldy idx1
|
||||
lda ptr2
|
||||
sta [sv],y
|
||||
iny
|
||||
iny
|
||||
iny2
|
||||
lda ptr2+2
|
||||
sta [sv],y
|
||||
;
|
||||
|
@ -403,8 +439,7 @@ space equ idx1+2
|
|||
tay
|
||||
lda [sv],y
|
||||
sta vleft
|
||||
iny
|
||||
iny
|
||||
iny2
|
||||
lda [sv],y
|
||||
sta vleft+2
|
||||
;
|
||||
|
@ -426,8 +461,7 @@ okloop anop
|
|||
tay
|
||||
lda [sv],y
|
||||
tax
|
||||
iny
|
||||
iny
|
||||
iny2
|
||||
lda [sv],y
|
||||
pha
|
||||
phx
|
||||
|
@ -446,8 +480,7 @@ okloop anop
|
|||
tay
|
||||
lda [sv],y
|
||||
sta ptr1
|
||||
iny
|
||||
iny
|
||||
iny2
|
||||
lda [sv],y
|
||||
sta ptr1+2
|
||||
lda i
|
||||
|
@ -458,8 +491,7 @@ okloop anop
|
|||
sta ptr2
|
||||
lda ptr1
|
||||
sta [sv],y
|
||||
iny
|
||||
iny
|
||||
iny2
|
||||
lda [sv],y
|
||||
sta ptr2+2
|
||||
lda ptr1+2
|
||||
|
@ -467,8 +499,7 @@ okloop anop
|
|||
ldy idx1
|
||||
lda ptr2
|
||||
sta [sv],y
|
||||
iny
|
||||
iny
|
||||
iny2
|
||||
lda ptr2+2
|
||||
sta [sv],y
|
||||
|
||||
|
@ -476,7 +507,7 @@ nextloop inc i
|
|||
jmp forloop
|
||||
;
|
||||
; swap(v, left, last)
|
||||
;
|
||||
;
|
||||
endloop lda left
|
||||
asl a
|
||||
asl a
|
||||
|
@ -484,8 +515,7 @@ endloop lda left
|
|||
tay
|
||||
lda [sv],y
|
||||
sta ptr1
|
||||
iny
|
||||
iny
|
||||
iny2
|
||||
lda [sv],y
|
||||
sta ptr1+2
|
||||
lda last
|
||||
|
@ -496,8 +526,7 @@ endloop lda left
|
|||
sta ptr2
|
||||
lda ptr1
|
||||
sta [sv],y
|
||||
iny
|
||||
iny
|
||||
iny2
|
||||
lda [sv],y
|
||||
sta ptr2+2
|
||||
lda ptr1+2
|
||||
|
@ -505,8 +534,7 @@ endloop lda left
|
|||
ldy idx1
|
||||
lda ptr2
|
||||
sta [sv],y
|
||||
iny
|
||||
iny
|
||||
iny2
|
||||
lda ptr2+2
|
||||
sta [sv],y
|
||||
;
|
||||
|
@ -529,7 +557,7 @@ endloop lda left
|
|||
pha
|
||||
pei (right)
|
||||
jsl _qsort
|
||||
|
||||
|
||||
exit return
|
||||
|
||||
END
|
||||
|
|
190
bin/gsh/term.asm
190
bin/gsh/term.asm
|
@ -6,51 +6,90 @@
|
|||
* Jawaid Bazyar
|
||||
* Tim Meekins
|
||||
*
|
||||
* $Id: term.asm,v 1.8 1998/12/21 23:57:08 tribby Exp $
|
||||
*
|
||||
**************************************************************************
|
||||
*
|
||||
* TERM.ASM
|
||||
* By Tim Meekins
|
||||
* Modified by Dave Tribby for GNO 2.0.6
|
||||
*
|
||||
* Routines for dealing with Termcap under gsh.
|
||||
*
|
||||
* Note: text set up for tabs at col 16, 22, 41, 49, 57, 65
|
||||
* | | | | | |
|
||||
* ^ ^ ^ ^ ^ ^
|
||||
**************************************************************************
|
||||
|
||||
keep o/term
|
||||
mcopy m/term.mac
|
||||
mcopy /obj/gno/bin/gsh/term.mac
|
||||
|
||||
dummyterm start ; ends up in .root
|
||||
end
|
||||
|
||||
setcom 60
|
||||
|
||||
TIOCGETP gequ $40067408
|
||||
|
||||
**************************************************************************
|
||||
*
|
||||
* Initialize the system for termcap - checks to see if $TERM exists
|
||||
* and is set, if not, sets to GNOCON
|
||||
* and is set, if not, sets to GNOCON; and allocate termcap buffers.
|
||||
*
|
||||
**************************************************************************
|
||||
|
||||
InitTerm START
|
||||
|
||||
|
||||
using termdata
|
||||
|
||||
Set_Variable setparm
|
||||
Export expparm
|
||||
;
|
||||
; See if $TERM exists
|
||||
;
|
||||
ReadVariableGS ReadVarPB
|
||||
|
||||
lda term_len Get length of $TERM
|
||||
bne allocate If 0,
|
||||
SetGS SetPB set to default ("gnocon")
|
||||
|
||||
allocate anop Allocate termcap buffers.
|
||||
|
||||
ph4 #1024
|
||||
jsl ~NEW
|
||||
sta bp
|
||||
~NEW
|
||||
sta bp
|
||||
stx bp+2
|
||||
|
||||
ph4 #1024
|
||||
jsl ~NEW
|
||||
~NEW
|
||||
sta areabuf
|
||||
stx areabuf+2
|
||||
rts
|
||||
|
||||
setparm dc i4'termname' ;default term type
|
||||
dc i4'termval'
|
||||
rts Return to caller.
|
||||
|
||||
expparm dc i4'termname'
|
||||
dc i2'1'
|
||||
;
|
||||
; Parameter block for shell ReadVariableGS call (p 423 in ORCA/M manual)
|
||||
;
|
||||
ReadVarPB anop
|
||||
dc i2'3' pCount
|
||||
dc i4'term' Name (pointer to GS/OS string)
|
||||
dc i4'dummyresult' GS/OS Output buffer ptr
|
||||
ds 2 export flag
|
||||
;
|
||||
; GS/OS result buffer for getting length of TERM env var.
|
||||
;
|
||||
dummyresult dc i2'5' Only five bytes total.
|
||||
term_len ds 2 Value's length returned here.
|
||||
ds 1 Only 1 byte for value.
|
||||
|
||||
termname str 'term'
|
||||
termval str 'gnocon'
|
||||
;
|
||||
; Parameter block for shell SetGS calls (p 427 in ORCA/M manual)
|
||||
;
|
||||
SetPB anop
|
||||
dc i2'3' pCount
|
||||
dc i4'term' Name (pointer to GS/OS string)
|
||||
dc i4'gnocon' Value (pointer to GS/OS string)
|
||||
dc i2'1' Export flag
|
||||
|
||||
term gsstr 'term'
|
||||
gnocon gsstr 'gnocon'
|
||||
|
||||
END
|
||||
|
||||
|
@ -69,42 +108,52 @@ forward_char equ 4
|
|||
up_history equ 5
|
||||
down_history equ 6
|
||||
|
||||
lda #1
|
||||
lda #1
|
||||
sta didReadTerm
|
||||
|
||||
ph4 #termname
|
||||
jsl getenv
|
||||
phx
|
||||
pha
|
||||
phx Push allocated buffer on stack
|
||||
pha for later call to nullfree.
|
||||
clc Add 4 to GS/OS result buffer
|
||||
adc #4 to get pointer to text.
|
||||
bcc val_addr_set
|
||||
inx
|
||||
val_addr_set sta hold_term_val
|
||||
stx hold_term_val+2
|
||||
tgetent (bp,@xa) ;xa is pushed first
|
||||
beq noentry
|
||||
dec a
|
||||
beq ok
|
||||
|
||||
jsl nullfree
|
||||
jsl nullfree Free buffer allocated by getenv.
|
||||
stz termok
|
||||
ldx #^error1
|
||||
lda #error1
|
||||
jmp errputs
|
||||
|
||||
noentry jsl nullfree
|
||||
noentry anop
|
||||
stz termok
|
||||
ldx #^error2
|
||||
lda #error2
|
||||
jsr errputs
|
||||
ph4 #termname
|
||||
jsl getenv
|
||||
jsr errputs
|
||||
lda #error2 Print error message:
|
||||
jsr errputs 'Termcap entry not found for '
|
||||
lda hold_term_val Get text from buffer allocated
|
||||
ldx hold_term_val+2 by getenv
|
||||
jsr errputs and print it.
|
||||
jsl nullfree Free buffer allocated by getenv.
|
||||
lda #13
|
||||
jmp errputchar
|
||||
|
||||
ok jsl nullfree
|
||||
ok jsl nullfree Free buffer allocated by getenv.
|
||||
lda #1
|
||||
sta termok
|
||||
mv4 areabuf,area
|
||||
mv4 areabuf,area
|
||||
|
||||
;
|
||||
; Get addresses of termcap strings
|
||||
;
|
||||
tgetstr (#isid,#area)
|
||||
jsr puts
|
||||
jsr puts Send initialization string to term.
|
||||
tgetstr (#leid,#area)
|
||||
sta lecap
|
||||
stx lecap+2
|
||||
|
@ -141,24 +190,27 @@ ok jsl nullfree
|
|||
tgetstr (#usid,#area)
|
||||
sta uscap
|
||||
stx uscap+2
|
||||
|
||||
|
||||
;
|
||||
; Bind keyboard characters
|
||||
;
|
||||
tgetstr (#klid,#area)
|
||||
phx
|
||||
phx
|
||||
pha
|
||||
ph2 #backward_char
|
||||
jsl bindkeyfunc
|
||||
tgetstr (#krid,#area)
|
||||
phx
|
||||
phx
|
||||
pha
|
||||
ph2 #forward_char
|
||||
jsl bindkeyfunc
|
||||
tgetstr (#kuid,#area)
|
||||
phx
|
||||
phx
|
||||
pha
|
||||
ph2 #up_history
|
||||
jsl bindkeyfunc
|
||||
tgetstr (#kdid,#area)
|
||||
phx
|
||||
phx
|
||||
pha
|
||||
ph2 #down_history
|
||||
jsl bindkeyfunc
|
||||
|
@ -174,26 +226,30 @@ ok jsl nullfree
|
|||
|
||||
rts
|
||||
|
||||
termname dc c'term',h'00'
|
||||
termname gsstr 'term'
|
||||
error1 dc c'Error reading termcap file!',h'0d0d00'
|
||||
error2 dc c'Termcap entry not found for ',h'00'
|
||||
isid dc c'is',h'00'
|
||||
leid dc c'le',h'00'
|
||||
ndid dc c'nd',h'00'
|
||||
veid dc c've',h'00'
|
||||
viid dc c'vi',h'00'
|
||||
vsid dc c'vs',h'00'
|
||||
blid dc c'bl',h'00'
|
||||
clid dc c'cl',h'00'
|
||||
soid dc c'so',h'00'
|
||||
seid dc c'se',h'00'
|
||||
klid dc c'kl',h'00'
|
||||
krid dc c'kr',h'00'
|
||||
kuid dc c'ku',h'00'
|
||||
kdid dc c'kd',h'00'
|
||||
cdid dc c'cd',h'00'
|
||||
ueid dc c'ue',h'00'
|
||||
usid dc c'us',h'00'
|
||||
|
||||
;
|
||||
; Termcap identification strings
|
||||
;
|
||||
isid dc c'is',h'00' Initialization
|
||||
leid dc c'le',h'00' Out of keypad transmit mode
|
||||
ndid dc c'nd',h'00' Non-destructive space
|
||||
veid dc c've',h'00' Normal cursor visible
|
||||
viid dc c'vi',h'00' Cursor unvisible
|
||||
vsid dc c'vs',h'00' Standout cursor
|
||||
blid dc c'bl',h'00' Bell
|
||||
clid dc c'cl',h'00' Clear screen and home cursor
|
||||
soid dc c'so',h'00' Begin standout mode
|
||||
seid dc c'se',h'00' End standout mode
|
||||
cdid dc c'cd',h'00' Clear to end of display
|
||||
ueid dc c'ue',h'00' End underscore mode
|
||||
usid dc c'us',h'00' Begin underscore mode
|
||||
klid dc c'kl',h'00' Left arrow key
|
||||
krid dc c'kr',h'00' Right arrow key
|
||||
kuid dc c'ku',h'00' Up key
|
||||
kdid dc c'kd',h'00' Down key
|
||||
|
||||
sgtty anop
|
||||
dc i1'0'
|
||||
|
@ -201,8 +257,12 @@ sg_ospeed dc i1'0'
|
|||
dc i1'0'
|
||||
dc i1'0'
|
||||
sg_flags dc i2'0'
|
||||
|
||||
; Hold the address of the value of $TERM
|
||||
hold_term_val ds 4
|
||||
|
||||
END
|
||||
|
||||
|
||||
**************************************************************************
|
||||
*
|
||||
* outc for outputting characters by termcap
|
||||
|
@ -441,13 +501,27 @@ tset START
|
|||
|
||||
using global
|
||||
|
||||
space equ 0
|
||||
status equ 0
|
||||
space equ status+2
|
||||
|
||||
subroutine (4:argv,2:argc),space
|
||||
|
||||
jsr readterm
|
||||
stz status
|
||||
lda argc
|
||||
dec a
|
||||
beq doterm
|
||||
|
||||
return
|
||||
ldx #^Usage
|
||||
lda #Usage
|
||||
jsr errputs
|
||||
inc status Return status = 1.
|
||||
bra exit
|
||||
|
||||
doterm jsr readterm
|
||||
|
||||
exit return 2:status
|
||||
|
||||
usage dc c'Usage: tset',h'0d00'
|
||||
|
||||
END
|
||||
|
||||
|
@ -462,7 +536,7 @@ termdata DATA
|
|||
didReadTerm dc i2'0'
|
||||
|
||||
termok dc i2'0'
|
||||
insertflag dc i2'1'
|
||||
insertflag dc i2'1'
|
||||
|
||||
bp ds 4
|
||||
areabuf ds 4
|
||||
|
@ -482,4 +556,4 @@ vicap ds 4
|
|||
vscap ds 4
|
||||
|
||||
END
|
||||
|
||||
|
||||
|
|
40
bin/gsh/tests/Makefile
Normal file
40
bin/gsh/tests/Makefile
Normal file
|
@ -0,0 +1,40 @@
|
|||
#
|
||||
# This makefile is intended for use with dmake(1) on Apple IIGS
|
||||
# $Id: Makefile,v 1.1 1999/11/30 20:28:24 tribby Exp $
|
||||
#
|
||||
# Created by Dave Tribby (beginning June 1998)
|
||||
|
||||
# This makefile creates the simple test programs used for gsh testing.
|
||||
# These two programs are used directly by the dotests command script:
|
||||
# echoparams echo parameters passed from command line;
|
||||
# uses reparse.asm assembly language subroutine
|
||||
# callsystem call the system() library subroutine
|
||||
#
|
||||
# The remaining two programs can be run to verify the system
|
||||
# shellenv print information on the shell environment
|
||||
# testfork use fork/_execve/wait/kill the way gsh does
|
||||
|
||||
|
||||
# Make sure lint is turned on
|
||||
CFLAGS += -w
|
||||
|
||||
all: echoparams callsystem shellenv testfork
|
||||
|
||||
# echoparams has a helper subroutine named reparse.
|
||||
echoparams.o: echoparams.c
|
||||
|
||||
reparse.o: reparse.asm
|
||||
|
||||
echoparams: echoparams.c reparse.asm
|
||||
17/occ -o echoparams.o -i -w -a0 -c echoparams.c
|
||||
17/occ -o reparse.o -i -w -a0 -c reparse.asm
|
||||
17/occ -o echoparams echoparams.o reparse.o
|
||||
rm -f echoparams.root echoparams.o reparse.root reparse.o
|
||||
|
||||
clean:
|
||||
rm -f *.o
|
||||
rm -f *.root
|
||||
|
||||
clobber: clean
|
||||
rm -f echoparams callsystem shellenv testfork
|
||||
|
0
bin/gsh/tests/bi.out/alias.0.list
Normal file
0
bin/gsh/tests/bi.out/alias.0.list
Normal file
2
bin/gsh/tests/bi.out/alias.list
Normal file
2
bin/gsh/tests/bi.out/alias.list
Normal file
|
@ -0,0 +1,2 @@
|
|||
ls: ls -l
|
||||
mv: cp -p mv
|
6
bin/gsh/tests/bi.out/commands.list
Normal file
6
bin/gsh/tests/bi.out/commands.list
Normal file
|
@ -0,0 +1,6 @@
|
|||
alias commands fg prefix setdebug unhash
|
||||
bg dirs hash ps setenv unset
|
||||
bindkey echo history pushd source which
|
||||
cd edit jobs pwd stop
|
||||
chdir exit kill rehash tset
|
||||
clear export popd set unalias
|
4
bin/gsh/tests/bi.out/echo.list
Normal file
4
bin/gsh/tests/bi.out/echo.list
Normal file
|
@ -0,0 +1,4 @@
|
|||
- - - - - - - - - - E C H O T E S T S - - - - - - - - - -
|
||||
|
||||
Testing whether the echo command inserts an extra space:
|
||||
There should be no space between -><- the '->' and '<-'
|
2
bin/gsh/tests/bi.out/glob.list
Normal file
2
bin/gsh/tests/bi.out/glob.list
Normal file
|
@ -0,0 +1,2 @@
|
|||
callsystem.c dotests echoparams.c shellenv.c testfork.c
|
||||
|
25
bin/gsh/tests/bi.out/hash.list
Normal file
25
bin/gsh/tests/bi.out/hash.list
Normal file
|
@ -0,0 +1,25 @@
|
|||
apropos cp gsh.debug pwd testfork
|
||||
aroff cpp gsh.nodebug rcp testjobs
|
||||
asml ctags gsh.r releasemem testjobs2
|
||||
assemble cut gsh0 removerez time
|
||||
aw30 date head rlogin touch
|
||||
awk day help rm tr
|
||||
basename describe hostname rmdir true
|
||||
binprint df init rsh udl
|
||||
callsystem diff install script uname
|
||||
cat dirname kill sed uncompress
|
||||
catrez dmake last setvers uniq
|
||||
center dotests launch shellenv unshar
|
||||
chmod du less singletc uptime
|
||||
chtyp echo link sleep vi
|
||||
cksum echoparams logger smallbi wall
|
||||
cmdtest egrep ls split wc
|
||||
cmdtest4fr false lseg strings whatis
|
||||
cmdtestmul fgrep man stty whereis
|
||||
cmp fmt mkdir su who
|
||||
cmpl freeze more sum whois
|
||||
coff ftp nroff tail yankit
|
||||
colcrt fulltests.mul passwd tar yes
|
||||
compile getvers print10params tee
|
||||
compress grep ps test
|
||||
copycat gsh purge testedit
|
15
bin/gsh/tests/bi.out/keep.list
Normal file
15
bin/gsh/tests/bi.out/keep.list
Normal file
|
@ -0,0 +1,15 @@
|
|||
Command line: echoparams 'Parameter #1' "" p3 '' "Last param"
|
||||
parameter 0: 'echoparams'
|
||||
parameter 1: ''Parameter'
|
||||
parameter 2: '#1''
|
||||
parameter 3: ''
|
||||
parameter 4: 'p3'
|
||||
parameter 5: ''''
|
||||
parameter 6: 'Last param'
|
||||
Reparsing...
|
||||
parameter 0: 'echoparams'
|
||||
parameter 1: 'Parameter #1'
|
||||
parameter 2: ''
|
||||
parameter 3: 'p3'
|
||||
parameter 4: ''
|
||||
parameter 5: 'Last param'
|
11
bin/gsh/tests/bi.out/keep2.list
Normal file
11
bin/gsh/tests/bi.out/keep2.list
Normal file
|
@ -0,0 +1,11 @@
|
|||
Command line: echoparams '{ print "Hello, world" }' filename
|
||||
parameter 0: 'echoparams'
|
||||
parameter 1: ''{'
|
||||
parameter 2: 'print'
|
||||
parameter 3: 'Hello, world'
|
||||
parameter 4: '}''
|
||||
parameter 5: 'filename'
|
||||
Reparsing...
|
||||
parameter 0: 'echoparams'
|
||||
parameter 1: '{ print "Hello, world" }'
|
||||
parameter 2: 'filename'
|
1
bin/gsh/tests/bi.out/multi.list
Normal file
1
bin/gsh/tests/bi.out/multi.list
Normal file
|
@ -0,0 +1 @@
|
|||
Test variable has been set to 1
|
14
bin/gsh/tests/bi.out/null.list
Normal file
14
bin/gsh/tests/bi.out/null.list
Normal file
|
@ -0,0 +1,14 @@
|
|||
Command line: echoparams "Parameter #1" "" p3 "" "Last param"
|
||||
parameter 0: 'echoparams'
|
||||
parameter 1: 'Parameter #1'
|
||||
parameter 2: ''
|
||||
parameter 3: 'p3'
|
||||
parameter 4: ''
|
||||
parameter 5: 'Last param'
|
||||
Reparsing...
|
||||
parameter 0: 'echoparams'
|
||||
parameter 1: 'Parameter #1'
|
||||
parameter 2: ''
|
||||
parameter 3: 'p3'
|
||||
parameter 4: ''
|
||||
parameter 5: 'Last param'
|
2
bin/gsh/tests/bi.out/nullsys.list
Normal file
2
bin/gsh/tests/bi.out/nullsys.list
Normal file
|
@ -0,0 +1,2 @@
|
|||
Test of system() function
|
||||
`` returns value = 0
|
1
bin/gsh/tests/bi.out/pathtst.1.list
Normal file
1
bin/gsh/tests/bi.out/pathtst.1.list
Normal file
|
@ -0,0 +1 @@
|
|||
This is test command number 1
|
1
bin/gsh/tests/bi.out/pathtst.2.list
Normal file
1
bin/gsh/tests/bi.out/pathtst.2.list
Normal file
|
@ -0,0 +1 @@
|
|||
This is test command number 2
|
18
bin/gsh/tests/bi.out/prefix.list
Normal file
18
bin/gsh/tests/bi.out/prefix.list
Normal file
|
@ -0,0 +1,18 @@
|
|||
*: :H1:
|
||||
0: :src:gno:bin:gsh:tests:
|
||||
1: :obj:gno:bin:gsh:
|
||||
2: :lib:
|
||||
3: :tmp:
|
||||
4: :lang:orca:shell:
|
||||
5: :lang:orca:languages:
|
||||
6: :lang:orca:utilities:
|
||||
8: :home:cmd:
|
||||
9: :obj:gno:bin:gsh:
|
||||
10: .CONSOLE:
|
||||
11: .CONSOLE:
|
||||
12: .CONSOLE:
|
||||
13: :lib:
|
||||
14: :tmp:
|
||||
15: :lang:orca:shell:
|
||||
16: :lang:orca:languages:
|
||||
17: :lang:orca:utilities:
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user